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+issuetitleи volume+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}

Сигфридссон, Э. и У. Райд, Сравнение методов получения атомных зарядов из электростатического потенциала и моментов. Журнал вычислительной химии, 1998. 19(4): стр. 377–395.

Поскольку ваш .bibфайл использует issueто, что numberбыло бы более уместно, вы можете исправить это на лету с помощью карты источников Biber:biblatex - номер выпуска журнала в дате.

Связанный контент