スムーズバーテーマを使用した見出しのサブセクション番号付け

スムーズバーテーマを使用した見出しのサブセクション番号付け

スムーズバーの外側のテーマ (Darmstadt で使用) では、サブセクションの見出しは気に入っていますが、その前にセクションとサブセクション番号を印刷したいです。

\thesection.\thesubsection\の行を追加して見出しテンプレートを変更しようとしました\insertsubsectionheadが、数字がタイトルページや概要にも表示されてしまい、望ましくありません。

私も使ってみましたが\insertsubsectionheadnumber、うまくいきませんでした:(。

MWE :

\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}

ここに画像の説明を入力してください

関連情報