Math Example
Use LaTeX notation in Markdown for maths. The wiki renders it with KaTeX.
Inline and display
Use single dollar signs for inline maths, such as :
merge sort runs in $O(n \log n)$ timeUse double dollar signs for a display equation:
$$
\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$Rendered:
Display equations also support sums:
Notation that comes up in computer science
An asymptotic bound:
A geometric sum:
A harmonic number:
Multi-line derivations use the aligned environment, with & marking the alignment point and \\ ending each line:
Matrices and cases work too:
Dollar signs in code
Dollar signs inside code blocks and inline code remain literal:
eval $(opam env)
echo "${HOME}/bin"The area of a circle is $\pi r^2$.And inline: $HOME, $(pwd), $1.
Everything else KaTeX supports
Check the KaTeX supported functions if a command does not render, and preview the page before publishing.