Skip to content

Remove/Deprecate numalign/denomalign/align attributes #30

Closed

Description

@fred-wang

These are used for horizontal alignments:

  • numalign, denomalign for mfrac
  • align attributes for munderover/munder/mover

I'm opening the discussion about whether we really want to keep these attributes. I think in practice most people use the default alignment.

Activity

  1. added
    MathML 4
    on Feb 22, 2019
  2. davidcarlisle commented on Feb 22, 2019

    @davidcarlisle
    Collaborator

    for fractions at least the main use of alignment is continued fractions see section 4.12

    http://anorien.csc.warwick.ac.uk/mirrors/CTAN/macros/latex/required/amsmath/amsldoc.pdf

    where amsmath supports \cfrac (left alignment) and \cfrac[r] (right)

    As far as possible we should be able to support amsmath which is the base level support for math typesetting in LaTeX.

  3. dani31415 commented on Feb 25, 2019

    @dani31415

    We can remove it but implement the CSS style text-align. We will have the same effect.

  4. fred-wang commented on Mar 14, 2019

    @fred-wang
    Author

    We can remove it but implement the CSS style text-align. We will have the same effect.

    Quick comment on this:
    (1) As others stated elsewhere, people who implement MathML in a non-browser context might want to keep it.
    (2) As I commented in a previous meeting, if we decide to support text-align (which makes sense and avoids to introduce new properties) we will need to extend its definition for math layout. Currently, the CSS spec says "how the inline-level content of a block is aligned along the inline axis if the content does not completely fill the line box" ( https://drafts.csswg.org/css-text-3/#text-align-property ). Note that we still haven't defined precisely the CSS display values of MathML elements ( #56 ).

  5. fred-wang commented on Mar 14, 2019

    @fred-wang
    Author

    for fractions at least the main use of alignment is continued fractions see section 4.12

    http://anorien.csc.warwick.ac.uk/mirrors/CTAN/macros/latex/required/amsmath/amsldoc.pdf

    where amsmath supports \cfrac (left alignment) and \cfrac[r] (right)

    As far as possible we should be able to support amsmath which is the base level support for math typesetting in LaTeX.

    Thanks. it seems this is only for numalign though. Do we have use cases for denomalign and align? (maybe non-LaTeX use case)

    In general per #55 we should figure out how MathML converters handle things like

    \cfrac{1}{234}
    \cfrac[r]{1}{234}
    \cfrac[l]{1}{234}
    

    ( TeXZilla/itex2MML don't support that command https://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html https://github.com/fred-wang/TeXZilla/blob/master/base-commands.txt )

  6. added
    compatibility
    on Mar 20, 2019
  7. fred-wang commented on Apr 24, 2019

    @fred-wang
    Author

    Here is the summary of the options:

    (I) Remove numalign/denomalign attributes.

    (II) Keep numalign/denomalign attributes for MathML but not expose them at all to CSS (Firefox and WebKit's implementation). I guess this would be fine for the short term but I suspect people would like to rely on CSS in the future.

    (III) Implement numalign/denomalign using CSS properties. Two options:

    (A) It could be something like

    mfrac[numalign="left"] > *:first-child {
    ALIGNMENT-PROPERTY: left;
    }
    mfrac[denomalign="left"] > *:last-child {
    ALIGNMENT-PROPERTY: left;
    }
    ...

    which implies introducing universal selectors for UA agent stylesheet, something we want to avoid as Chromium implementers (otherwise they need to be "expanded" with all the possible MathML element names). I don't know if we can implement such a mapping in the MathML C++ code.

    ALIGNMENT-PROPERTY can just be text-align, but that will require introducing a new CSS display for and that we override the definition of text-align, two things that need the approval of the CSS WG.

    (B) Or introducing independent properties like

    mfrac[numalign="left"] {
    NUMALIGN-PROPERTY: left;
    }
    mfrac[denomalign="left"] {
    DENOMALIGN-PROPERTY: left;
    }

    which actually can also be directly implemented in the C++ code. The disadvantage is that we would need to introduce two independent CSS properties and get approval from the CSS WG. In general, we want to avoid introducing too many CSS properties if they are not justified.

    (IV) Same as (III)(A) but remove the MathML attributes (i.e. what Dani said) and move them to CSS polyfills. However, maybe some people will complain that we still need to support non-CSS environment.

    (V) Currently, only a use case for numalign was provided by @davidcarlisle. So another alternative is to do something like (III)(B) but remove denomalign. The cons is that users will likely complain of not keeping the symmetry.

  8. davidcarlisle commented on Apr 24, 2019

    @davidcarlisle
    Collaborator

    There is a use case for this but I agree we want to "ration" the number of css-extension requests we make.

    Definitely they should be in full mathml. If it was easy (or possible) for a document author to get the effect with css than I'd even say drop from core (at least initially, revisit if there is end user demand) but if I understand you correctly that there isn't currently anything that even an in-document stylesheet can do unless css is extended.

    so perhaps I'd go for this if CSS WG are happy with that

    (IV) Same as (III)(A) but remove the MathML attributes (i.e. what Dani said) and move them to CSS
    polyfills. However, maybe some people will complain that we still need to support non-CSS environment.

    I think non CSS environments will most likely need to define their own subsets of full that are compatible with, but not necessarily the same as, mathml core, and so they could allow "native" handling of these attributes if needed.

  9. NSoiffer commented on Apr 25, 2019

    @NSoiffer
    Contributor

    Chiming in a little late on uses cases, but this Wikipedia page on inference rules uses left alignment for the premise and conclusion. I've seen several others that center them. Logic is not something I took, so I don't know what is really the correct notation (maybe both?).

  10. NSoiffer commented on Apr 25, 2019

    @NSoiffer
    Contributor

    Just an FYI...

    I'm a bit surprised, but neither the arXiv stats nor the NAG stats have any usage of numalign or denomalign. So despite potential usage for continued fractions and logical inference rules, they don't seem to be getting much use.

  11. NSoiffer commented on Apr 25, 2019

    @NSoiffer
    Contributor

    I don't see how this very rarely usage feature of MathML is worth spending any "capital" with the CSS WG (i.e., let's keep our requests for those things that are critical). I very much agree they should remain in full and a polyfill created that uses text-align as per @dani31415's suggestion. So, I agree with @davidcarlisle that we go with @fred-wang's IV:

    (IV) Same as (III)(A) but remove the MathML attributes (i.e. what Dani said) and move them to CSS
    polyfills.

    @fred-wang wrote earlier:

    ...if we decide to support text-align (which makes sense and avoids to introduce new properties) we will need to extend its definition for math layout. Currently, the CSS spec says "how the inline-level content of a block is aligned along the inline axis if the content does not completely fill the line box" (https://drafts.csswg.org/css-text-3/#text-align-property). Note that we still haven't defined precisely the CSS display values of MathML elements ( #56 ).

    Sorry for being dense, but why is an extension needed for math layout? Don't we want exactly the same thing to happen for numerators/denominators of fractions as happens when textalign is left/right/center?

  12. fred-wang commented on Apr 25, 2019

    @fred-wang
    Author

    Chiming in a little late on uses cases, but this Wikipedia page on inference rules uses left alignment for the premise and conclusion. I've seen several others that center them. Logic is not something I took, so I don't know what is really the correct notation (maybe both?).

    mfrac is for fractions or fractions-like argument per https://mathml-refresh.github.io/mathml/chapter3.html#presm.mfrac but here it describes inference rules so it does not seem appropriate to use a fraction. Actually, the HTML/MathML on this page is not very good: it's two separate formulas one of the top of the other and the top one has an munder with a stretchy underline. Also, I don't think the alignment is important for the semantic, it's probably a author hack to ensure that the top and bottom SVG image have the same width and hence align correctly.

    I believe this use case is similar to commutative diagrams, where the expected rendering could be emulated with mtable but what we really want is MathML formulas inside an SVG image. I would be good to check how this is implemented in LaTeXML, maybe there are some arXiV articles.

  13. fred-wang commented on Apr 25, 2019

    @fred-wang
    Author

    ...if we decide to support text-align (which makes sense and avoids to introduce new properties) we will need to extend its definition for math layout. Currently, the CSS spec says "how the inline-level content of a block is aligned along the inline axis if the content does not completely fill the line box" (https://drafts.csswg.org/css-text-3/#text-align-property). Note that we still haven't defined precisely the CSS display values of MathML elements ( #56 ).

    Sorry for being dense, but why is an extension needed for math layout? Don't we want exactly the same thing to happen for numerators/denominators of fractions as happens when textalign is left/right/center?

    We want the same rendering but it's difficult to see if the CSS concepts involved in the definition of text-align would just work here until we clarify all the CSS display, size etc for MathML elements. So I would not bother the CSS WG until we are sure of what we want and have a solid proposal.

    For example I don't think we can use text-align to emulate numalign/denomalign in this case (which is close to current Chromium and WebKit implementations CSS-wise).

    <style>
      .mfrac { width: 100px; height: 20px; background: red; }
      .mspace1 { width: 50px; height: 10px; background: blue; }
      .mspace1 { width: 100px; height: 10px; background: green; }
    </style>
    <div class="mfrac">
      <div class="mspace1"></div>
      <div class="mspace2"></div>
    </div>
    <div class="mfrac">
      <div class="mspace2"></div>
      <div class="mspace1"></div>
    </div>
    
  14. NSoiffer commented on Apr 25, 2019

    @NSoiffer
    Contributor

    Inference notation uses a fraction-like notation and hence is an appropriate use of mfrac. mfrac hints at a semantics, but doesn't specify it. The math on the web CG came up with a page that deals with ambiguous notations, with a long section devoted to fraction-like notations, only one of which is semantically a fraction. The logic notation is part of that (although in they point off to one that centers it). Dealing with these other uses is something I hope the non-core group figures out with respect to accessibility.

  15. fred-wang commented on Apr 25, 2019

    @fred-wang
    Author

    For me all but 2-Dimensional vector notation and logical deduction are fraction-like in the sense of binary functions with some kind of multiplicative property. I'm not sure what's the 2-Dimensional vector notation, but for me it's a matrix so it should rely on mtable. And the logical deduction is more a diagram to me (you basically put several deduction on the same schema to produce sequence of deduction). Anyway, all of this is subjective and MathML 3 is not clear at all, so people could use whatever they want to emulate a visual rendering of the formula. But again, it's not clear whether the alignment is important at all for logical deduction.

  16. 31 remaining items

  17. added
    need specification update
    on Sep 16, 2019
  18. NSoiffer commented on May 20, 2020

    @NSoiffer
    Contributor

    Just to be clear upfront: I am not proposing adding numalign/denomalign back into core.

    In a comment, @fred-wang wrote:

    The CSS align modules has various properties: https://www.w3.org/TR/css-align-3/#intro (both alignment of children and with respect to parent)
    We could define interpretation of these properties for mfrac/munder/munderover/munderover elements in order to keep the old behavior.

    What is the plan for interpreting the CSS align properties? I'm guessing the answer is either "ignore them" or "they do whatever they do", but if they were implemented to support left and right alignment, then a polyfill could take advantage of them.

  19. fred-wang commented on May 20, 2020

    @fred-wang
    Author

    There is no short-term plan to define/test/implement CSS properties for https://www.w3.org/TR/css-align-3/ (see https://mathml-refresh.github.io/mathml-core/#css-styling for ignored properties). FWIW, the old tests from Firefox use mspace to force alignment ; until the CSS layout API is available you could add mspaces of width mfrac.width - num/denum.width on the proper side of the num/denum

  20. NSoiffer commented on May 20, 2020

    @NSoiffer
    Contributor

    Yes, measuring seems to be the only solution. The downside of that is that one can't transform the MathML into core on the server (or earlier).

    Reopening because we still need a polyfill.

  21. removed
    need polyfill
    on Jun 3, 2020
  22. davidcarlisle commented on Aug 8, 2024

    @davidcarlisle
    Collaborator

    will be kept in full and not in core, so closing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MathML 4compatibilityneed specification update

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions