0

我有一个像这样的 LaTeX 文档:

\documentclass{article}
\begin{document}

\section{1}
\section{2}
\section{3}
\section{4}
\section{5}
\section{6}
\section{7}
\section{8}
\section{9}
\section{10}
\section{11}
\section{12}
\section{13}
\section{14}
\section{15}
\section{16}
\section{17}
\section{18}
\section{19}
\section{20}
\section{21}
\section{22}
\section{23}
\section{24}
\section{25}
\section{26}
\section{27}
\section{28}
\section{29}
\section{30}

\end{document}

很多章节标题,但没有文字

它产生这样的东西:

如您所见,它将所有部分标题保留在一页上,并且不会将其分成两页。26 以上的所有内容都已从页面末尾消失。

有没有办法让 LaTeX 将这些部分分成多个页面?我不能轻易更改正文的实际内容,因为它是自动生成的。不过,我可以更改序言。有没有办法通过改变序言来做到这一点?

4

2 回答 2

1

在节标题后添加 \mbox{} 将允许分页符。您可以通过以下方式在序言中全局介绍它:

\makeatletter
\g@addto@macro\@afterheading{\mbox{}}
\makeatother

或者

\makeatletter
\expandafter\def\expandafter\@afterheading\expandafter{\@afterheading\mbox{}}
\makeatother

就像在这个expandafter 示例中一样。

于 2010-07-28T15:22:03.537 回答
0

你应该可以用sectsty包做这样的事情

于 2010-07-28T14:50:07.040 回答