![如何在标题幻灯片上对齐来自两个不同框的文本?](https://linux22.com/image/254014/%E5%A6%82%E4%BD%95%E5%9C%A8%E6%A0%87%E9%A2%98%E5%B9%BB%E7%81%AF%E7%89%87%E4%B8%8A%E5%AF%B9%E9%BD%90%E6%9D%A5%E8%87%AA%E4%B8%A4%E4%B8%AA%E4%B8%8D%E5%90%8C%E6%A1%86%E7%9A%84%E6%96%87%E6%9C%AC%EF%BC%9F.png)
我正在尝试匹配 PowerPoint 模板,因为,好吧,这里有人喜欢 PowerPoint 吗?将图像替换为公共领域的图像,它看起来像这样:
不,我并没有故意选择我能找到的最不好看的东西。我的代码已经做到了这一点:
使用此徽标
和图像这里作为背景。我的 MWE 是使用这个.tex
文件制作的
\documentclass{beamer}
\usetheme{generic}
\title{This Is Sort Of A Descriptive Title}
\author{Author}
\institute[Inst.]{Institute}
\date{Date}
\begin{document}
\begin{frame}[plain]
\titlepage
\end{frame}
\end{document}
这个和这个简单的beamerthemegeneric.sty
文件:
\RequirePackage{tikz}
\useinnertheme[shadow=true]{generic}
\addtobeamertemplate{title page}{
\begin{tikzpicture}[remember picture,overlay]
\node [xshift=0cm,yshift=0cm] at (current page.center) {
\includegraphics[width=\paperwidth,height=\paperheight]{wikiCommonsPic}
};
\node [xshift=0cm,yshift=0cm] at (0.068\paperwidth,0.044\paperheight) {
\includegraphics[width=0.27\paperwidth]{fakeLogo}
};
\end{tikzpicture}
}{}
beamerinnerthemegeneric.sty
不过我的问题在于这个文件:
\DeclareOptionBeamer{shadow}[true]{\def\beamer@themerounded@shadow{#1}}
\ExecuteOptionsBeamer{shadow=false}
\ProcessOptionsBeamer
\setbeamercolor{title page}{fg=white}
\setbeamercolor{titlelike}{fg=white}
\defbeamertemplate*{title page}{myCustom}[1][]{
\vfill
\hbox{
\vbox{
\begin{beamercolorbox}[wd=0.4\paperwidth,sep=8pt,left,#1]{title}
\usebeamerfont{title}\inserttitle
\ifx\insertsubtitle\@empty
\else
\vskip0.25em
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle}
\fi
\end{beamercolorbox}
}
\vbox{
\begin{beamercolorbox}[wd=0.4\paperwidth,sep=8pt,left,#1]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\begin{beamercolorbox}[wd=0.4\paperwidth,sep=8pt,left,#1]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\begin{beamercolorbox}[wd=0.4\paperwidth,sep=8pt,left,#1]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}
\ifx\inserttitlegraphic\@empty
\else
\vskip0.25em
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic}
\fi
}
}
\vskip0pt
}
\setbeamertemplate{title page}[myCustom][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]
如何像在 PowerPoint 中一样将标题文本的顶行与作者文本的顶行对齐?我尝试在各个地方插入胶水,但许多尝试甚至无法编译,说我有一个多余的}
(这对我来说没有意义)。
答案1
使用这个变体(我使用顶部对齐的sbeamerinnerthemegeneric.sty
而不是es ):\vbox
minipage
\DeclareOptionBeamer{shadow}[true]{\def\beamer@themerounded@shadow{#1}}
\ExecuteOptionsBeamer{shadow=false}
\ProcessOptionsBeamer
\setbeamercolor{title page}{fg=white}
\setbeamercolor{titlelike}{fg=white}
\defbeamertemplate*{title page}{myCustom}[1][]{
\vfill
\hbox{
\begin{minipage}[t]{0.4\paperwidth}
\vspace*{0pt}
\begin{beamercolorbox}[wd=0.4\paperwidth,sep=8pt,left,#1]{title}
\usebeamerfont{title}\inserttitle
\ifx\insertsubtitle\@empty
\else
\vskip0.25em
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle}
\fi
\end{beamercolorbox}
\end{minipage}%
\begin{minipage}[t]{0.6\paperwidth}
\vspace*{0pt}
\begin{beamercolorbox}[wd=0.4\paperwidth,sep=8pt,left,#1]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\begin{beamercolorbox}[wd=0.4\paperwidth,sep=8pt,left,#1]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\begin{beamercolorbox}[wd=0.4\paperwidth,sep=8pt,left,#1]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}
\ifx\inserttitlegraphic\@empty
\else
\vskip0.25em
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic}
\fi
\end{minipage}
}
\vskip0pt
}
\setbeamertemplate{title page}[myCustom][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]