# What function does the asterisk have in beamer, '\setbeamercolor*{'?

I am working to create a style file in a separate file from the beamer .tex file. When configuring the title page with:

\setbeamertemplate{title page}{


or using:

\setbeamertemplate*{title page}{


I get different behaviors. It appears that when using the asterisk, the title and other frame title information in the .tex document get used, and without it, all the information is ignored. With the asterisk, if I include any object such as a colorbox, I get errors instead of the title material being put on top of it.

(In the end I would like to set the background color of the frame title slide only.)

• Did you try looking in the manual? People put a lot of effort into writing documentation, which is much less fun than writing the code to document. – cfr Feb 20 '17 at 1:29
• @cfr, I understand that there is probably something evident from the documentation, and for some reason when I search it (http://tug.ctan.org/macros/latex/contrib/beamer/doc/beameruserguide.pdf) for keywords like asterisk, nothing relevant is found. I read the pages 12, and 62 which are relevant, but if it is in the documentation and I can't find it, I am sorry, maybe you could point it out to me? – Vass Feb 20 '17 at 2:16
• If it were me, I'd search for \setbeamertemplate*. It might use the term starred. Almost certainly won't call it an asterisk. – cfr Feb 20 '17 at 4:07
• Search for \setbeamertemplate. Maybe you'll find something about the starred version in the description. – TeXnician Feb 20 '17 at 5:32
• cfr's point that the magic word is starred deserves to be reinforced, as does TeXcician's that searching for the base (unstarred) version of the command is usually helpful. – Chris H Feb 20 '17 at 8:55

I think that \setbeamertemplate* doesn't exist or, at least, is not documented. In beameruserguide we can find

which I understand is the official definition of \setbeamertemplate. As you can see, there is no optional *.

May be you confuse this command with \defbeamertemplate which is defined

and where an optional * can be found. Regarding this option, we can read (page 171) :

If instead of your question body, I look at question title, What function does the asterisk have in beamer, \setbeamercolor*{? I have to say that \setbeamercolor* and \setbeamerfont* commands are defined with both versions, starred and non starred. Corresponding definitions can be found in pages 185 and 196. The unstarred version of both command adds or replaces previous calls of corresponding template, while the starred versions resets all parameters from previous definitions before applying the current one.

There is no \setbeamertemplate* variant. The definition of \setbeamertemplate can be found in beamerbasetemplates.sty:

% beamerbasetemplates.sty, line 91:
\def\setbeamertemplate#1{%
\@ifnextchar[{\beamer@sbtchoose{#1}}{\beamer@sbtexec{#1}}}


which means that the command will take the next token or balanced braced group as first argument and then check for a following [. Let's list the definitions of the auxiliary macros \beamer@sbtexec and \beamer@sbtchoose.

% beamerbasetemplates.sty, line 93:
\long\def\beamer@sbtexec#1#2{%
\expandafter\long\expandafter\def\csname beamer@@tmpl@#1\endcsname{#2}%
\expandafter\ifx\csname beamer@@tmpgrp@#1\endcsname\relax%
\else%
\expandafter\expandafter\expandafter\def
\expandafter\expandafter\expandafter\beamer@sbt@group
\expandafter\expandafter\expandafter{\csname beamer@@tmpgrp@#1\endcsname}%
\@for\beamer@templ:=\beamer@sbt@group\do{\expandafter\setbeamertemplate\expandafter{\beamer@templ}{#2}}%
\fi%
}

% beamerbasetemplates.sty, line 103:
\long\def\beamer@sbtchoose#1[#2]{\def\beamer@@sbt@option{#2}%
\expandafter\ifx\csname beamer@@tmpop@#1@#2\endcsname\relax%
\expandafter\let\expandafter\beamer@@next\csname beamer@@tmpop@#1@*\endcsname%
\else%
\expandafter\let\expandafter\beamer@@next\csname beamer@@tmpop@#1@#2\endcsname%
\fi%
\beamer@@next%
}


Thus we see that the hypothetical call

\setbeamertemplate*{abc}{def}


would result in storing passing * to \beamer@sbtchoose as argument #1, abc as argument #2 and do nothing with def that would remain in the input stream (and probably cause errors).