Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.14 KB

math-inline.md

File metadata and controls

54 lines (37 loc) · 1.14 KB

MathInline extension

Use this extension to render inline 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.

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

dictionary

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

MathInline.configure({
  dictionary: {
    name: "Math Inline",
    emptyMath: "Add a Tex equation",
    inputMath: "Enter or paste the equation",
    inputHelp: "Help",
  },
});

Commands

setMathInline()

Insert a new inline mathematics expression.

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

Markdown

GitHub Writing mathematical expressions