# markdown-it-with-katex **Repository Path**: gitee-weijinhua/markdown-it-with-katex ## Basic Information - **Project Name**: markdown-it-with-katex - **Description**: 用于渲染带公式的markdown内容的的markdown-it插件,处理逻辑参考 katex的auto-render插件的渲染逻辑。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-15 - **Last Updated**: 2025-11-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # markdown-it-with-katex #### 介绍 用于渲染带公式的markdown内容的markdown-it插件,处理逻辑参考katex的auto-render插件的渲染逻辑,AI模型返回的带公式的内容可直接使用。 #### 安装教程 需要附带安装katex及markdown-it ```bash npm install katex markdown-it markdown-it-with-katex ``` #### 使用说明 在使用的地方 ```javascript import {renderMarkdownWithKatex} from "markdown-it-with-katex" const markdownText= "### 举例\n$c = \\pm\\sqrt{a^2 + b^2}$" const renderText=renderMarkdownWithKatex(markdownText) ``` 调用方法已经引入了katex(包括相关的样式及mhchem插件,如果引入路径不对可自行引入)及markdown-it。 #### 配置项 renderMarkdownWithKatex支持传入配置项options,详细配置参考:[katex options 配置](https://katex.org/docs/options)