为了强制参考标题采用句子大小写,我在.bbx
样式文件中使用了以下行:
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{titlecase}{\MakeSentenceCase*{#1}}
但这也会导致期刊名称以句子大小写形式显示,这是不受欢迎的。
为什么会这样?我该如何避免这种情况?
一个简单的例子:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{ref1,
author = {Doe, J. and Dane, D., and Dewy, R.},
year = {2000},
title = {This and That},
journal = {Journal of Deep Understanding of Things},
}
@article{ref2,
author = {Doe, J. and Dewy, D., and Dane, R.},
year = {2000},
title = {The Other},
journal = {Journal of deep understanding of things},
}
\end{filecontents}
\usepackage[style=authoryear-comp,natbib=true,
maxcitenames = 2,
mincitenames = 1,
firstinits = true,
labelyear=true,
uniquename=false,
uniquelist=false,
terseinits = false,
backend=biber]{biblatex}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{titlecase}{\MakeSentenceCase*{#1}}
\addbibresource{\jobname.bib}
\begin{document}
Some text and a ref \citep{ref1}.
Then another ref with same first author and year \citep{ref2}
\printbibliography
\end{document}
给出:
代替:
答案1
用于打印期刊信息的 bibmacro 的原始定义是
\newbibmacro*{journal}{%
\iffieldundef{journaltitle}
{}
{\printtext[journaltitle]{%
\printfield[titlecase]{journaltitle}%
\setunit{\subtitlepunct}%
\printfield[titlecase]{journalsubtitle}}}}
因此该指令也会影响期刊标题。解决方案是修改bib 宏\DeclareFieldFormat[article]{titlecase}{\MakeSentenceCase*{#1}}
的定义journal
\newbibmacro*{journal}{%
\iffieldundef{journaltitle}
{}
{\printtext[journaltitle]{%
\printfield[myplain]{journaltitle}%
\setunit{\subtitlepunct}%
\printfield[myplain]{journalsubtitle}}}}
我们可以在其中定义myplain
仅产生未格式化的值的字段格式。
\DeclareFieldFormat{myplain}{#1}
答案2
如果您尝试获取 IEEE 样式,则可能需要使用以下设置(细节):
\usepackage[
bibstyle=ieee,% IEEE citation style
citestyle=numeric-comp,% citing multiple papers will produce format similar to [2,4-8,12] instead of [2,4,5,6,7,8,12] (optional)
sorting=none,
backend=biber,
maxnames=100,% show up to 100 authors per author in the bibliography (optional)
isbn=false,url=false,doi=false% remove extra info (optional)
] {biblatex}
它会产生预期的结果,但也可能会修改其他事物。
答案3
如图所示biblatex 中标题的句子大小写我的包中的样式biblatex-ext
可以更精细地控制特定字段的标题大小写。如果您只想对大小写title
s 进行句子处理,而不想journal(title)
对booktitle
s @article
、@inbook
s、@incollection
s 及其同类进行句子处理,则可以使用字段格式titlecase:title
。
\documentclass{article}
\usepackage[style=ext-authoryear-comp,
backend=biber]{biblatex}
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{titlecase:title}{\MakeSentenceCase*{#1}}
\begin{filecontents}[force]{\jobname.bib}
@article{ref1,
author = {Doe, J. and Dane, D. and Dewy, R.},
year = {2000},
title = {This and That},
journal = {Journal of Deep Understanding of Things},
}
@article{ref2,
author = {Doe, J. and Dewy, D. and Dane, R.},
year = {2000},
title = {The Other},
journal = {Journal of deep understanding of things},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
Some text and a ref \autocite{ref1}.
Then another ref with same first author and year \autocite{ref2}
\printbibliography
\end{document}