1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus{loading}{ConTeXt Tracing Macros Rivers}
15
16\registerctxluafile{tracriv}{autosuffix}
17
18\unprotect
19
20\permanent\tolerant\protected\def\startshowrivers[#1]#*
21 {\begingroup
22 \letdummyparameter\c!margin\zeropoint
23 \letdummyparameter\c!step\!!twopoint
24 \setdummyparameter\c!height{.2\bodyfontsize}
25 \setdummyparameter\c!depth {.2\bodyfontsize}
26 \setdummyparameter\c!spaceinbetween{.1\lineheight}
27 \letdummyparameter\c!criterium\plusfour
28 \letdummyparameter\c!option\empty
29 \getdummyparameters[#1]
30 \setbox\scratchboxone\vbox\bgroup}
31
32\permanent\tolerant\protected\def\stopshowrivers
33 {\egroup
34 \clf_getrivers
35 box \scratchboxone
36 margin \dimexpr\dummyparameter\c!margin\relax
37 skip \dimexpr\dummyparameter\c!spaceinbetween\relax
38 step \dimexpr\dummyparameter\c!step\relax
39 height \dimexpr\dummyparameter\c!height\relax
40 depth \dimexpr\dummyparameter\c!depth\relax
41 \relax
42 \setbox\scratchboxtwo\hbox\bgroup
43 \startMPcode
44 lmt_showrivers (
45 \the\numexpr\dummyparameter\c!criterium\relax,
46 \the\dimexpr\wd \scratchboxone\relax,
47 \the\dimexpr\htdp\scratchboxone\relax,
48 \ifcstok{\dummyparameter\c!option}\v!test true\else false\fi
49 ) ;
50 \stopMPcode
51 \egroup
52 \startoverlay
53 {\box\scratchboxtwo}
54 {\box\scratchboxone}
55 \stopoverlay
56 \endgroup}
57
58\permanent\tolerant\protected\def\addriverstobox[#1]#2
59 {\begingroup
60 \letdummyparameter\c!margin\zeropoint
61 \letdummyparameter\c!step\!!twopoint
62 \setdummyparameter\c!height{.2\bodyfontsize}
63 \setdummyparameter\c!depth {.2\bodyfontsize}
64 \setdummyparameter\c!spaceinbetween{.1\lineheight}
65 \getdummyparameters[#1]
66 \clf_addrivers
67 box \numexpr#2\relax
68 margin \dimexpr\dummyparameter\c!margin\relax
69 skip \dimexpr\dummyparameter\c!spaceinbetween\relax
70 step \dimexpr\dummyparameter\c!step\relax
71 height \dimexpr\dummyparameter\c!height\relax
72 depth \dimexpr\dummyparameter\c!depth\relax
73 \relax
74 \endgroup}
75
76
77
78
79
80
81
82
83
84\permanent\tolerant\protected\def\showrivers[#1]
85 {\def\page_one_hook_for_checks##1{\addriverstobox[#1]{##1}}}
86
87\protect \endinput
88 |