Numbered Index in Page Head
KOMA-Script is a bundle of versatile LaTeX classes and packages
Brought to you by:
kohm
With the value "index=numbered" within the document class "scrbook" I changed the chapter head in this example from "MyIndex" to "2 MyIndex". In the pagehead there is still "MyIndex" printed instead of "2 MyIndex". How can I fix this when using Koma Script unless the markboth command does not help here.
\documentclass[
10pt,
twoside,
toc=listofnumbered,
listof=flat,
headinclude,
footinclude,
index=numbered,
usegeometry
]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{makeidx}
\usepackage[headsepline]{scrlayer-scrpage}
\pagestyle{scrheadings}
\ohead{\headmark}
\automark[section]{chapter}
\setkomafont{pagehead}{\upshape\sffamily\small}
\addtokomafont{pagenumber}{\sffamily\small}
\addto\captionsngerman{
\def\indexname{MyIndex}%
}
\makeindex
\makeatother
\begin{document}
\chapter{MyFirstPage}
Foo \index{foo}
Moo \index{moo}
\printindex%\markboth{Huhu}{Huhu} %this does not work here
\end{document}
Seems indeed to be one more bug with the index. It is not limited to
scrbook
, but also occurs withscrreprt
andscrartcl
, if\pagestyle{headings}
is used.Thank you for reporting it.
Just a note: The example could be reduced a lot, because neither
scrlayer-scrpage
nor changing captions is needed to show the problem:Just a workaround would be:
BTW: You've one unwanted space in your redefinition
\captionsngerman
→ How to avoid unwanted spaces in the output or Wie unerwünschte Leerzeichen in der Ausgabe vermieden werden.Related
Wiki (Deutsch): HowTo_AvoidSpaces
Wiki (English): HowTo_AvoidSpaces
Last edit: Markus Kohm 2023-06-07
Issue has been fixed in [r4052].
For test files of several index option combinations see [r4053].
Related
Commit: [r4052]
Commit: [r4053]