# [NTG-context] future versions

Hans Hagen j.hagen at xs4all.nl
Wed Jul 25 01:21:48 CEST 2018

```On 7/24/2018 11:02 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
> Hi Hans, all,

> One needed feature that would be of general use is better support for
> synctex. Thinking especially of structural elements such as headings,
> footnotes, etc. which mostly do not work with synctex - i.e., clicking
> on these elements in the pdf do not take one back to the correct
> location in the relevant TEX file.
Synctex is a beast. Basically it is not that useable for context which
is why we have a different implementation with a rather clean, minimal,
and predictable output. Unfortunately the usual approahc is to use a
library for interoreting the synctex files which has too much heuristics
built in. More flexible would be to let the viewer cann an external
program which then can interpret the synctex file based on a page and
position. This also would make it possible to have more clever
synchronization and/or adapt to a macro package. Anyway, were sort of
stuck and can only try to make the best of it.

That said, the context generated synctex file is nornally okay unless we
render from lua, which happens for instance with titles. Just try

\ctxlua{context("foo bar")}

and you will also see that there is no line related positioning.
Tweaking luatex for this is not really an options because whatever
decision we make here will backfire at some point. (I can look into some
option later but it needs bit of thinking)

Anyway, i can cheat at the tex/lua end if needed and support e.g. titles
but i'm not going to pollute the code with every place where we come
from lua (also because in most cases there is no relation with the
source anyway then). Also, I will not add code that can have an impact
on performance when synctex is turned off. But for a subset of
constructs that are relatively short in usage it is doable (but doesn't
really qualify as fun -- also, i don't use it myself).

(One complication is that for instance fixing it for some constructs
will break it for xml input which also supports synctex.)

Hans

-----------------------------------------------------------------