MathJax Tutorial Reference and Examples
MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all browsers. MathJax uses web-based fonts to produce high-quality typesetting that scales and prints at full resolution.
With MathJax, Mathematics is text-based rather than image-based, thus it is accessible to search engines. MathJax allows you to include Mathematics in your web pages, either using LaTeX, MathML, or AsciiMath notation.
You can use http://www.hostmath.com to create Math equations in browser.
How To Enable MathJax Including Chemistry
Add following in your head section (before body).
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {extensions: ["mhchem.js"]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
1. Greek Letters
For Greek letters: \alpha, \beta, \omega, \pi, \rho, \lambda, \sigma, \mu, \theta
For uppercase: \Gamma, \Delta, \Omega, \Pi, \Rho
2. Superscript, Subscript and Roots
Superscript: ^
Subscript: _
Square Root: sqrt{}
Superscripts, subscripts, and other operations apply only to the next group. A group can be either a single symbol, or any formula surrounded by curly braces {…}. Use \{ and \} for literally using curly braces instead of grouping.
3. Brackets
Usual keyboard values of ( and ) are used. For resizing brackets according to the size of the equation, use \left( and \right).
5. Fractions
There are two ways to make fractions: \frac and \over
\frac applies to the next two groups. For more complicated numerators and denominators use, you may prefer \over.
\dfrac forces the fraction into display mode (large fraction), instead of inline mode.
To make a continued fraction, use \cfrac, with nested groups.
6. Matrices
For matrices with square brackets,
\begin{bmatrix}a & b \\c & d \end{bmatrix}
7. Special Symbols and Notations
Inequalities: \lt \gt \le \ge \neq
Maths Operators: \times \div \pm \mp \cdot \% \arg
Sets: \cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing
Arrows: \to \rightarrow \leftarrow \Rightarrow \Leftarrow \implies
Decorations: \overline \underline \widehat \fbox
8. Boolean Algebra
Negation: \lnot, \overline{}, !
Conjunction: \land, \wedge, \cdot
Disjunction: \lor, \vee
9. Calculus
Sum: \sum_{i=1}^{10} t_i, \displaystyle\sum_{i=1}^{10} t_i
Limits: \lim_{x \to a} f(x)
Integration: \int_a^b f(x) \ dx
10. Vectors
Basic Notation: \hat a, \bar a, \vec a
11. Geometric Shapes
Circles are easily created, and only needs a number to determine how large the circle is. \circle(50)
12. Chemical Equations
You can write chemical compounds or equation using: \ce{}
Chemical Formula: H2O, KMnO4, (NH4)2S
Charges: H+, CrO4^2-
Stoichiometric Numbers: 2H2O. 1/2H2O
Horizontal Bonds: - (single bond), = (double bond), # (triple bond)
You can also use \sbond \dbond \tbond
Reaction Arrows: ->, <-, <=>, <->
How to write above or below arrow? ->[above][below]
Precipitate and Gas: v, ^
Chemical names below or above formula: \underset{}, \underbrace{}_{}
Isotopes: ^{227}_{90}Th+, ^0_{-1}n-