mathspace / msquill

Render LaTeX math as pure HTML/CSS that is WYSIWYG editable
1 stars 0 forks source link

Wrapping should not occur between base and its exponent #1

Open asavoy opened 8 years ago

asavoy commented 8 years ago

With a long expression, when a term has a base and exponent, wrapping should not occur between the base and exponent, e.g.:

a + b + c + 
x^1234

is preferred to the current behavior:

a + b + c + x
^1234

upload_1_22_2016_at_4_01_47_pm

From https://trello.com/c/5JDVPiJu/8763-power-is-wrapping-in-mathquill

asavoy commented 7 years ago

Basically this can't be fixed given the way that MathQuill renders right now (using "inline-block" rendering) - because browsers are allowed to wrap right after any inline-block element (i.e. right after a MathQuill block, or between the base and exponent)

We don't have great options to fix:

laughinghan commented 7 years ago

is the problem you're trying to solve that the superscript (^2) is wrapping, or the math field?

If you leave the math field container as an inline-block but make the exponent inline, the math field box will still increase the height of the line when needed for tall expressions, but the exponent might not wrap (maybe? It might still). (Also possibly worth trying but I doubt it'd work: U+2060 zero-width non-breaking space aka word joiner, which "prohibits a line break at its position": https://en.wikipedia.org/wiki/Word_joiner . Slightly more likely to work is a zero-width space at other places to encourage a line break there)

If you're trying to solve the whole math field box wrapping, the only idea I can think of is using JS to set its max-width to be less than the space between that = sign and the right edge of the page or container.

And I assume you know about white-space: nowrap.