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:
\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\alphabeta\betagamma\gammaGamma\Gammadelta\deltaDelta\Deltaepsilon epsi\epsilonvarepsilon\varepsilonzeta\zetaeta\etatheta\thetaTheta\Thetavartheta\varthetaiota\iotakappa\kappalambda lamda\lambdaLambda Lamda\Lambdamu\munu\nuxi\xiXi\Xipi\piPi\Pirho\rhosigma\sigmaSigma\Sigmatau\tauupsilon\upsilonphi\phiPhi\Phivarphi\varphichi\chipsi\psiPsi\Psiomega\omegaOmega\OmegaOperations
a + ba + ba - ba - ba * b a cdot ba \cdot ba ** b a ast ba \ast ba *** b a star ba \star ba xx b a times ba \times ba -: b a div b a divide ba \div ba // ba / bA \\ B A backslash BA \backslash BA setminus BA \setminus Ba +- b a pm ba \pm bf @ g f circ gf \circ ga o+ b a oplus ba \oplus ba ox b a otimes ba \otimes ba o. b a odot ba \odot bp ^^ q p wedge qp \wedge qp vv q p vee qp \vee qA nn B A cap BA \cap BA uu B A cup BA \cup BA |>< B A ltimes BA \ltimes BA ><| B A rtimes BA \rtimes BA |><| B A bowtie BA \bowtie Ba mod na \operatorname{mod} nBig 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{}\!dxoint_gamma f(z) dz\oint_{\gamma} f{{\left ( z \right )}} \mathop{}\!dzlim_(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 Ainf A\inf Alub A\operatorname{lub} Aglb A\operatorname{glb} Adim 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 = ba != b a ne ba \ne ba < b a lt ba < ba > b a gt ba > ba <= b a le ba \le ba lt= b a leq ba \leq ba >= b a ge ba \ge ba gt= b a geq ba \geq ba -< b a -lt b a prec ba \prec ba -<= b a preceq ba \preceq ba >- b a succ ba \succ ba >-= b a succeq ba \succeq bx in Ax \in Ax !in A x notin Ax \notin AA sub B A subset BA \subset BA sube B A subseteq BA \subseteq BA supset BA \supset BA supe B A supseteq BA \supseteq Ba -= b a equiv ba \equiv ba ~= b a cong ba \cong ba ~~ b a approx ba \approx ba prop b a propto ba \propto ba := ba := ba :|: ba \rvert : bLogic
p and qp \quad\text{and}\quad qp or qp \quad\text{or}\quad qnot p neg p\neg pp => qp \Rightarrow qp implies qp \implies qp <=> qp \Leftrightarrow qp iff qp \iff qy = 1 if x > 0y = 1 \quad\text{if}\quad x > 0AA x forall x\forall xEE x exists x\exists x_|_ bot\botTT top\topp |-- q p vdash qp \vdash qp |== q p models qp \models q:. therefore\therefore:' because\becauseBrackets
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\uparrowdarr downarrow\downarrowrarr rightarrow\rightarrow-> to\to>-> rightarrowtail\rightarrowtail->> twoheadrightarrow\twoheadrightarrow>->> twoheadrightarrowtail\twoheadrightarrowx |-> y x mapsto yx \mapsto ylarr leftarrow\leftarrowharr leftrightarrow\leftrightarrowrArr Rightarrow\RightarrowlArr Leftarrow\LeftarrowhArr Leftrightarrow\LeftrightarrowFunctions
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 = 2text(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\partialgrad nabla\nablaoo infty\inftyO/ emptyset\emptysetaleph\aleph/_ angle\angle/_\ triangle\trianglediamond\diamondsquare boxempty\squarefrown\frown... ldots\ldotscdots\cdotsvdots\vdotsddots\ddotsa quad ba \quad ba qquad ba \qquad ba \ ba \, b50%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{}\!dxdy\mathop{}\!dydz\mathop{}\!dzdt\mathop{}\!dt