# Why does the latex command sometimes produces PDF output?

I have noticed that on some .tex files (making use of the graphicx and hyperref packages and PDF image files), the `latex` command produces PDF files instead of the expected DVI. How and when does this happen?

In case this matters, I'm using TeXLive 2012.20120611-3~ubuntu12.04.1 on Ubuntu 12.04 (from PPA):

``````\$ latex
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)
restricted \write18 enabled.
``````
-
`latex` and `pdflatex` use the same executable (`pdftex`); you can't include PDF files when you use `latex`, nor should pass the `pdftex` option to `graphicx` or `hyperref`, which would change the output mode from DVI to PDF. –  egreg Apr 2 '13 at 11:19
Beside `\usepackage[pdftex]{graphicx}` (which should give an error message) it is also possible that a faulty "`\ifpdf`"-code in some old package sets unvoluntarly `\pdfoutput=1`. –  Ulrike Fischer Apr 2 '13 at 11:35

`pdf(la)tex` writes DVI code by default and produces PDF just if the integer register `\pdfoutput` is set non zero. So presumably you are loading a package (perhaps with a `pdftex` option) that is setting this register.