Re: synctex issue
Alan Bowen <[email protected]>
| Newsgroups | gmane.comp.tex.context |
|---|---|
| Message-ID | <[email protected]> |
Hi, Jim— I will test the change to mtx-synctex.lua once I have updated synctex itself. But here is the problem: I update my installation of ConTeXt (standalone) from the command line with: cd /Applications/LuaMetaTeX/ && sh ./install.sh --script install-modules --install --all --fonts=all’. This gets me the latest ConTeXt ver 2026.04.10 and LuaMetaTeX ver 2.11.09. When I process a file and check the .synctex output, I see that I am running SyncTeX Version:1 and that mtx-synctex.lua is at version 1.002 I gather that you have version 1.5 and a standalone installation. How did you get that? Alan > On Apr 11, 2026, at 17:17, Jim <[email protected]> wrote: > > Hi Alan, > > I now (think I) know why that error message you reported is happening, and > I can suggest a small change. > > Hans: if you are reading this, perhaps you can enlighten me about this. > > About 10 lines from the bottom of mtx-synctex.lua, we have the line of code > gotolocation(filename,argument("page"),argument("x"),argument("y"),"console",argument("direct"),argument("tolerance")) > which is the line of code that gets executed when --report is the argument. > > But in the gotolocation() function, the "console" argument is assigned to > the editor parameter. A couple of lines down it says > if editor then > but that if statement does the "true" part regardless of whether or not > "console" is an editor. And in that case another function called > "editfile" is called on a file it found, rather than just reporting the > information. > > If you are up for a small edit of your copy of mtx-synctex.lua, then I > suggest changing the above gotolocation line to this: > gotolocation(filename,argument("page"),argument("x"),argument("y"),nil,argument("direct"),argument("tolerance")) > and after that, the error message you reported should go away. > > I don't use Macs, so I can't tell you where mtx-synctex.lua is on your > system. If you don't know where it lives, you will have to use your OS's > search functions. In my case, I have the ConTeXt standalone distribution > installed in /usr/local/context, and the file is found at > /usr/local/context/tex/texmf-context/scripts/context/lua/mtx-synctex.lua > > Having said all that, if TeXshop uses the synctex program and/or the > synctex library, those are likely the things that need to be updated before > things get better. > > Jim > > On Sat, Apr 11, 2026 at 13:55 (-0400), Alan Bowen wrote: > >> Hi, Jim— > >> I changed the engine so that it now reads >> synctex==repeat “$1” > >> I re-did the tests (without the typos ☹️) > >> For the first >> % synctex edit -o 50:300:300:prd_Aestimatio-05.pdf >> the error message is >> This is SyncTeX command line utility, version 1.2 >> SyncTeX ERROR: No SyncTeX available for prd_Aestimatio-05.pdf >> usage: synctex <subcommand> [options] [args] >> Synchronize TeXnology command-line client, version 1.17 > >> and for the second >> % mtxrun --script synctex --report --page=50 --x=300 --y=300 --tolerance=9999 prd_Aestimatio-05.synctex >> the error message is >> mtx-synctex | invalid synctex log file 'prd_Aestimatio-05.synctex' > >> which is the same as before. > >> I will send the files that you request to you directly. > >> All best, >> Alan > >>> On Apr 11, 2026, at 12:55, Jim <[email protected]> wrote: > >>> Hi Alan, > >>> On Sat, Apr 11, 2026 at 12:28 (-0400), Alan Bowen wrote: > >>>> Thank you for your help. > >>> You're welcome (such as it is!). > >>>> The TeXShop engine for luametatex is LMTX and it contains: >>>> mtxrun --script context --synctex "$1" --autogenerate --file-line-error --directives="system.showerror" --autopdf > >>> Are you able to change it to --synctex=repeat ? > >>> That produces a different format of synctex output which is more compatible >>> with the non-ConTeXt synctex program and synctex library. Which TeXshop >>> may be using. > >>>> I have limited experience with the command line, so I may have >>>> misunderstood you in the following. > >>>> When I run: >>>> % cd Aestimatio_ns_v05 >>>> and then >>>> % synctex edit -o 50:300:300:prd_Aestimatio-05.pdf >>>> I get: > >>>> % synctex edit -o 50:30o:30o:prd_Aestimatio-05.pdf > >>> Is there a cut-and-paste error here? The last character of what should be >>> "300" is an "o". Which is not good. > >>>> This is SyncTeX command line utility, version 1.2 >>>> SyncTeX ERROR: No SyncTeX available for prd_Aestimatio-05.pdf >>>> usage: synctex <subcommand> [options] [args] >>>> Synchronize TeXnology command-line client, version 1.17 > >>> Is the file prd_Aestimatio-05.synctex (or prd_Aestimatio-05.synctex.gz) in >>> that directory? If so, my (wild) guess is that synctex is complaining >>> about the format of the synctex file, which might be helped with the >>> --synctex=repeat >>> version. > >>>> With >>>> % mtxrun --script synctex --report --page=50 --x=300 --y=300 --tolerance=9999 prd_Aestimatio-05.synctex > >>>> I get >>>> mtx-synctex | invalid synctex log file 'prd_Aestimatio-05.synctex' > >>> That is curious. > >>>> In both instances, the file "prd_Aestimatio-05.synctex" is in the same directory and it has content. > >>>> What is puzzling is that synctex does work for all cases except for that >>>> from PDF file to one of a number of souurce files. > >>> If your files (.tex, .pdf and .synctex_ are not huge, and they are not >>> "secret", feel free to mail them to me (directly is fine) and I will be >>> happy to take a look. (No guarantees of success, however.) > > >>> Jim > >>>>> On Apr 9, 2026, at 12:34, Jim <[email protected]> wrote: > >>>>> On Thu, Apr 9, 2026 at 11:25 (-0400), Alan Bowen wrote: > >>>>>> Hi— > >>>>>> I now have synctex working successfully for : >>>>>> PDF output—> single source file >>>>>> single source file—> PDF output >>>>>> any one of many included source files—> PDF output. > >>>>>> What I have yet to get is >>>>>> PDF output—> one of many component files. >>>>>> (This last promises to be very useful in editing my journal.) > >>>>>> I have no idea how to troubleshoot this and so any advice or guidance will be gratefully received. > >>>>>> I am running the latest ConTeXt ( ver: 2026.03.25) and the latest TeXShop (ver. 5.58 with the luametatex engine) on macOS 26.4 > >>>>> Hi Alan, > >>>>> I use synctex a lot, and while I run into some issues which I'm currently >>>>> trying to resolve, here's an example that I just tested that works for me >>>>> to go to a component file > >>>>> $ synctex edit -o 48:85:76:introCTX_eng.pdf >>>>> This is SyncTeX command line utility, version 1.5 >>>>> SyncTeX result begin >>>>> Output:introCTX_eng.pdf >>>>> Input:01_BodyMatter/b03_Commands.tex >>>>> Line:40 >>>>> Column:-1 >>>>> Offset:0 >>>>> Context: >>>>> SyncTeX result end > >>>>> It got the file correct, but the line number is wrong. > >>>>> I have never used TeXShop, so I don't know how it gets its synctex into >>>>> (i.e., internal library? >>>>> external synctex program? >>>>> mtxrun --script synctex ... ? >>>>> ) > >>>>> I would suggest testing a command-line synctex program to see if your >>>>> synctex file has the required info in it. > >>>>> The syntax for the above "synctex edit" is >>>>> pdf-page:x-coord:y-coord:pdf-file.pdf >>>>> and that assumes the synctex file is in the same directory. If not there >>>>> is another option needed. > >>>>> mtxrun call from the command line is like >>>>> mtxrun --script synctex --report --page=48 --x=850 --y=1020 --tolerance=9999 introCTX_eng.synctex > >>>>> I can't promise to be a while lot of help going forward, but I'm interested >>>>> in knowing how well things work for you, so please report back to the list. > >>>>> Jim >>> ___________________________________________________________________________________ >>> If your question is of interest to others as well, please add an entry to the Wiki! > >>> maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl >>> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) >>> archive : https://github.com/contextgarden/context >>> wiki : https://wiki.contextgarden.net >>> ___________________________________________________________________________________ > >> ___________________________________________________________________________________ >> If your question is of interest to others as well, please add an entry to the Wiki! > >> maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl >> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) >> archive : https://github.com/contextgarden/context >> wiki : https://wiki.contextgarden.net >> ___________________________________________________________________________________ > ___________________________________________________________________________________ > If your question is of interest to others as well, please add an entry to the Wiki! > > maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl > webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) > archive : https://github.com/contextgarden/context > wiki : https://wiki.contextgarden.net > ___________________________________________________________________________________ ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________