我正在努力理解如何在 biblatex 中更改参考书目。我使用的样式是“numeric-comp”,根据下面的 MWE,它给出了以下顺序:
Name, G.,“文章标题 1”,2020 Journal of Something Great 5.1,第 21-42 页
但我需要将日期移到作者后面,并将章节号设置为粗体,将期刊设置为斜体,使其看起来像:
姓名,G.,(2020)文章标题 1, 大事记(5),21-42
根据这里,我已更改“journal+issuetitle”的宏,但我只能将其移动到 Journal 之后的其他位置。有人能帮我解决我遗漏的内容吗?以下是 MWE:
\begin{filecontents}{demobib.bib}
@ARTICLE{article1,
author = {Name, Givenname},
title = {Title of Article no. 1},
journal = {Journal of Something Great},
year = {2020},
volume = {5},
number = {1},
pages = {21-42},
}
@ARTICLE{article2,
author = {Name, Givenname},
title = {Title of Article no. 2},
journal = {Journal of Something Even Greater},
year = {2021},
volume = {4},
number = {2},
pages = {42-84},
}
\end{filecontents}
\documentclass[english]{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[babel]{csquotes}
\usepackage[backend=biber, style=numeric-comp, giveninits=true, maxnames = 3, bibencoding=utf8, sorting=none]{biblatex}
\renewcommand*{\newunitpunct}{\addcomma\space}
\renewbibmacro{in:}{}
\bibliography{demobib}
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{date}
\setunit{\addspace}
\usebibmacro{journal}%
\setunit*{\addspace}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\setunit{\addspace}}%
\usebibmacro{volume+number+eid}%
% \setunit{\addspace}% DELETED
%\setunit{\addcolon\space}% DELETED
% \usebibmacro{issue}% DELETED
\newunit}
\DeclareNameAlias{author}{last-first}
\DeclareNameAlias{sortname}{last-first}
\begin{document}
\parencite{article1}
\parencite{article2}
\printbibliography
\end{document}
´´´
答案1
让你的数字书目看起来更像作者年份的经典技巧如下:在 BibLaTeX 中将数字样式与作者年份样式相结合。
对于“in:”,我推荐以下解决方案之一抑制“在:” biblatex(我选择了该biblatex-ext
解决方案)。
为了重新格式化volume
和pages
字段的输出,您可以使用\DeclareFieldFormat
(参见其他自定义 biblatex 样式的指南)。要摆脱number
使用 Biber 源映射(使用 biblatex 禁用 ISSN 但保留 ISBN)。
\documentclass[english]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[babel]{csquotes}
\usepackage[
backend=biber,
citestyle=ext-numeric-comp,
bibstyle=ext-authoryear,
sorting=none,
giveninits=true,
maxnames = 3,
articlein=false,
]{biblatex}
\makeatletter
\input{ext-numeric.bbx}
\makeatother
\renewcommand*{\newunitpunct}{\addcomma\space}
\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{author}{sortname}
\DeclareNameAlias{editor}{sortname}
\DeclareNameAlias{translator}{sortname}
\DeclareFieldFormat[article,periodical]{volume}{\mkbibbold{\mkbibparens{#1}}}
\DeclareFieldFormat[article,periodical]{pages}{#1}
\DeclareSourcemap{
\maps{
\map{
\pertype{article}
\pertype{periodcial}
\step[fieldset=number, null]
}
}
}
\addbibresource{biblatex-examples.bib}
\begin{document}
\autocite{sigfridsson,worman,geer}
\printbibliography
\end{document}
请注意,我在 MWE 中从 切换\usepackage[latin1]{inputenc}
到\usepackage[utf8]{inputenc}
。后者已经是默认设置,因此严格来说,不再需要包含。UTF-8 是当今事实上的标准编码,并且biblatex
的一些功能最适合使用 UTF-8(而不是 Latin1)。