Skip to content

Equations

Opus provides full LaTeX math support for mathematical and scientific notation.

Basic Syntax

Inline Equations

Wrap math in single dollar signs for inline equations:

The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.

Renders as: The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.

Display Equations

Use double dollar signs for centered, display-style equations:

$$
E = mc^2
$$

Numbered Equations

Add a label to reference equations:

$$
F = ma
$$ {#eq:newton}

As shown in @eq:newton, force equals mass times acceleration.

Common Notation

Greek Letters

Lowercase Code Uppercase Code
α \alpha Α A
β \beta Β B
γ \gamma Γ \Gamma
δ \delta Δ \Delta
ε \epsilon Ε E
θ \theta Θ \Theta
λ \lambda Λ \Lambda
μ \mu Μ M
π \pi Π \Pi
σ \sigma Σ \Sigma
φ \phi Φ \Phi
ω \omega Ω \Omega

Operators

\sum_{i=1}^{n} x_i          % Summation
\prod_{i=1}^{n} x_i         % Product
\int_{a}^{b} f(x) dx        % Integral
\lim_{x \to \infty} f(x)    % Limit
\frac{a}{b}                 % Fraction
\sqrt{x}                    % Square root
\sqrt[n]{x}                 % nth root

Subscripts and Superscripts

x^2         % Superscript
x_i         % Subscript
x_i^2       % Both
x_{i,j}     % Multi-character subscript

Brackets

(x)         % Parentheses
[x]         % Square brackets
\{x\}       % Curly braces
|x|         % Absolute value
\|x\|       % Norm
\langle x \rangle   % Angle brackets

For auto-sizing brackets:

\left( \frac{a}{b} \right)

Advanced Features

Matrices

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

Matrix types: - pmatrix - parentheses - bmatrix - square brackets - Bmatrix - curly braces - vmatrix - vertical bars (determinant)

Aligned Equations

$$
\begin{aligned}
f(x) &= x^2 + 2x + 1 \\
     &= (x + 1)^2
\end{aligned}
$$

Cases

$$
f(x) = \begin{cases}
x^2 & \text{if } x \geq 0 \\
-x^2 & \text{if } x < 0
\end{cases}
$$

Arrays

$$
\begin{array}{ccc}
a & b & c \\
d & e & f
\end{array}
$$

Common Examples

Statistics

$$
\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i
$$

$$
\sigma^2 = \frac{\sum_{i=1}^{n}(x_i - \bar{x})^2}{n-1}
$$

Calculus

$$
\frac{d}{dx} \left[ f(g(x)) \right] = f'(g(x)) \cdot g'(x)
$$

$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$

Linear Algebra

$$
\mathbf{A}\mathbf{x} = \mathbf{b}
$$

$$
\det(\mathbf{A}) = \sum_{\sigma \in S_n} \text{sgn}(\sigma) \prod_{i=1}^{n} a_{i,\sigma(i)}
$$

Physics

$$
i\hbar \frac{\partial}{\partial t} \Psi = \hat{H} \Psi
$$

$$
\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}
$$

Formatting Tips

Text in Equations

Use \text{} for words within equations:

$$
P(\text{rain} | \text{clouds}) = \frac{P(\text{clouds} | \text{rain}) P(\text{rain})}{P(\text{clouds})}
$$

Spacing

LaTeX handles spacing automatically, but you can adjust:

  • \, - thin space
  • \: - medium space
  • \; - thick space
  • \quad - em space
  • \qquad - 2em space

Bold and Italic

\mathbf{x}    % Bold (for vectors)
\mathit{x}    % Italic
\mathrm{x}    % Roman (upright)
\mathcal{X}   % Calligraphic
\mathbb{R}    % Blackboard bold (for sets)

Inserting Equations

Three ways to insert equations:

  1. Type directly - Just type $...$ or $$...$$
  2. Slash command - Type /equation for a display equation
  3. Keyboard shortcut - Cmd/Ctrl + Shift + E

Next Steps