☰ ← Back to portfolio 🧩 ← Back to Fragments
KIT No. LLX-2026 · FILED UNDER: TEACHING NOTES

A Modern LuaLaTeX Kit for Computational Linguistics

Six files. One narrative tutorial. Written in 2026 for a student who just inherited a decade of stale advice from the internet.

Most LuaLaTeX material online was written between 2010 and 2015. Package names drift, defaults change, and a newcomer following those tutorials will spend the first evening fighting inputenc errors instead of writing linguistics. This kit is a small, opinionated starting point for anyone — in particular, students of computational linguistics working with Romance languages (French, Spanish, Italian, Portuguese, Romanian) and IPA.

Everything here assumes a current TeX Live installation and LuaLaTeX as the engine. The six source files below mirror six jobs: understand the engine, keep a reference, start a document, and borrow from three worked examples (Romance languages, corpus statistics, Praat alignment).

LuaLaTeX Students Edition 2026
LuaLaTeX Students Edition 2026
🚀 Iliya Radulov
Target OS — Ubuntu / Linux. Compiles equally on macOS & Windows TeX Live.
Repository: github.com/iliya-radulov/lualatex_kit
License: MIT  ·  Credits: motivated by M. Pégourié-Gonnard's A Guide to LuaLaTeX (2010). See CREDITS.md.
ITEM I
READ FIRST
File I

modern-lualatex-guide.tex

Narrative tutorial English Read this first
What it is

Why LuaLaTeX in the first place; what to use instead of the old pdfLaTeX packages (fontspec replaces fontenc, polyglossia replaces babel, tipauni replaces tipa); how to build a safe modern preamble; two-pass compilation; font-cache troubleshooting on Linux and macOS. Also lists learning resources that are actually current.

ITEM II
REFERENCE
File II

cl-cheatsheet.tex

Short reference English Keep printed next to the keyboard
What it is

A compact cheat-sheet covering the symbols a comp-ling student actually needs week to week: common math & statistics notation, IPA via tipauni, interlinear glosses via gb4e, syntax trees via forest, multilingual snippets via polyglossia. Each section is short enough to scan while debugging.

ITEM III
START HERE
File III

cs-starter.tex

Blank-ish template English Copy, rename, start writing
What it is

A minimal, heavily commented starter document — safe 2026 preamble plus one example of each major building block (formula, gloss, IPA, tree, multilingual text). The bibliography block is commented out so it compiles the first time, with no missing .bib errors. Rename it and begin.

ITEM IV
EXAMPLES
File IV

romance-comp-ling.tex

Worked example Multilingual: FR · ES · IT · PT · RO Open when you need to see a feature
What it is

A worked example that leans into Romance-language quirks: direct Unicode for é, ñ, ã, ș; IPA for French pain, Portuguese são, Spanish perro; interlinear glosses for French and Spanish; a forest phrase-structure tree; a dependency-parsing table styled for NLP output; and a short listings snippet calling spaCy on Spanish text. Useful as a reference when a feature works in theory but you want to see the LaTeX for it.

ITEM V
STATISTICS
File V

corpus-stats.tex

Worked example English Quantitative / corpus linguistics
What it is

Publication-ready statistical output in pure LaTeX. Decimal-aligned tables with siunitx, properly italicized p-values, scientific notation; a vector-based Zipf's-law plot with pgfplots; and a short note on reading data from a CSV with pgfplotstable. No Python screenshots in your thesis.

ITEM VI
PHONETICS
File VI

praat-pipeline.tex

Worked example English Phonetics / acoustic analysis
What it is

The modern phonetician's publishing pipeline: export a spectrogram from Praat as a PDF, embed it with graphicx, and draw phoneme, word, and gloss tiers over it with TikZ. Includes a reusable \phonbox macro and the time-to-coordinate scaling formula so your TikZ boxes line up with the acoustic events in the image.

Ubuntu Setup — the easy way

01Install TeX Live

