Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

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.

share|improve this question

marked as duplicate by zeroth, Werner, Claudio Fiandrino, Marco Daniel, lockstep Mar 14 '13 at 19:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
See for example »Macro for formatting names (initials or full name)« –  cgnieder Mar 14 '13 at 18:18

1 Answer 1

up vote 3 down vote accepted

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}
share|improve this answer
    
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

Not the answer you're looking for? Browse other questions tagged or ask your own question.