BibTeX does linebreaking on the .bbl files it write outs. How do I turn that off, or adjust it? It is breaking lines inside long URLs with spaces in the bibliography, causing them to stop working.
Here’s is a MWE.
\documentclass{article}
\usepackage[spaces,obeyspaces]{url}
\usepackage{hyperref}
\usepackage{filecontents}
\begin{document}
\begin{filecontents}{foo.bst}
ENTRY {
url
}
{}
{}
FUNCTION {misc}
{
"\url{" url "}" * * write$ newline$
"\par" write$ newline$
}
READ
ITERATE {call.type$}
\end{filecontents}
\begin{filecontents}{foo.bib}
@misc{key1,
url = "http://example.com"
}
@misc{key2,
url = "http://example.com/this is a long url that contains more spaces than BibTeX can handle"
}
\end{filecontents}
\nocite{*}
\section{Bibliography}
\bibliographystyle{foo}
\bibliography{foo}
\end{document}
Clicking the first link opens a browser, but the second does not.
Here is a line-numbered version of the .bbl file it spits out:
1 \url{http://example.com}
2 \par
3 \url{http://example.com/this is a long url that contains more spaces than
4 BibTeX can handle}
5 \par
btxhak.pdf claims that “write$ does reasonable line breaking” …

%20– David Carlisle Aug 11 '12 at 22:12