How to "really" solve the problem of "underfull \hbox" when typesetting url in footnote

Rather than breaking mid-word, you can re-introduce some stretch space around the break characters (. and / here) I use

\Urlmuskip=0mu  plus 10mu

which allows more than enough flexibility in this case.

enter image description here

\documentclass{article}
\usepackage{hyperref}

\Urlmuskip=0mu  plus 10mu
\begin{document}

We use this dataset
\footnote{\url{http://archive.ics.uci.edu/ml/datasets/Parkinson+Speech+Dataset+with++Multiple+Types+of+Sound+Recordings\#}}
for experimentation.

\vfill

\noindent X\dotfill X
\end{document} 

\url tries hard to break the url only at "sensible" places. But if you don't like this you can allow \url to break everywhere:

\documentclass{article}
\usepackage{hyperref}

\makeatletter
\g@addto@macro{\UrlBreaks}{%
\do\/\do\a\do\b\do\c\do\d\do\e\do\f%
\do\g\do\h\do\i\do\j\do\k\do\l\do\m%
\do\n\do\o\do\p\do\q\do\r\do\s\do\t%
\do\u\do\v\do\w\do\x\do\y\do\z%
\do\A\do\B\do\C\do\D\do\E\do\F\do\G%
\do\H\do\I\do\J\do\K\do\L\do\M\do\N%
\do\O\do\P\do\Q\do\R\do\S\do\T\do\U%
\do\V\do\W\do\X\do\Y\do\Z}
\makeatother
\begin{document}

We use this dataset
\footnote{\url{http://archive.ics.uci.edu/ml/datasets/Parkinson+Speech+Dataset+with++Multiple+Types+of+Sound+Recordings\#}}
for experimentation.
\end{document} 

enter image description here

Be aware that as there are no stretchable spaces the line is still a bit underfull.

Tags:

Footnotes

Urls