Skip to content

First run

You have TeXRA installed. This page walks you through running one agent, polish, on a real .tex file. It takes about five minutes and covers the extension and the CLI side by side.

If you don't have TeXRA yet, read the installation guide.

Fresh install?

On a fresh install, the setup assistant offers to run this flow conversationally: it checks your environment, asks what you're working on, and runs the same polish demo, ending at the diff. Start it any time with TeXRA: Run Setup Assistant from the Command Palette in VS Code, or texra setup in the terminal. This page is the manual mirror of that conversation.

Step 0: add a key or connect a subscription

A credential is the one step no agent can do for you. Three ways in:

  • Use your own provider API key: Anthropic, OpenAI, Google, and more. Read Quick start: add a key or connect a subscription.
  • Use a ChatGPT subscription: Codex models through your ChatGPT plan. In VS Code, open Settings → Subscriptions and use the ChatGPT sign-in section; in the terminal, run texra auth chatgpt login. Grok, Kimi Code, and the GLM Coding Plan connect from the same place.
  • Use GitHub Copilot in VS Code: compatible models through your Copilot subscription. Open Settings → Subscriptions → Copilot in VS Code and grant access in the native VS Code prompt. No provider API key is needed. This source is unavailable in the terminal and desktop applications.

What you'll do

  1. Get a sample .tex file.
  2. Run the polish agent with one instruction.
  3. Read the diff.

Get a sample file

If you already have a draft you want to polish, skip this step. Otherwise:

In VS Code

Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run TeXRA: Create Sample Project. This creates a ready-to-run workspace at texra-sample/draft.tex.

In the terminal

Any .tex file works. If you want a quick test file:

sh
cat > draft.tex <<'EOF'
\documentclass{article}
\begin{document}
The proposed method achieves significant improvements over the baseline,
which is something that is very important for the field, and we will
demonstrate this in the following sections through various experiments.
\end{document}
EOF

Run polish

In VS Code

  1. Open draft.tex.
  2. Select the TeXRA icon in the Secondary Side Bar.
  3. In the Input section, select Add files and pick draft.tex from the file picker.
  4. Pick polish under Agent. Pick sonnet5T under Model (or any available model).
  5. Type an instruction:

    Tighten the prose. Preserve all math and citations.

  6. Press Execute.

The ProgressBoard opens and streams the run. When it finishes, a diff icon appears on the completed stream. Select it to see what changed.

In the terminal

sh
texra run polish \
  --input draft.tex \
  --instruction "Tighten the prose. Preserve all math and citations."
texra run
$texra run polish --input draft.tex --instruction "Tighten the prose. Preserve all math and citations."
  • Round 0: draft · r0/draft.tex written
  • Round 1: critique, rereading its own output

Mid-run: Round 0 has written the first revision and Round 1 is critiquing and revising it. The live status line on stderr tracks the current round. When the run completes, the path to the final document prints on stdout.

The run streams reasoning, tool calls, and the assembled output. When it completes, polish has written one folder per round in the run's storage folder (executions/<run-id>/ under TeXRA's workspace storage):

executions/one folder per round · input filename preserved
<run-id>/
r0/first revision
  • draft.texreads draft.tex, applies your instruction
r1/critique pass · final
  • draft.texrereads r0, revises again
draft.polished.tex--outputwritten next to your input instead

Each round lands in its own folder and keeps the input filename: r0/draft.tex is the first revision, r1/draft.tex the critique pass and final. Add --output draft.polished.tex to write the result next to your input instead.

To diff against your original, use the final-document path printed on stdout:

sh
diff -u draft.tex <path-to-r1/draft.tex-from-stdout>

What just happened

Polish ran two passes: a first revision, then a critique pass that rereads its own output and revises again.

1Round 0: draft

Reads draft.tex, applies your instruction, writes the first revision.

r0/draft.tex
2Round 1: critique

Rereads its own Round 0 output, then revises again.

missing mathweakened sentencesgeneric fillerout-of-scope editsr1/draft.tex

Polish is a two-pass workflow: Round 0 drafts from your instruction, Round 1 critiques its own output against a fixed checklist and revises into r1/draft.tex.

Workflow agents like polish do not call tools. They read input, run their pipeline, and write a diff. The next step up, tool-use agents, can read across your project, search literature, compile LaTeX, and verify their work. Read the built-in agents catalog.

Next steps

  • Polish a draft: the workflow in depth: rounds, limits, multi-file projects
  • Built-in agents: the full catalog, including correct, research, review, and lean
  • Models: choosing a model that matches the work
  • TeXRA CLI: sign-in, workspace defaults, headless output formats
  • LaTeX Diff: compiled PDF comparison of revisions