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.
Connected code: electron/compiler.ts, electron/latexDiagnostics.ts, src/features/compile/useCompile.ts
Pipeline
- Find
latexmkfrom standard TeX locations, including/Library/TeX/texbinon macOS. - Support
pdflatex,xelatex, andlualatexthrough engine-specificlatexmkflags. - 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
latexmkfailure 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.