LaTEX is a document preparation system ideal for producing high-quality academic documents, especially those containing mathematical expressions. Unlike word processors, LaTEX uses plain text and markup commands to format content.
It was developed in the 1980s by Leslie Lamport and it operates with TEX, a typesetting program created by Donald Knuth, another American scientist and mathematician.
To use LaTEX, you'll need an editor, such as Overleaf. Your department might recommend other editors,. You can contact IT support to have an editor installed into your own device.
There are two main methods to insert citations and a bibliography in LaTEX: BibTEX and BibLaTEX. Which one you use will depend on the reason why you are creating the document and whether you are working from a template or not.
BibTEX has been around for a long time and it is still used in template for journal articles and some assignments. If you have given a LaTEX template which uses BibTEX for referencing, you should use BibTEX .
BibLaTEX is more modern and flexible. Whereas with BibTEX there are several compilation steps, when using BibLaTEX with the biber
backend, you can define your bibliography style and source directly in the LaTEXdocument using commands like \usepackage{biblatex}
and \addbibresource{}
. Many LaTEX editors (like Overleaf) automate the biber
compilation step, making it feel like a single-step process.
This tutorial has more information about refencing with BibTEX and BibLaTEX.
Although it is possible to use insert citations with BibTEX without any packages loaded, this is rather limited.We recommend that you use the natbib
package, which allows the creation of different types of citation and has a lot of styles available.
1. Create a .bib
file with your references. Each reference should look something like this:
@article{einstein1905, author = {Albert Einstein}, title = {On the Electrodynamics of Moving Bodies}, journal = {Annalen der Physik}, year = {1905}, volume = {17}, pages = {891--921} }
2. Insert citations in your LaTEX document. A citation within the text should loke something like this:
Einstein's work on relativity \cite{einstein1905}
changed physics.
In this example, einstein1905
is the citation for the bibliography entry shown in step 1. This combination of author's surname and year of publication is what is called a citekey. Most citekeys will have this format, but some referencing management systems will produce citekeys in different formats.
3. Add bibliography commands:
\bibliographystyle{plain} \bibliography{references}
In the above example, references
refers to the BibTEX file which has all your references in the format explained in step 1.This file will have the extension .bib.
To compile the bibliography, make sure that both the LaTEX and BibTEX files are in the same directory, and follow these copilation steps:
pdflatex
).BibLaTEX offers more flexibility and modern features. It uses biber
as its backend instead of bibtex
.
1. Set up your document: Add the usepackage biblatex with the backend biber and, if relevant to your referencing style, the authoryear style.
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{references.bib}
2. Insert your reference file:
\addbibresource{references.bib}
The format for each entry in the reference file will be similar to this:
@article{einstein1905, author = {Albert Einstein}, title = {On the Electrodynamics of Moving Bodies}, journal = {Annalen der Physik}, year = {1905}, volume = {17}, pages = {891--921} }
3. Insert citations in your text. A citation within the text should loke something like this:
Einstein's work on relativity \cite{einstein1905}
changed physics.
4. Compile the bibliography with the \printbibliography
command.
Much time and effort can be saved by automatically generating BibTEX files through bulk export of multiple references either direct from databases or from reference management software. This automatic process may cause some issues and require you to tidy up the BibTEX files.
Here are some suggestions to help with this: