[Tex/LaTex] Long URL in Bibliography section exceeds the bounds of the page


I have an external bib where I put a reference to an external URL.

  author = {The Author},
  title = {The Title},
  howpublished = "\url{http://thisismyurl/2010/3/a-long-url-here}",
  year = {year}

When I compile, the URL (when displayed in Bibliography) exceeds the bounds of the page (set as customs). The URL is composed by different terms concatenated with - symbol. a-long-url-here can be the following:


The bib is inserted in the following manner:


Is there any mechanism to fix this behaviour? I checked Line breaking of URLs in bibliographies but I don't know how to use it in my situation.


For the sake of completeness, I use PdfLatex.

Best Answer

Assuming that you have a file named bibliog.bib with the contents given in your posting, the following MWE (minimum working example) generates a reference with the URL string broken at a hyphen. The key steps are (i) load the url package with the hyphens option and (ii) enable the breaklinks=true option of the hyperref package.

\setlength\textwidth{4in} % simulate a very narrow line width
\bibliographystyle{IEEEtran} % *not* IEEEbib...

enter image description here

Related Question