# How to fill an underfull box in footnote with url?

Could someone help to correct the warning I get related to an underfull box with the following code? I have tried \hfill, hspace*{\hfill} etc with no luck.

\documentclass[twocolumn,draft]{svjour3}
\usepackage{lmodern}
\usepackage{url}

\usepackage{breakurl}

\begin{document}

\title{Something}

Microsoft continued to gain market \footnote{\url{www.some-asd-sdsasdasd-asdas-dasdas-dasdas-asd.com}}

\end{document}


So the answer to this is to use: the following: \usepackage{ragged2e} \footnote{\RaggedRight\url{www.some-asd-sdsasdasd-asdas-dasdas-dasdas-asd.com}}

-
Man I gave up trying to fix those types of error/s a long time ago... – Nicholas Hamilton Dec 29 '12 at 20:32
Welcome to TeX.sx! Things like that require luck; it's nearly impossible to break correctly paragraphs with long URLs. Can you give a more realistic example? – egreg Dec 29 '12 at 21:10
Nope :). IMO this example expresses all I want. I have a long url in a footnote which breaks into multiple rows (in a two column class) and does not fill the box. – Alex Dec 30 '12 at 10:12
while it's possible to break a url, i think it may not be possible to get rid of the underfull box message. i worked on a project a long time ago that needed to break long words (not just urls) automatically. we got the breaks we needed (with proper hyphenation), but just learned to live with the underfull box messages. there were few enough that they could easily be checked. – barbara beeton Dec 30 '12 at 13:57

I took the following code snippet from another question:

\newcommand{\url}[1]{%
\begingroup
\ttfamily
\begingroup\lccode~=/\lowercase{\endgroup\def~}{/\discretionary{}{}{}}%
\begingroup\lccode~=.\lowercase{\endgroup\def~}{.\discretionary{}{}{}}%
\catcode/=\active\catcode.=\active
\scantokens{#1\noexpand}%
\endgroup
}

-
I commented \usepackage{url} and it doesn't do the job. – Alex Dec 30 '12 at 10:27

Inserting an \hfill before the \url, i.e. \footnote{\hfill\url{...}}, removes the warning. The only drawback of this is that it pushes the first part of the URL to the right, so that you have some extra space between the footnote number and the URL.

Another idea ist to use \footnote{\rlap{\url{...}}}. This printes the URL but ignores its width completely. The URL will stick out to the second column then, though, if it is too long.

-
Yeap. So IMO none of these are really useful! – Alex Dec 30 '12 at 10:10

use

\footnote{\sloppy\url{www.some-asd-sdsasdasd-asdas-dasdas-dasdas-asd.com}}

-
I am sorry this does not work. – Alex Dec 30 '12 at 10:08
it works for me ... – Herbert Dec 30 '12 at 10:09
Do you use \usepackage{lmodern}? because if I comment this,then yes it works...but then I have other warnings like:LaTeX Font Warning: Font shape OML/cmm/m/it' in size <4.25> not available – Alex Dec 30 '12 at 10:23
I run pdflatex without loading package breakurl which makes no sense – Herbert Dec 30 '12 at 10:33
Sorry it doesn't seem to work for me. The only thing it works is to add the following code: \usepackage{etoolbox} \apptocmd{\sloppy} {\hbadness 10000\relax}{}{} taken from [1] with \sloppy`. But should I do this in a journal. I do not think that this is acceptable.... [1]: tex.stackexchange.com/questions/10924/… – Alex Dec 30 '12 at 11:00