Skip to content
Advertisement

process a file remotely using ssh

I have this report.tex file which I convert to pdf as follows:

latex report.tex
dvips report.dvi -o report.ps
ps2pdfwr report.ps report.pdf

These commands are placed in a file called linux_build

This works great. However, this works on my Linux machine and most of my work I do on my Mac

I checked out MacTex which is enormous (> 4GB) so I decided to process the latex file remotely (so working on my Mac, and building on my Linux computer). Like this:

ssh latex@192.168.2.8 "cd build && ./linux_build" < report.tex
scp latex@192.168.2.8:build/report.pdf .

All this works, except for one thing:

latex report.tex

That command simply looks on disk, not for some input stream/pipe of whatever. It is at this point I’m not sure anymore how to fix this. Any suggestions ?

Advertisement

Answer

If latex supports reading from standard input then you can do it that way.

Possibly just latex or maybe latex - or possibly latex /dev/stdin to fake it as a local file.

If that doesn’t work then you need to transfer the file over first.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement