2

I have read on

https://en.wikibooks.org/wiki/LaTeX/Fonts

that there is no variant of \scshape for upper case. Also there seem to be problems with upper case that are addressed by the textcase package. However, using its \MakeTextUppercase does not work for me since it garbles my cross references.

I must have missed something or why is it possible to get small caps out of the box but not upper case? This is quite incredible. (I know that one could create a new \nameref command to get around the problem but that isn't feasible for me.)

Here are two examples:

Works great with \scshape:

\documentclass{scrartcl}
\usepackage{hyperref}
\usepackage{textcase}
\setkomafont{section}{
\normalfont
\scshape
}

\begin{document}
  \section{Test \nameref{sec:test2}}
  \section{Test2}\label{sec:test2}
\end{document}

Doesn't work with \MakeTextUppercase:

\documentclass{scrartcl}
\usepackage{hyperref}
\usepackage{textcase}
\setkomafont{section}{
\normalfont
\MakeTextUppercase
}

\begin{document}
  \section{Test \nameref{sec:test2}}
  \section{Test2}\label{sec:test2}
\end{document}
Daniel
  • 1,787
  • 5
    \scshape uses a different font; there is no “all caps” font. – egreg Jun 10 '18 at 14:02
  • @egreg Thanks. But why can whatever font is used by \scshape not be used for all caps? It is a real bummer in LaTeX that such a simple functionality is so problematic. – Daniel Jun 10 '18 at 14:05
  • 3
    @Daniel an all caps font would a full size A in the slot for a a small caps font, as its name implies has a small A in the slot for a so to use the same mechanism would require a new font. But jou can use \section{Test \NoCaseChange\nameref{sec:test2}} or variants – David Carlisle Jun 10 '18 at 14:30
  • @DavidCarlisle Thanks. How do I use your example? It seems not to work in either of the examples I provided. – Daniel Jun 10 '18 at 16:09
  • @DavidCarlisle Might this be a misunderstanding? I want everything in the section in upper case. But your \NoCaseChange suggestion seems to suggest the opposite. – Daniel Jun 10 '18 at 17:54
  • It's a matter of timing you need to stop sec:tex2 uppercasing otherwise the reference doesn't resolve, but then you get Test2 so you need to uppercase the result of \nameref koma sectioning defeated me on that initially but I'll look later. – David Carlisle Jun 10 '18 at 18:03
  • 2
    You could create such an all caps font with a bit work, (with lualatex more easily than with pdflatex (https://tex.stackexchange.com/questions/370799/fill-a-lua-table-with-lowercase-uppercase-pairs)). It doesn't exist a lot already as there is not much use for an all caps font. I personally e.g. rather loath them, I do find titles in all caps in german quite difficult to read - I rely quite a lot of mix cases for fast reading. – Ulrike Fischer Jun 10 '18 at 19:16

0 Answers0