LaTeX II: Thesis Workflows, Bibliography, and Advanced Tools

Multi-file Projects, Zotero, Quarto, and TikZ

17 June 2026

Overview

Building on Session 1, this session covers:

  • Longer documents — multi-file project structure for theses and dissertations
  • Bibliography management.bib files, biblatex, and citation commands
  • Zotero + BetterBibTeX — reference management with continuous auto-export
  • Quarto — literate programming combining R/Python code with LaTeX output
  • TikZ — programmatic figures and diagrams written directly in LaTeX
  • Templates — journal submission files and university thesis templates
  • Debugging — reading error messages and fixing common problems

Tip

Prerequisites: familiarity with LaTeX document structure, basic commands, and environments from Session 1.

Session 1 Recap

Concept Key points
Document structure Preamble + body; \documentclass, \usepackage
Commands \command[opt]{arg} — backslash notation
Environments \begin{name}\end{name} blocks
Text formatting \textbf, \textit, \section, \itemize
Math $...$ inline; \[...\] display; equation for numbered
Figures and tables figure and table float environments with \label/\ref
Distributions TeX Live (recommended); MiKTeX; TinyTeX
Editors Overleaf, Prism, TeXlyre, TeXstudio, VS Code

Document Classes for Longer Works

For documents longer than a typical journal article, choose the right \documentclass:

Class Use for Key structure commands
article Papers, short reports \section, \subsection
report Bachelor/master theses, technical reports \chapter, \section
book PhD theses, monographs \part, \chapter, \section
beamer Presentations \frame, \begin{block}

Most universities provide a custom class (e.g. unikoeln-thesis) that presets all formatting.

Useful preamble options for longer documents:

\documentclass[12pt, a4paper, twoside, openright]{report}
\usepackage{hyperref}     % clickable cross-references and PDF metadata
\usepackage{cleveref}     % smart refs: \cref{fig:x} → "Figure 1"
\usepackage{microtype}    % improved line breaking and spacing
\usepackage{setspace}     % line spacing (\onehalfspacing, \doublespacing)

hyperref · cleveref · microtype · setspace

Multi-file Projects: \input and \include

For long documents, split your .tex source into multiple files.

\input{filename} — inline inclusion:

% main.tex
\documentclass{report}
\begin{document}
\input{chapters/introduction}
\input{chapters/methods}
\input{chapters/results}
\end{document}
  • Inserts the file content directly — equivalent to copy-pasting
  • Can be nested; no page break is forced

\include{filename} — chapter inclusion with page break:

\include{chapters/introduction}  % forces a new page before and after
  • Supports \includeonly{chapter1,chapter3} to compile only selected chapters — faster iteration on large documents

Note

Use \input for small fragments (preamble settings, custom commands). Use \include for major structural divisions like chapters.

LaTeX Engines

A LaTeX engine is the program that reads your .tex file and produces output. Several exist — choose based on your font and language needs:

Engine (since) Output Unicode System fonts When to use
pdflatex (1997) PDF directly Partial (Latin extended) No — TeX fonts only Most journal templates; fastest compile; widest compatibility
xelatex (2004) PDF via XDV Full UTF-8 Yes — any installed font Non-Latin scripts; custom OpenType/TrueType fonts; multilingual documents
lualatex (2007) PDF directly Full UTF-8 Yes — via fontspec Same as XeLaTeX + Lua scripting for advanced customisation; slower compile
latex + dvipdf (1985) DVI → PDF No No Legacy workflows; rarely needed today

Browser-based engines (no installation):

Engine How it works Use case
SwiftLaTeX (2019) Compiles entirely in the browser via WebAssembly; no server round-trip Offline-capable web apps; embedding LaTeX in tools
BusyTeX (2022) TeX Live compiled to WASM; runs pdflatex/xelatex client-side Self-contained browser editors; privacy-sensitive workflows

Tip

