Quantcast
Channel: How to prevent insertion of \parskip glue? - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

How to prevent insertion of \parskip glue?

$
0
0

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 between bbb and ccc. TeX does not go into horizontal mode. No \parskip-glue is inserted between bbb and ccc. (No vertical glue at all is inserted between bbb and ccc.)
  • In case 2 you have ccc. Due to \hrule no \baselineskip-glue is inserted between bbb and ccc. TeX does go into horizontal mode. \parskip-glue is inserted between bbb and ccc.

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

enter image description here


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images