diff options
author | Norbert Preining <norbert@preining.info> | 2023-05-26 03:02:08 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-05-26 03:02:08 +0000 |
commit | 8057c647880f05a2624b3d04ab0eb38d5cbf8c18 (patch) | |
tree | 2df10dbc859977e89de9b6797303c039106aca37 /macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx | |
parent | ed4c98e3a1f3e2160094ac1b05cfc304832cce4d (diff) |
CTAN sync 202305260302
Diffstat (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx')
-rw-r--r-- | macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx | 119 |
1 files changed, 102 insertions, 17 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx index 454e5cc7e6..739528dc1b 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx @@ -28,6 +28,9 @@ % 增加标签包围符号格式处理选项 % 20211030,1.1a,hzz % +\def\gbpunctcommacite{\addcomma\addspace} +\def\gbpunctmarkcite{\addcomma\addspace}% +\def\gbpunctsemicoloncite{\addsemicolon\addspace} \newrobustcmd{\mkbibleftborder}{\gbleftparen} \newrobustcmd{\mkbibrightborder}{\gbrightparen} \DeclareBibliographyOption[string]{gbcitelabel}[bracket]{% @@ -43,6 +46,21 @@ \renewrobustcmd{\mkbibleftborder}{\gbleftparen}% \renewrobustcmd{\mkbibrightborder}{\gbrightparen}% } +\def\gbcitelabelopt@parensqj{% +\renewrobustcmd{\mkbibleftborder}{\allowbreak(}% +\renewrobustcmd{\mkbibrightborder}{)\unspace}% +} +\def\gbcitelabelopt@bracketqj{% +\renewrobustcmd{\mkbibleftborder}{\allowbreak【}% +\renewrobustcmd{\mkbibrightborder}{】\unspace}% +} +\def\gbcitelabelopt@quanjiao{% +\renewrobustcmd{\mkbibleftborder}{\allowbreak(}% +\renewrobustcmd{\mkbibrightborder}{)\unspace}% +\def\gbpunctcommacite{,}% +\def\gbpunctmarkcite{、}% +\def\gbpunctsemicoloncite{;}% +} \def\gbcitelabelopt@dot{% \renewrobustcmd{\mkbibleftborder}{}% \renewrobustcmd{\mkbibrightborder}{.}% @@ -116,14 +134,20 @@ test {\iftoggle{iftlseven}}%3.7=biblatex % v1.0t,20200320,hzz,修改如下 % 在cbx中增加标注中的nameyeardelim标点定义,避免bbx使用其它样式时出现问题 % 同时设置textcite的nameyeardelim为一个短空格,似乎原来直接连上去的不够美观 -\DeclareDelimFormat[cite,parencite,pagescite]{nameyeardelim}{\addcomma\space}%\addcomma\space -\DeclareDelimFormat[textcite]{nameyeardelim}{\addthinspace}%\addcomma\space -\DeclareDelimFormat[textcite]{andothersdelim}{\iffieldequalstr{userf}{chinese}{\addthinspace}{\addspace}}% -\AtEveryCitekey{% -\iffieldequalstr{userf}{chinese}{\renewcommand*{\andothersdelim}{\addthinspace}}%\addthinspace - {\renewcommand*{\andothersdelim}{\addspace}}% -} -\newcommand{\compextradelim}{\addcomma\addthinspace} %标注中压缩后相同年份后附加标签a、b之间的标点 +\renewcommand*{\multicitedelim}{\gbpunctsemicoloncite}%\addsemicolon\addspace; +\renewcommand*{\compcitedelim}{\gbpunctmarkcite} +\newcommand{\compextradelim}{\gbpunctcommacite} %标注中压缩后相同年份后附加标签a、b之间的标点 +\DeclareDelimFormat[cite,parencite,pagescite,citep]{nameyeardelim}{\gbpunctcommacite}%\addcomma\space +\DeclareDelimFormat[textcite,authornumcite,citet]{nameyeardelim}{\addthinspace}%\addcomma\space +\DeclareDelimFormat[cite,parencite,pagescite,citep]{andothersdelim} + {\iffieldequalstr{userf}{chinese}{\addthinspace}{\addspace}}% +\DeclareDelimFormat[textcite,authornumcite,citet]{andothersdelim} + {\iffieldequalstr{userf}{chinese}{\addthinspace}{\addspace}}% +%\AtEveryCitekey{% +%\iffieldequalstr{userf}{chinese}{\renewcommand*{\andothersdelim}{\addthinspace}}%\addthinspace +% {\renewcommand*{\andothersdelim}{\addspace}}% +%} + % % 修订使可用选项gblabelref来控制是否将标准标签中的作者加上超链接 @@ -152,12 +176,12 @@ test {\iftoggle{iftlseven}}%3.7=biblatex {\usebibmacro{cite:shorthand}% \usebibmacro{cite:reinit}}% \setunit{\multicitedelim}} -\renewbibmacro*{textcite}{% +\newbibmacro*{textcite}{% \iffieldequals{namehash}{\cbx@lasthash} {\iffieldundef{shorthand} {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)} - {\setunit{\compextradelim}% + {\setunit{\addcomma}% \usebibmacro{cite:extradate}} {\setunit{\compcitedelim}% \usebibmacro{cite:labeldate+extradate}% @@ -170,7 +194,7 @@ test {\iftoggle{iftlseven}}%3.7=biblatex {\usebibmacro{cite:label}% \setunit{% \global\booltrue{cbx:parens}% - \printdelim{nonameyeardelim}\bibopenparen}% + \printdelim{nonameyeardelim}\mkbibleftborder}%\bibopenparen \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% @@ -179,7 +203,7 @@ test {\iftoggle{iftlseven}}%3.7=biblatex {\iftoggle{bbx:gblabelref}{\printtext[bibhyperref]{\printnames{labelname}}}{\printnames{labelname}}% \setunit{% \global\booltrue{cbx:parens}% - \printdelim{nameyeardelim}\bibopenparen}% + \printdelim{nameyeardelim}\mkbibleftborder}%\bibopenparen \ifnumequal{\value{citecount}}{1} {\usebibmacro{prenote}} {}% @@ -194,9 +218,69 @@ test {\iftoggle{iftlseven}}%3.7=biblatex \savefield{namehash}{\cbx@lasthash}}% \setunit{% \ifbool{cbx:parens} - {\bibcloseparen\global\boolfalse{cbx:parens}} + {\mkbibrightborder\global\boolfalse{cbx:parens}}%\bibcloseparen {}% - \textcitedelim}}}{} + \textcitedelim}} +\newbibmacro*{textcite:postnote}{% + \usebibmacro{postnote}% + \ifthenelse{\value{multicitecount}=\value{multicitetotal}} + {\setunit{}% + \printtext{% + \ifbool{cbx:parens} + {\mkbibrightborder\global\boolfalse{cbx:parens}}%\bibcloseparen + {}}} + {\setunit{% + \ifbool{cbx:parens} + {\mkbibrightborder\global\boolfalse{cbx:parens}}%\bibcloseparen + {}% + \textcitedelim}}} +%这是老版本的textcite,上面是新版本的,使用新版本后,对于老版本的biblatex的兼容性可能会受影响 +%\renewbibmacro*{textcite}{% +% \iffieldequals{namehash}{\cbx@lasthash} +% {\iffieldundef{shorthand} +% {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND +% \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)} +% {\setunit{\compextradelim}% +% \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}\bibopenparen}%\bibopenparen\mkbibleftborder +% \ifnumequal{\value{citecount}}{1} +% {\usebibmacro{prenote}} +% {}% +% \usebibmacro{cite:labeldate+extradate}} +% {\usebibmacro{cite:shorthand}}} +% {\iftoggle{bbx:gblabelref}{\printtext[bibhyperref]{\printnames{labelname}}}{\printnames{labelname}}% +% \setunit{% +% \global\booltrue{cbx:parens}% +% \printdelim{nameyeardelim}\bibopenparen}%\mkbibleftborder +% \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} +% {\bibcloseparen\global\boolfalse{cbx:parens}}%\bibcloseparen\mkbibrightborder +% {}% +% \textcitedelim}}% +}{} @@ -229,6 +313,7 @@ test {\iftoggle{iftlseven}}%3.7=biblatex {\mkbibrightborder\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} } + % % 定义upcite命令 % 20180604,v1.0l,hzz @@ -332,7 +417,7 @@ test {\iftoggle{iftlseven}}%3.7=biblatex \savefield{labelyear}{\cbx@lastyear}}} {\iftoggle{bbx:gblabelref}{\printtext[bibhyperref]{\printnames{labelname}}}{\printnames{labelname}}%% %\setunit{\printdelim{nameyeardelim}}% - \gbleftparen\usebibmacro{cite:labeldate+extradate}\gbrightparen% + \mkbibleftborder\usebibmacro{cite:labeldate+extradate}\mkbibrightborder% \savefield{namehash}{\cbx@lasthash}% \savefield{labelyear}{\cbx@lastyear}}}} {\usebibmacro{cite:shorthand}% @@ -385,11 +470,11 @@ test {\iftoggle{iftlseven}}%3.7=biblatex {\setunit{}% \printtext{% \ifbool{cbx:parens} - {\bibcloseparen\global\boolfalse{cbx:parens}} + {\mkbibrightborder\global\boolfalse{cbx:parens}}%\bibcloseparen {}}} {\setunit{% \ifbool{cbx:parens} - {\bibcloseparen\global\boolfalse{cbx:parens}} + {\mkbibrightborder\global\boolfalse{cbx:parens}}%\bibcloseparen {}% \textcitedelim}}% \renewbibmacro*{postnote}{% |