10

I'm having this Error when I try to compile my .tex file with xelatex:

! Package hyperref Error: Wrong DVI mode driver option `dvips',
(hyperref)                because XeTeX is running.

See the hyperref package documentation for explanation.

This is my LaTeX header

\documentclass[10pt, a4paper, dvips,]{moderncv}

\moderncvtheme[grey, roman]{classic}

\usepackage{ifxetex}
\ifxetex % only for xelatex
\usepackage{xltxtra} % this should load both fontspec & xunicode
\usepackage{fontspec}
\setromanfont{Helvetica Neue}
\else %
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\fi % \ifxetex

Any ideas?

EDIT:

I removed the 'dvips', now I get:

! Package hyperref Error: Wrong driver option `pdftex',
(hyperref)                because pdfTeX in PDF mode is not detected.

See the hyperref package documentation for explanation.

Now my first latex line

\documentclass[10pt, a4paper]{moderncv}

Any clues ?

  • 3
    Why "Warning"? It is clearly labeled as Error. – Martin Scharrer Jan 3 '12 at 14:29
14

Don't use the dvips option for the class (and any package). It will be passed to every package, like all class options, and tell these that they should use the DVIPS mode or driver. You however use apparently XeLaTeX which uses a different driver.

You should not explicitly state the driver in any case. The packages should nowadays be able to determine the correct driver themselves and stating a wrong one manually leads to exactly this kind of errors.

  • Except for dvipdfmx which cannot be auto-detected. – AlexG Jan 3 '12 at 15:03
  • I removed dvips from my options, but it's not working for another reason, I edited my post :) – Mr.Gando Jan 3 '12 at 15:22
  • 2
    @Mr.Gando: Your new error would actually be a new problem and which should be asked as a new question instead of changing the existing one. But the answer here is simple enough: Older versions of modernsv used the pdftex driver explicitly, making it incompatible with XeLaTeX. Simply update your version to the newest one. – Martin Scharrer Jan 3 '12 at 15:41
  • How is doipd remove from LexStudio? – Jose Enrique Calderon Apr 10 at 22:40
3

I have this version:

moderncv.cls    2011/12/23 v0.15.1 modern curriculum vitae document class

and do not get a problem with the driver.

  • Apologies for being contrary, but is this really an answer? It seems more like a comment. – qubyte Jan 3 '12 at 15:58
  • fwiw, the latest version is 2013/04/29 v1.5.1, which is also present in tex live. – wasteofspace Aug 21 '13 at 10:00
0

I also came across the same trouble, for I use XeLaTeX. The original .cls says: if dvips fails , turns to dvipdfm. So I would add a third option, when dvipdfm also fails , it turns to xetex.

\ifTWXJZ@dvips   \TWXJZ@dvipsfalse
    \DeclareOption{dvips}{\TWXJZ@dvipstrue} \DeclareOption{dvipdfm}
{\TWXJZ@dvipsfalse}
    \DeclareOption{xetex}{\TWXJZ@dvipsfalse} % I added this sentence

Below is my offer of the third option:

\ifpdf   % We're running pdfTeX in PDF mode
  \RequirePackage[pdftex]{hyperref}
\else    % We're not running pdfTeX, or running pdfTeX in DVI mode
  \ifTWXJZ@dvips
     \RequirePackage[dvips]{hyperref}
  \else
    %\RequirePackage[dvipdfm]{hyperref}    % this is the original description, which I'd prefer to modify as below:
     \if\RequirePackage[dvipdfm]{hyperref} % I added
     \else                                 % I added
        \RequirePackage[xetex]{hyperref}   % I added

Thank God, the problem is fixed!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.