# Missing dots in ToC for chapters

I am using the starred version of \chapter and \section to avoid the numbering of chapter and section. To have the title of chapters in ToC I use \addcontentsline{toc}{<xxx>}.

This results in no dots between title of chapter and page number in the ToC.

How do I get the dots back in the line?

• You should use \setcounter{secnumdepth}{-1} instead of \chapter* and \section* all over. In this way you'll need no explicit \addcontentsline. – egreg Oct 8 '14 at 8:17

## 1 Answer

The default layout of the ToC for chapters (starred or not) under memoir is to have no dots. This is set internally by

\newcommand{\cftchapterdotsep}{\cftnodots}


If you want dots, it's best to set it to match that of the sectional unit dots, which is the same as \cftdotsep. As such, using

\renewcommand{\cftchapterdotsep}{\cftdotsep}% Chapters should use dots in ToC


works.

\documentclass{memoir}
\renewcommand{\cftchapterdotsep}{\cftdotsep}% Chapters should use dots in ToC
\begin{document}
\tableofcontents
\chapter{A chapter}
\chapter*{A starred chapter}
\addcontentsline{toc}{chapter}{\protect\numberline{}A starred chapter}
\section{A section}
\end{document}

• However, in your screenshot there aren't dots for the last level of headings for an entry. How to fix that? – Zelphir Kaltstahl Jan 1 '16 at 4:30
• @Zelphir: What do you mean by "last level"? – Werner Jan 1 '16 at 9:45
• For example there is the following: 1 A chapter instead of 1. A chapter For me this sounds wrong. I don't know how it is in English, but at least in German you'd rather say "First ... A chapter", so you'd use an ordinal number, instead of just a number. That's why I'd like to have a dot there. Also I think it's more logical: "The first chapter is A chapter" (in that order, reading from left to right) instead of "One chapter is A chapter." not including any indication that the number stands for a rank within the chapter hierarchy. – Zelphir Kaltstahl Jan 1 '16 at 12:54