Re: texworks crashes with a context mkiv example
Bruno Voisin <[email protected]> Thu, 19 Mar 2026 12:15:55 +0100
| Newsgroups | gmane.comp.tex.live |
|---|---|
| Message-ID | <[email protected]> |
Back to the SyncTeX/TeXworks issue that started this.
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.
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.
As a consequence, TeXShop includes two SyncTeX parsers (see TSDocument-SyncTeX.m and TSDocument-SyncConTeXt.m in the source):
- The standard one based on version 1.19 of synctex_parser.c from 2017.
- A ConTeXt-specific parser, triggered by adding
% !TEX useConTeXtSyncParser
in the .tex file. There is no related C code, I think TeXShop uses directly contextforwardsyncwrap and contextbackwardsyncwrap as provided by ConTeXt.
Now, TeXworks seems to include only one brand of SyncTeX, using the latest synctex_parser.c 1.30 from 2024. Maybe this can't be used with ConTeXt, hence the crash.
Again, I'm no ConTeXt user apart from testing, so there is a significant chance the above is wrong.
Bruno