For those searching in future, the minimum needed to make synctex work with 
ConTeXt and TeXShop on macOS Monterey is:

1) Reasonably new LMTX. I have version 2021.12.10 11:41. (It might well work 
going back a few versions but not too far.)

2) TeXShop version 4.68

3) TeXShop -> Preferences -> Engines -> Alternate path *must* be set to your 
LMTX installation.
   For me on an Intel Mac that is: 
/Users/bruce/Applications/context-osx-64/tex/texmf-osx-64/bin

TeXShop uses this path to launch the program it needs to convert a synctex 
location into a file name
and line number. If this path is wrong then the editor just does nothing.

4) These two lines at the top of each source file you want to sync to/from:

% !TEX useAlternatePath
% !TEX useConTeXtSyncParser

5) Either --synctex="1" on the command line in the .engine file or 
\setupsynctex [state=start, method=max]
somewhere in your source (which can be in the current file or in an environment 
file).

6) Most times you will need to quit and restart TeXShop when you change any of 
the above.


You *do not* need:

1) You do not need the "ConTeXt2021.engine" file: you can use your own engine 
file as long as it invokes your local LMTX. So, for me, the two key commands in 
the .engine file are:

set path=(/Users/bruce/Applications/context-osx-64/tex/texmf-osx-64/bin $path 
/Library/TeX/texbin /usr/texbin /usr/local/bin)
mtxrun --script context --autogenerate "$1"

2) You do not need the following magic line:

% !TEX TS-program = ConTeXt2021

If you do include it then it will override the engine you select from the drop 
down.


Hopefully this answer will help others with this problem:- at least until the 
version of ConTeXt shipped with TexShop is new enough to support the new 
synctex and then there won't be any need to configure anything.


> On 13 Dec 2021, at 09:45, Bruce Horrocks via ntg-context <ntg-context@ntg.nl> 
> wrote:
> 
> I'm having trouble getting the new synctex to work on a Mac. I've completely 
> re-installed MacTeX and TeXWorks and synctex works fine for LaTeX documents. 
> But for ConTeXt no combination of magic lines etc will work for me. The 
> symptoms are... nothing - no errors but no synching, either way.
> 
> Q1: is there a log file created somewhere or a debugging flag that can be 
> turned on which will tell me what is happening when I try to jump from PDF to 
> editor or vice versa?
> 
> Q2: Is this the same error as reported at the bottom of 
> https://wiki.contextgarden.net/SyncTeX ? Or has that been fixed?
> 
> PS: \enabletrackers[system.synctex.visualize] works as expected - i.e. the 
> .synctex file seems to be correct.

—
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________________
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