LaTeX tools
Rather than asking a language model to format LaTeX source, count words, or compute diffs by hand, TeXRA delegates those tasks to dedicated command-line utilities (latexindent, tex-fmt, latexdiff, texcount) and built-in extractors.
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 |
| Symbolic math | wolframscript |
All are configured from Settings → Plugins () or Settings → LaTeX (), where each tool shows its status.
Settings → LaTeX → Dependencies: a detected tool shows a green check; a missing one shows a Not found tag and a Setup guide. On Settings → Plugins, a plugin that is ready reads Ready and one that is not reads Needs setup, with an Install in terminal or Open install page action where it has one.
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: sudo apt-get install -y texlive-extra-utils (requires Perl).
Formatting tools
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 produces a compiled PDF comparing two versions of a .tex document, with additions underlined in blue and deletions struck through in red. TeXRA shows one as the preview of a .tex edit awaiting your approval, and the assistant runs it in the shell when you ask for a diff against another file or a Git commit. Read the LaTeX Diff guide for both.
Document statistics with texcount
texcount reports word counts, heading counts, and math element counts so the model can reason about document scale and structure.
A program adds these statistics to its prompt when an agent starts it with args: { attachTeXCount: true }. Agents with bash can also run texcount themselves through the shell, for example texcount -inc main.tex.
attachTeXCount counts each input file on its own. In the VS Code extension, TeXRA: Count Words in Current TeX File counts the active file and asks how:
- Count main file only: count the file on its own
- Follow \input/\include and combine: follow
\input{}/\include{}directives from the main file and combine the counts
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
A program attaches the images its input files include with \includegraphics when an agent starts it with args: { autoExtractFigure: true }. In a chat, an agent opens a figure file with read_file, which returns it as an attachment. Read the figures guide.
TikZ figures
A program started with args: { autoExtractTikzFigure: true } finds the tikzpicture environments of its input files, compiles each to a standalone PDF, and attaches 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), each with a setup guide when it is missing. texra doctor reports the compiler rows (latexmk, pdflatex) but not the image tools:
TikZ extraction needs the compiler and, for rasterizing, Ghostscript with GraphicsMagick or ImageMagick. Here Image Processing is Not found; its Setup guide holds the install steps.
Read the TikZ figures guide for workflows and the installation guide for dependency setup.
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.
For formatter paths, TikZ templates, and compile settings, 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