目录中各小节的编号与其标题之间的空格

目录中各小节的编号与其标题之间的空格

我想知道为什么从 10 开始的那些部分的编号和标题之间的空间小于 1 到 9 之间的那些部分的编号和标题之间的空间。我希望它增加,因为编号似乎太靠近标题了。我该如何实现它?我搜索并多次询问这个问题,但我没有得到有用的解决方案。我只是\tableofcontents在我的 documentclass 中使用命令article。这是我的意思的屏幕截图。

在此处输入图片描述

我感谢任何帮助,我希望我的问题不会被标记为重复,因为我没有从任何其他类似问题中获得任何好处。

这是我使用的:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{footskip=15pt}
\usepackage{amsmath}

\usepackage{tocloft}

\begin{document}
\tableofcontents
\end{document}

答案1

 \documentclass[10pt,a4paper]{article}
 \usepackage[utf8]{inputenc}
 \usepackage{geometry}
 \usepackage[svgnames]{xcolor}
 \geometry{footskip=15pt}
 \usepackage{amsmath}
 \usepackage{amssymb}
 \usepackage{tocloft}
 \makeatletter
 \let\stdl@section\l@section
 \renewcommand*{\l@section}[2]{%
   \stdl@section{\textcolor{blue}{#1}}{\textcolor{blue}{#2}}}
 \let\stdl@subsection\l@subsection
 \renewcommand*{\l@subsection}[2]{%
   \stdl@subsection{\textcolor{DarkGreen}{#1}}{\textcolor{DarkGreen}{#2}}}


 \AtBeginDocument{%
   \let\nl@org@contentsline\contentsline
   \def\contentsline#1{%
     \def\nl@current@levelname{#1}%
     \nl@org@contentsline{#1}%
   }%
 }

 % \numberline evaluates \nl@current@levelname to find
 % the horizontal alignment
 \protected\def\numberline#1{%
   \begingroup
     \edef\nl@align{%
       nl@align@%
       \@ifundefined{nl@current@levelname}{}{\nl@current@levelname}%
     }%
     \edef\nl@align{%
       \@ifundefined{\nl@align}\nl@align@{\csname\nl@align\endcsname}%
     }%
     \@ifundefined{nl@numberline@\nl@align}{%
       \errmessage{Unknown alignment '\nl@align' for \noexpand\numberline}%
       \nl@numberline@l{#1}%
     }{%
       \csname nl@numberline@\nl@align\endcsname{#1}%
     }%
   \endgroup
 }

 % Implementations of `\numberline` for the different horizontal alignments
 \newcommand*{\nl@numberline@l}[1]{% left-aligned
   \hb@xt@\@tempdima{#1 \hfil}%
 }
 \newcommand*{\nl@numberline@c}[1]{% centered
   \hb@xt@\@tempdima{\hfil#1 \hfil}%
 }
 \newcommand*{\nl@numberline@r}[1]{% right-aligned
   \hb@xt@\@tempdima{\hfil#1 }%
 }

 % Configuration
 % -------------
 % Horizonal alignment in \numberline:
 %   l: left-aligned
 %   c: centered
 %   r: right-aligned
 % \nl@align@: Default setting
 % \nl@align@<levelname>: Setting for specific level

 \def\nl@align@{r}% default
 \def\nl@align@section{r}

 \makeatother


 \begin{document}
 \tableofcontents
 \newpage
 \section{The First Section}
 \section{The Exterior Algebra of Multiconvectors}
 \subsection{Dual Space}
 \subsection{Permuations}
 \subsection{Multilinear Functions}
 \subsection{The Symmetrizing and Alternating  Operations}
 \subsection{The Tensor Product}
 \subsection{The Wedge Product}
 \subsection{Associativity of The Wedge Product}
 \subsection{A Basics for \textit{k}-Convector}
 \section{Tangent Vectors in $\mathbb{R}^{n}$}
 \subsection{Germs of Functions}
 \subsection{The Tangent Space}
 \subsection{Vector Fields}
 \section{Differential Forms on $\mathbb{R}^{n}$}
 \subsection{Differential 1-Forms and the Differential of a function}
 \subsection{Differential \textit{k}-Forms}
 \subsection{The Exterior Derivative}
 \section{Manifolds}
 \subsection{Differentiability of Mapping and Jacobians}
 \subsection{Topological Manifolds, Compatible charts and Smooth Manifolds}
 \subsection{Smooth Functions on a Manifold}
 \subsection{Smooth Maps Between Manifolds}
 \subsection{Diffeomorphisms}
 \subsection{Partial Derivatives}
 \section{Tangent Vectors and the Tangent Space}
 \subsection{Bases For the Tangents Space at a Point}
 \subsection{The Differential of a Map}
 \section{The Tangent Bundle}
 \subsection{The Topology of The Tangent Bundle}
 \subsection{The Manifold Structure on The Tangent Bundle}
 \section{Smooth Bump Functions}
 \section{Vector Fields}
 \subsection{Smoothness of a Vector Field}
 \section{Differential 1-Forms}
 \subsection{The Differential of a Function and Local Expression for a Diffecrential 1-Form}
 \subsection{The Cotangent Bundle}


 \end{document}

在此处输入图片描述

在此处输入图片描述

在此处输入图片描述

章节编号和标题之间的间距可以通过在 \subsection{~~标题名称} 中使用 ~~ 来设置,这里是在章节编号右侧对齐后的新间距

 \documentclass[8pt,a4paper]{article}
 \usepackage[utf8]{inputenc}
 \usepackage{geometry}
 \usepackage[svgnames]{xcolor}
 \geometry{footskip=15pt}
 \usepackage{amsmath}
 \usepackage{amssymb}
 \usepackage{tocloft}
 \makeatletter
 \let\stdl@section\l@section
 \renewcommand*{\l@section}[2]{%
   \stdl@section{\textcolor{blue}{#1}}{\textcolor{blue}{#2}}}
 \let\stdl@subsection\l@subsection
 \renewcommand*{\l@subsection}[2]{%
   \stdl@subsection{\textcolor{DarkGreen}{#1}}{\textcolor{DarkGreen}{#2}}}


 \AtBeginDocument{%
   \let\nl@org@contentsline\contentsline
   \def\contentsline#1{%
     \def\nl@current@levelname{#1}%
     \nl@org@contentsline{#1}%
   }%
 }

 % \numberline evaluates \nl@current@levelname to find
 % the horizontal alignment
 \protected\def\numberline#1{%
   \begingroup
     \edef\nl@align{%
       nl@align@%
       \@ifundefined{nl@current@levelname}{}{\nl@current@levelname}%
     }%
     \edef\nl@align{%
       \@ifundefined{\nl@align}\nl@align@{\csname\nl@align\endcsname}%
     }%
     \@ifundefined{nl@numberline@\nl@align}{%
       \errmessage{Unknown alignment '\nl@align' for \noexpand\numberline}%
       \nl@numberline@l{#1}%
     }{%
       \csname nl@numberline@\nl@align\endcsname{#1}%
     }%
   \endgroup
 }

 % Implementations of `\numberline` for the different horizontal alignments
 \newcommand*{\nl@numberline@l}[1]{% left-aligned
   \hb@xt@\@tempdima{#1 \hfil}% Distance between titles and page number
 }
 \newcommand*{\nl@numberline@c}[1]{% centered
   \hb@xt@\@tempdima{\hfil#1 \hfil}%
 }
 \newcommand*{\nl@numberline@r}[1]{% right-aligned
   \hb@xt@\@tempdima{\hfil#1 }%
 }

 % Configuration
 % -------------
 % Horizonal alignment in \numberline:
 %   l: left-aligned
 %   c: centered
 %   r: right-aligned
 % \nl@align@: Default setting
 % \nl@align@<levelname>: Setting for specific level

 \def\nl@align@{r}% default
 \def\nl@align@section{r}

 \makeatother


 \begin{document}
 \tableofcontents
 \newpage
     \section{The First Section}
 \section{The Exterior Algebra of Multiconvectors}
 \subsection{~~Dual Space}
 \subsection{~~Permuations}
 \subsection{~~Multilinear Functions}
 \subsection{~~The Symmetrizing and Alternating  Operations}
 \subsection{~~The Tensor Product}
 \subsection{~~The Wedge Product}
 \subsection{~~Associativity of The Wedge Product}
 \subsection{~~A Basics for \textit{k}-Convector}
 \section{Tangent Vectors in $\mathbb{R}^{n}$}
 \subsection{~~Germs of Functions}
 \subsection{~~The Tangent Space}
 \subsection{~~Vector Fields}
 \section{Differential Forms on $\mathbb{R}^{n}$}
 \subsection{~~Differential 1-Forms and the Differential of a function}
 \subsection{~~Differential \textit{k}-Forms}
 \subsection{~~The Exterior Derivative}
 \section{Manifolds}
 \subsection{~~Differentiability of Mapping and Jacobians}
 \subsection{~~Topological Manifolds, Compatible charts and Smooth Manifolds}
 \subsection{~~Smooth Functions on a Manifold}
 \subsection{~~Smooth Maps Between Manifolds}
 \subsection{~~Diffeomorphisms}
 \subsection{~~Partial Derivatives}
 \section{Tangent Vectors and the Tangent Space}
 \subsection{~~Bases For the Tangents Space at a Point}
 \subsection{~~The Differential of a Map}
 \section{The Tangent Bundle}
 \subsection{~~The Topology of The Tangent Bundle}
 \subsection{~~The Manifold Structure on The Tangent Bundle}
 \section{Smooth Bump Functions}
 \section{Vector Fields}
 \subsection{~~Smoothness of a Vector Field}
 \section{Differential 1-Forms}
 \subsection{~~The Differential of a Function and Local Expression for a Diffecrential 1-Form}
 \subsection{~~The Cotangent Bundle}


 \end{document}

在此处输入图片描述

相关内容