使用 pdfLaTeX 在 BibTeX 中换行 URL(忽略边距)

发布于 2024-10-01 18:28:41 字数 474 浏览 0 评论 0原文

我使用 breakurl 包和 hyperref 包以及 pdfLatex 和 BibTeX 来引用 url。网址已损坏,但不是根据我的边距。有什么办法可以让网址识别我的边距或强制换行吗?提前致谢。

代码:

<代码> \usepackage{hyperref} \usepackage[vertfit]{breakurl}

@MISC{cmm:dataset,
author = {University of Bristol Centre for Multilevel Modelling},
    title = {Datasets used in reviews},
    howpublished = {\url{http://www.cmm.bristol.ac.uk/learning-training/multilevel-m-software/exam.shtml}},
}

I'm using the breakurl package and the hyperref package with pdfLatex and BibTeX to cite a url. The url is breaking, but not according to my margins. Is there any way I can make the url recognize my margins or force a line break? Thanks in advance.

Code:


\usepackage{hyperref}
\usepackage[vertfit]{breakurl}

@MISC{cmm:dataset,
author = {University of Bristol Centre for Multilevel Modelling},
    title = {Datasets used in reviews},
    howpublished = {\url{http://www.cmm.bristol.ac.uk/learning-training/multilevel-m-software/exam.shtml}},
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心病无药医 2024-10-08 18:28:42

有时,当 LaTeX 无法很好地换行时,它会导致它们无法调整。您可以控制该行为,将 \sloppy 放在文档的开头,然后查看该行为是否更适合您。另外,正如我在您的帖子中看到的那样,您的网址中有空格。删除它们。 url 包通常可以很好地分解 url(我没有使用 breakurl 包,我的 URL 可以很好地用斜杠或破折号来分解)。

Sometimes, when LaTeX cannot break lines nicely, it leaves them unadjusted. You can control that behavior putting \sloppy at the beginnig of your document and see if the behavior suits you more. Also, you have spaces in your URL, as I've seen in your post. Remove them. The url package usuallly does a nice job breaking urls (I have not used the breakurl package and my URLs break nicely by the slashes or dashes).

稚气少女 2024-10-08 18:28:42

最好将“breaklinks”添加到 hyperref 的选项中,或者如果使用 url 显式格式化 bibtex 文件中的 url“\url{http:....}”。这解决了我的问题。如果默认框不适合您的目的,您可能仍然需要重新定义 url 的格式。

Better to add 'breaklinks' to the options for hyperref or if using url explicitly format the url in the bibtex file "\url{http:....}". This fixed the problem for me. You may still need to redefine the format for the url if the default box does not suit your purposes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文