2

How do you remove the red-filled circle generated with tikz in the table of contents for entries without a number (i.e. the List of Figures entry) as shown below:

enter image description here

The above is made with the following minimal working example:

\documentclass{book}

\usepackage{tikz}
\usepackage{tikzpagenodes}
\usepackage{titletoc}

\titlecontents{chapter}[0pt]
    {\tikz\draw[black,fill=red] (0,0) circle (.5ex);\hspace{1em}}
  {\bfseries\thecontentslabel\quad}
  {}
  {\hfill\bfseries\contentspage}

\begin{document}

\tableofcontents
\addcontentsline{toc}{chapter}{\bfseries\listfigurename}
\chapter{One}

\end{document}

1 Answer 1

2

The complete syntax is

\titlecontents{⟨section⟩}[⟨left⟩]{⟨above-code⟩}{⟨numbered-entry-format⟩}{⟨numberless-entry-format⟩}{⟨filler-page-format⟩}[⟨below-code⟩]

Instead of misusing the above-code field to add your circle, use separate definitions for numbered and numberless entries.

\documentclass{book}

\usepackage{tikz}
\usepackage{tikzpagenodes}
\usepackage{titletoc}


\titlecontents{chapter}[0pt]{}{\tikz\draw[black,fill=red] (0,0) circle (.5ex);\hspace*{0.2cm}\bfseries\thecontentslabel\quad}{\bfseries\thecontentslabel\quad}
{\hfill\bfseries\contentspage}[]

\begin{document}

\tableofcontents
\addcontentsline{toc}{chapter}{\bfseries\listfigurename}
\chapter{One}

\end{document}

enter image description here

0

You must log in to answer this question.

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