64

Instead of the default icons or the text option, I would like to have numbered entries in my bibliography.

I added the line:

\setbeamertemplate{bibliography item}{}

to get rid of the icons, but can't figure out how to get numbers to display in their place. The references in the content slides are numbered, but without the corresponding number in the bibliography it's not very helpful.

MWE:

\documentclass[t]{beamer}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{bibliography item}{}
\setbeamertemplate{frametitle continuation}[from second]

\setbeamertemplate{footline}{
    \hspace*{0.1cm}
    \text{short title}
    \hspace{1cm}
    \insertshortauthor
    \hspace{3.5cm}
    \insertsectionhead
    \hfill
    \insertframenumber
    /
    \inserttotalframenumber
    \hspace{0.1cm}
}

\title{a title}
\author[me]{my full name}
\institute{where I work}
\date{today}

\begin{document}

\begin{frame}
    \titlepage
\end{frame}

\begin{frame}
    \frametitle{1st slide}
    Some text. \cite{ref_1} More interesting text. \cite{ref_2} Some even more interesting stuff. \cite{ref_3} 
\end{frame}

\begin{frame}[allowframebreaks]
\frametitle{References}
    \tiny{\bibliographystyle{abbrv} }
    \bibliography{refs}
\end{frame}

\end{document}

Bib file:

@inproceedings{ref_1,
  title={title 1},
  author={A. Author},
  booktitle={book title},
  year={2010}
}
@article{ref_2,
  title={title 2},
  author={B. Author},
  journal={Journal},
  volume={35},
  number={10},
  pages={1217--1256},
  year={2010},
  publisher={Publisher}
}
@incollection{ref_3,
  title={title 3},
  author={C. Author},
  booktitle={book title},
  pages={595--606},
  year={2012},
  publisher={publisher}
}

Resulting bibliography:

The bibliography I get using the supplied code. No numbers next to the entry.

77

Edited answer

This works independently of the bibliography style, and with biblatex as well.

According to the beamer documentation, subsection 10.6, you can use

\setbeamertemplate{bibliography item}{\insertbiblabel}

instead of

\setbeamertemplate{bibliography item}{}

so that the bib label is inserted for each bib item.

The result is:

enter image description here

Original answer

This works in the particular case of the OP, because using the bibliography style abbrv, \insertbiblabel inserts [\theenumiv].

I think the beamer class uses the counter enumiv to number the items in the thebibliography environment as the standard classes.

So, substituting the line

\setbeamertemplate{bibliography item}{}

with

\setbeamertemplate{bibliography item}{[\theenumiv]}

you should obtain what you want:

enter image description here

  • Awesome! But out of curiosity, is this listed somewhere in the documentation? I looked, but couldn't find anything. – andy mcevoy Jul 16 '13 at 16:21
  • If you mean in the beamer documentation, the answer is no. I've used a trick with the enumiv counter. – karlkoeller Jul 16 '13 at 16:25
  • 4
    In fact, you can simply use \setbeamertemplate{bibliography item}{\insertbiblabel}. – Gonzalo Medina May 16 '14 at 0:33
  • When using biblatex+biber, karlkoellers answer results in all items labelled [0], but @GonzaloMedina's answer works correctly. – gerrit Jun 25 '14 at 16:42
  • For me (biblatex+biber) neither method works. This seems to come from the fact that my style is authoryear. I then use \footcite and I like the way this looks. It seems though that you need to use numerics style in order for this to work. Is there a solution using the authoryear style. Would it be possible to insert the footcite number in the same way you insert the biblabel? – Kvothe Sep 25 '17 at 9:30
12

The accepted answer didn't work with biblatex as all reference numbers became zero. What worked was to substitute the line:

\setbeamertemplate{bibliography item}{} in the code example with:

\setbeamertemplate{bibliography item}[text]

and that works with both bibtex and biblatex.

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. People usually give a minimal working example - please do so too. – strpeter May 13 '14 at 7:02
  • This answer does not work in the code set-up of the question. – Andrew Swann May 13 '14 at 8:08
  • 1
    It does work in the code set-up of the question, I just double-checked it. The answer I posted works with both bibtex and biblatex, but the accepted answer only works with bibtex. Since this method took a while to find I thought I'd post it in case anyone else wanted to use biblatex to do the same. – cazgp May 15 '14 at 23:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.