我在 beamer 中使用rectangles
innertheme。我想在 ToC 中以字母形式打印子部分编号。例如,使用以下代码片段:
\documentclass{beamer}
\useinnertheme{rectangles}
%%%\setbeamertemplate{subsection in toc}[subsections numbered] %doesn't work
\begin{document}
\begin{frame}{ToC}
\tableofcontents
\end{frame}
\section{Test 1}
\subsection{Test 11}
\begin{frame}
page 1
\end{frame}
\subsection{Test 12}
\begin{frame}
page 2
\end{frame}
\section{Test 2}
\subsection{Test 21}
\begin{frame}
page 3
\end{frame}
\end{document}
我明白了
我想要的是之前的矩形测试 11将包含A, ... 喜欢:
有什么帮助吗?!
答案1
您可以重新定义子部分模板以包含子部分编号:
\documentclass{beamer}
\useinnertheme{rectangles}
\newcounter{mynumber}
\makeatletter
\setbeamertemplate{subsection in toc}{
\leavevmode\leftskip=5ex%
\llap{%
\usebeamerfont*{section number projected}%
\usebeamercolor[bg]{section number projected}%
\vrule width2.25ex height1.85ex depth.4ex%
\hskip-2.25ex%
\setcounter{mynumber}{\inserttocsubsectionnumber}%
\hbox to2.25ex{\hfil\color{fg}\alph{mynumber}\hfil}}%
\kern1.25ex\inserttocsubsection\par}
\makeatother
\begin{document}
\begin{frame}{ToC}
\tableofcontents
\end{frame}
\section{Test 1}
\subsection{Test 11}
\begin{frame}
page 1
\end{frame}
\subsection{Test 12}
\begin{frame}
page 2
\end{frame}
\section{Test 2}
\subsection{Test 21}
\begin{frame}
page 3
\end{frame}
\end{document}