Biblatex:更改条目的顺序

Biblatex:更改条目的顺序

我最近才开始使用 biblatex,但我仍然在努力理解如何正确地做事。我的问题是:如何更改参考书目中的条目/单元/块的顺序?我使用的样式是“数字”。现在,默认顺序是:

BB Aggarwal、Y. Takada 和 OV Oommen。“从化学预防到化学治疗:共同目标和共同目的”。引自:专家意见调查药物13.10(2004 年 10 月),第 1327-1338 页。

基本上,我需要逗号作为分隔符,期刊标题和卷号之间需要逗号;“In:”应该删除,卷号和卷号应该有前缀和逗号作为分隔符,最后,日期应该放在最后,不带括号。类似这样:

BB Aggarwal、Y. Takada 和 OV Oommen,“从化学预防到化学治疗:共同目标和共同目的”,专家意见调查药物,第 13 卷,第 10 期,第 1327-1338 页,2004 年 10 月。

如果有关于如何自定义参考书目或如何创建用于 biblatex 的参考书目样式的分步教程,我将不胜感激。谢谢。

以下是用于测试目的的代码:

\begin{filecontents}{mybib.bib}
@article{Aggarwal2004b,
author = {Aggarwal, B. B. and Takada, Y. and Oommen, O. V.},
journal = {Expert Opin Investig Drugs},
month = oct,
number = {10},
pages = {1327--1338},
publisher = {Informa Pharma Science},
title = {{From chemoprevention to chemotherapy: common targets and common goals}},
volume = {13},
year = {2004}
}
\end{filecontents}
\documentclass{article}
\usepackage[style=numeric]{biblatex}
\bibliography{mybib}  
\begin{document}
Test~\cite{Aggarwal2004b}.
\printbibliography
\end{document}

答案1

将以下内容添加到您的前言(或配置文件biblatex.cfg)中:

% Commas as separators
\renewcommand*{\newunitpunct}{\addcomma\space}

% Comma before and after journal volume
\renewbibmacro*{volume+number+eid}{%
  \setunit*{\addcomma\space}% NEW
  \printfield{volume}%
%  \setunit*{\adddot}% DELETED
  \setunit*{\addcomma\space}% NEW
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

% Prefixes for journal volume and number
\DeclareFieldFormat[article]{volume}{\bibstring{volume}~#1}% volume of a journal
\DeclareFieldFormat[article]{number}{\bibstring{number}~#1}% number of a journal

% Comma before date; date not in parentheses
\renewbibmacro*{issue+date}{%
  \setunit*{\addcomma\space}% NEW
%  \printtext[parens]{% DELETED
    \iffieldundef{issue}
      {\usebibmacro{date}}
      {\printfield{issue}%
       \setunit*{\addspace}%
%       \usebibmacro{date}}}% DELETED
       \usebibmacro{date}}% NEW
  \newunit}

% Issue/date macros removed after journal number
\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\addspace}%
  \iffieldundef{series}
    {}
    {\newunit
     \printfield{series}%
     \setunit{\addspace}}%
  \usebibmacro{volume+number+eid}%
%  \setunit{\addspace}% DELETED
%  \usebibmacro{issue+date}% DELETED
%  \setunit{\addcolon\space}% DELETED
%  \usebibmacro{issue}% DELETED
  \newunit}

% "In:" removed for articles; issue/date macros added after note+pages macro
\DeclareBibliographyDriver{article}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{bytranslator+others}%
  \newunit\newblock
  \printfield{version}%
  \newunit\newblock
%  \usebibmacro{in:}% DELETED
  \usebibmacro{journal+issuetitle}%
  \newunit
  \usebibmacro{byeditor+others}%
  \newunit
  \usebibmacro{note+pages}%
  \setunit{\addspace}% NEW
  \usebibmacro{issue+date}% NEW
  \setunit{\addcolon\space}% NEW
  \usebibmacro{issue}% NEW
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{issn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \usebibmacro{finentry}}

请注意,我仅针对文章删除了“In:” - 它仍应显示在条目中@incollection。还请注意,将日期直接移到页码后面可能会产生误导(您示例中的年份可能会被误认为是 2004 页)。

至于分步教程,最好的方法是 a) 彻底研究 biblatex 文档和 b) 深入研究biblatex.defstandard.bbx对于那些精通德语的人来说,还有很好的教程作者:Dominik Waßenhoven。

编辑:赫伯特提供了更优雅的方式仅删除文章中的“In”。

相关内容