Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Fix Markdown Math ToolNew to Visual Studio Code? Get it now.
Fix Markdown Math Tool

Fix Markdown Math Tool

xiaofanfan

|
1 install
| (0) | Free
Normalize LaTeX math and repair common Markdown formatting issues in the current file.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Fix Markdown Math

修复当前文件中的常见 Markdown 排版和 LaTeX 数学公式格式问题。

使用方法

  1. 在 VS Code 中打开 Markdown 文件。
  2. 按 Alt+M(macOS 为 Option+M),或在命令面板运行 Fix Entire Markdown File。
  3. 检查修改结果并保存文件。可以使用编辑器的撤销命令恢复修改。

命令会处理整个当前文件,不限于选中内容。

功能

  • 将 Unicode 上下标转换为 LaTeX 上下标,例如 x² 转为 $x^{2}$。
  • 清理部分重复的 LaTeX 反斜杠及多余转义。
  • 将独立行上的 \[、\] 块公式分隔符统一为 $$。
  • 为识别出的上下标变量补充行内数学公式分隔符。
  • 为识别出的独立公式行补充块公式分隔符。
  • 修复部分 Markdown 转义、重复加粗标记和中文标点 HTML 实体。

注意事项

公式识别使用启发式规则,可能把包含数学符号的普通文本判断为公式。当前版本不单独保护代码块,因此包含代码、链接或复杂 Markdown 结构的文件也需要检查修改结果。

环境要求

VS Code 1.90.0 或更高版本。

许可证

本项目采用 MIT License。

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft