1

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}

enter image description here Any suggestion? Otherwise, if breqn works as it should (?), how can I automatically break that long equation in the main text?

4
  • 2
    Are you sure this is related to \breakingcomma I seem to get the same output with or without that macro.
    – daleif
    Oct 26, 2023 at 10:12
  • thanks for your comment @daleif :-) I do not know if it is related to \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, 2023 at 11:52
  • 1
    You would never make that automatic, otherwise you allow linebreak at the comma on f(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 \allowbreak after relevant commas. And I would also not use breqn, it causes more problems than it solves.
    – daleif
    Oct 26, 2023 at 12:30
  • thanks a lot, I will follow your suggestions :-)
    – Ommo
    Oct 26, 2023 at 12:39

0

You must log in to answer this question.

Browse other questions tagged .