openleaf

Engines

The engine is the program that turns your .tex files into a PDF. OpenLeaf does not ship one: it detects what you have installed and drives it.

Change engine in Settings → Build, by clicking the engine name in the status bar, or with ⌘K → “Change the LaTeX engine”. The choice is saved per project.

Installing one

brew install texlive                      # macOS: latexmk, pdfTeX, XeTeX, LuaTeX
sudo apt install texlive-full latexmk     # Debian, Ubuntu
brew install tectonic                     # a single self-contained binary

TeX Live is around 4 GB because it includes every package on CTAN. Tectonic is a few tens of megabytes and downloads packages the first time a document needs one, which is a reasonable trade if disk space matters more than build speed.

On Windows, MiKTeX works and installs packages on demand like Tectonic does.

What OpenLeaf detects

id Label Needs
latexmk latexmk + pdfTeX latexmk, pdflatex
latexmk-xelatex latexmk + XeTeX latexmk, xelatex
latexmk-lualatex latexmk + LuaTeX latexmk, lualatex
pdflatex pdfTeX, single pass pdflatex
tectonic Tectonic tectonic

Detection runs once per server start, by asking each binary for its version. If you install an engine while OpenLeaf is running, restart it.

Speed

Measured on an M-series Mac with the starter article, in steady state:

Engine No-change rebuild After a text edit
latexmk + pdfTeX 0.09s 0.72s
pdfTeX alone   0.90s
latexmk + XeTeX   1.4s
latexmk + LuaTeX   1.6s
Tectonic   3.3s

The gap between the top and bottom rows is around 4.6x on a normal edit, and up to 36x when nothing changed. On a document you rebuild every few seconds, that is the difference between a preview that keeps up and one you wait for.

Why latexmk wins

latexmk reads the .fls dependency list that pdfTeX emits, which records every file the last build actually touched. So it can tell:

Tectonic keeps no such database. It cannot know whether a rerun is needed, so it always runs TeX twice plus BibTeX. That is the safe choice for a batch tool and the wrong one for a live preview.

pdflatex alone has no rerun logic at all, so OpenLeaf supplies it: it inspects your source and the previous log to decide whether a second pass and a bibliography run are needed, and skips them when they are not. That makes it faster than Tectonic but still slower than latexmk, because it is guessing from heuristics rather than reading a dependency list.

Which to choose

latexmk + pdfTeX unless you have a reason. It is the default when installed.

latexmk + XeTeX if your document uses fontspec or system fonts, or contains substantial non-Latin text. XeTeX is Unicode-native.

latexmk + LuaTeX if you need Lua scripting, or a package that requires it. Functionally similar to XeTeX for fonts, slightly slower.

pdfTeX alone if latexmk is not installed and you do not want to install it.

Tectonic if you would rather not install a TeX distribution, or you are on a machine where you cannot. It is genuinely convenient: one binary, and a missing package resolves itself. Just expect each rebuild to take a few seconds.

Bibliography tools

OpenLeaf works out which one your document needs from its source:

Your document has It runs
\bibliography or \bibliographystyle bibtex
\addbibresource, \printbibliography, or biblatex biber
neither nothing

latexmk handles this itself. For single-pass engines, OpenLeaf runs the tool, but only when the .aux file shows the document actually cites something, because BibTeX errors out on an empty citation list and that error would appear on every build of a document that has a .bib but no \cite yet.

Timeouts

A compile is killed after 120 seconds, and a bibliography run after 60. A document legitimately taking longer than that is unusual; if yours does, it is almost always a TikZ figure that would be better precompiled to a PDF and included with \includegraphics.

Reading a failure

When a build fails, the Problems pane names the file that caused it rather than the root document, adds a plain-language explanation where it recognises the error, and links to the line. Problems → the log button shows the engine’s raw output for anything the parser did not make sense of.

The attribution matters more than it sounds. TeX reports errors against whatever file it was reading, and a multi-file project spends most of its time inside \input files, so an unattributed error tells you a line number in a file you have to guess at.