1
2
3
4
5
6
7
8
9
10
11
12
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
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{smathshow.mkxl}
131
132\showmathmargins[all]
133
134\starttext
135
136\startformula
137 a b = c
138\stopformula
139
140\stoptext
141 |