2
\documentclass[a4paper]{article}
\usepackage{amsmath,amssymb}
\usepackage{amsfonts}
\begin{document}
\begin{align*}
    &\displaystyle \lim_{x \to 2}(2f(x)-g(x))&=5\\
    \Leftrightarrow &\displaystyle \lim_{x \to 2}2f(x)-\lim_{x \to 2}g(x)&=5\tag{limit laws}\\
    \Leftrightarrow &\displaystyle 2\cdot\lim_{x \to 2}f(x)-\lim_{x \to 2}g(x)&=5\tag{limit laws}
\end{align*}
\end{document}

enter image description here

I use & to align the equals signs but it's too far from the equation. How solve it?

Celdor
  • 9,058
manh3
  • 363
  • 1
    You should use alignat, but the “if and only if” symbols are wrong, because that's not what the limit laws say and it's very easy to make an example where the top limit exists, but the middle ones don't. – egreg Sep 22 '22 at 10:52
  • @egreg if I remove the limit law tag and add under the first limit "applying limit law, we have:". Is it right? – manh3 Sep 22 '22 at 11:11

1 Answers1

5

In align-like environments, & is a group separator. Each group has two elements with right & left alignment with an inner separator which is also &. You just need to play with ampersands & to achieve the desired effect. Most of times this pattern

% item && item && item ... etc.

will give you left alignment for all items.

In this case, I applied alignat, which in oppose to align does not add extra space. However, I also had to simulate a space in one group by adding \ . Note, alignat requires a mandatory argument: a number of groups.

enter image description here

\documentclass[a4paper]{article}
\usepackage{amsmath,amssymb}

\begin{document} \begin{alignat}{2} & && \ \lim_{x \to 2}2f(x)-g(x) &&=5 \ &\Leftrightarrow && \ \lim_{x \to 2}2f(x)-\lim_{x \to 2}g(x) &&=5 \tag{limit laws} \ &\Leftrightarrow && \ 2\cdot\lim_{x \to 2}f(x)-\lim_{x \to 2}g(x) &&=5 \tag{limit laws} \end{alignat} \end{document}

Celdor
  • 9,058