2

I have a footnote with a long url containing an underscore, like this:

\footnote{\url{http://www.example.com/somethinglong_somethingotherlong}}

The link appears in the pdf, but it is broken off after the underscore and redirects to http://www.example.com/somethinglong_, which of course gives a page not found error.

How do I solve this? Adding a \ before the underscore doesn't do anything (the backslash just shows up in the pdf). It seems that the same problem was encountered here

URL linebreak in footnote

but I see no answer here as well.

EDIT: I can't use hyperref. Added MWE below.

\documentclass{article}
\usepackage{ismir,amsmath,cite,url}
\usepackage{graphicx}
\usepackage{color}
\usepackage[capitalise]{cleveref}
\usepackage{array}
\usepackage{alltt}
\usepackage{fixltx2e}

\begin{document}

Some text with a footnote.\footnote{\url{https://en.wikipedia.org/wiki/Hidden_Markov_model}}

\end{document}
rdv
  • 297
  • 5
    Please provide a full minimal example? Are you using hyperref or not? If not then it is a previewer problem, where the previewer is trying to interpret the contents of the PDF and attempts to parse the URL and perhaps not doing a good job. In any case it helps if you provide a full minimal example that others can copy and test as is. – daleif Jun 18 '18 at 11:56
  • 1
    Also it would be useful to have an actual working URL, so that we know when it's not working... – Phelype Oleinik Jun 18 '18 at 12:00
  • 1
    @rdv - I've posted a new answer to the query URL linebreak in footnote, to mention the use of "defined URLs" for URL strings that occur in the arguments of \footnote and similar directives. (\thanks is such a directive.) – Mico Jun 18 '18 at 13:50
  • 1
  • What is ismir package? 2. Without hyperref the issue you see was explained by @daleif hours ago: there is no hyperlink in the PDF, and it is entirely up to the PDF viewer to detect it. I can reproduce your issue by shifting the \url so that it breaks at the underscore.
  • –  Jun 18 '18 at 17:01
  • @jfbu The ismir package is the styleguide that we have to follow. It's not relevant, sorry. I was actually avoiding to use hyperref - I don't want these ugly boxes around the references... – rdv Jun 18 '18 at 17:34
  • 2
    Are you aware of the hidelinks option for hyperref? – Teepeemm Jun 18 '18 at 17:49
  • @rdv these ugly boxes do not show in the printed on paper PDF, and you can always customize their presence on screen. RTFM. –  Jun 18 '18 at 19:03