1

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

  • 2
    I think \setbeamertemplate{bibliography item}{\insertbiblabel} only works if the bibliography list is naturally labelled, for biblatex this is the case with the numeric and alphabetic styles, but not with authoryear. (Compare style=numeric,, style=alphabetic, and style=authoryear, with \documentclass{article} to see what it means to be 'naturally labelled'.) For authoryear you can avoid icons with \setbeamertemplate{bibliography item}{}. Note that the result is enough to identify the citation uniquely. Repeating the citation label in the bibliography would be redundant. – moewe Mar 03 '21 at 07:37
  • @moewe Thanks for the comment. In my use case it still would be beneficial but if it's is not "out of the box" possible then I have to accept it :). – Dr. Manuel Kuehner Mar 03 '21 at 07:42
  • 1
    I don't think it is easily possible out of the box, but it is certainly not impossible. But I think labelled lists with author-year labels have the problem that they waste a lot of space. If you cite my favourite, sigfridsson, about one third of the width of your bibliography slide will be occupied by "Sigfridsson and Ryde 1998". That doesn't make for best space efficiency. – moewe Mar 03 '21 at 07:46
  • Just to show how this could look like I cooked up https://gist.github.com/moewew/98bcbfb317159a869b31caf41a2f165c (this is just a quick thing I put together, because I have to leave soon, it is not for production use). I absolute do not recommend you use this, because I find it wrong to abuse alphabetic to get an author-year style and because the output is as it is. – moewe Mar 03 '21 at 07:54
  • @moewe Ok, understood. I am also offline soon (midnight for me). If you do not recommend it then I will not go for it. – Dr. Manuel Kuehner Mar 03 '21 at 07:56
  • @moewe BTW, crazy how fast you put together the proof of concept! – Dr. Manuel Kuehner Mar 03 '21 at 08:00
  • 1
    I might write something up later in case no one else has. There must be ways to get something slightly more sensible without abusing the alphabetic style, which I would find less problematic, but the main conceptual issue of redundancy and waste of space will probably still apply. Anyway, good night! – moewe Mar 03 '21 at 08:00
  • 1
    Have you tried \setbeamertemplate{bibliography item}{[\printfield{labelnumber}]} instead? – Timm Sep 03 '22 at 15:04
  • @Timm Can't test it the next days, I am on vacation. But thanks for the the comment. – Dr. Manuel Kuehner Sep 04 '22 at 04:28

1 Answers1

4

Note that

\setbeamertemplate{bibliography item}{\insertbiblabel}

and

\setbeamertemplate{bibliography item}[text]

are equivalent (assuming standard definitions), so this answer applies to both of these definitions equally.


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.

moewe
  • 175,683
  • Thanks! I "preto" common command? Do you consider this a hack or is this long-term stable and is unlikely to beak anytime soon, e. g. when Beamer or biblatex get updates? – Dr. Manuel Kuehner Mar 04 '21 at 08:05
  • I am offline now and will reply tomorrow if applicable. Again, thanks. – Dr. Manuel Kuehner Mar 04 '21 at 08:07
  • 1
    @Dr.ManuelKuehner \preto is one of the etoolbox patching commands. I don't know if "common command" is a useful classification here. I would say it is ... established, but I wouldn't want to guess how much it is used in the real world. I'd say this is fairly stable: Even though we have to work around the standard settings of beamer here (whose implementation has changed a bit in the past) we do so in a way that should be safe even in the future. – moewe Mar 04 '21 at 08:10
  • Thanks for the follow-up! – Dr. Manuel Kuehner Mar 04 '21 at 21:31