I am writing a thesis. But it turned out to be of the wrong format. Following is the format (wrong one):

enter image description here

I want the following format, where header on odd page must be right side and header on the even page must be on the left side (in the following format):

enter image description here

P.S. Following is the TeX code that I used.

\pagestyle{fancy}                       % Sets fancy header and footer
\fancyfoot{}                            % Delete current footer settings
\renewcommand{\chaptermark}[1]{         % Lower Case Chapter marker style
  \markboth{\chaptername\ \thechapter.\ #1}{}} %
\renewcommand{\sectionmark}[1]{         % Lower case Section marker style
  \markright{\thesection.\ #1}}         %

\fancyhead[LE,RO]{\bfseries}            % Page number (boldface) in left on even
                                    % pages and right on odd pages                                 
\fancyhead[RE]{\sl\nouppercase\leftmark}% Chapter in the right on even pages
\fancyhead[LO]{\sl\nouppercase\rightmark}% Section in the left on odd pages

\renewcommand{\headrulewidth}{0.3pt}    % Width of head rule
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else%
\thispagestyle{empty}%              % Empty header styles
\parskip 7.5pt
\makeatother \clearpage{\pagestyle{plain}\cleardoublepage}
  • Have you tried \fancyhead[RO]{\sl\nouppercase\leftmark}\fancyhead[LE]{\sl\nouppercase\rightmark} instead of \fancyhead[RE]{\sl\nouppercase\leftmark}\fancyhead[LO]{\sl\nouppercase\rightmark}? – gernot Nov 5 '19 at 14:12
  • Use LE instead of RE and RO instead of LO. R=right, L=left, E=even, O=odd. – leandriis Nov 5 '19 at 14:12
  • @gernotsaysReinstateMonica yeah I tried this but it is showing two headers on the same page – monalisa Nov 5 '19 at 18:27

To mark the left side of even pages (LE) and the right side on odd pages (RO), one has to set the header for these two locations:


By default, all sides are marked, so one has to set locations that are supposed to remain empty, here the right side on even pages (RE) and the left one on odd pages (LO) explicitly to empty:


Here is a sample document:

\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}

enter image description here

  • Thanks a ton. This helped me a lot. Thank you. – monalisa Nov 6 '19 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.