![如何使用 DeclareSourcemap 为字段添加默认值](https://linux22.com/image/301617/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20DeclareSourcemap%20%E4%B8%BA%E5%AD%97%E6%AE%B5%E6%B7%BB%E5%8A%A0%E9%BB%98%E8%AE%A4%E5%80%BC.png)
hyphenation
如果没有的话,我想使用 Biber sourcemaps 为参考书目条目字段添加默认值(我希望参考书目条目的默认连字符与文档的主要语言不同)。这是我能想到的最好的办法:
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldset=needs-hyphenation,fieldvalue=true]
\step[fieldsource=hyphenation,fieldset=needs-hyphenation,null]
\step[fieldsource=needs-hyphenation,fieldset=hyphenation,fieldvalue=british]
\step[fieldset=needs-hyphenation,null]
}
}
}
不幸的是,我似乎找不到一种方法来根据以下条件处理源映射中的条目:缺席键。fieldsource
本身可用于使步骤取决于在场一个字段,我(滥用)使用它来产生一个“标志”字段,然后有条件地删除它。
有没有更好的方法可以有条件地运行某个步骤(如果字段是)不是展示?
答案1
抱歉,大家,我在发布这个问题后才意识到这一点!:-)
\map
without[overwrite]
不会覆盖任何字段,因此可以说
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldset=hyphenation,fieldvalue=british]
}
}
}
并且不用担心覆盖任何内容。但是,我确实想知道这种“标志字段”编程方法在其他情况下是否有用...