我正在尝试制作一个beamer
从上往下填充的自定义标题页。我可以使用\beamer@centeringfalse
来更改它,但这是整个文档的全局设置。当我将命令放在 内时\setbeamertemplate{titlepage}
,标题页从中心填充。
有没有办法来解决这个问题?
代码:
\setbeamertemplate{title page}%
{%
\begin{tabular}{l|c|r}%
\begin{beamercolorbox}[wd=0.3\textwidth]{normal text}%
\centering%
\usebeamerfont{author}\insertauthor%
\end{beamercolorbox}&%
\begin{beamercolorbox}[wd=0.3\textwidth]{normal text}%
\centering%
\usebeamerfont{institute}\insertinstitute%
\end{beamercolorbox}&%
\begin{beamercolorbox}[wd=0.3\textwidth]{normal text}%
\centering%
\usebeamerfont{date}\insertdate%
\end{beamercolorbox}%
\end{tabular}
\begin{beamercolorbox}[wd=\textwidth]{normal text}%
\centering%
\usebeamerfont{title}\inserttitle\par%
\end{beamercolorbox}%
\ifx\insertsubtitle\@empty\else%
\begin{beamercolorbox}[wd=\textwidth]{accent text}%
\centering%
\begin{tikzpicture}%
\node[draw, ellipse, minimum width=1cm, minimum height=1cm, line width=2pt, inner sep=2pt] at (2,0) {%
\begin{minipage}{0.25\textwidth}%
\centering%
\usebeamerfont{subtitle}\color{WhiteSmoke}\insertsubtitle\par%
\end{minipage}};%
\end{tikzpicture}%
\end{beamercolorbox}%
\fi%
}
答案1
模板title page
在框架内执行。此时设置框架选项已经太迟了。
为了能够控制标题页的对齐方式,您可以确保标题页填满整个框架[c]
,[t]
否则[b]
框架就无关紧要了。
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes}
\title{text}
\author{names}
\subtitle{subtitle}
\makeatletter
\setbeamertemplate{title page}%
{%
\begin{minipage}[t][\textheight]{\textwidth}
\begin{tabular}{@{}l|c|r@{}}%
\begin{beamercolorbox}[wd=0.3\textwidth]{normal text}%
\centering%
\usebeamerfont{author}\insertauthor%
\end{beamercolorbox}&%
\begin{beamercolorbox}[wd=0.3\textwidth]{normal text}%
\centering%
\usebeamerfont{institute}\insertinstitute%
\end{beamercolorbox}&%
\begin{beamercolorbox}[wd=0.3\textwidth]{normal text}%
\centering%
\usebeamerfont{date}\insertdate%
\end{beamercolorbox}%
\end{tabular}%
\begin{beamercolorbox}[wd=\textwidth]{normal text}%
\centering%
\usebeamerfont{title}\inserttitle\par%
\end{beamercolorbox}%
\ifx\insertsubtitle\@empty\else%
\begin{beamercolorbox}[wd=\textwidth]{accent text}%
\centering%
\begin{tikzpicture}%
\node[draw, ellipse, minimum width=1cm, minimum height=1cm, line width=2pt, inner sep=2pt] at (2,0) {%
\begin{minipage}{0.25\textwidth}%
\centering%
\usebeamerfont{subtitle}\color{red}\insertsubtitle\par%
\end{minipage}};%
\end{tikzpicture}%
\end{beamercolorbox}%
\fi%
\end{minipage}%
}
\makeatother
\begin{document}
\begin{frame}[c]
\titlepage
\end{frame}
\begin{frame}[t]
\titlepage
\end{frame}
\begin{frame}[b]
\titlepage
\end{frame}
\end{document}