# cftXpresnum overlapping with heading [duplicate]

As per the tocloft package documentation, we should be able to use \renewcommand{\cftsecpresnum}{something} to insert some text before the section number in the table of contents (for example, should work for list of tables, list of figures, and a custom list using \newlistof).

However, when I use that command the I want to insert before the section heading entry in the table of contents overlaps with the section heading text. See MWE. Am I missing something here? I did not immediately see an answer to address this, specifically as to whether or not the \cftsecpresnum command from the tocloft works or not. As per below I would have to use \cftsecindent as a work around, but that was not mentioned in the package documentation and not sure if that is the intent.

\documentclass{report}

\usepackage{tocloft}
\renewcommand{\cftsecpresnum}{Something }

\begin{document}

\tableofcontents

\section{what}
Bananas

\section{is the deal}
Apples

\end{document}


## marked as duplicate by Werner, Phelype Oleinik, vonbrand, Kurt, Stefan PinnowJul 6 '18 at 18:57

• Related/duplicate: Roman numerals become “too wide” in table of contents – Werner Jul 5 '18 at 23:01
• That question would have provided me with a solution, and in my mind is the same. But is it acknowledged that it isn't specified (or isn't required to be specified) in the documentation? I have similar comment below as well...how would this be achieved for a custom list? Or new question? – Prevost Jul 6 '18 at 4:38

You have to increase the value if \cftsecnumwidth. here is a solution, using calc:

\documentclass{report}
\usepackage{calc}
\usepackage{tocloft}
\renewcommand{\cftsecpresnum}{Something }
\setlength{\cftsecnumwidth}{\widthof{Something\hspace{2.5em}}}
\setlength{\cftsecindent}{0pt}
\begin{document}

\tableofcontents

\section{what}
Bananas

\section{is the deal}
Apples

\end{document}


• Thank you. That would work and I didn't know/think of calc...is there a way to adjust the equivalent of \cftsecnumwidth for a custom list or would that be a new question? – Prevost Jul 6 '18 at 4:36
• There are ways, with enumitem, which depend on the list type. I think it's better to ask a new question. – Bernard Jul 6 '18 at 8:03