我的文档中有页面\parskip
被拉伸。结果就是章节标题下面的文本与后面的文本距离太远。如何让章节标题与后面的段落保持恒定的距离?
梅威瑟:
\documentclass[12pt]{scrbook}
\usepackage[top=80mm]{geometry}
\usepackage{calc}
\RedeclareSectionCommand[%
beforeskip= 0.5\baselineskip plus 2\baselineskip minus 0.1\baselineskip,
afterskip=\parskip]{section}
\setparsizes{0em}{0.1\baselineskip plus 1\baselineskip}{0.5em plus 1fil}
\newcommand{\lsec}{%
\section{Small sec}
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par}
\newcommand{\msec}{%
\section{Medium sec}
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\par}
\begin{document}
\lsec\lsec\lsec\msec\lsec\lsec
\end{document}
也就是说,虽然段落之间的距离可能不等,但 AAA 与每个标题之间的距离应该相等。
我尝试改变afterskip=1sp
,但仍然留下\parskip
或parfillskip
值(我无法从cls
文件中分辨出哪个是哪个。)
答案1
应用以下补丁似乎可以解决问题:
% Removes glue around section titles.
\RequirePackage{xpatch}
\xapptocmd{\sectionlinesformat}{\vspace*{-\parskip}}{}{\PatchFailed}