我正在使用 Nature 引用样式。我想更改文章年份的位置并更改一些格式。
这是我的示例代码。
\usepackage[backend=biber,bibencoding=utf8,refsegment=chapter,style=nature,firstinits=true,isbn=false,doi=false,url=false,sorting=none,clearlang=true,natbib=true,intitle=true]{biblatex}
\DeclareFieldFormat[article]{citetitle}{#1}
\DeclareFieldFormat[article]{date}{#1;}
\AtEveryBibitem{%
\ifentrytype{article}{
\clearfield{url}%
\clearfield{urldate}%
\clearfield{review}%
\clearfield{series}%
\clearfield{eprint}%
\clearfield{eprinttype}%
}{}
}
\DeclareFieldFormat{booktitle}{\textbf{#1}\isdot}
\DeclareFieldFormat{journaltitle}{\textbf{#1}\isdot}
我想移动文章年份并将其放在期刊名称后面,不带圆括号。
请向我建议。
答案1
您可能想尝试以下重新定义。
\documentclass[american]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber,
style=nature,
intitle=true,
isbn=false, doi=false, url=false, eprint=false,
]{biblatex}
\DeclareFieldFormat[article]{citetitle}{#1}
\DeclareFieldFormat{booktitle}{\textbf{#1}\isdot}
\DeclareFieldFormat{journaltitle}{\textbf{#1}\isdot}
\DeclareFieldFormat*{volume}{#1}
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addspace}%
\iffieldundef{series}
{}
{%
\newunit
\printfield{series}%
\setunit{\addspace}%
}%
\setunit{\addspace}%
\printfield{issue}%
\setunit*{\addspace}%
\usebibmacro{date}%
\setunit{\addsemicolon\space}%
\printfield{volume}%
\newunit
\usebibmacro{issue}%
\newunit
}
\renewbibmacro{issue+date}{}
\addbibresource{biblatex-examples.bib}
\begin{document}
\autocite{sigfridsson,aksin}
\printbibliography
\end{document}
如果你想知道需要更改哪些 bibmacros 或字段定义,通常必须查看你正在使用的书目样式的来源。对于@article
问题中讨论的类型,nature.bbx
有
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\iftoggle{bbx:articletitle}
{%
\usebibmacro{title}%
\newblock
}
{}%
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{bytranslator+others}%
\newunit\newblock
\printfield{version}%
\newunit\newblock
\usebibmacro{journal+issuetitle}%
\newunit
\usebibmacro{byeditor+others}%
\newunit
\usebibmacro{note+pages}%
\newunit
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\setunit{\addspace}\newblock
\usebibmacro{issue+date}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}%
}
经过一些猜测和反复试验,我们发现 bibmacrojournal+issuetitle
可以打印期刊标题、卷数和编号信息。note+pages
还可以打印页数和issue+date
日期。
因此,第一步是重新定义issue+date
为不执行任何操作。第二步是插入代码以在期刊标题后打印日期。为此,我们重新定义 journal+issuetitle
,最初定义nature.bbx
为
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addspace}%
\iffieldundef{series}
{}
{%
\newunit
\printfield{series}%
\setunit{\addspace}%
}%
\printfield{volume}%
\newunit
\usebibmacro{issue}%
\newunit
}
你会注意到我们添加的代码journal+issuetitle
是一个简化的nature.bbx
的版本issue+date
\renewbibmacro*{issue+date}{%
\iffieldundef{year}
{}
{%
\iffieldundef{issue}
{\printtext[parens]{\usebibmacro{date}}}
{%
\printtext[parens]{%
\printfield{issue}%
\setunit*{\addspace}%
\usebibmacro{date}%
}%
}%
}%
\newunit
}
底线是:如果您想知道需要重新定义哪些宏,请检查.bbx
和.cbx
文件中的实现并追踪 bibmacro 定义。