2.10.0
中文
Skip to content

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: .

Examples

Basic formulas.

Streaming formulas.

API ​

Latex(options?) returns TokenizerAndRendererExtension[].

PropDescriptionTypeDefault
replaceAlignStartWhether to replace align* in formulas with aligned. KaTeX does not support align*booleantrue
katexOptionsConfiguration passed directly to KaTeXKatexOptions{ 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.