我尝试这样做:
\usepackage[toc,page]{appendix}
\newcommand{\nocontentsline}[3]{}
\newcommand{\tocless}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}
但它不起作用;知道如何在 Beamer 的目录中做到这一点吗?
答案1
您可以\beamer@(sub)subsectionintoc
像这样重新定义宏:
\documentclass{beamer}
\makeatletter
\def\subsectionintoc{}
\long\def\beamer@subsectionintoc#1#2#3#4#5#6{%
\ifnum\c@tocdepth>1%
\ifnum#5=\beamer@showpartnumber%
{%
\beamer@saveanother%
\gdef\beamer@todo{}%
\beamer@slideinframe=#1\relax%
\expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
\ifbeamer@pausesubsections\pause\fi%
\beamer@tempcount=#6%
\advance\beamer@tempcount by\beamer@sectionadjust%
\edef\inserttocsectionnumber{\the\beamer@tempcount}%
\def\inserttocsubsectionnumber{#2}%
\def\inserttocsubsection{\hyperlink{Navigation#4}{#3}\dotfill #4}%
\beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@css\else\beamer@toc@oss\fi}%
{%
\def\beamer@breakhere{\\}%
\beamer@tocact{\ifnum\c@section=#1\ifnum\c@subsection=#2\beamer@toc@css\else\beamer@toc@oss\fi\else\beamer@toc@ooss\fi}
{subsection in toc}%
}%
}}%
\beamer@restoreanother%
}%
\beamer@todo%
\fi\fi%
}
\def\subsubsectionintoc{}
\long\def\beamer@subsubsectionintoc#1#2#3#4#5#6#7{%
\ifnum\c@tocdepth>2%
\ifnum#6=\beamer@showpartnumber%
{
\beamer@saveanother%
\gdef\beamer@todo{}%
\beamer@slideinframe=#1\relax%
\expandafter\only\beamer@tocsections{\gdef\beamer@todo{%
\ifbeamer@pausesubsections\pause\fi%
\beamer@tempcount=#7%
\advance\beamer@tempcount by\beamer@sectionadjust%
\edef\inserttocsectionnumber{\the\beamer@tempcount}%
\def\inserttocsubsectionnumber{#2}%
\def\inserttocsubsubsectionnumber{#3}%
\def\inserttocsubsubsection{\hyperlink{Navigation#5}{#4}\dotfill #5}%
\beamer@tocifnothide{\ifnum\c@section=#1\beamer@toc@csss\else\beamer@toc@osss\fi}%
{%
\def\beamer@breakhere{\\}%
\beamer@tocact{\ifnum\c@section=#1\ifnum\c@subsection=#2\ifnum\c@subsubsection=#3\beamer@toc@csss\else\beamer@toc@osss\fi\else\beamer@toc@oosss\fi\else\beamer@toc@ooosss\fi}
{subsubsection in toc}%
}%
}}%
\beamer@restoreanother%
}
\beamer@todo%
\fi\fi%
}
\makeatother
\begin{document}
\begin{frame}
\tableofcontents
\end{frame}
\section{sec title}
\subsection{sub title}
\subsubsection{subsub title}
\begin{frame}
abc
\end{frame}
\end{document}