Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 web server)?

share|improve this question
    
Try man latex. Also texlive comes with a lot of documentation. –  Martin Schröder Oct 12 '13 at 19:37

1 Answer 1

up vote 3 down vote accepted

Yes, that command will install a basic but fully functional LaTeX environment.

You then compile a document mydoc.tex:

latex mydoc
latex mydoc

Which will produce a dvi file which you can further convert to postscript with dvips. (Or other output formats, eg png with dvipng.) In the more likely event that you want PDF output, use pdflatex instead of latex. (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.

share|improve this answer
    
Thank you so much! This worked fine, but although you said I have to run pdflatex more than once, the PDF is always there after the first run. So is running it once enough after all? –  Marco W. Oct 11 '13 at 19:07
    
@MarcoW.: Please have a look at tex.stackexchange.com –  Martin Schröder Oct 12 '13 at 19:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.