Overview of Typora
Typora is a minimalist Markdown editor distinguished by its real-time rendering feature, which lets users write and preview formatted content in a single pane, unlike most other Markdown tools that separate editing and preview windows.
Basic Formula Insertion
There are two formats for mathematical formulas in Typora:
- Inline formulas: Embedded within text, wrapped with single
$delimiters, e.g.,$ E = mc^2 $ - Display formulas: Rendered on their own line, wrapped with double
$$delimiters, e.g.,$$ \int_0^\infty e^{-x} dx = 1 $$
Subscripts and Superscripts
Use ^ for superscripts and _ for subscripts. Wrap multi-character subscripts/superscripts in {} to group them. You can nest subscripts and superscripts, or use both on a single element.
Example:
$$ x^{y^z} = (1+\mathrm{e}^x)^{-2xy^w} $$
To add subscripts/superscripts to both sides of a symbol, use the \sideset command, or add the modifiers directly before/after the symbol:
$$ \sideset{^1_2}{^3_4}\bigotimes \quad \text{or} \quad {^1_2}\bigotimes {^3_4} $$
Brackets and Separators
Standard brackets (), [], and | render as themselves. Use \{ and \} to display literal curly braces. For scaled brackets that match the height of surrounding content, use \left and \right paired commands.
Common special brackets:
| Input | Rendered | Input | Rendered |
|---|---|---|---|
\langle |
$\langle$ | \rangle |
$\rangle$ |
\lceil |
$\lceil$ | \rceil |
$\rceil$ |
\lfloor |
$\lfloor$ | \rfloor |
$\rfloor$ |
\lbrace |
$\lbrace$ | \rbrace |
$\rbrace$ |
\lvert |
$\lvert$ | \rvert |
$\rvert$ |
\lVert |
$\lVert$ | \rVert |
$\rVert$ |
To add vertical dividers for vector norms, use \lVert and \rVert:
$$ \lVert \boldsymbol{X}_i - \boldsymbol{S}_j \rVert^2 $$
For partial scaling without rendering one side of a bracket pair, use \left. or \right.:
$$ \left. \frac{\mathrm{d}u}{\mathrm{d}x} \right|_{x=0} $$
Fractions
Use \frac{numerator}{denominator} for nested fractions, or numerator \over denominator for single-layer fractions. For two-character fractions, use the shorthand \frac ab.
Examples:
$$ \frac{a-1}{b-1} \quad \text{or} \quad {a+1 \over b+1} $$
$$ \frac 12, \frac 1a, \frac a2 $$
Square Roots and Radicals
Use \sqrt[root index]{radicand} to display radicals. Omit the root index to default to square roots:
$$ \sqrt{2} \quad \text{or} \quad \sqrt[n]{3} $$
Ellipses
Use \ldots for ellipses aligned with the text baseline, and \cdots for ellipses aligned with the text midline:
$$ f(x_1,x_2,\underbrace{\ldots}_{\rm ldots},x_n) = x_1^2 + x_2^2 + \underbrace{\cdots}_{\rm cdots} + x_n^2 $$
Vectors
Use \vec{symbol} for basic vector notation, or \overrightarrow, \overleftarrow, \overleftrightarrow for custom arrow styles:
$$ \vec{a} \cdot \vec{b} = 0 $$
$$ \overleftarrow{xy} \quad \overleftrightarrow{xy} \quad \overrightarrow{xy} $$
Integrals
Use \int_{lower limit}^{upper limit}{integrand} to display integrals. Add \,\mathrm{d} before the integration variable for proper spacing and font:
$$ \int_0^1 x^2 \,\mathrm{d}x $$
Limits
Use \lim_{variable \to expression} to display limit notation. You can replace \to with any custom arrow:
$$ \lim_{n \to \infty} \frac{1}{n(n+1)} \quad \text{and} \quad \lim_{x \leftarrow \text{sample}} \frac{1}{n(n+1)} $$
Summation and Product Notation
Use \sum_{subscript}^{superscript}{term} for summations, \prod for products, \bigcup for unions, and \bigcap for intersections:
$$ \sum_{i=1}^n \frac{1}{i^2} \quad \text{and} \quad \prod_{i=1}^n \frac{1}{i^2} \quad \text{and} \quad \bigcup_{i=1}^2 \mathbb{R} $$
Greek Letters
Use \lowercase name for lowercase Greek letters, and \Uppercase Name for uppercase Greek letters. For uppercase letters that match standard Latin letters, just use the Latin uppercase character directly.
| Input | Rendered | Input | Rendered |
|---|---|---|---|
\alpha |
$\alpha$ | A |
$A$ |
\beta |
$\beta$ | B |
$B$ |
\gamma |
$\gamma$ | \Gamma |
$\Gamma$ |
\delta |
$\delta$ | \Delta |
$\Delta$ |
\epsilon |
$\epsilon$ | E |
$E$ |
\zeta |
$\zeta$ | Z |
$Z$ |
\eta |
$\eta$ | H |
$H$ |
\theta |
$\theta$ | \Theta |
$\Theta$ |
\iota |
$\iota$ | I |
$I$ |
\kappa |
$\kappa$ | K |
$K$ |
\lambda |
$\lambda$ | \Lambda |
$\Lambda$ |
\mu |
$\mu$ | M |
$M$ |
\nu |
$\nu$ | N |
$N$ |
\xi |
$\xi$ | \Xi |
$\Xi$ |
o |
$o$ | O |
$O$ |
\pi |
$\pi$ | \Pi |
$\Pi$ |
\rho |
$\rho$ | P |
$P$ |
\sigma |
$\sigma$ | \Sigma |
$\Sigma$ |
\tau |
$\tau$ | T |
$T$ |
\upsilon |
$\upsilon$ | \Upsilon |
$\Upsilon$ |
\phi |
$\phi$ | \Phi |
$\Phi$ |
\chi |
$\chi$ | X |
$X$ |
\psi |
$\psi$ | \Psi |
$\Psi$ |
\omega |
$\omega$ | \Omega |
$\Omega$ |
Some Greek letters have variant forms prefixed with \var-:
| Lowercase | Uppercase | Variant Form | Rendered |
|---|---|---|---|
\epsilon |
E |
\varepsilon |
$\varepsilon$ |
\theta |
\Theta |
\vartheta |
$\vartheta$ |
\rho |
P |
\varrho |
$\varrho$ |
\sigma |
\Sigma |
\varsigma |
$\varsigma$ |
\phi |
\Phi |
\varphi |
$\varphi$ |
Special Characters and Operators
For a full list of LaTeX symbols, refer to the official MathJax documentation. You can adjust text size with commands like \large, \small, \tiny, up to \Huge.
Relational Operators
| Input | Rendered | Input | Rendered |
|---|---|---|---|
\pm |
$\pm$ | \times |
$\times$ |
\div |
$\div$ | \mid |
$\mid$ |
\nmid |
$\nmid$ | \cdot |
$\cdot$ |
\circ |
$\circ$ | \ast |
$\ast$ |
\bigodot |
$\bigodot$ | \bigotimes |
$\bigotimes$ |
\bigoplus |
$\bigoplus$ | \leq |
$\leq$ |
\geq |
$\geq$ | \neq |
$\neq$ |
\approx |
$\approx$ | \equiv |
$\equiv$ |
\sum |
$\sum$ | \prod |
$\prod$ |
\coprod |
$\coprod$ | \backslash |
$\backslash$ |
Set Operators
| Input | Rendered | Input | Rendered |
|---|---|---|---|
\emptyset |
$\emptyset$ | \in |
$\in$ |
\notin |
$\notin$ | \subset |
$\subset$ |
\supset |
$\supset$ | \subseteq |
$\subseteq$ |
\supseteq |
$\supseteq$ | \cap |
$\cap$ |
\cup |
$\cup$ | \vee |
$\vee$ |
\wedge |
$\wedge$ | \uplus |
$\uplus$ |
\top |
$\top$ | \bot |
$\bot$ |
\complement |
$\complement$ |
Logarithmic Operators
| Input | Rendered |
|---|---|
\log |
$\log$ |
\lg |
$\lg$ |
\ln |
$\ln$ |
Trigonometric Operators
| Input | Rendered | Input | Rendered |
|---|---|---|---|
\backsim |
$\backsim$ | \cong |
$\cong$ |
\angle A |
$\angle A$ | \sin |
$\sin$ |
\cos |
$\cos$ | \tan |
$\tan$ |
\csc |
$\csc$ | \sec |
$\sec$ |
\cot |
$\cot$ |
Calculus Operators
| Input | Rendered | Input | Rendered |
|---|---|---|---|
\int |
$\int$ | \iint |
$\iint$ |
\iiint |
$\iiint$ | \partial |
$\partial$ |
\oint |
$\oint$ | \prime |
$\prime$ |
\lim |
$\lim$ | \infty |
$\infty$ |
\nabla |
$\nabla$ |
Logical Operators
| Input | Rendered | Input | Rendered |
|---|---|---|---|
\because |
$\because$ | \therefore |
$\therefore$ |
\neg |
$\neg$ | \forall |
$\forall$ |
\exists |
$\exists$ | \not\subset |
$\not\subset$ |
\not< |
$\not<$ | \not> |
$\not>$ |
\not= |
$\not=$ |
Hat and Bar Symbols
| Input | Rendered | Input | Rendered |
|---|---|---|---|
\hat{xy} |
$\hat{xy}$ | \widehat{xyz} |
$\widehat{xyz}$ |
\bar{x} |
$\bar{x}$ | \tilde{xy} |
$\tilde{xy}$ |
\widetilde{xyz} |
$\widetilde{xyz}$ | \acute{y} |
$\acute{y}$ |
\breve{xy} |
$\breve{xy}$ | \check{y} |
$\check{y}$ |
\grave{y} |
$\grave{y}$ | \dot{xy} |
$\dot{xy}$ |
\ddot{x} |
$\ddot{x}$ | \dddot{x} |
$\dddot{x}$ |
Decorations and Frames
| Input | Rendered |
|---|---|
\fbox{a+b+c+d} |
$\fbox{a+b+c+d}$ |
\overleftarrow{a+b+c+d} |
$\overleftarrow{a+b+c+d}$ |
\overrightarrow{a+b+c+d} |
$\overrightarrow{a+b+c+d}$ |
\overleftrightarrow{a+b+c+d} |
$\overleftrightarrow{a+b+c+d}$ |
\underleftarrow{a+b+c+d} |
$\underleftarrow{a+b+c+d}$ |
\underrightarrow{a+b+c+d} |
$\underrightarrow{a+b+c+d}$ |
\underleftrightarrow{a+b+c+d} |
$\underleftrightarrow{a+b+c+d}$ |
\overline{a+b+c+d} |
$\overline{a+b+c+d}$ |
\underline{a+b+c+d} |
$\underline{a+b+c+d}$ |
\overbrace{a+b+c+d}^{Sample} |
$\overbrace{a+b+c+d}^{Sample}$ |
\underbrace{a+b+c+d}_{Sample} |
$\underbrace{a+b+c+d}_{Sample}$ |
\overbrace{a+\underbrace{b+c}_{1.0}+d}^{2.0} |
$\overbrace{a+\underbrace{b+c}_{1.0}+d}^{2.0}}$ |
Arrow Symbols
Recommended arrows:
| Input | Rendered | Input | Rendered |
|---|---|---|---|
\to |
$\to$ | \mapsto |
$\mapsto$ |
\implies |
$\implies$ | \iff |
$\iff$ |
\impliedby |
$\impliedby` |
Full arrow set:
| Input | Rendered | Input | Rendered |
|---|---|---|---|
\uparrow |
$\uparrow$ | \Uparrow |
$\Uparrow$ |
\downarrow |
$\downarrow$ | \Downarrow |
$\Downarrow$ |
\leftarrow |
$\leftarrow$ | \Leftarrow |
$\Leftarrow$ |
\rightarrow |
$\rightarrow$ | \Rightarrow |
$\Rightarrow$ |
\leftrightarrow |
$\leftrightarrow$ | \Leftrightarrow |
$\Leftrightarrow$ |
\longleftarrow |
$\longleftarrow$ | \Longleftarrow |
$\Longleftarrow$ |
\longrightarrow |
$\longrightarrow$ | \Longrightarrow |
$\Longrightarrow$ |
\longleftrightarrow |
$\longleftrightarrow$ | \Longleftrightarrow |
$\Longleftrightarrow$ |
Font Styling for Math
Use {\font{text}} to change the font of math text. Default math text is italic. Available fonts:
| Font Command | Full Alphabet Support | Rendered Example | Font Command | Uppercase Only Support | Rendered Example |
|---|---|---|---|---|---|
\rm |
Roman Type | $\rm{Sample}$ | \mathcal |
Calligraphic | $\mathcal{SAMPLE}$ |
\it |
Italic | $\it{Sample}$ | \mathbb |
Blackboard Bold | $\mathbb{SAMPLE}$ |
\bf |
Bold | $\bf{Sample}$ | \mit |
Math Italic | $\mit{SAMPLE}$ |
\sf |
Sans-Serif | $\sf{Sample}$ | \scr |
Script | $\scr{SAMPLE}$ |
\tt |
Typewriter | $\tt{Sample}$ | \frak |
Fraktur | $\frak{SAMPLE}$ |
Use \boldsymbol{} to add bold formatting for vectors and matrices:
$$ \vec{\boldsymbol{\alpha}} $$
For better integral notation, use \mathrm{d}x instead of plain dx:
\begin{array}{cc}
\mathrm{Bad} & \mathrm{Better} \\
\hline \\
\int_0^1 x^2 dx & \int_0^1 x^2 \,\mathrm{d}x
\end{array}
Highlighting Formulas
Use \bbox[background, padding, border: style] to highlight formulas:
$$
\bbox[yellow]{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n \qquad (1)
}
$$
You can also add custom padding, border colors, and widths:
$$
\bbox[#9ff, 5px, border:2px solid #f1f2f6]{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n \qquad (1)
}
$$
Matrices and Arrays
Basic Matrix
Use \begin{matrix} ... \end{matrix} with & to separate columns and \\ to separate rows:
$$
\begin{matrix}
1 & x & x^2 \\
1 & y & y^2 \\
1 & z & z^2 \\
\end{matrix}
$$
Styled Matrices
Use different environments for different bracket styles:
pmatrix: Parenthesesbmatrix: Square bracketsBmatrix: Curly bracesvmatrix: Vertical barsVmatrix: Double vertical bars
$$
\begin{pmatrix} 1 & 2 \\ 3 & 4 \\ \end{pmatrix}
$$
$$
\begin{bmatrix} 1 & 2 \\ 3 & 4 \\ \end{bmatrix}
$$
Matrices with Ellipses
Use \cdots, \vdots, and \ddots for ellipses in matrices:
$$
\begin{pmatrix}
1 & a_1 & a_1^2 & \cdots & a_1^n \\
1 & a_2 & a_2^2 & \cdots & a_2^n \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
1 & a_m & a_m^2 & \cdots & a_m^n \\
\end{pmatrix}
Inline Matrices
Use \bigl(\begin{smallmatrix} ... \end{smallmatrix}\bigr) for inline matrices:
This is an inline matrix example: $\bigl(\begin{smallmatrix} a & b \\ c & d \end{smallmatrix}\bigr)$.
Aligned Equation Sequences
Use \begin{align} ... \end{align} to create aligned, numbered equation sequences. Use align* for unnumbered sequences:
$$
\begin{align}
\sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \\
& = \sqrt{\frac{73^2}{12^2} \cdot \frac{73^2-1}{73^2}} \\
& = \frac{73}{12}\sqrt{1-\frac{1}{73^2}} \\
& \approx \frac{73}{12}\left(1-\frac{1}{2\cdot73^2}\right)
\end{align}
You can add custom tags and explanatory text:
$$
\begin{align}
v + w & = 0 & \text{Given} \tag 1 \\
-w & = -w + 0 & \text{Additive Identity} \tag 2 \\
-w + 0 & = -w + (v + w) & \text{Combine Equations (1) and (2)}
\end{align}
Piecewise Functions
Use \begin{cases} ... \end{cases} to create piecewise functions:
$$
f(n) =
\begin{cases}
n/2, & \text{if $n$ is even} \\
3n+1, & \text{if $n$ is odd}
\end{cases}
Tables and Arrays
Use \begin{array}{column spec} ... \end{array} to create tables. Use | for vertical dividers and \hline for horizontal dividers:
$$
\begin{array}{c|lcr}
n & \text{Left-Aligned} & \text{Centered} & \text{Right-Aligned} \\
\hline
1 & 0.24 & 1 & 125 \\
2 & -1 & 189 & -8 \\
3 & -20 & 2000 & 1+10i
\end{array}
Continued Fractions
Use \cfrac instead of \frac for properly scaled continued fractions:
$$
x = a_0 + \cfrac{1^2}{a_1 +
\cfrac{2^2}{a_2 +
\cfrac{3^2}{a_3 +
\cfrac{4^4}{a_4 +
\cdots
}
}
}
}
Commutative Diagrams
First enable the AMScd package with \require{AMScd}. Use \begin{CD} ... \end{CD} to create commutative diagrams:
$$
\require{AMScd}
\begin{CD}
A @>a>> B \\
@V b V V \# @VV c V \\
C @>>d> D
\end{CD}
Use arrow modifiers like @>>>, @<<<, @VVV, @AAA, @=, and @| to define arrow styles and labels.