TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

enter image description here

I compiled a memoir document that has "0." prepended with Contents. How can I remove it?

\documentclass[12pt,oneside]{memoir}

\title{Document}
\author{prosseek}

% http://tex.stackexchange.com/questions/97465/modify-default-memoir-chapter-style
\makeatletter
\newcommand{\fonttitle}{\chaptitlefont}
\makechapterstyle{mystyle}{%
\def\chapterheadstart{\vspace*{\beforechapskip}}
\def\printchaptername{}
\def\printchapternum{}
\def\printchapternonum{}
\def\printchaptertitle##1{\fonttitle \space \fonttitle \thechapter.\space \fonttitle ##1}
\def\afterchaptertitle{\par\nobreak\vskip \afterchapskip}
}
\makeatother

\chapterstyle{mystyle}

\begin{document}

\maketitle
\tableofcontents

\chapter{The Domain Problem and Stakeholders}
\section{First}
abcdef. 

\end{document}
share|improve this question
1  
Quick guess: use \frontmatter and \mainmatter declarations in your document. Or, if not writing a full book, use the article option to the class. – jon Sep 30 '13 at 22:33
up vote 5 down vote accepted

Add a conditional test and use \frontmatter and \mainmatter:

\documentclass[12pt,oneside]{memoir}

\title{Document}
\author{prosseek}

% http://tex.stackexchange.com/questions/97465/modify-default-memoir-chapter-style
\makeatletter
\newcommand{\fonttitle}{\chaptitlefont}
\makechapterstyle{mystyle}{%
  \def\chapterheadstart{\vspace*{\beforechapskip}}
  \def\printchaptername{}
  \def\printchapternum{}
  \def\printchapternonum{}
  \def\printchaptertitle##1{%
    \fonttitle \if@mainmatter \thechapter.\space\fi ##1}
  \def\afterchaptertitle{\par\nobreak\vskip \afterchapskip}
}
\makeatother

\chapterstyle{mystyle}

\begin{document}
\frontmatter
\maketitle
\tableofcontents
\mainmatter
\chapter{The Domain Problem and Stakeholders}
\section{First}
abcdef. 

\end{document}
share|improve this answer

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.