Skip to content

MathJax

MathJax is a syntax for writing mathematical formulas that get beautifully rendered.

Example

The following text:

$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$

renders the formula:

Enabling MathJax

When you choose MathJax as an option, the following is added to the Starlight project:

  1. rehypeMathJax is added to the markdown.rehypePlugins Astro configuration.
  2. remarkMath is added to the markdown.remarkPlugins Astro configuration.
  3. mathjax.css is added to the customCss Starlight configuration.