如何增加目录中章节编号和标题之间的间距?

如何增加目录中章节编号和标题之间的间距?

我只是想不出如何在 LaTeX 目录中扩大这个空间: 在此处输入图片描述

梅威瑟:

\documentclass[12pt]{article}

\renewcommand{\thesection}{\Roman{section}}
\renewcommand{\thesubsection}{\arabic{subsection}}

\title{MWE}
\author{John Doe}
\date{August 2022}

\begin{document}
    \maketitle
    As you can clearly see, the "III" is far too close the the title name.
    \tableofcontents
    \clearpage
    \section{Test}
    \section{Test}
    \section{Test}
    \section{Test}
    \section{Test}
\end{document}

我已经尝试过“类似问题”,但无济于事。如能得到任何帮助,我将不胜感激!

答案1

添加包tocloft并使用 更改分配给目录中章节编号的空间\setlength{\cftsecnumwidth}{<space>}。最好使用字体相关单元,如emex

A

\documentclass[12pt]{article}

\usepackage{tocloft}% to configure the ToC <<<<<
\setlength{\cftsecnumwidth}{4.5ex}% set the width to the section number in the ToC <<<<<

\renewcommand{\thesection}{\Roman{section}}
\renewcommand{\thesubsection}{\arabic{subsection}}

\title{MWE}
\author{John Doe}
\date{August 2022}

\begin{document}
    \maketitle
    As you can clearly see, the "III" is far too close the the title name. (not anymore)
    \tableofcontents
    \clearpage
    \section{Test}
    \section{Test}
    \section{Test}
    \section{Test}
    \section{Test}
\end{document}

相关内容