Skip to content

Remove/Deprecate subscriptshift/superscriptshift attributes of msubsup/msup/msub #27

Closed

Description

@fred-wang

These are currently defined in MathML 4 and ignored in MathML Core.

Script shifts are currently described via complex TeX / OpenType rules in MathML Core, allowing font designers to provide proper position of scripts.

subscriptshift/superscriptshift allow page authors to override the min script shifts. However, I'm not sure that's really use in practice. I wonder if we should deprecate/remove them to simplify the layout.

Activity

  1. added
    MathML Core
    MathML 4
    and removed
    MathML Core
    on Feb 22, 2019
  2. dani31415 commented on Feb 25, 2019

    @dani31415

    What about using non math fonts? The default choice should be good enough.

  3. fred-wang commented on Feb 25, 2019

    @fred-wang
    Author

    What about using non math fonts? The default choice should be good enough.

    I believe the TeX appendix G has some suggestions for the min shifts and this is what is used in Gecko & WebKit.

  4. NSoiffer commented on Mar 5, 2019

    @NSoiffer
    Contributor

    I think the spec should say what values to use when using math fonts. Let's make sure there is no confusion by being specific about which should be used.

    Similarly, when using fonts without math tables, we need to specific about how to calculate default values for them. I hope it won't be a problem to do so via character-specific bounding boxes (e.g, defining the axis and rule thickness based on the bounding box for "-"). Using generic font-wide info such as x-height will lead to poor layout.

  5. fred-wang commented on Mar 5, 2019

    @fred-wang
    Author

    What about using non math fonts? The default choice should be good enough.

    I believe the TeX appendix G has some suggestions for the min shifts and this is what is used in Gecko & WebKit.

    Similarly, when using fonts without math tables, we need to specific about how to calculate default values for them. I hope it won't be a problem to do so via character-specific bounding boxes (e.g, defining the axis and rule thickness based on the bounding box for "-"). Using generic font-wide info such as x-height will lead to poor layout.

    Let's not go off-topic, I opened w3c/mathml-core#116 for that.

  6. fred-wang commented on Mar 5, 2019

    @fred-wang
    Author

    The MathML Core spec already indicates how to use MATH parameters to layout scripted expressions:
    https://mathml-refresh.github.io/mathml-core/#scriptsandlimits
    We can add fallback values w3c/mathml-core#116

    This issue is about whether we actually need subscriptshift/superscriptshift? Gecko interprets them as "minimal shifts" but some people might want that it overrides the whole MATH / TeX rules.

    My preference would be that it does not keep in MathML core, that we remove support from Gecko. (AFAIK there is no plan to implement it in WebKit or Chromium) and that people who really want to tweak the shifts (which is probably a bad thing) could use CSS (once we clarify the things about margin/padding/border/width/height) or mspace or mpadded...

  7. fred-wang commented on Mar 14, 2019

    @fred-wang
    Author

    cc @rwlbuis, @emilio :

    This went off topic, but as I understand current status is:

    My preference would be:
    (1) Remove this attribute from core to remove the extra layout/parsing code.
    (2) Or if there is really a strong use case for this, interpret them as minimal shifts with default 0 values, so that it's easy to plug them into the default algorithm.

  8. added
    compatibility
    on Mar 20, 2019
  9. physikerwelt commented on Mar 31, 2019

    @physikerwelt
    Member

    I would go for (1)

  10. NSoiffer commented on Apr 29, 2019

    @NSoiffer
    Contributor

    The shifts are not in use for the converters we have data for. However, I'm not sure that is meaningful as the source is mostly TeX and the games people play in TeX to shift a script probably aren't easily translated to these values. I do see mphantom and mpadded have some use in the stats and that for arXiv, there are some (very small) number of scripts that have a class of ltx_phantom. These could be cases where shifting the script more directly represents what they want to do.

  11. added
    need resolution
    on May 16, 2019
  12. NSoiffer commented on Jun 10, 2019

    @NSoiffer
    Contributor

    FYI... On p179 of the TeXBook, Knuth has an example of resetting the script default shift values for typesetting Chemistry. That's the only case I could see, but he lists this as an alternative to \vphantom so other cases are possibly listed in the TeXBook.

    The shift attrs are a higher-level method of doing this. Maybe we add something as mentioned in #92 to handle the Chemistry case and then the use case goes away... if one of the possibilities is easy to implement in a browser.

  13. 4 remaining items

  14. removed
    need resolution
    on Aug 12, 2020
  15. NSoiffer commented on Aug 24, 2020

    @NSoiffer
    Contributor

    At the meeting today, the consensus was to remove these from core. A problem does exist for supporting chemical notations as they want sub/superscripts always aligned. @davidcarlisle felt various workarounds could be used ranging from converters adding struts via mphantom to publishers creating their own version of a font where they have tweaked the open math params so they work well with chemical formulas.

  16. added
    need polyfill
    on Aug 24, 2020
  17. removed
    need specification update
    on Aug 8, 2024
  18. davidcarlisle commented on Sep 19, 2024

    @davidcarlisle
    Collaborator

    call resolved not to deprecate these

  19. dginev commented on Sep 19, 2024

    @dginev
    Member

    A problem does exist for supporting chemical notations as they want sub/superscripts always aligned.

    I do not currently have enough practical experience with CSS Box Alignment, but I was wondering during the call today whether that could be a long-term device to accomplish the script alignments for chemistry.

    If other participants here have thoughts on that idea (especially when it comes to MathML Core), it would be interesting to hear.

    To clarify David's comment above, the call resolved to keep the attributes in MathML Full, as there is no clear alternative mechanism available today.

  20. removed
    MathML 4
    need polyfill
    on May 2, 2026
  21. NSoiffer commented on May 2, 2026

    @NSoiffer
    Contributor

    I added the polyfill (w/example tests).

    Can we close this?

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

    compatibilityneed tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions