Generalmath mode embeded in a text paragraph runs away into margin

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
hzmonte
Posts: 17
Joined: Sun Nov 16, 2008 8:05 am

math mode embeded in a text paragraph runs away into margin

Post by hzmonte »

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.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

daleif
Posts: 199
Joined: Wed Nov 19, 2008 12:46 am

Re: math mode embeded in a text paragraph runs away into margin

Post by daleif »

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.
Post Reply