References using BibTeX

This page have some tips and trix on how to use BibTeX and how to write citations to references in the text.

Even though these things are general, I recommend using BibTeX with Overleaf when writing.

When compiling your paper, do not forget to read through the output of the reference list to see that everything in the output of the reference list looks like it should and make sense! This is even more important for reference entries you have entered yourself and not exported from a publisher, database etc. As a reader, you should be able to find the reference based on the reference list in the paper.

Setting up BibTeX and setting the style

There are two commands that are necessary to use to get BibTeX to work in the first place.

\bibliographystyle{<style>}
\bibliography{<bibliography_file.bib>}

example:
\bibliographystyle{apacite}
\bibliography{references.bib}

The bibliography styles are determined by a .bst file (e.g., apacite.bst). However, most of the commons ones are included in e.g., Overleaf. There are a few different bibliography styles that might be of interest.

\bibliographystyle{apacite}                % APA style, i.e. a name and year system
\bibliographystyle{IEEEtran}               % IEEE, i.e. a number and bracket system
\bibliographystyle{ACM-Reference-Format}   % ACM, i.e. a number and bracket system

Observe that the style is case-sensitive (must be the same as the filename of the .bst file)

Citing references in text and ‘natbib’ package

For citation in text it is possible to use the cite-command in LaTeX. When using \cite{...}, one or more references can be put into one citation.

\cite{REF_1}
\cite{REF_1,REF_2,REF_3,...}

For references, especially when writing using a (name, year) system (e.g., APA Style), there are some help you can get from the bibliography management add-on “natbib” and its citation styles. Observe that there are alternatives to the commands below when there are several authors on a publication (by using an asterisk*).

\usepackage{natbib}            % Parenthetical citation
\usepackage[numbers]{natbib}   % Numerical citation

...

\citep{REF_1}        % Parenthetical, or bracket, citation, e.g., "(Mejtoft, 2009)" or "[3]"
\citep*{REF_1}       % Parenthetical citation with all authors printed in the text
\citet{REF_1}        % Textual citation, e.g., "Mejtoft (2009)" or "Mejtoft [3]"
\citet*{REF_1}       % Textual citation with all authors printed in the text
\citeauthor{REF_1}   % Only the name of author(s) in citation, e.g., "Mejtoft"
\citeyear{REF_1}     % Only the year of publication in citation, e.g., "2009"

From time to time a page number needs to be included in the reference. This is done by specifying this in the \cite command.

\cite[p. 89]{REF_1}        % For reference to one page
\cite[pp. 89--90]{REF_1}   % For reference to a range of pages


\usepackage{natbib}
\citet[p. 89]{REF_1}       % e.g., "Mejtoft (2009, p. 89)" or "[23, p. 89]
\citep[p. 89]{REF_1}       % e.g., "(Mejtoft, 2009, p. 89)"

In a similar way as above, it is possible to add information both before and after the citation mark.

\usepackage{natbib}
\citep[see][chapter 8]{REF_1}   % e.g., "(see Mejtoft, 2009, chapter 8)"

Example with parenthetical citations using APA Style.

LaTeX code:
\usepackage{natbib}
\usepackage{apacite}

According to \citet{Mejtoft:2009} many firms using this strategy fail. However, results from a the study carried out by \citeauthor{Mejtoft:2009} in \citeyear{Mejtoft:2009}, failure is not the only option. Firms that break through the market might survive \citep{Mejtoft:2009}. \citet[p. 45]{Mejtoft:2009} states that ``even though some survive, not everyone can''. There are many more examples of this phenomenon \citep[see][Ch 4]{Mejtoft:2009}. 

BibTeX entry:
@book{Mejtoft:2009,
   Author = {Thomas Mejtoft},
   Title = {The survival in any industry},
   Publisher = {The publishing Co.},
   Year = {2009},
   address = {New York: NY}
}

Output (bibliographystyle: apacite):
According to Mejtoft (2009) many firms using this strategy fail. However, results from a the study carried out by Mejtoft in 2009, failure is not the only option. Firms that break through the market might survive (Mejtoft, 2009). Mejtoft (2009, p. 45) states that “even though some survive, not everyone can”. There are many more examples of this phenomenon (see Mejtoft, 2009, Ch 4).

