Abstract
Docutils supports mathematical content with a "math" directive and role. The input format is LaTeX math syntax[1] with support for literal Unicode symbols.
The math role can be used for inline mathematical expressions: :math:`\psi(r) = \exp(-2r)` will produce Ï ( r ) = exp ( â 2 r ) . Inside the backtics you can write anything you would write between dollar signs in a LaTeX document. [1]
Tip
If you put .. default-role:: math at the top of your document, you can write `x^2` instead of the longer version: :math:`x^2`. You can also introduce an abbreviation like this .. role:: m(math). That will allow you to write :m:`x^2` or `x^2`:m:.
The math directive is used for displayed equations. It corresponds to an equation* or align* environment in a LaTeX document. If you write:
.. math:: \psi(r) = e^{-2r}
you will get:
Ï ( r ) = e â 2 r
A more complex example is the definition of the Fourier transform:
.. math:: :name: Fourier transform (\mathcal{F}f)(y) = \frac{1}{\sqrt{2\pi}^{\ n}} \int_{\mathbb{R}^n} f(x)\, e^{-\mathrm{i} y \cdot x} \,\mathrm{d} x.
which is rendered as:
( â± f ) ( y ) = 1 2 Ï n â« â n f ( x ) e â i y â x d x .
The :name: option puts a label on the equation that can be linked to by hyperlink references.
Displayed equations can use \\ and & for line shifts and alignments:
.. math:: a &= (x + y)^2 & b &= (x - y)^2 \\ &= x^2 + 2xy + y^2 & &= x^2 - 2xy + y^2
LaTeX output will wrap it in an align* environment. The result is:
a = ( x + y ) 2 b = ( x â y ) 2 = x 2 + 2 x y + y 2 = x 2 â 2 x y + y 2
The aligned environment can be used as a component in a containing expression. E.g.,
.. math:: \left. \begin{aligned} B' & = -\partial\times E, \\ E' & = \partial\times B - 4\pi j, \end{aligned} \right\} \qquad \text{Maxwellâs equations}
results in
B ' = â â Ã E E ' = â Ã B â 4 Ï j } Maxwellâs equations.
2 Mathematical symbolsThe following tables are adapted from the first edition of "The LaTeX Companion" (Goossens, Mittelbach, Samarin) and the AMS Short Math Guide.
2.1 Accents and embellishmentsThe "narrow" accents are intended for a single-letter base.
x ´
\acute{x}
t Ë
\dot{t}
x `
\grave{x}
x â
\vec{x}
v Ë
\bar{v}
t ¨
\ddot{t}
x Ë
\hat{x}
x Ë
\breve{x}
t ËËË
\dddot{t}
x Ë
\mathring{x}
x Ë
\check{x}
t ËËËË
\ddddot{t}
n ~
\tilde{n}
When adding an accent to an i or j in math, dotless variants can be obtained with \imath and \jmath: ı Ë , È· â .
For embellishments that span multiple symbols, use:
g b i ~
\widetilde{gbi}
g b i ^
\widehat{gbi}
g b i _
\overline{gbi}
g b i _
\underline{gbi}
g b i â
\overbrace{gbi}
g b i â
\underbrace{gbi}
g b i â
\overleftarrow{gbi}
g b i â
\underleftarrow{gbi}
g b i â
\overrightarrow{gbi}
g b i â
\underrightarrow{gbi}
g b i â
\overleftrightarrow{gbi}
g b i â
\underleftrightarrow{gbi}
2.2 Binary operators*
*
â
\circledast
â
\ominus
+
+
â
\circledcirc
â
\oplus
â
-
â
\circleddash
â
\oslash
â¶
:
âª
\cup
â
\otimes
â
\Cap
â
\curlyvee
±
\pm
â
\Cup
â
\curlywedge
â
\rightthreetimes
⨿
\amalg
â
\dagger
â
\rtimes
â
\ast
â¡
\ddagger
â§µ
\setminus
â¯
\bigcirc
â
\diamond
â
\smallsetminus
â½
\bigtriangledown
÷
\div
â
\sqcap
â³
\bigtriangleup
â
\divideontimes
â
\sqcup
â¡
\boxdot
â
\dotplus
â
\star
â
\boxminus
â©
\doublebarwedge
Ã
\times
â
\boxplus
â
\gtrdot
â
\triangleleft
â
\boxtimes
âº
\intercal
â¹
\triangleright
â¢
\bullet
â
\leftthreetimes
â
\uplus
â©
\cap
â
\lessdot
â¨
\vee
â
\cdot
â
\ltimes
â»
\veebar
â¬
\centerdot
â
\mp
â§
\wedge
â
\circ
â
\odot
â
\wr
2.3 Extensible delimitersUnless you indicate otherwise, delimiters in math formulas remain at the standard size regardless of the height of the enclosed material. To get adaptable sizes, use \left and \right prefixes, for example g ( A , B , Y ) = f ( A , B , X = h [ X ] ( Y ) ) or
a n = ( 1 2 ) n
Use . for "empty" delimiters:
A = 1 1 â n | n = 0 â
See also the commands for fixed delimiter sizes below.
The following symbols extend when used with \left and \right:
2.3.1 Pairing delimiters( )
( )
⨠â©
\langle \rangle
[ ]
[ ]
â â
\lceil \rceil
{ }
\{ \}
â â
\lfloor \rfloor
| |
\lvert \rvert
â® â¯
\lgroup \rgroup
â â
\lVert \rVert
â° â±
\lmoustache \rmoustache
2.3.2 Nonpairing delimiters|
|
|
\vert
â
\arrowvert
â
\|
â
\Vert
â
\Arrowvert
/
/
\
\backslash
âª
\bracevert
The use of | and \| for pairs of vertical bars may produce incorrect spacing, e.g., |k|=|-k| produces | k | = | â k | and |\sin(x)| produces | sin ( x ) | . The pairing delimiters, e.g. | â k | and | sin ( x ) | , prevent this problem.
2.4 Extensible vertical arrowsâ \uparrow
â \Uparrow
â \downarrow
â \Downarrow
â \updownarrow
â \Updownarrow
2.5 Functions (named operators)arccos
\arccos
gcd
\gcd
Pr
\Pr
arcsin
\arcsin
hom
\hom
projâ¯lim
\projlim
arctan
\arctan
inf
\inf
sec
\sec
arg
\arg
injâ¯lim
\injlim
sin
\sin
cos
\cos
ker
\ker
sinh
\sinh
cosh
\cosh
lg
\lg
sup
\sup
cot
\cot
lim
\lim
tan
\tan
coth
\coth
limâ¯inf
\liminf
tanh
\tanh
csc
\csc
limâ¯sup
\limsup
lim ¯
\varlimsup
deg
\deg
ln
\ln
lim _
\varliminf
det
\det
log
\log
lim â
\varprojlim
dim
\dim
max
\max
lim â
\varinjlim
exp
\exp
min
\min
Named operators outside the above list can be typeset with \operatorname{name}, e.g.
sgn ( â 3 ) = â 1 .
The \DeclareMathOperator command can only be used in the LaTeX preamble.
2.6 Greek lettersGreek letters that have Latin look-alikes are rarely used in math formulas and not supported by LaTeX.
Î
\Gamma
α
\alpha
μ
\mu
Ï
\omega
Î
\Delta
β
\beta
ν
\nu
Ï
\digamma
Î
\Lambda
γ
\gamma
ξ
\xi
ε
\varepsilon
Φ
\Phi
δ
\delta
Ï
\pi
ϰ
\varkappa
Î
\Pi
ϵ
\epsilon
Ï
\rho
Ï
\varphi
Ψ
\Psi
ζ
\zeta
Ï
\sigma
Ï
\varpi
Σ
\Sigma
η
\eta
Ï
\tau
ϱ
\varrho
Î
\Theta
θ
\theta
Ï
\upsilon
Ï
\varsigma
Î¥
\Upsilon
ι
\iota
Ï
\phi
Ï
\vartheta
Î
\Xi
κ
\kappa
Ï
\chi
Ω
\Omega
λ
\lambda
Ï
\psi
In LaTeX, the default font for capital Greek letters is upright/roman. Italic capital Greek letters can be obtained by loading a package providing the "ISO" math style. They are used by default in MathML.
Individual Greek italic capitals can also be achieved preceding the letter name with var like \varPhi: ð¤ ð¥ ð¬ ð· ð± ð¹ ð´ ð© ð¶ ð¯ ðº
2.7 Letterlike symbolsâ
\forall
âµ
\aleph
â
\hbar
â
\ell
â
\complement
â¶
\beth
â
\hslash
â
\wp
â
\exists
â·
\gimel
â
\Im
â
\Re
â²
\Finv
â¸
\daleth
ı
\imath
â
\circledR
â
\Game
â
\partial
È·
\jmath
â
\circledS
â§
\mho
ð
\eth
ð
\Bbbk
2.8 Math alphabetsThe TeX math alphabet macros are intended for mathematical variables where style variations are important semantically. They style letters and numbers with a combination of font attributes (shape, weight, family) --- non-alphanumerical symbols, function names, and mathematical text are left unchanged.
MathML uses the mathvariant style attribute or pre-styled characters from the Mathematical Alphanumeric Symbols Unicode block.
command
example
result
\mathrm
s_\mathrm{out}
s out
\mathbf
\mathbf{r}^2=x^2+y^2
ð« 2 = x 2 + y 2
\mathit
\mathit{\sin\Gamma}
sin ð¤
\mathcal
\mathcal{F}f(x)
â± f ( x )
\mathbb
\mathbb{R \subset C}
â â â
\mathfrak
\mathfrak{a+b}
ð + ð
\mathsf
\mathsf x
ð
\mathtt
\mathtt{0.12}
ð¶.ð·ð¸
The set of characters in a given "math alphabet" varies. LaTeX may produce garbage for unsupported characters. Additional math alphabets are defined in LaTeX packages, e.g.,
\mathbfit from isomath allows vector symbols in line with the International Standard [ISO-80000-2]. E.g., \mathbfit{r}^2=x^2+y^2 becomes ð 2 = x 2 + y 2 .
Several packages, e.g. mathrsfs, define \mathscr that selects a differently shaped "script" alphabet.
The listing below shows the characters supported by Unicode and Docutils with math_output MathML. [2]
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z ı È· ΠΠΠΠΠΠΣ Î¥ Φ Ψ Ω α β γ δ ε ζ η θ ι κ λ μ ν ξ Ï Ï Ï Ï Ï Ï Ï Ï Ï Ï Ïµ Ï Ï Ï° ϱ Ï Ï Ï â â 0123456789
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z ı È· ΠΠΠΠΠΠΣ Î¥ Φ Ψ Ω α β γ δ ε ζ η θ ι κ λ μ ν ξ Ï Ï Ï Ï Ï Ï Ï Ï Ï Ï Ïµ Ï Ï Ï° ϱ Ï Ï Ï â â 0123456789
ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð¡ ð¢ ð£ ð¤ ð¥ ð¦ ð§ ð¨ ð© ðª ð« ð¬ ð ð® ð¯ ð° ð± ð² ð³ ðª ð« ð¯ ð² ðµ ð· ðº ð¼ ð½ ð¿ ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð¡ ð ð ð ð ðððððððððð
ð´ ðµ ð¶ ð· ð¸ ð¹ ðº ð» ð¼ ð½ ð¾ ð¿ ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð â ð ð ð ð ð ð ð ð ð ð ð ð¡ ð¢ ð£ ð¤ ð¥ ð¦ ð§ ð¤ ð¥ ð¤ ð¥ ð© ð¬ ð¯ ð± ð´ ð¶ ð· ð¹ ðº ð¼ ð½ ð¾ ð¿ ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ϰ ð ð ð ð» 0123456789 [2]
ð¨ ð© ðª ð« ð¬ ð ð® ð¯ ð° ð± ð² ð³ ð´ ðµ ð¶ ð· ð¸ ð¹ ðº ð» ð¼ ð½ ð¾ ð¿ ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð£ ð¦ ð© ð« ð® ð° ð± ð³ ð´ ð¶ ð· ð¸ ð¹ ðº ð» ð¼ ð½ ð¾ ð¿ ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ðµ
ð ⬠ð ð â° â± ð¢ â â ð¥ ð¦ â â³ ð© ðª ð« ð¬ â ð® ð¯ ð° ð± ð² ð³ ð´ ðµ ð¶ ð· ð¸ ð¹ ⯠ð» â ð½ ð¾ ð¿ ð ð ð ð â´ ð ð ð ð ð ð ð ð ð ð ð
ð ⬠ð ð â° â± ð¢ â â ð¥ ð¦ â â³ ð© ðª ð« ð¬ â ð® ð¯ ð° ð± ð² ð³ ð´ ðµ ð¶ ð· ð¸ ð¹ ⯠ð» â ð½ ð¾ ð¿ ð ð ð ð â´ ð ð ð ð ð ð ð ð ð ð ð
ð¸ ð¹ â ð» ð¼ ð½ ð¾ â ð ð ð ð ð â ð â â â ð ð ð ð ð ð ð ⤠ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð¡ ð¢ ð£ ð¤ ð¥ ð¦ ð§ ð¨ ð© ðª ð« â¾ â¿ â â½ â¼ ððððððððð ð¡
ð ð â ð ð ð ð â â ð ð ð ð ð ð ð ð â ð ð ð ð ð ð ð ⨠ð ð ð ð¡ ð¢ ð£ ð¤ ð¥ ð¦ ð§ ð¨ ð© ðª ð« ð¬ ð ð® ð¯ ð° ð± ð² ð³ ð´ ðµ ð¶ ð·
ð ð¡ ð¢ ð£ ð¤ ð¥ ð¦ ð§ ð¨ ð© ðª ð« ð¬ ð ð® ð¯ ð° ð± ð² ð³ ð´ ðµ ð¶ ð· ð¸ ð¹ ðº ð» ð¼ ð½ ð¾ ð¿ ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð¢ð£ð¤ð¥ð¦ð§ð¨ð©ðªð«
ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð¡ ð¢ ð£ ð¤ ð¥ ð¦ ð§ ð¨ ð© ðª ð« ð¬ ð ð® ð¯ ð° ð± ð² ð³ ð´ ðµ ð¶ ð· ð¸ ð¹ ðº ð»
ð¼ ð½ ð¾ ð¿ ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð¡ ð¢ ð£ ð¤ ð¥ ð¦ ð§ ð¨ ð© ðª ð« ð¬ ð ð® ð¯ ð ð ð ð ð ð ð¢ ð¤ ð¥ ð§ ð¨ ðª ð« ð¬ ð ð® ð¯ ð° ð± ð² ð³ ð´ ðµ ð¶ ð· ð¹ ðº ð» ð¼ ð½ ð¾ ð¿ ð ð ð ð ð ð ð ð ð ð ð©
ð° ð± ð² ð³ ð´ ðµ ð¶ ð· ð¸ ð¹ ðº ð» ð¼ ð½ ð¾ ð¿ ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð¡ ð¢ ð£ ð¶ð·ð¸ð¹ðºð»ð¼ð½ð¾ð¿
In contrast to the math alphabet selectors, \boldsymbol only changes the font weight. It can be used to get a bold version of any mathematical symbol:
V i x ± cos ( α ) â 3 Î â x â â
V i x ± cos ( α ) â 3 Î â x â â
It is usually ill-advised to apply \boldsymbol to more than one symbol at a time.
2.9 Miscellaneous symbols#
\#
â£
\clubsuit
¬
\neg
&
\&
â¢
\diamondsuit
â
\nexists
â
\angle
â
\emptyset
â²
\prime
âµ
\backprime
â
\exists
â¯
\sharp
â
\bigstar
â
\flat
â
\spadesuit
â§«
\blacklozenge
â
\forall
â¢
\sphericalangle
â¼
\blacksquare
â¡
\heartsuit
â»
\square
â´
\blacktriangle
â
\infty
â
\surd
â¾
\blacktriangledown
â
\lozenge
â¤
\top
â¥
\bot
â¡
\measuredangle
â³
\triangle
â
\diagdown
â
\nabla
â½
\triangledown
â
\diagup
â®
\natural
â
\varnothing
2.10 Punctuation.
.
!
!
â®
\vdots
/
/
?
?
â¯
\dotsb
|
|
:
\colon [3]
â¦
\dotsc
'
'
â¯
\cdots
â¯
\dotsi
;
;
â±
\ddots
â¯
\dotsm
â¶
:
â¦
\ldots
â¦
\dotso
2.11 Relation symbols 2.11.1 Arrowsâº
\circlearrowleft
â»
\circlearrowright
â¶
\curvearrowleft
â·
\curvearrowright
â©
\hookleftarrow
âª
\hookrightarrow
â
\leftarrow
â
\rightarrow
â
\Leftarrow
â
\Rightarrow
â¢
\leftarrowtail
â£
\rightarrowtail
â½
\leftharpoondown
â
\rightharpoondown
â¼
\leftharpoonup
â
\rightharpoonup
â
\leftleftarrows
â
\rightrightarrows
â
\leftrightarrow
â
\Leftrightarrow
â
\leftrightarrows
â
\rightleftarrows
â
\leftrightharpoons
â
\rightleftharpoons
â
\leftrightsquigarrow
â
\rightsquigarrow
â
\Lleftarrow
â
\Rrightarrow
âµ
\longleftarrow
â¶
\longrightarrow
â¸
\Longleftarrow
â¹
\Longrightarrow
â·
\longleftrightarrow
âº
\Longleftrightarrow
â«
\looparrowleft
â¬
\looparrowright
â°
\Lsh
â±
\Rsh
â¦
\mapsto
â¼
\longmapsto
â¸
\multimap
â
\nleftarrow
â
\nrightarrow
â
\nLeftarrow
â
\nRightarrow
â®
\nleftrightarrow
â
\nLeftrightarrow
â
\nwarrow
â
\nearrow
â
\swarrow
â
\searrow
â
\twoheadleftarrow
â
\twoheadrightarrow
â¿
\upharpoonleft
â¾
\upharpoonright
â
\downharpoonleft
â
\downharpoonright
â
\upuparrows
â
\downdownarrows
Synonyms: â \gets, â \to, â¾ \restriction.
2.11.2 Comparison<
<
â¥
\geq
âª
\ll
âº
\prec
=
=
â§
\geqq
â
\lll
⪷
\precapprox
>
>
⩾
\geqslant
âª
\lnapprox
â¼
\preccurlyeq
â
\approx
â«
\gg
âª
\lneq
⪯
\preceq
â
\approxeq
â
\ggg
â¨
\lneqq
⪹
\precnapprox
â
\asymp
âª
\gnapprox
â¦
\lnsim
⪵
\precneqq
â½
\backsim
âª
\gneq
â
\ncong
â¨
\precnsim
â
\backsimeq
â©
\gneqq
â
\neq
â¾
\precsim
â
\bumpeq
â§
\gnsim
â±
\ngeq
â
\risingdotseq
â
\Bumpeq
âª
\gtrapprox
â§Ì¸
\ngeqq
â¼
\sim
â
\circeq
â
\gtreqless
⩾̸
\ngeqslant
â
\simeq
â
\cong
âª
\gtreqqless
â¯
\ngtr
â»
\succ
â
\curlyeqprec
â·
\gtrless
â°
\nleq
⪸
\succapprox
â
\curlyeqsucc
â³
\gtrsim
â¦Ì¸
\nleqq
â½
\succcurlyeq
â
\doteq
â¤
\leq
⩽̸
\nleqslant
⪰
\succeq
â
\doteqdot
â¦
\leqq
â®
\nless
⪺
\succnapprox
â
\eqcirc
⩽
\leqslant
â
\nprec
⪶
\succneqq
â
\eqsim
âª
\lessapprox
â
\npreceq
â©
\succnsim
âª
\eqslantgtr
â
\lesseqgtr
â
\nsim
â¿
\succsim
âª
\eqslantless
âª
\lesseqqgtr
â
\nsucc
â
\thickapprox
â¡
\equiv
â¶
\lessgtr
â¡
\nsucceq
â¼
\thicksim
â
\fallingdotseq
â²
\lesssim
â
\triangleq
The commands \lvertneqq and \gvertneqq are not supported with MathML output, as there is no corresponding Unicode character.
Synonyms: â \ne, ⤠\le, ⥠\ge, â \Doteq, â \llless, â \gggtr.
Symbols can be negated prepending \not, e.g. â \not=, ⢠\not\equiv, â¹ \not\gtrless, ⸠\not\lessgtr.
2.11.3 Miscellaneous relationsâ
\backepsilon
â¬
\ntrianglelefteq
â
\subseteq
âµ
\because
â«
\ntriangleright
â«
\subseteqq
â¬
\between
â
\ntrianglerighteq
â
\subsetneq
â
\blacktriangleleft
â¬
\nvdash
â«
\subsetneqq
â¸
\blacktriangleright
â®
\nVdash
â
\supset
â
\bowtie
â
\nvDash
â
\Supset
â£
\dashv
â¯
\nVDash
â
\supseteq
â¢
\frown
â¥
\parallel
â«
\supseteqq
â
\in
â
\perp
â
\supsetneq
â£
\mid
â
\pitchfork
â«
\supsetneqq
â§
\models
â
\propto
â´
\therefore
â
\ni
â£
\shortmid
â´
\trianglelefteq
â¤
\nmid
â¥
\shortparallel
âµ
\trianglerighteq
â
\notin
â¢
\smallfrown
â
\varpropto
â¦
\nparallel
â£
\smallsmile
âµ
\vartriangle
â¤
\nshortmid
â£
\smile
â²
\vartriangleleft
â¦
\nshortparallel
â
\sqsubset
â³
\vartriangleright
â
\nsubseteq
â
\sqsubseteq
â¢
\vdash
⫠̸
\nsubseteqq
â
\sqsupset
â©
\Vdash
â
\nsupseteq
â
\sqsupseteq
â¨
\vDash
â«Ì¸
\nsupseteqq
â
\subset
âª
\Vvdash
âª
\ntriangleleft
â
\Subset
Synonyms: â \owns.
Symbols can be negated prepending \not, e.g. â \not\in, â \not\ni.
The commands \varsubsetneq, \varsubsetneqq, \varsupsetneq, and \varsupsetneqq are not supported with MathML output as there is no corresponding Unicode character.
2.12 Variable-sized operatorsâ \sum
â \prod
â \bigcap
⨠\bigodot
â« \int
â \coprod
â \bigcup
⨠\bigoplus
â® \oint
â \bigwedge
⨠\biguplus
⨠\bigotimes
â« \smallint
â \bigvee
⨠\bigsqcup
Larger symbols are used in displayed formulas, sum-like symbols have indices above/below the symbol:
â n = 1 N a n â« 0 1 f ( x ) d x â i = 1 10 b i â¦
3 Notations 3.1 Top and bottom embellishmentsSee Accents and embellishments.
3.2 Extensible arrowsxleftarrow and xrightarrow produce arrows that extend automatically to accommodate unusually wide subscripts or superscripts. These commands take one optional argument (the subscript) and one mandatory argument (the superscript, possibly empty):
A \xleftarrow{n+\mu-1} B \xrightarrow[T]{n\pm i-1} C
results in
A âµ n + μ â 1 B â¶ T n ± i â 1 C
3.3 Affixing symbols to other symbolsIn addition to the standard accents and embellishments, other symbols can be placed above or below a base symbol with the \overset and \underset commands. The symbol is set in "scriptstyle" (smaller font size). For example, writing \overset{*}{X} becomes X * and \underset{+}{M} becomes M + .
3.4 MatricesThe matrix and cases environments can also contain \\ and &:
.. math:: \left ( \begin{matrix} a & b \\ c & d \end{matrix}\right)
Result:
( a b c d )
The environments pmatrix, bmatrix, Bmatrix, vmatrix, and Vmatrix have (respectively) ( ), [ ], { }, | |, and â â delimiters built in, e.g.
( a b c d ) [ a b c d ] â a b c d â
To produce a small matrix suitable for use in text, there is a smallmatrix environment ( a b c d ) that comes closer to fitting within a single text line than a normal matrix.
For piecewise function definitions there is a cases environment:
sgn ( x ) = { â 1 x < 0 â 1 x > 0
3.5 Spacing commandsHorizontal spacing of elements can be controlled with the following commands:
3 4
3\qquad 4
= 2em
3 4
3\quad 4
= 1em
3 Â 4
3~4
3\nobreakspace 4
3 4
3\ 4
escaped space
3 4
3\;4
3\thickspace 4
3 4
3\:4
3\medspace 4
3 4
3\,4
3\thinspace 4
3 4
3 4
regular space [4]
3 4
3\!4
3\negthinspace 4
negative space [5]
3 4
3\negmedspace 4
3 4
3\negthickspace 4
3 4
3\hspace{1ex}4
custom length
3 4
3\mspace{20mu}4
custom length [6]
There are also three commands that leave a space equal to the height and width of its argument. For example \phantom{XXX} results in space as wide and high as three Xâs:
X X X + 1 X X X â 1
The commands \hphantom and \vphantom insert space with the width or height of the argument. They are not supported with math_output MathML.
3.6 Modular arithmetic and modulo operationThe commands \bmod, \pmod, \mod, and \pod deal with the special spacing conventions of the âmodâ notation. [7]
command
example
result
\bmod
\gcd(n,m \bmod n)
gcd ( n , m mod n )
\pmod
x\equiv y \pmod b
x â¡ y ( mod b )
\mod
x\equiv y \mod c
x â¡ y mod c
\pod
x\equiv y \pod d
x â¡ y ( d )
\operatorname{mod}(m,n)
mod ( m , n )
3.7 Rootscommand
example
result
\sqrt
\sqrt{x^2-1}
x 2 â 1
\sqrt[3n]{x^2-1}
x 2 â 1 3 n
\sqrt\frac{1}{2}
1 2
3.8 Boxed formulasThe command \boxed puts a box around its argument:
η ⤠C ( δ ( η ) + ΠM ( 0 , δ ) )
4 Fractions and related constructionsThe \frac command takes two ar guments, numerator and denominator, and typesets them in normal fraction form. For example, U = \frac{R}{I} produces U = R I . Use \dfrac or \tfrac to force text style and display style respectively.
x + 1 x â 1 x + 1 x â 1 x + 1 x â 1
and in text: x + 1 x â 1 , x + 1 x â 1 , x + 1 x â 1 .
For binomial expressions such as ( n k ) , there are \binom, \dbinom and \tbinom commands:
2^k-\binom{k}{1}2^{k-1}+\binom{k}{2}2^{k-2}
prints
2 k â ( k 1 ) 2 k â 1 + ( k 2 ) 2 k â 2
The \cfrac command for continued fractions uses displaystyle and padding for sub-fractions:
Ï 4 = 1 + 1 2 2 + 3 2 2 + 5 2 2 + 7 2 2 + ⯠vs. Ï 4 = 1 + 1 2 2 + 3 2 2 + 5 2 2 + 7 2 2 + â¯
The optional argument [l] or [r] for left or right placement of the numerator is not supported by MathML Core:
x x â 1 x x â 1 x x â 1
5 Delimiter sizesBesides the automatic scaling of extensible delimiters with \left and \right, there are four commands to manually select delimiters of fixed size:
Sizing
no
\left
\bigl
\Bigl
\biggl
\Biggl
command
\right
\bigr
\Bigr
\biggr
\Biggr
Result
( b ) ( c d )
( b ) ( c d )
( b ) ( c d )
( b ) ( c d )
( b ) ( c d )
( b ) ( c d )
There are two or three situations where the delimiter size is commonly adjusted using these commands:
The first kind of adjustment is done for cumulative operators with limits, such as summation signs. With \left and \right the delimiters usually turn out larger than necessary, and using the Big or bigg sizes instead gives better results:
[ â i a i | â j x i j | p ] 1 / p  versus [ â i a i | â j x i j | p ] 1 / p
The second kind of situation is clustered pairs of delimiters, where left and right make them all the same size (because that is adequate to cover the encompassed material), but what you really want is to make some of the delimiters slightly larger to make the nesting easier to see.
( ( a 1 b 1 ) â ( a 2 b 2 ) ) ( ( a 2 b 1 ) + ( a 1 b 2 ) ) versus ( ( a 1 b 1 ) â ( a 2 b 2 ) ) ( ( a 2 b 1 ) + ( a 1 b 2 ) )
The third kind of situation is a slightly oversize object in running text, such as | b ' d ' | where the delimiters produced by \left and \right cause too much line spreading. [8] In that case \bigl and \bigr can be used to produce delimiters that are larger than the base size but still able to fit within the normal line spacing: | b ' d ' | .
6 TextThe main use of the command \text is for words or phrases in a display. It is similar to \mbox in its effects but, unlike \mbox, automatically produces subscript-size text if used in a subscript, k_{\text{B}}T becomes k B T .
Whitespace is kept inside the argument:
f [ x i â 1 , x i ]  is monotonic for i = 1 , ⦠, c + 1
The text may contain math commands wrapped in $ signs, e.g.
( â 1 ) n i = { â 1 if n i  is odd, + 1 if n i  is even.
7 Integrals and sumsThe limits on integrals, sums, and similar symbols are placed either to the side of or above and below the base symbol, depending on convention and context. In inline formulas and fractions, the limits on sums, and similar symbols like
lim n â â â 1 n 1 n
move to index positions: lim n â â â 1 n 1 n .
7.1 Altering the placement of limitsThe commands \intop and \ointop produce integral signs with limits as in sums and similar: â« 0 1 , â® c and
â« 0 1 â® c vs. â« 0 1 â® c
The commands \limits and \nolimits override the default placement of the limits for any operator; \displaylimits forces standard positioning as for the sum command. They should follow immediately after the operator to which they apply.
Compare the same term with default positions, \limits, and \nolimits in inline and display mode: lim x â 0 f ( x ) , lim x â 0 f ( x ) , lim x â 0 f ( x ) , vs.
lim x â 0 f ( x ) , lim x â 0 f ( x ) lim x â 0 f ( x ) .
8 Changing the size of elements in a formulaThe declarations [9] \displaystyle, \textstyle, \scriptstyle, and \scriptscriptstyle, select a symbol size and spacing that would be applied in display math, inline math, first-order subscript, or second-order subscript, respectively even when the current context would normally yield some other size.
For example :math:`\displaystyle \sum_{n=0}^\infty \frac{1}{n}` is printed as â n = 0 â 1 n rather than â n = 0 â 1 n and
\frac{\scriptstyle\sum_{n > 0} z^n} {\displaystyle\prod_{1\leq k\leq n} (1-q^k)}
yields
â n > 0 z n â 1 ⤠k ⤠n ( 1 â q k )  instead of the default â n > 0 z n â 1 ⤠k ⤠n ( 1 â q k ) .
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4