如何斷開包含長字母數字字串的 URL 連結?

如何斷開包含長字母數字字串的 URL 連結?

如何斷開包含長字母數字字串的 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,而不是加載,並且它的更改永遠不會應用。xurlapaciteurl

它有點 hackish...還要注意,它apacite似乎已經近 10 年沒有更新了,所以難怪它不支持xurl.

相關內容