For my dissertation I've redefined \thechapter
as \thepart
because I'm only using parts, sections and subsections. With the code below I get the section as the right header but nothing on the left. How do I get the part to appear on the left?
\renewcommand{\thechapter}{\thepart}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\parttitle.\ #1}{}}}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}{}}
\fancyhead{}
\fancyhead[L]{\textit{\leftmark}}
\fancyhead[R]{\textit{\rightmark}}
\renewcommand{\cfoot}{\thepage}
Best Answer
This code does the job. It redefines LaTeX internal command
\@part
to call\markboth
. Packagelipsum
is there to provide some dummy text.As well, I cleaned the code:
\sectionmark
nor\chaptermark
.\parttitle
, it's\partname
.\fancyfoot
and don't redefine\cfoot
.The code: