Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: How to integrate gatsby-remark-katex to support KaTeX #39176

Open
2 tasks done
jasonkang14 opened this issue Dec 2, 2024 · 0 comments
Open
2 tasks done

Fix: How to integrate gatsby-remark-katex to support KaTeX #39176

jasonkang14 opened this issue Dec 2, 2024 · 0 comments
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: documentation An issue or pull request for improving or updating Gatsby's documentation

Comments

@jasonkang14
Copy link

Preliminary Checks

Summary

I followed the instructions provided in the official documentation for gatsby-remark-katex, but I encountered an error when trying to display math equations.

To resolve the issue, I had to add the following configurations to the options in gatsby-transformer-remark:

resolve: "gatsby-transformer-remark",
options: {
  plugins: [
    {
      resolve: "gatsby-remark-katex",
      options: {
        strict: "ignore",
        remarkPlugins: [require('remark-math')], // Added
        rehypePlugins: [require('rehype-katex')],  // Added
      },
    },
    ...other plugins,
  ],
  ...other options,
}

These configurations were not mentioned in the current documentation.

Can I create a pull request to update the documentation to include these configurations? This will help other users avoid the same issue when integrating gatsby-remark-katex.

Steps to Resolve this Issue

  1. install remark-math and rehype-katex
  2. add remarkPlugins and rehypePlugins to the gatsby-remark-katex configuration
@jasonkang14 jasonkang14 added the type: documentation An issue or pull request for improving or updating Gatsby's documentation label Dec 2, 2024
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

No branches or pull requests

1 participant