MaTeX icon indicating copy to clipboard operation
MaTeX copied to clipboard

How to use MaTeX in WSL

Open ghost opened this issue 5 years ago • 4 comments

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?

ghost avatar Nov 22 '19 04:11 ghost

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, [email protected] 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 .

szhorvat avatar Nov 23 '19 09:11 szhorvat

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

ghost avatar Nov 23 '19 10:11 ghost

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, [email protected] 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 avatar Nov 23 '19 10:11 szhorvat

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:

  • There may be more than one Linux environment. There should be a way to select which one to use.
  • Paths need to be converted. wslpath can do this.

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.

szhorvat avatar Dec 05 '19 14:12 szhorvat