1
2
3
4
5
6
7
8
9
10
11
12
13
14\unprotect
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30\newconstant\c_grph_buffers_mode
31
32\let\lasttypesetbuffer\empty
33
34\unexpanded\def\typesetbuffer
35 {\bgroup
36 \setconstant\c_grph_buffers_mode\plusone
37 \dodoubleempty\grph_buffers_typeset}
38
39\unexpanded\def\typesetbufferonly
40 {\bgroup
41 \setconstant\c_grph_buffers_mode\zerocount
42 \dodoubleempty\grph_buffers_typeset}
43
44\def\grph_buffers_typeset[#1][#2]
45 {\ifsecondargument
46 \grph_buffers_typeset_indeed[#1][#2]
47 \else\iffirstargument
48 \doifelseassignment{#1}
49 {\grph_buffers_typeset_indeed[\jobname][#1]}
50 {\grph_buffers_typeset_indeed[#1][]}
51 \else
52 \grph_buffers_typeset_indeed[\jobname][]
53 \fi\fi}
54
55\def\grph_buffers_typeset_indeed[#1][#2]
56 {\doifnot{#1}{*}{\xdef\lasttypesetbuffer{\clf_typesetbuffer{#1}}}
57 \ifcase\c_grph_buffers_mode
58
59 \or
60 \externalfigure[\lasttypesetbuffer][#2]
61 \fi
62 \egroup}
63
64\unexpanded\def\runbuffer
65 {\dotripleempty\grph_buffers_run_indeed}
66
67\def\grph_buffers_run_indeed[#1][#2]
68 {\xdef\lasttypesetbuffer{\clf_runbuffer{#1}{#2}}}
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84\installcorenamespace{typesettingfile}
85
86\unexpanded\def\definetypesetting{\dotripleempty\grph_typesetting_define}
87\unexpanded\def\typesetfile {\dotripleempty\grph_typesetting_process}
88
89\def\grph_typesetting_define[#1][#2][#3]
90 {\doifsomething{#1}{\setuvalue{\??typesettingfile#1}{\grph_typesetting_process_indeed{#2}{#3}}}}
91
92\def\grph_typesetting_process[#1][#2][#3]
93 {\ifcsname\??typesettingfile#1\endcsname
94 \lastnamedcs{#2}{#3}
95 \else\ifthirdargument
96 \grph_typesetting_process_indeed{#2}{#3}{#1}{}
97 \else\ifsecondargument
98 \grph_typesetting_process_indeed{}{#2}{#1}{}
99 \fi\fi\fi}
100
101\defineexternalfigure[typesetting]
102
103\def\grph_typesetting_process_indeed#1#2#3#4
104 {\begingroup
105 \edef\m_typesetting_name{\clf_runcontextjob{#3}{#1}}
106 \ifx\m_typesetting_name\empty \else
107 \expanded{\externalfigure[\m_typesetting_name][typesetting]}[#2,#4]
108 \fi
109 \endgroup}
110
111
112
113
114
115\newcount\c_grph_steps_reference
116\newdimen\d_grph_steps_x
117\newdimen\d_grph_steps_y
118\newbox \b_grph_steps_colorbar
119
120\let\placestopfigure\relax
121
122\unexpanded\def\placestartfigure[#1][#2][#3]#4\placestopfigure[#5]
123 {\hpack
124 {\setbox\scratchbox\hpack
125 {\useexternalfigure[\s!dummy][#2][#3,#5]
126 \externalfigure[\s!dummy]}
127 \grph_steps_calculate
128 \startpositioning
129 \let\referring\grph_steps_one_referring
130 \let\marking \grph_steps_one_marking
131 \let\remark \grph_steps_one_remark
132 \let\colorbar \grph_steps_one_colorbar
133 \position(0,0){\box\scratchbox}
134 \linewidth\onepoint
135 \setuppositioning
136 [\c!unit=pt,
137 \c!xscale=\withoutpt\the\d_grph_steps_x,
138 \c!yscale=\withoutpt\the\d_grph_steps_y,
139 \c!factor=1]
140 \ignorespaces#4
141 \let\referring\grph_steps_two_referring
142 \let\marking \grph_steps_two_marking
143 \let\remark \grph_steps_two_remark
144 \let\colorbar \grph_steps_two_colorbar
145 \ignorespaces#4
146 \stoppositioning
147 \ifvoid\b_grph_steps_colorbar\else\box\b_grph_steps_colorbar\fi}}
148
149\unexpanded\def\grph_steps_one_referring(#1,#2)#3(#4,#5)#6[#7]
150 {\position(#1,#2){\grph_steps_goto(#4,#5){\externalfigureparameter\c!frames}[#7]}}
151
152\unexpanded\def\grph_steps_one_marking(#1,#2)#3(#4,#5)#6[#7]
153 {\position(#1,#2){\grph_steps_this_is(#4,#5){\externalfigureparameter\c!frames}[#7]}}
154
155\unexpanded\def\grph_steps_one_remark(#1,#2)#3(#4,#5)
156 {\def\grph_steps_no_comment_indeed[##1]##2{}
157 \dosingleempty\grph_steps_no_comment_indeed}
158
159\unexpanded\def\grph_steps_one_colorbar#1[#2]
160 {}
161
162\unexpanded\def\grph_steps_two_referring(#1,#2)#3(#4,#5)#6[#7]
163 {}
164
165\let\grph_steps_two_marking\grph_steps_two_referring
166
167\unexpanded\def\grph_steps_two_remark
168 {\grph_steps_comment\v!no}
169
170\unexpanded\def\grph_steps_two_colorbar#1[#2]
171 {\begingroup
172 \global\setbox\b_grph_steps_colorbar\vpack
173 {\forgetall
174 \processcommalist[#2]\grph_colorbar_make_step}
175 \global\setbox\b_grph_steps_colorbar\vpack
176 {\hskip2\emwidth\box\b_grph_steps_colorbar}
177 \global\wd\b_grph_steps_colorbar\zeropoint
178 \endgroup}
179
180\unexpanded\def\grph_colorbar_make_step#1
181 {\blackrule[\c!color=#1,\c!width=2\emwidth,\c!height=\exheight,\c!depth=\zeropoint]
182 \endgraf}
183
184\unexpanded\def\startfigure
185 {\grabuntil{\e!stop\v!figure}\grph_steps_figure_process}
186
187\let\stopfigure\relax
188
189\def\grph_steps_figure_process#1
190 {\dotripleargument\grph_steps_figure_process_indeed#1\stopfigure}
191
192\def\grph_steps_figure_process_indeed[#1][#2][#3]#4\stopfigure
193 {\doifelse{\externalfigureparameter\c!option}\v!test
194 {\teststartfigure[#1][#2][#3]#4\teststopfigure
195 \letexternalfigureparameter\c!frames\v!on}
196 {\letexternalfigureparameter\c!frames\v!off}
197 \setvalue{\??externalfigureinstance#1}
198 {\dosingleempty{\placestartfigure[#1][#2][#3]#4\placestopfigure}}}
199
200\let\teststopfigure\relax
201
202\unexpanded\def\teststartfigure[#1][#2][#3]#4\teststopfigure
203 {\begingroup
204 \setbox\scratchbox\hpack
205 {\useexternalfigure[\s!dummy][#2][\c!wfactor=\v!max]
206 \externalfigure[\s!dummy]}
207 \let\referring\grph_steps_three_referring
208 \let\marking \grph_steps_three_marking
209 \let\remark \grph_steps_three_remark
210 \let\colorbar \grph_steps_three_colorbar
211 \c_grph_steps_reference\zerocount
212 \setbox0\vpack
213 {\hsize240\points
214 \startpositioning
215 \grph_steps_calculate
216 \position(0,0)
217 {\box\scratchbox}
218 \position(0,0)
219 {\basegrid
220 [\c!nx=\externalfigureparameter\c!xmax,
221 \c!dx=\withoutpt\the\d_grph_steps_x,
222 \c!ny=\externalfigureparameter\c!ymax,
223 \c!dy=\withoutpt\the\d_grph_steps_y,
224 \c!xstep=1,
225 \c!ystep=1,
226 \c!scale=1,
227 \c!offset=\v!no,
228 \c!unit=pt]}
229 \setuppositioning
230 [\c!unit=pt,
231 \c!xscale=\withoutpt\the\d_grph_steps_x,
232 \c!yscale=\withoutpt\the\d_grph_steps_y,
233 \c!factor=1]
234 \linewidth\onepoint
235 \ignorespaces#4\relax
236 \stoppositioning
237 \vfill}
238 \c_grph_steps_reference\zerocount
239 \let\referring\grph_steps_four_referring
240 \let\marking \grph_steps_four_marking
241 \let\remark \grph_steps_four_remark
242 \let\colorbar \grph_steps_four_colorbar
243 \setbox2\vbox
244 {{\tfa\doifelsenothing{#1}{#2}{#1}}
245 \blank
246 \tfxx#4
247 \vfilll}
248 \ifdim\ht0>\ht2
249 \ht2\ht0
250 \else
251 \ht0\ht2
252 \fi
253 \hpack
254 {\hskip3\emwidth
255 \tpack{\vskip12\points\box0\vskip6\points}
256 \tpack{\vskip12\points\box2\vskip6\points}}
257 \endgroup}
258
259\definesystemconstant {vwa}
260\definesystemconstant {vwb}
261
262\unexpanded\def\grph_steps_three_referring(#1,#2)#3(#4,#5)#6[#7]
263 {\advance\c_grph_steps_reference\plusone
264 \position(#1,#2)
265 {\hbox{\the\c_grph_steps_reference}}
266 \position(#1,#2)
267 {\gotosomeinternal\s!vwb{#7}\realfolio
268 {\grph_steps_marker(#4,#5)\v!on{\thisissomeinternal\s!vwa{#7}}}}}
269
270\unexpanded\def\grph_steps_three_remark
271 {\grph_steps_comment\v!yes}
272
273\let\grph_steps_three_marking \grph_steps_three_referring
274\let\grph_steps_three_colorbar\grph_steps_one_colorbar
275
276\unexpanded\def\grph_steps_four_referring
277 {\grph_steps_text{\normalstartimath\rightarrow\normalstopimath}}
278
279\unexpanded\def\grph_steps_four_marking
280 {\grph_steps_text{\normalstartimath\leftarrow\normalstopimath}}
281
282\let\grph_steps_four_remark \grph_steps_one_remark
283\let\grph_steps_four_colorbar\grph_steps_one_colorbar
284
285
286
287\def\grph_steps_calculate
288 {\ifnum0\externalfigureparameter\c!xmax=\zerocount
289 \ifnum0\externalfigureparameter\c!ymax=\zerocount
290 \setexternalfigureparameter\c!ymax{24}
291 \fi
292 \d_grph_steps_y\figureheight
293 \divide\d_grph_steps_y \externalfigureparameter\c!ymax
294 \d_grph_steps_x\d_grph_steps_y
295 \scratchdimen\figurewidth
296 \advance\scratchdimen\d_grph_steps_y
297 \divide \scratchdimen\d_grph_steps_y
298 \setexternalfigureparameter\c!xmax{\number\scratchdimen}
299 \else
300 \d_grph_steps_x\figurewidth \divide\d_grph_steps_x \externalfigureparameter\c!xmax\relax
301 \d_grph_steps_y\figureheight \divide\d_grph_steps_y \externalfigureparameter\c!ymax\relax
302 \fi}
303
304\def\grph_steps_comment#1(#2,#3)#4(#5,#6)
305 {\def\grph_steps_comment_indeed[##1]##2
306 {\position(#2,#3)
307 {\setnostrut
308 \framed
309 [\c!width=#5\d_grph_steps_x,
310 \c!height=#6\d_grph_steps_y,
311 \c!offset=\v!none,
312 \c!frame=#1,
313 ##1]
314 {##2}}}
315 \dosingleempty\grph_steps_comment_indeed}
316
317
318
319
320\def\grph_steps_goto(#1,#2)#3[#4]
321 {\gotobox{\vpack{\grph_steps_area(#1,#2)#3{}}}[#4]}
322
323\def\grph_steps_text#1(#2,#3)#4(#5,#6)#7[#8]
324 {\advance\c_grph_steps_reference\plusone
325 \hbox
326 {\quad
327 \thisissomeinternal\s!vwb
328 {#8}
329 \gotosomeinternal\s!vwa{#8}\realfolio
330 {\hbox to 1.5em{\the\c_grph_steps_reference\hfill}}
331 \quad#1 (#2,#3) (#5,#6) [#8]\hfill}
332 \endgraf}
333
334\def\grph_steps_this_is(#1,#2)#3[#4]
335 {\grph_steps_area(#1,#2){#3}{\dosetdirectpagereference{#4}}}
336
337\def\grph_steps_area(#1,#2)#3#4
338 {\bgroup
339 \setnostrut
340 \framed
341 [\c!width=#1\d_grph_steps_x,
342 \c!height=#2\d_grph_steps_y,
343 \c!offset=\zeropoint,
344 \c!frame=#3]
345 {#4}
346 \egroup}
347
348\def\grph_steps_marker(#1,#2)#3#4
349 {\framed
350 [\c!width=#1\d_grph_steps_x,
351 \c!height=#2\d_grph_steps_y,
352 \c!offset=\v!none,
353 \c!frame=#3]
354 {#4}}
355
356\protect \endinput
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 |