-
Notifications
You must be signed in to change notification settings - Fork 365
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
Support WSL installs of LaTeX #946
Comments
Is this only problematic with the math and image preview? How would you suggest to support that? |
It applies to both the TeX binaries and the preview dependencies. WSL essentially acts as an Ubuntu VM that shares the same filesystem as Windows and allows commands to be run via I think the easiest solution would be to add a config option to enable WSL in the Windows section, and switch to the Linux paths wrapped with It looks like external_command.py#L173 controls everything that calls binaries in Windows, so adding the |
Not to be negative, but there are a few other considerations that need to be taken into account:
None of this requires too much code by itself, but it'll require a fair bit of testing to ensure all the features work as expected. |
How is this going? Any news? Thanks for your work! |
@jmml97 I don't think anyone is currently (or in the near future) working on this. |
Differently from @Techwolfy , however, with the latest WSL update even duplicating the installation of latex on both Windows and WSL doesn't seem to be working any more since launching a windows executable in a WSL directory screws up the filesystem making every file broken. I agree with @ig0774 that this is no small feat, however I'll add my two cents to this conversation [I'm using a similar setup as @Techwolfy ]:
|
Additionally, in principle all Linux executables can be run from the command line : https://docs.microsoft.com/en-us/windows/wsl/interop#run-linux-tools-from-a-windows-command-line Which means that in this case it would only be a matter of having a I know I am making it easy when it is not, but I think it would be a great addition to LatexTools! |
I am using a simple workaround: Create a file latexmk.bat or whatever command from wsl you need and add it to Windows PATH. Then add "wsl latexmk %*" to the file. LatexTools is now working correctly but showing a warning concerning log parsing. Edit: Synctex is also working with sumatra using a script convertig from unix path to windows |
From Tools > Build System > New Build System..., adding the following + saving it as {
"cmd" : ["bash", "-c", "/usr/local/texlive/2022/bin/x86_64-linux/xelatex ${file_name}"],
"shell" : true,
"working_dir" : "${file_path}",
"selector" : "text.tex.latex"
} This worked without the need to install LaTeXTools package on Windows 10 with WSL v2. Any user styles must have the full path (e.g. my custom style |
I use WSL (Windows Subsystem for Linux) on Windows 10, and I'd prefer to avoid duplicate installs of TeXLive and ImageMagick/GhostScript (used for math previews). Unfortunately, it's currently impossible to add linux executables to Windows' PATH variable; they can only be run via
bash.exe -c "command"
(which calls into the linux environment).Are there any plans to support this configuration?
The text was updated successfully, but these errors were encountered: