[Tex/LaTex] How to prevent inline math formulas from overflowing into the margin

line-breakingmath-mode

When I compile my document in LaTeX, some formulas in the document in math mode, between $ $, go into the right margin area beyond all the text. Is there a way to fix this aesthetic problem?

Best Answer

If your formular is not too long for a line in the first place, you can use

\sloppy

in the begining of your paragraph:

The lineshape of the imaginary part of the susceptibility
(e.g. $\mathrm{\mathfrak{Im}}\left(\left.\chi_{\phi\phi}\left(\omega\right)\right|_{B=B_{0}}\right)$
or $\mathfrak{Im}\left(\left.\chi_{\phi\phi}\left(B\right)\right|_{\omega=\omega_{0}}\right)$)
for sufficiently small damping and a symmetric excitation measurement
projection ...

Produces In-text formula reaching out of text margins

Whereas

\sloppy The lineshape of the imaginary part of the susceptibility
(e.g. $\mathrm{\mathfrak{Im}}\left(\left.\chi_{\phi\phi}\left(\omega\right)\right|_{B=B_{0}}\right)$
or $\mathfrak{Im}\left(\left.\chi_{\phi\phi}\left(B\right)\right|_{\omega=\omega_{0}}\right)$)
for sufficiently small damping and a symmetric excitation measurement
projection ...

Produces

In-text formula within text margins at the cost of inconsistent whitespaces

If your formula is too long to fit in a line there are several ways of introducing \newlines within formulas. For instance Allowing line break at ',' in inline math mode?