[Tex/LaTex] How to get subtitles for chapter titles to appear in the ToC, but not in the page headers

header-footertable of contents

From a previous question, here's some code that enables subtitles for chapters, while also adding the subtitles to the ToC.

\newcommand\Chapter[2]{\chapter
[#1\hfil\hbox{}\protect\linebreak{\itshape#2}]%
{#1\\[2ex]\Large\itshape#2}%
}

Unfortunately this also adds the subtitles to the page headers. Is there a way of achieving the same effect in the chapter titles and ToC, but without having the subtitles in the page headers?

Best Answer

Here is a suggestion using \markboth

\newcommand\Chapter[2]{\chapter
  [#1\hfil\hbox{}\protect\linebreak{\itshape#2}]%
  {#1\\[2ex]\Large\itshape#2}%
  \markboth{\MakeUppercase{\chaptername\ \thechapter.\ #1}}{}%
}

enter image description here


enter image description here


enter image description here

Code:

\documentclass{book}
\usepackage{lmodern}

\newcommand\Chapter[2]{\chapter
  [#1\hfil\hbox{}\protect\linebreak{\itshape#2}]%
  {#1\\[2ex]\Large\itshape#2}%
  \markboth{\MakeUppercase{\chaptername\ \thechapter.\ #1}}{}%
}

\usepackage{blindtext}
\begin{document}
\tableofcontents
\Chapter{Title}{Subtitle}
\blindtext[10]
\end{document}


There is another possibility: try a KOMA-Script class with the class option

headings=optiontoheadandtoc

Then the extended interpretation of the optional argument is activated and you can use

\newcommand\Chapter[2]{\chapter[
    tocentry={#1\hfil\hbox{}\protect\linebreak{\itshape#2}},
    head={#1}
  ]{#1\\[2ex]\Large\itshape#2}%
}

enter image description here


enter image description here


enter image description here

Code:

\documentclass[headings=optiontoheadandtoc]{scrbook}
\usepackage{lmodern}

\newcommand\Chapter[2]{\chapter[
    tocentry={#1\hfil\hbox{}\protect\linebreak{\itshape#2}},
    head={#1}
  ]{#1\\[2ex]\Large\itshape#2}%
}

\usepackage{blindtext}
\begin{document}
\tableofcontents
\Chapter{Title}{Subtitle}
\blindtext[10]
\end{document}
Related Question