- Pass
hypensto theurlpackage that is referenced in thehyperrefpackage, e.g.,
PassOptionsToPackage{hyphens}{url}\usepackage{hyperref} -
However, the above would not work when the long URL has hyphens to avoid confusion by design. To break a long URL that has hyphens, we can use
\usepackage[hyphenbreaks]{breakurl}
-
In the above, LaTeX works hard and attempts to break the long URL at some location. If the location is not to our liking, we add the
\sloppycommand right before the reference to an URL, e.g.,
\sloppy \url{a-very-long-and-awkward-URL-with-many-hyphens}
Great discussions, folks. Thanks.