MathJax: LaTeX in Markdown
NOTE: Not sure of the best way to organize the relationship between MathJax and LaTeX. For now, I'm separating MathJax and LaTeX into separate notes. In the future it might be best to make MathJaX a sub-section of LaTeX.
Introduction
MathJax to Wikipedia:
MathJax is a cross-browser JavaScript library that displays mathematical notation in web browsers, using MathML, LaTeX and ASCIIMathML markup.
So essentially it takes a subset of the LaTeX syntax, namely the parts related to mathematical expressions, and renders it in the browser or on documents in the server, just like LaTeX does.
Blocks
MathJax or LaTeX blocks are enclosed using curly braces {}
.
They are essentially function parameters where each brace is a parameter.
The \frac
function is an example of a function that takes two parameters,
first is the numerator and the second is the denominator.
This is a necessary syntax because sometimes it's hard to
serially express mathemtical expressions in a single line, like with large fractions.
This can also apply to simple operators like the superscript operator ^
.
For example, raising a symbol by a negative power creates a problem of interpretation.
e^-i\pi + 1 = 0
The above expression makes it hard to interpret the actual expression which
is Euler's identity.
This is because the -
is interpreted as a subtraction operator,
so to fix this we need to enclose the exponential parts in braces {}
.
e^{ -i\pi } + 1 = 0
Which results in this expression:
Arithmetic Operators
- Addition or
, expressed with+
or\+
- Subtraction or
, expressed with-
or\-
- Multiplication or
, expressed in many ways*
asterisk\times
times\cdot
dot
- Division or
, expressed in many ways/
slash\div
division\frac{numerator}{denominator}
fraction or
Greek Letters
, :\alpha
,\Alpha
(resp.) , :\beta
,\Beta
(resp.) , :\gamma
,\Gamma
(resp.) , :\delta
,\Delta
(resp.) , :\epsilon
,\Epsilon
(resp.) , :\zeta
,\Zeta
(resp.) , :\eta
,\Eta
(resp.) , :\theta
,\Theta
(resp.) , :\iota
,\Iota
(resp.) , :\kappa
,\Kappa
(resp.) , :\lambda
,\Lambda
(resp.) , :\mu
,\Mu
(resp.) , :\nu
,\Nu
(resp.) , :\xi
,\Xi
(resp.) , :\omicron
,\Omicron
(resp.) , :\pi
,\Pi
(resp.) , :\rho
,\Rho
(resp.) , :\sigma
,\Sigma
(resp.) , :\tau
,\Tau
(resp.) , :\upsilon
,\Upsilon
(resp.) , :\phi
,\Phi
(resp.) , :\chi
,\Chi
(resp.) , :\psi
,\Psi
(resp.) , :\omega
,\Omega
(resp.)
Miscellaneous
- Dots or Ellipsis (
), expressed with\dots
Cheat Sheet
There's a fantastic cheat sheet post about MathJax syntax.
TODO: Add a summary of the cheat sheet here.
References
Web Links
- MathJax (from Wikipedia, the free encyclopedia)
- MathJax basic tutorial & quick reference (from Math.StackExchange by Community)