Skip to content

Latest commit

 

History

History
542 lines (458 loc) · 17.5 KB

LaTeX.md

File metadata and controls

542 lines (458 loc) · 17.5 KB

LaTeX

Repeatio uses LaTeX (KaTeX) to render mathematical functions.

Table of Content
1. General
1.1 Inline Functions
1.2 Multiline Functions
2. Fractions and Binomials
3. Power and Indices
4. Roots
5. Operators
6. Sums and Integrals
7. Brackets
8. Accents
9. Arrows
10. Greek letters
11. Environments
12. Misc
13. Sources and more Types

1. General

Although not required it is generally advised to add a empty line after each LaTeX function.

1.1 Inline Functions

LaTeX inline functions are written between single dollar signs $...$.
Example:

Input Result
Calculate $x$:

$x =\frac{\sqrt{20}}{3\times(5-10)^2}$

Round to 2 decimal places.

Calculate $x$:

$x =\frac{\sqrt{20}}{3\times(5-10)^2}$

Round to 2 decimal places.

1.2 Multiline Functions

LaTeX multiline functions are written between double dollar signs $$...$$.
For a new line in the function use two backslashes \\.
Center a function with \begin{gather} and \end{gather}. To align a function use \begin{align} in combination with &= and \end{align}.

Type Input Result
Centered
Calculate $x^2+3x+2 = 0$

$$
\begin{gather}
x_{1,2} = -\left(\frac{3}{2}\right) \pm \sqrt{ \left(\frac{3}{2}\right)^{2}-2}\nonumber \\
x_{1,2} = -1,5 \pm \sqrt{2,25 - 2} \nonumber \\
\vdots \nonumber \\
x_1 = -2 \nonumber  \\
x_2 = -1 \nonumber
\end{gather}
$$

Calculate $x^2+3x+2 = 0$

$$ \begin{gather} x_{1,2} = -\left(\frac{3}{2}\right) \pm \sqrt{ \left(\frac{3}{2}\right)^{2}-2} \nonumber \ x_{1,2} = -1,5 \pm \sqrt{2,25 - 2} \nonumber \ \vdots \nonumber \ x_1 = -2 \nonumber \ x_2 = -1 \nonumber \end{gather} $$

Aligned
Calculate $x^2+3x+2 = 0$

$$
\begin{align}
x_{1,2} &= -\left(\frac{3}{2}\right) \pm \sqrt{ \left(\frac{3}{2}\right)^{2}-2} \\
x_{1,2} &= -1,5 \pm \sqrt{2,25 - 2} \\
\vdots \nonumber \\
x_1 &= -2 \\
x_2 &= -1 \nonumber
\end{align}
$$

Calculate $x^2+3x+2 = 0$

$$ \begin{align} x_{1,2} &= -\left(\frac{3}{2}\right) \pm \sqrt{ \left(\frac{3}{2}\right)^{2}-2} \ x_{1,2} &= -1,5 \pm \sqrt{2,25 - 2} \ \vdots \nonumber \ x_1 &= -2 \ x_2 &= -1 \nonumber \end{align} $$

Note
If the numbers next to the function overlap with the content of the function add \nonumber to the line.

2. Fractions and Binomials

Type Input Result
Fraction $\frac{n}{k}$ $\frac{n}{k}$
Fraction (advanced) $\frac{n!}{k!(n-k)!}$ $\frac{n!}{k!(n-k)!}$
Binomial coefficient $\binom{n}{k}$ $\binom{n}{k}$
Fraction in Fraction $\frac{\frac{x}{1}}{x - y}$ $\frac{\frac{x}{1}}{x - y}$
Fraction $^x/_y$ $^x/_y$

3. Power and Indices

Type Input Result
Superscript $n^2$ $n^2$
Superscript (advanced) $n^{2+k}$ $n^{2+k}$
Subscript $k_n$ $k_n$
Subscript (advanced) $k_{n+1}$ $k_{n+1}$
Sup-/Subscript $k_n^2$ $k_n^2$

4. Roots

Type Input Result
Square root $\sqrt{k}$ $\sqrt{k}$
Square root with exponent $\sqrt[n]{k}$ $\sqrt[n]{k}$

5. Operators

Type Input Result
Plus $+$ $+$
Minus $-$ $-$
Multiplied by $\times$ $\times$
Divided by $\div$ $\div$
Comma $,$ $,$
Colon $:$ $:$
Semicolon $;$ $;$
Exclamation $!$ $!$
Horizontal dots $\dots$ $\dots$
Vertical dots $\vdots$ $\vdots$
Diagonal dots $\ddots$ $\ddots$
Sinus $\sin$ $\sin$
Cosine $\cos$ $\cos$
Tangent $\tan$ $\tan$
Limit $\lim$ $\lim$
Exponential function $\exp$ $\exp$
Mod $\bmod$ $\bmod$
Infinity $\infty$ $\infty$
Equivalent $\equiv$ $\equiv$
Not equal $\ne$ $\ne$
Approximately $\approx$ $\approx$
Less than $\leq$ $<$
Less or equal than $\leq$ $\leq$
Greater than $\geq$ $>$
Greater or equal than $\geq$ $\geq$
Not $\neg$ $\neg$

6. Sums and Integrals

