В зависимости от содержания \AtBeginSectionя получаю разные ошибки

В зависимости от содержания \AtBeginSectionя получаю разные ошибки

У меня есть базовый MWE [после удаления 400 несвязанных строк кода :(], содержащий beamerпрезентацию с библиографией, которая генерируется biblatex.

\documentclass{beamer}

\usepackage{tikz}

\usepackage{biblatex}   

\begin{filecontents}{BibDatabase.bib}
@book{Miller2012,
    author = {Adam Miller},
    title = {Clever Book Title},
    date = {2012},
}
\end{filecontents}

\addbibresource{BibDatabase.bib}    

\AtBeginSection{
    \begin{frame}[plain]
    \begin{tikzpicture}
    \end{tikzpicture}
    \end{frame}
}

\begin{document}

\section{test}
\begin{frame}
  \cite{Miller2012}
  \printbibliography
\end{frame}

\end{document}

В зависимости от содержания \AtBeginSectionя получаю разные ошибки

Ошибка 1 ( plainопция активна)

\begin{frame}[plain]
\begin{tikzpicture}
\end{tikzpicture}
\end{frame}
! Extra }, or forgotten \endgroup.
\endframe ->\egroup 
                    \begingroup \def \@currenvir {frame}
l.30 \end{frame}

I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.

Ошибка 2 ( plainвариантнетактивен / tikzpictureудален)

\AtBeginSection{
    \begin{frame}%[plain]
    \begin{tikzpicture}
    \end{tikzpicture}
    \end{frame}
}

\AtBeginSection{
    \begin{frame}%[plain]
    %\begin{tikzpicture}
    %\end{tikzpicture}
    \end{frame}
}
! Missing \endcsname inserted.
<to be read again> 
                   \vrule 
l.30 \end{frame}

The control sequence marked <to be read again> should
not appear between \csname and \endcsname.

Ошибок нет (вообще нет контента)

\AtBeginSection{
%   \begin{frame}%[plain]
%   \begin{tikzpicture}
%   \end{tikzpicture}
%   \end{frame}
}

введите описание изображения здесь

Можете ли вы воспроизвести проблему?

решение1

\printbibliographyвызывает \section*. Следовательно, вы пытаетесь вложить a frameв a frame, что не может работать.

Либо используйте

\AtBeginSection[]{%
  ...
}

чтобы избежать настройки в ненумерованных разделах, или используйте

\printbibliography[heading=none]

чтобы избежать \printbibliographyсоздания заголовка раздела.

Связанный контент