KaTeX Examples
This page collects KaTeX examples so that authors can quickly validate typography and the shared macro set. Every block below renders server-side via remark-math and rehype-katex with copy-paste friendly MathML and TeX.
Inline vs display
heading.anchorLabelInline math keeps equations in the flow of text, such as or the unit vector . Display math is set apart for emphasis:
Use \ifrac{a}{b} or \tfrac{a}{b} for inline fractions like and \frac{a}{b} for display:
Limits and derivatives
heading.anchorLabelThe macros include differential operators for concise notation:
- Velocity:
- Heat flow:
- Gradient:
- Divergence:
- Curl:
A standard limit rendered with left-aligned display math:
Matrices and vectors
heading.anchorLabelVectors in inline math look like while unit vectors such as keep the hat aligned with the bold letter.
Absolute values, norms, and delimiters
heading.anchorLabelGraphing island
heading.anchorLabelThe <Graph2D /> component renders lightweight function plots on the client using Plotly. Expressions are parsed with expr-eval so authors can experiment with quick sketches:
Try a polynomial with asymptotes:
Copy the original TeX
heading.anchorLabelThanks to the copy-tex plugin, selecting in the rendered output copies the raw TeX (\int_0^{\pi} \sin x\,\dd x). This makes it easy to reuse formulas across lectures without retyping them.
Keep this gallery handy when tuning future typography or testing new macros.