Mathematics
Inline notation
A short expression belongs inside its sentence: for a real number , the quantity is nonnegative. Inline math uses single dollar delimiters.
For $x \in \RR$, the quantity $x^2$ is nonnegative.
This site defines \RR as a macro for \mathbb{R}. The formula is rendered into HTML and MathML during the build.
Display equations
The quadratic formula is a useful display example:
Use a pair of double dollar delimiters for display math:
$$
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
$$
Matrices and aligned expressions
Long expressions
Wide formulas stay in their own scrolling region on small screens:
Macros and validation
astro.config.mjs
astroBook({
markdown: {
math: {
macros: { '\\RR': '\\mathbb{R}' },
throwOnError: false,
},
},
});
The default keeps invalid math readable. This deliberately unknown command demonstrates that fallback: .
Use throwOnError: true when an invalid expression should fail the build. The theme uses KaTeX math syntax; it does not compile complete LaTeX documents.