我在引用在线新闻文章时发现了参考书目中令人尴尬的空白。
@MISC{DHLHYBRID,
author = { Kastrenakes, Jacob},
title = {{UPS} has a delivery truck that can launch a drone},
editor = {theverge.com},
month = {February},
year = {2017},
url = {https://www.theverge.com/2017/2/21/14691062/ups-drone-delivery-truck-test-completed-video},
note = {\emph{https://www.theverge.com/2017/2/21/14691062/ups-drone-delivery-truck-test-completed-video} {[Online; posted 21-February-2017]}},
我看到作者名字中的 UPS 之前以及“J”之前和之后有很大空白。
答案1
您应该 (a) 将\emph
注释中的 替换为\url
并 (b) 加载url
包。在您的特定情况下,将hyphens
选项传递给url
包,因此允许在 hyhens 处中断 url,可获得最佳效果。
\documentclass{article}
\usepackage{natbib}
\usepackage[hyphens]{url}
\begin{document}
\cite{DHLHYBRID}
\bibliographystyle{abbrvnat}
\bibliography{test}
\end{document}
和test.bib
@Misc{DHLHYBRID,
author = {Kastrenakes, Jacob},
title = {{UPS} has a delivery truck that can launch a drone},
editor = {theverge.com},
month = {February},
year = 2017,
note =
{\url{https://www.theverge.com/2017/2/21/14691062/ups-drone-delivery-truck-test-completed-video}
{[Online; posted 21-February-2017]}}
}
您在原始示例中看到的大空格是由于 LaTeX 尝试尽可能地拉伸以填充第一行,因为它无法在段落后面找到好的断点。styles提供的\url
命令natbib
通常是 just \texttt
,它不允许这样的断点。\url
来自url
包(或来自hyperef
)的命令允许跨行断点非单词对象(例如 url),从而为 LaTeX 如何断段提供了更多选项。看到url
软件包文档获得更多选项,包括更改 URL 所用字体的方法。
请注意,您也可以按如下方式使用该url
字段test.bib
:
@Misc{DHLHYBRID,
author = {Kastrenakes, Jacob},
title = {{UPS} has a delivery truck that can launch a drone},
editor = {theverge.com},
month = {February},
year = 2017,
url =
{https://www.theverge.com/2017/2/21/14691062/ups-drone-delivery-truck-test-completed-video},
note = {[Online; posted 21-February-2017]}
}
但是现在 URL 将继续运行,URL
并且您仍然需要加载url
包以获得良好的间距。