How to break url links that include long alphanumerical strings?
Here an example:
\documentclass[12pt,a4paper,twoside]{article}
\begin{filecontents}[overwrite]{ref.bib}
@misc{Reuters_2023,
author = "Reuters",
title = "Example of long URL",
year = 2023,
url = "https://www.facebook.com/Reuters/posts/pfbid0Gw8qyhJSCCBeAzfVRXcV9aMBsy5pzmeTfbx2WeTmGySdpSYPBxtqJqkkuhDX9Fb9l",
}
\end{filecontents}
\usepackage{apacite}
\bibliographystyle{apacite}
\usepackage[hyphens,spaces,obeyspaces]{url}
\begin{document}
\cite{Reuters_2023}
\bibliography{ref}
\end{document}
\usepackage{xurl}
.xurl
instead, this changes\url
, which (hopefully) is used by the style you use, to allow linebreaks more or less everywhere. With all the long URLs we use nowadays it is better to usexurl
.apacite
does use\url
, but has its own url breakpoints settings. So, anyone who can make it work, please feel free to answer.xurl
withapacite
in its current form. (But sinceapacite
looks for loadedurl
at begin document, one could delayxurl
:\AtBeginDocument{\usepackage{xurl}}
loaded afterapacite
, that does seem to work)