ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <j.hagen@xs4all.nl>
To: ntg-context@ntg.nl
Subject: [NTG-context] Re: context not producing synctex output that my synctex program can use
Date: Sun, 12 Nov 2023 12:00:28 +0100	[thread overview]
Message-ID: <db6587cf-73dd-425a-954c-0228cbde2a91@xs4all.nl> (raw)
In-Reply-To: <5d94a1ce-c683-411f-af33-375ac77464b2@fiee.net>

On 11/12/2023 10:26 AM, Henning Hraban Ramm wrote:
> Am 12.11.23 um 00:59 schrieb Jim:
>> Hi,
>>
>> I've read the wiki, looked at workflows-synctex.tex, searched the web, 
>> and
>> scratched my head, all to no avail.  So here I am, cap in hand...
>>
>> When I run context, I get a .synctex file which has some information 
>> in it,
>> but I can't find any invocation of synctex to return anything useful.  
>> Nor
>> does the okular example in the wiki 
>> (https://wiki.contextgarden.net/SyncTeX)
>> work for me.  Ocular starts, but always on the first page, regardless of
>> what line number I give it.
>>
>> On the other hand, pdftex creates a .synctex file which my copy of 
>> synctex
>> find useful.
>>
>> I am using the synctex from the current version of texlive:
>>          This is SyncTeX command line utility, version 1.5
>>
>> Can anyone either
>> (a) enlighten me on what I am doing wrong; or
>> (b) definitively confirm that context is not currently playing nicely 
>> with
>>      synctex (the wiki notwithstanding) and I should give up this 
>> quest for
>>      now.
> 
> ConTeXt doesn’t work with the synctex binary, but with
> mtxrun --script synctex

afaik there is no binary ... there is a library that has to be compiled 
into a pdf viewer that intercept some 'goto the text file' command and 
then launches an editor (afik the library has some heuristics build in 
wrt boxes and nesting and so); at the tex end there is also a library 
that kicks in addiional code for nodes and the backend (which is why 
enabling synctex will have an impact on runtime)

wrt the synctex file, that one is generated by context (so we don't use 
the synctex code in luatex and as luametatex has no backend there it's 
even completely absent ... context generates the file itself which is 
also a bit more efficient)

> Unfortunately, it’s not a drop-in replacement, so it doesn’t work with 
> most editors. (I was thinking about a translating wrapper script, but 
> didn’t do anything yet.)
> 
> AFAIK TeXshop (MacOS) is the only TeX editor that supports ConTeXt’s 
> workflow.

indeed texshop uses the approach that avoids the library and just calls 
mtxrun to figure out the file/line that relates to the position; this is 
more reliable because there is no need to recompile a viewer when 
synctex updates

you can run

   mtxrun --script synctex

on the synctex file and check what areas are there

> ConTeXt’s synctex format is much simpler than the “standard” LaTeX one 
> and should be at least as good, but alas it needs support from the editors.
simpler in the sense that we only output what is needed for the 
synchronization to work reliable; fwiw, my collegue already for many 
years uses context with synctex enabled with sumatra pdf in pretty 
complex setups: a mix of tex and xml files with deeply nested inputs and 
it works ok (so we also get to the right spot in an (included) xml file)

for synctex to work one has to call context with --synctex or put a 
directive on the topline of the file. Otherwise you won't get the right 
jobname. Of course it then still depends on the pdf viewer + lib used if 
things work out as expected.

there isn't much we can do about the viewer part unless tit is not 
locked into the binary but as flexible like the texshop viewer is

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 / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2023-11-12 11:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-11 23:59 [NTG-context] " Jim
2023-11-12  9:26 ` [NTG-context] " Henning Hraban Ramm
2023-11-12 11:00   ` Hans Hagen [this message]
2023-11-15 14:32   ` Jim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=db6587cf-73dd-425a-954c-0228cbde2a91@xs4all.nl \
    --to=j.hagen@xs4all.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).