DeepSeek Harness plugin

dsh-latex-ocr

公式图片 → LaTeX(pix2tex / LaTeX-OCR):把教材/截图中的数学公式识别为 LaTeX 代码

Jump to install

Source facts

Repository
Yunnalab/dsh-latex-ocr
Latest update
Aug 17, 2026
Category
Vision & Multimodal
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/Yunnalab/dsh-latex-ocr
Plugin: dsh-latex-ocr
Author: Yunnalab

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer2 files
README.mdSource · read only

dsh-latex-ocr

公式图片 → LaTeX:为 DeepSeek Harness 提供 latex_ocr 工具, 把数学公式截图 / 教材公式页 / 手写公式照片识别为 LaTeX 代码(基于开源 pix2tex / LaTeX-OCR, 本地 CPU 推理,无需联网、无需 API key)。

安装

1. 安装识别引擎(一次性)

bash scripts/setup.sh      # 创建 ~/.dsh/latex-ocr-venv,安装 torch(CPU) + pix2tex

或手动:

python3 -m venv ~/.dsh/latex-ocr-venv
~/.dsh/latex-ocr-venv/bin/pip install --index-url https://download.pytorch.org/whl/cpu torch
~/.dsh/latex-ocr-venv/bin/pip install pix2tex
~/.dsh/latex-ocr-venv/bin/pip install --index-url https://download.pytorch.org/whl/cpu torchvision   # 与 torch 同源,避免算子不匹配

首次识别会自动下载模型权重(约 120MB,HuggingFace)。

> NixOS:pip 安装的二进制缺少 libstdc++.so.6 / libz.so.1setup.sh 会自动生成 > 注入 nix store 运行库的 pix2tex-dsh 包装脚本;插件优先使用它。

2. 安装插件

# 任意 DeepSeek Harness 检出目录
dsh plugin --profile web add dsh-latex-ocr        # npm 发布后可这样装
# 或本地源码:dsh plugin --profile web add /path/to/dsh-latex-ocr

重启 DSH Web 进程后生效。

使用

把这张公式识别成 LaTeX:latex_ocr(image="/path/to/formula.png")

返回 LaTeX 表达式,可直接用于讲解、推导与复现。本地 CPU 推理约 1-7 秒/条。

实测(温度 0.1):

原公式识别结果
∫₀^∞ e^{-x²} dx = √π/2\int_{0}^{\infty}e^{-x^{2}}\,d x={\frac{\sqrt{\pi}}{2}}
lim_{x→0} sinx/x = 1\operatorname*{lim}_{x\to0}{\frac{\sin x}{x}}=1

复杂公式(重积分、矩阵、求和上下限)可能不完美,关键公式请对照原图核对。

工作原理

latex_ocr 工具 → execFile 调用本机 pix2tex CLI(~/.dsh/latex-ocr-venv/bin/pix2tex[-dsh], 找不到则回退到 PATH 上的 pix2tex)→ 解析 stdout 中的 LaTeX。

兼容性

  • Node ≥ 22(DSH Web 要求)
  • Python ≥ 3.10(引擎;PyTorch 需支持对应版本)
  • 磁盘:约 1.5GB(torch + pix2tex + 权重)
  • 平台:Linux / macOS(Windows 未验证;scripts/setup.sh 为 bash)

License

MIT(pix2tex 模型与权重版权归其原作者所有)。