![允许在内联公式中换行但不允许分页](https://linux22.com/image/254283/%E5%85%81%E8%AE%B8%E5%9C%A8%E5%86%85%E8%81%94%E5%85%AC%E5%BC%8F%E4%B8%AD%E6%8D%A2%E8%A1%8C%E4%BD%86%E4%B8%8D%E5%85%81%E8%AE%B8%E5%88%86%E9%A1%B5.png)
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}