我怎样才能在目录中列出子部分并在其间使用破折号?我找到了部分解决方案(感谢 samcarter,在上一个问题中),但是当目录显示在子部分的开头时,破折号也会突出显示。
\documentclass{beamer}
\setbeamertemplate{subsection in toc}{%
\ifnum\inserttocsubsectionnumber>1
$-$\hspace{0.5em}%
\fi
\inserttocsubsection}
\begin{document}
\section{Section}
\subsection{This}
\begin{frame}{test}
\end{frame}
\subsection{Is}
\tableofcontents[subsectionstyle=show/shaded]
\begin{frame}{test}
\end{frame}
\subsection{A}
\begin{frame}{test}
\end{frame}
\subsection{Minimal}
\begin{frame}{test}
\end{frame}
\subsection{Working}
\begin{frame}{test}
\end{frame}
\subsection{Example}
\begin{frame}{test}
\end{frame}
\end{document}
答案1
可能有点奇怪,不确定下面的解决方法会破坏什么......
\documentclass{beamer}
\colorlet{foo}{black}
\setbeamertemplate{subsection in toc}{%
\ifnum\inserttocsubsectionnumber>1
{%
\color{black!20}%
$-$\hspace{0.5em}%
}%
\fi
\textcolor{foo}{\inserttocsubsection}}
\setbeamertemplate{subsection in toc shaded}{%
%\begin{colormixin}{20!parent.bg}
\begingroup%
\colorlet{foo}{black!20}%
\usebeamertemplate{subsection in toc}%
%\end{colormixin}
\endgroup%
\unskip}
\begin{document}
\section{Section}
\subsection{This}
\begin{frame}{test}
\end{frame}
\subsection{Is}
\begin{frame}
\tableofcontents[subsectionstyle=show/shaded]
\end{frame}
\begin{frame}{test}
\end{frame}
\subsection{A}
\begin{frame}{test}
\end{frame}
\subsection{Minimal}
\begin{frame}{test}
\end{frame}
\subsection{Working}
\begin{frame}{test}
\end{frame}
\subsection{Example}
\begin{frame}{test}
\end{frame}
\end{document}