
\hpagecolor[color1]{color2} は、背景色を左側の color1 から右側の color2 まで徐々に変更します。color2 のみが指定されている場合は、背景はその色になり、左から右に向かってフェードします。
次の画像のナビゲーション バーとフッターの背景色に、このようなフェード効果をもたらすにはどうしたらよいでしょうか。ここでは、黒と青の 2 つの単色のみです。黒から青までの連続スペクトルを作成したいと考えています。
\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}
同様に、この画像の「Intro」のように、見出しの背景に効果(赤を緑など)を加えるにはどうすればよいですか。
前もって感謝します。
答え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
シェーディング効果には を使用しました。基本的には、 と の 2 つのテンプレートを変更する必要がありますheadline
。例では、見出しをフレーム タイトルのように (同じ青/黒のシェーディング) しましたが、と の値footline
を変更することで外観を簡単にカスタマイズできます。 left color
right color