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.

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?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

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

share|improve this answer
    
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
add comment

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

share|improve this answer
add comment

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.