## LaTeX forum ⇒ Text Formatting ⇒ space in equations

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
helllo
Posts: 44
Joined: Sat Jun 05, 2010 5:20 pm

### space in equations

Hi everyone,
I'm trying to type this in latex :
f*g = a
"space" = b + c
(where "space" is real space)

When I do it in latex this way :
f*g = a \\           = b + c

I get this :
f*g = a
= b + c

Any idea how to have the second "=" under the first one ?
Thank you
Last edited by helllo on Tue Aug 17, 2010 11:59 pm, edited 3 times in total.

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm
Hi helllo,

Don't post random bits of code, instead post full a MWE that people can easily compile to see the problem.

For your current question, use the align environment provided by the amsmath package
\documentclass[a4paper,11pt]{article} \usepackage{amsmath} \begin{document} \begin{align}f\star g &=a\\          &=b+c\end{align} \end{document}

helllo
Posts: 44
Joined: Sat Jun 05, 2010 5:20 pm
Thank you !

helllo
Posts: 44
Joined: Sat Jun 05, 2010 5:20 pm
Hi, is it possible to write a "non-maths" sentence next to one equation when using the align mode ?
like this :
\documentclass[a4paper,11pt]{article} \usepackage{amsmath} \begin{document} \begin{align}f\star g &=a (because a>0)\\          &=b+c\end{align} \end{document}

thanks

Stefan Kottwitz
Posts: 9616
Joined: Mon Mar 10, 2008 9:44 pm
Yes, use the \text command:
\documentclass[a4paper,11pt]{article}\usepackage{amsmath}\begin{document}\begin{align}f\star g &=a \quad (\text{because }a>0)\\          &=b+c\end{align}\end{document}

Stefan

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
Hi,

you can use either the \text or \textrm command and add some space if there's only one annotated line or use another aligning point (to align the annotations):

\documentclass{article}\usepackage{amsmath} \begin{document} \begin{align}   f\star g &=a\qquad\text{(because $a>0$)}\\               &=b+c\end{align} \begin{align}   f\star g &=a & \text{(because $a>0$)}\\               &=b+c & \text{(because $b=0$)}\end{align} \end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...

helllo
Posts: 44
Joined: Sat Jun 05, 2010 5:20 pm
thank you very much