Page Layout ⇒ Problems with page headers (fancyhead)
Problems with page headers (fancyhead)
I have a problem with the fancyheadings package.
I have a style that prints the chapter name on odd pages and section marks on even pages, pretty much like the default.
Now, if there is a chapter with no sections in it, for example a simple summary chapter at the end, the problem is that LaTeX seems to remember the last section mark (from the previous chapter). I would like to kill this one and print nothing for the case when the chapters have no sections.
Looking at the FAQ and the "LaTeX companion" and also the documentation for "fancyheadings", I find.... nothing.
Anyone here who knows?
Best regards,
/C
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
Problems with page headers (fancyhead)
BTW: if you were using memoir (which has a better header interface build in), it would be enough with
Code: Select all
\addtopsmarks{<name of style>}{}{\createmark{chapter}{both}{shownumber}{\@chapapp\ }{. \ }}
Problems with page headers (fancyhead)
Adding this to my code:
Code: Select all
\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter. #1}{\chaptername\ \thechapter. #1}}
Code: Select all
\fancyhead[LO]{}\fancyhead[LE]{\thepage}\fancyhead[RO]{\thepage}
Cheers,
/C
Re: Problems with page headers (fancyhead)
i.e. a short dicumetn showing what you do and displays your problem.
leave out anything unnessary
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Problems with page headers (fancyhead)
You better take a look at packages like fancyhdr or titlesec. Nevertheless you should meet the request of daleif for a minimal working example (MWE). A possible solution for your problem could be to use the \markboth command.ceke wrote:[...] I have a problem with the fancyheadings package. [...]
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10