使用 smoothbar 外部主题(达姆施塔特使用)时,我喜欢子部分标题,但我想先打印部分和子部分编号。
我尝试通过添加\thesection.\thesubsection\
行来修改标题模板\insertsubsectionhead
,但数字也出现在标题页或摘要中,而这并不是我想要的。
我也尝试过使用\insertsubsectionheadnumber
,但是没有用 :(。
分数维:
\documentclass{beamer}
\useoutertheme{smoothbars}
\makeatletter
\setbeamertemplate{headline}{%
\pgfuseshading{beamer@barshade}%
\ifbeamer@sb@subsection%
\vskip-9.75ex%
\else%
\vskip-7ex%
\fi%
\begin{beamercolorbox}[ignorebg,ht=2.25ex,dp=3.75ex]{section in head/foot}
\insertnavigation{\paperwidth}
\end{beamercolorbox}%
\ifbeamer@sb@subsection%
\begin{beamercolorbox}[ignorebg,ht=2.125ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
\usebeamerfont{subsection in head/foot}\thesection.\thesubsection\ \insertsubsectionhead
\end{beamercolorbox}%
\fi%
}%
\makeatother
\AtBeginSection[]{
\begin{frame}
\tableofcontents[currentsection]
\end{frame}
}
\begin{document}
\begin{frame}{Summary}
\tableofcontents%[pausesections]
\end{frame}
\section{section 1}
\subsection{sub 1}
\frame{}
\end{document}
答案1
我不完全确定我是否正确理解了你的问题,但是你只是想隐藏\thesection.\thesubsection\
带有空白小节的幻灯片吗?
\documentclass{beamer}
\useoutertheme{smoothbars}
\usepackage{etoolbox}
\makeatletter
\setbeamertemplate{headline}{%
\pgfuseshading{beamer@barshade}%
\ifbeamer@sb@subsection%
\vskip-9.75ex%
\else%
\vskip-7ex%
\fi%
\begin{beamercolorbox}[ignorebg,ht=2.25ex,dp=3.75ex]{section in head/foot}
\insertnavigation{\paperwidth}
\end{beamercolorbox}%
\ifbeamer@sb@subsection%
\begin{beamercolorbox}[ignorebg,ht=2.125ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
\usebeamerfont{subsection in head/foot}
\ifx\insertsubsection\empty\else%
\ifdefempty{\subsecname}{\relax}{%
\thesection.\thesubsection\ \insertsubsectionhead%
}%
\fi
\end{beamercolorbox}%
\fi%
}%
\makeatother
\AtBeginSection[]{
\begin{frame}
\tableofcontents[currentsection]
\end{frame}
}
\begin{document}
\begin{frame}{Summary}
\tableofcontents%[pausesections]
\end{frame}
\section{section 1}
\subsection{sub 1}
\frame{}
\end{document}