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.

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

1 Answer 1

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.