mathjax / mathjax/MathJax

Set the `translate` attribute for MathJax HTML nodes to `no`, except <mtext>

Open
#3,347 1 comment 0 reactions 1 assignee View on GitHub

@dpvc is already working on this.

Since Aug 13, 2025.

Feature Request
Dominant language
JavaScript
Stars
10.9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
MathJax-rendered content is inadvertently translated during page localization. This can lead to incorrect translations of mathematical expressions or symbols, which are typically not meant to be translated. However, text within <mtext> (TeX: \text{...}) is often intended to be translatable.

Describe the solution you'd like
I suggest that MathJax nodes should have the HTML translate attribute set to no by default (or inherited from ancestor nodes). This would ensure that mathematical content is not translated during localization. However, for <mtext> the translate attribute should be set to yes or unset, allowing their content to be translated as intended.

Describe alternatives you've considered
Use SVG renderer.

Additional context
This suggestion is based on the HTML translate attribute described here: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/translate. It specifies whether an element's translatable attribute values and its Text node children should be translated when the page is localized.

I am unsure whether this issue has been raised before, as it seems like a common concern when dealing with localization of mathematical content.

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.