Bibtex Bibliography Tutorial

Bibliography in LaTeX with Bibtex/Biblatex

Learn how to create a bibliography with Bibtex and Biblatex in a few simple steps. Create references / citations and autogenerate footnotes.

Tweet

[View example on Overleaf]

  1. Creating a .bib file
  2. Using BibTeX
  3. Autogenerate footnotes with BibLaTeX
  4. BibTeX Format
  5. BibTeX Styles

We have looked at many features of LaTeX so far and learned that many things are automated by LaTeX. There are functions to add a table of contents, lists of tables and figures and also several packages that allow us to generate a bibliography. I will describe how to use bibtex and biblatex (both external programs) to create the bibliography. At first we have to create a .bib file, which contains our bibliographic information.

Creating a .bib file

A .bib file will contain the bibliographic information of our document. I will only give a simple example, since there are many tools to generate the entries automatically. I will not explain the structure of the file itself at this point, since i suggest using a bibtex generator (choose one from google). Our example will contain a single book and look like this:

@BOOK{DUMMY:1, AUTHOR="John Doe", TITLE="The Book without Title", PUBLISHER="Dummy Publisher", YEAR="2100", }

If you don't want to use a BibTeX generator or a reference management tool like Citavi (which generates BibTeX files automatically for you), you can find more examples of BibTeX formats here.

Using BibTeX

After creating the bibtex file, we have to tell LaTeX where to find our bibliographic database. For BibTeX this is not much different from printing the table of contents. We just need the commands \bibliography which tells LaTeX the location of our .bib file and \bibliographystyle which selects one of various bibliographic styles.

\documentclass{article} \begin{document} Random citation \cite{DUMMY:1} embeddeed in text. \newpage \bibliography{lesson7a1} \bibliographystyle{ieeetr} \end{document}

By using this code, we will obtain something like this:

I named my .bib file lesson7a1.bib, note that I did not enter the .bib extension. For the style, I've choosen the ieeetr style, which is very common for my subject, but there are many more styles available. Which will change the way our references look like. The ieeetr style will mark citations with successive numbers such as [1] in this example. If I choose the style to apalike instead, i will get the following result:

Most editors will let you select, to run bibtex automatically on compilation. In TeXworks (MiKTeX) for example, this should be selected by default.

If you use a different editor, it can be necessary to execute the bibtex command manually. In a command prompt/shell simply run:

pdflatex lesson7a1.tex bibtex lesson7a1 pdflatex lesson7a1.tex pdflatex lesson7a1.tex

It is necessary to execute the pdflatex command, before the bibtex command, to tell bibtex what literature we cited in our paper. Afterwards the .bib file will be translated into the proper output for out references section. The next two steps merge the reference section with our LaTeX document and then assign successive numbers in the last step.

Autogenerate footnotes in $\LaTeX$ using BibLaTeX

The abilities of BibTeX are limited to basic styles as depicted in the examples shown above. Sometimes it is necessary to cite all literature in footnotes and maintaining all of them by hand can be a frustrating task. At this point BibLaTeX kicks in and does the work for us. The syntax varies a bit from the first document. We now have to include the biblatex package and use the \autocite and \printbibliography command. It is crucial to move the \bibliography{lesson7a1} statement to the preamble of our document:

\documentclass{article} \usepackage[backend=bibtex,style=verbose-trad2]{biblatex} \bibliography{lesson7a1} \begin{document} Random citation \autocite[1]{DUMMY:1} embeddeed in text. \newpage \printbibliography \end{document}

The \autocite command generates the footnotes and we can enter a page number in the brackets \autocite[1]{DUMMY:1} will generate a footnote like this:

For BibLaTeX we have to choose the citation style on package inclusion with:

\usepackage[backend=bibtex,style=verbose-trad2]{biblatex}

The backend=bibtex part makes sure to use BibTeX instead of Biber as our backend, since Biber fails to work in some editors like TeXworks. It took me a while to figure out how to generate footnotes automatically, because the sources I found on the internet, didn't mention this at all.

BibTeX Formats

This is not meant to be a comprehensive list of BibTeX formats, but rather give you an idea of how to cite various sources properly. If you're interested in an extensive overview of all BibTeX formats, I suggest you to check out the resources on Wikibooks.

Article

@ARTICLE{ARTICLE:1, AUTHOR="John Doe", TITLE="Title", JOURNAL="Journal", YEAR="2017", }

Book

@BOOK{BOOK:1, AUTHOR="John Doe", TITLE="The Book without Title", PUBLISHER="Dummy Publisher", YEAR="2100", }

Inbook (specific pages)

@INBOOK{BOOK:2, AUTHOR="John Doe", TITLE="The Book without Title", PUBLISHER="Dummy Publisher", YEAR="2100", PAGES="100-200", }

Website

@MISC{WEBSITE:1, HOWPUBLISHED = "\url{http://example.com}", AUTHOR = "Intel", TITLE = "Example Website", MONTH = "Dec", YEAR = "1988", NOTE = "Accessed on 2012-11-11" }

This is a list of the formats that I have most commonly used. If you think some important format is missing here, please let me know.

BibTeX Styles

Here's a quick overview of some popular styles to use with BibTeX.

Abbrv

Alpha

