Can I add LaTeX packages to MathJax?

后端 未结 4 744
悲哀的现实
悲哀的现实 2020-12-14 15:29

I have some mathematical expressions written in LaTeX that I would like to put on a webpage. However, they use packages that don\'t seem to be included in MathJax (e.g. yta

4条回答
  •  佛祖请我去吃肉
    2020-12-14 16:18

    Yes. According to the official MathJax documentation, version 2.7:

    While MathJax includes nearly all of the Plain TeX math macros, and many of the LaTeX macros and environments, not everything is implemented in the core TeX input processor. Some less-used commands are defined in extensions to the TeX processor.

    MathJax will load some extensions automatically when you first use the commands they implement (for example, the \def and \newcommand macros are implemented in the newcommand.js extension, but MathJax loads this extension itself when you use those macros). Not all extensions are set up to load automatically, however, so you may need to request some extensions explicitly yourself.

    To enable any of the TeX extensions, simply add the appropriate string (e.g., "AMSmath.js") to the extensions array in the TeX block of your configuration. If you use one of the combined configuration files, like TeX-AMS_CHTML, this will already include several of the extensions automatically, but you can include others using a mathjax configuration script prior to loading MathJax. For example:

    
    
    

    will load the autobold TeX extension in addition to those already included in the TeX AMS_CHTML configuration file.

    You can also load these extensions from within a math expression using the non-standard \require{extension} macro. For example:

    \(\require{color}\)
    

    would load the color extension into the page. This way you you can load extensions into pages that didn’t load them in their configurations (and prevents you from having to load all the extensions into all pages even if they aren’t used).

    Source: https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions

    If you want to work with version 3, here is the documentation: https://docs.mathjax.org/en/v3.0-latest/input/tex/extensions.html

    If you want the latest version: https://docs.mathjax.org/en/latest/input/tex/extensions.html

提交回复
热议问题