I'm forced to avoid the url package in a proceedings paper (!) but my bibliography includes a long URL. I already


but the URL spills over to the margin as it isn't hyphenated. I would rather not change the bibliography manually to add the hyphens (my current solution) but rather define the new \url command to put in the \- commands before dots and forward slashes. I've seen a few related questions but close enough for my TeX skills...

Also, is there a way to make the hyphenation happen without an actual hyphen?

EDIT: sorry, I should have said, that not only the url package is disallowed...but I cannot include any extra package. the packages that are included are

graphicx multicol footmisc amsmath amsfonts

So I guess this is a plainTeX question.


2 Answers 2


Without any package, your only hope is that they use a fairly recent TeX distribution:


This will allow breaks after periods and slashes.

If you have some special character in your URLs, they can be taken care of, just present some examples.

  • I noticed the following \raggedright behavior with both your answer as well as the url package; Namely, while breaks are "allowed" after slashes, it will frequently prefer to move the whole url down to the next line, in preference to breaking at a slash (if the whole url fits on a single line). Is that expected behavior? Commented Sep 29, 2014 at 19:34
  • 1
    @StevenB.Segletes Yes, with \raggedright hyphenation is essentially suppressed. Use \RaggedRight from ragged2e. A different strategy might be using {/\penalty0 } in the definition instead of {/\discretionary{}{}{}}
    – egreg
    Commented Sep 29, 2014 at 19:41

You can adapt the solution from Option to break urls with carriage-return symbol? to define \url:

enter image description here

If you prefer the use a dash at the end of the line then replace the line \discretionary{-}{}{} which yields:

enter image description here

but note that this can be confusing as it is difficult to tell if the trailing dash is part of the URL or not. This is not an issue if the link is to be clicked on with online viewing, but for printed version this may be an issue.

Alternatively, if you use \discretionary{\usebox\MyArrowBox}{}{} then you can have a special character (I used \hookleftarrow, but you can adapt this to use any other symbol) at the end of the line to indicate the continued text so that there is no confusion with a dash.

enter image description here



  %\discretionary{-}{}{}% If want a dash

  \StrLen{#1 }[\stringLength]%




You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .