Bibliography In Latex Thesis Templates

To see the corresponding video for this blog post click here.

In the last post we looked at using images and tables in our thesis. In this post we are going to look at adding a bibliography to our thesis. To do this we are going to use the biblatex package. This involves creating a list of sources in a separate file called a bib file.

The Bib File

When we create this file we need to choose a name for it and save it as a ‘.bib’ file rather than a ‘.tex’ file.

Now every time we need to reference a source we can cite it in the text and then fill in the source details in the bib file. First we’ll look at filling in our ‘.bib’ file and then we’ll move on to discussing citations.

To add a new entry to our bib file we need to first tell biblatex what type of source we are referencing. We do this using an @ symbol followed immediately by the source type.

Then comes an opening curly bracket and a citation key of our choice followed by a comma. We then need to tell it all the details it wants for that particular type of source. We do this using a list of keywords each followed by an equals sign and the corresponding information in curly brackets. Items in the list are separated by commas. Each recognised source type has a list of required details which we must provide. But we’ll often want to give more details. For example, for an article entry we need to use the author, title, journaltitle and year or date keywords. For an online source we need to use the author or editor, title, year or date and url keywords, and finally for a book it’s the author, title and year or date keywords. Here’s an example of what they might look like filled in.

All of the information about the recognised source types and all the keywords you can use can be found in the biblatex documentation.

Now let’s return to the main tex file. To set it up for a bibliography we need to load up the biblatex package using the command. Also in the preamble we need to specify which bib files we want to use by calling the command and entering the file name in the curly brackets including the ‘.bib’ extension.


Now let’s look at citations. To cite a source in the text we use one of the biblatex citation commands. The simplest is the command which prints the citation without any brackets unless you are using the numeric or alphabetic styles. We’ll discuss styles a little later on. For example we may cite a source in the text like this:

Another one is the command which prints citations in parentheses except when using the numeric or alphabetic styles when it uses square brackets. There are more citation commands available to you which again can be found in the documentation.

The citation commands in biblatex also give us the option of adding a ‘prenote’ and ‘postnote’ in as arguments. A ‘prenote’ is a word or phrase like ‘see’ that is inserted at the start of the citation. A ‘postnote’ is text you want inserted at the end of the citation. To add these notes in you uses two sets of square brackets in the citation command. If you only open one set of square brackets it will assume the contents of the brackets is a postnote, so if you only want a prenote make sure you still open the second set of square brackets and then just leave them empty. Here are some examples:


Now to actually get the bibliography printed in our thesis we use the command at the end of the document. By default the bibliography and citations use the numeric style which looks like this:

To change the style we pass more arguments into the command in square brackets. For example this specifies the ‘alphabetic’ style.

Which looks like this:

And this is the ‘authoryear’ style.

Another thing we can change here is the way the bibliography is ordered. For example this sorts entries by year, name, title.

While this doesn’t sort them at all but displays them in the order they are cited.

More information about the numerous styles and sorting options available can be found in the documentation. This concludes our discussion on adding a bibliography. In the next post we’ll look at customising some of the opening pages.

Other posts in this series:

pt 1 - Basic Structure

pt 2 - Page Layout

pt 3 - Figures, Subfigures and Tables

pt 5 - Customising Your Title Page and Abstract

Posted by Josh Cassidy on 08 Aug 2013

PhD Thesis LaTeX Template Files

Here it is. I finally put on this web site the LaTeX template I used for writing my PhD. I have been looking for such a thing for a long time on the web before finally writing mine, using as an inspiration many web sites that proposed parts of what I wanted.

I originally made it to work with latex/dvipdfm combination. I have since changed it so that it should work with either latex/dvipdfm or pdflatex. I have now ended up with two versions corresponding to two languages. The first one is the English version which contains features like:

  • Made for A4 paper
  • Chapters and different sections always start on the page on the right
  • Acknowledgment section included in main file
  • A title page that fits the style required for University of Nice
  • Links in the pdf file and bookmarks (hyperref package)
  • Backward links in the bibliography section going to where the references were cited
  • Some environments and commands that were useful for me (vertically centered page, partial derivatives, argmin, bullet list, etc.)
  • Summary of the thesis at the end of the thesis (usually required in France)
  • Use of minitoc (table of contents for each chapter)
  • A bibtex style file modified a little from alpha style (references appear as [Commowick, 2007] which is much easier than numbers for the reader). I added recently a second style file (bst) allowing the references to appear as [Commowick et al, 2007] when there are more than two authors and as [AuhtorA & AuthorB, 2007] when there are two authors. This style file can be used by replacing the bibliographystyle included in Thesis.tex.
  • And other things I forgot that you may discover in the formatAndDefs.tex file if you want to have a look.

