AsciiMath cheat sheet

AsciiMath writes formulas the way you would type them in a message: sqrt(x^2+1), a/b, sum_(n=1)^oo. Here is every symbol, how it looks and the LaTeX it becomes, with a box to try your own.

From AsciiMath to LaTeX

Examples:

How it looks
LaTeX
\sum_{n = 1}^{\infty} \frac{1}{n^{2}} = \frac{\pi^{2}}{6}

The conversion runs in your browser, with the same code that typesets the sheets of live-math. Decimal numbers take a point here: 3.14.

What AsciiMath is

AsciiMath is a markup for mathematics made to be quick to type and easy to read even before it is typeset. Fractions, powers and roots are written as on a calculator, (a+1)/(b+1), x^(n+1), sqrt(x); symbols are short words, oo for , -> for , in for . Brackets grow by themselves, and a matrix is a list of rows.

It was created by Peter Jipsen for writing maths on web pages; MathJax and AsciiDoc read it too. The symbols on this page are those of live-math, which adds the names of Italian textbooks and of linear algebra.

AsciiMath or LaTeX?

LaTeX is the standard for printed mathematics, and the right tool for a paper or a thesis. To write while you explain, it is slow: braces, backslashes and \frac{}{} at every step. AsciiMath says the same in about two thirds of the characters, and its output is LaTeX: each formula can be converted, and a whole sheet exported as a LaTeX file.

live-math is built on this: you type AsciiMath during a lesson and the students see it typeset as you type, with plots drawn from a line. See it on the home page, or open the editor.

Every symbol

In each row, what you can type (any of the forms), how it looks, and its LaTeX. Spaces only separate: sinx and sin x are the same.

Fractions, scripts and roots

/ makes a fraction of what is right before and after it: a symbol, a number, or a group in brackets. ^ and _ do the same for exponents and indices. The brackets around a numerator, a denominator, an exponent or an index are not shown: (a+1)/(b+1) is , x^(n+1) is . To keep them there, double them: ((a+b))/2 is . Elsewhere brackets stay: (a+b)^2 is .

x^2x^{2}
x_1x_{1}
x_1^2x_{1}^{2}
x^(n+1)x^{n + 1}
a/b\frac{a}{b}
(a+1)/(b+1)\frac{a + 1}{b + 1}
frac(a)(b)\frac{a}{b}
sqrt x Sqrt x\sqrt{x}
sqrt(x+1)\sqrt{x + 1}
root(3)(x)\sqrt[3]{x}
stackrel(def)(=)\stackrel{d e f}{=}
overset(*)(=)\overset{\cdot}{=}
underset(x->0)(=)\underset{x \to 0}{=}
cancel(x)\cancel{x}
color(red)(x^2)\textcolor{red}{x^{2}}

color colours only its argument; it takes the names of colours (red, blue, green, orange, purple…).

Greek letters

alpha\alpha
beta\beta
gamma\gamma
Gamma\Gamma
delta\delta
Delta\Delta
epsilon epsi\epsilon
varepsilon\varepsilon
zeta\zeta
eta\eta
theta\theta
Theta\Theta
vartheta\vartheta
iota\iota
kappa\kappa
lambda lamda\lambda
Lambda Lamda\Lambda
mu\mu
nu\nu
xi\xi
Xi\Xi
pi\pi
Pi\Pi
rho\rho
sigma\sigma
Sigma\Sigma
tau\tau
upsilon\upsilon
phi\phi
Phi\Phi
varphi\varphi
chi\chi
psi\psi
Psi\Psi
omega\omega
Omega\Omega

Operations

a + ba + b
a - ba - b
a * b a cdot ba \cdot b
a ** b a ast ba \ast b
a *** b a star ba \star b
a xx b a times ba \times b
a -: b a div b a divide ba \div b
a // ba / b
A \\ B A backslash BA \backslash B
A setminus BA \setminus B
a +- b a pm ba \pm b
f @ g f circ gf \circ g
a o+ b a oplus ba \oplus b
a ox b a otimes ba \otimes b
a o. b a odot ba \odot b
p ^^ q p wedge qp \wedge q
p vv q p vee qp \vee q
A nn B A cap BA \cap B
A uu B A cup BA \cup B
A |>< B A ltimes BA \ltimes B
A ><| B A rtimes BA \rtimes B
A |><| B A bowtie BA \bowtie B
a mod na \operatorname{mod} n

Big operators, limits, integrals

The limits go after _ and ^; with brackets when they are more than one symbol. On their own line they are set below and above the operator.

