TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


\usepackage[breaklinks]{hyperref} %make hyperlinks references
    \hypersetup{colorlinks=true,linkcolor=blue,          % color of internal links



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


So the answer to this is to use: the following: \usepackage{ragged2e}

Credits to How can I make my text never go over the right margin by always hyphenating or breaking on word-boundaries?

share|improve this question
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:

share|improve this answer
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.

share|improve this answer
Yeap. So IMO none of these are really useful! – Alex Dec 30 '12 at 10:10


share|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.