我正在尝试在我的参考书目中使用@techreport,并更改技术报告标签或类型。
我尝试关注 MWE,
\startbuffer[bib]
@techreport{Doe2019,
author = {Jane Doe},
address = {Brussel},
institution = {European Parliamentary Research Service},
title = {The EU poultry meat and egg sector},
year = {2019},
type = {Not technical report} % I want to use othe type.
}
\stopbuffer
\usebtxdataset[default][bib.buffer]
\loadbtxdefinitionfile[apa]
\usebtxdefinitions[apa]
\setupbtx[dataset=default]
\definebtxrendering[default][apa][specification=apa,sorttype=authoryear,numbering=no]
\starttext
\startbodymatter
I want the change the label Technical report into something else \cite[Doe2019]. But it is shown twice. The one in the box bracket is not desirable.
\\
\\
\placelistofpublications[criterium=all]
\stopbodymatter
\stoptext
生成的 pdf 显示更改的标签两次,一次在方括号中,另一次在圆括号中。
我该怎么办?谢谢。
答案1
publ-imp-apa.mkvi:1506-1512
有:
% A report published by a school or other institution, usually numbered within a series.
% Required fields: author, title, institution, year.
% Optional fields: type, number, address, month, note.
\startsetups btx:apa:list:techreport
\fastsetup{btx:apa:list:book}
\stopsetups
所以一份技术报告就相当于一本书。
publ-imp-apa.mkvi:1382-1385
有:
\startsetups btx:apa:list:book
\texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}
\texdefinition{btx:apa:type}
\texdefinition{btx:apa:editionset}
\texdefinition{btx:apa:wherefrom-publisher}
\texdefinition{btx:apa:url-doi-note}
\stopsetups
现在我们看一下publ-imp-apa.mkvi:1113-1123
:
\starttexdefinition mutable protected btx:apa:editionset
\setmode{btx:apa:editionset-is-empty}
\doif {\currentbtxcategory} {techreport} {
\texdefinition{btx:apa:leftparenthesis-or-comma}
\btxdoifelse {type} {
\btxusecommand [apa:\s!list:type] {
\btxflush{type}
}
} {
\btxlabeltext{technicalreport}
}
我们可以看到btx:apa:type
和都btx:apa:editionset
排版了类型,这就是这个问题的根源。
我不确定您是否要删除 [括号] 类型或 (括号) 类型;以下代码可以执行以下任一操作:
\startbuffer[bib]
@techreport{Doe2019,
author = {Jane Doe},
address = {Brussel},
institution = {European Parliamentary Research Service},
title = {The EU poultry meat and egg sector},
year = {2019},
type = {Not technical report}
}
\stopbuffer
\usebtxdataset[default][bib.buffer]
\usebtxdefinitions[apa]
%% Remove the [bracketed] type
% \letcsname btx:apa:type\endcsname\relax
%% [end]
%% Remove the (parenthesized) type
\let\origbtxrightparenthesisperiod\btxrightparenthesisperiod
\def\resetbtxrightparenthesisperiod{%
\let\btxrightparenthesisperiod\origbtxrightparenthesisperiod%
}
\def\btxtypehelper#-{%
\removepunctuation%
\let\btxrightparenthesisperiod\resetbtxrightparenthesisperiod%
}
\setupbtx[apa:list:type][command=\btxtypehelper]
%% (end)
\startTEXpage
\nocite[Doe2019]
\placelistofpublications
\stopTEXpage