[texhax] How to dereference a \ref in a command definition?

Morten Høgholm morten.hoegholm at gmail.com
Sat May 17 16:04:00 CEST 2008

On Sat, 17 May 2008 13:45:54 +0200, martin f krafft wrote:

> also sprach Morten Høgholm <morten.hoegholm at gmail.com> [2008.05.17.1208  
> +0100]:
>> \getrefnumber from the refcount package.
> Ah, nice. Except in my thesis, I still get
> ! Use of \\aref doesn't match its definition.
> \@ifnextchar ... \reserved at d =#1\def \reserved at a {
>                                                   #2}\def \reserved at b  
> {#3}\f...
> l.52 ... documents, the \ac{DFSG} (see \aref{dfsg}
>                                                   ), a part of \D{}'s
> No idea what this is about... and no idea how to recreate that in
> the test case...

I did the following alterations:

   \protected at edef\curchapter{\thechapter}% removed \hbox{}
   \protected at edef\cursection{\thesection}% ditto
   \protected at edef\cursubsection{\thesubsection}% ditto
   \protected at edef\cursubsubsection{\thesubsubsection}% ditto
   \protected at edef\curref{#2}% here: never raw \edef in LaTeX!
   \typeout {DEBUG: curref: \meaning\curref}
   \typeout {DEBUG: cursec: \meaning\cursubsection}



More information about the texhax mailing list