LaTeX in Markdown

Since May 2022 it has been possible to rendered math expressions in Markdown on GitHub using LaTeX.

Writing mathematical expressions

LaTeX and Markdown for students in high school

If students and especially visually impaired students should learn a simple, yet powerful tool for writing their home work, this might be the best solution to date.

Pratique des mathématiques en situation de handicap visuel

Examples of Math in Markdown

High School Math

$$
x = \sqrt{x}^2 =\sqrt{x^2} = (x^2)^{\frac{1}{2}}
$$

$$
16 = 4^2
$$

$$
4 = \sqrt{16} = 16^{\frac{1}{2}}
$$
\[x = \sqrt{x}^2 =\sqrt{x^2} = (x^2)^{\frac{1}{2}}\] \[16 = 4^2\] \[4 = \sqrt{16} = 16^{\frac{1}{2}}\]

LaTeX

$$ \LaTeX $$
\[\LARGE{\LaTeX}\]

Integral

\int_{-\infty}^{+\infty}\mathrm e^{-\alpha\, x^2}\mathrm d x=\sqrt{\frac{\pi}{\alpha}} 
\[\LARGE{\int_{-\infty}^{+\infty}\mathrm e^{-\alpha\, x^2}\mathrm d x=\sqrt{\frac{\pi}{\alpha}}}\]

Special case

If a delimiter on only one side of an expression is required, then an invisible delimiter on the other side may be denoted using a period (.).

$$
\left.\frac{x^3}{3}\right|_0^1
$$
\[\LARGE{\left.\frac{x^3}{3}\right|_0^1}\]

Matrix

$$
\begin{bmatrix}
    a1 & a2 \\
    a3 & a4 \\
\end{bmatrix}
$$
\[\LARGE{ \begin{bmatrix} a1 & a2 \\ a3 & a4 \\ \end{bmatrix} }\]

Cédric Villani

In his book Théorème vivant, Cédric Villani gives an example of an email that he sends to his cowriter Clement Mouhot. In the email he writes native LaTeX and thereby giving us an example of two people reading native LaTeX without the need of formatting it.

N_{k-i+1}/(k-i+1)! devrait donner N_k/k!
et pas N_k/(k+1)!
\[\frac{N_{k-i+1}}{(k-i+1)!}\]

devrait donner

\[\frac{N_k}{k!}\]

et pas

\[\frac{N_k}{(k+1)!}\]

In the book, he also tells the storry of Donald Knuth and gives the example of

Formule de Faà di Bruno (Arbogast 1800, Faà de Brune 1855)

$$
(f\circ H)^{(n)}] = \sum_{\sum_{j=1}^n j\,m_j = n}\frac{n!}{m_1!\ldots m_n!}\, \bigl(f^{(m_1 + \ldots + m_n)}\circ H\bigr)\, \prod_{j=1}^n\left(\frac{H^{(j)}}{j!}\right)^{m_j}
$$
\[(f\circ H)^{(n)} = \sum_{\sum_{j=1}^n j\,m_j = n}\frac{n!}{m_1!\ldots m_n!}\, \bigl(f^{(m_1 + \ldots + m_n)}\circ H\bigr)\, \prod_{j=1}^n\left(\frac{H^{(j)}}{j!}\right)^{m_j}\]

Water

Water is represented as

$$
\text{H}_2\text{O}
$$
\[\text{H}_2\text{O}\]

Sources of information and inspiration

If you want to learn how to do this here are some good sources.

Good overview of all commands

Examples

Visual Studio Code Extensions