防止一系列章节标题超出页面长度

防止一系列章节标题超出页面长度

我正在编写需求文档,并且一直在使用一个简单的模板。我遇到的问题是,当我编译文档时,在某些地方,文本超出了页面。问题的 MWE:

\documentclass{scrreprt}
\begin{document}
\chapter{Specific Requirements}
\section{External Interface Requirements}

\subsubsection{foo}

\section{Functional Requirements}

\subsection{Sign In}

\subsection{Profile Page}

\subsubsection{foo}
\subsubsection{foo}
\subsubsection{foo}
\subsubsection{foo}
\subsubsection{foo}
\subsubsection{foo}
\subsubsection{foo}
\subsubsection{foo}
\subsubsection{foo}
\subsubsection{foo}

\subsubsection{some of these subsections will run off the page}
\subsubsection{some of these subsections will run off the page}
\subsubsection{some of these subsections will run off the page}
\subsubsection{some of these subsections will run off the page}
\subsubsection{some of these subsections will run off the page}
\subsubsection{some of these subsections will run off the page}
\subsubsection{some of these subsections will run off the page}
\subsubsection{some of these subsections will run off the page}
\subsubsection{some of these subsections will run off the page}
\subsubsection{some of these subsections will run off the page}
\subsubsection{some of these subsections will run off the page}
\subsubsection{some of these subsections will run off the page}

\end{document}

如果您编译它,您应该会看到一些标记为“其中一些......”的小节从页面底部延伸出去,并且确实覆盖了页码。

答案1

LaTeX 不允许在章节标题后立即分页。因此,设置仅包含标题的“大纲”将导致文本过长而无有效分页位置,因此您会看到超长效果。与过大的图形一样,您在这里得到的是一张空白页,因为 LaTeX 首先尝试将材料放在第一页上,如果放不下,就将其留在下一页(完整)上,然后简单地转储它所拥有的内容。

您有几个选择。第一个是不用担心:假设这是您自己记忆中的“草图”大纲,您可以简单地等待文档充实。如果您需要能够将输出提供给其他人,则强制中断(\break)或确实正确放置的一些填充文本(“这是填充文本。”)就可以完成工作。

如果你不打算在标题后添加任何文本,那么它们就不是\sections,而是某种形式的列表结构。那些跨页分页:您需要做的是根据需要调整格式。

相关内容