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}. – gusbrs Mar 01 '23 at 13:57xurlinstead, 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. – daleif Mar 01 '23 at 14:50apacitedoes use\url, but has its own url breakpoints settings. So, anyone who can make it work, please feel free to answer. – gusbrs Mar 01 '23 at 18:10xurlwithapacitein its current form. (But sinceapacitelooks for loadedurlat begin document, one could delayxurl:\AtBeginDocument{\usepackage{xurl}}loaded afterapacite, that does seem to work) – daleif Mar 02 '23 at 08:12