diff options
author | Karl Berry <karl@freefriends.org> | 2018-12-09 22:36:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-12-09 22:36:06 +0000 |
commit | 0f732f6c1b8c213b892b09e27e798c9ebd8f58e9 (patch) | |
tree | 2a416c53f2841a88f7c11ace17962a0bff72fc77 /Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.cbx | |
parent | 5281459b50fc0b886ea4f36de42fb283b5c04634 (diff) |
biblatex-gb7714-2015 (9dec18)
git-svn-id: svn://tug.org/texlive/trunk@49358 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.cbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.cbx | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.cbx b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.cbx new file mode 100644 index 00000000000..165c133a4cd --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-gb7714-2015/gb7714-2015ms.cbx @@ -0,0 +1,139 @@ +%% +%% --------------------------------------------------------------- +%% biblatex-gb7714-2015 --- A biblatex implementation of the +%% GBT7714-2015 citation style,numerical sequence +%% Maintained by huzhenzhen +%% E-mail: hzzmail@163.com +%% Released under the LaTeX Project Public License v1.3c or later +%% --------------------------------------------------------------- +%% +\ProvidesFile{gb7714-2015.cbx}[2018/11/04 v1.0n biblatex citation style] + +% +% 加载标准样式 +% +\RequireCitationStyle{numeric-comp} %numeric + + +% +% 选项设置 +% +\ExecuteBibliographyOptions{ + autocite = superscript , + autopunct = true , + %sorting = none , + maxcitenames=1, + mincitenames=1, +} + +%textcite标注命令中的标点设置 +%\DeclareDelimFormat[textcite]{andothersdelim}{\addspace}% + +% +% 定义一个上标方括号wrapper +% +\newcommand*\mkbibsuperbracket[1]{% + \mkbibsuperscript{\mkbibbrackets{#1}}% +} + +% +% 重定义cite命令 +% +% 方法:\DeclareCiteCommand{\cite}[\mkbibparens]{precode}{loopcode}{sepcode}{postcode} +\DeclareCiteCommand{\cite}[\mkbibsuperbracket]%利用mkbibsuperbracket添加方括号 + {\usebibmacro{cite:init}% + \usebibmacro{prenote}} + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}% + \usebibmacro{postnote}} + +% +% 定义upcite命令 +% 20180604,v1.0l,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}} + +% +% 新定义pagescite命令,以满足标签带页码的国标要求 +% +% 原理方法: +% 1.修改postnote的输出格式 +\DeclareFieldFormat{postnote}{#1} +% 2.新增页码输出宏 +\newbibmacro*{postpages}{% + \iffieldundef{postnote} + {\printfield[postnote]{pages}} + {\printfield{postnote}}} +% 3.新增\pagescite引用命令 +\DeclareCiteCommand{\pagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标 + {[\usebibmacro{cite:init}%]直接添加方括号 + \usebibmacro{prenote}% + } + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \usebibmacro{postpages}} + +% +% 定义yearpagescite,为与ay样式兼容,等同于\pagescite +% +\DeclareCiteCommand{\yearpagescite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标 + {[\usebibmacro{cite:init}%]直接添加方括号 + \usebibmacro{prenote}% + } + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]% + \usebibmacro{postpages}} + +% +% 定义\yearcite命令,为与ay样式兼容,且提供不输出页码的标签格式, +% +% 原理方法:等同于\pagescite,但不要页码 +\DeclareCiteCommand{\yearcite}[\mkbibsuperscript]%\mkbibbrackets,仍然用上标 + {[\usebibmacro{cite:init}%]直接添加方括号 + \usebibmacro{prenote}% + } + {\usebibmacro{citeindex}% + \usebibmacro{cite:comp}} + {} + {\usebibmacro{cite:dump}]} + +% +% 定义\authornumcite命令,输出作者信息,然后在后面带上顺序编码 +% 20180427,v1.0k,增加,hzz +% gb7714样式新定义的命令都把cite放到最后,比如前面的pagescite,yearcite,这里的\authornumcite +% 区别于biblatex定义的命令都把cite放到前面,比如citeauthor等。 +%见numeric.CBX +\newbibmacro*{cite}{% + \printtext[bibhyperref]{% + \printfield{labelprefix}% + \printfield{labelnumber}% + \ifbool{bbx:subentry} + {\printfield{entrysetcount}} + {}}} +%见numeric.CBX,\DeclareCiteCommand{\cite}, +\DeclareCiteCommand{\authornumcite}%[\mkbibsuperscript] + {\usebibmacro{prenote}} + {\iffieldequalstr{userf}{cn}{\renewcommand*{\andothersdelim}{\addthinspace}}%\addthinspace + {\renewcommand*{\andothersdelim}{\addspace}}% + \printnames{labelname}\mkbibsuperscript{\mkbibbrackets{\usebibmacro{citeindex}% + \usebibmacro{cite}}}} + {\multicitedelim} + {\usebibmacro{postnote}} |