与我的相关之前关于 beamer 的问题,现在我又有一个:
- 如何在标题上方添加徽标。
答案1
CambridgeUS
使用default
title page
在末尾插入标题图形的模板;您可以重新定义模板以将其包含在标题之前,然后使用
\titlegraphic{\includegraphics[<options>]{image}}
完整的示例,包括来自链接问题的设置:
\documentclass{beamer}
\usetheme{CambridgeUS}
% Set Color ==============================
% Custom colors
\usepackage{xcolor}
% http://www.computerhope.com/htmcolor.htm
\definecolor{gold}{HTML}{FDD017}
\definecolor{deep sky blue}{HTML}{3BB9FF}
\definecolor{light sky blue}{HTML}{82CAFA}
\definecolor{mybackground}{HTML}{82CAFA}
\definecolor{myforeground}{HTML}{0000A0}
\setbeamercolor{normal text}{fg=black,bg=white}
\setbeamercolor{alerted text}{fg=red}
\setbeamercolor{example text}{fg=black}
\setbeamercolor{background canvas}{fg=myforeground, bg=white}
\setbeamercolor{background}{fg=myforeground, bg=mybackground}
\setbeamercolor{palette primary}{fg=black, bg=gray!30!white}
\setbeamercolor{palette secondary}{fg=black, bg=gray!20!white}
\setbeamercolor{palette tertiary}{fg=black, bg=gold}
\setbeamercolor{frametitle}{fg=cyan!80!black}
\setbeamercolor{title}{fg=cyan!80!black}
\setbeamertemplate{headline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,center]{section in head/foot}%
\usebeamerfont{section in head/foot}\insertsectionhead\hspace*{2ex}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,center]{subsection in head/foot}%
\usebeamerfont{subsection in head/foot}\hspace*{2ex}\insertsubsectionhead
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatletter
\defbeamertemplate*{title page}{mydefault}[1][]
{
\vbox{}
\vfill
\begin{centering}
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
\begin{beamercolorbox}[sep=8pt,center,#1]{title}
\usebeamerfont{title}\inserttitle\par%
\ifx\insertsubtitle\@empty%
\else%
\vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip1em\par
\begin{beamercolorbox}[sep=8pt,center,#1]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center,#1]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center,#1]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}\vskip0.5em
\end{centering}
\vfill
}
\setbeamertemplate{title page}[mydefault][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]
\makeatother
% Set Color ==============================
\title{Title1}
\subtitle{Title2}
\author{Author}
\institute{Institute}
\date{Date}
\titlegraphic{\includegraphics[height=2cm]{ctanlion}}
\begin{document}
\frame{\maketitle}
\section[Outline]{}
\frame{\tableofcontents}
\section{Header1}
\subsection{Header2}
\frame{\frametitle{Topic1}
%
HTML color codes are the \textbf{hexadecimal triplets} representing the colors red, green, and blue.
%
These color codes can be used to change the color of the background, text, and tables on a web page.
}
\end{document}
答案2
您可以使用命令 将图形添加到标题框\titlegraphic{}
。标准行为是将图形放在底部。但是,您可以使用\raisebox
以下方式,而不是重新定义默认行为\smash
:
\titlegraphic{\leavevmode\smash{\raisebox{6cm}{foo}}}
对于“foo”,您可以使用\includegraphics
或任何您想要的。