# Biblatex: URL-breaking not working in DVI-mode

I'm preparing my bibliography and noticed that biblatex-printbibliography produces Overfull \hbox several times.

Examples (gray lines indicates text margins, red line is the physical page margin):

Why is hyperref line-breaking not working as expected using pdflatex or even latex -> dvipdfm BUT not using latex -> dvips -> ps2pdf?

Also it would be great if someone could point out how I can raise the indentation of the second (and following) lines, as this might look better.

edit: Customized question, as the answer given by lockstep solved the third problem. The second problem seems to be identical to the first.

\documentclass[12pt]{scrbook}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ps2pdf]{hyperref}
%\usepackage{breakurl} %That makes no difference either.

\usepackage[a4paper,twoside,showframe]{geometry} %show text margins

\usepackage[style=alphabetic,backend=biber,maxnames=4,minnames=3,maxbibnames=99]{biblatex}
\bibliography{biblatex-issue}

\begin{document}
\nocite{*}

\end{document}


And the bib-file:

@online{GLS:datasheet,
title         = "GLS Datasheet",
organization  = "Optoelectronics Research Centre",
howpublished ="Website",
date = "2004-09",
urldate="2013-07-01",
url ="http://www.southampton.XXXX",
}
@book {Lifante:Fundamentals,
title = "Integrated Photonics: Fundamentals",
author = "Lifante, Ginés",
publisher = "J.Wiley",
year = "2003",
type = "text",
isbn = "9780470848685"
}
author = {Labadie, L. and Mart\'{\i}n, G. and Anheier, N. C. and Arezki, B. and Qiao, H. A. and Bernacki, B. and Kern, P.},
title = {First fringes with an integrated-optics beam combiner at 10},
DOI= "10.1051/0004-6361/201116727",
journal = {A\&A},
year = 2011,
volume = 531,
pages = "A48"
}


P.S.: I noticed that the visiting-date of the GLS-datasheet is wrong ;-)

• It would be great if you could provide a complete MWE. – mafp Apr 8 '13 at 10:15
• I removed the boxes tag because it isn't used for questions about "bad" linebreaks. – lockstep Apr 8 '13 at 10:15
• I haven't put that flag in..hmm... Added MWE. Problem for the URL disappeared somehow, don't know why. – MrD Apr 8 '13 at 10:27
• Rather than adding links, please include the .tex and .bib files directly in the question (as code samples). – lockstep Apr 8 '13 at 10:32
• The first and the second problem can be avoided when removing hyperref (that is not a good solution). Although the third problem (Wiley leaking out of the margin) still remains. – MrD Apr 8 '13 at 10:39

I will answer to my own question as I finally found a solution, that might be of interest to all the ones having problems with displaying long URLs in LaTeX and also to show you the effect: I had a little chat with Vilar (the maintainer of the breakurl-package) and he was able to extend the breaking possibilities of his package they way I suggested.

Therefore the new option anythingbreaks in the newest version does the links look good as they keep in range of the textborder.

See for yourself:

Completely without:

Standard behavior:

Anythingbreaks:

@lockstep: Thanks for your solution regarding the third problem. Really have missed the ~.

The first and second problem could be solved by removing the ps2pdf package option and running your example in PDF mode (see my picture) -- but that may not be an option for you. With regard to the third problem, an unbreakable space is missing in J.Wiley -- with J.~Wiley, a hyphen will be added after the i and the line break becomes acceptable.

\documentclass[12pt]{scrbook}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}

\usepackage[a4paper,twoside,showframe]{geometry}

\usepackage[style=alphabetic,backend=biber,maxnames=4,minnames=3,maxbibnames=99]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@online{GLS:datasheet,
title         = "GLS Datasheet",
organization  = "Optoelectronics Research Centre",
howpublished ="Website",
date = "2004-09",
urldate="2013-07-01",
url ="http://www.southampton.XXXX",
}
@book {Lifante:Fundamentals,
title = "Integrated Photonics: Fundamentals",
author = "Lifante, Ginés",
publisher = "J.~Wiley",
year = "2003",
type = "text",
isbn = "9780470848685"
}
author = {Labadie, L. and Mart\'{\i}n, G. and Anheier, N. C. and Arezki, B. and Qiao, H. A. and Bernacki, B. and Kern, P.},
title = {First fringes with an integrated-optics beam combiner at 10},
DOI= "10.1051/0004-6361/201116727",
journal = {A\&A},
year = 2011,
volume = 531,
pages = "A48"
}
\end{filecontents}

\nocite{*}

\begin{document}

\end{document}


An alternative is to allow for some "emergency" extra space:

\appto{\bibsetup}{\emergencystretch=1em}


• The unbreakable space helped solving the third problem, just like you mentioned, but removing the [ps2pdf] changed nothing (so 1st still remains). I can't use pdflatex, as I am heavily operating with pstricks and pdflatex makes that very hard. So I'm always going latex -> dvips -> ps2pdf (of course sometimes I'm using biber after latex). – MrD Apr 8 '13 at 11:01
• @DL6ER In that case, have a look at tex.stackexchange.com/questions/20768/… – lockstep Apr 8 '13 at 11:05
• Already seen that, but neither using \usepackage[breaklinks=true]{hyperref} nor adding \usepackage{breakurl} after hyperref solves the first problem. – MrD Apr 8 '13 at 11:09
• @DL6ER Too bad. As I know next to nothing about DVI mode, I suggest you update your question, specifically pointing out the issue my answer didn't solve. That way (and by adding the dvips tag), it is more likely to attract a suitable expert. – lockstep Apr 8 '13 at 11:12
• Really strange: latex + dvipdfm is working as expected, while latex -> dvips -> ps2pdf fails. Hope someone can tell how to fix this. – MrD Apr 8 '13 at 11:29