Re: TeX extensions and \let\vtop\undefined




Jonathan Fine wrote:
Dan wrote:
Jonathan Fine wrote:

There is an explanation of \vtop in The TeXbook, page 81. My
understanding of this - not tested - is that
\setbox 0 = \vtop{ vertical material}
and
\setbox 0 = \vbox{ vertical material} % XXX
\ht 0 = <magic1>
\dp 0 = <magic2>
are equivalent, where <magic1> is the height of the
first item in the vertical material, and
<magic1> + <magic2>
is equal the \ht 0 + \dp 0 at stage XXX.


Your understanding is incorrect: changing the height and depth
of a box doesn't change its reference point: the box will still be
placed with the last item on the baseline.

Thank you, Dan, for your interest, and for joining in the
discussion.

I was suprised to hear this and so I tested the proposition.
===

\def\doit#1#2{%
\setbox0\vbox{\hrule width 1in height0.5in depth 0.5in}%
\ht0 #1
\dp0 #2
\box0
}
\hbox{\doit{0in}{1in}\doit{1in}{0in}\doit{0.5in}{0.5in}}
===
The test shows that I am right. We get three squares in a line,
vertically aligned low, high and middle.

However, this works only for \vbox. For \hbox (about which
I made no claim) one gets three squares in a line).
===
\def\doit#1#2{%
\setbox0\hbox{\vrule width 1in height0.5in depth 0.5in}%
\ht0 #1
\dp0 #2
\box0
}

\hbox{\doit{0in}{1in}\doit{1in}{0in}\doit{0.5in}{0.5in}}
===

I think, in this case, my not previously tested understanding
was correct.


You are correct.

I was surprised to find this inconsistency in TeX. I could only
find this explained in Appendix D "Dirty Tricks" in the TeXbook.
(I might add that changing the height alone is sufficient to shift
the reference point, but changing the depth is not. This is
reversed for \vtop.)

Chapter 12 contains quite a detailed explanation of how
the height and depth of a _constructed_ vbox is determined.
But I can find no mention of how changing the depth or height
_afterwards_ changes the position of the contents. In the
special case where the depth exceeds \boxmaxdepth, it is
stated that the height and depth are adjusted (and the
reference point moved), but I saw that as a special case.

After readind Appendix D, I can see how Chapter 12 could
_possibly_ be interpreted as providing an absolute relationship
between the height, depth and reference point, but I certainly
didn't interpret it that way.


Dan

.



Relevant Pages

  • Re: META: Adventures in Comprehension-- Why I did it...
    ... sort of give lip-service forgiveness to someone but understanding is ... It's not that I don't have a frame of reference: ... It's much easier, though, to say that everything sucks. ...
    (rec.arts.comics.creative)
  • Re: Direct TWLS Measurement
    ... The SRians claimed that numerous such expriments have ... > been done and I am trying to get them to give me a reference and they ... all interatomic distances -- or markings on a ruler, ... At least, such is my understanding. ...
    (sci.physics.relativity)
  • Re: Apology Re: Is everything a refrence or isnt it?
    ... What's broken is their understanding of what variables are ... >> "Everything in Python is a reference, so this should work, but it ... POINTERS, the pointer to the object is passed by making a copy of it on ... the stack, so there is no way that the callee can directly alter the ...
    (comp.lang.python)
  • Re: Apology Re: Is everything a refrence or isnt it?
    ... What's broken is their understanding of what variables are ... >> "Everything in Python is a reference, so this should work, but it ... POINTERS, the pointer to the object is passed by making a copy of it on ... the stack, so there is no way that the callee can directly alter the ...
    (comp.lang.python)
  • Re: Apology Re: Is everything a refrence or isnt it?
    ... What's broken is their understanding of what variables are ... >> "Everything in Python is a reference, so this should work, but it ... POINTERS, the pointer to the object is passed by making a copy of it on ... the stack, so there is no way that the callee can directly alter the ...
    (comp.lang.python)