#set page(height: auto, width: 10em, margin: 1em)
Then $exists x > 0, f(x) = y$ and why?
How to allow the line to break after ,? I think the following would be better.
Then ∃x>0,
f(x) = y and
why?
Why can’t I split it?
$exists x > 0$, $f(x) = y$
My document is not English, and I have to use a dedicated font for my main text. The font provides a good glyph for this comma, but it does not fit well among Latin-like characters in math equations.
Moreover, I can’t set text(font: (covers: regex_matching_comma_period_etc, …)), because it will destroy kerning.
You could just wrap the comma in a separate equation to get the correct font. The space of the comma relative to the zero looks to be equal to the case where everything is in the same equation. The space behind the comma will be wider by default because you have to use the “plain-text” space between the last two equations. This is however not an issue when you have a line break.
Well, long inline math is hard to make look good. Typst is a WYSIWYM tool, so if you explicitly don’t say it to break, it won’t break. If you want, you can always open a new issue and see if others will agree. Perhaps this can be improved.
Unfortunately, this solution doesn’t work well in all cases (for example, it breaks the spacing in $a allowbreak + b$). But I personally found it sufficient as a temporary workaround for the commas use case.
(I tried making all commas in math mode automatically insert such an allowbreak after themselves with #show math.comma: math.comma + allowbreak, but this seemed to break kerning around commas both inside and outside of math mode.)