For new documents: use pdflatex if the journal template requires it, otherwise lualatex for the most modern and flexible setup. Overleaf, Prism, and TeXlyre all support switching engines in project settings.

Bibliography: How It Works

LaTeX separates the bibliography database (a .bib file) from the formatting style (applied at compile time).

Why multiple compilation passes?

Each pass does something different:

pdflatex main.tex   → compiles document; writes citation keys to main.aux
biber main          → reads main.aux; looks up keys in main.bib;
                      writes formatted bibliography to main.bbl
pdflatex main.tex   → reads main.bbl; inserts bibliography into PDF
pdflatex main.tex   → resolves all cross-references (page numbers, labels)

Skipping passes is the most common reason references show as [?] or the bibliography is missing entirely.

The bibliography system has two independent layers:

  • Backend — an external program invoked between LaTeX passes (e.g. biber or bibtex on the command line); reads the .bib database, resolves citation keys, and writes the formatted .bbl file that LaTeX then reads back in
  • Style package — a LaTeX package declared in the preamble (the part of your .tex file before \begin{document}); defines the \cite commands available in your document and controls how the bibliography list is formatted when printed

The backend and the style package must be chosen as a matched pair — they communicate via the .aux and .bbl files and expect a compatible format.

Bibliography: Choosing Packages

Backend (since) Style package (since) When to use
biber (2011) biblatex (2006) New projects and theses — full Unicode; per-entry-type formatting; advanced sorting and filtering; large choice of maintained styles (APA, Chicago, linguistics-specific)
BibTeX (1985) natbib (1993) Publisher-mandated — ACL, IEEE, Elsevier, Springer templates ship .bst files that require BibTeX; ASCII cite keys only; less flexible but universally supported
BibTeX (1985) biblatex (2006) Compatibility fallback — set backend=bibtex in the preamble when biber is unavailable (e.g. restricted servers or CI); keeps biblatex syntax but loses Unicode sorting and some advanced features
BibTeX (1985) apacite (1994) Avoid for new work — implements APA 6th edition only (2009); unmaintained since ~2013; still found in older humanities templates but superseded by biblatex-apa

Preamble examples — the style package is where you declare the pairing:

% Option 1: biblatex + biber + APA 7th (recommended for linguistics / social science)
% biblatex-apa requires babel (or polyglossia) and csquotes for correct
% localisation of quotes and date formats — load them BEFORE biblatex
\usepackage[american]{babel}
\usepackage{csquotes}                          % language-aware quotation marks
\usepackage[backend=biber, style=apa]{biblatex} % style=apa loads biblatex-apa
\addbibresource{references.bib}

% Option 1b: same but with polyglossia (XeLaTeX/LuaLaTeX)
\usepackage{polyglossia}
\setdefaultlanguage[variant=american]{english}
\usepackage{csquotes}
\usepackage[backend=biber, style=apa]{biblatex}
\addbibresource{references.bib}

% Option 2: natbib + BibTeX (journal template compatibility)
\usepackage[round, authoryear]{natbib}
% no \addbibresource — use \bibliography{references} at end of document

% Option 3: biblatex + BibTeX fallback (biber unavailable)
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[backend=bibtex, style=apa]{biblatex}
\addbibresource{references.bib}

% Option 4: apacite — AVOID (APA 6th only, unmaintained since ~2013)
\usepackage{apacite}
% no \addbibresource — use \bibliography{references} at end of document

Tip

csquotes is required by biblatex-apa for correct localisation of block quotes, in-text quotation marks, and date formatting. Without it you may get warnings or incorrect output. babel / polyglossia sets the language so that biblatex applies the right hyphenation, month names, and punctuation rules.

Note

The backend= option inside \usepackage[...]{biblatex} tells biblatex which external program to expect. If this does not match the program your editor actually runs, you get missing-reference errors. Check your editor’s build settings if references show as [?].

APA Manuscript Layout

