Page Layout ⇒ missing footer and header on last pages of a chapter
missing footer and header on last pages of a chapter
I am using fancyhf for the headers and footers of my dissertation.
It works well on all the pages of my document, except for two pages on which the headers and footers don't appear. The two pages are the two last pages of a chapter for which the headers and footers appear normaly on all pages - except the 1st one but that's deliberate since it's the title of the chapter.
Has anyone already got such a problem? Any idea why that would happen and how to fix it?
Thanks a lot for your help!
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
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
missing footer and header on last pages of a chapter
right now it is impossible to see the reason. There could be a
\thispagestyle{empty}
somewhere at the end of the chapter. There is a way for you to find the cause, it is called preparing a minimal working example. Simply said, you comment out huge parts of the document till the cause is obvious. If it's not for you, it will be for us.
Please follow the above link for more instructions to do it systematically.
Re: missing footer and header on last pages of a chapter
Thanks for your answer. As you noticed I am new to this forum so I didn't know how to simplify a whole chapter for it to be relevant! So I'll use the document you provided and come back when I have more information to provide to you or maybe if I manage to solve it myself!
Cheers
Lucile
Re: missing footer and header on last pages of a chapter
So I followed Johannes_B's advice and managed to solve the problem myself!
The problem came from the fact that I used the command \pagestyle{fancy} at the beginning of my subfiles and not in my main file (in which I call each chapter by using the command \subfile{chaptername}). For some reason, that resulted in headers on all the pages but the last two pages of my chapters.
If instead I put the \pagestyle{fancy} in the beginning of my main file, i.e., before I use the \subfile{chaptername} command, I get the headers and footers in all the pages of the chapter.
Thanks a lot for your advice in how to debug a big latex file, and sorry for posting a question I managed to solve myself. I will use this a lot now. This file is super helpful.
Best
Lucile
- Stefan Kottwitz
- Site Admin
- Posts: 10326
- Joined: Mon Mar 10, 2008 9:44 pm
missing footer and header on last pages of a chapter
welcome to the forum!
Great to see, that you could solve it.
No problem at all, as it could help somebody else who would arrive here via google. So, thank you for posting the solution you found!lucile wrote:sorry for posting a question I managed to solve myself.
Stefan
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: missing footer and header on last pages of a chapter
And you will get faster with time as you can suspect where to start.