I have got a problem with the heading on a page with
\chapter*
and using fancyhdr. There is a minimal example below. The header of the first page of the introduction is "Contents" instead of "Introduction". If I replace "
\chapter*{Introduction}
" by "\chapter{Introduction}
" then it is displayed correctly, but the introduction becomes chapter 1, what is not intended. Hopefully someone can offer some help with that issue. Since I am close to a deadline a quick and dirty fix will be fine too.Best regards
Thomas
Code: Select all
\documentclass[a4paper,10pt]{book}
\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[RO]{\slshape\nouppercase\rightmark}
\fancyhead[LE]{\slshape\nouppercase\leftmark}
\fancyhead[LO,RE]{\thepage}
\setlength{\headheight}{15pt}
\fancypagestyle{plain}{
\fancyhf{}%
\fancyhead[RO]{\slshape\nouppercase\rightmark}
\fancyhead[LE]{\slshape\nouppercase\leftmark}
\fancyhead[LO,RE]{\thepage}
\setlength{\headheight}{15pt}
}
\begin{document}
\tableofcontents
\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}
\lipsum
\chapter{First Chapter}
\section{First Section}
\lipsum
\section{Second Section}
\lipsum
\chapter{Second Chapter}
\section{First Section}
\lipsum
\section{Second Section}
\lipsum
\end{document}