使用 \usepackage[screen]{pdfscreen} 设置 pdfbookmark 进行枚举

使用 \usepackage[screen]{pdfscreen} 设置 pdfbookmark 进行枚举

我的 tex 文件使用\usepackage[screen]{pdfscreen},我也想在这个文件中设置 pdfbookmark 进行枚举。我试过了

\documentclass{article}

\usepackage{lipsum}
\usepackage{hyperref}
\hypersetup{bookmarksnumbered=true, bookmarksopen=true,bookmarksdepth=2}
\usepackage[shortlabels]{enumitem}
\newcommand{\itemm}[1][]{\item\label{item:#1}\pdfbookmark[2]{#1}{anchor:#1}}

\usepackage[screen]{pdfscreen} %comment this???

\begin{document}

%===================================================
\section{A}

\begin{enumerate}[{1}.1]

\itemm[1.1] %--------------------------------------------
\lipsum[11]

\itemm[1.2] %--------------------------------------------
\lipsum[12]

\end{enumerate}

%===================================================
\section{B}

\begin{enumerate}[{2}.1]

\itemm[2.1] %--------------------------------------------
\lipsum[21]

\itemm[2.2] %--------------------------------------------
\lipsum[22]

\itemm[2.3] %--------------------------------------------
\lipsum[1-3]

\end{enumerate}

\end{document}

我注意到,pdfbookmarks 仅1.1, 1.2,...在我们发表评论时才有效\usepackage[screen]{pdfscreen}。我们能用\usepackage[screen]{pdfscreen}present 来解决这个问题吗?

答案1

pdfscreen 将 pdfpagemode 更改为 none,您可以切换回来:

\documentclass{article}

\usepackage{lipsum}
\usepackage{hyperref}
\hypersetup{bookmarksnumbered=true, bookmarksopen=true,bookmarksdepth=2}
\usepackage[shortlabels]{enumitem}
\newcommand{\itemm}[1][]{\item\label{item:#1}\pdfbookmark[2]{#1}{anchor:#1}}

\usepackage[screen]{pdfscreen} %comment this???
\hypersetup{pdfpagemode=UseOutlines} %show outlines
\begin{document}

%===================================================
\section{A}

\begin{enumerate}[{1}.1]

\itemm[1.1] %--------------------------------------------
\lipsum[11]

\itemm[1.2] %--------------------------------------------
\lipsum[12]

\end{enumerate}

%===================================================
\section{B}

\begin{enumerate}[{2}.1]

\itemm[2.1] %--------------------------------------------
\lipsum[21]

\itemm[2.2] %--------------------------------------------
\lipsum[22]

\itemm[2.3] %--------------------------------------------
\lipsum[1-3]

\end{enumerate}

\end{document}

在此处输入图片描述

相关内容