# How to change TOC counters without affecting the document?

I am using book class with XeLaTeX. I want to change the toc counter 'I' (as shown here),

with a bullet but redefining the Roman alphabets will also change the alphabets in the main document (as shown in here)

which will then probably look like 'Part (bullet)' which makes no sense. Hence I want to separate the toc counter from the part definition.

MWE -

\documentclass[11pt]{book}
\raggedright

\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\part{The Part}
\chapter{The Chapter}
\section{The Section}
\end{document}


This is just an additional thought and not the main issue, but as I am also using hyperref and it automatically creates the outline for the pdf. As of now I am seeing the same entity which is in the part definition in the outline also.

This means if we replace the counter with a bullet it will be changed in the outline too, therefore I'll prefer a unicode-based bullet. Is it possible?

• If you look in the aux file, you will see \numberline{I} The Part which was created by \part using \addcontentsline. You will have to modify \part to not do that. See tex.stackexchange.com/questions/490987/… – John Kormylo May 17 at 19:11
• But if I change \part, won't it also change the part name in the document? eg. I'm getting I. Part in the toc, which I don't want, but because of the same definition I'm also getting Part I in the document. I don't want to loose it. So is there any way to separate these two? – Niranjan May 18 at 4:03
• @JohnKormylo please check the screenshots attached. – Niranjan May 18 at 4:04
• The link was to show an example of replacing \part, not to implement your particular modifications. – John Kormylo May 18 at 15:09

in book the formatting of the part entry in the toc is quite hard-coded. So you need to redefine an internal command (before loading hyperref). This will change both the toc and the bookmarks:

\documentclass[11pt]{book}
\usepackage{etoolbox}
\makeatletter
\patchcmd\@part{\thepart}{\textbullet}{}{\fail}
\makeatother
\raggedright

\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\part{The Part}
\chapter{The Chapter}
\section{The Section}
\end{document}


• Thank you so much man! Great job – Niranjan May 19 at 12:42
• I'm not a man, I'm a woman. – Ulrike Fischer May 19 at 12:43
• Lol. I'm sorry for that, but thanks a ton. – Niranjan May 19 at 12:47
• What if one wants to change the toc and not the outline? Is there any way to redefine toc separately and outline separately? – Niranjan May 26 at 7:06
• If you have a new question ask a new question don't ping only me for support. – Ulrike Fischer May 26 at 7:11