# Make not breaking inline math the default

I find myself often converting some inline math like $a < b$ into ${a < b}$ so TeX won't insert a line break after the comparison operator. I would prefer if TeX simply treated my inline math as unbreakable by default, since I almost always use display math for long equations anyway. If I want to break some inline math manually, I can add \allowbreak. Is this configuration possible?

• {...} prevents white space stretching and shrinking as well as preventing line breaking, so it isn't usually a good solution. – David Carlisle Dec 3 at 0:43
• Thanks for bringing that to my attention; I didn't know. – japreiss Dec 3 at 2:12

Linebreaks in inline math are only possible around a relation or a binary operator. Setting the corresponding linebreak penalties to a high value (10000 and larger is considered infinite) will suppress the linebreak.

\documentclass{article}

\begin{document}

\fbox{\parbox{45pt}{math $a < b$}}
\fbox{\parbox{40pt}{math $a + b$}}

\binoppenalty=10000
\relpenalty=10000

\fbox{\parbox{45pt}{math $a < b$}}
\fbox{\parbox{40pt}{math $a + b$}}

\fbox{\parbox{45pt}{math $a <\allowbreak b$}}
\fbox{\parbox{40pt}{math $a +\allowbreak b$}}

\end{document}