From 36c481b02c4fdfaf33325b9f18834c2357b8eec5 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 28 Jun 2021 03:01:01 +0000 Subject: CTAN sync 202106280301 --- biblio/bibtex/contrib/gbt7714/CHANGELOG.md | 24 +- biblio/bibtex/contrib/gbt7714/README.md | 2 +- biblio/bibtex/contrib/gbt7714/gbt7714.dtx | 482 ++++++++++++++++------------- biblio/bibtex/contrib/gbt7714/gbt7714.ins | 8 +- biblio/bibtex/contrib/gbt7714/gbt7714.pdf | Bin 351819 -> 368979 bytes 5 files changed, 300 insertions(+), 216 deletions(-) (limited to 'biblio') diff --git a/biblio/bibtex/contrib/gbt7714/CHANGELOG.md b/biblio/bibtex/contrib/gbt7714/CHANGELOG.md index 312b41259e..a4e37872f6 100644 --- a/biblio/bibtex/contrib/gbt7714/CHANGELOG.md +++ b/biblio/bibtex/contrib/gbt7714/CHANGELOG.md @@ -5,6 +5,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +## [v2.1.2] - 2021-06-20 +### Added +- 新增选项 `italic.book.title` 控制书名使用斜体。 +- 新增选项 `wave.dash.in.pages` 控制起止页码使用波浪号。 +- 新增选项 `end.with.period` 控制结尾加句点。 + +### Fixed +- 修正了 `article` 只有 `date` 时年份缺失的问题(ustctug/ustcthesis#299)。 + +## [v2.1.1] - 2021-04-03 +### Added +- 新增选项 `space.before.mark` 选择文献类型标识前是否有空格。 + +### Changed +- 默认不再显示“出版地不详”、“S.l.”等信息。 + +### Fixed +- 修正了上标式引用后与中文之间多余的空格(tuna/thuthesis#624)。 +- 修正了姓名或年份中含有中括号时的引用错误,该问题是同时使用 `bibunits` 导致的(tuna/thuthesis#630)。 + ## [v2.1] - 2020-12-17 ### Changed - 著者-出版年制的 `key` 域如果含有多个姓名的拼音,改为使用 ` & ` 分隔(#68) @@ -121,7 +141,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Initial release. -[Unreleased]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v2.1...HEAD +[Unreleased]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v2.1.2...HEAD +[v2.1.2]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v2.1.1...v2.1.2 +[v2.1.1]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v2.1...v2.1.1 [v2.1]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v2.0.2...v2.1 [v2.0.2]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v2.0.1...v2.0.2 [v2.0.1]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v2.0...v2.0.1 diff --git a/biblio/bibtex/contrib/gbt7714/README.md b/biblio/bibtex/contrib/gbt7714/README.md index bb56f7408c..fdd9abfac4 100644 --- a/biblio/bibtex/contrib/gbt7714/README.md +++ b/biblio/bibtex/contrib/gbt7714/README.md @@ -34,7 +34,7 @@ GB/T 7714—2015 《信息与文献\quad 参考文献著录规则》是中国的 ## 版本 v2.0 的重要修改 -从 v2.0 版本开始(2020-03-04),用户必须在文档中使用 `\biblilographystyle` 命令选择参考文献样式, +从 v2.0 版本开始(2020-03-04),用户必须在文档中使用 `\bibliographystyle` 命令选择参考文献样式, 如 `gbt7714-numerical` 或 `gbt7714-author-year`。 在早期的版本中,选择文献样式的方法是将 `numbers` 或 `super` 等参数传递给 `gbt7714`, 而不能使用 `\bibliographystyle`。 diff --git a/biblio/bibtex/contrib/gbt7714/gbt7714.dtx b/biblio/bibtex/contrib/gbt7714/gbt7714.dtx index 357fd14495..fa0e99aae5 100644 --- a/biblio/bibtex/contrib/gbt7714/gbt7714.dtx +++ b/biblio/bibtex/contrib/gbt7714/gbt7714.dtx @@ -2,7 +2,7 @@ % GB/T 7714—2015 BibTeX Style % https://github.com/CTeX-org/gbt7714-bibtex-style % -% Copyright (C) 2016-2020 by Zeping Lee +% Copyright (C) 2016—2021 by Zeping Lee % % This file may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3c @@ -10,14 +10,14 @@ % The latest version of this license is in % https://www.latex-project.org/lppl.txt % and version 1.3c or later is part of all distributions of LaTeX -% version 2005/12/01 or later. +% version 2008 or later. % % \fi % % \iffalse %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{gbt7714} -% [2020/12/17 v2.1 GB/T 7714—2015 BibTeX Style] +% [2021/06/20 v2.1.2 GB/T 7714—2015 BibTeX Style] % %<*driver> \documentclass[a4paper]{ltxdoc} @@ -292,20 +292,24 @@ % max.num.authors & |#3| & 输出著者的最多数量 \\ % year.after.author & |#0| & 年份置于著者之后 \\ % period.after.author & |#0| & 著者和年份之间使用句点连接 \\ +% italic.book.title & |#0| & 西文书籍名使用斜体 \\ % sentence.case.title & |#1| & 将西文的题名转为 sentence case \\ % link.title & |#0| & 在题名上添加 url 的超链接 \\ % title.in.journal & |#1| & 期刊是否显示标题 \\ +% space.before.mark & |#0| & 文献类型标识前是否有空格 \\ % show.mark & |#1| & 显示文献类型标识 \\ % show.medium.type & |#1| & 显示载体类型标识 \\ % italic.journal & |#0| & 西文期刊名使用斜体 \\ -% show.missing.address.publisher & |#1| & 出版项缺失时显示“出版者不详” \\ +% show.missing.address.publisher & |#0| & 出版项缺失时显示“出版者不详” \\ % space.before.pages & |#1| & 页码与前面的冒号之间有空格 \\ % only.start.page & |#0| & 只显示起始页码 \\ +% wave.dash.in.pages & |#0| & 起止页码使用波浪号 \\ % show.urldate & |#1| & 显示引用日期 urldate \\ % show.url & |#1| & 显示 url \\ % show.doi & |#1| & 显示 DOI \\ % show.preprint & |#0| & 显示预印本信息 \\ % show.note & |#0| & 显示 note 域的信息 \\ +% end.with.period & |#1| & 结尾加句点 \\ % \bottomrule % \end{tabular} % \end{table} @@ -467,7 +471,6 @@ % % 将选项传递给 \pkg{natbib} % \begin{macrocode} -\PassOptionsToPackage{compress}{natbib} \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{natbib}} \ProcessOptions\relax % \end{macrocode} @@ -478,6 +481,12 @@ \RequirePackage{url} % \end{macrocode} % +% 如果将 \opt{compress} 传给 \pkg{natbib} 容易导致 option clash。 +% 这里直接修改内部命令。 +% \begin{macrocode} +\def\NAT@cmprs{\@ne} +% \end{macrocode} +% % \begin{macro}{\citestyle} % 定义接口切换引用文献的标注法,可用 \cs{citestyle} 调用 \opt{numerical} % 或 \opt{authoryear},参见 \pkg{natbib}。 @@ -503,21 +512,51 @@ % 为了减少依赖的宏包,这里直接重定义命令不使用 \cs{patchcmd}。 % % Super 样式的 \cs{citep} 的页码也为上标。 +% 另外加上 |\kern\p@| 去掉上标式引用后与中文之间多余的空格, +% 参考 \href{https://github.com/tuna/thuthesis/issues/624}{tuna/thuthesis\#624}。 % \begin{macrocode} -\renewcommand\NAT@citesuper[3]{\ifNAT@swa - \if*#2*\else#2\NAT@spacechar\fi - % \unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close}% - % \if*#3*\else\NAT@spacechar#3\fi\else #1\fi\endgroup} - \unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close\if*#3*\else#3\fi}% - \else #1\fi\endgroup} +\renewcommand\NAT@citesuper[3]{% + \ifNAT@swa + \if*#2*\else + #2\NAT@spacechar + \fi + % \unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close}% + % \if*#3*\else\NAT@spacechar#3\fi\else #1\fi\endgroup} + \unskip\kern\p@ + \textsuperscript{% + \NAT@@open + #1% + \NAT@@close + \if*#3*\else + #3% + \fi + }% + \kern\p@ + \else + #1% + \fi + \endgroup +} % \end{macrocode} % % 将 numbers 样式的 \cs{citep} 的页码置于括号外。 % \begin{macrocode} -\renewcommand\NAT@citenum% - [3]{\ifNAT@swa\NAT@@open\if*#2*\else#2\NAT@spacechar\fi - % #1\if*#3*\else\NAT@cmt#3\fi\NAT@@close\else#1\fi\endgroup} - #1\NAT@@close\textsuperscript{\if*#3*\else#3\fi}\else#1\fi\endgroup} +\renewcommand\NAT@citenum[3]{% + \ifNAT@swa + \NAT@@open + \if*#2*\else + #2\NAT@spacechar + \fi + % #1\if*#3*\else\NAT@cmt#3\fi\NAT@@close\else#1\fi\endgroup} + #1\NAT@@close + \if*#3*\else + \textsuperscript{#3}% + \fi + \else + #1% + \fi + \endgroup +} % \end{macrocode} % % Numerical 模式的 \cs{citet} 的页码: @@ -611,8 +650,11 @@ % }{}% \NAT@mbox{\NAT@@close}% \@ifnum{\NAT@ctype=\z@}{% - \if*#2*\else\textsuperscript{#2}\fi + \if*#2*\else + \textsuperscript{#2}% + \fi }{}% + \NAT@super@kern \fi }{#1}{#2}% }% @@ -795,7 +837,7 @@ % 这里定义了一些变量用于定制样式, % 可以在下面的 |load.config| 函数中选择是否启用。 % \begin{macrocode} -%<*authoryear|numerical> +%<*author-year|numerical> INTEGERS { citation.et.al.min citation.et.al.use.first @@ -805,10 +847,12 @@ INTEGERS { terms.in.macro year.after.author period.after.author + italic.book.title sentence.case.title link.title title.in.journal show.mark + space.before.mark show.medium.type slash.for.extraction in.booktitle @@ -818,19 +862,21 @@ INTEGERS { show.missing.address.publisher space.before.pages only.start.page + wave.dash.in.pages show.urldate show.url show.doi show.preprint show.note show.english.translation -%<*authoryear> + end.with.period +%<*author-year> lang.zh.order lang.ja.order lang.en.order lang.ru.order lang.other.order -% +% } % \end{macrocode} @@ -859,12 +905,12 @@ FUNCTION {load.config} % % 英文姓名转为全大写: % \begin{macrocode} -%<*!(nouppercase|thu)> +%<*!(no-uppercase|thu)> #1 'uppercase.name := -% -%<*nouppercase|thu> +% +%<*no-uppercase|thu> #0 'uppercase.name := -% +% % \end{macrocode} % % 使用 TeX 宏输出“和”、“等” @@ -882,9 +928,9 @@ FUNCTION {load.config} %<*numerical|ucas> #0 'year.after.author := % -%<*authoryear&!ucas> +%<*author-year&!ucas> #1 'year.after.author := -% +% % \end{macrocode} % % 采用著者-出版年制时,作者姓名与年份之间使用句点连接: @@ -892,74 +938,94 @@ FUNCTION {load.config} %<*numerical> #1 'period.after.author := % -%<*authoryear> -%<*2015&!(period|thu|ustc)> +%<*author-year> +%<*2015&!(period|ustc)> #0 'period.after.author := -% -%<*period|2005|thu|ustc> +% +%<*period|2005|ustc> #1 'period.after.author := -% -% +% +% +% \end{macrocode} +% +% 书名使用斜体: +% \begin{macrocode} +%<*!italic-book-title> + #0 'italic.book.title := +% +%<*italic-book-title> + #1 'italic.book.title := +% % \end{macrocode} % % 英文标题转为 sentence case (句首字母大写,其余小写): -%<*!nosentencecase> % \begin{macrocode} -% +%<*!no-sentence-case> #1 'sentence.case.title := -%<*nosentencecase> +% +%<*no-sentence-case> #0 'sentence.case.title := -% +% % \end{macrocode} % % 在标题添加超链接: % \begin{macrocode} -%<*!linktitle> +%<*!link-title> #0 'link.title := -% -%<*linktitle> +% +%<*link-title> #1 'link.title := -% +% % \end{macrocode} % % 期刊是否含标题: % \begin{macrocode} -%<*!(title-in-journal|npr)> +%<*!no-title-in-journal> #1 'title.in.journal := -% -%<*title-in-journal|npr> +% +%<*no-title-in-journal> #0 'title.in.journal := -% +% % \end{macrocode} % % 著录文献类型标识(比如“[M/OL]“): % \begin{macrocode} -%<*!nomark> +%<*!no-mark> #1 'show.mark := -% -%<*nomark> +% +%<*no-mark> #0 'show.mark := -% +% +% \end{macrocode} +% +% 文献类型标识前是否有空格: +% \begin{macrocode} +%<*!space-before-mark> + #0 'space.before.mark := +% +%<*space-before-mark> + #1 'space.before.mark := +% % \end{macrocode} % % 是否显示载体类型标识(比如“/OL“): % \begin{macrocode} -%<*!no.medium.type> +%<*!no-medium-type> #1 'show.medium.type := -% -%<*no.medium.type> +% +%<*no-medium-type> #0 'show.medium.type := -% +% % \end{macrocode} % % 使用“//”表示析出文献 % \begin{macrocode} -%<*!noslash> +%<*!no-slash> #1 'slash.for.extraction := -% -%<*noslash> +% +%<*no-slash> #0 'slash.for.extraction := -% +% % \end{macrocode} % % 使用“In:”表示析出文献 @@ -969,22 +1035,22 @@ FUNCTION {load.config} % % 期刊名使用缩写: % \begin{macrocode} -%<*!(short-journal|npr)> +%<*!short-journal> #0 'short.journal := -% -%<*short-journal|npr> +% +%<*short-journal> #1 'short.journal := -% +% % \end{macrocode} % % 期刊名使用斜体: % \begin{macrocode} -%<*!italicjournal> +%<*!italic-journal> #0 'italic.journal := -% -%<*italicjournal> +% +%<*italic-journal> #1 'italic.journal := -% +% % \end{macrocode} % % 期刊的卷使用粗体: @@ -994,32 +1060,42 @@ FUNCTION {load.config} % % 无出版地或出版者时,著录“出版地不详”,“出版者不详”,“S.l.” 或 “s.n.”: % \begin{macrocode} -%<*!(noslsn|thu|ustc|ucas|npr)> - #1 'show.missing.address.publisher := -% -%<*noslsn|thu|ustc|ucas|npr> +%<*!sl-sn> #0 'show.missing.address.publisher := -% +% +%<*sl-sn> + #1 'show.missing.address.publisher := +% % \end{macrocode} % -% 页码是否只含起始页: +% 页码与前面的冒号之间是否有空格: % \begin{macrocode} -%<*!(no-space-before-pages|thu)> +%<*!no-space-before-pages> #1 'space.before.pages := -% -%<*no-space-before-pages|thu> +% +%<*no-space-before-pages> #0 'space.before.pages := -% +% % \end{macrocode} % % 页码是否只含起始页: % \begin{macrocode} -%<*!(only-start-page|npr)> +%<*!only-start-page> #0 'only.start.page := -% -%<*only-start-page|npr> +% +%<*only-start-page> #1 'only.start.page := -% +% +% \end{macrocode} +% +% 起止页码使用波浪号: +% \begin{macrocode} +%<*!wave-dash-in-pages> + #0 'wave.dash.in.pages := +% +%<*wave-dash-in-pages> + #1 'wave.dash.in.pages := +% % \end{macrocode} % % 是否著录非电子文献的引用日期: @@ -1034,32 +1110,32 @@ FUNCTION {load.config} % % 是否著录 URL: % \begin{macrocode} -%<*!nourl> +%<*!no-url> #1 'show.url := -% -%<*nourl> +% +%<*no-url> #0 'show.url := -% +% % \end{macrocode} % % 是否著录 DOI: % \begin{macrocode} -%<*!nodoi&2015> +%<*!(no-doi|2005)> #1 'show.doi := -% -%<*nodoi|2005> +% +%<*no-doi|2005> #0 'show.doi := -% +% % \end{macrocode} % % 是否著录 e-print: % \begin{macrocode} -%<*!(preprint|npr)> +%<*!preprint> #0 'show.preprint := -% -%<*preprint|npr> +% +%<*preprint> #1 'show.preprint := -% +% % \end{macrocode} % % 在每一条文献最后输出注释(note)的内容: @@ -1069,23 +1145,33 @@ FUNCTION {load.config} % % 中文文献是否显示英文翻译 % \begin{macrocode} -%<*!(show-english-translation|npr)> +%<*!show-english-translation> #0 'show.english.translation := -% -%<*show-english-translation|npr> +% +%<*show-english-translation> #1 'show.english.translation := -% +% +% \end{macrocode} +% +% 结尾加句点 +% \begin{macrocode} +%<*!no-period-at-end> + #1 'end.with.period := +% +%<*no-period-at-end> + #0 'end.with.period := +% % \end{macrocode} % % 参考文献表按照“著者-出版年”组织时,各个文种的顺序: % \begin{macrocode} -%<*authoryear> +%<*author-year> #1 'lang.zh.order := #2 'lang.ja.order := #3 'lang.en.order := #4 'lang.ru.order := #5 'lang.other.order := -% +% } % \end{macrocode} @@ -1382,9 +1468,9 @@ FUNCTION {bbl.pages.colon} if$ } -%<*2015> +%<*!2005> FUNCTION {bbl.wide.space} { "\quad " } -% +% %<*2005> FUNCTION {bbl.wide.space} { "\ " } % @@ -1437,6 +1523,22 @@ FUNCTION {or} if$ } +STRINGS { x y } + +FUNCTION {contains} +{ 'y := + 'x := + y text.length$ 'len := + x text.length$ len - #1 + 'charptr := + { charptr #0 > + x charptr len substring$ y = not + and + } + { charptr #1 - 'charptr := } + while$ + charptr #0 > +} + % \end{macrocode} % % the variables s and t are temporary string holders @@ -1521,7 +1623,10 @@ FUNCTION {output.check} % % \begin{macrocode} FUNCTION {fin.entry} -{ add.period$ +{ end.with.period + 'add.period$ + 'skip$ + if$ write$ show.english.translation entry.lang lang.zh = and { ")" @@ -1659,10 +1764,18 @@ FUNCTION {field.or.null} if$ } -FUNCTION {italicize} +FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } - { "\textit{" swap$ * "}" * } + { "\emph{" swap$ * "}" * } + if$ +} + +FUNCTION {format.btitle} +{ italic.book.title + entry.lang lang.en = and + 'emphasize + 'skip$ if$ } @@ -1898,7 +2011,7 @@ FUNCTION {format.name} { bbl.et.al } { t get.str.lang 'name.lang := name.lang lang.en = - { t #1 "{vv~}{ll}{~f{~}}" format.name$ + { t #1 "{vv~}{ll}{ f{~}}" format.name$ uppercase.name { "u" change.case$ } 'skip$ @@ -1952,9 +2065,9 @@ FUNCTION {format.authors} { author empty$ not { author format.names } { "empty author in " cite$ * warning$ -%<*authoryear> +%<*author-year> bbl.anonymous -% +% %<*numerical> "" % @@ -2066,17 +2179,13 @@ FUNCTION {output.bibitem} "\bibitem[" write$ label ")" * make.full.names duplicate$ short.list = - { pop$ } - { * } - if$ - 's := - s text.length$ 'charptr := - { charptr #0 > s charptr #1 substring$ "[" = not and } - { charptr #1 - 'charptr := } - while$ - charptr #0 > - { "{" s * "}" * } - { s } + { pop$ } + { duplicate$ "]" contains + { "{" swap$ * "}" * } + 'skip$ + if$ + * + } if$ "]{" * write$ cite$ write$ @@ -2317,6 +2426,7 @@ FUNCTION {format.series.vol.num.title} } { format.title.vol.num } if$ + format.btitle link.title 'add.link 'skip$ @@ -2351,6 +2461,7 @@ FUNCTION {format.series.vol.num.booktitle} } { format.booktitle.vol.num } if$ + format.btitle in.booktitle { duplicate$ empty$ not entry.lang lang.en = and { "In: " swap$ * } @@ -2385,48 +2496,6 @@ FUNCTION {abbreviate} { "Phys Rev Lett" } 'skip$ if$ -%<*npr> - s "china physics c" = - { "Chin Phys C" } - 'skip$ - if$ - s "chinese physics letters" = - { "Chin Phys Lett" } - 'skip$ - if$ - s "nuclear instruments and methods in physics research section a" = - { "Nucl Instr and Meth A" } - 'skip$ - if$ - s "nuclear instruments and methods in physics research section a: accelerators, spectrometers, detectors and associated equipment" = - { "Nucl Instr and Meth A" } - 'skip$ - if$ - s "nuclear instruments and methods in physics research section b" = - { "Nucl Instr and Meth B" } - 'skip$ - if$ - s "nuclear instruments and methods in physics research section b: beam interactions with materials and atoms" = - { "Nucl Instr and Meth B" } - 'skip$ - if$ - s "physical review c" = - { "Phys Rev C" } - 'skip$ - if$ - s "physical review d" = - { "Phys Rev D" } - 'skip$ - if$ - s "physical review e" = - { "Phys Rev E" } - 'skip$ - if$ - s "physics letters b" = - { "Phys Lett B" } - 'skip$ - if$ -% 's := s empty$ { t } @@ -2462,7 +2531,7 @@ FUNCTION {format.journal} if$ duplicate$ empty$ not { italic.journal entry.lang lang.en = and - 'italicize + 'emphasize 'skip$ if$ } @@ -2502,7 +2571,11 @@ FUNCTION {format.mark} 'skip$ if$ 'entry.mark := - "[" entry.mark * "]" * + space.before.mark + { " " } + { "\allowbreak" } + if$ + "[" * entry.mark * "]" * } { "" } if$ @@ -2669,21 +2742,6 @@ FUNCTION {extract.after.dash} if$ } -FUNCTION {contains.dash} -{ duplicate$ empty$ - { pop$ #0 } - { 's := - { s empty$ not - s #1 #1 substring$ "-" = not - and - } - { s #2 global.max$ substring$ 's := } - while$ - s empty$ not - } - if$ -} - FUNCTION {extract.before.slash} { duplicate$ empty$ { pop$ "" } @@ -2728,23 +2786,6 @@ FUNCTION {extract.after.slash} if$ } -FUNCTION {contains.slash} -{ duplicate$ empty$ - { pop$ #0 } - { 's := - { s empty$ not - s #1 #1 substring$ "-" = not - and - s #1 #1 substring$ "/" = not - and - } - { s #2 global.max$ substring$ 's := } - while$ - s empty$ not - } - if$ -} - % \end{macrocode} % % 著者-出版年制必须提取出年份 @@ -2793,11 +2834,16 @@ FUNCTION {format.periodical.year} % 专利和报纸都是使用日期而不是年 % \begin{macrocode} FUNCTION {format.date} -{ type$ "patent" = type$ "newspaper" = or - date empty$ not and - { date } - { year field.or.null - extra.label * +{ date empty$ not + { type$ "patent" = type$ "newspaper" = or + { date } + { format.year } + if$ + } + { year empty$ not + { format.year } + { "" } + if$ } if$ } @@ -2878,7 +2924,10 @@ FUNCTION {hyphenate} "" { t empty$ not } { t #1 #1 substring$ "-" = - { "-" * + { wave.dash.in.pages + { "~" * } + { "-" * } + if$ { t #1 #1 substring$ "-" = } { t #2 global.max$ substring$ 't := } while$ @@ -3232,9 +3281,9 @@ FUNCTION {monograph} { editor empty$ not { format.editors } { "empty author and editor in " cite$ * warning$ -%<*authoryear> +%<*author-year> bbl.anonymous -% +% %<*numerical> "" % @@ -3513,9 +3562,9 @@ FUNCTION {preprint} { editor empty$ not { format.editors } { "empty author and editor in " cite$ * warning$ -%<*authoryear> +%<*author-year> bbl.anonymous -% +% %<*numerical> "" % @@ -3536,9 +3585,9 @@ FUNCTION {preprint} new.block title.in.journal { format.series.vol.num.title "title" output.check -%<*2015> +%<*!2005> "Z" set.entry.mark -% +% %<*2005> "M" set.entry.mark % @@ -3588,9 +3637,9 @@ FUNCTION {misc} { entry.is.electronic 'electronic { -%<*2015> +%<*!2005> "Z" set.entry.mark -% +% %<*2005> "M" set.entry.mark % @@ -4131,9 +4180,18 @@ FUNCTION {calc.short.authors} if$ } +% \end{macrocode} +% +% 如果 label 中有中括号“[”,分别用大括号保护起来,防止 \cs{bibitem} 处理出错。 +% 另外为了兼容 \pkg{bibunits},“name(year)fullname” 的每一项都要分别保护起来, +% 参考 \href{https://github.com/tuna/thuthesis/issues/630}{tuna/thuthesis/\#630}。 +% \begin{macrocode} FUNCTION {calc.label} { calc.short.authors - short.list + short.list "]" contains + { "{" short.list * "}" * } + { short.list } + if$ "(" * format.year duplicate$ empty$ @@ -4141,6 +4199,10 @@ FUNCTION {calc.label} { pop$ "" } 'skip$ if$ + duplicate$ "]" contains + { "{" swap$ * "}" * } + 'skip$ + if$ * 'label := short.label @@ -4182,7 +4244,7 @@ FUNCTION {calc.label} % names in the format described above. The function is almost the same % as format.names. % \begin{macrocode} -%<*authoryear> +%<*author-year> FUNCTION {sort.language.label} { entry.lang lang.zh = { lang.zh.order } @@ -4332,7 +4394,7 @@ FUNCTION {editor.organization.sort} if$ } -% +% % \end{macrocode} % % 顺序编码制的排序要简单得多 @@ -4365,7 +4427,7 @@ FUNCTION {presort} label sortify " " * -%<*authoryear> +%<*author-year> sort.language.label " " * @@ -4391,7 +4453,7 @@ FUNCTION {presort} cite$ * #1 entry.max$ substring$ -% +% %<*numerical> seq.num #1 + 'seq.num := seq.num int.to.fix @@ -4602,7 +4664,7 @@ EXECUTE {begin.bib} ITERATE {call.type$} EXECUTE {end.bib} -% +% % \end{macrocode} % \end{environment} % diff --git a/biblio/bibtex/contrib/gbt7714/gbt7714.ins b/biblio/bibtex/contrib/gbt7714/gbt7714.ins index 130b045638..cb407faf80 100644 --- a/biblio/bibtex/contrib/gbt7714/gbt7714.ins +++ b/biblio/bibtex/contrib/gbt7714/gbt7714.ins @@ -7,9 +7,9 @@ ------------------------------------------------------------------- GB/T 7714—2015 BibTeX Style https://github.com/CTeX-org/gbt7714-bibtex-style -Version: 2020/12/17 v2.1 +Version: 2021/06/20 v2.1.2 ------------------------------------------------------------------- -Copyright (C) 2016-\the\year by Zeping Lee +Copyright (C) 2016—\the\year by Zeping Lee ------------------------------------------------------------------- This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c @@ -17,13 +17,13 @@ of this license or (at your option) any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX -version 2005/12/01 or later. +version 2008 or later. ------------------------------------------------------------------- \endpreamble \nopostamble \generate{ \file{gbt7714.sty}{\from{gbt7714.dtx}{package}} \file{gbt7714-numerical.bst}{\from{gbt7714.dtx}{2015,numerical}} - \file{gbt7714-author-year.bst}{\from{gbt7714.dtx}{2015,authoryear}} + \file{gbt7714-author-year.bst}{\from{gbt7714.dtx}{2015,author-year}} } \endbatchfile diff --git a/biblio/bibtex/contrib/gbt7714/gbt7714.pdf b/biblio/bibtex/contrib/gbt7714/gbt7714.pdf index a90b794bc3..0d029a13c6 100644 Binary files a/biblio/bibtex/contrib/gbt7714/gbt7714.pdf and b/biblio/bibtex/contrib/gbt7714/gbt7714.pdf differ -- cgit v1.2.3