Math & LaTeX
Pagesmith supports mathematical notation through remark-math and rehype-mathjax. Write equations using standard LaTeX syntax and Pagesmith renders them to accessible SVG output. Use $...$ for inline math and $$...$$ for display math.
Inline Math
Inline math flows naturally within text. The $ delimiters must not have spaces immediately inside them.
The equation
The sum of the first
A circle with radius
In probability, the expected value of a discrete random variable is
The Pythagorean theorem states that
Display Math
Display math is centered on its own line, which is useful for important equations or more complex expressions.
Quadratic formula
The solutions to
Definite integral
The Gaussian integral is one of the most useful results in calculus and probability theory:
Matrix notation
A 2x2 rotation matrix for angle
Taylor series
The Taylor expansion of
Euler’s identity
Often called the most beautiful equation in mathematics:
This connects five fundamental constants:
Bayes’ theorem
The foundation of Bayesian inference:
where
Mixing Text and Math
Mathematical expressions work naturally alongside prose, tables, links, and the rest of your Markdown content.
The standard deviation of a dataset is
Given a function
so the roots are
Big-O notation in context
Algorithm complexity is commonly expressed using Big-O notation. Binary search runs in
| Algorithm | Best case | Average case | Worst case |
|---|---|---|---|
| Binary search | |||
| Quicksort | |||
| Merge sort |
Maxwell’s equations
The four equations that describe classical electromagnetism:
These equations unify electricity, magnetism, and light into a single theoretical framework.