jupyterlab-latex: Synctex fails on windows

Jupyterlab 0.32.1 jupyterlab_latex 0.3.0 MikTex 2.9.6500

It appears that it is searching for files in the wrong location. (note the ‘uri’ in the traceback)

From the server console after clicking “scroll pdf to cursor” on the .tex fail:

Uncaught exception GET /latex/synctex/gryoscope.pdf?page=1#x=0&y=0&1525389931568 (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/latex/synctex/gryoscope.pdf?page=1&x=0&y=0&1525389931568', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "E:\ProgramData\Anaconda3\lib\site-packages\tornado\web.py", line 1543, in _execute
        result = yield result
      File "E:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 1099, in run
        value = future.result()
      File "E:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 1107, in run
        yielded = self.gen.throw(*exc_info)
      File "E:\ProgramData\Anaconda3\lib\site-packages\jupyterlab_latex\synctex.py", line 189, in get
        out = yield self.run_synctex(cmd)
      File "E:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 1099, in run
        value = future.result()
      File "E:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 1107, in run
        yielded = self.gen.throw(*exc_info)
      File "E:\ProgramData\Anaconda3\lib\site-packages\jupyterlab_latex\synctex.py", line 143, in run_synctex
        code, output = yield run_command(cmd)
      File "E:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 1099, in run
        value = future.result()
      File "E:\ProgramData\Anaconda3\lib\site-packages\tornado\gen.py", line 296, in wrapper
        result = func(*args, **kwargs)
      File "E:\ProgramData\Anaconda3\lib\types.py", line 248, in wrapped
        coro = func(*args, **kwargs)
      File "E:\ProgramData\Anaconda3\lib\site-packages\jupyterlab_latex\util.py", line 25, in run_command_sync
        process = subprocess.run(cmd, stdout=subprocess.PIPE)
      File "E:\ProgramData\Anaconda3\lib\subprocess.py", line 403, in run
        with Popen(*popenargs, **kwargs) as process:
      File "E:\ProgramData\Anaconda3\lib\subprocess.py", line 709, in __init__
        restore_signals, start_new_session)
      File "E:\ProgramData\Anaconda3\lib\subprocess.py", line 997, in _execute_child
        startupinfo)
    FileNotFoundError: [WinError 2] The system cannot find the file specified

gyroscope.(tex/pdf/synctex.gz) are all in the same folder (at the base of the directories accessible given where I started the server)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 24 (12 by maintainers)

Most upvoted comments

Hi @t-makaro, I’ve just published a new release of the python package (v0.4.0) which uses absolute paths for the SyncTeX requests. In my testing, this appears to resolve the issue. Let me know if that fixes things for you, and thanks for your patience!

Okay, I can reproduce this on Windows, but not on Linux. It seems the issue is with the SyncTex being extremely picky about absolute vs relative paths in the file names passed to it, and some versions of synctex don’t accept relative paths at all.

This discussion is helpful in working this out. It will be a pain, but I think it is fixable. I must say, SyncTeX’s CLI is not very robust.

Okay, I have confirmed the bug, and will have a fix shortly. Thanks for helping with this @t-makaro!