hufangd-2019/dsh-latex2office0

dsh-latex2office

DeepSeek Harness 的 LaTeX 转 Office 公式工具,支持将公式作为原生 OMML 或渲染图片插入 Word/PPT。

AI 分析

核心用途是自动将 LaTeX 公式排版插入到现有的 docx 或 pptx 文档中。适合需要撰写学术报告、技术文档的科研与办公人员。

套件
dsh-latex2office
版本
0.1.1
授權
MIT
最近更新
2026年9月9日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hufangd-2019/dsh-latex2office

可选配置覆盖

在 profile 自身的 cordis.patch.yml 中给本插件的行挂 config:

- id: latex2office-tools
  config:
    pythonPath: 'D:\python\python.exe'   # 三个路径均可留空=自动探测
    pandocPath: ''
    sofficePath: ''
    renderTimeoutSec: 90                  # 单公式 LibreOffice 渲染超时

使用示例(模型侧调用)

// 生成带编号的公式文档
{ "tool": "latex2office_generate",
  "args": {
    "output": "D:/docs/equations.docx",
    "title": "运动方程",
    "formulas": [
      { "latex": "\\frac{\\partial u}{\\partial t} + u\\frac{\\partial u}{\\partial x} = -\\frac{1}{\\rho}\\frac{\\partial p}{\\partial x}", "number": "1.1" }
    ]
  } }

// 插入现有文档,定位到某段文字之后
{ "tool": "latex2office_insert",
  "args": {
    "file": "D:/docs/report.docx",
    "formulas": [
      { "latex": "E = mc^2", "position": { "mode": "after_text", "text": "质能方程:" }, "number": "2.1" },
      { "latex": "\\sigma_x = \\frac{F}{A}", "position": { "mode": "end" } }
    ]
  } }