我尝试使用 natbib 格式化参考文献,但不知何故我的参考文献中总是出现很大、很难看的空白。有什么解决办法吗?我尝试过我使用的“howpublished”和“note”版本。
@misc{trafikverket_2018,
author = {{Trafikverket}},
title = {{Granskningshandling} {E6.21} {Lundbyleden} delen {Brantingsmotet}–{Ringömotet}},
year = {2018},
note = {\url{https://www.trafikverket.se/contentassets/6e09cdddd92c4b7c84bbe584ff72b18d/1_plan_och_milljobeskrivning.pdf?fbclid=IwAR3BepAcid8YwBbAlk_MwWmverrtMrXRMW7JzFC1NHj2QwRlWwJCQ0hOAHY} {Hämtad den 9/2 - 2021}
}
\usepackage{natbib}
\usepackage[hyphens]{url}
\bibliographystyle{apalike}
\bibliography{Referenser.bib}
答案1
我建议你\usepackage[hyphens]{url}
用 来代替\usepackage{xurl}
。这样,就可以出现换行符任何地方在 URL 字符串中,而不仅仅是在连字符中。
我还会将该字段拆分note
为两个独立的字段,并将 URL 字符串移动到新创建的howpublished
字段。
\documentclass{article} % or some other suitable document class
\begin{filecontents}[overwrite]{Referenser.bib}
@misc{trafikverket_2018,
author = {Trafikverket},
title = {{Granskningshandling} {E6.21} {Lundbyleden} delen {Brantingsmotet}–{Ringömotet}},
year = {2018},
howpublished = {\url{https://www.trafikverket.se/contentassets/6e09cdddd92c4b7c84bbe584ff72b18d/1_plan_och_milljobeskrivning.pdf?fbclid=IwAR3BepAcid8YwBbAlk_MwWmverrtMrXRMW7JzFC1NHj2QwRlWwJCQ0hOAHY}},
note = {Hämtad den 9/2 - 2021}
}
\end{filecontents}
\usepackage[T1]{fontenc}
\usepackage[swedish]{babel}
\usepackage{natbib}
\bibliographystyle{apalike}
\usepackage{xurl} % <-- new
\begin{document}
\cite{trafikverket_2018}
\bibliography{Referenser}
\end{document}