mathvariant=Monospace produces bold letters
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.9k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Issue Summary
The mathvariant="monospace" mtext renders the letters in a bolder fashion, making them stand out and prone to be misinterpreted as intentionally bold letters, e.g. vector notations.
Steps to Reproduce:
Add the following mathML inside math> mrow > mtable > mtr > mtd > mstyle
<msub> <mrow> <mtext mathvariant="monospace">SN</mtext> </mrow> </msub>
Technical details:
- MathJax Version: 4.1.2
- Client OS: Mac OS 26.3.1
- Browser: Chrome, Build 147.0.7727.138
I am using the following MathJax configuration:
...
displayOverflow: 'linebreak',
font: 'mathjax-tex',
mathmlSpacing: true,
linebreaks: {
inline: true,
width: /Firefox/.test(navigator.userAgent) ? '40%' : '90%',
lineleading: 0.2,
LinebreakVisitor: null,
},
}
and loading MathJax via
<script src="'https://cdn.jsdelivr.net/npm/mathjax@4.1.2/mml-chtml.js"></script>
Supporting information:
In the following equation the letters SN, TN and Lick are all monospace.
Link to live article: https://elifesciences.org/articles/95802
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied MathML reproduction and the mml-chtml.js entry point used in MathJax 4.1.2, then trace how mathvariant="monospace" selects and renders the CHTML font. Confirm the result against the reported SN, TN, and Lick examples; done means monospace letters no longer appear unintentionally bold while remaining monospace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100