I was trying the solution proposed in breqn does not automatically break lines, but it does not work in my case:
\documentclass{article}
% \textwidth=.7\textwidth % just to show the result
\usepackage{breqn}
\usepackage{lipsum}
\newcommand{\breakingcomma}{%
\begingroup\lccode`~=`,
\lowercase{\endgroup\expandafter\def\expandafter~\expandafter{~\penalty0 }}}
\begin{document}
\lipsum[1-3]
$\breakingcomma
\Omega = \left{ q , \colon , d_{pq}<d_{pq'} , ,\forall {q} \in \Psi{\setminus}\left( {p} \cup {q'} \right)
,\forall {q'} \in \Psi{\setminus}\left( {p} \cup {q} \right) \enspace \land \enspace
\left| {q} \right| = \delta \right}$
\
\
If I use the "breakingcomma" command, "breqn" does not work as expected:
\begin{dmath}
\breakingcomma
\Omega = \left{ q , \colon , d_{pq}<d_{pq'} , ,\forall {q} \in \Psi{\setminus}\left( {p} \cup {q'} \right)
,\forall {q'} \in \Psi{\setminus}\left( {p} \cup {q} \right) \enspace \land \enspace
\left| {q} \right| = \delta \right}
\end{dmath}
\end{document}
Any suggestion?
Otherwise, if breqn works as it should (?), how can I automatically break that long equation in the main text?
\breakingcommaI seem to get the same output with or without that macro. – daleif Oct 26 '23 at 10:12\breakingcomma... However, I would expect that the inline equation within the main text, would break when there are commas, and just following to the next text line. However, this does not occur. Other way around: how can I automatically break that long equation in the main text? – Ommo Oct 26 '23 at 11:52f(x,y)which is not wanted (which is probably one of the reasons TeX is not allowed to break by detault at comma). I you just manually add\allowbreakafter relevant commas. And I would also not usebreqn, it causes more problems than it solves. – daleif Oct 26 '23 at 12:30