summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx
diff options
context:
space:
mode:
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.bbx117
1 files changed, 57 insertions, 60 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 15a9d96596d..2121eafa7e3 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,8 +11,8 @@
%
% 版本和时间信息
%
-\ProvidesFile{gb7714-2015.bbx}[2018/08/14 v1.0m biblatex bibliography style]
-\def\versionofgbtstyle{2018/08/14 v1.0m}
+\ProvidesFile{gb7714-2015.bbx}[2018/11/04 v1.0n biblatex bibliography style]
+\def\versionofgbtstyle{2018/11/04 v1.0n}
\def\versionofbiblatex{\abx@version}
\RequireBiber[3]%显式指定用biber后端
@@ -30,32 +30,26 @@
%
% biblatex版本判断
% 20180405,v1.0k,为兼容biblatexv3.11增加toggle:iftlnine,HU zhenzhen
+ % 20181020,v1.0n,为不再使用xstring宏包做的修改,hzz
%
% 原理方法:当版本继续更新时,增加一个新的toggle用以处理新的旧版,最新版和未判断出来的版本永远用iftlatest
- \providetoggle{iftlfive}\togglefalse{iftlfive}%用于处理biblatex3.2之前的版本
- \providetoggle{iftlsix}\togglefalse{iftlsix}%用于处理biblatex3.3开始改变的新的姓名机制后版本
- \providetoggle{iftlseven}\togglefalse{iftlseven}%用于处理biblatex3.7的兼容性
- \providetoggle{iftleight}\togglefalse{iftleight}%用于处理biblatex3.8到3.9的兼容性
- \providetoggle{iftlnine}\togglefalse{iftlnine}%用于处理biblatex10的兼容性
- \providetoggle{iftlatest}\toggletrue{iftlatest}%假设是最新版biblatex
- \StrBefore{\abx@version}{.}[\numinteger]%以点区分整数和小数
- \StrBehind{\abx@version}{.}[\numdigital]%小数部分可能带字母所以需将其去掉,见下一行代码
- \IfInteger{\numdigital}{}{\StrGobbleRight{\numdigital}{1}[\numdigital]}
- \ifnumcomp{\numinteger}{=}{3}{
- \ifnumcomp{\numdigital}{=}{10}{\toggletrue{iftlnine}\togglefalse{iftlatest}}{}%3.10版本
- \ifnumcomp{\numdigital}{<}{10}{\ifnumcomp{\numdigital}{>}{7}{\toggletrue{iftleight}\togglefalse{iftlatest}}{}}{}%>3.8版本用iftleight=true表示
- \ifnumcomp{\numdigital}{=}{7}{\toggletrue{iftlseven}\togglefalse{iftlatest}}{}%3.7版本用iftlseven=true表示
- \ifnumcomp{\numdigital}{<}{7}{\ifnumcomp{\numdigital}{>}{2}{\toggletrue{iftlsix}\togglefalse{iftlatest}}{}}{}%3.3-3.6版本用iftlsix=true表示
- \ifnumcomp{\numdigital}{<}{3}{\toggletrue{iftlfive}\togglefalse{iftlatest}}{}%3.0-3.2版本用iftlfive=true表示
- }{\ifnumcomp{\numinteger}{>}{3}{
- \blx@warning@noline{%
- biblatex version is >= 4.x.\MessageBreak
- if errors raised,Please contact biblatex-gb7714-2015 pkg author.}%
- }{ \toggletrue{iftlfive}\togglefalse{iftlatest}%2.x版本统一用iftlfive=true表示
- \blx@warning@noline{%
- biblatex version is <= 2.x.\MessageBreak
- if errors raised,Please contact biblatex-gb7714-2015 pkg author.}%
- }}
+ \providetoggle{iftlfive}\togglefalse{iftlfive} %处理biblatex3.2之前版本,时间2016-03-01前
+ \providetoggle{iftlsix}\togglefalse{iftlsix} %处理biblatex3.3开始改变姓名机制后版本,时间2016-03-01及以后
+ \providetoggle{iftlseven}\togglefalse{iftlseven}%处理biblatex3.7的兼容性,时间2016-12-01后
+ \providetoggle{iftleight}\togglefalse{iftleight}%处理biblatex3.8到3.9的兼容性,时间2017-11-01后到2017-12-01前
+ \providetoggle{iftlnine}\togglefalse{iftlnine} %处理biblatex10的兼容性,时间2017-12-01后
+ \providetoggle{iftlatest}\toggletrue{iftlatest} %假设是最新版biblatex
+ \@ifpackagelater{biblatex}{2016/03/01}{
+ \@ifpackagelater{biblatex}{2016/12/01}{
+ \@ifpackagelater{biblatex}{2017/11/01}{
+ \@ifpackagelater{biblatex}{2017/12/01}{
+ \@ifpackagelater{biblatex}{2018/02/19}{}
+ {\toggletrue{iftlnine}\togglefalse{iftlatest}}}
+ {\toggletrue{iftleight}\togglefalse{iftlatest}}}
+ {\toggletrue{iftlseven}\togglefalse{iftlatest}}}
+ {\toggletrue{iftlsix}\togglefalse{iftlatest}}}
+ {\toggletrue{iftlfive}\togglefalse{iftlatest}}
+
\newcommand\defversion[2]{\csdef{codeversion#1#2}}%定义不同版本的命令
\newcommand\switchversion[2]{\csuse{codeversion#1#2}}%使用不同版本的命令
@@ -612,6 +606,11 @@
\step[fieldset=usera, fieldvalue={A}]%没有专门的驱动,定义一个usera域,方便映射后使用
}
\map{
+ \pertype{misc}%当misc类型带有网址时,将其转换为online类型
+ \step[fieldsource=url,final]
+ \step[typesource=misc,typetarget=online]
+ }
+ \map{
\pertype{misc}%对应增加的一个备选类型misc
\step[fieldset=usera, fieldvalue={Z}]%没有专门的驱动,定义一个usera域,方便映射后使用
}
@@ -894,11 +893,11 @@
{\switchversion{3.4}{map}}%%当采用3.3<=biblatex版本时
\DeclareBibliographyAlias{newspaper}{article}%定义驱动别名,尝试以替代驱动层映射,实践表明是可行的。
-\DeclareBibliographyAlias{unpublished}{misc}
-\DeclareBibliographyAlias{database}{misc}
-\DeclareBibliographyAlias{dataset}{misc}
-\DeclareBibliographyAlias{software}{misc}
-\DeclareBibliographyAlias{map}{misc}
+\DeclareBibliographyAlias{unpublished}{manual}
+\DeclareBibliographyAlias{database}{manual}
+\DeclareBibliographyAlias{dataset}{manual}
+\DeclareBibliographyAlias{software}{manual}
+\DeclareBibliographyAlias{map}{manual}
\DeclareBibliographyAlias{archive}{manual}
@@ -1737,18 +1736,18 @@ test{\iftoggle{iftlnine}}
% 新增一个样式用于输出连续出版物的地址,单位,时间,%类似\newbibmacro*{publisher+location+date}
\newbibmacro*{location+institution+date}{\bibpubfont%
\iftoggle{bbx:gbpub}%
-{\testCJKfirst{userd}
+{\testCJKfirst{userd}%
+\ifboolexpr{%
+test {\iflistundef{location}} and test {\iflistundef{institution}}%
+}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}%
+{\printtext{[S.l.\space :\space s.n.\adddot]}}%
+}{%
\iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}}{\printtext{[S.l.\adddot]}}}%
{\printlist{location}}%
-% \iflistundef{institution}
-% {\setunit*{\addcomma\space}}
-% {\setunit*{\addcolon\space}}%
-% \printlist{institution}%
-% \setunit*{\addcomma\space}%
\addcolon\addspace%
\iflistundef{institution}{%
-\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}}{\printtext{\mkbibbrackets{s.n.}}}}% \bibstring{nopublisher}%[s.n.\adddot]
-{\printlist{institution}}%
+\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}}{\printtext{\mkbibbrackets{s.n.}}}}%
+{\printlist{institution}}}%
\setunit{\addcomma\addspace}%
%\usebibmacro{date}%
\printfield{year}%
@@ -1769,6 +1768,11 @@ test{\iftoggle{iftlnine}}
\renewbibmacro*{publisher+location+date}{\bibpubfont%
\iftoggle{bbx:gbpub}%
{\testCJKfirst{userd}%
+\ifboolexpr{%
+test {\iflistundef{location}} and test {\iflistundef{publisher}}%
+}{\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}%
@@ -1780,8 +1784,8 @@ test{\iftoggle{iftlnine}}
\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
{\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}%
}}%
-{\printlist{publisher}\setunit*{\addcomma\addspace}}%
-%\addcomma\addspace%
+{\printlist{publisher}}}%
+\setunit*{\addcomma\addspace}%\addcomma\addspace%
\usebibmacro{date}%
%\newunit %去掉这个标点
}%
@@ -2531,40 +2535,34 @@ test{\iftoggle{iftlnine}}
%
% 备选类型驱动
%
-% 直接利用report做misc
+% 利用biblatex的misc驱动
\DeclareBibliographyDriver{misc}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
- \usebibmacro{author}%
- \setunit{\labelnamepunct}\newblock
+ \usebibmacro{author/editor+others/translator+others}%
+ \setunit{\printdelim{nametitledelim}}\newblock
\usebibmacro{title}%
- \iftoggle{bbx:gbstrict}{}{%
- \newunit%
+\iftoggle{bbx:gbstrict}{}{%
+ \newunit
\printlist{language}%
\newunit\newblock
- \usebibmacro{byauthor}}%
+ \usebibmacro{byauthor}%
\newunit\newblock
- \printfield{type}%
- \setunit*{\addspace}%
- \printfield{number}%
+ \usebibmacro{byeditor+others}}%
+ \newunit\newblock
+ \printfield{howpublished}%
\newunit\newblock
+ \printfield{type}%
+ \newunit
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\usebibmacro{institution+location+date}%
+ %\usebibmacro{organization+location+date}%
%\newunit\newblock
- \usebibmacro{chapter+pages}%
\usebibmacro{doi+eprint+url}%
- \newunit
- \printfield{pagetotal}%
- \newunit\newblock
- \iftoggle{bbx:isbn}
- {\printfield{isrn}}
- {}%
\newunit\newblock
-% \usebibmacro{doi+eprint+url}%
-% \newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
@@ -2575,7 +2573,6 @@ test{\iftoggle{iftlnine}}
{}%
\usebibmacro{finentry}}
-
%
% 会议论文文献类型驱动
%