I need listing package (\usepackage{listing}) to break at punctuation

           ^             ^

at either these two locations


1 Answer 1


This breaks at ::, but puts it :: in the new line.


This leaves a hyphenated :: in the old line, but the spacing is terrible.


This monster fixes the spacing:


Btw, you can also break in the middle of :: ;-)

  • For punctuation in general does that mean I will have to define them one by one?
    – aiao
    Feb 11, 2013 at 12:45
  • At least I don't know a better way. Feb 11, 2013 at 12:53

You must log in to answer this question.

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