![목차에서 참조 페이지 번호를 제거하는 방법](https://rvso.com/image/420749/%EB%AA%A9%EC%B0%A8%EC%97%90%EC%84%9C%20%EC%B0%B8%EC%A1%B0%20%ED%8E%98%EC%9D%B4%EC%A7%80%20%EB%B2%88%ED%98%B8%EB%A5%BC%20%EC%A0%9C%EA%B1%B0%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95.png)
온라인에서 이에 대한 해결책을 찾지 못했고 이름도 확실하지 않습니다. 그러나 내 하위 섹션의 목차 오른쪽에 있는 숫자를 제거하고 싶습니다.
여기 내 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}
답변1
첨가
\makeatletter
\renewcommand{\cftsubsecpagefont}{\@gobble}
\makeatother
서문을 참조하면 형식 지정 목표를 달성할 수 있습니다.
전체 MWE:
\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}