参考书目中的单词之间的间隙

参考书目中的单词之间的间隙

我在引用在线新闻文章时发现了参考书目中令人尴尬的空白。

@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包以获得良好的间距。

相关内容