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 know that \setkomafont is supposed to deal with switching fonts but sometimes instead of switching font, I'd like to switch to uppercase. I've not found a way to do this reliably. This breaks:

\documentclass{scrartcl}
\setkomafont{title}{\normalfont\uppercase}
\author{A. Author}
\title{The title}
\begin{document}
\maketitle
\end{document}

But this works:

\documentclass{scrartcl}
\setkomafont{section}{\normalfont\uppercase}
\author{A. Author}
\title{The title}
\begin{document}
\maketitle
\section{Something}
\end{document}

But this breaks:

\documentclass{scrartcl}
\setkomafont{disposition}{\normalfont\uppercase}
\author{A. Author}
\title{The title}
\begin{document}
\maketitle
\section{something}
\end{document}

Now, here's the one that's really weird:

\begin{filecontents}{\jobname.bib}
@Book{sen70,
  author =   {Amartya Sen},
  title =    {Collective choice and social welfare},
  publisher =    {Holden-Day},
  year =     1970}
\end{filecontents}
\documentclass{scrartcl}
\setkomafont{section}{\normalfont\uppercase}
\author{A. Author}
\title{The title}
\bibliographystyle{plain}
\begin{document}
\maketitle

\section{Something}
\cite{sen70}
\bibliography{\jobname}
\end{document}

Now, this kind of works in that the section heading is uppercased. But it doesn't work in that the "References" is set lowercase. But it is set in normalfont...

I know that \uppercase doesn't behave like a font switching command, but is there a robust way to do what I want?

I guess I could create a virtual font with the capitals in place of the lc letters, but there must be a better way...

share|improve this question
1  
Just in case you're using LuaTeX: you could try the approach I've written in tex.stackexchange.com/a/109476 –  topskip Apr 20 '13 at 6:07
add comment

2 Answers

up vote 5 down vote accepted

Imho there is no better way. A font is the best solution. Some of the problems with \uppercase & friends are described in the FAQ: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=casechange. In your example there are the additional problems that you don't know where in the code the upper case command is executed and you can have various arguments.

share|improve this answer
add comment

You can add a layer over \section and redefine \author:

\makeatletter
\def\author#1{\gdef\@author{\MakeUppercase{#1}}}
\let\scr@section\section
\def\section{\@ifstar\seamus@sections\seamus@section}
\def\seamus@sections#1{\scr@section*{\MakeUppercase{#1}}}
\def\seamus@section{\@dblarg{\seamus@section@}}
\def\seamus@section@[#1]#2{%
  \scr@section[\MakeUppercase{#1}]{\MakeUppercase{#2}}}
\makeatother

The method advertised by source2e.pdf of terminating the sixth parameter passed to \@startsection with \MakeUppercase doesn't work with scrartcl.

share|improve this answer
add comment

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.