[Tex/LaTex] Bibliography numbering in Beamer with authoryear style

beamerbiblatex

I use a (biblatex+biber) style=authoryear bibliography, and do my citations using \footcite{}. I like the way this looks when citing. However, in the bibliography I want the item bullets to be numbers like you can do when using the numbered style (as is explained in How do I get numbered entries in a beamer bibliography). How can I do the same thing, but using the footcite counter instead.


Requested minimal example: I want the output produced by the code below, except I want the bibliography to have an item bullet [i] where i is the number of the foot citation (instead of the document icon).

\documentclass{beamer}

\usepackage[backend=biber,
style=authoryear,
sorting=none,
bibencoding=ascii
]{biblatex}


\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
  @book{Knu86,
    author = {Knuth, Donald E.},
    year = {1986},
    title = {The \TeX book},
  }
  @book{Aut,
    author = {Author, A.},
    year = {2000},
    title = {A book},
  }
\end{filecontents*}

\addbibresource{\jobname.bib}

% \setbeamertemplate{bibliography item}{???} % Insert something that hopefully magically fixes everything.


\begin{document}

\begin{frame}
  Citation one \footcite{Knu86}
\end{frame}

\begin{frame}
  Citation two \footcite{Aut}
\end{frame}

\begin{frame}
  \frametitle{References}
    \printbibliography
\end{frame}

\end{document}

Note that including \setbeamertemplate{bibliography item}{\insertbiblabel} would have been the solution if I had used style=authoryear.

Only footcite is used to for citations and bibliography entries are never cited twice. There is a clear one to one map from footcite numbering and the bibliography numbering so I'm hoping that a Tex expert knows how to make this work.

Best Answer

Try this

\documentclass{beamer}

\usepackage[backend=biber, citestyle=numeric, bibstyle=authoryear, sorting=none, autocite=superscript, labeldateparts]{biblatex}
\addbibresource{biblatex-examples.bib}

\setbeamertemplate{bibliography item}{\insertbiblabel}

\makeatletter
\input{numeric.bbx}
\makeatother

\newbibmacro*{aycite:shorthand}{%
  \printtext[bibhyperref]{\printfield{shorthand}}}

\newbibmacro*{aycite:label}{%
  \iffieldundef{label}
    {\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}
    {\printtext[bibhyperref]{\printfield{label}}}}

\newbibmacro*{aycite:labelyear+extrayear}{%
  \iffieldundef{labelyear}
    {}
    {\printtext[bibhyperref]{\printlabeldateextra}}}

\newbibmacro*{aycite}{%
  \iffieldundef{shorthand}
    {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
       {\usebibmacro{aycite:label}%
        \setunit{\printdelim{nonameyeardelim}}}
       {\printnames{labelname}%
        \setunit{\printdelim{nameyeardelim}}}%
     \usebibmacro{aycite:labelyear+extrayear}}
    {\usebibmacro{aycite:shorthand}}}

\DeclareCiteCommand{\supercite}
  {}
  {\footnote[\thefield{labelnumber}]{\usebibmacro{prenote}\usebibmacro{aycite}\usebibmacro{postnote}}}
  {\supercitedelim}
  {}

\begin{document}

\begin{frame}
  Citation one \autocite[12]{sigfridsson}
\end{frame}

\begin{frame}
  Citation two \autocite{worman}
\end{frame}

\begin{frame}
  Citation three \autocite{nussbaum}
  Citation four \autocite{sigfridsson}
\end{frame}

\begin{frame}
  \frametitle{References}
  \printbibliography
\end{frame}

\end{document}

Essentially we combine authoryear and numeric as in Combining style numeric with style authoryear in BibLaTeX, furthermore, we use \supercite to give us a footnote with the citation number. The code for the ay macros is from authoryear.cbx. Numbers are printed in the bibliography thanks to How do I get numbered entries in a beamer bibliography

example page 1 (footnote was moved) example page 2 (footnote was moved) example page 3 (footnote was moved) example page 4 (cropped)

Related Question