Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/varya/gatsby-remark-include
https://github.com/varya/gatsby-remark-include
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/varya/gatsby-remark-include
- Owner: varya
- Created: 2018-11-22T08:41:29.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-22T08:43:20.000Z (about 6 years ago)
- Last Synced: 2024-11-05T11:52:26.345Z (about 2 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
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