In this module we present the basic steps to start with BibTex. BibTex is a very powerful tool in LaTeX that helps you keep your references all together and ordered. Some big advantages of using BibTex are the following

  1. it will make sure your references are printed in the same style;
  2. it will put your references in alphabetical order (not the authors in one specific reference);
  3. you can have your references collected in one file which you can use in multiple documents.

All the information presented in this short manual are taken from Wikipedia/LaTeX/Bibliography Management. For a more elaborate explanation on how to use BibTex we refer you to this site.

Step 1 - Creating a bib file

The first step is to create a bib file with all your references. Such a file is created using a LaTeX distribution like TeXworks. Creat an empty file and include your references one by one, you don’t need to install any packages, the only thing is that each reference has to be included in a specific way. In the example below you can see how to create a bib entry of the type article and of the type book.


@article{greenwade93,
    author  = "George D. Greenwade",
    title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
    year    = "1993",
    journal = "TUGBoat",
    volume  = "14",
    number  = "3",
    pages   = "342--351"
}

@book{goossens93,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The LaTeX Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

Remark: In both cases above is goossens93 the citation key which you can use to cite this reference.

Tip: You can easily obtain a bib item from Google Scholar. If you search for the source you would like to reference on Google Scholar, you can click on the citation symbol that appears in the search results. This will open a popup window with the citation for a list of different referencing styles. In the lower part of the window you can click on BibTeX, after which a page will open with the bib item for this particular source. It is always helpful to check over this bib item, but you could just copy and paste this into your bib file.

When you are done with all the references you need to save the file as a BibTex dataset (.bib).

Step 2 - Compiling the bib file in LaTex

In your main tex file you need to add the following two commands in order to call the bib file.

\bibliographystyle{plain}
\bibliography{NameOfbibFile} 

The first one determines the style of the bibliography and the second one calls the bib file. Make sure that

  1. the bib file is in the same folder as the main tex file;
  2. the name of the bib file tex will try to call, i.e. NameOfbibFile, is the same as the name you have given to the bib file.

In your tex file you can use the \cite{} command to cite a reference from the bib file. To compile the tex file with the bibliography you need to

  1. first compile the tex file to pdf (Typeset to pdfLaTex);
  2. compile the bib file from your main tex file (Typeset BibTex);
  3. compile the tex file to pdf twice to get the references and the citations.

Remark: The references that will appear in the pdf are only those that have been used in the text. References that are not cited will not appear in the list of references. If you want to include references that are not cited in the text have a look at the link given in the beginning.