Re: warning about multiply-defined labels

"Hans F. Nordhaug" <[email protected]> Wed, 23 Feb 2005 18:52:02 +0100
Newsgroups gmane.comp.tex.texpower.user
Message-ID <[email protected]>
On Wed, Feb 23, 2005 at 05:58:41PM +0100, Roland Schilling wrote:
> On Wed, 23 Feb 2005, Ben Mueller wrote:
> 
> > Dear texpower-users,
> >
> > compiling the following minimal example
> > ----------------------------------------------------------
> > \documentclass{seminar}
> > \usepackage[display]{texpower}
> >
> > \begin{document}
> > \begin{slide}
> >
> > \liststepwise{
> > \begin{enumerate}
> >   \item \label{foo} \step{bar}
> > \end{enumerate}
> > }
> >
> > \ref{foo}
> >
> > \end{slide}
> > \end{document}
> > ---------------------------------------------------------
> > I got a warning message about a multiply-defined label `foo'.
> > After removing the "\begin{slide}" and "\end{slide}" the warning
> > disappeared. But I hope, there are better solutions to avoid this
> > confusing warning.
> 
> 
> Try \documentclass{powersem} instead of \documentclass{seminar}.
> This fixes some problems occuring with the seminar class.  If you
> intend to use 'hyperref' you should also load 'fixseminar.sty'
> after you loaded 'hyperref.sty'.

Even though using powersem over seminar is sound advice it doesn't solve this
problem. An ugly/verbose work-around is the following:
----
\documentclass{seminar}
\usepackage[display]{texpower}
\begin{document}
\begin{slide}
\liststepwise*{
\begin{enumerate}
  \item \step{\ifthenelse{\value{step}=\value{firststep}}{\label{foo}}{}}
\step{bar}
\end{enumerate}
}
\ref{foo}
\end{slide}
\end{document}
----
The trick is putting \label{foo} inside a step and only execute \label for 
the first step. (You can of course make a command for this work around if 
you really need it a lot.) 

Hans

PS! They way you have written it the label will of course be execute several
times - once for each step in the stepwise command and hence it's really not a
bug. However, since it does work without the slide environment I'll look more
into it.


-------------------------------------------------------
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