Bibtex Format Multiple Authors Bibliography

Creating and Managing Bibliographies with BibTeX on Overleaf

By Lian Tze Lim

Introduction

Many tutorials have been written about what \(\mathrm{Bib\TeX}\) is and how to use it. However, based on my experience of providing support to Overleaf’s users, it’s still one of the topics that many newcomers to \(\mathrm{\LaTeX}\) find complicated—especially when things don’t go quite right; for example: citations aren’t appearing; problems with authors’ names; not sorted to a required order; URLs not displayed in the references list, and so forth.

In this first article, one of a planned series to address references, we’ll pull together all the threads relating to citations, references and bibliographies, as well as how Overleaf and related tools can help users manage these.

We’ll start with a quick recap of how \(\mathrm{Bib\TeX}\) and bibliography database () files work and look at some ways to prepare files. This is, of course, running the risk of repeating some of the material contained in many online tutorials, but future blog posts will expand our coverage to include bibliography styles and —the alternative package and bibliography processor.

Bibliography: just a list of

Let’s first take a quick look “under the hood” to see what a \(\mathrm{\LaTeX}\) reference list is comprised of—please don’t start coding your reference list like this because later in this article we’ll look at other, more convenient, ways to do this.

A reference list really just a list of :

By default, this environment is a numbered list with labels , and so forth. If the document class used is , automatically inserts a numberless section heading with (default value: References). If the document class is or report, then a numberless chapter heading with (default value: Bibliography) is inserted instead. Each takes a cite key as its parameter, which you can use with commands, followed by information about the reference entry itself. So if you now write

together with the block from before, this is what gets rendered into your PDF when you run a \(\mathrm{\LaTeX}\) processor (i.e. any of , , or ) on your source file:

Figure 1: Citing entries from a list.

Notice how each is automatically numbered, and how then inserts the corresponding numerical label.

takes a numerical argument: the widest label expected in the list. In this example we only have two entries, so is enough. If you have more than ten entries, though, you may notice that the numerical labels in the list start to get misaligned:

Figure 2: with a label that’s too short.

We’ll have to make it instead, so that the longest label is wide enough to accommodate the longer labels, like this:

Figure 3: with a longer label width.

If you compile this example code snippet on a local computer you may notice that after the first time you run (or another \(\mathrm{\LaTeX}\) processor), the reference list appears in the PDF as expected, but the commands just show up as question marks [?].

This is because after the first \(\mathrm{\LaTeX}\) run the cite keys from each (, ) are written to the file and are not yet available for reading by the commands. Only on the second run of are the commands able to look up each cite key from the file and insert the corresponding labels (, ) into the output.

On Overleaf, though, you don’t have to worry about re-running yourself. This is because Overleaf uses the build tool, which automatically re-runs (and some other processors) for the requisite number of times needed to resolve outputs. This also accounts for other cross-referencing commands, such as and .

A note on compilation times

Processing \(\mathrm{\LaTeX}\) reference lists or other forms of cross-referencing, such as indexes, requires multiple runs of software—including the \(\mathrm{\TeX}\) engine (e.g., ) and associated programs such as \(\mathrm{Bib\TeX}\), , etc. As mentioned above, Overleaf handles all of these mulitple runs automatically, so you don’t have to worry about them. As a consequence, when the preview on Overleaf is refreshing for documents with bibliographies (or other cross-referencing), or for documents with large image files (as discussed separately here), these essential compilation steps may sometimes make the preview refresh appear to take longer than on your own machine. We do, of course, aim to keep it as short as possible! If you feel your document is taking longer to compile than you’d expect, here are some further tips that may help.

Enter \(\mathrm{Bib\TeX}\)

There are, of course, some inconveniences with manually preparing the list:

  • It’s up to you to accurately format each based on the reference style you’re asked to use—which bits should be in bold or italic? Should the year come immediately after the authors, or at the end of the entry? Given names first, or last names first?
  • If you’re writing for a reference style which requires the reference list to be sorted by the last names of first authors, you’ll need to sort the s yourself.
  • For different manuscripts or documents that use different reference styles you’ll need to rewrite the for each reference.

This is where \(\mathrm{Bib\TeX}\) and bibliography database files ( files) are extremely useful, and this is the recommended approach to manage citations and references in most journals and theses. The approach, which is slightly different and gaining popularity, also requires a file but we’ll talk about in a future post.

