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

mhchem doesn't seem to work with rehype-katex #97

Closed
4 tasks done
djoudimansouri-ti opened this issue Apr 10, 2024 · 5 comments
Closed
4 tasks done

mhchem doesn't seem to work with rehype-katex #97

djoudimansouri-ti opened this issue Apr 10, 2024 · 5 comments
Labels
👯 no/duplicate Déjà vu 👎 phase/no Post cannot or will not be acted on

Comments

@djoudimansouri-ti
Copy link

Initial checklist

Affected packages and versions

latest

Link to runnable example

No response

Steps to reproduce

Node version : v21.5.0
NPM version : 10.2.4
PNPM version : 8.13.1

I'm using the rehype-katex plugin in react-markdown in a Nextjs14 app, and while KaTeX seem to work and displays maths equations and symbols with little to no issues, i can't say the same for chimical reactions, even the KaTeX package imports the mhchem module and declares the macros properly, i can't seem to get it to work in my app, in which i call the plugin like this :

        <ReactMarkdown
            className="prose break-words dark:prose-invert prose-p:leading-relaxed prose-pre:p-0"
            remarkPlugins={[remarkGfm, remarkMath]}
            rehypePlugins={[rehypeKatex]}
            components={{
              p({ children }) {
                return <p className="mb-2 last:mb-0 ">{children}</p>
              },
            }}
          >
             {`$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$`} 
          </ReactMarkdown>

Expected behavior

The chemical reaction equation should be properly formated and show this :

image

Actual behavior

Instead, nothing is happening, it's style displayed like this :

\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}

Runtime

Other (please specify in steps to reproduce)

Package manager

Other (please specify in steps to reproduce)

OS

Linux

Build and bundle tools

Next.js

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Apr 10, 2024
@wooorm
Copy link
Member

wooorm commented Apr 10, 2024

See: #81 (comment).
See: #34 (comment).

@wooorm wooorm closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2024
@wooorm wooorm added the 👯 no/duplicate Déjà vu label Apr 10, 2024

This comment has been minimized.

Copy link

Hi! Thanks for taking the time to contribute!

Because we treat issues as our backlog, we close duplicates to focus our work and not have to touch the same chunk of code for the same reason multiple times. This is also why we may mark something as duplicate that isn’t an exact duplicate but is closely related.

Thanks,
— bb

Copy link

github-actions bot commented Apr 10, 2024

Hi team! It seems this post is a duplicate, but hasn’t been marked as such. Please post a comment w/ Duplicate of #123(no final .) to do so. See GH docs for more info.

Thanks,
— bb

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Apr 10, 2024
@wooorm
Copy link
Member

wooorm commented Apr 10, 2024

Duplicate of #34

@wooorm wooorm marked this as a duplicate of #34 Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👯 no/duplicate Déjà vu 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants