Skip to content

Problems with “Root with index” #317

@RuixiZhang42

Description

@RuixiZhang42

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”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions