Next: , Previous: , Up: Top   [Contents][Index]

28 Command line

Synopsis (from a terminal command line):

pdflatex options argument

Run LaTeX on argument. In place of pdflatex you can also use xelatex, or lualatex, or dviluatex, or latex.

For example, this will run LaTeX on the file thesis.tex, creating the output thesis.pdf.

pdflatex thesis

Note that .tex is the default file extension.

pdfTeX is a development of the original TeX program, as are XeTeX and LuaTeX (see TeX engines). They are completely backward compatible. But the original program had a custom output format, DVI, while the newer ones can output directly to PDF. This allows them to take advantage of the extra features in PDF such as hyperlinks, support for modern image formats such as JPG and PNG, and ubiquitous viewing programs. In short, if you run pdflatex or xelatex or lualatex then you will by default get PDF and have access to all its modern features. If you run latex, or dvilualatex, then you will get DVI. The description here assumes pdfLaTeX.

See Command line options, for a selection of the most useful command line options. As to argument, the usual case is that it does not begin with a backslash, so the system takes it to be the name of a file and it compiles that file. If argument begins with a backslash then the system will interpret it as a line of LaTeX input, which can be used for special effects (see Command line input).

If you gave no arguments or options then pdflatex prompts for input from the terminal. You can escape from this by entering <control>-D.

If LaTeX finds an error in your document then by default it stops and asks you about it. See Recovering from errors for an outline of what to do.

Unofficial LaTeX2e reference manual