Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

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.

share|improve this answer
    
thank you very much –  Alfatau Sep 30 '12 at 16:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.