![用于枚举项目的 PDF 书签](https://linux22.com/image/405573/%E7%94%A8%E4%BA%8E%E6%9E%9A%E4%B8%BE%E9%A1%B9%E7%9B%AE%E7%9A%84%20PDF%20%E4%B9%A6%E7%AD%BE.png)
我正在尝试插入枚举项的 PDF 书签:
我定义了一个几乎可以正常工作的自定义列表类型exercises
:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\usepackage[pdfusetitle,bookmarks=true]{hyperref}
\usepackage{bookmark}
\usepackage{cleveref}
\newlist{exercises}{enumerate}{2}
\setlist[exercises,1]{left=-2\parindent .. -\parindent,label=\protect\pdfbookmark[1]{Exercise \arabic*}{ex-\arabic*}\arabic*., ref=\arabic*}
\setlist[exercises,2]{left=0pt .. \parindent,label=\protect\pdfbookmark[2]{Part \alph*}{ex-\arabic{exercisesi}-part\alph*}\alph*), ref=\arabic{exercisesi}.~\alph*)}
\crefname{exercisesi}{exercise}{exercises}
\crefname{exercisesii}{exercise}{exercises}
\creflabelformat{exercisesii}{#2#1#3}
\begin{document}
\begin{exercises}
\item \label{part:1} \begin{exercises}
\item \label{part:1a}
This is \cref{part:1a}
Second line
\item B
\newpage
\item c
\end{exercises}
\item \label{part:2} \begin{exercises}
\item \label{part:2a}
That was \cref{part:1a}
Second line
\item B
\item c
\end{exercises}
\end{exercises}
\end{document}
不幸的是,这有两个问题:
我该如何做呢?