summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-05-07 03:01:25 +0000
committerNorbert Preining <norbert@preining.info>2021-05-07 03:01:25 +0000
commitc92d9953347e3bdebc5243c67cf012a2f7a60fb6 (patch)
tree808a0ad402713257a48445f97e662786d95207ee /macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx
parent25f20b6d8ccd4edcdfec23c1a3c908516076ee06 (diff)
CTAN sync 202105070301
Diffstat (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx')
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx46
1 files changed, 39 insertions, 7 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx
index 9ce600b2bf..a407be98e0 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.cbx
@@ -7,7 +7,7 @@
%% Released under the LaTeX Project Public License v1.3c or later
%% ---------------------------------------------------------------
%%
-\def\versionofgbtstyle{2021/04/03 v1.0x}
+\def\versionofgbtstyle{2021/05/06 v1.0y}
\ProvidesFile{gb7714-2015.cbx}[\versionofgbtstyle biblatex citation style]
%
@@ -38,6 +38,7 @@
%
% 修订使可用选项gblabelref来控制是否将标准标签中的作者加上超链接
% 20210121,v1.0w,hzz
+%
\iftoggle{iftlatest}%
{\renewbibmacro*{textcite}{%
\iffieldequals{namehash}{\cbx@lasthash}
@@ -88,6 +89,25 @@
\setcounter{cbx@tempcnta}{0}%
\global\undef\cbx@lastprefix}
+%biblatex v3.15 增加了一堆标点命令如\multiciterangedelim
+%为方便用户定义,在新的版本中使用新的{cite:dump},尽管前面的定义也没有问题
+%前面的定义是适用于biblatex v2.8以后的版本的,从16年到20年都没动过
+%而且也适用于最新的版本,biblatex本身兼容性做的也还是不错的。
+\@ifpackagelater{biblatex}{2020/08/15}{%v3.15 2020-08-16
+ \renewbibmacro*{cite:dump}{%
+ \usebibmacro{cite:dump:inset}%
+ % dump labelnumber (+labelprefix)
+ \ifnumgreater{\value{cbx@tempcnta}}{0}
+ {\ifnumgreater{\value{cbx@tempcnta}}{0}%1改为0,可以将压缩起始3个编号改为2个编号
+ {\setunit{\multiciterangedelim}}
+ {\setunit{\multicitedelim}}%
+ \usebibmacro{cite:print:last:labelnumber}%
+ \global\undef\cbx@lastprefix}
+ {}%
+ \setcounter{cbx@tempcnta}{0}%
+ }%
+}{}
+
%
% 定义一个上标方括号wrapper
%
@@ -109,6 +129,14 @@
\mkbibbrackets{##1}}%
#1\endgroup}\kern\z@}
+\newrobustcmd{\mkbibsuperscriptusp}[1]{%
+ \unspace\allowhyphens\textsuperscript{%
+ \begingroup
+ \protected\long\def\mkbibsuperscriptusp##1{%
+ \blx@warning{Nested superscript}%
+ \mkbibbrackets{##1}}%
+ #1\endgroup}}
+
%
% 重定义cite命令
%
@@ -154,7 +182,7 @@
{}
{%[
\usebibmacro{cite:dump}]%
- \mkbibsuperscript{\printfield{postnote}}}
+ \mkbibsuperscriptusp{\printfield{postnote}}}
%
% 新定义pagescite命令,以满足标签带页码的国标要求
@@ -243,9 +271,11 @@
%
% 重定义citet,因为前面与\authornumcite同定义的命令无法正确处理多个bibtexkey同时给出的压缩情况
-% 20200721,v1.0v,hzz
+% 20200721,v1.0v,hzz
% 方法:利用textcite命令进行定义
% 基本利用textcite命令来写citet,仅利用bool{cbx:incitet}做判断,进而处理不同的上标和页码形式
+% 20210416,v1.0y,hzz:将namelabeldelim标点注释掉了,因为中文环境下不需要,
+% 若有需要可以用context sensitive的形式做定义
\newbool{cbx:incitet}
\global\booltrue{cbx:incitet}
@@ -263,7 +293,7 @@
\ifnameundef{labelname}
{\printfield[citetitle]{labeltitle}}
{\printnames{labelname}}%
- \setunit*{\printdelim{namelabeldelim}}%
+ %\setunit*{\printdelim{namelabeldelim}}%
\mkbibsuperscript{\printtext{\bibopenbracket}\global\booltrue{cbx:parens}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}%
@@ -378,7 +408,7 @@
\newbibmacro*{citec:dump}{%
\ifnumgreater{\value{cbx@tempcnta}}{0}
- {\ifnumgreater{\value{cbx@tempcnta}}{1}
+ {\ifnumgreater{\value{cbx@tempcnta}}{0}%从1改成0就是从3个开始压缩改成2个开始压缩
{\bibrangedash}
{\multicitedelim}%
\bibhyperref[\cbx@lastkey]{%
@@ -409,7 +439,8 @@
{}
{\usebibmacro{citec:dump}%
\usebibmacro{cite:init}%
- \setunit{\multicitedelim}}}
+ \setunit{\multicitedelim}%
+ }}
{\usebibmacro{citec:dump}%
\usebibmacro{cite:init}%
\setunit{\multicitedelim}%
@@ -420,7 +451,8 @@
{\ifboolexpr{ test {\ifnumequal{\value{multicitecount}}{\value{multicitetotal}}}
or not test {\iffieldundef{postnote}}}
{\usebibmacro{citec:dump}%
- \usebibmacro{postnote}}
+ \printfield{postnote}%
+ }
{}}
\DeclareMultiCiteCommand{\citecs}[\mkbibsuperscript]{\citec}{}