Skip to content
Get started

Compilers and TeX Live

Luzbase compiles with TeX Live and supports three engines: pdfLaTeX, XeLaTeX and LuaLaTeX. There is no engine menu. Luzbase reads the engine from your main file, so the setting travels with your document.

Luzbase reads the beginning of your main file (its first 4,096 bytes) and picks the engine in this order:

  1. A magic comment naming the engine, such as % !TEX program = xelatex.
  2. A Unicode font package. If the file loads fontspec, unicode-math, polyglossia, xltxtra or xunicode with \usepackage, Luzbase uses XeLaTeX.
  3. Otherwise pdfLaTeX.

When Luzbase picks XeLaTeX or LuaLaTeX this way, the Output panel shows a line such as [worker] engine auto-detected: xelatex.

  1. Open your main file.

  2. Add this line at the very top:

    % !TEX program = xelatex
    \documentclass{article}
  3. Compile.

The comment accepts exactly pdflatex, xelatex or lualatex. It must sit alone on its own line, and it is not case-sensitive (% !TeX program = LuaLaTeX works too).

Engine Use it when
pdfLaTeX Most papers and theses written with standard LaTeX fonts. It is the default.
XeLaTeX You use system or OpenType fonts through fontspec, or many non-Latin scripts.
LuaLaTeX A package or template asks for it, or you need LuaTeX features.

If pdfLaTeX stops on a character it cannot typeset, the error hint suggests switching to XeLaTeX with the magic comment.

  • Every project compiles with the same recent TeX Live distribution. You cannot choose a TeX Live year.
  • Packages come from TeX Live only. Compiles have no internet access, so missing packages cannot be downloaded during a compile.
  • To use a package or class that is not in TeX Live, upload its .sty or .cls file to your project. Luzbase finds .sty, .cls, .bst and .bib files anywhere in the project, including inside folders.

Luzbase runs LaTeX with latexmk, which runs the other tools as often as needed:

Tool Support
BibTeX (\bibliography) Runs automatically, using bibtexu, the Unicode version of BibTeX, so accented author names work. Warnings in your .bib do not fail the compile.
biblatex with biber (\addbibresource) Runs automatically.
makeindex (\makeindex, \printindex) Runs automatically.

Errors in a .bib file appear in the Output panel with the file name and line. See Bibliographies.

  • Full shell escape. Only TeX Live’s restricted list of safe tools can run (such as the EPS-to-PDF converter). Anything else that needs \write18 does not run.
  • Packages that call external programs, such as the classic minted (it needs Pygments), PythonTeX, SageTeX, Asymptote, gnuplot through shell escape, and knitr or Sweave (.Rnw).
  • A latexmk configuration file. Files named latexmkrc or .latexmkrc cannot be added to a project. If one is present, the compile stops with “the project contains a latexmk configuration file (latexmkrc), which is not allowed; remove it and compile again”.
  • Custom compiler flags. Luzbase always runs LaTeX in non-stop mode and stops at the first error.
  • Uploading fonts. Font files (.ttf, .otf) cannot be uploaded. With XeLaTeX or LuaLaTeX you can use the fonts that ship with TeX Live.
  • A folder named out/ at the top of the project. Luzbase uses it for compile output, so files in it are left out of compiles.