m-maybe.mkiv /size: 1552 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [       file=m-maybe,
3%D        version=2018.07.26,
4%D          title=\CONTEXT\ Extra Modules,
5%D       subtitle=Maybe some day,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14%D The code here is not in the core and might never be as it's probably not
15%D of much use and|/|or can interfere.
16
17\unprotect
18
19% \showframe
20% \starttext
21%     \tweakpagegoal[-\lineheight]
22%     \dorecurse{40}{\inleftmargin{!}\input ward\par}
23% \stoptext
24
25\def\page_scale_text_box_indeed#1%
26  {\scratchheight\ht#1\relax
27   \scratchwidth \wd#1\relax
28   \setbox#1\vpack\bgroup
29     \hpack\bgroup
30       \scale
31        [\c!height=\dimexpr\textheight-\d_page_adapts_delta\relax,
32         \c!width=\scratchwidth]
33        {\box#1}%
34     \egroup
35   \egroup
36   \global\d_page_adapts_delta\zeropoint
37   \glet\page_scale_text_box\gobbleoneargument
38   \ht#1\scratchheight
39   \wd#1\scratchwidth}
40
41\unexpanded\def\tweakpagegoal[#1]%
42  {\ifx\currentoutputroutine\s!singlecolumn
43     \global\d_page_adapts_delta\dimexpr#1\relax
44     \ifdim\d_page_adapts_delta=\zeropoint
45       \glet\page_scale_text_box\gobbleoneargument
46     \else
47       \glet\page_scale_text_box\page_scale_text_box_indeed
48     \fi
49   \else
50     \global\d_page_adapts_delta\zeropoint
51     \glet\page_scale_text_box\gobbleoneargument
52   \fi
53   \page_otr_command_set_vsize}
54
55\protect
56
57\endinput
58