On an Ubuntu 10 server (yes, not the latest version anymore), I would like to run LaTeX so that I can invoke the program via command line and pass .tex files to compile. Is this possible?
TeX Live would be one of the distributions that you can choose, right?
I can just install it with the following command, can't I?
sudo apt-get install texlive
And then? How can I invoke TeX Live via command line, without a GUI (as this is on a remote server)?
Yes, that command will install a basic but fully functional
LaTeX
environment.You then compile a document
mydoc.tex
:Which will produce a
dvi
file which you can further convert to postscript withdvips
. (Or other output formats, egpng
withdvipng
.) In the more likely event that you want PDF output, usepdflatex
instead oflatex
. (I assume this is available in 10.04, I don't have a copy on hand to check).If you are running on a server, you might want the option
-interaction=nonstopmode
, otherwise it will pause and wait for your input if it finds an error in the document.It is necessary to run
latex
/pdflatex
more than once since during the first pass it will produce various auxiliary files which it then uses to improve the layout the next time around.More detailed questions about latex are probably best asked on the appropriate stackexchange.