I'm brand new to Latex and BibTex and am having more trouble than I should generating a bibliography. Just using the example from the ShareLatex website won't work.
I used their text of
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{biblatex}
\addbibresource{sample2}
\begin{document}
Let's cite! The Einstein's journal paper \cite{einstein} and the Dirac's
book \cite{dirac} are physics related items.
\printbibliography
\end{document}
and made a separate file called sample2.bib wherein I put
@article{einstein,
author = "Albert Einstein",
title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
journal = "Annalen der Physik",
volume = "322",
number = "10",
pages = "891--921",
year = "1905",
DOI = "http://dx.doi.org/10.1002/andp.19053221004"
}
@book{latexcompanion,
author = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
title = "The \LaTeX\ Companion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
@misc{knuthwebsite,
author = "Donald Knuth",
title = "Knuth: Computers and Typesetting",
url = "http://www-cs-faculty.stanford.edu/\~{}uno/abcde.html"
}
Then, from TexWorks I run pdflatex -> bibtex -> pdflatex -> pdflatex, and just end up with a one page pdf with all the citation names in bold. But NO bibliography.
How can I get this working? What am I doing wrong?
Thanks for the help,
Best Answer
There are three problems with your setup:
First, since you're loading the
biblatex
package without any special options, you must usebiber
rather thanbibtex
. Ifbiblatex
is loaded without the optionbackend=bibtex
, nothing BibTeX-specific is written to the aux file. The error message you've posted indicates that you've tried to use BibTeX. Given your setup, BibTeX rightly complains that essential meta information (e.g.,\bibdata
) is missing. Either provide the optionbackend=bibtex
and use BibTeX or (better) usebiber
.Next, assuming your sample bibliography file is called
sample2.bib
, the instruction should be\addbibresource{sample2.bib}
rather than\addbibresource{sample2}
. The filename extension is required for use withbiber
.Finally, since there's no entry with key
dirac
in the sample bib file, you should be getting a warning about an unresolved citation even if you runbiber
and fix the\addbibresource
instruction.