0% found this document useful (0 votes)
5 views

LaTeXCommands

The document provides an extensive overview of LaTeX commands supported by MathLive, detailing how to enter LaTeX editing mode, switch between text and math modes, and utilize various commands for typesetting mathematical expressions. It includes instructions for fractions, binary operators, functions, trigonometry, and custom functions, along with examples of each command. Additionally, it covers Unicode usage and large operators, as well as logical and relational operators.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

LaTeXCommands

The document provides an extensive overview of LaTeX commands supported by MathLive, detailing how to enter LaTeX editing mode, switch between text and math modes, and utilize various commands for typesetting mathematical expressions. It includes instructions for fractions, binary operators, functions, trigonometry, and custom functions, along with examples of each command. Additionally, it covers Unicode usage and large operators, as well as logical and relational operators.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

LaTeX Commands

MathLive supports over  LaTeX commands

If you know the shape of a symbol use Detexify to find the name of the
corresponding LaTeX command

To enter a LaTeX command press the ESC key or \ to enter LaTeX editing
mode Press ESC to exit LaTeX editing mode You can examine the LaTeX code for
an expression by selecting it then pressing ESC

The most common symbols can be entered using keyboard shortcuts

Text Mode Math Mode and Math Style

Math Mode
When in Math Mode the content is laid out using typesetting rules specific to
math For example variables are displayed in italics an appropriate amount of
space is inserted around some letters such as f to improve their legibility and
white spaces are ignored

In Math Mode the layout and size of some math elements is adjusted based on
the context in which they are used For example superscripts and subscripts are
displayed in a smaller font

To override the default math style use the following commands

Math Style
\displaystyle \displaystyle For equations in their own
\sum_{i=0}^n \frac{a_i} paragraph
{1+x}
n

ai
i=0
1+x

\textstyle \textstyle \sum_{i=0}^n Confusingly for inline math


\frac{a_i}{1+x} not for text mode
∑ni=0 1+x
ai

\scriptstyle \scriptstyle For subscripts and


\sum_{i=0}^n \frac{a_i} superscripts
{1+x}
ai
∑ni=0
1+x

\scriptscriptstyle \scriptscriptstyle For subscripts and


\sum_{i=0}^n \frac{a_i} superscripts of subscripts and
{1+x} superscripts
ai
∑n
i=0 1+x

Text Mode
To include some textual comments  use the \text{} command to switch to Text
Mode

Math Mode Text Mode


if andonlyif x > 0 if and only if x > 0

if and only if x > 0 \text{if and only if } x > 0

The \text{} command will use the font defined by the font-family attribute of
the enclosing mathfield The size of the text will adjust depending on the current
math style smaller in superscript/subscript

The \textrm{} command works like \text{} but will use a serif roman font

\textrm{Don Knuth}_\textrm{Don Knuth}


Don KnuthDon Knuth

The \mbox{} command uses the same font as \text but its size does not
account for the current math style

\mbox{Don Knuth}_\mbox{Don Knuth}


Don KnuthDon Knuth

The \textnormal{} command works like \text{}  But its longer to type

\textnormal{Don Knuth}_\textnormal{Don Knuth}


Don KnuthDon Knuth

