This is a problem I am anxious to solve. Run this program: \starttext \newbox\testbox \hbox{% % centered \setbox\testbox=\vbox{\vskip5mm\framed [frame=on,align=disable,width=1cm,height=2cm,offset=0pt,location=depth,t op=\vss,bottom=\vss]{lp}\vskip5mm} \the\ht\testbox \box\testbox % bottom \setbox\testbox=\vbox{\vskip5mm\framed [frame=on,align=disable,width=1cm,height=2cm,offset=0pt,location=depth,t op=\vss,bottom=\empty]{lp}\vskip5mm} % note leaveout bottom=, not good \the\ht\testbox \box\testbox % top \setbox\testbox=\vbox{\vskip5mm\framed [frame=on,align=disable,width=1cm,height=2cm,offset=0pt,location=depth,t op=\empty,bottom=\vss]{lp}\vskip5mm} % note leaveout top=, not good \the\ht\testbox \box\testbox } \stoptext Now the middle box comes out higher than the other two, like this: ------------ ------------ | | ------------ | | | | |lp | | | | | | | | | | | | | |lp | | | | | | | | | | | | | | | | | | | |lp | | | ------------ ------------ ------------ The \ht's will tell the difference, the \dp's are 0 here. Using \vtop gives analogous results, then the depth of middle box is greater. Probing with [depth=0pt] makes no difference. Setting [strut=yes/no] makes some difference but is not the cause of the difference. Setting [align=no/line] makes no difference. Omitting [align=..] or using [align=normal] makes all boxes the same height but puts every contents in the middle, which is not what I want: one at the top, one in the middle and one at the bottom. How can I get the required result with all three the same height? Hans van der Meer
Hans van der Meer wrote:
This is a problem I am anxious to solve. Run this program:
\starttext \newbox\testbox \hbox{% % centered \setbox\testbox=\vbox{\vskip5mm\framed[frame=on,align=disable,width=1cm,height=2cm,offset=0pt,location=depth,top=\vss,bottom=\vss]{lp}\vskip5mm} \the\ht\testbox \box\testbox % bottom \setbox\testbox=\vbox{\vskip5mm\framed[frame=on,align=disable,width=1cm,height=2cm,offset=0pt,location=depth,top=\vss,bottom=\empty]{lp}\vskip5mm} % note leaveout bottom=, not good \the\ht\testbox \box\testbox % top \setbox\testbox=\vbox{\vskip5mm\framed[frame=on,align=disable,width=1cm,height=2cm,offset=0pt,location=depth,top=\empty,bottom=\vss]{lp}\vskip5mm} % note leaveout top=, not good \the\ht\testbox \box\testbox } \stoptext
Now the middle box comes out higher than the other two, like this: � �� �� �� �� �------------ ------------� �| � �� �� �|� �------------ | � �� �� �|� �| � �� �� �|� �|lp� � �� �| | � �� �� �|� �| � �� �� �|� �| � �� �� �| | � �� �� �|� �| � �� �� �|� �| � �� �� �| |lp� � �� �|� �| � �� �� �|� �| � �� �� �| | � �� �� �|� �| � �� �� �|� �| � �� �� �| | � �� �� �|� �| � �� �� �|� �| � �� �� �| | � �� �� �|� �|lp� � �� �|� �| � �� �� �| ------------� �------------� �------------ The \ht's will tell the difference, the \dp's are 0 here. Using \vtop gives analogous results, then the depth of middle box is greater.
Probing with [depth=0pt] makes no difference. Setting [strut=yes/no] makes some difference but is not the cause of the difference. Setting [align=no/line] makes no difference. Omitting [align=..] or using [align=normal] makes all boxes the same height but puts every contents in the middle, which is not what I want: one at the top, one in the middle and one at the bottom.
How can I get the required result with all three the same height? \starttext
\hbox{% \vbox{\vskip5mm\framed[frame=on,align=disable,width=1cm,height=2cm,offset=0pt,top=\vss,bottom=\obeydepth\vss]{lp}\vskip5mm}% \vbox{\vskip5mm\framed[frame=on,align=disable,width=1cm,height=2cm,offset=0pt,top=\vss,bottom=\obeydepth]{lp}\vskip5mm}% \vbox{\vskip5mm\framed[frame=on,align=disable,width=1cm,height=2cm,offset=0pt,top=\empty,bottom=\obeydepth]{lp}\vskip5mm}% } \hbox{% \vbox{\vskip5mm\framed[frame=on,align={disable,high},width=1cm,height=2cm,offset=0pt]{lp}\vskip5mm}% \vbox{\vskip5mm\framed[frame=on,align={disable,low},width=1cm,height=2cm,offset=0pt]{lp}\vskip5mm}% \vbox{\vskip5mm\framed[frame=on,align={disable,lohi},width=1cm,height=2cm,offset=0pt]{lp}\vskip5mm}% } \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Hans van der Meer