2

The following MWE compiles on Overleaf, but it does not on my local MiKTeX installation. It works without the \newrefsection commands. With them, I get undefined citation warnings as well as the warning "Please (re)run BibTeX on the file(s): (biblatex) minimal1-blx (biblatex) minimal2-blx (biblatex) and rerun LaTeX afterwards." Here, minimal.tex was the file name of the MWE on my machine. How do I run BibLaTeX on those files and how can I automate it so that it works for any number of sections?

\documentclass{beamer}
\usepackage[backend=bibtex, style=authoryear]{biblatex}

\begin{filecontents}{biblio.bib} @article{A:2022, author = {A}, title = {xx}, year = {2022}, journal = {zz}} @article{B:2022, author = {B}, title = {yy}, year = {2022}, journal = {zz}} \end{filecontents}

\addbibresource{biblio.bib}

\begin{document}

\section{First Section}\newrefsection

\begin{frame} \textcite{A:2022} \end{frame}

\begin{frame} \printbibliography[heading=none] \end{frame}

\section{Second Section}\newrefsection

\begin{frame} \textcite{B:2022} \end{frame}

\begin{frame} \printbibliography[heading=none] \end{frame} \end{document}

1 Answers1

3

How do I run BibLaTeX on those files and

You are using the backend=bibtex option for biblatex. So you have to run bibtex instead of biber, which one normally uses for biblatex. For your document, the compilation sequence should be something like

pdflatex minimal
bibtex minimal1-blx
bibtex minimal2-blx
pdflatex minimal

(I don't think texmaker has predefined commands for this, you'll probably have to manually do this from the command line)

how can I automate it so that it works for any number of sections?

You can compile your document with

latexmk minimal

This will automatically run all the required tools (that's also what overleaf uses to compile your document).

  • Ah, Latexmk is what I was looking for. For the other command line noobs reading this, it is available in the Texmaker menu. – S. Olafsson Jul 10 '22 at 09:50
  • @S.Olafsson One thing I was wondering: is there a particular reason you use backend=bibtex? Without this, your code would use the much more powerful and modern biber. – samcarter_is_at_topanswers.xyz Jul 10 '22 at 10:54
  • 1
    @S.Olafsson In particular if you run Biber, you only need to call Biber on one file. See for example https://tex.stackexchange.com/q/649174/35864. Another reason to use Biber is https://tex.stackexchange.com/q/649143/35864: You can only use all biblatex features (not only data model customisation, but also full Unicode support) if you use Biber. – moewe Jul 10 '22 at 11:37
  • Good question. Most journals in my field require natbib, which uses BibTeX. Since I don't want to maintain a separate .bib file for my lecture slides, I used the BibTeX backend. However, I have to admit I never checked how many changes I would have to make to the .bib file. Can one have a .bib file that is compatible with both? – S. Olafsson Jul 10 '22 at 16:47
  • @S.Olafsson It is worth giving biber a try. Nearly everything which works with bibtex also works with biber. (the other way round is more problematic, there are special things which only work in biber but not in bibtex, but you don't have to use them) – samcarter_is_at_topanswers.xyz Jul 10 '22 at 18:05
  • 1
    @S.Olafsson The backend you use with biblatex is not the main factor when it comes to compatibility with classical BibTeX styles. The standard data model is the same whether you use biblatex with Biber or BibTeX. For the most part .bib files for classical BibTeX styles will work OK with biblatex, but you may only be able to use biblatex's potential to the fullest if you optimise your .bib files. ... – moewe Jul 10 '22 at 18:06
  • 1
    ... Note that it is not at all the case that all BibTeX styles support the same set of fields with the same meaning. So even when you use only BibTeX (and switch between BibTeX styles only), you may have to tweak entries from time to time. (The classical example is that many of the early BibTeX styles don't support a url field, so there people often use howpublished as workaround.) – moewe Jul 10 '22 at 18:06