[Tex/LaTex] Difference between \defbeamertemplate* and \setbeamertemplate

beamer

Can somebody explain what the difference between \defbeamertemplate* and \setbeamertemplate is?

Specifically:

\defbeamertemplate*{title page}{default}[1][]

This code is from the default beamer theme.

What I do not understand:

  1. What does the word default do? Sometimes it can be named something different.
  2. What does the 1 part mean?
  3. Why is \setbeamertemplate not used instead for everything?

Best Answer

From the user manual, page 169:

\setbeamertemplate {⟨element name⟩}[⟨predefined option⟩]⟨args⟩In the simplest case, if no ⟨predefined option⟩ is given, the ⟨args⟩ must be a single argument and the text of the template ⟨element name⟩ is setup to be this text. Upon later invocation of the template by the command \usebeamertemplate this text is used.

[...]

If you specify a ⟨predefined option⟩ , this command behaves slightly differently. In this case, someone has used the command \defbeamertemplate to predefine a template for you. By giving the name of this predefined template as the optional parameter ⟨predefined option⟩ , you cause the template ⟨element name⟩ to be set to this template.