More LaTeX

Citations

We will often need to cite references in our paper. There is an easy way to do this, and a hard way…

References

Let’s get some references

Probability Summation

Photochemical Damage Model

The thebibliography environment (The Hard Way)

  1. Create a special list of our references that will be our bibliography using the thebibliography environment and the \bibitem command.
  2. Cite our references in the paper using the \cite command.

Very similar to using \label and \ref.

Some information from reference 1   \cite{ref1}
and also refernce 2   \cite{ref2}.

\begin{thebibliography}{}
\bibitem{ref1} Reference 1, formatted correctly. 1999
\bibitem{ref2} Reference 2, formatted incorrectly, 2000
\end{thebibliography}

BibTex (The Easy Way… well, at least The Easier Way)

Bibtex is a program that generates Latex bibliographies.

The process is a little convoluted if you don’t know what is happening.

  1. Create a reference database that contains all of the information about our sources.
  2. Use the \cite command to cite references throughout our paper.
  3. Use bibtex to generate our bibliography based on the references we cited and the information in our reference database.
Some information from reference 1   \cite{ref1}
and also refernce 2   \cite{ref2}.

\bibliography{reference_database}{}
\bibliographystyle{plain}

BibTex Database

The Bibtex database is a plain text file with all of the information about our references that we would need to create a bibliography.

@Article{CLARK-2016,
  author    = {Clifton D. Clark III and Gavin D. Buffington},
  title     = {On the probability summation model for laser-damage thresholds},
  journal   = {Journal of Biomedical Optics},
  year      = {2016},
}
@Article{CLARK-2011,
  title                    = {Mathematical model that describes the transition from thermal to photochemical damage in retinal pigment epithelial cell culture},
  author                   = {C.D. {Clark III} and Micael L. Denton and Robert J. Thomas},
  journal                  = {Journal of Biomedical Optics},
  year                     = {2011},
  pages                    = {020504},
  volume                   = {16},
}

BibTex Styles

We can use different styles for our citations and bibliography. There are several installed by default:

BibTex Additional Styles

There are other styles that are not installed by default:

JabRef

JabRef is a program that manages Bibtex reference databased.

We don’t want to be writting these by hand:

@ARTICLE{MOUSSA1977,
  author = {N.A. Moussa and J.J. McGrath and E.G. Cravalho and J. Asimacopoulos},
  title = {Kinetics of Thermal Injury in Cells},
  journal = {Journal of Miomechanical Engineering},
  year = {1977},
  pages = {155--159},
}

Adding bibliography

...

The answer is 42. \cite{Adams-1985}.

\bibliography{references}{}
\bibliographystyle{plain}
\end{document}

Using a template

Publisher-provided Template

Many journals will provide templates for authors to use.

The Journal of Biometical Optics is a SPIE journal that uses an SPIE LaTeX Template.

REVTex

REVTex Homepage is very common.

Download the tds distribution and the samples directory from the docs/ page.

Overleaf

LaTeX is extremely popular, and yet extremely difficult to use…

Overleaf is an online platform for writing LaTeX documents.

Build Scripts

We can automate the entire LaTeX build process from the command line. If we have a bibliography, the compilation needs to happen in 4 steps.

pdflatex main.tex
bibtex main.tex
pdflatex main.tex
pdflatex main.tex

What is happening here?

Its a similar problem to the reference labels. Latex/Bibtex need to figure out what number to use for each reference.