I would like to give a custom style to my table of contents, in a memoir document.

My goal is to make it look like in the image below, more specifically underline the entire line for sections and nothing for subsections, instead of having dots like with the default style:

what I would like to do

I know the tocloft package can be used to some extent, but I didn't find how to use it to do that. I saw someone mixing its use with tikz figures but I hope there is an easier way to do it.

  • Welcome to TeX.SX! Please add a small but compilable example document to your questions that show how yout ToC currently looks like and that can be used as a basis for the modifications you want.
    – siracusa
    Commented Sep 17, 2019 at 23:09
  • Just out of curiosity, where is the line suppose to be if the entry is multilined?
    – daleif
    Commented Sep 18, 2019 at 9:09
  • @daleif under the second line (if what you mean is: when the chapter title needs to be written on more than one line)
    – Seldi
    Commented Sep 18, 2019 at 10:43
  • Then that is easy in memoir, see my answer
    – daleif
    Commented Sep 18, 2019 at 11:05

2 Answers 2


This is pretty simple with titletoc:

\documentclass[a4paper,twoside french]{book}
\usepackage{fourier, erewhon}

[0em] %
{\thecontentslabel.\enspace}%numbered chapters
{}%unnumbered chapters

[1.8em] %

[4.1em] %



\chapter{Premier paragraphe}
    \section{Premier sous-paragraphe}
    \section{Deuxième sous-paragraphe}
\chapter{Deuxième paragraphe}
    \section{Premier sous-paragraphe}
        \subsection{Première sous-section}
        \subsection{Deuxième sous-section}
    \section{Deuxième sous-paragraphe}
    \section*{Conclusion du deuxième paragraphe}\addcontentsline{toc}{section}{Conclusion du deuxième paragraphe}



enter image description here


In memoir this can be done with a one-liner


We basically look at the pseudocode for how ToC entries are build. At the end we have \cftchapterafterpnum\par. By default \cftchapterafterpnum is empty. So we use it to insert our own stuff after the page number. Just remember to start it with \par such that the line is a paragraph on its own.

This has not been optimised against page breaks.

  • This one also works, and is more simple
    – Seldi
    Commented Sep 18, 2019 at 14:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .