Skip to content

Polish a draft

Once the results are in, polish rewrites a LaTeX draft for clarity. It keeps math, citations, and structure intact and outputs a reviewable diff.

What polish does

  • Reads your input .tex file (and any context files you attach).
  • Produces a revised draft that follows your instruction.
  • Runs a built-in critique pass that rereads its own output and revises it.

Polish is a workflow agent: it writes to disk and produces a diff. It does not chat, compile LaTeX, or verify citations.

When to use it

Use polish when the content is in place and the prose needs work.

  • Tighten loose paragraphs before submission.
  • Fix repetition, hedging, generic phrasing.
  • Improve flow between sentences and sections.

Do not use polish to add content, change math, or restructure sections. For those, use the Orchestrator or the research agent.

Run it from the CLI

sh
texra run polish \
  --input intro.tex \
  --instruction "Tighten prose. Preserve all math and citations."
texra run
$texra run polish --input intro.tex --instruction "Tighten prose. Preserve all math and citations."
  • r0: first revision
  • r1: critique-and-revise pass
executions/c4e19b07a52d/r1/intro.tex

Rounds stream as progress, then the path to the final revision prints on stdout. That printed path is the success signal.

Each round writes its output into the run's task storage, an executions/<run-id>/ folder under TeXRA's workspace storage directory, using the input filename as the document name:

executions/<run-id>/r0/intro.tex   # Round 0: first revision
executions/<run-id>/r1/intro.tex   # Round 1: critique-and-revise pass
executions/<run-id>/one folder per round
  • r0/intro.texfirst revision
  • r1/intro.texcritique pass · final

Both rounds reuse your input filename: r0/ holds the first revision, r1/ the critique-and-revise pass you usually keep.

To write the final revision next to your input instead:

sh
texra run polish --input intro.tex --output intro.polished.tex

Run it in VS Code

  1. Open intro.tex.
  2. Select the TeXRA icon in the Secondary Side Bar.
  3. In the Input section, select Add files and pick intro.tex from the file picker.
  4. Pick polish as the agent. Pick a model.
  5. Type the instruction. Select Run agent (the arrow button; Enter also runs it).
  6. When the run completes, open the diff from the ProgressBoard.

Same run, same history, same output files, whichever surface you used.

Reviewing the output

CLI: diff the rounds against your input:

sh
diff -u intro.tex executions/<run-id>/r0/intro.tex
diff -u executions/<run-id>/r0/intro.tex executions/<run-id>/r1/intro.tex

VS Code: the ProgressBoard shows side-by-side diffs and lets you accept the output back into the workspace.

draft.tex ↔ r0/draft.tex (Working Tree) — texra-sample
r0/draft.tex TeXRA
12\begin{abstract}
13We present an efficient method for the
14estimation of spectral gaps in random regular graphs.
15\end{abstract}
16
17\section{Preliminaries}
18Let $G$ be a $d$-regular graph.
draft.tex Previous draft
12\begin{abstract}
13We present a novel and efficient method for the
14estimation of spectral gaps in random regular graphs.
15\end{abstract}
16
17\section{Preliminaries}
18Let $G$ be a graph.

The ProgressBoard opens the polished round as a diff. Accept each change back into your draft.

For a compiled PDF comparison (additions in blue, deletions in red), use the LaTeXdiff feature in the TeXRA panel. Read the LaTeX Diff guide.

How the critique pass works

After Round 0 produces a revision, polish re-prompts itself to check for common failure modes:

Round 1 — critique passrereads r0/intro.tex, then revises
  • Weakened editsreverts changes that dulled the original argument
  • Missing mathrestores equations or symbols dropped in Round 0
  • Notation before definitionflags a symbol used before it is introduced
  • Generic fillercuts empty phrasingprovides crucial insights into…
  • Plain technical Englishrewrites added sentences that are not concrete, plain, and said once
  • Out-of-scope changeskeeps edits inside your instruction

Round 1 rereads its own Round 0 output and checks six failure modes before revising again: weakened or unnecessary edits, missing math, notation used before definition, generic filler, added sentences that do not read as plain technical English, and out-of-scope changes.

The result is written to r1/. Use Round 0 alone for fast iteration. Use Round 1 when the draft is close to final.

Limits

  • Operates on one revision per input file. For multi-file projects, list each file with --input or use the Orchestrator.
  • No tool access: polish cannot compile, search citations, or run code.
  • No new sections, equations, or references: polish only rewrites what is already there.

See also