From 9ed1a61f45b05f58016912a6bd6c13daab6db9eb Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 12 Dec 2021 03:01:11 +0000 Subject: CTAN sync 202112120301 --- .../biblatex-gb7714-2015/gb7714-2015ay.cbx | 110 +++++++++++++++------ 1 file changed, 82 insertions(+), 28 deletions(-) (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.cbx') 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 e6540216ba..19a92bceed 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 @@ -24,6 +24,43 @@ \ExecuteBibliographyOptions{gblabelref} +% +% 增加标签包围符号格式处理选项 +% 20211030,1.1a,hzz +% +\newrobustcmd{\mkbibleftborder}{(} +\newrobustcmd{\mkbibrightborder}{)} +\DeclareBibliographyOption[string]{gbcitelabel}[bracket]{% + \csuse{gbcitelabelopt@#1} +} +\ExecuteBibliographyOptions{gbcitelabel} + +\def\gbcitelabelopt@bracket{% +\renewrobustcmd{\mkbibleftborder}{[}% +\renewrobustcmd{\mkbibrightborder}{]}% +} +\def\gbcitelabelopt@parens{% +\renewrobustcmd{\mkbibleftborder}{(}% +\renewrobustcmd{\mkbibrightborder}{)}% +} +\def\gbcitelabelopt@dot{% +\renewrobustcmd{\mkbibleftborder}{}% +\renewrobustcmd{\mkbibrightborder}{.}% +} +\def\gbcitelabelopt@plain{% +\renewrobustcmd{\mkbibleftborder}{}% +\renewrobustcmd{\mkbibrightborder}{}% +} +\def\gbcitelabelopt@box{% +\renewrobustcmd{\mkbibleftborder}{}% +\renewrobustcmd{\mkbibrightborder}{}% +} +\def\gbcitelabelopt@circle{% +\renewrobustcmd{\mkbibleftborder}{}% +\renewrobustcmd{\mkbibrightborder}{}% +} + + \ExecuteBibliographyOptions{ %autocite = superscript , %autopunct = true , @@ -69,6 +106,11 @@ or test {\iftoggle{iftlseven}}%3.7=biblatex }{\newbibmacro{cite:labeldate+extradate}{\usebibmacro{cite:labelyear+extrayear}}}{}%else: biblatex>3.7 +%标注中biblatex专门定义了labelname来控制格式 +%所以如果要让标注的格式也同著录表一样的话 +%就可以使用下面这一个定义,当然通常情况下我们使用默认的定义即可。 +%\DeclareNameAlias{labelname}{namefmtselected} + %textcite标注命令中的标点设置,注意只针对textcite命令。 % v-old % v1.0t,20200320,hzz,修改如下 @@ -179,12 +221,11 @@ test {\iftoggle{iftlseven}}%3.7=biblatex \iffieldundef{postnote}% {}% {\thefield{postnote}}}% - (\usebibmacro{prenote}}%) + \mkbibleftborder\usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite}} {} - {%( - )\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} + {\mkbibrightborder\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} } % @@ -198,19 +239,34 @@ test {\iftoggle{iftlseven}}%3.7=biblatex % % 重定义parencite命令 % -%\DeclareCiteCommand{\parencite} -% {\usebibmacro{cite:init}% -% \renewbibmacro*{postnote}{% -% \iffieldundef{postnote}% -% {}% -% {\nopunct% -% \printfield{postnote}}}% -% (\usebibmacro{prenote}}%) -% {\usebibmacro{citeindex}% -% \usebibmacro{cite}} -% {} -% {%( -% )\mkbibsuperscript{\usebibmacro{postnote}}} +\DeclareCiteCommand{\parencite}%[\mkbibparens] + {\usebibmacro{cite:init}% + \renewbibmacro*{postnote}{% + \iffieldundef{postnote}% + {}% + {\nopunct% + \printfield{postnote}}}% + \mkbibleftborder\usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{cite}} + {} + {\mkbibrightborder\mkbibsuperscript{\usebibmacro{postnote}}} + +% +% 重定义footcite需要使用的命令 +% +\renewrobustcmd{\blx@mkbibfootnote}[2]{% + \iftoggle{blx@footnote} + {\blx@warning{Nested notes}% + \addspace\mkbibleftborder{#2}\mkbibrightborder} + {\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}}}}}} % @@ -224,13 +280,12 @@ test {\iftoggle{iftlseven}}%3.7=biblatex \iffieldundef{postnote}% {\thefield{pages}}% {\thefield{postnote}}}% - (\usebibmacro{prenote}%) + \mkbibleftborder\usebibmacro{prenote}% }% {\usebibmacro{citeindex}% \usebibmacro{cite}} {} - {%( - )\mkbibsuperscript{\usebibmacro{postnote}}} + {\mkbibrightborder\mkbibsuperscript{\usebibmacro{postnote}}} % % 定义yearpagescite,用于当文中作者已经存在,需要页码和年份的情况 @@ -243,10 +298,10 @@ test {\iftoggle{iftlseven}}%3.7=biblatex \iffieldundef{postnote}% {\thefield{pages}}% {\thefield{postnote}}}% - \printtext{(}\usebibmacro{prenote}}% + \printtext{\mkbibleftborder}\usebibmacro{prenote}}% {\usebibmacro{cite:labeldate+extradate}}%\printfield{year}\printfield{extrayear} {\multicitedelim}% - {\printtext{)}\textsuperscript{\usebibmacro{postnote}}} + {\printtext{\mkbibrightborder}\textsuperscript{\usebibmacro{postnote}}} % % 定义yearcite,用于当文中作者已经存在,仅需要年份的情况 @@ -254,10 +309,10 @@ test {\iftoggle{iftlseven}}%3.7=biblatex % 原理:增加一个命令yearcite \DeclareCiteCommand{\yearcite}%仅输出年份,不要页码 {\usebibmacro{cite:init}% - \printtext{(}\usebibmacro{prenote}}% + \printtext{\mkbibleftborder}\usebibmacro{prenote}}% {\usebibmacro{cite:labeldate+extradate}}%\printfield{year}\printfield{extrayear} {\multicitedelim}% - {\printtext{)}} + {\printtext{\mkbibrightborder}} % % 定义\authornumcite命令,输出作者信息,然后在后面带上顺序编码 @@ -355,13 +410,13 @@ test {\iftoggle{iftlseven}}%3.7=biblatex {} {\ifbool{cbx:incitet}{\usebibmacro{citet:postnote}}{\usebibmacro{textcite:postnote}}} - \newrobustcmd{\cbx@citet@init}[2]{% +\newrobustcmd{\cbx@citet@init}[2]{% \global\booltrue{cbx:incitet}% \setcounter{textcitetotal}{0}% \setcounter{textcitecount}{0}% \def\cbx@savedcites{#1}#2\cbx@savedcites\empty} - \renewrobustcmd{\cbx@textcite@init}[2]{% +\renewrobustcmd{\cbx@textcite@init}[2]{% \global\boolfalse{cbx:incitet}% \setcounter{textcitetotal}{0}% \setcounter{textcitecount}{0}% @@ -397,12 +452,11 @@ test {\iftoggle{iftlseven}}%3.7=biblatex \iffieldundef{postnote}% {}% {\thefield{postnote}}}% - (\usebibmacro{prenote}}%) + \mkbibleftborder\usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite}} {} - {%( - )\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} + {\mkbibrightborder\mkbibsuperscript{\usebibmacro{postnote}}%\usebibmacro{postnote} } \newrobustcmd*{\citetns}% -- cgit v1.2.3