Skip to content

LaTeX Tools

TeXRA doesn't just send text to an AI and hope for the best. It plugs into battle-tested LaTeX tools so formatting, diffing, figure extraction, and citation lookup are handled by the right software — not by a language model guessing at syntax.

Overview

What it doesTool behind the scenes
Code formattinglatexindent or tex-fmt
Version comparisonlatexdiff
Document statisticstexcount
Figure extractionBuilt-in
TikZ compilationBuilt-in
Bibliography resolutionBuilt-in
Symbolic mathwolfram

All are configured from Dashboard → Tools () or Dashboard → LaTeX (). Missing dependencies show Not Found; ready ones show Available.

Formatting Tools

TeXRA uses formatters to keep LaTeX code consistent and readable.

Supported formatters:

  • latexindent — the default formatter; highly configurable
  • tex-fmt — a faster alternative with simpler configuration

Formatting runs automatically after agent execution and is also available via the Command Palette (Ctrl+Shift+P) → TeXRA: Indent Current TeX (or Indent All LaTeX Files for the whole workspace).

Configuration: Formatter selection and installation live on the LaTeX tab () of the TeXRA Dashboard. See Configuration for the full set of settings.

Version Comparison with latexdiff

latexdiff visualises changes between two versions of a document, producing a PDF with additions and deletions clearly marked. TeXRA can generate diffs automatically after an agent runs.

Usage:

  • After an agent modifies your document, a diff PDF shows exactly what changed.
  • Use latexdiff-vc to compare the current file against a git commit — pick the commit from the Commit dropdown.

See the LaTeX Diff guide for the full workflow.

Document Statistics with texcount

texcount reports word counts, heading counts, and math element counts so the LLM can reason about document scale and structure.

Enabling texcount:

  1. For context: toggle Attach TeX Count in the Tool Configuration dropdown — see Configuration.
  2. As a tool: tool-use agents can invoke texcount directly to analyse files on demand.

Modes:

  • separate (default) — count each file independently
  • include — follow \input{} / \include{} directives from the main file
  • sum — aggregate totals across multiple top-level files

Requirement

texcount must be on your PATH. It ships with most TeX distributions. Check Dashboard → Tools () → LaTeX — if the card shows Not Found, 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. See Working with Figures.

TikZ Figures

The extract_tikz_figures tool discovers tikzpicture environments, compiles them to standalone PDFs, and returns the rendered output.

Requirements (all checked on Dashboard → Tools):

  • latexmk (preferred) or pdflatex
  • GraphicsMagick or ImageMagick for conversion
  • Ghostscript for PDF processing

See 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:

  1. Finds \bibliography{} and \addbibresource{} directives
  2. Loads the referenced .bib files
  3. 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

The wolfram tool executes Wolfram Language code through wolframscript, letting agents verify calculations or perform symbolic algebra. While not LaTeX-specific, it's invaluable for validating mathematical content in papers and derivations.

The Wolfram card sits under Dashboard → Tools → Computation (). Requires a local Wolfram Engine install.

Configuring Tool Usage

Control how TeXRA uses these tools from the UI:

  • Tool Config Dropdown (): enable per-run helpers like Attach TeX Count () or Attach Diagnostics (). See Configuration.
  • Auto Extract Dropdown (): toggle automatic extraction of Figures or TikZ Figures. See Working with Figures.
  • Dashboard → Tools (): enable/disable whole tool groups, view install guides, and run one-click installers.

For detailed tool settings (formatter paths, TikZ processing options, etc.), see the Configuration guide.

Next Steps