From a3c8439ad6e8d1da89be1069a9d62bedd62a3279 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 29 Oct 2015 10:10:42 -0700 Subject: [PATCH] Beamer template: fix incompatibility of section slides with natbib. Natbib (and presumably biblatex) bibliography commands create their own section. Since these are in frame environments, we have an incompatibility with the `\AtBeginSection` macro which creates a special frame when a new section occurs. (We can't have a frame inside another frame.) This change disables `\AtBeginSection` inside bibliography slides. This supersedes #145. See discussion tehre. --- default.beamer | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/default.beamer b/default.beamer index dcbc161969ea..f4e4be99021c 100644 --- a/default.beamer +++ b/default.beamer @@ -78,6 +78,7 @@ $for(polyglossia-otherlangs)$ $endfor$ \fi $endif$ +\newif\ifbibliography $if(natbib)$ \usepackage{natbib} \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$} @@ -129,9 +130,12 @@ $endif$ \frame{\partpage} } \AtBeginSection{ - \let\insertsectionnumber\relax - \let\sectionname\relax - \frame{\sectionpage} + \ifbibliography + \else + \let\insertsectionnumber\relax + \let\sectionname\relax + \frame{\sectionpage} + \fi } \AtBeginSubsection{ \let\insertsubsectionnumber\relax @@ -215,6 +219,7 @@ $else$ $endif$ $endif$ \begin{frame}[allowframebreaks]{$biblio-title$} +\bibliographytrue \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} \end{frame} @@ -222,6 +227,7 @@ $endif$ $endif$ $if(biblatex)$ \begin{frame}[allowframebreaks]{$biblio-title$} +\bibliographytrue \printbibliography[heading=none] \end{frame}