投影机中的部分导航器?

投影机中的部分导航器?

我有一个 2 小时的演讲,包含 3 个部分。

我正在使用Warsaw主题,其顶部栏有两个垂直列表:左侧的部分列表和右侧的子部分列表。

我可以在顶部栏的最左侧添加垂直零件列表(例如 1),或者在框架的左下角添加水平零件列表(例如 2)吗?或者在任何地方?

截屏

梅威瑟:

\documentclass{beamer}

\usetheme{Warsaw}
\usecolortheme{spruce}

\title { Example Beamer }
\subtitle { Sub Title }
\author { Ray J. Stomach }

\AtBeginPart{
    \begin{frame}
        \partpage
    \end{frame}
}
\AtBeginSection{
    \begin{frame}
        \tableofcontents[currentsection]
    \end{frame}
}

\newcommand\testsubsection[1]{
    \subsection{#1}
    \begin{frame}
        \begin{itemize}
            \item A black cat
            \item jumps over a big
            \item a blat fox
        \end{itemize}
    \end{frame}
}

\begin{document}

\frame{\maketitle}

\part{Part 1}
    \section{Section 1}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

    \section{Section 2}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

    \section{Section 3}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

\part{Part 2}
    \section{Section 1}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

    \section{Section 2}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

    \section{Section 3}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

\part{Part 3}
    \section{Section 1}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

    \section{Section 2}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

    \section{Section 3}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

\end{document}

答案1

不幸的是,beamer没有提供开箱即用的部分导航栏,但是您可以自己创建必要的\insertpartnavigation命令\insertpartnavigationhorizontal

\documentclass{beamer}

\usetheme{Warsaw}
\usecolortheme{spruce}

%%% Part navigation (http://tex.stackexchange.com/a/103431) %%%

% The templates "part in head/foot" and "part in head/foot shaded" control the appearance of the part navigation
\defbeamertemplate*{part in head/foot}{default}
{\insertparthead\hfil}
\defbeamertemplate*{part in head/foot shaded}{default}[1][50]
{\color{fg!#1!bg}\usebeamertemplate{part in head/foot}}
\setbeamercolor{part in head/foot}{parent=section in head/foot,fg=red}

\makeatletter
\def\insertpartnavigation#1{%
  \ifnum\c@part>0
  \hbox to #1{%
    \vbox{{\usebeamerfont{section in head/foot}\usebeamercolor[fg]{part in head/foot}%
     \vskip0.5625ex%
     \def\slideentry##1##2##3##4##5##6{}%
     \def\sectionentry##1##2##3##4##5{}%
     \def\partentry##1##2{
       \def\insertparthead{##1}
       \def\insertpartheadnumber{##2}%
       \setbox\beamer@tempbox=\hbox{%
         \hyperlink{Outline##2}{\hbox to #1{%
             \hskip0.3cm%
             \ifnum\c@part=##2%
               {\usebeamertemplate{part in head/foot}}%
             \else%
               {\usebeamertemplate{part in head/foot shaded}}%
             \fi\hskip0.3cm}}}%
       \ht\beamer@tempbox=1.6875ex\dp\beamer@tempbox=0.75ex%
       \box\beamer@tempbox}%
     \dohead\vskip0.5625ex}}\hfil}\fi}

\def\insertpartnavigationhorizontal#1#2#3{%
  \ifnum\c@part>0
  \hbox to #1{{%
     \def\slideentry##1##2##3##4##5##6{}%
     \def\sectionentry##1##2##3##4##5{}%
     \def\partentry##1##2{% part title, part numer
       \hskip1.875ex plus 1fill
       \hbox{\def\insertparthead{##1}%
         \def\insertpartheadnumber{##2}%
         {%
           \usebeamerfont{part in head/foot}\usebeamercolor[fg]{part in head/foot}%
           \ifnum\c@part=##2%
             \hyperlink{Outline##2}{{\usebeamertemplate{part in head/foot}}}%
           \else%
             \hyperlink{Outline##2}{{\usebeamertemplate{part in head/foot shaded}}}%
           \fi}%
       }%
       \ignorespaces}
     #2%
     \usebeamerfont{part in head/foot}\usebeamercolor[fg]{part in head/foot}%
     \hskip-1.875ex plus-1fill\dohead%
     \hfil%
     #3}}\fi}

% Headline with part navigation
\setbeamertemplate{headline}
{%
  \leavevmode%
  \@tempdimb=2.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\insertpartnavigation{.25\paperwidth}\vfil}%
      \vbox to\@tempdimb{\vfil\insertsectionnavigation{.25\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%
}

% Footline with part navigation
\setbeamertemplate{footline}
{%
  \leavevmode%
  \hbox{%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm]{author in head/foot}%
    \insertpartnavigationhorizontal{.3\paperwidth}{}{\hskip0pt plus1filll}\hfill\usebeamerfont{author in head/foot}\insertshortauthor
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}}%
  \vskip0pt%
}
\makeatother

%%% End of code for part navigation %%%

\title{Example Beamer}
\subtitle{Sub Title}
\author{Ray J. Stomach}

\AtBeginPart{
    \begin{frame}
        \partpage
    \end{frame}
}
\AtBeginSection{
    \begin{frame}
        \tableofcontents[currentsection]
    \end{frame}
}

\newcommand\testsubsection[1]{
    \subsection{#1}
    \begin{frame}
        \begin{itemize}
            \item A black cat
            \item jumps over a big
            \item a blat fox
        \end{itemize}
    \end{frame}
}

\begin{document}
\frame{\maketitle}
\part{Part 1}
    \section{Section 1}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}
    \section{Section 2}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}
    \section{Section 3}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}
\part{Part 2}
    \section{Section 1}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}
    \section{Section 2}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}
    \section{Section 3}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}
