[Tex/LaTex] HowTo make beamer’s \insertauthor all uppercase

beamercapitalizationexpansion

So I was finally able to create a MWE for this one:

I am creating my own beamer style which has some areas, where all text is supposed to be all caps. Using \MakeUppercase with the beamer class' macros \insertFOO is problematic for all FOOs, because of the order in which things are expanded … so they say.
There are several questions on this topic and the solutions all include constructs of the form

\expandafter\MakeUppercase\expandafter{all caps stuff}

This works a little bit for me.

\expandafter\MakeUppercase\expandafter{\insertdate \inserttitle}

works exactly how I want it, but

\expandafter\MakeUppercase\expandafter{\insertdate \inserttitle \insertauthor}

does not. A fairly minimal non working example is this:

\documentclass{beamer}

\defbeamertemplate*{title page}{myway}[1][]{%
        \expandafter\MakeUppercase\expandafter{%the expandafterblock
           \insertdate
           \inserttitle
           \insertauthor
        }
}

\title{Some Title}
\author{My Name}
\date{\today}

\begin{document}
\begin{frame}[plain]\titlepage\end{frame}
\end{document}

This code will fail with

\insertauthor ->\def \inst
                       {\beamer@insttitle }\def \and {\beamer@andtitle }...

It fails because \insertauthor is inside the expandafterblock. By removing \insertauthor or placing it outside the the expandafterblock, this code will compile.

It would seem \insertauthor behaves uniquely, compared to other beamer \insert macros. If I had to guess, I'd pinpoint the problem to the fact, that you can attribute authors to institutions (if present), by prefixing author names with \inst[<number>]. So the question is:

How can I wrap \insertauthor on the title page, such that the author's/s' name(s) are capitalized?

P.S.: All questions I was able to find on this problem were about titles only, or not specific to the beamer class. Since beamer's \insertauthor seems to be a special case, I am fairly certain this is not a duplicate.


Update/Ending

While I haven't been able to actually solve the problem, I found an aceptable way to work around it by replacing the \expandafter\MakeUppercase\expandafter construct with this:

\fontspec{Our Sans Serif Font}[Letters=UppercaseSmallCaps,Scale=1.1]\scshape

Not ideal, but acceptable. A true solution would follow along Ulrike's advice to create a font which also has/uses capital letters for small letters. While fontspec is quite powerful, it does not enable me to simply make *TeX use the uppercase letters for any input letter. IMO a good solution would teach this trick to fontspec.

Best Answer

If you just use \insertdate and \inserttitle, you don't need \expandafter, because \MakeUppercase does full (protected) expansion on its argument.

However, \inserttitle is quite different from the other two macros. Indeed, \insertdate expands to \today (in general to the argument given to \date) and, similarly, \inserttitle expands to the argument given to \title.

On the other hand, the expansion of \insertauthor is

\def\inst{\beamer@insttitle}\def\and{\beamer@andtitle}My Name

which is something \MakeUppercase will choke on.

We can patch the \author command or, rather, the internal command that's called, so it defines \insertauthor in a safer way. Note however that your template will definitely break if there is more than one author.

\documentclass{beamer}
\usepackage{etoolbox}

\makeatletter
\newrobustcmd{\titlepreliminaries}{%
  \def\inst{\beamer@insttitle}%
  \def\and{\beamer@andtitle}%
}
\patchcmd{\beamer@author}
  {\def\inst{\beamer@insttitle}\def\and{\beamer@andtitle}}
  {\titlepreliminaries}
  {}{}
\makeatother

\defbeamertemplate*{title page}{myway}[1][]{%
   \MakeUppercase{\insertdate}\\
   \MakeUppercase{\inserttitle}\\
   \MakeUppercase{\insertauthor}
}

\title{Some Title}
\author{My Name}
\date{\today}

\begin{document}
\begin{frame}[plain]\titlepage\end{frame}
\end{document}

enter image description here

A different patch, proposed by Gonzalo Medina, is

\makeatletter
\patchcmd{\beamer@author}
  {\def\and{\beamer@andtitle}#2}
  {\def\and{\beamer@andtitle}\MakeUppercase{#2}}
  {}{}
\makeatother
\defbeamertemplate*{title page}{myway}[1][]{%
  \MakeUppercase{\insertdate}\\
  \MakeUppercase{\inserttitle}\\
  \insert‌​author
}

This allows multiple authors, but has the downside that author names will be typeset in uppercase also in the other places they appear.