# How to show subsubsection title but not number in ToC only, while still indenting?

I'm trying to add unnumbered subsubsections to my ToC while keeping it properly indented and without removing the title numbers within the text. Here is the example and code of what I have but don't want:

\documentclass[11pt]{article}
\usepackage{tocloft}

\begin{document}

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
\cftpagenumbersoff{part} % suppress page number in toc for parts
\tableofcontents
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}
\renewcommand{\thesubsection}
{\arabic{subsection}}
\renewcommand{\thesubsubsection}
{\Alph{subsubsection}}
\newpage

\part*{Part}
\section{Section1}
\section{Section2}
\subsection{Subsection1}
\subsubsection{SubsubsectionA}
\subsubsection{SubsubsectionB}
\section{Section3}

\end{document}


When I remove the subsubsection numbering with \setcounter{secnumdepth}{2}, it also removes the indent, flushing it even with the subsection. Below is that result.

I'd also like to avoid the above solution as it removes the title numbers within the text, which I want to keep. Below is the ideal solution I'd like to achieve: A properly indented ToC that includes the subsubsection without section number BUT still includes the section number within the text.

IDEAL SOLUTION

If that's impossible or too difficult, then simply changing the indent space between the subsubsection number and the title would be fine, as in:

LESS IDEAL SOLUTION 1

or

LESS IDEAL SOLUTION 2

Here is a suggestion using package tocbasic instead tocloft (do not use both!):

\documentclass[11pt]{article}

\usepackage{tocbasic}
\DeclareTOCStyleEntry[
pagenumberformat=\gobble,
numwidth=0pt
]{tocline}{part}
\DeclareTOCStyleEntry[
entrynumberformat=\gobble,
numwidth=2em
]{tocline}{subsubsection}
\newcommand\gobble[1]{}

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

\renewcommand{\thesubsection}{\arabic{subsection}}
\renewcommand{\thesubsubsection}{\Alph{subsubsection}}

\begin{document}
\tableofcontents
\clearpage
\section{Section1}
\section{Section2}
\subsection{Subsection1}
\subsubsection{SubsubsectionA}
\subsubsection{SubsubsectionB}
\section{Section3}
\end{document}


Regarding a comment below:

If you want to decrease the space between subsection number and its title in TOC, you can use

\DeclareTOCStyleEntry[
numwidth=1.5em
]{tocline}{subsection}


Then I would change numwidth for subsection too.

Code:

\documentclass[11pt]{article}

\usepackage{tocbasic}
\DeclareTOCStyleEntry[
pagenumberformat=\gobble,
numwidth=0pt
]{tocline}{part}
\DeclareTOCStyleEntry[
numwidth=1.5em
]{tocline}{subsection}
\DeclareTOCStyleEntry[
entrynumberformat=\gobble,
numwidth=1.5em
]{tocline}{subsubsection}
\newcommand\gobble[1]{}

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

\renewcommand{\thesubsection}{\arabic{subsection}}
\renewcommand{\thesubsubsection}{\Alph{subsubsection}}

\begin{document}
\tableofcontents
\clearpage
\section{Section1}
\section{Section2}
\subsection{Subsection1}
\subsubsection{SubsubsectionA}
\subsubsection{SubsubsectionB}
\section{Section3}
\end{document}

• This works great thank you so much! While we're here, would you know how to decrease the huge space between 1 and Subsection1 in the ToC? Apr 25, 2018 at 9:10
• @VincentMQ You can change numwidth for subsection, too. See my updated answer.
– esdd
Apr 25, 2018 at 9:40

The tocloft manual is rather well done and is also a very good reference on LaTeX2e's parameters for table of contents. Here we use the parameters provided by tocloft itself. I recommend you read the manual.

\documentclass[11pt]{article}
\usepackage{tocloft}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{2}
\cftpagenumbersoff{part} % suppress page number in toc for parts

\setlength{\cftsubsubsecindent}
{\dimexpr\cftsubsubsecindent+\cftsubsubsecnumwidth\relax}

\renewcommand{\thesubsection}{\arabic{subsection}}
\renewcommand{\thesubsubsection}{\Alph{subsubsection}}

\begin{document}

\tableofcontents

\newpage

\part*{Part}

• you can naturally adjust the indent to the desired width. The point is that you can use \cftsubsubsecindent on "both sides" of \setlength. For example on right side \cft...indent + 2em inside the \dimexpr.