答案1
如果我理解正确的话,您想在标题中为每个部分、小节添加项目符号。
\insertsectionnavigation
您只需对和的定义进行最小程度的改变即可\insertsubsectionnavigation
两个命令的定义如下beamerbasenavigation.sty
:
\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%
{\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%
{\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}}}
只需在定义中添加项目符号\insertsectionhead
即可\insertsubsectionhead
一个例子(MWE)
\documentclass{beamer}
\usetheme{warsaw}
\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{$\circ$ ##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%
{\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{$\circ$ ##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%
{\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}}}
\makeatother
\begin{document}
\section{section one}
\subsection{subsection one}
\begin{frame}
hello world
\end{frame}
\section{section two}
\begin{frame}
hello world too
\end{frame}
\end{document}
更新
仅适用于当前章节和当前小节的项目符号
\documentclass{beamer}
\usetheme{warsaw}
\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{\ifnum\c@section=##1{$\circ$}\fi\ ##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%
{\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{\ifnum\c@subsection=##2{$\circ$}\fi\ ##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%
{\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}}}
\makeatother
\begin{document}
\section{section one}
\subsection{subsection one}
\begin{frame}
hello world
\end{frame}
\section{section two}
\begin{frame}
hello world too
\end{frame}
\end{document}
结果