I have recently started to experiment with the pyluatex package (which lets you include Python 3 code in a .tex document, and have it run during the .tex compilation process).


I have a setup that I am pretty happy with, except that I haven't gotten synctex (forward-inverse-search) to work. My documents compile properly and I do get proper .pdf output; the only problem is that I also get a synctex(busy) file (so of course Ctrl-click in the source or the output doesn't do anything).

Here is a minimal example where synctex doesn't work:




It would not surprise me if my question is related to this one. However, please note that synctex works properly if I do not use pyluatex. For example, the following document compiles and produces a .pdf and a synctex.gz file, and synctex seems to work just fine:




In case it is relevant, I am using Windows 10, with TeXworks (0.6.6) and MiKTeX (21.12.10), and I am using the following typesetting options (available from the Edit, Preferences, Typesetting menu in TeXworks):





(Latexmk seems to be version 4.76.)

I guess the question is: Why is synctex not working for me? In other words, am I doing something wrong (perhaps with the Typesetting options I am using)? Or maybe I have installed something wrong, or need to update something. Please let me know if there is further information that I should have provided.

  • Welcome to TeX.SE!
    – Mensch
    Jan 26 at 19:47

1 Answer 1


It turned out that the problem is a PyLuaTeX bug under Windows. Since the Python interpreter was not shut down early enough in previous versions of PyLuaTeX, the SyncTeX output file was locked and could not be finished (i.e., compressed and renamed) properly.

It has been fixed in the new version 0.4.1 https://github.com/tndrle/PyLuaTeX/commit/86725935425f2d4e879efba4227744df807c675e

  • Fantastic! FYI, I had originally installed pyluatex "manually": downloaded the .zip, extracted, and put the folder somewhere that I thought made sense. BUT, I guess I had put it into a weird location, and it looks like maybe MiKTeX copied that folder into a location it liked better? So I had to track it down and manually replace the old folder with the new one, in MiKTeX's preferred location. Luckily, checking the .log file told me where MiKTeX was opening pyluatex from (if that makes sense), so I replaced it with the new version at that file location. Anyway, thanks very much!
    – mathmandan
    Feb 9 at 4:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.