For each chapter, I have the reference section, but the chapter header becomes REFERENCE, it should still be the original chapter name.
Here is a MWE, using PdfLaTeX with BibTeX. On page 6 and 8, the header should be 1. INTRODUCTION, not REFERENCE.
the problem of this is that if i want to add subappendix after reference at each chapter. the header will still be REFERENCE, but i want it to be the real chapter name. like INTRODUCTION in this case.
I have tried to delete as much as i can. i assume that the problem happens with the fancypagestyle at the end part of the .cls file. thanks for all your kind help in advance.
\begin{filecontents}{dissertation.cls} \ProvidesClass{dissertation}[2013/07/08 v1.0 TU Delft dissertation class] \newif\if@nativefonts \DeclareOption{nativefonts}{\@nativefontstrue} \newif\if@print \DeclareOption{print}{\@printtrue} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}} \ProcessOptions\relax \LoadClass[10pt]{book} \RequirePackage[dutch,english]{babel} \RequirePackage{calc} \RequirePackage[nooneline,footnotesize]{caption} \RequirePackage[sectionbib,numbers,sort&compress]{natbib} \RequirePackage{chapterbib} \RequirePackage{fancyhdr} \RequirePackage{ifxetex} \ifxetex \RequirePackage[xetex]{geometry} \RequirePackage[xetex]{graphicx} \RequirePackage[xetex]{hyperref} \RequirePackage{fontspec} \RequirePackage{xltxtra} \defaultfontfeatures{Ligatures=TeX} \else \ifpdf \RequirePackage[pdftex]{geometry} \RequirePackage[pdftex]{graphicx} \RequirePackage[pdftex]{hyperref} \else \RequirePackage[dvips]{geometry} \RequirePackage[dvips]{graphicx} \RequirePackage[hypertex]{hyperref} \fi \RequirePackage[T1]{fontenc} \RequirePackage[utf8]{inputenc} \fi \RequirePackage{lettrine} \RequirePackage{metalogo} \RequirePackage{tikz} \RequirePackage[noindentafter]{titlesec} \RequirePackage{titletoc} \RequirePackage[nottoc]{tocbibind} \RequirePackage{xcolor} %% If the document is not compiled with XeLaTeX, we need to use the native %% fonts. \ifxetex\else \@nativefontstrue \fi \if@nativefonts %% The native font is Utopia Regular with Fourier math. We use Latin Modern %% as a fallback, since Utopia lacks support for sans-serif and monospace. \RequirePackage[T1]{fontenc} \RequirePackage[utf8]{inputenc} \RequirePackage{lmodern} \RequirePackage{fourier} %% The style for titles is small caps. \def\titlefont{\rmfamily} \def\titleshape{\scshape} \def\titlestyle{\titlefont\titleshape\bfseries} \if@print \def\headerstyle{\titlefont\titleshape\bfseries} \else \def\headerstyle{\titlefont\titleshape} \fi \else %% The TU Delft house style fonts are Bookman Old Style (serif) for titles %% and Tahoma (sans-serif) for text. Apart from these, we use Courier New %% for monospace and Cambria for math. \RequirePackage{unicode-math} \setmainfont[ Path = fonts/, Extension = .ttf, BoldFont = *-Bold, ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic ]{BookmanOldStyle} \setsansfont[ Path = fonts/, Extension = .ttf, BoldFont = *-Bold, ItalicFont = *, ItalicFeatures = FakeSlant, BoldItalicFont = *-Bold, BoldItalicFeatures = FakeSlant ]{Tahoma} \setmonofont[ Path = fonts/, Extension = .ttf, UprightFont = *MT, BoldFont = *-BoldMT, ItalicFont = *-ItalicMT, BoldItalicFont = *-BoldItalicMT ]{CourierNewPS} \setmathfont[ Path = fonts/, Extension = .ttf ]{CambriaMath} %% The default style for text is Tahoma (sans-serif). \renewcommand*\familydefault{\sfdefault} %% The default style for titles is Bookman Old Style (serif). \def\titlefont{\rmfamily} \def\titleshape{} \if@print \def\titlestyle{\titlefont\titleshape\bfseries} \else \def\titlestyle{\titlefont\titleshape} \fi \def\headerstyle{\titlestyle} \fi \definecolor{tudelft-cyan}{cmyk}{1,0,0,0} \definecolor{anthracite}{cmyk}{0,0,0,0.8} \if@print \colorlet{title}{anthracite} \else \colorlet{title}{tudelft-cyan} \fi \colorlet{thumb}{anthracite} \if@print% \newcommand*\cropmarks{% \ifodd\c@page% \begin{tikzpicture}[remember picture,overlay] \draw ($(current page.north east)+(0mm,-3mm)$) -- ($(current page.north east)+(-2mm,-3mm)$); \draw ($(current page.north east)+(-3mm,0mm)$) -- ($(current page.north east)+(-3mm,-2mm)$); \draw ($(current page.south east)+(0mm,3mm)$) -- ($(current page.south east)+(-2mm,3mm)$); \draw ($(current page.south east)+(-3mm,0mm)$) -- ($(current page.south east)+(-3mm,2mm)$); \end{tikzpicture}% \else% \begin{tikzpicture}[remember picture,overlay] \draw ($(current page.north west)+(0mm,-3mm)$) -- ($(current page.north west)+(2mm,-3mm)$); \draw ($(current page.north west)+(3mm,0mm)$) -- ($(current page.north west)+(3mm,-2mm)$); \draw ($(current page.south west)+(0mm,3mm)$) -- ($(current page.south west)+(2mm,3mm)$); \draw ($(current page.south west)+(3mm,0mm)$) -- ($(current page.south west)+(3mm,2mm)$); \end{tikzpicture}% \fi% } \else \newcommand*\cropmarks{} \fi% %%% Thumb indices consist of white text on a rectangular colored background. The %%% font-size is 75% of the size of thumb height. \newif\ifthumb \newlength\thumbheight \setlength\thumbheight{24pt} \newlength\thumbedge \setlength\thumbedge{4pt} \newlength\thumbhspace \setlength\thumbhspace{36pt} \newlength\thumbvspace \setlength\thumbvspace{2\thumbheight} \newlength\thumbwidth \setlength\thumbwidth{36pt} \newlength\thumbspacing \setlength\thumbspacing{2\thumbheight} %% We need the TikZ library calc to calculate the coordinates of the thumb %% indices. \usetikzlibrary{calc} %% The lthumb command prints the current chapter number in a thumb index on the %% left (even) page. \newcommand*\lthumb{% \ifthumb% \begin{tikzpicture}[remember picture,overlay] \coordinate (top margin) at (0pt,1in+\topmargin+\headheight+\headsep); \coordinate (left margin) at (1in+\evensidemargin,0pt); %% Calculate the corners of the thumb index based on the current %% chapter number. \coordinate (top left) at ($(current page.north west)-(top margin)-(0pt,\value{chapter}\thumbvspace-\thumbvspace)$); \coordinate (bottom right) at ($(top left)+(left margin)-(\thumbhspace,\thumbheight)$); %% Shift the left edge to prevent the rounded corner from showing. \coordinate (top left) at ($(top left)-(\thumbedge,0pt)$); %% Draw the thumb index. \fill[fill=thumb,rounded corners=\thumbedge](top left) rectangle (bottom right); %% Print the chapter number at the center right in the thumb index. \coordinate (center right) at ($(bottom right)+(0pt,0.5\thumbheight)$); \node at (center right)[anchor=east,inner sep=2\thumbedge]{ \titlefont\bfseries\color{tudelft-white} \fontsize{0.75\thumbheight}{0.75\thumbheight}\selectfont \thechapter }; \end{tikzpicture}% \fi% } %% rthumb draws a thumb index on the right (odd) page. \newcommand*\rthumb{% \ifthumb% \begin{tikzpicture}[remember picture,overlay] \coordinate (top margin) at (0pt,1in+\topmargin+\headheight+\headsep); \coordinate (right margin) at (1in+\evensidemargin,0pt); %% Calculate the corners of the thumb index based on the current %% chapter number. \coordinate (top right) at ($(current page.north east)-(top margin)-(0pt,\value{chapter}\thumbvspace-\thumbvspace)$); \coordinate (bottom left) at ($(top right)-(right margin)-(-\thumbhspace,\thumbheight)$); %% Shift the left right to prevent the rounded corner from showing. \coordinate (top right) at ($(top right)+(\thumbedge,0pt)$); %% Draw the thumb index. \fill[fill=thumb,rounded corners=\thumbedge](top right) rectangle (bottom left); %% Print the chapter number at the center right in the thumb index. \coordinate (center left) at ($(bottom left)+(0pt,0.5\thumbheight)$); \node at (center left)[anchor=west,inner sep=2\thumbedge]{ \titlefont\bfseries\color{tudelft-white} \fontsize{0.75\thumbheight}{0.75\thumbheight}\selectfont \thechapter }; \end{tikzpicture}% \fi% } %% Fancy style for the main matter. \fancypagestyle{mainmatter}{% \fancyhf{} %% Page numbers on the top left and top right. \fancyhead[LE]{\cropmarks\lthumb\titlefont\thepage} \fancyhead[RO]{\cropmarks\rthumb\titlefont\thepage} %% Chapter name on the left (even) page. \fancyhead[RE]{\titlefont\titleshape\nouppercase{\leftmark}} %% Section name on the right (odd) page. \fancyhead[LO]{\titlefont\titleshape\nouppercase{\rightmark}} } %% The mainmatter style is default for normal pages. \pagestyle{mainmatter} %% Print the current chapter and section at the top of the page in cyan. \renewcommand*\chaptermark[1]{\markboth{\thechapter.\ \color{title}#1}{}} \renewcommand*\sectionmark[1]{\markright{\thesection.\ \color{title}#1}} %% The setheader command can be used to print the title of unnumbered chapters %% in the page header. \newcommand*\setheader[1]{\markboth{\color{title}#1}{\color{title}#1}} %% Create an unnumbered reference section. \addto\captionsenglish{\renewcommand*\bibname{\color{title}References}} \newcommand*\references[1]{% \bibliographystyle{dissertation}% \bibliography{#1}% } \end{filecontents} \begin{filecontents}{dissertation.bib} @ARTICLE{Einstein1906, author = {Einstein, A.}, title = {Eine neue Bestimmung der MolekEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine nlek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine nlek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine nlek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine nlek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine nlek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine nlek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine nlek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionenEine neue Bestimmung der Molek\"uldimensionen\"uldimensionen}, journal = {Annalen der Physik}, year = {1906}, volume = {324}, pages = {289--306}, number = {2}, doi = {10.1002/andp.19063240204}, url = {http://dx.doi.org/10.1002/andp.19063240204} } \end{filecontents} \documentclass{dissertation} \usepackage{lipsum} \begin{document} \tableofcontents \chapter{Introduction} \section{section 1} some text here \cite{Einstein1906} \lipsum \section{section 2} some text here \lipsum \lipsum \bibliographystyle{plain} \bibliography{dissertation.bib} \chapter{another chapter} \section{test} \end{document}