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
.
[Tex/LaTex] URL line breaks with biblatex
biblatexline-breakingurls
Best Answer
Answers to the question linked in domwass's comment mention the package
url
. This package is already loaded bybiblatex
. It is configured with the command\biburlsetup
defined inbiblatex.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 version1.4c
to permit breakpoints at many different characters. For reference here is the definition for\biburlsetup
from version1.7
:Unlike versions
1.4c
to1.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 between0
and10000
, exclusive. For example:The penalties can be reset locally using the command
\defcounter
from theetoolbox
package (also loaded bybiblatex
). 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
.