diff options
Diffstat (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx')
-rw-r--r-- | macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx | 98 |
1 files changed, 63 insertions, 35 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx index 2ebf228c61..d4beba03b6 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015.bbx @@ -11,7 +11,7 @@ % % 版本和时间信息 % -\def\versionofgbtstyle{2021/05/06 v1.0y} +\def\versionofgbtstyle{2021/08/19 v1.0z} \def\versionofbiblatex{\abx@version} \ProvidesFile{gb7714-2015.bbx}[\versionofgbtstyle biblatex bibliography style] %\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 @@ -753,7 +753,7 @@ \ifstrequal{#1}{familyahead}{\setcounter{gbnamefmtcase}{3}}{} \ifstrequal{#1}{pinyin}{\setcounter{gbnamefmtcase}{4}}{}%family-given \ifstrequal{#1}{reverseorder}{\setcounter{gbnamefmtcase}{5}}{}%family-given/given-family - \ifstrequal{#1}{quanpin}{\setcounter{gbnamefmtcase}{6}}{}%family-given + \ifstrequal{#1}{quanpin}{\setcounter{gbnamefmtcase}{6}}{}%全拼 } \ExecuteBibliographyOptions{gbnamefmt} @@ -1002,21 +1002,17 @@ \DeclareSourcemap{ \maps[datatype=bibtex]{% - \map{%当没有作者时将editor转成author - \pernottype{inbook}%因为in系列中editor可能用来表示bookauthor,所以排除 - \pernottype{inproceedings} - \pernottype{incollection} - \pernottype{periodical}%因为peridical直接使用editor,所以排除 - %注意notfield在低版本biblatex中没有 - %\step[notfield=author,final]%当author不存在,将editor复制给author - \step[fieldsource=editor,fieldtarget=author]%并删除editor + \map{%如果author或者editor或者translator存在,那么设置namea便于后面判断。 + \step[fieldsource=author,final] + \step[fieldset=namea,origfieldval] } - \map{%当没有作者时将translator转成author - \pernottype{inbook} - \pernottype{inproceedings} - \pernottype{incollection} - %\step[notfield=author,final]%当author不存在,将translator复制给author - \step[fieldsource=translator,fieldtarget=author]%并删除translator + \map{% + \step[fieldsource=editor,final] + \step[fieldset=namea,origfieldval] + } + \map{% + \step[fieldsource=translator,final] + \step[fieldset=namea,origfieldval] } \map{%让address和location同步,biblatex中address是location的别名 %因此输出的时候只有location信息,但处理过程中是可以存在address的。 @@ -1049,7 +1045,7 @@ \step[fieldsource=nameformat,match=pinyin,final] \step[fieldset=namefmtid,fieldvalue={4}] } - \map{%处理在bib文件中直接给出文献的姓名格式为pinyin的情况 + \map{%处理在bib文件中直接给出文献的姓名格式为全拼的情况 \step[fieldsource=nameformat,match=quanpin,final] \step[fieldset=namefmtid,fieldvalue={6}] } @@ -2178,6 +2174,8 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 % 这里调整一下两种语言参考文献的间隔,源来自biblatex.def \renewcommand*{\entrysetpunct}{\adddot\newline\nobreak} \renewcommand*{\bibpagespunct}{\addcolon\addthinspace}%%页码引用格式的修改,修改为用冒号 +% 2021.08.19,增加出版地和出版社之间的标点,hzz +\newcommand{\publocpunct}{\addcolon\addspace}%出版项中:出版社地址后面的标点 %\renewcommand{\relateddelim}{}%\par %===================================================================== @@ -2362,6 +2360,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 % v1.0w,20210401,hzz,针对其它语言的译者后的标点与中文不同做处理 % 原理方法:判断作者或译者是否中文,若中文用字符等,否则用et al. 。 % \printnames由start-stop控制项数,默认是1和maxnames/minnames +\newcommand{\aftertransdelim}{\addcomma\addthinspace} \renewbibmacro*{name:andothers}{\bibauthorfont% \ifboolexpr{ test {\ifnumequal{\value{listcount}}{\value{liststop}}} @@ -2375,7 +2374,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 %袁训来, 陈哲, 肖书海, 等. %胡泳, 范海燕, 译. %潘惠霞, 魏婧, 杨艳, 等译. -\ifcurrentname{translator}{\iffieldequalstr{usere}{chinese}{\addcomma\addthinspace}{}}{}%为了实现上述第二个示例情况做的处理 +\ifcurrentname{translator}{\iffieldequalstr{usere}{chinese}{\aftertransdelim}{}}{}%为了实现上述第二个示例情况做的处理 }} @@ -3185,7 +3184,7 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}% }{% \iflistundef{location}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}}{\printtext{[S.l.\adddot]}}}% {\printlist{location}}% -\addcolon\addspace% +\publocpunct% \iflistundef{institution}{% \iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}}{\printtext{\mkbibbrackets{s.n.}}}}% {\printlist{institution}}}% @@ -3198,7 +3197,7 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}% {\printlist{location}% \iflistundef{institution}% {\setunit*{\addcomma\space}} - {\setunit*{\addcolon\space}}% + {\setunit*{\publocpunct}}% \printlist{institution}% \setunit*{\addcomma\space}% \usebibmacro{date}% @@ -3217,8 +3216,8 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}% {\iffieldequalstr{note}{standard}{}{\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress}\space :\space\str@nopublisher]}{\printtext{[S.l.\space :\space s.n.\adddot]}}}}% {\iflistundef{location}{%\adddot \iffieldequalstr{note}{standard}{}%%从gbt7714-2015标准第19页看到,标准存在出版项时输出,没有时完全省略。 - {\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}\addcolon\addspace}{\printtext{[S.l.\adddot]}\addcolon\addspace}}}% \bibstring{noaddress} - {\printlist{location}\addcolon\addspace}%%\addcolon\addspace% + {\iftoggle{ifCJKforgbt}{\printtext{[\str@noaddress]}\addcolon\addspace}{\printtext{[S.l.\adddot]}\publocpunct}}}% \bibstring{noaddress} + {\printlist{location}\publocpunct}%%\addcolon\addspace% \iflistundef{publisher}{% \iffieldequalstr{note}{standard}{}% {\iftoggle{ifCJKforgbt}{\printtext{[\str@nopublisher]}\setunit{\adddot\addspace}\setunit*{\addcomma\addspace}}% @@ -3230,7 +3229,7 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}% {\printlist{location}% \iflistundef{publisher} {\setunit*{\addcomma\space}} - {\setunit*{\addcolon\space}}% + {\setunit*{\publocpunct}}% \printlist{publisher}% \setunit*{\addcomma\space}% \usebibmacro{date}%%\newunit @@ -3246,7 +3245,7 @@ test {\iflistundef{location}} and test {\iflistundef{institution}}% {\printlist{location}%%加了一个编组避免\usebibmacro{date}把month和day信息去掉 \iflistundef{institution} {\setunit*{\addcomma\space}} - {\setunit*{\addcolon\space}}% + {\setunit*{\publocpunct}}% \printlist{institution}% \setunit*{\addcomma\space}% \usebibmacro{date}% @@ -3504,6 +3503,31 @@ incollection,proceedings,inproceedings]{number}{% }% } +% 责任者如果没有author用editor或translator替代 +% 20210521 v1.0y hzz +%专著如果责任者是editor那么不用输出类型信息 +\renewbibmacro*{editor+others}{% + \ifboolexpr{ + test \ifuseeditor + and + not test {\ifnameundef{editor}} + } + {\printnames{editor}% + \clearname{editor}} + {}} +%要注意要使用translator那么需要开启usetranslator选项的。 +%注意其中的标点处理。 +\renewbibmacro*{translator+others}{% + \ifboolexpr{ + test \ifusetranslator + and + not test {\ifnameundef{translator}} + } + {\renewcommand{\aftertransdelim}{\adddot\addspace}{\adddot\addspace}\printnames{translator}% + \clearname{translator}} + {}} + + % % 修改期刊的标题 % @@ -3647,11 +3671,11 @@ incollection,proceedings,inproceedings]{number}{% % % book条目类的驱动 % - \DeclareBibliographyDriver{book}{%源来自standard.bbx文件 - \usebibmacro{bibindex}% - \usebibmacro{begentry}% +\DeclareBibliographyDriver{book}{%源来自standard.bbx文件 +\usebibmacro{bibindex}% +\usebibmacro{begentry}% \usebibmacro{author/editor+others/translator+others}% -\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 \usebibmacro{maintitle+title}% \iftoggle{bbx:gbstrict}{}{% \newunit @@ -3837,7 +3861,7 @@ incollection,proceedings,inproceedings]{number}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% \usebibmacro{author/editor+others/translator+others}% -\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 \usebibmacro{title}% \iftoggle{bbx:gbstrict}{}{% \newunit% @@ -3884,8 +3908,8 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{ \DeclareBibliographyDriver{report}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% - \usebibmacro{author}% -\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 \usebibmacro{title}% \iftoggle{bbx:gbstrict}{}{% \newunit% @@ -3933,8 +3957,8 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{ \DeclareBibliographyDriver{manual}{% \usebibmacro{bibindex}% \usebibmacro{begentry}% - \usebibmacro{author}% -\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \usebibmacro{author/editor+others/translator+others}% +\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 \usebibmacro{title}% \iftoggle{bbx:gbstrict}{}{% \newunit% @@ -3986,7 +4010,7 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{ \usebibmacro{bibindex}% \usebibmacro{begentry}% \usebibmacro{author/editor+others/translator+others}% -\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 +\ifnameundef{namea}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 \usebibmacro{title}% \iftoggle{bbx:gbstrict}{}{% \newunit @@ -4060,7 +4084,11 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{ \usebibmacro{bibindex}% \usebibmacro{begentry}% \usebibmacro{author/translator+others}% -\ifnameundef{author}{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 + \ifboolexpr{ + test {\ifnameundef{author}} + and + test {\ifnameundef{translator}} + }{}{\setunit{\labelnamepunct}\newblock}%这一段用于去除作者不存在时多出的标点 \usebibmacro{title}% \usebibmacro{in:}% %\printtext{\texttt{//}\addthinspace}% |