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.
Import of KaTeX styling.
import "katex/dist/katex.min.css";
Custom HTML attributes that should be added to the rendered HTML tag.
MathInline.configure({
HTMLAttributes: {
class: "my-custom-class",
},
});
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",
},
});
Insert a new inline mathematics expression.
editor.commands.setMathInline("E = mc^2");