tabular
当我在演示文稿中添加环境时footline
,只显示第一行。如何增加脚注线的高度以显示整个表格?
\documentclass[12pt,ngerman]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\setbeamertemplate{navigation symbols}{}
\begin{document}
\setbeamertemplate{footline}{
{
\tiny\begin{tabular}{p{0.25\textwidth}p{0.25\textwidth}p{0.45\textwidth}}
First line & John Doe & fsdfs\\
second line \& Title of the talk & dsdfsd\\
some third line & &
\end{tabular}
}}
\frame{
\frametitle{fdfsdgdf}
\begin{itemize}
\item
\item
\item
\end{itemize}
}
\end{document}
答案1
一个选项是修补\beamer@calculateheadfoot
命令(在文件中定义beamerbaseframecomponents.sty
)以为新的脚注添加一些空间:
\documentclass[12pt,ngerman]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{etoolbox}
\usepackage{lipsum}
\setbeamertemplate{navigation symbols}{}
\makeatletter
\patchcmd{\beamer@calculateheadfoot}{\advance\footheight by 4pt}{\advance\footheight by 20pt}{}{}
\makeatother
\setbeamertemplate{footline}{
{%
\begin{beamercolorbox}[wd=\paperwidth,ht=1.5ex,dp=20pt,leftskip=.3cm,rightskip=.3cm]{author in head/foot}
\tiny\begin{tabular}[t]{@{}p{0.25\textwidth}p{0.25\textwidth}p{0.38\textwidth}@{}}
First line & John Doe & fsdfs\\
second line \& Title of the talk & dsdfsd\\
some third line & &
\end{tabular}
\end{beamercolorbox}
}}
\begin{document}
\frame{
\frametitle{Test Frame}
\lipsum[4]
}
\end{document}
beamercolorbox
我还在定义中添加了,但这是完全可选的。
答案2
随着当前 beamer 开发版本(应包含在 beamer v3.70 或更新版本中),beamer 现在会在每帧开始时重新计算头部和脚部的高度,因此您可以按原样使用代码:
\documentclass[12pt,ngerman]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\setbeamertemplate{navigation symbols}{}
\begin{document}
\setbeamertemplate{footline}{
{
\tiny\begin{tabular}{p{0.25\textwidth}p{0.25\textwidth}p{0.45\textwidth}}
First line & John Doe & fsdfs\\
second line \& Title of the talk & dsdfsd\\
some third line & &
\end{tabular}
}}
\frame{
\frametitle{fdfsdgdf}
\begin{itemize}
\item
\item
\item
\end{itemize}
}
\end{document}