How do I allow long URLs to have line breaks at any point. This is in the bibliography not the main text. I am trying to save space so don't want extra spaces to be added to make it only break at slashes, for example, as it does by default. I am using biblatex+biber.

  • 2
    do you want to allow a linebreak at any symbol/character?
    – user2478
    Jul 12, 2011 at 11:23
  • 2
    Have you already seen this question and the answers given there?
    – domwass
    Jul 12, 2011 at 11:24
  • 1
    Yes at any symbol/character. I really just want to wrap very crudely to save maximum space. I don't want it to hyphenate however as that would be confusing.
    – graffe
    Jul 12, 2011 at 12:07

1 Answer 1


Answers to the question linked in domwass's comment mention the package url. This package is already loaded by biblatex. It is configured with the command \biburlsetup defined in biblatex.def.

URLs are broken at the set of characters specified in \UrlBreaks, \UrlBigBreaks and \UrlSpecials. \UrlBigBreaks will prevent breaks from occurring between repeating characters (e.g. -- and :: in the code below). \UrlSpecials handles breaks at characters that may not be present in the document font.

Upgrading to the latest version of biblatex should solve your problem as \biburlsetup was expanded in version 1.4c to permit breakpoints at many different characters. For reference here is the definition for \biburlsetup from version 1.7:


  \Urlmuskip=0mu plus 3mu\relax
    {\def\do##1{\appto\UrlSpecials{\do##1{\mathchar`##1 \penalty\value{biburlnumpenalty}}}}%
    {\def\do##1{\appto\UrlSpecials{\do##1{\mathchar`##1 \penalty\value{biburlucpenalty}}}}%
    {\def\do##1{\appto\UrlSpecials{\do##1{\mathchar`##1 \penalty\value{biburllcpenalty}}}}%

Unlike versions 1.4c to 1.6, this new definition no longer allows breakpoints at numbers, uppercase letters and lowercase letters by default. Breaks at these characters can be permitted by setting the penalty counters to a value between 0 and 10000, exclusive. For example:


The penalties can be reset locally using the command \defcounter from the etoolbox package (also loaded by biblatex). For example:


To use this new setup with an older version of biblatex, just put the code defining \biburlsetup and its penalty counters in your preamble and replace \newcommand with \renewcommand.

  • 2
    Thanks! I somehow feel this ought to have been easier :)
    – graffe
    Jul 12, 2011 at 13:45
  • Interesting! Could you explain why you handle digits in this way? Jul 12, 2011 at 13:51
  • @Martin The \UrlSpecials appears as defined by biblatex/Philipp Lehman. I am not sure why myself. If you (or anyone else for that matter) can figure it out, please feel free to edit my answer.
    – Audrey
    Jul 12, 2011 at 14:00
  • 1
    Hm … where (and how) do I have to change these values? I tried it via \biburlsetup and at my preamble with \defcounter and \setcounter – nothing happened …
    – Tobi
    Dec 2, 2012 at 1:48
  • 1
    @Tobi The documentation is your friend. Don't modify \biburlsetup. Just add the \setcounter commands to your preamble. You can use \defcounter to reset the penalties locally. See the post I linked earlier for an example.
    – Audrey
    Dec 2, 2012 at 3:32

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.