3

In a typical beamer document I can set various options like \author or \title:

main.tex

\documentclass{beamer}

\author{George Orwell}
\title{Animal Farm}
\date{\today}
\institute[TUD]
%\def\talklocation{Berlin}

\usetheme{tudrobert}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\end{document}

which can then be used in the template definitions:

beamerthemetudrobert.tex

\mode<presentation>

\usepackage{graphicx}
\usepackage[absolute,overlay]{textpos}
\usepackage{calc}

\usepackage{fontspec}
\useinnertheme{tudrobert}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{blocks}[rounded][shadow=true]  

\mode<all>

And finally the theme where I want to use the command:

beamerinnerthemetudrobert.tex

\mode<presentation>

\defbeamertemplate*{title page}{tudrobert}{%

    \usebeamerfont*{title}
    \MakeUppercase{\inserttitle}\par
    \vfill
    {\scriptsize\insertauthor}
    \vfill
    \vfill
    %\talklocation, \insertdate

}

\mode<all>

The proposed use of

\def\talklocation{Berlin}

and

\talklocation

Throws the errors

enter image description here

The same applies for

\newcommand{\talklocation}{Berlin}

What is the appropriate way to add additional properties/strings to pass to the themes?

1 Answers1

3

As suggested by Jojo Boulix in the comments beamer options are the way to go.

The three files could then look like:

main.tex

\documentclass{beamer}

\author{George Orwell}
\title{Animal Farm}
\date{\today}
\institute[TUD]

\usetheme[location=Berlin]{tudrobert}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\end{document}

beamerthemetudrobert.tex

\mode<presentation>

\DeclareOptionBeamer{location}{\PassOptionsToPackage{location=#1}{beamerinnerthemetudrobert}}
\DeclareOptionBeamer{conference}{\PassOptionsToPackage{conference=#1}{beamerinnerthemetudrobert}}
\ProcessOptionsBeamer

\usepackage{graphicx}
\usepackage[absolute,overlay]{textpos}
\usepackage{calc}

\usepackage{fontspec}
\useinnertheme{tudrobert}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{blocks}[rounded][shadow=true]  

\mode<all>

beamerinnerthemetudrobert.tex

\mode<presentation>

\DeclareOptionBeamer{location}{\def\beamer@tudrobert@location{#1}}    
\DeclareOptionBeamer{conference}{\def\beamer@tudrobert@conference{#1}}    
\ProcessOptionsBeamer

\defbeamertemplate*{title page}{tudrobert}{%

    \usebeamerfont*{title}
    \MakeUppercase{\inserttitle}\par
    \vfill
    {\scriptsize\insertauthor}
    \vfill
    \vfill
    \beamer@tudrobert@location, \insertdate
    \beamer@tudrobert@conference

}

\mode<all>