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
orlualatex
in PDF mode (second line of the error message), but you have specified a driverdvipdfm
, 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
andlatex/dvipdfm
, then optiondriverfallback
can be used:Then
hyperref
uses the driver forpdflatex
/lualatex
, if it detects them. Otherwisedvipdfm
is chosen.