summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx361
1 files changed, 294 insertions, 67 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx
index 9b652a900e0..186f5577869 100644
--- a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx
+++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.bbx
@@ -11,10 +11,11 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2019/02/11 v1.0q}
+\def\versionofgbtstyle{2019/03/28 v1.0r}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015ms.bbx}[\versionofgbtstyle biblatex bibliography style]
-\RequireBiber[3]%显式指定用biber后端
+%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
+
%=====================================================================
% 加载标准样式
@@ -80,9 +81,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}
@@ -90,6 +93,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,文献引用带圈上标数字表示,脚注中的文献用带圈非上标数字做标签
@@ -99,7 +110,11 @@
\ifstrequal{#1}{false}{}{\execgbfootbib}}
\ExecuteBibliographyOptions{gbfootbib}
- %%
+ %%
+ \newlength{\footbibmargin}
+ \newlength{\footbiblabelsep}
+ \setlength{\footbibmargin}{1em}%脚注的段落左侧缩进距离
+ \setlength{\footbiblabelsep}{0.5em}%脚注中标记号与脚注段落的间距
\def\execgbfootbib%
{%
%开启引用跟踪计数器,为使用\ifciteseen等测试命令
@@ -111,8 +126,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的方式
@@ -128,6 +215,7 @@
%
%判断当前文献是否已经引用过且是做的footfullcite(即已经作为脚注输出文献内容)
%记录首次输出时的脚注号码,用于后面再次引用该文献时的输出,比如同(4)。
+ %v1.0q 20190309 区分使脚注标注适应minipage中的情况
\newbibmacro*{citesavefn}{%
\ifciteseen%当被引用过为true
{\ifcsdef{sec\arabic{refsection}et\thefield{entrykey}}%当已经定义过脚注序号信息
@@ -135,9 +223,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的定义进行判断
+ }}%
}
%
@@ -209,6 +302,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}{%
@@ -333,6 +430,13 @@
\def\thegbcitelocalcase{\the\c@gbcitelocalcase}
\def\thegbbiblocalcase{\the\c@gbbiblocalcase}
+ % 增加不同语言排序的切换选项
+ % numeric样式,不使用该选项,这里给出仅为兼容性考虑
+ % v1.0q,20190307,hzz
+ %
+ \DeclareBibliographyOption[string]{gblanorder}[chineseahead]{}
+
+
%
% 增加本地化字符串的中英文切换选项
% gbcitelocal指标注中的本地化字符串
@@ -374,6 +478,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
}
@@ -442,6 +547,12 @@
\NewBibliographyString{volumecn}
\NewBibliographyString{numbercn}
\NewBibliographyString{serialcn}
+ \NewBibliographyString{incn}
+ \NewBibliographyString{mathesiscn}
+ \NewBibliographyString{phdthesiscn}
+ \NewBibliographyString{editorcn}
+ \NewBibliographyString{editorscn}
+
%
% 修改一些当地化字符串
@@ -471,6 +582,11 @@
andotherskr={외},
andjp={和},
andkr={和},
+ incn={\str@incn\addcolon\addspace},
+ mathesiscn={\str@mathesiscn},
+ phdthesiscn={\str@phdthesiscn},
+ editorscn={\str@editorcn},
+ editorcn={\str@editorcn},
}
@@ -647,11 +763,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}]
@@ -667,8 +778,6 @@
\step[fieldset=usera, fieldvalue={C}]
\step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用institution
\step[fieldset=publisher, origfieldval]
- \step[fieldsource=editor]%%有时会把editor和bookauthor混淆,处理后使用bookauthor
- \step[fieldset=bookauthor, origfieldval]
}
\map{
\pertype{proceedings}
@@ -681,8 +790,6 @@
\step[fieldset=usera, fieldvalue={G}]
\step[fieldsource=institution]%有时会把publisher和institution混淆,处理后使用institution
\step[fieldset=publisher, origfieldval]
- \step[fieldsource=editor]%%有时会把editor和bookauthor混淆,处理后使用bookauthor
- \step[fieldset=bookauthor, origfieldval]
}
\map{
\pertype{collection}
@@ -882,27 +989,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}]
}
}
@@ -924,14 +1031,14 @@
\map{%尝试未定义数据模型的standard类型映射为book,standard类型在blx-dm中有出现,但仅定义了类型,域和约束等都没有定义
\step[typesource=standard, typetarget=book, final]%当不存在booktitle域是映射为book
}
- \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]
@@ -1154,28 +1261,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等参考文献信息的输出格式
@@ -1247,6 +1366,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}}
@@ -1450,7 +1599,7 @@
%
% 重设专利title的输出,将文献类型标识符输出出去
%
-\newbibmacro*{patenttitle}{%原输出来自biblatex.def文件
+\renewbibmacro*{patenttitle}{%原输出来自biblatex.def文件
\ifboolexpr{%
test{\iffieldundef{title}}%
and%
@@ -1472,6 +1621,47 @@
}%
}
+%
+% 编者类型的本地化字符串输出
+% 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}%
+
%=====================================================================
%设置驱动格式
@@ -1537,13 +1727,13 @@ togl{bbx:gbstyle} or test {\iffieldequalstr{userd}{chinese}}%
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}{}%为了实现上述第二个示例情况做的处理
}}%
%
% 修改省略作者后的本地化字符串,比如et al.
@@ -1554,8 +1744,6 @@ togl{bbx:gbstyle} or test {\iffieldequalstr{userd}{chinese}}%
% 首先设置全局的,然后设置文献表中的,这一等价于将所有的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}}{}%
@@ -1564,7 +1752,7 @@ togl{bbx:gbstyle} or test {\iffieldequalstr{userd}{chinese}}%
\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}}{}%
@@ -1592,7 +1780,7 @@ togl{bbx:gbstyle} or test {\iffieldequalstr{userd}{chinese}}%
\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}}{}%
@@ -1895,33 +2083,38 @@ incollection,proceedings,inproceedings]{number}{%
%
\renewbibmacro*{note+pages}{%源来自standard.bbx
%\printfield{note}%不要note,note用来判断是否是报纸newspaper
- \iffieldundef{pages}{}{
+ \iffieldundef{pages}{}{%
\setunit{\bibpagespunct}%
\printfield{pages}}%
%\newunit
}%
%
% 编者的符号修改一下
+% v1.0 2016-07-01
+% v1.0q 2019-03-01 hzz 修改editortype前的标点
%
\renewbibmacro*{editor}{%源来自biblatex.DEF
- \ifboolexpr{
+ \ifboolexpr{%
test \ifuseeditor
and
- not test {\ifnameundef{editor}}
- }
+ not test {\ifnameundef{editor}}%
+ }%
{\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]{%
- \iffieldundef{editortype}
+ \iffieldundef{editortype}%
{%
% \ifboolexpr{ %这一段去掉,未定义编者类型情况下不处理
% test {\ifnumgreater{\value{editor}}{1}}
@@ -1930,18 +2123,34 @@ incollection,proceedings,inproceedings]{number}{%
% }
% {\bibstring{editors}}
% {\bibstring{editor}}
- }
- {\ifbibxstring{\thefield{editortype}} %定义编者类型情况下处理,以后根据需要修改
- {\ifboolexpr{
- test {\ifnumgreater{\value{editor}}{1}}
+ }%
+ {\ifbibxstring{\thefield{editortype}}%定义编者类型情况下处理,以后根据需要修改
+ {\ifboolexpr{%
+ test {\ifnumgreater{\value{editor}}{1}}%
or
- test {\ifandothers{editor}}
- }
- {\bibstring{\thefield{editortype}s}}
- {\bibstring{\thefield{editortype}}}}
+ test {\ifandothers{editor}}%
+ }%
+ {\printdelim{streditortypes}}%
+ {\printdelim{streditortype}}}%
{\thefield{editortype}}}%
}}%
%
+% 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
@@ -2002,11 +2211,25 @@ 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}}%
+}%
%
% book条目类的驱动
%
@@ -2296,8 +2519,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}%
@@ -2380,7 +2604,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}%增加卷和册信息
@@ -2427,3 +2653,4 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
\AtEveryBibitem{\localsetchinesecode}%
\AtEveryCite{\localsetchinesecode}%
+\AtEveryLositem{\localsetchinesecode}%