Jesteś w: Start / Przedsięwzięcia/Projects / TeX Pearls / 2008 Pearls / david-kastrup / bachotex2008-david-kastrup-pearl1.tex


TeX document icon bachotex2008-david-kastrup-pearl1.tex — TeX document, 1 KB (1242 bytes)

Zawartość pliku

%%% fixing \vtop

|\vtop| happens to lose the correct top of line information when it
starts with a whatsit.  We can reconstitute this in the following
manner\footnote*{The trick here is to use |\vsplit| which pads the
followup box sufficiently to reach a given line height on the top
line. We essentially tell it to make this line fit |\maxdimen| minus
a safety margin and see how far it gets.  Then we remove the padding
with another split and start the box with a strut that establishes the
corrected height.}:


  \ifdim\dp0>0pt \advance\dimen0-\dp0 \fi
  {\splittopskip\dimen0 \setbox0\vsplit0to0pt}%
  \hrule height\dimen0 depth-\dimen0

\def\example{\hbox{First good line}%
\hbox{Second good line}%
\hbox{Third good line}}