In the plugin-based ecosystem of DeepSeek Harness, agents need concrete tools to handle complex document compilation tasks. LaTeX development often encounters compilation errors, missing citations, or messy BibTeX formatting. dsh-latex-guard aims to solve these problems by integrating the standard LaTeX toolchain into agent development workflows.

What is this

dsh-latex-guard is a client-side plugin designed for DeepSeek Harness and any agent. It provides LaTeX project compile checking and BibTeX auditing features. The plugin is maintained by Flan246 and is licensed under the MIT License.

Core Features

  • LaTeX Compilation Checking: Compiles LaTeX projects using latexmk and returns a structured report, including errors, warnings, and undefined references.
  • BibTeX Linting: Deduplicates BibTeX entries, checks required fields for each entry type, and normalizes formatting.
  • Field Filling: Populates missing BibTeX entry fields via DOI or title from Crossref (never overwrites existing values).
  • Citation Auditing: Compares citation keys in .tex and .bib files, identifying entries that are cited but missing and entries that are never cited.

Installation and Enablement

Install the plugin with the following command:

dsh plugin add dsh-latex-guard

After installation, it registers four agent tools: latex_check, bib_lint, bib_fill, and cite_audit.

Typical Usage

The plugin supports running as a DSH plugin and also supports use as a standalone CLI tool.

CLI Commands

# LaTeX 编译检查
npx dsh-latex-guard check <dir> <entry.tex>

# BibTeX 代码检查
npx dsh-latex-guard bib-lint <file.bib>

# BibTeX 字段填充
npx dsh-latex-guard bib-fill <file.bib>

# 引用审计
npx dsh-latex-guard cite-audit <file.bib> <tex...>

CLI Flags

  • --write: Modifies .bib files (please confirm before use).
  • --engine <name>: Selects the compilation engine (auto, pdflatex, xelatex, or lualatex).
  • --json: Outputs in structured JSON format.

Use Cases and Cautions

This plugin runs with the permissions of the current DSH process. Before installing, please review the source code and license.

Known Limitations and Cautions:

  • Comment Line Recognition: cite-audit treats \cite keys inside comment lines (% ...) as real citations.
  • Compilation Reports: The check report may still contain citation warnings emitted by intermediate latexmk passes; only the final pass reflects the true citation state.
  • Environment Dependencies: The check command requires latexmk to be installed on the system (for example, via TeX Live or MiKTeX) and available on the PATH. If latexmk is not found, check returns skipped: true and skips compilation, but the other three commands (pure BibTeX/text processing) remain available.
  • Network Access: bib-fill is the only command that requires network access (it calls the Crossref API).
  • Write Operations: The --write flag modifies .bib files in place.

Short Conclusion

This plugin integrates the LaTeX toolchain into DeepSeek Harness, helping agents handle document compilation and citation management. For more details, visit the plugin directory or the GitHub repository.