zhibin52 downloadsConvert LaTeX formulas generated by AI (ChatGPT, DeepSeek, Gemini, etc.) into Obsidian's MathJax format.
One-click conversion of LaTeX formulas in AI responses (ChatGPT, DeepSeek, Gemini, etc.) into MathJax syntax that renders correctly in your notes.
English description | 中文说明
Convert LaTeX formulas copied from AI chats into Obsidian-compatible MathJax syntax with a single command.
When you copy AI answers directly into your notes, formulas often fail to render. Two common forms appear:
| Form | Example | Typical source |
|---|---|---|
| Standard delimiters | \( E=mc^2 \), \[ \int_0^1 f(x)\,dx \] |
Default output of ChatGPT and other AIs |
| Double-escaped | \\( E=mc^2 \\), \\[ ... \\] |
Web copy or JSON / API output that escapes backslashes |
This plugin converts both into the inline $ ... $ and block $$ ... $$ syntax.
| Input | Output |
|---|---|
\( ... \) |
$ ... $ |
\[ ... \] |
$$ ... $$ |
\\( ... \\) |
$ ... $ |
\\[ ... \\] |
$$ ... $$ |
$ ... $ / $$ ... $$ is left untouched, so running the command twice is safe.\( without its matching \)) are kept as-is instead of swallowing the rest of the document.\begin{align} are already supported natively.Requires Node.js (18+ recommended) and npm
git clone https://github.com/crazy5/obsidian-transfer-latex-from-AI
cd obsidian-transfer-latex-from-AI
npm install
npm run build
Copy main.js, manifest.json, and styles.css into:
<your vault>/.obsidian/plugins/transfer-latex-from-ai/
Then enable the plugin in Settings → Community plugins (turn off Restricted mode first).
crazy5/obsidian-transfer-latex-from-AIThe original upstream plugin, Transfer LaTeX from GPT, is available in the community directory but does not include
\\( ... \\)support.
Turn off Settings → Editor → Auto convert HTML. Otherwise, paste AI answers as plain text, so the formula delimiters survive the paste.
Ctrl+P → Convert LaTeX to MathJaxThe conversion is undoable with Ctrl+Z.
\(...\) examples inside code will also be converted.Forked from xixia123/obsidian-transfer-latex-from-gpt by Xixia, with thanks.
将 ChatGPT、DeepSeek、Gemini 等 AI 回答中的 LaTeX 公式,一键转换为 Obsidian 能够正确渲染的 MathJax 语法,帮助你在笔记中便捷地使用数学公式,提高学习与科研效率。
直接从 AI 网页复制回答到 Obsidian,公式经常无法渲染,常见两类形式:
| 形式 | 示例 | 常见来源 |
|---|---|---|
| 标准定界符 | \( E=mc^2 \)、\[ \int_0^1 f(x)\,dx \] |
ChatGPT 等 AI 的默认输出 |
| 双反斜杠转义 | \\( E=mc^2 \\)、\\[ ... \\] |
网页复制或 JSON / API 输出被二次转义 |
本插件一键将它们转换为 Obsidian 支持的 $ ... $(行内)与 $$ ... $$(块级)。
| 输入 | 输出 |
|---|---|
\( ... \) |
$ ... $ |
\[ ... \] |
$$ ... $$ |
\\( ... \\) |
$ ... $ |
\\[ ... \\] |
$$ ... $$ |
$ ... $ / $$ ... $$ 的内容不会再次改动,重复执行安全。\( 没有 \))保持原样,不会误吞后文。\begin{align} 等 LaTeX 环境 Obsidian 本身已支持,无需转换。需要 Node.js(建议 18+)与 npm
git clone https://github.com/crazy5/obsidian-transfer-latex-from-AI
cd obsidian-transfer-latex-from-AI
npm install
npm run build
构建完成后,将 main.js、manifest.json、styles.css 三个文件复制到你的库目录:
<你的库>/.obsidian/plugins/transfer-latex-from-ai/
然后在 Obsidian 中:设置 → 第三方插件 → 关闭受限模式 → 启用 Transfer LaTeX from AI。
crazy5/obsidian-transfer-latex-from-AI社区市场上游原版为 Transfer LaTeX from GPT,不含本仓库的
\\( ... \\)双反斜杠支持。
使用前,请在 设置 → 编辑器 中关闭「自动转换 HTML」选项;否则粘贴 AI 回答时请使用纯文本格式,以免公式定界符在粘贴时丢失。


方式一:通过命令使用
Ctrl + P 打开命令面板 → 输入 Convert LaTeX to MathJax

方式二:通过点击左侧按钮使用
点击左侧栏的 σ 按钮,转换当前打开的文件。

Ctrl + Z 撤销。\(...\) 示例同样会被转换。本项目基于 xixia123/obsidian-transfer-latex-from-gpt 二次开发,感谢原作者 Xixia。项目的英文介绍见上文 English 段。
AI生成