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.
How the engine is chosen
Section titled “How the engine is chosen”Luzbase reads the beginning of your main file (its first 4,096 bytes) and picks the engine in this order:
- A magic comment naming the engine, such as
% !TEX program = xelatex. - A Unicode font package. If the file loads
fontspec,unicode-math,polyglossia,xltxtraorxunicodewith\usepackage, Luzbase uses XeLaTeX. - Otherwise pdfLaTeX.
When Luzbase picks XeLaTeX or LuaLaTeX this way, the Output panel shows a line such as [worker] engine auto-detected: xelatex.
Choose the engine with a magic comment
Section titled “Choose the engine with a magic comment”-
Open your main file.
-
Add this line at the very top:
% !TEX program = xelatex\documentclass{article} -
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).
Which engine to use
Section titled “Which engine to use”| 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.
TeX Live
Section titled “TeX Live”- 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
.styor.clsfile to your project. Luzbase finds.sty,.cls,.bstand.bibfiles anywhere in the project, including inside folders.
Bibliographies and indexes
Section titled “Bibliographies and indexes”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.
What is not supported
Section titled “What is not supported”- 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
\write18does 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
latexmkrcor.latexmkrccannot 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.