sum_(n=1)^oo a_n\sum_{n = 1}^{\infty} a_{n}
prod_(i=1)^n x_i\prod_{i = 1}^{n} x_{i}
int_a^b f(x) dx\int_{a}^{b} f{{\left ( x \right )}} \mathop{}\!dx
oint_gamma f(z) dz\oint_{\gamma} f{{\left ( z \right )}} \mathop{}\!dz
lim_(x->0) f(x)\lim_{x \to 0} f{{\left ( x \right )}}
Lim_(n->oo) a_n\operatorname{Lim}_{n \to \infty} a_{n}
limsup_(n->oo) a_n\limsup_{n \to \infty} a_{n}
liminf_(n->oo) a_n\liminf_{n \to \infty} a_{n}
max_(x in A) f(x)\max_{x \in A} f{{\left ( x \right )}}
min_(x in A) f(x)\min_{x \in A} f{{\left ( x \right )}}
sup A\sup A
inf A\inf A
lub A\operatorname{lub} A
glb A\operatorname{glb} A
dim V\dim V
^^^_(i in I) p_i bigwedge_(i in I) p_i\bigwedge_{i \in I} p_{i}
vvv_(i in I) p_i bigvee_(i in I) p_i\bigvee_{i \in I} p_{i}
nnn_(i in I) A_i bigcap_(i in I) A_i\bigcap_{i \in I} A_{i}
uuu_(i in I) A_i bigcup_(i in I) A_i\bigcup_{i \in I} A_{i}

Relations

a = ba = b
a != b a ne ba \ne b
a < b a lt ba < b
a > b a gt ba > b
a <= b a le ba \le b
a lt= b a leq ba \leq b
a >= b a ge ba \ge b
a gt= b a geq ba \geq b
a -< b a -lt b a prec ba \prec b
a -<= b a preceq ba \preceq b
a >- b a succ ba \succ b
a >-= b a succeq ba \succeq b
x in Ax \in A
x !in A x notin Ax \notin A
A sub B A subset BA \subset B
A sube B A subseteq BA \subseteq B
A supset BA \supset B
A supe B A supseteq BA \supseteq B
a -= b a equiv ba \equiv b
a ~= b a cong ba \cong b
a ~~ b a approx ba \approx b
a prop b a propto ba \propto b
a := ba := b
a :|: ba \rvert : b

Logic

p and qp \quad\text{and}\quad q
p or qp \quad\text{or}\quad q
not p neg p\neg p
p => qp \Rightarrow q
p implies qp \implies q
p <=> qp \Leftrightarrow q
p iff qp \iff q
y = 1 if x > 0y = 1 \quad\text{if}\quad x > 0
AA x forall x\forall x
EE x exists x\exists x
_|_ bot\bot
TT top\top
p |-- q p vdash qp \vdash q
p |== q p models qp \models q
:. therefore\therefore
:' because\because

Brackets

Brackets grow with what they hold. {: x :} is an invisible pair, useful to group; (: :) are angle brackets. |x| is the absolute value: the bars pair up inside brackets, so |x - a| < delta works as it reads.

(x){\left ( x \right )}
[x]{\left [ x \right ]}
{x}{\left \lbrace x \right \rbrace}
|x|{\left \lvert x \right \rvert}
(: x :) << x >> langle x rangle{\left \langle x \right \rangle}
|: x :|{\left \lvert x \right \rvert}
{: x :}{\left . x \right .}
lbrace x rbrace{\left \lbrace x \right \rbrace}
abs(x) Abs(x){\left | x \right |}
norm(x){\left \| x \right \|}
floor(x) |__ x __| lfloor x rfloor{\left \lfloor x \right \rfloor}
ceil(x) |~ x ~| lceil x rceil lceiling x rceiling{\left \lceil x \right \rceil}

Arrows

uarr uparrow\uparrow
darr downarrow\downarrow
rarr rightarrow\rightarrow
-> to\to
>-> rightarrowtail\rightarrowtail
->> twoheadrightarrow\twoheadrightarrow
>->> twoheadrightarrowtail\twoheadrightarrow
x |-> y x mapsto yx \mapsto y
larr leftarrow\leftarrow
harr leftrightarrow\leftrightarrow
rArr Rightarrow\Rightarrow
lArr Leftarrow\Leftarrow
hArr Leftrightarrow\Leftrightarrow

Functions

A function's name is set upright and its argument follows, with or without brackets: sin x, sin(x), sin^2 x. f and g are functions only before a bracket: f(x), but f g stays a product.

