General ⇒ math mode embeded in a text paragraph runs away into margin
math mode embeded in a text paragraph runs away into margin
It is a common occurrence that text formatted in math mode in a regular text paragraph runs into the right margin. That is, it does not start in a new line. How to fix it? Thanks.
NEW: TikZ book now 40% off at Amazon.com for a short time.
Re: math mode embeded in a text paragraph runs away into margin
You need to help it. I tis best to wait to do this until you are finish with the rest of your text.
For math in the text there are some rules as to where LaTeX can perform a line break. Other rules even prevent break at certain places.
One of the best things to do is to rewrite the test (if it is a very bad case), keep the inline formula short. DO not write something like "for $x>0,y<2,z>4$" much better (and more correct) to write this as "for $x>0$, $y<2$, $z>4$", then LaTeX can break the lines.
LaTeX is not allowed to break math at a comma (e.g. $f(x,y)$ would look stupid broken).
In regular text one can use \- to add a hyphenation pont. We have something similar for inline math: \allowbreak, it simply tells the linebreaker "if needed it is allowed to break the line here"
But it all depends on the situation at hand.
For math in the text there are some rules as to where LaTeX can perform a line break. Other rules even prevent break at certain places.
One of the best things to do is to rewrite the test (if it is a very bad case), keep the inline formula short. DO not write something like "for $x>0,y<2,z>4$" much better (and more correct) to write this as "for $x>0$, $y<2$, $z>4$", then LaTeX can break the lines.
LaTeX is not allowed to break math at a comma (e.g. $f(x,y)$ would look stupid broken).
In regular text one can use \- to add a hyphenation pont. We have something similar for inline math: \allowbreak, it simply tells the linebreaker "if needed it is allowed to break the line here"
But it all depends on the situation at hand.