Compiler
What we did in the compiler to make it work.
The compiler is implemented as an Electron-side service around
the user's local TeX installation. It runs latexmk,
writes output into an isolated .latexdo/build/job-*
folder, captures the log, and turns compiler output into
structured diagnostics for 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 one compile result with PDF path, duration, raw output, diagnostics, and failure reason.
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.