[texhax] enumerate inconsistency

Ulrike Fischer news3 at nililand.de
Sun Nov 8 13:44:12 CET 2015

Am Sat, 7 Nov 2015 12:20:42 -0800 schrieb William F Hammond:

> Victor Ivrii writes:
>> If in {enumerate} item does not have a custom "label" then supplying it
>> with a \label{A} works: \ref{A} returns a value of the standard label.
>> On the other hand, if item has a custom label then \label{C} fails: \ref{C}
>> returns either empty (as in the example below) or value of the larger
>> environment (say, section)
> Yes, I think this is the way it is.  \ref needs to look at a
> counter.  

No, \ref looks at \@currentlabel, and there is no real technical
reason why the optional argument doesn't change it, it is a design
reason, which one can find arguable.


%%%Standard labels%%%
\item one\label{A}
\item two\label{B}

\ref{A} \ref{B}

%%%Custom labels%%%
\item[oh] \makeatletter \def\@currentlabel{oh} \makeatother
\item[ah] \makeatletter \def\@currentlabel{ah} \makeatother

\ref{C} \ref{D}


Ulrike Fischer 

More information about the texhax mailing list