sin x\sin{x}
cos x\cos{x}
tan x\tan{x}
cot x\cot{x}
sec x\sec{x}
csc x\csc{x}
arcsin x\arcsin{x}
arccos x\arccos{x}
arctan x\arctan{x}
sinh x\sinh{x}
cosh x\cosh{x}
tanh x\tanh{x}
coth x\coth{x}
sech x\operatorname{sech}{x}
csch x\operatorname{csch}{x}
exp x\exp{x}
log x\log{x}
ln x\ln{x}
det A\det{A}
gcd(a, b)\gcd{{\left ( a , b \right )}}
lcm(a, b)\operatorname{lcm}{{\left ( a , b \right )}}
f(x)f{{\left ( x \right )}}
g(x)g{{\left ( x \right )}}

Capitalised names

Sin x\operatorname{Sin}{x}
Cos x\operatorname{Cos}{x}
Tan x\operatorname{Tan}{x}
Cot x\operatorname{Cot}{x}
Sec x\operatorname{Sec}{x}
Csc x\operatorname{Csc}{x}
Arcsin x\operatorname{Arcsin}{x}
Arccos x\operatorname{Arccos}{x}
Arctan x\operatorname{Arctan}{x}
Sinh x\operatorname{Sinh}{x}
Cosh x\operatorname{Cosh}{x}
Tanh x\operatorname{Tanh}{x}
Log x\operatorname{Log}{x}
Ln x\operatorname{Ln}{x}

Italian names and linear algebra

The names of Italian textbooks, and the operators of linear algebra. Im is the image only before a bracket: Im(f), while Im z stays a product.

sen x\operatorname{sen}{x}
arcsen x\operatorname{arcsen}{x}
tg x\operatorname{tg}{x}
arctg x\operatorname{arctg}{x}
cotg x\operatorname{cotg}{x}
arccotg x\operatorname{arccotg}{x}
sh x\operatorname{sh}{x}
ch x\operatorname{ch}{x}
th x\operatorname{th}{x}
settsh x\operatorname{settsh}{x}
settch x\operatorname{settch}{x}
rg A\operatorname{rg}{A}
rank A\operatorname{rank}{A}
Ker f\operatorname{Ker}{f}
Im(f)\operatorname{Im}{{\left ( f \right )}}
tr A\operatorname{tr}{A}
span(v, w)\operatorname{span}{{\left ( v , w \right )}}

Accents

hat x\hat{x}
bar x overline(x)\overline{x}
vec v\vec{v}
tilde x\tilde{x}
dot x\dot{x}
ddot x\ddot{x}
ul(x) underline(x)\underline{x}
ubrace(1+2)_3 underbrace(1+2)_3\underbrace{1 + 2}_{3}
obrace(1+2)^3 overbrace(1+2)^3\overbrace{1 + 2}^{3}

Fonts

bb(A) mathbf(A)\mathbf{A}
bbb(R) mathbb(R)\mathbb{R}
cc(F) mathcal(F)\mathcal{F}
tt(x) mathtt(x)\mathtt{x}
fr(g) mathfrak(g)\mathfrak{g}
sf(x) mathsf(x)\mathsf{x}

Text inside a formula

Between double quotes, words stay words: x = 1 " if " y > 0. A thin space is added where the text touches a symbol, so "for all"x does not stick. and, or, if as words are already spaced.

x = 1 "and" y = 2x = 1 \,\text{and}\, y = 2
text(text) mbox(text)\text{text}

Matrices, vectors, systems

A matrix is a list of rows, each in brackets, separated by commas: [[1,2],[3,4]] with square brackets, ((1,2),(3,4)) with round ones, |(a,b),(c,d)| for a determinant. A column vector is a matrix of one column. A system is a matrix with { on the left and nothing on the right, :}:

A = [[1,2],[3,4]]
det A = |(1,2),(3,4)| = -2
vec v = ((x),(y),(z))
{(x + y = 1),(x - y = 2):}
|x| = {(x, " if " x >= 0),(-x, " if " x < 0):}

Other symbols

del partial\partial
grad nabla\nabla
oo infty\infty
O/ emptyset\emptyset
aleph\aleph
/_ angle\angle
/_\ triangle\triangle
diamond\diamond
square boxempty\square
frown\frown
... ldots\ldots
cdots\cdots
vdots\vdots
ddots\ddots
a quad ba \quad b
a qquad ba \qquad b
a \ ba \, b
50%50 \%
NN\mathbb{N}
ZZ\mathbb{Z}
QQ\mathbb{Q}
RR\mathbb{R}
CC\mathbb{C}
f'(x) f prime(x)f ' {\left ( x \right )}
f''(x)f '' {\left ( x \right )}
f'''(x)f ''' {\left ( x \right )}
x^2 dxx^{2} \mathop{}\!dx
dy\mathop{}\!dy
dz\mathop{}\!dz
dt\mathop{}\!dt