vm via ntg-context schrieb am 07.12.2024 um 09:10:
Trying to get a single page of a specific size, I set the width and
height of \startTEXpage only to find out that a \strut as a last
command before the \stopTEXpage, will expand the height.
8<----
\setuppapersize [A2]
\starttext
\startTEXpage[offset=0mm, width=220mm, height=110mm]
MWE without \type{\strut} -> Landscape (220 × 110 mm)
%MWE with \type{\strut} -> Landscape (220 × 111 mm)
%\strut
\stopTEXpage
\stoptext
--->8
The problem here is "\pack_framed_initialize" which was added in LMTX
and causes a problem with the parameter handler.
%%%% page-app.mkxl
\def\page_fitting_start_normal
{\setbox\b_page_fitting\hbox
\bgroup
\inheritedfittingpageframed
\bgroup
\pack_framed_initialize
\ignorepars} % \gobblespacetokens} brr also gobbles next assingment
%%%%
When you compare the output of the following two boxes you will notice
the second box has a depth (the part below the dashed line) while the
first one hasn't.
This happens only when you set an instance for the frame because now
ConTeXt fails to use the default value for "bottom".
When you now remove "\csname pack_framed_initialize\endcsname" from the
example or add "bottom=\vss" to \setuptest the second box has the
correct height.
%%%% begin example
\unprotect
\installnamespace {test}
\installframedcommandhandler \????test {test} \????test
\protect
\starttext
\setuptest
[frame=off,
offset=overlay,
align=normal,
width=4cm,
height=4cm]
\start \showboxes
\let\currenttest\empty
\setbox\scratchbox\hbox\bgroup
\inheritedtestframed\bgroup
\csname pack_framed_initialize\endcsname
\strut xxx
\egroup
\egroup
\box\scratchbox
\definetest[foo]
\def\currenttest{foo}
\setbox\scratchbox\hbox\bgroup
\inheritedtestframed\bgroup
\csname pack_framed_initialize\endcsname
\strut xxx
\egroup
\egroup
\box\scratchbox
\stop
\stoptext
%%%% end example
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________