Skip to content
Get started

How to cite and add a bibliography in LaTeX

You will learn how to cite sources from a .bib file, using either classic BibTeX or biblatex with biber. Both work in Luzbase without any setup: you write the LaTeX, and the compile runs the right tool.

Every compile runs latexmk, which detects what your document needs:

  • If your document uses \bibliography{…}, latexmk runs BibTeX. Luzbase uses bibtexu, the Unicode version of BibTeX from TeX Live, so author names with accented or non-Latin letters work.
  • If your document loads biblatex with the biber backend (the default), latexmk runs biber.
  • latexmk then repeats the LaTeX runs until citations and the bibliography are resolved. One click on Compile is enough.

There is no bibliography setting to change, and no need to clear any files when you switch from BibTeX to biblatex or back. If leftover files from the other tool get in the way, Luzbase rebuilds from scratch on its own.

  1. In the editor’s file tree, click New file.
  2. Enter a path such as references.bib, then click Create file.
  3. Add your entries:
references.bib
@article{turing1936,
author = {Turing, Alan M.},
title = {On Computable Numbers, with an Application to the Entscheidungsproblem},
journal = {Proceedings of the London Mathematical Society},
year = {1936},
volume = {s2-42},
number = {1},
pages = {230--265},
doi = {10.1112/plms/s2-42.1.230}
}
@article{noether1918,
author = {Noether, Emmy},
title = {Invariante Variationsprobleme},
journal = {Nachrichten von der Gesellschaft der Wissenschaften zu G{\"o}ttingen, Mathematisch-Physikalische Klasse},
year = {1918},
pages = {235--257}
}

You can also upload an existing .bib file with Upload files, or sync one from a reference manager (see below).

Choose one of the two approaches.

main.tex
\documentclass{article}
\usepackage{natbib}
\begin{document}
Computability was formalised by \citet{turing1936}.
Symmetries and conservation laws are linked by \citet{noether1918}.
\bibliographystyle{plainnat}
\bibliography{references}
\end{document}
  • \bibliography{references} names the file without the .bib extension.
  • \bibliographystyle{…} sets the style. Styles from TeX Live work; for a journal’s own style, upload its .bst file to the project.
  • Without natbib, use plain \cite{…} and a style such as plain.
main.tex
\documentclass{article}
\usepackage[backend=biber, style=authoryear]{biblatex}
\addbibresource{references.bib}
\begin{document}
Computability was formalised by \textcite{turing1936}.
Symmetries and conservation laws are linked by \textcite{noether1918}.
\printbibliography
\end{document}
  • \addbibresource{references.bib} names the file with the .bib extension.
  • Set the style with the style= option, for example numeric, alphabetic or authoryear.

Click Compile, or press Ctrl+Enter (Cmd+Enter on Mac). Citations and the reference list appear in the PDF.

  • Type \cite{ (or \citep{, \textcite{ and similar) and the editor suggests keys from every .bib file in the project. You can search by key, title, author or year.
  • The Citation button in the editor toolbar inserts \cite{} and opens the suggestions.
  • Hover over a citation to see its entry, or the message “Citation “key” is not in the bibliography” if the key is missing.

On the Pro plan, you can link a Zotero or Mendeley library or collection to a .bib file in your project (by default references.bib). Press Sync in the editor’s References panel whenever you want the latest references. Each sync rewrites that file, so edit your references in the reference manager, not in the file.

Problem What to check
[?] in the PDF, or “Citation … undefined” in the log The key is missing or misspelled. See Citation undefined.
An error that names your .bib file and a line A syntax error in that entry, often a missing comma or brace. Luzbase reads the BibTeX or biber log and shows the file and line in the Output panel.
The bibliography is empty Nothing is cited yet. Cite at least one entry, or add \nocite{*} to list every entry in the .bib file.
A .bib file over 1 MB Text files are limited to 1 MB. Split the file, or sync a smaller collection.