允许在内联公式中换行但不允许分页

允许在内联公式中换行但不允许分页

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}

相关内容