LaTeX
Latex is imported from @ant-design-x-vue/x-markdown/plugins/Latex, returns marked extensions, and is passed to config.extensions. Inline $...$ / \(...\), block $$ / \[...\].
When to use
Needed when rendering mathematical formulas in Markdown.
Examples
Pythagoras: .
API
Latex(options?) returns TokenizerAndRendererExtension[].
| Prop | Description | Type | Default |
|---|---|---|---|
| replaceAlignStart | Whether to replace align* in formulas with aligned. KaTeX does not support align* | boolean | true |
| katexOptions | Configuration passed directly to KaTeX | KatexOptions | { output: 'html', throwOnError: false } |
ts
import { XMarkdown } from '@ant-design-x-vue/x-markdown';
import Latex from '@ant-design-x-vue/x-markdown/plugins/Latex';
// <XMarkdown :config="{ extensions: Latex({ replaceAlignStart: true }) }" content="$E=mc^2$" />For more instructions, see Plug-in Collection · Latex.