对齐环境中的长解释;想分成两行

对齐环境中的长解释;想分成两行

我有一个align如下的环境:

\documentclass{article}
\usepackage{amsmath}
\newcommand\compose{\circ}
\newcommand\bd{\mathbf{d}}

\begin{document}
\begin{align*}
\sum_i [\int_M (\phi_i f)\,\bd V] &= \sum_i [\int_A (\phi_i\compose \alpha)(f\compose\alpha)V(D\alpha)] && \text{by definition} \\
&= \int_A [\sum_i (\phi_i\compose \alpha)(f\compose\alpha)V(D\alpha)] &&  \text{because the sum converges uniformly on compact subsets of $A$} \\
&= \int_A [\sum_i (f\compose\alpha)V(D\alpha)] && \text{because $\sum_i (\phi_i\compose\alpha)=1$ on $A$} \\
&= \int_M f\,\bd V && \text{by definition.}
\end{align*}
\end{document}

在此处输入图片描述

第二个解释太长了。我想把它分成两行。如果我在环境中创建一个新的行,align它看起来很糟糕:

在此处输入图片描述

做好这件事的最佳方法是什么? 答:minipage?我该如何处理align选择宽度本身而我需要为提供固定宽度的事实minipage

答案1

您对此有何看法?(我对代码做了一些编辑。一些评论解释了理由,或给出了适当的说明。)

\documentclass{article}
\usepackage{amsmath}
\newcommand*\compose{\circ}
\newcommand*{\diff}{\mathop{}\!\mathbf{d}} % Thanks to Heiko Oberdiek

\begin{document}
\begin{align*}
    \sum_i \biggl[\int_M (\phi_i f)\diff V\biggr]
        &= \sum_i \biggl[\int_A
            (\phi_i\compose\alpha)(f\compose\alpha)V(D\alpha)\biggr]
            && \mbox{by definition} \\
            % \mbox, for consistency.  Here I do not think it is wrong (see 
            % below), and it avoids the recourse to \mathchoice, which is 
            % relatively cumbersome since it typesets the argument four times 
            % (but who cares of such things nowadays?).
        &= \int_A \biggl[\sum_i
            (\phi_i\compose \alpha)(f\compose\alpha)V(D\alpha)\biggr]
            && \parbox[t]{10pc}{because the sum converges uniformly
                on compact subsets of~$A$\strut} \\ % please note the \strut
        &= \int_A \biggl[\sum_i (f\compose\alpha)V(D\alpha)\biggr]
            && \mbox{because $\sum_i (\phi_i\compose\alpha)=1$ on $A$} \\
            % Note the \textstyle \sum, automatic since \mbox does not patch 
            % \everymath as \text does.
        &= \int_M f\diff V
            && \mbox{by definition.}
\end{align*}
\end{document}

这是输出:

上述代码的输出

答案2

像这样吗? 在此处输入图片描述

只需将方程描述放在表格环境中:

\documentclass{article}
\usepackage{amsmath}
\newcommand\compose{\circ}
\newcommand\bd{\mathbf{d}}

    \begin{document}
\begin{align*}
\sum_i [\int_M (\phi_i f)\,\bd V]
    &= \sum_i [\int_A (\phi_i\compose \alpha)(f\compose\alpha)V(D\alpha)]
        && \text{by definition} \\
    &= \int_A [\sum_i (\phi_i\compose \alpha)(f\compose\alpha)V(D\alpha)]
        &&  \begin{tabular}[t]{@{}l}
            because the sum converges uniformly\\
            on compact subsets of $A$
            \end{tabular}\\
&= \int_A [\sum_i (f\compose\alpha)V(D\alpha)] && \text{because $\sum_i (\phi_i\compose\alpha)=1$ on $A$} \\
&= \int_M f\,\bd V && \text{by definition.}
\end{align*}
    \end{document}

编辑:正如@egreg 所说,您可以使用 消除描述前的虚假空格\begin{tabular}[t]{@{}l}

答案3

tabular例如可以使用A :

\documentclass{article}
\usepackage{amsmath}
\usepackage{mleftright}
\newcommand\compose{\circ}
\newcommand*{\diff}{\mathop{}\!\mathbf{d}}

\begin{document}
\begin{align*}
\sum_i \mleft[\int_M (\phi_i f)\diff V\mright]
  &= \sum_i \mleft[\int_A (\phi_i\compose \alpha)
     (f\compose\alpha)V(D\alpha)\mright]
  && \text{by definition} \\
  &= \int_A \Bigl[\sum_i (\phi_i\compose \alpha)
     (f\compose\alpha)V(D\alpha)\Bigr]
  && \text{\begin{tabular}{@{}l@{}}
    because the sum\\
    converges uniformly on\\
    compact subsets of $A$\end{tabular}} \\
  &= \int_A \Bigl[\sum_i
     (f\compose\alpha)V(D\alpha)\Bigr]
  && \text{\begin{tabular}{@{}l@{}}
    because\\ $\textstyle\sum_i (\phi_i\compose\alpha)=1$
    on $A$\end{tabular}} \\
  &= \int_M f\diff V && \text{by definition.}
\end{align*}
\end{document}

结果

评论:

  • 方括号通过\leftand\right功能放大。实际上,mleftright\mleftand一起打包\mright的版本提供了\leftand ,\right从而避免了额外的水平空间。

  • 第二行和第三行的方括号用 和 扩大\Bigl\Bigr以避免括号过大遮盖下标。

  • 定义宏\diff来代替\bd。从这里开始的定义\mathop{}避免了之前的手动设置\,

  • 说明中的和符号设置为\textstyle而不是\displaystyle,因为它是文本的一部分,而不是显示的等式的一部分。此形式更适合文本行。

相关内容