HomeNotesA formula on a web page should be text

A formula on a web page should be text

Many course pages show formulas as images, exported from slides or a typesetting tool. They look right at the size they were made. Zoom the page to 200%, as WCAG 2.1 expects text to allow, and they blur. Switch on a dark theme and they keep the colours they were drawn in. Try to copy one and you copy a picture.

MathML is the web's own language for mathematics, and a formula written in it is text. It is drawn in the page's font, at the reader's size and in the reader's colours, and since early 2023 every major browser has drawn it without a plugin.

๐‘’๐‘–โข๐œ‹+1=0e^{i \pi} + 1 = 0

Hearde raised to the power i pi, end power plus 1 equals 0

The formula above is MathML on this page. Zoom in and it stays sharp. A screen reader receives the words printed under it, and one that understands MathML can let its user step through the formula part by part.

Our web pages carry every formula this way, each with its spoken words attached; so does every page of this site. To get the MathML of a formula of your own, ready to paste into a page, use the formula reader.

More notes: all notes, or follow them with the Atom feed.