Hello,
I have a large document broken down into separate chapters. In each chapter, I have the following line as running head at top margin:
\markboth{Chapter k}{Abc 123}
where k = 1, 2, 3, etc is the chapter number.
Then I combine all chapters as follows:
\begin{document}
\input chapter1.tex
\input chapter2.tex
etc.
\end{document}
The problem is that in the last page of each chapter, I get the running head of the next chapter. For example, if the first chapter ends on an odd page (say 25), it's running head at top is "Chapter 2". But if the first chapter ends on an even page, its running head is "Abc 123", because it is the same for all the chapters. I feel that the problem is due to some counter not resetting when a new chapter is read in. This happens not only with chapters, but with the preamble as well. In the last page of "List of tables", I get the running head of chapter 1. Is there anyone who have come across this strange behaviour of MikTex? How can I tell MikTex to keep the running head till the last (odd) page of each chapter?
Thanks in advance.
General ⇒ Running head at the last page is that of next chapter!
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Running head at the last page is that of next chapter!
Change from \input to \include. There are better ways to declare headers and footers. Take a look at fancyhdr or titlesec.
Best regards
Thorsten¹
Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10