使用 pdfLaTeX 在 BibTeX 中换行 URL(忽略边距)
我使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有时,当 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. Theurl
package usuallly does a nice job breaking urls (I have not used thebreakurl
package and my URLs break nicely by the slashes or dashes).最好将“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.