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(2) 앞에 다른 & 기호를 추가하여 \quad(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}

여기에 이미지 설명을 입력하세요

관련 정보