Skip to content
Discussion options

You must be logged in to vote

Configure rehype-katex with output: 'mathml' in your docusaurus.config.js:

import rehypeKatex from 'rehype-katex';

export default {
  presets: [
    [
      '@docusaurus/preset-classic',
      {
        docs: {
          rehypePlugins: [
            [rehypeKatex, {output: 'mathml'}],
          ],
        },
        blog: {
          rehypePlugins: [
            [rehypeKatex, {output: 'mathml'}],
          ],
        },
      },
    ],
  ],
};

The plugin passes options directly to KaTeX. See https://katex.org/docs/options.html for all available options.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@li-zhenyu
Comment options

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