1

I am using the align environment to create aligned numbered equations. I would like to add some regular text in between some equations (for the purpose of explaining the next step). Something like this:

                   f(x) = abc (1)
                        = def (2)
We now apply the mathematic property of foobar to achieve a new form.
                        = xyz (3)

I have tried the following:

\usepackage{amsmath}
\begin{align}
    f(x)    &= abc\\
            &= def\\
\text{Using the property of logarithms that $x^{\log_x y} = y$, we can rewrite $P(w)$ to be $e^{\log P(w)}$.}\\ 
            &= xyz
\end{align}

Which produces this output:

enter image description here

I would like:

  1. The text line to be centered (not aligned to the left of the = sign)
  2. The text line not to have an equation number.

Thanks for any help.

1 Answers1

2

Here are two ways, using \clap or \shortintertext, both from mathtools:

\documentclass{article}
\usepackage[showframe]{geometry} 
\usepackage{mathtools}

\begin{document} \begin{align} f(x) &= abc\ &= def\ \clap{Using the property of logarithms that $x^{\log_x y} = y$, we can rewrite $P(w)$ to be $e^{\log P(w)}$.}\notag\ &= xyz \end{align}

\begin{align} f(x) &= abc\ &= def\ \shortintertext{\centering Using the property of logarithms that $x^{\log_x y} = y$, we can rewrite $P(w)$ to be $e^{\log P(w)}$.} &= xyz \end{align}

\end{document}

enter image description here

Bernard
  • 271,350