The second version is a French version, which is why I will switch to French for a while. Go to the end of the page to get the templates and examples. La version française donc contient les mêmes caractéristiques que la version anglaise avec une francisation du style latex et bibtex. Là encore deux styles pour bibtex sont disponibles que je vous laisserai tester. Les macros des mois (jan, feb, mar, ..., dec) du style bibtex ont été redéfinies pour sortir les mois en français dans la bibliographie. J'inclus aussi les packages MyAlgorithm et MyAlgorithmic qui sont les traductions en français des packages algorithm et algorithmic (gentiment fournis à l'époque par Céline Fouard, merci à toi).


All right, now let's start the real thing. I put here two tarballs, one for each version. Each tarball includes several tex files that constitute an example of a PhD, showing what you can expect from this. Sorry, this is an example, I won't write your thesis... If you want to have a look at what a real thesis can look like with this template, see my thesis (even if it is in French, you will still see what it looks like). I also included a script to compile the example (compileThese or compileThesis). Other files are:

  • These.tex or Thesis.tex: Main file, including the chapters and the acknowledgment section.
  • Chapter1.tex: Example of a chapter
  • Annexe1.tex or Appendix1.tex: Example of an appendix chapter
  • These.bib or Thesis.bib: references file
  • StyleThese.cls or ThesisStyle.cls: Main style file, largely inspired from book style file
  • formatAndDefs.tex: Most important: Definition of commands, fancy headers, pdf options and various environments
  • StyleThese.bst, ThesisStyle.bst, StyleTheseWithEtAl.bst or ThesisStyleWithEtAl.bst: Bibtex style files producing references either as [Commowick, 2007] or as [Commowick et al, 2007], uses names (much more readable and still relatively short), customized either for french or english.
  • TitlePage.tex: Title page, fits the style required for University of Nice. I don't know for other universities but this will still be a good start I guess.

A reminder: I do not guarantee that it will work on every computer with every configuration (it has been used successfully on linux and Mac OS X). However, feel free to use, modify or diffuse these templates for whatever you want, let's be GPL. If you want to acknowledge, do not hesitate to put the link to this website somewhere in your thesis or on your website. If you do not want to acknowledge, no problem do whatever you want, I will be able to track you anyway (just kidding :-) )... So here we go now with the two templates (last updated on November 10, 2015):

> English version of the PhD Thesis template.
> Version française du template LaTeX de thèse.

Frequently Asked Questions

I have had quite a lot of feedback on this template, and actually it is now generating half of the traffic to this website. I'm really amazed. So because of this high number of visits, I have had some questions and requests for improvements. Therefore, here is now the answers to questions section:

How do I remove the back-references to citation pages in the bibliography ?
Simply remove in the file formatAndDefs.tex any reference to pagebackref and recompile.

How do I change the way back-references look like in the bibliography ?
Simply modify in the file formatAndDefs.tex the lines after "nicer backref links" comment (thanks Francois and Vincent for the trick) and recompile.

How do I use the bibliography style displaying references as [Commowick et al, 2007] ?
Just replace in the main file (Thesis.tex or These.tex) the line \bibliographystyle{ThesisStyle} by \bibliographystyle{ThesisStyleWithEtAl} (\bibliographystyle{StyleThese} by \bibliographystyle{StyleTheseWithEtAl} for the French version).

How to add a list of abbreviations ?
It is possible using the nomenclature package (the glossary package may also be used but I found it more complicated). To use it and see an example, just uncomment the following lines: line 32 in These.tex or Thesis.tex, line 40 in Chapter1.tex (syntax example) and uncomment the makeindex in compileThese (or compileThesis) script. The \printnomenclature tells where to put the list in the document and the makeindex generates the list.

How to change the page margins ?
I used the package geometry to set the document margins for A4 paper. Feel free to change the margins by changing line 5 in formatAndDefs.tex.

How to change the page format ?
This might be tricky but the main things to do are to change the margins if needed (see above) and change line 1 of Thesis.tex or These.tex to replace a4paper by a supported paper type in latex (letterpaper and a5paper mainly, see the file StyleThese.cls or ThesisStyle.cls for a full list).

If you did not find your answer in this, or encounter any problem (file missing, compilation not working, idea of something to add), feel free to ask me by email (see my contact page).

0 thoughts on “Bibliography In Latex Thesis Templates

Leave a Reply

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