我需要更改投影机演示文稿中的 TCO 条目以符合我公司的 CI。
我需要颜色框内的不带点的章节编号。
我尝试采用这里的解决方案:在 beamer 中对子部分进行编号
通过增加:
\defbeamertemplate{section in toc}{sections numbered}{
\leavevmode\leftskip=3em%
\rlap{\hskip-3em\inserttocsectionnumber.\inserttocsubsectionnumber.\inserttocsubsubsectionnumber}%
\inserttocsubsubsection\par
}
\setbeamertemplate{section in toc}[sections numbered]
但我收到编译错误:
Package: beamerouterthemedefault 2012/10/02 (rcs-revision 5ed0f4010e8a)
)))
! LaTeX Error: Command \beamer@@tmpop@section in toc@sections numbered already
这是我要玩的 MWE:
\documentclass[aspectratio=169,hyperref={unicode},t]{beamer}
\usepackage{color}
\defbeamertemplate{section in toc}{sections numbered}{
\leavevmode\leftskip=3em%
\rlap{\hskip-3em\inserttocsectionnumber.\inserttocsubsectionnumber.\inserttocsubsubsectionnumber}%
\inserttocsubsubsection\par
}
\setbeamertemplate{section in toc}[sections numbered]
\begin{document}
\begin{frame}{How to layout TOC entries?}
\huge
\setlength{\lineskip}{0pt}
\tableofcontents[hideallsubsections]
\end{frame}
\section{Test}
some content
\subsection{Test Test}
some content
\section{Test}
\subsection{Test Test}
\section{Test}
\subsection{Test Test}
some content
\section{Test}
\subsection{Test Test}
some content
\end{document}
答案1
\documentclass[aspectratio=169,hyperref={unicode},t]{beamer}
\setbeamertemplate{section in toc}[square]
\setbeamerfont{section number projected}{size=\large}
\setbeamercolor{section number projected}{bg=red,fg=green}
\begin{document}
\begin{frame}{How to layout TOC entries?}
\large
\tableofcontents[hideallsubsections]
\end{frame}
\section{Test}
some content
\subsection{Test Test}
some content
\section{Test}
\subsection{Test Test}
\section{Test}
\subsection{Test Test}
some content
\section{Test}
\subsection{Test Test}
some content
\end{document}
或者如果你需要进一步定制,你可以修改
\setbeamertemplate{section in toc}{%
\leavevmode\leftskip=1.75ex%
\llap{%
\usebeamerfont*{section number projected}%
\usebeamercolor[bg]{section number projected}%
\vrule width2.25ex height1.85ex depth.4ex%
\hskip-2.25ex%
\hbox to2.25ex{\hfil\color{fg}\inserttocsectionnumber\hfil}}%
\kern1.25ex\inserttocsection\par}