9

I wish to make the list of authors show up as centered, uppercase and listed vertically on my titlepage. My documentclass contains a section like this

\begin{center}
...
\renewcommand{\and}{\\}\MakeUppercase{\@author}
...
\end{center}

but this particular combination or linebreaks, MakeUppercase and centering causes an error; \@icentercr doesn't match its definition

A minimal example would be

\documentclass{article}
\newcommand{\mytext}{Foo \\ Bar}
\begin{document}
\begin{center}
 \MakeUppercase{\mytext}
\end{center}
\end{document}

2 Answers 2

6

The TeX command \uppercase works without error:

\uppercase{Foo \\ Bar}

Output is:

FOO

BAR

If the LaTeX command would work, I would prefer it over a TeX command, but as it doesn't work here we could go deeper to a TeX command. Perhaps you are interested in the textcase package, which also helps to overcome some case-changing problems.

Using textcase the line break can be protected;

\begin{center}
\renewcommand{\and}{\NoCaseChange{\\}}
\MakeTextUppercase{\@author}
\end{center}
3
  • 2
    I suppose i should have mentioned uppercase as well. For a fixed text it works fine, but it won't work for a text defined in a command, i.e. \uppercase{\@author} does nothing. Mar 17, 2011 at 15:35
  • I'm voting this up as the answer, but not because of \uppercase, but the textcase package. I will edit your answer to include the working code. Mar 17, 2011 at 15:47
  • @Miakael: Good that textcase helped. I just used \uppercase to fix the minimal example. ;-)
    – Stefan Kottwitz
    Mar 17, 2011 at 15:53
13

While Stefan Kottwitzs answer does correct the problem, it incorrectly diagnoses it. The issue isn't one with upper or lower case: it's that the definition of \\, normally robust, is redefined by the \centering macro to something fragile. Note that the following MWE works just fine:

\documentclass{article}
\newcommand{\mytext}{Foo \protect\\ Bar}
\begin{document}
\begin{center}
 \MakeUppercase{\mytext}
\end{center}
\end{document}

Presumably the TeX \uppercase macro doesn't require robust arguments, while \MakeUppercase does.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .