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.
This commit is contained in:
John MacFarlane 2015-10-29 10:10:42 -07:00
parent de2e524e7d
commit a3c8439ad6

View file

@ -78,6 +78,7 @@ $for(polyglossia-otherlangs)$
$endfor$ $endfor$
\fi \fi
$endif$ $endif$
\newif\ifbibliography
$if(natbib)$ $if(natbib)$
\usepackage{natbib} \usepackage{natbib}
\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$} \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
@ -129,9 +130,12 @@ $endif$
\frame{\partpage} \frame{\partpage}
} }
\AtBeginSection{ \AtBeginSection{
\ifbibliography
\else
\let\insertsectionnumber\relax \let\insertsectionnumber\relax
\let\sectionname\relax \let\sectionname\relax
\frame{\sectionpage} \frame{\sectionpage}
\fi
} }
\AtBeginSubsection{ \AtBeginSubsection{
\let\insertsubsectionnumber\relax \let\insertsubsectionnumber\relax
@ -215,6 +219,7 @@ $else$
$endif$ $endif$
$endif$ $endif$
\begin{frame}[allowframebreaks]{$biblio-title$} \begin{frame}[allowframebreaks]{$biblio-title$}
\bibliographytrue
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$} \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
\end{frame} \end{frame}
@ -222,6 +227,7 @@ $endif$
$endif$ $endif$
$if(biblatex)$ $if(biblatex)$
\begin{frame}[allowframebreaks]{$biblio-title$} \begin{frame}[allowframebreaks]{$biblio-title$}
\bibliographytrue
\printbibliography[heading=none] \printbibliography[heading=none]
\end{frame} \end{frame}