Reference management in LaTeX
At UiO, you can use the web-based LaTeX editor Overleaf in its premium version, which you can connect to Zotero. You can also use Zotero if you work in a desktop LaTeX editor. Here, you will get help with both options.
BibLaTeX
Regardless of your choice of editor and reference management tool, it is recommended that you use the BibLaTeX package to manage your references.
More reference styles and commands
Try changing from numered citations to year-name-title (ynt stands for year-name-title):
style=alphabetic, sorting=yntstyle=numeric, sorting=none
Example with more commands
Here is a more detailed example of how you can set up a preamble in an editor:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{csquotes,graphicx}
\usepackage[backend=biber, style=numeric, sorting=none]{biblatex}
\usepackage{hyperref}
\addbibresource{references.bib}
\title{...}
\author{...}
\date{...}
\begin{document}
\maketitle
Her kan du begynne å skrive og sitere med \cite{...}
\printbibliography
\end{document}Explanation of commands
- \documentclass{article} Specifies the type of document you are creating—an article in this case. You can find an overview of different document classes here: https://www.ctan.org/topic/class
- \usepackage[T1]{fontenc} Fontenc ensures the correct font encoding, and [T1] allows LaTeX to handle special characters—such as the Norwegian letters æ, ø, and å—properly. [T1] provides 8-bit encoding for letter characters rather than 7-bit encoding, doubling the number of possible character codes from 128 to 256. With 7-bit encoding, some special characters (such as ö) do not have their own character code and are instead composed of two characters (o + ¨).
- \usepackage[english]{babel} Adapts the document to the English language and automatically ensures that fixed text elements appear in English—for example, “References” instead of “Bibliography”—and enables English hyphenation rules.
- \usepackage{csquotes,graphicx} Loads two useful packages at the same time:
- csquotes: Handles quotation marks automatically according to the language you have selected, which is useful when quoting.
- graphicx: Makes it possible to include images and illustrations in the document.
- \usepackage[backend=biber, style=numeric, sorting=none]{biblatex} Loads BibLaTeX for reference management, with three additional settings:
- backend=biber: Sets Biber as the backend program for BibLaTeX.
- style=numeric: Uses numbered citations (numeric style), for example [1].
- sorting=none: Sorts sources in the bibliography in the order in which they appear in the text, rather than alphabetically.
- \usepackage{hyperref} Turns all citations, table-of-contents entries, and web addresses into clickable hyperlinks in the PDF file.
- \addbibresource{references.bib} Tells LaTeX where your sources are stored—that is, in which file. It specifies that your references are in a separate file called references.bib, located in the same folder as the .tex file.
- \maketitle Retrieves the information entered in title, author, and date, and creates a title block using this information.
- \cite{…} This is the command used to cite a source.
- \printbibliography This is the command used to print the list of cited references. The default title is “References” for the article document class and “Bibliography” for books and reports.
UiO LaTeX templates
UiO has LaTeX templates for thesis and assignment writing, which are available in Overleaf under Templates. You can also find them as packages in UiO’s Design manual.
UiO support in LaTeX and BibLaTeX
See also:
Contact
If you have questions about LaTeX and Zotero, you can contact us at latexguru@ub.uio.no
Courses
Also see our course schedule: