04 August 2019

This post lists a few tips I’ve found useful for using bibtex, the standard tool for creating a bibliography in LaTeX:

  • Essential tips on getting thing displayed in the “standard” way (at least for statistics/machine learning community I work in). These should be pretty familiar to regular users, but hopefully are helpful to people writing their first papers.

  • Optional tips which are often broken in papers, but do make your bibliography look professional (although that’s sometimes a marginal concern!)

  • Miscellaneous tips, mainly those that are hard to come up with the right search term from on the internet.

Note that rules for particular journals and/or bibtex style files may differ from what’s below, so double-check!

Here’s a nice nice blog post on some of the mysteries of bibtex.

Essential tips

  • Google scholar is a great place to download a bibtex reference for papers from. First click on the quotation mark symbol under a listing, as shown in this screenshot.
    google scholar screenshot
    Then click on the “BibTeX” link at the bottom of the window that pops up.
    However google scholar listings often have various errors, so it’s worth double-checking them! This is also true of other internet sources of bibtex code. Some of the formatting problems listed below are quite common. But basic details like author names can also sometimes be incorrect, so check against the actual paper.

  • Bibtex has facilitities for many fields which are rarely required in bibliographies e.g. publication month, URL, ISSN. Unfortunately if you complete these they often end up in the bibliography output (depending on the bibtex style file). To be safe it’s easiest to simply delete these fields. You typically just need author, title, journal, year, volume, pages, or similar for conferences. For books you also need publisher.

  • If space is an issue, shorten long journal or conference names. Long lists of editors can also usually be omitted.
    For example: “In Jennifer Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR.” can usually be shortened to “International Conference on Machine Learning, 2018” or even just “ICML 2018”.

  • Truncate very long author lists and add “and others” to get references saying “et al”. See this stackoverflow answer for an example. Exactly how many authors to leave in is up to you!

  • Put full stops (/periods) after each middle initials and spaces between them. Otherwise many bibtex styles will leave them out or display them incorrectly. This is important for authors whose identity becomes unclear without the middle initials!

  • Use \cite to cite a reference in text e.g. Bayes (1763) and \citep to cite a reference in parentheses (Bayes, 1763). More complicated citations (see e.g. Bayes, 1763) can be achieved using \citealt and \citealp, as described here. An alternative is to pass optional arguments to \citep. This and many other variants of these commands is described in this reference.

Optional tips

  • Use curly braces to indicate words which should remain capitalised e.g. {Markov} chain {Monte Carlo} in {Bayesian} statistics.

  • Be in consistent within a particular bibliography e.g. in what you call authors, journals, conferences etc.

  • Double-check before submission whether any preprints now have published versions.

  • Make your bibtex keys consistent. One common format is author, year, first word of title e.g. @book{zeng2013state.

Miscellaneous tips

  • Write hyphenated first names in full e.g. “Jean-Michel”. They will then be shown correctly in the bibliography e.g. “J.-M.”

  • There are options in the ‘natbib’ package for sorting and compressing numerical citations e.g. so that [4,2,1,3] is converted to [1-4]. Select these when importing the package: \usepackage[numbers, sort&compress]{natbib} For more details see here.

  • An annoying bug when using bibtex and natbib is that papers with the same first author and year, but different author lists, are sometimes given the same citation. See here for a fuller description of the problem. The best resolution to this I’ve seen is to use biblatex and biber instead.



blog comments powered by Disqus