Apalike

IEEEtr

Plain

I'm trying to keep this list updated with other commonly used styles. If you're missing something here, please let me know.

Summary

  • Generate a bibliography with BibTeX and BibLaTeX
  • First define a .bib file using: \bibliography{BIB_FILE_NAME} (do not add .bib)
  • For BibTeX put the \bibliography statement in your document, for BibLaTeX in the preamble
  • BibTeX uses the \bibliographystyle command to set the citation style
  • BibLaTeX chooses the style as an option like: \usepackage[backend=bibtex, style=verbose-trad2]{biblatex}
  • BibTeX uses the \cite command, while BibLaTeX uses the \autocite command
  • The \autocite command takes the page number as an option: \autocite[NUM]{}

Next Lesson: Lesson 8

Your LaTeX file needs to include
  • a reference to a label in your BibTeX file whenever you want to cite an item in the file
  • a reference to the bibliography style file you want to use, which determines how the references you cite are formatted in the bibliography of your document (and possibly a LaTeX style file associated with the bibliography style)
  • a LaTeX command to generate the bibliography at the point in your document where you want it to appear.

Example using

Here is an example using the bibliography style , which produces citations in "author (year)" format. This file is available on this page (which has instructions on where to put the file once you get it). The lines related to BibTeX are highlighed. It requires the LaTeX style file to produce citations in the right style in the text (matching the format of the references produced by ). You probably have this file already (assuming you have some implementation of TeX on your computer). If you don't, you can get it on this CTAN page. Hover over orangetext to see explanations.

When you run the LaTeX file through LaTeX and BibTeX (instructions below), you'll get output for the body of the document that looks roughly like this:

This document illustrates the use of BibTeX. You may want to refer to Arrow et al. (1961) or Aliprantis and Border (1994) or Maskin (1985). Or you may want to cite a specific page in a reference, like this: see Maskin (1985, p. 199). Or perhaps you want to cite more than one paper by Maskin: Maskin (1985, 1999). Or you want to make a parenthetical reference to one or more articles, in which case the \citealt command omits the parentheses around the year (Arrow et al. 1961).
A few more options for the command are available. Here they are:
Jones et al. (1990)
Jones, Baker, and Smith (1990)
(Jones et al. 1990)
(Jones, Baker, and Smith 1990)
(Jones et al., 1990, p. 99)
(e.g. Jones et al., 1990)
(e.g. Jones et al., 1990, p. 99)
Jones et al.
Jones, Baker, and Smith
1990
*Jones et al.'s (1990)

*Assumes \citeapos is defined in your style or document like this:

(Thanks to Christopher M. Duncombe Rae for pointing out this simple way of generating a possessive citation.)

The list of references will look like this:

Aliprantis, Charalambos D. and Kim C. Border (1994), Infinite Dimensional Analysis. Springer, Berlin.

Arrow, Kenneth J., Leonid Hurwicz, and Hirofumi Uzawa (1961), "Constraint qualifications in maximization problems." Naval Research Logistics Quarterly, 8, 175–191.

Maskin, Eric S. (1985), "The theory of implementation in Nash equilibrium: a survey." In Social Goals and Social Organization (Leonid Hurwicz, David Schmeidler, and Hugo Sonnenschein, eds.), 173–204, Cambridge University Press.

Maskin, Eric S. (1999), "Nash equilibrium and welfare optimality." Review of Economic Studies, 66, 23–38.

Example using

Here is an example using the bibliography style , which in included in many LaTeX systems.

When you run the LaTeX file through LaTeX and BibTeX (instructions below), you'll get output for the body of the document that differs from the output when you use only in that the names of all three authors of Arrow, Hurwicz, and Uzawa (1961) are listed in the first citation to that work, although not in the second, parenthetical, citation.

The list of references differs more significantly from the list produced by : only authors' initials, not their full first names, are included, and "&" rather than "and" is used as a separator; numbers in page ranges are separated by hyphens, rather than the conventional en-dashes. Precisely, the list of references produced by looks like this:

Aliprantis, C. D. & K. C. Border (1994), Infinite Dimensional Analysis. Berlin: Springer.

Arrow, K. J., Hurwicz, L., & Uzawa, H. (1961), Constraint qualifications in maximization problems. Naval Research Logistics Quarterly, 8, 175-191.

Maskin, E. S. (1985), The theory of implementation in Nash equilibrium: a survey. In L. Hurwicz, D. Schmeidler, & H. Sonnenschein (Eds.), Social Goals and Social Organization (p. 173-204). Cambridge: Cambridge University Press.

Maskin, Eric S. (1999), Nash equilibrium and welfare optimality. Review of Economic Studies, 66, 23-38.

Other bibliography styles for author-year citations

A family of styles that produce author-year citations is available on this page.

Creating your own bibliography style

A BibTeX style file is plain text, which in principle you can edit. However, the language used is arcane, and changes that are more than trivial are tricky. A better way to proceed is to create a new style file from scratch, using the custom-bib package (that's how I created ). You run TeX on a file, which asks you a long list of questions about the features of the style you would like. You'll probably not be completely clear about your preferred answers to all the questions on your first attempt, but two or three runs should produce a format to your liking.

One thought on “Bibtex Bibliography Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *