
長い英数字の文字列を含む URL リンクを分割するにはどうすればよいですか?
以下に例を示します。
\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}
答え1
パッケージはロードされたことapacite
を検知しurl
、変更します。そのため、によって行われた変更はxurl
失われる可能性があります。ただし、代わりxurl
に
\usepackage{apacite}
\AtBeginDocument{\usepackage{xurl}}
をロードする代わりにurl
、が をチェックしたxurl
後に実際にロードされ、その変更は適用されません。apacite
url
ちょっとハックっぽいですね... また、 はapacite
10 年近く更新されていないようなので、 がサポートされていないのも不思議ではありませんxurl
。