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

Deprecate/Remove mlabeledtr #72

Open
fred-wang opened this issue Mar 15, 2019 · 5 comments
Open

Deprecate/Remove mlabeledtr #72

fred-wang opened this issue Mar 15, 2019 · 5 comments
Labels
compatibility Issues affecting backward compatibility css / html5 Issues related to CSS or HTML5 interoperability MathML 4 Issues affecting the MathML 4 specification need polyfill Issues requiring implementation changes

Comments

@fred-wang
Copy link

https://mathml-refresh.github.io/mathml/chapter3.html#presm.mlabeledtr

mlabeledtr is supposed to allow equation labels that you can refer easily elsewhere for example:

<p>blah blah</p>

x + y = z                 (5.1)

<p>blah blah see <a href="#id">(5.1)</a> blah blah</p>

MathML3's suggestion is to implement it via a MathML <mtable> via some special <mlabeledtr> row (i.e. <mtr> + some extra label cell). I guess this makes sense in the old "standalone spec" paradigm when each MathML formula is just considered an isolated document, so that specialized math editing/rendering/AT tools can properly handle it. But that does not seem very useful in the Web context and it duplicates existing features: You could just use HTML/CSS layout to produce this labelling effect, just like one writes "Figure 1" in HTML/CSS for images (even SVG ones). LaTeXML or Wikipedia do that (e.g. https://en.wikipedia.org/wiki/Fourier_transform#Definition ).

Additionally, the exact positioning of the label is a bit obscure in MathML3 and would have to be rewritten (maybe part of a general tabular math revamp for CSS) to be compatible with browser layout, implementable and testable. It's not implemented in any browsers and AFAIK there is not any plan to do it in the short to medium term. At this point, it does not seem a feature that meets the criteria to enter in MathML Core IMHO.

Currently MathML Core just treats <mlabeledtr> as an <mtr> with display: none label ( https://mathml-refresh.github.io/mathml-core/#tables ) but it is a bit confusing/misleading out of context and if you are only familiar with HTML tables.

Hence the proposal is either to:
(1) Remove <mlabeledtr> from core for now (my personal preference)
(2) Keep the fallback in core but add some rationale (backward compatibility?, allow users to override the default behavior?)

Last but not least, there is also the usual question of whether we want to deprecate/remove it from the full MathML spec and write polyfills in https://github.com/mathml-refresh/mathml-polyfills.

cc' @bkardell

@fred-wang fred-wang added MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification css / html5 Issues related to CSS or HTML5 interoperability labels Mar 15, 2019
@davidcarlisle
Copy link
Collaborator

I would drop it from core and keep it in full, in a css world the extra label "column" makes things confusing , but in other contexts having an explicit source markup for labels is useful, and dropping the mlabeledtr in any transformation to a document matching the the core spec is likely to be simple enough.

@fred-wang fred-wang added the compatibility Issues affecting backward compatibility label Mar 20, 2019
@NSoiffer
Copy link
Contributor

Based on survey results so far, none of the converters generate it, so usage is likely very low. That argues very strongly that it shouldn't be part of core.

The main reason for having this is to make sure the baseline of the label aligns with the baseline of the equation it is labeling. This property is very important to publishers. How can this be done, especially with a multi-line equation (often labeled as 6.1 (a), 6.1 (b), etc?

@fred-wang fred-wang added need polyfill Issues requiring implementation changes need resolution Issues needing resolution at MathML Refresh CG meeting labels May 16, 2019
@pdfion
Copy link

pdfion commented Jun 10, 2019

As usual, in my view, the point of this construct was to make a close association of a label that might later be referenced with a piece of a displayed formula, so an attempt to allow tying some mathematically significant things together, rather than just to allow a presentation with a formula number, say. If it isn't widely used at all, then remove it from Core by all means. But was not introduced entirely for page layout, though baseline alignment helps provide a good visual cue for an association. It might be argued, I suppose, that other ways of giving document parts IDs are readily available.

@bkardell
Copy link
Collaborator

it seems that we have idrefs and labels and links and all sorts of things in the platform that we can use toward these purposes. If it feels like it is replicating something that could be done with the existing platform, it definitely seems like we should either cut it, or find a way to express its very specific implementation directly in known terms. If there is not legacy content, I would prefer to drop it.

@NSoiffer
Copy link
Contributor

NSoiffer commented Jun 10, 2019

I was tasked with getting MathJax stats on this if there were any. I asked, and they don't have any stats on any usage features.

As I mentioned earlier, the point is to get the baseline of the label to align with the baseline of the equation it is labeling. If that can be done in HTML/CSS, then let's drop this from core. To be concrete:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mtable>
  <mlabeledtr id='e-is-m-c-square'>
    <mtd>
      <mtext> (2.1) </mtext>
    </mtd>
    <mtd>
     <mrow>
       <mi>E</mi>
       <mo>=</mo>
       <mrow>
        <mi>m</mi>
        <mo>&#x2062;<!--INVISIBLE TIMES--></mo>
        <msup>
         <mi>c</mi>
         <mn>2</mn>
        </msup>
       </mrow>
     </mrow>
    </mtd>
  </mlabeledtr>
  <mlabeledtr id='e-is-m-c-square'>
    <mtd>
      <mtext> (2.2) </mtext>
    </mtd>
    <mtd>
     <mrow>
       <mi>V</mi>
       <mo>=</mo>
       <mfrac>
         <mrow>
           <mi>l</mi>
           <mi>w</mi>
           <mi>h</mi>
        </mrow>
        <mn>3</mn>
       </mfrac>
     </mrow>
    </mtd>
  </mlabeledtr>
</mtable>
</math>

Should align the baselines as in
image

A better example probably would have been something like

   y = ....           label 1
     = ...            label 2
     = ...            label 3

where the exprs have different heights/depths

@fred-wang fred-wang removed the MathML Core Issues affecting the MathML Core specification label May 22, 2020
@fred-wang fred-wang removed the need resolution Issues needing resolution at MathML Refresh CG meeting label Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Issues affecting backward compatibility css / html5 Issues related to CSS or HTML5 interoperability MathML 4 Issues affecting the MathML 4 specification need polyfill Issues requiring implementation changes
Projects
None yet
Development

No branches or pull requests

5 participants