Possible Duplicate:
Line break in lines with colons

I have Perl package name defined as command:


How can I tell LaTeX to hyphen package name after double colon but without any hyphen char eg.


should be


marked as duplicate by Loop Space, Hendrik Vogt, Caramdir, lockstep, Martin Scharrer Mar 22 '11 at 22:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Maybe your question is answered here: Line break in lines with colons. (Possible duplicate?) – Hendrik Vogt Mar 22 '11 at 13:59
  • Yes, the main point of both questions is the same, but that question is more general - that's why I probably can't find it. – jesper Mar 22 '11 at 14:07
  • @jesper: So do the answers to that question answer yours? – Loop Space Mar 22 '11 at 14:09
  • Yes, but not as straight as this answers. I think this topic shouldn't be delete If you ask about this. – jesper Mar 22 '11 at 14:17
  • @Andrew: So what do you think? – Hendrik Vogt Mar 22 '11 at 14:28

I usually define a command \dbr for discretionary breakpoints like this: \newcommand\dbr{\disretionary{}{}{}}. Then you can write XXXX::\dbr YYYY::\dbr ZZZZ, which should have the effect you desire.

To explain, \discretionary<arg1><arg2><arg3> tells TeX that a line break is permissible and that it should put <arg1> before the breakpoint, <arg2> after the breakpoint (in the next line), and <arg3> in the case that no line break is performed. See the TeXbook (page 95) for more details.

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