Document Classesproblems with customising headers using memoir

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
alexander van loon
Posts: 11
Joined: Tue Jun 02, 2009 5:49 pm

problems with customising headers using memoir

Post by alexander van loon »

I have a one-sided document using the memoir document class. By default chapters open with an empty header and the page number in the footer (AFAIK the plain page style according to the memoir manual) and the following pages of the chapter use by default an empty footer and the page number in the header, as well as the name of the chapter or section depending on if it's an odd or even page (AFAIK the headings page style).

Now what I want to do is to create more consistency, I want the page number of the headings page style to be in the footer as well, and remove the page number from the header. Because it's a one-sided document I want the content of the header centered instead of aligned to the right or left.

I've been searching for hours for a solution this morning. Placing the page number in the footer is easy:

Code: Select all

\makeevenfoot{headings}{}{\thepage}{}
\makeoddfoot{headings}{}{\thepage}{}
But modifying the header is not. I found topic here which describes my problem exactly, but the solution given requires using fancyhdr, while I'd rather restrict myself to using memoir itself. There is another topic related to the problem, where another suggestion is given to use fancyhdr.

After even more searching – which turned up quite a lot of Usenet posts, which didn't help me much – I found this document describing how to use page styles in memoir which was quite helpful. Of course I already read the manual of memoir, but for a newbie like me it was quite difficult to understand.

The document I mentioned gives some examples, which I used in my own document to learn how memoir's page styles work. For example I copied the following code on page 19 of the document to my own document:

Code: Select all

\addtopsmarks{headings}{}{
  \createmark{chapter}{both}{shownumber}{}{. \space}
}
When I compiled the document it gave me error messages, Undefined control sequence \addtopsmarks and Undefined control sequence \createmark. The document apparently assumes that the memoir release of 2008 is used, this led me to believe that my version of memoir is out of date. I checked out the contents of /usr/share/texmf-texlive/tex/latex/memoir to see if there was any indication of a release date of my current version of memoir somewhere. The files memoir.cls and mempatch.sty give dates of 2005/09/25 and 2007/01/22 respectively. I got memoir from the texlive-latex-recommended package which shipped with Ubuntu 9.04 a.k.a. Jaunty Jackalope, which was released just a few months ago. I guess the Ubuntu package must be quite out of date then.

I assume that I should download the latest memoir package from CTAN then (just download memoir.zip?), but if I installed the package manually as described here, would LaTeX overlook the old version of memoir then, and use the latest one which was manually installed?

Or is there an easier solution to my problem, so that I can modify my header with my possibly outdated version of memoir, or anything else?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

problems with customising headers using memoir

Post by localghost »

Perhaps a paper from the PracTeX journal will be of help [1]. It describes in detail how to setup page styles with the memoir class.

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


Best regards and welcome to the board
Thorsten
alexander van loon
Posts: 11
Joined: Tue Jun 02, 2009 5:49 pm

Re: problems with customising headers using memoir

Post by alexander van loon »

I appreciate the help localghost, but you linked to the same article as I did in my post. In my post I described how I used an example from that document, which gave me the error messages I mentioned. This led to me to the question if this is caused by the memoir version which I'm using being out of date.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

problems with customising headers using memoir

Post by localghost »

Sorry, didn't take the time to check out all the links in your post. You could insert the \listfiles command to your code, start a run and then check the log file (section between *File List* and ***********) to get information about the version of the used document class. Compare this with the current version available on CTAN. Update your LaTeX system if necessary.
alexander van loon
Posts: 11
Joined: Tue Jun 02, 2009 5:49 pm

problems with customising headers using memoir

Post by alexander van loon »

Thanks for your help. I used the /listfiles command and noticed that my memoir version was indeed outdated. To update my memoir package let me tell me exactly what I did, so other newbies who read this won't be confused.

First go to the aforementioned memoir page on CTAN and the page on the LaTeX page on the Ubuntu wiki. Read the instructions, but don't follow them exactly. Both pages mention that you should execute a command on the memoir.ins file, but that won't be necessary. Create the directory texmf in your home directory. Then download the file memoir.tds.zip from CTAN and extract it to the texmf directory. Then execute the command texhash ~/texmf like the Ubuntu wiki says. Compile your document again and the new version of memoir you just downloaded and installed should be used, it will take precedence over the outdated memoir package which was installed system-wide through the Ubuntu package.

After I updated my memoir package the error messages went away, and my problem is fixed now.

For example, here is my .tex file, and here is my PDF document.
Post Reply