![参考书目中缺少位置后面和页码前面的逗号](https://linux22.com/image/416501/%E5%8F%82%E8%80%83%E4%B9%A6%E7%9B%AE%E4%B8%AD%E7%BC%BA%E5%B0%91%E4%BD%8D%E7%BD%AE%E5%90%8E%E9%9D%A2%E5%92%8C%E9%A1%B5%E7%A0%81%E5%89%8D%E9%9D%A2%E7%9A%84%E9%80%97%E5%8F%B7.png)
从中可以看出,“Amsterdam”和“pp. 1423-...”之间缺少一个逗号。
我怎样才能在这个地方添加逗号?使用@article时不会出现此问题,只有使用@incollection时才会出现此问题。
@incollection{Slemrod.2002,
author = {Slemrod, Joel and Yitzhaki, Shlomo},
title = {Tax Avoidance, Evasion, and Administration},
urldate = {22.06.2020},
pages = {1423--1470},
volume = {3},
publisher = {{Elsevier/North Holland}},
isbn = {9780444823144},
series = {Handbooks in economics},
editor = {Auerbach, Alan J. and Feldstein, M.},
booktitle = {Handbook of public economics},
year = {2002},
address = {Amsterdam}
}
@book{Auerbach.2002,
year = {2002},
title = {Handbook of public economics: Volume 3},
url = {https://www.elsevier.com/books/handbook-of-public-economics/feldstein/978-0-444-82314-4},
address = {Amsterdam},
urldate = {22.06.2020},
edition = {1},
volume = {3},
publisher = {{Elsevier/North Holland}},
isbn = {9780444823144},
series = {Handbooks in economics},
editor = {Auerbach, Alan J. and Feldstein, M.},
file = {http://lib.myilibrary.com/detail.asp?id=501359},
file = {http://www.sciencedirect.com/science/handbooks/15734420/5}
}
感谢您的任何帮助!
以下是我目前所做的:
\usepackage[style=authoryear, backend=bibtex, natbib=true, giveninits=true, isbn=false, doi=true, url=false, eprint=false, dashed=false, maxbibnames=99, maxcitenames=2]{biblatex}
\DeclareDelimFormat[cite,parencite,footcite]{finalnamedelim}{\space\&\space}
\DeclareNameAlias{sortname}{last-first}
\DeclareFieldFormat[article]{title}{#1}
\DeclareFieldFormat[article]{journaltitle}{#1}
\DeclareFieldFormat[book]{title}{#1}
\renewbibmacro{in:}{%
\ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
\DeclareFieldFormat[incollection]{citetitle}{#1\midsentence}
\DeclareFieldFormat[incollection]{title}{#1\midsentence}
\DeclareFieldFormat[incollection]{title}{#1}
\DeclareNameAlias[collection]{author}{last-first}
\DeclareNameAlias[collection]{editor}{last-first}
\DeclareNameAlias[incollection]{editor}{last-first}
% Put editor string in parentheses
\DeclareFieldFormat{editortype}{\mkbibparens{#1}}
% Like editor+others but without comma before editor string and dash checks
\newbibmacro*{ineditor+others}{%
\ifboolexpr{ test \ifuseeditor and not test {\ifnameundef{editor}} }
{\printnames{editor}%
\setunit{\addspace}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}}
{}}
% Print editors before "in" title
\renewbibmacro{in:}{%
\ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}%
\usebibmacro{ineditor+others}%
\newunit
\clearname{editor}}
%Capitalize Editor
\DefineBibliographyStrings{english}{editor={Ed.}, editors={Eds.}}
% let "publisher" and "location" change place
\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\iflistundef{location}
{\setunit{\addcomma\space}}
{\setunit*{\addcomma\space}}%
\printlist{location}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
\newunit}
%Comma before page numbers collections
%Collection Titel Non-Kursiv
\DeclareFieldFormat{booktitle}{#1\isdot}
%DOI in neue Zeile (unsicher ob Bedarf)
\newbibmacro*{bbx:parunit}{%
\ifbibliography
{\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\clearlist{pageref}%
\setunit{\adddot\par\nobreak}}
{}}
\renewbibmacro*{doi+eprint+url}{%
\usebibmacro{bbx:parunit}% Added
\iftoggle{bbx:doi}
{\printfield{doi}}
{}%
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\iftoggle{bbx:url}
{\usebibmacro{url+urldate}}
{}}
\renewbibmacro*{eprint}{%
\usebibmacro{bbx:parunit}% Added
\iffieldundef{eprinttype}
{\printfield{eprint}}
{\printfield[eprint:\strfield{eprinttype}]{eprint}}}
\renewbibmacro*{url+urldate}{%
\usebibmacro{bbx:parunit}% Added
\printfield{url}%
\iffieldundef{urlyear}
{}
{\setunit*{\addspace}%
\printtext[urldate]{\printurldate}}}
%--> xpatch to implement journal volume, number and page setting <--
\xpatchbibmacro{journal+issuetitle}{%
\setunit*{\addspace}%
\iffieldundef{series}}
{%
\setunit*{\space}%
\iffieldundef{series}}{}{}
%--> xpatch to change year setting from (year) to , year for all classes <--
\xpatchbibmacro{date+extradate}{%
\printtext[parens]%
}{%
\setunit{\addcomma\space}%
\printtext%
}{}{}
\addbibresource{Literatur.bib}
\renewcommand\bibpagespunct{\ifentrytype{article}{\addcomma}{\addspace}\space}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}
\printfield[parens]{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
% Remove "and" between last and second last author
\DefineBibliographyExtras{english}{%
\renewcommand*{\finalnamedelim}{\addcomma\addspace}%
}
答案1
您的参考书目设置包含以下行
\renewcommand\bibpagespunct{\ifentrytype{article}{\addcomma}{\addspace}\space}
这会为 s 生成一个逗号和空格,@article
为所有其他条目类型生成两个空格(例如@incollection
)。如果您希望所有条目类型都使用逗号后跟一个空格,您可以这样写
\renewcommand\bibpagespunct{\addcomma\space}
\bibpagespunct
但这是默认的,所以您根本不需要重新定义。
ext-authoryear
这是基于我的代码的现代化版本biblatex-ext
捆绑,这使得实现一些所需的修改变得更容易。 (我还使用 Biber 而不是 BibTeX,因为您只能使用biblatex
Biber 访问 的完整功能集,但这对于此处显示的代码而言并非必不可少。)
.bib
示例中的文件已修复,使用正确的格式(urldate
日期必须采用 ISO 8601 格式,即YYYY-MM-DD
格式) ,如达莱夫 在评论中crossref
. 通过使用及其字段继承可以使条目变得更加紧凑。
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber,
style=ext-authoryear,
maxbibnames=99, maxcitenames=2,
giveninits=true, uniquename=init,
articlein=false,
innamebeforetitle=true,
isbn=false, doi=true, url=false, eprint=false,
dashed=false,
]{biblatex}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}
\DeclareDelimFormat[cite,parencite,footcite]{finalnamedelim}{\space\&\space}
\DeclareNameAlias{sortname}{family-given}
\DeclareNameAlias{ineditor}{sortname}
\DeclareFieldFormat{editortype}{\mkbibparens{\bibsentence#1}}
\DeclareDelimFormat{editortypedelim}{\addspace}
\DeclareFieldAlias{translatortype}{editortype}
\DeclareDelimAlias{translatortypedelim}{editortypedelim}
\DeclareDelimFormat[bib]{nameyeardelim}{\addcomma\space}
\DeclareFieldFormat{biblabeldate}{#1}
\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat*{citetitle}{#1}
\DeclareFieldFormat*{journaltitle}{#1\isdot}
\DeclareFieldFormat*{booktitle}{#1}
\renewcommand*{\volnumdelim}{}
\DeclareFieldFormat[article,periodical]{number}{\mkbibparens{#1}}
\renewbibmacro*{pubinstorg+location+date}[1]{%
\printlist{#1}%
\setunit*{\publocdelim}%
\printlist{location}%
\setunit*{\locdatedelim}%
\usebibmacro{date}%
\newunit}
%DOI in neue Zeile (unsicher ob Bedarf)
\newbibmacro*{bbx:parunit}{%
\ifbibliography
{\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\clearlist{pageref}%
\setunit{\adddot\par\nobreak}}
{}}
\renewbibmacro*{doi+eprint+url}{%
\usebibmacro{bbx:parunit}% Added
\iftoggle{bbx:doi}
{\printfield{doi}}
{}%
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\iftoggle{bbx:url}
{\usebibmacro{url+urldate}}
{}}
\renewbibmacro*{eprint}{%
\usebibmacro{bbx:parunit}% Added
\iffieldundef{eprinttype}
{\printfield{eprint}}
{\printfield[eprint:\strfield{eprinttype}]{eprint}}}
\renewbibmacro*{url+urldate}{%
\usebibmacro{bbx:parunit}% Added
\printfield{url}%
\iffieldundef{urlyear}
{}
{\setunit*{\addspace}%
\printtext[urldate]{\printurldate}}}
\begin{filecontents}{\jobname.bib}
@incollection{Slemrod.2002,
author = {Slemrod, Joel and Yitzhaki, Shlomo},
title = {Tax Avoidance, Evasion, and Administration},
urldate = {2020-06-22},
pages = {1423-1470},
crossref = {Auerbach.2002},
}
@collection{Auerbach.2002,
editor = {Auerbach, Alan J. and Feldstein, M.},
maintitle = {Handbook of Public Economics},
year = {2002},
volume = {3},
edition = {1},
address = {Amsterdam},
publisher = {Elsevier/North Holland},
isbn = {9780444823144},
series = {Handbooks in Economics},
url = {https://www.elsevier.com/books/handbook-of-public-economics/feldstein/978-0-444-82314-4},
urldate = {2020-06-22},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
\autocite{sigfridsson,Slemrod.2002,Auerbach.2002}
\printbibliography
\end{document}