Bibliographies made easy: BibTeX and LaTeX

A major annoyance of anyone writing thoroughly researched articles is keeping track of all the citations and managing the bibliography. It can be so bad that people are willing to buy expensive software packages that do it for them. LaTeX (introduced in my other blog) provides a convenient and free solution to this problem through BibTeX.

Creating a bibliography through BibTeX requires two plain text files, a .bib file that contains the details of the references and a .tex file, which is a normal LaTeX file that contains citations. A .bib file is simply a list of references in a specific format. Knowing the exact specifications of the format isn’t necessary since almost all scientific journal search engines, such as Google Scholar and Web of Science, will create BibTeX references for you. For Google Scholar specifically, find the article you want to reference, click cite, click Import Into BibTeX and then copy and paste the text into your .bib file. I have created the following example test.bib file using Google Scholar.

@article{finkelmann1980investigations,
  title={Investigations on liquid crystalline polysiloxanes, 1. 
Synthesis and characterization of linear polymers},
  author={Finkelmann, H. and Rehage, G.},
  journal={Die Makromolekulare Chemie, Rapid Communications},
  volume={1},
  number={1},
  pages={31--34},
  year={1980},
  publisher={Wiley Online Library}
}
@article{sun1997polysiloxanes,
  title={Polysiloxanes: ab initio force field and structural, 
conformational and thermophysical properties},
  author={Sun, H. and Rigby, D.},
  journal={Spectrochimica Acta Part A: Molecular and 
Biomolecular Spectroscopy},
  volume={53},
  number={8},
  pages={1301--1323},
  year={1997},
  publisher={Elsevier}
}
@book{stevens1999polymer,
  title={Polymer Chemistry: An Introduction},
  author={Stevens, M.P.},
  isbn={9780195124446},
  lccn={75005864},
  url={http://books.google.com/books?id=8B2a2NT18x8C},
  year={1999},
  publisher={Oxford University Press}
}
Table 1: Example test.bib file.

Next we need a .tex file that we are going to add citations to. I’ll use the simple .tex file below to add to.

\documentclass[12pt]{article}
\usepackage{fullpage}
\begin{document}
\section{Body}
Text about polysiloxanes.
\end{document}
Table 2: Example test.tex file.

We need to add a couple commands to this .tex file to add a bibliography. First, the command “\usepackage{natbib}” goes in the beginning and is required to load the package for bibliographies. At the end we need to add a “\bibliography{…}” command along with a “\bibliographystyle{…}” command. The “…” in the \bibliography command is the name of the .bib file and the “…” in the \bibliographystyle is the name of a style, examples of styles can be found here. In the text we need to add “\cite{…}” commands. The “…” in \cite{…} is the label for the reference you want to cite. In my test.bib file I have three labels I can choose from, finkelmann1980investigations, sun1997polysiloxanes or stevens1999polymer.

\documentclass[12pt]{article}
\usepackage{fullpage}
\usepackage{natbib}
\begin{document}
\section{Body}
Text about polysiloxanes.\cite{finkelmann1980investigations}
\bibliographystyle{plain}
\bibliography{test}
\end{document}
Table 3: test.tex file with a citation and bibliography added.
10
Figure 1: PDF output from table 3.

To get the output to display correctly whenever citations are added a couple things need to be done. First, LaTeX needs to be run, followed by BibTeX, followed by LaTeX two more times. This can be done in Texmaker by pressing on the keyboard buttons F2, F11, F2 and F2 in quick secession and then pressing the arrow next to quick build to view the output like usual. If your citations appear as question marks then something has gone wrong with your references and you should make sure that your filenames are correct and that the files are in the same folder and then try pressing F2, F11, F2 and F2 again.

Footnotes are another (and simpler) way to cite references. Footnotes can be inserted very easily with the “\footnote{…}” command where anything can be inserted in place of “…”. Footnotes are commonly used among historians and judges as well as other professionals in place of parenthetical citations.

\documentclass[12pt]{article}
\usepackage{fullpage}
\begin{document}
\section{Body}
Text about polysiloxanes.\footnote{This is a footnote.}
\end{document}
Table 4: Example footnote.

Endnotes are a way to cite sources that are similar to footnotes except that they are placed at the end of a chapter or paper. The command “\usepackage{endnotes} is needed in order to use them. The “\endnote{…}” command adds an endnote, where “…” can be anything. The “\theendnotes” command is added at the end and displays the notes.

\documentclass[12pt]{article}
\usepackage{fullpage}
\usepackage{endnotes}
\begin{document}
\section{Body}
Text about polysiloxanes.\endnote{This is an endnote.}
\theendnotes
\end{document}
Table 5: Example endnote.

More information about creating bibliographies with BibTeX can be found here or here. Information about using APA style citations can be found here.

Adam Hogan is a professional writing student and chemistry major at the University of South Florida.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s