Hej guys!
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
Page Layout ⇒ Problems with page headers (fancyhead)
Problems with page headers (fancyhead)
by default \chapter only writes to the \leftmark, I would suggest redefining \chaptermark to add its title to both marks (i.e. fill in both arguments of \markboth and not just the left one)
BTW: if you were using memoir (which has a better header interface build in), it would be enough with
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)
Hi again!
Adding this to my code:
did not help. It seems like fancyhead is redefining the markers. The only workaround I found so far is to add the following at the top of the no-sections chapter
Not sure I understood your reply correctly though.
Cheers,
/C
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)
Please post a minimal example then.
i.e. a short dicumetn showing what you do and displays your problem.
leave out anything unnessary
i.e. a short dicumetn showing what you do and displays your problem.
leave out anything unnessary
- localghost
- Site Moderator
- Posts: 9201
- 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¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1