# What commandline parameter to get pdf

I start latex via the commandline with `latex filename`. What do I have to do to get a pdf instead of a dvi?

-

`pdflatex filename`

-

If you have to pass a switch for some strange reason, `latex -fmt pdflatex filename` should do the same thing as `pdflatex filename`.

-

In addition, there's also `latex -output-format pdf` and `latex &pdflatex file.tex`, where the ampersand might need escaping according to your shell, or having %&pdflatex as the first line of your input file. OK, did we get them all?

-
 +1 tradition: I haven't seen `&format` in a while. This has to occur after all switches. – Charles Stewart Nov 30 '10 at 18:14 How about `latex '\pdfoutput=1 \input file'`? – Lev Bishop Nov 30 '10 at 19:35 @Lev Bishop: good one. – Ulrich Schwarz Nov 30 '10 at 19:52

You can also run `latex file.tex` and then do a `dvipdf file.dvi` on the resulting dvi file.

-