On 8/21/2018 3:04 PM, Aditya Mahajan wrote:
On Tue, 21 Aug 2018, Hans Hagen wrote:

Anyway, a better support for "pick-in-PDF-and-go-to-source" (synctex), namely when user "tunes" the docs to their final stage, would be great.
I think that the current approach to hard code synctex libraries into a viewer is a limitation (instead an editor should call an external program with the page and coordinates so that an external program can then look at the synctex file and decide where to go in the editor. That way more sophisticated support is possible than the now hard coded heuristics. Keep in mind that these heuristics are tuned for latex and from context we generate the real minimal amount of synctex code that works without clashing with these heuristics. If that were not that case is would be unuseable.

Anyhow, there's only so much i can do about it (i'm not going to patch viewers). Currently synctex is mostly working for decent structured source (can be multiple files).

Which of the existing viewers have this functionality? Last time I tried using synctex on linux, almost all viewers gave an error that they could not parse synctex file.

I think that is because the format of the synctex file changed.

Is there some documentation on what is the format of the synctex file written by ConTeXt and how the external program should be called with page and coordinates? With that we can try to raise an issue asking the pdf viewers to support that.

context outputs a bare minimum of synctex info: basically it identifies text and marks that, so we don't need the whole nested box mess that can confuse the parser (think of boxes that lap or are moved or lie about dimensions)

is you have a context synctex file you only see a few levels (basically words / lines) marked

There is a script:

mtxrun --script synctex

basically all an editor has to do is call:

mtxrun --script synctex
  --page=123 --x=400 --y=500
  --editor=scite
  foo.synctex

the script will look into the synctex file and figure out where to go to. Basically all the viewer needs to do is react to a click/cursor/key combination and call mtxrun .... with the page and positions (basepoints in pdf coordinate space)

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to