![Bibtex 在 Beamer 中不起作用](https://linux22.com/image/369743/Bibtex%20%E5%9C%A8%20Beamer%20%E4%B8%AD%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我提出一个 MWE:
\documentclass[12pt]{beamer}
\usetheme{Madrid}
\usecolortheme{beaver}
\usefonttheme{professionalfonts}
\usepackage[backend=biber,style=authoryear,natbib=true,url=false]{biblatex}
\addbibresource{biblatex-examples.bib}
\makeatletter
\let\insertsupervisor\relax
\newcommand\supervisortitle{Supervisor}
\mode<all>
{
\newcommand\supervisor[1]{\def\insertsupervisor{#1}}
\titlegraphic{}
}
\defbeamertemplate*{title page}{supdefault}[1][]
{
\vbox{}
\vfill
\begingroup
\centering
\begin{beamercolorbox}[sep=8pt,center,#1]{title}
\usebeamerfont{title}\inserttitle\par%
\ifx\insertsubtitle\@empty\relax%
\else%
\vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]
{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip1em\par
\begin{beamercolorbox}[sep=8pt,center,#1]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\ifx\insertsupervisor\relax\relax\else
\begin{beamercolorbox}[sep=8pt,center,#1]{author}
\usebeamerfont{author}\supervisortitle:~\insertsupervisor
\end{beamercolorbox}\fi
\begin{beamercolorbox}[sep=8pt,center,#1]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center,#1]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}\vskip0.5em
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
\endgroup
\vfill
}
\title[main]{main document}
\author{me}
\supervisor{supervisor}
\AtBeginSection{%
\begin{frame}[allowframebreaks]
\frametitle{Outline}
\tableofcontents[sections=1-2,,currentsection]
\framebreak
\tableofcontents[sections=3-5,,currentsection]
\end{frame}
}
\setbeamertemplate{bibliography item}[text]
\setbeamercolor{section number projected}{bg=white,fg=red}
\setbeamercolor{subsection number projected}{bg=white,fg=red}
\setbeamercolor*{item}{fg=red}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\frametitle{Outline}
\tableofcontents[sections=1-2]
\end{frame}
\begin{frame}
\frametitle{Outline}
\tableofcontents[sections=3-5]
\end{frame}
\section{References and Acknowledgements}
%\subsection{References}
\begin{frame}
test
\nocite{*}
\printbibliography
\end{frame}
\subsection{Acknowledgements}
\end{document}
更新 MWE(2018 年 4 月 2 日) 我运行了这个 MWE 并发现了同样的错误。请提供建议。
答案1
我设法找到了错误......似乎是以下这一行:
\AtBeginSection{%
\begin{frame}[allowframebreaks] \frametitle{Outline}
\tableofcontents[sections=1-2,,currentsection]
\framebreak
\tableofcontents[sections=3-5,,currentsection]
\end{frame}
}
将其更改为
\AtBeginSection[]{%
它能够编译。
非常感谢@moewe,我猜问题部分出在更新 MikTex 上,然后是这个。不过我不确定为什么缺失[]
会成为一个问题,因为我是从其他地方复制的这个段落。