<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hi,<DIV><BR class="khtml-block-placeholder"></DIV><DIV>I would like to redefine the current label of a new command using the value of a savebox and a counter. My first guess would have been the following:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>--------</DIV><DIV>\newcommand{\newreqtype}[1]{\sbox{\reqsbox}{\bfseries#1}\setcounter{req}{0}}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>\newcommand{\req}[]{</DIV><DIV>...</DIV><DIV>\def\@currentlabel</DIV><DIV>       {\csname p@req \endcsname \usebox{\reqsbox} -\thereq}% </DIV><DIV>}</DIV><DIV>--------</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This does not run. If I substitute </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>\usebox{\reqsbox}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV> in the definition of currentlabel with</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>\leavevmode \copy \reqsbox \relax </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>it runs but unfortunaly the label assigned to each "req" is wrong.</DIV><DIV>For instance if I have in my tex file:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-------</DIV><DIV>\newreqtype{S-GEN}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>..... \ref{req:t-perf:1} ...</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>\newreqtype{T-PERF}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>\req{}{}...{}\label{req:t-perf:1}</DIV><DIV>--------</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>the resulting label is S-GEN-1 instead of T-PERF-1. The counter is assigned correctly (I checked in the case of more than one "req" defined), but the content of the saved box is the one defined where the \ref{} command is used and not the \label{} one. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I would greatly appreciate your help! </DIV><DIV>Please do not hesitate contacting me if my problem is not made enough clear.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks in advance,</DIV><DIV>Francesca</DIV><DIV><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Comic Sans MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>    ^-^</DIV><DIV>   (o o)</DIV><DIV>     v</DIV><DIV>  (/   \)</DIV><DIV>****^*^***************************************************************</DIV><DIV> Francesca De Angeli                         E-mail: <A href="mailto:fda@ast.cam.ac.uk">fda@ast.cam.ac.uk</A></DIV><DIV> Institute of Astronomy</DIV><DIV> University of Cambridge</DIV><DIV> Madingley Road                                 tel: (+44) 1223 337546</DIV><DIV> Cambridge, CB3 0HA, UK</DIV><DIV>**********************************************************************</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></DIV></BODY></HTML>