我正在尝试使用 enumitem-zref 包来自动引用枚举的所有项目。这是一个简单的例子(在互联网上找到,但似乎与文档一致):
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{hyperref}
\usepackage{enumitem,enumitem-zref}
\begin{document}
\begin{enumerate}[start=34,label=(\arabic*),name=thelist]
\item stuff
\item more stuff \label{more stuff}
\item yet more
\end{enumerate}
This is \refitem{thelist,35} or \refitem{thelist{35}}
and this is also \refitem{more stuff}
\end{document}
不幸的是,我无法让它工作;我收到以下错误(从 pdflatex 中提取日志):
...
Package zref Info: New property list: zen@list on input line 108.
Package zref Info: New property: zen@ on input line 110.
Package zref Info: New property: zen@page on input line 117.
...
Package zref Info: New property: zen@counter on input line 135.
! Package zref Error: Property `zen@default,zen@page,zen@type,zen@depth,zen@lis
tctr,zen@listname,zen@index,zen@label,zen@ref,zen@starlabel,zen@parents,zen@ref
item,zen@commaref,zen@item,zen@currentlabel,zen@counter' does not exist.
See the zref package documentation for explanation.
Type H <return> for immediate help.
我尝试了一些小改动(包括明确地进行 zref 操作,更改包含顺序……),但没有成功。我不知道问题是否来自我的配置(pdfTeX 3.1415926-2.4-1.40.13(TeX Live 2012/Arch Linux))。我找不到任何等效的软件包,也无法编写简单的解决方法(我对 LaTeX 还很陌生)。我只想能够编写类似以下内容的代码:
\begin{enumerate}[name=mylist,label=\arabic*.]
\item First item;
\item Second item;
\begin{enumerate}[label=(\alph*)]
\item first subitem,
\item second subitem,
\item third subitem;
\end{enumerate}
\item Third item.
\end{enumerate}
所有项目都被自动引用(例如,通过item:mylist.1
、、、等item:mylist.2
),从而显示超链接“2.(c)”或类似内容。item:mylist.2.1
item:mylist.2.2
\ref{item:mylist.2.3}
感谢您的帮助。