我迫切地想要 (1) 垂直对齐标题页的标题和副标题,同时 (2) 在标题和副标题之间精确创建分隔线。这是我目前得到的结果:
分隔线的垂直空间显然太大了。但是如果我尝试摆弄\vskip
或\vfill
,该线不再垂直居中在标题和副标题之间。此图显示了标题和分隔线之间的正确间距(分隔线和副标题之间的间距明显不对):
我也一直在努力让分隔线的长度与标题的实际宽度一样长。但这只是一个小问题。
这是我的 MWE:
\documentclass[leqno,hyperref={pdfpagemode=FullScreen},aspectratio=169]{beamer}
%%% Fußzeile: deutsches Datum, Autor:in, Folienzahl %%%
\makeatletter
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,left]{date}%
\vspace{2.5pt}
\usebeamerfont{date}\hspace*{3ex}
\insertshortdate{}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author}%
\vspace{2.5pt} \usebeamerfont{author}\insertshortauthor
\end{beamercolorbox}
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{pageno}%
\vspace{2.5pt}
\usebeamerfont{pageno}
\insertframenumber{}\hspace*{7ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
%%% Titelfolie %%%
\setbeamercolor{lower separation line head}{bg=blue}
\makeatletter
\setbeamertemplate{title page}{
\begin{minipage}[b][\paperheight]{\textwidth}
\centering % <-- Center here
\vfill%
\ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi
\vfill%
\ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi\\
\begin{beamercolorbox}[colsep=0.5pt,wd=\textwidth]{lower separation line head}
\end{beamercolorbox} \vfill%
\ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi \vfill%
\usebeamertemplate*{title separator}
\ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi
\ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
\ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
\vfill
\vspace*{1mm}
\end{minipage}
}
\setbeamertemplate{title}{
% \raggedright% % <-- Comment here
\Huge\rmfamily\scshape{\inserttitle}%
\par%
\
\vspace*{0.5em}
}
\setbeamertemplate{subtitle}{
% \raggedright% % <-- Comment here
\huge\rmfamily\scshape\insertsubtitle%
\par%
\vspace*{0.5em}
}
\makeatother
\author{Vitus Schäfftlein}
\title{This is quite a long and completely useless title}
\subtitle{And this is quite a long and completely useless subtitle}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}
有谁能帮助我吗?
答案1
您可以通过在我用 标记的两行中选择相同的值来对称地调整空间% here
:
\documentclass[leqno,hyperref={pdfpagemode=FullScreen},aspectratio=169]{beamer}
%%% Fußzeile: deutsches Datum, Autor:in, Folienzahl %%%
\makeatletter
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,left]{date}%
\vspace{2.5pt}
\usebeamerfont{date}\hspace*{3ex}
\insertshortdate{}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author}%
\vspace{2.5pt} \usebeamerfont{author}\insertshortauthor
\end{beamercolorbox}
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{pageno}%
\vspace{2.5pt}
\usebeamerfont{pageno}
\insertframenumber{}\hspace*{7ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
%%% Titelfolie %%%
\setbeamercolor{lower separation line head}{bg=blue}
\makeatletter
\setbeamertemplate{title page}{
\begin{minipage}[b][\paperheight]{\textwidth}
\centering % <-- Center here
\vfill%
\ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi
\vfill%
\ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi\\
\vspace{0.25cm} % here
\begin{beamercolorbox}[colsep=0.5pt,wd=\textwidth]{lower separation line head}
\end{beamercolorbox}
% \vfill%
\vspace*{0.25em} % here
\ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi \vfill%
\usebeamertemplate*{title separator}
\ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi
\ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
\ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
\vfill
\vspace*{1mm}
\end{minipage}
}
\setbeamertemplate{title}{
% \raggedright% % <-- Comment here
\Huge\rmfamily\scshape{\inserttitle}%
}
\setbeamertemplate{subtitle}{
% \raggedright% % <-- Comment here
\huge\rmfamily\scshape\insertsubtitle%
\par%
\vspace*{0.5em}
}
\makeatother
\author{Vitus Schäfftlein}
\title{This is quite a long and completely useless title}
\subtitle{And this is quite a long and completely useless subtitle}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}