各个章节编号和标题之间的目录间距

各个章节编号和标题之间的目录间距

使用该tocloft包并\setlength\cftsubsubsecnumwidth{4em}成功更改目录中所有子部分编号和标题的间距。

由于标题和编号“10”和“11”太接近,我该如何更改小节 1.10.10 和 1.10.11 的间距,以匹配前几个小节的间距。

在此处输入图片描述

妈妈:

\documentclass[oneside,12pt]{extarticle}
\usepackage[T1]{fontenc}

\usepackage{tocloft}

\begin{document}

\tableofcontents

\section{title}
\setcounter{subsection}{9}
    \subsection{title}
    \setcounter{subsubsection}{7}
        \subsubsection{title}
        \subsubsection{title}
        \subsubsection{title}
        \subsubsection{title}
    
\end{document}

答案1

~对于奇数分段单元,您可以考虑在目录条目中添加额外的空间(如领带):

在此处输入图片描述

\documentclass{article}

\usepackage{tocloft}

\setlength{\cftsubsubsecnumwidth}{3.5em}% Or whatever default you set for this sectional unit

\begin{document}

\tableofcontents

\section{title}

\setcounter{subsection}{9}
\subsection{title}

\setcounter{subsubsection}{7}
\subsubsection{title}
\subsubsection{title}
\subsubsection[~title]{title}% Alternative title in ToC
\subsubsection[~title]{title}% Alternative title in ToC
\subsubsection[~title]{title}% Alternative title in ToC

\end{document}

答案2

试试这个。它将本地更改放入目录本身。

% tocspacesprob.tex  SE 634180

\documentclass[oneside,12pt]{extarticle}
\usepackage[T1]{fontenc}

\usepackage{tocloft}
\setlength{\cftsubsubsecnumwidth}{4em}  %% added to match your question's description

\begin{document}

\tableofcontents

\section{title}
\setcounter{subsection}{9}
    \subsection{title}
    \setcounter{subsubsection}{7}
        \subsubsection{title}
        \subsubsection{title}
 \addtocontents{toc}{\addtolength{\cftsubsubsecnumwidth}{1em}} %% added to locally increase space
        \subsubsection{title}
        \subsubsection{title}
 \addtocontents{toc}{\addtolength{\cftsubsubsecnumwidth}{-1em}} %% added to revert to "normal" space
        \subsubsection{title}
    
\end{document}

在此处输入图片描述

相关内容