This is a BIG page.
It may take a while to process.
You can watch the progress in the lower left corner—it loads most
reliably if you resist the temptation to click on something before it's done.
I think it's worth the wait (but of course I'm biased).
You can read about why it's so big below.
This document was created in Spring of 2011.
As of May 2017, it is being processed using MathJax 2.7.1
(loaded from my own server).
A print version of this page is available
here (88 pages).
It is self-published, using
Amazon KDP.
If you have
Amazon Prime,
then you get quick, free delivery.
Be aware that the font size is small,
because it matches this page exactly.
Here is the complete pdf of the print version (about 2.8 Mb).
It's identical to the print version at Amazon. You may download it
for your personal use. If you want a print version,
it's cheaper (and easier)
to get the
Amazon book
than to print it yourself. However, the pdf may be
easier to search, and you won't be dependent on this potentially slow-loading
gigantic web page.
I (Dr. Carol JVF Burns)
prepared this page to thoroughly familiarize myself with the $\rm\TeX $ commands
that are available in MathJax,
and to provide a resource that may be useful to
other MathJax users.
Davide Cervone, the lead developer of MathJax,
has most generously provided extensive edits,
and this page is greatly improved due to his efforts;
I owe him countless thanks.
All mistakes on this page are my own
(and I welcome suggestions and corrections).
Please contact me via the contact form on
my homepage.
MathJax allows a syntax modeled on both $\rm\TeX $ and $\rm\LaTeX\,. $
Therefore, web authors can use familiar and concise commands
when creating mathematics with MathJax.
The $\rm\TeX $ commands available in MathJax
are listed alphabetically on this page,
each with a brief description.
Everything is on this single page,
instead of (say) having each letter as its own page.
My decision is that the advantages of this approach outweigh
the disadvantage:
Advantages
You can easily scroll through and use
‘find’ features on everything at once,
making it more likely to find what you're looking for,
even if you don't know its name.
You can use this page as a
‘MathJax torture test’.
If it loads in an acceptable time,
and displays things acceptably, then you're all set.
It's easier to compare different viewing environments
with everything on the same page.
You can do stretching exercises while the page loads,
and improve your flexibility while you're
learning about MathJax.
Disadvantage
This is a big page.
There is lots of MathJax to process.
Load time may not be insignificant.
The following links may be useful:
Need to define your own macros?
MathJax supports both \def and \newcommand .
You must include your definitions within a math block, e.g., inside
‘\$ \$’ or
‘\( \)’ or
‘\$\$ \$\$’, so that MathJax will process them.
Syntax for TeX Commands available in MathJax
gives information about the syntax used in this documentation to describe commands.
It also includes a table of length units available in MathJax.
The MathJax Users Group is a
support forum and open discussion for the MathJax Project.
Please be sure to
read the MathJax documentation
and search the forum discussions before creating a new post,
to see if your question has already been answered.
Alphabetical List of
$\rm\TeX$ Commands Available in MathJax
Some entries are logically grouped,
instead of appearing strictly alphabetically.
Examples are sometimes contrived to exhibit particular behaviors,
and hence may not represent typical mathematical usage.
Unless otherwise indicated,
the delimiters for a math block are not
shown in examples.
For example, you would see:
a \lt b yields $\,a<b$
instead of (say)
$a \lt b$ yields $a<b$
or
\frac{a+1}{b+2} yields: $$\frac{a+1}{b+2}$$
instead of (say)
$$\frac{a+1}{b+2}$$ yields: $$\frac{a+1}{b+2}$$
If it is important to distinguish between display mode
and inline mode, then these differences
will be clearly indicated.
The following information is provided for each table element
(as appropriate):
Command name (e.g., \alpha )
Extension information:
MathJax includes nearly all the Plain $\rm\TeX$ math macros,
and many of the $\rm\LaTeX$ macros and environments;
however, not everything is implemented in the core $\rm\TeX$ input processor.
Some less frequently used commands are defined in extensions, like
AMSsymbols or AMSmath .
To enable an extension, add the appropriate string
(e.g., AMSsymbols.js or AMSmath.js )
to the extensions array in the $\rm\TeX$ block of your configuration.
A combined configuration file (e.g., TeX-AMS_HTML )
will include some extensions automatically.
An extension that appears in brackets (like [HTML]) means that the
extension is loaded automatically, when needed.
See the MathJax documentation for further details.
used for a single-line comment;
shows only in the source code;
does not show in the rendered expression
Example (showing the math block delimiters):
$$
% Note: (x+1)^2 is NOT x^2 + 1
(x+1)^2 % original expression
= (x+1)(x+1) % definition of exponent
= x^2 + 2x + 1 % FOIL, combine like terms
$$
yields
$$
% Note: (x+1)^2 is NOT x^2 + 1
(x+1)^2 % original expression
= (x+1)(x+1) % definition of exponent
= x^2 + 2x + 1 % FOIL, combine like terms
$$
Internet Explorer caution:
Some versions of Internet Explorer convert newlines to spaces
when building the page DOM, so that something like
\begin{equation} % some comment
a = b + c
\end{equation}
becomes
\begin{equation} % some comment a = b + c \end{equation}
before MathJax sees it. Thus,
some comment a = b + c \end{equation}
is all treated as a comment, causing a ‘missing \end{equation}’ error.
It is therefore recommended that you keep comments outside of math mode (using HTML comment style).
If you must use comments within mathematics, then it is best to end them with <br /> (as of version 1.1a):
for example,
braces, used for grouping;
for literal braces, use \{ and \}
There are two basic grouping constructs that use braces;
I will refer to them as ‘arguments’ versus ‘braced groups’.
If you're not aware which construct is in force, then you can get unexpected results.
The examples below should clarify.
ARGUMENTS:
In this documentation, arguments are indicated by #1, #2, etc.
An argument is either a single ‘token’ (like ‘a’ or ‘\alpha’),
or is a group enclosed in braces.
For example, the \boldsymbol command takes an argument, notated by:
\boldsymbol #1
Thus:
\boldsymbol aa
yields
$\boldsymbol aa$
the first token, ‘a’, becomes bold
\boldsymbol \alpha\alpha
yields
$\boldsymbol \alpha\alpha$
the first token, ‘\alpha’, becomes bold
\boldsymbol{a\alpha}a\alpha
yields
$\boldsymbol{a\alpha}a\alpha$
braces have been used to make the argument the group ‘a\alpha’,
so both become bold
BRACED GROUPS:
A ‘braced group’ is a group, enclosed by braces, inside which some behavior is in force.
The \bf (boldface) command operates inside a braced group, notated by:
{\bf ... }
Here, \bf is a switch, which ‘turns on’ boldface inside the braced group;
boldface ends when the braced group ends.
Sometimes, you may not see the opening ‘{’ that signals the start of a braced group.
In this situation, when does a command (like \bf ) end?
It ends at whichever occurs first:
it is replaced by a competing command (e.g., \bf is replaced by \rm )
the end of math mode (math delimiters form an implicit local group)
Examples: (explicit braced groups are indicated in red, for your convenience)
\bf ab
yields
$\bf ab$
turn on boldface; stays on to end of math mode
{\bf ab}cd
yields
${\bf ab}cd$
an explicit braced group is entered;
the ‘cd’ falls outside this group
\bf{ab}cd
yields
$\bf{ab}cd$
turn on boldface; stays on to end of math mode; the braces here are extraneous
{\bf{ab}c}d
yields
${\bf{ab}c}d$
boldface operates inside a braced group;
the ‘d’ falls outside this group
{efg\bf{ab}c}d
yields
${efg\bf{ab}c}d$
the ‘efg’ occur before boldface is turned on
ab \bf cd \rm ef
yields
$ab \bf cd \rm ef$
the competing \rm replaces boldface
ab \bf cd {\rm ef} gh
yields
$ab \bf cd {\rm ef} gh$
the ‘gh’ is still in boldface
Make sure you see the difference in the behaviors below:
\boldsymbol{ab}cd
yields
$\boldsymbol{ab}cd$
\boldsymbol takes an argument
\bf{ab}cd
yields
$\bf{ab}cd$
\bf does not take an argument;
instead, \bf ‘turns on’ boldface behavior
control space;
$\rm\TeX$ often ignores spaces, or collapses multiple spaces to a single space.
A control space is used to force $\rm\TeX$ to typeset a space.
In $\rm\TeX$ this is a non-breaking space—i.e.,
a blank space where $\rm\TeX$ is not allowed to break between lines.
MathJax (unlike $\rm\TeX$) doesn't do any automatic breaking of lines,
so MathJax will not break at any space.
The tilde is useful to force a space where MathJax would otherwise collapse or ignore spaces,
as illustrated in the examples below.
literal dollar sign;
needed since $ may (optionally) be used to delimit math mode
Dollar sign outside of math mode:
The configuration information below enables dollar signs as inline math delimiters;
setting processEscapes: to true allows use of \$outside of math mode, as a literal dollar sign:
Creates a fraction:
numerator: subformula1
denominator: subformula2
fraction bar has thickness: dimen
There are separate local groups for subformula1 and subformula2 ;
if these local groups are not explicit, then unexpected results may occur, as illustrated in the
choose discussion.
Creates a fraction:
numerator: subformula1
denominator: subformula2
fraction bar has thickness: dimen delim1 is put before the fraction delim2 is put after the fraction
For an empty delimiter, use ‘.’ in place of the delimiter.
There are separate local groups for subformula1 and subformula2 ;
if these local groups are not explicit, then unexpected results may occur, as illustrated in the
choose discussion.
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for examples
If alternate notation is desired, define: \def\arccosAlt{\cos^{-1}} so that
$\arccosAlt(x)$ yields
$\def\arccosAlt{\cos^{-1}} \arccosAlt(x)$
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for examples
If alternate notation is desired, define: \def\arcsinAlt{\sin^{-1}} so that
$\arcsinAlt(x)$ yields
$\def\arcsinAlt{\sin^{-1}} \arcsinAlt(x)$
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for examples
If alternate notation is desired, define: \def\arctanAlt{\tan^{-1}} so that
$\arctanAlt(x)$ yields
$\def\arctanAlt{\tan^{-1}} \arctanAlt(x)$
the complex argument function;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for examples
general command for making a fraction-like structure, but without the horizontal fraction bar
{ <subformula1> \atop <subformula2> }
Creates a fraction-like structure:
‘numerator’ subformula1
’denominator’ subformula2
There are separate local groups for subformula1 and subformula2 ;
if these local groups are not explicit, then unexpected results may occur, as illustrated in the
choose discussion.
Creates a fraction-like structure:
‘numerator’ subformula1
‘denominator’ subformula2 delim1 is put before the structure delim2 is put after the structure
For an empty delimiter, use ‘.’ in place of the delimiter.
There are separate local groups for subformula1 and subformula2 ;
if these local groups are not explicit, then unexpected results may occur, as illustrated in the
choose discussion.
Whether lower-case letters are displayed in blackboard-bold, or not, depends on the fonts being used.
The MathJax web-based fonts don't have lowercase blackboard-bold, but the STIX fonts do;
so users with the STIX fonts installed will be able to display lowercase blackboard-bold letters.
Used to obtain various-sized delimiters, with a left/right/middle context;
may be followed by any of these Variable-Sized Delimiters.
The ‘l’ (left), ’m’ (middle), and ‘r’ (right) specifications
may make reading the source code more meaningful,
especially when there are delimiters inside delimiters.
Whereas (say) \Bigg produces results of class ORD, we have:
\Biggl produces results of class OPEN
\Biggr produces results of class CLOSE
\Biggm produces results of class REL
The spacing for these differ (but may not always be apparent, as it depends on the class of what is next to it).
For example, $x\big| y$ ($\,x\big| y\,$)
has less space than $x\bigm| y$ ($\,x\bigm| y\,$).
Therefore, these commands affect typeset results in a fundamental way;
it is best to use the form appropriate for the position of the desired delimiter.
a double-backslash can be used in place of \cr ;
the final \\ or \cr is optional
In $\,\rm\TeX\,,$ the second column is automatically in text-mode, while in MathJax it is in math-mode.
This behavior will be changed to be consistent with $\,\rm\TeX\,$ in a future release of MathJax.
notation commonly used for binomial coefficients;
different versions for inline and display modes
{ <subformula1> \choose <subformula2> }
There are separate local groups for subformula1
and subformula2 ;
if these local groups are not explicit, then unexpected results may occur,
as illustrated next.
Examples (showing the math delimiters):
$\displaystyle
n+1
\choose
k+2
$
yields
$\displaystyle n+1 \choose k+2$
Without an explicit braced group, the local group for subformula1
extends back to the opening math delimiter.
That is, this code is interpreted as (color added for emphasis):
${\displaystyle n+1}\choose{k+2}$
Now it is clear that only the n+1 is affected by the \displaystyle switch.
$\displaystyle
{n+1
\choose
k+2}
$
yields
$\displaystyle {n+1 \choose k+2}$
Here, an explicit braced group is used for the \choose command,
making both subformulas clear—and the expected result is obtained.
Note that it may appear that \displaystyle is taking
an argument, but this is not the case: instead, \displaystyle
acts as a switch which turns on display mode, and the entire
choose command is affected.
where: #1 is the desired color #2 is the mathematics to be colored
This works differently from standard $\,\rm\LaTeX\,$ (where \color is a switch).
In a future version of MathJax, it will be possible to load an extension
to make the command behave like the $\,\rm\LaTeX\,$ version.
class OP
cosine;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for more examples
class OP
hyperbolic cosine;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for more examples
hyperbolic cosine
class OP
cotangent;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for more examples
class OP
hyperbolic cotangent;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for more examples
class OP
cosecant
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for more examples
non-standard; class ORD;
extension is loaded automatically when used;
used to set a MathML element's ID attribute, so it can be accessed dynamically
(e.g., to add an event handler, add CSS styling, or set display status)
\cssId #1 #2
where:
#1 is an ID attribute (without quotes)
#2 is the mathematics to be identified by the ID
Example:
Suppose this HTML and Javascript is provided outside of math mode:
<button type="button" onclick="turnRed();">
Click button to turn something red
</button>
<script type="text/javascript">
function turnRed() {
document.getElementById('testID').style.color = "red";
}
</script>
Suppose further that the following MathJax code is provided:
$$
abc
\cssId{testID}{def\text{ Something will turn red! }ghi}
jkl
$$
Multi-letter operator names (like $\,\log\,,$
$\,\sin\,,$ and $\,\lim\,$) are traditionally typeset in a roman font. \DeclareMathOperator allows you to define your own
operator names;
they are subsequently typeset using the proper font and spacing;
you can control the way that limits appear (see examples below)
\DeclareMathOperator #1 #2
where:
#1 is the operator name, including the preceding backslash;
only letters az and AZ are allowed;
in particular, no numbers are allowed in operator names
#2 is the replacement text for the operator name
A named operator is available in any mathematics that appears after it is
defined on the page.
Examples:
myOp(x)
yields
$myOp(x)$
poor style; the function name should appear in a roman font
\text{myOp}(x)
yields
$\text{myOp}(x)$
better; a nuisance to type if used frequently
\DeclareMathOperator
{\myOp}{myOp}
\myOp(x)
yields
$\DeclareMathOperator
{\myOp}{myOp} \myOp(x)$
best; once an operator is declared, it can be used in any subsequent mathematics
\myOp_a^b(x)
yields (inline mode)
$\myOp_a^b(x)$
standard subscript and superscript position for inline mode
\myOp_a^b(x)
yields (display mode)
$\displaystyle\myOp_a^b(x)$
standard subscript and superscript position for display mode
operator names are case-sensitive, so \myOp
is different from \myOP ;
if displaystyle limits are desired in both inline and display modes,
then use DeclareMathOperator* instead of
DeclareMathOperator
for defining your own commands (control sequences, macros, definitions);
must appear (within math delimiters) before it is used;
alternatively, you can
define macros using the MathJax configuration
options in the <head>
class OP
degree;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for examples
class OP
determinant;
does not change size;
default limit placement can be changed using \limits and \nolimits;
does not change size;
see the Big Operators Table for more examples
Examples:
class OP
dimension;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for examples
class ORD
used to over-ride automatic style rules and force display style;
stays in force until the end of math mode or the braced group, or until another style is selected
{ \displaystyle ... }
Example:
In inline mode:
\frac ab+\displaystyle\frac ab+\textstyle\frac ab
+\scriptstyle\frac ab+\scriptscriptstyle\frac ab
yields:
$\frac ab + \displaystyle\frac ab+\textstyle\frac ab+\scriptstyle\frac ab+\scriptscriptstyle\frac ab$
Example:
In inline mode: \frac ab + {\displaystyle \frac cd + \frac ef} + \frac gh
yields
$\frac ab + {\displaystyle \frac cd + \frac ef} + \frac gh$
Example:
In inline mode: \frac ab + \displaystyle{\frac cd + \frac ef} + \frac gh
yields
$\frac ab + \displaystyle{\frac cd + \frac ef} + \frac gh$
equation alignment;
for aligning multi-line displays at a single place
\eqalign{ <math> & <math> \cr <repeat as needed> }
the ampersand is placed where alignment is desired;
a double-backslash can be used in place of the \cr ;
the final \\ or \cr is optional;
supports only a single \tag, which is vertically centered
Example:
\eqalign{
3x - 4y &= 5\cr
x + 7 &= -2y
}
yields:
$$
\eqalign{
3x - 4y &= 5\cr
x + 7 &= -2y
}
$$
Example:
A <math> component may be empty:
yields:
$$
\eqalign{
(a+b)^2 &= (a+b)(a+b) \\
&= a^2 + ab + ba + b^2 \\
&= a^2 + 2ab + b^2
}
$$
Example:
The result of \eqalign is a vertically-centered block;
you can use more than one in the same display:
\left\{
\eqalign{
a &= 1\\
b &= 2\\
c &= 3
}\right\}
\qquad
\eqalign{
ax + by &= c \\
x + 2y &= 3
}
yields:
$$
\left\{
\eqalign{
a &= 1\\
b &= 2\\
c &= 3
}\right\}
\qquad
\eqalign{
ax + by &= c \\
x + 2y &= 3
}
$$
see also: \eqalignno, the align environment,
\tag
the first ampersand is placed where alignment is desired;
the second ampersand is used just before a tag;
if there is no tag, then the final & <equation tag> is omitted;
a double-backslash can be used in place of the \cr ;
the final \\ or \cr is optional
Example:
\eqalignno{
3x - 4y &= 5 &(\dagger) \cr
x + 7 &= -2y &(\ddagger)\cr
z &= 2
}
yields:
$$
\eqalignno{
3x - 4y &= 5 &(\dagger)\cr
x + 7 &= -2y &(\ddagger)\cr
z &= 2
}
$$
see also: \eqalign,
\leqalignno,
the align environment
When you're working with a MathJax page, you may
want to see the log of messages generated during page processing (particularly
if something has gone wrong).
To do this, type
javascript:alert(MathJax.Message.Log())
in the browser's location URL box, and then refresh the page.
If the alert box is too big to see the close button, just press ‘enter’ to close the alert box.
class OP
exponential function;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for examples
class OP
greatest common divisor;
does not change size;
can change limit placement using \limits and \nolimits;
see the Big Operators Table for examples
horizontal glue; horizontal fill (added in MathJax 2.5);
can be used to set horizontal alignment in matrices and arrays (as in old-fashioned $\,\TeX\,$ layout);
it ‘expands’ to fill available horizontal space, pushing contents on right or left to the boundary
Example:
\begin{matrix}
xxxxxx & xxxxxx & xxxxxx \cr
ab & \hfil ab & ab\hfil\cr
\end{matrix}
yields
$
\begin{matrix}
xxxxxx & xxxxxx & xxxxxx \cr
ab & \hfil ab & ab\hfil \cr
\end{matrix}
$
class OP
homomorphism;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for examples
Sometimes you want to pretend that something is there, for spacing reasons,
but you don't want it to appear—you want it to be invisible—you want it to be a phantom.
The box created by \hphantom has the width of its argument,
but its height and depth are zero (so it doesn't contribute to any vertical spacing issues).
In other words, \hphantom creates horizontal space equal to that produced by its argument,
but doesn't create any vertical space.
Instead of providing the definition inside math delimiters in the body,
you can add the definition to your configuration using the Macros property of
the TeX block:
class OP
infimum;
greatest lower bound;
does not change size;
can change limit placement using \limits and \nolimits;
see the Big Operators Table for examples
class OP
kernel;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for examples
equation alignment with optionally numbered (tagged) lines;
in $\rm\TeX$, \leqalignno puts the tags on the left, but MathJax
doesn't implement this behavior;
currently, tags appear in a column on the
right separated from the equations by a fixed amount of space (so they
don't work like tags in the AMS math environments);
this may be fixed in a future version of MathJax
the first ampersand is placed where alignment is desired;
the second ampersand is used just before a tag;
if there is no tag, then the final & <equation tag> is omitted;
a double-backslash can be used in place of the \cr ;
the final \\ or \cr is optional;
output is the same in both inline and display modes
(except for the amount of vertical space before and after);
Example:
\leqalignno{
3x - 4y &= 5 &(\dagger) \cr
x + 7 &= -2y &(\ddagger)\cr
z &= 2
}
yields:
$$
\leqalignno{
3x - 4y &= 5 &(\dagger) \cr
x + 7 &= -2y &(\ddagger)\cr
z &= 2
}
$$
see also: \eqalignno; the align environment
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for examples
creates a box of width zero;
the argument is then placed just to the left of this zero-width box
(and hence will overlap whatever lies to the left);
proper use of \llap and \rlap in math expressions is somewhat delicate
Examples:
a\mathrel{{=}\llap{/}}b
yields
$a\mathrel{{=}\llap{/}}b$
{=} forces the equal to not have
REL spacing (since it is not adjacent to ORD's) and \mathrel{} forces
the compound symbol (equal with overlapping slash) to be treated as a
single REL
a\mathrel{{=}\llap{/\,}}b
yields
$a\mathrel{{=}\llap{/\,}}b$
the thinspace ‘\,’ improves the spacing
a=\mathrel{\llap{/\,}}b
yields
$a=\mathrel{\llap{/\,}}b$
this works because the spacing between adjacent REL's is zero
natural logarithm;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for examples
logarithm;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for examples
lowers the argument by the amount specified in <dimen>;
in actual $\rm\TeX$, the argument to \lower (and \raise ) must be an
\hbox ,
but in MathJax it can be any expression (using an \hbox is allowed, but not required)
Whether lower-case letters are displayed in blackboard-bold, or not, depends on the fonts being used.
The MathJax web-based fonts don't have lowercase blackboard-bold, but the STIX fonts do;
so users with the STIX fonts installed will be able to display lowercase blackboard-bold letters.
gives the correct spacing to make an object into a binary operator;
binary operators have some extra space around them;
creates an element of class BIN
some constructions are meant to appear ‘inside’ other formulas,
and should be surrounded by additional space in certain circumstances;
this classification is forced on the argument by using \mathinner
forces the argument to be treated in the ‘ordinary’ class; for example, like ‘$/$’;
spacing is determined by pairs of tokens;
there is no extra spacing between adjacent ORD's (as in the second example below);
there is extra spacing between an ORD and a BIN (as in the first example below);
creates an element of class ORD
forces the argument to be treated in the ‘punctuation’ class; for example, like ‘$,$’;
punctuation tends to have some extra space after the symbol;
returns an element of class PUNCT
forces the argument to be treated in the ‘relation’ class; for example, like ‘$=$’ and ‘$\gt$’;
relations have a bit more space on both sides than binary operators;
returns an element of class REL
Whether lower-case letters are displayed in script, or not, depends on the fonts being used.
The MathJax web-based fonts don't have lowercase script, but the STIX fonts do;
so users with the STIX fonts installed will be able to display lowercase script letters.
sans serif typestyle for uppercase and lowercase letters and digits;
also affects uppercase greek (as do the other font switches,
like \rm,
\it,
\bf,
\mathrm,
\mathit,
\mathbf, etc).
an invisible box whose width is zero;
its height and depth are the same as a parenthesis ‘$($’;
can be used to achieve more uniform appearance in adjacent formulas
modulus operator; modulo;
the leading space depends on the style: displaystyle has 18 mu,
others 12 mu;
2 thinspaces of following space;
for things like equations modulo a number
In actual $\rm\TeX$, these require an \hbox (or some
box) as an argument, and can only appear in vertical mode;
MathJax is less picky: you don't need an actual box, and MathJax
doesn't have a vertical mode;
these are not really designed as user-level macros, but instead allow existing macros to work;
the box takes up its original space (unlike something like
\llap or \rlap ),
but its contents are shifted (without affecting its
bounding box)
Examples:
\rm tight
yields
$\rm tight$
\rm t\moveleft3pt ight
yields
$\rm t\moveleft3pt ight$
\rm t\moveleft3pt i\moveleft3pt g\moveleft3pt h\moveleft3pt t
for defining your own commands (control sequences, macros, definitions); \newcommand must appear (within math delimiters) before it is used;
if desired, you can use the TeX.Macros
property of the configuration to define
macros in the head
\newcommand\myCommandName
[ <optional # of arguments, from 1 to 9> ]
{ <replacement text> }
The bracketed # of arguments is omitted when there are no arguments.
for defining your own environments; \newenvironment must appear (within math delimiters) before it is used
\newenvironment{myEnvironmentName}
[ <optional # of arguments, from 1 to 9> ]
{ <replacement text for each occurrence of \begin{myEnvironmentName}> }
{ <replacement text for each occurrence of \end{myEnvironmentName}> }
The bracketed # of arguments is omitted when there are no arguments.
There must not be a command having the same name as the environment:
for example, to use \begin{myHeart}...\end{myHeart} there may not be a command \myHeart.
used in AMS math environments that do automatic equation numbering,
to suppress the equation number;
since MathJax doesn't implement auto-numbering (as of version 1.1a), it is basically a no-op,
although it will cancel an explicit \tag ;
when auto-numbering is added, then this will work as expected; \notag is included now for compatibility with existing TeX code (to
prevent throwing an error, even though it has no effect)
this is intended for oldstyle numbers;
it is a switch that turns on oldstyle mode;
the way it works in $\rm\TeX$ is to select the caligraphic font
(which is where the oldstyle
numbers are stored),
so it has the side effect of selecting
caligraphic upper-case letters;
MathJax does the same for compatibility
puts a (stretchy) over-brace over the argument;
can use ‘^’ to place an optional superscript over the overbrace;
can use ‘_’ to place an optional subscript below the argument
Creates a fraction:
numerator subformula1
denominator subformula2 delim1 is put before the fraction delim2 is put after the fraction
For an empty delimiter, use ‘.’ in place of the delimiter.
Sometimes you want to pretend that something is there, for spacing reasons,
but you don't want it to appear—you want it to be invisible—you want it to be a phantom.
The box created by \phantom has width, height and depth equal to its argument.
In other words, \phantom creates horizontal and vertical space equal to that of its argument,
even though the argument isn't visible.
poor man's bold;
it works by duplicating its argument slightly offset,
giving a bold effect (at least in the horizontal direction);
doesn't work well for horizontal lines, like $\,-\,$ or $\,+\,$
parenthesized modulus operator; parenthesized modulo;
18 mu of leading space before the opening parenthesis in display style;
8 mu of leading space before the opening parenthesis in other styles;
6 mu of space after the word mod
parenthesized argument with leading space;
18 mu of leading space before the opening parenthesis in display style;
8 mu of leading space before the opening parenthesis in other styles
does not change size;
default limit placement can be changed using \limits and \nolimits;
does not change size;
see the Big Operators Table for more examples
raises the argument by the amount specified in <dimen>;
in actual $\rm\TeX$, the argument to \raise (and \lower ) must be an
\hbox ,
but in MathJax it can be any expression (using an \hbox is allowed, but not required)
equivalent to \newcommand;
for clarity of code, you may choose to use \renewcommand
when re-defining a macro;
this is different from actual $\,\rm\TeX\,,$
where \renewcommand only allows redefining of an existing command
This is a MathJax-specific macro that can be used to load MathJax $\rm\TeX$ extensions (like the AMSmath extension)
from within math mode, rather than having to include it in the configuration.
For example,
$\require{AMSsymbols}$
would cause MathJax to load the
extensions/TeX/AMSsymbols.js file at that point.
Since many people use MathJax in blogs and wikis that may not have all the extensions loaded,
this makes it possible to load a lesser-used extension on a particular page,
without having to include it in every page.
creates a box of width zero;
the argument is then placed just to the right of this zero-width box
(and hence will overlap whatever lies to the right)
Example:
a\mathrel{\rlap{\;/}{=}}b
yields
$a\mathrel{\rlap{\;/}{=}}b$
In this example, {=} forces the equal to not have
REL spacing (since it is not adjacent to ORD's); \mathrel{} forces the compound symbol (equal with overlapping slash)
to be treated as a single REL;
the \; improves the spacing for the slash.
see also: \llap
used to over-ride automatic style rules and force scriptscript style;
stays in force until the end of math mode or the braced group, or until another style is selected
used to over-ride automatic style rules and force script style;
stays in force until the end of math mode or the braced group, or until another style is selected
secant;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for more examples
sine;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for more examples
hyperbolic sine;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for more examples
used to finely adjust the positioning on accents;
particularly useful for adjusting superaccents (accents on accents);
usually requires trial-and-error adjustment for proper positioning
By using \smash, \phantom,
\hphantom,
\vphantom,
\rlap,
\llap,
you can typeset any mathematics,
yet give it the width and/or height and/or depth of any other mathematics.
\smash #1
Typesets the argument in a box with the same width as the argument,
but with height and depth equal to zero.
In other words: the argument of \smash is visible, and has its natural width,
but does not contribute any height or depth to the surrounding mathematics
(hence leaving the surrounding mathematics to dictate height and depth).
to horizontally compress the box containing this and make it instead behave horizontally like that : \rlap{this}\hphantom{that}
or \hphantom{that}\llap{this}
to both vertically smash and horizontally compress the box containing this
and make it instead behave both vertically and horizontally like that : \rlap{\smash{this}}\phantom{that}
or \phantom{that}\llap{\smash{this}}
Examples:
\sqrt{\matrix{a & b\cr c & d}}
\sqrt{
\rlap{\smash{\rm Hi!}}
\phantom{\matrix{a & b\cr c & d}}
}
yields
$
\sqrt{\matrix{a & b\cr c & d}}
\sqrt{
\rlap{\smash{\rm Hi!}}
\phantom{\matrix{a & b\cr c & d}}
}
$
stack relations;
you can stack anything (not just relations) but it creates
an item of class REL
(and usually the bottom is a REL to start with,
but doesn't have to be)
\stackrel #1 #2
where #1 (in superscript style) is stacked on top of #2
used primarily in AMS math environments to
get tags (equation numbers, labels);
can, however, be used on any equation;
the argument of \tag is typeset in text mode, but
math mode can be used within the text:
for example, \tag{\$\bullet\$}
You can use dollar signs in text-mode regardless of the settings of the inlineMath delimiters in the
tex2jax preprocessor.
tangent;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for more examples
hyperbolic tangent;
does not change size;
default limit placement is the same in both inline and display modes;
can change limit placement using \limits;
see the Big Operators Table for more examples
used to produce text-mode material (in a given font) within a mathematical expression;
MathJax does not process any macros within the text (unlike $\rm\TeX$ itself);
you can get math mode within the text using \(...\) delimiters
used to over-ride automatic style rules and force text (inline) style;
stays in force until the end of math mode or the braced group, or until another style is selected
puts a (stretchy) under-brace under the argument;
can use ‘^’ to place an optional superscript over the argument;
can use ‘_’ to place an optional subscript below the underbrace
implements a \unicode{} extension to $\rm\TeX$
that allows arbitrary unicode code points to be entered in mathematics;
can optionally specify height and depth of character (width is determined by browser);
can optionally specify the default font from which to take the character;
once a size and font are provided for a given unicode point, they need not be specified again in subsequent
\unicode{} calls for that character
centers the argument on the ‘math axis’,
which is at
half the height of an ‘x’, or about the position of a minus sign;
one of the reasons for \vcenter is to get stretchy delimiters to match the
contents better
verbatim mode;
useful for code snippets and for displaying special characters ‘as is’ (i.e., not interpreted by MathJax).
Only works in display mode.
Usually, verbatim content is typeset in a sans serif font.
Sometimes you want to pretend that something is there, for spacing reasons,
but you don't want it to appear—you want it to be invisible—you want it to be a phantom.
The box created by \vphantom has the height and depth of its argument,
but its width is zero (so it doesn't contribute to any horizontal spacing issues).
In other words, \vphantom creates vertical space equal to that produced by its argument,
but doesn't create any horizontal space.
$\rm\LaTeX$ environments of the form \begin{XXX} ... \end{XXX}
are provided, as listed in the table below.
The processEnvironments value in the tex2jax block of the
MathJax configuration controls processing behavior:
processEnvironments: true (the default) causes environments to be
processed both inside and outside of math delimiters
processEnvironments: false causes environments to be processed
only when they appear inside math delimiters
yields
$$
\begin{align}
(a+b)^2 &= (a+b)(a+b) \tag{3.1c} \\
&= a^2 + ab + ba + b^2 \tag{$\dagger$} \\
&= a^2 + 2ab + b^2 \tag{$\ast$}
\end{align}
$$
Alignment at more than one location is trickier.
It is best illustrated with an example:
Let $n$ denote the number of places where alignment is desired.
Then, there will be $2n - 1$ ampersands used.
STEP 1:
The odd-numbered ampersands (1st, 3rd, 5th, etc.) are placed where alignment is desired.
Position these ampersands first:
a &= bbbbbb &= cc &= d \\
aaa &= bbbb &= cccccc &= ddd
STEP 2:
Now, focus attention on the content between the previously-positioned ampersands.
What part of this content belongs on the left? On the right?
In each group, use an ampersand to separate the content into two pieces (a piece may be empty).
Think of this ampersand as a solid ‘wall’ that is pushing content to the left or right.
Compare these three scenarios:
Pushing all content to the left:
\begin{align}
a &= bbbbbb& &= cc& &= d \\
aaa &= bbbb& &= cccccc& &= ddd
\end{align}
yields
$$
\begin{align}
a &= bbbbbb& &= cc& &= d \\
aaa &= bbbb& &= cccccc& &= ddd
\end{align}
$$
Pushing all content to the right:
\begin{align}
a &= &bbbbbb &= &cc &= d \\
aaa &= &bbbb &= &cccccc &= ddd
\end{align}
yields
$$
\begin{align}
a &= &bbbbbb &= &cc &= d \\
aaa &= &bbbb &= &cccccc &= ddd
\end{align}
$$
Splitting the content, with half left and half right:
\begin{align}
a &= bbb&bbb &= c&c &= d \\
aaa &= bb&bb &= ccc&ccc &= ddd
\end{align}
yields
$$
\begin{align}
a &= bbb&bbb &= c&c &= d \\
aaa &= bb&bb &= ccc&ccc &= ddd
\end{align}
$$
For vertical alignment of two or more lines at one or more places;
produces a more horizontally-compressed display than align:
the alignat environment is started with \begin{alignat}{<num>} ,
where num is a positive integer ($1,2,3,\ldots$) that indicates the number of places
where alignment is desired
ampersand(s) ‘&’ are used to indicate desired alignments (see examples below)
a double backslash ‘\\’ or carriage return ‘\cr’ separates lines
individual lines may be tagged using the \tag{} command:
default input for \tag{} is text
you may get mathematical content inside \tag{} by using math delimiters;
e.g., \tag{$\alpha$}
Let $n$ denote the number of places where alignment is desired.
Then, there will be $2n - 1$ ampersands used, as follows:
STEP 1:
The odd-numbered ampersands (1st, 3rd, 5th, etc.) are placed where alignment is desired.
Position these ampersands first:
a &= bbbbbb &= cc &= d \\
aaa &= bbbb &= cccccc &= ddd
STEP 2:
Now, focus attention on the content between the previously-positioned ampersands.
What part of this content belongs on the left? On the right?
In each group, use an ampersand to separate the content into two pieces (a piece may be empty).
Think of this ampersand as a solid ‘wall’ that is pushing content to the left or right.
Compare these three scenarios:
Pushing all content to the left:
\begin{alignat}{3}
a &= bbbbbb& &= cc& &= d \tag{3.1} \\
aaa &= bbbb& &= cccccc& &= ddd \tag{3.2}
\end{alignat}
Used to create an array (matrix),
where columns can be individually left-justified,
centered, or right-justified.
suppose that $n$ columns are desired in the array;
then, $n-1$ ampersands are used to separate the columns
the array environment is started with \begin{array}{<justification info>} ,
where <justification info> is a series of $n$ letters, one for each column:
‘l’ for left-justified
‘c’ for centered
‘r’ for right-justified
pipe character(s) ‘|’ can be used in the justification information to specify
optional separating vertical line(s) (see example below)
a double backslash ‘\\’ or carriage return ‘\cr’ separates rows
Putting a pipe character ‘|’ at the beginning or end of
the justification info encloses the entire structure,
which is different from standard $\,\rm\TeX\,$:
for ‘equation arrays’;
aligns at one or more places;
surround the character(s) to be aligned with ampersands, as shown below;
content between alignment characters (or between alignment characters and end-of-line) is left-justified;
a double backslash ‘\\’ or carriage return ‘\cr’ separates rows
to display any number of centered formulas (without any alignment);
a double backslash ‘\\’ or carriage return ‘\cr’ separates rows;
individual lines may be tagged using the \tag{} command:
default input for \tag{} is text
you may get mathematical content inside \tag{} by using math delimiters;
e.g., \tag{$\alpha$}
Example:
\begin{gather}
a = a \tag{$*$}\\
\text{if } a=b \text{ then } b=a \tag{$\dagger$}\\
\text{if } a=b \text{ and } b=c \text{ then } a=c\tag{3.1}
\end{gather}
yields:
$$
\begin{gather}
a = a \tag{$*$}\\
\text{if } a=b \text{ then } b=a \tag{$\dagger$}\\
\text{if } a=b \text{ and } b=c \text{ then } a=c \tag{3.1}
\end{gather}
$$
see also: \displaylines
a multi-line environment;
typically used for formulas/equations that don't fit on a single line
the first (or only) line is displayed left-justified
the last line is displayed right-justified
any intermediate line(s) are centered
The justification of intermediate lines can be adjusted with
\shoveleft and \shoveright.
Examples:
\begin{multline}
\rm first\ line \\
\rm second\ line \\
\rm third\ line \\
\rm fourth\ line
\end{multline}
yields:
$$
\begin{multline}
\rm first\ line \\
\rm second\ line \\
\rm third\ line \\
\rm fourth\ line
\end{multline}
$$
\begin{multline}
\rm first\ line \\
\shoveleft\rm second\ line \\
\shoveright\rm third\ line \\
\rm fourth\ line
\end{multline}
yields:
$$
\begin{multline}
\rm first\ line \\
\shoveleft\rm second\ line \\
\shoveright\rm third\ line \\
\rm fourth\ line
\end{multline}
$$
see also: \begin{split}
for single equations that are too long to fit on one line, and hence must be split into multiple lines;
allows for (optional) alignment at one or more places, using ‘&’ to mark alignment points
Examples:
\begin{split}
\text{first line}\\
&\text{first aligned place} &\text{second aligned place} \\
&\text{and more first aligned}\qquad &\text{and more second aligned} \\
\text{no ampersands on this line} \\
& &\text{aligned at second place} \\
\text{no amps here either}
\end{split}
yields:
$$
\begin{split}
\text{first line}\\
&\text{first aligned place} &\text{second aligned place} \\
&\text{and more first aligned}\qquad &\text{and more second aligned} \\
\text{no ampersands on this line} \\
& &\text{aligned at second place} \\
\text{no amps here either}
\end{split}
$$
see also: \begin{multline}
a more compact version of \begin{array};
can be used for multi-subscripts and multi-superscripts on large operators;
columns can be individually left-justified,
centered, or right-justified
suppose that $n$ columns are desired in the subarray;
then, $n-1$ ampersands are used to separate the columns
the subarray environment is started with \begin{subarray}{<justification info>} ,
where <justification info> is a series of $n$ letters, one for each column:
‘l’ for left-justified
‘c’ for centered
‘r’ for right-justified
a double backslash ‘\\’ or carriage return ‘\cr’ separates rows