<commit_before># 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: [
        {
          resolve: `gatsby-remark-katex`,
          options: {
            // Add any KaTeX options from https://github.com/KaTeX/KaTeX/blob/master/docs/options.md here
            strict: `ignore`
          }
        }
      ],
    },
  },
],
```

**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]):

```javascript
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:**

```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:**

```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<commit_msg>Change to new URL, avoid redirect (#20470)<commit_after># 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: [
        {
          resolve: `gatsby-remark-katex`,
          options: {
            // Add any KaTeX options from https://github.com/KaTeX/KaTeX/blob/master/docs/options.md here
            strict: `ignore`
          }
        }
      ],
    },
  },
],
```

**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]):

```javascript
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:**

```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:**

```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/KaTeX/KaTeX
[4]: https://github.com/gatsbyjs/gatsby/blob/master/examples/using-remark/src/templates/template-blog-post.js
{'fraction_non_alphanumeric': 0.15668789808917197, 'fraction_numerical': 0.01178343949044586, 'mean_word_length': 3.2968536251709986, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7574208', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1081, 'n_words': 265}