Citation style (biblatex-apa) and document layout are separate concerns. APA journals require specific formatting — double-spacing, running head, author note, abstract — that goes beyond citation style.

Options for full APA 7th manuscript layout:

Option Status Notes
apa7 document class Last release July 2022; no updates since Implements full APA 7th manuscript format; use with biblatex-apa; broadly functional but bug reports unaddressed
papaja R package Actively maintained Quarto/R Markdown wrapper around an APA 6th LaTeX template; integrates R output directly; ideal for empirical papers with analysis code
Overleaf APA template Varies by template Several community-maintained APA 7th templates on the Overleaf Gallery; quality varies
Custom preamble Maintained by you Use setspace, fancyhdr, geometry etc. to replicate APA layout manually; full control

Minimal apa7 setup (for manuscript submission):

\documentclass[man, 12pt]{apa7}   % man = manuscript mode; also: jou, doc, stu
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa, backend=biber]{biblatex}
\addbibresource{references.bib}

Tip

For empirical linguistics or psychology papers where you also need R/Python output in your manuscript, papaja with Quarto is the most practical fully-maintained solution. It generates APA 7th–formatted PDFs directly from .qmd or .Rmd files.

Configuring TeXstudio for Biber

TeXstudio defaults to BibTeX as the bibliography tool. When your document uses biblatex with backend=biber, you must change this setting — otherwise you get errors like:

I found no \citation commands---while reading file test.aux
I found no \bibdata command---while reading file test.aux
I found no \bibstyle command---while reading file test.aux

Fix:

Options → Configure TeXstudio → Build → Default Bibliography Tool → Biber

TeXstudio Build settings

After changing the setting — compile in order:

  1. PDFLaTeX (F6) — generates .aux with citation keys
  2. Bibliography / Biber (F8) — processes .bib, writes .bbl
  3. PDFLaTeX (F6) — inserts bibliography
  4. PDFLaTeX (F6) — resolves page numbers and cross-references

Or press F5 (Build & View) — TeXstudio runs the full sequence automatically.

Tip

latexmk (used by VS Code LaTeX Workshop and Overleaf) detects biber automatically from the preamble and runs the correct sequence without any configuration.

The .bib File

A .bib file is a plain-text database of references. Each entry has a type, a cite key, and fields:

@article{schepens2024prominence,
  author    = {Schepens, Job and Smith, Anna},
  title     = {Prominence in Language},
  journal   = {Language and Cognition},
  year      = {2024},
  volume    = {16},
  pages     = {123--145},
  doi       = {10.1017/langcog.2024.12},
}

@book{chomsky1965aspects,
  author    = {Chomsky, Noam},
  title     = {Aspects of the Theory of Syntax},
  publisher = {MIT Press},
  address   = {Cambridge, MA},
  year      = {1965},
}

Common entry types: @article, @book, @incollection, @inproceedings, @phdthesis, @misc

Note

The cite key (e.g. schepens2024prominence) is what you use in \cite{...} commands. BetterBibTeX generates these automatically from Zotero.

Zotero: Building Your Reference Library

Zotero is a free, open-source reference manager widely used in academia.

Collecting references:

  • Browser connector imports references from publisher websites, Google Scholar, PubMed with one click
  • Drag-and-drop PDFs → Zotero extracts metadata automatically
  • Add by DOI, ISBN, or arXiv ID directly

Organising your library:

  • Collections and sub-collections (like folders)
  • Tags for thematic grouping; related items for linking connected works

Generating citations:

  • Word processor plugins (Word, LibreOffice) for inline citations
  • Supports thousands of citation styles (APA, MLA, Chicago, linguistics styles …)
Download zotero.org
Browser connector zotero.org/download/connectors

Tip

Overleaf, Prism (OpenAI), and TeXlyre all include Zotero integration panels for searching and importing references directly within the editor.

BetterBibTeX: Continuous Auto-export

