Reference: MathJAX Macros table - macros start with \.
Github Markdown allows a limited subset of MathJAX and no MathJAX extensions can be used.
But in static site generators, extensions can be installed using <script> tag.
Inline expressions are written within $ $, block expressions within $$ $$.
Curly Brackets { } are required for grouping multiple symbols where otherwise only a single character/symbol is expected
- eg. after
_(superscript under) and^(power/subscript over).
Notably MathJAX rendered by ChatGPT is a slightly different dialect -
eg. it uses ( ) delimiters for inline expressions and [ ] for block expressions.
Some common function usages are:
| MathJAX Code | Rendered Output | Description |
|---|---|---|
\sum\limits_{i=1}^n x_i |
Put limits directly under previous symbol \min. NOTE: this is automatically done in block display mode $$ ... $$. In inline mode $ ... $ by default subscript and superscript are placed directly after character. \limits forces it to place them directly under and over even in inline mode. |
|
\emptyset |
Empty (Null) set | |
E \cup F, E \cap F |
Set union, intersection | |
\mathbf{x} |
Bold font: (my convention) x is a vector | |
\mathbb{R}, \mathbb{C} |
Blackboard font: (my convention) Real numbers set, Complex numbers, etc. | |
x \sim \mathcal{N} , x \sim \mathcal{U}
|
|
x belongs to Normal, Uniform distributions (used Calligraphic font for distribution) |
\begin{cases} x & \text{if } cond \\ y & \text{otherwise} \end{cases} |
$\begin{cases} x & \text{if } cond \ y & \text{otherwise} \end{cases}$ | If-Else / Switch-case functions (working in VS Code, but not here in Github Gist) |