How Can I Set a Full Path to a Beamer Theme

Let's say I want to specify the full path to a beamer theme. Let's say the theme is called "Nord". The three file names are beamercolorthemeNord.sty, beamerfontthemeNord.sty, and beamerthemeNord.sty. They are located in ~/Documents/Beamer/Themes/Nord or /home/amarakon/Documents/Themes/Nord. I want to use this theme in the YAML metadata:

output:
  beamer_presentation:
    theme: /home/amarakon/Documents/Beamer/Themes/Nord/beamerthemeNord

It gives me this error when compiling:

! LaTeX Error: File `beamertheme/home/amarakon/Documents/Beamer/Themes/Nord/beamerthemeNord.sty' not found.

The problem is that it expects the directory I gave it to be located in a directory called beamertheme, but it is not.

Setting a theme will beamer will use the \usetheme{} command on your TeX file. I am not sure that beamer allows you to use a custom path within this function. Can you ?

my understanding is that usually you need to put the custom theme locally to your presentation for the command to work, or maybe making it available somewhere globally so that \usetheme command finds it.

I suggest to look directly at beamer documentation to see what you can do

1 Like

I looked at the beamer documentation but it did not have a solution. My theme is available globally, but I want to make it available in a separate location for my R package so that users of the package will not have to install the theme themselves. I will ask about the \usetheme command on tex.stackexchange.com. Thank you.

With R Markdown, document templates can help with that. You can have your resource in your package and they would be copied locally when a user creates a new document in a template.

See R Markdown Document Templates or Chapter 17 Document Templates | R Markdown: The Definitive Guide

That would be the easiest way of sharing for R users I think.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.