From 79e9e48f9496fe82b7e76b2b318d24e9aab1ca8a Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 28 Mar 2024 03:01:34 +0000 Subject: CTAN sync 202403280301 --- .../biblatex-gb7714-2015/README.md | 18 +++-- .../biblatex-gb7714-2015/biblatex-gb7714-2015.pdf | Bin 1735647 -> 1740400 bytes .../biblatex-gb7714-2015/biblatex-gb7714-2015.tex | 52 +++++++++++-- .../biblatex-gb7714-2015/gb7714-2015.bbx | 82 ++++++++++++-------- .../biblatex-gb7714-2015/gb7714-2015ay.bbx | 81 ++++++++++++-------- .../biblatex-gb7714-2015/gb7714-2015ay.cbx | 12 ++- .../biblatex-gb7714-2015/gb7714-2015ms.bbx | 83 +++++++++++++++++++-- .../biblatex-gb7714-2015/gb7714-2015ms.cbx | 2 +- .../biblatex-gb7714-2015/gb7714-2015mx.bbx | 81 ++++++++++++++++++-- .../biblatex-gb7714-2015/gb7714-2015mx.cbx | 2 +- 10 files changed, 319 insertions(+), 94 deletions(-) (limited to 'macros/latex/contrib/biblatex-contrib') diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md index 5634883569..c167a21ea5 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/README.md @@ -1,4 +1,5 @@ -Date of last change: 2024-02-10 to version v1.1p +Date of last change: 2024-03-27 to version v1.1q + # biblatex-gb7714-2015: a biblatex style package @@ -74,6 +75,8 @@ biblatex-gb7714-2015 宏包是中文参考文献著录/标注标准 `GB/T 7714-2 * [SJTUThesis(上海交通大学学位论文模板)](https://github.com/sjtug/SJTUThesis) (母校的论文模板,不得不说缘分真的很神奇,16年一出来就用上) * [sustechthesis(Southern University of Science and Technology Thesis Template LaTeX Template)](https://github.com/Iydon/sustechthesis) * [SwufeTeX(西南财经大学学位论文LaTeX模板)](https://github.com/OopsYao/swufethesis) +* [SYSUThesis(中山大学研究生学位论文LaTeX模板(试用))](https://github.com/1FCENdoge/SYSUThesis) +* [sysu-thesis(中山大学 LaTeX 论文项目模板(本科))](https://github.com/SYSU-SCC/sysu-thesis) * [Thesis-Template-for-XJTU (西安交大毕业设计模板)](https://github.com/DXie123/Thesis-Template-for-XJTU) * [ThuThesis(LaTeX Thesis Template for Tsinghua University )](https://github.com/tuna/thuthesis) * [TongjiThesis(同济大学硕博士论文LaTeX模板)](https://github.com/marquistj13/TongjiThesis) @@ -703,14 +706,15 @@ GB/T 7714-2015标准实现的bst版本,已经由[zeping lee](https://github.co #### 4.2 Bibliography format/文献表著录格式 -* 请问可以在参考文献表中实现类似于word那样的与文献内容等间距标签对齐格式么? +* 请问可以在参考文献表中实现类似于word那样的与文献内容等间距的标签对齐格式么? 可以,latex的列表通常用list来实现,因此一般列表的内容都是对齐的, -此时如果标签右对齐的,那么标签和内容等间距,但标签左侧是不对齐的。 -如果标签是左对齐的,那么标签和内容的间距不相等。 -如果要求标签左侧对齐,且标签与内容等间距必须放弃使用list。 -biblatex-7714-2015的顺序编码制样式特别设计了这样的环境,以保持和word一致。通过设置选项gbalign来实现: +此时如果标签右对齐的,那么标签和内容等间距,但标签左侧是不对齐的,此时对应的选项为:gbalign=right。 +如果标签是左对齐的,那么标签和内容的间距不相等,此时对应的选项为:gbalign=left。 +如果标签是中间对齐的,那么标签的两侧的[]是对齐的,数字标签处于其中间,此时对应的选项为:gbalign=center。 +如果要求标签左侧对齐,且标签与内容等间距,则必须放弃使用list,这种方式在本宏包中称为项对齐,对应选项为gbalign=gb7714-2015, +这是biblatex-7714-2015的顺序编码制样式为项对齐设计了专门环境达成的,其使用方式很简单,加上响应的选项即可: ```\usepackage[backend=biber,bibstyle=gb7714-2015,gbalign=gb7714-2015]{biblatex}``` @@ -1609,6 +1613,8 @@ please see the file 'biblatex-gb7714-2015.pdf' for further information! * 2023/05/24 v1.1n,ctan,github * 2023/09/10 v1.1o,ctan,github * 2024/02/10 v1.1p,ctan,github +* 2024/03/27 v1.1q,ctan,github + diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf index e0b7222d5e..042dce20cb 100644 Binary files a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf and b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf differ diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex index 2dce4783ce..e87235d9e4 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.tex @@ -538,6 +538,20 @@ leftrule=0pt,rightrule=0pt,toprule=0.4pt,bottomrule=0.4pt] \caption{文献表作者缺失处理选项gbnoauthor效果}\label{fig:eg:optgbnoauthor} \end{figure} + + + \pdfbookmark[4]{gbnoothers}{gbnoothers} + \item[gbnoothers]=true,\textbf{false}. \hfill default is false + + 为控制是否输出作者列表截断后的等/et al. 信息增加的选项。 + \begin{itemize} + \item gbnoothers=false,默认输出等、et al.信息; + \item gbnoothers=true,不输出。 + \end{itemize} + 该选项是全局选项,设置为true后,全文的作者列表都将不输出。若需要再局部调整,则利用编组局部设置\verb|\settoggle{bbx:gbnoothers}{true}|即可。 + + + \pdfbookmark[4]{gbbiblabel}{gbbiblabel} \item[gbbiblabel]=\textbf{bracket},parens,plain,dot,box,circle. \hfill default is bracket @@ -1098,6 +1112,16 @@ leftrule=0pt,rightrule=0pt,toprule=0.4pt,bottomrule=0.4pt] 将会为author2007en,author2014en两个条目添加nameformat域信息。 该命令也只能出现在导言区中。 + + \pdfbookmark[4]{delEntryField}{delEntryField} + \item[delEntryField] \{entrykey or entrykey comma list\}\{field\} + + 用于给指定的文献条目(集)删除域。即将指定的entrykey 条目或者entrykey comma list 中的各个条目中的 field 域删除。 + + \verb|\delEntryField{author2007en,author2014en}{usera}| + + 将会把author2007en,author2014en两个条目中usera域信息删除。 + \pdfbookmark[4]{setlocalbibstring}{setlocalbibstring} @@ -1650,7 +1674,7 @@ leftrule=0pt,rightrule=0pt,toprule=0.4pt,bottomrule=0.4pt] \end{figure} \paragraph{\heiti 文献表竖直间距控制} -文献表各条目之间的竖直间距控制如例\ref{eg:biblist:vspace}所示,此外,还可以调整方括号和圆括号的竖直位置,使其与使用无基线以下部分字体的文本相配合。 +文献表各条目之间的竖直间距控制如例\ref{eg:biblist:vspace}所示。注意,这些竖直间距设置不是行距设置,而是行距基础上附加设置,行距默认采用正文的设置,若要局部调整参考文献的行距,则在局部编组中采用linespread命令或者调整 baselinestretch 实现。此外,还可以调整方括号和圆括号的竖直位置,使其与使用无基线以下部分字体的文本相配合。 \begin{example}{文献表竖直间距控制}{eg:biblist:vspace} \begin{texlist} @@ -1779,7 +1803,7 @@ bibitemindent表示 其它一些修改示例可以参考: \href{run:./chinese-erj.bbx}{chinese-erj.bbx}, \href{run:./gb7714-CCNU.bbx}{gb7714-CCNU.bbx}, -\href{run:./egthesis/thesis-uibe-numeric.tex}{thesis-uibe-numeric.tex}。各标点命令的意义详见biblatex手册。 +\href{run:./egthesis/thesis-uibe-numeric.tex}{thesis-uibe-numeric.tex}。各标点命令的意义详见biblatex手册。一些示例见:\url{https://github.com/TheNetAdmin/zjuthesis/issues/374}。 \begin{example}{文献表常见标点(间隔符)控制}{eg:biblist:separator} \begin{texlist} @@ -1806,12 +1830,16 @@ bibitemindent表示 %姓名内部的相关标点,包括如下等设置 %注意这类设置与gbnamefmt选项相关,不同的选项值对应不同的gb...localset +%包括:gbcaselocalset,gbpinyinlocalset,gbquanpinlocalset,gbfullnamelocalset +%如果是familyahead,givenahead选项,则直接使用内部的重设命令即可。 %除了如下命令外还有其它设置,有需要可以查biblatex文档 \def\gbcaselocalset{% \renewcommand*{\revsdnamepunct}{,}%% \renewrobustcmd*{\bibinitperiod}{}%将名字简写后的点去掉 \renewrobustcmd*{\bibinithyphendelim}{}%.\mbox{-} -\renewrobustcmd*{\bibnamedelima}{} %%\mbox{-} +\renewrobustcmd*{\bibnamedelima}{} %%全拼名后的标点\mbox{-} +\renewrobustcmd*{\bibnamedelimi}{} %名缩写点后的标点,Initials in the bib file +\renewrobustcmd*{\bibinitdelim}{} %名缩写点后的标点 } \end{texlist} \end{example} @@ -2007,6 +2035,20 @@ annotation = {美国发明专利申请号.}, } \end{filecontents} +%导言区 +%去掉文献Zhang2007-500-503的usera域 +\delEntryField{Zhang2007-500-503}{usera} +%在第1个refsection中去掉article类的文献标识符 +%利用AtEveryBibitem在对refsection和entrytype判断后局部做设置 +\AtEveryBibitem{% +\ifnumequal{\value{refsection}}{1} + {% + \ifentrytype{article}{\settoggle{bbx:gbtype}{false}}{\settoggle{bbx:gbtype}{true}}% + }% + {}% +} + +%正文区 \begin{refsection}[resume.bib] \nocite{ref-8-1-任天令,ref-9-1-Ren}% \printbibliography[heading=subbibliography,title={研究成果}] @@ -2170,7 +2212,7 @@ annotation = {美国发明专利申请号.}, \href{https://github.com/hushidong/biblatex-solution-to-latex-bibliography/blob/master/biblatex-solution-to-latex-bibliography.pdf}% {biblatex-solution-to-latex-bibliography}中的第2.10节。 -具体例子则可以参考\href{run:./stdgbT7714-2015.pdf}{stdgbT7714-2015.pdf}。其中第8节中大量使用这种方式。 +具体例子则可以参考\href{run:./stdgbT7714-2015.pdf}{stdgbT7714-2015.pdf},其中第8节中大量使用这种方式。 @@ -2540,7 +2582,7 @@ biber -l zh__stroke jobname 其中,排序模板优先使用persort域进行排序,接着是与文种相关的lansortorder域,接着是sortkey域(该域在biblatex中就是key域的别名),接着是sortname等作者姓名相关的域,要让文献根据多音字习惯音进行排序,那么就在key域中设置文献作者姓名的习惯音。比如三篇文献作者分别是[李四]、[J. B. Conway]、[曾三]。在设置sorting=multipinyin, gblanorder=chineseahead, sortlocale=zh\_\_pinyin的情况下,根据上述的multipinyin排序模板,首先根据文种和作者信息将中文文献[曾三][李四]排在前面,接着是[J. B. Conway],因为默认情况下,曾字考虑的读音是ceng2,但这不是我们希望得到的。 -所以需要手动将key域设置为中文的拼音,比如[李四]文献设置key=\{li3si4\},而[曾三]文献设置key=\{zeng1san1\},那么中文文献仍然排在前面,但根据key域的设置会将[李四]文献排列在[曾三]前面。因此手动设置作者姓名的习惯拼音后,文献排列正确,顺序为:[李四][曾三][J. B. Conway]。 需要注意的是:若要手动设置拼音则需要对文献表中的全部中文文献设置否则利用key域排序就会失效,而这并是一个轻松的活,此时我们可以使用自动设置拼音的工具,详见 +所以需要手动将key域设置为中文的拼音,比如[李四]文献设置key=\{li3si4\},而[曾三]文献设置key=\{zeng1san1\},那么中文文献仍然排在前面,但根据key域的设置会将[李四]文献排列在[曾三]前面。因此手动设置作者姓名的习惯拼音后,文献排列正确,顺序为:[李四][曾三][J. B. Conway]。 需要注意的是:若要手动设置拼音则需要对文献表中的全部中文文献设置否则利用key域排序就会失效,而这并不是一个轻松的活,此时我们可以使用自动设置拼音的工具,详见 \href{https://www.latexstudio.net/index/details/index/ids/1546}{为中文参考文献自动添加排序用的拼音信息域},\href{https://github.com/hushidong/biblatex-map}{bibmap宏包}。 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 bc09f63c6e..6042720bc3 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{2024/02/10 v1.1p} +\def\versionofgbtstyle{2024/03/27 v1.1q} \def\versionofbiblatex{\abx@version} \ProvidesFile{gb7714-2015.bbx}[\versionofgbtstyle biblatex bibliography style] %\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 @@ -235,6 +235,14 @@ %===================================================================== % 设置宏包选项 %===================================================================== + % + % 增加一个控制是否输出and others信息的选项 + % 20240315,v1.1p,hzz + \newtoggle{bbx:gbnoothers} + \DeclareBibliographyOption{gbnoothers}[false]{%biblatex低版本 + \settoggle{bbx:gbnoothers}{#1}} + \ExecuteBibliographyOptions{gbnoothers} + % % 增加一个控制是否调整日期输出位置的选项mergedate % 为兼容性考虑,但实际不产生作用了,因为如果要使用ay样式可以直接从bibstyle进入 @@ -960,6 +968,7 @@ bibliography = {\str@bibliography}, references = {\str@references}, bytranslatorcn = {\str@bytranslator},%\addperiod,%将trans. by 改成 译\addcomma\ + byeditor={\iffieldequalstr{userd}{chinese}{\str@editorcn}{ed\adddotspace by}}, and = {\addcomma},%将第2和3人名间的and符号改成逗号,用\finalnamedelim命令也可以定义,参见3.9.1节 andcn = {\addcomma},%and本地化字符串的中文对应词 andincitecn = {\str@andcn},%将标注中的分开,便于与文献表中的区分 @@ -1848,37 +1857,31 @@ } %用于人工的为条目或条目集添加域 \newcommand{\addEntryField}[3]{% - \edef\entrykeya{#1} - \edef\entrykeyb{#2} - \edef\entrykeyc{#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] } - \map{%处理在bib文件中直接给出文献的姓名格式为lowercase的情况 - \step[fieldsource=nameformat,match=lowercase,final] - \step[fieldset=namefmtid,fieldvalue={1}] - } - \map{%处理在bib文件中直接给出文献的姓名格式为givenahead的情况 - \step[fieldsource=nameformat,match=givenahead,final] - \step[fieldset=namefmtid,fieldvalue={2}] - } - \map{%处理在bib文件中直接给出文献的姓名格式为familyahead的情况 - \step[fieldsource=nameformat,match=familyahead,final] - \step[fieldset=namefmtid,fieldvalue={3}] - } - \map{%处理在bib文件中直接给出文献的姓名格式为pinyin的情况 - \step[fieldsource=nameformat,match=pinyin,final] - \step[fieldset=namefmtid,fieldvalue={4}] - } - \map{%处理在bib文件中直接给出文献的姓名格式为全拼的情况 - \step[fieldsource=nameformat,match=quanpin,final] - \step[fieldset=namefmtid,fieldvalue={6}] - } } - } + }% + } + +%用于人工的为条目或条目集删除域 +\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={}] + } + } + }% } % @@ -2355,7 +2358,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.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标识符 {\printdelim{titletypedelim}\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}}% {\printdelim{titletypedelim}\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{{\SlashFont/}OL\gbrightbracket}}% }% @@ -2476,6 +2479,18 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 \patchcmd{\abx@macro@title}{\newunitpunct}{}{}{}}}{} } +% +\newbibmacro*{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}} % % 修改译者位置格式 @@ -2485,8 +2500,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 \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}%中可以看到当地化字符串格式的引用前的代码处理 @@ -2792,7 +2806,9 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 {\namepartprefix} {\namepartsuffix}% \fi - \usebibmacro{name:andothers}} +\iftoggle{bbx:gbnoothers}{}% + {\usebibmacro{name:andothers}}% +} \DeclareNameAlias{default}{namefmtselected}%姓名的默认格式采用可选的模式 \DeclareNameAlias{sortname}{default}% Used in the bibliography %family-given/given-family @@ -3092,8 +3108,10 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 {\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}% \or \usebibmacro{name:gbquanpin}{#1}{#3}{#5}{#7}% - \fi - \usebibmacro{name:andothers}} + \fi% +\iftoggle{bbx:gbnoothers}{}% + {\usebibmacro{name:andothers}}% + }% } % @@ -4218,7 +4236,7 @@ test{\iffieldundef{day}} and test{\iffieldundef{endday}} and test{\iffieldundef{ \usebibmacro{institution+location+date}% %\newunit\newblock \usebibmacro{chapter+pages}% - \iffieldundef{url}{}{a%当没有网址时也不输出修改或更新日期 + \iffieldundef{url}{}{%当没有网址时也不输出修改或更新日期 \usebibmacro{modifydate}}%修改或更新日期为带括号的时间 \usebibmacro{doi+eprint+url}% \newunit diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx index 73316ea3cb..01a0f05a6b 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ay.bbx @@ -10,7 +10,7 @@ % % 版本和时间信息 % -\def\versionofgbtstyle{2024/02/10 v1.1p} +\def\versionofgbtstyle{2024/03/27 v1.1q} \def\versionofbiblatex{\abx@version} \ProvidesFile{gb7714-2015ay.bbx}[\versionofgbtstyle biblatex bibliography style] %\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 @@ -232,6 +232,14 @@ %===================================================================== % 设置宏包选项 %===================================================================== + % + % 增加一个控制是否输出and others信息的选项 + % 20240315,v1.1p,hzz + \newtoggle{bbx:gbnoothers} + \DeclareBibliographyOption{gbnoothers}[false]{%biblatex低版本 + \settoggle{bbx:gbnoothers}{#1}} + \ExecuteBibliographyOptions{gbnoothers} + % % 增加一个控制是否输出文献载体的选项 % 20191125,v1,0s,hzz @@ -913,6 +921,7 @@ bibliography = {\str@bibliography}, references = {\str@references}, bytranslatorcn= {\str@bytranslator\adddot}, %将trans. by 改成 译 + byeditor={\iffieldequalstr{userd}{chinese}{\str@editorcn}{ed\adddotspace by}}, and = {\addcomma},%将第2和3人名见的and符号改成 逗号,用\finalnamedelim命令也可以定义,参见3.9.1节 andcn = {\addcomma},%\str@andcn\ and本地化字符串的中文对应词 andincitecn = {\str@andcn},%将标注中的分开,便于与文献表中的区分 @@ -1675,37 +1684,31 @@ } %用于人工的为条目或条目集添加域 \newcommand{\addEntryField}[3]{% - \edef\entrykeya{#1} - \edef\entrykeyb{#2} - \edef\entrykeyc{#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] } - \map{%处理在bib文件中直接给出文献的姓名格式为lowercase的情况 - \step[fieldsource=nameformat,match=lowercase,final] - \step[fieldset=namefmtid,fieldvalue={1}] - } - \map{%处理在bib文件中直接给出文献的姓名格式为givenahead的情况 - \step[fieldsource=nameformat,match=givenahead,final] - \step[fieldset=namefmtid,fieldvalue={2}] - } - \map{%处理在bib文件中直接给出文献的姓名格式为familyahead的情况 - \step[fieldsource=nameformat,match=familyahead,final] - \step[fieldset=namefmtid,fieldvalue={3}] - } - \map{%处理在bib文件中直接给出文献的姓名格式为pinyin的情况 - \step[fieldsource=nameformat,match=pinyin,final] - \step[fieldset=namefmtid,fieldvalue={4}] - } - \map{%处理在bib文件中直接给出文献的姓名格式为全拼的情况 - \step[fieldsource=nameformat,match=quanpin,final] - \step[fieldset=namefmtid,fieldvalue={6}] - } } - } + }% + } + +%用于人工的为条目或条目集删除域 +\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={}] + } + } + }% } % @@ -2213,7 +2216,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.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标识符 {\printdelim{titletypedelim}\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{\iffieldundef{medium}{}{{\SlashFont/}\thefield{medium}}\gbrightbracket}}% {\printdelim{titletypedelim}\printtext{\gbleftbracket}\nobreak#1\nobreak\printtext{{\SlashFont/}OL\gbrightbracket}}% }% @@ -2334,6 +2337,19 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 } +\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,增加对英文等其它语言译者的处理 @@ -2342,8 +2358,7 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 \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}%中可以看到当地化字符串格式的引用前的代码处理 @@ -2648,7 +2663,9 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 {\namepartprefix} {\namepartsuffix}% \fi - \usebibmacro{name:andothers}} +\iftoggle{bbx:gbnoothers}{}% + {\usebibmacro{name:andothers}}% +} \DeclareNameAlias{default}{namefmtselected}%姓名的默认格式采用可选的模式 \DeclareNameAlias{sortname}{default}% Used in the bibliography %family-given/given-family @@ -2948,8 +2965,10 @@ test {\iftoggle{iftlseven}}%biblatex<=3.7 {\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}% \or \usebibmacro{name:gbquanpin}{#1}{#3}{#5}{#7}% - \fi - \usebibmacro{name:andothers}} + \fi% +\iftoggle{bbx:gbnoothers}{}% + {\usebibmacro{name:andothers}}% + }% } % 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 739528dc1b..8a1a03d1d2 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 @@ -7,7 +7,7 @@ %% Released under the LaTeX Project Public License v1.3c or later %% --------------------------------------------------------------- %% -\ProvidesFile{gb7714-2015.cbx}[a biblatex citation style for GB/T 7714-2015] +\ProvidesFile{gb7714-2015ay.cbx}[a biblatex citation style for GB/T 7714-2015] % % 加载标准样式 @@ -322,16 +322,20 @@ test {\iftoggle{iftlseven}}%3.7=biblatex \newrobustcmd*{\upcite}{% \cite} +\newrobustcmd{\mkbiboutparens}[1]{% + \unspace\allowhyphens% +\begingroup\mkbibleftborder#1\mkbibrightborder\endgroup}% + % % 重定义parencite命令 % -\DeclareCiteCommand{\parencite}%[\mkbibparens] +\DeclareCiteCommand{\parencite}[\mkbiboutparens]% {\usebibmacro{cite:init}% - \mkbibleftborder\usebibmacro{prenote}}% + \usebibmacro{prenote}}% {\usebibmacro{citeindex}% \usebibmacro{cite}} {} - {\usebibmacro{postnote}\mkbibrightborder} + {\usebibmacro{postnote}} % % 重定义footcite需要使用的命令 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后无法达成格式需求 @@ -119,6 +119,14 @@ %===================================================================== % 设置宏包选项 %===================================================================== + % + % 增加一个控制是否输出and others信息的选项 + % 20240315,v1.1p,hzz + \newtoggle{bbx:gbnoothers} + \DeclareBibliographyOption{gbnoothers}[false]{%biblatex低版本 + \settoggle{bbx:gbnoothers}{#1}} + \ExecuteBibliographyOptions{gbnoothers} + % % 增加一个控制是否输出文献载体的选项 % 20191125,v1,0s,hzz @@ -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}}%在标题后直接给出文献标识字母,判断一下,是否是报纸和标准 diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.cbx index fce42d508b..333b873eec 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.cbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015ms.cbx @@ -7,7 +7,7 @@ %% Released under the LaTeX Project Public License v1.3c or later %% --------------------------------------------------------------- %% -\ProvidesFile{gb7714-2015.cbx}[a biblatex citation style for GB/T 7714-2015] +\ProvidesFile{gb7714-2015ms.cbx}[a biblatex citation style for GB/T 7714-2015] % % 加载样式 diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx index 8351664a2a..27b316d648 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.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-2015mx.bbx}[\versionofgbtstyle biblatex bibliography style] %\RequireBiber[3]%显式指定用biber后端,当用bibtex时会报错,但其实不会影响编译,只是采用bibtex后无法达成格式需求 @@ -146,6 +146,15 @@ %===================================================================== % 设置宏包选项 %===================================================================== + % + % 增加一个控制是否输出and others信息的选项 + % 20240315,v1.1p,hzz + \newtoggle{bbx:gbnoothers} + \DeclareBibliographyOption{gbnoothers}[false]{%biblatex低版本 + \settoggle{bbx:gbnoothers}{#1}} + \ExecuteBibliographyOptions{gbnoothers} + + % % 增加一个控制是否输出type域的选项 % 20190212,v1,0q,hzz @@ -383,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}{% @@ -680,6 +696,12 @@ \NewBibliographyString{editorcn} \NewBibliographyString{editorscn} \NewBibliographyString{bytranslatorcn} + \NewBibliographyString{compilercn} + \NewBibliographyString{compilerscn} + \NewBibliographyString{revisercn} + \NewBibliographyString{reviserscn} + \NewBibliographyString{foundercn} + \NewBibliographyString{founderscn} @@ -694,6 +716,7 @@ bibliography = {\str@bibliography}, references = {\str@references}, bytranslatorcn = {\str@bytranslator},%\addperiod,%将trans. by 改成 译\addcomma\ + byeditor={\iffieldequalstr{userd}{chinese}{\str@editorcn}{ed\adddotspace by}}, and = {\addcomma},%将第2和3人名间的and符号改成逗号,用\finalnamedelim命令也可以定义,参见3.9.1节 andcn = {\addcomma},%and本地化字符串的中文对应词 andincitecn = {\addcomma},%将标注中的分开,便于与文献表中的区分 @@ -717,6 +740,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}, } % @@ -1407,7 +1436,34 @@ } } +%用于人工的为条目或条目集添加域 +\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={}] + } + } + }% + } % @@ -1751,7 +1807,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}}% }% @@ -1867,7 +1923,17 @@ \patchcmd{\abx@macro@title}{\newunitpunct}{}{}{}}}{} } - +\newbibmacro*{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,增加对英文等其它语言译者的处理 @@ -1876,8 +1942,7 @@ \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}%中可以看到当地化字符串格式的引用前的代码处理 @@ -2172,8 +2237,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 diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx index 1beb8d05ca..e7d16c09b4 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/gb7714-2015mx.cbx @@ -7,7 +7,7 @@ %% Released under the LaTeX Project Public License v1.3c or later %% --------------------------------------------------------------- %% -\ProvidesFile{gb7714-2015.cbx}[a biblatex citation style for GB/T 7714-2015] +\ProvidesFile{gb7714-2015mx.cbx}[a biblatex citation style for GB/T 7714-2015] % % 加载标准样式 -- cgit v1.2.3