BetterBibTeX (BBT) is a Zotero plugin that connects your Zotero library directly to your LaTeX project.

Install: Zotero → Tools → Plugins → Install from file (download .xpi from retorque.re/zotero-better-bibtex)

Cite keys:

BBT generates a stable, customisable cite key for every item:

  • Default pattern: [auth:lower][year][veryshorttitle]schepens2024prominence
  • Configure globally: Preferences → Better BibTeX → Citation Keys
  • Pin individual keys to prevent them from changing

Setting up auto-export — set it and forget it:

  1. Right-click a Zotero collection → Export Collection…
  2. Format: Better BibLaTeX (or Better BibTeX)
  3. Check Keep updated
  4. Save as references.bib in your LaTeX project folder

Tip

With Keep updated enabled, every time you add, edit, or delete a reference in Zotero, the .bib file regenerates automatically. Your LaTeX project always has fresh, correct references — no manual exports needed.

Citation Commands in biblatex

With \usepackage[backend=biber, style=apa]{biblatex} and \addbibresource{references.bib}:

Command Output
\cite{key} (Author, Year)
\parencite{key} (Author, Year) — parenthetical
\textcite{key} Author (Year) — narrative
\autocite{key} Style-determined; adapts to context
\cites{key1}{key2} Multiple citations
\footcite{key} Footnote citation

Example text:

\textcite{schepens2024prominence} argue that prominence is cross-linguistic.
Several studies support this claim \parencite{chomsky1965aspects, schepens2024prominence}.

Print the bibliography:

\printbibliography                        % full bibliography
\printbibliography[heading=bibintoc]      % include in table of contents
\printbibliography[type=article]          % filter by entry type

Citation in Practice: A Real Example

Using burknerBrmsPackageBayesian2017 from our .bib file:

The .bib entry (BibLaTeX format, auto-exported from Zotero):

@article{burknerBrmsPackageBayesian2017,
  author  = {Bürkner, Paul-Christian},
  title   = {brms: {An} {R} Package for Bayesian Multilevel Models Using Stan},
  journal = {Journal of Statistical Software},
  year    = {2017},
  volume  = {80},
  pages   = {1--28},
  doi     = {10.18637/jss.v080.i01},
}

In your .tex document:

% Narrative citation — author as subject:
\textcite{burknerBrmsPackageBayesian2017} introduced the brms package for Bayesian multilevel modelling in R.

% Parenthetical citation — supporting claim:
Bayesian multilevel models can be fitted using Stan via R \parencite{burknerBrmsPackageBayesian2017}.

% Multiple citations:
\parencite{burknerBrmsPackageBayesian2017, gelmanRegressionOtherStories2020}

Rendered output (APA 7th style):

Bürkner (2017) introduced the brms package for Bayesian multilevel modelling in R.

Bayesian multilevel models can be fitted using Stan via R (Bürkner, 2017).

Note

The cite key burknerBrmsPackageBayesian2017 is generated automatically by BetterBibTeX from the pattern [auth:lower][Title:skipwords:lower:select=1,1][year]. You never need to type or remember it — just search in your editor’s Zotero panel or use autocomplete.

Quarto: Literate Programming Meets LaTeX

Quarto is a scientific publishing system that produces PDF output via LaTeX while keeping analysis code and prose in a single source file.

A Quarto document (.qmd):

---
title: "My Analysis"
format: pdf
---

## Introduction

We analysed **N = 42** participants.

```{r}
#| label: fig-histogram
#| fig-cap: "Distribution of scores"
hist(rnorm(100))
```

As shown in @fig-histogram, scores are normally distributed.
  • Write in Markdown (with LaTeX commands where needed)
  • Embed R, Python, or Julia code chunks — output appears in the compiled PDF
  • Cross-references (@fig-histogram), citations (@key), and equations all work out of the box

Note

Quarto is the successor to R Markdown. It supports multiple languages and output formats (PDF, HTML, DOCX, slides) from the same source file.

