把 ChatGPT 风格的公式定界符(\(...\)、\[...\])就地改成 Obsidian 能渲染的 $...$、$$...$$,并跳过代码块与正则示例。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:Mach1ne333/dsh-latex-delimiter-fixer
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
Fix math delimiters pasted from ChatGPT (or any MathJax-default renderer) so they
render in Obsidian (and other $-only Markdown renderers).
\( ... \) → $ ... $ · \[ ... \] → $$ ... $$

Why
ChatGPT and MathJax-default sites accept \(...\) / \[...\]. Obsidian's MathJax
only registers $...$ and $$...$$, so GPT-generated notes show raw \( noise
instead of formulas. This plugin rewrites them in place.
| Input | Output |
|---|---|
\(g\) |
$g$ |
\($P_s$\) (nested) |
$P_s$ |
\[\Delta x\] alone on a line |
three-line $$ block |
multi-line \[ ... \] display block |
$$ ... $$ display block |
\(2\,\mathrm{m/s}\) |
$2\,\mathrm{m/s}$ |
Left untouched on purpose: fenced code, inline code, YAML front matter, Chinese
parentheses such as (具体应该输出什么动作), and regex examples such as
5. \(xy\) : 匹配字符为xy, \[\^0-9 \]\+. mode: "all" converts everything.
Install
- Open the DSH plugin market, search for LaTeX delimiter fixer, install and enable it.
- Or install this repository's folder as a local bundle from the plugin manager. No build step and no runtime dependencies are required.
The plugin activates immediately: the tool and the slash command appear in the running session without a restart.
Usage
- Tool
fix_latex_delimiters— parameters{ path?, mode?: "auto" | "all", dry_run?: boolean }. Withoutpath, the session working directory is scanned recursively. - Command
/fixlatex [path ...] [--dry] [--all]— runs inside the host process and never creates a model message, so it costs no tokens. Add--dryto preview, drop it to write.
Example:
/fixlatex /home/me/Notes --dry
/fixlatex "/home/me/Notes/秋招/LLM驱动的机器人决策范式.md"
/fixlatex ~/Notes
Directories are walked recursively; .git, .obsidian, .trash, node_modules,
and .dsh are skipped. Unreadable directories are skipped instead of aborting.
Every changed file is reported with a couple of sample replacements.
中文说明
ChatGPT 粘贴出来的公式用 \(...\)、\[...\],Obsidian 只认 $...$、$$...$$。
这个插件把两者就地改写:
- 斜杠命令
/fixlatex 路径 [--dry] [--all]:在宿主进程里跑,不产生模型消息,不花 token; - 工具
fix_latex_delimiters:让 agent 调用,适合批量整理; - 代码块、行内代码、front matter、中文括号、正则示例默认不动。
Layout
index.js— Cordis plugin: registers the tool and the slash command, no imports.lib/transform.js— dependency-free Markdown state machine (transformMarkdown,runFix,summarize).cordis.patch.yml— bundle patch that inserts the plugin.locale/— bundle title and description for the plugin manager.assets/— screenshots shown here and in the market.
License
MIT
链接
同类插件
tt-a1i/archify#integrations/deepseek-harness★ 97127
从仓库或系统描述生成经过校验的自包含交互式架构图、流程图、时序图、数据流图和生命周期图。
dream-num/dsh-univer-office★ 728
为 DeepSeek Harness 打造一个真正的办公环境。Univer Office 插件将电子表格、文档、幻灯片、画布、多维表格等汇聚到同一个运行时——数据互联、修改经过校验、变更按版本管理,并以隔离工作树支持多 Agent 协作。
Roland0511/dsh-marktext★ 702
基于 MarkText 内核 muya 的右侧栏所见即所得 Markdown 编辑器:打开 .md 按渲染结果编辑,保存走 ctx.fs 并带版本守卫。
ECNU/EduWork#dsh-knowledge-studio★ 370
基于工作区资料的 Studio,复用 DSH 模型与共享成果服务,制作报告、演示文稿、表格、思维导图、测验、闪卡及音视频。Office 生成需 Python 3.12+ 及相关依赖,并配置 DSH_OFFICE_PYTHON;媒体渲染需 Chromium;本地语音转写另需 whisper.cpp 和模型。
PerryLink/dsh-industry-research★ 219
面向 DeepSeek Harness 的确定性行业研究报告:公司与行业研究流程基于分阶段证据产出结构化、可核验的报告。
joeseesun/qiaomu-ui-learn-dsh★ 85
浏览界面设计参考和交互标本,练习设计测验,并导出 Markdown 学习笔记。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。