1

I have configured my ToC as follows:

\documentclass{scrbook}

\usepackage{tocloft}
\renewcommand{\cftchappresnum}{\textmd{\emph\chaptername\ }}
\renewcommand{\cftchapaftersnumb}{\\ }
\cftsetindents{chapter}{0em}{0em}

\begin{document}
  \tableofcontents
  \chapter{A chapter-heading. Great.}
\end{document}

This yields the following:

TOC

This has about everything I want, except for the chapter-number after ›Chapter‹ which is bold. I have not been able to track the format of this so that I can change it. Any idea how I can do this? changing the tocloft-macro \cftchapfont will change the entire entry, but I would just like the ›Chapter‹ and its corresponding number to be emphasized which I have tried with \cftchappresnum.

  • 2
    I don't think that KOMA and tocloft go well together – user31729 Sep 6 '17 at 11:44
  • I think this answer over here has you covered:tex.stackexchange.com/a/227103/140011 – nhck Sep 6 '17 at 12:09
  • I think Schweinebacke's answer solves the problem most elegantly within KOMA-Script, without having to rely on tocloft. – Kubo Sep 6 '17 at 21:53
1

Very easy to do using KOMA-Script's \RedeclareSectionCommand instead of tocloft:

\documentclass{scrbook}

\RedeclareSectionCommand[%
  tocbreakafternumber,% line break after chapter number
  tocentrynumberformat=\chaptertocnumber,% new format of the chapter number
  tocdynnumwidth,% avoid overfull \hbox message
]{chapter}
\newcommand*{\chaptertocnumber}[1]{\mdseries\itshape\chaptername~#1}

\begin{document}
  \tableofcontents
  \chapter{A chapter-heading. Great.}
\end{document}

with chapter only

If the chapter entries of the appendix should be automatically prefixed with Appendix instead of Chapter you can use:

\documentclass{scrbook}

\RedeclareSectionCommand[%
  tocbreakafternumber,
  tocentrynumberformat=\chaptertocnumber,
  tocdynnumwidth
]{chapter}
\newcommand*{\chaptertocnumber}[1]{\mdseries\itshape #1}

\let\originaladdchaptertocentry\addchaptertocentry
\renewcommand*{\addchaptertocentry}[2]{%
  \IfArgIsEmpty{#1}{%
    \originaladdchaptertocentry{#1}{#2}%
  }{%
    \originaladdchaptertocentry{\chapapp~#1}{#2}% add current "Chapter" or "Appendix" before the number
  }%
}

\begin{document}
  \tableofcontents
  \chapter{A chapter-heading. Great.}
  \appendix
  \chapter{An appendix-heading}
\end{document}

with appendix

  • Yippieyayeah, @Schweinebacke! This is awesome! I just checked the KOMA-Script-Guide and studied these features which can handle some things internally without relying on tocloft. One thing that may be necessary to adapt: To remove the \autodot after ›Chapter‹ (or ›appendix‹) it is possible to add an option while loading the documentclass: numbers=noendperiod. This also effects running headlines in pages, which may then be redefined, as I have done with: \renewcommand*{\chaptermarkformat}{\chapapp~\thechapter\autodot\enskip–\enskip}. – Kubo Sep 6 '17 at 21:48

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.