1

I want to be able to print certain references (separately) on the same frame using biblatex. I thought I could do that using \newrefcontext, however this didn't work as the MWE below shows. All reference are printed whenever \printbibliography is executed.

Additionally, is there a way to have the references number on the frame instead of showing the small page icon? Using \defbibenvironment, which works in normal documents, doesn't seem to work in beamer.

\documentclass{beamer}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Doe2012a,
    author  = {J. Doe},
    title   = {Lorem Ipsum -- Part I},
    journal = {J. Dolor Sit Am.},
    language = {English},
    volume  = {1},
    pages   = {1--10},
    month   = {1},
    year    = {2012},
}
@article{Doe2019a,
    author  = {J. Doe},
    title   = {Lorem Ipsum -- Part II},
    journal = {J. Dolor Sit Am.},
    volume  = {2},
    pages   = {1--30},
    month   = {1},
    year    = {2019},
}
\end{filecontents}
\usepackage[backend=biber, giveninits=true, hyperref]{biblatex}
\addbibresource{\jobname.bib}

\defbibenvironment{bibliography}%
{\scriptsize\begin{enumerate}}%
  {\end{enumerate}}%
{\item}%


\begin{document}
\begin{frame}
  First reference only: \newrefcontext \nocite{Doe2012} \printbibliography

  \vskip 1cm%
  All references: \newrefcontext \nocite{*} \printbibliography
\end{frame}

\end{document}
Tohiko
  • 1,789

1 Answers1

3

To keep bibliographies separate you use refsections not refcontexts. refcontexts control sorting and similar context-dependent data. refsections keep bibliographies and citations completely separate. There are also refsegments, which can be used to subdivide bibliographies without keeping them independent.

Your example works as intended if you use

\newrefsection

instead of \newrefcontext.

You can get the bibliography numbering back with \setbeamertemplate{bibliography item}{\insertbiblabel} as explained in How do I get numbered entries in a beamer bibliography.

\documentclass{beamer}

\usepackage[backend=biber, giveninits=true]{biblatex}

\defbibenvironment{bibliography}
  {\scriptsize\begin{enumerate}}
  {\end{enumerate}}
  {\item}%

\setbeamertemplate{bibliography item}{\insertbiblabel}

\begin{filecontents}{\jobname.bib}
@article{Doe2012a,
  author   = {J. Doe},
  title    = {Lorem Ipsum -- Part I},
  journal  = {J. Dolor Sit Am.},
  language = {English},
  volume   = {1},
  pages    = {1--10},
  month    = {1},
  year     = {2012},
}
@article{Doe2019a,
  author  = {J. Doe},
  title   = {Lorem Ipsum -- Part II},
  journal = {J. Dolor Sit Am.},
  volume  = {2},
  pages   = {1--30},
  month   = {1},
  year    = {2019},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\begin{frame}
  First reference only: \newrefsection \nocite{Doe2012a} \printbibliography

  \vskip 1cm
  All references: \newrefsection \nocite{*} \printbibliography
\end{frame}

\end{document}

Split bibliographies

moewe
  • 175,683