Skip to content
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

Allow for custom LaTeX command, not just folder #64

Open
francescoboc opened this issue Jun 3, 2024 · 6 comments
Open

Allow for custom LaTeX command, not just folder #64

francescoboc opened this issue Jun 3, 2024 · 6 comments
Assignees

Comments

@francescoboc
Copy link

Hi,
I would like to tell Iguanatex to use my LaTeX installation in WSL (Windows Subsystem for Linux), but I cannot find this option. There is the option to specify a custom folder for the LaTeX installation under Windows, but that is not what I need.

Basically, instead of calling the command pdflatex, I would like it to call wsl -e pdflatex. I am confident that this would work because I am already using this approach for Texstudio for Windows:

image

Moreover, manually compiling the IguanaTex_tmp.tex with wsl -e pdflatex -output-format dvi -shell-escape -interaction=batchmode, which is the command called by Iguanatex preceeded by wsl -e, successfully produces the corresponding dvi file:

image

Thank you very much.

@Jonathan-LeRoux
Copy link
Owner

I think simply commenting out this line which adds a trailing slash to the path specified in the settings may work for your case. You would then just have to write wsl -e (with a trailing space) instead of a folder. I just tried and got the right string. Here is a version with the change.

Instead of that box being used to specify a folder, it's now used to specify more generally a "prefix". I simply warn the user that it's their responsibility to add a trailing slash or backslash (it's automatically fixed depending on the platform) if their prefix is a folder.

@francescoboc
Copy link
Author

Thank you very much for the quick response! Unfortunately, this still throws an error:

image

I suspect that the problem might be in the quotes ", as if I try to manually re-run the command without them, it compiles:

image

@Jonathan-LeRoux
Copy link
Owner

Argh, that would have been too easy. I'm trying to think about the best way to solve this. Maybe check if wsl is part of the string and if so just not add quotes...
Do you expect to use WSL also for Ghostscript and/or ImageMagick?

@Jonathan-LeRoux
Copy link
Owner

Here is a version that checks if the prefix starts with wsl and if so does not add quotes: IguanaTex_v1_61_1.zip

@francescoboc
Copy link
Author

Here is a version that checks if the prefix starts with wsl and if so does not add quotes: IguanaTex_v1_61_1.zip

Thank you, this works like a charm! Even the dvisvgm command works!

Do you expect to use WSL also for Ghostscript and/or ImageMagick?

Yes, possibly. But I'm ok just with the basic functionality that I have now.

One comment: are quotes necessary at all? Wouldn't the pdflatex command in Windows work without them?

@Jonathan-LeRoux
Copy link
Owner

Great! I think it might also work for GS and ImageMagick if you set the corresponding command in the respective settings, as long as that command starts with wsl and includes the program being executed.

Quotes are only there in case there's a space in the path name. That being said, there may be a better way to handle this, such as only adding quotes to the path part (that would be assuming there's no space in the file name... Maybe that's always true?), or letting users add their own quotes in the settings if needed. I need to make sure there are no unintended consequences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants