# synctex not working with ConTeXt MkIV on macOS

I can't get synctex working with ConTeXt MkIV. A .synctex file is generated, but I don't get any syncing in either TeXShop or in Texpad. MkII works.

Here are the details: I'm typesetting the simplest document.

\starttext
This is my {\em first} ConTeXt document.
\stoptext


In TeXShop I'm using two engines, one for the TexLive installation:

set path= ($path /usr/texbin /usr/local/bin) mtxrun --script context --autogenerate --synctex=1 "$1"


and one for the stand alone ConTeXt Suite (system wide instal).

set path= (/Applications/context/tex/texmf-osx-64/bin)
mtxrun --script context --autogenerate --synctex=1 "$1"  Both generate a .synctex file, but TeXShop doesn't sync. Everything is great if I typeset with MkII using the engine: set path= ($path /usr/texbin /usr/local/bin)
texexec --synctex=1 "$1"  However, I need to use MkIV for real work. I also tried in Texpad using the build script: export PATH=/Applications/context/tex/texmf-osx-64/bin:$PATH
mtxrun --script context --autogenerate --synctex=1 "\$TEXPAD_ROOTFILE"


That also generates a .synctex file but the syncing doesn't work.

The .log file says "> synctex functionality is enabled, expect 5-10 pct runtime overhead!"

Any ideas? Thanks!

Gavin

• I remember that there was something on the mailing list about this some time ago: \setupsynctex[state=start,method=min] % or method=max mailman.ntg.nl/pipermail/ntg-context/2019/094642.html Jul 14 '19 at 4:27
• That put me on the path to a solution. Adding the line: % !TEX useOldSyncParser to my source solves the problem in TeXShop. The line is read when the file is opened, so after adding the line the file must be closed and opened again. This only works in TeXShop. I'll provide detailed answer in a couple days when I've been able to test it more carefully. Jul 15 '19 at 2:55

% !TEX useOldSyncParser

to the beginning of the source.tex file. This line tells TeXShop that the source.synctex file produced by ConTeXt uses an older standard for synctex. Since TeXShop reads that line when the file is opened, adding the line does nothing until source.tex is closed and reopened. Then typeset and syncing works great.
I also added the line that Henri suggested and removed the --synctex=1 flag from the TeXShop engine. This is not related to the syncing issue I was having, but it allows better control of synctex.