flalign環境ではテキストを揃えることができません

flalign環境ではテキストを揃えることができません

テキスト注釈付きの導出があり、注釈は左揃えにする必要があり、方程式の最初の等号はすべて中央揃えにする必要があります。これは私が使用しているコードです。原理的には動作するはずですが、問題がわかりません。アンパサンドが行末にあり、アンパサンドが等号の位置にあります。動作しない理由について何かアドバイスはありますか?

\documentclass[12pt]{article}

\usepackage{mathtools,amssymb}

\begin{document}

\begin{flalign*}
\text{Let } \quad \sqrt{x} + \sqrt{y} &= \sqrt{7 + 4 \sqrt{3}}. \quad (1)&\\
%
\text{Then, by Theorem 5,} \quad \sqrt{x}-\sqrt{y} &= \sqrt{7 - 4 \sqrt{3}}. \quad (2)&\\
%
\text{Multiply (1) by (2)}, \quad x-y &=\sqrt{49-48}.&\\
%
\text{Square (1), then by Theorem 4,} \quad x + y &= 7.&\\
%
\therefore\ x &= 4, \text { and } y = 3.&\\
%
\therefore\ \sqrt{x}+\sqrt{y} &= \sqrt{4}+\sqrt{3}.&\\
%
\therefore\ \sqrt{7+4 \sqrt{3}} &= 2+\sqrt{3}.
\end{flalign*}

\end{document}

代わりに私が得ているのは

ここに画像の説明を入力してください

答え1

注釈の前と各式の左辺の前に & 記号を追加する必要があります。また、\quad (1) と面一になるように、\quad (2) の前にもう 1 つ & 記号を追加しました。

次のコードを試してください:

\documentclass[12pt]{article}

\usepackage{mathtools,amssymb}

\begin{document}

\begin{flalign*}
&\text{Let } &\quad \sqrt{x} + \sqrt{y} &= \sqrt{7 + 4 \sqrt{3}}. &\quad (1)\\
%
&\text{Then, by Theorem 5,} &\quad \sqrt{x}-\sqrt{y} &= \sqrt{7 - 4 \sqrt{3}}. &\quad (2)\\
%
&\text{Multiply (1) by (2)}, &\quad x-y &=\sqrt{49-48}.\\
%
&\text{Square (1), then by Theorem 4,} &\quad x + y &= 7.\\
%
&&\therefore\ x &= 4, \text { and } y = 3.\\
%
&&\therefore\ \sqrt{x}+\sqrt{y} &= \sqrt{4}+\sqrt{3}.\\
%
&&\therefore\ \sqrt{7+4 \sqrt{3}} &= 2+\sqrt{3}.
\end{flalign*}

\end{document}

ここに画像の説明を入力してください

関連情報