szhorvat / MaTeX

LaTeX labels in Mathematica
http://szhorvat.net/mathematica/MaTeX
MIT License
375 stars 45 forks source link

How to use MaTeX in WSL #31

Open ghost opened 5 years ago

ghost commented 5 years ago

I have a Windows machine, which don't have LaTeX installed, but I have install TeX in windows subsystem in Linux, so how to config MaTeX to use LaTeX installed in WSL?

szhorvat commented 5 years ago

I don't know if this is possible. Currently I do not have access to a Windows system with WSL.

MaTeX uses RunProcess[] under the hood, so the question is whether RunProcess can interact with WSL. If you can figure this out, let me know, and we'll see what can be done.

P.S. This month I'm away and generally slow to respond.

On Fri, 22 Nov 2019, 12:27 Yuqiang Zheng, notifications@github.com wrote:

I have a Windows machine, which don't have LaTeX installed, but I have install TeX in windows subsystem in Linux, so how to config MaTeX to use LaTeX installed in WSL?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/szhorvat/MaTeX/issues/31?email_source=notifications&email_token=AAJIDR5HIAAGWROQNQXQQQLQU5NRZA5CNFSM4JQLSEK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3JCR2Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJIDRYZLQ7JZYBWGDRWQGLQU5NRZANCNFSM4JQLSEKQ .

ghost commented 5 years ago

Ok, maybe replace it with RunProcess[{"wsl","pdflatex"}, args___] etc.(a way to call wsl function in windows) will work.

szhorvat commented 5 years ago

Thanks for the hint. I'll look into it when I'm back home in a couple of weeks.

On Sat, 23 Nov 2019, 18:32 Yuqiang Zheng, notifications@github.com wrote:

Ok, maybe replace it with RunProcess[{"wsl","pdflatex"}, args___] etc.(a way to call wsl function in windows) will work.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/szhorvat/MaTeX/issues/31?email_source=notifications&email_token=AAJIDR6MCR4SVJXXB5XGWGTQVEBFXA5CNFSM4JQLSEK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE7SJUA#issuecomment-557786320, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJIDR4HXHN7UYZRGGALRGLQVEBFXANCNFSM4JQLSEKQ .

szhorvat commented 4 years ago

I looked into this briefly. While this is certainly a reasonable request, it does not seem to be trivial to implement in a robust way. Things to consider:

Ideally, the entire WSL interface would be wrapped into a script, and this script could be used instead of pdflatex. The problem is that RunProcess won't run a script or a .cmd file. It requires an executable. As a workaround it may be possible to convert a batch file to an executable, but I have not tried this.

For the moment I'll have to put this aside because of lack of time.