![章节号和章节标题之间的垂直间距](https://linux22.com/image/279996/%E7%AB%A0%E8%8A%82%E5%8F%B7%E5%92%8C%E7%AB%A0%E8%8A%82%E6%A0%87%E9%A2%98%E4%B9%8B%E9%97%B4%E7%9A%84%E5%9E%82%E7%9B%B4%E9%97%B4%E8%B7%9D.png)
我们如何在章节号(#)和章节标题行之间以及章节标题行和第一段之间留出 25 毫米的垂直间隙。
答案1
构建于章节号和章节标题之间的空格长度,您所追求的空间在\@makechapterhead
for \chapter
(和\@makeschapterhead
for \chapter*
)中给出。以下定义取自report.cls
:
\def\@makechapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\huge\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@% <--- Chapter title & Chapter text
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@% <------- Chapter text and first paragraph
}}
\def\@makeschapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@% <------- Chapter text and first paragraph
}}
可以使用以下方法修补/修改这些值etoolbox
:
\documentclass{report}
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\@makechapterhead}{20\p@}{25mm}{}{}% Correct \chapter
\patchcmd{\@makechapterhead}{40\p@}{25mm}{}{}% ... \chapter
\patchcmd{\@makeschapterhead}{40\p@}{25mm}{}{}% ... \chapter*
\makeatother
\begin{document}
\chapter{A chapter} Some text
\chapter*{Another chapter} Some text
\end{document}