Quarto PDF Output and LaTeX Options

Quarto converts .qmd → LaTeX → PDF via a TeX Live installation.

Configure LaTeX in the YAML header:

---
title: "Thesis Chapter"
format:
  pdf:
    documentclass: report
    papersize: a4
    fontsize: 12pt
    geometry: margin=2.5cm
    keep-tex: true          # inspect the generated .tex file
    include-in-header: preamble.tex   # your custom packages
    cite-method: biblatex
    bibliography: references.bib
    biblio-style: apa
---

Why keep-tex: true?

  • Lets you inspect and modify the generated LaTeX if something doesn’t look right
  • Some journals require a .tex submission file — Quarto can generate it

Tip

Install Quarto from quarto.org/docs/get-started. With TinyTeX (tinytex::install_tinytex() in R), PDF output works immediately — no separate TeX Live install needed.

Writing a Complete Thesis in Quarto

Quarto supports multi-file book projects — the natural structure for a thesis.

Initialise a Quarto book:

quarto create project book my-thesis

This generates a ready-to-use folder:

my-thesis/
├── _quarto.yml        ← project config: title, author, chapters, output
├── index.qmd          ← front matter / preface
├── chapters/
│   ├── 01-introduction.qmd
│   ├── 02-methods.qmd
│   ├── 03-results.qmd
│   └── 04-discussion.qmd
├── references.bib
└── _extensions/       ← optional: university theme extension

_quarto.yml for a PDF thesis:

project:
  type: book

book:
  title: "My Thesis Title"
  author: "Your Name"
  date: "2026"
  chapters:
    - index.qmd
    - chapters/01-introduction.qmd
    - chapters/02-methods.qmd
    - chapters/03-results.qmd
    - chapters/04-discussion.qmd

bibliography: references.bib

format:
  pdf:
    documentclass: report
    papersize: a4
    fontsize: 12pt
    geometry: margin=2.5cm
    toc: true
    number-sections: true
    cite-method: biblatex
    biblio-style: apa
    include-in-header: preamble.tex   # custom LaTeX packages

Render the whole thesis:

quarto render          # builds PDF (and HTML if configured)
quarto render --to pdf # PDF only

Tip

Each .qmd chapter file is an ordinary Quarto document — it can contain R/Python code chunks, figures, tables, and equations. Cross-references (@fig-, @tbl-, @sec-) resolve across chapter boundaries automatically.

Note

Quarto book projects also render to HTML (a website) and EPUB from the same source. Useful for sharing a web version alongside the submitted PDF.

TikZ: Programmatic Figures

TikZ (“TikZ ist kein Zeichenprogramm”) is a LaTeX package for creating figures programmatically — directly in your .tex source.

Why TikZ?

  • Figures are plain text — version-controlled alongside your paper
  • Perfect vector output at any scale
  • Consistent fonts and styling with the surrounding document
  • Highly precise control over every element

Minimal setup:

\usepackage{tikz}
\usetikzlibrary{arrows.meta, positioning}  % load useful libraries

Drawing shapes and paths:

\begin{tikzpicture}
  \draw[thick, fill=blue!20] (0,0) rectangle (3,2);
  \draw[red, ->, line width=1.2pt] (0,0) -- (3,2) node[right] {diagonal};
  \node[circle, draw, fill=green!30, minimum size=1cm] at (1.5,1) {center};
\end{tikzpicture}

Note

TikZ has a steep learning curve. tikz.dev and the PGF/TikZ manual on CTAN are comprehensive references. Start small and build up.

TikZ: Flowcharts

