summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx')
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx95
1 files changed, 66 insertions, 29 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx
index 2ecd604b01..fb67497c2f 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx
@@ -10,7 +10,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2021/05/06 v1.0y}
+\def\versionofgbtstyle{2021/08/19 v1.0z}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015ay.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -951,21 +951,17 @@
\DeclareSourcemap{
\maps[datatype=bibtex]{%
- \map{%当没有作者时将editor转成author
- \pernottype{inbook}%因为in系列中editor可能用来表示bookauthor,所以排除
- \pernottype{inproceedings}
- \pernottype{incollection}
- \pernottype{periodical}%因为peridical直接使用editor,所以排除
- %注意notfield在低版本biblatex中没有
- %\step[notfield=author,final]%当author不存在,将editor复制给author
- \step[fieldsource=editor,fieldtarget=author]%并删除editor
+ \map{%如果author或者editor或者translator存在,那么设置namea便于后面判断。
+ \step[fieldsource=author,final]
+ \step[fieldset=namea,origfieldval]
}
- \map{%当没有作者时将translator转成author
- \pernottype{inbook}
- \pernottype{inproceedings}
- \pernottype{incollection}
- %\step[notfield=author,final]%当author不存在,将translator复制给author
- \step[fieldsource=translator,fieldtarget=author]%并删除translator
+ \map{%
+ \step[fieldsource=editor,final]
+ \step[fieldset=namea,origfieldval]
+ }
+ \map{%
+ \step[fieldsource=translator,final]
+ \step[fieldset=namea,origfieldval]
}
\map{%让address和location同步,biblatex中address是location的别名
%因此输出的时候只有location信息,但处理过程中是可以存在address的。
@@ -2033,6 +2029,8 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
% 这里调整一下两种语言参考文献的间隔,源来自biblatex.def
\renewcommand*{\entrysetpunct}{\adddot\par\nobreak}%ay样式用par也可以,因为没有悬挂对齐问题
\renewcommand*{\bibpagespunct}{\addcolon\addthinspace}%%页码引用格式的修改,修改为用冒号
+% 2021.08.19,增加出版地和出版社之间的标点,hzz
+\newcommand{\publocpunct}{\addcolon\addspace}%出版项中:出版社地址后面的标点
%\renewcommand{\relateddelim}{}%\par
%=====================================================================
@@ -2215,6 +2213,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
% v1.0w,20210401,hzz,针对其它语言的译者后的标点与中文不同做处理
% 原理方法:判断作者或译者是否中文,若中文用字符等,否则用et al. 。
% \printnames由start-stop控制项数,默认是1和maxnames/minnames
+\newcommand{\aftertransdelim}{\addcomma\addthinspace}
\renewbibmacro*{name:andothers}{\bibauthorfont%
\ifboolexpr{
test {\ifnumequal{\value{listcount}}{\value{liststop}}}
@@ -2228,7 +2227,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7
%袁训来, 陈哲, 肖书海, 等.
%胡泳, 范海燕, 译.
%潘惠霞, 魏婧, 杨艳, 等译.
-\ifcurrentname{translator}{\iffieldequalstr{usere}{chinese}{\addcomma\addthinspace}{}}{}%为了实现上述第二个示例情况做的处理
+\ifcurrentname{translator}{\iffieldequalstr{usere}{chinese}{\aftertransdelim}{}}{}%为了实现上述第二个示例情况做的处理
}}
% 修改省略作者后的本地化字符串,比如et al.
@@ -3008,7 +3007,7 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}%
}{%
\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}}{\printtext{[S.l.\adddot]}}}%
{\printlist{location}}%
-\addcolon\addspace%
+\publocpunct%
\iflistundef{institution}{%
\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}}{\printtext{\mkbibbrackets{s.n.}}}}% \bibstring{nopublisher}%[s.n.\adddot]
{\printlist{institution}}}%
@@ -3021,7 +3020,7 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}%
{ \printlist{location}%
\iflistundef{institution}%
{\setunit*{\addcomma\space}}
- {\setunit*{\addcolon\space}}%
+ {\setunit*{\publocpunct}}%
\printlist{institution}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
@@ -3040,8 +3039,8 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}%
{\iffieldequalstr{note}{standard}{}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}{\printtext{[S.l.\space :\space s.n.\adddot]}}}}%
{\iflistundef{location}{%\adddot
\iffieldequalstr{note}{standard}{}%%从gbt7714-2015标准第19页看到,标准存在出版项时输出,没有时完全省略。
- {\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}\addcolon\addspace}{\printtext{[S.l.\adddot]}\addcolon\addspace}}}% \bibstring{noaddress}
- {\printlist{location}\addcolon\addspace}%%\addcolon\addspace%
+ {\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}\addcolon\addspace}{\printtext{[S.l.\adddot]}\publocpunct}}}% \bibstring{noaddress}
+ {\printlist{location}\publocpunct}%%\addcolon\addspace%
\iflistundef{publisher}{%
\iffieldequalstr{note}{standard}{}%
{\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
@@ -3053,7 +3052,7 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}%
{\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
- {\setunit*{\addcolon\space}}%
+ {\setunit*{\publocpunct}}%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%%\newunit
@@ -3069,7 +3068,7 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}%
{\printlist{location}%%加了一个编组避免\usebibmacro{date}把month和day信息去掉
\iflistundef{institution}
{\setunit*{\addcomma\space}}
- {\setunit*{\addcolon\space}}%
+ {\setunit*{\publocpunct}}%
\printlist{institution}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
@@ -3507,6 +3506,44 @@ test {\ifentrytype{conference}}
}%
}
+% 责任者如果没有author用editor或translator替代
+% 20210521 v1.0y hzz
+%专著如果责任者是editor那么不用输出类型信息
+\renewbibmacro*{editor+others}{%
+ \ifboolexpr{
+ test \ifuseeditor
+ and
+ not test {\ifnameundef{editor}}
+ }
+ {\usebibmacro{bbx:dashcheck}
+ {\bibnamedash}
+ {\printnames{editor}%
+ \usebibmacro{bbx:savehash}}%
+ \clearname{editor}%
+ \setunit{\printdelim{nameyeardelim}}}%
+ {\global\undef\bbx@lasthash
+ \usebibmacro{labeltitle}%
+ \setunit*{\printdelim{nonameyeardelim}}}%
+ \usebibmacro{date+extradate}}
+%要注意要使用translator那么需要开启usetranslator选项的。
+%注意其中的标点处理。
+\renewbibmacro*{translator+others}{%
+ \ifboolexpr{
+ test \ifusetranslator
+ and
+ not test {\ifnameundef{translator}}
+ }
+{\usebibmacro{bbx:dashcheck}
+ {\bibnamedash}
+ {\renewcommand{\aftertransdelim}{\adddot\addspace}\printnames{translator}%
+ \usebibmacro{bbx:savehash}}%
+ \clearname{translator}%
+ \setunit{\printdelim{nameyeardelim}}}%
+ {\global\undef\bbx@lasthash
+ \usebibmacro{labeltitle}%
+ \setunit*{\printdelim{nonameyeardelim}}}%
+ \usebibmacro{date+extradate}}
+
%
% 修改期刊的标题
%
@@ -3655,7 +3692,7 @@ test {\ifentrytype{conference}}
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
-\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
+\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
\usebibmacro{maintitle+title}%
\iftoggle{bbx:gbstrict}{}{%
\newunit
@@ -3842,7 +3879,7 @@ test {\ifentrytype{conference}}
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
-\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
+\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
\usebibmacro{title}%
\iftoggle{bbx:gbstrict}{}{%
\newunit%
@@ -3891,8 +3928,8 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
\DeclareBibliographyDriver{report}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
- \usebibmacro{author}%
-\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
+ \usebibmacro{author/editor+others/translator+others}%
+\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
\usebibmacro{title}%
\iftoggle{bbx:gbstrict}{}{%
\newunit%
@@ -3940,8 +3977,8 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
\DeclareBibliographyDriver{manual}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
- \usebibmacro{author}%
-\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
+ \usebibmacro{author/editor+others/translator+others}%
+\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
\usebibmacro{title}%
\iftoggle{bbx:gbstrict}{}{%
\newunit%
@@ -3994,7 +4031,7 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
-\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
+\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点
\usebibmacro{title}%
\iftoggle{bbx:gbstrict}{}{%
\newunit