Closed timothywangdev closed 3 years ago
@timothywangdev At first I think it's pretty easy to add something to defaultPluginMdx
just like other gatsby remark plugins in _layouts/gatsby-config.js
. But then I found there is an upstream problem of gatsby-remark-katex Doesn’t work with gatsby-plugin-mdx.
I tried some of the configs posted in the answers and no luck 😞. Maybe we can track the issue and wait for the day that we can solve this simply by upgrading some dependencies.
Any updates for gatsby-remark-katex? Maybe we can try with remark-math and rehype-katex
@flashshare I don't know if things have changed since last time I checked. Maybe I will find sometime to look at it this week.
@hikerpig These plugins work for me
{
resolve: "gatsby-plugin-mdx",
options: {
remarkPlugins: [require("remark-math")],
rehypePlugins: [require("rehype-katex")],
},
},
plugins version
"rehype-katex": "^5.0.0",
"remark": "^12.0.1",
"remark-math": "^3.0.1"
@timothywangdev I've pushed a new commit to support math notation. The demo can be viewed in https://hikerpig.github.io/foam-template-gatsby-kb/math
@hikerpig Great! This theme is indeed good. I hope it will be popular soon. Not only for foam users, but also for Obsidian users
I'd like to render math equations with katex and I wonder where I should put the gatsby-remark-katex plugin? Thanks!