Re: warning about multiply-defined labels

"Hans F. Nordhaug" <[email protected]> Thu, 24 Feb 2005 21:52:09 +0100
Newsgroups gmane.comp.tex.texpower.user
Message-ID <[email protected]>
On Thu, Feb 24, 2005 at 09:59:12AM +0100, Ben Mueller wrote:
> On Wed, 23 Feb 2005, Hans F. Nordhaug wrote:
[cut]
> > Your \switch solution has major drawback that you probably haven't considered
> > - you get empty steps, i.e., you need to advance two pages to get to bar.
> > Consider this example:
> > ----
> > \documentclass{seminar}
> > \usepackage[display]{texpower}
> > \usepackage{hyperref}
> > \begin{document}
> > \begin{slide}
> > \liststepwise*{
> > \begin{enumerate}
> >   % The duplicate step in the first label is avoid by the star to \liststepwise
> >   \item \step{\ifthenelse{\value{step}=\value{firststep}}{\label{foo}}{}} \step{bar}
> >   % The duplicate step in the second (and following) labels are avoided by using \restep
> >   \item \restep{\ifthenelse{\value{step}=\value{firststep}}{\label{foo2}}{}} \step{bar}
> >   % These two \switch commands produce four pages - do you see?
> >   \item \step{\switch{\label{foo3}}{bar}}
> >   \item \step{\switch{\label{foo4}}{bar}}
> > \end{enumerate}
> > }
> > \ref{foo}
> > \end{slide}
> > \end{document}
> > ----
> >
> Hi Hans,
> 
> you are right about my example producing empty steps. I should have
> written "\item \restep{\switch{\label{bar}}{foo}}" or "\step{\item
> \switch{\label{bar}}{foo}}" or something like that.
>
> But in your example the label `foo2' won't be defined, because when
> processing "\restep{...}" the value of the counter step is 2 while the
> value of firststep always is 1.

I stand corrected. "\item \restep{\switch{\label{bar}}{foo}}" works nicely.
 
> I wonder why using \steponce also produces the multiply-defined labels

I also wonder - because I also tried \steponce but couldn't make it work.
You are definitely touching an area of texpower that hasn't been tested enough.
I'll look more into it, but I think I have to let this case rest for now.

Thx a lot for your input.

Hans


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click