TransWikia.com

beamer + biblatex: authoryear causes problem with "insertbiblabel"

TeX - LaTeX Asked on May 31, 2021

Introduction

  • I want to use biblatex (biber) in beamer.
  • I also want to use the style authoryear.
  • In order to have the cite label (e. g. <Author YYYY>) instead of a symbol in the bibliography, I use setbeamertemplate{bibliography item}{insertbiblabel}, see here for example.
  • Sadly, this causes the error ! Undefined control sequence.beamer@@tmpl@bibliography item ->insertbiblabel.

Questions

  1. Can you reproduce the problem?
  2. Do you have a solution?

documentclass{beamer}

usepackage[
    style = authoryear % (un)comment for testing
    ]{biblatex}%

addbibresource{biblatex-examples.bib}
setbeamertemplate{bibliography item}{insertbiblabel} % (un)comment for testing

begin{document}

section{Section}
begin{frame}
cite{doody}
end{frame}

begin{frame}[allowframebreaks]
frametitle{References}
    printbibliography
end{frame}

end{document} 

My system is a up-to-date TeXLive 2020: This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex 2021.3.2) 2 MAR 2021 23:22

One Answer

With biblatex, insertbiblabel only works with styles that have a labelled bibliography list (numeric and alphabetic styles; to see what it means to have a 'labelled' bibliography list compare the output of style=alphabetic, and style=authoryear, with documentclass{article}). The authoryear style does not have a labelled bibliography list and it does not repeat the citation labels in the bibliography.

So with authoryear there simply is no label for insertbiblabel to insert.

I would just use

documentclass{beamer}

usepackage[style=authoryear]{biblatex}

addbibresource{biblatex-examples.bib}

setbeamertemplate{bibliography item}{}

begin{document}
begin{frame}
  cite{doody,sigfridsson}
end{frame}

begin{frame}[allowframebreaks]
  frametitle{References}
  printbibliography
end{frame}
end{document}

Sigfridsson, Emma and Ulf Ryde (1998). “Comparison of methods for deriving atomic charges from the electrostatic potential and moments”

which gives you fundamentally the same output as with documentclass{article}.


If you want to repeat the citation labels in the bibliography to make it easier to find entries, you can use biblatex-ext as follows

documentclass{beamer}

usepackage[backend=biber,
  bibstyle=ext-authoryear,
  citestyle=ext-authoryear,
  sorting=nyt,
  introcite=label,
]{biblatex}

addbibresource{biblatex-examples.bib}

setbeamertemplate{bibliography item}{insertbiblabel}

% avoid error about insertbiblabel being undefined
preto{bibsetup}{providecommand*{insertbiblabel}{}}

begin{document}
begin{frame}
  cite{doody,sigfridsson}
end{frame}

begin{frame}[allowframebreaks]
  frametitle{References}
  printbibliography
end{frame}
end{document}

Sigfridsson and Ryde 1998//Sigfridsson, Emma and Ulf Ryde (1998). “Comparison of methods for deriving atomic charges from the electrostatic potential and moments”. In: Journal of Computational Chemistry 19.4, pp. 377–395. doi:10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P.

Correct answer by moewe on May 31, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP