LinuxCommandLibrary

lualatex

Compile LaTeX documents using LuaTeX engine

TLDR

Start texlua to act as a Lua interpreter

$ lualatex
copy

Compile a Tex file to PDF
$ lualatex [path/to/file.tex]
copy

Compile a Tex file without error interruption
$ lualatex -interaction nonstopmode [path/to/file.tex]
copy

Compile a Tex file with a specific output file name
$ lualatex -jobname=[filename] [path/to/file.tex]
copy

SYNOPSIS

lualatex [options] filename.tex

PARAMETERS

-draftmode
    Run in draft mode (suppresses output to paper)

-file-line-error
    Display errors in file:line:error format

-halt-on-error
    Exit immediately if an error is encountered

-interaction=mode
    Sets the interaction mode (batchmode, nonstopmode, scrollmode, errorstopmode)

-jobname=string
    Sets the jobname (base name for output files)

-kpathsea-debug=number
    Sets Kpathsea debugging flags

-output-directory=directory
    Specifies the output directory

-recorder
    Enables file dependency recording

-shell-escape
    Enables shell escape (allows execution of external commands)

-no-shell-escape
    Disables shell escape (prevents execution of external commands)

-version
    Displays the lualatex version

DESCRIPTION

lualatex is a TeX typesetting engine that uses Lua as an embedded scripting language. This allows for direct access to TeX's internals and provides powerful scripting capabilities within LaTeX documents. Unlike traditional TeX engines (like pdfTeX), lualatex allows you to manipulate almost any aspect of the typesetting process using Lua code.

This opens up possibilities for advanced customization, such as creating custom document classes and packages, manipulating fonts, performing complex calculations, and even generating dynamic content based on external data. lualatex compiles LaTeX documents in much the same way as other engines, by reading .tex files, processing the markup, and generating output, most commonly a PDF.

Lualatex is actively developed and is often used for documents needing advanced scripting capabilities. Lualatex is a stable and robust LaTeX engine for most projects.

CAVEATS

Using `-shell-escape` can pose security risks if the LaTeX document is from an untrusted source, as it allows arbitrary commands to be executed on the system.

LUA INTEGRATION

Lua code can be embedded directly within LaTeX documents using the `\luaexec` command or within custom LaTeX environments. This allows for tight integration of scripting logic with the typesetting process. Libraries like luatexbase provide extensive functionality for interacting with TeX internals.

FONT MANAGEMENT

Lualatex offers superior font management capabilities, especially for OpenType fonts, allowing access to advanced font features and glyph variations. This enables more sophisticated typography and improved rendering of complex scripts.

HISTORY

lualatex was developed as a successor to pdfTeX, aiming to provide a modern, extensible typesetting engine. It integrates LuaJIT, a high-performance just-in-time compiler for Lua, offering significant performance improvements compared to earlier scripting solutions within TeX. Development started in the mid-2000s, and it has gradually gained popularity as a robust choice, particularly for complex documents.

The motivation was to have better support for Unicode, OpenType fonts, and advanced scripting capabilities without relying on external programs or complicated workarounds. Its usage has increased in academic and publishing circles where these features are essential.

SEE ALSO

pdflatex(1), xelatex(1), tex(1)

Copied to clipboard