TransWikia.com

Regular text between equations in math align mode

TeX - LaTeX Asked by stackoverflowuser2010 on May 30, 2021

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.

One Answer

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

Answered by Bernard on May 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP