How ComfyTex Works
A transparent look at the AI pipeline that powers ComfyTex — including what it does well, how each stage works, and the limitations we choose to disclose.
The Three-Agent Pipeline
ComfyTex is built around a three-layer multi-agent architecture. Each agent has a distinct, narrow responsibility. No single agent makes decisions across layers — the system is designed so that each stage validates and constrains the output of the previous one.
- LLM Assembly Agent — reads your Markdown and your target venue's LaTeX template, then generates a first-draft
.texfile. It understands template-specific conventions (preamble structure, sectioning commands, bibliography style) and maps your Markdown content into them. - LLM Checker Agent — audits the generated
.texfor structural correctness: missing environments, broken cross-references, escaped-character errors, and template-compliance violations. It produces a structured error report. - LLM Overviewer Agent — receives both the draft and the error report, then applies targeted fixes. It does not regenerate from scratch — it surgically corrects the specific issues flagged by the Checker.
What the AI Actually Does
Each agent performs structural translation only. The pipeline never rewrites, paraphrases, summarises, or generates new academic content. Specifically:
- Maps Markdown headings (
#,##) to LaTeX sectioning commands (\section,\subsection) - Converts
$...$and$...$math into the template's required math environments - Transforms Markdown tables into properly-structured
tabularortable*environments - Matches author-year citations to
.bibentries and inserts template-appropriate\citecommands - Copies figure assets into the output package and generates
\includegraphicswrappers - Preserves your paragraph structure, emphasis, and inline formatting exactly as written
What ComfyTex Intentionally Does Not Do
Being transparent about limitations is how we earn trust. Here is what the pipeline explicitly avoids:
- Does not rewrite your prose. Your words stay yours. No paraphrasing, no "improving" — structural conversion only.
- Does not verify citation accuracy. If a reference in your
.bibfile has incorrect author names or years, ComfyTex carries them through verbatim. - Does not guarantee float placement. LaTeX's float algorithm determines final figure/table positions at compile time. ComfyTex produces correct float code; final placement is a LaTeX compiler decision.
- Does not add or remove content. Every sentence in your Markdown appears in the output. Nothing is added, nothing is deleted.
- Does not format bibliographies. ComfyTex inserts
\nocite{*}so your reference list renders. You supply the.bibfile; the template's bibliography style handles formatting.
Published Research
The ComfyTex pipeline is described in detail in a peer-reviewed technical paper:
arXiv:2606.23107 — Describes the architecture, evaluation methodology, and design rationale behind the three-agent pipeline. Includes benchmark results against Pandoc and baseline LLM approaches.
Read the paperReferences & Further Reading
The most widely used online LaTeX editor. Reference for LaTeX commands, environments, and package usage.
The authoritative source for LaTeX packages and documentation. Every package ComfyTex uses is published here.
The international organisation behind TeX, LaTeX, and related typesetting technologies since 1980.
Google's official guide to making content discoverable — referenced throughout ComfyTex's own content strategy.