7

I need help with page layout in memoir. I want to have an unnumbered chapter0 (i.e. introduction) but when using the \chapter starred version the chapter headers is wrong. This is my example source:

\documentclass[14pt,extrafontsizes,a4paper,twoside,final]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[T1]{fontenc}
\usepackage{indentfirst}
\usepackage{microtype}
\usepackage{lipsum}

\raggedbottomsection

\begin{document}
%
\OnehalfSpacing
%
\frontmatter
\thispagestyle{empty}
\begin{DoubleSpace}
\tableofcontents*
\end{DoubleSpace}
\clearforchapter

\mainmatter

\pagestyle{ruled}
\chapter*{chapter0}
\label{chap:chapter0}

\lipsum
\lipsum
\lipsum

\chapter{chapter1}
\label{chap:chapter1}

\section{ch1-s1}
\lipsum
\section{ch1-s2}
\lipsum
\section{ch1-s3}
\lipsum
\lipsum

\chapter*{last}
\label{chap:last}

\lipsum
\lipsum
\end{document}

And the problem is in chapter0 and in "last". Can you help me?

0

1 Answer 1

10

Use the optional argument provided for \chapter (works for \chapter* as well):

\chapter*[chapter0]{chapter0}

This will set the \chaptermark accordingly, and correct the headers. Why is this the case? Let's look at \@m@mschapter from memoir.cls:

\newcommand{\@m@mschapter}[2][\@empty]{%
  \@schapter{#2}%
  \ifx \@empty#1
    \def\f@rhdr{#2}%
  \else%                    opt arg
    \def\f@rhdr{#1}%
    \setcounter{secnumdepth}{-10}%
    \chaptermark{#1}%
    \setcounter{secnumdepth}{\value{maxsecnumdepth}}%
  \fi
  \ifanappendix
    \memappchapstarinfo{\f@rhdr}{#2}%
  \else
    \memchapstarinfo{\f@rhdr}{#2}%
  \fi
  \ifheadnameref\M@gettitle{\f@rhdr}\else\M@gettitle{#2}\fi}

The optional argument is set to \@empty if not specified manually. Subsequently, the macro conditions on whether #1 (the optional argument) is \@empty or not, and specifying \chaptermark accordingly.

Note that using \label in an un-numbered sectional unit doesn't help.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .