URL 换行与 hyperref 冲突

URL 换行与 hyperref 冲突

我想为 URL 添加换行符,因为它超出了页边距。我已在 StackExhange 上引用了几篇文章,但仍然没有成功。以下代码的错误显示 !LaTeX 错误:包 hyperref 的选项冲突。

任何能帮助解决此问题的帮助都将不胜感激。

\documentclass[11pt, a4paper]{article}
\usepackage{geometry}
\usepackage[inner=1.5cm,outer=1.5cm,top=2.5cm,bottom=2.5cm]{geometry}
\pagestyle{empty}
\usepackage{graphicx}
\PassOptionsToPackage{hyphens}{url}
\usepackage{hyperref}
\usepackage{url}


\usepackage{fancyhdr, lastpage, bbding, pmboxdraw}
\usepackage[usenames,dvipsnames]{color}
\definecolor{darkblue}{rgb}{0,0,.6}
\definecolor{darkred}{rgb}{.7,0,0}
\definecolor{darkgreen}{rgb}{0,.6,0}
\definecolor{red}{rgb}{.98,0,0}
\usepackage[colorlinks,pagebackref,pdfusetitle,urlcolor=darkblue,citecolor=darkblue,linkcolor=darkred,bookmarksnumbered,plainpages=false]{hyperref}
%\renewcommand{\thefootnote}{\fnsymbol{footnote}}



\pagestyle{fancyplain}
\fancyhf{}
\lhead{ \fancyplain{}{Course Name} }
%\chead{ \fancyplain{}{} }
\rhead{ \fancyplain{}{\today} }
%\rfoot{\fancyplain{}{page \thepage\ of \pageref{LastPage}}}
\fancyfoot[RO, LE] {page \thepage\ of \pageref{LastPage} }
\thispagestyle{plain}



%%%%%%%%%%%% LISTING %%%
\usepackage{listings}
\usepackage{caption}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}
\usepackage{verbatim} % used to display code
\usepackage{fancyvrb}
\usepackage{acronym}
\usepackage{amsthm}
\VerbatimFootnotes % Required, otherwise verbatim does not work in footnotes!



\definecolor{OliveGreen}{cmyk}{0.64,0,0.95,0.40}
\definecolor{CadetBlue}{cmyk}{0.62,0.57,0.23,0}
\definecolor{lightlightgray}{gray}{0.93}



\lstset{
%language=bash,                          % Code langugage
basicstyle=\ttfamily,                   % Code font, Examples: \footnotesize, \ttfamily
keywordstyle=\color{OliveGreen},        % Keywords font ('*' = uppercase)
commentstyle=\color{gray},              % Comments font
numbers=left,                           % Line nums position
numberstyle=\tiny,                      % Line-numbers fonts
stepnumber=1,                           % Step between two line-numbers
numbersep=5pt,                          % How far are line-numbers from code
backgroundcolor=\color{lightlightgray}, % Choose background color
frame=none,                             % A frame around the code
tabsize=2,                              % Default tab size
captionpos=t,                           % Caption-position = bottom
breaklines=true,                        % Automatic line breaking?
breakatwhitespace=false,                % Automatic breaks only at whitespace?
showspaces=false,                       % Dont make spaces visible
showtabs=false,                         % Dont make tabls visible
columns=flexible,                       % Column format
morekeywords={__global__, __device__},  % CUDA specific keywords
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{center}
{\Large \textsc{Modeling and Evaluation}}
\end{center}
\begin{center}
Fall 2014
\end{center}
%\date{September 26, 2014}

\begin{center}
\rule{6in}{0.4pt}
\begin{minipage}[t]{.75\textwidth}
\begin{tabular}{llcccll}
\textbf{Instructor:} & Arman Shokrollahi & & &  & \textbf{Time:} & F 14:00 -- 17:00 \\
\textbf{Email:} &  \href{mailto:[email protected]}{[email protected]} & & & & \textbf{Place:} & 107 Engineering Bldg.
\end{tabular}
\end{minipage}
\rule{6in}{0.4pt}
\end{center}
\vspace{.5cm}
\setlength{\unitlength}{1in}
\renewcommand{\arraystretch}{2}

\noindent\textbf{Main References:}
\begin{enumerate}
\item Kenneth H. Rosen, \textit{Elementary Number Theory and Its Applications}, 6th Edition (2010), Pearson.
\url{https://www.math.upenn.edu/~kazdan/210S19/Notes/crypto/Rosen-Number-Theory-6ed.pdf}
\item David Burton, \textit{Elementary Number Theory}, 7th Edition (2010), McGraw-Hill Education
\url{https://cdchester.co.uk/wp-content/uploads/2018/02/david-m-burton-elementary-number-theory-mcgraw-hill-education-2010.pdf}
\end{enumerate}

\vskip.15in
\noindent\textbf{Office Hours:} After class, or by appointment, or post your questions in the forum provided for this purpose on AeLP.


\end{itemize}

相关内容