cont-run.mkxl /size: 2967 b    last modification: 2025-02-21 11:03
1%D \module
2%D   [       file=cont-run,
3%D        version=2014.12.26,
4%D          title=\CONTEXT\ Core Macros,
5%D       subtitle=Runner,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\writestatus{loading}{ConTeXt Core Macros / Runner}
15
16\registerctxluafile{cont-run}{autosuffix}
17
18% \enabletrackers[system.synctex.visualize]
19% \enabletrackers[system.synctex.xml]
20% \enabledirectives[system.synctex.details]
21% \setupsynctex[state=start]  % works in most cases (old libs)
22% \setupsynctex[state=repeat] % in case the lib is new
23
24\unprotect
25
26% \synctexsetfilename   % defined at lua end
27% \synctexresetfilename % idem
28% \synctexblockfilename % idem
29
30\permanent\protected\lettonothing\synctexpause
31\permanent\protected\lettonothing\synctexresume
32\permanent\protected\lettonothing\synctexpushline
33\permanent\protected\lettonothing\synctexpopline
34
35\appendtoks\synctexpause \to\everybeforeoutput
36\appendtoks\synctexresume\to\everyafteroutput
37
38\permanent\protected\def\setupsynctex[#1]%
39  {\begingroup
40   \getdummyparameters[\c!state=\v!stop,\c!method=\v!max,#1]%
41   \edef\p_state{\dummyparameter\c!state}%
42   \clf_setupsynctex
43      state  {\p_state}%
44      method {\dummyparameter\c!method}%
45   \relax
46   \ifx\p_state\v!repeat
47     \let\p_state\v!start
48   \fi
49   \ifx\p_state\v!start
50     % when public implementor, use conditional
51     \enforced\glet\synctexpause   \clf_synctexpause
52     \enforced\glet\synctexresume  \clf_synctexresume
53     \enforced\glet\synctexpushline\clf_synctexpushline
54     \enforced\glet\synctexpopline \clf_synctexpopline
55   \fi
56   \endgroup}
57
58\permanent\protected\def\blocksynctexfile[#1]%
59  {\processcommacommand{#1}\synctexblockfilename}
60
61\permanent\protected\lettonothing\continuewhenlmtxmode
62
63\permanent\protected\def\continuewhenmkivmode
64  {\starttext
65   \startTEXpage[\c!offset=2\exheight,\c!foregroundstyle=\tttf]%
66      This file needs \LuaTeX\ and \ConTeXt\ \MKIV.%
67   \stopTEXpage
68   \stoptext
69   \endinput}
70
71%D Control (this might become nicer):
72
73\newtoks\t_syst_every_export_images
74\newtoks\t_syst_every_export_content
75
76\permanent\protected\def\exportimages {\expand\t_syst_every_export_images}
77\permanent\protected\def\exportcontent{\expand\t_syst_every_export_content}
78
79\appendtoks
80    \setupbackend[\c!export=\v!yes]%
81    \enabledirectives[export.images]%
82    \enablemode[exportimages]%
83    \collectexported
84    \usemodule[export-todo]%
85\to \t_syst_every_export_images
86
87\appendtoks
88    \setupbackend[\c!export=\v!yes]%
89    \usemodule[export-todo]%
90\to \t_syst_every_export_content
91
92% \appendtoks
93%     \ifcstok{\backendparameter\c!export}\v!yes
94%       \doifmode {exportimages} {%
95%          \enabledirectives[export.images]%
96%          \collectexported
97%       }%
98%     \fi
99% \to \everysetupbackend
100
101\protect \endinput
102