Re: References to pages within \stepwise
Andreas Matthias <[email protected]> 21 Dec 2003 00:19:11 +0100
| Newsgroups | gmane.comp.tex.texpower.user |
|---|---|
| Message-ID | <[email protected]> |
Hans Fredrik Nordhaug wrote:
> On Fri, 12 Dec 2003, Andreas Matthias wrote:
>
> ----
> \documentclass[a4paper]{article}
> \usepackage[display]{texpower}
> \usepackage{count1to}
> \def\abspage{\the\count1}
>
> \makeatletter
> \newcount\foobar
> \def\WriteLabel{%
> \protected@write\@auxout{\let\abspage\relax}
> {\string\newlabel{foobar\the\foobar}{{}{\abspage}}}%
> \global\advance\foobar\@ne
> }
> \renewcommand{\do@insert@firstanchor@TP}{\SetLabel}
> \renewcommand{\dont@insert@firstanchor@TP}{\SetLabel}
> \def\AddLabel{\global\let\SetLabel\WriteLabel\AtShipout{\KillLabel}}
> \def\KillLabel{\global\let\SetLabel\relax}
> \def\StepLabel{\ifthenelse{\boolean{firstactivation}}{\AddLabel}{}}
> \makeatother
>
> \KillLabel
>
> \begin{document}
> \Huge testing
> \stepwise{%
> \step{foo}%
> \step{bar}%
> \step{baz\StepLabel}%
> }
> Bla-bla
> \newpage
> foobar
> \pause
> foobar again \AddLabel
> \pause
> foobar again again
> \end{document}
> ----
>
> What do you think - slightly better?
Yes, that's it. And after some stupid problems -- I then used
\newcounter instead of \newcount and forgot about \releasecounter --
I even got it working in my other documents and pdfpages, too.
I am happy now!
> You use \StepLabel inside steps and \AddLabel elsewhere.
I added one more indirection, so that one does not have to
distinguish between \AddLabel and \StepLabel:
\def\@AddLabel{\global\let\SetLabel\WriteLabel\AtShipout{\KillLabel}}
\def\KillLabel{\global\let\SetLabel\relax}
\def\AddLabel{%
\ifthenelse{\boolean{instepwise@TP}}
{\ifthenelse{\boolean{firstactivation}}{\@AddLabel}{}}
{\@AddLabel}}
Now \AddLabel is working within and outside of \stepwise.
Thank you very much for your help. I appreciate it.
Ciao
Andreas
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click