9

I have long URLs in my references and I want to submit my paper to arxiv.org.

They use TexLive 2016.

I tried to follow advice at

Line breaks of long URLs in biblatex bibliography?

URLs in bibliography: LaTeX not breaking line as expected

to no avail. Interestingly, arxiv.org expects .bbl file, not the .bib file.

I tried to manually insert '\-' hyphenation into the .bbl file but that didn't work.

How can I break long URLs on arxiv.org?

6
  • Did you try with package xurl?
    – Bernard
    Aug 17, 2020 at 13:37
  • 1
    Upon your advice I did but it didn't work.
    – Gergely
    Aug 17, 2020 at 13:50
  • Even with a more recent distribution?
    – Bernard
    Aug 17, 2020 at 13:52
  • 1
    I have no jurisdiction over Arxiv's installed TeXLive 2016 distribution. My question is specific to that, they expect me to submit my paper in source form.
    – Gergely
    Aug 17, 2020 at 13:54
  • Could you post a minimal (yet complete) code reproducing the problem?
    – Bernard
    Aug 17, 2020 at 13:56

3 Answers 3

9

At last

\usepackage[hyphens]{url}
\usepackage{hyperref}
\usepackage[hyphenbreaks]{breakurl}

did the trick.

2
  • I didn't need the first line, which gave me an error. Feb 8, 2023 at 5:29
  • \usepackage[hyphens]{url} produced an 'option clash' error for me. The other answer below worked, though. May 9, 2023 at 12:27
4

After a lot of experimenting I found that the following works:

\usepackage{biblatex}
\usepackage{hyperref}
\usepackage{xurl}
\hypersetup{breaklinks=true}

Packages must be in this order. The biblatex might not be necessary, but I suppose you are using it anyway.


The problem seems to come up from here and Overleaf has a relevant lemma. Although these links might provide little insight as to why links can't break on arXiv, the reason has to do with how their HyperTeX is setup to work.

2
  • This also worked for me on arXiv, thanks. May 9, 2023 at 12:26
  • this is the one that finally worked for me, thank you!
    – Tim
    Aug 18, 2023 at 15:38
1

Same answer as Gergely's but without the hyphen option for url

\usepackage{url}
\usepackage{hyperref}
\usepackage[hyphenbreaks]{breakurl}
1
  • 1
    Welcome to TeX! Please explain, why this a better solution!
    – Mensch
    Aug 14, 2023 at 20:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .