我定义了类似于下面 MWE 中的分段命令\task
和。不知何故,将 a 放在a 后面会导致 LaTeX 允许在两者之间进行分页。如果没有,分页符会出现在 之前(应该如此)。\subtask
\label
\task
\subtask
\label
\task
这是为什么?
\documentclass{scrartcl}
% create the sectioning commands \task and \subtask
\DeclareNewSectionCommand[%
style=section, level=1, afterskip=1sp plus .2ex, beforeskip=-3.5ex plus -1ex minus -.2ex, font=\Large, indent=0em, tocindent=0em, tocnumwidth=1.5em%
]{task}
\DeclareNewSectionCommand[%
style=section, level=2, counterwithin=task, afterskip=-0em, beforeskip=-2ex plus -1ex minus -.2ex, font=\Large, indent=0em, tocindent=2em, tocnumwidth=0em%
]{subtask}
\begin{document}
\task{one}
foo\\[47em]
bar
% here, the pagebreak occurs before the \task
\task{two}
\subtask{three}
baz
\clearpage
\task{one}
foo\\[47em]
bar
% here, the pagebreak occurs between the \task and the \subtask
\task{two}
\subtask{three}\label{asdf}
baz
\end{document}