The codes of the two \vtop
in the example below look very similar.
Difference is:
- In case 1 you have
\hbox{ccc\hfill}
. Due to\hrule
no\baselineskip
-glue is inserted betweenbbb
andccc
. TeX does not go into horizontal mode. No\parskip
-glue is inserted betweenbbb
andccc
. (No vertical glue at all is inserted betweenbbb
andccc
.) - In case 2 you have
ccc
. Due to\hrule
no\baselineskip
-glue is inserted betweenbbb
andccc
. TeX does go into horizontal mode.\parskip
-glue is inserted betweenbbb
andccc
.
Now assume a situation where you don't know if TeX will go into horizontal mode after the \hrule
but in any case you don't want \parskip
-glue/any vertical glue after the \hrule
. In any case you want the thing to look like in case 1.
Is there a method to cancel or prevent \parskip
glue in case material following the \hrule
switches to horizontal mode without knowing before if this switching will happen?
\parindent=0ex\parskip=4cm\baselineskip=2cm\hbox to\hsize{%\vtop{\hsize=.3\hsize \hbox{aaa} \hbox{bbb} \hrule height 0mm depth 0mm\relax \hbox{ccc} %<- TeX stays in restricted vertical mode \par\hbox to\hsize{This is case 1\hfill}}\hfill\vrule\hfill\vtop{\hsize=.3\hsize \hbox{aaa} \hbox{bbb} \hrule height 0mm depth 0mm\relax ccc %<- TeX switches to horizontal mode \par\hbox to\hsize{This is case 2\hfill}}%}\bye