对齐中的互文后编号消失

对齐中的互文后编号消失

请考虑以下 MWE:

\begin{align}
&\begin{aligned}a_{12345}&=b\\ a&=c\end{aligned}\\
\intertext{The first aligned block and the second aligned block should be aligned at the equal sign. Therefore, I added an hphantom. But I want that they have a number which summarizes several equations. In my file, these equations are longer. They contain of ten lines each. It looks appealing, if they are aligned at the equal sign.\endgraf
However, while I am writing, I make a paragraph with \endgraf. Now, I need an equation. 
\begin{align*}
a&=b\\
a&=c
\end{align*}
I want this equation to be central and aligned because it has several lines. This equal sign should be central. It is not realted to the outer equal signs. It contains only two lines which have to be central.\endgraf
Bonus question: What happens if I want to write a footnote in my intertext? Like: This is a nice footnote.\footnote{Indeed!} The footnote will not appear in the output. As strange as it is!}    
&\begin{aligned}\hphantom{{}_{345}}a_{12}&=b\\ a&=c\end{aligned}
\end{align}

我的输出中第二个aligned块没有数字。我不知道为什么。

我有一个较长的块intertext,想像示例中那样将其前后两个块对齐。第二个块中缺少数字。

相关问题可以被找寻到这里。您知道如何在第二个aligned区块中获取数字吗?提前谢谢您!

答案1

您不需要\intertext在这里使用,特别是当您试图插入这么大的一段带有复杂添加项的文本(例如align)时。只需拆分组件,正常书写文本,然后使用\phantoms 和smath对齐它们lap(来自mathtools)。

在此处输入图片描述

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{equation}
  \begin{aligned}
    \sin\cos\tan\log\max\min &= b \\
                           a &= \sum_{i = 1}^\infty x^2
  \end{aligned}
\end{equation}
The first aligned block and the second aligned block should be aligned at the equal sign. 
Therefore, I added an \texttt{\string\hphantom}. But I want that they have a number which 
summarizes several equations. In my file, these equations are longer. They contain of ten 
lines each. It looks appealing, if they are aligned at the equal sign.

However, while I am writing, I make a paragraph with. Now, I need an equation. 
\begin{align*}
  a &= b \\
  a &= c
\end{align*}
I want this equation to be central and aligned because it has several lines. This equal 
sign should be central. It is not related to the outer equal signs. It contains only two 
lines which have to be central.

Bonus question: What happens if I write a footnote in my \texttt{\string\intertext}? 
Like: This is a nice footnote.\footnote{Indeed!} The footnote will appear in the output. 
As strange as it is!
\begin{equation}
  \begin{aligned}
    \hphantom{\sin\cos\tan\log\max\min}% Widest left-hand side
      \mathllap{a_{12}} &= 
    \mathrlap{b}
      \hphantom{\sum_{i = 1}^\infty x^2} \\ % Widest right-hand side
    a &= c
  \end{aligned}
\end{equation}

\end{document}

对于每个align想要与其他组件对齐的断开部分,请使用最宽的元素作为\hphantom两侧的,并进行适当的重叠。

类似盒子尺寸的其他选项也是可能的(通过eqparbox)。

答案2

你想实现这样的目标吗

\documentclass{article}

\usepackage{amsmath}

\begin{document}
\begin{align}
  &\begin{aligned}a&=b\\ a&=c\end{aligned}\\
  &\begin{aligned}a&=b\end{aligned}\notag\\
  &\begin{aligned}a&=b\\ a&=c\end{aligned}
\end{align}
\end{document}

在此处输入图片描述

也许

\documentclass{article}

\usepackage{amsmath}

\begin{document}
\begin{align}
  &\begin{aligned}a&=b\\ a&=c\end{aligned}\\
  &\begin{aligned}\intertext{Hello}a&=b\intertext{World}\end{aligned}\notag\\
  &\begin{aligned}a&=b\\ a&=c\end{aligned}
\end{align}
\end{document}

答案3

witharrows我尝试使用 的环境而不是 的环境来执行相同示例amsmath。扩展提供了类似于 的witharrows环境、类似于 的环境和类似于 的环境。{WithArrows}{aligned}{DispWithArrows}{align}{DispWithArrows*}{align*}

在这些环境下,第二个标签不会消失,并且脚注会被提取(如果扩展使用选项footnote或加载)。但是,必须加载footnotehyper扩展,因为使用的命令是 命令。amsmath\intertextamsmath

\documentclass{article}
\usepackage{amsmath}
\usepackage[footnotehyper]{witharrows}
\begin{document}
\begin{DispWithArrows}
&\begin{WithArrows}a_{12345}&=b\\ a&=c\end{WithArrows}\\
\intertext{The first aligned block and the second aligned block should be aligned at the equal sign. Therefore, I added an hphantom. But I want that they have a number which summarizes several equations. In my file, these equations are longer. They contain of ten lines each. It looks appealing, if they are aligned at the equal sign.\endgraf
However, while I am writing, I make a paragraph with intertext.\endgraf Now, I need an equation. 
\begin{DispWithArrows*}
a&=b\\
a&=c
\end{DispWithArrows*}
I want this equation to be central and aligned because it has several lines. This equal sign should be central. It is not realted to the outer equal signs. It contains only two lines which have to be central.\endgraf
Bonus question: What happens if I want to write a footnote in my intertext? Like: This is a nice footnote.\footnote{Indeed!} The footnote will not appear in the output. As strange as it is!}    
&\begin{WithArrows}\hphantom{{}_{345}}a_{12}&=b\\ a&=c\end{WithArrows}
\end{DispWithArrows}
\end{document}

答案4

对于所有遇到同样问题的人,我发布了我刚刚找到的解决方案。你可以用以下方法“手动”插入号码:

\refstepcounter{equation}\tag{\theequation}

在对齐的行尾。到目前为止,这对我来说效果很好。

相关内容