I am new to LaTeX and I need to create a list of references.
I browsed through this forum and couldn't find some uniform standard for doing references.
Many people are using, e.g, How to reference properly when citations are grouped by sections
\begin{filecontents*}
@article{A1,
keywords = {articles},
title={First Paper},
author={Green},
journal={Journal 1},
note={based on \cite{C2}},
year={2014}
}
Others are using, e.g., When I use the \begin{thebibliography} command, I get it as a chapter. How can I get rid of that?
\begin{thebibliography}{10}
\bibitem{notes} John W. Dower {\emph{Readings compiled for History 21.479.}} 1991.
\bibitem{impj} The Japan Reader {\emph{Imperial Japan 1800-1945}} 1973: Random House, N.Y.
\end{thebibliography}
What is the form of citation that someone new to LaTeX should use?
And based on what criteria would one choose one method of citation over the other?
Best Answer
For practical purposes the distinction that should be made is not between
thebibliography
on one side andfilecontents
on the other, but betweenthebibliography
on one side and.bib
files and BibTeX on the other.In the bibliography context
filecontents
is usually only used to make example files self-contained and produce a.bib
file for use with BibTeX. That is why you will find many mentions of it here, but in production use one would normally not use it. (I don't doubt that some people do, maybe because they find it more convenient, or maybe because they picked it up as a habit from various sites on the web.)Manual
thebibliography
thebibliography
is the manual way to produce bibliographies in citations. All LaTeX offers you here is basically a way to produce a list of labelled entries that can be referenced with\cite
.thebibliography
usually works like anenumerate
list that uses\bibitem[<optional label>]{<entry key>}
instead of\item[<optional label>]
and automatically sets a\label
that you can refer to with\cite
(instead of\ref
). Everything else is left to you. You have to write and format the entire entry, you have to sort the list, you have to assign labels if you don't want to use a numbered citation style.Pros
enumerate
.Cons
Dower, John W.
instead ofJohn W. Dower
in all of your entries. You'd have to invert each and every name manually.)For a handful bibliography entries with a straightforward bibliography style writing
thebibliography
manually is an option. But as soon as you plan on citing more works or want to be able to change the style easily or want to avoid inconsistencies other methods are usually better..bib
files (BibTeX).bib
files are a way to address many of the cons of a manualthebibliography
by introducing another layer of abstraction and a middle man called BibTeX..bib
files contain the relevant bibliographic information of a work you want to cite in a systematic and machine-readable form.Instead of writing
thebibliography
manually you tell LaTeX about the bibliography style you would like to see your bibliography formatted in and BibTeX (a helper program, see Question mark or bold citation key instead of citation number) will produce thethebibliography
environment for you (in the.bbl
file), which LaTeX automatically reads and typesets.Assuming your
.bib
file calledmybibfile.bib
contains the above entry, you could cite it and produce a bibliography in your document calledmydoc.tex
withby running (at least) LaTeX, BibTeX, LaTeX, LaTeX (more precisely
pdflatex mydoc
,bibtex mydoc
,pdflatex mydoc
,pdflatex mydoc
, assumingpdflatex
is your preferred flavour of LaTeX) on that file.Pros
\bibliographystyle
..bib
entries in your.bib
file that you don't cite. That means that it is possible to have one master.bib
file for several documents with different bibliographies.Cons
.bib
file..bst
files) with their reverse Polish notation..bib
files and use the BibTeX ecosystem..bib
files (biblatex
)There is actually another method that shares the same basic ideas of
.bib
files as the BibTeX approach:biblatex
. From a user perspective the BibTeX method explained above andbiblatex
are not all that different: You have a.bib
file, you have a few commands in your.tex
file to tell LaTeX and its helper which bibliography style you want, you run an external program (withbiblatex
usually Biber instead of BibTeX, thoughbiblatex
also works with BibTeX as backend). But under the hood the two systems are very different.biblatex
does not rely onthebibliography
and completely reimplements all bibliographic and citation features. Its bibliography style programming language is not based on the reverse Polish notation from BibTeX, styles can be programmed directly in LaTeX.To the intents and purposes of this comparison the pros and cons of
biblatex
and BibTeX vsthebibliography
are roughly the same. A detailed comparison can be found in bibtex vs. biber and biblatex vs. natbib..bib
files make sense if you have a larger bibliography and if you don't want to have to worry about consistency, formatting details and sorting. I usually recommend to use.bib
files over manualthebibliography
. Whether you want to use classical BibTeX orbiblatex
is a different matter (I'm biased towardsbiblatex
, but there are reasons to prefer BibTeX overbiblatex
).filecontents
As mentioned above
filecontents
is not really something that can be compared tothebibliography
and the BibTeX orbiblatex
approach to bibliographies, it is just a way to produce external files from within a.tex
document.mydoc.tex
from above would then look likeYou would run LaTeX, BibTeX, LaTeX, LaTeX on that file and that would produce a document with a citation and a bibliography. The interesting bit is that the first LaTeX run will produce the
.bib
filemydoc.bib
that is then used as the bibliography database.Further reading
This answer was meant as a short comparison between manual
thebibliography
and.bib
files with BibTeX/biblatex
. It does not want to be a tutorial or showcase of BibTeX.There are many tutorials and beginner's guides out there for bibliographies with LaTeX. Some are very good, others not so much.
I think https://www.dickimaw-books.com/latex/novices/html/biblio.html and https://www.dickimaw-books.com/latex/thesis/html/citations.html are very good places to start for
thebibliography
and BibTeX/biblatex
.For
biblatex
there is biblatex in a nutshell (for beginners).