Re: TeX extensions and \let\vtop\undefined
- From: "Dan" <luecking@xxxxxxxx>
- Date: 1 Sep 2006 08:30:18 -0700
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
.
- Follow-Ups:
- Re: TeX extensions and \let\vtop\undefined
- From: Jonathan Fine
- Re: TeX extensions and \let\vtop\undefined
- References:
- Re: TeX extensions and \let\vtop\undefined
- From: Jonathan Fine
- Re: TeX extensions and \let\vtop\undefined
- Prev by Date: Re: Creating a glossary list (NOT nomencl or acronym)
- Next by Date: Re: How can I view a LaTeX file in Firefox?
- Previous by thread: Re: TeX extensions and \let\vtop\undefined
- Next by thread: Re: TeX extensions and \let\vtop\undefined
- Index(es):
Relevant Pages
|