0

Preface: I am not good with Latex. Nor do I know the proper formatting for this type of inquiry.

Someone has sent me some source code, and I am getting this error when I try to create the PDF:

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

See the hyperref package documentation for explanation.
Type  H <return>  for immediate help.
...                                              

l.4393 \ProcessKeyvalOptions{Hyp}

Here is part of the preamble:

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\renewcommand{\rmdefault}{ptm}
\usepackage[scaled=0.92]{helvet}
\usepackage[psamsfonts]{amsfonts}
\usepackage{amsmath, amsbsy, upref, wtrench}
\usepackage[dvips, bookmarks, colorlinks=true, plainpages = false,
  citecolor = blue, urlcolor = blue, filecolor =
blue]{hyperref}
\setcounter{secnumdepth}{2}
\numberwithin{equation}{section}
\numberwithin{exercise}{section}
\numberwithin{example}{section}
\numberwithin{theorem}{section}
\numberwithin{figure}{section}
\setcounter{chapter}{1}
\input seteps
Paul Stanley
  • 18,151
Nights
  • 13
  • 1
    You are probably meant to run the code in dvi-mode. But that option is obsolete for many years. The other stuff is also a bit outdated. – Johannes_B May 07 '20 at 03:25

1 Answers1

1

As Johannes_B notes in his comment, the error message comes because you are compiling with pdfTeX.

The preamble has indications that this is probably an old document. The old way of compiling LaTeX was to run latex (not pdflatex) to produce a dvi (device independent) file, which was then further processed to produce a pdf if that is what you wanted.

Although that's not often done nowadays, you can still do it! Run latex (not pdflatex) which will produce a file ending .dvi, then dvips on that file (producing a file called .ps, then ps2pdf, or run latex then dvipdfm. My preference was usually for the longer route.

The alternative is to try to re-edit the file you have to be processable by pdflatex, for instance by removing the particular option to hyperref which is telling it to us dvips. However, if it's an old document there are probably other ways it expects the dvips method, and you may well find it easier to go that way. Whether you get other errors caused by the use of archaic syntax it's not possible to say, though most long-standing packages do try to preserve backward compatibility, so you may be OK.

Paul Stanley
  • 18,151
  • Paul, any specific instructions for this in TexWorks? I really don't know what any of this means. – Nights May 11 '20 at 21:37
  • I don't use it but this looks as if it might help: https://tex.stackexchange.com/questions/85417/configuring-texworks-processing-tools – Paul Stanley May 11 '20 at 22:02