From 6228e603ee4b60d2a8c779fc2fadce176160cff3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 29 Aug 2019 22:50:47 +0000 Subject: biblatex-gb7714-2015 (29aug19) git-svn-id: svn://tug.org/texlive/trunk@51985 c570f23f-e606-0410-a88d-b1316a301751 --- .../latex/biblatex-gb7714-2015/gb7714-2015mx.bbx | 112 ++++++++++++++++----- 1 file changed, 88 insertions(+), 24 deletions(-) (limited to 'Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.bbx') diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.bbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.bbx index 7b043ea65b6..d92ac1daf92 100644 --- a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015mx.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-2015mx.bbx}[\versionofgbtstyle biblatex bibliography style] %\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 @@ -26,6 +26,28 @@ %===================================================================== % 功能函数 %===================================================================== + % + % 增加一个控制是否输出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}}}% + {}% + } + + % % biblatex版本判断 % 20180629,v1.0k,hzz @@ -103,6 +125,14 @@ \settoggle{bbx:gbfieldtype}{#1}} \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 @@ -135,7 +165,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{% @@ -221,16 +253,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的定义进行判断 }}% @@ -247,8 +279,8 @@ {}{\setunit{\addcolon\addspace}\printtext{\thefield{postnote}}}}%由于ay样式中没有修改postnote域,此处因为格式需要不使用默认域格式 }% {\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}% @@ -567,6 +599,15 @@ labeldateparts=true, } +% +% 针对3.13<=biblatex版本的选项设置,因为内容有限,所以不做版本区分,而用时间直接判断 +% +% 解决国标中“王临慧, 2010a.”和“王临慧, 等, 2010b.”的问题 +% 在没有这个选项之前无法加上a和b +% v1.0s,20190828 +\@ifpackagelater{biblatex}{2019/08/16}{% + \ExecuteBibliographyOptions{% + nohashothers=true}}{} %===================================================================== % 设置本地化字符串 @@ -613,7 +654,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}, @@ -631,6 +672,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}} %===================================================================== % 动态数据修改 @@ -2104,7 +2154,7 @@ % {}% %\newunit\newblock \iftoggle{bbx:eprint} - {\usebibmacro{eprint}} + {\iffieldundef{eprint}{}{\newunit\usebibmacro{eprint}}} {}% %\newunit\newblock \iftoggle{bbx:url} @@ -2598,6 +2648,17 @@ 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 + } + %===================================================================== %设置驱动格式 %===================================================================== @@ -2655,7 +2716,7 @@ incollection,proceedings,inproceedings]{number}{% {\usebibmacro{related:init}% \usebibmacro{related}} {}% - \usebibmacro{finentry}} + \usebibmacro{finentry}\usebibmacro{annotation}} % @@ -2702,7 +2763,7 @@ incollection,proceedings,inproceedings]{number}{% {\usebibmacro{related:init}% \usebibmacro{related}} {}% - \usebibmacro{finentry}} + \usebibmacro{finentry}\usebibmacro{annotation}} @@ -2740,7 +2801,7 @@ incollection,proceedings,inproceedings]{number}{% {\usebibmacro{related:init}% \usebibmacro{related}} {}% - \usebibmacro{finentry}} + \usebibmacro{finentry}\usebibmacro{annotation}} % % 专利文献驱动 @@ -2783,7 +2844,7 @@ incollection,proceedings,inproceedings]{number}{% {\usebibmacro{related:init}% \usebibmacro{related}} {}% - \usebibmacro{finentry}} + \usebibmacro{finentry}\usebibmacro{annotation}} % @@ -2830,7 +2891,7 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{ {\usebibmacro{related:init}% \usebibmacro{related}} {}% - \usebibmacro{finentry}} + \usebibmacro{finentry}\usebibmacro{annotation}} % @@ -2880,7 +2941,7 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{ {\usebibmacro{related:init}% \usebibmacro{related}} {}% - \usebibmacro{finentry}} + \usebibmacro{finentry}\usebibmacro{annotation}} % % 论文、手册类型驱动 @@ -2932,7 +2993,7 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{ {\usebibmacro{related:init}% \usebibmacro{related}} {}% - \usebibmacro{finentry}} + \usebibmacro{finentry}\usebibmacro{annotation}} % % 备选类型驱动 @@ -2973,7 +3034,7 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{ {\usebibmacro{related:init}% \usebibmacro{related}} {}% - \usebibmacro{finentry}} + \usebibmacro{finentry}\usebibmacro{annotation}} % @@ -2992,8 +3053,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 @@ -3005,9 +3068,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 @@ -3031,7 +3095,7 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{ {\usebibmacro{related:init}% \usebibmacro{related}} {}% - \usebibmacro{finentry}} + \usebibmacro{finentry}\usebibmacro{annotation}} % -- cgit v1.2.3