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

min-width for <mpadded> #202

Closed
ronkok opened this issue Jul 28, 2023 · 6 comments
Closed

min-width for <mpadded> #202

ronkok opened this issue Jul 28, 2023 · 6 comments

Comments

@ronkok
Copy link

ronkok commented Jul 28, 2023

Currently in MathML-Core, one can set a width on an <mpadded> element, and I believe, only on an <mpadded> element. There seems to be no way to set a min-width on any MathML element, <mpadded> or otherwise.

This makes it difficult to emulate the behavior of LaTeX extensible arrows, all of which have a minimum width.

This issue proposes to add a min-width to the specification of the <mpadded> element.

@dginev
Copy link

dginev commented Jul 28, 2023

I have a connected question I'd like to clarify:
Currently, Chrome (but not Firefox) respects the CSS min-width property on (all? most?) MathML Core elements.

For example:

<math>
  <mrow style="min-width:100px; background-color:green;">
    <mi>x</mi>
  </mrow>
</math>

Is that use of CSS to be encouraged or discouraged? Thanks.

@NSoiffer
Copy link
Contributor

@ronkok: it seems your reason for your proposal is to be able to emulate extensible arrows in LaTeX. Doesn't <mo>s minsize attr allow you to do this?

I also want to note (it may be obvious, sorry) that a CSS min-width won't cause stretching, is just sets the minimum width of the element... at least in the chromium-based browsers that have implemented MathML-core's requirements wrt to CSS.

@ronkok
Copy link
Author

ronkok commented Aug 28, 2023

Doesn't <mo>s minsize attr allow you to do this?

I'm not so sure that MathML-Core does this. See Issue #64. It should work in Firefox, since it was written to MathML 3.0, but Firefox currently does not in real life support minsize on horizontal operators, unless it has recently changed. Hence my interest in a CSS solution.

a CSS min-width won't cause stretching

My plan was to set a CSS min-width on the upper element of an extensible arrow. That width would then, per my plan, determine the width of the stretched element.

@ronkok
Copy link
Author

ronkok commented Aug 28, 2023

I currently have a work-around for extensible arrows. It's a horrible kludge, and I would very much like to use a minsize or a min-width instead. But it is working, so this issue is perhaps less of a priority than some other issues.

@ronkok
Copy link
Author

ronkok commented Aug 29, 2023

Just to tie up some loose ends: I've just done a test and the minsize attribute currently has no effect on horizontal operators, either in Chromium or Gecko. However, issue #64 has a "level-2" label. I take that to mean it is planned for future implementation.

If/when minsize is implemented, that would indeed make this issue unnecessary. To avoid duplication, I'm going to close this issue, continue operating with my current horrible kludge workaround, and hope that minsize will eventually be implemented for horizontal stretchy operators.

@ronkok ronkok closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2023
@dginev
Copy link

dginev commented Aug 30, 2023

To also address my question for archival:

Currently, Chrome (but not Firefox) respects the CSS min-width property on (all? most?) MathML Core elements.
Is that use of CSS to be encouraged or discouraged? Thanks.

I think the prevailing sentiment in the last couple of Core meetings was that Chromium's approach to respect CSS rules prescribed over MathML is the correct one going forward, and that it is desirable for CSS properties to successfully apply to any/all MathML Core elements.

That said, we concretely discussed the min-width property, so more nuance may be needed for other cases. If I correctly followed the discussion about combining it with the stretchy attribute of an "embellished operator", then the two examples attached below should be expected to succeed stretching to the CSS-prescribed minimal size, when it is applied to the right contextual nodes (rather than the <mo> itself). This is already the case by using the current layout algorithm of MathML Core. And is an independent observation from the minsize/maxsize attribute discussion - both mechanisms inform the layout algorithm.

<math>
  <mi>a</mi>
  <mrow style="min-height:25px"></mrow>
  <mo stretchy="true"></mo>
  <mi>b</mi>
</math>

<math>
  <mi>a</mi>
  <munder>
    <mo></mo>
    <mrow style="min-width: 25px;"></mrow>
  </munder>
  <mi>b</mi>
</math>

Currently it appears that both of these examples stretch correctly in Chrome, and neither stretches in Firefox, for the reasons @ronkok outlined above.

@dginev dginev removed the Agenda label Aug 30, 2023
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

4 participants