Skip to content

Typeset preview math in MathJax's TeX faces - #1

Merged
Daria-E merged 1 commit into
mainfrom
claude/mathjax-tex-fonts-28a634d6-010f-49a9-9bbe-fd6b2f279bf5
Aug 16, 2026
Merged

Typeset preview math in MathJax's TeX faces#1
Daria-E merged 1 commit into
mainfrom
claude/mathjax-tex-fonts-28a634d6-010f-49a9-9bbe-fd6b2f279bf5

Conversation

@Daria-E

@Daria-E Daria-E commented Aug 16, 2026

Copy link
Copy Markdown
Owner

The HTML-CSS output jax prefers fonts installed on the machine over MathJax's own, and its default availableFonts list names STIX. macOS ships STIX 1.x as system-reserved faces that WebKit resolves by name, so the preview selects them and typesets digits and operators in STIXGeneral-Regular, a Times-metric face indistinguishable from body text while identifiers still read as math italic. Browsers that do not enumerate those faces, such as Firefox, load MathJax's TeX fonts and render the same document correctly.

An empty availableFonts list declines local fonts. preferredFont is nulled alongside it because MathJax tests the preferred font even when it is absent from availableFonts, so the list alone still takes the local path on a machine carrying MathJax's own TeX fonts.

MathJax resolves its configuration, jax and fonts against the script element's own src, so script-src and font-src both derive their source expression from that URL rather than repeating the origin. Without the font-src entry the faces are blocked, and the output jax stalls for its web-font timeout before falling back to bitmap image fonts.

The HTML-CSS output jax prefers fonts installed on the machine over
MathJax's own, and its default availableFonts list names STIX. macOS
ships STIX 1.x as system-reserved faces that WebKit resolves by name, so
the preview selects them and typesets digits and operators in
STIXGeneral-Regular, a Times-metric face indistinguishable from body
text while identifiers still read as math italic. Browsers that do not
enumerate those faces, such as Firefox, load MathJax's TeX fonts and
render the same document correctly.

An empty availableFonts list declines local fonts. preferredFont is
nulled alongside it because MathJax tests the preferred font even when
it is absent from availableFonts, so the list alone still takes the
local path on a machine carrying MathJax's own TeX fonts.

MathJax resolves its configuration, jax and fonts against the script
element's own src, so script-src and font-src both derive their source
expression from that URL rather than repeating the origin. Without the
font-src entry the faces are blocked, and the output jax stalls for its
web-font timeout before falling back to bitmap image fonts.
@Daria-E
Daria-E merged commit b103652 into main Aug 16, 2026
4 checks passed
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.

1 participant