1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54\defineregister
55 [figureindex]
56
57\setupregister
58 [figureindex]
59 [criterium=text,
60 interaction=text,
61 pagenumber=no,
62 indicator=no]
63
64\setuptolerance
65 [verytolerant]
66
67\setupbuttons
68 [offset=10pt,
69 width=broad,
70 strut=no,
71 rulethickness=1pt,
72 framecolor=darkred]
73
74\setuplayout
75 [topspace=15pt,
76 backspace=15pt,
77 header=0pt,
78 footer=0pt,
79 bottom=20pt,
80 bottomdistance=10pt,
81 width=middle,
82 height=fit]
83
84\setupbackgrounds
85 [page]
86 [background=,
87 backgroundcolor=gray]
88
89\setupinteractionscreen
90 [width=max,
91 height=max]
92
93\setupinteraction
94 [style=,
95 color=,
96 contrastcolor=,
97 state=start]
98
99\setuphead
100 [section]
101 [style=bfb]
102
103\setupinteractionmenu
104 [bottom]
105 [left=\hfill,
106 middle=\hskip10pt,
107 frame=off,
108 style=bold,
109 background=color,
110 backgroundcolor=darkred,
111 foregroundcolor=white]
112
113\startinteractionmenu[bottom]
114 \but [begin] begin \\
115 \but [index] index \\
116 \but [list] list \\
117 \but [CloseDocument] close \\
118 \but [PreviousJump] go back \\
119\stopinteractionmenu
120
121\setupinteraction
122 [openaction=begin]
123
124\setuppapersize
125 [S6][S6]
126
127\setupbackgrounds
128 [page]
129 [background=color]
130
131\setupinteraction
132 [menu=on]
133
134\setupbodyfont
135 [tt,10pt]
136
137\definesymbol [attachment] [{\strut\bf\color[darkred]{\inputfilename}}]
138\setupattachments [symbol=attachment,alternative=,location=text]
139\useattachment [datafile] [\inputfilename]
140
141\xmlloadonly{main}{\inputfilename}{}
142
143\mainlanguage[\xmlattributedef{main}{rlx:library}{language}{en}]
144
145\startxmlsetups xml:resource:asis
146 \startTEXpage[pagestate=start]
147 \xmldoifelsetext{#1}{rlx:label} {
148 \edef\CurrentLabel{\xmltext{#1}{rlx:label}}
149 } {
150 \edef\CurrentLabel{\xmltext{#1}{rlx:file}}
151 }
152 \pagereference [
153 asis:\CurrentLabel
154 ]
155 \gotobox {
156 \externalfigure[\xmltext{#1}{rlx:file}]
157 }[
158 data:\CurrentLabel
159 ]
160 \stopTEXpage
161\stopxmlsetups
162
163\definemeasure[figure:width] [210mm]
164\definemeasure[figure:height][297mm]
165
166\startmode[letter]
167 \enablemode[previewpageletter]
168\stopmode
169
170\startmode[previewpageA4]
171 \definemeasure[figure:width] [210mm]
172 \definemeasure[figure:height][297mm]
173\stopmode
174
175\startmode[previewpageletter]
176 \definemeasure[figure:width] [8.5in]
177 \definemeasure[figure:height][11in]
178\stopmode
179
180\startmode[previewpageS6]
181 \definemeasure[figure:width] [600pt]
182 \definemeasure[figure:height][450pt]
183\stopmode
184
185\startxmlsetups xml:resource:a
186 \button
187 [
188 width=150pt,
189 height=100pt,
190 offset=10pt,
191 frame=off,
192 background=color,
193 backgroundcolor=white,
194 color=
195 ]
196 {
197 \externalfigure
198 [\xmltext{#1}{rlx:file}]
199 [factor=max]
200 }
201 [
202 grid:\CurrentLabel
203 ]
204\stopxmlsetups
205
206\startxmlsetups xml:resource:b
207 \framed
208 [
209 width=150pt,
210 height=100pt,
211 offset=10pt,
212 frame=off,
213 background=color,
214 backgroundcolor=white,
215 color=
216 ]
217 {
218 \externalfigure [
219 \xmltext{#1}{rlx:file}
220 ] [
221 factor=max
222 ]
223 }
224\stopxmlsetups
225
226\startxmlsetups xml:resource:data
227
228
229
230 \xmldoifelsetext{#1}{rlx:label} {
231 \edef\CurrentLabel{\xmltext{#1}{rlx:label}}
232 } {
233 \edef\CurrentLabel{\xmltext{#1}{rlx:file}}
234 }
235
236 \button {
237 \hbox to \hsize {
238 \forgetall
239 \dontcomplain
240 \pagereference[data:\CurrentLabel]
241
242
243
244 \expanded{\figureindex{\xmltext{#1}{rlx:label}}}
245
246 \vbox to 100pt {
247 \hsize30pt
248 \vskip5pt
249 \hbox to \hsize {
250 \hss
251 \strut
252 \bf
253 \at[asis:\CurrentLabel]
254 \hss
255 }
256 \vfill
257 }
258 \advance\hsize by 30pt
259 \doifelsemode {clipgriddistance,clipgridsteps} {
260 \xmlsetup{#1}{xml:resource:a}
261 } {
262 \xmlsetup{#1}{xml:resource:b}
263 }
264 \edef\CurrentWidth {\the\dimexpr\figurenaturalwidth}
265 \edef\CurrentHeight{\the\dimexpr\figurenaturalheight}
266 \advance\hsize by 150pt
267 \hskip10pt
268 \advance\hsize by 10pt
269 \vbox to 100pt {
270 \hsize40pt
271 \framed [
272 offset=overlay,
273 framecolor=darkred,
274 rulethickness=.5pt
275 ] {
276 \scale [
277 width=40pt
278 ] {
279 \framed [
280 width=\measure{figure:width},
281 height=\measure{figure:height},
282 offset=overlay,
283 frame=off,
284 background=color,
285 backgroundcolor=white
286 ] {
287 \externalfigure
288 [
289 \xmltext{#1}{rlx:file}
290 ] [
291 reset=yes
292 ]
293 }
294 }
295 }
296 \vfill
297 }
298 \advance\hsize by 40pt
299 \hskip10pt
300 \advance\hsize by 10pt
301 \vbox to 100pt {
302 \blank[disable]
303 \starttabulate[Belp]
304 \NC file \NC \xmltext{#1}{rlx:file} \NC \NR
305 \xmldoif{#1}{rlx:label} {\NC label \NC \xmltext{#1}{rlx:label} \NC \NR}
306 \NC dimensions \NC \CurrentWidth\ * \CurrentHeight \NC \NR
307 \xmldoif{#1}{rlx:copyright} {\NC copyright \NC \xmltext{#1}{rlx:copyright} \NC \NR}
308 \xmldoif{#1}{rlx:status} {\NC status \NC \xmltext{#1}{rlx:status} \NC \NR}
309 \xmldoif{#1}{rlx:comment} {\NC comment \NC \xmltext{#1}{rlx:comment} \NC \NR}
310 \stoptabulate
311 \vfill
312 }
313 }
314 } [
315 asis:\CurrentLabel
316 ]
317
318 \vskip10pt
319
320\stopxmlsetups
321
322\startxmlsetups xml:description
323
324 \starttabulate[lBep]
325 \xmldoif{#1}{rlx:organization} {\NC organization \NC \xmltext{#1}{rlx:organization} \NC \NR}
326 \xmldoif{#1}{rlx:project} {\NC project \NC \xmltext{#1}{rlx:project} \NC \NR}
327 \xmldoif{#1}{rlx:product} {\NC product \NC \xmltext{#1}{rlx:product} \NC \NR}
328 \xmldoif{#1}{rlx:comment} {\NC comment \NC \xmltext{#1}{rlx:comment} \NC \NR}
329 \NC specification \NC \attachment[datafile] \NC \NR
330 \stoptabulate
331
332\stopxmlsetups
333
334\starttext
335
336 \xmlfilter{main}{rlx:libraryrlx:resourcecommand(xml:resource:asis)}
337
338 \subject {Figure collection}
339
340 \xmlfilter{main}{rlx:libraryrlx:descriptioncommand(xml:description)}
341
342 \subject [list] {List of figures}
343
344 \xmlfilter{main}{rlx:libraryrlx:resourcecommand(xml:resource:data)}
345
346 \page
347
348 \subject [index] {Index of figures}
349
350 \startcolumns
351 \placeregister[figureindex]
352 \stopcolumns
353
354\stoptext
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427\stoptext
428 |