1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus{loading}{ConTeXt Core Macros General}
15
16
17
18\unprotect
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37\installcorenamespace{dimensionnormal}
38
39\def\assign_dimension_direct#value#dimension#small#medium#big{#dimension=#value\relax}
40
41\setvalue{\??dimensionnormal \v!none }#value#dimension#small#medium#big{#dimension\zeropoint}
42\setvalue{\??dimensionnormal \empty }#value#dimension#small#medium#big{#dimension\zeropoint}
43\setvalue{\??dimensionnormal \v!small }#value#dimension#small#medium#big{#dimension=#small\relax}
44\setvalue{\??dimensionnormal \v!medium}#value#dimension#small#medium#big{#dimension=#medium\relax}
45\setvalue{\??dimensionnormal \v!big }#value#dimension#small#medium#big{#dimension=#big\relax}
46\setvalue{\??dimensionnormal\v!small }#value#dimension#small#medium#big{#dimension=#small\relax}
47\setvalue{\??dimensionnormal\v!medium}#value#dimension#small#medium#big{#dimension=#medium\relax}
48\setvalue{\??dimensionnormal\v!big }#value#dimension#small#medium#big{#dimension=#big\relax}
49\letvalue{\??dimensionnormal\s!unknown}\assign_dimension_direct
50
51
52
53
54\protected\def\assigndimension#value
55 {\ifcsname\??dimensionnormal#value\endcsname
56 \expandafter\lastnamedcs
57 \else
58 \expandafter\assign_dimension_direct
59 \fi{#value}}
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74\installcorenamespace{dimensionalfa}
75
76\def\assign_alpha_dimension_direct#value#macro#small#medium#big{\edef#macro{#value}}
77
78\setvalue{\??dimensionalfa\v!none }#value#macro#small#medium#big{\let #macro\!!zerocount}
79\setvalue{\??dimensionalfa\v!small }#value#macro#small#medium#big{\edef#macro{#small}}
80\setvalue{\??dimensionalfa\v!medium }#value#macro#small#medium#big{\edef#macro{#medium}}
81\setvalue{\??dimensionalfa\v!big }#value#macro#small#medium#big{\edef#macro{#big}}
82\letvalue{\??dimensionalfa\s!unknown}\assign_alpha_dimension_direct
83
84
85
86
87\protected\def\assignalfadimension#value
88 {\ifcsname\??dimensionalfa#value\endcsname
89 \expandafter\lastnamedcs
90 \else
91 \expandafter\assign_alpha_dimension_direct
92 \fi
93 {#value}}
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109\installcorenamespace{dimensionvalue}
110
111\def\assign_value_direct#value#macro#small#medium#big{\edef#macro{#value}}
112
113\setvalue{\??dimensionvalue\v!small }#value#macro#small#medium#big{\edef#macro{#small}}
114\setvalue{\??dimensionvalue\v!medium }#value#macro#small#medium#big{\edef#macro{#medium}}
115\setvalue{\??dimensionvalue\v!big }#value#macro#small#medium#big{\edef#macro{#big}}
116\letvalue{\??dimensionvalue\s!unknown}\assign_value_direct
117
118
119
120
121\protected\def\assignvalue#value
122 {\ifcsname\??dimensionvalue#value\endcsname
123 \expandafter\lastnamedcs
124 \else
125 \expandafter\assign_value_direct
126 \fi{#value}}
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142\installcorenamespace{dimensionwidth}
143
144\newbox\b_assign_width
145
146\def\assign_width_direct#value#dimension#content#extra{#dimension=#value\relax}
147
148
149
150\setvalue{\??dimensionwidth }#value#dimension#content#extra{\setbox\b_assign_width\hbox{#content}#dimension\wd\b_assign_width
151 \setbox\b_assign_width\emptybox}
152\setvalue{\??dimensionwidth\v!fit }#value#dimension#content#extra{\setbox\b_assign_width\hbox{#content}#dimension\wd\b_assign_width
153 \setbox\b_assign_width\emptybox}
154\setvalue{\??dimensionwidth\v!broad }#value#dimension#content#extra{\setbox\b_assign_width\hbox{#content}#dimension\dimexpr\wd\b_assign_width#extra\relax
155 \setbox\b_assign_width\emptybox}
156\setvalue{\??dimensionwidth\v!line }#value#dimension#content#extra{\setbox\b_assign_width\hbox{#content}#dimension\wd\b_assign_width
157 \setbox\b_assign_width\emptybox}
158\letvalue{\??dimensionwidth\s!unknown}\assign_width_direct
159
160
161
162
163\protected\def\assignwidth#value
164 {\ifcsname\??dimensionwidth#value\endcsname
165 \expandafter\lastnamedcs
166 \else
167 \expandafter\assign_width_direct
168 \fi{#value}}
169
170\protect \endinput
171 |