我正在使用以下程式碼(大致)在投影儀標題。標題的內容是使用outertheme
tree
.著色方法大致基於 的著色方法Singapore
。問題是我在投影片的最頂部有一條淺綠色的線,而我希望深綠色一直到頂部。
\PassOptionsToPackage{rgb}{xcolor}
\documentclass{beamer}
\definecolor{acol}{rgb}{.5,1,.5}
\definecolor{bcol}{rgb}{.1,.6,.2}
\colorlet{bcol1}{bcol!25!black}
\setbeamercolor{title in head/foot}{fg=acol,bg=}
\setbeamercolor{section in head/foot}{fg=acol,bg=}
\setbeamercolor{subsection in head/foot}{fg=acol,bg=}
\setbeamercolor{upper separation line head}{bg=bcol1}
\setbeamercolor{lower separation line head}{bg=bcol1}
\makeatletter
\useoutertheme{tree}
\pgfdeclarehorizontalshading{beamer@headfade}{\dimexpr5.4375ex+3pt}
{%
color(0cm)=(bcol1);
color(\paperwidth)=(acol)%
}
\addtoheadtemplate{\vskip 3pt\pgfuseshading{beamer@headfade}\vskip\dimexpr -3pt-10.875ex}{}
\makeatother
\begin{document}
\title{Title}
\section{A Section}
\subsection{A Subsection}
\begin{frame}{A Frame}{A Subframe}
Some text
\end{frame}
\end{document}
據推測,我在某個地方計算錯誤或使用了錯誤的值,但每次我推動某些東西、某些東西或其他東西時,我似乎就是無法把它弄對。 (可能是因為我像往常一樣被beamer
的代碼迷宮迷住了。)
任何提示將不勝感激!
答案1
我收到您提供的 MWE 錯誤。它在這一行給出,說\dimexpr
不能在垂直模式下使用:
\pgfdeclarehorizontalshading{beamer@headfade}{\dimexpr5.4375ex+3pt}
我剛剛刪除了它,它對我有用(頂部沒有線):
\pgfdeclarehorizontalshading{beamer@headfade}{5.4375ex+3pt}
\PassOptionsToPackage{rgb}{xcolor}
\documentclass{beamer}
\definecolor{acol}{rgb}{.5,1,.5}
\definecolor{bcol}{rgb}{.1,.6,.2}
\colorlet{bcol1}{bcol!25!black}
\setbeamercolor{title in head/foot}{fg=acol,bg=}
\setbeamercolor{section in head/foot}{fg=acol,bg=}
\setbeamercolor{subsection in head/foot}{fg=acol,bg=}
\setbeamercolor{upper separation line head}{bg=bcol1}
\setbeamercolor{lower separation line head}{bg=bcol1}
\makeatletter
\useoutertheme{tree}
\pgfdeclarehorizontalshading{beamer@headfade}{5.4375ex+3pt}
{%
color(0cm)=(bcol1);
color(\paperwidth)=(acol)%
}
\addtoheadtemplate{\vskip 3pt\pgfuseshading{beamer@headfade}\vskip\dimexpr -3pt-10.875ex}{}
\makeatother
\begin{document}
\title{Title}
\section{A Section}
\subsection{A Subsection}
\begin{frame}{A Frame}{A Subframe}
Some text
\end{frame}
\end{document}