[Tex/LaTex] header and chapter*

chaptersheader-footersectioningstarred-version

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?

Best Answer

\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}
Related Question