[Tex/LaTex] How to prevent LaTeX from breaking inline formulas globally

line-breakingmath-mode

I am using the acmsmall template and my inline formulas are being broken at equal signs and arrows; how can I prevent them from being typeset like that globally (i.e. without having to put tildes everywhere)?

Screenshot

Best Answer

Increase the penalty for line breaks at relation symbols and binary operators:

\relpenalty=9999
\binoppenalty=9999

If you simply include these commands in your preamble (between \documentclass{...} and \begin{document}), it will prevent line breaks in most cases, but in extreme situations, they can still be broken. If you set

\relpenalty=10000
\binoppenalty=10000

equations will never be broken - this may, however, destroy your layout!