LaTeX 错误:包 hyperref 的选项冲突

emo*_*ssi 4 latex pdflatex overleaf

\documentclass[11pt,a4paper,sans]{moderncv} 
\moderncvstyle{banking} 
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}

\usepackage{graphicx}
\usepackage{float}

\usepackage{import}

% links Symbol
\usepackage{bbding,pifont}

\usepackage[hidelinks]{hyperref}

% Redefinition:
\let\orighref\href
\newcommand{\hrefa}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{...code}{#1}}
\newcommand{\hrefb}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{xxx/}{#1}}
\newcommand{\hrefc}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{ccc}{#1}}
\newcommand{\hrefd}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{vvv/}{#1}}
\newcommand{\hrefe}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{vvv}{#1}}
\newcommand{\hreff}[1]{\raisebox{-0.4ex}{\HandRight}\,\orighref{vvv}{#1}}
% end links symbol

% personal data
\name{...}
\title{}                               
\address{..}{}{}
\phone[mobile]{+...4}
\email{xxx@a.com} 
\extrainfo{\hrefd{xc.com}}    
%\photo[64pt][0.4pt]{photo.jpg} 


%----------------------------------------------------------------------------------
%            content
%----------------------------------------------------------------------------------
\begin{document}
Run Code Online (Sandbox Code Playgroud)

错误:

LaTeX Error: Option clash for package hyperref.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.40 \begin{document}
                     
The package hyperref has already been loaded with options:
  [hidelinks]
There has now been an attempt to load it with options
  [unicode]
Adding the global options:
  hidelinks,unicode
to your \documentclass declaration may fix this.
Try typing  <return>  to proceed.
Run Code Online (Sandbox Code Playgroud)

当我尝试转换为 pdf 时,我得到一个空的 html 文件。

sam*_*ter 7

该类moderncv自动加载hyperref包。您可以使用它\PassOptionsToPackage{hidelinks}{hyperref}来确保它加载了您想要的选项。

(尽管你的hidelinks选择不会产生很大的影响,因为moderncv将链接框的线宽设置为零,所以它们已经不可见)

\PassOptionsToPackage{hidelinks}{hyperref}

\documentclass[11pt,a4paper,sans]{moderncv} 
\moderncvstyle{banking} 
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}

\usepackage{graphicx}
\usepackage{float}

\usepackage{import}

% links Symbol
\usepackage{bbding,pifont}

% personal data
\name{...}
\title{}                               
\address{..}{}{}
\phone[mobile]{+...4}
\email{xxx@a.com} 
%\extrainfo{\hrefd{xc.com}}    
%\photo[64pt][0.4pt]{photo.jpg} 


%----------------------------------------------------------------------------------
%            content
%----------------------------------------------------------------------------------
\begin{document}
test

\url{stackoverflow.com}

\end{document}
Run Code Online (Sandbox Code Playgroud)