Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • Works great, thanks! Only problem is now I get an "Underfull \hbox (badness 10000)" complaint for every URL that needs more than one line. Harmless, but kinda irritating ... any idea why? Commented Mar 2, 2011 at 3:56
  • @Zack: I provided a better solution that should solve that problem as well as deal with hyperref and % in the url. I think I got the spacing right, but I'm not completely sure. Commented Mar 2, 2011 at 4:46
  • Wow, this is bizarre. With your revision, instead of underfulls I get over fulls. Overfull by precisely 18.32794pt each time. It is as if \linewidth is too large, but I checked my class file's definition of thebibliography and it seems to be doing that correctly. (Also I had to put the catcode of % back to 14 to cope with BibTeX's habit of breaking very long lines with %-newline; I don't need URL %-encoding, fortunately.) Commented Mar 2, 2011 at 5:31
  • ... now I'm even more confused. I set \@tempdima to \linewidth minus 18.32794pt (at the beginning of \url@aux), replaced every instance of \linewidth in your code with \@tempdima, and wrapped the \vbox in a \hbox to\@tempdima ... and the overfull hboxes are now exactly twice as overfull as they used to be. Commented Mar 2, 2011 at 5:37
  • 1
    I've used the \hskip solution to get DOIs and arXiv IDs onto a separate line, but in some situations two skips end up on the same line and the glue is divided equally among them. I found that \hfil\penalty0\hfilneg inserts the glue only where it is needed and is a tad more elegant IMHO. Commented Jan 9, 2018 at 18:45