我正在使用 Biblatex-APA/Biber 和 LyX 以及 Mendeley 生成的 Bibtex 文件。我可以毫无问题地生成参考书目,但我想更改 inproceedings/booktitle 的参考样式。目前,我的参考文献如下:
Cole, R., Purao, S., Rossi, M. & Sein, M. (2005). Being proactive: Where action research meets design research. In Proceedings of the 26th international conference on information systems.
来自我的 Bibtex 文件:
@inproceedings{Cole2005,
author = {Cole, Robert and Purao, Sandeep and Rossi, Matti and Sein, Maung},
booktitle = {Proceedings of the 26th International Conference on Information Systems},
title = {{Being proactive: Where action research meets design research}},
year = {2005}
}
现在我想保留我的 inproceedings/booktitle 的大写字母以获得以下内容:
Cole, R., Purao, S., Rossi, M. & Sein, M. (2005). Being proactive: Where action
research meets design research. In Proceedings of the 26th International Conference
on Information Systems.
我尝试了以下方法,但没有成功。
\DeclareFieldFormat[inproceedings]{booktitle}{#1}
有什么建议么?
答案1
从书目样式文件中apa.bbx
,
\DeclareFieldFormat[inproceedings]{booktitle}{#1}
不起作用,因为该booktitle
字段设置为\printfield[apacase]{booktitle}
,其中apacase
格式指令定义为
\DeclareFieldFormat{apacase}{\MakeSentenceCase*{#1}}
要保留条目类型booktitle
中字段的源大小写@inproceedings
,您可以重新定义booktitle
参考书目宏或apacase
文档序言中的指令。后一种方法的示例如下:
\DeclareFieldFormat{apacase}{%
\ifboolexpr{ test {\ifentrytype{inproceedings}}
and ( test {\ifcurrentfield{booktitle}}
or test {\ifcurrentfield{booksubtitle}} ) }
{#1}{\MakeSentenceCase*{#1}}}
为了避免在除原始标题 ( origtitle
) 和标题附加组件之外的所有标题中使用句子大小写,请使用
\DeclareFieldFormat{apacase}{#1}
相反。由于biblatex-apa
仅依赖于带星号的变体,您可以通过将其添加到序言中并利用文件中的字段\MakeSentenceCase*
来避免所有句子大小写。\DeclareCaseLangs{}
hyphenation
bib
请注意,您可以通过该字段避免保护某些单词不被小写subtitle
。例如:
title = {Being proactive},
subtitle = {Where action research meets design research},
答案2
只需将问题字母放在花括号中即可保留特定的大写字母。因此
@inproceedings{Cole2005,
author = {Cole, Robert and Purao, Sandeep and Rossi, Matti and Sein, Maung},
booktitle = {{Proceedings} of the 26th {International} {Conference} on {Information} {Systems}},
title = {{Being proactive: Where action research meets design research}},
year = {2005}
}
就可以了。但大多数时候,把整行放在花括号中会更简单,就像标题一样。
答案3
我在寻找一个至少对我来说方便的解决方案,我编写了一个小 Python 脚本来解析 Mendeley 生成的本地 bib 文件。此脚本将书名放在两个花括号中。
import re
import fileinput
library = 'path/to/file'
import re
def re_sub_verbose(pattern, replace, string):
def substitute(match):
return match.expand(replace)
result = re.sub(pattern, substitute, string)
return result
for line in fileinput.input(library, inplace=1):
print re_sub_verbose("booktitle = \{(.*)\},", "booktitle = {{\\1}},", line)