3

It has already been mentioned that it could be tricky to get uppercase letters in chapter for scrbook. However, the solution in Using \MakeUppercase in \@startsection works for scrreprt.

The solution used in tudscr adds a custom command to make the text uppercase, but then chapter has to be redefined.

\makeatletter
    \newcommand*\mymakeuppercase[1]{%
        \ifdin{\begingroup\MakeTextUppercase{#1}\endgroup}{#1}%
    }
\makeatother

Any other alternative, that would be applicable to all koma scripts?

MWE:

\documentclass[chapterprefix=on]{scrbook}

% Fix \MakeUppercase
\usepackage{makerobust}
\makeatletter
\MakeRobustCommand\@hangfrom
\newcommand*{\ModMakeUppercase}{%
    \MakeRobustCommand\@svsec
    \MakeUppercase
}
\makeatother

\addtokomafont{part}{\MakeUppercase}
\addtokomafont{chapter}{\MakeUppercase} % <- doesn't work
\addtokomafont{section}{\ModMakeUppercase}
\addtokomafont{subsection}{\ModMakeUppercase}


\begin{document}
\tableofcontents
\end{document}
2
  • Please provide an MWE which can be compiled. Mar 24, 2015 at 12:46
  • 1
    Could be a possible bug in 3.16 that will be fixed with the next release.
    – Johannes_B
    Mar 24, 2015 at 17:02

1 Answer 1

7

Update

Since KOMA-Script version 3.19 the recommended way is redefining \sectionlinesformat, \chapterlinesformat:

\documentclass[chapterprefix]{scrbook}[2015/10/03]

\makeatletter
\renewcommand\sectionlinesformat[4]{%
  \@hangfrom{\hskip #2#3}{\MakeUppercase{#4}}%
}
\renewcommand\chapterlinesformat[3]{%
  \@hangfrom{#2}{\MakeUppercase{#3}}%
}
\makeatother
\renewcommand\chapterlineswithprefixformat[3]{%
  \MakeUppercase{#2#3}%
}
\renewcommand{\sectioncatchphraseformat}[4]{%
  \hskip #2#3\MakeUppercase{#4}%
}

\usepackage{blindtext}
\begin{document}
\tableofcontents
\listoffigures
\chapter{Test}
\KOMAScriptVersion
\blinddocument
\end{document}

enter image description here


There is a problem in KOMA-Script Version 3.16 (and 3.15). As a workaround:

\documentclass[chapterprefix=on]{scrbook}

% Fix \MakeUppercase
\usepackage{makerobust}
\makeatletter
\MakeRobustCommand\@hangfrom
\newcommand*{\ModMakeUppercase}{%
    \MakeRobustCommand\@svsec
    \MakeUppercase
}
\makeatother

\addtokomafont{part}{\MakeUppercase}
\addtokomafont{chapter}{\MakeUppercase}
\addtokomafont{section}{\ModMakeUppercase}
\addtokomafont{subsection}{\ModMakeUppercase}

% workaround for version 3.15 and 3.16
\deftocheading{toc}{\chapter*{#1}}% <- added
\deftocheading{lof}{\chapter*{#1}}% <- added
\deftocheading{lot}{\chapter*{#1}}% <- added

\usepackage{blindtext}
\begin{document}
\tableofcontents
\listoffigures
\chapter{Test}
\KOMAScriptVersion
\blinddocument
\end{document}
3
  • As far as I know this problem will be fixed with the next release (3.17). Additionally \addtokomafont{section}{\MakeUppercase} and \addtokomafont{subsection}{\MakeUppercase} will also work.
    – esdd
    Mar 25, 2015 at 15:20
  • What if, in addition to the chapters, I require that the sections also appear in capital letters?
    – Aradnix
    Mar 9, 2018 at 9:00
  • @Aradnix You have to redefine \sectionlinesformat and maybe \secrioncatchphraseformat as shown in the first example. If this does not help then ask a new question with a MWE showing your issue.
    – esdd
    Mar 9, 2018 at 9:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .