Page LayoutWrong page title in Header

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
tsurreal
Posts: 15
Joined: Sat Aug 02, 2008 6:48 pm

Wrong page title in Header

Post by tsurreal »

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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

Wrong page title in Header

Post by Stefan Kottwitz »

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
LaTeX.org admin
tsurreal
Posts: 15
Joined: Sat Aug 02, 2008 6:48 pm

Re: Wrong page title in Header

Post by tsurreal »

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.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

Re: Wrong page title in Header

Post by Stefan Kottwitz »

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
LaTeX.org admin
tsurreal
Posts: 15
Joined: Sat Aug 02, 2008 6:48 pm

Wrong page title in Header

Post by tsurreal »

Code: Select all

\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}
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\thispagestyle{empty}
Blah blah blah in \cite*{ownpapers:paper1} and \cite*{ownpapers:paper2}.

\putbib[ownpapers]
\end{bibunit}



\chapter*{Acknowledgements}
\addcontentsline{toc}{chapter}{Acknowledgements}
\thispagestyle{empty}
bbbbb \\
ggg \\

\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\thispagestyle{empty}
habs wf f 9c c 9WWFCkccn n<zkls<lkclkhcsv slkcv hvs scsois cich svcsico cSCV 

\tableofcontents
\thispagestyle{empty}

\chapter*{List of Abbreviations}
\addcontentsline{toc}{chapter}{List of Abbreviations}
\thispagestyle{empty}

\begin{tabular}{l l}
A & bb \\

\end{tabular}

\mainmatter

\chapter{Introduction}
a A Cajc AICS ac sACS A Ca csA CSTac 98A 8CS 0acA


\chapter{Conclusions}
xyz

\begin{bibunit}
\renewcommand\bibname{Bibliography}
\putbib
\end{bibunit}
\end{document}
Here is a MWE. ntnuthesis is a class mainly defining the formatting and for generating the front page. It uses document class 'book' and uses fancyhdr.

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

\chapter*{List of Abbreviations}
\addcontentsline{toc}{chapter}{List of Abbreviations}
\thispagestyle{empty}
With this I get the desired results on all chapters except when I hit the /putbib and /tableofcontents. Then the next (empty) page and the pages of all subsequent chapters carry the title 'list of papers'. The same happens with TOC. Being a newbie to Latex, any expert help will be appreciated :)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

Wrong page title in Header

Post by Stefan Kottwitz »

Hi,

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}
\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:

Code: Select all

\makeatletter
\renewcommand*\cleardoublepage{\clearpage\if@twoside
\ifodd\c@page\else
\hbox{}
\thispagestyle{plain}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
You will find further information in the fancyhdr documentation section 15.

Stefan
LaTeX.org admin
tsurreal
Posts: 15
Joined: Sat Aug 02, 2008 6:48 pm

Re: Wrong page title in Header

Post by tsurreal »

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!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

Re: Wrong page title in Header

Post by Stefan Kottwitz »

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
LaTeX.org admin
tsurreal
Posts: 15
Joined: Sat Aug 02, 2008 6:48 pm

Re: Wrong page title in Header

Post by tsurreal »

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 :D
miceleee
Posts: 7
Joined: Wed Jan 19, 2011 1:50 am

Wrong page title in Header

Post by miceleee »

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!!

Code: Select all

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

Post Reply