Math & ScienceComments in Equations with Line Breaks

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
thorpn
Posts: 53
Joined: Mon Jul 30, 2012 7:30 pm

Comments in Equations with Line Breaks

Post by thorpn »

I wish to make nice comments under my equations, meaning that they shouldn't "drag out" the equation which it tends to do if the comment is longer than the part of the equation

Code: Select all

f(x)=\underbrace{x^2}_\text{this is a quadratic term} + x + 5
The above expression can be posted into this http://www.codecogs.com/latex/eqneditor.php. Basically I would like to use some sort of line shift so that it will look nicer.

thx!
Last edited by thedreamshaper on Mon Jun 25, 2012 10:16 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Comments in Equations with Line Breaks

Post by localghost »

Wherever you need line breaks, you should use a \parbox.


Thorsten
thorpn
Posts: 53
Joined: Mon Jul 30, 2012 7:30 pm

Re: Comments in Equations with Line Breaks

Post by thorpn »

Could you give an example ? i have tried and have not been able to apply it
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Comments in Equations with Line Breaks

Post by cgnieder »

This should give you the general idea:

Code: Select all

% arara: pdflatex
\documentclass{scrartcl}
\begin{document}
 \[f(x)=\underbrace{x^2}_{\parbox{.8cm}{\raggedright this is a qua- dra- tic term}} + x + 5\]
\end{document}
Regards
site moderator & package author
thorpn
Posts: 53
Joined: Mon Jul 30, 2012 7:30 pm

Re: Comments in Equations with Line Breaks

Post by thorpn »

Thanks! :)
Post Reply