Advanced Mathematical Typography Guide

Advanced Mathematical Typography Guide

6 min read
Table of Contents

Introduction to Mathematical Typography

This blog now supports advanced mathematical typography using KaTeX, a fast math rendering library. You can write complex mathematical expressions using LaTeX syntax directly in your Markdown files. KaTeX renders mathematical notation much faster than MathJax while supporting most common mathematical expressions.

Inline Mathematics

You can write inline math expressions using single dollar signs: $E = mc^2$ or using parentheses: (F = ma).

Here’s another example with inline math: The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.

Display Mathematics

For larger equations, use double dollar signs or square brackets for display mode:

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

The Schrödinger equation:

$$ i\hbar\frac{\partial}{\partial t}\Psi(\mathbf{r},t) = \hat{H}\Psi(\mathbf{r},t) $$

Complex Mathematical Expressions

Matrix Operations

$$ \begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} ax + by \\ cx + dy \end{pmatrix} $$

Summations and Integrals

The Riemann sum definition of an integral:

$$ \int_a^b f(x) dx = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i) \Delta x $$

Greek Letters and Special Symbols

Common Greek letters: $\alpha, \beta, \gamma, \delta, \epsilon, \zeta, \eta, \theta, \lambda, \mu, \pi, \sigma, \phi, \psi, \omega$

Uppercase: $\Gamma, \Delta, \Theta, \Lambda, \Xi, \Pi, \Sigma, \Phi, \Psi, \Omega$

Calculus Expressions

Partial derivatives:

$$ \frac{\partial f}{\partial x} = \lim_{h \to 0} \frac{f(x+h, y) - f(x, y)}{h} $$

Chain rule:

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

Set Theory

Set operations:

  • Union: $A \cup B$
  • Intersection: $A \cap B$
  • Subset: $A \subseteq B$
  • Element of: $x \in A$
  • Not element of: $x \notin A$

Number Theory

Euler’s identity:

$$ e^{i\pi} + 1 = 0 $$

The Fibonacci sequence can be expressed as:

$$ F_n = \frac{\phi^n - \psi^n}{\sqrt{5}} $$

where $\phi = \frac{1+\sqrt{5}}{2}$ and $\psi = \frac{1-\sqrt{5}}{2}$.

Statistics and Probability

Normal distribution probability density function:

$$ f(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2} $$

Bayes’ theorem:

$$ P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)} $$

Linear Algebra

Eigenvalue equation:

$$ A\mathbf{v} = \lambda\mathbf{v} $$

Determinant of a 3×3 matrix:

$$ \det(A) = a_{11}(a_{22}a_{33} - a_{23}a_{32}) - a_{12}(a_{21}a_{33} - a_{23}a_{31}) + a_{13}(a_{21}a_{32} - a_{22}a_{31}) $$

Advanced Features

Important Equations

Einstein’s mass-energy equivalence:

$$ E = mc^2 $$

Aligned Equations

$$ \begin{align} \nabla \cdot \mathbf{E} &= \frac{\rho}{\epsilon_0} \\ \nabla \cdot \mathbf{B} &= 0 \\ \nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t} \\ \nabla \times \mathbf{B} &= \mu_0\mathbf{J} + \mu_0\epsilon_0\frac{\partial \mathbf{E}}{\partial t} \end{align} $$

Cases and Conditions

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

Usage Tips

  1. Inline math: Use $...$ or \(...\) for inline expressions
  2. Display math: Use $$...$$ or \[...\] for centered display equations
  3. Escaping: Use backslashes to escape special characters
  4. Spacing: KaTeX handles spacing automatically, but you can use \,, \:, \; for fine-tuning
  5. Line breaks: Use \\ for line breaks in multi-line expressions
  6. KaTeX limitations: This blog uses KaTeX for faster rendering. Some advanced LaTeX features like \label, \ref, and \eqref are not supported
  7. Performance: KaTeX renders mathematical notation quickly while supporting most common mathematical notation

Testing Display

Here’s a complex expression to test the rendering:

$$ \oint_C \mathbf{F} \cdot d\mathbf{r} = \iint_S (\nabla \times \mathbf{F}) \cdot d\mathbf{S} $$

