![beamer:如何在 \footline 中显示 \subsubsections](https://linux22.com/image/377263/beamer%EF%BC%9A%E5%A6%82%E4%BD%95%E5%9C%A8%20%5Cfootline%20%E4%B8%AD%E6%98%BE%E7%A4%BA%20%5Csubsubsections.png)
我需要在 中插入subsubsections
(注意subsub
)以进行带有和主题的footline
演示,就像一样。beamer
AnnArbor
subsection
\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但我只得到了第一部分的数字。