hasura / gatsby-gitbook-starter

Generate GitBook style modern docs/tutorial websites using Gatsby + MDX
https://hasura.io/learn/graphql/react/introduction/
MIT License
985 stars 376 forks source link

KaTeX support #174

Closed ancepsinfans closed 2 years ago

ancepsinfans commented 2 years ago

I've tried adding the gatsby-remark-katex plugin using the instructions here, but I still can't seem to get KaTeX to display on my pages. Any ideas?

ancepsinfans commented 2 years ago

I'll close this issue. I found a fix myself. I'll post the code below for anyone else in the same position.

const plugins = [
...
  {
    resolve: 'gatsby-plugin-mdx',
    options: {
      remarkPlugins: [
        require('remark-math'),
        require('remark-html-katex'),
        require('remark-abbr'),
      ],
      gatsbyRemarkPlugins: [
        {
          resolve: "gatsby-remark-images",
          options: {
            maxWidth: 1035,
            sizeByPixelDensity: true
          }
        },
        {
          resolve: 'gatsby-remark-copy-linked-files'
        }
      ],
      extensions: [".mdx", ".md"]
    }
  },
  ...
  ];