texlive 2018 버전을 사용하여 비머 북마크의 각 섹션, 하위 섹션 및 하위 하위 섹션에 번호를 매기고 싶습니다. 이 문제는 에서 제공한 솔루션에 따르면 수년 전에 해결된 것 같습니다.사이버 특이점문제의Beamer에서 북마크 번호 매기기 조정.
나는 그것을 따라갔고texlive 2017에서 해결했습니다.하지만 작년에는 코드를 컴파일할 수 없었습니다.텍스라이브 2018Windows OS의 경우:
북마크는 다음과 같습니다
코드는 다음과 같습니다:
\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}
그래서,위의 코드를 수정하고 하위 섹션과 하위 섹션에 번호를 매기는 방법?
도움을 주셔서 감사합니다.
답변1
비머는 이제 하위 섹션 및 하위 섹션 명령 \subsecname 및 \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}