Writing a latex document it is possible that a math-text is putted into two different lines but obviously this could be unpleasant so that I thought to confront with this using the following solution.
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\noindent
This is an example of unbroken line.
%\vspace{0.1cm}
\noindent
By the equation above we argue that the following equation (by Euler) $e^{i\pi}+1=0$ which is useful.
\vspace{1cm}
\noindent
This is an example of \textbf{manually} broken line
%\vspace{0.1cm}
\noindent
By the equation above we argue that the following equation (by Euler)
\linebreak
$e^{i\pi}+1=0$ which is useful.
\end{document}
However I dislike it since it is not just automatic so that if I modify the text then I have to remember I inserted the command \linebreak which shall delete after edits: so this could cause many "errors" in a long document so that I thought to put here a specific question where I ask if there is some command to put into the preamble which do this automatically. So could someone help me, please?
.........it will break at word spaces (which you always have before inline math) or at+or=within the math. – David Carlisle Dec 26 '23 at 19:21\noindentor\vspaceor..............and all the issues with this example are just about those things, not about the math, – David Carlisle Dec 26 '23 at 19:27\begin{equation} x=y \label{abc}\end{equation}.... see\eqref{abc}– David Carlisle Dec 26 '23 at 19:29\sloppyin the preamble. But this may also affect paragraphs that were acceptable before, and make them not as good looking. To limit the effect to just one paragraph, put\begin{sloppypar}at the beginning of the paragraph (before\noindentif that is present), and\end{sloppypar}at the end. Then the line breaking will be automatic. – barbara beeton Dec 26 '23 at 19:56sloppyparis a feature of basic LaTeX. But the answer also gives some examples that may help you understand it better. – barbara beeton Dec 26 '23 at 20:17