Academic writing
Citations and Bibliographies in Typst
Typst has citations built in: no extra package, no separate bibliography program and no second compile pass. You point it at a file of references, cite with @key, and Typst formats both the citations and the reference list in the style you choose.
Add a bibliography file
Typst reads two formats: BibLaTeX/BibTeX .bib files, which reference managers such as Zotero export, and Hayagriva .yml files, Typst's own readable format. Put the file next to your main file and place the bibliography where the reference list should appear:
= Results
As shown by @knuth1984, ...
#bibliography("refs.bib")@book{knuth1984,
author = {Donald E. Knuth},
title = {The TeXbook},
publisher = {Addison-Wesley},
year = {1984}
}Only works you cite appear in the list. To list everything in the file, write #bibliography("refs.bib", full: true).
Cite with @key
@knuth1984 cites a work by its key. The same syntax references figures, tables and headings that carry a label, so Typst decides from the key what kind of reference it is. When you need options, use the cite function with the key as a label:
| You write | You get (APA style) |
|---|---|
@knuth1984 | (Knuth, 1984) |
@knuth1984[p. 7] | (Knuth, 1984, p. 7) |
#cite(<knuth1984>, form: "prose") | Knuth (1984) |
#cite(<knuth1984>, form: "year") | 1984 |
Choose a citation style
Styles are Citation Style Language (CSL) styles. Typst ships with the common ones, which you name with style:
#bibliography("refs.bib", style: "ieee")
// also: "apa", "chicago-author-date", "chicago-notes", "mla", "harvard-cite-them-right", ...If your journal or university provides a .csl file, add it to the project and pass its path: style: "my-journal.csl". The thousands of styles in the public CSL repository work the same way.
Changing the style changes every citation and the list at once. There is no need to touch the citations in your text.
Title and placement of the list
- The list gets a localized heading ("Bibliography" in English). Set your own with
title: [References], or hide it withtitle: none. - The heading is a normal heading, so your heading show rules style it too.
- A document has one bibliography. Cite from any included chapter file, and the list collects all of them.
Coming from LaTeX
Your existing .bib file works as it is, so you can keep using it while you move the document over. \cite{key} becomes @key, \citet becomes the prose form, and \bibliographystyle becomes the style argument. Read How to Convert a LaTeX Project to Typst for the rest of the mapping.
In Kern, the bibliography is built by the same on-device compiler as the rest of the document, so citations resolve as you type, offline, and the reference list updates in the live preview. Kern Pro can import a LaTeX or Overleaf project, bibliography file included, as a new Typst project.