控制 Beamer 頂行導航圓圈的顏色和陰影

控制 Beamer 頂行導航圓圈的顏色和陰影

\useoutertheme{miniframes}我正在使用和\useinnertheme{circles}以及我自己的預設顏色主題的修改版本在 Beamer 中準備簡報。

我想在頂部有一個類似法蘭克福的導航欄,但我沒有設定背景顏色,而是有一個圖像提供頂部欄的背景。

我想要的是當前部分標題和小節點與其他部分相比要突出顯示,如下所示:

正確的陰影,但有背景顏色

……除了這僅在我聲明“頭/腳部分”的背景顏色時才有效。當我設定{bg=}該定義時,它會遮蔽活動部分和圓圈較暗比其他的,這與我想要的相反:

正確的背景,但現在陰影是錯誤的

如果我將其設為fg全白,那麼一切變白,不活動區域沒有陰影。我想要的是第一張圖像上的陰影與第二張圖像的背景。

我怎樣才能實現這個目標?


編輯:最小工作範例

這是一個最小的工作範例。為了發揮作用,它需要一個背景圖像,我用過這個背景圖片來自 Internetz(TM)。

最小工作範例的程式碼如下。有 3 種不同的選項\setbeamercolor{section in head/foot}選項1產生正確的背景和全白導航,沒有陰影,選項2提供正確的背景但錯誤的陰影(深色背景圖像上強調的部分較暗),並且選項3提供正確的陰影,但設定覆蓋影像的純背景色。

我想要的是選項1和2的背景影像,但選項3的導航項目的底紋。

\documentclass[compress]{beamer}
\useoutertheme[footline=authortitle]{miniframes}
\usebackgroundtemplate{\includegraphics[height=\paperheight]{baggrund.jpg}}
\setbeamercolor{structure}{fg=white}
%\setbeamercolor{section in head/foot}{parent=structure}%, bg=black} %opt.1
\setbeamercolor{section in head/foot}{parent=structure,fg=white!70!black} %opt.2
%\setbeamercolor{section in head/foot}{parent=structure, bg=black} %opt.3
\setbeamercolor{normal text}{fg=white!80!blue}
\title{the title}
\author{John Doe}
\begin{document}

\section{S1}

\subsection{SS11}
\begin{frame}{Foo}
    Some text
\end{frame}
\begin{frame}{Bar}
    Some text
\end{frame}

\subsection{SS12}    
\begin{frame}{Baz}
    Some text
\end{frame}
\begin{frame}{Qux}
    Some text
\end{frame}

\section{S2}
\subsection{SS21}    
\begin{frame}{Buqz}
    Some text
\end{frame}

\subsection{SS22}
\begin{frame}{Bao}
    Some text
\end{frame}
\end{document}

答案1

要影響迷你框架的顏色而不更改標題的背景顏色,您可以使用投影機顏色mini frames(預設情況下,這僅從 獲取顏色section in head/foot,這就是為什麼更改此顏色也會影響迷你框架):

\setbeamercolor{mini frame}{fg=white,bg=black}

然而,這只能解決問題的一半:雖然它為迷你框架本身提供了正確的顏色,但部分名稱顏色仍然是錯誤的,因為它是由以下命令控制的section name in head/foot

根據需要突出顯示/陰影迷你框架的標題,但部分名稱仍為灰色

要解決此問題,您可以修補內部投影機命令以使用迷你框架顏色而不是部分名稱的標題顏色:

\usepackage{etoolbox}
\patchcmd{\sectionentry}{\usebeamercolor[fg]{section in head/foot}}{\usebeamercolor[fg]{mini frame}}{}{}

總之,這給出了期望的結果:

帶有迷你框架的標題和根據需要突出顯示/陰影的部分名稱

\documentclass[compress]{beamer}
\useoutertheme[footline=authortitle]{miniframes}
\usebackgroundtemplate{\includegraphics[height=\paperheight]{baggrund.jpg}}
\setbeamercolor{structure}{fg=white}
\setbeamercolor{normal text}{fg=white!80!blue}

\setbeamercolor{mini frame}{fg=white,bg=black}
\usepackage{etoolbox}
\patchcmd{\sectionentry}{\usebeamercolor[fg]{section in head/foot}}{\usebeamercolor[fg]{mini frame}}{}{}

\title{the title}
\author{John Doe}
\begin{document}

\section{S1}

\subsection{SS11}
\begin{frame}{Foo}
    Some text
\end{frame}
\begin{frame}{Bar}
    Some text
\end{frame}

\subsection{SS12}    
\begin{frame}{Baz}
    Some text
\end{frame}
\begin{frame}{Qux}
    Some text
\end{frame}

\section{S2}
\subsection{SS21}    
\begin{frame}{Buqz}
    Some text
\end{frame}

\subsection{SS22}
\begin{frame}{Bao}
    Some text
\end{frame}
\end{document}

相關內容