1)如何將Beamer中扉頁上的標題放到所需顏色的區塊上?類似地,就像主題華沙、柏林...... 2)如何控製作者和日期之間的空間?\vspace
似乎不起作用。
1)我用這個
\title[TITLE]{TITLE\\[1em]
\includegraphics[height=4cm]{logo}\\[1em]}
\subtitle{\textbf{Subtitle}}
但我只想要 TITLE 周圍的方框。我怎樣才能做到這一點?
答案1
您可以重新定義title page
範本並對佈局進行必要的修改;需要重新定義,因為預設標題和副標題都在同一個內部,beamercolorbox
因此只需重新定義title
投影機顏色就會在標題和副標題周圍產生一個框(這裡不需要):
\documentclass{beamer}
\title{TITLE}
\titlegraphic{\includegraphics[height=4cm]{cat}}
\subtitle{\textbf{Subtitle}}
\author{Author}
\setbeamercolor{title}{bg=orange,fg=white}
\makeatletter
\setbeamertemplate{title page}
{
\vbox{}
\vfill
\begin{centering}
\begin{beamercolorbox}[sep=8pt,center]{title}
\usebeamerfont{title}\inserttitle
\end{beamercolorbox}
\setbeamercolor{title}{bg=white,fg=structure}
\begin{beamercolorbox}[sep=8pt,center]{title}
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
\ifx\insertsubtitle\@empty%
\else%
\vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip1em\par
\begin{beamercolorbox}[sep=8pt,center]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\vskip-1em\par % change here
\begin{beamercolorbox}[sep=8pt,center]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}\vskip0.5em
\end{centering}
\vfill
}
\makeatother
\begin{document}
\maketitle
\end{document}
請注意,現在不需要使用,\title[TITLE]{TITLE\includegraphics{...}}
但現在您可以簡單地使用\title{TITLE}
\titlegraphic{\includegraphics[]{}}`。當然,您可以根據您的特定需求隨意進行必要的調整(您可以使用 \vskip 命令中的長度來調整垂直間距)。
根據評論中的要求,要僅在副標題周圍有一個彩色框,必要的修改如下:
\documentclass{beamer}
\title{TITLE}
\titlegraphic{\includegraphics[height=4cm]{cat}}
\subtitle{\textbf{Subtitle}}
\author{Author}
\makeatletter
\setbeamertemplate{title page}
{
\vbox{}
\vfill
\begin{centering}
\begin{beamercolorbox}[sep=8pt,center]{title}
\usebeamerfont{title}\inserttitle
\end{beamercolorbox}
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
\ifx\insertsubtitle\@empty%
\else%
\vskip0.25em%
\setbeamercolor{title}{bg=orange,fg=white}
\begin{beamercolorbox}[sep=8pt,center]{title}
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip1em\par
\begin{beamercolorbox}[sep=8pt,center]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\vskip-1em\par % change here
\begin{beamercolorbox}[sep=8pt,center]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}\vskip0.5em
\end{centering}
\vfill
}
\makeatother
\begin{document}
\maketitle
\end{document}
對於新的請求,這裡是隨意更改用於字幕的框的寬度的代碼;根據您的需求變更用於的長度\subtitwd
(最初設定為):4cm
\documentclass{beamer}
\newlength\subtitwd
\setlength\subtitwd{4cm}% change the width here
\makeatletter
\setbeamertemplate{title page}
{
\vbox{}
\vfill
\begin{centering}
\begin{beamercolorbox}[sep=8pt,center]{title}
\usebeamerfont{title}\inserttitle
\end{beamercolorbox}
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
\ifx\insertsubtitle\@empty%
\else%
\vskip0.25em%
\setbeamercolor{title}{bg=orange,fg=white}
\vbox{%
\hfill\begin{beamercolorbox}[wd=\subtitwd,sep=8pt,center]{title}
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\end{beamercolorbox}\hfill\null%
}%
\fi%
\vskip1em\par
\begin{beamercolorbox}[sep=8pt,center]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\vskip-1em\par % change here
\begin{beamercolorbox}[sep=8pt,center]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}\vskip0.5em
\end{centering}
\vfill
}
\makeatother
\title{TITLE}
\titlegraphic{\includegraphics[height=4cm]{cat}}
\subtitle{\textbf{Subtitle}}
\author{Author}
\begin{document}
\maketitle
\end{document}