[Indic-dev] Help understanding a (small?) Macro.

Dr. Dinesh Karia indic-dev@tug.org
Sat, 2 Nov 2002 14:23:10 +0530

Dear all,

    May I have your help in understanding the mechanism of the following
code in "texpause.sty"?  Line numbers are mine. I read the Chapter 23 of TTB
but then also I could not get the idea of storing the halfway page and then
restoring the same.

  1. \newbox\p@uses@vebox
  2. \newtoks\p@uses@veoutput
  3. \newcount\p@uses@vepage
  4. \def\pause{\global\p@uses@vepage=\count0\relax %save pagenumber
  5.  \p@uses@veoutput=\output % make backup copy of output routine
  6.  \output={\global\setbox\p@uses@vebox=\box255}% copy current contents
  7.        % only, when triggered
  8.  \vfill\eject %trigger now
  9.  \output=\p@uses@veoutput % restore output routine
10. \unvcopy\p@uses@vebox % insert contents
11. \eject % now really show the output
12.  \global\count0=\p@uses@vepage\relax %restore page number
13.  \unvbox\p@uses@vebox\vskip-\lastskip % and insert again for next turn
14.  }%

The above macro does the following in pdfslide.

whenever \pause command is put in a document the page built up so far is
output and it stops. When we go the next page, the content after \pause is
added to the displayed page. The tragedy is that it starts newline with the
word after \pause whereas I want the put the next word at the place where
otherwise it would have been put.

    Can anybody help me understand the above process? Perhaps what I ought
to do is the following.

After the line 9 above, we should be access the last hbox in \output and see
if there is a room for next box to be glued. If so, then instead of \unvcopy
we can use \unhcopy!!! But this does not work.

Dinesh Karia