Comments (1)
You are right that there should be more detail about this.
MathML and TeX approach the spacing between items in very different ways. MathML inserts spacing on both sides of <mo>
elements (Math Operator elements) based on the Operator Dictionary and the position of the <mo>
within the surrounding <mrow>
(the <mo>
will be in a prefix, infix, or postfix position in the expression). Some renderers also add space in other locations, but that is not required by the specification as it currently stands. For example, Firefox will put a small amount of space between <mi>
(Math Identifier) elements when the mathvariant
attribute is different between the two <mi>
. This means that <mi>sin</mi><mi>x</mi>
will have a small space between "sin" and "x", since the multi-character <mi>sin</mi>
has the normal
variant by default, while the single-character <mi>x</mi>
has the italic
variant.
TeX, on the other hand, determines spacing based on the class of adjacent items in the expression (not just at operators). TeX assigns each item a TeX class (OP = large operator, BIN = binary operator, REL = relation, OPEN = open delimiter, etc.) and specifies a spacing too use between each possible pairing of adjacent classes (see the TeXBook Chapter 18 (p. 170)). So TeX can have spacing in palces that MathML doesn't, and the spacing does not always agree between the two.
For example, TeX does not put spacing between two adjacent relations; e.g., x == y
in TeX will have no extra space between the two equal signs (other than what is part of the glyph in the font itself). But in MathML, both equal signs are in infix position, and so get an equal amount of space on both sides, meaning there will be twice that extra space between the two equals.
TeX does some rewriting of classes to make some situations work better. For example, in x + -y
to make the minus sign act as negation rather than a binary operator, whereas an extra <mrow>
is needed for this case in MathML (and the TeX input jax doesn't add one).
Other places involve the spacing between two things neither of which is an <mo>
, though the conditions where these include spacing is rare. One is the spacing for \sin x
, where both are <mi>
nodes:
Firefox handles that by putting space between <mi>
that have different variants, as discussed above, though MathJax doesn't do that. That approach introduces extra space in places where TeX would not, for example, in a\mathbf{i}
.
I hope that helps clarify the difference between the two modes.
from mathjax-docs.
Related Issues (20)
- Bad links in docs.mathjax.org HOT 1
- MathJax.typesetPromise() HOT 1
- Wrong link to configuration pages
- Dead link in math editors wiki page HOT 1
- MathJax version in page title about lazy typesetting HOT 1
- MathJax CDN doesn't have some environments such as empheq HOT 3
- Typesetting and Converting Mathematics - errors in the code() example HOT 3
- Getting started documentation of of date HOT 2
- Problem with using lazy typesetting of mathjax HOT 1
- Circular link in documentation? Regarding configuration HOT 1
- input/tex/macros - link packages to their docs page HOT 4
- The style `border-spacing` of parent element affects how fractions are rendered
- Hope give a funtion list for mathjax HOT 1
- [tagformat] correct way to disable id generation entirely HOT 2
- Is there any way to overwrite MathJax font family for math equation to apply font families like Arial, Tahoma, Courier New etc. HOT 2
- Can we migrated to MathJax.v3.2 version from V2 HOT 1
- Interfacing MathJax with PyScript and SymPy and Quarto
- Broken link on the 'Fonts q&a' page
- remove polyfill.io references HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mathjax-docs.