Beamer:为华沙调色板添加项目符号

Beamer:为华沙调色板添加项目符号

有没有办法添加项目符号,因为它们是在列表环境中显示的,在调色板中显示的“列表”中,我相信它是这么称呼的,华沙主题?

由于我不确定我是否正确解释了这个问题,我将添加一个(质量较差的)图形表示:

在此处输入图片描述

有点像这样。

最终这可能微不足道,但我在搜索它时很难正确地形成问题。

答案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}

结果

在此处输入图片描述

相关内容