Closed evanorti closed 2 years ago
I tried with remark-math
and rehype-katex
and I don't see any error: https://stackblitz.com/edit/github-hdma5n?file=docusaurus.config.js,docs%2Fintro.md&initialpath=docs/intro
Make sure the versions you are using work with mdx v2. If you are still having problems, post a stackblitz example and I'll take a look.
Also, make sure to escape any opening braces {
that aren't part of expressions. See here: https://mdxjs.com/docs/troubleshooting-mdx/#could-not-parse-expression-with-acorn-error
@pomber Interesting, on my setup your example is showing that equations still aren't being parsed into katex.
I'll try some things and then post a stackblitz example.
Still can't get any of our other remark plugins are able to work either it seems.
Stackblitz here:
Seems related to your comment here:
https://github.com/facebook/docusaurus/issues/4029#issuecomment-1098451055
Using remark directives would also be helpful for us.
Seems related to your comment here:
Admonition doesn't work with mdx v2. Math and katex should work (according to the remark-math docs).
But I'm not familiar with those plugins. I don't see any error, and I don't know what's the expected output. It would help if you could provide an example with the correct output (maybe using another framework that support mdx v2, like nextjs).
I found an example of what Katex math equations should look like using next.js mdx2, rehypeKatex and remarkMath:
https://codesandbox.io/s/next-mdx-math-katex-vd1qx?file=/package.json
Let me know if you need anything else.
I updated the plugins in your example
"rehype-katex": "^6.0.2",
"remark-math": "^5.1.1"
Looks like it works now https://stackblitz.com/edit/tdocs-vjasmd?file=docs%2Findex.mdx
Awesome! Thank you for your help!
I want to use the katex and math remark plugins for parsing formulas, but I am getting errors:
It seems this happens to other remark plugins as well, such as the admonitions plugin (as specified in this repo's readme). I'd also like to use the directives plugin for simpler syntax, but am running into the same issue.
Is there any workaround for this, so I can still use Code Hike and these plugins?
Thanks