Missing spaces around the `\perp` symbol in Mathjax v4
Issue Summary
The spacing around the \perp symbol is incorrect in Mathjax v4 — it appears too tight compared to expected LaTeX behavior.
Steps to Reproduce
-
Open the MathJax live demo.
-
Enter:
$a \perp b$ -
Observe the rendered output:
Expected Behavior
In MathJax v3 (and in LaTeX), \perp is treated as a relation symbol (REL) (according to some unofficial TeX syntax notes), so extra spacing is inserted around it:
Possible Cause
In the HTML output, \perp is currently classified as ORD, resulting in missing relational spacing:
<mjx-texatom data-mjx-texclass="ORD" texclass="ORD">
<mjx-mo data-latex="\perp" ... data-semantic-operator="infixop,⟂">⟂</mjx-mo>
</mjx-texatom>
It looks like MathJax may be handling \perp the same way as \bot, classifying it as ORD instead of REL.
In response to #3322, MathJax v4 remapped \perp from the incorrect character U+22A5 (UP TACK) to the correct U+27C2 (PERPENDICULAR). The TeX class for \perp was being assigned automatically from the operator dictionary, which had U+22A5 set to REL (though it shouldn't be). Unfortunately, U+27C2 is not in the MathJax operator dictionary, and so it received a default ORD class.
This is being corrected in the next release, along with a broader update to the operator dictionary.
In the meantime, you can incorporate
MathJax = {
startup: {
ready() {
const {OPTABLE, MO} = MathJax._.core.MmlTree.OperatorDictionary;
OPTABLE.infix['\u27C2'] = MO.REL;
MathJax.startup.defaultReady();
}
},
};
into your MathJax configuration to work around the issue.
Als note that this is a duplicate of #3440 (which the author closed).