0

The sub-section numbers in the ToC are overlapping the title.

I've attempted the solution on this post, but it doesn't work for me.

Below you will find a sample document to recreate the issue.

\documentclass[12pt]{article}
\usepackage[margin=0.5in,headheight=48pt,includeheadfoot]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[table,usenames,dvipsnames]{xcolor}
\usepackage{sectsty}
\usepackage{multirow}
\usepackage{float}
\usepackage{fancyhdr}
\usepackage{arev}
\usepackage{pgfgantt}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{titlesec}
\usepackage{tikz}
\usepackage{outlines}
\usepackage{hyperref}
\usepackage{longtable}
\usepackage{paralist}

% define custom colors \definecolor{primary}{HTML}{8bc34a} \colorlet{primarylight}{primary!60!white} \colorlet{primarylightest}{primary!10!white} \definecolor{secondary}{HTML}{000000} \colorlet{secondarylight}{secondary!60!white} \colorlet{secondarylightest}{secondary!80!white} \definecolor{tertiary}{HTML}{1a237e} \colorlet{tertiarylight}{tertiary!60!white} \definecolor{background}{HTML}{FFFFFF}

% define document formatting \pagestyle{fancy} \rhead{} \rfoot{PROPRIETARY & CONFIDENTIAL} \cfoot{\thepage} \lfoot{OTHER THING} \setlength{\parskip}{0.5em} %\setcounter{secnumdepth}{0} \titleformat{\section} {\normalfont\Large\bfseries\color{primary}}{\thesection}{1em}{}[{\titlerule[0.8pt]}] \setlength{\parindent}{0pt}

% document coloring %\let\oldheadrule\headrule %\renewcommand{\headrule}{\color{secondary}\oldheadrule} \renewcommand{\headrulewidth}{0pt} \sectionfont{\color{primary}} \subsectionfont{\color{secondary}}

% table of contents %\renewcommand{@pnumwidth}{2em}

\renewcommand{\arraystretch}{2.5} \arrayrulecolor{secondarylight}

\title{broken} \author{} \date{March 2022}

\begin{document}

\hypertarget{toc}{} \tableofcontents

\newpage

\section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction} \section{Introduction}

\subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section} \subsection{Sub-section}

\end{document}

overlapping numbers on sub-section title

Edie W.
  • 101

1 Answers1

0

Your question title includes "tocloft attempted" but there is no usepackage{tocloft} in your MWE. So, how did you use tocloft? Have you even read the manual which tells you what it can do for you?

Your MWE is far too long with irrevalent packages and code.

\documentclass{article}
\usepackage{tocloft}
%\setlength{\cftsubsecnumwidth}{7em} % cater for very long subsection numbers, but better
\addtolength{\cftsubsecnumwidth}{{2em} % increase space for subsection numbers by 2em
Peter Wilson
  • 28,066