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


I load the following packages:


\usepackage{amsfonts, amssymb, amscd}

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:


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

Related Question