I have a question regarding the fancy header in LaTeX. The header shows up inconsistently with the following code. For example, it doesn't show the section name for the Abstract and it isn't showing at all on the first page of table of contents.

My code:

%from settings

%code Abstract

%code Table of Content
\renewcommand{\contentsname}{Table of Contents}
\addcontentsline{toc}{section}{Table of Contents}

1 Answer 1


\section* doesn't set up the marks so \leftmark will not have the proper value. Try:


See section 15 (The scoop on LATEX’s marks) in the fancyhdr documentation.

\tableofcontents\thispagestyle{fancy} causes the pagestyle to apply only to the last page of the table of contents.

Probably better is


Without a complete example document it is difficult to say, however.

You must log in to answer this question.

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