我需要重新制作塞格德主题中的脚注,我按照这线程。但我收到此错误:
presentatie_template.tex|90 错误| 未定义的控制序列。
! 未定义控制序列。\beamer@@tmpl@footline ...\insertauthor ~~\beamer {\insertshortinstitute }{}...
l.31 \开始{文档}
?!紧急停止。\beamer@@tmpl@footline ...\insertauthor ~~\beamer {\insertshortinstitute }{}...
l.31 \开始{文档}
仍在使用的节点内存的 885 个字:11 hlist、2 vlist、3 rule、2 local_par、8 dir、6 glue、4 kern、3 penalty、5 glyph、25 attribute、70 glue_spec、25 attribute_list、8 temp、1 write、1 pdf_de st、10 pdf_colorstack 节点可用列表:2:1,5:1 ! ==> 发生致命错误,未生成输出 PDF 文件!成绩单写在 presentatie_template.log 上。
shell 返回 1
以下是完整的示例代码:
\documentclass[compress]{beamer}
\setbeameroption{show notes}
\useinnertheme{default}
\usefonttheme{professionalfonts}
\usetheme{Szeged}
\usecolortheme{beaver}
\setbeamertemplate{footline}
{
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
\end{beamercolorbox}
\hbox{
\begin{beamercolorbox}[wd=0.5\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}
\usebeamerfont{author in head/foot}\insertauthor~~\beamer{\insertshortinstitute}{}
\end{beamercolorbox}
\begin{beamercolorbox}[wd=0.333333\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}
\begin{beamercolorbox}[wd=0.166666\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}
\usebeamerfont{title in head/foot}\insertframenumber/\inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
\end{beamercolorbox}
}
\title{Sample presentation}
\author{Some}
\institute{Some}
\date{Thu Mar 23 07:00:41 PM CET 2023}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{First frame}
\frame{ \frametitle{First frame}
Some text and
\begin{enumerate}
\item{one}
\item{two}
\item{three}
\end{enumerate}
}
\end{document}
关于如何解决这个问题您有什么想法吗?
答案1
您链接的答案和您的代码之间存在重要差异。您有
\beamer{\insertshortinstitute}{}
这将导致错误,因为\beamer
未定义宏(实际上调用了宏\beamer@ifempty
)。它还需要 3 个参数,而不仅仅是代码中的 2 个。
在链接的答案中,实际的代码是
\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}
它将检查机构是否为空,并且只有当机构不为空时才插入(这可以避免()
在机构为空的情况下插入)
\documentclass[compress]{beamer}
\setbeameroption{show notes}
\useinnertheme{default}
\usefonttheme{professionalfonts}
\usetheme{Szeged}
\usecolortheme{beaver}
\makeatletter
\setbeamertemplate{footline}
{%
\begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
\end{beamercolorbox}
\hbox{%
\begin{beamercolorbox}[wd=0.333333\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor~~\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=0.333333\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=0.333333\paperwidth, ht=2.5ex, dp=1.125ex, center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertframenumber/\inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}
\begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
\end{beamercolorbox}
}
\makeatother
\title{Sample presentation}
\author{Some}
\institute{Some}
\date{Thu Mar 23 07:00:41 PM CET 2023}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{First frame}
\frame{ \frametitle{First frame}
Some text and
\begin{enumerate}
\item{one}
\item{two}
\item{three}
\end{enumerate}
}
\end{document}
答案2
我反复试验,终于找到了答案。修改了以下行:
\usebeamerfont{author in head/foot}\insertauthor~~\beamer{\insertshortinstitute}{}
到:
\usebeamerfont{author in head/foot}\insertauthor \hspace{5pt} \insertshortinstitute{}
错误已解决。