7

I find it strange that the page header in the chapter “Title2” is not updated in the example below:

\documentclass[12pt]{book}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\chapter{Title1}
\lipsum[10]
\clearpage
\chapter*{Title2}
\addcontentsline{toc}{chapter}{Title2}
\lipsum{5}
\end{document}

What should be done?

2
  • Which header should be updated to what?
    – Caramdir
    Apr 15 '11 at 20:34
  • header of chapter*2 was the header of chapter 1
    – pluton
    Apr 15 '11 at 20:52
11

\chapter* neither adds a ToC entry nor adjusts the content of headers/footers. For the latter, add \markboth with appropriate parameters. EDIT: This results in correct headers/footers for the (default) twoside class option; for oneside, \markright should be used.

\documentclass[12pt]{book}
\usepackage{lipsum}
\begin{document}
\tableofcontents
\chapter{Title1}
\lipsum[10]
\clearpage
\chapter*{Title2}
\addcontentsline{toc}{chapter}{Title2}
\markboth{\MakeUppercase{Title2}}{}% for "twoside" class option
% \markright{\MakeUppercase{Title2}}% for "oneside" class option
\lipsum{5}
\end{document}
0

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.