0

This link describes how to make all capital commands which can handle newlines,
using the \uppercase command.

This link describes how to make all capital commands which can handle curly braces.

How would I perform both?

\documentclass{scrreprt}
\newcommand{\Title}  {Uppercase Instructions}
\newcommand{\Author} {Latex Newb}
\begin{document}
\begin{center}
\MakeUppercase{%
\Title\protect\\
Written By:\protect\\
\Author

\vspace*{\fill}

At:\protect\\
University of Colleges
}
\end{center}
\end{document}

Alright, per H Oberdiek,

\documentclass{scrreprt}
\newcommand{\Title}  {Uppercase Instructions}
\newcommand{\Author} {Latex Newb}
\begin{document}
\begin{center}
\uppercase{%
\MakeUppercase{\Title}\\
Written By:\\
\MakeUppercase{\Author}

\vspace*{\fill}

At:\\
University of Colleges
}
\end{center}
\end{document}

I believe using the \uppercase command throughout
while using the \MakeUppercase command around commands
will help a portion of people looking for added flexibility.

kando
  • 1,338

1 Answers1

2

I do not know, what you mean with braces. The primitive \uppercase only converts direct tokens and does not expand macros. Thus, the letters in \Title and \Author are hidden. The LaTeX macro \MakeUppercase expands the argument to expose the letters in macros. But here, it breaks on the fragile \\, which needs protection:

\documentclass{scrreprt}
\newcommand{\Title}  {Uppercase Instructions}
\newcommand{\Author} {Latex Newb}
\begin{document}
\begin{center}
\MakeUppercase{%
\Title\protect\\
Written By:\protect\\
\Author}
\end{center}
\end{document}

Result

LaTeX's \MakeUppercase does not work with "long" arguments containing empty lines or \par tokens. Instead of the empty lines \endgraf can be used:

\documentclass{scrreprt}
\newcommand{\Title}  {Uppercase Instructions}
\newcommand{\Author} {Latex Newb}
\begin{document}
\begin{center}
\MakeUppercase{%
\Title\protect\\
Written By:\protect\\
\Author
\endgraf
\vspace*{\fill}
\endgraf
At:\protect\\
University of Colleges}
\end{center}
\end{document}
Heiko Oberdiek
  • 271,626
  • Alright - is it possible to \renewcommand{\}{\protect\} within the bounds of the \MakeUppercase group? – kando Jun 24 '17 at 19:35
  • Also, what if I want to use newlines? – kando Jun 24 '17 at 19:37
  • MWE code updated to pursue this question. – kando Jun 24 '17 at 19:40
  • @kando \newline is robust. – Heiko Oberdiek Jun 24 '17 at 19:48
  • @kando Are you sure, you want to have such an ugly title page by converting all to upper case? AFAIK, this kind of emphasis comes from the time of mechanical typewriters with a limited set of font faces (usually just one). Nowadays, there are bold fonts, larger font sizes, ... – Heiko Oberdiek Jun 24 '17 at 19:52
  • (I agree with your assessment about caps; however, the template is school enforced.) – kando Jun 24 '17 at 20:06
  • Alright - answer posted below. What do you think of the hybrid approach? I can delete after - I just didn't know where to dump the code. – kando Jun 24 '17 at 20:07
  • @kando (You can edit your question.) I can't comment, because I do not know about the requirements of your school. – Heiko Oberdiek Jun 24 '17 at 20:10