gatsby-remark-mathjax

Transform math nodes to html markup for MathJax

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
gatsby-remark-mathjax
611.0.04 years ago4 years agoMinified + gzip package size for gatsby-remark-mathjax in KB

Readme

gatsby-remark-mathjax
gatsby-remark-mathjax1 adds mathjax support to gatsby using remark-math2.

Install

npm install --save gatsby-transformer-remark gatsby-remark-mathjax

How to use

// 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.

Math Equations in Inline Mode

Surround your equation with $ to generate a math equation in inline mode.
Example markdown:
$a^2 + b^2 = c^2$

Math Equations in Display Mode

Surround your equation with $$ and new-lines to generate a math equation in display mode.
Example markdown:
$$
a^2 + b^2 = c^2
$$