我正在尝试将参考资料插入到beamer
页脚中。这些参考资料对于每张幻灯片来说都是不同的,所以我无法将它们包含在页脚模板中 - 除非以后有某种方法可以在每张幻灯片中定义它们。
我试图简单地在 a 之后包含\vfill
,但是线的位置随着每张幻灯片而变化,而这不是我想要的。
如何在特定幻灯片的页脚中插入参考文献(或实际上任何自定义文本)beamer
?
答案1
这提供了一个新的模板/字体/颜色和一个将文本添加到脚注的footline extra
宏。\footlineextra
\documentclass{beamer}
\title{Adding extra text to footline}
\author{R.J.~Drofnats}
\institute{University of St. Anford}
\useoutertheme{infolines}% for example, ymmv
\makeatletter
% add a macro that saves its argument
\newcommand{\footlineextra}[1]{\gdef\insertfootlineextra{#1}}
\newbox\footlineextrabox
% add a beamer template that sets the saved argument in a box.
% The * means that the beamer font and color "footline extra" are automatically added.
\defbeamertemplate*{footline extra}{default}{
\begin{beamercolorbox}[ht=2.25ex,dp=1ex,leftskip=\Gm@lmargin]{footline extra}
\insertfootlineextra
%\par\vspace{2.5pt}
\end{beamercolorbox}
}
\addtobeamertemplate{footline}{%
% set the box with the extra footline material but make it add no vertical space
\setbox\footlineextrabox=\vbox{\usebeamertemplate*{footline extra}}
\vskip -\ht\footlineextrabox
\vskip -\dp\footlineextrabox
\box\footlineextrabox%
}
{}
% patch \begin{frame} to reset the footline extra material
\let\beamer@original@frame=\frame
\def\frame{\gdef\insertfootlineextra{}\beamer@original@frame}
\footlineextra{}
\makeatother
\setbeamercolor{footline extra}{fg=structure.fg}% for instance
\begin{document}
\begin{frame}\maketitle\end{frame}
\begin{frame}{foo}
\begin{itemize}
\item one
\item two
\item three
\end{itemize}
\footlineextra{Source: ``Mr. Lee'' by the Bobbettes}
\end{frame}
\begin{frame}{bar}
\begin{itemize}
\item Able
\item Baker
\item Charlie
\end{itemize}
\footlineextra{Source: \emph{What do People Do All Day?} by Richard Scarry}
\end{frame}
\begin{frame}{baz}
No footlineextra here
\end{frame}
\end{document}
在这个问题上花了一个小时之后,我必须放弃了,但一个不错的补充就是让它\footlineextra
意识到覆盖规范。
答案2
添加不使用 footline 模板的替代方案。这是对我之前回答的评论的回应。(需要 \usepackage{tikz})
\newcommand{\footlineextra}[1]{
\begin{tikzpicture}[remember picture,overlay]
\node[yshift=2ex,anchor=south west] at (current page.south west) {\usebeamerfont{author in head/foot}\hspace{2ex}#1};
\end{tikzpicture}
}
答案3
我也这样做,这是我的技巧,与tikz
之前发布的方法大致类似。
\usepackage[absolute,overlay]{textpos}
\setbeamertemplate{footline}{}
\newcommand{\MyfootnoteBlock}[1]{%
\begin{textblock*}{11cm}(1cm,9.1cm)%
#1%
\end{textblock*}%
}
答案4
\defbeamertemplate{footline}{foot1}{<define footer 1 here>}
\defbeamertemplate{footline}{foot2}{<define footer 2 here>}
...
然后在每一帧之前
\setbeamertemplate{footline}[<foot name>]