biblatex:日期与发行日期分开,日期在期刊标题后面,无括号

biblatex:日期与发行日期分开,日期在期刊标题后面,无括号

我的参考书目几乎与我想要的完全一样,但有一个例外:我希望年份位于期刊标题之后,用逗号分隔,没有括号。目前,期号和年份一起放在括号中。此外,冒号位于卷之后,而不是期号之后,这是我想要的。(我无法手动将数百个 Bibtex 条目中的数字从“期号”字段移动到“编号”字段,如另一个答案中建议的那样)。

因此,不要这样:在此处输入图片描述

我想要这个:在此处输入图片描述

这是我的 MWE

\documentclass{scrreprt}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\usepackage[
backend=biber,
style=numeric-comp,
giveninits=true,
maxbibnames=2,
%citestyle=nature,
sorting=none,
isbn=false,
doi=false
]{biblatex}

\DeclareNameAlias{sortname}{family-given/given-family}
\DeclareNameAlias{author}{sortname}
\DeclareNameAlias{editor}{sortname}
\DeclareNameAlias{translator}{sortname} % 1st author as lastname, comma, firstname-initials, 2nd author as firstname-initials lastname

\DeclareNameWrapperFormat{sortname}{\mkbibbold{#1}}
\DeclareNameWrapperAlias{author}{sortname}
\DeclareNameWrapperAlias{editor}{sortname}
\DeclareNameWrapperAlias{translator}{sortname} %names bold

\AtEveryBibitem{\clearfield{month}} %month not printed
\AtEveryBibitem{\clearfield{day}} %day not printed
\AtEveryBibitem{\clearfield{note}} %notes not printed

\DeclareFieldFormat*{title}{#1} %no quotation marks

\DeclareDelimFormat[biblist,bib]{nametitledelim}{\addcomma\space} %comma after names

\renewrobustcmd*{\bibinitdelim}{\,} %thinspace between name initials

\renewbibmacro{in:}{%
    \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}} %supresses "In:" before journal titles

\DeclareFieldFormat{titlecase}{#1} %Journal titles capitalized as given (not sentence case)

\DeclareFieldFormat[article, inbook, incollection, inproceedings, misc, thesis, unpublished]
{number}{\mkbibparens{#1}} %number/issue between brackets

\DeclareFieldFormat[article, inproceedings, incollection, inbook]
{pages}{p. #1} %single p. instead of pp.

\renewbibmacro*{volume+number+eid}{
    \printfield{volume}
    \printfield{number}
    \printunit{\addcolon}} %format 16(4):224--225 for articles


%year after journal title

%no parentheses around date

\addbibresource{test.bib}

\usepackage{filecontents}

\begin{filecontents}{test.bib}
@Article{Brem2002,
    author          = {Brem, Rachel B and Yvert, Gaël and Clinton, Rebecca and Kruglyak, Leonid},
    title           = {Genetic dissection of transcriptional regulation in budding yeast.},
    journal         = {Science},
    year            = {2002},
    volume          = {296},
    pages           = {752--755},
    month           = apr,
    issue           = {5568},
}

@Article{Yvert2003,
    author          = {Yvert, Gaël and Brem, Rachel B and Whittle, Jacqueline and Akey, Joshua M and Foss, Eric and Smith, Erin N and Mackelprang, Rachel and Kruglyak, Leonid},
    title           = {Trans-acting regulatory variation in Saccharomyces cerevisiae and the role of transcription factors.},
    journal         = {Nat. Genet.},
    year            = {2003},
    volume          = {35},
    pages           = {57--64},
    month           = sep,
    issue           = {1},
}

\end{filecontents}  

\begin{document}

    I'm citing \cite{Brem2002} and \cite{Yvert2003}.

    \printbibliography

\end{document}  

答案1

以下对 和 的重新定义journal+issuetitlevolume+number+eid从 的代码中复制而来的biblatex-ext。这就是为什么它们包含一些可自定义的宏。

不需要使用\clearfield隐藏日期中的月份和日期,只需date=year,在加载时间选项中说明即可,这样更简单。

\documentclass{article}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\usepackage[
  backend=biber,
  style=numeric-comp,
  sorting=none,
  maxbibnames=2,
  giveninits=true,
  date=year,
  isbn=false,
  doi=false,
]{biblatex}

\DeclareNameAlias{sortname}{family-given/given-family}
\DeclareNameAlias{author}{sortname}
\DeclareNameAlias{editor}{sortname}
\DeclareNameAlias{translator}{sortname}

\DeclareNameWrapperFormat{sortname}{\mkbibbold{#1}}
\DeclareNameWrapperAlias{author}{sortname}
\DeclareNameWrapperAlias{editor}{sortname}
\DeclareNameWrapperAlias{translator}{sortname}

\renewrobustcmd*{\bibinitdelim}{\,}

\DeclareDelimFormat[biblist,bib]{nametitledelim}{\addcomma\space}

\DeclareFieldFormat*{title}{#1}

\renewbibmacro{in:}{%
  \ifentrytype{article}
    {}
    {\printtext{\bibstring{in}\intitlepunct}}}

\newcommand*{\volnumdelim}{\adddot}
\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
  \setunit*{\volnumdelim}%
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

\renewcommand*{\volnumdelim}{}
\DeclareFieldFormat[article, periodical]{number}{\mkbibparens{#1}}

\newcommand*{\jourdatedelim}{\addcomma\space}
\newcommand*{\jourserdelim}{\addcomma\space}
\newcommand*{\datevolnumdelim}{\newunitpunct}

\renewbibmacro*{journal+issuetitle}{%
  \usebibmacro{journal}%
  \setunit*{\jourdatedelim}%
  \iffieldundef{series}
    {}
    {\setunit*{\jourserdelim}%
     \printfield{series}%
     \setunit{\jourdatedelim}}%
  \usebibmacro{date}%
  \setunit{\datevolnumdelim}%
  \usebibmacro{volume+number+eid}%
  \setunit{\addcolon\space}%
  \usebibmacro{issue}%
  \newunit}

\renewcommand*{\bibpagespunct}{%
  \ifentrytype{article}
    {\addcolon}
    {\addcomma}%
  \space
}

\DefineBibliographyStrings{english}{
  pages = {p\adddot},
}

\addbibresource{biblatex-examples.bib}

\begin{document}
\autocite{sigfridsson}
\printbibliography
\end{document}

Sigfridsson, E. 和 U. Ryde,《从电势和电矩推导原子电荷的方法比较》。《计算化学杂志》,1998 年。19(4): 第 377-395 页。

由于您的.bib文件使用的issue位置number更合适,您可以使用 Biber 源图动态修复此问题:biblatex - 期刊的发行号(按日期)

相关内容