I often use small inline math notation such as $\FuncName(a)$
in paragraphs. These math expressions are smaller than some words, so I think it's fine to inline them instead of putting them on their own line with something like double $$.
But LaTeX will allow these short math notations to hang over the edge of a justified paragraph. I don't like this.
Here's an example:
\documentclass{article}
\newcommand{\FuncName}{\mathsf{FuncName}}
\begin{document}
Nam dui ligula, fringilla a, euismod sodales, esollicitudin vel, ewisi. $\FuncName(a)$
Culpa vitae magnam quis quidem. Tempora quis vitae in odio eligendi ea ea. Qui non cumque velit. Non et quis rerum voluptate. Dignissimos consequuntur impedit aut at explicabo dolor. Reiciendis a fuga et blanditiis et impedit architecto
\end{document}
As you can see, the inline math is outside of the box for the paragraph. I'd like LaTeX to simple put the inline math on the next line. I'd also accept another solution where the paragraph looks nice, but I really don't want to have to do any positioning manually or put the math on its own line.
My question is really similar to this question (How to automatically linebreak an inline math formula?) but the solution in that question was to split up the inline math into text mode pieces, which I can't do in my case.
Here's another example where I would want a line break inside the math mode:
\documentclass{article}
\begin{document}
Nam dui ligula, fringilla a, euismod sodales, esollicitudin vel, ewisi. $\{a,b,c,d,e,f\}$
Culpa vitae magnam quis quidem. Tempora quis vitae in odio eligendi ea ea. Qui non cumque velit. Non et quis rerum voluptate. Dignissimos consequuntur impedit aut at explicabo dolor. Reiciendis a fuga et blanditiis et impedit architecto
\end{document}
\raggedright
?