\usetikzlibrary{shapes.geometric, arrows.meta, positioning}
\begin{tikzpicture}[
  node distance=1.5cm,
  box/.style={draw, rectangle, minimum width=2.5cm,
              minimum height=0.8cm, align=center},
  decnode/.style={draw, diamond, aspect=2,
                  minimum width=2.5cm, align=center}
]
  \node[box] (A) {Step 1};
  \node[box, below of=A] (B) {Step 2};
  \node[decnode, below of=B] (C) {Decision?};
  \node[box, below right=0.8cm and 1.2cm of C] (D) {Yes};
  \node[box, below left=0.8cm and 1.2cm of C] (E) {No};
  \draw[->] (A) -- (B);
  \draw[->] (B) -- (C);
  \draw[->] (C) -- node[above right, font=\small] {yes} (D);
  \draw[->] (C) -- node[above left, font=\small] {no} (E);
\end{tikzpicture}

Named styles keep the node definitions clean and reusable. The decnode style uses TikZ’s built-in diamond shape from shapes.geometric.

TikZ: Plots with PGFPlots

\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\begin{tikzpicture}
  \begin{axis}[
    xlabel={$x$}, ylabel={$f(x)$},
    grid=major, grid style={dashed, gray!30}
  ]
    \addplot[blue, thick, domain=-3:3, samples=60]{x^2};
    \addlegendentry{$x^2$}
    \addplot[red, thick, domain=-3:3, samples=60]{x^3/5};
    \addlegendentry{$x^3/5$}
  \end{axis}
\end{tikzpicture}

PGFPlots can also read data from CSV files (\addplot table {data.csv}), making it suitable for publication-quality plots directly from experimental data.

TikZ: Syntax Trees

\usepackage{tikz-qtree}
\begin{tikzpicture}
  \Tree [.S
          [.NP Det N ]
          [.VP V
            [.NP Det N ]
          ]
        ]
\end{tikzpicture}

tikz-qtree uses a compact bracket notation. For more control (node styles, movement arrows, coindexation), use the full tikz library directly or forest — a popular alternative for complex phrase structure trees.

TikZ: Dependency Graphs and Glosses

The tikz-dependency package draws dependency arcs over interlinear glossed text — standard in typological and computational linguistics:

\usepackage{tikz-dependency}

\begin{dependency}[theme=simple,
    label style={above, font=\small\itshape}]
  \begin{deptext}[column sep=1.2em]
    Der \& Mann \& gibt \& der \& Frau \& das \& Buch \\
    \textsc{det.m.nom} \& man.\textsc{nom} \& gives \&
      \textsc{det.f.dat} \& woman.\textsc{dat} \&
      \textsc{det.n.acc} \& book.\textsc{acc} \\
    `The \& man \& gives \& the \& woman \& the \& book' \\
  \end{deptext}
  \deproot{3}{root}
  \depedge{3}{2}{nsubj}
  \depedge{3}{5}{iobj}
  \depedge{3}{7}{obj}
  \depedge{2}{1}{det}
  \depedge{5}{4}{det}
  \depedge{7}{6}{det}
\end{dependency}

Tip

For complex figures, consider generating them in Python (matplotlib PGF backend) or R (tikzDevice) and importing the resulting .tex fragment.

Linguistics: Interlinear Glosses — gb4e

The gb4e package is the standard for numbered linguistic examples with interlinear glosses following the Leipzig Glossing Rules:

\usepackage{gb4e}

\begin{exe}
  \ex \label{ex:german-dative}
  \gll Der Mann gibt    der   Frau   das   Buch. \\
       the.M man  gives the.F woman  the.N book \\
  \trans `The man gives the woman the book.'

  \ex[*]{
  \gll *Das Buch gibt der Frau der Mann. \\
        the.N book gives the.F woman the.M man \\
  \trans (ungrammatical word order)
  }

  \exi{(1a)}
  \gll \textsc{nom} \textsc{dat} \textsc{acc} \\
       subject indirect.object direct.object \\
  \trans Case roles in the German ditransitive construction.
\end{exe}

% Cross-reference later:
As shown in example (\ref{ex:german-dative}), ...

