GeneralRedefining \leftmark and \rightmark

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Redefining \leftmark and \rightmark

Post by meho_r »

Hi,

How to redefine \leftmark and \rightmark to correspond to \part and \chapter instead of \chapter and \section? Is there some thorough explanation of these (preferably with practical examples)?

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

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Redefining \leftmark and \rightmark

Post by Stefan Kottwitz »

Hi meho_r,

have a look at the fancyhdr packlage. Following the link to this package you will find its documentation, training slides and examples. The documentation also provides basic information about LaTeX marks using \leftmark and \rightmark.
If you use KOMA classes the scrpage2 package is a recommendable alternative.

Stefan
LaTeX.org admin
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Redefining \leftmark and \rightmark

Post by meho_r »

Thanks. I read fancyhdr docs but there is one small problem: there is no \partmark and that's exactly what I need - to make leftmark correspond to \part and rightmark to \chapter (not default leftmark=chapter and rightmark=section). Any ideas?
Noviomagum
Posts: 6
Joined: Mon Oct 13, 2008 3:56 pm

Re: Redefining \leftmark and \rightmark

Post by Noviomagum »

I've got exactly the same problem (and therefore same question). Is there a way to put the part-title in the \leftmark or \rightmark? Or is there any other way to put it in the header using fancyhdr?
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Redefining \leftmark and \rightmark

Post by Juanjo »

Search for \partname in this long web page. It may help. For other approach, see the answers of gmedina in this page.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Post Reply