This question is related to “Forcing linebreaks in \url
”. One of its answer is to pass the hyphens
option to the url package:
\PassOptionsToPackage{hyphens}{url}
\usepackage{hyperref}
As I have my own class file, I adapted the commands to be:
\PassOptionsToPackage{hyphens}{url}
\RequirePackage{hyperref}
However, the line \PassOptionsToPackage{hyphens}{url}
is clashing on my side and I got this error message: Option clash for package url. \let
.
Then, I tried to replace that line with \requirePackage[hyphens]{url}
, but since hyperref
already defines implicitly url
, I got the error Option clash for package url. \RequirePackage
.
I even tried the hyperref
package option breaklinks=true
but this did not help and the latter is reported to only work with slashes not dashes like I want.
Any idea? What could be the issue, where do I need to look for? I don't understand, the aforementioned command is reported to work fine by others, while on my side this is not working.
\g@addto@macro{\UrlBreaks}{\UrlOrds}
as described in this post, which can be placed anywhere and doesn't need complicated package ordering. I'm not an expert, but just another user trying to figure out the most robust way of doing this.\usepackage{hyperref}
. I have a ton of packages so I like to minimize the ordering constraints needed. I hope never to come to a day when the ordering required is not a linear order.