Skip to content

add equation-label for w3c/mathml#525 #84

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

Merged
merged 2 commits into from
Mar 15, 2025
Merged

add equation-label for w3c/mathml#525 #84

merged 2 commits into from
Mar 15, 2025

Conversation

davidcarlisle
Copy link
Collaborator

As discussed in w3c/mathml#525 this adds equation-label (and no-equation-label) properties to identify equation labels in mtable.

These properties have been tested with test implementation in LaTeX (for generation) and MathCAT (reading) and greatly improve the reading of aligned math displays.

Following discussion in the issue, and in WG zoom meetings, the text added by this PR is quite general, it does not constrain the label to be in the first column, or mandate any particular behaviour, it just standardises the property to be available as a way to mark those cells which are labels.

Copy link
Contributor

@dginev dginev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I would move this change to open-properties.yml for an experimentation phase. This is admittedly a minority position in the last WG meeting.

  2. equation-label is a reasonable name.

  3. no-equation-label reads ad-hoc to me. LaTeX uses \notag to keep lines unmarked, so I can guess at the origin. Is there a strong motivation why this is needed beyond :silent or just the default empty <mtd></mtd> readout? Or even if a simple comment documenting that <mtd intent=":equation-label"></mtd> will be assumed to be a scaffolding cell when left empty? Adding an extra entry seems a bit over-engineered.

@davidcarlisle
Copy link
Collaborator Author

davidcarlisle commented Feb 28, 2025

  1. I would move this change to open-properties.yml for an experimentation phase. This is admittedly a minority position in the last WG meeting.

Yes noted. I thought you'd say that and explicitly pinged you as a reviewer to make sure you saw this and had chance to add a dissenting comment. As we discussed there are benefits to having this in core.

2. `equation-label` is a reasonable name.

3. `no-equation-label` reads ad-hoc to me. LaTeX uses `\notag` to keep lines unmarked, so I can guess at the origin. Is there a strong motivation why this is needed beyond `:silent` or just the default empty `<mtd></mtd>` readout? Or even if a simple comment documenting that `<mtd intent=":equation-label"></mtd>` will be assumed to be a scaffolding cell when left empty? Adding an extra entry seems a bit over-engineered.

In MathML3 (and earlier) <mlabeledtr> was available for this equation label functionality. It had a distinguished mtd that acted as the label, unlabeled rows used normal mtr and needed no special "empty" markup. This meant that the underlying structure for the table as a whole was not rectangular, with labeled rows having more cells. This really was what killed mlabeledtr in web platform implemenations.

So the proposal here is that mlabeledtr is replaced by mtr with the distinguished mtd having a :equation-label property but the other part is that to keep the rectangular table backing the alignment, unlabeled rows also have an extra empty cell which like the label cell isn't part of the math expression but is just a syntactic part of the label mechanism. A system may ignore it or it may use it, for example to make column counting match the labeled rows, or for css or other positioning again to omit that cell. But it isn't just css style it is literally marking up the intent that this is an extra cell just added formally to make column counts match those of labeled rows, so an intent attribute seems quite natural.

Actually I think MathCat ignores it (as it doesn't announce columns for :system-of-equations tables anyway), but it is used in the CSS style for latex output which uses column counting to apply left and right alignment but then treats equation-label and no-equation-label equally as cells which do not take part in that. But I don't want to focus on that CSS detail it's more the logical notion that if any row is labeled, then every row has to have an extra cell, and these two intents mark the extra cell in each row. Labeled and unlabeled rows being treated equally as far as possible.

@davidcarlisle
Copy link
Collaborator Author

davidcarlisle commented Feb 28, 2025

Note the current implementation only supports the extra cells being the first in each row, which means that you could actually just assert that any first cell without :equation-label is an empty label, but after discussion that is not mandated here and really you do want to distinguish this formal extra cell from empty cells that might be part of the math structure so it is more important if the equation label is not in a known position to have :no-equation-label but even in the current implementation, it is convenient and more symmetric ti have it.

@davidcarlisle
Copy link
Collaborator Author

Merging as this is a prerequisite for the approved w3c/mathml/pull/529

@davidcarlisle davidcarlisle merged commit a2db15a into main Mar 15, 2025
@davidcarlisle davidcarlisle deleted the equation-label branch March 15, 2025 08:48
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

Successfully merging this pull request may close these issues.

2 participants