Page Layouthow to remove "Contents" from header in frontmatter

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
amoz
Posts: 14
Joined: Mon Mar 16, 2009 1:42 pm

how to remove "Contents" from header in frontmatter

Post by amoz »

Hi

If you run this MWE piece of code (twice), you will see that there is a Contents header over the Acknowledgements and Acronyms section. I wonder why this is happening... and how to change it.

Any clues? Thanks!

Code: Select all

\documentclass[11pt]{book} 
\usepackage{array,booktabs,longtable,tabularx}
\usepackage{chapterbib,varioref,url}
\usepackage{graphicx}
\usepackage{lineno,paralist,appendix,marginnote,float,amsfonts}
\usepackage{xkeyval,ifpdf}
\usepackage{subfig}
\usepackage{calc,lscape,rotating,textcomp}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{blindtext}

\usepackage{fancyhdr} 
\pagestyle{fancy} 
\renewcommand{\chaptermark}[1]{\markboth{#1}{}} 
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} 
\fancyhf{} % delete current setting for header and footer
\fancyhead[LO]{\bfseries\rightmark} 
\fancyhead[RE]{\bfseries\leftmark}
\fancyfoot{} % clear all footer fields 
\fancyfoot[LE,RO]{\bfseries\thepage}  
\fancypagestyle{plain}{% 
\fancyhead{} % get rid of headers on plain pages
\renewcommand{\headrulewidth}{0pt} % and the line 
}

\usepackage[english]{babel} 

\begin{document}

\tableofcontents
\chapter*{Acknowledgements}
\addcontentsline{toc}{chapter}{Acknowledgements}
%\input{acknowledgements}

\chapter*{Acronyms \& Abbreviations}
\addcontentsline{toc}{chapter}{Acronyms  \& Abbreviations}
%\input{abbreviations}

 \Blinddocument
  
\end{document}

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

how to remove "Contents" from header in frontmatter

Post by localghost »

Try a \newpage right after the ToC or the \markboth command.


Best regards
Thorsten¹
amoz
Posts: 14
Joined: Mon Mar 16, 2009 1:42 pm

Re: how to remove "Contents" from header in frontmatter

Post by amoz »

Thank you!

Maybe I should put you in my PhD Acknowledgements as well. 8-)
Post Reply