I like to keep all my university lecture and tutorial slides for a given course in one file because it is so much less work than having a separate file for each, particularly since I use the article mode with memoir to produce a course book for myself and my TAs.
I have discovered, however, that having a second (or more) \lecture commands interferes with the production of bibliography at the end.
I have tried (unsuccessfully) various schemes suggested by others (e.g., How do I add a separate bibtex bibliography in beamer to each lecture?) but in any case have cobbled together an MWE based on an actual biblatex example file to illustrate the issue.
Somehow, the refsections don't seem to take hold.
For the handout, I want bibliography for only the current lecture. With my memoir template, I want everything: all slides and the entire bibliography. Currently, the slides are properly filtered, but the bibliography is entire, whether slides are included or not.
I can do this using \include files and \includeonly but as noted above would prefer not to split things up.
MWE:
% Handout version follows.
% Alternate header used for 'article' version.
\documentclass[t,ignorenonframetext,handout,hyperref={xetex,bookmarks,breaklinks,colorlinks,unicode,allcolors=blue}]{beamer}
\usetheme{Warsaw}
\usefonttheme{professionalfonts}
\setbeamertemplate{footline}[page number]{}
% Customize for handout mode
\setbeameroption{show notes}
\includeonlylecture{L1}
\usepackage{biblatex-chicago}
\addbibresource{biblatex-examples.bib}
% Main code common to presentation, handout, and article
\mode<all>{
\institute{Department of History\\Miskatonic University}
\title{Course title}
\author{Author}
}
\begin{document}
\begin{titlingpage}
\maketitle
\begin{abstract}
\noindent This course will bla-bla-bla.
\end{abstract}
\end{titlingpage}
\OnehalfSpacing
\frontmatter
\tableofcontents
\mainmatter
% LECTURE
\lecture[Lecture 1]{Syllabus and course introduction}{L1}
\chapter{C1}
\begin{refsection}
\mode<presentation>{%
\begin{frame}{HI999---Course title}
\date{6 Jan 2020}
\title{Syllabus and course introduction}
\maketitle
\end{frame}
}
\begin{frame}{Title}{Subtitle}
This is just filler text \parencite{massa}.
This is just filler text \parencite{augustine}.
This is just filler text \parencite{cotton}.
This is just filler text \parencite{hammond}.
\end{frame}
\begin{frame}[allowframebreaks]{Bibliography}
\printbibliography[heading=subbibliography]
\end{frame}
\end{refsection}
\clearpage
% LECTURE
\lecture[Lecture 2]{First real lecture}{L2}
\chapter{C2}
\begin{refsection}
\mode<presentation>{%
\begin{frame}{HI999---Course title}
\date{8 Jan 2020}
\title{First real lecture}
\subtitle{With subtitle}
\maketitle
\end{frame}
}
\begin{frame}{Title}{Subtitle}
This is just filler text \parencite{murray}.
This is just filler text \parencite{augustine}.
This is just filler text \parencite{cotton}.
This is just filler text \parencite{bertram}.
\end{frame}
\begin{frame}[allowframebreaks]{Bibliography}
\printbibliography[heading=subbibliography]
\end{frame}
\end{refsection}
\clearpage
\backmatter
\end{document}
bbiblatex-examples.bibto avoid confusion. Everybiblatexinstallation comes with this file, so people who can run the example without encountering a missingbiblatex.styerror should have no issue with the.bibfile. – moewe Jan 02 '20 at 13:12