TeX Live and MacTeXWhy is 'latex' command producing pdf, not dvi?

Information and discussion about TeX Live distribution for all platforms (Windows, Linux, Mac OS X) and the related MacTeX: installing, updating, configuring
Post Reply
123forman
Posts: 2
Joined: Thu Apr 02, 2009 5:28 am

Why is 'latex' command producing pdf, not dvi?

Post by 123forman »

I've recently switched from Windows to Linux (Ubuntu with Gnome), and from MikTex to TexLive. For some reason, whenever I use the LaTex button in Kile (or the 'latex' command in the terminal) it produces a .pdf instead of a .dvi.

My file is compiling just fine, into a beautiful pdf. I have kdvi and kpdf installed, so that is not an issue. But I can't seem to squeeze a .dvi out of TexLive.

Thanks in advance for any advice, I'm very confused.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Why is 'latex' command producing pdf, not dvi?

Post by localghost »

This can have more than one probable cause. On Linux system the shell command latex is mostly a symbolic link to the actual executable which is located in the texmf tree. On my openSUSE system I check the directory for the binaries. This should work on your Ubuntu system, too.

Code: Select all

thorsten@localghost:~> ls /usr/bin -l | grep latex
lrwxrwxrwx 1 root root         35  3. Mär 22:22 cslatex -> ../lib/texmf/bin/i586-linux/cslatex
lrwxrwxrwx 1 root root         35  3. Mär 22:22 delatex -> ../lib/texmf/bin/i586-linux/delatex
lrwxrwxrwx 1 root root         33  1. Mär 15:18 htlatex -> ../share/texmf/bin/noarch/htlatex
lrwxrwxrwx 1 root root         35  1. Mär 15:18 htxelatex -> ../share/texmf/bin/noarch/htxelatex
-rwxr-xr-x 1 root root       5127  8. Jul 2008  kopete_latexconvert.sh
lrwxrwxrwx 1 root root         33  3. Mär 22:22 latex -> ../lib/texmf/bin/i586-linux/latex
lrwxrwxrwx 1 root root         36  3. Mär 22:22 lualatex -> ../lib/texmf/bin/i586-linux/lualatex
lrwxrwxrwx 1 root root         35  3. Mär 22:22 mllatex -> ../lib/texmf/bin/i586-linux/mllatex
lrwxrwxrwx 1 root root         38  3. Mär 22:22 pdfcslatex -> ../lib/texmf/bin/i586-linux/pdfcslatex
lrwxrwxrwx 1 root root         36  3. Mär 22:22 pdflatex -> ../lib/texmf/bin/i586-linux/pdflatex
lrwxrwxrwx 1 root root         39  3. Mär 22:22 pdflualatex -> ../lib/texmf/bin/i586-linux/pdflualatex
-rwxr-xr-x 1 root root      10255 28. Jan 16:30 pod2latex
lrwxrwxrwx 1 root root         33  3. Mär 22:22 pslatex -> ../share/texmf/bin/noarch/pslatex
lrwxrwxrwx 1 root root         35  3. Mär 22:24 xelatex -> ../lib/texmf/bin/i586-linux/xelatex
Try this command (see first line) in a terminal on your machine and post the output here.

Another (and the more probable) reason could be that in your source code somewhere there is the pdftex driver loaded. This driver option can appear in the option list for the document class or packages like geometry, graphicx, hyperref or xcolor. If you find it somewhere, remove it because it is not necessary. These packages detect the running compiler and load the appropriate driver on their own.


Best regards and welcome to the board
Thorsten¹
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Why is 'latex' command producing pdf, not dvi?

Post by phi »

localghost wrote:This can have more than one probable cause. On Linux system the shell command latex is mostly a symbolic link to the actual executable which is located in the texmf tree.
latex, pdftex and pdflatex are all symlinked to pdftex, but this doesn't matter because pdftex sets the output format according to the command by which it was called. But pdftex.def actually does enable PDF output if called with DVI output active, but it also issues an error in this case.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Why is 'latex' command producing pdf, not dvi?

Post by localghost »

phi wrote:latex, pdftex and pdflatex are all symlinked to pdftex, but this doesn't matter because pdftex sets the output format according to the command by which it was called. But pdftex.def actually does enable PDF output if called with DVI output active, but it also issues an error in this case.
Sorry, but I'm afraid that you are only partly right. pdftex is merely the engine called with according preloaded formats (latex, pdflatex). Consider the following example.

Code: Select all

\documentclass[11pt,a4paper,english,pdftex]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{blindtext}

\begin{document}
  \Blinddocument
\end{document}
It compiles to a proper PDF output when processed with latex but only MiKTeX gives an error. TeX Live (Web2C) compiles without any complaints. See the attached log files.
Attachments
pdftex-xmpl.log.zip
The log files of two different LaTeX systems.
(5.8 KiB) Downloaded 254 times
123forman
Posts: 2
Joined: Thu Apr 02, 2009 5:28 am

Re: Why is 'latex' command producing pdf, not dvi?

Post by 123forman »

Thank you both! Thorsten, you were right, I was using \usepackage[pdftex]{hyperref}. Removing that fixed it.

- Noah
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Why is 'latex' command producing pdf, not dvi?

Post by phi »

localghost wrote:It compiles to a proper PDF output when processed with latex but only MiKTeX gives an error. TeX Live (Web2C) compiles without any complaints.
that's only caused by different versions of pdftex.def. The current version 0.04l gives this error (also in TeX Live), version 0.04k does not. Probably that change (2008/09/08) was introduced to avoid the unexpected behavior described here.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Why is 'latex' command producing pdf, not dvi?

Post by localghost »

phi wrote:[...] The current version 0.04l gives this error (also in TeX Live), version 0.04k does not. Probably that change (2008/09/08) was introduced to avoid the unexpected behavior described here.
Now that you say it I also notice that in the log files. The devil is in the detail. Thanks for this useful information.
Post Reply