다른 섹션에 대해 toc의 간격을 제어하는 ​​방법은 무엇입니까?

다른 섹션에 대해 toc의 간격을 제어하는 ​​방법은 무엇입니까?

장 제목 사이에는 이중 공백이 있지만 섹션과 하위 섹션 사이에는 단일 공백이 있는 목차가 필요합니다. 이 문제에 대해 몇 가지 관련 질문이 있다는 것을 알고 있지만 섹션 또는 하위 섹션 앞이나 뒤의 간격을 변경하는 \setlength{\cftbeforesecskip}{-2pt} 또는 같은 제안 솔루션 중 일부를 사용할 때 문제의 제목이 한 줄 길이이면 괜찮다는 차이점이 있습니다. \renewcommand\cftchapafterpnum{\vspace{}}, 그러나 섹션의 긴 세 줄 제목인 경우 섹션 제목 위에 원하는 공간이 있는 매우 불규칙한 간격을 제공하고 페이지 번호 뒤에는 절반 간격처럼 보이고 다시 한 간격으로 표시됩니다.
내가 시도한 또 다른 해결책은 실제 텍스트 내에서 다음과 같은 것을 사용하는 것입니다. \section[\singlespacing{\noindent Long title}]{Long title}그러나 TOC에 단일 간격 줄이 생기더라도 섹션 번호와 섹션 제목의 시작 부분 사이에 원하지 않는 세로 공간이 생기기도 합니다. 계층적 섹션별로 TOC의 간격을 균일하게 변경하는 방법이 있습니까? 아니면 두 번째 접근 방식에서 추가 수직 공간을 피하는 방법이 있습니까? 또한 setspace패키지를 로드하고 문서의 서문에 사용한다는 점을 언급할 가치가 있습니다 \onehalfspacing. 문서의 본문이 1/2 간격이어야 하기 때문입니다. 정말 감사합니다. 제가 가지고 있는 모습은 다음과 같습니다.

\documentclass[12pt,reqno]{report}
\usepackage[titles]{tocloft}
\setlength{\cftbeforesecskip}{-2.5pt}
\setlength{\cftbeforesubsecskip}{-2.5pt}
\usepackage{setspace}
\onehalfspacing
\usepackage{blindtext}
\begin{document}
\tableofcontents
\newpage
\chapter{this is a really really long title that someone else wrote for all the penguins in the world}
\section{this is a really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really long title having more than three lines of text to appear on the toc.}
\subsection{this is a really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really long title having more than three lines of text to appear on the toc.}
\blinddocument
\blinddocument
\blinddocument
\blinddocument
\end{document}

이 MWE에서는 제가 시도한 옵션 중 하나를 보여줍니다. 누군가가 이에 대해 논평할 수 있기를 바랍니다. 감사해요.

답변1

\cftchapafterpnum목차의 장 제목 뒤에 수직 공간을 추가하기 위해 연결할 수 있습니다 .

\documentclass[12pt,reqno]{report}
\usepackage[titles]{tocloft}
\usepackage{blindtext}

\renewcommand{\cftchapafterpnum}{\vspace{\cftbeforechapskip}}

\begin{document}
\tableofcontents
\newpage
\chapter{this is a really really long title that someone else wrote for all the penguins in the world}
\section{this is a really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really long title having more than three lines of text to appear on the toc.}
\subsection{this is a really really really really really really really really really really really really really really really really really really really really really really really really really really really really really really long title having more than three lines of text to appear on the toc.}
\blinddocument
\blinddocument
\blinddocument
\blinddocument
\end{document}

여기에 이미지 설명을 입력하세요

그러나 긴 제목은 문제와 관련이 없습니다. 아마도 기관의 어리석은 요구 사항을 준수하기 setspace위해 를 로드하는 것 같습니다 \onehalfspacing(그렇지 않은 경우 표준 간격을 사용하면 더 행복해질 것입니다).

\singlespacing목차를 작성할 때 발행하십시오 .

\documentclass[12pt,reqno]{report}
\usepackage[titles]{tocloft}
\usepackage{setspace}
\usepackage{blindtext}

\renewcommand{\cftchapafterpnum}{\vspace{\cftbeforechapskip}}

\onehalfspacing

\begin{document}

\begingroup\singlespacing
\tableofcontents
\endgroup

\chapter{this is a really really long title that someone else wrote 
for all the penguins in the world}
\section{this is a really really really really really really really
really really long title having more than three lines of text to appear on the toc.}
\subsection{this is a really really really really really really really
really really really long title having more than three lines of text to appear on the toc.}

\blinddocument

\end{document}

여기에 이미지 설명을 입력하세요

관련 정보