\part{Part 3}
    \section{Section 1}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}
    \section{Section 2}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}
    \section{Section 3}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}
\end{document}

带有页眉和页脚部分导航的示例幻灯片

当然,您不需要在页眉和页脚中都使用部分导航,您只需删除重新定义\setbeamertemplate{headline}{...}\setbeamertemplate{footline}{...}移除多余的即可。或者,您可以使用新引入的宏来创建自己的部分导航\insertpartnavigation-\insertpartnavigationhorizontal它们的使用方式与相应的命令完全相同,参见。\insertsectionnavigation(horizontal)用户beamer指南,第 64 页

部件导航的外观由模板part in head/foot和控制part in head/foot shaded,因此您可以通过发出类似的命令来更改其颜色\setbeamercolor{part in head/foot}{fg=white}

答案2

我遇到了类似的问题,并且无法在互联网上找到任何“优雅”的解决方案,因此我想出了一种肮脏的破解方法,如下所示:

\documentclass{beamer}
\usetheme{Warsaw}
\usecolortheme{spruce}

\title { Example Beamer }
\subtitle { Sub Title }
\author [\hyperlink{part1}{Part 1} \hyperlink{part2}{Part 2} \hyperlink{part3}{Part 3} \hspace{.18\textwidth} Ray J. Stomach]{ Ray J. Stomach }

\AtBeginPart{
    \begin{frame}
        \partpage
    \end{frame}
}
\AtBeginSection{
    \begin{frame}
        \tableofcontents[currentsection]
    \end{frame}
}

\newcommand\testsubsection[1]{
    \subsection{#1}
    \begin{frame}
        \begin{itemize}
            \item A black cat
            \item jumps over a big
            \item a blat fox
        \end{itemize}
    \end{frame}
}

\begin{document}

\frame{\maketitle}

\hypertarget{part1}{\part{Part 1}}
    \section{Section 1}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

    \section{Section 2}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

    \section{Section 3}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

\hypertarget{part2}{\part{Part 2}}
    \section{Section 1}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

    \section{Section 2}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

    \section{Section 3}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

\hypertarget{part3}{\part{Part 3}}
    \section{Section 1}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

    \section{Section 2}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

    \section{Section 3}
       \testsubsection{Subsection A}
       \testsubsection{Subsection B}
       \testsubsection{Subsection C}

\end{document}

我所做的是添加三个方括号中的超链接,以便\author它们仅显示在底部栏中。然后我为这三个部分添加了三个超目标。我相信有更好的解决方案,但这至少有效。

相关内容