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.

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

2 Answers 2

up vote 3 down vote accepted

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}
share|improve this answer
    
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. –  Mikael Öhman Mar 17 '11 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. –  Mikael Öhman Mar 17 '11 at 15:47
    
@Miakael: Good that textcase helped. I just used \uppercase to fix the minimal example. ;-) –  Stefan Kottwitz Mar 17 '11 at 15:53

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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