w3c / w3c/mathml-core

Problems with “Root with index”

Open
#317 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
56
Forks
20
PR merge metrics
No merged PRs in 30d

Description

This is a report regarding Root with index. Related issues are collected here too:

The problems are with AdjustedRadicalKernBeforeDegree and AdjustedRadicalKernAfterDegree, which may need rethinking. This figure illustrates how the index is displaced under the current MathML core spec, together with a note at the end of this section:

In general, […] the root element will have some inline-start space and that the root index will overlap the surd.

Here’s a picture showing what the current MATH spec implies:

Top equation shows radicals with degree under the current MATH spec. The degree is either too far apart from or too close together with the radical sign. The BeforeKern MATH constant is unnecessary for wide degree but is insufficient for narrow degree. Bottom equation shows what the expected layout should be for radicals with degree.

In a web context, the notable problems are paraphrased as follows:

  1. AdjustedRadicalKernAfterDegree is a constant, but the radical sign may grow. A constant back kern cannot accommodate the varing sizes of the radical. The index will be either too far apart or too close together.
  2. Too much space in front of the wide radical index.
  3. Not enough space in front of the narrow radical index. In the extreme, a radical with an index containing zero-width space would not match the behavior of an index-free radical.
  4. Depending on the line-breaking algorithm, AdjustedRadicalKernBeforeDegree may or may not disappear at line-breaks, so the radical may or may not protrude the left edge of the text block (and alignment may be impossible).

If the vertical displacement of the index is governed by RadicalDegreeBottomRaisePercent, perhaps we should think similar thing for the horizontal displacement of the index. This works:

Image showing how to displace the index of radicals

Here, the right-edge of the index box sticks into the radical by X% times the width of radical sign.

  • Index wider than “X% times radical sign width” is a wide index. It gets no BeforeKern. The whole root element has a left-edge identical to the left-edge of the index box.
  • Index narrower than “X% times radical sign width” is a narrow index. It is re-boxed to have exactly “X% times radical sign width”, set flush-right. The whole root element has a left-edge identical to the left-edge of the radical sign.
  • In both cases, the AfterKern equals negative “X% times radical sign width”.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MathML Core “Root with index” section and its figure, then compare the linked OpenType MATH, LaTeX, and TeX discussions. Trace how AdjustedRadicalKernBeforeDegree and AdjustedRadicalKernAfterDegree are defined and identify a consensus replacement. Done means the specification behavior and terminology are agreed and updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
documentation
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.