LaTeX forum ⇒ BibTeX, biblatex and biberBeamer bibliography icon together with numbering

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
will_flp
Posts: 6
Joined: Mon Dec 17, 2012 7:06 pm

Beamer bibliography icon together with numbering

Postby will_flp » Thu Jul 08, 2021 3:18 pm

Is it possible to have Beamer bibliography icon together with a numbering?

This post shows a nice way of selecting the icon according to the type of reference. However, beyond showing the type I would like to include the numbering to be emphatic.

This is an example of the output I would like.
Image

A minimal working example (MWE).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{filecontents}{refs.bib} 
@Book{Kuttruff2007,
  author    = {Heinrich Kuttruff},
  publisher = {Taylor \& Francis},
  title     = {Acoustics: an introduction},
  year      = {2007},
  isbn      = {0203970896},
}
\end{filecontents} 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[aspectratio=169]{beamer}

\usepackage[backend=biber, bibstyle=numeric, citestyle=numeric, sorting=none]{biblatex}
\addbibresource{refs.bib}

%% Set the icons 
\setbeamertemplate{bibliography item}{%
  \ifboolexpr{ test {\ifentrytype{book}} or test {\ifentrytype{mvbook}}
    or test {\ifentrytype{collection}} or test {\ifentrytype{mvcollection}}
    or test {\ifentrytype{reference}} or test {\ifentrytype{mvreference}} }
    {\setbeamertemplate{bibliography item}[book]}
    {\ifentrytype{online}
      {\setbeamertemplate{bibliography item}[online]}
      {\setbeamertemplate{bibliography item}[article]}}%
  \usebeamertemplate{bibliography item}}

\defbibenvironment{bibliography}
  {\list{}
     {\settowidth{\labelwidth}{\usebeamertemplate{bibliography item}}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}}
  {\endlist}
  {\item}

\title[Example]{Beamer example}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\section{First section}
\begin{frame}{Title of frame: cite example}
    Contents \cite{Kuttruff2007}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{References}
\begin{frame}[t,noframenumbering,plain,allowframebreaks]{References}
    \frametitle{References}
    \printbibliography
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% EOF


Thanks for the help.

This is a crosspost from TEX Stackexchange.

Return to “BibTeX, biblatex and biber”

Who is online

Users browsing this forum: No registered users and 4 guests