context-2012-the-script.tex /size: 8125 b    last modification: 2020-07-01 14:35
1\usemodule[present-stepwise,present-bars,abr-01]
2
3\startdocument
4  [title=The scripts,
5   color=darkblue]
6
7\StartSteps
8
9\startsubject[title=Some myths]
10
11    \startitemize[packed]
12
13        \startitem \CONTEXT\ looks al lot like plain \TEX\ and expects users to program macros. \stopitem \FlushStep
14        \startitem \CONTEXT\ depends on \RUBY. \stopitem \FlushStep
15
16    \stopitemize
17
18\stopsubject
19
20\startsubject[title=The truth]
21
22    \startitemize[packed]
23
24        \startitem On the average users don't have to program. Configuring is not programming. \stopitem \FlushStep
25        \startitem As \TEX\ lacks commandline handling and job control, helpers are provided. \stopitem \FlushStep
26        \startitem Of course users can still program a lot, but not all need that. \stopitem \FlushStep
27        \startitem Of course users can directly run \CONTEXT, but why should they. \stopitem \FlushStep
28
29    \stopitemize
30
31\stopsubject
32
33\startsubject[title=A few facts]
34
35    \startitemize[packed]
36
37        \startitem The \CONTEXT\ distribution provides a sort of ecosystem. \stopitem \FlushStep
38        \startitem In \MKII\ indeed we use \RUBY\ for some job control. \stopitem \FlushStep
39        \startitem But in \MKIV\ all is (of course) done in \LUA. \stopitem \FlushStep
40        \startitem Two scripts play an important role: mtxrun and context. \stopitem \FlushStep
41
42    \stopitemize
43
44\stopsubject
45
46\StopSteps
47
48\page
49
50\StartSteps
51
52\startsubject[title=The \quote {mtxrun} script]
53
54    \startitemize[packed]
55
56        \startitem Locates and runs scripts, has a lot of helpers preloaded. \stopitem \FlushStep
57        \startitem It is in fact my \LUA\ runner on top the \TEXLUA. \stopitem \FlushStep
58        \startitem It knows about files and the environment we run in. \stopitem \FlushStep
59        \startitem It has some features that makes it easier to integrate in services. \stopitem \FlushStep
60        \startitem This way we don't need stubs (and avoid potential conflicts in name). \stopitem \FlushStep
61
62    \stopitemize
63
64\stopsubject
65
66\startsubject[title=The \quote {context} script]
67
68\startitemize[packed]
69
70    \startitem It runs \CONTEXT\ and keeps track of how many runs are needed. \stopitem \FlushStep
71    \startitem Contrary to its \MKII\ ancestor it is not needed for index sorting etc. \stopitem \FlushStep
72    \startitem It has a few extensions that are loaded on demand: extras \stopitem \FlushStep
73
74\stopitemize
75
76\stopsubject
77
78\StopSteps
79
80\page
81
82\StartSteps
83
84\startsubject[title=A regular run]
85
86    \starttyping
87    context [--run] filename
88    \stoptyping \FlushStep
89
90\stopsubject
91
92\startsubject[title=Running from an editor]
93
94    \starttyping
95    context --autopdf filename
96    \stoptyping \FlushStep
97
98\stopsubject
99
100\startsubject[title=Running from an service]
101
102    \starttyping
103    mtxrun --path=somepath --script context filename
104    \stoptyping \FlushStep
105
106\stopsubject
107
108\StopSteps
109
110\page
111
112\StartSteps
113
114\startsubject[title=Controlling the rendering]
115
116    \starttyping
117    --usemodule=list
118    --environment=list
119    --mode=list
120    --arguments=list
121    --path=list
122    \stoptyping \FlushStep
123
124\stopsubject
125
126\startsubject[title=Controlling with ctx files]
127
128    \starttyping
129    --ctx=name
130    \stoptyping \FlushStep
131
132\stopsubject
133
134\startsubject[title=Also in preamble]
135
136    \starttyping
137    <?context-directive job ctxfile m4all.ctx ?>
138    \stoptyping \FlushStep
139
140\stopsubject
141
142\StopSteps
143
144\page
145
146\StartSteps
147
148\startsubject[title=A ctx file]
149
150\starttyping
151<?xml version='1.0' standalone='yes'?>
152
153<ctx:job>
154    <ctx:message>EPUB Formatter</ctx:message>
155    <ctx:flags>
156        <ctx:flag>purge</ctx:flag>
157        <ctx:flag>global</ctx:flag>
158    </ctx:flags>
159    <ctx:process>
160        <ctx:resources>
161            <ctx:module>epub-01</ctx:module>
162        </ctx:resources>
163    </ctx:process>
164</ctx:job>
165\stoptyping \FlushStep
166
167\stopsubject
168
169\StopSteps
170
171\page
172
173\StartSteps
174
175\startsubject[title=Multiple products from one source]
176
177    \starttyping
178    --result=name
179    \stoptyping \FlushStep
180
181\stopsubject
182
183\startsubject[title=When imposition is needed]
184
185    \starttyping
186    --arrange
187    \stoptyping \FlushStep
188
189\stopsubject
190
191\startsubject[title=Cleanup after runs]
192
193    \starttyping
194    --batchmode
195    --purge(all)
196    --purgeresult
197    \stoptyping \FlushStep
198
199\stopsubject
200
201\StopSteps
202
203\page
204
205\StartSteps
206
207\startsubject[title=Sometimes faster (in services)]
208
209    \starttyping
210    --once
211    --runs=2
212    \stoptyping \FlushStep
213
214\stopsubject
215
216\startsubject[title=Normally automatically done]
217
218    \starttyping
219    --make
220    --generate
221    --touch
222    \stoptyping \FlushStep
223
224\stopsubject
225
226\startsubject[title=Seldom used]
227
228    \starttyping
229    --interface
230    --randomseed=number
231    \stoptyping \FlushStep
232
233\stopsubject
234
235\StopSteps
236
237\page
238
239\StartSteps
240
241\startsubject[title=Information about extra control]
242
243    \starttyping
244    --trackers
245    --directives
246    --showlogcategories
247    --version
248    \stoptyping \FlushStep
249
250\stopsubject
251
252\startsubject[title=Controlling the machinery]
253
254    \starttyping
255    --trackers=list
256    --directives=list
257    --silent=list
258    --noconsole
259    --nostatistics
260    \stoptyping \FlushStep
261
262\stopsubject
263
264\StopSteps
265
266\page
267
268\StartSteps
269
270\startsubject[title=When no local file is used]
271
272    \starttyping
273    --global
274    --nofile
275    \stoptyping \FlushStep
276
277\stopsubject
278
279\startsubject[title=When the automatics recognition doesn't work]
280
281    \starttyping
282    --forcexml
283    --forcecld
284    --forcelua
285    --forcemp
286    \stoptyping \FlushStep
287
288\stopsubject
289
290\StopSteps
291
292\page
293
294\StartSteps
295
296\startsubject[title=Only handy for development (or me)]
297
298    \starttyping
299    --profile
300    --timing
301    \stoptyping \FlushStep
302
303\stopsubject
304
305\startsubject[title=Forget about these]
306
307    \starttyping
308    --paranoid
309    --update
310    \stoptyping \FlushStep
311
312\stopsubject
313
314\startsubject[title=Some hidden treasures]
315
316    \starttyping
317    --extras
318    --extra=name
319    \stoptyping \FlushStep
320
321\stopsubject
322
323\StopSteps
324
325\page
326
327\StartSteps
328
329\startsubject[title=Arguments can be prefixed]
330
331    \starttyping
332    environment:
333    relative:
334    auto:
335    locate:
336    filename:
337    pathname:
338    home:
339    selfautoloc:
340    selfautoparent:
341    selfautodir:
342    \stoptyping \FlushStep
343
344\stopsubject
345
346\StopSteps
347
348\page
349
350\StartSteps
351
352\startsubject[title=Recent (probably unnoticed) change]
353
354    \starttyping
355    luatex
356      --fmt=".../tex/texmf-cache/luatex-cache/context/.../formats/cont-en"
357      --lua=".../tex/texmf-cache/luatex-cache/context/.../formats/cont-en.lui"
358      --jobname="context-the-script"
359      --no-parse-first-line
360      --c:autopdf
361      --c:currentrun=1
362      --c:fulljobname="./context-the-script.tex"
363      --c:input="./context-the-script.tex"
364      --c:kindofrun=1
365      "cont-yes.mkiv"
366    \stoptyping \FlushStep
367
368\stopsubject
369
370\startsubject[title=Another change]
371
372\startitemize[packed]
373
374    \startitem The (runtime generated) options file is no longer there. \stopitem \FlushStep
375    \startitem For as far as possible arguments are passed directly. \stopitem \FlushStep
376    \startitem Input files are always loaded indirectly, no more stubs. \stopitem \FlushStep
377
378\stopitemize
379
380\stopsubject
381
382\StopSteps
383
384\page
385
386\StartSteps
387
388\startsubject[title=About 30 mtx/lmx scripts]
389
390    \starttyping
391    mtx-check.lua
392    mtx-convert.lua
393    mtx-epub.lua
394    mtx-fonts.lua
395    mtx-modules.lua
396    mtx-patterns.lua
397    mtx-pdf.lua
398    \stoptyping \FlushStep
399
400\stopsubject
401
402\startsubject[title=These are run like]
403
404    \starttyping
405    mtxrun --script pdf
406    \stoptyping \FlushStep
407
408\stopsubject
409
410\StopSteps
411
412\page
413
414\StartSteps
415
416\startsubject[title=Several mtx templates]
417
418    \starttyping
419    mtx-context-arrange.lua
420    mtx-context-combine.lua
421    mtx-context-listing.lua
422    mtx-context-select.lua
423    mtx-context-timing.lua
424    \stoptyping \FlushStep
425
426\stopsubject
427
428\startsubject[title=These are run like]
429
430    \starttyping
431    context --extra=arrange [--help] ...
432    \stoptyping \FlushStep
433
434\stopsubject
435
436\StopSteps
437
438\page
439
440\StartSteps
441
442\startsubject[title=Local preferences]
443
444    \starttyping
445    texmfcnf.lua
446    \stoptyping \FlushStep
447
448\stopsubject
449
450\StopSteps
451
452\stopdocument
453
454