I've been working through the detailed answer to this question: Design a custom Beamer theme from scratch and have a question regarding paths.

I'm building a theme to be used in multiple presentations. I have a directory structure (git repo) as follows:

|- Presentations (top-dir)
|\_.git (and subfolders)
|  |-presentation1.tex
|  \-presentation1.{aux,pdf} etc
|  |-presentation2.tex
|  \-presentation2.{aux,pdf} etc

I seem to have a few options to use this theme:

  • Symbolically link all 4 files into each presentation. Adds to setup cost, can complicate handling with git, but works nicely and doesn't require peculiar handling in the theme files

  • Abandon \usetheme{mytheme} and use \usepackage{../Theme/beamerthememytheme} in the presentationN.tex file. This also works for the main .tex file, but seems to require that my theme file now reads \usepackage{../Theme/beamerinnerthememytheme} instead of the simpler \useinnertheme{mytheme}

  • Remove extra files. Use only beamerthememytheme.sty and copy the contents of {inner,outer,color} themes into that file. I can also rename to make this simpler by removing the leading beamertheme label, since I have to use \usepackage anyway. This seems undesirable for readability/maintainability, but I suppose is a tradeoff if the alternatives are complicated.

Is there any way to specify from a .sty file the part that it is included with? In my case, I would imagine I could then go ahead and include <unknown-inclusion-relative-path>/beamerinnerthememytheme without concern that I might have presentations want to include this from outside of this directory structure (not a major problem, but would be nice to avoid limiting possibilities whilst I still have ability to easily change).

  • 2
    I would put the theme files (with a better name than "mytheme") in a folder themestexmf/tex/latex/mythemes/... and then add themestexmf as a new root to the tex system. Sep 4, 2019 at 9:29
  • You can define the TEXINPUTS environment variable: TEXINPUTS=".//;../Theme//;" Oct 5, 2019 at 7:35

1 Answer 1


Following the suggestion of Ulrike Fischer in the comments to the question, I ran the following command using the Windows Command Prompt.

initexmf --register-root="%cd%"

from the top-level directory, having moved the them file into the directory


and I can now successfully use \usetheme{themename}.

The command can be run from a .bat file or similar, making it easier to carry out in a newly cloned repository.

An equivalent Linux script might be something like (untested):

initexmf --register-root="$(pwd)"

I used the command prompt to avoid possible issues when my 'Linux' prompt is in fact via mingw and git-bash (which often causes path problems converting to/from Windows/Linux).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.