diff options
author | Karl Berry <karl@freefriends.org> | 2023-04-24 20:15:38 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-04-24 20:15:38 +0000 |
commit | 0bd9edc890ca68b16c4dac98050b233004982b65 (patch) | |
tree | 708306377ca4140892f90bb3bc77e4d79fd18160 /Master/texmf-dist/tex | |
parent | 02c2da13028e03fce73e05dd7ae264d773c95ca2 (diff) |
biblatex-gb7714-2015 (24apr23)
git-svn-id: svn://tug.org/texlive/trunk@66929 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
7 files changed, 1509 insertions, 81 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-css.bbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-css.bbx index 8d160a44fe0..88d963c2bc5 100644 --- a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-css.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-css.bbx @@ -38,6 +38,7 @@ doi=false, url=false, gbfieldtype=true, + dateabbrev=false, %datezeros=false, } @@ -73,13 +74,14 @@ %为标注和文献表中标点格式,重设and本地化字符串 %================================================== \DefineBibliographyStrings{english}{ -% and = { and},%and后面的空格在finalnamedelim已经加过了,所以这里去掉20191009 + and = {\ifcitation{ and}{\addcomma\addspace}},%and后面的空格在finalnamedelim已经加过了,所以这里去掉20191009 % andcn = {\gbpunctmark\unspace},%\gbpunctmark % andincitecn = {和},%将标注中的分开,便于与文献表中的区分 -% andincite = {\&}, + %andincite = { and }, %andotherscn={等}, mathesiscn={硕士学位论文}, phdthesiscn={博士学位论文}, + bytranslator= {\ifcitation{trans\adddot\space}{trans\adddot\ \lbx@sfromlang\ by}}, } @@ -92,11 +94,15 @@ %\DeclareFieldFormat*{booktitle}{\gbpunctttl#1\gbpunctttr} \DeclareFieldFormat*{title}{% \ifcitation{\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}{\textit{#1}\isdot}}{#1\isdot}} -\DeclareFieldFormat[article]{title}{% +\DeclareFieldFormat[archive]{title}{% +\ifcitation{\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}{#1\isdot}}{#1\isdot}} +\DeclareFieldFormat[article,incollection,inbook,inproceedings]{title}{% \ifcitation{\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}{\mkbibquote{#1}\isdot}}% {#1\adddot\addthinspace}} \DeclareFieldFormat*{journaltitle}{% \ifcitation{\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}{\textit{#1}}}{#1\isdot}}% +\DeclareFieldFormat{booktitle}{% +\ifcitation{\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}{\textit{#1}}}{#1}} \renewcommand*{\revsdnamepunct}{% \ifcitation{\iffieldequalstr{userd}{chinese}{\gbpunctcomma}{\gbpunctcommalanen}}{}} \DeclareDelimFormat{multinamedelim}{% @@ -196,37 +202,160 @@ \DeclareDelimFormat{finalpunct}{\iffieldequalstr{userd}{chinese}{\gbpunctdot}{\adddot}} \DeclareDelimFormat[fullinnercite]{finalpunct}{} -\DeclareFieldFormat{booktitle}{% -\ifcitation{\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}{#1}}{#1}} - %出版项中:出版社地址后面的标点 \renewcommand{\publocpunct}{% \ifcitation{\iffieldequalstr{userd}{chinese}{\gbpunctcolon}{\addcolon\addspace}}{\addcolon\addspace}% } %调整出版社与年份之间的标点 \renewcommand{\pubdatadelim}{% -\ifcitation{\iffieldequalstr{userd}{chinese}{\gbpunctcomma}{\setunit*{\addcomma\space}}}% +\ifcitation{\iffieldequalstr{userd}{chinese}{\iffieldundef{year}{}{\setunit*{\gbpunctcomma}}}{\setunit*{\addcomma\space}}}% {\setunit*{\addcomma\space}}% } +\renewcommand{\locnopubdelim}{% +\ifcitation{\iffieldequalstr{userd}{chinese}{\iffieldundef{year}{}{\setunit*{\gbpunctcomma}}}{\setunit*{\addcomma\space}}}% +{\setunit*{\addcomma\space}}% +} + +%编者与编者类型之间的标点 +\DeclareDelimFormat{editortypedelim}{\iffieldequalstr{userd}{chinese}{}{\addcomma\space}} + +%子标题前的标点 +\renewcommand*{\subtitlepunct}{% +\ifcitation{\iffieldequalstr{userd}{chinese}{}{\addcolon\addspace}}{\addcolon\addspace}} %================================================== %调整部分域的输出格式 %================================================== +%重新调整输出编者的类型 +\renewbibmacro*{editor+others}{% + \ifcitation{\ifboolexpr{ + test \ifuseeditor + and + not test {\ifnameundef{editor}} + } + {\printnames{editor}% + \setunit{\printdelim{editortypedelim}}% + \usebibmacro{editor+othersstrg}% + \clearname{editor}}% + {}}% + {\ifboolexpr{% + test \ifuseeditor + and + not test {\ifnameundef{editor}} + }% + {\printnames{editor}% + \clearname{editor}} + {}}% + } + +\renewbibmacro*{editor+othersstrg}{% + \iffieldundef{editortype} + {\ifboolexpr{ + test {\ifnumgreater{\value{editor}}{1}} + or + test {\ifandothers{editor}} + } + {\def\abx@tempa{editors}} + {\def\abx@tempa{editor}}} + {\ifboolexpr{ + test {\ifnumgreater{\value{editor}}{1}} + or + test {\ifandothers{editor}} + } + {\edef\abx@tempa{\thefield{editortype}s}} + {\edef\abx@tempa{\thefield{editortype}}}}% + \let\abx@tempb=\empty + \ifnamesequal{editor}{translator} + {\appto\abx@tempa{tr}% + \appto\abx@tempb{\clearname{translator}}} + {}% + \ifnamesequal{editor}{commentator} + {\appto\abx@tempa{co}% + \appto\abx@tempb{\clearname{commentator}}} + {\ifnamesequal{editor}{annotator} + {\appto\abx@tempa{an}% + \appto\abx@tempb{\clearname{annotator}}} + {}}% + \ifnamesequal{editor}{introduction} + {\appto\abx@tempa{in}% + \appto\abx@tempb{\clearname{introduction}}} + {\ifnamesequal{editor}{foreword} + {\appto\abx@tempa{fo}% + \appto\abx@tempb{\clearname{foreword}}} + {\ifnamesequal{editor}{afterword} + {\appto\abx@tempa{af}% + \appto\abx@tempb{\clearname{afterword}}} + {}}}% + \ifbibxstring{\abx@tempa} + {\printtext[editortype]{% + \iffieldequalstr{userd}{chinese}{\bibstring{\abx@tempa cn}}{\bibstring{\abx@tempa}}% + }\abx@tempb} + {\usebibmacro{editorstrg}}} + +%去掉译前的标点 +\renewbibmacro*{name:andothers}{\bibauthorfont% +\ifcitation{\ifboolexpr{test {\ifnumequal{\value{listcount}}{\value{liststop}}} + and test \ifmorenames} + {\ifnumgreater{\value{liststop}}{1}%注意这里试图去区分姓名总数大于1的情况,当姓名总数大于1时,最后一个姓名后面先加入一个\finalandcomma + {}{}%\finalandcomma,目前国标没有这样的区分要求,如果有需要也是可以这么去做的。 + \printdelim{andothersdelim}\printdelim{strandothersdelim}}% + {}}% +{\ifboolexpr{test {\ifnumequal{\value{listcount}}{\value{liststop}}} + and test \ifmorenames} + {\ifnumgreater{\value{liststop}}{1}%注意这里试图去区分姓名总数大于1的情况,当姓名总数大于1时,最后一个姓名后面先加入一个\finalandcomma + {}%\finalandcomma,目前国标没有这样的区分要求,如果有需要也是可以这么去做的。 + {}% + \printdelim{andothersdelim}\printdelim{strandothersdelim}% + }% + {%当是译者的时候需要特殊处理:从7.2节看等,译前面加逗号,但从示例看等和译同时出现时,译前的逗号没有,比如: + %袁训来, 陈哲, 肖书海, 等. + %胡泳, 范海燕, 译. + %潘惠霞, 魏婧, 杨艳, 等译. + \ifnumequal{\value{listcount}}{\value{liststop}}% + {\ifcurrentname{translator}{\iffieldequalstr{usere}{chinese}{\aftertransdelim}{}}{}}{}%为了实现上述第二个示例情况做的处理 + }}% +} + + + %增加年字 \renewbibmacro*{date}{% -\ifcitation{\iffieldequalstr{userd}{chinese}{\printdate 年}{\printdate}}% +\ifcitation{% + \iffieldequalstr{userd}{chinese}{% + \ifboolexpr{test {\ifentrytype{article}} or test {\ifentrytype{inproceedings}} + or test {\ifentrytype{archive}} or test {\ifentrytype{online}}} + {\printtext{\blx@gbdatecn{}{}}}% + {\printdate\iffieldundef{year}{}{年}}% + }{\ifentrytype{archive}{\printtext{\blx@gbdateen{}{}}}{\printdate}}% +}% {\printdate}% } - - \newrobustcmd*{\blx@gbdatecn}[3][]{% \dateeraprintpre{#2#3year}% - \blx@imc@forcezerosy{\thefield{#2#3year}年}\ifblank{#1}{}{\printfield{#1}}% + \iffieldundef{#2#3year}{}{\blx@imc@forcezerosy{\thefield{#2#3year}年}}\ifblank{#1}{}{\printfield{#1}}% \iffieldundef{#2#3month}{}{{\thefield{#2#3month}}月}% \iffieldundef{#2#3day}{}{{\thefield{#2#3day}}日}} +\newrobustcmd*{\blx@gbdateen}[3][]{% +\mkbibdateen{#2#3year}{#2#3month}{#2#3day}% +} + +\newrobustcmd*{\mkbibdateen}[3]{% + \iffieldundef{#2} + {} + {\mkbibmonth{\thefield{#2}}% + \iffieldundef{#1}{}{\space}}% + \iffieldundef{#3} + {} + {{\thefield{#3}}% + \iffieldundef{#2}{}{\addcomma\space}}% + \iffieldbibstring{#1} + {\bibstring{\thefield{#1}}} + {\dateeraprintpre{#1}\stripzeros{\thefield{#1}}}} + + \renewbibmacro*{newsdate}{%% \ifboolexpr{% test{\ifcitation} and test{\iffieldequalstr{userd}{chinese}}% @@ -257,6 +386,18 @@ test{\ifcitation} and test{\iffieldequalstr{userd}{chinese}}% }}% +\renewbibmacro*{url+urldate}{% +\ifcitation{\newunit\usebibmacro{url}\newunit% + \printtext{\blx@gbdatecn{}{url}}% + }% + {\iffieldundef{urlyear}% + {}{%\setunit*{\addspace}% + \usebibmacro{urldate}}% + \setunit{\addperiod\addspace}% + \usebibmacro{url}}% +} + + \DeclareFieldFormat{type}% {\ifcitation{\iffieldequalstr{userd}{chinese}% {\ifbibxstring{#1cn}{\bibxstring{#1cn}}{#1}}% @@ -280,30 +421,57 @@ test{\ifcitation} and test{\iffieldequalstr{userd}{chinese}}% \DeclareFieldFormat[newspaper,article,periodical]{number}% {\ifcitation{% \iffieldequalstr{userd}{chinese}{% - \iffieldequalstr{entrysubtype}{news}{\printtext{\gbpunctcomma\bibstring{serialcn} #1 版}} + \iffieldequalstr{entrysubtype}{news}{% + \iffieldint{number}% + {\printtext{\gbpunctcomma\bibstring{serialcn} #1 版}}% + {\printtext{\gbpunctcomma #1}}% + }% {\iffieldint{number}{\setcounter{numberwithoutzero}{#1}% - \printtext{\bibstring{serialcn}\addthinspace\arabic{numberwithoutzero}\addthinspace\bibstring{numbercn}}}% - {\printtext{\bibstring{serialcn}\addthinspace #1\addthinspace\bibstring{numbercn}}}% + \printtext{\bibstring{serialcn}\addthinspace\arabic{numberwithoutzero} 期}}% + {\printtext{\bibstring{serialcn}\addthinspace #1 期}}% }}% - {\setcounter{numberwithoutzero}{#1}\printtext{(}\arabic{numberwithoutzero}\printtext{)}}% + {\newunit\setcounter{numberwithoutzero}{#1}\printtext{\bibstring{number}}\arabic{numberwithoutzero}}% + }% + {\iffieldint{number}{\setcounter{numberwithoutzero}{#1}\arabic{numberwithoutzero}}{#1}}% +} + +\DeclareFieldFormat[book,inbook,incollection]{number}% +{\iffieldequalstr{userd}{chinese}{\iffieldint{number}% + {% + \bibstring{serialcn}#1\bibstring{numbercn}% + }{#1}% }% - {\setcounter{numberwithoutzero}{#1}\arabic{numberwithoutzero}}% + {\bibstring{number}~#1}% } -\DeclareFieldFormat[article,periodical]{volume}% +\DeclareFieldFormat[article,periodical,newspaper]{volume}% {\ifcitation{% -\iffieldequalstr{userd}{chinese}{\bibstring{serialcn}#1\bibstring{volumecn}}% - {\bibstring{volume}~#1}}% +\iffieldequalstr{userd}{chinese}{% + \iffieldint{volume}% + {\bibstring{serialcn}#1\bibstring{volumecn}}% + {#1}% + }% + {\bibstring{volume}~#1}}% {#1}% } -\DeclareFieldFormat[book]{volume}% +\DeclareFieldFormat[book,inbook,incollection]{volume}% {\iffieldequalstr{userd}{chinese}{\iffieldint{volume}% - {\bibstring{serialcn}#1\bibstring{volumecn}}{#1}% + {\iffieldequalstr{entrysubtype}{classic}{\bibstring{volumecn}#1}% + {\bibstring{serialcn}#1\bibstring{volumecn}}% + }{#1}% }% {\bibstring{volume}~#1}% } +\DeclareListFormat[article,newspaper]{location}{% +\iffieldequalstr{userd}{chinese}{\gbpunctprl#1\gbpunctprr}{#1}% +} + +\DeclareListFormat[article]{series}{% +\iffieldequalstr{userd}{chinese}{\gbpunctprl#1\gbpunctprr}{#1}% +} + % % 调整期刊名的格式 % @@ -312,15 +480,15 @@ test{\ifcitation} and test{\iffieldequalstr{userd}{chinese}}% \renewbibmacro*{journal+issuetitle}{% \ifcitation{\bibpubfont% \usebibmacro{journal}% + \iflistundef{location}{}{\printlist{location}}% \iffieldundef{series}% {}% - {\printfield{series}% - \setunit{\addspace}}% + {\printfield{series}}% \iffieldundef{volume}% {\ifciteseen{}{\usebibmacro{issue+date}% \usebibmacro{volume+number+eid}}}% {\ifciteseen{}{\usebibmacro{volume+number+eid}% - \newunit% + \iffieldundef{year}{}{\newunit}% \usebibmacro{issue+date}}}% }% {\bibpubfont%源来自standard.bbx @@ -446,22 +614,18 @@ test{\ifcitation} and test{\iffieldequalstr{userd}{chinese}}% test{\iffieldundef{subtitle}}% }% {}% - {\setunit{\iffieldequalstr{userd}{chinese}{\gbpunctcolon}{\gbpunctcolonlanen}}% + {\setunit*{\iffieldequalstr{userd}{chinese}{\gbpunctcolon}{\gbpunctcommalanen}}% + \ifboolexpr{not test {\iffieldundef{origyear}} and test{\iffieldequalstr{entrysubtype}{classic}}}% + {\printorigdate}{}% \printtext[title]{\bibtitlefont%增加字体控制命令%增加了标点: \printfield[titlecase]{title}% \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 {}{\setunit{\subtitlepunct}% \printfield[titlecase]{subtitle}}% \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 - {\setunit{\subtitlepunct}\printfield{titleaddon}}% - \iftoggle{bbx:gbtype}{% - \iffieldundef{entrysubtype}{\printfield[gbtypeflag]{usera}}%在标题后直接给出文献标识字母,判断一下,是否是报纸和标准 - {\iffieldequalstr{entrysubtype}{standard}{\printfield[gbtypeflags]{usera}}%判断是否为标准 - {\iffieldequalstr{entrysubtype}{news}{\printfield[gbtypeflagn]{usera}}% 判断是否为报纸 - {\printfield[gbtypeflag]{usera}}}% 其它 - }}{}% - }\ifboolexpr{test{\ifentrytype{book}} and (not test{\iffieldundef{volume}})}%判断一下book类有没有volume - {\ifcitation{}{\setunit{\subtitlepunct}}\printfield{volume}}{}%% + {\setunit{\subtitlepunct}\printfield{titleaddon}}}% + \ifboolexpr{test{\ifentrytype{book}} and (not test{\iffieldundef{volume}})}%判断一下book类有没有volume + {\printfield{volume}}{}%% }}{\ifboolexpr{% test{\iffieldundef{title}}% and @@ -600,6 +764,7 @@ test{\ifcitation} and test{\iffieldequalstr{userd}{chinese}}% }{\printdelim{authotitledelim}}% \iffieldundef{series}{}{\usebibmacro{series+number}\setunit{\addcolon\addspace}}%为处理一些存在series的情况而增加 \usebibmacro{maintitle+booktitle}% + \usebibmacro{inbook:volume+number}% } % @@ -626,6 +791,44 @@ test{\ifcitation} and test{\iffieldequalstr{userd}{chinese}}% \ifcitation{\iffieldequalstr{userd}{chinese}{\gbpunctcolon}{\addperiod\space}}{\addperiod\space}% } +\renewbibmacro*{maintitle+booktitle}{% +\ifcitation{% + \iffieldundef{maintitle} + {} + {\usebibmacro{maintitle}% + \newunit\newblock + \iffieldundef{volume} + {} + {\printfield{volume}% + \printfield{part}% + \setunit{\addcolon\space}}}% + \usebibmacro{booktitle}% + }% + {\iffieldundef{maintitle} + {} + {\usebibmacro{maintitle}% + \newunit\newblock + \iffieldundef{volume} + {} + {\printfield{volume}% + \printfield{part}% + \setunit{\addcolon\space}}}% + \usebibmacro{booktitle}% + \newunit}% +} + + +\newbibmacro*{inbook:volume+number}{% +\ifcitation{% + \iffieldundef{volume}{}{\printfield{volume}}% + \iffieldundef{number}{}{\printfield{number}}% + }% + {\iffieldundef{volume}{}{\setunit{\addcolon\addspace}\printfield{volume}}% + \iffieldundef{number}{}{\setunit{\addcolon\addspace}\printfield{number}}%增加卷和册信息 + }% +} + + % % 增加inbook:parent用于辅助crossref传统功能的实现 @@ -636,12 +839,122 @@ test{\ifcitation} and test{\iffieldequalstr{userd}{chinese}}% \ifnameundef{bookauthor}{% \ifnameundef{editor}{}{\printdelim{authotitledelim}}% }{\printdelim{authotitledelim}}% -\iffieldundef{series}{}{\usebibmacro{series+number}\setunit{\addcolon\addspace}}%为处理一些存在series的情况而增加 +\ifboolexpr{test {\ifcitation} and test{\iffieldequalstr{entrysubtype}{classic}}}{} +{\iffieldundef{series}{}{\usebibmacro{series+number}\setunit{\addcolon\addspace}}}%为处理一些存在series的情况而增加 \usebibmacro{maintitle+booktitle}% -\iffieldundef{volume}{}{\setunit{\addcolon\addspace}\printfield{volume}}% -\iffieldundef{number}{}{\setunit{\addcolon\addspace}\printfield{number}}%增加卷和册信息 + \usebibmacro{inbook:volume+number}% +\ifboolexpr{test {\ifcitation} and test{\iffieldequalstr{entrysubtype}{classic}}}% +{\iffieldundef{series}{}{\newunit\usebibmacro{series+number}}}{}% \newunit\newblock% - \printfield{edition}% +\ifboolexpr{test {\ifcitation} and test{\iffieldequalstr{entrysubtype}{classic}}}{}{\printfield{edition}}% \newunit \newunit\newblock - \usebibmacro{publisher+location+date}} + \usebibmacro{publisher+location+date}% +\ifboolexpr{test {\ifcitation} and test{\iffieldequalstr{entrysubtype}{classic}}}{\printfield{edition}}{}% +} + + +\DeclareBibliographyDriver{book}{%源来自standard.bbx文件 +\usebibmacro{bibindex}% +\usebibmacro{begentry}% +\usebibmacro{author/editor+others/translator+others}% +\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\usebibmacro{maintitle+title}% +\iftoggle{bbx:gbstrict}{}{% +\newunit +\printlist{language}% +\newunit\newblock% +\usebibmacro{byauthor}% +\newunit\newblock}% +\usebibmacro{byeditor+others}% +\newunit% +\ifboolexpr{test {\ifcitation} and test{\iffieldequalstr{entrysubtype}{classic}}}{}{\printfield{edition}}% +\newunit\newblock%% +\iftoggle{bbx:gbstrict}{}{% +\iffieldundef{maintitle}% +{\printfield{volume}% +\printfield{part}}% +{}% +\newunit% +\printfield{volumes}% +\newunit\newblock% +\usebibmacro{series+number}}% +\newunit\newblock% +%\printfield{note}% +%\newunit\newblock% +\usebibmacro{publisher+location+date}% +\ifboolexpr{test {\ifcitation} and test{\iffieldequalstr{entrysubtype}{classic}}}{\printfield{edition}}{}% +%\newunit\newblock %这里标点去掉 +\usebibmacro{chapter+pages}% + \iffieldundef{url}{}{%当没有网址时也不输出 + \usebibmacro{modifydate}}%带括号的修改或更新日期, +\usebibmacro{doi+eprint+url}%从下面移动到上面来,因为gbt2015的url需直接放在页码后面。 + \newunit\newblock% + \printfield{pagetotal}% + \newunit\newblock% + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock + %\usebibmacro{doi+eprint+url}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{annotation}\usebibmacro{finentry}} + + + +\DeclareBibliographyDriver{manual}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \usebibmacro{byeditor+others}%增加的译者信息 + \newunit\newblock + \iftoggle{bbx:gbfieldtype}{% + \printfield{type}% + \setunit*{\addspace}}{}% + \ifboolexpr{test {\ifcitation} and test{\ifentrytype{archive}}}% + {}{\printfield{number}}% + \newunit\newblock + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{institution+location+date}% + \ifboolexpr{test {\ifcitation} and test{\ifentrytype{archive}}}% + {\newunit\printfield{number}}{}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + \iffieldundef{url}{}{%当没有网址时也不输出修改或更新日期 + \usebibmacro{modifydate}}%修改或更新日期为带括号的时间 + \usebibmacro{doi+eprint+url}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isrn}} + {}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{annotation}\usebibmacro{finentry}} diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-css.cbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-css.cbx index a0fa1dc004a..56bf057f015 100644 --- a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-css.cbx +++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-css.cbx @@ -10,7 +10,7 @@ %%用法:类似于标准的样式在biblatex加载时设置样式 %%文献表正常处理,标注命令主要用cite和textcite -\ProvidesFile{chinese-css.cbx}[2023/03/31 v1.0a a biblatex citation style for CSS] +\ProvidesFile{chinese-css.cbx}[v1.0a a biblatex citation style for CSS] %================================================== %加载gb样式 @@ -21,10 +21,10 @@ %================================================== %选项设置 %================================================== -%\ExecuteBibliographyOptions{ -% maxcitenames=2, -% mincitenames=1, -%} +\ExecuteBibliographyOptions{ + maxcitenames=2, + mincitenames=1, +} %================================================== %引用命令设置,主要用cite和textcite @@ -35,6 +35,20 @@ \renewcommand{\bibfootnotewrapper}[1]{% \bibsentence#1}% +%避免去除前面的空白 +\renewrobustcmd{\blx@mkbibfootnote}[2]{% + \iftoggle{blx@footnote} + {\blx@warning{Nested notes}% + \addspace\mkbibparens{#2}} + {%\unspace + \ifnum\blx@notetype=\tw@ + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + {\csuse{blx@theendnote#1}{\protecting{\blxmkbibnote{end}{#2}}}} + {\csuse{footnote#1}{\protecting{\blxmkbibnote{foot}{#2}}}}}} + %修改脚注注释的实现 \def\execgbfootbib% {% @@ -44,8 +58,8 @@ % %重定义\footfullcite使完成css的脚注文献要求 \DeclareCiteCommand{\footfullcite}[\mkbibfootnote]% - {\defcounter{maxnames}{\blx@maxbibnames}%局部定义maxnames和minnames计数器 - \defcounter{minnames}{\blx@minbibnames}%使footfullcite内的作者输出与正文文献表中的一致。 + {\defcounter{maxnames}{\blx@maxcitenames}%局部定义maxnames和minnames计数器 + \defcounter{minnames}{\blx@mincitenames}%使footfullcite内的作者输出与正文文献表中的一致。 \usebibmacro{prenote}% \renewbibmacro*{postnote}{% \iffieldundef{postnote}% @@ -59,8 +73,14 @@ {\multicitedelim}% {\usebibmacro{postnote}\usebibmacro{finentry}} + \DeclareCiteCommand{\fullcite} - {\usebibmacro{prenote}} + {\usebibmacro{prenote}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}{\setunit{\iffieldequalstr{userd}{chinese}{\unspace\gbpunctcomma}{\addcolon\addspace}}% + \printfield{postnote}}}%与ay样式不同,由于已修改postnote域格式,直接用printfield + } {\ifciteseen% {\usedriver{\DeclareNameAlias{sortname}{default}}{citeseen:\thefield{entrytype}}}%\nopunct {\usedriver{\DeclareNameAlias{sortname}{default}}{\thefield{entrytype}}}% @@ -68,8 +88,14 @@ {\multicitedelim} {\usebibmacro{postnote}\usebibmacro{finentry}} + \DeclareCiteCommand{\fullinnercite} - {\usebibmacro{prenote}} + {\usebibmacro{prenote}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}{\setunit{\iffieldequalstr{userd}{chinese}{\unspace\gbpunctcomma}{\addcolon\addspace}}% + \printfield{postnote}}}%与ay样式不同,由于已修改postnote域格式,直接用printfield + } {\ifciteseen% {\usedriver{\DeclareNameAlias{sortname}{default}}{citeseen:\thefield{entrytype}}}%\nopunct {\usedriver{\DeclareNameAlias{sortname}{default}}{\thefield{entrytype}}}% @@ -93,3 +119,30 @@ \printfield[citejz]{labeltitle}} {\multicitedelim} {\usebibmacro{postnote}} + + +\DeclareFieldFormat{citetitle}{% +\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}% +{\mkbibemph{#1}}% +} + +\DeclareFieldFormat + [article,inbook,incollection,inproceedings,patent,thesis,unpublished] + {citetitle}{% + \iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}% + {\mkbibquote{#1\isdot}}% + } + + +%为文献输出出版信息 +\DeclareCiteCommand{\citepub} + {\boolfalse{citetracker}% + \boolfalse{pagetracker}% + \usebibmacro{prenote}} + {\ifciteindex + {\indexfield{indextitle}} + {}% + \ifentrytype{online}{\usebibmacro{institution+location+date}}{\usebibmacro{publisher+location+date}}% + } + {\multicitedelim} + {\usebibmacro{postnote}} diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-erj.cbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-erj.cbx index 42447176421..d0300a9b101 100644 --- a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-erj.cbx +++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-erj.cbx @@ -10,7 +10,7 @@ %%用法:类似于标准的样式在biblatex加载时设置样式 %%文献表正常处理,标注命令主要用cite和textcite -\ProvidesFile{chinese-erj.cbx}[2022/02/22 v1.0a a biblatex citation style for ERJ] +\ProvidesFile{chinese-erj.cbx}[v1.0a a biblatex citation style for ERJ] %================================================== %加载gb样式 @@ -22,17 +22,17 @@ % 增加一个控制标注中标点是英文还是中文的选项 % 20220222,v1.0a,hzz \DeclareBibliographyOption{gbcitepunctcn}[true]{%biblatex低版本 - \ifstrequal{#1}{false}{\execerjpunctencite}{}} - -\def\erjpunctmarkcite{、}% -\def\erjpunctsemicoloncite{;}% -\def\erjpunctparenlcite{(}% -\def\erjpunctparenrcite{)} -\def\execerjpunctencite{% -\def\erjpunctmarkcite{\addcomma\addspace}% -\def\erjpunctsemicoloncite{\addsemicolon\addspace}% -\def\erjpunctparenlcite{(}% -\def\erjpunctparenrcite{)} + \ifstrequal{#1}{false}{\exegbpunctencite}{}} + +\def\gbpunctmarkcite{、}% +\def\gbpunctsemicoloncite{;}% +\def\gbpunctparenlcite{(}% +\def\gbpunctparenrcite{)} +\def\exegbpunctencite{% +\def\gbpunctmarkcite{\addcomma\addspace}% +\def\gbpunctsemicoloncite{\addsemicolon\addspace}% +\def\gbpunctparenlcite{(}% +\def\gbpunctparenrcite{)} } %================================================== @@ -47,13 +47,13 @@ %引用命令设置,主要用cite和textcite %包括标点设置 %================================================== -\renewcommand*{\multicitedelim}{\erjpunctsemicoloncite}%\addsemicolon\addspace; +\renewcommand*{\multicitedelim}{\gbpunctsemicoloncite}%\addsemicolon\addspace; \renewcommand*{\textcitedelim}{% \iffinalcitedelim {\ifnumgreater{\value{textcitetotal}}{2} {}{}%\iftextcitepunct{\finalandsemicolon}{\finalandcomma} - \addspace\erjpunctmarkcite}%\addspace\bibstring{andincitecn} - {\iftextcitepunct{\addsemicolon\space}{\addspace\erjpunctmarkcite}}%\addcomma + \addspace\gbpunctmarkcite}%\addspace\bibstring{andincitecn} + {\iftextcitepunct{\addsemicolon\space}{\addspace\gbpunctmarkcite}}%\addcomma }%\space \DeclareDelimFormat[textcite]{nameyeardelim}{\addspace}%\addcomma\space @@ -67,7 +67,7 @@ } %标注压缩时,直接用date+extradate代替extradate实现2006a,2006b的效果 -%\DeclareDelimFormat*{compcitedelim}{\erjpunctmarkcite}%\addcomma\addspace +%\DeclareDelimFormat*{compcitedelim}{\gbpunctmarkcite}%\addcomma\addspace \newbibmacro*{cite:extradate}{% \iffieldundef{extradate} {} @@ -81,12 +81,12 @@ %添加前后空格 \DeclareCiteCommand{\cite}%[\mkbibparens] {\usebibmacro{cite:init}% - \unspace\printtext{\erjpunctparenlcite}\usebibmacro{prenote}}%\addspace + \unspace\printtext{\gbpunctparenlcite}\usebibmacro{prenote}}%\addspace {\usebibmacro{citeindex}% \usebibmacro{cite}} {} {\usebibmacro{postnote}% - \erjpunctparenrcite}%\addspace + \gbpunctparenrcite}%\addspace %原版 %\DeclareCiteCommand{\cite}[\mkbibparens] @@ -124,7 +124,7 @@ {\usebibmacro{cite:label}% \setunit{% \global\booltrue{cbx:parens}% - \printdelim{nonameyeardelim}\unspace\erjpunctparenlcite}%\bibopenparen + \printdelim{nonameyeardelim}\unspace\gbpunctparenlcite}%\bibopenparen \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% @@ -133,7 +133,7 @@ {\printnames{labelname}% \setunit{% \global\booltrue{cbx:parens}% - \printdelim{nameyeardelim}\unspace\erjpunctparenlcite}%\bibopenparen + \printdelim{nameyeardelim}\unspace\gbpunctparenlcite}%\bibopenparen \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% @@ -148,7 +148,7 @@ \savefield{namehash}{\cbx@lasthash}}% \setunit{% \ifbool{cbx:parens} - {\erjpunctparenrcite\global\boolfalse{cbx:parens}}%\bibcloseparen + {\gbpunctparenrcite\global\boolfalse{cbx:parens}}%\bibcloseparen {}% \textcitedelim}} @@ -158,11 +158,11 @@ {\setunit{}% \printtext{% \ifbool{cbx:parens} - {\erjpunctparenrcite\global\boolfalse{cbx:parens}}%\bibcloseparen + {\gbpunctparenrcite\global\boolfalse{cbx:parens}}%\bibcloseparen {}}} {\setunit{% \ifbool{cbx:parens} - {\erjpunctparenrcite\global\boolfalse{cbx:parens}}%\bibcloseparen + {\gbpunctparenrcite\global\boolfalse{cbx:parens}}%\bibcloseparen {}% \textcitedelim}}} diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-jmw.bbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-jmw.bbx new file mode 100644 index 00000000000..cba4e064597 --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-jmw.bbx @@ -0,0 +1,821 @@ +%% +%% --------------------------------------------------------------- +%% css.bbx --- A citation style of journal of management world in china +%% modified from gb7714-2015 +%% Maintained by huzhenzhen +%% E-mail: hzzmail@163.com +%% Released under the LaTeX Project Public License v1.3c or later +%% history +%% 2019/03/28 v1.0 +%% 2022/02/22 v1.0a +%% --------------------------------------------------------------- +%% +%%用法:类似于标准的样式在biblatex加载时设置样式 +%%文献表正常处理,标注命令主要用cite和textcite +\ProvidesFile{chinese-jmw.bbx}[2023/04/24 v1.0a a biblatex bibliography style for JMW] + + +%================================================== +%加载gb样式 +%================================================== +\RequireBibliographyStyle{gb7714-2015} + + +% +% 增加一个控制标点是英文还是中文的选项 +% 20220222,v1.0a,hzz +\DeclareBibliographyOption{gbpunctcn}[true]{%biblatex低版本 + \ifstrequal{#1}{false}{\execgbpuncten}{}} + +\newbibmacro*{bbx:ifmergeddate}{\@secondoftwo} + +\newbibmacro*{date+extradate}{} + +% merge date with date label +\def\bbx@opt@mergedate@true{% + \renewbibmacro*{date+extradate}{% + \iffieldundef{labelyear} + {} + {\printtext{% + \iflabeldateisdate + {\printdateextra} + {\printlabeldateextra}}}}% + \renewbibmacro*{bbx:ifmergeddate}{\iflabeldateisdate}% +% \renewbibmacro*{issue+date}{% +% \ifboolexpr{test {\usebibmacro{bbx:ifmergeddate}} +% and +% test {\iffieldundef{issue}}} +% {} +% {\printtext[parens]{% +% \printfield{issue}% +% \setunit*{\addspace}% +% \usebibmacro{bbx:ifmergeddate} +% {} +% {\printdate}}}% +% \newunit} +} + + +\renewbibmacro*{author}{% + \ifboolexpr{ + test \ifuseauthor + and + not test {\ifnameundef{author}} + } + {\printnames{author}% + \iffieldundef{authortype} + {\setunit{\printdelim{nameyeardelim}}} + {\setunit{\printdelim{authortypedelim}}}% + \iffieldundef{authortype} + {} + {\usebibmacro{authorstrg}% + \setunit{\printdelim{nameyeardelim}}}}% + {\global\undef\bbx@lasthash + \usebibmacro{labeltitle}% + \setunit*{\printdelim{nonameyeardelim}}}% +\iffieldequalstr{userd}{chinese}{}{\usebibmacro{date+extradate}\clearfield{year}}% +} + + +%================================================== +%选项设置 +%================================================== +\ExecuteBibliographyOptions{ + gbnamefmt=familyahead, + gbbiblabel=parens, + gbtype=false, + gbpub=false, + doi=false, + url=false, + gbfieldtype=true, + dateabbrev=false, + maxbibnames=99, + mergedate=true, + %datezeros=false, + } + +%================================================== +%定义一些标点为中文全角标点 +%================================================== +\def\gbpunctdot{。}% +\def\gbpunctmark{、}% +\def\gbpunctcomma{,}% +\def\gbpunctcommalanen{,}%\addcomma\addspace +\def\gbpunctcolon{:}% +\def\gbpunctcolonlanen{\addcolon\addspace}% +\def\gbpunctsemicolon{;}% +\def\gbpunctttl{《}% +\def\gbpunctttr{》} +\def\gbpunctprl{(}% +\def\gbpunctprr{)} + + +\def\execgbpuncten{% +\def\gbpunctdot{\adddot}% +\def\gbpunctmark{\addcomma\addspace}% +\def\gbpunctcomma{\addcomma\addspace}% +\def\gbpunctcommalanen{\addcomma\addspace}% +\def\gbpunctcolon{\addcolon\addspace}% +\def\gbpunctcolonlanen{\addcolon\addspace}% +\def\gbpunctsemicolon{\addsemicolon\addspace}% +\def\gbpunctttl{《}% +\def\gbpunctttr{》}% +} + +\DefineBibliographyExtras{english}{\renewcommand*{\bibrangedash}{$\sim$}}%将页码间隔符替换会英文的短横线 + +%================================================== +%为标注和文献表中标点格式,重设and本地化字符串 +%================================================== +\DefineBibliographyStrings{english}{ + and = { and},%and后面的空格在finalnamedelim已经加过了,所以这里去掉20191009 + andcn = {\gbpunctmark\unspace},%\gbpunctmark + %andotherscn={等}, + mathesiscn={硕士学位论文}, + phdthesiscn={博士学位论文}, + bytranslator= {trans\adddot\ \lbx@sfromlang\ by}, +} + + + + +%================================================== +%设置一些标点格式为中文的标点 +%================================================== +%\DeclareFieldFormat{titlecase}{\iffieldequalstr{userd}{chinese}{#1}{\capitalisewords{#1}}} +%\DeclareFieldFormat*{booktitle}{\gbpunctttl#1\gbpunctttr} +\DeclareFieldFormat*{title}{% +\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}{\textit{#1}\isdot}} +\DeclareFieldFormat[book]{title}{% +\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}{\textbf{\textit{#1}}\isdot}} +\DeclareFieldFormat[archive]{title}{% +\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}{#1\isdot}} +\DeclareFieldFormat[article,incollection,inbook,inproceedings,misc]{title}{% +\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}{\mkbibquote{#1}\isdot}} +\DeclareFieldFormat*{journaltitle}{% +\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}{\textbf{\textit{#1}}}}% +\DeclareFieldFormat{booktitle}{% +\iffieldequalstr{userd}{chinese}{\gbpunctttl#1\gbpunctttr}{\textbf{\textit{#1}}}} +\renewcommand*{\revsdnamepunct}{% +\iffieldequalstr{userd}{chinese}{\gbpunctcomma}{\gbpunctcommalanen}} +\DeclareDelimFormat{multinamedelim}{% +\iffieldequalstr{userd}{chinese}{\gbpunctmark}{\gbpunctcommalanen}} +\DeclareDelimFormat{finalnamedelim}{% + %\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% + %\addspace% + \edef\userfieldabcde{userd}% + \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbcitelocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andincitecn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andkr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\space\bibstring{andincite}\space}{}% + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{and}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{and}}{}% +%\space% + \or% + \bibstring{andincitecn}\space% + \or% + \bibstring{andincite}\space% + \fi} +\DeclareDelimFormat[bib,biblist]{finalnamedelim}{% +% \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}% + \edef\userfieldabcde{userd}% + \ifcurrentname{translator}{\edef\userfieldabcde{usere}}{}% + \ifcurrentname{editor}{\edef\userfieldabcde{userc}}{}% + \ifcurrentname{author}{\edef\userfieldabcde{userf}}{}% + \ifcurrentname{bookauthor}{\edef\userfieldabcde{userb}}{}% + \ifcase\value{gbbiblocalcase}% + \iffieldequalstr{\userfieldabcde}{chinese}{\bibstring{andcn}}{}% + \iffieldequalstr{\userfieldabcde}{korean}{\bibstring{andkr}}{}% + \iffieldequalstr{\userfieldabcde}{japanese}{\bibstring{andjp}}{}% + \iffieldequalstr{\userfieldabcde}{english}{\bibstring{and}}{}% + \iffieldequalstr{\userfieldabcde}{french}{\bibstring{and}}{}% + \iffieldequalstr{\userfieldabcde}{russian}{\bibstring{and}}{}% +\space% + \or% +\bibstring{andcn}\space% + \or% + \bibstring{and}\space% + \fi} +\DeclareDelimFormat{nameyeardelim}{% +\iffieldequalstr{userd}{chinese}{\gbpunctcomma}{\gbpunctcommalanen}} +\DeclareDelimFormat[bib,biblist]{nameyeardelim}{% +\iffieldequalstr{userd}{chinese}{\gbpunctcomma}{\gbpunctcommalanen}} +\DeclareDelimFormat{bibpagespunct}{% +\iffieldequalstr{userd}{chinese}{\unspace\gbpunctcomma}{\unspace\gbpunctcommalanen}} +\DeclareFieldFormat{pages}{%%前面引导页码的pp.等字符 +\iffieldequalstr{userd}{chinese}{% +\printtext{\bibstring{serialcn} #1\addthinspace 页}}% +{\mkpageprefix[bookpagination]{#1}}} + +% +% 调整页码前的标点和去掉期刊文章等页码后面的标点 +% +\renewbibmacro*{note+pages}{%源来自standard.bbx +% \iffieldundef{postnote}{\iffieldundef{pages}{}{% +% \setunit{\bibpagespunct}% +% \printfield{pages}}}{}% +} + + +% +% 调整页码的格式,即chapter+pages格式 +% +\renewbibmacro*{chapter+pages}{% +\iffieldundef{postnote}{\iffieldundef{pages}{}{% + \setunit{\bibpagespunct}% + \printfield{pages}}}{}% +} + + +\renewcommand*{\newunitpunct}{% +\iffieldequalstr{userd}{chinese}{\gbpunctcomma}{\gbpunctcommalanen}% +} +\renewcommand*{\finentrypunct}{% +\printdelim{finalpunct}} +%调整标注的注释中的条目结尾标点 +\DeclareDelimFormat{finalpunct}{\iffieldequalstr{userd}{chinese}{\gbpunctdot}{\adddot}} +\DeclareDelimFormat[fullinnercite]{finalpunct}{} + +%出版项中:出版社地址后面的标点 +\renewcommand{\publocpunct}{% +\iffieldequalstr{userd}{chinese}{\gbpunctcolon}{\addcolon\addspace}% +} +%调整出版社与年份之间的标点 +\renewcommand{\pubdatadelim}{% +\iffieldequalstr{userd}{chinese}% + {\iffieldundef{year}{}{\setunit*{\gbpunctcomma}}}{\setunit*{\addcomma\space}}} +\renewcommand{\locnopubdelim}{% +\iffieldequalstr{userd}{chinese} + {\iffieldundef{year}{}{\setunit*{\gbpunctcomma}}}{\setunit*{\addcomma\space}}} + +%编者与编者类型之间的标点 +\DeclareDelimFormat{editortypedelim}{\iffieldequalstr{userd}{chinese}{}{\addcomma\space}} + +%子标题前的标点 +\renewcommand*{\subtitlepunct}{% +\iffieldequalstr{userd}{chinese}{}{\addcolon\addspace}} + +%================================================== +%调整部分域的输出格式 +%================================================== + +%重新调整输出编者的类型 +\renewbibmacro*{editor+others}{% + \ifboolexpr{ + test \ifuseeditor + and + not test {\ifnameundef{editor}} + } + {\printnames{editor}% + \setunit{\printdelim{editortypedelim}}% + \usebibmacro{editor+othersstrg}% + \clearname{editor}}% + {}% + } + +\renewbibmacro*{editor+othersstrg}{% + \iffieldundef{editortype} + {\ifboolexpr{ + test {\ifnumgreater{\value{editor}}{1}} + or + test {\ifandothers{editor}} + } + {\def\abx@tempa{editors}} + {\def\abx@tempa{editor}}} + {\ifboolexpr{ + test {\ifnumgreater{\value{editor}}{1}} + or + test {\ifandothers{editor}} + } + {\edef\abx@tempa{\thefield{editortype}s}} + {\edef\abx@tempa{\thefield{editortype}}}}% + \let\abx@tempb=\empty + \ifnamesequal{editor}{translator} + {\appto\abx@tempa{tr}% + \appto\abx@tempb{\clearname{translator}}} + {}% + \ifnamesequal{editor}{commentator} + {\appto\abx@tempa{co}% + \appto\abx@tempb{\clearname{commentator}}} + {\ifnamesequal{editor}{annotator} + {\appto\abx@tempa{an}% + \appto\abx@tempb{\clearname{annotator}}} + {}}% + \ifnamesequal{editor}{introduction} + {\appto\abx@tempa{in}% + \appto\abx@tempb{\clearname{introduction}}} + {\ifnamesequal{editor}{foreword} + {\appto\abx@tempa{fo}% + \appto\abx@tempb{\clearname{foreword}}} + {\ifnamesequal{editor}{afterword} + {\appto\abx@tempa{af}% + \appto\abx@tempb{\clearname{afterword}}} + {}}}% + \ifbibxstring{\abx@tempa} + {\printtext[editortype]{% + \iffieldequalstr{userd}{chinese}{\bibstring{\abx@tempa cn}}{\bibstring{\abx@tempa}}% + }\abx@tempb} + {\usebibmacro{editorstrg}}} + +%去掉译前的标点 +\renewbibmacro*{name:andothers}{\bibauthorfont% + \ifboolexpr{test {\ifnumequal{\value{listcount}}{\value{liststop}}} + and test \ifmorenames} + {\ifnumgreater{\value{liststop}}{1}%注意这里试图去区分姓名总数大于1的情况,当姓名总数大于1时,最后一个姓名后面先加入一个\finalandcomma + {}{}%\finalandcomma,目前国标没有这样的区分要求,如果有需要也是可以这么去做的。 + \printdelim{andothersdelim}\printdelim{strandothersdelim}}% + {}% +} + + + +%增加年字 +\renewbibmacro*{date}{% + \iffieldequalstr{userd}{chinese}{% + \ifboolexpr{test {\ifentrytype{article}} or test {\ifentrytype{inproceedings}} + or test {\ifentrytype{archive}} or test {\ifentrytype{online}}} + {\printtext{\blx@gbdatecn{}{}}}% + {\printdate\iffieldundef{year}{}{年}}% + }{\ifentrytype{archive}{\printtext{\blx@gbdateen{}{}}}{\printdate}}% +} + +\newrobustcmd*{\blx@gbdatecn}[3][]{% + \dateeraprintpre{#2#3year}% + \iffieldundef{#2#3year}{}{\blx@imc@forcezerosy{\thefield{#2#3year}年}}\ifblank{#1}{}{\printfield{#1}}% + \iffieldundef{#2#3month}{}{{\thefield{#2#3month}}月}% + \iffieldundef{#2#3day}{}{{\thefield{#2#3day}}日}} + +\newrobustcmd*{\blx@gbdateen}[3][]{% +\mkbibdateen{#2#3year}{#2#3month}{#2#3day}% +} + +\newrobustcmd*{\mkbibdateen}[3]{% + \iffieldundef{#2} + {} + {\mkbibmonth{\thefield{#2}}% + \iffieldundef{#1}{}{\space}}% + \iffieldundef{#3} + {} + {{\thefield{#3}}% + \iffieldundef{#2}{}{\addcomma\space}}% + \iffieldbibstring{#1} + {\bibstring{\thefield{#1}}} + {\dateeraprintpre{#1}\stripzeros{\thefield{#1}}}} + + +\renewbibmacro*{newsdate}{%% +\iffieldequalstr{userd}{chinese} + {\printtext{\blx@gbdatecn{}{}}}% + {\printtext{\blx@gbdate{}{}}}%% +} + + +% +\renewbibmacro*{modifydate}{%新增加一个带括号的日期,用于表示电子资源的更新和修改日期,而公告日期则按日期格式 +\iffieldequalstr{userd}{chinese} + {% + \printtext{\blx@gbdatecn{}{}}% + }% + {\ifboolexpr{% + test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{eventday}}% + }% + {}%更新或修改日期通常有day信息 + {\iffieldundef{year}{% + \iffieldundef{endyear}{\iffieldundef{eventyear}{}{\printtext{\gbleftparen}\printeventdate\printtext{\gbrightparen}}}% + {\printtext{\gbleftparen}\printenddate\printtext{\gbrightparen}}% + }{\iffieldequalstr{year}{}{%因为year存在,但为空 + }{\printtext{\gbleftparen}\blx@gbdate{}{}\printtext{\gbrightparen}}% + }}% +}}% + + +\renewbibmacro*{url+urldate}{% + \newunit\usebibmacro{url}\newunit% + \printtext{\blx@gbdatecn{}{url}}% +} + + +\DeclareFieldFormat{type}% +{\iffieldequalstr{userd}{chinese}% + {\ifbibxstring{#1cn}{\bibxstring{#1cn}}{#1}}% + {\ifbibstring{#1}{\bibstring{#1}}{#1}}% +} + + +\renewbibmacro*{in:}{% +\iftoggle{bbx:gbpunctin}{\gbpunctcomma}%\addthinspace + {\setunit{\adddot\addspace}% + \iffieldequalstr{userd}{chinese}% + {\gbpunctcomma}% + {\printtext{\bibstring{in}}}% + }}%\newunit\newblock\intitlepunct + + +% +% 修改number和volume的格式 +% +\newcounter{numberwithoutzero} +\DeclareFieldFormat[newspaper,article,periodical]{number}% +{\iffieldequalstr{userd}{chinese}{% + \iffieldequalstr{entrysubtype}{news}{% + \iffieldint{number}% + {\printtext{\gbpunctcomma\bibstring{serialcn} #1 版}}% + {\printtext{\gbpunctcomma #1}}% + }% + {\iffieldint{number}{\setcounter{numberwithoutzero}{#1}% + \printtext{\bibstring{serialcn}\addthinspace\arabic{numberwithoutzero} 期}}% + {\printtext{\bibstring{serialcn}\addthinspace #1 期}}% + }}% + {\newunit\setcounter{numberwithoutzero}{#1}\printtext{\bibstring{number}}\arabic{numberwithoutzero}}% +} + +\DeclareFieldFormat[book,inbook,incollection,misc]{number}% +{\iffieldequalstr{userd}{chinese}{\iffieldint{number}% + {% + \bibstring{serialcn}#1\bibstring{numbercn}% + }{#1}% + }% + {\bibstring{number}~#1}% +} + +\DeclareFieldFormat[article,periodical,newspaper]{volume}% +{\iffieldequalstr{userd}{chinese}{% + \iffieldint{volume}% + {\bibstring{serialcn}#1\bibstring{volumecn}}% + {#1}% + }% + {\bibstring{volume}~#1}% +} + +\DeclareFieldFormat[book,inbook,incollection]{volume}% +{\iffieldequalstr{userd}{chinese}{\iffieldint{volume}% + {\iffieldequalstr{entrysubtype}{classic}{\bibstring{volumecn}#1}% + {\bibstring{serialcn}#1\bibstring{volumecn}}% + }{#1}% + }% + {\bibstring{volume}~#1}% +} + +\DeclareListFormat[article,newspaper]{location}{% +\iffieldequalstr{userd}{chinese}{\gbpunctprl#1\gbpunctprr}{#1}% +} + +\DeclareListFormat[article]{series}{% +\iffieldequalstr{userd}{chinese}{\gbpunctprl#1\gbpunctprr}{#1}% +} + +% +% 调整期刊名的格式 +% +% v1.0k,20180425,增加了字体控制命令,hzz +% v1.1j,20220527,修复期刊名不存在时多余的标点 +\renewbibmacro*{journal+issuetitle}{% + \bibpubfont% + \usebibmacro{journal}\newunit% + \iflistundef{location}{}{\printlist{location}}% + \iffieldundef{series}% + {}% + {\printfield{series}}% + \iffieldundef{volume}% + {\usebibmacro{issue+date}% + \usebibmacro{volume+number+eid}}% + {\usebibmacro{volume+number+eid}% + \iffieldundef{year}{}{\newunit}% + \usebibmacro{issue+date}}% +} + + +%去掉期刊名后的标点 +\renewbibmacro*{journal}{% + \ifboolexpr{ + test {\iffieldundef{journaltitle}} + and + test {\iffieldundef{journalsubtitle}} + } + {} + {\printtext[journaltitle]{% + \printfield[titlecase]{journaltitle}% + \printfield[titlecase]{journalsubtitle}}% + }% + \iffieldundef{journaltitleaddon} + {} + {\printfield{journaltitleaddon}}} + + + + +% +% 调整期刊卷和期的格式 +% +\renewbibmacro*{volume+number+eid}{%源来自standard.bbx +\iffieldequalstr{userd}{chinese}% + {\iffieldundef{volume}{}{\printfield{volume}}% + \iffieldundef{number}{}{\printfield{number}}}%区别于顺序编码制 + {\newunit\printfield{volume}% + \printfield{number}% + \setunit{\addcomma\space}% + \printfield{eid}}% +} + + +% +% 期刊的标题做修改 +% +\renewbibmacro*{title+issuetitle}{%源来自standard.BBX + \usebibmacro{periodical}% + \iffieldequalstr{userd}{chinese}{\setunit*{\gbpunctcomma}}{\setunit*{\adddot\addspace}}% + \iffieldundef{series}% + {}% + {\newunit% + \printfield{series}% + \setunit{\addspace}}% + \usebibmacro{periodical+issue}%将issue调整到上面来,并修改 + \usebibmacro{issue+date}% + \usebibmacro{issue}% + \usebibmacro{volume+number+eid} +} + + + + +% +% 重设title的输出 +% +% 20180425,v1.0k,为标题增加字体控制命令,Hu Zhenzhen +% 原理方法:将文献类型标识符输出出去,原输出来自biblatex.def文件 +% 利用toggle做标识符是否输出的判断 +\renewbibmacro*{title}{% + \ifboolexpr{% + test{\iffieldundef{title}}% + and + test{\iffieldundef{subtitle}}% + }% + {}% + {\setunit*{\iffieldequalstr{userd}{chinese}{\gbpunctcolon}{\gbpunctcommalanen}}% + \ifboolexpr{not test {\iffieldundef{origyear}} and test{\iffieldequalstr{entrysubtype}{classic}}}% + {\printorigdate}{}% + \printtext[title]{\bibtitlefont%增加字体控制命令%增加了标点: + \printfield[titlecase]{title}% + \ifboolexpr{test {\iffieldundef{subtitle}}}%这里增加了对子标题的判断,解决不判断多一个点的问题 + {}{\setunit{\subtitlepunct}% + \printfield[titlecase]{subtitle}}% + \iffieldundef{titleaddon}{}%判断一下titleaddon,否则直接加可能多一个空格 + {\setunit{\subtitlepunct}\printfield{titleaddon}}}% + \ifboolexpr{test{\ifentrytype{book}} and (not test{\iffieldundef{volume}})}%判断一下book类有没有volume + {\printfield{volume}}{}%% + }% +} + + +%===================================================================== +%设置驱动格式 +%===================================================================== + +\DeclareDelimFormat{authotitledelim} +{% +\iffieldequalstr{userd}{chinese}{\gbpunctcolon}{\addperiod\space}% +} + +\renewbibmacro*{maintitle+booktitle}{% + \iffieldundef{maintitle} + {} + {\usebibmacro{maintitle}% + \newunit\newblock + \iffieldundef{volume} + {} + {\printfield{volume}% + \printfield{part}% + \setunit{\addcolon\space}}}% + \usebibmacro{booktitle}% +} + + +\newbibmacro*{inbook:volume+number}{% + \iffieldundef{volume}{}{\printfield{volume}}% + \iffieldundef{number}{}{\printfield{number}}% +} + + +\renewbibmacro*{thesis:institution+location+date}{\bibpubfont%当没有institution时不处理。 +{\printlist{location}%%加了一个编组避免\usebibmacro{date}把month和day信息去掉 + \iflistundef{institution} + {\setunit*{\addcomma\space}} + {\setunit*{\publocpunct}}% + \printlist{institution}% + \iftoggle{bbx:gbfieldtype}{% + \printfield{type}% + \setunit*{\addspace}}{}% + \pubdatadelim% + \usebibmacro{date}% + %\newunit + }} + + +% +% 增加inbook:parent用于辅助crossref传统功能的实现 +% 用在{crosscite}宏中 +% 20210216,v1.0w,hzz +\newbibmacro*{inbook:parent}{% +\usebibmacro{bybookauthor}% +\ifnameundef{bookauthor}{% + \ifnameundef{editor}{}{\printdelim{authotitledelim}}% + }{\printdelim{authotitledelim}}% +{\iffieldundef{series}{}{\usebibmacro{series+number}\setunit{\addcolon\addspace}}}%为处理一些存在series的情况而增加 + \usebibmacro{maintitle+booktitle}% + \usebibmacro{inbook:volume+number}% + \newunit\newblock% + {\printfield{edition}}% + \newunit + \newunit\newblock + \usebibmacro{publisher+location+date}% +} + + +\DeclareBibliographyDriver{book}{%源来自standard.bbx文件 +\usebibmacro{bibindex}% +\usebibmacro{begentry}% +\usebibmacro{author/editor+others/translator+others}% +\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\usebibmacro{maintitle+title}% +\iftoggle{bbx:gbstrict}{}{% +\newunit +\printlist{language}% +\newunit\newblock% +\usebibmacro{byauthor}% +\newunit\newblock}% +\usebibmacro{byeditor+others}% +\newunit% +{\printfield{edition}}% +\newunit\newblock%% +\iftoggle{bbx:gbstrict}{}{% +\iffieldundef{maintitle}% +{\printfield{volume}% +\printfield{part}}% +{}% +\newunit% +\printfield{volumes}% +\newunit\newblock% +\usebibmacro{series+number}}% +\newunit\newblock% +%\printfield{note}% +%\newunit\newblock% +\usebibmacro{publisher+location+date}% +%\newunit\newblock %这里标点去掉 +\usebibmacro{chapter+pages}% +% \iffieldundef{url}{}{%当没有网址时也不输出 +% \usebibmacro{modifydate}}%带括号的修改或更新日期, +\usebibmacro{doi+eprint+url}%从下面移动到上面来,因为gbt2015的url需直接放在页码后面。 + \newunit\newblock% + \printfield{pagetotal}% + \newunit\newblock% + \iftoggle{bbx:isbn} + {\printfield{isbn}} + {}% + \newunit\newblock + %\usebibmacro{doi+eprint+url}% + %\newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{annotation}\usebibmacro{finentry}} + + +\DeclareBibliographyDriver{thesis}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \usebibmacro{byeditor+others}%增加的译者信息 + \newunit\newblock + {\printfield{number}}% + \newunit\newblock + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{thesis:institution+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + \iffieldundef{url}{}{%当没有网址时也不输出修改或更新日期 + \usebibmacro{modifydate}}%修改或更新日期为带括号的时间 + \usebibmacro{doi+eprint+url}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isrn}} + {}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{annotation}\usebibmacro{finentry}} + + +\DeclareBibliographyDriver{manual}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% + \iftoggle{bbx:gbstrict}{}{% + \newunit% + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}}% + \newunit\newblock + \usebibmacro{byeditor+others}%增加的译者信息 + \newunit\newblock + \iftoggle{bbx:gbfieldtype}{% + \printfield{type}% + \setunit*{\addspace}}{}% + {\printfield{number}}% + \newunit\newblock + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{institution+location+date}% + %\newunit\newblock + \usebibmacro{chapter+pages}% + \iffieldundef{url}{}{%当没有网址时也不输出修改或更新日期 + \usebibmacro{modifydate}}%修改或更新日期为带括号的时间 + \usebibmacro{doi+eprint+url}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn} + {\printfield{isrn}} + {}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{annotation}\usebibmacro{finentry}} + + +\DeclareBibliographyDriver{misc}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{title}% +\iftoggle{bbx:gbstrict}{}{% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}}% + \newunit\newblock + \printfield{howpublished}% + \newunit\newblock + \printfield{type}% + \newunit + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{institution+location+date}% + \newunit% + \printfield{number}% + %\usebibmacro{organization+location+date}% + %\newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related} + {\usebibmacro{related:init}% + \usebibmacro{related}} + {}% + \usebibmacro{annotation}\usebibmacro{finentry}} diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-jmw.cbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-jmw.cbx new file mode 100644 index 00000000000..d8a89fb5352 --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/chinese-jmw.cbx @@ -0,0 +1,183 @@ +%% +%% --------------------------------------------------------------- +%% css.cbx --- A citation style of journal of management world in china +%% modified from gb7714-2015 +%% Maintained by huzhenzhen +%% E-mail: hzzmail@163.com +%% Released under the LaTeX Project Public License v1.3c or later +%% --------------------------------------------------------------- +%% +%%用法:类似于标准的样式在biblatex加载时设置样式 +%%文献表正常处理,标注命令主要用cite和textcite + +\ProvidesFile{chinese-jmw.cbx}[v1.0a a biblatex citation style for jmw] + +%================================================== +%加载gb样式 +%================================================== +\RequireCitationStyle{gb7714-2015ay} % + + +% +% 增加一个控制标注中标点是英文还是中文的选项 +% 20220222,v1.0a,hzz +\DeclareBibliographyOption{gbcitepunctcn}[true]{%biblatex低版本 + \ifstrequal{#1}{false}{\execgbpunctencite}{}} + +\def\gbpunctcommacite{,}% +\def\gbpunctmarkcite{、}% +\def\gbpunctsemicoloncite{;}% +\def\gbpunctparenlcite{(}% +\def\gbpunctparenrcite{)} +\def\execgbpunctencite{% +\def\gbpunctcommacite{\addcomma\addspace}% +\def\gbpunctmarkcite{\addcomma\addspace}% +\def\gbpunctsemicoloncite{\addsemicolon\addspace}% +\def\gbpunctparenlcite{(}% +\def\gbpunctparenrcite{)} +} + +%================================================== +%选项设置 +%================================================== +\ExecuteBibliographyOptions{ + maxcitenames=2, + mincitenames=1, +} + +\DeclareDelimFormat[textcite]{delimandincitecn}{和}%\addcomma\space +\DeclareDelimFormat[parencite]{delimandincitecn}{\gbpunctmarkcite}%\addcomma\space +\DeclareDelimFormat[textcite]{delimandincite}{和}%\addcomma\space +\DeclareDelimFormat[parencite]{delimandincite}{ and }%\addcomma\space +\DeclareDelimFormat[textcite]{delimandothersincite}{\str@andotherscn}%\addcomma\space +\DeclareDelimFormat[parencite]{delimandothersincite}{et al\adddot}%\addcomma\space + +\DefineBibliographyStrings{english}{ + andincitecn = {\printdelim{delimandincitecn}}, + andincite = {\printdelim{delimandincite}}, + %andothersincitecn={\str@andotherscn}, + andothersincite={\printdelim{delimandothersincite}}, +} + +%================================================== +%引用命令设置,主要用cite和textcite +%包括标点设置 +%================================================== +\renewcommand*{\multicitedelim}{\gbpunctsemicoloncite}%\addsemicolon\addspace; +\renewcommand*{\textcitedelim}{% + \iffinalcitedelim + {\ifnumgreater{\value{textcitetotal}}{2} + {}{}%\iftextcitepunct{\finalandsemicolon}{\finalandcomma} + \addspace\gbpunctmarkcite}%\addspace\bibstring{andincitecn} + {\iftextcitepunct{\addsemicolon\space}{\addspace\gbpunctmarkcite}}%\addcomma +}%\space + +\DeclareDelimFormat[textcite]{nameyeardelim}{\addspace}%\addcomma\space +\DeclareDelimFormat[parencite]{nameyeardelim}{\gbpunctcommacite} +\DeclareDelimFormat[textcite]{andothersdelim}{\addspace}% +\DeclareDelimFormat[parencite]{andothersdelim}{\iffieldequalstr{userf}{chinese}{}{\addspace}}% + + +%标注压缩时,直接用date+extradate代替extradate实现2006a,2006b的效果 +%\DeclareDelimFormat*{compcitedelim}{\gbpunctmarkcite}%\addcomma\addspace +\newbibmacro*{cite:extradate}{% + \iffieldundef{extradate} + {} + {\printtext[bibhyperref]{\addspace\printlabeldateextra}}}%\printfield{extradate}\printlabeldateextra \printfield{labelyear}\printfield{extradate} + +%\AtEveryCite{% +%\let\parentext=\parentexttrack% +%\let\bibopenparen=(% +%\let\bibcloseparen=)} + +%添加前后空格 +\DeclareCiteCommand{\parencite}%[\mkbibparens] + {\usebibmacro{cite:init}% + \unspace\printtext{\gbpunctparenlcite}\usebibmacro{prenote}}%\addspace + {\usebibmacro{citeindex}% + \usebibmacro{cite}} + {} + {\usebibmacro{postnote}% + \gbpunctparenrcite}%\addspace + +%原版 +%\DeclareCiteCommand{\cite}[\mkbibparens] +% {\usebibmacro{cite:init}% +% \usebibmacro{prenote}}%) +% {\usebibmacro{citeindex}% +% \usebibmacro{cite}} +% {} +% {\usebibmacro{postnote}} + +% +%添加后面空格 +%\DeclareCiteCommand{\cbx@textcite} +% {\usebibmacro{cite:init}} +% {\usebibmacro{citeindex}% +% \usebibmacro{textcite}} +% {} +% {\usebibmacro{textcite:postnote}\addspace} + +\newbibmacro*{textcite}{% + \iffieldequals{namehash}{\cbx@lasthash} + {\iffieldundef{shorthand} + {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND + \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)} + {\setunit{\addcomma}% + \usebibmacro{cite:extradate}} + {\setunit{\compcitedelim}% + \usebibmacro{cite:labeldate+extradate}% + \savefield{labelyear}{\cbx@lastyear}}} + {\setunit{\compcitedelim}% + \usebibmacro{cite:shorthand}% + \global\undef\cbx@lastyear}} + {\ifnameundef{labelname} + {\iffieldundef{shorthand} + {\usebibmacro{cite:label}% + \setunit{% + \global\booltrue{cbx:parens}% + \printdelim{nonameyeardelim}\unspace\gbpunctparenlcite}%\bibopenparen + \ifnumequal{\value{citecount}}{1} + {\usebibmacro{prenote}} + {}% + \usebibmacro{cite:labeldate+extradate}} + {\usebibmacro{cite:shorthand}}} + {\printnames{labelname}% + \setunit{% + \global\booltrue{cbx:parens}% + \printdelim{nameyeardelim}\unspace\gbpunctparenlcite}%\bibopenparen + \ifnumequal{\value{citecount}}{1} + {\usebibmacro{prenote}} + {}% + \iffieldundef{shorthand} + {\iffieldundef{labelyear} + {\usebibmacro{cite:label}} + {\usebibmacro{cite:labeldate+extradate}}% + \savefield{labelyear}{\cbx@lastyear}} + {\usebibmacro{cite:shorthand}% + \global\undef\cbx@lastyear}}% + \stepcounter{textcitecount}% + \savefield{namehash}{\cbx@lasthash}}% + \setunit{% + \ifbool{cbx:parens} + {\gbpunctparenrcite\global\boolfalse{cbx:parens}}%\bibcloseparen + {}% + \textcitedelim}} + +\newbibmacro*{textcite:postnote}{% + \usebibmacro{postnote}% + \ifthenelse{\value{multicitecount}=\value{multicitetotal}} + {\setunit{}% + \printtext{% + \ifbool{cbx:parens} + {\gbpunctparenrcite\global\boolfalse{cbx:parens}}%\bibcloseparen + {}}} + {\setunit{% + \ifbool{cbx:parens} + {\gbpunctparenrcite\global\boolfalse{cbx:parens}}%\bibcloseparen + {}% + \textcitedelim}}} + +\let\citet=\textcite +\let\citep=\parencite +\let\cite=\parencite 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 aa44a3870ff..b5233fc1f94 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{2023/03/31 v1.1l} +\def\versionofgbtstyle{2023/04/24 v1.1m} \def\versionofbiblatex{\abx@version} \ProvidesFile{gb7714-2015.bbx}[\versionofgbtstyle biblatex bibliography style] %\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 @@ -543,6 +543,13 @@ \def\str@mathesiscn{硕士学位论文} \def\str@phdthesiscn{博士学位论文} \def\str@editorcn{主编} + \def\str@editorscn{主编} + \def\str@compilerscn{整理} + \def\str@compilercn{整理} + \def\str@revisercn{编} + \def\str@reviserscn{编} + \def\str@foundercn{编著} + \def\str@founderscn{编著} \AtEndOfPackage{% \iftoggle{bbx:codegbk}{% @@ -919,6 +926,13 @@ \NewBibliographyString{editorcn} \NewBibliographyString{editorscn} \NewBibliographyString{bytranslatorcn} + \NewBibliographyString{compilercn} + \NewBibliographyString{compilerscn} + \NewBibliographyString{revisercn} + \NewBibliographyString{reviserscn} + \NewBibliographyString{foundercn} + \NewBibliographyString{founderscn} + @@ -956,6 +970,12 @@ phdthesiscn={\str@phdthesiscn}, editorscn={\str@editorcn}, editorcn={\str@editorcn}, + compilerscn={\str@compilerscn}, + compilercn={\str@compilercn}, + reviserscn={\str@reviserscn}, + revisercn={\str@revisercn}, + founderscn={\str@founderscn}, + foundercn={\str@foundercn}, } % @@ -2670,7 +2690,8 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 {\namepartgiven} {\namepartprefix} {\namepartsuffix}}% -\or +\or% +\renewrobustcmd*{\bibinithyphendelim}{.\mbox{-}}% \ifgiveninits {\usebibmacro{name:given-family} {\namepartfamily} @@ -2682,7 +2703,8 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 {\namepartgiven} {\namepartprefix} {\namepartsuffix}}% -\or +\or% +\renewrobustcmd*{\bibinithyphendelim}{.\mbox{-}}% \ifgiveninits {\usebibmacro{name:family-given} {\namepartfamily} @@ -2700,7 +2722,8 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 {\namepartgiven} {\namepartprefix} {\namepartsuffix}% -\or +\or% +\renewrobustcmd*{\bibinithyphendelim}{.\mbox{-}}% \ifnumequal{\value{listcount}}{1} {\ifgiveninits {\usebibmacro{name:family-given} @@ -3298,6 +3321,7 @@ test{\iftoggle{iftlnine}} %定义出版社与年份之间的标点便于后面重定义 \newcommand{\pubdatadelim}{\setunit*{\addcomma\space}} +\newcommand{\locnopubdelim}{\setunit*{\addcomma\space}} % 新增一个样式用于输出连续出版物的地址,单位,时间, % 用于periodical连续出版物的出版社和地址的处理 @@ -3327,7 +3351,7 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}% \newunit}% {\printlist{location}% \iflistundef{institution}% - {\setunit*{\addcomma\space}} + {\locnopubdelim} {\setunit*{\publocpunct}}% \printlist{institution}% \pubdatadelim% @@ -3362,7 +3386,7 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}% }% {\printlist{location}% \iflistundef{publisher} - {\setunit*{\addcomma\space}} + {\locnopubdelim} {\setunit*{\publocpunct}}% \printlist{publisher}% \pubdatadelim% @@ -3396,6 +3420,12 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}% {\bibstring{serialcn}#1\bibstring{volumecn}}% {\bibstring{volume}~#1}% }% volume of a book +\DeclareFieldFormat[book,inbook,incollection]{volume}% +{\iffieldequalstr{userd}{chinese}{\iffieldint{volume}% + {\bibstring{serialcn}#1\bibstring{volumecn}% + }{#1}}% + {\bibstring{volume}~#1}% +} \DeclareFieldFormat[article,periodical]{volume}{#1}% volume of a journal % 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 e6a1ae9e412..a1f7a234924 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 @@ -10,7 +10,7 @@ % % 版本和时间信息 % -\def\versionofgbtstyle{2023/03/31 v1.1l} +\def\versionofgbtstyle{2023/04/24 v1.1m} \def\versionofbiblatex{\abx@version} \ProvidesFile{gb7714-2015ay.bbx}[\versionofgbtstyle biblatex bibliography style] %\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 @@ -492,6 +492,13 @@ \def\str@mathesiscn{硕士学位论文} \def\str@phdthesiscn{博士学位论文} \def\str@editorcn{主编} + \def\str@editorscn{主编} + \def\str@compilerscn{整理} + \def\str@compilercn{整理} + \def\str@revisercn{编} + \def\str@reviserscn{编} + \def\str@foundercn{编著} + \def\str@founderscn{编著} \AtEndOfPackage{% \iftoggle{bbx:codegbk}{% @@ -876,6 +883,12 @@ \NewBibliographyString{editorcn} \NewBibliographyString{editorscn} \NewBibliographyString{bytranslatorcn} + \NewBibliographyString{compilercn} + \NewBibliographyString{compilerscn} + \NewBibliographyString{revisercn} + \NewBibliographyString{reviserscn} + \NewBibliographyString{foundercn} + \NewBibliographyString{founderscn} % % 修改一些当地化字符串 @@ -910,6 +923,12 @@ phdthesiscn={\str@phdthesiscn}, editorscn={\str@editorcn}, editorcn={\str@editorcn}, + compilerscn={\str@compilerscn}, + compilercn={\str@compilercn}, + reviserscn={\str@reviserscn}, + revisercn={\str@revisercn}, + founderscn={\str@founderscn}, + foundercn={\str@foundercn}, } % @@ -2526,7 +2545,8 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 {\namepartgiven} {\namepartprefix} {\namepartsuffix}}% -\or +\or% +\renewrobustcmd*{\bibinithyphendelim}{.\mbox{-}}% \ifgiveninits {\usebibmacro{name:given-family} {\namepartfamily} @@ -2538,7 +2558,8 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 {\namepartgiven} {\namepartprefix} {\namepartsuffix}}% -\or +\or% +\renewrobustcmd*{\bibinithyphendelim}{.\mbox{-}}% \ifgiveninits {\usebibmacro{name:family-given} {\namepartfamily} @@ -2556,7 +2577,8 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 {\namepartgiven} {\namepartprefix} {\namepartsuffix}% -\or +\or% +\renewrobustcmd*{\bibinithyphendelim}{.\mbox{-}}% \ifnumequal{\value{listcount}}{1} {\ifgiveninits {\usebibmacro{name:family-given} @@ -3217,6 +3239,12 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}% {\bibstring{serialcn}#1\bibstring{volumecn}}% {\bibstring{volume}~#1}% }% volume of a book +\DeclareFieldFormat[book,inbook,incollection]{volume}% +{\iffieldequalstr{userd}{chinese}{\iffieldint{volume}% + {\bibstring{serialcn}#1\bibstring{volumecn}% + }{#1}}% + {\bibstring{volume}~#1}% +} \DeclareFieldFormat[article,periodical]{volume}{#1}% volume of a journal % |