A similar use of names and year around numerical citations can be achieved setting numbers in the natbib package using \usepackage[numbers]{natbib} and using the bibliographystyle IEEEtranN (observe the double “nN”).

LaTeX code:
\usepackage[numbers]{natbib}

According to \citet{Mejtoft:2009} many firms using this strategy fail. However, results from a the study carried out by \citeauthor{Mejtoft:2009} in \citeyear{Mejtoft:2009}, failure is not the only option. Firms that break through the market might survive \citep{Mejtoft:2009}. \citet[p. 45]{Mejtoft:2009} states that ``even though some survive, not everyone can''. There are many more examples of this phenomenon \citep[see][Ch 4]{Mejtoft:2009}. 

BibTeX entry:
@book{Mejtoft:2009,
   Author = {Thomas Mejtoft},
   Title = {The survival in any industry},
   Publisher = {The publishing Co.},
   Year = {2009},
   address = {New York: NY}
}

Output (bibliographystyle: IEEEtranN):
According to Mejtoft [1] many firms using this strategy fail. However, results from a the study carried out by Mejtoft in 2009, failure is not the only option. Firms that break through the market might survive [1]. Mejtoft [1, p. 45] states that “even though some survive, not everyone can”. There are many more examples of this phenomenon [see 1, Ch 4].

Using BibTeX

When compiling the reference list, it is important to be careful and be sure all information is correct. The reference list is used by the readers if they want to access any of our sources and should, hence, include all information needed for that purpose. Below are some tips on how to create a correct output and some of the common problems that can occur.

When using BibTeX (or other systems) you can often export the correct reference directly from the journal/database. This is done by using the “Export/Download Citation/Cite” button on the journal’s/database’s website. To the right are examples from ACM Digital Library, Taylor & Francis Online, Google Scholar, and IEEE Xplore. Using this feature generates a possibility to export the citation data of the article in different format, e.g., BibTeX. If you are using BibTeX, all information needed for a correct entry is (usually) exported. However, do not fully trust all these automatic BibTeX creators, check and see if the output in your article looks ok.


Example of how to export BibTeX entry from ACM Digital Library.
ACM Digtal Library: Click ” to export citation.

Example of how to export BibTeX entry from Taylor and Francis Online.
Taylor and Francis Online: Click “Download citation” to export citation.

Example of how to export BibTeX entry from Google Scholar.
Google Scholar: Click “Cite” to export citation.

Example of how to export BibTeX entry from IEEE Xplore.
IEEE Xplore: Click “Cite This” to export citation.

There are two great online tools to convert a DOI (digital object identifier) name into a BibTeX entry: doi2bib and DOI to BibTeX converter. Please observe that some DOI names might refer to the book/journal. Always check the output and see if the BibTeX entry look correct.

If this feature is not available for your reference, then you need to fill out all the fields by yourself.

Understanding BibTeX Entries

An important part of BibTeX is the .bib file, which contains the BibTeX entries. A BibTeX entry consist of three parts – Entry type, citekey, and a list of key-value pairs. All these things need to be present for the entry to work. The entry starts with the entry type, the other parts are surrounded by curly brackets (or quotation marks) and separated by commas (see example below).

The entry type is the type of refence used. There are ~14 different BibTeX entry types and the entry starts with “@”. The most common entry types are e.g., @article, @book and @inproceedings.

The citekey is a unique key that is used to cite the reference in the text. When creating a larger list of references in BibTeX it is important to structure the list by giving each entry an appropriate citekey. This is important for easier referencing later on. A simple way to solve this is to use e.g., “author:year” or “DOI name” as citekey. However, the citekey can be anything e.g., “reference1”, “smartphone-stats” etc. The most important thing is that you can easily remember which citekey corresponds to a certain entry.

The key-value pairs are different for different entry types but some of the most common ones are e.g. author, title, and year. The key-value pairs should be separated with comma (the comma after the last pair is optional and it does not matter if present or not).

This is the structure of a BibTeX entry:

@entry-type{citekey,
  key-1 = {value-1},
  key-2 = {value-2},
  key-3 = {value-3},
  ...
  key-X = {value-X}
}