Rendered output:

  • \gll starts the word-by-word alignment; \\ separates tiers; \trans adds the free translation
  • \ex[*] marks ungrammatical examples; \exi allows custom labels
  • Alternative packages: linguex (more compact syntax), expex (most flexible, recommended for complex data)

Tip

Use \textsc{nom}, \textsc{acc}, \textsc{dat} etc. for Leipzig small-cap abbreviations. The leipzig package provides pre-defined commands for all standard glossing abbreviations (\Nom, \Acc, \Dat, \Sg, \Pl …).

Linguistics: IPA Symbols

With XeLaTeX or LuaLaTeX — type Unicode directly:

\usepackage{fontspec}
\setmainfont{Charis SIL}   % free SIL font with full IPA coverage
% alternatives: Doulos SIL, Gentium Plus, Linux Libertine

% In running text — paste Unicode IPA characters:
The high front vowel /iː/ contrasts with the lax /ɪ/ in English.
The retroflex stops [ʈ ɖ] are contrastive in Hindi.
Tone is marked with diacritics: /má/ (high) vs /mǎ/ (rising).

% Phonological rules:
/p, t, k/ → [pʰ, tʰ, kʰ] / _V  (aspirated before vowels)

With pdfLaTeX — use tipa:

\usepackage{tipa}

