I have big tex document that was created for a4 paper, I wanted to change a4 to a5. After doing so, latex rendered some inline math in kinda awkward way:
Something something x + y + z =
f(x).
I would prefer if instead of breaking on operators and white spaces latex would move whole inline math to the new line
Something something
x + y + z = f(x).
I know I can do that manually with \\
or wrap it some new environment, but it would take SO much time.
I also found this:
\binoppenalty=\maxdimen
\relpenalty=\maxdimen
but it didn't help and made things even worse because sometimes a part of the math would simply go beyond page border.
So, is there a simple and painless way to automatically move inline math to a new line instead of breaking it in awkward places?
MWE:
\documentclass{report}
\begin{document}
Something Something Something Something Something
Something
$ x + y + z = f(x)$
\end{document}
Best Answer
You can set the penalties to prevent breaks within math then allow the white space outside math more flexibility to avoid overfull boxes
Or, if you want the preceding line to be short, add white space before each math expression that can fill the line