In the example below, the entry type is @article, the citekey mejtoft:2010, and the key-value pairs author, title, and year (note that this is not a complete BibTeX entry, for complete examples, see below).

@article{mejtoft:2010,
  author = {Thomas Mejtoft},
  title = {Moving closer to the customers},
  year  = {2010},
  ...
}

For examples of BibTeX entries, see below.

Common problems with references (and how to fix them)

Some of the common problems when writing references is that not all the needed information is entered.

  • Missing page number on journal articles, book chapters, etc.
    On articles, book chapters, and other references that are only part of a publication, the page numbers should be included.
    Note that en-dash (–) (sv: tankstreck) should be used to specify page range in a reference, this is created by using “--” in the BibTex entry.
    Solution: Include the pages key.
pages = {xxx--yyy},
  • Missing volume or issue on journal articles.
    Missing volume or issue of a article might make it more or less impossible to find. For an article this information should be included. Check the publisher, all information is available! The most important is the volume, this cannot be missing.
    Solution: Include the following keys: volume and number.
volume = {XX},
number = {YY},
  • Different style on the output of author(s) on different sources.
    From time to time some authors have full name and some only have initial. This is due to lack of information in the BibTeX entry. The best way to solve this is to include full names (or at least make all entries of a single author similar), then the output in LaTeX changes your BibTeX entry into the correct reference.
    Solution: If you have several authors, write the authors in the correct way in the BibTex entry, meaning using AND (both upper case and lower case works) between the authors names (either way of the example below is fine and will produce the same result).
author = {Thomas Mejtoft AND Ulrik Söderström AND John Doe},

author = {Mejtoft, Thomas AND Söderström, Ulrik AND Doe, John},
  • Missing part of last name in reference
    If a author has several last names or if the author is e.g., an organization, the references might display incorrectly.
    Solution: Words that should be seen as “one word” should be marked with { }. Hence, curly brackets can be used to identify surnames.
author = {Sven Gunnar {Jonsson Wilklund}}
  • Abbreviation of company name
    A entry with company as the author of a document (common for e.g. web pages) might be treated as a human with first name and last name and be abbreviated.
    Solution: Use curly brackets { } to identify the company as “one name”.
author = {{Goldman Sachs Group}}
  • Brand names, names or abbreviations get lower case.
    Some fields (especially the title field) might become lowercase or all words capitalized if the style requires this. This might get e.g. brand names or names of persons etc. to display incorrectly. Curly brackets can be used to protect capital letters.
    Solution: Use curly brackets { } to identify the words that need special treatment and write them with upper/lower case just as they should be displayed.
title = {Using {Microsoft} {HoloLens} in a driving scenario}
  • Missing book title on book chapter.
    Both the title of the chapter and the title of the book need to be in the entry.
    Solution: Include the keys: title and booktitle.
title = {Xyz},
booktitle = {Zyx}
  • Missing editor on book with book chapter.
    If you reference a book chapter from a book with different authors on the chapters, both the author(s) of the chapter and the editor(s) of the book also need to be included.
    Solution: Include the keys: author and editor.
author = {Xxx},
editor = {Xxx AND Yyy}
  • Missing year or date.
    The year (and sometimes the date) is needed to find the reference. Add the year (or date) that the material were published to the entry. If no year or date is available, write “n.d.” for “no date”.
    Solution: Include the key: year.
year = {2010}

year = {n.d.}
  • Incorrect source of the published paper.
    Researchgate, private web pages, and university websites are (most often) not official places of publication, but rather parallel publication of a published paper (otherwise it is to be regarded as unpublished or self-published work and you should be careful and probably not use that source).
    Solution: Find the real source (journal/proceedings/book etc.) and use that source for writing your citation. This information is most often noted somehow on the copy of the paper

Examples

Some of the more common BibTeX styles are @article, @inproceedings, @incollection, @book, @online, and @techreport. Here you can find more examples and how to use the different styles.

Key-value pairs in red is needed to create a useful references (in most cases). The other key-value pairs are information that is useful for retrieving the reference. Please observe that not all optional key-pair values are present in the examples below. For more optional values, please refer to the manual.

