[Tex/LaTex] How to add a separate bibtex bibliography in beamer to each lecture

beamerbibliographiesbibtex

I am making lecture notes for a course, and I would like to use includeonlylecture to make a separate slide set for each week.

I use bibtex for citations, and it would best for me if every set of slides would contain an own bibliography. Is there some elegant way to do this?

Thanks and best regards,
CB

Best Answer

Is the use of bibtex mandatory? I am asking, because biblatex provided so called “refsections” which can be used to compile individual bibliographies for parts of document. Below is a very simple MWE that illustrates capabilities.

The key is the use of \newrefsection that tells biblatex where to split the document into subpart regarding the bibliography. You can then use \printbibliography with an optional argument to restrict it to a certain refsection.

\printbibliography[section=1,heading=Lecture1]

I added another optional argument to customize the header of the sub bibliographies. This can be customized with the following command.

 \defbibheading{Lecture1}{\frametitle{References for Lecture 1}}

I put the name into \frametitle{…} since I assume you want it to appear in the title of the frame. But you can basically use any code you want (like, e.g. \section{My bib head}).

I put the bibliographies at the end of the respective sections, but you could also put them all at the end.

\documentclass{beamer}
\usepackage[style=authoryear,backend=bibtex]{biblatex}
\bibliography{bib}

\begin{document}

\defbibheading{Lecture1}{\frametitle{References for Lecture 1}}
\defbibheading{Lecture2}{\frametitle{References for Lecture 2}}

\lecture{Quiet}{Week 1} \newrefsection
    \begin{frame}
        \cite{Smith1997}
    \end{frame}    
    \frame{\printbibliography[section=1,heading=Lecture1]}

\lecture{Loud}{Week 2} \newrefsection  
    \begin{frame}{}
        \cite{Doe2001}
    \end{frame}    
    \frame{\printbibliography[section=2,heading=Lecture2]}

\end{document}

Here are the bib entries I used for this example. Save it as bib.bib.

@article{Smith1997,
    Author = {Smith, Elliot},
    Journal = {Singer and Songwriter},
    Title = {Eithe/Or},
    Volume = {23},
    Year = {1997}}

@article{Doe2001,
    Author = {Converge},
    Journal = {Hardcore and Metal},
    Volume = {19},
    Title = {Jane Doe},
    Year = {2001}}