When in Text Mode use $##...$ to switch back to Math Mode Text Style inline
math or \\[##...\\] to switch to Math Mode Display Style

Fractions and Binomials

\frac{}{} \dfrac{}{}

\tfrac{}{}

The \dfrac command typesets its numerator and denominator in Display Style
The \tfrac command uses Text Style inline math

[ [
]1x + 1 \cfrac[l]{1}{x+1} ]1x + 1 \cfrac[r]{1}{x+1}
l r

The \cfrac continuous fraction command has an optional argument [l] or


[r]  that controls if the numerator is leftaligned or rightaligned


\pdiff{}{}

( ) \binom{}{} ( ) \dbinom{}{}

( ) \tbinom{}{}

The following commands are supported but their usage is generally discouraged when creating
modern LaTeX content

a a
a \over b a \atop b
b b

( ) { }
n
n \choose k
k
\overwithdelims\lbrace\rbrace

{ }

\atopwithdelims\lbrace\rbrace

Binary Operators
Some binary operators can also be used as a unary operator +  -  etc… Their
spacing is adjusted accordingly For example in −1 − 2 there is less space
between - and 1 than there is between - and 2 

+ + − -

± \pm ∓ \mp

∗ * ⋅ \cdot

× \times a/b a / b

3
/4 \nicefrac{3}{4} macro ÷ \div

∣ \divides √ \sqrt{}

√ \sqrt[]{} √ \surd{}

⋉ \ltimes ⋊ \rtimes

⋋ \leftthreetimes ⋌ \rightthreetimes

⊺ \intercal ∔ \dotplus

⩞ \doublebarwedge ⋇ \divideontimes

⊟ \boxminus ⊞ \boxplus

⊠ \boxtimes ⊡ \boxdot

⊖ \ominus ⊕ \oplus

⊗ \otimes ⊙ \odot

∘ \circ ⋅ \centerdot

∙ \bullet ⊝ \circleddash

⊛ \circledast ⊚ \circledcirc

⊘ \oslash

∗ \ast ⋆ \star

Functions

exp \exp ln \ln

log \log lg \lg

lb \lb ker \ker

det \det arg \arg

arg min \argmin arg max \argmax

plim \plim

inj lim \injlim proj lim \projlim

lim \varlimsup lim \varliminf

lim \varinjlim lim \varprojlim

Trigonometry

° \degree arccos \arccos

arcsin \arcsin arctan \arctan

arctg \arctg arcctg \arcctg

ch \ch cos \cos

cosh \cosh cot \cot

coth \coth ctg \ctg

cth \cth cotg \cotg

csc \csc cosec \cosec

sec \sec sh \sh

sin \sin sinh \sinh

tan \tan tanh \tanh

tg \tg th \th

Bounds

max \max min \min

sup \sup inf \inf

lim \lim lim inf \liminf

lim sup \limsup dim \dim

Projections

Pr \Pr hom \hom

Modulo
n (mod 3)
n \pmod{3}

n mod 3
n \mod{3}

n mod 3
n \bmod 3

Custom Functions
Use \operatorname{} to define a custom function it will be display in upright font
and will have the appropriate spacing

\operatorname{argth}(\theta)
argth(θ)

Unicode
Command
\unicode{} The argument is a Unicode codepoint expressed as a
number To use a hexadecimal number start the argument
with x or " and use uppercase A  F for hexadecimal
digits

⨗ \unicode{10775}

⨗ \unicode{"2A17}

⨗ \unicode{x2A17}

\char The argument is also a Unicode codepoint but the { … }


delimiters are optional when using " 

⨗ \char"2A17

^^ Followed by  or  hexadecimal digits with lowercase


^^^^ a  f to specify a Unicode codepoint

J ^^4a

⨗ ^^^^2a17

The codepoint of the Unicode character ⨗ UA INTEGRAL WITH


LEFTWARDS ARROW WITH HOOK is  in decimal A in
hexadecimal The codepoint of the letter J is A in hexadecimal Learn
more about Mathematical Operators and Symbols in Unicode on Wikipedia

Large Operators
Large operators display their limits above and below or adjacent to the operator
depending on the math style Display Style or Text Style and on the operator

The position of the limits can be controlled with \limits  \nolimits or


\displaylimits after the operator The \limits command forces the display of
the limits above and below the operator \nolimits forces the display of the limits
adjacent to the operator and \displaylimits uses an automatic position based
on the operator and current math style

\limits \nolimits \displaylimits



n n n
∑ i=0 ∑
i=0 i=0

\sum_{i=0}^n\limits \sum_{i=0}^n\nolimits \sum_{i=0}^n\displaylimits

∞ ∞ ∞

∫ 0 ∫
0 0

\int_0^\infty\limits \int_0^\infty\nolimits \int_0^\infty\displaylimits

In Display Style the \intop and \ointop commands display their limits above
and below by default while the \int command display its limit adjacent

∞ ∞
∑ \sum ∏ \prod
n=0 n=0

∞ ∞
∐ \coprod ∫ \int
0
n=0

∞ ∞
∬ \iint  Double integral
∫ \intop 0
0


∭ \iiint  Tripe integral ∮ \oint  Contour integral
0 C

∫ \smallint  Always ⋃ \bigcup


displayed small

⋂ \bigcap ⋁ \bigvee

⋀ \bigwedge ⨄ \biguplus

⨂ \bigotimes ⨁ \bigoplus

⨀ \bigodot ⨆ \bigsqcup

∯ \oiint  Surface integral ∰ \oiiint  Volume integral

∱ \intclockwise ∲ \varointclockwise

∳ \ointctrclockwise ⨑ \intctrclockwise

⋒ \Cap ⋓ \Cup

⋒ \doublecap ⋓ \doublecup

⊔ \sqcup ⊓ \sqcap

⊎ \uplus ≀ \wr

⨿ \amalg

Logic

Quantifiers

∀ \forall ∃ \exists

∄ \nexists

Unary/Binary Operators

∧ \land ∧ \wedge

∨ \lor ∨ \vee

⊼ \barwedge ⊻ \veebar

⊻ \nor ⋏ \curlywedge

⋎ \curlyvee ¬ \lnot

¬ \neg
Relational Operators

→ \to ← \gets

⟹ \implies ⟸ \impliedby

⟷ \biconditional ∴ \therefore

∵ \because ↔ \leftrightarrow

⇔ \Leftrightarrow ⥰ \roundimplies

⊨ \models ⊢ \vdash

⊣ \dashv

Arrows

→ \rightarrow ← \leftarrow

↠ \twoheadrightarrow ↞
\twoheadleftarrow

↣ \rightarrowtail ↢
\leftarrowtail

⇢ \dashrightarrow ⇠
\dashleftarrow

\longrightarrow
\longleftarrow \longleftrightarrow

⇒ \Rightarrow ⇐ \Leftarrow

⟹ \Longrightarrow ⟸ ⟺
\Longleftarrow \Longleftrightarrow

↦ \mapsto ⟼ \longmapsto ⊸ \multimap

↑ \uparrow ↓ \downarrow ↕ \updownarrow

⇑ \Uparrow ⇓ \Downarrow ⇕ \Updownarrow

⇀ \rightharpoonup ↼
\leftharpoonup

⇁ \rightharpoondown ↽
\leftharpoondown

⇌ \rightleftharpoons ⇋
\leftrightharpoons

↘ \searrow ↗ \nearrow

↙ \swarrow ↖ \nwarrow

⇛ \Rrightarrow ⇚ \Lleftarrow

⇆ \leftrightarrows ⇄
\rightleftarrows

↷ \curvearrowright ↶
\curvearrowleft

↪ \hookrightarrow ↩
\hookleftarrow

↬ \looparrowright ↫
\looparrowleft

↻ \circlearrowright ↺
\circlearrowleft

⇉ \rightrightarrows ⇇
\leftleftarrows

⇈ \upuparrows ⇊
\downdownarrows

↱ \Rsh ↰ \Lsh

↾ \upharpoonright ↿
\upharpoonleft

⇂ \downharpoonright ⇃
\downharpoonleft

↾ \restriction

⇝ \rightsquigarrow ↭
\leftrightsquigarrow

⇝ \leadsto

Negated Arrows

↛ \nrightarrow ↚ \nleftarrow ↮
\nleftrightarrow

⇏ \nRightarrow ⇍ \nLeftarrow ⇎
\nLeftrightarrow

Extensible Arrows
The width of the arrow commands above is fixed The width of the commands
below is determined by the length of the content above and below the arrows
which is specified as an argument and optional argument

\xrightarrow[\text{long text below}]{}

long text below

\xrightarrow{\text{long text above!}}


long text above

\xrightarrow[\text{and below}]{\text{long text above!}}


long text above
and below

above
\xlongequal[]{}
below

above above
\xrightarrow[]{} \xleftarrow[]{}
below below

above
\xleftrightarrow[]{}
below

above above
\xtwoheadrightarrow[]{} \xtwoheadleftarrow[]{}
below below

above above
\xRightarrow[]{} \xLeftarrow[]{}
below below

above above
\xrightharpoonup[]{} \xleftharpoonup[]{}
below below

above above
\xrightharpoondown[]{} \xleftharpoondown[]{}
below below

above above
\xrightleftharpoons[]{} \xLeftrightarrow[]{}
below below

above
\xleftrightharpoons[]{}
below

above above
\xhookrightarrow[]{} \xhookleftarrow[]{}
below below

above
\xmapsto[]{}
below

above
\xtofrom[]{}
below

Accents
Regular accents have a fixed width and do not stretch For example compare


ABC
\vec{ABC}

and

ABC
\overrightarrow{ABC} 

The following commands are supported for compatibility with existing content but their use is
generally discouraged when creating new LaTeX content if there is an equivalent Unicode
character available
For example use é rather than \'{e} 

ˊ \acute{} ˋ \grave{}

˙ \dot{} ¨ \ddot{}

˚ ~
\mathring{} \tilde{}

ˉ \bar{} ˘ \breve{}

ˇ \check{} ^ \hat{}

⃗ \vec{} ê \^{e}

è `{e} é \'{e}

ä \"{a} ā \={a}

ç \c{c} ñ \~{n}

Extensible Accents

ABC \overline{} ABC \overgroup{}

ABC \overbrace{} ABC \overlinesegment{}

ABC \overrightarrow{} ABC \overleftarrow{}

ABC \overleftrightarrow{} ABC \overarc{}

ABC \overparen{} ABC \wideparen{}

ABC \widetilde{} ABC \widehat{}

ABC \widecheck{} ABC \Overrightarrow{}

ABC \overleftharpoon{} ABC \overrightharpoon{}

ABC \underline{} ABC \undergroup{}

ABC \underbrace{} ABC \underlinesegment{}

ABC \underrightarrow{} ABC \underleftarrow{}

ABC \underleftrightarrow{} ABC \underarc{}

ABC \underparen{} ABC \utilde{}

Relational Operators
To display a vertical stack of two symbols as a relational operator use the
\stackrel command
?
a= b
a\stackrel{?}{=}b 

= = < <

< \lt > >

> \gt ≤ \le

≤ \leq ≥ \ge

≥ \geq ∥ \shortparallel

⩽ \leqslant ⩾ \geqslant

≳ \gtrsim ≊ \approxeq

≈ \thickapprox ⪅ \lessapprox

⪆ \gtrapprox ⪷ \precapprox

⪸ \succapprox ∼ \thicksim

≿ \succsim ≾ \precsim

∽ \backsim ≂ \eqsim

⋍ \backsimeq ≲ \lesssim

⌣ \smallsmile ⌢ \smallfrown

≦ \leqq ⪕ \eqslantless

⋘ \lll ≶ \lessgtr

⋚ \lesseqgtr ⪋ \lesseqqgtr

≓ \risingdotseq ≒ \fallingdotseq

≼ \preccurlyeq ⋞ \curlyeqprec

⊨ \vDash ⊪ \Vvdash

≏ \bumpeq ≎ \Bumpeq

≧ \geqq ⪖ \eqslantgtr

⋙ \ggg ≷ \gtrless

⋛ \gtreqless ⪌ \gtreqqless

≽ \succcurlyeq ⋟ \curlyeqsucc

⊩ \Vdash ∣ \shortmid

≬ \between ⋔ \pitchfork

∝ \varpropto ⋘ \llless

⋙ \gggtr ≑ \doteqdot

≑ \Doteq ≖ \eqcirc

≗ \circeq ⊲ \lhd

⊳ \rhd ⋖ \lessdot

⋗ \gtrdot ≪ \ll

≫ \gg :− \coloneq

≝ \measeq ≞ \eqdef

≟ \questeq ≅ \cong

≡ \equiv ≺ \prec

⪯ \preceq ≻ \succ

⪰ \succeq ⊥ \perp

∝ \propto ⌣ \smile

⌢ \frown ∼ \sim

≐ \doteq ⋈ \bowtie

⋈ \Join ≍ \asymp

≈ \approx ∥ \parallel

≃ \simeq : \ratio

∷ \coloncolon :− \colonequals

∷− \coloncolonequals ∹ \equalscolon

−∷ \equalscoloncolon :− \colonminus

∷− \coloncolonminus −: \minuscolon

−∷ \minuscoloncolon ∷≈ \coloncolonapprox

∷∼ \coloncolonsim ∼: \simcolon

∼∷ \simcoloncolon ≈∷ \approxcoloncolon

∌ \notni lim sup \limsup

lim inf \liminf : \ordinarycolon

: \vcentcolon ∷ \dblcolon

≔ \coloneqq ∷= \Coloneqq

:− \coloneq ∷− \Coloneq

≕ \eqqcolon =∷ \Eqqcolon

∹ \eqcolon −∷ \Eqcolon

:≈ \colonapprox ∷≈ \Colonapprox

:∼ \colonsim ∷∼ \Colonsim

Negated Relational Operators


To negate other relational operators use the \not command eg ≡
 \not\equiv 


= \ne 
= \neq


= \not=  \not{}

≮ \nless ≰ \nleq

⪇ \lneq ≨ \lneqq

 \nleqq  \nleqslant

≱ \ngeq  \lvertneqq

⋦ \lnsim ⪉ \lnapprox

⊀ \nprec ⋠ \npreceq

⋨ \precnsim ⪹ \precnapprox

≁ \nsim  \nshortmid

∤ \nmid ⊬ \nvdash

⊭ \nvDash ≯ \ngtr

 \ngeqslant  \ngeqq

⪈ \gneq ≩ \gneqq

 \gvertneqq ⋧ \gnsim

⪊ \gnapprox ⊁ \nsucc

⋡ \nsucceq ⋩ \succnsim

⪺ \succnapprox ≆ \ncong

 \nshortparallel ∦ \nparallel

⊯ \nVDash ⊮ \nVdash

⪵ \precneqq ⪶ \succneqq

⊴ \unlhd ⊵ \unrhd

Sets

∅ \emptyset ∅ \varnothing

N \N R \R

Q \Q C \C

Z \Z P \P

N \doubleStruckCapitalN R \doubleStruckCapitalR
macro macro

Q \doubleStruckCapitalQ Z \doubleStruckCapitalZ
macro macro

P \doubleStruckCapitalP
macro

Set Operators

∩ \cap ∪ \cup

∖ \setminus ∖ \smallsetminus

∁ \complement

Relational Set Operators


 \nsupseteqq ⊋ \supsetneq

 \varsupsetneq ⫌ \supsetneqq

 \varsupsetneqq  \nsubseteqq

⫅ \subseteqq ⋐ \Subset

⊏ \sqsubset ⫆ \supseteqq

⋑ \Supset ⊐ \sqsupset

⊑ \sqsubseteq ⊒ \sqsupseteq

∈ \in ∉ \notin

∋ \ni ∋ \owns

∍ \backepsilon ⊂ \subset

⊃ \supset ⊆ \subseteq

⊇ \supseteq ⊊ \subsetneq

 \varsubsetneq ⫋ \subsetneqq

 \varsubsetneqq ⊄ \nsubset

⊅ \nsupset ⊈ \nsubseteq

⊉ \nsupseteq

Greek

α \alpha β \beta

γ \gamma δ \delta

ϵ \epsilon ε \varepsilon

ζ \zeta η \eta

θ \theta ϑ \vartheta

ι \iota κ \kappa

ϰ \varkappa λ \lambda

μ \mu ν \nu

ξ \xi o \omicron

π \pi ϖ \varpi

ρ \rho ϱ \varrho

σ \sigma ς \varsigma

τ \tau ϕ \phi

φ \varphi υ \upsilon

χ \chi ψ \psi

ω \omega ϝ \digamma

A \Alpha B \Beta

Γ \Gamma Γ \varGamma

Δ \Delta Δ \varDelta

E \Epsilon Z \Zeta

H \Eta Θ \Theta

Θ \varTheta I \Iota

K \Kappa Λ \Lambda

Λ \varLambda M \Mu

N \Nu Ξ \Xi

Ξ \varXi O \Omicron

Π \Pi Π \varPi

P \rho Σ \Sigma

Σ \varSigma T \Tau

Φ \Phi Φ \varPhi

Υ \Upsilon Υ \varUpsilon

X \Chi Ψ \Psi

Ψ \varPsi Ω \Omega

Ω \varOmega

Hebrew

ℵ \aleph ℶ \beth

ℷ \gimel ℸ \daleth

Letterlike Symbols

@ @ ∣ \mid

⊤ \top ⊥ \bot

∇ \nabla ∂ \partial

ℓ \ell ℏ \hbar

£ \pounds € \euro

& \And \$

\% ∆ \differencedelta

℘ \wp ℏ \hslash

Ⅎ \Finv ⅁ \Game

ð \eth ℧ \mho

k \Bbbk ¥ \yen

ı \imath ȷ \jmath

° \degree ℜ \Re

ℑ \Im

Delimiters
A delimiter also called a fence is a symbol used to group some symbols for
example parentheses brackets braces etc…

To grow delimiters based on their content use \left##...\right 

Regular delimiters \left##...\right


x ∣x
{x∣ > 0}
2 {x∣ > 0}
∣2

\lbrace x \| \frac{x}{2} > 0\rbrace \left\lbrace x \middle\| \frac{x}{2}


> 0\right\rbrace

The left and right delimiters do not have to match

1
( ] \left\lparen \frac1x \right\rbrack
x
To omit a delimiter use . 

1
( \left\lparen \frac1x \right.
x

The argument to \left  \right and \middle can be one of the following
commands

( \lparen ) \rparen

{ \lbrace } \rbrace

⟨ \langle ⟩ \rangle

⌊ \lfloor ⌋ \rfloor

⌈ \lceil ⌉ \rceil

∣ \vert ∣ \lvert

∣ \rvert ∣ \|

∥ \Vert ∥ \mVert

∥ \lVert ∥ \rVert

[ \lbrack ] \rbrack

{ \{ } \}

( ( ) )

[ [ ] ]

┌ \ulcorner ┐ \urcorner

└ \llcorner ┘ \lrcorner

⟮ \lgroup ⟯ \rgroup

⎰ \lmoustache ⎱ \rmoustache

∣ \mvert

Punctuation

. . ? ?

! ! : :

∷ \Colon : \colon

, , ; ;

” "

Dots

⋅ \cdotp . \ldotp

⋮ \vdots ⋯ \cdots

⋱ \ddots … \ldots

… \mathellipsis

Shapes

⋄ \diamond ◊ \Diamond

◊ \lozenge ⧫ \blacklozenge

□ \square □ \Box

■ \blacksquare

◯ \bigcirc Ⓢ \circledS

® \circledR

◃ \triangleleft ▹ \triangleright

△ \triangle ▽ \triangledown

◀ \blacktriangleleft ▶ \blacktriangleright

▲ \blacktriangle ▼ \blacktriangledown

△ \vartriangle ⊲ \vartriangleleft

⊳ \vartriangleright

≜ \triangleq ⊴ \trianglelefteq

⊵ \trianglerighteq ⋪ \ntriangleleft

⋫ \ntriangleright ⋬ \ntrianglelefteq

⋭ \ntrianglerighteq

△ \bigtriangleup ▽ \bigtriangledown

† \dagger † \dag

‡ \ddag ‡ \ddagger

✠ \maltese

St Marys Road Symbols for Theoretical Computer


Science

↤ \mapsfrom ⤆ \Mapsfrom

⤇ \MapsTo ⅄ \Yup

↯ \lightning ⇽ \leftarrowtriangle

⇾ \rightarrowtriangle ⇿ \leftrightarrowtriangle

⊡ \boxdot △ \bigtriangleup

▽ \bigtriangledown ◫ \boxbar

⟅ \Lbag ⟆ \Rbag

⟦ \llbracket ⟧ \rrbracket

⟻ \longmapsfrom ⟽ \Longmapsfrom

⟾ \Longmapsto ⧄ \boxslash

⧅ \boxbslash ⧆ \boxast

⧇ \boxcircle ⧈ \boxbox

⨟ \fatsemi ⪦ \leftslice

⪧ \rightslice ⫴ \interleave

⫼ \biginterleave ⫽ \sslash

⫾ \talloblong

Layout
These commands change the amount of space around a symbol \mathop{}
treats its argument as if it was a large operator \mathrel{} a relational operator
\mathbin{} a binary operator \mathopen{} and \mathclose{} an opening and
closing delimiter respectively \mathpunct{} a punctuation \mathinner{} a
fraction and \mathord{} an ordinary symbol

x+0 + 1 x\mathop{+}0+1 x = arg = \mathbin{}


0

x =arg= 0\mathrel{} x = arg= 0\mathopen{}

x =arg = 0\mathclose{} x =arg = 0\mathpunct{}

x = arg = \mathinner{}
0 x = arg = \mathord{}
0

arg
x=0 \overset{}{} =0
x arg \underset{}{}

arg arg
y=1 \overunderset{arg}{x=0} x=0 \stackrel[]{}{}
x=0
{y=1}

arg
x=0 \stackbin[]{}{} 0/ \rlap{}

/o \llap{} /o \mathllap{}

/0 \mathrlap{}

Spacing

› ‹ \hspace{} › ‹ \hspace*{}

›!‹ \! ›, ‹ \,

›:‹ \: ›; ‹ \;

›‹ \enskip › ‹ \enspace

› ‹ \quad › ‹ \qquad

Decorations

x+1=0 \textcolor{blue} Recommended over \color


{x+1=0}

x+1=0 {\color{blue}
x+1=0#}}

ax2 + bx + c \colorbox{yellow} The argument is in Text Mode Use \[##...\]


{\[ax^2+bx+c\]} to switch to math mode

\fcolorbox{}{}{}

1
\boxed{1+\frac{1}
1+ x
{x#}}

\bbox[]{} See MathJax BBox documentation

\rule[]{2em} The arguments are the width and height The


{1em} optional argument is an offset from the
baseline

Notations

\enclose
The \enclose command is very flexible It accepts three arguments two of which
are required

\enclose{<notation>}![<style!>]{<body>}

<notation> a list of whitespacedelimited values

x=0 box

x=0 roundedbox

x=0 circle

x=0 top

x=0 left

x=0 bottom

x=0 right

x=0 horizontalstrike

x=0 verticalstrike

x=0 updiagonalstrike
x=0 downdiagonalstrike

x=0 updiagonalarrow

x=0 phasorangle

x=0 radical

x=0 longdiv

x=0 actuarial

x=0 madruwb

They can be combined

x=0 roundedbox, updiagonalstrike

<style> an optional list of comma separated keyvalue pairs including


mathbackground="<color>" background color of the expression
mathcolor="<color>" color of the notation for example red or #cd0030
or rgba(205, 0, 11, .4) 

padding="<dimension>" "auto" or an amount of padding around the


content
shadow="<shadow>"  "auto" or "none" or a CSS box-shadow expression
for example "0 0 2px rgba(0, 0, 0, 0.5)" 

in addition the style property can include a stroke style expression that
follows the shorthand syntax of the CSS border property for example
"2px solid red" 

<body> a math expression that is enclosed by the specified notations

\enclose is a LaTeX extension introduced by MathJax that follows the


<menclose> definition of MathML

x=0
\enclose{updiagonalstrike roundedbox}[1px solid red,
mathbackground="#fbc0bd"]{x=0}

1
x
\enclose{circle}[mathbackground="#fbc0bd"]{\frac1x}

x2 + y 2
√x2 + y 2
\enclose{roundedbox}[1px dotted #cd0030]{\frac{x^2+y^2}{\sqrt{x^2+y^2#}}}

\cancel \bcancel and \xcancel


Command… is a shorthand for…
\enclose{updiagonalstrike}{body}

\cancel{body}

\enclose{downdiagonalstrike}{body}

\bcancel{body}

\enclose{updiagonalstrike

\xcancel{body} downdiagonalstrike}{body}

The \cancel  \bcancel and \xcancel commands are part of the cancel
LaTeX package

Shortcuts
Some commands are shortcuts for common notations

Command… is a shorthand for…

body \enclose{actuarial}{body}

\angl{body}

n \enclose{actuarial}{n}
\angln

r \enclose{actuarial}{r}
\anglr

k \enclose{actuarial}{k}
\anglk

Colors
To change the foreground color use the \textcolor{}{} command

To change the background use the \colorbox{}{} command

The first argument of these commands is a color specified as

one of red  orange  yellow  lime  green  teal  blue  indigo 

purple  magenta  black  dark-grey  grey  light-grey  `white

a RGB color using the standard CSS format  #d7170b or rgb(240, 20, 10) 
one of the  colors from dvips color name  CadetBlue  Note that these
names are casesensitive
one of the  Mathematica color from ColorData[97, "ColorList"]  M0 to
M9 

a color defined using the syntax from the xcolor package for example
Blue!20!Black!30!Green

if the color is prefixed with a -  the complementary color is used

The following color names are recommended

These colors have been carefully selected for a balanced representation of


the range of hues on the color circle with similar lightness and intensity They
will map to different color values than the dvips colors of the same name

To have proper legibility based on usage these color names will map to
different values when used as a foreground color and a background color To
use a specific color value use a RGB color instead

For best portability between versions of TeX limit yourself to this subset of
DVIPS colors White  Black  Gray  Red  Orange  Yellow  LimeGreen 
Green  TealBlue  Blue  Violet  Purple and Magenta  Those names are
casesensitive

Font Styling

\selectfont

Bold

Don Knuth
\fontseries{} \boldsymbol{}
DonKnuth

\bfseries \mdseries

\bm{}
DonKnuth DonKnuth
\bold{}

Don Knuth
\textbf{} Don Knuth\textmd{}

DonKnuth
\mathbf{} \mathbfit{}

Italic

\upshape \slshape

Don Knuth\textup{} Don Knuth\textsl{}

Don Knuth\textit{} DonKnuth \mathit{}

Font Family

Typewriter / Monospace

Don Knuth \fontfamily{} Don Knuth\texttt{}

DonKnuth \mathtt{} DonKnuth\ttfamily

SansSerif

Don Knuth \textsf{} DonKnuth \mathsf{}

DonKnuth\sffamily

Math Variants

ABCdef \mathfrak{ABCdef}  Fraktur ABC \mathcal{ABCdef} –


Caligraphic

A BC 𝒹ℯ𝒻 \mathscr{ABCdef}  Script D𝕠𝕟K𝕟𝕦𝕥𝕙\mathbb{}  Blackboard

ABC𝕕𝕖𝕗 \Bbb{} DonKnuth\rmfamily

DonKnuth{\frak}

MathJax HTML Extension


MathLive support some commands from the MathJax HTML extension

\class

\class{custom-class}{x+1}
x+1

When used in a <math-field> component the class names should refer to a


stylesheet defined with a <style> tag inside the <math-field> element

<math-field>
<style>
#custom-class {
box-shadow: 0 0 10px #000; border-radius: 8px; padding: 8px;
}
!</style>

\class{custom-class}{\frac{1}{x+1!}}

!</math-field>

\cssId{custom-class}{Don Knuth}
DonKnuth

\htmlData
The argument of this command is a commadelimited list of key/value pairs eg
\htmlData{foo=green,bar=blue}{x=0}  A corresponding data-foo and data-bar
DOM attribute is generated to the rendered DOM

\htmlData{foo=green,bar=blue}{ \text{Don Knuth} }


Don Knuth

Other Extensions

\error
The argument of this command is a string that will be rendered in red

\error{\text{Don Knuth!}}
Don Knuth

\texttip
The first argument is a math expression to display the second argument is the
text to display on hover

\mathtip{\text{Don Knuth!}}{\text{Knuth is the author of TeX!}}


Don Knuth

\mathtip
The first argument is a math expression to display the second argument is the a
math expression to display on hover

\mathtip{e^{i\pi!}}{-1}
eiπ

Others

DON KNUTH\fontshape{} Small Caps \scshape

DON KNUTH\textsc{} Don Knuth\textrm{}

DonKnuth\mathrm{} Don Knuth\em{}  Emphasis

Don \emph{}  Emphasis

Deprecated
The following commands are supported for compatibility with existing content
but their use is generally discouraged when creating new LaTeX content

{\bf Don Knuth} Use \textbf{} or \bfseries instead

{\it Don Knuth} Use \textit{} or \itshape instead

Sizing
In LaTeX using the sizing commands below may not always achieve the expected
result In MathLive the sizing commands are applied consistently to text and math
mode

These size are relative to the font-size property of the mathfield

eiπ + 1 = 0
\tiny

eiπ + 1 = 0 \scriptsize

eiπ + 1 = 0 \footnotesize

eiπ + 1 = 0 \small

eiπ + 1 = 0 \normalsize

e +1=0
iπ \large

e +1=0 iπ \Large

e +1=0 iπ \LARGE

e +1=0
\huge

e +1=0
\Huge

The size of delimiters can be controlled manually with the commands below The
\left##...\right##... commands calculate automatically the size of the delimiters
based on the content

The command must be followed by a delimiter  for example ( or \lbrace


or \lbrack  If the command is used on its own nothing is displayed

(∣∣) \bigl( \bigm\| \bigr)


(∣) \Bigl( \Bigm\| \Bigr)


(∣∣) \biggl( \biggm\| \biggr)


(∣)
∣ \Biggl( \Biggm\| \Biggr)

Various

/ / ♯ \sharp

♭ \flat ♮ \natural

# \# & \&

♣ \clubsuit ♡ \heartsuit

♠ \spadesuit ♢ \diamondsuit

\ \backslash ∞ \infty

′ \prime ″ \doubleprime

∠ \angle \_

✓ \checkmark ╱ \diagup

∡ \measuredangle ∢ \sphericalangle

‵ \backprime ‶ \backdoubleprime

/ \/ ∣ |

’ ' ⊶ \originalof

⊶ \laplace ⊷ \imageof

⊷ \Laplace − −

‘ ``` ~

\space \smash[]{}

\vphantom{} \hphantom{}

\phantom{}

MediaWiki texvc.sty package


MathLive supports the commands used by MediaWiki pages except for the
deprecated ones

↓ \darr ⇓ \dArr

⇓ \Darr ⟨ \lang

⟩ \rang ↑ \uarr

⇑ \uArr ⇑ \Uarr

N \N R \R

Z \Z ℵ \alef

ℵ \alefsym A \Alpha

B \Beta ∙ \bull

X \Chi ♣ \clubs

C \cnums C \Complex

‡ \Dagger ♢ \diamonds

∅ \empty E \Epsilon

H \Eta ∃ \exist

↔ \harr ⇔ \hArr

⇔ \Harr ♡ \hearts

ℑ \image ∞ \infin

I \Iota ∈ \isin

K \Kappa ← \larr

⇐ \lArr ⇐ \Larr

↔ \lrarr ⇔ \lrArr

⇔ \Lrarr M \Mu

N \natnums N \Nu

O \Omicron ± \plusmn

→ \rarr ⇒ \rArr

⇒ \Rarr ℜ \real

R \reals R \Reals

P \Rho ⋅ \sdot

\S \sect ♠ \spades

⊂ \sub ⊆ \sube

⊇ \supe T \Tau

ϑ \thetasym ℘ \weierp

Z \Zeta

Physics

Braket Notation
MathLive supports the braket package

⟨Ψ∣ \bra{\Psi} macro ∣Ψ⟩ \ket{\Psi} macro

⟨ab⟩ \braket{} macro ⟨ab∣ \Bra{} macro

∣ab⟩ \Ket{} macro ⟨ab⟩ \Braket{} macro

Chemistry mhchem package


MathLive supports the mhchem package

Chemical Formulae

H2 O \ce{H2O} Sb2 O3 \ce{Sb2O3}

Charges

[AgCl2 ]− \ce{[AgCl2]-} Y99+ \ce{Y^99+}

Y99+ \ce{Y^{99+#}} H+ \ce{H+}

CrO4 2− \ce{CrO4^2-}

Stoichiometric numbers

2 H2 O \ce{2 H2O} 2 H2 O \ce{2H2O}

1
0.5 H2 O \ce{0.5 H2O} 2
H2 O \ce{1/2 H2O}

(1/2) H2 O \ce{(1/2) H2O} n H2 O \ce{$n$ H2O}

Isotopes

227 + 227 +
90 Th \ce{^{227}_{90}Th+} 90 Th \ce{^227_90Th+}

0 − 0 −
−1n \ce{^{0}_{-1}n^{-}} −1n \ce{^0_-1n-}

H 3HO \ce{H{}^3HO} H 3HO \ce{H^3HO}

Complex Examples
\ce{CO2 + C !-> 2 CO}
CO2 + C 2 CO

\ce{Hg^2+ !->[I-] HgI2 !->[I-] [Hg^{II}I4]^2-}


I− I−
Hg 2+
HgI2 [HgII I4 ]2−

\ce{$K = \ce{\frac{[Hg^2+][Hg]}{[Hg2^2+]!}}$}
[Hg2+ ][Hg]
K=
[Hg2 2+ ]

\ce{Hg^2+ !->[I-] $\underset{\mathrm{red!}}{\ce{HgI2!}}$ !->[I-] $\underset{\mathrm{red!}}{\ce{[Hg^{II}I4]^2-}}$}

I− I−
Hg 2+
HgI2 [HgII I4 ]2−
red red

Macros

⟺ \iff {ab} \set{}

d \rd D \rD

E \scriptCapitalE H \scriptCapitalH

L \scriptCapitalL C \gothicCapitalC

H \gothicCapitalH I \gothicCapitalI

R \gothicCapitalR i \imaginaryI

j \imaginaryJ e \exponentialE

d \differentialD D \capitalDifferentialD

\Set{ x\in\mathbf{R}^2 | 0<!{|x!|}<5 }


{x ∈ R2 ∣0 < ∣x∣ < 5}

Environments / Matrixes
Environements are used to typeset a set of related items for examples cells in a
matrix or multiline equations

Each row in a tabular environment is separated by a \\ command

Each column is separated by a & 

Matrixes

array
A simple table with no delimiters

a+1 b+1 \begin{array}{lc}


a + 1 & b + 1 \\
c 1 c & \frac{1}{d}
d
\end{array}

The {lc} argument specifies how many columns there are and how they should
be formated

l  leftaligned
c  centered
r  rightaligned

To add a vertical line separating columns  add | character in the column


format

\begin{array}{l|c}
a+1 b+1 a + 1 & b + 1 \\
c & \frac{1}{d}
1
c d \end{array}

To add a double vertical line separating columns  add two | characters in the
column format

\begin{array}{l!||c}
a+1 b+1 a + 1 & b + 1 \\
c & \frac{1}{d}
1
c d \end{array}

To add a dashed vertical line between two columns  use : 

\begin{array}{l:c}
a+1 b+1 a + 1 & b + 1 \\
c & \frac{1}{d}
1
c d \end{array}

matrix
The matrix environment is very similar to array  but it does not have an
argument to specify the format of the columns

a+1 b+1 \begin{matrix}


a + 1 & b + 1 \\
c 1 c & \frac{1}{d}
d
\end{matrix}

To specify the format of the columns  use the starred version and an optional
argument This applies to all the other matrix environments

\begin{matrix*}[l|r]
a+1 b+1 a + 1 & b + 1 \\
c & \frac{1}{d}
1
c d \end{matrix*}

pmatrix
A matrix with parentheses as delimiters

⎛a b⎞ \begin{pmatrix}
a + 1 & b + 1 \\
⎝c 1⎠ c & \frac{1}{d}
d
\end{pmatrix}

bmatrix
A matrix with square brackets as delimiters

⎡a b⎤ \begin{bmatrix}
a + 1 & b + 1 \\
⎣c 1⎦ c & \frac{1}{d}
d
\end{bmatrix}

Bmatrix
A matrix with braces curly brackets as delimiters

⎧a b⎫ \begin{Bmatrix}
⎨ ⎬ a + 1 & b + 1 \\
⎩ 1⎭ c & \frac{1}{d}
c d
\end{Bmatrix}

vmatrix
A matrix with single bars as delimiters

∣a b ∣∣ \begin{vmatrix}

∣ ∣ a + 1 & b + 1 \\
∣ ∣
∣c 1∣ c & \frac{1}{d}
∣ d∣
\end{vmatrix}

Vmatrix
A matrix with double bars as delimiters

∥a b∥ \begin{Vmatrix}
∥ ∥
∥ ∥ a + 1 & b + 1 \\
∥ ∥
∥c 1∥ c & \frac{1}{d}
∥ d∥
\end{Vmatrix}

matrix*
An array a matrix without delimiters

a b \begin{matrix*}
a + 1 & b + 1 \\
c 1 c & \frac{1}{d}
d
\end{matrix*}

smallmatrix
A matrix typeset in a way that may be suitable on the same line as text

a b
\begin{smallmatrix} a & b \\ c &
1
c \frac{1}{d} \end{smallmatrix}
d

Other Environments

cases dcases and rcases


Use these environments to write piecewise functions

⎧1
⎪ if n = 0 f(n) = \begin{cases}
f (n) = ⎨ 1 & \text{if } n = 0 \\
⎪f (n − 1) + f (n − 2)
⎩ if n ≥ 2
f(n-1) + f(n-2) & \text{if } n \ge 2
\end{cases}

To typeset the content in Display style  use dcases instead

⎧1

f(n) = \begin{dcases}

if n = 0
1 & \text{if } n = 0 \\
f (n) = ⎨

f(n-1) + f(n-2) & \text{if } n \ge 2
⎪f (n − 1) + f (n − 2)
⎩ if n ≥ 2 \end{dcases}

To display the brace on the right  use rcases 

if n = 0⎫

\begin{rcases}

1
1 & \text{if } n = 0 \\
⎬ = f (n)

f(n-1) + f(n-2) & \text{if } n \ge 2
f (n − 1) + f (n − 2) if n ≥ 2⎭
⎪ \end{rcases} = f(n)

gather
Consecutive equations without alignment

3(a − x) = 3.5x + a − 1
\begin{gather}
3(a-x) = 3.5x + a - 1 \\
3a − 3x = 3.5x + a − 1
3a - 3x = 3.5x + a - 1 \\
a = \frac{13}{4}x - \frac{1}{2}
a = 13 x − 1 \end{gather}
4 2

multline
The first line is left aligned the last line is right aligned and all the intermediate
lines are centered

3(a − x) = 3.5x + a − 1
\begin{multline}
3(a-x) = 3.5x + a - 1 \\
3a − 3x = 3.5x + a − 1
3a - 3x = 3.5x + a - 1 \\
a = \frac{13}{4}x - \frac{1}{2}
a = 13 x − 1 \end{multline}
4 2

align

2 \begin{align}
f (x) = (a + b) f(x) & = (a+b)^2 \\
= a2 + 2ab + b2 & = a^2+2ab+b^2 \\
\end{align}

Others

\begin{math}
1
x+ 2 x+\frac12
\end{math}

\begin{displaymath}
1
x+ 2 x+\frac12
\end{displaymath}

\begin{equation}
x+ 1 x+\frac12
2
\end{equation}

\begin{subequations}
x+ 1 x+\frac12
2
\end{subequations}

ab
c1 \begin{eqnarray}!!...\end{eqnarray}
d


Avoid use align instead

\begin{center}
first \text{first}
\end{center}

These environments do not form a math environment by themselves but can be


used as building blocks for more elaborate structures

3(a − x) = 3.5x + a − 1

3a − 3x = 3.5x + a − 1
\begin{gathered}!!...\end{gathered}

a = 13 x − 1
4 2

3(a − x) = 3.5x + a − 1

3a − 3x = 3.5x + a − 1
\begin{split}!!...\end{split}

a = 13 x − 1
4 2

3(a − x) = 3.5x + a − 1

3a − 3x = 3.5x + a − 1
\begin{aligned}!!...\end{aligned}

a = 13 x − 1
4 2

TeX Registers
The math typesetting is influenced by some constants that are stored in
registers Those registers can be set globally on a mathfield using the
registers option

Register Purpose
arrayrulewidth Width of separator lines in array environments

arraycolsep Amount of space between separator lines

arraystretch Stretch factor between rows in an environment

delimitershortfall

doublerulesep Amount of space between adjacent separator lines

jot Vertical space between the lines for all math expressions
which allow multiple lines

fboxrule Default width of the border with commands such as \boxed


or \fbox

fboxsep Default padding between a box and its content

medmuskip Amount of space around a binary operator See also


thinmuskip  thickmuskip 

nulldelimiterspace Horizontal space of an empty delimiter

thickmuskip Amount of space around a relational operator See also


medmuskip  thinmuskip 

thinmuskip Amount of space around math punctuation See also


medmuskip  thickmuskip 

TeX Primitives
The commands below are TeX primitives Most are only useful when writing TeX
packages or macros

Command
% Anything after a % character and an end of line character is
interpreted as a comment and ignored

\limits
\nolimits

\relax

\noexpand

\obeyspaces In Math Mode spaces are normally ignored Using this


command spaces will be preserved even in Math Mode

\bgroup Begin/End group synonym for open/close brace


\egroup

\string

\csname Turn the next tokens until \endcsname  into a command


\endcsname

\ensuremath{} If in Math Mode does nothing Otherwise switch to Math


Mode

Version MathLive  / Cortex Compute Engine undefined


Updated November  
Problem? Feedback? File a report at githubcom/cortexjs/cortexjsio

You might also like