LatexDo Research

Compiler systems

Compiler

How LatexDo runs local TeX compilation, captures build output, and turns LaTeX errors into structured editor diagnostics.

Compiler systems

Local compilation that returns useful diagnostics.

LatexDo wraps the user's local TeX installation with an Electron-side compile service. It runs latexmk in isolated job folders, captures the log, and returns one structured result to the editor.

Pipeline

  • Find latexmk from standard TeX locations, including /Library/TeX/texbin on macOS.
  • Support pdflatex, xelatex, and lualatex through engine-specific latexmk flags.
  • Run with -synctex=1, -file-line-error, -interaction=nonstopmode, and -halt-on-error.
  • Return PDF path, duration, raw output, diagnostics, and failure reason in one result.

Diagnostics

  • Parse file-line errors, LaTeX warnings, package warnings, class warnings, and overfull or underfull boxes.
  • Detect low-information failures like emergency stops and surface the real earlier compiler problem.
  • Enrich diagnostics with source context, confidence, highlight text, suggested fixes, and cascade ranking.
  • Sanitize stale latexmk failure output so old failed runs do not confuse the user.

Runtime Controls

Compile jobs are cancellable and have a timeout. On cancellation or timeout the app terminates the process group, waits briefly, then force-kills if needed. Shared cloud projects are materialized into a bounded scratch folder before local compile, with file count and size limits.