My problem is that sometimes long inline equations go off the margin. For some of the equations, advice from a similar thread of using \raggedleft
helped with most of the equations, but it does not work for certain equations and I don't know why:
\documentclass[8pt]{article}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sed justo at nisi
interdum eleifend ut vitae libero. Duis cursus Lorem ipsum $P = \min ( 1,{\rm e}^{-\beta [U(\vec{r'})- U(\vec{r})] } )$, consectetur adipiscing elit. Nullam sed justo at nisi
Lorem ipsum dolor sit amet, consectetur adipiscing elit $s^2 = R^2 + r^2 - 2 Rr \raggedleft [\sin \theta \sin \theta^{\prime} \cos(\varphi - \varphi^{\prime}) + \cos \theta \cos \theta^{\prime} \raggedright ]$. Curabitur dignissim, ligula sed mattis sodales, purus felis viverra metus, id tempor diam magna eget dolor. Nulla pellentesque hendrerit tortor, vel pretium ante cursus vel.
\end{document}
Does anybody know how to force the line-breaking algorithm for equations every single time?
(1,\allowbreak