3

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?

3
  • Do you really not want the subtitles in headers, or is it only because of the linebreak?
    – Bernard
    Commented Jul 4, 2014 at 10:02
  • Do you want the subtitles in the headers?
    – egreg
    Commented Jul 4, 2014 at 10:32
  • Redefine the pagestyle with one of the pagestyle package (fancyhdr) (scrhead).
    – Sveinung
    Commented Jul 4, 2014 at 10:36

1 Answer 1

6

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}
1
  • Thanks! Both these solutions worked. However the first solution also changed the formatting of the headers, apparently overriding some settings used for fancyhdr. So, even though I've not used Koma before, I'll go with the second suggestion.
    – sujato
    Commented Jul 4, 2014 at 22:22

You must log in to answer this question.

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