Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/varya/gatsby-remark-include


https://github.com/varya/gatsby-remark-include

Last synced: 5 days ago
JSON representation

Awesome Lists containing this project

README

        

# gatsby-remark-katex

[gatsby-remark-katex][1] adds math equation support to gatsby using
[remark-math][2] and [katex][3]. Live example at [using-remark.gatsbyjs.org/katex/](https://using-remark.gatsbyjs.org/katex/).

## Install

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

## How to use

```javascript
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
`gatsby-remark-katex`,
],
},
},
],
```

**Add Katex CSS to your template:** Katex's CSS file is required to render the formulas correctly. Include the CSS file in your template ([example][4]):

```
require(`katex/dist/katex.min.css`)
```

### 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://www.gatsbyjs.org/packages/gatsby-remark-katex/
[2]: https://github.com/Rokt33r/remark-math
[3]: https://github.com/Khan/KaTeX
[4]: https://github.com/gatsbyjs/gatsby/blob/master/examples/using-remark/src/templates/template-blog-post.js