我可以在模板而不是文档中指定标题页自定义吗?

我可以在模板而不是文档中指定标题页自定义吗?

我正在尝试创建一个 LaTeXbeamer主题以匹配罗格斯大学的官方 PowerPoint 模板。我已经能够创建标题页,并且这个 MWE

\documentclass{beamer}
    \usepackage{graphicx}
    \usetheme{NewBrunswick}

    \title{This Is A Long Descriptive Title Describing How Much Easier It Would Be To 
        Study \LaTeX{} And Not Hypersonics}
    \author{Someone Other Than Till Tantau}
    \institute[MAE]{Fake Degree Candidate \and Mechanical \& Aerospace Engineering}
    \date{A Long, Long, Time Ago}

\begin{document}
{
\usebackgroundtemplate{
    \includegraphics[width=\paperwidth, height=\paperheight]{rutgersTitle} }
    \begin{frame}[plain]
        \titlepage
    \end{frame} }
\end{document}

使用此 MWEbeamerthemeNewBrunswick.sty文件

\setbeamercolor{titlelike}{fg=white}
\setbeamercolor{title page}{fg=white}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{title page}{family=\rmfamily}
\addtobeamertemplate{title page}{\vspace{3\baselineskip}}{}

类似于:

示例标题页

有没有办法让我将背景图像代码从文档中取出并放入主题文件中?我想分发它,以便用户只需指定

\begin{frame}[plain]
    \titlepage
\end{frame}

并获取我与主题文件一起存储的背景图像。我尝试将其添加到主题文件中

\addtobeamertemplate{title page}{}{
    \usebackgroundtemplate{
        \includegraphics[width=\paperwidth, height=\paperheight]{rutgersTitle} } }

但它并没有像我希望的那样添加背景图像。

编辑:

尝试textpos

\documentclass{beamer}
    \usepackage{graphicx}
    \usetheme{NewBrunswick}

    \title{This Is A Long Descriptive Title Describing How Much Easier It Would Be To
        Study \LaTeX{} And Not Hypersonics}
    \author{Someone Other Than Till Tantau}
    \institute[MAE]{Fake Degree Candidate \and
                    Mechanical \& Aerospace Engineering}
    \date{A Long, Long, Time Ago}

\begin{document}
    \begin{frame}[plain]
        \titlepage
    \end{frame}
\end{document}

现在beamerthemeNewBrunswick.sty包含

\RequirePackage{textpos}

\setbeamercolor{titlelike}{fg=white}
\setbeamercolor{title page}{fg=white}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{title page}{family=\rmfamily}
\addtobeamertemplate{title page}{\vspace{3\baselineskip}}{}

\addtobeamertemplate{title page}{
    \begin{textblock*}{\paperwidth}(-2.6em, -1.6em)
        \includegraphics[width=\paperwidth, height=\paperheight]{rutgersTitle}
    \end{textblock*} }{}

会产生 一个效果新样本 ,你可以看到底部有一个额外的白色条。我使用textpos错了吗?这是我的背景图片: 背景图 我想我应该添加到问题而不是评论中。textpos这里使用居中效果吗?如果我添加类似

\addtobeamertemplate{title page}{\vspace{10\baselineskip}}{}

背景图像在幻灯片上向上移动,而我的文本在幻灯片上向下移动。

编辑解决方案: 使用 Tikz 似乎是避免硬编码大小的唯一方法,因此尽管编译时间增加,我还是选择了它。我的最终文件代码.sty是:

\RequirePackage{tikz}

\setbeamercolor{titlelike}{fg=white}
\setbeamercolor{title page}{fg=white}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{title page}{family=\rmfamily}
\addtobeamertemplate{title page}{\vspace{3\baselineskip}}{}

\addtobeamertemplate{title page}{
    \begin{tikzpicture}[remember picture,overlay]
        \node [xshift=0cm,yshift=0cm] at (current page.center) {
            \includegraphics[width=\paperwidth, height=\paperheight]{rutgersTitle}
        };
        \node [xshift=0cm,yshift=0cm] at (0.04\paperwidth,-0.01\paperheight) {
            \includegraphics[width=3cm]{tigre}
        };
    \end{tikzpicture}
}{}

答案1

尝试使用此beamerthemeNewBrunswick.sty文件;想法是使用蒂克兹包在绝对位置添加背景图像;当然,使用多个节点可以添加多张图片;例如,beamerthemeNewBrunswick.sty按以下方式定义:

\RequirePackage{tikz}

\setbeamercolor{titlelike}{fg=white}
\setbeamercolor{title page}{fg=white}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{title page}{family=\rmfamily}
\addtobeamertemplate{title page}{\vspace{3\baselineskip}}{}

\addtobeamertemplate{title page}{%
\begin{tikzpicture}[remember picture,overlay] 
  \node [xshift=0cm,yshift=0cm] at (current page.center)
  {\includegraphics[width=\paperwidth, height=\paperheight]{rutgersTitle}};             
  \node [xshift=0cm,yshift=0cm] at (1cm,-0.7\paperheight)
  {\includegraphics[width=3cm]{tigre}};             
\end{tikzpicture}%
}{}


\RequirePackage{textpos}

\setbeamercolor{title}{fg=white}
\setbeamercolor{subtitle}{fg=white}
\setbeamercolor{author}{fg=white}
\setbeamercolor{institute}{fg=white}
\setbeamercolor{date}{fg=white}
\setbeamertemplate{navigation symbols}{}
\setbeamerfont{title page}{family=\rmfamily}

\addtobeamertemplate{title page}{%
\begin{textblock*}{\paperwidth}(-2.6em,-1.6em)
\includegraphics[width=\paperwidth, height=\paperheight]{tigre} 
\end{textblock*}%
\begin{textblock*}{2cm}(0cm,6cm)
\includegraphics[width=2cm]{tigre} 
\end{textblock*}
}{}

并使用以下.tex文件:

\documentclass{beamer}
\usepackage{graphicx}
\usetheme{NewBrunswick}

\title{This Is A Long Descriptive Title Describing How Much Easier It Would Be To
        Study \LaTeX{} And Not Hypersonics}
\author{Someone Other Than Till Tantau}
\institute[MAE]{Fake Degree Candidate \and
                    Mechanical \& Aerospace Engineering}
\date{A Long, Long, Time Ago}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\end{document}

你会得到

在此处输入图片描述

相关内容