Document ClassesMemoir - Chapters & Headers

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
Julian_S_Moore
Posts: 72
Joined: Sun Nov 16, 2008 1:26 pm

Memoir - Chapters & Headers

Post by Julian_S_Moore »

I know this is a tedious question, but one can only read a manual so many times before admitting I just don't get this (It doesn't help that I'm now working to a deadline... I'm even dreaming LaTeX :( )

I want to put the title of a chapter on the 1st page of a chapter, and to repeat the chapter title in both (at least) one header.

Using \chapter{MyChapterTitle} what command do I use to get "MyChapterTitle" into the header. Does it matter whether I define the pagestyle before the \makechapterstyle?

Thanks...

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Memoir - Chapters & Headers

Post by localghost »

A minimal working example (MWE) would have been nice that shows your recent efforts. For the present you can start with a small paper written by the maintainer of the memoir class [1]. This should answer the most questions.

[1] The PracTeX Journal - Lars Madsen: Page Styles on steroids (or, memoir makes page styling easy)


Best regards
Thorsten¹
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Memoir - Chapters & Headers

Post by meho_r »

The first page of a chapter automatically use chapter pagestyle in memoir class. You can use \aliaspagestyle to assign a different custom header to the first page of a chapter too. Here's an example:

Code: Select all

\documentclass{memoir}

\usepackage[english]{babel}

\usepackage{blindtext}

\makepagestyle{myheadings}
\makeevenhead{myheadings}{\thepage}{\leftmark}{}
\makeoddhead{myheadings}{}{\rightmark}{\thepage}

\pagestyle{myheadings}

\makepagestyle{chapfirst}% Just for the first page of a chapter
\makeoddhead{chapfirst}{}{\leftmark}{\thepage}

\aliaspagestyle{chapter}{chapfirst}% customizing chapter pagestyle

\begin{document}

\blinddocument

\end{document}
EDIT: Thanks for the link, localghost.
Post Reply