Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapping should not occur between base and its exponent #1

Open
asavoy opened this issue Feb 2, 2016 · 2 comments
Open

Wrapping should not occur between base and its exponent #1

asavoy opened this issue Feb 2, 2016 · 2 comments

Comments

@asavoy
Copy link
Collaborator

asavoy commented Feb 2, 2016

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

ajhyndman pushed a commit that referenced this issue Nov 28, 2016
@asavoy
Copy link
Collaborator Author

asavoy commented Nov 28, 2016

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:

  • render as "inline" which means that MathQuill won't be allowed to increase the height of a line when needed (e.g. for tall expressions)
  • render as "block" so that no text can appear on the same line as MathQuill

@laughinghan
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants