Use mathjax for TeX math expressions

If you want to write Tex math expressions on the same line you can use:

  • Dollar signs
$a^2 + b^2 = c^2$

Eg:

Expressions like $a^2 + b^2 = c^2$ on the same line

Expressions like $a^2 + b^2 = c^2$ on the same line

  • Escaped parentheses
\(1+2+\dots+n=\frac{n(n+1)}{2}\)

Eg:

Or expressions like \(1+2+\dots+n=\frac{n(n+1)}{2}\)

Or expressions like \(1+2+\dots+n=\frac{n(n+1)}{2}\)

If you want to write TeX math expressions on its own line use:

  • Double dollar signs
$$ \frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x) $$

Eg:

Expressions like $$ \frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x) $$

Expressions like $$ \frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x) $$

  • Escaped square brackets
\[ \sin A \cos B = \frac{1}{2}\left[ \sin(A-B)+\sin(A+B) \right] \]

Eg:

Or like \[ \sin A \cos B = \frac{1}{2}\left[ \sin(A-B)+\sin(A+B) \right] \]

Or like \[ \sin A \cos B = \frac{1}{2}\left[ \sin(A-B)+\sin(A+B) \right] \]

Also, you can use a wide range of TeX math enviroments like: align, align*, alignat, alignat*, displaymath, eqnarray, eqnarray*, equation, equation*, flalign, flalign*, gather, gather*, math, multline, multline*

Eg:

\begin{align*}
e^x & = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \cdots \\
    & = \sum_{n\geq 0} \frac{x^n}{n!}
\end{align*}

\begin{align*} e^x & = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \cdots \\ & = \sum_{n\geq 0} \frac{x^n}{n!} \end{align*}

Note: math environments should not be inside the dollar sign delimiters; the environments should stand on their own with just the \begin and \end statements in order to be parsed correctly.

  • tutorials/mathjax.txt
  • Last modified: 2016/05/09 22:38
  • by amora