beamer:如何在 \footline 中显示 \subsubsections

beamer:如何在 \footline 中显示 \subsubsections

我需要在 中插入subsubsections(注意subsub)以进行带有和主题的footline演示,就像一样。beamerAnnArborsubsection\insertsubsectionnavigationhorizontal

答案1

部分解决方案:

您必须在每个小节的开头手动指定该小节中有多少个小节。

\documentclass{beamer}

\usetheme{AnnArbor}

\usepackage{pgffor}

\newcounter{totalsubsub}

\AtBeginSubsubsection[]{\label{subsubsec:\thesection:\thesubsection:\thesubsubsection}}


\setbeamertemplate{footline}
{%
  \leavevmode%
  \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{subsection in head/foot}%
    \ifnum\thetotalsubsub>0
        \foreach \i in {1,...,\thetotalsubsub}{% 
                \hfill
                \ifnum\i=\thesubsubsection
                    \usebeamercolor[fg]{subsubsection in sidebar}
                \else
                    \usebeamercolor[fg]{subsubsection in sidebar shaded}
                \fi
                \hyperlink{subsubsec:\thesection:\thesubsection:\i}{\nameref{subsubsec:\thesection:\thesubsection:\i}}
            }
            \hfill
            \hspace*{0pt}
        \fi
  \end{beamercolorbox}%
}


\begin{document}

\section{section}
\subsection{sub 1}
\setcounter{totalsubsub}{3}

\subsubsection{subsub 1}
\begin{frame}
    subsub 1
\end{frame} 

\subsubsection{subsub 2}
\begin{frame}
    subsub 2
\end{frame} 

\subsubsection{subsub 3}
\begin{frame}
    subsub 3
\end{frame} 

\subsection{sub 2}
\setcounter{totalsubsub}{0}

\begin{frame}
    abc
\end{frame} 

\end{document}

在此处输入图片描述

对于自动检索每个子节的子节数,该xcntperchap包可能会有所帮助。我尝试将其类似于https://tex.stackexchange.com/a/303968/36296但我只得到了第一部分的数字。

相关内容