summaryrefslogtreecommitdiff
path: root/doc/context/presentations/context/2012/context-2012-the-script.tex
blob: be586e2ff04b76a0f57a7fad5853ffdcfa9bbc69 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
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
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
\usemodule[present-stepwise,present-bars,abr-01]

\startdocument
  [title=The scripts,
   color=darkblue]

\StartSteps

\startsubject[title=Some myths]

    \startitemize[packed]

        \startitem \CONTEXT\ looks al lot like plain \TEX\ and expects users to program macros. \stopitem \FlushStep
        \startitem \CONTEXT\ depends on \RUBY. \stopitem \FlushStep

    \stopitemize

\stopsubject

\startsubject[title=The truth]

    \startitemize[packed]

        \startitem On the average users don't have to program. Configuring is not programming. \stopitem \FlushStep
        \startitem As \TEX\ lacks commandline handling and job control, helpers are provided. \stopitem \FlushStep
        \startitem Of course users can still program a lot, but not all need that. \stopitem \FlushStep
        \startitem Of course users can directly run \CONTEXT, but why should they. \stopitem \FlushStep

    \stopitemize

\stopsubject

\startsubject[title=A few facts]

    \startitemize[packed]

        \startitem The \CONTEXT\ distribution provides a sort of ecosystem. \stopitem \FlushStep
        \startitem In \MKII\ indeed we use \RUBY\ for some job control. \stopitem \FlushStep
        \startitem But in \MKIV\ all is (of course) done in \LUA. \stopitem \FlushStep
        \startitem Two scripts play an important role: mtxrun and context. \stopitem \FlushStep

    \stopitemize

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=The \quote {mtxrun} script]

    \startitemize[packed]

        \startitem Locates and runs scripts, has a lot of helpers preloaded. \stopitem \FlushStep
        \startitem It is in fact my \LUA\ runner on top the \TEXLUA. \stopitem \FlushStep
        \startitem It knows about files and the environment we run in. \stopitem \FlushStep
        \startitem It has some features that makes it easier to integrate in services. \stopitem \FlushStep
        \startitem This way we don't need stubs (and avoid potential conflicts in name). \stopitem \FlushStep

    \stopitemize

\stopsubject

\startsubject[title=The \quote {context} script]

\startitemize[packed]

    \startitem It runs \CONTEXT\ and keeps track of how many runs are needed. \stopitem \FlushStep
    \startitem Contrary to its \MKII\ ancestor it is not needed for index sorting etc. \stopitem \FlushStep
    \startitem It has a few extensions that are loaded on demand: extras \stopitem \FlushStep

\stopitemize

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=A regular run]

    \starttyping
    context [--run] filename
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=Running from an editor]

    \starttyping
    context --autopdf filename
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=Running from an service]

    \starttyping
    mtxrun --path=somepath --script context filename
    \stoptyping \FlushStep

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=Controlling the rendering]

    \starttyping
    --usemodule=list
    --environment=list
    --mode=list
    --arguments=list
    --path=list
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=Controlling with ctx files]

    \starttyping
    --ctx=name
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=Also in preamble]

    \starttyping
    <?context-directive job ctxfile m4all.ctx ?>
    \stoptyping \FlushStep

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=A ctx file]

\starttyping
<?xml version='1.0' standalone='yes'?>

<ctx:job>
    <ctx:message>EPUB Formatter</ctx:message>
    <ctx:flags>
        <ctx:flag>purge</ctx:flag>
        <ctx:flag>global</ctx:flag>
    </ctx:flags>
    <ctx:process>
        <ctx:resources>
            <ctx:module>epub-01</ctx:module>
        </ctx:resources>
    </ctx:process>
</ctx:job>
\stoptyping \FlushStep

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=Multiple products from one source]

    \starttyping
    --result=name
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=When imposition is needed]

    \starttyping
    --arrange
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=Cleanup after runs]

    \starttyping
    --batchmode
    --purge(all)
    --purgeresult
    \stoptyping \FlushStep

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=Sometimes faster (in services)]

    \starttyping
    --once
    --runs=2
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=Normally automatically done]

    \starttyping
    --make
    --generate
    --touch
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=Seldom used]

    \starttyping
    --interface
    --randomseed=number
    \stoptyping \FlushStep

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=Information about extra control]

    \starttyping
    --trackers
    --directives
    --showlogcategories
    --version
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=Controlling the machinery]

    \starttyping
    --trackers=list
    --directives=list
    --silent=list
    --noconsole
    --nostatistics
    \stoptyping \FlushStep

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=When no local file is used]

    \starttyping
    --global
    --nofile
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=When the automatics recognition doesn't work]

    \starttyping
    --forcexml
    --forcecld
    --forcelua
    --forcemp
    \stoptyping \FlushStep

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=Only handy for development (or me)]

    \starttyping
    --profile
    --timing
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=Forget about these]

    \starttyping
    --paranoid
    --update
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=Some hidden treasures]

    \starttyping
    --extras
    --extra=name
    \stoptyping \FlushStep

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=Arguments can be prefixed]

    \starttyping
    environment:
    relative:
    auto:
    locate:
    filename:
    pathname:
    home:
    selfautoloc:
    selfautoparent:
    selfautodir:
    \stoptyping \FlushStep

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=Recent (probably unnoticed) change]

    \starttyping
    luatex
      --fmt=".../tex/texmf-cache/luatex-cache/context/.../formats/cont-en"
      --lua=".../tex/texmf-cache/luatex-cache/context/.../formats/cont-en.lui"
      --jobname="context-the-script"
      --no-parse-first-line
      --c:autopdf
      --c:currentrun=1
      --c:fulljobname="./context-the-script.tex"
      --c:input="./context-the-script.tex"
      --c:kindofrun=1
      "cont-yes.mkiv"
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=Another change]

\startitemize[packed]

    \startitem The (runtime generated) options file is no longer there. \stopitem \FlushStep
    \startitem For as far as possible arguments are passed directly. \stopitem \FlushStep
    \startitem Input files are always loaded indirectly, no more stubs. \stopitem \FlushStep

\stopitemize

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=About 30 mtx/lmx scripts]

    \starttyping
    mtx-check.lua
    mtx-convert.lua
    mtx-epub.lua
    mtx-fonts.lua
    mtx-modules.lua
    mtx-patterns.lua
    mtx-pdf.lua
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=These are run like]

    \starttyping
    mtxrun --script pdf
    \stoptyping \FlushStep

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=Several mtx templates]

    \starttyping
    mtx-context-arrange.lua
    mtx-context-combine.lua
    mtx-context-listing.lua
    mtx-context-select.lua
    mtx-context-timing.lua
    \stoptyping \FlushStep

\stopsubject

\startsubject[title=These are run like]

    \starttyping
    context --extra=arrange [--help] ...
    \stoptyping \FlushStep

\stopsubject

\StopSteps

\page

\StartSteps

\startsubject[title=Local preferences]

    \starttyping
    texmfcnf.lua
    \stoptyping \FlushStep

\stopsubject

\StopSteps

\stopdocument