The mathematical typography powered by KaTeX integrates seamlessly with the existing design while maintaining excellent readability in both light and dark themes. KaTeX provides fast, high-quality math rendering perfect for technical blogging.

Advanced Complex Formulas

Quantum Mechanics - Dirac Equation

The Dirac equation for a free particle:

$$ \left(i\gamma^\mu\partial_\mu - m\right)\psi = 0 $$

With gamma matrices satisfying the anticommutation relation:

$$ \{\gamma^\mu, \gamma^\nu\} = 2\eta^{\mu\nu}I_4 $$

General Relativity - Einstein Field Equations

$$ G_{\mu\nu} + \Lambda g_{\mu\nu} = \frac{8\pi G}{c^4}T_{\mu\nu} $$

Where the Einstein tensor is:

$$ G_{\mu\nu} = R_{\mu\nu} - \frac{1}{2}Rg_{\mu\nu} $$

And the Riemann curvature tensor:

$$ R^\rho{}_{\sigma\mu\nu} = \partial_\mu\Gamma^\rho_{\nu\sigma} - \partial_\nu\Gamma^\rho_{\mu\sigma} + \Gamma^\rho_{\mu\lambda}\Gamma^\lambda_{\nu\sigma} - \Gamma^\rho_{\nu\lambda}\Gamma^\lambda_{\mu\sigma} $$

Complex Analysis - Residue Theorem

$$ \oint_C f(z) dz = 2\pi i \sum_{k=1}^n \text{Res}(f, a_k) $$

For a function with a pole of order $m$ at $z = a$:

$$ \text{Res}(f, a) = \frac{1}{(m-1)!} \lim_{z \to a} \frac{d^{m-1}}{dz^{m-1}} \left[ (z-a)^m f(z) \right] $$

Advanced Calculus - Multiple Integrals with Jacobians

Change of variables in multiple integrals:

$$ \iiint_D f(x,y,z) \, dx \, dy \, dz = \iiint_{D'} f(x(u,v,w), y(u,v,w), z(u,v,w)) \left| \frac{\partial(x,y,z)}{\partial(u,v,w)} \right| du \, dv \, dw $$

Where the Jacobian determinant is:

$$ \frac{\partial(x,y,z)}{\partial(u,v,w)} = \begin{vmatrix} \frac{\partial x}{\partial u} & \frac{\partial x}{\partial v} & \frac{\partial x}{\partial w} \\ \frac{\partial y}{\partial u} & \frac{\partial y}{\partial v} & \frac{\partial y}{\partial w} \\ \frac{\partial z}{\partial u} & \frac{\partial z}{\partial v} & \frac{\partial z}{\partial w} \end{vmatrix} $$

Fourier Analysis - Fourier Transform

$$ \hat{f}(\xi) = \int_{-\infty}^{\infty} f(x) e^{-2\pi i x \xi} dx $$

Inverse Fourier Transform:

$$ f(x) = \int_{-\infty}^{\infty} \hat{f}(\xi) e^{2\pi i x \xi} d\xi $$

Convolution theorem:

$$ \mathcal{F}\{f * g\} = \mathcal{F}\{f\} \cdot \mathcal{F}\{g\} $$

Differential Geometry - Christoffel Symbols

Second kind Christoffel symbols:

$$ \Gamma^k_{ij} = \frac{1}{2} g^{kl} \left( \frac{\partial g_{il}}{\partial x^j} + \frac{\partial g_{jl}}{\partial x^i} - \frac{\partial g_{ij}}{\partial x^l} \right) $$

Topology - Fundamental Group

For a topological space $X$ with basepoint $x_0$:

$$ \pi_1(X, x_0) = \{ [\gamma] : \gamma \text{ is a loop at } x_0 \} / \sim $$

Where $\gamma_1 \sim \gamma_2$ if they are homotopic relative to endpoints.

Number Theory - Riemann Zeta Function

$$ \zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s} = \prod_{p \text{ prime}} \frac{1}{1-p^{-s}} $$

Functional equation:

$$ \zeta(s) = 2^s \pi^{s-1} \sin\left(\frac{\pi s}{2}\right) \Gamma(1-s) \zeta(1-s) $$

Quantum Field Theory - Path Integral

