Skip to content

Is there a way to include KaTeX extensions? (mhchem extension) #99

Answered by yhatt
vedranmiletic asked this question in Q&A
Discussion options

You must be logged in to vote

Marp's markdown rendering will be completed within Node.js. <script> is for browser side so will never work. Instead, you should follow KaTeX documentation for Node.js: https://github.com/KaTeX/KaTeX/blob/master/docs/node.md#using-mhchem-extension

In Marp CLI:

// marp.config.js
const katex = require('katex');
require('katex/dist/contrib/mhchem.js'); // modify katex module

To modify Marp Core's KaTeX, you may be required installing into local.

npm i @marp-team/marp-core @marp-team/marp-cli
npx marp -c marp.config.js your-markdown.md

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Serenade600
Comment options

@yhatt
Comment options

Answer selected by yhatt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants