[tex-eplain] \definexref problem
Adam Fenn
acwfenn at hotmail.com
Wed Nov 2 14:11:01 CET 2005
I made a slight modification to Oleg's suggestion:
\def\book#1#2#3{%
\definexref{#3:long}{#1}{}%
\definexref{#3:short}{#2}{}%
\definexref{#3full}{#1}{}%
}
\def\bookref#1{%
\readauxfile % make sure the xrefs are loaded
\expandafter \ifx\csname\xrlabel{#1}\endcsname\relax % no marker defined
\global\expandafter\let\csname\xrlabel{#1}\endcsname\empty % define it
\csname\xrlabel{#1:long}\endcsname % produce the long ref
\else % the marker already defined
\csname\xrlabel{#1:short}\endcsname % produce the short ref
\fi
}
\book
{first book (long reference)}
{first book (short ref)}
{firstbook}
\book
{article in \xrefn{firstbookfull}}
{article (short ref)}
{article}
\bookref{firstbook} % a long first reference
\bookref{firstbook} % a short second reference
\bookref{article} % a long reference to article in first book
\bookref{article} % a short reference
This worked, but when I changed over to eplain 3.0 (from 2.8.4) I get
! Undefined control sequence.
\@optionaltemp ...ingroup \def \extension
{#1}\immediate \openin 0 = ...
\@getoptionalarg #1->\let \@optionaltemp =
#1\let \@optionalnext = \r...
<argument> article in \xrefn
{firstbookfull}
\definexref ...g \@definelabel {\temp }{#2
}{#3}}}\@wr \ignorespaces
\book #1#2#3->\definexref {#3:long}{#1}{}
\definexref {#3:short}{#2}{}...
l.31 {article}
Is this a bug? and if not why does it work with the earlier version and not
the latest?
Adam Fenn.
More information about the tex-eplain
mailing list