[Tex/LaTex] the meaning for “Package hyperref Error: Wrong DVI mode driver option “

errorspackages

I load the following packages:

\documentclass[12pt]{amsart}

\usepackage{amsfonts, amssymb, amscd}
\usepackage[dvipdfm]{hyperref}
\usepackage{verbatim}
\usepackage{eucal}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{graphicx}
\usepackage{psfrag}
\usepackage{cite}
\usepackage{upref}
\usepackage[all]{xy}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning}

Could any one can tell me why when I run the latex, it always has error:

Package hyperref Error: Wrong DVI mode driver option `dvipdfm',
(hyperref) because pdfTeX or LuaTeX is running in PDF mode.

How should I fix this problem?

(Besides, I can see the PDF file of the paper, and it seems there is no error in the file.)

Best Answer

You are running pdflatex or lualatex in PDF mode (second line of the error message), but you have specified a driver dvipdfm, which only works for DVI output (second line of the error message).

Since hyperref can detect the correct driver here (hpdftex.def), the error recovery works by ignoring the wrong driver specification.

If you want to compile the document both with pdflatex/lualatex and latex/dvipdfm, then option driverfallback can be used:

\usepackage[driverfallback=dvipdfm]{hyperref}

Then hyperref uses the driver for pdflatex/lualatex, if it detects them. Otherwise dvipdfm is chosen.

Related Question