Page Layoutfinal word on headers

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
thranduil
Posts: 2
Joined: Wed Jul 11, 2012 11:02 pm

final word on headers

Post by thranduil »

hi all,

i was reading a lot of editing headers in the document, and nowhere I could find, real and usefull explanation. Since I am not so much experienced in latex, i hope somebody could help me understand this:

what is practical mean of this:

Code: Select all

\renewcommand{\chaptermark}[1]{%
\markright{#1}{}}
after this \chaptermark is kind of empty string.
i was trying to understand this fancyhdr so i started with experiments. I put simply:

Code: Select all

\lhead{\chaptername \ \thechapter}
and I got for example: Chapter 1

nex i tried:

Code: Select all

\lhead{\chaptername \ \thechapter \chaptermark}
and I got the same: Chapter 1

I also tried:
\markright{njnjnjnjnj} and nothings happen on the page?

Please help me
Last edited by Stefan Kottwitz on Wed Jul 11, 2012 11:55 pm, edited 1 time in total.

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

thranduil
Posts: 2
Joined: Wed Jul 11, 2012 11:02 pm

final word on headers

Post by thranduil »

There is also another problem. I am using Thesis template, which you have maybe seen already. Initialy that template was intended for oneSide printing, but I wanter to make it twoSide.

I changed in the documentclass from oneSide to twoSide, and then margines changed as it should be. But the problem was changing headers. Origialy, at the very begining of the document, there is written:

Code: Select all

\rhead{\thepage} % Sets the right side header to show the page number
I have changed this into:

Code: Select all

\fancyhead[RO,LE]{\thepage} % Clears all page headers and footers
Which solved page numbers well, but the problem was with chapter names.
In the original template, at the begining of every chaper I had to write:

Code: Select all

\lhead{Poglavlje \thechapter.\ \emph{Chapter name}}
but when I change this into:

Code: Select all

\fancyhead[LO, RE]{blah blah}
Header positions are correct, but the style isn't. I suppose the style of the chapter names and page numbers in the header is hidden in this lines of .cls file:

Code: Select all

\lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}}
\rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage}
I hope somebody can explain me these two lines, and help me make

Code: Select all

\fancyhead[LO, RE]{blah blah}
has the same style like \rhead.

Many thanks
Post Reply