LaTeX forum ⇒ Text Formattingspace 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

Postby helllo » Tue Aug 17, 2010 5:31 pm

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 :
  1. f*g = a \\
  2. = 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

Postby php1ic » Tue Aug 17, 2010 6:00 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
  1. \documentclass[a4paper,11pt]{article}
  2.  
  3. \usepackage{amsmath}
  4.  
  5. \begin{document}
  6.  
  7. \begin{align}
  8. f\star g &=a\\
  9. &=b+c
  10. \end{align}
  11.  
  12. \end{document}

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

Postby helllo » Tue Aug 17, 2010 8:05 pm

Thank you !

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

Postby helllo » Tue Aug 17, 2010 8:36 pm

Hi, is it possible to write a "non-maths" sentence next to one equation when using the align mode ?
like this :
  1. \documentclass[a4paper,11pt]{article}
  2.  
  3. \usepackage{amsmath}
  4.  
  5. \begin{document}
  6.  
  7. \begin{align}
  8. f\star g &=a (because a>0)\\
  9. &=b+c
  10. \end{align}
  11.  
  12. \end{document}


thanks :)

User avatar
Stefan Kottwitz
Site Admin
Posts: 9616
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Tue Aug 17, 2010 8:52 pm

Yes, use the \text command:
  1. \documentclass[a4paper,11pt]{article}
  2. \usepackage{amsmath}
  3. \begin{document}
  4. \begin{align}
  5. f\star g &=a \quad (\text{because }a>0)\\
  6. &=b+c
  7. \end{align}
  8. \end{document}

Stefan
LaTeX.org admin

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

Postby gmedina » Tue Aug 17, 2010 8:55 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):

  1. \documentclass{article}
  2. \usepackage{amsmath}
  3.  
  4. \begin{document}
  5.  
  6. \begin{align}
  7. f\star g &=a\qquad\text{(because $a>0$)}\\
  8. &=b+c
  9. \end{align}
  10.  
  11. \begin{align}
  12. f\star g &=a & \text{(because $a>0$)}\\
  13. &=b+c & \text{(because $b=0$)}
  14. \end{align}
  15.  
  16. \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

Postby helllo » Tue Aug 17, 2010 11:59 pm

thank you very much :D


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 7 guests