we're working on a technical document with some special requirement identifier, which use a dot-notation. For example:


As you might expect we get a lot of overfull box messages and theses "words" get not split by the hyphenation mechanism.

So I'm looking for another solution. Is there a way defining a discretionary-rule or something else to get these words wrapped? We don't want to use something like \url. The user experience should be smooth as possible.

Thx, aronadaal

This question is a follow up to Replacing # for use inside \label

  • 1
    why not \url don't you have some command already wrapping these identifiers for font change at least, or do you just use the text font with no markup? (I posted an answer suggesting \url then noticed you said not that, so it is deleted, but it seems like the right answer to me:-) Jan 20, 2016 at 14:45
  • you have tagged this luatex, although you do not mention that in the text, does that mean a lua-only solution is acceptable? Jan 20, 2016 at 14:47
  • in your linked example all such words appear inside \req so why not just define \req using url package so that it breaks at the . ? Jan 20, 2016 at 15:33

1 Answer 1


use the url package and


and it will allow breaking at .

You could define a command with a different name if needed, see the url package documentation.

Adding this to your example from the linked question, and setting up @ as a safer way to input # gives

enter image description here




  type=requirement, %
  types=requirements, %
  name=Anforderung, %
  listname={List of Requirements} %

\req{MY.REQ.ID.42}{Lorem ipsum dolor sit amet,...}

\req{MY.REQ.ID.43@BROKEN}{this requirement is broken,...}

xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx 
xxx xxx xxx xxx xxx 
Please have a look at \ref{req:MY.REQ.ID.42} on page~\pageref{req:MY.REQ.ID.42}

x x x x x x x x x x x x x x x x x x x x x x
x x x x x x x x x x x
Please have a look at \ref{req:MY.REQ.ID.43@BROKEN} on page~\pageref{req:MY.REQ.ID.42}



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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