2

Suppose we were using small caps (rather than, e.g., bold face) to format a sectioning level in our TOC, say, section.

Consequently, we would use the appropriate alternative spelling of the section titles, to make sure the TOC entries will appear in small-caps only (rather mixed with upper-case letters, which looks clumsy) -- as, so far, there's no such thing as an upper- or lower-case command that can be used functionally identically to (and in combination with) the text style commands we already have (there's no \lcshape\scshape).

\section[lorem ipsum]{Lorem Ipsum}

But how to proceed with things like the names of \listoffigures and the likes? What would be the most elegant way to patch them before they get written to the TOC file?

\documentclass[listof=totoc]{scrartcl}
\usepackage{tocstyle,blindtext}

\settocfeature[toc][1]{entryhook}{\normalfont\scshape}

\setkomafont{section}{\normalfont\itshape}

\begin{document}
\tableofcontents

\section[lorem ipsum]{Lorem Ipsum}
\blindtext

\begin{figure}
  \dots
  \caption{\dots}\label{fig1}
\end{figure}

\blindtext

\listoffigures

\end{document} 

enter image description here

Nils L
  • 9,716

2 Answers2

2

With \MakeLowercase you could automatically make your sections titles for the toc lowercase without manually specifying a short title.

\documentclass[listof=totoc]{scrartcl}
\usepackage{tocstyle,blindtext}

\settocfeature[toc][1]{entryhook}{\normalsize\scshape\MakeLowercase}

\setkomafont{section}{\normalfont\large\itshape}

\begin{document}
\tableofcontents

\section{Lorem Ipsum}
\blindtext

\begin{figure}
  \dots
  \caption{\dots}\label{fig1}
\end{figure}

\blindtext

\listoffigures

\end{document} 

enter image description here

Thanks to @DavidCarlisle for pointing out the advantages of \MakeLowercase compared to \lowercase!

0

Actually I wrote a little package for this use case: lccaps. It basically does what samcarter's answer does. (One minor difference is that it uses \MakeTextLowercase, thus being a little more robust, one could say.) The solution then looks a little more compact any case:

% arara: pdflatex
% arara: pdflatex
\documentclass[listof=totoc]{scrartcl}
  \setkomafont{section}{\normalfont\itshape}
\usepackage{lccaps}
\usepackage{tocstyle}
  \settocfeature[toc][1]{entryhook}{\textlcc}

\usepackage{blindtext}

\begin{document}
\tableofcontents

\section*{Lorem Ipsum}
\addcontentsline{toc}{section}{Lorem Ipsum}
\blindtext    
\listoffigures
\end{document}

output

Ruben
  • 13,448