这个问题升级为这(已回答)问题。
我正在使用biblatex-apa
作为biber
后端。
根据 APA 格式,“翻译”作品应与“重印”作品区别对待。已翻译“作品”将只标明译者,并在末尾标明原始出版日期(...Somepress. (Original work published 1923)
),而不标明翻译所基于的源作品的任何其他附加信息。与“重新出版”或“重印书“。相反,“重印章节“需要注明书的原名,章节/文章最初发表的页码,原书的作者/编辑,最初出版的年份,城市和出版商。
然后,我在参考书目中添加了两个字段,以存储有关原始作品的参考信息reprintedfrom
(如果章节/文章已经打印)和原始出版页面origpages
。
然后,我正在寻找一个宏来区分翻译、重新出版或重印的书籍和重新出版的章节/文章。
在第一种情况下应该打印
布伯,M.(1937)。我和你(RG Smith 译)。爱丁堡:T. & T. Clark。(原著出版于 1923 年)
文内附有括号引用:(Buber, 1923/1937)
;
而在第二个
Cohen, J. (1997). 协商与民主合法性。J. Bohman & W. Rehg (Eds.),协商民主:理性与政治论文(第 67-91 页)。马萨诸塞州剑桥:麻省理工学院出版社。(转载自良好政体:国家的规范分析,第 17-34 页,AP Hamlin & P. Pettit 编,1989 年,牛津:Blackwell)
带有文内括号引用:(Cohen, 1989/1997)
。
这个答案提供一个宏来向特定 bib 项的参考书目添加字段,并将其添加到参考的末尾:
Cohen, J. (1997). 协商与民主合法性。J. Bohman & W. Rehg (Eds.),协商民主:理性与政治论文(第 67-91 页)。马萨诸塞州剑桥:麻省理工学院出版社。(转载自良好政体:国家的规范分析,AP Hamlin & P. Pettit 编,1989 年,牛津:Blackwell)(原著于 1989 年出版)
问题是它不会增加原始作品的页数,也不会删除(Original work published 1989)
完整引用中多余的内容。
我想知道是否可以调整这些宏以获得如上所述的不同引用样式。
请考虑以下事项
\RequirePackage{filecontents}
\begin{filecontents*}{mybib.bib}
@book{test1,
address = {Edinburgh},
title = {I and thou},
publisher = {T. \& {T}. {Clark}},
author = {Buber, Martin},
translator = {Smith, Ronald Gregor},
year = {1937},
origdate = {1923}
}
@incollection{test2,
address = {Cambridge, {MA}},
title = {Deliberation and democratic legitimacy},
booktitle = {Deliberative democracy: {Essays} on reason and politics},
publisher = {MIT {Press}},
author = {Cohen, Joshua},
editor = {Bohman, James and Rehg, William},
year = {1997},
origdate = {1989},
reprintedfrom = {test3},
origpages = {17--34},
pages = {67--91}
}
@book{test3,
address = {Oxford},
title = {The {Good} polity: {Normative} analysis of the state},
shorttitle = {The {Good} polity},
publisher = {Blackwell},
editor = {Hamlin, Alan P. and Pettit, Philip},
year = {1989}
}
}
\end{filecontents*}
\documentclass[a4paper]{article}
% Set the values for the bibliography
\usepackage[
style=apa,
backend=biber,
isbn=false,
url=false,
doi=false,
eprint=false,
hyperref=true,
backref=false,
firstinits=false,
]{biblatex}
% Recommended by biblatex
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{xpatch}
% Set language
\usepackage[british]{babel}
\DeclareLanguageMapping{british}{british-apa}
\addbibresource{mybib.bib}
\begin{document}
\cite{test1}
\cite{test2}
\printbibliography
\end{document}
这是输出
当我试图
答案1
你可能想尝试一下这个稍微修改过的映射命令
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=reprintedfrom, fieldtarget=related, final]
\step[fieldset=relatedtype, fieldvalue={reprintfrom}]
}
}
}
它会将非标准转变reprintedfrom={something}
为related={something}
和relatedtype={reprintfrom}
。
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{test1,
address = {Edinburgh},
title = {I and thou},
publisher = {T. \& {T}. {Clark}},
author = {Buber, Martin},
translator = {Smith, Ronald Gregor},
year = {1937},
origdate = {1923}
}
@incollection{test2,
address = {Cambridge, {MA}},
title = {Deliberation and democratic legitimacy},
booktitle = {Deliberative democracy: {Essays} on reason and politics},
publisher = {MIT {Press}},
author = {Cohen, Joshua},
editor = {Bohman, James and Rehg, William},
year = {1997},
origdate = {1989},
reprintedfrom = {test3},
pages = {67--91},
}
@book{test3,
address = {Oxford},
title = {The {Good} polity: {Normative} analysis of the state},
shorttitle = {The {Good} polity},
publisher = {Blackwell},
editor = {Hamlin, Alan P. and Pettit, Philip},
year = {1989},
pages = {17--34},% that's better than origpages in test2
}
}
\end{filecontents*}
\documentclass[a4paper]{article}
% Set the values for the bibliography
\usepackage[
style=apa,
backend=biber,
isbn=false,
url=false,
doi=false,
eprint=false,
hyperref=true,
backref=false,
firstinits=false,
]{biblatex}
% Recommended by biblatex
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{xpatch}
% Set language
\usepackage[british]{babel}
\DeclareLanguageMapping{british}{british-apa}
\addbibresource{\jobname.bib}
\renewbibmacro*{related:reprintfrom}[1]{%
\entrydata*{#1}{%
\printtext{\mkbibemph{\printfield[apacase]{title}}}%
\setunit{\bibpagespunct}%
\printfield{pages}%
\setunit{\addcomma\addspace}%
\bibstring{byauthor}\addspace
\printnames[apanames][-\value{listtotal}]{editor}%
\ifnameundef{editor}
{}
{\addcomma\addspace
\usebibmacro{apaeditorstrg}{editor}}
\printnames[apanames][-\value{listtotal}]{author}%
\setunit{\addcomma\addspace}%
\usebibmacro{date}%
\setunit{\addcomma\addspace}%
\usebibmacro{location+publisher}%
\newunit\newblock
\usebibmacro{related}}}
\DefineBibliographyStrings{british}{
reprintfrom = {Reprinted from}
}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=reprintedfrom, fieldtarget=related, final]
\step[fieldset=relatedtype, fieldvalue={reprintfrom}]
}
}
}
\renewbibmacro*{origyear}{%
\ifboolexpr{not test {\iffieldundef{labelyear}} and not test {\iffieldsequal{labelyear}{origyear}} and not test {\iffieldequalstr{relatedtype}{reprintfrom}}}
{\printfield{origyear}}
{}}
\begin{document}
\cite{test1}
\cite{test2}
\printbibliography
\end{document}
但问题是origpages
;最好的解决方案是将的内容添加到相关条目origpages
中pages
,如上所示。
但是如果您无法忍受改变您的 bibsource,那么这个重新定义related:reprintfrom
可能适合您。
\DeclareFieldFormat{origpages}{\mkpageprefix[bookpagination]{#1}}
\renewbibmacro*{related:reprintfrom}[1]{%
\entrydata*{#1}{%
\printtext{\mkbibemph{\printfield[apacase]{title}}}}%
\setunit{\bibpagespunct}%
\printfield{origpages}%
\entrydata*{#1}{%
\setunit{\addcomma\addspace}%
\bibstring{byauthor}\addspace
\printnames[apanames][-\value{listtotal}]{editor}%
\ifnameundef{editor}
{}
{\addcomma\addspace
\usebibmacro{apaeditorstrg}{editor}}
\printnames[apanames][-\value{listtotal}]{author}%
\setunit{\addcomma\addspace}%
\usebibmacro{date}%
\setunit{\addcomma\addspace}%
\usebibmacro{location+publisher}%
\newunit\newblock
\usebibmacro{related}}}
不过,您必须告诉biblatex
/Biber 才能识别origpages
。这可以通过以下方式完成
\begin{filecontents*}{biblatex-dm.cfg}
\DeclareDatamodelFields[type=field,datatype=range]{origpages}
\DeclareDatamodelEntryfields{origpages}
\end{filecontents*}
另一个MWE
\RequirePackage{filecontents}
\begin{filecontents*}{biblatex-dm.cfg}
\DeclareDatamodelFields[type=field,datatype=range]{origpages}
\DeclareDatamodelEntryfields{origpages}
\end{filecontents*}
\begin{filecontents*}{\jobname.bib}
@book{test1,
address = {Edinburgh},
title = {I and thou},
publisher = {T. \& {T}. {Clark}},
author = {Buber, Martin},
translator = {Smith, Ronald Gregor},
year = {1937},
origdate = {1923}
}
@incollection{test2,
address = {Cambridge, {MA}},
title = {Deliberation and democratic legitimacy},
booktitle = {Deliberative democracy: {Essays} on reason and politics},
publisher = {MIT {Press}},
author = {Cohen, Joshua},
editor = {Bohman, James and Rehg, William},
year = {1997},
origdate = {1989},
reprintedfrom = {test3},
%related = {test3},
%relatedtype={reprintfrom},
origpages = {17--34},
pages = {67--91}
}
@book{test3,
address = {Oxford},
title = {The {Good} polity: {Normative} analysis of the state},
shorttitle = {The {Good} polity},
publisher = {Blackwell},
editor = {Hamlin, Alan P. and Pettit, Philip},
year = {1989}
}
}
\end{filecontents*}
\documentclass[a4paper]{article}
% Set the values for the bibliography
\usepackage[
style=apa,
backend=biber,
isbn=false,
url=false,
doi=false,
eprint=false,
hyperref=true,
backref=false,
firstinits=false,
]{biblatex}
% Recommended by biblatex
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{xpatch}
% Set language
\usepackage[british]{babel}
\DeclareLanguageMapping{british}{british-apa}
\addbibresource{\jobname.bib}
\DeclareFieldFormat{origpages}{\mkpageprefix[bookpagination]{#1}}
\renewbibmacro*{related:reprintfrom}[1]{%
\entrydata*{#1}{%
\printtext{\mkbibemph{\printfield[apacase]{title}}}}%
\setunit{\bibpagespunct}%
\printfield{origpages}%
\entrydata*{#1}{%
\setunit{\addcomma\addspace}%
\bibstring{byauthor}\addspace
\printnames[apanames][-\value{listtotal}]{editor}%
\ifnameundef{editor}
{}
{\addcomma\addspace
\usebibmacro{apaeditorstrg}{editor}}
\printnames[apanames][-\value{listtotal}]{author}%
\setunit{\addcomma\addspace}%
\usebibmacro{date}%
\setunit{\addcomma\addspace}%
\usebibmacro{location+publisher}%
\newunit\newblock
\usebibmacro{related}}}
\DefineBibliographyStrings{british}{
reprintfrom = {Reprinted from}
}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=reprintedfrom, fieldtarget=related, final]
\step[fieldset=relatedtype, fieldvalue={reprintfrom}]
}
}
}
\renewbibmacro*{origyear}{%
\ifboolexpr{not test {\iffieldundef{labelyear}} and not test {\iffieldsequal{labelyear}{origyear}} and not test {\iffieldequalstr{relatedtype}{reprintfrom}}}
{\printfield{origyear}}
{}}
\begin{document}
\cite{test1}
\cite{test2}
\printbibliography
\end{document}
为了删除origyear
重印末尾的信息,我们修改了宏以包含对重印条目的测试(它检查是否relatedtype
设置为reprintfrom
;映射会处理该问题);如果是重印,则跳过该信息。
\renewbibmacro*{origyear}{%
\ifboolexpr{not test {\iffieldundef{labelyear}} and not test {\iffieldsequal{labelyear}{origyear}} and not test {\iffieldequalstr{relatedtype}{reprintfrom}}}
{\printfield{origyear}}
{}}
两种 MWE 均产生