Page Layout ⇒ fancyhdr | Customized Header for ToC Pages
fancyhdr | Customized Header for ToC Pages
When using the fancydr package to create a header (on the left the chaptertitle and the page number on the right) I have to use '\thispagestyle{fancy}' on a page where a new chapter starts cause otherwise the pagestyle is automatically 'plain'. So thats not a problem.
Now I'm trying to do the same for my table of contents, but i'm encountering a problem. If my table of contents is only 1 page long it works just fine, but when its 2 or 3 pages the '\thispagestyle{fancy}' command doesn't seem to have an effect on the first page of the ToC.
I've tried to look in the fancyhdr package documentation but found nothing of help.
I've added a working example.
- Attachments
-
- Test.tex
- (1.21 KiB) Downloaded 1055 times
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: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
fancyhdr | Customized Header for ToC Pages
welcome to the board!
Try
Code: Select all
\addtocontents{toc}{\protect\thispagestyle{fancy}}
Stefan
Re: fancyhdr | Customized Header for ToC Pages
Re: fancyhdr | Customized Header for ToC Pages
I have a similar problem with fancyhdr and Table of Contents. I have defined my headers and footers (see attached file), but the headers in the Contents, List of Tables, and List of Figures pages still don't change. The first page is fine, but in the following pages I want the header to be lower-case letters, not capitalised.
cheers,
Karianne
- Attachments
-
- ex.tex
- (1.64 KiB) Downloaded 759 times
fancyhdr | Customized Header for ToC Pages
use the \nouppercase command in the appropritae locations:
Code: Select all
\fancyhead[LE]{\nouppercase\leftmark}
\fancyhead[RO]{\nouppercase\rightmark}
fancyhdr | Customized Header for ToC Pages
I just found out that this also works (after fighting LaTeX all day):
Code: Select all
\tableofcontents{\fancyhead[LE]{\slshape\contentsname}}
\listoffigures{\fancyhead[LE]{\slshape\listfigurename}}
\listoftables{\fancyhead[LE]{\slshape\listtablename}}
Cheers, Karianne