Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hanai/gatsby-remark-mathjax

Transform math nodes to html markup for MathJax
https://github.com/hanai/gatsby-remark-mathjax

gatsby gatsbyjs math mathjax remark

Last synced: 3 months ago
JSON representation

Transform math nodes to html markup for MathJax

Awesome Lists containing this project

README

        

# gatsby-remark-mathjax

## :pushpin: Notice

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.

## Introduction

[gatsby-remark-mathjax][1] adds mathjax support to gatsby using [remark-math][2].

## Install

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

## How to use

```javascript
// 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](http://docs.mathjax.org/en/latest/start.html)

``` html

```

### 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
$$
```

[1]: https://github.com/hanai/gatsby-remark-mathjax
[2]: https://github.com/Rokt33r/remark-math