我希望在amsart
课堂上排版这样的内容:
但是由于\hfill
在环境中不起作用align
,我没有找到一个很好的方法来写这个。下面是一个繁琐的方法,需要手动调整一些长度:
\begin{align*}
\hspace{.35\linewidth}
A &= BB &\hspace{.25\linewidth}(\text{Due to E...})\\
&= CCC &\hspace{.25\linewidth}(\text{Due to FF...})\\
&= DDDD &\hspace{.25\linewidth}(\text{Due to GGG...})
\end{align*}
有一个更好的方法吗?
以下是 MWE:
\documentclass{amsart}
\usepackage{blindtext}
\begin{document}
\begin{align*} % Doesn't work
A &= BB \hfill \text{(Due to ...)}\\
&= CCC \hfill \text{(Due to ...)}\\
&= DDDD \hfill \text{(Due to ...)}
\end{align*}
\begin{align*}
\hspace{.35\linewidth}
A &= BB &\hspace{.25\linewidth}(\text{Due to E...})\\
&= CCC &\hspace{.25\linewidth}(\text{Due to FF...})\\
&= DDDD &\hspace{.25\linewidth}(\text{Due to GGG...})
\end{align*}
\blindtext
\end{document}
答案1
您可能会滥用flalign
,但我更喜欢中间或底部的实现。
\documentclass{amsart}
\usepackage{lipsum}
\begin{document}
\lipsum[1][1-3]
\begin{flalign*} % Doesn't work
&& A &= BB & \makebox[0pt][r]{(Due to E...)}\\
&& &= CCC & \makebox[0pt][r]{(Due to FF...)}\\
&& &= DDDD & \makebox[0pt][r]{(Due to GGG...)}
\end{flalign*}
\lipsum[2][1-3]
\begin{alignat*}{2}
A &= BB &\qquad& (\text{Due to E...})\\
&= CCC &\qquad& (\text{Due to FF...})\\
&= DDDD &\qquad& (\text{Due to GGG...})
\end{alignat*}
\lipsum[3][1-3]
\begin{align*}
A &= BB && (\text{Due to E...})\\
&= CCC && (\text{Due to FF...})\\
&= DDDD && (\text{Due to GGG...})
\end{align*}
\lipsum[4][1-3]
\end{document}