[texshop] Synctex and component files

Richard Koch koch at uoregon.edu
Sat Oct 15 18:42:13 CEST 2022


Alan Bowen,

Synctex was written by Jerome Laurens. He provided two pieces of code:

a) he added code directly to the various TeX engines to output a ".synctex" file containing information to support sync

b) he provided a procedure written in C which opened the synctex file and interpreted its contents. Front end developers could add this source to their project to implement synctex.


The ConTeXt people like to rewrite everything from scratch. They have a special version of LuaTeX for ConTeXt, etc., etc. So it is not surprising that they

a) wrote their own version of synctex for ConTeXt

b) wrote their own C source to interprete the results

I was contacted by someone in the ConTeXt community, Nicola Vitacolonna, who led me through the process of adding support for these things to TeXShop. See the TeXShop changes document for version 4.65.

I don't use ConTeXt myself.  Therefore, the correct avenue to obtain help for your problem is to contact the ConTeXt community, explain your problem, ask if their version of synctex has support to fix the problem, and if so ask them to select someone to contact me and explain exactly what I must do to support it.

I have many things on my plate, so I will not be able to learn ConTeXt myself, discover how their synctex works, etc. But I'm happy to provide support if someone explains exactly what needs to be done.

Richard Koch




On Oct 15, 2022, at 9:16 AM, Alan C. Bowen <bowen at ircps.org<mailto:bowen at ircps.org>> wrote:

Herb and Bruno—

Many thanks for your suggestions.

Sadly, neither % !TEX root = rootfile.tex  or % !TEX root = /path/to/rootfile.tex at the top of each subfile (ie., component file to be included) makes no difference

Adding % !TEX projectfile = rootfile.tex at the top of the root (product) file also makes no difference.

What I have now:
• nothing special in the root (product) file
• at the top of each subfile (component file),
% !TEX root = rootfile.tex
% !TEX TS-program = ConTeXt2021
% !TEX useAlternatePath
% !TEX useConTeXtSyncParser
   \setupsynctex[state=start, method=max]

* in TeXShop—
sync method: Both Pdf Sync and Search
Alternative Path: /Users/bowen1/Applications/LuaMetaTeX/tex/texmf-osx-arm64/bin

• I am also using the latest ConteXt (ver.  2022.10.15 10:37 LMTX) and TeXShop ver. 5.03

So far
(a) the product file typesets as it should
(b) I do not get syncing from PDF to source (any component file)
(c) Syncing from source to PDf goes to the correct page of the PDF file but without any highlighting.
(d) there is a rootfile.synctex file (79 KB) generated

I am surely missing something. But what?

Alan



On Oct 13, 2022, at 12:56, Alan C. Bowen <bowen at IRCPS.org<mailto:bowen at IRCPS.org>> wrote:

I have been trying to get Synctex to work with a ConText structure of product and component files using
% !TEX useAlternatePath
% !TEX useConTeXtSyncParser
\setupsynctex[state=start, method=max]
and the various preference settings for the Sync Method in the Typesetting menu. This works  when I typeset a single source file but, so far, I have had no luck no matter whether theses lines are in the product file or in the component source files. Is there a way to get syncing with source files structured in this way? I have checked the files that come with TeXShop itself and did not see an answer there.

Alan Bowen



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texshop/attachments/20221015/6aaece80/attachment-0001.html>


More information about the texshop mailing list.