GithubHelp home page GithubHelp logo

Comments (4)

dpvc avatar dpvc commented on July 20, 2024

I don't think \mod works differently for MathJax than for TeX. Note that \mod requires a parameter, in both LaTeX and MathJax, so \mod by itself doesn't work in either case, but a \mod b is fine. (Actually, $\mod$ is OK is LaTeX, because \mod reads the dollar sign as its argument, and then inserts it back during the substitution of its definition, and when the dollar is read again, it closes math mode. This is a difference in how TeX reads its file compared to MathJax. MathJax determines the extent of the math before processing it, whereas TeX enters math mode when it sees a dollar, continues processing, and then leaves math mode when it sees another dollar. So the fact that LaTeX will process $\mod$ while MathJax doesn't has little to do with \mod itself and everything to do with how the two determine what is inside math mode.)

As for the others, it depends on the document class in some cases, and also sometimes the macros involved, so it is not always as clear cut as we might like. Since this is not an intentional difference, some testing would need to be done in order to come up with this list. In general, however, MathJax requires braces whenever an argument to a macro consists of more than one token. It is TeX that is not consistent about this, so it is TeX that needs to be investigated to find out when this is not the case. It frequently has to do with whether the control sequence is actually a macro or is a TeX primitive, but that is not the only factor involved.

For example in TeX \vec \bf x is OK but \vec \mathbf x is not (neither is valid in MathJax). This is an interaction between \vec and \bf or \mathbf, and the way that TeX collects the argument for a macro compared to that for a primitive. On the other hand, neither \sqrt \bf x nor \sqrt \mathbf x is valid (in TeX or MathJax).

So unless you want to document pairs of macros, I'm not sure how to do this. My own feeling is that the best way to handle it is simply to say that MathJax requires braces around any argument that is more than one token, even when TeX does not.

from mathjax-docs.

pkra avatar pkra commented on July 20, 2024

Thanks for the clarification, Davide!

from mathjax-docs.

pkra avatar pkra commented on July 20, 2024

Related: mathjax/MathJax#694

from mathjax-docs.

pkra avatar pkra commented on July 20, 2024

This is ancient history and today's docs are much better.

from mathjax-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.