$$ \langle \phi_f | \phi_i \rangle = \int \mathcal{D}\phi \, \exp\left( \frac{i}{\hbar} \int_{t_i}^{t_f} \mathcal{L}[\phi, \dot{\phi}] dt \right) $$

Feynman diagrams amplitude:

$$ \mathcal{M} = \int \frac{d^4 k}{(2\pi)^4} \frac{i}{k^2 - m^2 + i\epsilon} \cdot \frac{i}{(p-k)^2 - m^2 + i\epsilon} $$

Stochastic Calculus - Itô’s Lemma

For a stochastic process $dX_t = \mu(X_t, t) dt + \sigma(X_t, t) dW_t$:

$$ df(X_t, t) = \left( \frac{\partial f}{\partial t} + \mu \frac{\partial f}{\partial x} + \frac{1}{2}\sigma^2 \frac{\partial^2 f}{\partial x^2} \right) dt + \sigma \frac{\partial f}{\partial x} dW_t $$

Algebraic Topology - Homology Groups

The $n$-th homology group:

$$ H_n(X) = \frac{\ker(\partial_n)}{\text{im}(\partial_{n+1})} = \frac{Z_n(X)}{B_n(X)} $$

Where $Z_n$ are $n$-cycles and $B_n$ are $n$-boundaries.

Continued Fractions

Golden ratio as an infinite continued fraction:

$$ \phi = 1 + \cfrac{1}{1 + \cfrac{1}{1 + \cfrac{1}{1 + \cfrac{1}{1 + \ddots}}}} $$

Advanced Trigonometry - Spherical Harmonics

$$ Y_\ell^m(\theta, \phi) = \sqrt{\frac{2\ell+1}{4\pi} \frac{(\ell-|m|)!}{(\ell+|m|)!}} P_\ell^{|m|}(\cos\theta) e^{im\phi} $$

Where $P_\ell^m$ are associated Legendre polynomials:

$$ P_\ell^m(x) = (-1)^m (1-x^2)^{m/2} \frac{d^m}{dx^m} P_\ell(x) $$

Information Theory - Shannon Entropy

$$ H(X) = -\sum_{i=1}^n p(x_i) \log_2 p(x_i) = -\mathbb{E}[\log_2 p(X)] $$

Mutual information:

$$ I(X;Y) = \sum_{y \in Y} \sum_{x \in X} p(x,y) \log\left(\frac{p(x,y)}{p(x)p(y)}\right) $$

Tensor Calculus - Covariant Derivative

$$ \nabla_\mu T^{\alpha_1 \ldots \alpha_p}_{\beta_1 \ldots \beta_q} = \partial_\mu T^{\alpha_1 \ldots \alpha_p}_{\beta_1 \ldots \beta_q} + \sum_{i=1}^p \Gamma^{\alpha_i}_{\mu \lambda} T^{\alpha_1 \ldots \lambda \ldots \alpha_p}_{\beta_1 \ldots \beta_q} - \sum_{j=1}^q \Gamma^{\lambda}_{\mu \beta_j} T^{\alpha_1 \ldots \alpha_p}_{\beta_1 \ldots \lambda \ldots \beta_q} $$

Complex Integration - Bromwich Integral

Inverse Laplace transform:

$$ f(t) = \frac{1}{2\pi i} \int_{\gamma-i\infty}^{\gamma+i\infty} F(s) e^{st} ds $$

Where $\gamma$ is chosen so that all singularities of $F(s)$ lie to the left of the line $\text{Re}(s) = \gamma$.

Spectral Theory - Functional Calculus

For a self-adjoint operator $A$:

$$ f(A) = \int_{\sigma(A)} f(\lambda) dE(\lambda) $$

Where $E(\lambda)$ is the spectral measure and $\sigma(A)$ is the spectrum of $A$.

These advanced formulas test various challenging aspects of mathematical typography including:

  • Multi-level subscripts and superscripts
  • Complex fractions and continued fractions
  • Large operators with multiple limits
  • Tensors with many indices
  • Special symbols and operators
  • Multi-line expressions with proper alignment
  • Integration over complex domains
  • Functional notation with multiple arguments

Read More

Leave a comment

Guidelines:
  • Comments are limited to 30 words
  • Submissions are reviewed before publication
  • Keep discussions respectful and on-topic

Comments

Comments are reviewed before publication.