I am having some issues with setting my thesis formatting and I may need some assistance with the fancyhdr package. The problem is, I made by own style from a combination of two templates and there must be some inherited settings from each of them (and each different), but I am unable to locate them. This is what the pages look like: An example of my problem

As you see, the LEFT pages have the page number as a footer under a line and the RIGHT pages have the page number as a header and with no line. I want to have the chapter name in the headers and page numbers in the footers. This is a part of my preamble:

\documentclass[a4paper,12pt,twoside,openright, english]{book}

\usepackage{latexsym, syntonly, textcomp, amsmath, caption, float}
\usepackage{blindtext, setspace, rotating}
\usepackage{natbib, longtable}
\usepackage{threeparttable} %for footnote in tables
\usepackage[hyphens]{url} %break line within long url
\usepackage[top=2.3cm, inner=3.2cm, bottom=2.4cm, outer=2.3cm]{geometry}


        \markright{\thesection\ #1}}
\fancyhf{}  % delete current header and footer
\addtolength{\headheight}{3pt} % space for the rule
\fancyhead{} % get rid of headers on plain pages
\renewcommand{\headrulewidth}{0.5pt} % and the line



What have I missed? I thought I have all the settings.

  • 1
    Please post a MWE (minimal working example) instead of just 'part of your preamble'. Did you select your headerstyle with \thispagestyle{fancy} by any chance, since only the opening pages have it applied? Commented Dec 8, 2017 at 7:16
  • Nope, the only things that I excluded were settings of unrelated things (dedication etc., which had its own \thispagestyle{empty}). Otherwise the document begins, that's all
    – durbachit
    Commented Dec 8, 2017 at 7:58

1 Answer 1


There is at least a \pagestyle{fancy} missing. The normal pages still use pagestyle headings. Note that \pagestyle{fancy} must be used at least once before the redefinition of \chaptermark and \sectionmark, because the first call of \pagestyle{fancy} also redefines this commands.

I am not sure about the desired page layout. Maybe

enter image description here

Code (without all the unrelated stuff):

\usepackage{blindtext}% only for dummy text

\pagestyle{fancy}% <- must be used before the redefinition of \chaptermark and \sectionmark
% change the marks set by \chapter and \section
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
% change fancy style
% change plain style (eg. used on chapter pages)
  \renewcommand{\headrulewidth}{0pt} % comment this line, if there should be a headsepline on plain pages too

\usepackage[nottoc]{tocbibind}% LoF and LoT should get a ToC entry

If there should be a headsepline on plain pages too, remove the change of \headrulewidth inside the definition of page style fancyplain.

Additional remark: In your code the \addcontentsline{toc}{chapter}{\listfigurename} and \addcontentsline{toc}{chapter}{\listtablename} are at the wrong place. They would add the page numbers of the last pages of LoF and LoT to the table of contents. You could use package tocbibind instead.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .