2

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}
egreg
  • 1,121,712
prosseek
  • 6,033
  • 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

1 Answers1

5

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}
egreg
  • 1,121,712