內嵌公式中允許換行符但不允許分頁符

內嵌公式中允許換行符但不允許分頁符

LaTeX 經常將內聯公式分解為兩行。但是,當它破壞多個頁面上的內聯公式時,我發現它非常分散注意力。例如:

\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1-5]

We could go on like this for some time.  We eventually get $x = 15y + 4z + 3w + 2u - 5v$, which is unpleasant.  In contrast, something like $x = 2y + 3z - 4w - 15u - 4v$ is no problem.
\end{document}

是否有一種全域方法(或者,如果失敗,則有一種本地方法)禁止跨多個頁面的中斷,同時允許跨多個行的中斷?

答案1

在此輸入影像描述

\documentclass{article}
\usepackage{lipsum}
\everymath{\vadjust{\nobreak\null}}
\begin{document}
\lipsum[1-5]

We could go on like this for some time.  We eventually get $x = 15y + 4z + 3w + 2u - 5v$, which is unpleasant.  In contrast, something like $x = 2y + 3z - 4w - 15u - 4v$ is no problem.
\end{document}

相關內容