-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Synctex fails on windows #78
Comments
I am puzzled by the uri of the GET request: This looks like a request for the reverse operation (scrolling the editor to the PDF location). Can you confirm that you are trying which direction of synchronization is failing? |
You're right. That traceback was for "scroll editor to page". But I get an almost identical error for both operations (scroll pdf to cursor AND scroll editor to page). I must have pulled the wrong traceback from the server console. I got lots of errors trying to figure this out. For a "scroll pdf to cursor" I get:
|
And there is a |
I deleted both the pdf and the synctex.gz. The synctex file is created with the pdf when I click "show LaTeX preview". MikTeX definitely has synctex support. I've used it for years in TeXStudio, but typing "synctex" into cmd is not recognized as a command. |
Okay, good to know that MikTeX supports synctex. It seems like the issue is that the synctex binary is not available in your path as If it is available in your PATH, you can add it to your |
Progress. Synctex consists of 2 parts. The part that makes the file is a part of latex. The part that reads the synctex file is not. It is usually embedded into a viewer like TeXStudio, but TeXLive offers a binary for synctex. I've managed to install a synctex binary separately using chocolatey (like apt-get but for windows). More info Synctex is now in my path. I now get the following error:
|
Glad we are making progress! The string decoding error looks like a bug. Let me look into it. It may be as simple as not decoding the output. By the way, if you have any notes on how to smooth out the process for Windows, I would love to be able to put them in the README. |
Okay, I have confirmed the bug, and will have a fix shortly. Thanks for helping with this @t-makaro! |
Hi @t-makaro, I just released |
Another error:
|
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 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. |
If it helps, the version that I get using chocolatey by
is:
It also appears that synctex is fairly new to the chocolatey repository. |
This is relevant. It explains that synctex needs an absolute path, and why there is a strange I'm too busy to attempt at the moment to implement either of these solutions (especially since I'm unfamiliar with the codebase), but it's worth it for someone to try. |
I'd like to take another crack at this, but I don't have easy access to a Windows setup. The last time I tried I wasn't able to get synctex working at all on Windows, with or without JupyterLab. If somebody has a set of instructions for how to get a working install of synctex from the windows shell, that would be helpful. |
Easiest way to install synctex on windows is with chocolatey To install chocolatey: From an administrative powershell run:
Then still from an admin shell run:
Chocolatey will automatically shim synctex into the path. In order to run chocolatey, you may need to set the execution policy with:
Similarly MikTeX can be installed with:
|
I was able to install If we can come up with commands that work for Windows, we should be able to get it up and running. But last time I couldn't get it to produce useful results, even with messing around with |
Got it. Note, I use powershell for everything here (but it should work in cmd). I have a \documentclass{article}
\begin{document}
Hello world
\end{document} Then from the pdflatex -synctex=1 test.tex Then I tried synctex with the following 3 commands: relative path does not work:
absolute path does work:
absolute path with stupid
I tested using forward slashes as well. They work fine. |
Thanks for the information @t-makaro, that's very helpful. I'll see if I can reproduce that and maybe we can finally resolve the issue. |
A little more testing. I decided to run synctex from one directory higher at
Notice. I also through in |
And one more because I didn't have an example of reverse synctex.
|
Huh, I just noticed that you didn't have the full path for the "synctex edit" case. Is it not necessary there? Does it still work if we include it? |
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! |
Yes, synctex edit works with an absolute path. It all works! Tested with jlab==0.33.11 + jlab-latex==0.4.0 |
I ran into the same error in m1 mac. I am using version 3.2.0 and jupyterlab 3.6.4.
|
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:
gyroscope.(tex/pdf/synctex.gz) are all in the same folder (at the base of the directories accessible given where I started the server)
The text was updated successfully, but these errors were encountered: