s-math-show.mkxl /size: 4630 b    last modification: 2024-01-16 10:22
1%D \module
2%D   [       file=math-run,
3%D        version=2023.05.18,
4%D          title=\CONTEXT\ Math Macros,
5%D       subtitle=Runtime loaded commands,
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\unprotect
15
16\permanent\tolerant\protected\gdef\showmathmargins[#1]%
17  {\bgroup
18     \par
19     \c_attr_visual\attributeunsetvalue
20     \ruledhbox to \hsize \bgroup
21       \setbox\scratchbox\hbox to \hsize\bgroup
22         \scratchheight2\lineheight
23         \scratchwidth \onepoint
24         \infofont
25         \ifcstok{#1}\v!all
26           \llap\bgroup
27             \setupinterlinespace
28             \vbox yoffset -\lineheight\bgroup
29               \forgetall
30               \setstrut
31             % \llap{\the      \c_strc_math_n_of_lines \enspace \#l}\par
32               \llap{\withoutpt\d_strc_math_first_left \enspace fl}\par
33               \llap{\withoutpt\d_strc_math_last_left  \enspace ll}\par
34               \llap{\withoutpt\d_strc_math_max_left   \enspace ml}\par
35               \llap{\withoutpt\d_strc_formulas_number \enspace wd}\par
36             \egroup
37             \quad
38           \egroup
39         \fi
40         \ifzeropt\s_strc_formulas_margin_left\else
41           \bgroup\darkred
42             \srule \s!width \scratchwidth \s!height \scratchheight
43             \kern-\scratchwidth
44             \vrule \s!width \s_strc_formulas_margin_left
45             \kern-\scratchwidth
46             \srule \s!width \scratchwidth \s!height \scratchheight
47           \egroup
48         \fi
49         \ifdim\d_math_strc_hangindent>\zeropoint
50           \bgroup\darkred
51             \vrule \s!width \d_math_strc_hangindent \s!depth 2\exheight \s!height-\exheight
52             \kern-\d_math_strc_hangindent
53           \egroup
54         \fi
55         \bgroup\darkgray
56           \leaders\vrule\hfill
57         \egroup
58         \bgroup\darkgreen
59           \srule \s!width \scratchwidth \s!height \scratchheight
60         \egroup
61         \bgroup\darkgray
62           \leaders\vrule\hfill
63         \egroup
64         \ifdim\d_math_strc_hangindent<\zeropoint
65           \bgroup\darkblue
66             \kern\d_math_strc_hangindent
67             \vrule \s!width -\d_math_strc_hangindent \s!depth 2\exheight \s!height-\exheight
68           \egroup
69         \fi
70         \ifzeropt\s_strc_formulas_margin_right\else
71           \bgroup\darkblue
72             \srule \s!width \scratchwidth \s!height \scratchheight
73             \kern-\scratchwidth
74             \vrule \s!width \s_strc_formulas_margin_right
75             \kern-\scratchwidth
76             \srule \s!width \scratchwidth \s!height \scratchheight
77           \egroup
78         \fi
79         \ifcstok{#1}\v!all
80           \rlap\bgroup
81             \setupinterlinespace
82             \quad
83             \vbox yoffset -\lineheight\bgroup
84               \forgetall
85               \setstrut
86               \rlap{fr\enspace\withoutpt\d_strc_math_first_right}\par
87               \rlap{lr\enspace\withoutpt\d_strc_math_last_right }\par
88               \rlap{mr\enspace\withoutpt\d_strc_math_max_right  }\par
89               \rlap
90                 {\formulaparameter\c!location:\enspace
91                  p=\the\c_strc_math_positioning\enspace
92                  a=\the\c_strc_math_ragged_status\enspace
93                  l=\the\c_strc_math_number_location\enspace
94                  v=\the\c_strc_math_number_variant}\par
95             \egroup
96           \egroup
97         \fi
98         \global\c_strc_math_positioning\zerocount
99       \egroup
100       \ht\scratchbox1.2\exheight
101       \dp\scratchbox0.4\exheight
102       \strut
103       \box\scratchbox
104       \kern-\hsize
105       \hbox to \hsize \bgroup
106         \white
107         \infofont
108         \kern\s_strc_formulas_margin_left
109         \quad
110         [\the\s_strc_formulas_margin_left]%
111         \hss
112         [\c!split=\iftok{\formulaparameter\c!split}\emptytoks\v!yes   \else\formulaparameter\c!split\fi]%
113         \quad
114         [\c!align=\iftok{\formulaparameter\c!align}\emptytoks\v!middle\else\formulaparameter\c!align\fi]%
115         \ifcstok{#1}\v!all\else
116           \quad
117           [\c!location=\formulaparameter\c!location]%
118         \fi
119         \hss
120         [\the\s_strc_formulas_margin_right]%
121         \quad
122         \kern\s_strc_formulas_margin_right
123       \egroup
124     \egroup
125   \par
126   \egroup}
127
128\protect
129
130\continueifinputfile{s-math-show.mkxl}
131
132\showmathmargins[all]
133
134\starttext
135
136\startformula
137    a + b = c
138\stopformula
139
140\stoptext
141