summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-gb7714-2015
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-11-18 23:20:15 +0000
committerKarl Berry <karl@freefriends.org>2016-11-18 23:20:15 +0000
commitb1738761511777180f24fe861550ef9b06de3af8 (patch)
treef438514dbbfbe03111de5b6c80fae93bde582925 /Master/texmf-dist/tex/latex/biblatex-gb7714-2015
parent721b1dbe9754ce2f222164010982be4e784f05f3 (diff)
biblatex-gb7714-2015 (18nov16)
git-svn-id: svn://tug.org/texlive/trunk@42531 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-gb7714-2015')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.bbx68
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx14
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.bbx86
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.cbx16
4 files changed, 145 insertions, 39 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 fb9717f3104..85166cb8a5f 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
@@ -7,11 +7,12 @@
%% 2016/05/20 v1.0
%% 2016/10/23 v1.0a
%% 2016/11/11 v1.0b
+%% 2016/11/14 v1.0c
%% E-mail: hzzmail@163.com
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\ProvidesFile{gb7714-2015.bbx}[2016/11/11 v1.0b biblatex bibliography style]
+\ProvidesFile{gb7714-2015.bbx}[2016/11/14 v1.0c biblatex bibliography style]
% Load the standard style to avoid copy-pasting unnecessary material
\RequireBibliographyStyle{numeric-comp} %加载标准样式
@@ -79,11 +80,35 @@
minnames = 3 %设置缩减后的名字最小数量
%uniquename = init
}
-\DeclareNameFormat{first-last}{%修改作者的姓和名的顺序,源来自于biblatex.def文件
- \iffirstinits%
- {\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}}
- {\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}}%
- \usebibmacro{name:andothers}}
+\newbibmacro*{name:first-last}[4]{%
+ \ifuseprefix
+ {\usebibmacro{name:delim}{#3#1}%
+ \usebibmacro{name:hook}{#3#1}%
+ \ifblank{#3}{}{%
+ \ifcapital
+ {\mkbibnameprefix{\MakeCapital{#3}}\isdot}
+ {\mkbibnameprefix{#3}\isdot}%
+ \ifpunctmark{'}{}{\bibnamedelimc}}%
+ %\mkbibnamelast{#1}\isdot
+ \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{\MakeUppercase{#1}}}\isdot%\MakeUppercase %\mkbibnamelast{\MakeUppercase{#1}} %\MakeSentenceCase
+ %注意上一句\MakeCapital后面如果再跟一个{}包含#1,则没有效果,可能是包在里面少了一层展开
+ %因为机构名通常包括在{}内,所以要多展开一次才行,所以这里去掉#1外面的{}
+ %\mkbibnamelast{\MakeUppercase{#1}}\isdot
+ %\ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%这句放到后面
+ \ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamefirst{\MakeUppercase{#2}}\isdot}%
+ \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}}
+ {\usebibmacro{name:delim}{#1}%
+ \usebibmacro{name:hook}{#1}%
+ %\mkbibnamelast{#1}\isdot %3.9.1 Generic Commands and Hooks,对姓重新处理,如下句: %\mkbibnamelast{\MakeUppercase{#1}}
+ \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{\MakeUppercase{#1}}}\isdot %大写,参考4.6.4 Miscellaneous Commands,\MakeUppercase %\MakeSentenceCase
+ %\mkbibnamelast{\MakeUppercase{#1}}\isdot
+ %\ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%这句放到后面
+ \ifblank{#2#3}{}{\revsdnamepunct}%
+ \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{\MakeUppercase{#2}}\isdot}%
+ \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}%
+ \addcomma\addspace%
+ \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
+ }}
\newbibmacro*{name:last-first}[4]{%
\ifuseprefix
@@ -185,7 +210,9 @@ and = {\addcomma},%将第2和3人名见的and符号改成 逗号,用\f
%andothers = {et al.}, %将超过3个人名的省略,et al.改成为 等
andotherscn = {等}, %将超过3个人名的省略,et al.改成为 等
noaddress = {[S.l.]},
-nopublisher = {[s.n.]}
+nopublisher = {[s.n.]},
+backrefpage = {引用页:},
+backrefpages = {引用页:},
}
%关于双语言或多语言的参考文献,可以参考3.11.5 Entry Sets,4.11.1 Entry Sets
@@ -350,15 +377,20 @@ nopublisher = {[s.n.]}
\step[fieldset=usera, fieldvalue={Z}]
}
\map{
- \step[fieldsource=author]
- \step[fieldset=userf, origfieldval]
- \step[fieldsource=translator]
- \step[fieldset=usere, origfieldval]
- \step[fieldsource=year]
- \step[fieldset=date, origfieldval]
- \step[fieldsource=note]%将note域信息复制给keywords,用于输出时容易区分标准和报纸
- \step[fieldset=keywords, origfieldval]
- }
+ \step[fieldsource=author]
+ \step[fieldset=userf, origfieldval]
+ \step[fieldsource=translator]
+ \step[fieldset=usere, origfieldval]
+ \step[fieldsource=year]
+ \step[fieldset=date, origfieldval]
+ }
+ \map{%将entrykey放入keywords中用于后期的使用
+ \step[fieldsource=entrykey]
+ \step[fieldset=keywords, origfieldval]
+ \step[fieldsource=note,final]%将note域信息复制给keywords,用于输出时容易区分标准和报纸
+ \step[fieldset=keywords, fieldvalue={,},append]
+ \step[fieldset=keywords, origfieldval,append]
+ }
}
}
@@ -526,14 +558,14 @@ nopublisher = {[s.n.]}
%\addcolon\addspace%
\iflistundef{publisher}{%
\iftoggle{ifnoteeqstandard}{}{%
-\iftoggle{ifCJKforgbt}{\printtext{[出版者不详]}\addcomma\addspace}{\printtext{[s.n.\adddot]}\addcomma\addspace}}}% \bibstring{nopublisher}
+\iftoggle{ifCJKforgbt}{\printtext{[出版者不详]}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}
+{\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}}}
{\printlist{publisher}\addcomma\addspace}%
%\addcomma\addspace%
\usebibmacro{date}%
%\newunit %去掉这个标点
}
-
%对版本信息做出修改,源来自biblatex.DEF
\DeclareFieldFormat{edition}{%
\testCJKfirst{\thefield{title}}%
diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx
index 526ddb12a0e..05c913c31af 100644
--- a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx
+++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx
@@ -7,11 +7,12 @@
%% 2016/05/20 v1.0
%% 2016/10/23 v1.0a
%% 2016/11/11 v1.0b
+%% 2016/11/14 v1.0c
%% E-mail: hzzmail@163.com
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\ProvidesFile{gb7714-2015.cbx}[2016/11/11 v1.0b biblatex citation style]
+\ProvidesFile{gb7714-2015.cbx}[2016/11/14 v1.0c biblatex citation style]
\RequireCitationStyle{numeric-comp}
%\RequireCitationStyle{numeric}
@@ -59,3 +60,14 @@
{}
{\usebibmacro{cite:dump}]%
\usebibmacro{postpages}}
+
+%增加一个命令yearpagescite为与ay样式兼容,命令等同于\pagescite
+\DeclareCiteCommand{\yearpagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标
+ {[\usebibmacro{cite:init}%
+ \usebibmacro{prenote}%
+ }
+ {\usebibmacro{citeindex}%
+ \usebibmacro{cite:comp}}
+ {}
+ {\usebibmacro{cite:dump}]%
+ \usebibmacro{postpages}}
diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.bbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.bbx
index 50b2521235a..9b8081a9b39 100644
--- a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.bbx
+++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.bbx
@@ -7,11 +7,12 @@
%% 2016/05/20 v1.0
%% 2016/10/23 v1.0a
%% 2016/11/11 v1.0b
+%% 2016/11/14 v1.0c
%% E-mail: hzzmail@163.com
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\ProvidesFile{gb7714-2015ay.bbx}[2016/11/11 v1.0b biblatex bibliography style]
+\ProvidesFile{gb7714-2015ay.bbx}[2016/11/14 v1.0c biblatex bibliography style]
% Load the standard style to avoid copy-pasting unnecessary material
\RequireBibliographyStyle{authoryear} %加载标准样式
@@ -38,9 +39,6 @@
%minnames = 3, %设置缩减后的名字最小数量
maxbibnames=3, %将文献列表和引用中最大名字数量区分开
minbibnames=3,
- maxcitenames=1,
- mincitenames=1
- %uniquename = init
}
\newbibmacro*{name:given-family}[4]{%利用family-given定义given-family
@@ -106,15 +104,7 @@
%minnames = 3, %设置缩减后的名字最小数量
maxbibnames=3, %将文献列表和引用中最大名字数量区分开
minbibnames=3,
- maxcitenames=1,
- mincitenames=1
- %uniquename = init
}
-\DeclareNameFormat{first-last}{%修改作者的姓和名的顺序,源来自于biblatex.def文件
- \iffirstinits%
- {\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}}
- {\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}}%
- \usebibmacro{name:andothers}}
%作者名字的处理,参考文档4.2.3节,3.12.4 Name Parts and Name Spacing
\newbibmacro*{name:last-first}[4]{%
@@ -146,6 +136,36 @@
\addcomma\addspace%
\ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
}}
+
+\newbibmacro*{name:first-last}[4]{%
+ \ifuseprefix
+ {\usebibmacro{name:delim}{#3#1}%
+ \usebibmacro{name:hook}{#3#1}%
+ \ifblank{#3}{}{%
+ \ifcapital
+ {\mkbibnameprefix{\MakeCapital{#3}}\isdot}
+ {\mkbibnameprefix{#3}\isdot}%
+ \ifpunctmark{'}{}{\bibnamedelimc}}%
+ %\mkbibnamelast{#1}\isdot
+ \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{\MakeUppercase{#1}}}\isdot%\MakeUppercase %\mkbibnamelast{\MakeUppercase{#1}} %\MakeSentenceCase
+ %注意上一句\MakeCapital后面如果再跟一个{}包含#1,则没有效果,可能是包在里面少了一层展开
+ %因为机构名通常包括在{}内,所以要多展开一次才行,所以这里去掉#1外面的{}
+ %\mkbibnamelast{\MakeUppercase{#1}}\isdot
+ %\ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%这句放到后面
+ \ifblank{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamefirst{\MakeUppercase{#2}}\isdot}%
+ \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}}
+ {\usebibmacro{name:delim}{#1}%
+ \usebibmacro{name:hook}{#1}%
+ %\mkbibnamelast{#1}\isdot %3.9.1 Generic Commands and Hooks,对姓重新处理,如下句: %\mkbibnamelast{\MakeUppercase{#1}}
+ \ifblank{#2}{\MakeCapital#1}{\mkbibnamelast{\MakeUppercase{#1}}}\isdot %大写,参考4.6.4 Miscellaneous Commands,\MakeUppercase %\MakeSentenceCase
+ %\mkbibnamelast{\MakeUppercase{#1}}\isdot
+ %\ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}%这句放到后面
+ \ifblank{#2#3}{}{\revsdnamepunct}%
+ \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{\MakeUppercase{#2}}\isdot}%
+ \ifblank{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}%
+ \addcomma\addspace%
+ \ifblank{#4}{}{\addcomma\addspace\bibnamedelimd\mkbibnameaffix{#4}\isdot}%
+ }}
}
%定义判断中文字符的函数,用于判断作者等信息是否由中文字符构成
@@ -191,7 +211,9 @@ and = {\addcomma},%将第2和3人名见的and符号改成 逗号,用\f
%andothers = {et al.}, %将超过3个人名的省略,et al.改成为 等
andotherscn = {等}, %将超过3个人名的省略,et al.改成为 等
noaddress = {[S.l.]},
-nopublisher = {[s.n.]}
+nopublisher = {[s.n.]},
+backrefpage = {引用页:},
+backrefpages = {引用页:},
}
%关于双语言或多语言的参考文献,可以参考3.11.5 Entry Sets,4.11.1 Entry Sets
@@ -252,8 +274,19 @@ nopublisher = {[s.n.]}
%注意\DeclareSourcemap命令只能出现一次
\DeclareSourcemap{
\maps[datatype=bibtex]{
-\map{ %增加文献标识符如[M],[J]等,下面首先生成这一信息
-%使用下面biber动态修改bbl文件的方法是正确的
+ \map{%因为要做佚名处理,所以这里先对有些只有编者而没有作者的情况进行处理
+ \step[fieldsource=editor]
+ \step[fieldset=author,origfieldval]
+ }
+ \map{%默认情况下将空缺作者设置为佚名
+ \step[fieldset=author, fieldvalue={佚名}]
+ }
+ \map[overwrite]{%当标题带有英文字符,且作者为佚名的情况,设置作者为noauthor,
+ %也有一些特殊情况可能处理不到,比如标题中英混合,作者又却是
+ \step[fieldsource=title,match=\regexp{[a-zA-Z]},final]
+ \step[fieldsource=author,match=\regexp{佚名}, replace={NOAUTHOR}]
+ }
+ \map{ %增加文献标识符如[M],[J]等,下面首先生成这一信息
%\perdatasource{examples.bib}
\pertype{article}
\pertype{periodical}
@@ -324,11 +357,23 @@ nopublisher = {[s.n.]}
\step[fieldset=userf, origfieldval]
\step[fieldsource=translator]
\step[fieldset=usere, origfieldval]
- \step[fieldsource=year]
+ \step[fieldsource=year]%处理一些用year表示date的情况
\step[fieldset=date, origfieldval]
- \step[fieldsource=note]%将note域信息复制给keywords,用于输出时容易区分标准和报纸
+ }
+ \map{%将entrykey放入keywords中用于后期的使用
+ \step[fieldsource=entrykey]
\step[fieldset=keywords, origfieldval]
- %\step[fieldset=userb, fieldvalue={en}]
+ \step[fieldsource=note,final]%将note域信息复制给keywords,用于输出时容易区分标准和报纸
+ \step[fieldset=keywords, fieldvalue={,},append]
+ \step[fieldset=keywords, origfieldval,append]
+ }
+ \map{%因为无法进行cjk字符判断,所以用反的思路,判断没有英文字符,没有空格,没有逗号等字符情况下
+ %认为是中文的,将文献userb设置成cn,用于排序
+ \step[fieldsource=author,match=\regexp{[^a-zA-Z\s\.\,\'\{\}]},final]
+ \step[fieldset=userb,fieldvalue={cn}]
+ }
+ \map{%将没有设置的userb设置成en,即认为不是中文的就是英文的。
+ \step[fieldset=userb,fieldvalue={en}]
}
}
}
@@ -598,7 +643,10 @@ nopublisher = {[s.n.]}
%\addcolon\addspace%
\iflistundef{publisher}{%
\iftoggle{ifnoteeqstandard}{}{%
-\iftoggle{ifCJKforgbt}{\printtext{[出版者不详]}\setunit*{\addcolon\addspace}}{\printtext{[s.n.\adddot]}\setunit*{\addcolon\addspace}}}}% \bibstring{nopublisher}
+\iftoggle{ifCJKforgbt}{\printtext{[出版者不详]}\setunit{\adddot\addspace}\setunit*{\addcolon\addspace}}
+%\mkbibbrackets
+%{\printtext{[s.n.\adddot]}\setunit{\adddot\addspace}\setunit*{\addcolon\addspace}}}}%\bibstring{nopublisher}
+{\printtext{\mkbibbrackets{s.n.}}\setunit{\adddot\addspace}\setunit*{\addcolon\addspace}}}}
{\printlist{publisher}\setunit*{\addcolon\addspace}}%
%\addcomma\addspace%
%\usebibmacro{date}%
diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.cbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.cbx
index 1efa222358f..f9824387ec9 100644
--- a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.cbx
+++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ay.cbx
@@ -7,11 +7,12 @@
%% 2016/05/20 v1.0
%% 2016/10/23 v1.0a
%% 2016/11/11 v1.0b
+%% 2016/11/14 v1.0c
%% E-mail: hzzmail@163.com
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\ProvidesFile{gb7714-2015ay.cbx}[2016/11/11 v1.0b biblatex citation style]
+\ProvidesFile{gb7714-2015ay.cbx}[2016/11/14 v1.0c biblatex citation style]
\RequireCitationStyle{authoryear}
%\RequireCitationStyle{numeric}
@@ -20,6 +21,11 @@
%autocite = superscript ,
%autopunct = true ,
%sorting = none ,
+ maxcitenames=1,
+ mincitenames=1,
+ uniquename=init,%因为使用了名字缩写选项,所以需要设置uniquename=init而不是full避免冲突
+ labeldate=true,
+ uniquelist=minyear,
}
%\DeclareCiteCommand{\cite}[\mkbibparens]{⟨precode⟩}{⟨loopcode⟩}{⟨sepcode⟩}{⟨postcode⟩}
@@ -52,3 +58,11 @@
\usebibmacro{cite}}
{\multicitedelim}
{\printtext{)}\textsuperscript{\usebibmacro{postpages}}}
+
+%增加一个命令yearpagescite用于当文中作者已经存在,需要页码和年份的情况。
+%参考来源,biblatex.DEF,其中\DeclareCiteCommand*{\citeyear}命令
+\DeclareCiteCommand{\yearpagescite}
+ {\printtext{(}\usebibmacro{prenote}}
+ {\printfield{year}\printfield{extrayear}}
+ {\multicitedelim}
+ {\printtext{)}\textsuperscript{\usebibmacro{postpages}}}