Coder Social home page Coder Social logo

Comments (10)

pomber avatar pomber commented on July 25, 2024

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.

from docusaurus-mdx-2.

pomber avatar pomber commented on July 25, 2024

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

from docusaurus-mdx-2.

evanorti avatar evanorti commented on July 25, 2024

@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.

Screen Shot 2022-08-05 at 10 14 02 AM

from docusaurus-mdx-2.

evanorti avatar evanorti commented on July 25, 2024

Still can't get any of our other remark plugins are able to work either it seems.

Stackblitz here:

https://stackblitz.com/edit/tdocs?file=docusaurus.config.js

from docusaurus-mdx-2.

evanorti avatar evanorti commented on July 25, 2024

Seems related to your comment here:

facebook/docusaurus#4029 (comment)

from docusaurus-mdx-2.

evanorti avatar evanorti commented on July 25, 2024

Using remark directives would also be helpful for us.

from docusaurus-mdx-2.

pomber avatar pomber commented on July 25, 2024

Seems related to your comment here:

facebook/docusaurus#4029 (comment)

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).

from docusaurus-mdx-2.

evanorti avatar evanorti commented on July 25, 2024

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.

from docusaurus-mdx-2.

pomber avatar pomber commented on July 25, 2024

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

image

from docusaurus-mdx-2.

evanorti avatar evanorti commented on July 25, 2024

Awesome! Thank you for your help!

from docusaurus-mdx-2.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.