Page Layout ⇒ Wrong page title in Header
Wrong page title in Header
Hi guys! Need help with another issue. I get wrong chapter title in the header of my document in places where I insert bibliography (I use bibunits package) and TOC. It seems as though the chapter title appearing in the header overflows to the subsequent chapters. For example, when I insert bibliography (before the main matter starts), this title is propagated to pages of the subsequent chapters (except the chapter main page). The same happens with the chapter following the TOC, the TOC title is propagated to the chapter after it until the main matter starts. Is there a way to correct it? It seems as though the problem starts after the auto-entries such as \putbib, and \tableofcontents. The TOC entries seem correct. Thanks in advance for the help.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Wrong page title in Header
Hi,
you did not tell us the document class you are using, the page style, if you use standard headings page style or a package like fancyhdr or scrpage2, there's not enough information yet. Perhaps provide a minimal working example that shows the problem. Maybe \markboth or \chaptermark could help.
Stefan
you did not tell us the document class you are using, the page style, if you use standard headings page style or a package like fancyhdr or scrpage2, there's not enough information yet. Perhaps provide a minimal working example that shows the problem. Maybe \markboth or \chaptermark could help.
Stefan
LaTeX.org admin
Re: Wrong page title in Header
Hi! The document class is 'book', use fancyhdr. If it is still hard to provide tips then I'll try to make a MWE file. Thanks.
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Wrong page title in Header
Hi,
a MWE would be useful. Normally the headings should not span over several chapters (\chapter, not \chapter*) with book and fancyhdr, there may be something wrong that at least I can't guess yet.
Stefan
a MWE would be useful. Normally the headings should not span over several chapters (\chapter, not \chapter*) with book and fancyhdr, there may be something wrong that at least I can't guess yet.
Stefan
LaTeX.org admin
Wrong page title in Header
Code: Select all
Code, edit and compile here:
\documentclass{ntnuthesis}\usepackage{amsmath}\usepackage{epsfig,graphicx}\usepackage{subfigure}\usepackage{calc}\usepackage{setspace}\usepackage{booktabs}\usepackage{sistyle}\usepackage{hyperref}\usepackage{epigraph}\usepackage{hyphenat}\usepackage{flafter}\usepackage{varioref}\usepackage{bibunits}%\usepackage{tocbibind}\usepackage[refpages]{gloss}\usepackage[T1]{fontenc}\usepackage[latin1]{inputenc}%\usepackage{babel}\newcommand{\degree}{\ensuremath{^\circ}}\providecommand{\abs}[1]{\lvert#1\rvert}\begin{document}\frontmatter\author{ABC}\title{XYZ}\degreetype{X}\faculty{TT}\department{EE}\maketitle\begin{bibunit}[plain]\renewcommand\bibname{List of Papers}
The formatting that I want is as follows: I want roman numbering on the chapters before the main matter. These chapters should start on the right page therefore the left page should be kept empty without any chapter title in header (but with a page number). These chapters along with a 'list of papers' bibliography should also be listed in the TOC. Notice the tricks that I use right now:
Code: Select all
Code, edit and compile here:
\chapter*{List of Abbreviations}\addcontentsline{toc}{chapter}{List of Abbreviations}\thispagestyle{empty}

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Wrong page title in Header
Hi,
without the ntnuthesis.cls file I cannot test it completely, but \chaptermark should help as I guessed above:
\markboth should work too, but try \chaptermark first, it should take care of the formatting.
Concerning the empty pages try this code in your preamble:
You will find further information in the fancyhdr documentation section 15.
Stefan
without the ntnuthesis.cls file I cannot test it completely, but \chaptermark should help as I guessed above:
Code: Select all
\chapter*{List of Abbreviations}\chaptermark{List of Abbreviations}
Concerning the empty pages try this code in your preamble:
Code: Select all
Code, edit and compile here:
\makeatletter\renewcommand*\cleardoublepage{\clearpage\if@twoside\ifodd\c@page\else\hbox{}\thispagestyle{plain}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}\makeatother
Stefan
LaTeX.org admin
Re: Wrong page title in Header
Hi Stefan, Thank you very much. The problem with the chapter titles is solved but not the problem with blank pages. I have PM'd you the class file. It seems as though the \putbib and \tableofcontents overwrite some settings such that chapter titles are displayed on the blank pages.
Thank you in advance!
Thank you in advance!
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Wrong page title in Header
If I put that 8 lines of code from my last posting above directly before \begin{document}, using ntnuthesis.cls, it works: on otherwise empty pages their page numbers are set, but no chapter title is printed into the head of an empty page.
What do you make differently?
Stefan
What do you make differently?
Stefan
LaTeX.org admin
Re: Wrong page title in Header
Hello again Stefan. I have done some additional tidying up and your code does work now. Thank you very much for your immense help! Till next question - Cheers 

Wrong page title in Header
Hi there...
have slightly different problem. Maybe it is just silly, but I can't get it right.
'Contents' shows my 'List of abbreviation' in the correct page number but Exec summary in the wrong page number (it is 2 pages, it reminds to the second). Also, there is an empty page between List of Tables, List of Abbreviations and Exec summary. Any hints?
Many thanks for you help!!
have slightly different problem. Maybe it is just silly, but I can't get it right.
'Contents' shows my 'List of abbreviation' in the correct page number but Exec summary in the wrong page number (it is 2 pages, it reminds to the second). Also, there is an empty page between List of Tables, List of Abbreviations and Exec summary. Any hints?
Many thanks for you help!!
Code: Select all
Code, edit and compile here:
\documentclass[a4paper, twoside,11pt]{memoir}%\usepackage{hyperref}%\hypersetup{ => omitted options\begin{document}\tableofcontents\newpage\listoffigures\listoftables\chapter*{List of Abbreviations}\addcontentsline{toc}{chapter}{List of Abbreviations}\chapter*{Executive Summary}\addcontentsline{toc}{chapter}{Executive Summary}%\cleardoublepage\mainmatter\chapter{}\end{document}