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
latexmkand 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
.texand.bibfiles, 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.bibfiles (please confirm before use).--engine <name>: Selects the compilation engine (auto,pdflatex,xelatex, orlualatex).--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-audittreats\citekeys inside comment lines (% ...) as real citations. - Compilation Reports: The
checkreport may still contain citation warnings emitted by intermediatelatexmkpasses; only the final pass reflects the true citation state. - Environment Dependencies: The
checkcommand requireslatexmkto be installed on the system (for example, via TeX Live or MiKTeX) and available on the PATH. Iflatexmkis not found,checkreturnsskipped: trueand skips compilation, but the other three commands (pure BibTeX/text processing) remain available. - Network Access:
bib-fillis the only command that requires network access (it calls the Crossref API). - Write Operations: The
--writeflag modifies.bibfiles 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.