нумерация подразделов в заголовке с темой Smoothbar

нумерация подразделов в заголовке с темой Smoothbar

В теме Smoothbar External (используемой Darmstadt) мне нравится заголовок подраздела, но я хочу сначала напечатать номер раздела и подраздела.

Я попытался изменить шаблон заголовка, добавив \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}

введите описание изображения здесь

Связанный контент