summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx')
-rw-r--r--macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx83
1 files changed, 76 insertions, 7 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx
index a4668eb0ff..3ff6cc21b6 100644
--- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx
+++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.bbx
@@ -11,7 +11,7 @@
%
% 版本和时间信息
%
-\def\versionofgbtstyle{2024/02/10 v1.1p}
+\def\versionofgbtstyle{2024/03/27 v1.1q}
\def\versionofbiblatex{\abx@version}
\ProvidesFile{gb7714-2015ms.bbx}[\versionofgbtstyle biblatex bibliography style]
%\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求
@@ -120,6 +120,14 @@
% 设置宏包选项
%=====================================================================
%
+ % 增加一个控制是否输出and others信息的选项
+ % 20240315,v1.1p,hzz
+ \newtoggle{bbx:gbnoothers}
+ \DeclareBibliographyOption{gbnoothers}[false]{%biblatex低版本
+ \settoggle{bbx:gbnoothers}{#1}}
+ \ExecuteBibliographyOptions{gbnoothers}
+
+ %
% 增加一个控制是否输出文献载体的选项
% 20191125,v1,0s,hzz
\newtoggle{bbx:gbmedium}
@@ -384,6 +392,13 @@
\def\str@mathesiscn{硕士学位论文}
\def\str@phdthesiscn{博士学位论文}
\def\str@editorcn{主编}
+ \def\str@editorscn{主编}
+ \def\str@compilerscn{整理}
+ \def\str@compilercn{整理}
+ \def\str@revisercn{编}
+ \def\str@reviserscn{编}
+ \def\str@foundercn{编著}
+ \def\str@founderscn{编著}
\AtEndOfPackage{%
\iftoggle{bbx:codegbk}{%
@@ -636,6 +651,12 @@
\NewBibliographyString{editorcn}
\NewBibliographyString{editorscn}
\NewBibliographyString{bytranslatorcn}
+ \NewBibliographyString{compilercn}
+ \NewBibliographyString{compilerscn}
+ \NewBibliographyString{revisercn}
+ \NewBibliographyString{reviserscn}
+ \NewBibliographyString{foundercn}
+ \NewBibliographyString{founderscn}
%
@@ -648,6 +669,7 @@
bibliography = {\str@bibliography},
references = {\str@references},
bytranslatorcn = {\str@bytranslator},%\addperiod,%将trans. by 改成 译
+ byeditor={\iffieldequalstr{userd}{chinese}{\str@editorcn}{ed\adddotspace by}},
and = {\addcomma},%将第2和3人名间的and符号改成逗号,用\finalnamedelim命令也可以定义,参见3.9.1节
andcn = {\addcomma},%and本地化字符串的中文对应词
andincitecn = {\addcomma},%将标注中的分开,便于与文献表中的区分
@@ -671,6 +693,12 @@
phdthesiscn={\str@phdthesiscn},
editorscn={\str@editorcn},
editorcn={\str@editorcn},
+ compilerscn={\str@compilerscn},
+ compilercn={\str@compilercn},
+ reviserscn={\str@reviserscn},
+ revisercn={\str@revisercn},
+ founderscn={\str@founderscn},
+ foundercn={\str@foundercn},
}
%
@@ -1263,6 +1291,35 @@
}
}
+%用于人工的为条目或条目集添加域
+\newcommand{\addEntryField}[3]{%
+ \edef\entrykeya{#1}%
+ \edef\entrykeyb{#2}%
+ \edef\entrykeyc{#3}%
+ \DeclareStyleSourcemap{
+ \maps[datatype=bibtex]{
+ \map[foreach={#1}]{
+ \step[fieldsource=entrykey, match=\regexp{$MAPLOOP}, final]
+ \step[fieldset=\entrykeyb, fieldvalue=\entrykeyc]
+ }
+ }
+ }%
+ }
+
+%用于人工的为条目或条目集删除域
+\newcommand{\delEntryField}[2]{%
+ \edef\entrykeya{#1}%
+ \edef\entrykeyb{#2}%
+ \DeclareStyleSourcemap{
+ \maps[datatype=bibtex,overwrite]{
+ \map[foreach={#1}]{
+ \step[fieldsource=entrykey, match=\regexp{$MAPLOOP}, final]
+ \step[fieldset=\entrykeyb, fieldvalue={}]
+ }
+ }
+ }%
+ }
+
%
%驱动别名等价于驱动层映射
%
@@ -1445,7 +1502,7 @@
\DeclareFieldFormat{gbtypeflag}{%
\iftoggle{bbx:gbmedium}%
{\iftoggle{bbx:url}%
- {\iffieldundef{url}%当存在url时,增加一个OL标识符
+ {\ifboolexpr{test {\iffieldundef{url}} and test {\iffieldundef{doi}} and test {\iffieldundef{eprint}}}%\iffieldundef{url}%当存在url时,增加一个OL标识符->改为当存在doi或eprint或url时增加OL标识符
{\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}}%
{\allowbreak\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{{\SlashFont/}OL\gbrightbracket}}%
}%
@@ -1590,8 +1647,10 @@
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
-\fi
- \usebibmacro{name:andothers}}
+\fi%
+\iftoggle{bbx:gbnoothers}{}%
+ {\usebibmacro{name:andothers}}%
+}
\DeclareNameAlias{default}{namefmtselected}%姓名的默认格式采用可选的模式
\DeclareNameAlias{sortname}{default}% Used in the bibliography %family-given/given-family
@@ -1935,6 +1994,17 @@ togl{bbx:gbstyle} or test {\iffieldequalstr{userd}{chinese}}%
\href{\thefield{url}}{##1}}}{##1}}%重设标题格式,将其修改为首字母大写
\DeclareFieldFormat{pages}{##1}%去掉前面引导页码的pp.等字符,\mkpageprefix[bookpagination]{##1}
}%
+\renewbibmacro*{byeditor+others}{%
+ \ifnameundef{editor}%
+ {}%
+ {\iffieldequalstr{userd}{chinese}{}{\usebibmacro{byeditor+othersstrg}%
+ \setunit{\addspace}}%
+ \printnames[byeditor]{editor}%
+ \iffieldequalstr{userd}{chinese}{\usebibmacro{byeditor+othersstrg}}{}%
+ \clearname{editor}%
+ \newunit}%
+ \usebibmacro{byeditorx}%
+ \usebibmacro{bytranslator+others}}%
%
% 修改译者位置格式
% v1.0w,20210401,hzz,增加对英文等其它语言译者的处理
@@ -1943,8 +2013,7 @@ togl{bbx:gbstyle} or test {\iffieldequalstr{userd}{chinese}}%
\renewbibmacro*{bytranslator+others}{\bibauthorfont%
\ifnameundef{translator}
{}
- {\iffieldequalstr{usere}{chinese}{}{\usebibmacro{bytranslator+othersstrg}}%
- %\setunit{\addspace}%
+ {\iffieldequalstr{usere}{chinese}{}{\usebibmacro{bytranslator+othersstrg}\setunit{\addspace}}%
\printnames[bytranslator]{translator}%
\clearname{translator}%
%从macro*{bytranslator+othersstrg}%中可以看到当地化字符串格式的引用前的代码处理
@@ -2092,7 +2161,7 @@ togl{bbx:gbstyle} or test {\iffieldequalstr{userd}{chinese}}%
\iffieldundef{titleaddon}{}{\setunit{\subtitlepunct}\printfield{titleaddon}}%判断一下titleaddon
\ifboolexpr{test{\ifentrytype{book}} and (not test{\iffieldundef{volume}})}%判断一下book类有没有volume
{\setunit{\subtitlepunct}\printfield{volume}}{}%
- \ifboolexpr{(test{\ifentrytype{archive}} or test{\ifentrytype{online}}) and (not test{\iffieldundef{number}})}%判断一下archive类有没有number
+ \ifboolexpr{(test{\ifentrytype{archive}} or test{\ifentrytype{online}}) and (not test{\iffieldundef{number}})}%判断一下archive类有没有number
{\setunit{\subtitlepunct}\printfield{number}}{}%
\iftoggle{bbx:gbtype}%
{\iffieldundef{entrysubtype}{\printfield[gbtypeflag]{usera}}%在标题后直接给出文献标识字母,判断一下,是否是报纸和标准