The focused install below covers 99 % of linguistics needs and is kinder to your disk than the full distribution:

sudo apt update
sudo apt install texlive-latex-recommended texlive-latex-extra \
                 texlive-lang-european texlive-fonts-extra \
                 texlive-science texlive-luatex latexmk

If you would rather not worry about missing packages ever, install the full distribution instead (5–8 GB):

sudo apt install texlive-full
02Verify your first compile

From the folder containing the kit's files:

latexmk -lualatex cs-starter.tex

A successful run ends with a line like Latexmk: All targets (cs-starter.pdf) are up-to-date and leaves a cs-starter.pdf next to the .tex file. If you cloned the repo, the included .latexmkrc means you can even drop the -lualatex flag — just latexmk cs-starter.tex works.

03Install an editor (optional)
sudo apt install texstudio

Then open Options → Configure TeXstudio → Build and change the default compiler to LuaLaTeX.

04Add linguistic fonts

For IPA and Romance special characters, Charis SIL and Doulos SIL are excellent and free. Download the .ttf files, then:

mkdir -p ~/.local/share/fonts
cp *.ttf ~/.local/share/fonts/
fc-cache -fv

LuaLaTeX will find them the next time you compile. On macOS the equivalent one-off command is luaotfload-tool --update (without sudo). Then uncomment this line in any template:

\setmainfont{Charis SIL}

Tested With

Last verified 2026-11-01 on:

TeX Live 2026
LuaLaTeX 1.18.x
latexmk 4.85x
Ubuntu 24.04 LTS  /  macOS Tahoe 26.6.2
Editor: TeXstudio 6.0.2 (Linux)  /  Texmaker 6.0.2 (macOS)

Substantially older or newer versions will almost certainly still work; the exact wording of error messages may differ from the troubleshooting table in modern-lualatex-guide.tex.

Known Gotchas

gb4e crashes on sub/superscripts Always put \noautomath immediately after \usepackage{gb4e}. Without it, any example containing a subscript or superscript will crash with a parameter-stack error. This is the #1 reason linguistics students give up on LaTeX. Every template in this repo already does it.
Two compilation passes — automate them LuaLaTeX often needs two runs to resolve the table of contents and cross-references, and with a bibliography the full dance is LuaLaTeX → Biber → LuaLaTeX → LuaLaTeX. Don't click compile four times. From the project folder: latexmk -lualatex -pdf your-document.tex handles the whole sequence and stops when nothing changes. It ships with every modern TeX Live.
Do not copy preambles from pre-2015 tutorials They will tell you to load inputenc, fontenc, textcomp and tipa. Under LuaLaTeX these are at best unneeded and at worst broken. Use fontspec, polyglossia and tipauni instead.

A Note on Lua — Why We Use Python Instead

LuaLaTeX embeds the Lua programming language, and you can write loops, read CSV files, and compute directly inside your .tex source with \directlua. However, as a computational linguist, your real data processing almost certainly belongs in Python or R — not inside the typesetting engine. One tiny example is included below so you understand the bridge exists; this kit deliberately does not teach Lua programming.

\directlua{
  local words = {"chat", "chien", "maison"}
  tex.sprint("Corpus contains " .. #words .. " items.")
}

When compiled, this prints "Corpus contains 3 items." in the body of the PDF. For anything substantial, process your data in Python or R, write the result to a .csv or .tex fragment, and let LaTeX \input that file — a cleaner division of labour than embedding complex logic in your document, and it keeps your analysis reproducible with the tools your discipline already uses.

This kit was motivated by Manuel Pégourié-Gonnard's A Guide to LuaLaTeX (2010), one of the earliest practical introductions to LuaLaTeX for newcomers. The 2026 landscape is very different — many of the packages he described are no longer current — but the effort behind the original guide deserves acknowledgement. See CREDITS.md.

Feedback and suggestions are welcome via the repo's issue tracker.

— MIT licensed · 2026 —