我有一个投影仪演示文稿,在这里(框架标题文本的字体和位置) 我得到了帮助,定义了正确的 frametitle 环境。现在,我希望在标题页上也拥有水平线和徽标(如果可能的话,大约在同一位置,见下图)。我尝试使用“%\textcolor{red}{\rule{16cm}{1mm}}”并在标题页上创建一个空的 frametitle 环境,但这没有任何结果。
我使用的背景图片:https://images.pexels.com/photos/1323550/pexels-photo-1323550.jpeg和现在的代码
\documentclass[mathserif,11pt]{beamer}
\setbeamercolor{frametitle}{fg=Black}
\setbeamercolor{lower separation line head}{bg=red}
\usepackage{fontspec}
\usepackage{lipsum}
\usepackage{hyperref,graphicx}
\definecolor{mycolor}{rgb}{0.722, 0.435, 0.698}% Rule colour
\newfontfamily{\arialblack}{Arial Black}
\setbeamerfont{frametitle}{family=\arialblack}
\makeatletter
\setbeamertemplate{frametitle}{%
\nointerlineskip%
\vskip0.3cm%
\begin{beamercolorbox}[wd=\textwidth]{frametitle}%
\begin{minipage}[t][1.2cm][b]{\dimexpr\paperwidth-4.6cm\relax}%
\usebeamerfont*{frametitle}\insertframetitle%
\ifx\insertframesubtitle\@empty%
\strut\par%
\else
\par{\usebeamerfont*{framesubtitle}{\usebeamercolor[fg]{framesubtitle}\insertframesubtitle}\strut\par}%
\fi%%
\end{minipage}%
\hfill%
\begin{minipage}[t][1.2cm][b]{2.5cm}
\hfill\includegraphics[height=1.2cm]{example-image-b}%
\end{minipage}%
\end{beamercolorbox}%
\begin{beamercolorbox}[colsep=1.5pt,wd=\textwidth]{lower separation line head}
\end{beamercolorbox}
}
\makeatother
% Let's get started
\author[Author, Author]
{
Author
}
\usepackage{tikz}
%----------------------------------------------------------------------------------------
\begin{document}
{
\usebackgroundtemplate{%
\begin{picture}(100,300)
\includegraphics[width=1.0\paperwidth]{pexels-photo-1323550.jpeg}
\end{picture}
}%
\begin{frame}[plain]
%\textcolor{red}{\rule{16cm}{1mm}}
\end{frame}
}
\begin{frame}
\frametitle{title}
\begin{center}
\end{center}
\end{frame}
%-----------------------------------
\end{document}
答案1
无论如何,当您加载 tikz 包时,您可以使用它来设计您的标题页背景。
其他的建议:
该
mathserif
选项已过时,请\usefonttheme[onlymath]{serif}
改用您不需要加载
hyperref
和graphicx
包,Beamer 会为您加载它们如果您希望所有框架上都有线条和徽标,我不会将它们作为框架标题的一部分,而是使用标题。
% !TeX TS-program = lualatex
\documentclass[
%mathserif,
11pt]{beamer}
\usefonttheme[onlymath]{serif}
\setbeamercolor{frametitle}{fg=black}
\setbeamercolor{lower separation line head}{bg=red}
\usepackage{fontspec}
\usepackage{lipsum}
%\usepackage{hyperref,graphicx}
\definecolor{mycolor}{rgb}{0.722, 0.435, 0.698}% Rule colour
\newfontfamily{\arialblack}{Arial Black}
\setbeamerfont{frametitle}{family=\arialblack}
\makeatletter
\setbeamertemplate{frametitle}{%
\nointerlineskip%
\vskip0.3cm%
\begin{beamercolorbox}[wd=\textwidth]{frametitle}%
\begin{minipage}[t][1.2cm][b]{\dimexpr\paperwidth-4.6cm\relax}%
\usebeamerfont*{frametitle}\insertframetitle%
\ifx\insertframesubtitle\@empty%
\strut\par%
\else
\par{\usebeamerfont*{framesubtitle}{\usebeamercolor[fg]{framesubtitle}\insertframesubtitle}\strut\par}%
\fi%%
\end{minipage}%
\hfill%
\begin{minipage}[t][1.2cm][b]{2.5cm}
\hfill\includegraphics[height=1.2cm]{example-image-b}%
\end{minipage}%
\end{beamercolorbox}%
\begin{beamercolorbox}[colsep=1.5pt,wd=\textwidth]{lower separation line head}
\end{beamercolorbox}
}
\makeatother
% Let's get started
\author[Author, Author]
{
Author
}
\usepackage{tikz}
%----------------------------------------------------------------------------------------
\begin{document}
\begingroup
\setbeamertemplate{background canvas}{
\begin{tikzpicture}[remember picture,overlay,inner sep=0pt,outer sep=0pt]
\node[anchor=south west] at (current page.south west) {\includegraphics[width=\paperwidth]{example-image-duck}};
\draw[red,line width=0.1cm] ([yshift=-1.7cm]current page.north west) -- ++(\paperwidth,0);
\node[anchor=north east] at ([xshift=-0.2cm,yshift=-0.2cm]current page.north east) {\includegraphics[height=1.2cm]{example-image-b}};
\end{tikzpicture}
}
\begin{frame}[plain]
\end{frame}
\endgroup
\begin{frame}
\frametitle{title}
\begin{center}
\end{center}
\end{frame}
%-----------------------------------
\end{document}