如何在对齐环境的末尾使用 intertext 命令而不添加空行?

如何在对齐环境的末尾使用 intertext 命令而不添加空行?

align我正在使用包的环境amsmath来显示多行方程式。我还使用\intertext相同环境的命令在方程式行之间添加文本。现在,当我\intertext在环境的最后一行使用该命令时align,它会添加一个空的方程式行。你知道一种简单的方法可以防止出现这个空行吗?如果我使用命令\text而不是\intertext,则添加的文本的缩进会发生变化。因此,解决问题的另一种方法可能是强制命令文本以与 intertext 命令相同的方式打印左对齐文本。

这是我的代码:

\begin{align*}
\frac{F_1}{m_1} \leq \frac{F_{12}}{m_{12}} \leq \frac{F_2}{m_2}\\
\intertext{Assuming additivity of mass and that joining the two bodies doesn't affect the force acting on each body (force is additive):}
\frac{F_1}{m_1} \leq \frac{F_1+F_2}{m_1+m_2} \leq \frac{F_2}{m_2}\\
\intertext{which is true iff:}
\frac{F_1}{F_2} \leq \frac{m_1}{m_2}\\
\intertext{which is equivalent to:}
a_1 \leq a_2\\
\intertext{which is always true by hypothesis (the same demonstration applies for $a_2 \leq a_1$)}
\end{align*}

答案1

最后一行不应该属于align

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
\frac{F_1}{m_1} \leq \frac{F_{12}}{m_{12}} \leq \frac{F_2}{m_2}\\
\intertext{Assuming additivity of mass and that joining the two 
  bodies doesn't affect the force acting on each body (force is additive):}
\frac{F_1}{m_1} \leq \frac{F_1+F_2}{m_1+m_2} \leq \frac{F_2}{m_2}\\
\intertext{which is true iff:}
\frac{F_1}{F_2} \leq \frac{m_1}{m_2}\\
\intertext{which is equivalent to:}
a_1 \leq a_2
\end{align*}
which is always true by hypothesis (the same demonstration applies for $a_2 \leq a_1$).

Some more text follows in order to show there's no added space.

\end{document}

在此处输入图片描述

另一方面,我认为没有理由强制对齐这些方程式,我会将它们排版如下。

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
\frac{F_1}{m_1} \leq \frac{F_{12}}{m_{12}} \leq \frac{F_2}{m_2}
\end{equation*}
Assuming additivity of mass and that joining the two bodies doesn't
affect the force acting on each body (force is additive):
\begin{equation*}
\frac{F_1}{m_1} \leq \frac{F_1+F_2}{m_1+m_2} \leq \frac{F_2}{m_2}
\end{equation*}
which is true if and only if
\begin{equation*}
\frac{F_1}{F_2} \leq \frac{m_1}{m_2}\\
\end{equation*}
which is equivalent to
\begin{equation*}
a_1 \leq a_2
\end{equation*}
which is always true by hypothesis (the same demonstration applies for $a_2 \leq a_1$).

\end{document}

在此处输入图片描述

相关内容