General ⇒ math mode embeded in a text paragraph runs away into margin
math mode embeded in a text paragraph runs away into margin
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
Re: math mode embeded in a text paragraph runs away into margin
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.