summaryrefslogtreecommitdiff
path: root/doc/context/presentations/context/2017/context-2017-synctex.tex
blob: 0ca6dfd0ea9d8b3818f6e601095f31693fa55729 (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
% \setupsynctex
%   [state=start]

% \enabletrackers
%   [system.synctex.visualize]

\usemodule[present-lines]

\definecolor[maincolor][r=.6]

\startdocument[title=\SYNCTEX,subtitle={\CONTEXT\ 2017 Maibach}]

\startchapter[title=What is \SYNCTEX]

\startitemize
    \startitem it is a mechanism for going back from viewer to editor \stopitem
    \startitem it uses an extra (zipped) output file \stopitem
    \startitem it adds an overhead of 5 to 15 percent runtime \stopitem
    \startitem it is designed with a specific macro package in mind \stopitem
    \startitem the rather generic approach works okay for simple document layouts \stopitem
    \startitem but it often fails for projects that use multiple files\stopitem
    \startitem and that moves information around like \XML\ encoded files \stopitem
\stopitemize

\startchapter[title=Disclaimer]

\startitemize
    \startitem till recently it was supported in \CONTEXT\ as-it-was  \stopitem
    \startitem there were no compliants, so it must have worked ok for most users \stopitem
    \startitem we never used it ourselves because of mentioned reasons \stopitem
    \startitem we only wanted to support it when it works ok in projects \stopitem
    \startitem (think of thousands of \XML\ with deeply nested inclusions in one document) \stopitem
    \startitem but what we support now is purely based on personal experiences \stopitem
    \startitem we don't use it ourselves so feedback is welcome \stopitem
\stopitemize

\stopchapter

\startchapter[title=What we do]

\startitemize
    \startitem the normal \SYNCTEX\ mechanism is disabled \stopitem
    \startitem when told so, \CONTEXT\ will kick in its own code \stopitem
    \startitem this is done by using \LUA\ code to set the right information \stopitem
    \startitem only source files that make sense are dealt with \stopitem
    \startitem this protects the styles from unwanted changes \stopitem
    \startitem within reasonable bounds \XML\ is supported \stopitem
    \startitem this also includes nested documents \stopitem
\stopitemize

\stopchapter

\startchapter[title=How it works]

\startitemize
    \startitem we only mark text and don't bother about the rest \stopitem
    \startitem we collapse information about whole stretches \stopitem
    \startitem the extra file is therefore not that large \stopitem
    \startitem so we can do without compression \stopitem
    \startitem some care is needed to avoid interference with the editors parser \stopitem
    \startitem (read: we need to get rid of the rather complex and heuristics) \stopitem
    \startitem (read: it would be nice to have a simple robust parser option) \stopitem
    \startitem there are flaws but I will look into them when motivated \stopitem
\stopitemize

\stopchapter

\startchapter[title=What the user gets]

\startitemize
    \startitem a way to turn it on:
        \starttyping
            \setupsynctex[state=start]
        \stoptyping
    \stopitem
    \startitem control over methods:
        \starttyping
            \setupsynctex[method=max]
        \stoptyping
    \stopitem
    \startitem visual tracing:
        \starttyping
            \enabletrackers[system.synctex.visualize]
        \stoptyping
    \stopitem
    \startitem some low level commands:
        \starttyping
            \synctexblockfilename{filename}
            \synctexsetfilename  {filename}
            \synctexresetfilename
            \synctexpause
            \synctexresume
        \stoptyping
    \stopitem
\stopitemize

% \enabletrackers[system.synctex.xml]
% \enabledirectives[system.synctex.details]

\stopchapter

\stopdocument