Multi-file Projects, Zotero, Quarto, and TikZ
17 June 2026
Building on Session 1, this session covers:
.bib files, biblatex, and citation commandsTip
Prerequisites: familiarity with LaTeX document structure, basic commands, and environments from Session 1.
| 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 |
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)\input and \includeFor long documents, split your .tex source into multiple files.
\input{filename} — inline inclusion:
\include{filename} — chapter inclusion with page break:
\includeonly{chapter1,chapter3} to compile only selected chapters — faster iteration on large documentsNote
Use \input for small fragments (preamble settings, custom commands). Use \include for major structural divisions like chapters.
my-thesis/
├── main.tex ← root document
├── preamble.tex ← packages and settings (\input'd)
├── chapters/
│ ├── 01-introduction.tex
│ ├── 02-methods.tex
│ ├── 03-results.tex
│ └── 04-discussion.tex
├── appendices/
│ └── appendix-a.tex
├── figures/
│ ├── fig-methods.pdf
│ └── fig-results.pdf
├── references.bib ← bibliography database
└── output/
└── thesis.pdf
Keep figures as vector PDFs — they scale perfectly at any zoom level and stay sharp in print.
Tip
Put this folder in a Git repository from day one. Version control for a thesis is invaluable — you can always go back to an earlier version.
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.
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:
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.tex file before \begin{document}); defines the \cite commands available in your document and controls how the bibliography list is formatted when printedThe 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.
| 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 documentTip
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 [?].
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):
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.
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:
.aux with citation keys.bib, writes .bblOr 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.
.bib FileA .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 is a free, open-source reference manager widely used in academia.
Collecting references:
Organising your library:
Generating citations:
| 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 (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:
[auth:lower][year][veryshorttitle] → schepens2024prominenceSetting up auto-export — set it and forget it:
references.bib in your LaTeX project folderTip
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.
biblatexWith \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:
Print the bibliography:
Using burknerBrmsPackageBayesian2017 from our .bib file:
The .bib entry (BibLaTeX format, auto-exported from Zotero):
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
brmspackage 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 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):
@fig-histogram), citations (@key), and equations all work out of the boxNote
Quarto is the successor to R Markdown. It supports multiple languages and output formats (PDF, HTML, DOCX, slides) from the same source file.
Quarto converts .qmd → LaTeX → PDF via a TeX Live installation.
Configure LaTeX in the YAML header:
Why keep-tex: true?
.tex submission file — Quarto can generate itTip
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.
Quarto supports multi-file book projects — the natural structure for a thesis.
Initialise a Quarto book:
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 packagesRender the whole thesis:
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 (“TikZ ist kein Zeichenprogramm”) is a LaTeX package for creating figures programmatically — directly in your .tex source.
Why TikZ?
Minimal setup:
Drawing shapes and paths:
Note
TikZ has a steep learning curve. tikz.dev and the PGF/TikZ manual on CTAN are comprehensive references. Start small and build up.
\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.
\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-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.
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.
gb4eThe 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 labelslinguex (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 …).
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:
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.
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.
The langsci-avm package typesets attribute-value matrices used in HPSG, LFG, and related frameworks:
Structure:
\avm{ ... } — root AVM command[ attr & val \\ attr2 & val2 ] — attribute-value pairs< ... > — lists (sequences)Rendered output:
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\rangleStructure:
\sv{...} shorthand for semantic brackets\lambda x_e typed lambda variables\forall and \rightarrow for generalized quantifier notation\langle e,t \rangleRendered 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.
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:
main.tex; delete the placeholder content\addbibresource to your Zotero-exported .bib fileLaTeX error messages appear in the log file. The key pattern:
! LaTeX Error: File `missfont.fd' not found.
l.42 \begin{document}
! marks the error typel.42 tells you the source line where LaTeX stoppedCommon 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.
Document organisation
report/book class for long documents\input / \include for multi-file projectsBibliography workflow
.bib filebiblatex + biber for modern citation managementAdvanced tools
Debugging
Note
All materials: dkz2r.de/tags/latex
RDM Workshop Series · SFB 1252 Prominence in Language · Universität zu Köln