You can type LaTeX in Docusaurus by using remark math.
In the root directory of your Docusaurus project, run
yarn add remark-math and
yarn add rehype-katex. This will add
rehype-katex to the
At the top of your
docusaurus.config.js, add the following in
module.exports (not under
Then add the following underneath your
docs section in
The result will look something like this:
You can also choose to self-host the stylesheets. The latest versions are available here.
static by running
cd static in your root directory.
There's at least two ways to unpack the
tar xvzf katex.tar.gz. You can remove the
gunzip katex.tar.gzthen run
tar xvf katex.tar.
Then, in the above configuration steps, replace
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css', with
You can use either
$ brackets or
$$ brackets across multiple lines.
For example, this
will print to this:
Fundamental Theorem of Calculus
Let be Riemann integrable. Let be . Then is continuous, and at all such that is continuous at , is differentiable at with .
The latest versions of
remark-parse v9.0.0 or
remark v13.0.0, which Docusaurus does not support yet, so you may need to change the versions of