1

I have a problem defining the headings in the index.
In the main text, part- and chapter-titles appear (alternating) in the headings. For the preamble (chapter "Vorwort"), I redefined this behavior for just the chapter titles appearing. This is realized by adding

\clearpairofpagestyles
\chead{\headmark}
\automark[chapter]{chapter}
\lehead*{\pagemark}
\rohead*{\pagemark}
\setkomafont{pagehead}{\footnotesize\upshape}

At the beginning of the "content" parts and chapters, this is set to:

\clearpairofpagestyles
\chead{\headmark}
\automark[chapter]{part}
\lehead*{\pagemark}
\rohead*{\pagemark}
\setkomafont{pagehead}{\footnotesize\upshape}

Works perfectly, except for the index. The index is located in the part "Anhang", so instead of appearing "Register" on every index page, there should be "Anhang" and "Register" alternating.
The first page of the index is configured by using

\newpairofpagestyles{IndexStyle}{%
\KOMAoptions{headsepline=false}
}
\renewcommand*{\indexpagestyle}{IndexStyle}

So I guess for the behavior I need to have, the indexpagestyle has to be edited in another/additional way, but I have no glue how to get that working...

MWE:

\documentclass[a4paper,fontsize=10pt,numbers=noenddot]{scrbook}
\usepackage[T1]{fontenc} 
\usepackage[latin1]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{times} 
\usepackage{blindtext}
\usepackage[papersize={210mm,297mm},text={113mm,180mm},inner=77mm,outer=20mm,top=34mm,bottom=83mm]{geometry}
\addtokomafont{disposition}{\rmfamily}
\KOMAoptions{toc=chapterentrydotfill} 
\KOMAoptions{headings=optiontohead}
\usepackage[indentunit=0.5em]{idxlayout}
\usepackage{makeidx}
\makeindex
\usepackage{acronym}
\renewcommand*{\aclabelfont}[1]{\textrm{\textrm{\acsfont{#1}}}}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}

\renewcommand*{\partpagestyle}{empty}
\renewcommand*{\chapterpagestyle}{empty}

\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\chead{\headmark}
\automark[chapter]{part}
\lehead*{\pagemark}
\rohead*{\pagemark}
\setkomafont{pagehead}{\footnotesize\upshape}

\newpairofpagestyles{IndexStyle}{%
\KOMAoptions{headsepline=false}
}
\renewcommand*{\indexpagestyle}{IndexStyle}

\begin{document}

\clearpairofpagestyles
\chead{\headmark}
\automark[chapter]{chapter}
\lehead*{\pagemark}
\rohead*{\pagemark}
\setkomafont{pagehead}{\footnotesize\upshape}

\addchap[tocentry={}]{Vorwort}
\blindtext
\newpage
\blindtext
\newpage
\blindtext
\newpage
\blindtext

\clearpairofpagestyles
\chead{\headmark}
\automark[chapter]{part}
\lehead*{\pagemark}
\rohead*{\pagemark}
\setkomafont{pagehead}{\footnotesize\upshape}

\renewcommand{\contentsname}{Inhalt}
\tableofcontents

\clearpairofpagestyles
\chead{\headmark}
\automark[chapter]{part}
\lehead*{\pagemark}
\rohead*{\pagemark}
\setkomafont{pagehead}{\footnotesize\upshape}

\part{Part I:lksdjklsdjfjkls...}
\chapter{first chapter}
\blindtext
\newpage
\blindtext
\newpage
\blindtext

\blindtext\index{Aaronsen, John} Other names to be indexed are Mike Arjonen\index{Arjonen, Mike} and Jim Azzz\index{Azzz, Jim}. For B, there are John Baily\index{Baily, John} and Jim Bronson\index{Bronson, Jim}a\index{Bronson, Jim2} b\index{Bronson, Jim3} c\index{Bronson, Jim4}n\index{Bronson, Jim5}k\index{Bronson, Jim6}b\index{Bronson, Jim7}n\index{Bronson, Jim8}b\index{Bronson, Jim9}b\index{Bronson, Jim10}.
\newpage
text Jim Bronson\index{Bronson, Jim11}a\index{Bronson, Jim12} b\index{Bronson, Jim13} c\index{Bronson, Jim14}n\index{Bronson, Jim15}k\index{Bronson, Jim16}b\index{Bronson, Jim17}n\index{Bronson, Jim18}b\index{Bronson, Jim19}b\index{Bronson, Jim20}
\newpage
text Jim Bronson\index{Bronson, Jim21}a\index{Bronson, Jim22} b\index{Bronson, Jim23} c\index{Bronson, Jim24}n\index{Bronson, Jim25}k\index{Bronson, Jim26}b\index{Bronson, Jim27}n\index{Bronson, Jim28}b\index{Bronson, Jim29}b\index{Bronson, Jim30}
\newpage
text Jim Bronson\index{Bronson, Jim31}a\index{Bronson, Jim32} b\index{Bronson, Jim33} c\index{Bronson, Jim34}n\index{Bronson, Jim13}k\index{Bronson, Jim36}b\index{Bronson, Jim37}n\index{Bronson, Jim38}b\index{Bronson, Jim39}b\index{Bronson, Jim40}
\newpage
text Jim Bronson\index{Bronson, Jim41}a\index{Bronson, Jim42} b\index{Bronson, Jim43} c\index{Bronson, Jim44}n\index{Bronson, Jim45}k\index{Bronson, Jim46}b\index{Bronson, Jim47}n\index{Bronson, Jim48}b\index{Bronson, Jim49}b\index{Bronson, Jim50}
\newpage
text Jim Bronson\index{Bronson, Jim51}a\index{Bronson, Jim52} b\index{Bronson, Jim53} c\index{Bronson, Jim54}n\index{Bronson, Jim55}k\index{Bronson, Jim56}b\index{Bronson, Jim57}n\index{Bronson, Jim58}b\index{Bronson, Jim59}b\index{Bronson, Jim60}
\newpage
text Jim Bronson\index{Bronson, Jim61}a\index{Bronson, Jim62} b\index{Bronson, Jim63} c\index{Bronson, Jim64}n\index{Bronson, Jim65}k\index{Bronson, Jim66}b\index{Bronson, Jim67}n\index{Bronson, Jim68}b\index{Bronson, Jim69}b\index{Bronson, Jim70}b\index{Cronson, Jim}b\index{Dronson, Jim}b\index{eronson, Jim}b\index{Fronson, Jim70}b\index{Gronson, Jim70}b\index{Hronson, Jim70}b\index{Ironson, Jim70}b\index{Jronson, Jim70}b\index{Kronson, Jim}\index{Lronson, Jim}\index{Mronson, Jim}\index{Nronson, Jim}\index{Oronson, Jim}\index{Pronson, Jim}\index{Qronson, Jim}\index{Rronson, Jim}\index{Sronson, Jim}\index{Tronson, Jim}\index{Uronson, Jim}\index{Vronson, Jim}\index{Wronson, Jim}\index{Xronson, Jim}\index{Yronson, Jim}\index{Zronson, Jim}\index{Zronson, Jim2}\index{Zronson, Jim3}\index{Zronson, Jim4}\index{Zronson, Jim5}\index{Zronson, Jim6}\index{Zronson, Jim7}\index{Zronson, Jim8}

\part{Anhang}
\renewcommand{\indexname}{Register}
\addcontentsline{toc}{chapter}{Register}
\printindex

\end{document}

register.ist:

% sty.file for mkidx32.exe - redefines:
quote '+'
%headings_flag 0
headings_flag 1
heading_prefix "{\\textbf "
heading_suffix "}\\nopagebreak%\n \\indexspace\\nopagebreak%"
delim_0 ": "
delim_1 ": "
delim_2 ": "
%delim_r "~--~"
delim_r "-"
%delim_0 "\\dotfill "
%delim_1 "\\dotfill "
%delim_2 "\\dotfill "
%delim_r "~--~"
suffix_2p "\\,f."
suffix_3p "\\,ff."
1

Do not set \chead and \ohead* in the document. I think that an additional pagestyle IndexStyle is not needed. Maybe you want

\renewcommand{\indexpagestyle}{empty}

to get the same pagestyle for the first index page as for part and chapter pages in your document.

For the index \@mkdouble{\MakeMarkcase{\indexname}} (KOMA-Script class) or \@mkboth{\MakeMarkcase{\indexname}}{\MakeMarkcase{\indexname}} (package idxlayout) is used. So for the index \leftmark and \rightmark are set to the \indexname if option automark is set. Note that \automark sets this option too.

To change this behaviour you can switch to manualmark (\manualmark or \KOMAoptions{manualmark}) before \printindex:

{
  \cleardoublepage
  \manualmark
  \markright{MakeMarkcase{\indexname}}%
  \printindex
}

For the TOC entry of the index KOMA-Script option index=totoc should be used.

Example without the unrelated packages and settings:

\documentclass[a4paper,fontsize=10pt,numbers=noenddot]{scrbook}
\usepackage[T1]{fontenc} 
\usepackage[latin1]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{newtxtext,newtxmath}% <- changed
\usepackage{blindtext}% only for dummy text
\usepackage[inner=77mm,outer=20mm,top=34mm,bottom=83mm]{geometry}
\addtokomafont{disposition}{\rmfamily}
\KOMAoptions{toc=chapterentrydotfill} 
\KOMAoptions{headings=optiontohead}

\renewcommand*{\partpagestyle}{empty}
\renewcommand*{\chapterpagestyle}{empty}
\renewcommand*{\indexpagestyle}{empty}

\usepackage{scrlayer-scrpage}
\automark[chapter]{part}
\clearpairofpagestyles
\chead{\headmark}
\ohead*{\pagemark}
\setkomafont{pagehead}{\footnotesize\upshape}

\KOMAoptions{index=totoc}% <- added: TOC entry for index
\usepackage[indentunit=0.5em]{idxlayout}
\usepackage{makeidx}
\makeindex

\renewcaptionname{ngerman}{\indexname}{Register}% <- added (changed and moved to preamble)
\renewcaptionname{ngerman}{\contentsname}{Inhalt}% <- added (changed and moved to preamble)


\begin{document}

{
  \automark[chapter]{chapter}
  \addchap[tocentry={}]{Vorwort}
  \Blindtext[25]
}

\tableofcontents

\part{First part}
\Blinddocument
\blindtext\index{Aaronsen, John} Other names to be indexed are Mike Arjonen\index{Arjonen, Mike} and Jim Azzz\index{Azzz, Jim}. For B, there are John Baily\index{Baily, John} and Jim Bronson\index{Bronson, Jim}a\index{Bronson, Jim2} b\index{Bronson, Jim3} c\index{Bronson, Jim4}n\index{Bronson, Jim5}k\index{Bronson, Jim6}b\index{Bronson, Jim7}n\index{Bronson, Jim8}b\index{Bronson, Jim9}b\index{Bronson, Jim10}.
\newpage
text Jim Bronson\index{Bronson, Jim11}a\index{Bronson, Jim12} b\index{Bronson, Jim13} c\index{Bronson, Jim14}n\index{Bronson, Jim15}k\index{Bronson, Jim16}b\index{Bronson, Jim17}n\index{Bronson, Jim18}b\index{Bronson, Jim19}b\index{Bronson, Jim20}
\newpage
text Jim Bronson\index{Bronson, Jim21}a\index{Bronson, Jim22} b\index{Bronson, Jim23} c\index{Bronson, Jim24}n\index{Bronson, Jim25}k\index{Bronson, Jim26}b\index{Bronson, Jim27}n\index{Bronson, Jim28}b\index{Bronson, Jim29}b\index{Bronson, Jim30}
\newpage
text Jim Bronson\index{Bronson, Jim31}a\index{Bronson, Jim32} b\index{Bronson, Jim33} c\index{Bronson, Jim34}n\index{Bronson, Jim13}k\index{Bronson, Jim36}b\index{Bronson, Jim37}n\index{Bronson, Jim38}b\index{Bronson, Jim39}b\index{Bronson, Jim40}
\newpage
text Jim Bronson\index{Bronson, Jim41}a\index{Bronson, Jim42} b\index{Bronson, Jim43} c\index{Bronson, Jim44}n\index{Bronson, Jim45}k\index{Bronson, Jim46}b\index{Bronson, Jim47}n\index{Bronson, Jim48}b\index{Bronson, Jim49}b\index{Bronson, Jim50}
\newpage
text Jim Bronson\index{Bronson, Jim51}a\index{Bronson, Jim52} b\index{Bronson, Jim53} c\index{Bronson, Jim54}n\index{Bronson, Jim55}k\index{Bronson, Jim56}b\index{Bronson, Jim57}n\index{Bronson, Jim58}b\index{Bronson, Jim59}b\index{Bronson, Jim60}
\newpage
text Jim Bronson\index{Bronson, Jim61}a\index{Bronson, Jim62} b\index{Bronson, Jim63} c\index{Bronson, Jim64}n\index{Bronson, Jim65}k\index{Bronson, Jim66}b\index{Bronson, Jim67}n\index{Bronson, Jim68}b\index{Bronson, Jim69}b\index{Bronson, Jim70}b\index{Cronson, Jim}b\index{Dronson, Jim}b\index{eronson, Jim}b\index{Fronson, Jim70}b\index{Gronson, Jim70}b\index{Hronson, Jim70}b\index{Ironson, Jim70}b\index{Jronson, Jim70}b\index{Kronson, Jim}\index{Lronson, Jim}\index{Mronson, Jim}\index{Nronson, Jim}\index{Oronson, Jim}\index{Pronson, Jim}\index{Qronson, Jim}\index{Rronson, Jim}\index{Sronson, Jim}\index{Tronson, Jim}\index{Uronson, Jim}\index{Vronson, Jim}\index{Wronson, Jim}\index{Xronson, Jim}\index{Yronson, Jim}\index{Zronson, Jim}\index{Zronson, Jim2}\index{Zronson, Jim3}\index{Zronson, Jim4}\index{Zronson, Jim5}\index{Zronson, Jim6}\index{Zronson, Jim7}\index{Zronson, Jim8}


\part{Anhang}
{
  \cleardoublepage
  \manualmark
  \markright{\indexname}%
  \printindex
}

\Blinddocument
\end{document}

enter image description here

Or you can patch \printindex:

\documentclass[a4paper,fontsize=10pt,numbers=noenddot]{scrbook}
\usepackage[T1]{fontenc} 
\usepackage[latin1]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{newtxtext,newtxmath}% <- changed
\usepackage{blindtext}% only for dummy text
\usepackage[inner=77mm,outer=20mm,top=34mm,bottom=83mm]{geometry}
\addtokomafont{disposition}{\rmfamily}
\KOMAoptions{toc=chapterentrydotfill} 
\KOMAoptions{headings=optiontohead}

\renewcommand*{\partpagestyle}{empty}
\renewcommand*{\chapterpagestyle}{empty}
\renewcommand*{\indexpagestyle}{empty}

\usepackage{scrlayer-scrpage}
\automark[chapter]{part}
\clearpairofpagestyles
\chead{\headmark}
\ohead*{\pagemark}
\setkomafont{pagehead}{\footnotesize\upshape}

\KOMAoptions{index=totoc}% <- added: TOC entry for index
\usepackage[indentunit=0.5em]{idxlayout}
\usepackage{makeidx}
\makeindex
% patch for \printindex:
\usepackage{xpatch}
\xpretocmd\printindex{\cleardoubleoddpage\manualmark\markright{\MakeMarkcase{\indexname}}}
  {}{\piIPatchFaled}
\xapptocmd\printindex{\automark[chapter]{part}}
  {}{\piIIPatchFailed}

\renewcaptionname{ngerman}{\indexname}{Register}% <- added (changed and moved to preamble)
\renewcaptionname{ngerman}{\contentsname}{Inhalt}% <- added (changed and moved to preamble)


\begin{document}

{
  \automark[chapter]{chapter}
  \addchap[tocentry={}]{Vorwort}
  \Blindtext[25]
}

\tableofcontents

\part{First part}
\Blinddocument
\blindtext\index{Aaronsen, John} Other names to be indexed are Mike Arjonen\index{Arjonen, Mike} and Jim Azzz\index{Azzz, Jim}. For B, there are John Baily\index{Baily, John} and Jim Bronson\index{Bronson, Jim}a\index{Bronson, Jim2} b\index{Bronson, Jim3} c\index{Bronson, Jim4}n\index{Bronson, Jim5}k\index{Bronson, Jim6}b\index{Bronson, Jim7}n\index{Bronson, Jim8}b\index{Bronson, Jim9}b\index{Bronson, Jim10}.
\newpage
text Jim Bronson\index{Bronson, Jim11}a\index{Bronson, Jim12} b\index{Bronson, Jim13} c\index{Bronson, Jim14}n\index{Bronson, Jim15}k\index{Bronson, Jim16}b\index{Bronson, Jim17}n\index{Bronson, Jim18}b\index{Bronson, Jim19}b\index{Bronson, Jim20}
\newpage
text Jim Bronson\index{Bronson, Jim21}a\index{Bronson, Jim22} b\index{Bronson, Jim23} c\index{Bronson, Jim24}n\index{Bronson, Jim25}k\index{Bronson, Jim26}b\index{Bronson, Jim27}n\index{Bronson, Jim28}b\index{Bronson, Jim29}b\index{Bronson, Jim30}
\newpage
text Jim Bronson\index{Bronson, Jim31}a\index{Bronson, Jim32} b\index{Bronson, Jim33} c\index{Bronson, Jim34}n\index{Bronson, Jim13}k\index{Bronson, Jim36}b\index{Bronson, Jim37}n\index{Bronson, Jim38}b\index{Bronson, Jim39}b\index{Bronson, Jim40}
\newpage
text Jim Bronson\index{Bronson, Jim41}a\index{Bronson, Jim42} b\index{Bronson, Jim43} c\index{Bronson, Jim44}n\index{Bronson, Jim45}k\index{Bronson, Jim46}b\index{Bronson, Jim47}n\index{Bronson, Jim48}b\index{Bronson, Jim49}b\index{Bronson, Jim50}
\newpage
text Jim Bronson\index{Bronson, Jim51}a\index{Bronson, Jim52} b\index{Bronson, Jim53} c\index{Bronson, Jim54}n\index{Bronson, Jim55}k\index{Bronson, Jim56}b\index{Bronson, Jim57}n\index{Bronson, Jim58}b\index{Bronson, Jim59}b\index{Bronson, Jim60}
\newpage
text Jim Bronson\index{Bronson, Jim61}a\index{Bronson, Jim62} b\index{Bronson, Jim63} c\index{Bronson, Jim64}n\index{Bronson, Jim65}k\index{Bronson, Jim66}b\index{Bronson, Jim67}n\index{Bronson, Jim68}b\index{Bronson, Jim69}b\index{Bronson, Jim70}b\index{Cronson, Jim}b\index{Dronson, Jim}b\index{eronson, Jim}b\index{Fronson, Jim70}b\index{Gronson, Jim70}b\index{Hronson, Jim70}b\index{Ironson, Jim70}b\index{Jronson, Jim70}b\index{Kronson, Jim}\index{Lronson, Jim}\index{Mronson, Jim}\index{Nronson, Jim}\index{Oronson, Jim}\index{Pronson, Jim}\index{Qronson, Jim}\index{Rronson, Jim}\index{Sronson, Jim}\index{Tronson, Jim}\index{Uronson, Jim}\index{Vronson, Jim}\index{Wronson, Jim}\index{Xronson, Jim}\index{Yronson, Jim}\index{Zronson, Jim}\index{Zronson, Jim2}\index{Zronson, Jim3}\index{Zronson, Jim4}\index{Zronson, Jim5}\index{Zronson, Jim6}\index{Zronson, Jim7}\index{Zronson, Jim8}


\part{Anhang}
\printindex
\Blinddocument
\end{document}

The result is the same as above.

  • Thanks a lot for these two solutions, both work perfect! – binsky Jun 17 '18 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.