Defining TeX macros in MathJax

This page uses two different methods to define macros: either putting them in JavaScript notation in the MathJax configuration, or in TeX notation in a script tag in the document.

Some math that uses the definitions: \[ f\colon\RR\to\RR^3 \hbox{ by } f(t)=\< t+1,{1\over 1+t^2}, \sqrt{t^2+1} > \] and \[ \{\,z\in\CC \mid z^2 = \bold{\alpha}\,\} \] and \[ \ddx{f} = \ddx[u]{f} \cdot \ddx{u} \] and \[ f\abc x,y \cba = x^2 + y^2 \]

This example shows how to predefine TeX macros for use in a web page in two different ways: either using the MathJax configuration to define them, or by using a special script tag that stores the macros.

The comments in the macros section of the tex block of the MathJax configuration indicate how to interpret the arrays used to define the individual macros. The definitions in the script tag can be TeX or LaTeX \def, \let \newcommand, \newenvironment, or other similar commands. The content of the script is passed to MathJax.tex2mml(), which processes them, but doesn't generate any output in the page (any output produced is discarded).