summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/cont-run.mkxl
blob: edc038e45e23712ff5d4e9304f367356fb94c5d2 (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
%D \module
%D   [       file=cont-run,
%D        version=2014.12.26,
%D          title=\CONTEXT\ Core Macros,
%D       subtitle=Runner,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{ConTeXt Core Macros / Runner}

\registerctxluafile{cont-run}{autosuffix}

% \enabletrackers[system.synctex.visualize]
% \enabletrackers[system.synctex.xml]
% \enabledirectives[system.synctex.details]
% \setupsynctex[state=start]

\unprotect

% \synctexsetfilename   % defined at lua end
% \synctexresetfilename % idem
% \synctexblockfilename % idem

\permanent\protected\lettonothing\synctexpause
\permanent\protected\lettonothing\synctexresume
\permanent\protected\lettonothing\synctexpushline
\permanent\protected\lettonothing\synctexpopline

\appendtoks\synctexpause \to\everybeforeoutput
\appendtoks\synctexresume\to\everyafteroutput

\permanent\protected\def\setupsynctex[#1]%
  {\begingroup
   \getdummyparameters[\c!state=\v!stop,\c!method=\v!max,#1]%
   \edef\p_state{\dummyparameter\c!state}%
   \clf_setupsynctex
      state  {\p_state}%
      method {\dummyparameter\c!method}%
   \relax
   \ifx\p_state\v!start
     % when public implementor, use conditional
     \enforced\glet\synctexpause   \clf_synctexpause
     \enforced\glet\synctexresume  \clf_synctexresume
     \enforced\glet\synctexpushline\clf_synctexpushline
     \enforced\glet\synctexpopline \clf_synctexpopline
   \fi
   \endgroup}

\permanent\protected\def\blocksynctexfile[#1]%
  {\processcommacommand{#1}\synctexblockfilename}

\permanent\protected\lettonothing\continuewhenlmtxmode

\permanent\protected\def\continuewhenmkivmode
  {\starttext
   \startTEXpage[\c!offset=2ex,\c!foregroundstyle=\tttf]%
      This file needs \LuaTeX\ and \ConTeXt\ \MKIV.%
   \stopTEXpage
   \stoptext
   \endinput}

\protect \endinput