1

I'm using MikTeX 2.9 on Windows 7, and when I want to create my pdf file I get:

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

How can I fix this?

3 Answers3

3

It sounds like you've asked the hyperref package to work in dvips-mode, but are trying to compile it through pdfTeX.

My guess would be you either:

  • Have set the option dvips in your \documentclass. An example of this would be:

    \documentclass[dvips]{article}
    
  • Have set the option dvips in your \usepackage for hyperref. An example of this would be:

    \usepackage[dvips]{hyperref}
    

If you're doing either of those two things, you're actively telling the package that you're using dvips, which you're not, so it's failing.

You should be able to resolve the problem by either:

  • Removing dvips from the options list.
  • Replacing dvips with pdftex.

If none of these options are set, try setting the pdftex option on your \usepackage{hyperref}.

  • I tried all you said and nothing worked. Keep getting the same error message. However my problem is a bit different: Here is the error message (am using texilve 2021) !Package hyperref Error: Wrong DVI driver option 'ps2pdf' because pdfTeX or LuaTeX is running in PDF mode. Any ideas? Thanks. – Herman Jaramillo Aug 05 '21 at 15:08
2

In my case, I just had to use a decent TeX Editor, as WinEdit.

I run texify to create a .dvi file and then dvi2pdf.

slhck
  • 223,558
  • 70
  • 607
  • 592
Raul
  • 21
  • 1
0

In my case the error was: hyperref error: wrong dvi mode driver option `ps2pdf'

I had to edit the file: sudo vi /usr/local/texlive/2021/texmf-dist/doc/latex/listings-ext/hyperref.cfg

The first few lines were:

\ProvidesFile{hyperref.cfg}%
  [2009/08/23 v1.0 hyperref configuration of listings-ext]
\providecommand*{\Hy@defaultdriver}{hdvips}%

\hypersetup{
  ps2pdf,                     % the documentation uses ps2pdf

I replaced "ps2pdf" by "pdftex"

That solved my problem.