Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.1 KB

math-block.md

File metadata and controls

53 lines (36 loc) · 1.1 KB

MathBlock extension

Use this extension to render block mathematics expressions. Mathematics expressions are rendered using KaTeX. In addition, the extension can render on the fly when editing expressions and give hints of errors.

Additional Setup

Import of KaTeX styling.

import "katex/dist/katex.min.css";

Options

HTMLAttributes

Custom HTML attributes that should be added to the rendered HTML tag.

MathBlock.configure({
  HTMLAttributes: {
    class: "my-custom-class",
  },
});

dictionary

If you need to internationalize this extension, you can use this option.

MathBlock.configure({
  dictionary: {
    name: "Math Block",
    inputMath: "Enter or paste the equation",
    inputHelp: "Help",
  },
});

Commands

setMathBlock()

Insert a new block mathematics expression.

editor.commands.setMathBlock("E = mc^2");

Markdown

GitHub Writing mathematical expressions