Wikipedia:WikiProject Mathematics/MathFormattingBugs

This page lists bugs and inconsistencies with the mathematical formatting system using the math extension with different preferences (server-side SVG/client-side SVG/client-side MathML).

The previous default rendering mode, "server-side SVG", was the default for many years. But a new rendering mode, "client-side SVG", has now been deployed as the default, despite still having a number of significant known bugs, and "server-side SVG" has been removed as an option. In the long term, developers have a goal of making "client-side MathML" the default rendering mode.

To change the default rendering mode for every article in English Wikipedia, visit Special:Preferences § mw-prefsection-rendering.

To view a specific article with a particular rendering preference, without changing the global preference setting, append ?mathmode=mathjax for "client-side SVG", and append ?mathmode=native for "client-side MathML". It is no longer possible to see what the "server-side SVG" mode looked like.

Yes, these names are confusing:

See Help:Displaying a formula for more general information about including mathematics within English Wikipedia articles. See #Formatting notes, below, for how to add entries.

How to classifiy the issues

Each reported problem is placed on one of four levels by asking one question: does it change what a reader understands?

  1. Broken: output is missing or wrong, or markup is shown as text (high priority).
  2. Misleading: the symbols are right, but the layout changes how the expression reads or makes it illegible (high priority).
  3. Degraded: it reads correctly but looks worse than before (medium).
  4. Cosmetic: it is only noticeable side by side with a low variation (low).

Broken and misleading problems were fixed and tackled before the roll-out. One is still in progress, T439460, that affects 46 articles, and its fix is due before most pages switch. The remaining regressions will be fixed after the switch, starting with the ones that affect the most articles. These include dot spacing in ellipses, column spacing around &= in align, and prime placement. The full list with article counts is at phab:T271001#12484145.

Problems with client-side SVG mode


Accessibility

In client-side SVG mode, all images displaying mathematics formulas lack alt text. This can be made visible e.g. using an alt text "Easy Checks" bookmarklet from the WAI. The lack of alt text violates MOS:ALTTEXT and the WCAG 2.2 (level A) content requirement 1.1.1 Non-text Content.

This also appears to contradict the documentation at mw:Extension:Math/Syntax § Rendering which claims that "The alt text of the images, which is displayed to visually impaired and other readers who cannot see the images, and is also used when the text is selected and copied, is equivalent to the TeX code that produced the image."

Sandwich issue

Listed on Phabricator T438945

In Vector2022 + latex-to-mathml-to-client-mathjax-svg, wide displayed math formulas that overlap a floating image are partially hidden by the image with no scrollbar to make the hidden part visible. When the formula overlaps with the caption of the image, both pieces of text are overlaid. Example from square pyramid (a div puts the following in a box to simulate a narrow window)

Client-side SVG mode:

Geometric representation of the square pyramidal number 1 + 4 + 9 + 16 = 30.

A square pyramidal number is a natural number that counts the number of stacked spheres in a square pyramid. If the pyramid has n layers, then it has Pn=12+22+⋯+n2=∑x=1nx2=n(n+1)(2n+1)6 spheres.

Native MathML mode:

Geometric representation of the square pyramidal number 1 + 4 + 9 + 16 = 30.

A square pyramidal number is a natural number that counts the number of stacked spheres in a square pyramid. If the pyramid has n layers, then it has Pn=12+22+⋯+n2=∑x=1nx2=n(n+1)(2n+1)6 spheres.


Blockquote issue

T382267 fixed and T420668 when using the parsoid parser open

See

The parser can be set via Special:Preferences#mw-prefsection-editing editing->Developer Tools->Use the new Parsoid wikitext parser set to "Always (Opt-In)" or "Never (Opt-Out)".

MathML only bugs

Math format inconsistencies primarily affecting MathML mode
NumberLaTeX markupClient-side SVGClient-side MathMLNotes
x : y : zx:y:zx:y:z

Lack of space before colon

T410843p(a|b)p(a|b)p(a|b)Pipe introduces spurious spacing in Firefox
\|pq\| = \|p\| \|q\|‖pq‖=‖p‖‖q‖‖pq‖=‖p‖‖q‖Norm introduces spurious spacing in Firefox
\begin{align} \sqrt5 \end{align}55

align environment wreaks hilarious havoc with square roots in Safari

a \xrightarrow{\cong} ba→≅ba→≅b

The ≅ symbol above the arrow is not clipped (as in server-side SVG render, which took a workaround to avoid) but in MathML mode is positioned too far to the right.

\lim\nolimits_x YlimxYlimxYSubscript is misplaced in Safari: should be immediately after 'lim'.

Resolved issues

The following markup examples no longer appear to be problematic but are retained here as a convenient collection of test cases.

Formatting notes

To add and example, use a line like

|-
|| {{phab|T1234}} status || {{/RowFormat| 1= \tbinom{n}{k} }} || Description

In one of the tables. This will automatically add four columns with the latex code,

There are some restrictions on the characters that you can use in parameters to the {{/RowFormat}} template. The character | is treated as a separator between template characters so can't be use directly, instead use the {{!}} special template that is converted to a pipe character in the template transclusion process. Double curly bracket either {{ or }} signify the start or end of a template to transclude. Here simply add a space between then, latex ignore the extra space.

Adding Phabricator tasks

Task can be added to the Wikimedia Phabricator bug reporting system that the developers use. See mw:How to report a bug for the actual steps, how to log in and guidance on what makes a good bug report.

A few pointers for adding maths bugs

After creating the task you can then add parent tasks, typically

You can do this using the "Edit related task -> Edit parent tasks" side bar option.