Transform math nodes to html markup for MathJax
This plugin is not for Mathjax Server-Side render or inject js/css. It is used for keeping Latex snippets as raw when gatsby-transformer-remark
convert markdown to html.
gatsby-remark-mathjax adds mathjax support to gatsby using remark-math.
npm install --save gatsby-transformer-remark gatsby-remark-mathjax
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
`gatsby-remark-mathjax`,
],
},
},
],
Add MathJax to your template: MathJax is required to render the formulas correctly. MathJax: Getting Started
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script>
Surround your equation with $
to generate a math equation in inline mode.
Example markdown:
$a^2 + b^2 = c^2$
Surround your equation with $$
and new-lines to generate a math equation in
display mode.
Example markdown:
$$
a^2 + b^2 = c^2
$$