0

I would like to know how to break URLs which contains long unbreakable sections in my bibliography using Sharelatex.

That's the code I use to load my bibliography file

\usepackage[sorting=nty]{biblatex}
\addbibresource{bibliography.bib}
\nocite{*}

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=black,
    filecolor=black,      
    urlcolor=black,
}
\urlstyle{same}

\begin{document}

...

\printbibliography[
heading=bibintoc,
title={Bibliografia Completa}
]

\printbibliography[heading=subbibintoc,type=article,title={Solo articoli}]
\printbibliography[heading=subbibintoc,type=book,title={Solo libri}]
\printbibliography[heading=subbibintoc,type=misc,title={Solo videografia}]

\end{document}

but when I load the bibliography the URLs that have too long unbreakable sections to fit in the page, like that one

PLoaVOjvkzQtyjhV55wZcdicAz5KexgKvm

, are not automatically broken, forcing me to use the \\ command. How can I avoid that and still maintaining a fully justified bibliography and correctly broken URLs?

Albeit the use of the hyperref package, I'm not using the \url{} command in the bibliography to make the URLs clickable, but they still are. My bibliography preset looks like this:

@misc{,
    author    = "",
    title     = "",
    howpublished = "",
    year      = "",
    url       = "",
    %month    = "",
    %note     = "",
}

Thank you for your time.

  • 4
    Welcome to TeX.SX! It would help you could add the actual example you have problems with, so we can check that our solutions actually work for you? While you are at it, please consider making your code snippets a full MWE/MWEB. The intent of your question is fairly clear even without an MWE, but an MWE makes sure that we are all talking about the same thing and people trying to help you don't need to start from scratch. ... – moewe Jun 11 '18 at 13:50
  • 3
    ... It shows that you care about the people trying to help you by not letting them waste their time reproducing what you already have and what is available to you at the stroke of a few buttons and mouse clicks. – moewe Jun 11 '18 at 13:53
  • 2
    maybe the https://ctan.org/pkg/xurl package can help – samcarter_is_at_topanswers.xyz Jun 11 '18 at 13:53
  • Thank you for your answer, I've tried to load the xurl package in the preamble but, unfortunately, it doesn't seem to work. – Edoardo Serra Jun 11 '18 at 14:27
  • Change the counters/penalties biburlnumpenalty, biburllcpenalty, biburlucpenalty. See the documentation of biblatex and various questions here. – Ulrike Fischer Jun 11 '18 at 14:49
  • Thanks, it worked by adding \setcounter{biburlnumpenalty}{100} \setcounter{biburlucpenalty}{100} \setcounter{biburllcpenalty}{100} to the preamble. – Edoardo Serra Jun 11 '18 at 15:50
  • So is this a duplicate of https://tex.stackexchange.com/q/22854/35864? – moewe Jun 11 '18 at 19:31
  • (Un)fortunately yes, but I didn't find that answer in the first place despite having made researches for an hour (maybe because I'm new here and still have to learn how this all works), I think this question can now be closed though. Thank you all for your help. – Edoardo Serra Jun 12 '18 at 08:47

0 Answers0