Re: texworks crashes with a context mkiv example

Max Chernoff <[email protected]> Fri, 20 Mar 2026 03:18:26 -0700
Newsgroups gmane.comp.tex.live
Message-ID <[email protected]>
Hi Bruno,

On Thu, 2026-03-19 at 12:15 +0100, Bruno Voisin wrote:
> SyncTeX
> =======
>
> Using Luigi Scarso's example-{mkiv,lmtx}.tex containing
>
> %%
> \setuppapersize[A5][A4,landscape]
> \setuparranging[2UP]
> \starttext
> \dorecurse{4}{
> \input knuth
> \page
> }
> \stoptext
> %%
>
> and processing it with
>
> context --luatex example-mkiv.tex
> context example-lmtx.tex
>
> the resulting example-{mkiv,lmtx}.pdf contains no SyncTeX data (and no
> .synctex file is generated during the run).
>
> Adding the --synctex option:
>
> - context --synctex example-lmtx.tex produces
>
> system          > synctex functionality is enabled, expect 5-10 pct runtime overhead!
> [...]
> mkxl run stats  > synctex tracing: 2 referenced files, 4 files ignored, 188 objects flushed, logfile: example-lmtx.synctex
>
> during the run and generates example-lmtx.pdf with SyncTeX data (which
> crashes TeXworks 0.6.11 for the Mac upon opening) along with
> example-lmtx.synctex.
>
> - context --luatex --synctex example-mkiv.tex produces
>
> system          > synctex functionality is enabled, expect 5-10 pct runtime overhead!
> [...]
> mkiv lua stats  > synctex tracing: 2 referenced files, 12 files ignored, 4 objects flushed, logfile: example-mkiv.synctex
>
> and generates a PDF file without SyncTeX data (as reported by
> TeXworks). No example-mkiv.synctex around, I looked, and looked again.
> Adding \setupsynctex[state=start] inside the TeX file instead of using
> --synctex does the same.
>
> I have no idea how to debug that. I must be doing something wrong, I
> don't know what.

Probably best to ask this on the ConTeXt list:

    https://mailman.ntg.nl/archives/list/[email protected]/latest

I remember seeing a few posts about SyncTeX there in the past year, so
I'm pretty sure that there is some way to get it working, but since I
don't use it myself, I'm not entirely sure about the details.

> TeXworks
> ========
>
> In his documentation for TeXShop's ConTeXt engines, namely
>
> ~/Library/TeXShop/Engines/Inactive/ConTeXt/Setting-Up-ConTeXt.pdf
>
> Dick Koch explains that SyncTeX has been developed by Jérôme Laurens who wrote C code for creating the SyncTeX data and C code to interpret this data. SyncTeX is still developed at https://github.com/jlaurens/synctex/ with the latest stable release 1.30 from 2024.
>
> The version of SyncTeX on CTAN
>
> https://ctan.org/tex-archive/support/synctex-parser
> https://ctan.org/pkg/synctex-parser
>
> is older, version 1.22 from 2017.
>
> Dick also explains that Hans Hagen rewrote his own version of SyncTeX
> for creating the SyncTeX data in ConTeXt, using an early version of
> Jérôme's code. He also writes that Hans recently wrote code for
> interpreting the ConTeXt-flavoured SyncTeX data.

Going off of my memory here (which is very likely incorrect):

- ConTeXt MkIV is LuaTeX-based, so it should mostly behave the same as
  LuaLaTeX, once you've figured out how to enable SyncTeX.

- ConTeXt MkXL/LMTX is LuaMetaTeX-based, and LuaMetaTeX removed the
  entire backend (the PDF/DVI writing code + the SyncTeX code) from the
  engine, and instead moved it all into Lua. So here, the SyncTeX
  implementation is Lua-based. In theory, this should be compatible with
  the previous implementation, but there are likely some bugs here.

- I think that there is a setting to use the new Lua-based SyncTeX
  writer in MkIV as well (or maybe this is the default?).

But again, all of this may be very wrong.

The Wiki page on SyncTeX

    https://wiki.contextgarden.net/Input_and_compilation/Text_editors/SyncTeX

and the search results on the mailing list

    https://mailman.ntg.nl/archives/search?count=50&q=synctex&page=1&mlist=ntg-context%40ntg.nl&sort=date-desc

may also have some useful information.

Thanks,
-- Max