![Cómo eliminar números de páginas de referencia en la tabla de contenido](https://rvso.com/image/420749/C%C3%B3mo%20eliminar%20n%C3%BAmeros%20de%20p%C3%A1ginas%20de%20referencia%20en%20la%20tabla%20de%20contenido.png)
No he encontrado una solución para esto en línea y no estoy seguro de cómo se llama, pero quiero eliminar los números a la derecha de mi tabla de contenido para mis subsecciones.
aquí está el código que tengo hasta ahora para mi ToC
%align numbers and TOC
\titleformat{\section}{\normalfont\Large\bfseries}{\makebox[30pt][l]{\thesection}}{0pt}{}
\titleformat{\subsection}{\normalfont\large\bfseries}{\makebox[30pt][l]{\thesubsection}}{0pt}{}
%TOC spacing
\usepackage{tocloft}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftsubsecleader}{\hfill}
\setcounter{tocdepth}{2}
\renewcommand{\cftsecafterpnum}{\vspace{0pt}}
\setlength{\cftsecnumwidth}{30pt}
\setlength{\cftsubsecnumwidth}{30pt}
\setlength{\cftsubsecindent}{60pt}
Respuesta1
Añadiendo
\makeatletter
\renewcommand{\cftsubsecpagefont}{\@gobble}
\makeatother
al preámbulo le permitirá lograr su objetivo de formato.
Un MWE completo:
\documentclass{article}
\usepackage{tocloft}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftsubsecleader}{\hfill}
\makeatletter
\renewcommand{\cftsubsecpagefont}{\@gobble}
\makeatother
\renewcommand{\cftsecafterpnum}{\vspace{0pt}}
\setlength{\cftsecnumwidth}{30pt}
\setlength{\cftsubsecnumwidth}{30pt}
\setlength{\cftsubsecindent}{60pt}
\begin{document}
\tableofcontents
\section{Introduction}
\subsection{Goals of the Experiment}
\subsection{Background Information}
\section{Hypothesis}
\end{document}