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 {\dummyparameter\c!margin}
37 skip {\dummyparameter\c!spaceinbetween}
38 step {\dummyparameter\c!step}
39 height {\dummyparameter\c!height}
40 depth {\dummyparameter\c!depth}
41 \relax
42 \setbox\scratchboxtwo\hbox\bgroup
43 \startMPcode
44 lmt_showrivers (
45 \tointeger{\dummyparameter\c!criterium},
46 \todimension{\wd \scratchboxone},
47 \todimension{\htdp\scratchboxone},
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 {#2}
68 margin {\dummyparameter\c!margin}
69 skip {\dummyparameter\c!spaceinbetween}
70 step {\dummyparameter\c!step}
71 height {\dummyparameter\c!height}
72 depth {\dummyparameter\c!depth}
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 |