LaTeX Paper Writing
Write academic papers conversationally with instant PDF compile — no local TeX install, no manual error spelunking, no editor-PDF context switch.
- Tools
execread_filewrite_file- Channels
desktop
Local LaTeX is a pain — gigabytes of TeX Live, cryptic compile errors, switching between editor and PDF viewer breaks flow. The agent handles the LaTeX layer: you describe the section you want, it generates the source, compiles, surfaces errors plainly, and shows you the PDF. You stay in chat (or your editor of choice).
What it does
- Generate LaTeX source from a description ("write a methodology section about X")
- Compile via pdflatex / xelatex / lualatex inside an isolated workspace
- Parse compile errors and surface them in plain English
- Apply iterative edits ("change the third paragraph to argue Y")
- Manage figures, citations, BibTeX
- Final output: a polished PDF + clean source tree ready to submit
What you'll need
- A LaTeX environment — either local TeX Live or a Docker image
(
texlive/texliveworks fine) - Exec tool for compilation
- A paper template to start from (Overleaf templates, university templates, or write your own)
Setup
1. Set the working directory convention
2. Initialise a paper
3. Write iteratively
"Add a methodology section. The paper is a survey of AI agent plugin architectures. Compare LangChain, Flowly, and OpenClaw on sandboxing, lifecycle hooks, and discovery."
The agent writes sections/methods.tex, compiles, surfaces any
warnings (undefined references, overfull boxes), and shows you the
output PDF path. You skim, ask for tweaks:
"Make the comparison a table instead of prose."
Section gets re-written, recompiled.
4. Citations
"Add a citation for the OpenClaw plugin paper. The reference is github.com/hesamsheikh/awesome-openclaw-usecases — fill in sensible BibTeX from the URL."
Agent fetches the page, generates BibTeX, appends to refs.bib.
"Cite that in the methodology section's first paragraph."
Adds \cite{...} in context.
5. Compile error handling
When pdflatex fails, the agent parses the error log, finds the
problematic line, and either fixes it (common cases: missing },
unbalanced $, undefined command) or asks you for guidance:
"Compile failed at line 42 of methods.tex:
- ! Undefined control sequence \citep{flowly2026}.*
- l.42 ...as introduced in \citep{flowly2026}*
That's a citation to a key not in refs.bib. Do you want me to add a placeholder or fetch the BibTeX?"
Tips
- Use
\input{sections/...}. Single-file LaTeX gets unmanageable past 5 pages. Modular sections compile faster too (PDFs of partial drafts). - Compile twice for refs. First pass writes
.aux, second pass resolves citations. The agent should know this. - Diff-friendly source. One sentence per line in your
.texsource — git diffs become readable, agent edits become surgical. - Don't fight the conventions. When submitting to a journal, use their template verbatim. Customising margins or fonts is the fastest path to desk rejection.
- Backup before big edits. A "rewrite the whole results section" prompt can lose work. Commit to git first.
- Image management. Keep figures in
figures/, reference with\includegraphics{figures/foo.pdf}. The agent should refuse to embed binary images inline. - Spell check stays manual. LaTeX hides typos in commands. Run
aspell -t main.texor your editor's spell-check before submitting.