
\hpagecolor[color1]{color2} 將背景顏色從左側的 color1 逐漸改為右側的 color2。如果只給予 color2,背景將採用該顏色,從左到右淡入淡出。
如何在下圖中的導覽列和頁腳的背景顏色中帶來這樣的淡入淡出效果。這裡它們只是黑色和藍色兩種純色。我希望有一個從黑色到藍色的連續光譜。
\documentclass[12pt]{beamer}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\beamertemplatenavigationsymbolsempty
\setbeamercovered{transparent}
\setbeamertemplate{footline}[]
\usetheme{Warsaw}
\usecolortheme{seahorse}
\title[]{Some title}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{Introduction}
\subsection{Sub Intro}
\begin{frame}
\frametitle{Intro}
\end{frame}
\end{document}
同樣,如何在標題背景中帶來效果(例如紅色到綠色),如該圖片中的“介紹”所示。
提前致謝。
答案1
你可以這樣做:
\documentclass[12pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\beamertemplatenavigationsymbolsempty
\setbeamercovered{transparent}
\setbeamertemplate{footline}[]
\usetheme{Warsaw}
\setbeamertemplate{headline}{
\begin{tikzpicture}[minimum height=4.15ex,halfhead/.style={text=white,overlay,text width=.5\paperwidth,inner sep=0pt}]
\node(a)[minimum width=\paperwidth,left color=structure.fg,right color=black]{};
\node[halfhead,align=right,anchor=south west]at(a.south west){\insertsectionhead\hskip10pt};
\node[halfhead,align=left,anchor=south east]at(a.south east){\hskip10pt\insertsubsectionhead};
\end{tikzpicture}
}
\setbeamertemplate{footline}{
\begin{tikzpicture}[minimum height=4.15ex,halfhead/.style={text=white,overlay,text width=.5\paperwidth,inner sep=0pt}]
\node(a)[minimum width=\paperwidth, left color=green,right color=red]{};
\node[halfhead,align=right,anchor=south west]at(a.south west){\insertauthor\hskip10pt};
\node[halfhead,align=left,anchor=south east]at(a.south east){\hskip10pt\inserttitle};
\end{tikzpicture}
}
\title[]{Some title}
\author{Author}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{Introduction}
\subsection{Sub Intro}
\begin{frame}
\frametitle{Intro}
\end{frame}
\end{document}
我用的TikZ
是陰影效果。您基本上需要修改兩個模板:headline
和footline
。在範例中,我使標題看起來像框架標題(相同的藍色/黑色陰影),但您可以透過變更left color
和right color
值輕鬆自訂外觀。