스무스바 테마를 사용한 헤드라인의 하위 섹션 번호 매기기

스무스바 테마를 사용한 헤드라인의 하위 섹션 번호 매기기

(다름슈타트에서 사용하는) 스무드바 외부 테마를 사용하면 하위 섹션 헤드라인이 마음에 들지만 이전에 섹션 및 하위 섹션 번호를 인쇄하고 싶습니다.

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

여기에 이미지 설명을 입력하세요

관련 정보