Type Input Result
Summation $\sum$ $\sum$
Summation (advanced) $\sum\limits_{i=0}^n f(x)$ $\sum\limits_{i=0}^n f(x)$
Integral $int$ $\int$
Integral (advanced) $\int_0^\infty \mathrm{e}^{-x},\mathrm{d}x$ $\int_0^\infty \mathrm{e}^{-x},\mathrm{d}x$
Integral (limit) $\int\limits_a^b$ $\int\limits_a^b$
Integral (double) $\iint$ $\iint$
Integral (triple) $\iiint$ $\iiint$
Product $\prod$ $\prod$
Coproduct $\coprod$ $\coprod$
Bigoplus $\bigoplus$ $\bigoplus$
BigoTimes $\bigotimes$ $\bigotimes$
Bigodot $\bigodot$ $\bigodot$
Plus-Minus $\pm$ $\pm$

7. Brackets

Type Input Result
Parenthesis $(a)$ $(a)$
parenthesis (bigger) $left(\frac{a^2}{2}\right) $\left(\frac{a^2}{2}\right)$
Bracket $[a]$ $[a]$
Brace $\{a\}$ {a}
Angle bracket $\langle f \rangle$ $\langle f \rangle$
Floor $\lfloor f \rfloor$ $\lfloor f \rfloor$
Ceiling $\lceil f \rceil$ $\lceil f \rceil$

8. Accents

Input Result
$a^{\prime}$ $a^{\prime}$
$a’$ $a’$
$a’’$ $a’’$
$a’’’$ $a’’’$
$\hat{a}$ $\hat{a}$
$\bar{a}$ $\bar{a}$
$\grave{a}$ $\grave{a}$
$\acute{a}$ $\acute{a}$
$\dot{a}$ $\dot{a}$
$\ddot{a}$ $\ddot{a}$
$\not{a}$ $\not{a}$
$\mathring{a}$ $\mathring{a}$
$\check{a}$ $\check{a}$
$\vec{a}$ $\vec{a}$
$\overrightarrow{AB}$ $\overrightarrow{AB}$
$\overleftarrow{AB}$ $\overleftarrow{AB}$
$\vec{F}$ $\vec{F}$
$\overline{aaa}$ $\overline{aaa}$
$\underline{a}$ $\underline{a}$

9. Arrows

Input Result
$\to$ $\to$
$\uparrow$ $\uparrow$
$\downarrow$ $\downarrow$
$\updownarrow$ $\updownarrow$
$\Uparrow$ $\Uparrow$
$\Downarrow$ $\Downarrow$

10. Greek letters

Input Result
$\alpha$ $\alpha$
$A$ $A$
$\beta$ $\beta$
$B$ $B$
$\gamma$ $\gamma$
$\Gamma$ $\Gamma$
$\delta$ $\delta$
$\Delta$ $\Delta$
$\epsilon$ $\epsilon$
$\Epsilon$ $E$
$\zeta$ $\zeta$
$\Zeta$ $Z$
$\eta$ $\eta$
$\Eta$ $H$
$\theta$ $\theta$
$\Theta$ $\Theta$
$\kappa$ $\kappa$
$\Kappa$ $K$
$\lambda$ $\lambda$
$\Lambda$ $\Lambda$
$\mu$ $\mu$
$\Mu$ $M$
$\nu$ $\nu$
$\Nu$ $N$
$\xi$ $\xi$
$\Xi$ $\Xi$
$\pi$ $\pi$
$\Pi$ $\Pi$
$\rho$ $\rho$
$\Rho$ $P$
$\sigma$ $\sigma$
$\Sigma$ $\Sigma$
$\tau$ $\tau$
$\au$ $T$
$\phi$ $\phi$
$\Phi$ $\Phi$
$\chi$ $\chi$
$\Chi$ $X$
$\psi$ $\psi$
$\Psi$ $\Psi$
$\omega$ $\omega$
$\Omega$ $\Omega$
$\varphi$ $\varphi$

11. Environments

Type Input Result
Matrix
$$
\begin{matrix}
a & b \\
c & d
\end{matrix}
$$

$$ \begin{matrix} a & b \ c & d \end{matrix} $$

Matrix (Parentheses)
$$
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
$$

$$ \begin{pmatrix} a & b \ c & d \end{pmatrix} $$

Matrix (Vertical)
$$
\begin{vmatrix}
a & b \\
c & d
\end{vmatrix}
$$

$$ \begin{vmatrix} a & b \ c & d \end{vmatrix} $$

Matrix (double Vertical)
$$
\begin{Vmatrix}
a & b \\
c & d
\end{Vmatrix}
$$

$$ \begin{Vmatrix} a & b \ c & d \end{Vmatrix} $$

Matrix (curly brackets)
$$
\begin{Bmatrix}
a & b \\
c & d
\end{Bmatrix}
$$

$$ \begin{Bmatrix} a & b \ c & d \end{Bmatrix} $$

Advanced Matrix Equation
$$
\begin{equation*}
A_{m,n} =
\begin{pmatrix}
a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
\vdots  & \vdots  & \ddots & \vdots  \\
a_{m,1} & a_{m,2} & \cdots & a_{m,n}
\end{pmatrix}
\end{equation*}
$$

$$ \begin{equation*} A_{m,n} = \begin{pmatrix} a_{1,1} & a_{1,2} & \cdots & a_{1,n} \ a_{2,1} & a_{2,2} & \cdots & a_{2,n} \ \vdots & \vdots & \ddots & \vdots \ a_{m,1} & a_{m,2} & \cdots & a_{m,n} \end{pmatrix} \end{equation*} $$

More Matrix Examples

12. Misc

Input Result
$\backslash$ $\backslash$
$\nonumber$ $\nonumber$
$\color{grey}x$ $\color{grey}x$

13. Sources and more Types