我在投影仪演示中导航栏的突出显示方面遇到了问题。在我的计算机显示器上,突出显示效果很好,但我希望当前部分/子部分的元素更加清晰一些,因为在投影仪上看不出太大的区别。
所以我的问题是,如何设置导航栏中当前元素的样式?我正在使用带有华沙主题的 LaTeX。
我的演讲如下:
\documentclass[12pt]{beamer}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\beamertemplatenavigationsymbolsempty
\setbeamercovered{transparent}
\setbeamertemplate{footline}[]
\usetheme{Warsaw}
\usecolortheme{seahorse}
\title[]{PRJ2 - HB Logistics}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\tableofcontents
\end{frame}
\section{Introduction}
\subsection{Project conditions}
\begin{frame}
\frametitle{Project conditions}
\end{frame}
\end{document}
答案1
一个选项是更改阴影部分/小节的“不透明度”,并将默认的 50% 因子降低到 20%:
\documentclass{beamer}
\usetheme{Warsaw}
\setbeamertemplate{section in head/foot shaded}[default][20]
\setbeamertemplate{subsection in head/foot shaded}[default][20]
\begin{document}
\section{Test section one}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\section{Test section two}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\end{document}
在Warsaw
主题中,导航栏中的部分默认为黑色背景上白色排版,因此我认为这是最大可能的对比度。如果您想更改此设置,可以根据自己的喜好设置部分头部/脚部颜色:
\documentclass{beamer}
\usetheme{Warsaw}
\setbeamertemplate{section in head/foot shaded}[default][20]
\setbeamertemplate{subsection in head/foot shaded}[default][20]
\setbeamercolor{section in head/foot}{bg=black!60,fg=orange}
\begin{document}
\section{Test section one}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\section{Test section two}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\end{document}
您还可以更改字体大小,但是,由于阴影和当前元素使用的字体大小不是独立的,因此这将需要一些额外的工作:
\documentclass{beamer}
\usetheme{Warsaw}
\setbeamertemplate{section in head/foot shaded}[default][20]
\setbeamertemplate{subsection in head/foot shaded}[default][20]
\setbeamerfont{section in head/foot}{size=\small}
\setbeamerfont{subsection in head/foot}{size=\footnotesize}
\makeatletter
\def\insertsectionnavigation#1{%
\hbox to #1{%
\vbox{{\usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}%
\vskip0.5625ex%
\def\slideentry##1##2##3##4##5##6{}%
\def\sectionentry##1##2##3##4##5{%
\ifnum##5=\c@part%
\def\insertsectionhead{##2}%
\def\insertsectionheadnumber{##1}%
\def\insertpartheadnumber{##5}%
\setbox\beamer@tempbox=\hbox{%
\hyperlink{Navigation##3}{\hbox to #1{%
\hskip0.3cm%
\ifnum\c@section=##1%
{\usebeamertemplate{section in head/foot}}%
\else%
{\tiny\usebeamertemplate{section in head/foot shaded}}%
\fi\hskip0.3cm}}}%
\ht\beamer@tempbox=1.6875ex\dp\beamer@tempbox=0.75ex%
\box\beamer@tempbox\fi}%
\dohead\vskip0.5625ex}}\hfil}}
\def\insertsubsectionnavigation#1{%
\hbox to #1{%
\vbox{{%
\usebeamerfont{subsection in head/foot}\usebeamercolor[fg]{subsection in head/foot}%
\vskip0.5625ex%
\beamer@currentsubsection=0%
\def\sectionentry##1##2##3##4##5{}%
\def\slideentry##1##2##3##4##5##6{\ifnum##6=\c@part\ifnum##1=\c@section%
\ifnum##2>\beamer@currentsubsection%
\beamer@currentsubsection=##2%
\def\insertsubsectionhead{##5}%
\def\insertsectionheadnumber{##1}%
\def\insertsubsectionheadnumber{##2}%
\def\insertpartheadnumber{##6}%
\setbox\beamer@tempbox=\hbox{\beamer@link(##4){%
\hbox to #1{\hskip0.3cm%
\ifnum\c@subsection=##2%
{\usebeamertemplate{subsection in head/foot}}%
\else%
{\tiny\usebeamertemplate{subsection in head/foot shaded}}%
\fi\hfil\hskip0.3cm}}}%
\ht\beamer@tempbox=1.6875ex\dp\beamer@tempbox=0.75ex%
\box\beamer@tempbox\fi\fi\fi}%
\dohead\vskip0.5625ex}\hfil}}}
\setbeamertemplate{headline}%{split theme}
{%
\leavevmode%
\@tempdimb=5.4375ex%
\ifnum\beamer@subsectionmax<\beamer@sectionmax%
\multiply\@tempdimb by\beamer@sectionmax%
\else%
\multiply\@tempdimb by\beamer@subsectionmax%
\fi%
\ifdim\@tempdimb>0pt%
\advance\@tempdimb by 1.825ex%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
\vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
\vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.5\paperwidth}\vfil}%
\end{beamercolorbox}%
\fi%
}
\makeatother
\begin{document}
\section{Test section one}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\section{Test section two}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\subsection{Test subsection}
\begin{frame} test\end{frame}
\end{document}