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.bbx113
1 files changed, 84 insertions, 29 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 6429952be64..7bc20e91635 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,7 +11,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2019/03/28 v1.0r}
+\def\versionofgbtstyle{2019/08/28 v1.0s}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -205,6 +205,27 @@
% 设置宏包选项
%=====================================================================
%
+ % 增加一个控制是否输出annotation域的选项,该域可以用于在文献条目后面输出一些注释信息
+ % 20190509,v1,0s,hzz
+ \newtoggle{bbx:gbannote}
+ \DeclareBibliographyOption{gbannote}[false]{%biblatex低版本
+ \settoggle{bbx:gbannote}{#1}}
+ \ExecuteBibliographyOptions{gbannote}
+ %
+ %用于在文献条目后面输出注释信息的宏
+ %FieldFormat{annotation}用于设置注释信息的格式
+ \DeclareFieldFormat{annotation}{%
+ \printtext{\addspace(#1)}%
+ }
+ \renewbibmacro*{annotation}{%
+ \iftoggle{bbx:gbannote}%
+ {\iffieldundef{annotation}%
+ {\printfile[annotation]{\bibannotationprefix\thefield{entrykey}.tex}}%
+ {\printfield{annotation}}}%
+ {}%
+ }
+
+ %
% 增加一个控制是否输出type域的选项
% 20190212,v1,0q,hzz
\newtoggle{bbx:gbfieldtype}
@@ -213,6 +234,15 @@
\ExecuteBibliographyOptions{gbfieldtype}
%
+ % 增加一个控制是否根据页码重设脚注数字标号的选项
+ % 20190422,v1,0r,hzz
+ \newtoggle{bbx:gbfnperpage}
+ \DeclareBibliographyOption{gbfnperpage}[false]{%
+ \settoggle{bbx:gbfnperpage}{#1}}
+ \ExecuteBibliographyOptions{gbfnperpage}
+
+
+ %
% 增加一个选项,用于控制是否实现GB/T 7714-2015标准的脚注文献表
% 20190203,v1.0p,hzz
% 原理方法:默认做patch,文献引用带圈上标数字表示,脚注中的文献用带圈非上标数字做标签
@@ -244,7 +274,9 @@
%重新实现脚注的根据单页重设脚注号码
%重新实现脚注的悬挂对齐问题,不再使用footmisc,直接从latex核心代码和hyperref代码进行修改
%v1.0q 20190317 hzz
- \@addtoreset{footnote}{page}%重设计数器
+ %v1.0r 20190422 hzz 根据gbfnperpage选项设置
+ \iftoggle{bbx:gbfnperpage}%
+ {\@addtoreset{footnote}{page}}{}%重设计数器
\@ifpackageloaded{hyperref}{%加载hyperref则对\H@@footnotetext做重定义
\long\def\H@@footnotetext##1{\insert\footins{%
@@ -330,16 +362,16 @@
%v1.0q 20190309 区分使脚注标注适应minipage中的情况
\newbibmacro*{citesavefn}{%
\ifciteseen%当被引用过为true
- {\ifcsdef{sec\arabic{refsection}et\thefield{entrykey}}%当已经定义过脚注序号信息
- {\csgdef{labelsec\arabic{refsection}et\thefield{entrykey}}{%
- \str@sameentry\gdef\@thefnmark{\csuse{sec\arabic{refsection}et\thefield{entrykey}}}%
+ {\ifcsdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}%当已经定义过脚注序号信息
+ {\csgdef{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{%
+ \str@sameentry\gdef\@thefnmark{\csuse{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}}%
\@makefnmark%
}}%
- {\csxdef{sec\arabic{refsection}et\thefield{entrykey}}{%
+ {\csxdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{%
\ifcsstring{@mpfn}{mpfootnote}{\@alph\c@mpfootnote}{\thefootnote}%
}}%
}%
- {\csxdef{sec\arabic{refsection}et\thefield{entrykey}}{%
+ {\csxdef{sec\arabic{refsection}\arabic{page}et\thefield{entrykey}}{%
\ifcsstring{@mpfn}{mpfootnote}{\@alph\c@mpfootnote}{\thefootnote}%
%判断在minipage中比较麻烦,这里使用\@mpfn的定义进行判断
}}%
@@ -356,8 +388,8 @@
{}{\setunit{\addcolon\addspace}\printfield{postnote}}}%与ay样式不同,由于已修改postnote域格式,直接用printfield
}%
{\usebibmacro{citesavefn}%
- \ifcsdef{labelsec\arabic{refsection}et\thefield{entrykey}}%
- {\csuse{labelsec\arabic{refsection}et\thefield{entrykey}}}%\nopunct
+ \ifcsdef{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}%
+ {\csuse{labelsec\arabic{refsection}\arabic{page}et\thefield{entrykey}}}%\nopunct
{\usedriver{\DeclareNameAlias{sortname}{default}}{\thefield{entrytype}}}%
}%
{\multicitedelim}%
@@ -775,7 +807,7 @@
%andothers = {et al.},%将超过3个人名的省略,et al.改成为 等
andotherscn = {\str@andotherscn},%将超过3个人名的省略,et al.改成为 等
andothersincitecn={\str@andotherscn},%将标注中的分开,便于与文献表中的区分
- andothersincite={et al.},
+ andothersincite={et al\adddot},
backrefpage = {\str@backrefpage:},
backrefpages = {\str@backrefpages:},
in={in\intitlepunct},
@@ -793,6 +825,15 @@
editorcn={\str@editorcn},
}
+ %
+ % 增加两个命令用于临时的局部的修改本地化字符串
+ % 其中\setlocalbibstring修改缩写字符串,setlocalbiblstring修改长字符串
+ % 注意使用时因为是局部修改,因此要将其与需要修改的引用命令放在一个编组符号内
+ % v1.0t,hzz,20190525
+ \newcommand{\setlocalbibstring}[2]{%
+ \csdef{abx@sstr@#1}{#2}}
+ \newcommand{\setlocalbiblstring}[2]{%
+ \csdef{abx@lstr@#1}{#2}}
%=====================================================================
% 动态数据修改
@@ -1787,7 +1828,7 @@
% 修改译者位置格式
%
% 原理方法:修改来自biblatex.def文件的bytranslator+others宏的格式
-\renewbibmacro*{bytranslator+others}{%
+\renewbibmacro*{bytranslator+others}{\bibauthorfont%
\ifnameundef{translator}
{}
{%\usebibmacro{bytranslator+othersstrg}
@@ -1808,7 +1849,7 @@
% v1.0O,20190103,hzz,修改利用新定义的一个分隔符strandothersdelim
%
% 原理方法:判断作者或译者是否中文,若中文用字符等,否则用et al. 。
-\renewbibmacro*{name:andothers}{%
+\renewbibmacro*{name:andothers}{\bibauthorfont%
\ifboolexpr{
test {\ifnumequal{\value{listcount}}{\value{liststop}}}
and
@@ -2470,7 +2511,8 @@ test{\iftoggle{iftlnine}}
%
% 调整doi+eprint+url格式
-%
+% 2016.07.01 byhzz
+% 2019.05.01 byhzz 在eprint前增加一个空格
% 原理方法:源来自standard.bbx,因为页码后面直接跟引用日期,没有标点所以去掉其中的标点。
\renewbibmacro*{doi+eprint+url}{%
% \iftoggle{bbx:doi}%把doi的位置放到url后面
@@ -2478,7 +2520,7 @@ test{\iftoggle{iftlnine}}
% {}%
%\newunit\newblock
\iftoggle{bbx:eprint}
- {\usebibmacro{eprint}}
+ {\iffieldundef{eprint}{}{\newunit\usebibmacro{eprint}}}
{}%
%\newunit\newblock
\iftoggle{bbx:url}
@@ -2621,7 +2663,7 @@ incollection,proceedings,inproceedings]{number}{%
%
% 对edition版本信息格式做出修改
%
-\DeclareFieldFormat{edition}{%源来自biblatex.DEF
+\DeclareFieldFormat{edition}{\bibtitlefont%源来自biblatex.DEF
\testCJKfirst{userd}%
\iftoggle{ifCJKforgbt}%
{\ifinteger{#1}%
@@ -2634,7 +2676,7 @@ incollection,proceedings,inproceedings]{number}{%
%
% 对version的版本信息做出修改
%
-\DeclareFieldFormat{version}{%源来自biblatex.DEF
+\DeclareFieldFormat{version}{\bibtitlefont%源来自biblatex.DEF
\testCJKfirst{userd}%
\ifinteger{#1}%
{\iftoggle{ifCJKforgbt}{\printtext{#1\str@edition}}%
@@ -2971,6 +3013,16 @@ incollection,proceedings,inproceedings]{number}{%
{\ifbibstring{#1}{\bibstring{#1}}{#1}}%
}
+%
+% 修改series域的输出格式
+% 2019.05.01,v1.0r,byhzz
+\renewbibmacro*{series+number}{%
+ \printfield{series}%
+ %\setunit*{\addspace}%
+ %\printfield{number}%
+ %\newunit
+ }
+
%=====================================================================
%设置驱动格式
%=====================================================================
@@ -3028,7 +3080,7 @@ incollection,proceedings,inproceedings]{number}{%
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
- \usebibmacro{finentry}}
+ \usebibmacro{finentry}\usebibmacro{annotation}}
%
@@ -3075,7 +3127,7 @@ incollection,proceedings,inproceedings]{number}{%
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
- \usebibmacro{finentry}}
+ \usebibmacro{finentry}\usebibmacro{annotation}}
@@ -3113,7 +3165,7 @@ incollection,proceedings,inproceedings]{number}{%
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
- \usebibmacro{finentry}}
+ \usebibmacro{finentry}\usebibmacro{annotation}}
%
% 专利文献驱动
@@ -3156,7 +3208,7 @@ incollection,proceedings,inproceedings]{number}{%
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
- \usebibmacro{finentry}}
+ \usebibmacro{finentry}\usebibmacro{annotation}}
%
@@ -3203,7 +3255,7 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
- \usebibmacro{finentry}}
+ \usebibmacro{finentry}\usebibmacro{annotation}}
%
@@ -3253,7 +3305,7 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
- \usebibmacro{finentry}}
+ \usebibmacro{finentry}\usebibmacro{annotation}}
%
% 论文、手册类型驱动
@@ -3305,7 +3357,7 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
- \usebibmacro{finentry}}
+ \usebibmacro{finentry}\usebibmacro{annotation}}
%
% 备选类型驱动
@@ -3346,7 +3398,7 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
- \usebibmacro{finentry}}
+ \usebibmacro{finentry}\usebibmacro{annotation}}
%
@@ -3365,8 +3417,10 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
\ifnameundef{editor}{}{\newunit}%
}{\newunit}%替换下一句
%\newunit\newblock
+\iffieldundef{series}{}{\usebibmacro{series+number}\setunit{\addcolon\addspace}}%为处理一些存在series的情况而增加
\usebibmacro{maintitle+booktitle}%
- \setunit{\addcolon}\printfield{volume}\printfield{number}%增加卷和册信息
+\iffieldundef{volume}{}{\setunit{\addcolon\addspace}\printfield{volume}}%
+\iffieldundef{number}{}{\setunit{\addcolon\addspace}\printfield{number}}%增加卷和册信息
\newunit\newblock%
% \usebibmacro{byeditor+others}%
% \newunit\newblock
@@ -3378,9 +3432,10 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
% \printfield{part}}
% {}%
% \newunit
- \printfield{volumes}%
- \newunit\newblock
- \usebibmacro{series+number}}%
+% \printfield{volumes}%
+% \newunit\newblock
+% \usebibmacro{series+number}
+ }%
\newunit\newblock
%\printfield{note}%
%\newunit\newblock
@@ -3404,4 +3459,4 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
- \usebibmacro{finentry}}
+ \usebibmacro{finentry}\usebibmacro{annotation}}