Instead of formatting cited reference entries in a list, we maintain a bibliography database file (let’s name it for our example) which contains format-independent information about our references. So our file may look like this:

You can find more information about other \(\mathrm{Bib\TeX}\) reference entry types and fields here—there’s a huge table showing which fields are supported for which entry types. We’ll talk more about how to prepare files in a later section.

Now we can use with the cite keys as before, but now we replace with a to choose the reference style, as well as to point \(\mathrm{Bib\TeX}\) at the file where the cited references should be looked-up.

This is processed with the following sequence of commands, assuming our \(\mathrm{\LaTeX}\) document is in a file named (and that we are using ):

    and we get the following output:

    Figure 4: \(\mathrm{Bib\TeX}\) output using the bibliography style.

    Whoah! What’s going on here and why are all those (repeated) processes required? Well, here’s what happens.

    1. During the first run, all sees is a and a from . It doesn’t know what all the commands are about! Consequently, within the output PDF, all the commands are simply rendered as [?], and no reference list appears, for now. But writes information about the bibliography style and file, as well as all occurrences of , to the file .

    2. It’s actually that \(\mathrm{Bib\TeX}\) is interested in! It notes the file indicated by , then looks up all the entries with keys that match the commands used in the file. \(\mathrm{Bib\TeX}\) then uses the style specified with to format the cited entries, and writes a formatted list into the file . The production of the file is all that’s achieved in this step; no changes are made to the output PDF.

    3. When is run again, it now sees that a file is available! So it inserts the contents of i.e. the into the \(\mathrm{\LaTeX}\) source, where is. After this step, the reference list appears in the output PDF formatted according to the chosen , but the in-text citations are still [?].

    4. is run again, and this time the commands are replaced with the corresponding numerical labels in the output PDF!

    As before, the build tool takes care of triggering and re-running and as necessary, so you don’t have to worry about this bit. You can inspect the generated file on Overleaf, if you click on the downward-pointing triangle next to the “Download as ZIP” button, and choose the “For submission (with .bbl)” option. This is also useful for some journal submission sites where their internal \(\mathrm{\LaTeX}\) compilation systems do not run separately.

    On some other journals, if you are asked to “copy the contents of the file into your manuscript”, you can also use this download option to access the file. You can then copy-and-paste the contents to replace the original lines in your manuscript.

    A few further things to note about using \(\mathrm{Bib\TeX}\) and :

    • You may have noticed that although contained five \(\mathrm{Bib\TeX}\) reference entries, only two are included in the reference list in the output PDF. This is an important point about \(\mathrm{Bib\TeX}\): the file’s role is to store bibliographic records, and only entries that have been cited (via ) in the files will appear in the reference list. This is similar to how only cited items from an EndNote database will be displayed in the reference list in a Microsoft Word document. If you do want to include all entries—to be displayed but without actually citing all of them—you can write . This also means you can reuse the same file for all your \(\mathrm{\LaTeX}\) projects: entries that are not cited in a particular manuscript or report will be excluded from the reference list in that document.
    • \(\mathrm{Bib\TeX}\) requires one and one to function correctly—in future posts we’ll see how to create multiple bibliographies in the same document. If you keep getting “undefined citation” warnings, check that you have indeed included those two commands, and that the names are spelled correctly. File extensions are not usually required, but bear in mind that file names are case sensitive on some operating systems—including on Overleaf! Therefore, if you typed (note the typo: “e”) instead of , or wrote when the actual file name is , you’ll get the dreaded [?] as citations.
    • In the same vein, treat your cite keys as case-sensitive, always. Use the exact same case or spelling in your as in your file.
    • The order of references in the file does not have any effect on how the reference list is ordered in the output PDF: the sorting order of the reference list is determined by the. For example, some readers might have noticed that, within my earlier example, the first citation in the text is numbered [2], while the second citation in the text () is numbered [1]! Have \(\mathrm{\LaTeX}\) and \(\mathrm{Bib\TeX}\) lost the plot? Not at all: this is actually because the style sorts the reference list by alphabetical order of the first author’s last name. If you prefer a scheme where the numerical citation labels are numbered sequentially throughout the text, you’ll have to choose a bibliography style which implements this. For example, if instead we had used for that example, we’d get the following output. Notice also how the formatting of each cited item in the reference list has automatically updated to suit the IEEE’s style:

    Figure 5: bibliography style output.

    We’ll talk more about different bibliography styles, including author–year citation schemes, in a future blog post. For now, let’s turn our attention to file contents, and how we can make the task of preparing files a bit easier.

    Taking another look at files

    As you may have noticed earlier, a file contains \(\mathrm{Bib\TeX}\) bibliography entries that start with an entry type prefixed with an . Each entry has a some key–value \(\mathrm{Bib\TeX}\) fields, placed within a pair of braces (). The cite key is the first piece of information given within these braces, and every field in the entry must be separated by a comma:

    As a general rule, every bibliography entry should have an , and field, no matter what the type is. There are about a dozen entry types although some bibliography styles may recognise/define more; however, it is likely that you will most frequently use the following entry types:

    • for journal articles (see example above).
    • for conference proceeding articles:
    • for books (see examples above).
    • , for dissertations and theses:
    • is for a book chapter where the entire book was written by the same author(s): the chapter of interest is identified by a chapter number:
    • is for a contributed chapter in a book, so would have its own and . The actual title of the entire book is given in the field; it is likely that an field will also be present:
    • is for whatever doesn’t quite fit any other entry type. It can be especially useful for web pages—by writing or :
      • you will often find it useful to add or in your files’ preamble (for more robust handling of URLs);
      • not all bibliography styles support the field: doesn’t, but does. All styles support . More on this in a future post;
      • you should be mindful that even web pages and entries should have an , a and a field:

    Multiple authors in \(\mathrm{Bib\TeX}\)

    In a file, commas are only used to separate the last name from the first name of an author—if the last name is written first. Individual author names are separated by . So these are correct:

    or

    But none of the following will work correctly—you’ll get weird output, or even error messages from \(\mathrm{Bib\TeX}\)! So take extra care if you are copying author names from a paper or from a web page.

    Multiple-word last names

    If an author’s last name is made up of multiple words separated by spaces, or if it’s actually an organisation, place an extra pair of braces around the last name so that \(\mathrm{Bib\TeX}\) will recognise the grouped words as the last name:

    Alternatively, you can use the format; some users find that clearer and more readable:

    Remember: Whether the first or last name appears first in the output (“John Doe” vs “Doe, John”), or whether the first name is automatically abbreviated “J. Doe” or “Doe, J.” vs “John Doe” “J. Doe”), all such details are controlled by the .

    is actually not a comment character in files! So, inserting a in files not only fails to comment out the line, it also causes some \(\mathrm{Bib\TeX}\) errors. To get \(\mathrm{Bib\TeX}\) to ignore a particular field we just need to rename the field to something that \(\mathrm{Bib\TeX}\) doesn’t recognise. For example, if you want to keep a field around but prefer that it’s ignored (perhaps because you want \(\mathrm{Bib\TeX}\) to use the field instead) write or the more human-readable .

    To get \(\mathrm{Bib\TeX}\) to ignore an entire entry you can remove the before the entry type. A valid reference entry always starts with a followed by the entry type; without the character \(\mathrm{Bib\TeX}\) skips the lines until it encounters another .

    How/where do I actually get those files?

    Edit the file as plain text

    Because files are plain text you can certainly write them by hand—once you’re familiar with \(\mathrm{Bib\TeX}\)’s required syntax. Just make sure that you save it with a extension, and that your editor doesn’t surreptitiously add a or some other suffix. On Overleaf you can click on the “Files…” link at the top of the file list panel, and then on “Add blank file” to create a fresh file to work on.

    Pro tip: Did you know that Google Scholar search results can be exported to a \(\mathrm{Bib\TeX}\) entry? Click on the “Cite” link below each search result, and then on the “\(\mathrm{Bib\TeX}\)” option search. You can then copy the \(\mathrm{Bib\TeX}\) entry generated. Here’s a video that demonstrates the process. Note that you should always double-check the fields presented in the entry, as the automatically populated information isn’t always comprehensive or accurate!

    Help from GUI-based editors

    Many users prefer to use a dedicated \(\mathrm{Bib\TeX}\) bibliography database editor/manager, such as JabRef or BibDesk to maintain, edit and add entries to their files. Using a GUI can indeed help reduce syntax and spelling errors whilst creating bibliography entries in a \(\mathrm{Bib\TeX}\) file. If you prefer, you can prepare your file on your own machine using JabRef, BibDesk or another utility, and then upload it to your Overleaf project using “Files > Bibliography > Upload .bib file”.

    Pro tip: If you’d like to use the same for multiple Overleaf projects, have a look at this help article to set up a “master project”, or this one for sharing files from Google Drive (the instructions apply to other cloud-based storage solutions, such as Dropbox).

    Export from reference library services

    If you click on the “Files > Bibliography” menu item in your Overleaf editor you may notice some options: Import your Mendeley, Zotero and CiteULike libraries! If you’re already using one of those reference library management services, Overleaf can now hook into the Web exporter APIs provided by those services to import the file (generated from your library) into your Overleaf project.

    For other reference library services that don’t have a public API, or are not yet directly integrated with Overleaf, such as EndNote or Paperpile, look for an “export to ” option in the application or service. Once you have a file, you can then add it to your Overleaf project using the steps explained earlier and in the linked help articles.

    I’ve already got a reference list in a Microsoft Word/HTML/PDF file; can I somehow reuse the data without re-typing everything?

    It used to be that you would have to hand-code each line into a or an entry (or another entry type) in a file. As you can imagine, it’s not exactly a task that many people look forward to. Fortunately, these days some tools are available to help. They typically take a plain text file, e.g.

    and attempt to parse the lines, converting it into a structured bibliography as a \(\mathrm{Bib\TeX}\) file. For example, have a look at text2bib or Edifix. Be sure to go through the options of these tools carefully, so that they work well with your existing unstructured bibliography in plain text.

    Summary and future articles

    We’ve now had a quick look at how \(\mathrm{Bib\TeX}\) processes a bibliography database file to resolve commands and produce a formatted reference list, as well as how to prepare files. In an forthcoming post we’ll look further into some popular options, as well as some citation niceties provided by the package.

    Until then, happy \(\mathrm{Bib\TeX}\)ing!

    More news from Overleaf

    Lian Tze Lim

    Community TeXpert

    Computer scientist, once-lecturer, trainer. Enjoys tinkering with LaTeX in the name of productive procrastination (ahem). Personal motto: "all research students are insane at one time or another".

    download example:

    Bibliography

    A typical scientific document contains a number of references, and this leads to the problem of organizing and presentation of the references in the document. The problem can be subdivided into several parts: store of the reference information, later retrieval of this information while preparing the document, and presentation (formatting) of the reference information in the document and in the bibliography according to a particular format.

    A widely-used approach to deal with references in LaTeX documents is to employ BibTeX reference management software. In BibTeX reference information is stored in format-independent plain text file(s) (usually with .bib extension), which can be modified with almost any text editor. Such a text file contains BibTeX entries, and each entry, formed by several text lines, has

    • unique ID or key, needed to identify and refer to the particular entry, for instance Author2001;
    • entry type, which can be article, book, thesis, etc.;
    • entry fields (such as year, publisher, journal, etc.), corresponding to the particular type.

    Here is an example of the article type entry from the .bib file I used while typesetting thesis:

    @article{Khirevich2010,author= {Khirevich, S. and Daneyko, A. and H\"{o}ltzel, A. and Seidel-Morgenstern, A. and Tallarek, U.},doi= {10.1016/j.chroma.2010.05.019},journal= {Journal of Chromatography A},shortjournal= {J. Chromatogr. A},pages= {4713--4722},title= {Statistical analysis of packed beds, the origin of short-range disorder, and its impact on eddy dispersion},volume= {1217},year= {2010}}

    The command \bibliography{reference_list} placed before \begin{document} is used to specify a plain text input file (reference_list.bib here) containing information on references.

    References can be "cited" during editing the LaTeX document using, for example, \cite{key} command, and later at the document compilation step LaTeX input files must be processed with LaTeX and BibTeX.

    The most popular approaches to indicate a reference appearing in the text can be classified as "numeric" and "author–year". The former uses sequential number of a reference in the document

    while "author–year" is based on the extended reference information and may appear like this:

    Each indication has particular advantages and drawbacks. For example, numeric is more compact (i.e., require less space in a text line), and a group of references can be "compressed" into a range in the case they have sequential numbering (i.e., [1,2,3,5] will be shown as [1–3,5]). On the other hand, author–year indication shows more information on the cited document (typically, first one or two author names, and a year of a publication), but requires more space compared to the numeric one. The space consumed by reference may become important if your document has high density of references (and you care about in-line space "wasted" by references :).

    and each number has associated script-sized text at the bottom of the page (where the reference appeared) containing extended information on the cited reference:

    Biblatex

    To create citations in my thesis, I employed the biblatex package, which is one of the most notable packages I have used with LaTeX. The package provides a highly customizable interface for the creation and edit of the presentation of bibliographic data in the document. Compared to the plain BibTeX, biblatex enables relatively easy customization of the appearance of bibliographic data. Below I provide customizations I used to modify the default biblatex output. The detailed description of the biblatex commands is available in the package documentation.

    The two basic commands to enable biblatex and output citation list are

    \usepackage{biblatex}% place in the document preamble\printbibliography% place in the document body where list of citations has to appear

    While preparing the thesis I activated biblatex with the following optionscompiling the document using biblatex with the options
    below will need and
    files (see next
    sections, "Biblatex customization" and "Footnote
    citation"):

    \usepackage[hyperref=true, url=false, isbn=false, backref=true, style=custom-numeric-comp, citereset=chapter, maxcitenames=3, maxbibnames=100, block=none]{biblatex}

    Option hyperref=true was specified to transform various citation elements (like citation number, page number where citation appears, hyperlink to the web page where cited document can be found, etc.) into clickable hyperlinks. This option requires hyperref package (see also notes on hyperref).

    With options url=false,isbn=false I disabled printing the URLs and ISBNs in the bibliography.

    Back references

    Option backref=true enables generation of the back references to the citation, which are usually number(s) of the page where citation appears:

    % backref=true
    % backref=false

    The back reference text preceding the page number ("see p.") can be modified using the following command:

    \DefineBibliographyStrings{english}{%backrefpage= {see p.}, % for single page numberbackrefpages= {see pp.}% for multiple page numbers}

    Just a note on the back references. When you are reading a .pdf document, encounter a reference, and click on it, .pdf viewer will change view to the record of this reference in the bibliography. Now, if you want to return to the main text and continue reading, you may find it difficult to do using back reference when the reference was cited on several pages (back reference will contain several page numbers and you have to bear in mind the original page number you came to the bibliography), and a good solution here is to use "Alt + ←" instead of the back reference itself. On the other hand, back references are useful to indicate how often and where a particular reference was cited in the document.

    Citation style

    Option style=custom-numeric-comp determines the citation style. As seen from its name, the chosen citation style uses numbers (numeric) to indicate citations in text, and consequent numbers are compressed (comp) into a range: [1,2,3,5] is printed as [1–3,5]. Above it was mentioned that I used footnote version of the standard biblatexnumeric-comp style — as a result, each citation has i) its number typeset as superscript, and ii) short and extended reference information located at the bottom of the page ("footnote text") and in the bibliography, respectively:

    Option citereset=chapter defines biblatex behavior for the reference footnote text in a typical situation when a citation appears several times in the document: footnote text for the particular citation is printed only once per document chapter (citereset=chapter), where chapter is defined according to the LaTeX sectioning commands. In my thesis a typical chapter includes about 20 pages, and I assumed citereset=chapter to be quite acceptable. However, one of my colleagues was confused by such a rule for printing the footnote text (i.e., he did not get the logic behind the rule until I have explained it). I was thinking about resetting footnote text as "once-per-page" (not "once-per-chapter") but decided to avoid this due to high density of the references in my thesis. If you are interested in such a behavior some useful information can be found here.

    Amount of displayed author names

    Options maxcitenames=3 and maxbibnames=100 limit amount of authors of the cited document to be printed in the document body and in the bibliography, respectively. If the number of authors exceeds maxcite(bib)names, the author list is truncated according to biblatex settings, and usually printed as "Author1 et al." In my case I have very short authors lists in the footnote text (document body) to reduce space occupied by footnote citations,

    and virtually all authors are displayed in the bibliography:

    I note that I have prepared my thesis with biblatex v. 0.9a (19.03.2010), while this on-line document was prepared and tested on biblatex v. 1.6 (29.07.2011). Options maxcitenames and maxbibnames were not available in v. 0.9a, and the described biblatex behavior (with maxcitenames=3 and maxbibnames=100) was obtained using maxnames=3 while loading the biblatex package, and maxnames=100 while printing the bibliography, i.e.

    \usepackage[..., maxnames=3]{biblatex}% in the document preamble\printbibliography[..., maxnames=100]% in the document body

    The next section continues the discussion of the biblatex customization.

    If you likeI hope you came to the bottom of this
    page not just by fast scrolling the information presented on this web site, and would like to support development of this project you may consider buying me a coffee.

    0 Replies to “Bibtex Format Multiple Authors Bibliography”

    Lascia un Commento

    L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *