0

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!

MGL
  • 1
  • Welcome to TeX.SE! Did you run biber (instead of bibtex) in between LaTeX runs? – Marijn Mar 01 '21 at 21:07
  • 2
    Note also that Biblatex is not necessarily 'better' than BibTeX, it has more possibilities to customize the bibliography and the citations in the document, but for many cases customization is not necessary (or even disallowed, for example when using a template for a journal or conference), so BibTeX is equally useful in such cases. – Marijn Mar 01 '21 at 21:09
  • You need to run Biber on your file using biblatex and 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:12
  • Apart from that I (also) agree with Marijn's second comment. Switching to biblatex for 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 of biblatex that are not available or really hard to pull off in classical BibTeX; if you need those, then it probably makes perfect sense to switch to biblatex. ... – moewe Mar 02 '21 at 07:17
  • ... But if you are happy with what you have so far, switching to biblatex and trying to make it replicate BibTeX's output exactly might not be the best use of your time. One huge drawback of biblatex is that it is not widely used or accepted by publishers and journals, who usually prefer BibTeX-based submissions (because biblatex would imply a very different workflow). Even the arXiv works much better with classical BibTeX than biblatex at the moment. – moewe Mar 02 '21 at 07:20
  • Marijn, moewe: Many thanks for your comments, they were really helpful and showed me how to get things to work. Actually my switch to Biblatex was prompted more by a desire to employ a very handy book template that requires me to use it. But I hear you about it not being necessarily "better" than BibTex. I might revise my plans, but that's my problem and not yours. Once again, thanks for your time. – MGL Mar 02 '21 at 09:55

0 Answers0