我需要更好地控制以上显示简短跳过当最后一行文本比其下方的等式短时。我当前的解决方案是一种黑客行为,使用起来很尴尬。例如,请参见下面的 MWE 示例及其预览图:
\documentclass[11pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[nomath]{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot,showframe]{geometry}
\usepackage[nodisplayskipstretch]{setspace}
\setstretch{1.1}
\raggedbottom
\usepackage{microtype}
\usepackage{nccmath,amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{tensor}
\newcommand*{\topless}{\vspace{\glueexpr\abovedisplayshortskip-\abovedisplayskip}}
\begin{document}
\setlength{\abovedisplayskip}{2ex}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayskip}{\abovedisplayskip}
\setlength{\belowdisplayshortskip}{\belowdisplayskip}
\setlength{\jot}{3ex}
\noindent
This is just a test, to see what will happen next and the equation below this dummy text sample:
\begin{align}
y^2 + x^2 - z^2 = 1
\end{align}
This is just a test, to see what will happen next and the equation below this dummy text sample:
\topless
\begin{align}
y^2 + x^2 - z^2 = 1
\end{align}
This is just a test, to see what will happen next and the equation below this dummy text sample:
\begin{equation}
y^2 + x^2 - z^2 = 1
\end{equation}
This is just a test, to see what will happen next and the equation below this dummy text sample which has no meaning:
\begin{equation}
y^2 + x^2 - z^2 = 1
\end{equation}
This is just a test, to see what will happen next and the equation below this dummy text sample which has no meaning at:
\begin{equation}
y^2 + x^2 - z^2 = 1
\end{equation}
This is just a test, to see what will happen next and the equation below this dummy text sample which has no meaning at:
\topless
\begin{equation}
y^2 + x^2 - z^2 = 1
\end{equation}
This is just a test, to see what will happen next and the equation below this dummy text sample:
\begin{gather}
y^2 + x^2 - z^2 = 1
\end{gather}
\end{document}
目前,我可以使用我调用的宏来减少方程 (1)、(5) 和 (7) 的垂直间距\topless
,但这真的很麻烦,因为我需要预测间距问题。我只能在第一次编译后使用该命令,而且它不太可靠(特别是当我需要更改文本或字体大小时)。
我需要一个自动解决方案在前导级别,适用于任何环境(方程、对齐、收集等)。
正如您在预览中看到的,方程环境对 displayshortskip 最小限制有更好的容忍度(见(3)、(4)和(5)。重叠限制很小),而对齐和聚集环境具有更低的容差(重叠限制相当大!)。我讨厌这样!我想摆脱我的 hack 风格宏,但当最后一行文本接近其下方显示的方程式时,仍然减少垂直间距。我的限制是1ex在尺寸方面。
当最后一行文本的末尾接近显示屏时,我们是否可以访问 LaTeX 用于更改垂直间距的大小限制?我想将该限制减少到大约1ex大小。这可能吗?如果可以,我们如何在序言中实现这一点?