You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using markdown-it-mathjax3 version 4.3.2 and mathjax-full version 3.2.0.
When I input full-width numbers and symbols in Japanese, they are displayed in italic.
Is there a way to set the font-style to normal for full-width characters, other than forcing it with CSS?
For characters that aren't specifically defined as having a meaning in MathJax (like ^ and _), there are two places that determine what TeX class is used: the RANGES list at
The RANGES list breaks down the unicode codepoints into groups of characters that are given the same TeX class and what MathML element type to use for them. This is a rough grouping, and is not a perfect mapping of characters to classes, but is meant as a means of getting most things into an acceptable form. This allows, for example, Latin and Greek letters to be put into mi elements, while arrows can be put into mo elements. Since these are broad groups of characters, not every one in these ranges may be properly typed.
In your case, the Halfwidth and Fullwidth forms are marked to be placed in <mi> elements, and a single character in an <mi> is set in italics. One solution would be to refine the RANGES array to make better choices within that Unicode block. An alternative would be to use a TeX pre-filter to map the Fullwidth character to their ASCII equivalents. Another approach would be to create a TeX extension that defines the characters in this range to give them the correct MathML elements and attributes.
Unfortunately, markdown-it-mathjax3 does provide enough configuration options to be able to patch this without modifying the code. Are you willing to modify either the markdown-it-mathjax3 index.ts file (and recompile it)? If so, I should be able to tell you what you need to do.
As a workaround for now, you could use \text{...} around these characters, which will cause them to be rendered as you would like.
I am using markdown-it-mathjax3 version 4.3.2 and mathjax-full version 3.2.0.
When I input full-width numbers and symbols in Japanese, they are displayed in italic.
Is there a way to set the font-style to normal for full-width characters, other than forcing it with CSS?
The text was updated successfully, but these errors were encountered: