在 BibLaTeX 中强制连字并对齐

在 BibLaTeX 中强制连字并对齐

我已经将 BibTeX 导入为

\usepackage[backend=bibtex,style=numeric,natbib=true]{biblatex}

我的书目中有三个条目,如下:

@inproceedings{arthur2007,
 author = {Arthur, David and Vassilvitskii, Sergei},
 title = {K-means++: The Advantages of Careful Seeding},
 booktitle = {Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms},
 series = {SODA '07},
 year = {2007},
 isbn = {978-0-898716-24-5},
 location = {New Orleans, Louisiana},
 pages = {1027--1035},
 numpages = {9},
 url = {http://dl.acm.org/citation.cfm?id=1283383.1283494},
 acmid = {1283494},
 publisher = {Society for Industrial and Applied Mathematics},
 address = {Philadelphia, PA, USA},
} 

@article{barshan2014,
    author = {Barshan, Billur and Y\"{u}ksek, Murat C.},
    day = {01},
    doi = {10.1093/comjnl/bxt075},
    issn = {1460-2067},
    journal = {The Computer Journal},
    keywords = {sport},
    month = nov,
    number = {11},
    pages = {1649--1667},
    posted-at = {2015-02-09 03:55:41},
    priority = {2},
    publisher = {Oxford University Press},
    title = {{Recognizing Daily and Sports Activities in Two Open Source Machine Learning Environments Using Body-Worn Sensor Units}},
    url = {http://dx.doi.org/10.1093/comjnl/bxt075},
    volume = {57},
    year = {2014}
}

@article{bahmani2012,
 author = {Bahmani, Bahman and Moseley, Benjamin and Vattani, Andrea and Kumar, Ravi and Vassilvitskii, Sergei},
 title = {Scalable K-means++},
 journal = {Proc. VLDB Endow.},
 issue_date = {March 2012},
 volume = {5},
 number = {7},
 month = mar,
 year = {2012},
 issn = {2150-8097},
 pages = {622--633},
 numpages = {12},
 url = {http://dx.doi.org/10.14778/2180912.2180915},
 doi = {10.14778/2180912.2180915},
 acmid = {2180915},
 publisher = {VLDB Endowment},
}

然而,它却被渲染为

在此处输入图片描述

我希望参考书目能够对齐(如原样)并使用连字符(参见路易斯安那州)。另外,是否可以将 URL/DOI 刷新为换行符?
我试过了\raggedright,但不适合我。我也试过添加babel=hyphen定义\usepackage,但没有成功。

更新
我能够将 DOI 和 URL 刷新到换行符,这要归功于, 分别。

答案1

您可以在 tex 文件中通过\hyphenation{Lou-is-i-ana}(或Lou-i-si-ana) 为特定单词添加连字符。示例如下,我已使用geometry提供导致中断的文本宽度并将您的引用放在 中mybib.bib

示例输出

\documentclass{article}

\usepackage[width=11.55cm]{geometry}
\usepackage[backend=bibtex,style=numeric,natbib=true]{biblatex}
\addbibresource{mybib.bib}

\hyphenation{Lou-is-i-ana}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

如果您希望保留参考书目来源的连字符例外,那么您可以@preamble在文件中放置一个条目.bib

@preamble{"\hyphenation{Lou-is-i-ana}"}

或者您可以直接在.bib条目中添加连字符建议:

  location =     {New Orleans, Lou\-is\-i\-ana},

(La)TeX 有一个复杂的连字算法,但它过于谨慎,因此不会在所有已知单词中提供断点。地名通常不在标准模式中,所以有时必须提供帮助。从很多方面来看,令人惊讶的是,人们很少需要这样做。

ushyphex.tex如果您的文档是美式英语,您可以按照 egreg 的建议加载文件: \input{ushyphex}。这包含多年来汇编的例外情况列表,特别是涵盖了路易斯安那州Lou-i-si-ana

相关内容