2

I have a derivation with text annotation where the annotation needs to be flush to the left and the first equals sign in the equations are all centered. This is the code I am using. In principle it should work but I can't figure out the issue. Ampersands are at the end of the line and ampersands on the aligning equals sign. Any suggestions why it isn't working?

\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}

What I am getting instead is

enter image description here

0

1 Answer 1

4

You need to add & signs before the annotations, and before the left sides of each equation. Also, I added another & sign before the \quad (2) to make it flush with the \quad (1).

Try this code:

\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}

enter image description here

2
  • 1
    Yes that fixed it. I noticed you put one & in front of first 4 lines and && in front of the remaining 3. What the logical behind these changes?
    – rhody
    Commented Mar 13, 2023 at 1:35
  • 1
    The & makes the annotations flush left with eachother by making an invisible column on the left, the && puts the therefore in the third column. If there were only one & then the therefore would be in the same column as the annotations.
    – user279206
    Commented Mar 13, 2023 at 1:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .