[dev-context] Caption in floatcombination is too low
Wolfgang Schuster
wolfgang.schuster.lists at gmail.com
Wed Feb 6 21:19:02 CET 2019
Hi,
here is a ugly fix for pack-com.mkiv to reduce the distance between the
float content and caption.
\unexpanded\def\pack_combinations_float_hack_b#1%
- {\box\b_strc_floats_separate_caption}
+
{\hpack{\raise\dimexpr\strutht-1pt\relax\box\b_strc_floats_separate_caption}}
Wolfgang
Wolfgang Schuster schrieb am 26.01.19 um 20:15:
> Hi Hans,
>
> there is a big gap between the content and the caption of each float
> in a floatcombination environment.
>
>
> %%%% begin example
> \useMPlibrary[dum]
>
> \starttext
>
> \startplacefigure[title={First graphic}]
> \externalfigure[one]
> \stopplacefigure
>
> \startfloatcombination
> \startplacefigure[title={Second graphic}]
> \externalfigure[two]
> \stopplacefigure
> \stopfloatcombination
>
> \stoptext
> %%%% end example
>
>
> This is probably a result of the following two command from
> strc-flt.mkvi where you put the caption in a \vbox with a height of
> 1pt and flush it afterwards in \vtop which shifts the content down to
> the baseline. As a result of this a empty space was added at the top
> of the caption.
>
> A simple fix for this is to raise the box with the caption when it is
> added to the combination.
>
>
> %%%% begin strc-flt.mkvi
> \def\strc_floats_build_box_separate_make
> {\offinterlineskip
> \vpack to \onepoint{\box\b_strc_floats_content}\break
> \vpack to \onepoint{\box\b_strc_floats_caption}}
>
> \def\strc_floats_build_box_separate_split#1%
> {\setbox\scratchbox\vbox{%
> \setbox\scratchbox\vpack{#1}%
> \unvbox\scratchbox\relax
> \setbox\scratchbox\lastbox
> %\doloop{%
> \unvbox\scratchbox
> \setbox\scratchbox\lastbox
> % \ifdim\ht\scratchbox=2\onepoint
> \unvbox\scratchbox
> \setbox\scratchbox\lastbox
> % \exitloop
> % \fi}%
> \splittopskip\zeropoint
> \global\setbox\b_strc_floats_separate_content\vsplit\scratchbox
> to \onepoint
> \global\setbox\b_strc_floats_separate_caption\vsplit\scratchbox
> to \onepoint
> \global\setbox\b_strc_floats_separate_content\vpack{\unvbox\b_strc_floats_separate_content\setbox0\lastbox\unvbox0}%
>
> \global\setbox\b_strc_floats_separate_caption\tpack{\unvbox\b_strc_floats_separate_caption\setbox0\lastbox\unvbox0}%
>
> }}
> %%%% end strc-flt.mkvi
>
> Wolfgang
More information about the dev-context
mailing list