我在下面提供了一个 MWE。我试图在参考书目页面中对 URL 进行连字符处理,但是多次谷歌搜索给出的解决方案都没有找到任何结果。所以我在这里寻求帮助。提前谢谢您。如果有帮助的话,我会使用 latexmk,-pdflua
它基本上使用 lualatex 来制作我的 tex 文件,并使用 biber 作为参考书目数据库。
\documentclass{report}
\usepackage[backend=biber,style=apa]{biblatex}
\addbibresource{main.bib}
\usepackage{filecontents}
\usepackage[hyphens]{url}
\begin{filecontents*}{main.bib}
@online{mcafee2021,
title = {2021 Threat Predictions Report},
url = {https://www.itweb.co.za/content/RgeVDqPYVddvKJN3},
abstract = {The revelations around the {SUNBURST} campaigns exploiting the {SolarWinds} Orion platform have revealed a new attack vector – the supply chain.},
titleaddon = {{ITWeb}},
author = {{McAfee}},
urldate = {2021-09-17},
date = {2021-02-01},
langid = {english},
}
\end{filecontents*}
\begin{document}
Yet another test~\parencite{mcafee2021}
\printbibliography{}
\end{document}
答案1
看起来该url
包默认不能在每个字符处剪切一个 url(尝试添加/
你会看到)。xurl
包改进了(它将在内部加载url
包),允许在各处进行剪切:
它还可以与hyperref
“先加载”结合使用xurl
。
\documentclass{report}
\usepackage[backend=biber,style=apa]{biblatex}
\addbibresource{main.bib}
\usepackage{filecontents}
\usepackage{xurl}
\begin{filecontents*}{main.bib}
@online{mcafee2021,
title = {2021 Threat Predictions Report},
url = {https://www.itweb.co.za/content/RgeVDqPYVddvKJN3},
abstract = {The revelations around the {SUNBURST} campaigns exploiting the {SolarWinds} Orion platform have revealed a new attack vector – the supply chain.},
titleaddon = {{ITWeb}},
author = {{McAfee}},
urldate = {2021-09-17},
date = {2021-02-01},
langid = {english},
}
\end{filecontents*}
\begin{document}
Yet another test~\parencite{mcafee2021}
\printbibliography{}
\end{document}
xurl
您可以通过重新定义来避免使用UrlBreaks
适当重新定义来避免使用,例如这个答案。