Skip to content

Commit

Permalink
Beamer template: fix incompatibility of section slides with natbib.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jgm committed Oct 29, 2015
1 parent de2e524 commit a3c8439
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions default.beamer
Original file line number Diff line number Diff line change
Expand Up @@ -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$}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -215,13 +219,15 @@ $else$
$endif$
$endif$
\begin{frame}[allowframebreaks]{$biblio-title$}
\bibliographytrue
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
\end{frame}

$endif$
$endif$
$if(biblatex)$
\begin{frame}[allowframebreaks]{$biblio-title$}
\bibliographytrue
\printbibliography[heading=none]
\end{frame}

Expand Down

0 comments on commit a3c8439

Please sign in to comment.