[comp.text.tex] lastskip

neumann@FUNCTION.MPS.OHIO-STATE.EDU ("Walter D. Neumann") (03/15/91)

\midinsert still has unresolved problems, which I will report on,
hopefully with solution, soon.  In trying to fix it I ran into a
stupid debugging problem in trying to see why a \removelastskip
was not removing the last skip.  If I define
\def\t{\immediate\write16{\the\lastskip}}
and then tex "\medbreak\t\medbreak" with \tracingall,
I see that the \t tells me that \lastskip is 0.0pt between the
two medbreaks, while the text \ifdim\lastskip<\medskipamount
inside the second \medbreak yields "false" (as it should).
 
What am I understanding wrong?
 
 
--
 Walter Neumann                     Email:       neumann@mps.ohio-state.edu
 Department of Mathematics                       neumann@ohstpy.bitnet
 Ohio State University              Fax: 614-292-3639 to Neumann, Math Dept
 Columbus, OH 43210          Tel: (614)-292-4886(office) 292-4975(messages)

Schoepf@SC.ZIB-BERLIN.DBP.DE (Rainer Schoepf) (03/19/91)

   From: "Walter D. Neumann" <neumann@function.mps.ohio-state.edu>
 
   \midinsert still has unresolved problems, which I will report on,
   hopefully with solution, soon.  In trying to fix it I ran into a
   stupid debugging problem in trying to see why a \removelastskip
   was not removing the last skip.  If I define
   \def\t{\immediate\write16{\the\lastskip}}
   and then tex "\medbreak\t\medbreak" with \tracingall,
   I see that the \t tells me that \lastskip is 0.0pt between the
   two medbreaks, while the text \ifdim\lastskip<\medskipamount
   inside the second \medbreak yields "false" (as it should).
 
There is some special treatment of vertical-type quantities
(like your \lastskip) within a \write.  Try the following:
 
\def\t{\skip0=\the\lastskip\immediate\write16{\the\skip0}}
 
With this you get the correct value of \lastskip.  If I remember
correctly, the problem with \write is that TeX is in a special
"no-mode" when it is processing the content of the \write, and
\lastskip can only be accessed reliably in vertical and horizontal
modes.  The only way to find this out is to read TeX - the program.
I'm sorry---there are lots of things that are not in the TeXbook...
 
 
   Dr. Rainer Schoepf
   Konrad-Zuse-Zentrum                       ,,Ich mag es nicht, wenn
    fuer Informationstechnik Berlin            sich die Dinge so frueh
   Heilbronner Strasse 10                      am Morgen schon so
   D-1000 Berlin 31                            dynamisch entwickeln!''
   Federal Republic of Germany
   <Schoepf@sc.ZIB-Berlin.dbp.de> or <Schoepf@sc.ZIB-Berlin.de>
 

eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) (03/20/91)

Schoepf@SC.ZIB-BERLIN.DBP.DE (Rainer Schoepf) writes:

>There is some special treatment of vertical-type quantities
>(like your \lastskip) within a \write.  Try the following:
> 
>\def\t{\skip0=\the\lastskip\immediate\write16{\the\skip0}}
> 
>With this you get the correct value of \lastskip.  If I remember
>correctly, the problem with \write is that TeX is in a special
>"no-mode" when it is processing the content of the \write, and

Note that with \spacefactor and \prevdepth there are the
same sort of problems, but there you get an error message.

Victor.