LaTeX tools
While TeXRA's agents focus primarily on substantive research—deriving theorems, verifying algebra, and formalizing arguments—managing LaTeX syntax and structure should remain effortless. Rather than relying on a language model to guess at formatting or diff boundaries, TeXRA delegates these tasks to proven command-line utilities for formatting, diffing, statistics, and figure extraction.
Overview
| What it does | Tool behind the scenes |
|---|---|
| Code formatting | latexindent or tex-fmt |
| Version comparison | latexdiff |
| Document statistics | texcount |
| Figure extraction | Built-in |
| TikZ compilation | Built-in |
| Bibliography resolution | Built-in |
| Symbolic math | wolframscript |
All are configured from Settings → Plugins () or Settings → LaTeX (), where each tool shows its status.
Settings → Plugins: ready tools show a green check (Ready); missing tools show a Needs setup badge with Install in Terminal / Install actions. On Settings → LaTeX → Dependencies, missing binaries show a Not found tag.
The same status is one command away in any terminal. texra doctor probes the same toolchain:
- PASSLaTeX latexmk:LaTeX build orchestration
- PASSLaTeX latexdiff:LaTeX diff generation
- WARNLaTeX latexindent:latexindent was not found on PATH.Install latexindent or a TeX distribution that provides it.
Formatting tools
TeXRA uses formatters to keep LaTeX code consistent and readable.
Supported formatters:
latexindent: the default formatter; highly configurabletex-fmt: a faster alternative with simpler configuration
Formatting does not run on its own after agent execution. The selected formatter runs when you invoke it, and after Download arXiv Source unpacks a project. In the VS Code extension, run it from the Command Palette (Ctrl+Shift+P) → TeXRA: Format Current LaTeX File, which formats the file in the active editor.
Configuration: Formatter selection and installation live on the LaTeX tab () of the TeXRA Settings. Read the LaTeX configuration settings for the full set.
Version comparison with latexdiff
latexdiff shows changes between two versions of a document, producing a PDF with additions and deletions marked. TeXRA can generate diffs automatically after an agent runs.
Usage:
- After an agent modifies your document, a diff PDF shows what changed.
- Use
latexdiff-vcto compare the current file against a git commit: pick the commit from the Commit dropdown.
Read the LaTeX Diff guide for the full workflow.
Document statistics with texcount
texcount reports word counts, heading counts, and math element counts so the model can reason about document scale and structure.
To attach these statistics to the prompt, toggle Attach TeX Count in the Tool Configuration dropdown. Read the agent execution settings. Agents with bash can also run texcount themselves through the shell, for example texcount -inc main.tex.
Modes:
separate(default): count each file independentlyinclude: follow\input{}/\include{}directives from the main filesum: aggregate totals across multiple top-level files
Requirement
texcount must be on your PATH. It ships with most TeX distributions. Check Settings → LaTeX () → Dependencies: the TeXcount row shows a Not found tag when it is missing (texcount is not listed on the Plugins page). Install it with your TeX package manager.
Figure extraction
TeXRA extracts figures from your LaTeX so vision-capable models can see them.
Standard figures
The extract_figures tool finds \includegraphics references and returns the images as attachments.
Auto-extraction: toggle Auto Extract → Figures in the main UI to include figures in every prompt automatically. Read the figures guide.
TikZ figures
The extract_tikz_figures tool discovers tikzpicture environments, compiles them to standalone PDFs, and returns the rendered output. It compiles with pdflatex and rasterizes with Ghostscript plus GraphicsMagick or ImageMagick. The Plugins page does not list these; Settings → LaTeX → Dependencies shows a TeX Distribution row (pdflatex/latexmk) and an Image Processing row (Ghostscript + GraphicsMagick/ImageMagick) with an install guide, and texra doctor reports them too:
TikZ extraction needs the compiler and both rasterising binaries present. Here Ghostscript is Not found; the Install guide link points at the setup steps for the missing dependency.
Read the TikZ figures guide for workflows and the installation guide for dependency setup.
Bibliography extraction
The extract_bib_entries tool resolves citation context for your LaTeX document:
- Finds
\bibliography{}and\addbibresource{}directives - Loads the referenced
.bibfiles - Returns BibTeX entries for every cited key
Useful whenever an agent needs exact citation records to edit, format, or validate references.
Symbolic math with Wolfram
Agents run Wolfram Language code through wolframscript in the shell (wolframscript -code '...' or wolframscript -file) to verify calculations or perform symbolic algebra. It is not LaTeX-specific, but it is useful for validating mathematical content in papers and derivations.
The Wolfram row sits under Settings → Plugins (). Requires a local Wolfram Engine install.
Configuring tool usage
Control how TeXRA uses these tools from the UI:
- Tool Config dropdown (): toggle the Attach TeX Count () per-run helper. Read the agent execution settings.
- Auto Extract dropdown (): toggle automatic extraction of Figures or TikZ Figures. Read the figures guide.
- Settings → Plugins (): switch plugins on or off, view install guides, and run installers.
Both per-run dropdowns live in the file-group headers, next to your input and media files:
The Tool Config menu ( on the Input header) toggles Attach TeX Count; the Auto Extract menu ( on the Media header) toggles Figures, TikZ Figures, and Compile Input PDF. Active helpers tint their buttons.
For detailed tool settings (formatter paths, TikZ processing options, etc.), read the configuration guide.
Next steps
- TikZ figures: advanced TikZ workflows
- LaTeX Diff: version comparison in detail
- Research tools: arXiv, Zotero, and web search
- Agent integrations: one-click setup for the Codex and Claude Code agents