4

Is there a way to make the memoir class not display the title of the current chapter, but still have the chapter appear in the table of contents (TOC)?

Ie., using chapter*{Title} will not display the title, but the chapter will not appear in the TOC.

Alternatively, is there a way to make \chapter*{Title}'s appear in the TOC?

4

For the second question use

\chapter*{Chapter title}
\addcontentsline{toc}{chapter}{Chapter title}

For the first one, if with "title of the current chapter" you mean the word "chapter" then the answer is the same, use \chapter* and \addcontentsline

  • Since the chapter I was asking about is in the \frontmatter part I needed to use \chapter*{} with nothing in the braces. Otherwise, works lika a charm. Thanks! – trolle3000 Sep 12 '13 at 18:09
1

For the first question, you can redefine the commands in charge of typesetting the number and title to do nothing; since chapters will no longer be numbered in the document body, you also need to suppress the numbering from the entries in the ToC and this can be easily done patching \@chapter:

\documentclass{memoir}
\usepackage{xpatch}

\def\printchaptername{}
\def\chapternamenum{}
\def\printchapternum{}
\def\afterchapternum{\par\nobreak\vskip-\midchapskip}
\def\printchapternonum{}

\makeatletter
\xpatchcmd{\@chapter}{\protect\chapternumberline{\thechapter}}{}{}{}
\xpatchcmd{\@chapter}{\protect\chapternumberline{\thechapter}}{}{}{}
\makeatother

\begin{document}

\tableofcontents

\chapter{Test chapter}
\chapter{Another test chapter}

\end{document}

An image of the resulting ToC:

enter image description here

An image of one the first page of a chapter:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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