![biblatex/biber 中缺少“Vol.”和“No.”](https://linux22.com/image/262636/biblatex%2Fbiber%20%E4%B8%AD%E7%BC%BA%E5%B0%91%E2%80%9CVol.%E2%80%9D%E5%92%8C%E2%80%9CNo.%E2%80%9D.png)
我想用 biblatex 引用一篇文章,但是我没有在相应的编号前面添加“Vol.”(卷)和“No.”(编号)。
@article
以下是文件中类型为的条目.bib
:
@article{kakimoto_monitoring_2006,
title = {Monitoring of Interarea Oscillation Mode by Synchronized Phasor Mesurement},
volume = {21},
issn = {0885-8950},
doi = {10.1109/TPWRS.2005.861960},
number = {1},
journal = {{IEEE} Transactions on Power Systems},
author = {Kakimoto, Naoto and Sugumi, Masahiro and Makino, Tohru and Tomiyama, Katsuyuki},
month = feb,
year = {2006},
pages = {260 -- 268}
}
我在这个最小的例子中引用了它:
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{selinput}
\SelectInputMappings{
adieresis={ä},
germandbls={ß},
Euro={€},
}
\usepackage[ngerman]{babel}
% erweiterete Literaturverwaltung
\usepackage[ backend = biber % (bibtex, biber)
, bibwarn = true % Warnung bei fehlerhafter bib-Datei
, style = authoryear
, natbib = true
]{biblatex}
% Einstellung der Anführungszeichen bei Zitaten („x“, »x«, “x”)
\usepackage[autostyle = true]{csquotes}
% Lokalisierung für biber ergänzen % wirkt nicht
\DefineBibliographyStrings{ngerman}{%
jourvol = {V1ol. }
, volume = {VolB. }
, volumes = {VolBs. }
, edition = {No. }
%, andothers = {and others}
}
% Trenner zwischen den Namen ein Semikolon
\renewcommand*{\multinamedelim}{\addsemicolon\space}
% Literaturliste laden
\addbibresource{L:/Uni/Literatur.bib}
\begin{document}
\cite{kakimoto_monitoring_2006}
\printbibliography
\end{document}
但是我在我的参考书目中看到了这样的条目:
Kakimoto, Naoto u.a. (Feb. 2006). „Monitoring of Interarea Oscillation Mode by Syn-
chronized Phasor Mesurement“. In: IEEE Transactions on Power Systems 21.1, S. 260–
268. issn: 0885-8950. doi: 10.1109/TPWRS.2005.861960.
正如您所见,我得到的不是“第 21 卷,第 1 期”,而是“21.1”。
在我的代码中,我尝试使用宏来更改此行为\DefineBibliographyStrings
,但没有成功。有趣的是,注释的andother
本地化字符串有效,而其他的则无效。
答案1
为了利用的优秀本地化功能biblatex
,以下方法可能更为合适。
\DeclareFieldFormat[article]{volume}{\bibstring{jourvol}\addnbspace #1}
\DeclareFieldFormat[article]{number}{\bibstring{number}\addnbspace #1}
请注意使用不间断空格 ( \addnbspace
),如果您更喜欢普通空格,请使用\addpspace
。(编辑:可能最好使用\bibstring{jourvol}
而不是\bibstring{volume}
,我已经改变了这一点,对于德语来说至少输出发生了变化,但这并没有反映在下面的图片中。)
volume+number+eid
然而,这会导致“Bd. 21.Nr. 1”,因此我们稍微修改了 bibmacro,在卷和编号之间包含一个逗号(和一个空格)。
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\setunit{\addcomma\space}%<---- was \setunit*{\adddot}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
因此,MWE
\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[backend = biber,style = authoryear,natbib = true]{biblatex}
\usepackage[autostyle = true]{csquotes}
\begin{filecontents}{\jobname.bib}
@article{kakimoto_monitoring_2006,
title = {Monitoring of Interarea Oscillation Mode by Synchronized Phasor Mesurement},
volume = {21},
issn = {0885-8950},
doi = {10.1109/TPWRS.2005.861960},
number = {1},
journal = {{IEEE} Transactions on Power Systems},
author = {Kakimoto, Naoto and Sugumi, Masahiro and Makino, Tohru and Tomiyama, Katsuyuki},
month = feb,
year = {2006},
pages = {260 -- 268}
}
\end{filecontents}
\DeclareFieldFormat[article]{volume}{\bibstring{jourvol}\addnbspace #1}
\DeclareFieldFormat[article]{number}{\bibstring{number}\addnbspace #1}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\setunit{\addcomma\space}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\renewcommand*{\multinamedelim}{\addsemicolon\space}
\addbibresource{\jobname.bib}
\begin{document}
\cite{kakimoto_monitoring_2006}
\nocite{*}
\printbibliography
\end{document}
产量
如果您希望在 之前添加逗号volume
,请将其添加到您的序言中。
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addcomma\space}% was: \setunit*{\addspace}
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\setunit{\addcomma\space}}% was: \setunit{\addspace}
\usebibmacro{volume+number+eid}%
\setunit{\addspace}%
\usebibmacro{issue+date}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
答案2
据我所知,这不是本地化问题,因此\DefineBibliographyStrings
这里无法为您做任何事情。您必须修改字段格式。尝试:
\DeclareFieldFormat[article]{volume}{Vol. #1}
\DeclareFieldFormat[article]{number}{No. #1}
[article]
如果您希望无论什么条目类型,它都保留,那么您可以隐藏可选参数。