When I run this code, I'm getting the error:
"! LaTeX Error: Option clash for package hyperref."
Code
\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[green]{classic}
\usepackage[scale=0.8]{geometry}
\AtBeginDocument{\recomputelengths}
\firstname{Rob}
\familyname{Ward}
\mobile{mobile +64 21 0377 936}
\phone{phone +64 6 212 0549}
\email{contact@robward.co.nz}
\homepage{www.robward.co.nz}
\usepackage[pdftex,
pdfauthor={Rob Ward},
pdftitle={CV for Rob Ward},
pdfsubject={Detailed CV for Rob},
urlcolor={blue}]{hyperref}
\begin{document}
% EDUCATION
\section{Education}
\cventry{2006--2011}{PhD physics/biophysics}{Massey University}{Palmerston North}{New Zealand}{} % arguments 3 to 6 can be left empty
\cventry{1999--2004}{BSc (hons.) physics}{Victoria University}{Wellington}{New Zealand}{}
\cventry{1999--2002}{BSc mathematics}{Victoria University}{Wellington}{New Zealand}{}
\cventry{1988--1989}{NCEE}{Central Institute of Technology}{Wellington}{New Zealand}{}
\end{document}
Best Answer
Update:
moderncv
loads the packagehyperref
by itself with its ownhypersetup
. Frommoderncv.cls
,Hence, you need not load
hyperref
again. But load thehypersetup
using\AfterPreamble
(or\AtBeginDocument
) hook as in this code:The pdf properties will then look like:
Earlier attempt:
Note: Noting the comments of Heiko Oberdiek,
this is not always advisable. In this case, it won't give desired results as the
hypersetup
is over-written later by themoderncv
itself.