This is what I'm trying to achieve:
I'm trying to obtain it using this code:
documentclass{article}
\usepackage{enumitem}
\begin{document}
\newcounter{entry}
\setcounter{entry}{1000}
\newcommand{\xlistformat}[1]{\theentry.~(#1)} % This is the interesting part
\newlist{xlist}{enumerate}{1}
\setlist[xlist]{
label = {\xlistformat{\alph*}},
leftmargin = *,
align = left
}
\begin{xlist}
\item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut
purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget,
consectetuer id, vulputate a, magna.
\end{xlist}
\end{document}
This doesn't work. I get this instead:
I can make it work by changing
\newcommand{\xlistformat}[1]{\theentry.~(#1)}
to
\makeatletter
\newcommand{\xlistformat}[1]{\number\c@entry.~(#1)}
\makeatother
but this has many other problems.
I'm not sure what I need to change to get this working. I've tried using the format
key instead of the label
, but that has given essentially the same result. My guess is that something's going wrong with the expansion of \theentry
, but my experiments in that direction have borne no fruit.