I am trying to replicate with biblatex a very simple specification that works with bibtex (but I want to migrate to biblatex because it's better).
This works fine (which proves as well that my .bib file has no errors):
\documentclass[11pt,a4paper]{article}
\usepackage{setspace}
\usepackage[a4paper,includeheadfoot,margin=2.54cm]{geometry}
\begin{document}
\title{\vspace{-2.54cm}Simple Test of \texttt{bibtex}}
\author{}
\date{}
\maketitle
Three items are cited:
\begin{itemize}
\item \textit{The \LaTeX\ Companion} book \cite{latexcompanion}
\item The Einstein journal paper \cite{einstein}
\item The Donald Knuth website \cite{knuthwebsite}
\end{itemize}
The \LaTeX\ related items are \cite{latexcompanion,knuthwebsite}.
\bibliographystyle{plain}
\bibliography{sample}
\end{document}
But this won't work:
\documentclass[11pt,a4paper]{article}
\usepackage{setspace}
\usepackage[a4paper,includeheadfoot,margin=2.54cm]{geometry}
\usepackage{biblatex}
\addbibresource{sample.bib}
\begin{document}
\title{\vspace{-2.54cm}Simple Test of \texttt{biblatex}}
\author{}
\date{}
\maketitle
Three items are cited:
\begin{itemize}
\item \textit{The \LaTeX\ Companion} book \cite{latexcompanion}
\item The Einstein journal paper \cite{einstein}
\item The Donald Knuth's website \cite{knuthwebsite}
\end{itemize}
The \LaTeX\ related items are \cite{latexcompanion,knuthwebsite}.
\printbibliography[title={References}]
\end{document}
The references are undefined. Anyone that can point out to me what I am doing wrong would be doing me a very great favour.
My sample.bib file, for what it's worth, is as follows:
@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"
}
Thanks!
biber(instead ofbibtex) in between LaTeX runs? – Marijn Mar 01 '21 at 21:07biblatexand not BibTeX as with the file using\bibliographystyle. If you are using an editor to compile your document, see https://tex.stackexchange.com/q/154751/35864 for help on configuring it to run Biber for you. – moewe Mar 02 '21 at 07:12biblatexfor the sake of switching or because you heard it is 'better' (but have no concrete use for any of its advanced features) might not be the best course of action. Of course there are features ofbiblatexthat are not available or really hard to pull off in classical BibTeX; if you need those, then it probably makes perfect sense to switch tobiblatex. ... – moewe Mar 02 '21 at 07:17biblatexand trying to make it replicate BibTeX's output exactly might not be the best use of your time. One huge drawback ofbiblatexis that it is not widely used or accepted by publishers and journals, who usually prefer BibTeX-based submissions (becausebiblatexwould imply a very different workflow). Even the arXiv works much better with classical BibTeX thanbiblatexat the moment. – moewe Mar 02 '21 at 07:20