Quero numerar cada seção, subseção e subseção nos marcadores do beamer usando a versão texlive 2018. Este problema parece ter sido resolvido há muitos anos, de acordo com as soluções fornecidas porcibersingularidadeem questãoAjustar a numeração dos favoritos no Beamer.
Eu segui eresolvi isso no texlive 2017no ano passado, porém, não consigo compilar o código emtexlive 2018no sistema operacional Windows:
o marcador é:
O código é o seguinte:
\documentclass{beamer}
\documentclass{beamer}
\hypersetup{
bookmarksnumbered=true
}
\setcounter{tocdepth}{4}
% get numbering in section bookmarks
\usepackage{etoolbox}
\usepackage{bookmark}
\makeatletter
\newcounter{realsection}
\newif\ifrealsection
\long\def\beamer@@ssection*#1{\realsectionfalse\beamer@section[{#1}]{}}
\long\def\beamer@@@section#1{\realsectiontrue\beamer@section[{#1}]{#1}}
\patchcmd{\beamer@section}%
{\refstepcounter{section}}%
{\ifrealsection\refstepcounter{realsection}\fi\refstepcounter{section}}%
{}{\errmessage{failed to patch}}
\patchcmd{\beamer@section}%
{\Hy@writebookmark{\the\c@section}{\secname}}%
{\Hy@writebookmark{\the\c@section}{\numberline{\therealsection}\secname}}%
{}{\errmessage{failed to patch}}
\patchcmd{\beamer@subsection}%
{\Hy@writebookmark{\the\c@subsection}{#2}}%
{\Hy@writebookmark{\the\c@subsection}{\numberline{\therealsection.\thesubsection}#2}}%
{}{\errmessage{failed to patch}}
\patchcmd{\beamer@subsubsection}%
{\Hy@writebookmark{\the\c@subsubsection}{#2}}%
{\Hy@writebookmark{\the\c@subsubsection}{\numberline{\therealsection.\thesubsection.\thesubsubsection}#2}}%
{}{\errmessage{failed to patch}}
\makeatother
\begin{document}
\section*{Intro}
\section{section}
\begin{frame}
\end{frame}
\subsection{subsection}
\begin{frame}
\end{frame}
\subsubsection{subsubsection}
\begin{frame}
\end{frame}
\section{section}
\begin{frame}
\end{frame}
\subsection{subsection}
\begin{frame}
\end{frame}
\subsubsection{subsubsection}
\begin{frame}
\end{frame}
\subsubsection{subsubsection}
\begin{frame}
\end{frame}
\end{document}
Então,como faço para modificar o código acima e numerar a subseção e a subseção?
Muito obrigado pela sua ajuda.
Responder1
O beamer agora usa também para comandos de subseção e subsubseção \subsecname e \subsubsecname:
\documentclass{beamer}
\hypersetup{
bookmarksnumbered=true
}
\setcounter{tocdepth}{4}
% get numbering in section bookmarks
\usepackage{etoolbox}
\usepackage{bookmark}
\makeatletter
\newcounter{realsection}
\newif\ifrealsection
\long\def\beamer@@ssection*#1{\realsectionfalse\beamer@section[{#1}]{}}
\long\def\beamer@@@section#1{\realsectiontrue\beamer@section[{#1}]{#1}}
\patchcmd{\beamer@section}%
{\refstepcounter{section}}%
{\ifrealsection\refstepcounter{realsection}\fi\refstepcounter{section}}%
{}{\errmessage{failed to patch}}
\patchcmd{\beamer@section}%
{\Hy@writebookmark{\the\c@section}{\secname}}%
{\Hy@writebookmark{\the\c@section}{\numberline{\therealsection}\secname}}%
{}{\errmessage{failed to patch}}
\patchcmd{\beamer@subsection}%
{\Hy@writebookmark{\the\c@subsection}{\subsecname}}%
{\Hy@writebookmark{\the\c@subsection}{\numberline{\therealsection.\thesubsection}\subsecname}}%
{}{\errmessage{failed to patch}}
\patchcmd{\beamer@subsubsection}%
{\Hy@writebookmark{\the\c@subsubsection}{\subsubsecname}}%
{\Hy@writebookmark{\the\c@subsubsection}{\numberline{\therealsection.\thesubsection.\thesubsubsection}\subsubsecname}}%
{}{\errmessage{failed to patch}}
\makeatother
\begin{document}
\section*{Intro}
\section{section}
\begin{frame}
\end{frame}
\subsection{subsection}
\begin{frame}
\end{frame}
\subsubsection{subsubsection}
\begin{frame}
\end{frame}
\section{section}
\begin{frame}
\end{frame}
\subsection{subsection}
\begin{frame}
\end{frame}
\subsubsection{subsubsection}
\begin{frame}
\end{frame}
\subsubsection{subsubsection}
\begin{frame}
\end{frame}
\end{document}