git.iko.soy/typeable/pandoc
on master help sign in
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.

commita3c8439ad6e8d1da89be1069a9d62bedd62a3279 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 29 Oct 2015, 10:10 (11 years ago) parentde2e524
1 file changed+9−3
default.beamer+9−3
default.beamer+9−3
@@ -78,6 +78,7 @@ $for(polyglossia-otherlangs)$
7878$endfor$
7979\fi
8080$endif$
81+\newif\ifbibliography
8182$if(natbib)$
8283\usepackage{natbib}
8384\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
@@ -129,9 +130,12 @@ $endif$
129130 \frame{\partpage}
130131}
131132\AtBeginSection{
132− \let\insertsectionnumber\relax
133− \let\sectionname\relax
134− \frame{\sectionpage}
133+ \ifbibliography
134+ \else
135+ \let\insertsectionnumber\relax
136+ \let\sectionname\relax
137+ \frame{\sectionpage}
138+ \fi
135139}
136140\AtBeginSubsection{
137141 \let\insertsubsectionnumber\relax
@@ -215,6 +219,7 @@ $else$
215219$endif$
216220$endif$
217221\begin{frame}[allowframebreaks]{$biblio-title$}
222+\bibliographytrue
218223\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
219224\end{frame}
220225
@@ -222,6 +227,7 @@ $endif$
222227$endif$
223228$if(biblatex)$
224229\begin{frame}[allowframebreaks]{$biblio-title$}
230+\bibliographytrue
225231\printbibliography[heading=none]
226232\end{frame}
227233