4

I'm writing a beamer document, and using the following definition for author

\author[O. Castillo]{Oscar Castillo}

As far as I know, \@author returns the value Oscar Castillo

Question

Is there a command that return the value O. Castillo?

Cheers.

Dox
  • 5,729

1 Answers1

4

Since you are using beamer, you have \insertshortauthor and \insertauthor:

\documentclass{beamer}

\author[O. Castillo]{\'Oscar Castillo}

\begin{document}

\begin{frame}
\insertshortauthor
\insertauthor
\end{frame}

\end{document}

enter image description here

After a comment, it seems that the idea is to use this to generate some meta-data information for the PDF; in this case one could use \beamer@shortauthor:

\documentclass{beamer}
\title{The Title}
\author[O. Castillo]{\'Oscar Castillo}

\makeatletter
\hypersetup{pdfauthor={\beamer@shortauthor}}
\makeatother

\begin{document}

\begin{frame}
test
\end{frame}

\end{document}
Gonzalo Medina
  • 505,128
  • Thanks @gonzalo-medina, very nice! However, it seems that this commands cannot be used in the preamble, and these are not accepted for generating metadata. :-P – Dox Mar 14 '13 at 18:40
  • @Dox of course they can be used in the preamble: `\documentclass{beamer}

    \author[O. Castillo]{'Oscar Castillo}

    \setbeamertemplate{footline}{\insertshortauthor} \setbeamertemplate{headline}{\insertauthor}

    \begin{document}

    \begin{frame} test \end{frame}

    \end{document}`. If something is not working for you, you need to be more specific.

    – Gonzalo Medina Mar 14 '13 at 18:44
  • I tried it again (using the command \hypersetup{pdftitle={\@title},pdfauthor={\insertshortauthor}}), but I get no author in the matadata info. Could it be a bug? – Dox Mar 14 '13 at 18:50
  • 1
    @Dox -- What about using \beamer@shortauthor? Probably need to wrap it in the \makeatletter ... \makeatother.... – jon Mar 14 '13 at 19:06
  • 1
    @Dox jon is right in his comment, you can use \beamer@shortauthor, as in my updated answer. – Gonzalo Medina Mar 14 '13 at 19:15