When we write larger works, one of the places we have the most stylistic freedom is with chapter pages. The chapter page is meant to break off the flow of pages and present something new. Looking through books on the book-case we see a wide-ranging difference in chapter styles. While the standard chapter style (as seen below) is pretty decent, there's a long way to the chapter styles of books like Unicode Standard 5.0, A History of Mathematics, or Fundamentals of Human Neuropsychology.

Standard chapter style

There are plenty of different styles we can think up to create on our own, or by mimicking others' designs (do note that exactly reproducing someone else's design is probably a copyright infringement in plenty of places. Yay for copyright law). So instead of showing you just one style, I will try to explain the fundamentals of chapter styling by looking at the commands used, and then giving several examples ranging from the simple to the quite complex.

Before we continue, it would probably be prudent for me to point out that LaTeX contains two kinds of chapters: numbered (the normal chapters) and unnumbered (the table of contents, the bibliography, the index, and chapters placed in the front matter). The main difference is, of course, that numbered chapters contain the text ‘Chapter 1’ (for chapter one, obviously), and unnumbered chapters do not. At least in the default setup.

In memoir, the default numbered chapter is defined as written below (from page 86 of the manual):

\chapterheadstart \printchaptername \chapternamenum \printchapternum \afterchapternum \printchaptertitle{Title goes here} \afterchaptertitle

In their default definitions the print methods also make use of the following commands that define font settings: \chapenamefont, \chapnumfont, and \chaptitlefont. This information is almost all we need in order to create our own fantastic chapter styles. The last thing before we embard on experimenting with styles is to know how to create and use different chapter styles. This is accomplished using the \makechapterstyle{stylename}{commands} command, where commands is a series of redefinitions of the above-mentioned commands, and in order to use this style, we can use the command \chapterstyle{stylename}.

As a very easy beginning, let's add some colour to the chapter style, by creating a ‘colour’ chapter style:

\usepackage{xcolor} \makechapterstyle{colour}{ \renewcommand*{\chapnamefont}{\normalfont\huge\bfseries\color{blue}} \renewcommand*{\chaptitlefont}{\normalfont\Huge\bfseries\color{blue}} } \chapterstyle{colour}

This style only redefines the fonts and leaves the rest of the chapter style intact as default. If we only had numbered chapters then redefining the \chapnamefont would be adequate, as the colour seeps through to the other commands, but since \chapnamefont is never called for unnumbered chapters, we also need to provide the colour for the \chaptitlefont command. For those not deeply into the LaTeX command architecture, then the star after \newcommand and \renewcommand means that the content of the command cannot contain a paragraph change, so for simple inline commands, tag the star on for verification purposes. Adding our new chapter style to our document we get the following page:

Colour chapter style

This, actually, did little to make the chapter style prettier, if I have to be a bit self-critical for a moment. Let us instead try to be a tad more artistic with our usual black and white palette. Using the tikz package that I have written about before, we can draw a black box with the chapter number inside and then have the title below, and this time let us make it right-aligned.

\usepackage{tikz} \makechapterstyle{box}{ \renewcommand*{\printchaptername}{} \renewcommand*{\chapnumfont}{\normalfont\sffamily\huge\bfseries} \renewcommand*{\printchapternum}{ \flushright \begin{tikzpicture} \draw[fill,color=black] (0,0) rectangle (2cm,2cm); \draw[color=white] (1cm,1cm) node { \chapnumfont\thechapter }; \end{tikzpicture} } \renewcommand*{\chaptitlefont}{\normalfont\sffamily\Huge\bfseries} \renewcommand*{\printchaptertitle}[1]{\flushright\chaptitlefont##1} }

This probably requires a bit more explanation. We disable printing ‘Chapter’ for the chapter style by overriding the \printchaptername command with an empty body. Then we change the font for the chapter number to be sans-serif (\sffamily), and the same for the chapter title. Also we ensure that the chapter title is flushed right, that is it aligns to the right margin. Lastly we have the tikzpicture in the \printchapternum. Inside that we draw a black triangle that's a 2cm square, and after that we print the chapter number in the middle of it. Fairly straightforward, eh? Using this chapter style in your document yields the following output:

Box chapter style

This is, indeed, a lot better, but there are plenty of other options for chapter styles to try out. We can combine some of the concepts in the last few chapter styles we've tried:

\usepackage{xcolor,calc} \makechapterstyle{combined}{ \setlength{\midchapskip}{-60pt} \setlength{\afterchapskip}{2.5cm} \renewcommand*{\printchaptername}{} \renewcommand*{\chapnumfont}{\normalfont\sffamily\bfseries\fontsize{80}{0}\selectfont} \renewcommand*{\printchapternum}{\flushright\chapnumfont\textcolor[rgb]{.64,.79,.87}{\thechapter}} \renewcommand*{\chaptitlefont}{\normalfont\sffamily\Huge\bfseries} \renewcommand*{\printchaptertitle}[1]{% \raggedright\chaptitlefont\parbox[t]{\textwidth-3cm}{\raggedright##1}} } \chapterstyle{combined}

First we set up some distances. The -60pt fits approximately on eye measurement the amount that you need to back up for the chapter number and title to align at the top. Normally it would be better to redefine more of the chapter style to create explicit boxes for the two things that could be top-aligned, but that's a lot more work and would actually obscure how to use the chapter styles easily, so eye measurement it is. We make the chapter number really big (80 pt to be exact), and we print it in the RGB value (0.64, 0.79, 0.87) where colours are in [0;1] for those of mathematical inclination. Lastly we print the chapter title inside a paragraph box that is 3 cm smaller than the text width in order not to have the chapter title written on top of the chapter number as that doesn't look particularly smashing. Adding this to our document gives us the following output:

Combined chapter style

We have now seen several different kinds of chapter styles that can be (more or less) easily customised using memoir's functionality. Creating your own chapter style is thus just a matter of overriding a couple of methods and inserting some code. Doing this gives a tremendous difference between a cookie-cutter template of a document and a customised, personal document of high quality. For those of you who need even more examples of different chapter styles, you can refer to the Memoir Chapter Style Samples document by Lars Madsen from Århus universitets institut for matematiske fag. But the most important aspect is, of course: experiment.

In closing, these are the relevant items to override in the standard setup. You may change commands so some of them become irrelevant or not used.

  • Lengths: \beforechapskip, \midchapskip, and \afterchapskip
  • Fonts: \chapnamefont, \chapnumfont, and \chaptitlefont
  • Printing text: \printchaptername, \printchapternum, and \printchaptertitle
  • More technical surrounding blocks: \chapterheadstart, \afterchapternum, \printchapternonum, and \afterchaptertitle

For more technical details, consult the memoir manual or class file.