如何在 beamer 1 中创建章节和子章节的编号。1a 1b

如何在 beamer 1 中创建章节和子章节的编号。1a 1b

如何在框架和目录中对 beamer 1.1a 1b 等中的章节和小节进行编号?

我想将编号改为类似这样的:

  1. 第一
    1a
    1b

  2. 第二
    2a
    2b

我使用的主题名为 Antibes。

答案1

部分解决方案

以下示例显示如何实现所需的目录:

\documentclass{beamer}
\usetheme{Antibes}

\makeatletter
\defbeamertemplate{subsection in toc}{subsections numbered roman}{%
    \leavevmode\leftskip=1.5em\inserttocsectionnumber\@alph\inserttocsubsectionnumber\ %
    \inserttocsubsection\par}
\makeatother

\setbeamertemplate{subsection in toc}[subsections numbered roman]

\begin{document}

    \frame{\tableofcontents}

\section{Test Section One}
\subsection{blub}
\begin{frame}
test
\end{frame}
\subsection{blubblub}
\begin{frame}
    test
\end{frame}
\section{Test Section Two}
\begin{frame}
test
\end{frame}
\section{Test Section Three}
\begin{frame}
test
\end{frame}

\end{document}

在此处输入图片描述


问题

但尝试修改导航栏时,我却无法插入部分编号。我试过了\insertsectionheadnumber,但不幸的是,这只适用于其他主题,而不适用于\useoutertheme{tree}

\documentclass{beamer}
\usetheme{Antibes}

\makeatletter
\defbeamertemplate{subsection in toc}{subsections numbered roman}{%
    \leavevmode\leftskip=1.5em\inserttocsectionnumber\@alph\inserttocsubsectionnumber\ %
    \inserttocsubsection\par}
\makeatother

\setbeamertemplate{subsection in toc}[subsections numbered roman]

\makeatletter
\setbeamertemplate{headline}{%
    \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{upper separation line head}
    \end{beamercolorbox}
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
        leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}
        \usebeamerfont{title in head/foot}\insertshorttitle
    \end{beamercolorbox}
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
        leftskip=.3cm,rightskip=.3cm plus1fil]{section in head/foot}
        \usebeamerfont{section in head/foot}%
        \ifbeamer@tree@showhooks
        \setbox\beamer@tempbox=\hbox{\insertsectionhead}%
        \ifdim\wd\beamer@tempbox>1pt%
        \hskip2pt\raise1.9pt\hbox{\vrule width0.4pt height1.875ex\vrule width 5pt height0.4pt}%
        \hskip1pt%
        \fi%
        \else%  
        \hskip6pt%
        \fi%
%       \insertsectionheadnumber % NOT WORKING
        \insertsectionhead
    \end{beamercolorbox}
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
        leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
        \usebeamerfont{subsection in head/foot}%
        \ifbeamer@tree@showhooks
        \setbox\beamer@tempbox=\hbox{\insertsubsectionhead}%
        \ifdim\wd\beamer@tempbox>1pt%
        \hskip9.4pt\raise1.9pt\hbox{\vrule width0.4pt height1.875ex\vrule width 5pt height0.4pt}%
        \hskip1pt%
        \fi%
        \else%  
        \hskip12pt%
        \fi%
        \insertsubsectionhead
    \end{beamercolorbox}
    \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{lower separation line head}
    \end{beamercolorbox}
}
\makeatother


\begin{document}

    \frame{\tableofcontents}

\section{Test Section One}
\subsection{blub}
\begin{frame}
test
\end{frame}
\subsection{blubblub}
\begin{frame}
    test
\end{frame}
\section{Test Section Two}
\begin{frame}
test
\end{frame}
\section{Test Section Three}
\begin{frame}
test
\end{frame}

\end{document}

相关内容