@article

This is the common style for a published journal article. This article is written by Thomas Mejtoft and published in in 2010 in the 7th issue of the 18th volume of the Journal of Strategic Marketing on pages 599 to 611. To cite this entry in your document you use the command:

\cite{mejtoft:2018}
@article{mejtoft:2010,
  author = {Thomas Mejtoft},
  title = {Moving closer to the customers: effects of vertical integration in the Swedish commercial 
  printing industry},
  journal = {Journal of Strategic Marketing},
  volume = {18},
  number = {7},
  pages = {599--611},
  year  = {2010},
  publisher = {Routledge},
  doi = {10.1080/0965254X.2010.529153},
  URL = {https://doi.org/10.1080/0965254X.2010.529153},
}

@inproceedings

This is the common style for a published conference paper. This paper is written by Thomas Mejtoft, Sarah Hale and Ulrik Söderström and presented at the 31st European Conference on Cognitive Ergonomics, it is published in the conference proceedings on pages 41 to 44 (a total of 4 pages) by ACM located in New York, NY.

@inproceedings{Mejtoft-Hale-Soderstrom:2019,
  author = {Thomas Mejtoft AND Sarah Hale AND Ulrik S\"{o}derstr\"{o}m},
  title = {Design Friction: How intentionally added friction affect users level of satisfaction},
  booktitle = {Proceedings of the 31st European Conference on Cognitive Ergonomics},
  series = {ECCE 2019},
  year = {2019},
  isbn = {978-1-4503-7166-7},
  pages = {41--44},
  numpages = {4},
  url = {http://doi.acm.org/10.1145/3335082.3335106},
  doi = {10.1145/3335082.3335106},
  publisher = {ACM},
  address = {New York, NY, USA},
} 

Other examples

Here are some other examples:

Book chapter:

@incollection{Mejtoft:2014,
  author = {Thomas Mejtoft},
  title = {Building Relationships for Survival: Coping Media Industry Dynamics},
  booktitle = {Field Guide to Case Study Research in Business-to-business Marketing and Purchasing},
  year = {2014},
  chapter = {3},
  pages = {39--59},
  volume = 21,
  editor = {Arch G. Woodside AND Hugh M. Pattinson AND Roger Marshall},
  publisher = {Emerald Group Publishing Limited},
  isbn = {978-1-78441-080-3},
  issn = {1069-0964},
  doi = {10.1108/S1069-096420140000021000},
  URL = {https://www.emeraldinsight.com/doi/abs/10.1108/S1069-096420140000021000},
}

Book:

@book{rogers-marshall:2017,
  Author = {Yvonne Rogers AND Paul Marshall},
  Title = {Research in the wild: Synthesis lectures on human-centered informatics},
  Publisher = {Morgan \& Claypool},
  Year = {2017},
  address = {San Rafael, CA, USA},
}

Online article:

@online{selze:2016,
  Author = {Steve Selze},
  Year = {2016},
  Month = {apr},
  Day = {3},
  Title = {The fiction of no friction},
  url = {https://medium.com/@steveselzer/the-fiction-of-no-friction-17da9349459a},
  lastaccessed = {February 13, 2019},
}

Report:

@techreport{Mejtoft:2005,
  author = {Thomas Mejtoft}, 
  title = {The cost of digital printing in newspaper production},
  institution = {STFI-Packforsk},
  year = {2005},
  number = {111},
  month = {05},
}

Data set:
(loosly based on APA style)

%Published data set
@misc{customer-survey:2021,
  author = {Thomas Mejtoft},
  title = {Dataset on customer engagement v1.0 [Data file]},
  year = {2021},
  url = {https://www.mejtoft.se/thomas/resources/},
  note = {Retrieved April 22, 2022}
}

%Unpublished data set
@misc{customer-survey:2022,
  author = {Thomas Mejtoft},
  title = {Dataset on collegial value v1.0 [Unpublished raw data]},
  year = {2022},
}
Licensed under a Attribution-ShareAlike 4.0 Creative Commons license.

(First published by Thomas Mejtoft: 2020-03-11; Last updated: 2022-06-28)