latex-doctor

Clean LaTeX comments, fix errors, and verify section markers in .tex files.

58|10|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/Alexander-M-Dickerson/ai-asset-pricing --skill latex-doctor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: latex-doctor
Source: https://github.com/Alexander-M-Dickerson/ai-asset-pricing/tree/main/.claude/skills/latex-doctor
Command: npx skills add https://github.com/Alexander-M-Dickerson/ai-asset-pricing --skill latex-doctor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

LaTeX documents often accumulate formatting errors, stray comments, and inconsistent section markers, causing build failures and tedious debugging. The latex-doctor skill cleans and fixes .tex files to produce reliable, compilable sources ready for publication.

Core Features & Use Cases

  • Comment cleanup: remove unnecessary comments while preserving important annotations.
  • Compilation health checks: run and parse LaTeX (pdflatex/bibtex) logs to identify errors and warnings.
  • Section-marker verification: ensure %% BEGIN/END markers align with \section{} structure and project conventions.
  • Safe auto-fixes: apply deterministic, non-invasive fixes to common issues and report remaining items for review.
  • Use case: prepare a dirty main.tex for submission by producing a clean, error-free version.

Quick Start

Run the latex-doctor on your main.tex to clean comments, fix compilation issues, and verify section markers.

Frequently Asked Questions about latex-doctor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix LaTeX compilation errors and clean up my .tex files automatically?

To fix LaTeX compilation errors and clean .tex files, the skill parses pdflatex and bibtex logs to identify issues, removes unnecessary comments, and applies safe deterministic auto-fixes for reliable, reproducible builds.

What is the best way to verify LaTeX section markers align with document structure?

Verifying LaTeX section markers involves checking that %% BEGIN and END markers align with the \section{} structure and project conventions. This validation ensures correct document sectioning and clean code for drafting and publication.

Can I use this to prepare a LaTeX project for publication without adding nonstandard packages?

Yes, you can prepare LaTeX projects for publication safely. The skill applies non-invasive fixes to individual .tex files or larger projects, enforces deterministic workflows, and specifically avoids introducing nonstandard packages into your document.

Why does my LaTeX document still have warnings after running compilation health checks?

Latex compilation health checks parse logs to identify errors and warnings, applying safe auto-fixes to common issues. Remaining warnings or unresolved errors are reported as items requiring manual review before final submission.

Does the comment cleanup process remove important annotations from my LaTeX source code?

No, the comment cleanup process targets unnecessary comments while actively preserving important annotations within your LaTeX source code. This ensures critical developer notes remain intact during document cleanup and preparation.

What do I need to clean a dirty main.tex file for error-free submission?

To clean a dirty main.tex file for submission, you need the LaTeX source file and its associated project files. The skill processes these inputs to produce a clean, error-free version ready for review and publication.