如何在章节标题和第一节条目(报告文档类)之间放置垂直间距。例如,我想要:
第 1 章标题
1.1 标题
1.2 标题第 2 章 标题
1.1 标题
1.2 标题
答案1
您可以使用重新\cftchapafterpnum
定义tocloft
在章节条目后添加垂直空间的包:
\documentclass{report}
\usepackage{tocloft}
\renewcommand\cftchapafterpnum{\vskip15pt}
\begin{document}
\tableofcontents
\chapter{Test Chapter One}
\section{Section One One}
\section{Section One Two}
\chapter{Test Chapter Two}
\section{Section Two One}
\section{Section Two Two}
\end{document}
无需使用额外的包,重新定义内部命令\@chapter
(在 中实现report.cls
)就可以完成这项工作(参见标有 的行a%NEW
):
\documentclass{report}
\makeatletter
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{toc}{\protect\addvspace{15\p@}}% NEW
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
\else
\@makechapterhead{#2}%
\@afterheading
\fi}
\makeatother
\begin{document}
\tableofcontents
\chapter{Test Chapter One}
\section{Section One One}
\section{Section One Two}
\chapter{Test Chapter Two}
\section{Section Two One}
\section{Section Two Two}
\end{document}