# aligning equalities = one below the other

I have the following source of math text in LaTeX and I would like to ALIGN all the equalities (=) to be one exactly below the other. How shall I do that? See the last 2 lines of this question. Can someone rewrite this chain of equalities into ALIGN enviroment? I got stuck with it.

\documentclass{article}

\usepackage{newtxtext}
\usepackage{newtxmath}
\usepackage{amsmath}

\begin{document}

It is clearer if you define $q_i = p_i \cdot f_i \cdot \overline{f}_i$

This is how it should be.

Then

$p \cdot f = p \cdot b_i \cdot f_i \qquad \text{(since } f = b_i \cdot f_i)$

$= d^*_i \cdot p_i \cdot f_i \qquad\text{(by naturality)}$

$= d^*_i \cdot p_i \cdot f_i \cdot \overline{f}_i \cdot f_i$ = \qquad (as $\overline{f}_i \cdot f_i = 1$)

$= d^*_i \cdot q_i \cdot f_i \qquad \text{(by the definition of} q_i)$

$= q \cdot b_i \cdot f_i \qquad \text{(by naturality)}$

$= q \cdot f \text{(by naturality)}$

Hope that helps.

\end{document}

• align environment from amsmath package – Hafid Boukhoulda Feb 11 at 17:47
• How do I begin and end the align enviroment? "\begin{align}" has failed. – user2925716 Feb 11 at 17:50

## 1 Answer

Updated

Text left aligned

\documentclass[]{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
&\text{It is clearer if you define} &q_i &= p_i \cdot f_i \cdot \overline{f}_i\\
&\text{This is how it should be} & p \cdot f &= p \cdot b_i \cdot f_i\\
&\text{then} &&= d^*_i \cdot p_i \cdot f_i \qquad \text{(by neutrality)}
\end{align}
\end{document}


Text right aligned

\documentclass[]{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
\text{It is clearer if you define}& &q_i &= p_i \cdot f_i \cdot \overline{f}_i\\
\text{This is how it should be}& & p \cdot f &= p \cdot b_i \cdot f_i\\
\text{then} &&&= d^*_i \cdot p_i \cdot f_i \qquad \text{(by neutrality)}
\end{align}
\end{document}


• WHat is wrong with this: \begin{align} $p \cdot f &= p \cdot b_i \cdot f_i \text{(since)} f = b_i \cdot f_i$\\ $&= d^*_i \cdot p_i \cdot f_i \text{(by naturality)}$\\ – user2925716 Feb 11 at 18:10
• @user2925716 remove all the $– Hafid Boukhoulda Feb 11 at 18:12 • Align already starts display math mode.$ is for inline math. – JPi Feb 11 at 19:02
• I've managed myself to align that text. Thank you for your help. – user2925716 Feb 11 at 20:00
• @user2925716 you're welcome! – Hafid Boukhoulda Feb 11 at 20:08