\textipa{/\textphi \textbeta/}   % bilabial fricatives [ɸ β]
\textipa{[\textrtailt \textrtaild]}  % retroflex stops
\textipa{/m\'{a}/}               % high tone on /a/

% tipx extends tipa with additional symbols:
\usepackage{tipx}
Approach Pro Con
Unicode + fontspec Type IPA directly; readable source Requires XeLaTeX/LuaLaTeX
tipa Works with pdfLaTeX Command-heavy; hard to read source

Rendered output:

Note

Most journal templates still require pdflatex. If you need IPA in a submission, use tipa for compatibility, or check if the journal accepts XeLaTeX/LuaLaTeX.

Linguistics: Optimality Theory Tableaux

The ot-tableau package produces formatted OT constraint tableaux:

\usepackage{ot-tableau}
\usepackage{pifont}  % for \HandRight winner symbol

% Column spec: c = solid border, : = dashed, | = solid between
\begin{tableau}{c:c:c|c}
\inp{/ɾ\textipa{E}to/}
  \const{*Complex} \const{Onset} \const{NoCoda} \const{Max}
\cand[\HandRight]{[ɾe.to]}
                              \vio{*}
\cand{[ɾet]}
               \vio{*}                           \vio{*}
\cand{[e.to]}
  \vio{*!}
\cand{[ɾ\textipa{E}.to]}
               \vio{*}        \vio{*!}
\end{tableau}

Rendered output:

Key commands:

Command Meaning
\inp{...} Input form cell
\const{...} Constraint header
\cand{...} Candidate row
\cand[\HandRight]{...} Optimal candidate
\vio{*} One violation mark
\vio{*!} Fatal violation
\vio{**} Two violations

Column spec characters: c (solid), : (dashed), | (solid within candidates)

Tip

Load \usepackage{tipa} alongside ot-tableau if your input/candidate cells contain IPA. The \ipa{...} shorthand in ot-tableau calls tipa internally.

Linguistics: Feature Structures (AVMs)

The langsci-avm package typesets attribute-value matrices used in HPSG, LFG, and related frameworks:

\usepackage{langsci-avm}

\avm{
  [ phon & < the, cat > \\
    synsem & [ local & [
      cat & [ head & noun \\
              valence & [ spr & < > \\
                          comps & < > ] ] \\
      cont & [ index & i \\
               restr & < [ reln & cat \\
                            arg0 & i ] > ] ] ]
}

Structure:

  • \avm{ ... } — root AVM command
  • [ attr & val \\ attr2 & val2 ] — attribute-value pairs
  • < ... > — lists (sequences)
  • Nested brackets for embedded feature structures
  • Matrices nest freely for complex feature geometries

Rendered output:

Linguistics: Formal Semantics

Lambda calculus and model-theoretic notation use standard LaTeX math mode — no special package needed for the core notation:

\usepackage{stmaryrd}
\usepackage{amsmath,amssymb,mathtools}

\newcommand{\sv}[1]{\llbracket #1 \rrbracket}

% Lexical denotations:
\[
\sv{\textit{cat}} = \lambda x_e .\ \text{cat}(x)
\]
\[
\sv{\textit{runs}} = \lambda x_e .\ \lambda e_v .\
    ext{run}(e) \wedge \text{Agent}(e,x)
\]

% Quantification:
\[
\sv{\textit{every cat}} =
  \lambda P_{\langle e,t \rangle} .\
  \forall x[\text{cat}(x) \rightarrow P(x)]
\]

% Type reminder:
\sv{\textit{runs}} : \langle e,\langle v,t\rangle\rangle

Structure:

  • \sv{...} shorthand for semantic brackets
  • \lambda x_e typed lambda variables
  • \forall and \rightarrow for generalized quantifier notation
  • Angle-bracket types like \langle e,t \rangle

Rendered output:

Tip

Key packages: stmaryrd for \llbracket/\rrbracket brackets; amssymb for logical operators (\forall, \exists, \wedge …); mathtools for extended math syntax. For frequently used brackets, define shorthands: \newcommand{\sv}[1]{\llbracket #1 \rrbracket} so you can write \sv{\text{runs}} instead of the full bracket pair each time.

Templates: Journals and Theses

Journal templates provide .cls and .sty files that enforce house style:

Source What you get
Overleaf Gallery — Journals Templates for hundreds of journals
Publisher websites ACL, IEEE, Springer, Elsevier all provide LaTeX kits
CTAN journal classes elsarticle, acmart, IEEEtran and many more

Thesis templates:

Source Link
Overleaf Thesis Gallery overleaf.com/gallery/tagged/thesis
Universität zu Köln Check your faculty’s doctoral office for approved templates
GitHub Search latex thesis template <university>

Starting from a template:

  1. Download the template folder
  2. Fill in main.tex; delete the placeholder content
  3. Point \addbibresource to your Zotero-exported .bib file
  4. Compile and iteratively fix errors

Debugging LaTeX: Reading Error Messages

LaTeX error messages appear in the log file. The key pattern:

! LaTeX Error: File `missfont.fd' not found.
l.42 \begin{document}
  • ! marks the error type
  • The next line describes the problem
  • l.42 tells you the source line where LaTeX stopped

Common errors and fixes:

Error Likely cause Fix
Undefined control sequence Typo in command or missing package Check spelling; add the right \usepackage
Missing $ inserted Math symbol outside math mode Wrap in $...$
File not found Missing image or .bib file Check filename and path
Runaway argument Unclosed { brace Count { and } carefully
Too many }'s Extra closing brace Remove the extra }

Tip

Compile often — catching one error at a time is much easier than debugging 20 at once. Search the error message on tex.stackexchange.com — most errors are already answered there.

Summary

Document organisation

  • report/book class for long documents
  • \input / \include for multi-file projects
  • Recommended folder structure for theses

Bibliography workflow

  • Zotero collects and organises references
  • BetterBibTeX auto-exports a continuously updated .bib file
  • biblatex + biber for modern citation management

Advanced tools

  • Quarto — analysis + prose in one file; PDF via LaTeX
  • TikZ — programmatic vector figures in LaTeX
  • Templates — start from a journal or thesis template

Debugging

  • Read the error message and the line number
  • Compile often; fix one error at a time

Note

All materials: dkz2r.de/tags/latex

Resources

References

Bürkner, P.-C. (2017). Brms: An R Package for Bayesian Multilevel Models Using Stan. Journal of Statistical Software, 80, 1–28. https://doi.org/10.18637/jss.v080.i01