summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-03-30 21:24:58 +0000
committerKarl Berry <karl@freefriends.org>2019-03-30 21:24:58 +0000
commitdd6bb2ce98e55e005893bdd5c6736725697db748 (patch)
treef771db65e9ad0b4cd83dde4c6a42fb6838edd07b /Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx
parent968b54c01ec82d717f37b6f3175b95da1029cf32 (diff)
biblatex-gb7714-2015 (30mar19)
git-svn-id: svn://tug.org/texlive/trunk@50661 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx371
1 files changed, 308 insertions, 63 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx
index cc8c75d3e7e..6429952be64 100644
--- a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx
+++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx
@@ -11,10 +11,10 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2019/02/11 v1.0q}
+\def\versionofgbtstyle{2019/03/28 v1.0r}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015.bbx}[\versionofgbtstyle biblatex bibliography style]
-\RequireBiber[3]%显式指定用biber后端
+%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
%=====================================================================
% 加载标准样式
@@ -193,9 +193,11 @@
%为与lee zeping的bst的样式统一,使用mark和medium这两域名
%为单个条目的姓名格式控制增加nameformat和namefmtid两个域
%为缩略信息文献表增加了shortbooktitle域
+ %为多语言排序增加了lansortorder域
\DeclareDatamodelFields[type=field,datatype=literal]{mark,medium,nameformat}
\DeclareDatamodelFields[type=field,datatype=integer]{namefmtid}
\DeclareDatamodelFields[type=field,datatype=literal]{shortbooktitle}
+ \DeclareDatamodelFields[type=field,datatype=literal]{lansortorder}
@@ -203,6 +205,14 @@
% 设置宏包选项
%=====================================================================
%
+ % 增加一个控制是否输出type域的选项
+ % 20190212,v1,0q,hzz
+ \newtoggle{bbx:gbfieldtype}
+ \DeclareBibliographyOption{gbfieldtype}[false]{%biblatex低版本
+ \settoggle{bbx:gbfieldtype}{#1}}
+ \ExecuteBibliographyOptions{gbfieldtype}
+
+ %
% 增加一个选项,用于控制是否实现GB/T 7714-2015标准的脚注文献表
% 20190203,v1.0p,hzz
% 原理方法:默认做patch,文献引用带圈上标数字表示,脚注中的文献用带圈非上标数字做标签
@@ -213,6 +223,10 @@
\ExecuteBibliographyOptions{gbfootbib}
%%
+ \newlength{\footbibmargin}
+ \newlength{\footbiblabelsep}
+ \setlength{\footbibmargin}{1em}%脚注的段落左侧缩进距离
+ \setlength{\footbiblabelsep}{0.5em}%脚注中标记号与脚注段落的间距
\def\execgbfootbib%
{%
%开启引用跟踪计数器,为使用\ifciteseen等测试命令
@@ -224,8 +238,80 @@
%beamer类因为其特殊性,为避免冲突不调footmisc。
%同时footmisc与hyperref宏包也不兼容,所以使用footmisc时会破坏脚注的超链接
%如果要实现超链接可以将下句注释掉,这里留着主要是实现悬挂对齐。
- \PassOptionsToPackage{perpage,hang}{footmisc}
- \RequirePackage{footmisc}}
+ %\PassOptionsToPackage{perpage,hang}{footmisc}%
+ %\RequirePackage{footmisc}%
+
+ %重新实现脚注的根据单页重设脚注号码
+ %重新实现脚注的悬挂对齐问题,不再使用footmisc,直接从latex核心代码和hyperref代码进行修改
+ %v1.0q 20190317 hzz
+ \@addtoreset{footnote}{page}%重设计数器
+
+\@ifpackageloaded{hyperref}{%加载hyperref则对\H@@footnotetext做重定义
+ \long\def\H@@footnotetext##1{\insert\footins{%
+ \reset@font\footnotesize
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\footnotesep
+ \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+ \hsize\columnwidth \@parboxrestore
+ \protected@edef\@currentlabel{%
+ \csname p@footnote\endcsname\@thefnmark
+ }%
+ \color@begingroup
+ \leftskip \footbibmargin%增加的左侧缩进
+ \@makefntext{%
+ \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox%
+ }%
+ \color@endgroup}}%
+
+ \long\def\H@@mpfootnotetext##1{%
+ \global\setbox\@mpfootins\vbox{%
+ \unvbox\@mpfootins
+ \reset@font\footnotesize
+ \hsize\columnwidth
+ \@parboxrestore
+ \protected@edef\@currentlabel
+ {\csname p@mpfootnote\endcsname\@thefnmark}%
+ \leftskip \footbibmargin%增加的左侧缩进
+ \color@begingroup
+ \@makefntext{%
+ \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox}%
+ \color@endgroup}}
+ }{%否则对latex核心代码中的\@footnotetext做重定义
+ \long\def\@footnotetext##1{\insert\footins{%
+ \reset@font\footnotesize
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\footnotesep
+ \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+ \hsize\columnwidth \@parboxrestore
+ \protected@edef\@currentlabel{%
+ \csname p@footnote\endcsname\@thefnmark
+ }%
+ \color@begingroup
+ \leftskip \footbibmargin%增加的左侧缩进
+ \@makefntext{%
+ \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox%
+ }%
+ \color@endgroup}}%
+
+ \long\def\@mpfootnotetext##1{%
+ \global\setbox\@mpfootins\vbox{%
+ \unvbox\@mpfootins
+ \reset@font\footnotesize
+ \hsize\columnwidth
+ \@parboxrestore
+ \protected@edef\@currentlabel
+ {\csname p@mpfootnote\endcsname\@thefnmark}%
+ \leftskip \footbibmargin%增加的左侧缩进
+ \color@begingroup
+ \@makefntext{%
+ \rule\z@\footnotesep\ignorespaces##1\@finalstrut\strutbox}%
+ \color@endgroup}}
+ }
+
+ \long\def\@makefntext##1{%增加了脚注标记与正文的间隔
+ \parindent 1em\noindent \hb@xt@ 0em{\hss \@makefnmark\makebox[\footbiblabelsep]{}}##1}
+
+ }
%
%使脚注标记加圈并设置数字的字体为tiny,不使用修改thefootnote的方式
@@ -241,6 +327,7 @@
%
%判断当前文献是否已经引用过且是做的footfullcite(即已经作为脚注输出文献内容)
%记录首次输出时的脚注号码,用于后面再次引用该文献时的输出,比如同(4)。
+ %v1.0q 20190309 区分使脚注标注适应minipage中的情况
\newbibmacro*{citesavefn}{%
\ifciteseen%当被引用过为true
{\ifcsdef{sec\arabic{refsection}et\thefield{entrykey}}%当已经定义过脚注序号信息
@@ -248,9 +335,14 @@
\str@sameentry\gdef\@thefnmark{\csuse{sec\arabic{refsection}et\thefield{entrykey}}}%
\@makefnmark%
}}%
- {\csxdef{sec\arabic{refsection}et\thefield{entrykey}}{\arabic{footnote}}}%
+ {\csxdef{sec\arabic{refsection}et\thefield{entrykey}}{%
+ \ifcsstring{@mpfn}{mpfootnote}{\@alph\c@mpfootnote}{\thefootnote}%
+ }}%
}%
- {\csxdef{sec\arabic{refsection}et\thefield{entrykey}}{\arabic{footnote}}}%
+ {\csxdef{sec\arabic{refsection}et\thefield{entrykey}}{%
+ \ifcsstring{@mpfn}{mpfootnote}{\@alph\c@mpfootnote}{\thefootnote}%
+ %判断在minipage中比较麻烦,这里使用\@mpfn的定义进行判断
+ }}%
}
%
@@ -323,6 +415,10 @@
\def\str@numbercn{册}
\def\str@serialcn{第}
\def\str@sameentry{同}
+ \def\str@incn{见}
+ \def\str@mathesiscn{硕士学位论文}
+ \def\str@phdthesiscn{博士学位论文}
+ \def\str@editorcn{主编}
\AtEndOfPackage{%
\iftoggle{bbx:codegbk}{%
@@ -474,6 +570,12 @@
\@ifpackagelater{biblatex}{2016/03/27}
{ % 针对biblatex>=3.3版本的选项设置
+ % 增加不同语言排序的切换选项
+ % numeric样式,不使用该选项,这里给出仅为兼容性考虑
+ % v1.0q,20190307,hzz
+ %
+ \DeclareBibliographyOption[string]{gblanorder}[chineseahead]{}
+
%
% 增加本地化字符串的中英文切换选项
% gbcitelocal指标注中的本地化字符串
@@ -519,6 +621,7 @@
\ifstrequal{#1}{givenahead}{\setcounter{gbnamefmtcase}{2}}{}%given-family
\ifstrequal{#1}{familyahead}{\setcounter{gbnamefmtcase}{3}}{}
\ifstrequal{#1}{pinyin}{\setcounter{gbnamefmtcase}{4}}{}%family-given
+ \ifstrequal{#1}{reverseorder}{\setcounter{gbnamefmtcase}{5}}{}%family-given/given-family
}
\ExecuteBibliographyOptions{gbnamefmt}
@@ -534,6 +637,12 @@
}
}
{% 针对biblatex<3.3版本的选项设置
+ % 增加不同语言排序的切换选项
+ % numeric样式,不使用该选项,这里给出仅为兼容性考虑
+ % v1.0q,20190307,hzz
+ %
+ \DeclareBibliographyOption{gblanorder}[chineseahead]{}
+
%
% 增加序号标签格式处理选项
% v1.0l,20180623,hzz
@@ -552,6 +661,7 @@
\ifstrequal{#1}{givenahead}{\setcounter{gbnamefmtcase}{2}}{}%given-family
\ifstrequal{#1}{familyahead}{\setcounter{gbnamefmtcase}{3}}{}
\ifstrequal{#1}{pinyin}{\setcounter{gbnamefmtcase}{4}}{}%family-given
+ \ifstrequal{#1}{reverseorder}{\setcounter{gbnamefmtcase}{5}}{}%family-given/given-family
}
\ExecuteBibliographyOptions{gbnamefmt}
@@ -639,6 +749,13 @@
\NewBibliographyString{volumecn}
\NewBibliographyString{numbercn}
\NewBibliographyString{serialcn}
+ \NewBibliographyString{incn}
+ \NewBibliographyString{mathesiscn}
+ \NewBibliographyString{phdthesiscn}
+ \NewBibliographyString{editorcn}
+ \NewBibliographyString{editorscn}
+
+
%
% 修改一些当地化字符串
@@ -669,6 +786,11 @@
andotherskr={외},
andjp={和},
andkr={和},
+ incn={\str@incn\addcolon\addspace},
+ mathesiscn={\str@mathesiscn},
+ phdthesiscn={\str@phdthesiscn},
+ editorscn={\str@editorcn},
+ editorcn={\str@editorcn},
}
@@ -846,11 +968,6 @@
\step[fieldsource=version] %有时会把version和edition混淆,处理后直接用edition
\step[fieldset=edition, origfieldval]
}
- \map{
- \pertype{inbook}
- \step[fieldsource=editor]%有时会把editor和bookauthor混淆,处理后使用bookauthor
- \step[fieldset=bookauthor, origfieldval]
- }
\map{%兼容老的standard类型,确定文献类型标识符
\pertype{standard}
\step[fieldset=usera, fieldvalue={S}]
@@ -866,8 +983,6 @@
\step[fieldset=usera, fieldvalue={C}]
\step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher
\step[fieldset=publisher, origfieldval]
- \step[fieldsource=editor]%%有时会把editor和bookauthor混淆,处理后使用bookauthor
- \step[fieldset=bookauthor, origfieldval]
}
\map{
\pertype{proceedings}
@@ -880,8 +995,6 @@
\step[fieldset=usera, fieldvalue={G}]
\step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用publisher
\step[fieldset=publisher, origfieldval]
- \step[fieldsource=editor]%%有时会把editor和bookauthor混淆,处理后使用bookauthor
- \step[fieldset=bookauthor, origfieldval]
}
\map{
\pertype{collection}
@@ -1081,27 +1194,27 @@
\step[fieldset=userd,origfieldval]
}
\map{%当文献给出language域时,设置文献要使用的本地化字符串的语言
- \step[fieldsource=language,match=english,final]
+ \step[fieldsource=language,match=\regexp{(e|E)(n|N)(g|G)(l|L)(i|I)(s|S)(h|H)},final]
\step[fieldset=langid,fieldvalue={english}]
}
\map{
- \step[fieldsource=language,match=russian,final]
+ \step[fieldsource=language,match=\regexp{(r|R)(u|U)(s|S)(s|S)(i|I)(a|A)(n|N)},final]
\step[fieldset=langid,fieldvalue={russian}]
}
\map{%
- \step[fieldsource=language,match=french,final]
+ \step[fieldsource=language,match=\regexp{(f|F)(r|R)(e|E)(n|N)(c|C)(h|H)},final]
\step[fieldset=langid,fieldvalue={french}]
}
\map{%
- \step[fieldsource=language,match=chinese,final]%中日韩语目前都用english,
+ \step[fieldsource=language,match=\regexp{(c|C)(h|H)(i|I)(n|N)(e|E)(s|S)(e|E)},final]%中日韩语目前都用english,
\step[fieldset=langid,fieldvalue={english}]
}
\map{%
- \step[fieldsource=language,match=japnese,final]%中日韩语目前都用english,
+ \step[fieldsource=language,match=\regexp{(j|J)(a|A)(p|P)(a|A)(n|N)(e|E)(s|S)(e|E)},final]%中日韩语目前都用english,
\step[fieldset=langid,fieldvalue={english}]
}
\map{%
- \step[fieldsource=language,match=korean,final]%中日韩语目前都用english,
+ \step[fieldsource=language,match=\regexp{(k|K)(o|O)(r|R)(e|E)(a|A)(n|N)},final]%中日韩语目前都用english,
\step[fieldset=langid,fieldvalue={english}]
}
}
@@ -1124,14 +1237,14 @@
\map{%剩下的全部映射为book
\step[typesource=standard, typetarget=book, final]
}
- \map{%先于标准样式的driver层映射,以取消type设置
- \step[typesource=mastersthesis, typetarget=thesis, final]
- %\step[fieldset=type, fieldvalue=mathesis]
- }
- \map{%先于标准样式的driver层映射,以取消type设置
- \step[typesource=phdthesis, typetarget=thesis, final]
- %\step[fieldset=type, fieldvalue=phdthesis]
- }
+% \map{%先于标准样式的driver层映射,以取消type设置
+% \step[typesource=mastersthesis, typetarget=thesis, final]
+% %\step[fieldset=type, fieldvalue=mathesis]
+% }
+% \map{%先于标准样式的driver层映射,以取消type设置
+% \step[typesource=phdthesis, typetarget=thesis, final]
+% %\step[fieldset=type, fieldvalue=phdthesis]
+% }
\map{%先于标准样式的driver层映射,以取消type设置
\step[typesource=techreport, typetarget=report, final]
%\step[fieldset=type, fieldvalue=techreport]
@@ -1282,14 +1395,14 @@
\map{%剩下的全部映射为book
\step[typesource=standard, typetarget=book, final]
}
- \map{%先于标准样式的driver层映射,以取消type设置
- \step[typesource=mastersthesis, typetarget=thesis, final]
- %\step[fieldset=type, fieldvalue=mathesis]
- }
- \map{%先于标准样式的driver层映射,以取消type设置
- \step[typesource=phdthesis, typetarget=thesis, final]
- %\step[fieldset=type, fieldvalue=phdthesis]
- }
+% \map{%先于标准样式的driver层映射,以取消type设置
+% \step[typesource=mastersthesis, typetarget=thesis, final]
+% %\step[fieldset=type, fieldvalue=mathesis]
+% }
+% \map{%先于标准样式的driver层映射,以取消type设置
+% \step[typesource=phdthesis, typetarget=thesis, final]
+% %\step[fieldset=type, fieldvalue=phdthesis]
+% }
\map{%先于标准样式的driver层映射,以取消type设置
\step[typesource=techreport, typetarget=report, final]
%\step[fieldset=type, fieldvalue=techreport]
@@ -1554,28 +1667,40 @@
% 而[]中间的内容,从4.6.2节的例子看也是可以分割的,因此内部的nobreak也可以去掉
%
\DeclareFieldFormat{gbtypeflag}{%
-\iftoggle{bbx:url}{\iffieldundef{url}%当存在url时,增加一个OL标识符
-{\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}%
-{\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}%
-}{\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}}
+\iftoggle{bbx:url}%
+ {\iffieldundef{url}%当存在url时,增加一个OL标识符
+ {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}%
+ {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}%
+ }%
+ {\ifentrytype{online}%
+ {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\texttt{/}OL]}}%
+ {\nobreak\printtext{[}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}}%
+ }%
+}
%
% 新增用于报纸的文献类型标识符的格式
%
\DeclareFieldFormat{gbtypeflagn}{%用于报纸newspaper
-\iftoggle{bbx:url}{\iffieldundef{url}%当存在url时,增加一个OL标识符
-{\nobreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
-{\nobreak\printtext{[}\nobreak N\printtext{\texttt{/}OL]}\nobreak}%
-}{\nobreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}}
+\iftoggle{bbx:url}%
+ {\iffieldundef{url}%当存在url时,增加一个OL标识符
+ {\nobreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
+ {\nobreak\printtext{[}\nobreak N\printtext{\texttt{/}OL]}\nobreak}%
+ }%
+ {\nobreak\printtext{[}\nobreak N\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
+}
%
% 新增用于标准的文献类型标识符的格式
%
\DeclareFieldFormat{gbtypeflags}{%用于标准standard
-\iftoggle{bbx:url}{\iffieldundef{url}%当存在url时,增加一个OL标识符
-{\nobreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
-{\nobreak\printtext{[}\nobreak S\printtext{\texttt{/}OL]}\nobreak}%
-}{\nobreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}}
+\iftoggle{bbx:url}%
+ {\iffieldundef{url}%当存在url时,增加一个OL标识符
+ {\nobreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
+ {\nobreak\printtext{[}\nobreak S\printtext{\texttt{/}OL]}\nobreak}%
+ }%
+ {\nobreak\printtext{[}\nobreak S\printtext{\iffieldundef{medium}{}{\texttt{/}\thefield{medium}}]}\nobreak}%
+}
%
% 重设title等参考文献信息的输出格式
@@ -1690,13 +1815,13 @@
test \ifmorenames
}{\ifnumgreater{\value{liststop}}{1}%
{\finalandcomma}%
- {}%biblatex作者要区别单作者加等的情况,这里为符合gbt7714-2015第7.2节的要求加上了逗号。
+ {}%
\printdelim{andothersdelim}\printdelim{strandothersdelim}%
}{%当是译者的时候需要特殊处理:从7.2节看等,译前面加逗号,但从示例看等和译同时出现时,译前的逗号没有,比如:
%袁训来, 陈哲, 肖书海, 等.
%胡泳, 范海燕, 译.
%潘惠霞, 魏婧, 杨艳, 等译.
-\ifcurrentname{translator}{\addcomma}{}%
+\ifcurrentname{translator}{\addcomma\addthinspace}{}%为了实现上述第二个示例情况做的处理
}}
@@ -1709,8 +1834,6 @@
% 首先设置全局的,然后设置文献表中的,这一等价于将所有的cite命令环境都设置过了
% 而不用对每一个引用命令单独设置,比如cite,parancite,textcite都设置
\DeclareDelimFormat{strandothersdelim}{%
- \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
- \addspace%
\edef\userfieldabcde{userd}%
\ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}%
\ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}%
@@ -1719,7 +1842,7 @@
\ifcase\value{gbbiblocalcase}%
\iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andotherscn}}{}%
\iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andotherskr}}{}%
- \iffieldequalstr{\userfieldabcde}{japnese}{\bibstring{andothersjp}}{}%
+ \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andothersjp}}{}%
\iffieldequalstr{\userfieldabcde}{english}{\bibstring{andothers}}{}%
\iffieldequalstr{\userfieldabcde}{french}{\bibstring{andothers}}{}%
\iffieldequalstr{\userfieldabcde}{russian}{\bibstring{andothers}}{}%
@@ -1748,7 +1871,7 @@
\ifcase\value{gbbiblocalcase}%
\iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andcn}}{}%
\iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andkr}}{}%
- \iffieldequalstr{\userfieldabcde}{japnese}{\bibstring{andjp}}{}%
+ \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andjp}}{}%
\iffieldequalstr{\userfieldabcde}{english}{\bibstring{and}}{}%
\iffieldequalstr{\userfieldabcde}{french}{\bibstring{and}}{}%
\iffieldequalstr{\userfieldabcde}{russian}{\bibstring{and}}{}%
@@ -1853,6 +1976,36 @@
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
+\or
+ \ifnumequal{\value{listcount}}{1}
+ {\ifgiveninits
+ {\usebibmacro{name:family-given}
+ {\namepartfamily}
+ {\namepartgiveni}
+ {\namepartprefix}
+ {\namepartsuffix}}
+ {\usebibmacro{name:family-given}
+ {\namepartfamily}
+ {\namepartgiven}
+ {\namepartprefix}
+ {\namepartsuffix}}%
+ \ifboolexpe{%
+ test {\ifdefvoid\namepartgiven}
+ and
+ test {\ifdefvoid\namepartprefix}}
+ {}
+ {\usebibmacro{name:revsdelim}}}
+ {\ifgiveninits
+ {\usebibmacro{name:given-family}
+ {\namepartfamily}
+ {\namepartgiveni}
+ {\namepartprefix}
+ {\namepartsuffix}}
+ {\usebibmacro{name:given-family}
+ {\namepartfamily}
+ {\namepartgiven}
+ {\namepartprefix}
+ {\namepartsuffix}}}%
\fi
\usebibmacro{name:andothers}}
@@ -2064,6 +2217,17 @@
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}%
\or
\usebibmacro{name:gbpinyin}{#1}{#3}{#5}{#7}%
+ \or
+ \ifnumequal{\value{listcount}}{1}
+ {\iffirstinits
+ {\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}}
+ {\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}}%
+ \ifblank{#3#5}
+ {}
+ {\usebibmacro{name:revsdelim}}}
+ {\iffirstinits
+ {\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}}
+ {\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}%
\fi
\usebibmacro{name:andothers}}
}
@@ -2575,6 +2739,8 @@ incollection,proceedings,inproceedings]{number}{%
%
% 编者的符号修改一下
+% v1.0 2016-07-01
+% v1.0q 2019-03-01 hzz 修改editortype前的标点
%
\renewbibmacro*{editor}{%源来自biblatex.DEF
\ifboolexpr{
@@ -2585,13 +2751,16 @@ incollection,proceedings,inproceedings]{number}{%
{\printnames{editor}%
\iffieldundef{editortype}%增加一个类型判断,用于存在editortype的情况
{\setunit\addspace}%当没有editortype时,直接用句点
- {\setunit{\addcomma\space}%
+ {%\setunit{\addcomma\space}%
\usebibmacro{editorstrg}}%
- \clearname{editor}}
+ %\clearname{editor}
+ }%
{}}
%
% 编者类型做一修改
+% v1.0 2016-07-01
+% v1.0q 2019-03-01 hzz 修改editortype不同语言的不同本地化字符串
%
\renewbibmacro*{editorstrg}{%源来自biblatex.DEF
\printtext[editortype]{%
@@ -2611,12 +2780,71 @@ incollection,proceedings,inproceedings]{number}{%
or
test {\ifandothers{editor}}
}
- {\bibstring{\thefield{editortype}s}}
- {\bibstring{\thefield{editortype}}}}
+ {\printdelim{streditortypes}}
+ {\printdelim{streditortype}}}
{\thefield{editortype}}}%
}}
%
+% 编者类型的本地化字符串输出
+% v1.0q 2019-03-01 hzz
+% 能对不同条目类型作格式设置的域格式,能对不同环境做格式设置的分隔符
+% 能对不同文境作设置的包括排序,标签等
+% 这里因为考虑可能标注和文献表中存在不同,所以用分隔符来输出本地化字符串
+%
+\DeclareDelimFormat{streditortypes}{%
+ \edef\userfieldabcde{userd}%
+ \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}%
+ \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}%
+ \ifcase\value{gbbiblocalcase}%
+ \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{\thefield{editortype}scn}}{}%
+ \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{\thefield{editortype}skr}}{}%
+ \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{\thefield{editortype}sjp}}{}%
+ \iffieldequalstr{\userfieldabcde}{english}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}%
+ \iffieldequalstr{\userfieldabcde}{french}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}%
+ \iffieldequalstr{\userfieldabcde}{russian}{\addcomma\addthinspace\bibstring{\thefield{editortype}s}}{}%
+ \or%
+ \bibstring{\thefield{editortype}scn}%
+ \or%
+ \addcomma\addthinspace\bibstring{\thefield{editortype}s}%
+ \fi}
+%
+\DeclareDelimFormat{streditortype}{%
+ \edef\userfieldabcde{userd}%
+ \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}%
+ \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}%
+ \ifcase\value{gbbiblocalcase}%
+ \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{\thefield{editortype}cn}}{}%
+ \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{\thefield{editortype}kr}}{}%
+ \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{\thefield{editortype}jp}}{}%
+ \iffieldequalstr{\userfieldabcde}{english}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}%
+ \iffieldequalstr{\userfieldabcde}{french}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}%
+ \iffieldequalstr{\userfieldabcde}{russian}{\addcomma\addthinspace\bibstring{\thefield{editortype}}}{}%
+ \or%
+ \bibstring{\thefield{editortype}cn}%
+ \or%
+ \addcomma\addthinspace\bibstring{\thefield{editortype}}%
+ \fi}
+
+
+%
+% bookauthor域的输出,
+% v1.0q 2019-03-01 hzz
+% 不再对editor和bookauthor做sourcemap,而是下面的宏内逻辑代替,
+% 使得除使用bookauthor外也可以使用editor,便于在使用editor时使用editortype
+\renewbibmacro*{bybookauthor}{%
+ \ifnameundef{bookauthor}%
+ {\ifnameundef{editor}%
+ {}%
+ {\ifnamesequal{author}{editor}%
+ {}{\usebibmacro{editor}}}%
+ }%
+ {\ifnamesequal{author}{bookauthor}%
+ {}{\printnames{bookauthor}}%
+ }%
+}
+
+%
% 修改期刊的标题
%
\renewbibmacro*{periodical}{%源来自biblatex.DEF
@@ -2722,12 +2950,26 @@ incollection,proceedings,inproceedings]{number}{%
%
% 修改in:用于inbook、incollection、inproceedings等类型
% 2018.04.20,v1.0k,renewed marco,by hzz
+% 20190212,v1.0q,增加中英文区分,by hzz
%
% 原理方法:使用bibmacro{in:}改变了以前在driver中直接输出//的方式,同时也简化了标点控制。
\renewbibmacro*{in:}{%
\iftoggle{bbx:gbpunctin}{\printtext{\texttt{//}\allowbreak}}%\addthinspace
- {\setunit{\adddot\addspace}\printtext{\bibstring{in}}}}%\newunit\newblock\intitlepunct
-
+ {\setunit{\adddot\addspace}%
+ \iffieldequalstr{userd}{chinese}%
+ {\printtext{\bibstring{incn}}}%
+ {\printtext{\bibstring{in}}}%
+ }}%\newunit\newblock\intitlepunct
+
+%
+% 修改type域的输出格式
+% 2019.02.12,v1.0q,byhzz
+% 使其可以区分中英文输出不同的格式,比如博士论文英文输出PHD thesis,中文则是博士学位论文
+\DeclareFieldFormat{type}%
+{\iffieldequalstr{userd}{chinese}%
+ {\ifbibxstring{#1cn}{\bibxstring{#1cn}}{#1}}%
+ {\ifbibstring{#1}{\bibstring{#1}}{#1}}%
+}
%=====================================================================
%设置驱动格式
@@ -3031,8 +3273,9 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
\newunit\newblock
\usebibmacro{byeditor+others}%增加的译者信息
\newunit\newblock
+ \iftoggle{bbx:gbfieldtype}{%
\printfield{type}%
- \setunit*{\addspace}%
+ \setunit*{\addspace}}{}%
\printfield{number}%
\newunit\newblock
\printfield{version}%
@@ -3118,7 +3361,9 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
\usebibmacro{in:}%
%\printtext{\texttt{//}\addthinspace}%
\usebibmacro{bybookauthor}%
- \ifnameundef{bookauthor}{}{\newunit}%替换下一句
+ \ifnameundef{bookauthor}{%
+ \ifnameundef{editor}{}{\newunit}%
+ }{\newunit}%替换下一句
%\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\setunit{\addcolon}\printfield{volume}\printfield{number}%增加卷和册信息