Page LayoutHeader in report class

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
nenu28
Posts: 28
Joined: Mon Jun 27, 2011 11:24 am

Header in report class

Post by nenu28 »

Hello,

I am writing a document in report class and compiling it with latex or pdflatex.
I want to insert the header on all the page of my table of contents and rename the header " TABLE OF CONTENTS" on the center of the header.
I am using

Code: Select all

\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{}
 \chead{}
 %\rhead{}
\renewcommand{\headrulewidth}{0.4 pt}
With this code,the first page of table of contents does not have the header. The header starts on the next page of " table of contents", Plus le title of the header is not in the center. So, is there someone who can help me ?
Thanks !

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Header in report class

Post by Stefan Kottwitz »

Hi,

did you already read the fancyhdr manual? If not yet, have a look, the commands for the header are explained there.

Regarding the first page of the ToC, you could set the fancy page style there by

Code: Select all

\addtocontents{toc}{\protect\thispagestyle{fancy}}
at the beginning.

Stefan
LaTeX.org admin
nenu28
Posts: 28
Joined: Mon Jun 27, 2011 11:24 am

Header in report class

Post by nenu28 »

Hi Stefan,
Thank a lot for your help. The code you sent to me , it works perfectly but the header title still on the right hand side. I want it (Header title)in the center.

I use this commands in the preambule

Code: Select all

\usepackage{fancyhdr}
\pagestyle{fancy}

\lhead{}
 \chead{}
 %\rhead{}
\renewcommand{\headrulewidth}{0.4 pt}
And in each chapter i put this command

Code: Select all

\markboth{\MakeUppercase{\thechapter. Performance of New Approach}}{\thechapter. Performance of New Approach}
. This allow me to get the header "Performance of New Approach" for this chapter. But still on the right side.
I read the document you advise me but don't really understand much. So could you please try to help me one more time ?

Thanks in advance !
Post Reply