LAH-tehk

Usage in Markdown

Surround notation with single $ for inline display. Place $$ in line before and after notation for block display.

  • Inline: $a+b$ becomes
  • Block:
    $$
    a+b
    $$

Syntax/Terminology

  • control sequences — prefixed with \
    • also called “commands” or “macros”
    • two kinds:
      • Control words — backslash \ + some word: \begin, \frac, \times
      • Control symbols — backslash \ + some symbol: \\, \,, \!

Formatting

Grouping

  • curly braces {} group content as a single unit
  • required when a subscript or superscript is more than one character
  • without braces, $x^10$ renders as where only the 1 is superscript

Spacing

CommandSizeExampleOutput
\,Thin space$\int f(x)\,dx$
\quadMedium space$a \quad b$
\qquadLarge space$a \qquad b$
\!Negative thin space$a\!b$

Text & Style

CommandPurposeExampleOutput
\text{}Normal text$x \text{ if } x > 0$
\mathbf{}Bold face$\mathbf{v}$
\mathrm{}Upright (“roman”)$\mathrm{pH}$
\mathbb{}Blackboard bold$\mathbb{R}$
\displaystyleFull-size in inline mode$\displaystyle\sum_{k=1}^n$

Auto-Sizing Delimiters

  • \left and \right scale delimiters to fit content
  • they must always be paired
    • use . as an invisible match if necessary
ExampleOutput
$\left(\frac{a}{b}\right)$
$\left.\frac{df}{dx}\right\rvert_{a}$

Other

  • usually used to highlight final answer or key result
  • $\boxed{x=5}$

Alignment

aligned

  • use \begin{aligned} ... \end{aligned} to align multiple lines

  • & marks the alignment point(s)

  • \\ marks end of each line

    • except the last line, adds extra blank space
  • ex. place & before the = character to align all equations

    $$
    \begin{aligned}
    2x + 3y &= 7 \\
    x - y &= 1
    \end{aligned}
    $$

gathered

  • use gathered when lines should be centered, not aligned at a specific point

    $$
    \begin{gathered}
      f(x) = x^2 + 2x + 1 \\
      x \in \mathbb{R}
    \end{gathered}
    $$

Notation

Arithmetic

NotationExampleOutput
Multiplication$a \times b$
$a \ast b$
$a \cdot b$
Division$a / b$
$a \div b$
$\frac{a}{b}$
Plus or Minus$\pm a$
Roots$\sqrt{a}$
$\sqrt[n]{a}$

Equality

NotationExampleOutput
Not Equal$a \neq b$
Equivalent$a \equiv b$
Proportional$a \propto b $
Approx.$a \approx b$

Comparison

NotationExampleOutput
Less Than or Equal$a \leq b$
Greater than or Equal$a \geq b$
Much Smaller Than$a \ll b$
Much Larger Than$a \gg b$

Algebra

NotationExampleOutput
Absolute Value$\lvert a \rvert$
Function Of$f(x)=x^2$
Delta$\Delta x$
Pi$\pi$
Sum$\sum_{k=3}^5$
$\displaystyle\sum_{k=3}^5$
Product$\prod_{x=2}^4$
$\displaystyle\prod_{x=2}^4$

Angles

NotationExampleOutput
Angle$\angle$
Degree$30\degree45\rq40\rq\rq$
Radians$2\pi rad$

Probability & Statistics

NotationExampleOutput
Probability$P(A)$, $\Pr(A)$,
Intersection$P(A \cap B)$
Union$P(A \cup B)$
Conditional$P(A \mid B)$
Median$\tilde{x}$
Population Mean$\overline{x}$
$\langle x \rangle$

Linear Algebra

Vectors

NotationExampleOutput
Vector$\mathbf{v}$
$\vec{v}$
Column Vector$\mathbf{v}=\begin{pmatrix}4\cr5\cr6\end{pmatrix}$
Row Vector$\mathbf{v}^T = \begin{pmatrix}1&2&3\end{pmatrix}$
Norm$\lVert \mathbf{v} \rVert$

Matrices

NotationExampleOutput
Matrix$A=\begin{bmatrix}1&2&3\cr4&5&6\end{bmatrix}$
Hadamard Product$A \circ B$
Kronecker Product$A \otimes B$

Calculus

NotationExampleOutput
Limit$\lim_{x \to \infty} f(x)$
Derivative Definition$\lim_{h \to 0} \frac{f(x+h) - f(x)}{h}$
Partial Derivative$\frac{\partial f}{\partial x}$
Evaluated At$\left. \frac{df}{dx} \right\rvert_{x=a}$
Evaluated Between$\left. F(x) \right\rvert_a^b$
Integration$\int f(x) \, dx$
Definite Integral$\int_a^b f(x) \, dx$
Double Integral$\iint f \, dA$
Triple Integral$\iiint f \, dV$
Closed Line Integral$\oint \mathbf{F} \cdot d\mathbf{r}$
Gradient$\nabla f$
Infinity$\infty$
Piecewise Function$f(x) = \begin{cases} x^2 & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}$
Dot Notation (Time)$\dot{f}$ $\ddot{f}$
Primes$f'$ $f''$

Chemistry

Requires the mhchem LaTex extension. Standard LaTeX treats letters as italic variables and requires verbose workarounds like adding \text{} around every element symbol.

NotationExampleOutput
Chemical Formula$\ce{H2SO4}$
Isotope$\ce{^{14}_{6}C}$
Ions$\ce{Ca^2+}$
$\ce{Cl-}$
Reaction$\ce{2H2 + O2 -> 2H2O}$
Reaction Conditions$\ce{N2 + 3H2 ->[\Delta] 2NH3}$
Reversible Reaction$\ce{A <=> B}$
Equilibrium Constant$K_{eq} = \frac{\ce{[C][D]}}{\ce{[A][B]}}$
Precipitation$\ce{Ag+ + Cl- -> AgCl v}$
Physical Units$\pu{8.314 J mol-1 K-1}$
Bonds$\ce{A\bond{~}B\bond{~-}C}$
Radical Dot$\ce{OCO^{.-}}$
Arrow with Text$\ce{A ->[{text above}][{text below}] B}$
Escaped Braces$\ce{[\{(X2)3\}2]^3+}$