梅威瑟:
\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>}
。最好使用字体相关单元,如em
或ex
。
\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}