diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx | 145 |
1 files changed, 130 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx index 949c37dca92..a62ca688b3c 100644 --- a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx +++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015.cbx @@ -7,7 +7,7 @@ %% Released under the LaTeX Project Public License v1.3c or later %% --------------------------------------------------------------- %% -\def\versionofgbtstyle{2019/03/28 v1.0r} +\def\versionofgbtstyle{2019/08/28 v1.0s} \ProvidesFile{gb7714-2015.cbx}[\versionofgbtstyle biblatex citation style] % @@ -66,20 +66,10 @@ % % 定义upcite命令 % 20180604,v1.0l,hzz +% 20190409,v1.0r,hzz % 方法:对supercite增加[] -\DeclareCiteCommand{\upcite}[\mkbibsuperbracket]% - {\usebibmacro{cite:init}% - \let\multicitedelim=\supercitedelim - \iffieldundef{prenote} - {} - {\BibliographyWarning{Ignoring prenote argument}}% - \iffieldundef{postnote} - {} - {\BibliographyWarning{Ignoring postnote argument}}} - {\usebibmacro{citeindex}% - \usebibmacro{cite:comp}} - {} - {\usebibmacro{cite:dump}} +\newrobustcmd*{\upcite}{% + \cite} % % 重定义parencite命令,以满足标签带页码的国标要求 @@ -161,4 +151,129 @@ \printnames{labelname}\mkbibsuperscript{\mkbibbrackets{\usebibmacro{citeindex}% \usebibmacro{cite}}}} {\multicitedelim} - {\usebibmacro{postnote}} + {\mkbibsuperscript{\printfield{postnote}}} + + +% +% 增加如下多个命令 +% 20190409,v1.0r,hzz +% 方法:利用newcommand或newrobustcmd命令进行定义 +% 注意\citet和\citep命令之所以不用newrobustcmd,是为避免加载natbib模块后产生冲突 +\DeclareCiteCommand{\citet}% + {\usebibmacro{prenote}} + {\iffieldequalstr{userf}{cn}{\renewcommand*{\andothersdelim}{\addthinspace}}%\addthinspace + {\renewcommand*{\andothersdelim}{\addspace}}% + \printnames{labelname}\mkbibsuperscript{\mkbibbrackets{\usebibmacro{citeindex}% + \usebibmacro{cite}}}} + {\multicitedelim} + {\mkbibsuperscript{\printfield{postnote}}} + + +\DeclareCiteCommand{\citep}[\mkbibsuperscript]%利用mkbibsuperbracket添加方括号 + {[\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \printfield{postnote}} + +\newrobustcmd*{\citetns}% + {\textcite} + +\newrobustcmd*{\citepns}% + {\parencite} + +\newrobustcmd*{\inlinecite}% + {\parencite} + +% +% 增加如下复数的命令,以符合biblatex的复数命令习惯 +% 20190430,v1.0r,hzz +% citec和citecs命令是实现了[1]-[3]这样的压缩形式。 +% authornumcites是常用命令authornumcite的复数形式 +\DeclareFieldFormat{labelbracket}{\mkbibbrackets{#1}} + +\newbibmacro*{citec:comp:comp}{% + \ifboolexpr{ + ( test {\iffieldundef{labelprefix}} and test {\ifundef\cbx@lastprefix} ) + or + test {\iffieldequals{labelprefix}{\cbx@lastprefix}} + } + {\ifnumequal{\thefield{labelnumber}}{\value{cbx@tempcntb}} + {\savefield{entrykey}{\cbx@lastkey}% + \savefield{labelnumber}{\cbx@lastnumber}% + \addtocounter{cbx@tempcnta}{1}} + {\ifnumequal{\thefield{labelnumber}}{\value{cbx@tempcntb}-1} + {} + {\usebibmacro{citec:dump}% + \ifnumgreater{\value{cbx@tempcntb}}{-1} + {\multicitedelim} + {}% + \printtext[bibhyperref]{% + \printfield{labelprefix}% + \printtext[labelbracket]{\printfield{labelnumber}}}}}} + {\usebibmacro{cite:comp:end}}% + \setcounter{cbx@tempcntb}{\thefield{labelnumber}}% + \savefield{labelprefix}{\cbx@lastprefix}} + +\newbibmacro*{citec:comp}{% + \addtocounter{cbx@tempcntb}{1}% + \iffieldundef{shorthand} + {\ifbool{bbx:subentry} + {\iffieldundef{entrysetcount} + {\usebibmacro{citec:comp:comp}} + {\usebibmacro{cite:comp:inset}}} + {\usebibmacro{citec:comp:comp}}} + {\usebibmacro{cite:comp:shand}}} + +\newbibmacro*{citec:dump}{% + \ifnumgreater{\value{cbx@tempcnta}}{0} + {\ifnumgreater{\value{cbx@tempcnta}}{1} + {\bibrangedash} + {\multicitedelim}% + \bibhyperref[\cbx@lastkey]{% + \ifdef\cbx@lastprefix + {\printtext[labelprefix]{\cbx@lastprefix}} + {}% + \printtext[labelbracket]{\cbx@lastnumber}}}%labelnumber + {}% + \setcounter{cbx@tempcnta}{0}% + \global\undef\cbx@lastprefix} + +%\DeclareCiteCommand{\citec}[\mkbibsuperscript]%[\mkbibbrackets] +% {\usebibmacro{cite:init}% +% \usebibmacro{prenote}} +% {\usebibmacro{citeindex}% +% \usebibmacro{citec:comp}} +% {} +% {\usebibmacro{citec:dump}% +% \usebibmacro{postnote}} + +%上面这个用于非压缩情况,这里考虑了压缩的情况 +\DeclareCiteCommand{\citec}[\mkbibsuperscript]% + {\ifnumless{\value{multicitecount}}{2} + {\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\iffieldundef{prenote} + {\iffieldundef{postnote} + {} + {\usebibmacro{citec:dump}% + \usebibmacro{cite:init}% + \setunit{\multicitedelim}}} + {\usebibmacro{citec:dump}% + \usebibmacro{cite:init}% + \setunit{\multicitedelim}% + \usebibmacro{prenote}}}} + {\usebibmacro{citeindex}% + \usebibmacro{citec:comp}} + {} + {\ifboolexpr{ test {\ifnumequal{\value{multicitecount}}{\value{multicitetotal}}} + or not test {\iffieldundef{postnote}}} + {\usebibmacro{citec:dump}% + \usebibmacro{postnote}} + {}} + +\DeclareMultiCiteCommand{\citecs}[\mkbibsuperscript]{\citec}{} + +\DeclareMultiCiteCommand{\authornumcites}[]{\authornumcite}{\multicitedelim} |