15

Is it possible to create beamer themes that take options? I have three themes that are essentially the same yet each beamertheme<name>.sty overrides certain aspects of the inner, outer and color themes.

I want to be able to do something like

\usetheme{mytheme}[default]

or

\usetheme{mytheme}[sidebar]

where some options of the theme change depending upon what you call. Is this possible? If so can someone point me to an example.

qubyte
  • 17,299
Robin
  • 151

2 Answers2

10

Thank you for the suggestion. I had looked once before and found nothing. More success this time though.

In my beamerthememytheme.sty I have to add the following lines at the beginning:

\newif\if@doMyOption
\@doMyOptionfalse
\DeclareOption{myoption}{\@doMyOptiontrue}
\ProcessOptions

In the same file I can then add the lines:

\if@doMyOption
Things to do if true
\else
Things to do if false
\fi

Then when I use the sty file I do

\usetheme[myoption]{mytheme}
frederik
  • 1,405
Robin
  • 101
5

The Beamer manual explains that some themes have options. You can look how these options are used inside the theme declaration file.

Just as an example, the rounded innertheme has an option shadow.

Alan Munn
  • 218,180
Ignasi
  • 136,588