texlive[59727] Master/texmf-dist: gbt7714 (27jun21)

commits+karl at tug.org commits+karl at tug.org
Sun Jun 27 22:59:54 CEST 2021


Revision: 59727
          http://tug.org/svn/texlive?view=revision&revision=59727
Author:   karl
Date:     2021-06-27 22:59:53 +0200 (Sun, 27 Jun 2021)
Log Message:
-----------
gbt7714 (27jun21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-author-year.bst
    trunk/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-numerical.bst
    trunk/Master/texmf-dist/doc/bibtex/gbt7714/CHANGELOG.md
    trunk/Master/texmf-dist/doc/bibtex/gbt7714/README.md
    trunk/Master/texmf-dist/doc/bibtex/gbt7714/gbt7714.pdf
    trunk/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx
    trunk/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.ins
    trunk/Master/texmf-dist/tex/latex/gbt7714/gbt7714.sty

Modified: trunk/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-author-year.bst
===================================================================
--- trunk/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-author-year.bst	2021-06-27 18:10:58 UTC (rev 59726)
+++ trunk/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-author-year.bst	2021-06-27 20:59:53 UTC (rev 59727)
@@ -4,13 +4,13 @@
 %%
 %% The original source files were:
 %%
-%% gbt7714.dtx  (with options: `2015,authoryear')
+%% gbt7714.dtx  (with options: `2015,author-year')
 %% -------------------------------------------------------------------
 %% 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-2020 by Zeping Lee <zepinglee AT gmail.com>
+%% Copyright (C) 2016—2021 by Zeping Lee <zepinglee AT gmail.com>
 %% -------------------------------------------------------------------
 %% This file may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3c
@@ -18,7 +18,7 @@
 %% 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.
 %% -------------------------------------------------------------------
 INTEGERS {
   citation.et.al.min
@@ -29,10 +29,12 @@
   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
@@ -42,6 +44,7 @@
   show.missing.address.publisher
   space.before.pages
   only.start.page
+  wave.dash.in.pages
   show.urldate
   show.url
   show.doi
@@ -48,6 +51,7 @@
   show.preprint
   show.note
   show.english.translation
+  end.with.period
   lang.zh.order
   lang.ja.order
   lang.en.order
@@ -65,10 +69,12 @@
   #0 'terms.in.macro :=
   #1 'year.after.author :=
   #0 'period.after.author :=
+  #0 'italic.book.title :=
   #1 'sentence.case.title :=
   #0 'link.title :=
   #1 'title.in.journal :=
   #1 'show.mark :=
+  #0 'space.before.mark :=
   #1 'show.medium.type :=
   #1 'slash.for.extraction :=
   #0 'in.booktitle :=
@@ -75,9 +81,10 @@
   #0 'short.journal :=
   #0 'italic.journal :=
   #0 'bold.journal.volume :=
-  #1 'show.missing.address.publisher :=
+  #0 'show.missing.address.publisher :=
   #1 'space.before.pages :=
   #0 'only.start.page :=
+  #0 'wave.dash.in.pages :=
   #1 'show.urldate :=
   #1 'show.url :=
   #1 'show.doi :=
@@ -84,6 +91,7 @@
   #0 'show.preprint :=
   #0 'show.note :=
   #0 'show.english.translation :=
+  #1 'end.with.period :=
   #1 'lang.zh.order :=
   #2 'lang.ja.order :=
   #3 'lang.en.order :=
@@ -248,6 +256,22 @@
   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 >
+}
+
 STRINGS { s t }
 
 FUNCTION {output.nonnull}
@@ -323,7 +347,10 @@
 }
 
 FUNCTION {fin.entry}
-{ add.period$
+{ end.with.period
+    'add.period$
+    'skip$
+  if$
   write$
   show.english.translation entry.lang lang.zh = and
     { ")"
@@ -410,13 +437,21 @@
   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$
+}
+
 INTEGERS { byte second.byte }
 
 INTEGERS { char.lang tmp.lang }
@@ -548,7 +583,7 @@
     { 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$
@@ -711,18 +746,14 @@
   "\bibitem[" write$
   label ")" *
   make.full.names duplicate$ short.list =
-     { pop$ }
-     { * }
+    { pop$ }
+    { duplicate$ "]" contains
+        { "{" swap$ * "}" * }
+        'skip$
+      if$
+      *
+    }
   if$
-  's :=
-  s text.length$ 'charptr :=
-    { charptr #0 > s charptr #1 substring$ "[" = not and }
-    { charptr #1 - 'charptr := }
-  while$
-  charptr #0 >
-    { "{" s * "}" * }
-    { s }
-  if$
   "]{" * write$
   cite$ write$
   "}" write$
@@ -903,6 +934,7 @@
     }
     { format.title.vol.num }
   if$
+  format.btitle
   link.title
     'add.link
     'skip$
@@ -934,6 +966,7 @@
     }
     { format.booktitle.vol.num }
   if$
+  format.btitle
   in.booktitle
     { duplicate$ empty$ not entry.lang lang.en = and
         { "In: " swap$ * }
@@ -1003,7 +1036,7 @@
   if$
   duplicate$ empty$ not
     { italic.journal entry.lang lang.en = and
-        'italicize
+        'emphasize
         'skip$
       if$
     }
@@ -1038,7 +1071,11 @@
         'skip$
       if$
       'entry.mark :=
-      "[" entry.mark * "]" *
+      space.before.mark
+        { " " }
+        { "\allowbreak" }
+      if$
+      "[" * entry.mark * "]" *
     }
     { "" }
   if$
@@ -1180,21 +1217,6 @@
   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$ "" }
@@ -1239,23 +1261,6 @@
   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$
-}
-
 FUNCTION {format.year}
 { year empty$ not
     { year extract.before.slash extra.label * }
@@ -1296,12 +1301,17 @@
 }
 
 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$
 }
 
@@ -1326,7 +1336,10 @@
   ""
     { t empty$ not }
     { t #1 #1 substring$ "-" =
-        { "-" *
+        { wave.dash.in.pages
+            { "~" * }
+            { "-" * }
+          if$
             { t #1 #1 substring$ "-" = }
             { t #2 global.max$ substring$ 't := }
           while$
@@ -2216,7 +2229,10 @@
 
 FUNCTION {calc.label}
 { calc.short.authors
-  short.list
+  short.list "]" contains
+    { "{" short.list * "}" * }
+    { short.list }
+  if$
   "("
   *
   format.year duplicate$ empty$
@@ -2224,6 +2240,10 @@
      { pop$ "" }
      'skip$
   if$
+  duplicate$ "]" contains
+    { "{" swap$ * "}" * }
+    'skip$
+  if$
   *
   'label :=
   short.label

Modified: trunk/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-numerical.bst
===================================================================
--- trunk/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-numerical.bst	2021-06-27 18:10:58 UTC (rev 59726)
+++ trunk/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-numerical.bst	2021-06-27 20:59:53 UTC (rev 59727)
@@ -8,9 +8,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-2020 by Zeping Lee <zepinglee AT gmail.com>
+%% Copyright (C) 2016—2021 by Zeping Lee <zepinglee AT gmail.com>
 %% -------------------------------------------------------------------
 %% This file may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3c
@@ -18,7 +18,7 @@
 %% 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.
 %% -------------------------------------------------------------------
 INTEGERS {
   citation.et.al.min
@@ -29,10 +29,12 @@
   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
@@ -42,6 +44,7 @@
   show.missing.address.publisher
   space.before.pages
   only.start.page
+  wave.dash.in.pages
   show.urldate
   show.url
   show.doi
@@ -48,6 +51,7 @@
   show.preprint
   show.note
   show.english.translation
+  end.with.period
 }
 
 FUNCTION {load.config}
@@ -60,10 +64,12 @@
   #0 'terms.in.macro :=
   #0 'year.after.author :=
   #1 'period.after.author :=
+  #0 'italic.book.title :=
   #1 'sentence.case.title :=
   #0 'link.title :=
   #1 'title.in.journal :=
   #1 'show.mark :=
+  #0 'space.before.mark :=
   #1 'show.medium.type :=
   #1 'slash.for.extraction :=
   #0 'in.booktitle :=
@@ -70,9 +76,10 @@
   #0 'short.journal :=
   #0 'italic.journal :=
   #0 'bold.journal.volume :=
-  #1 'show.missing.address.publisher :=
+  #0 'show.missing.address.publisher :=
   #1 'space.before.pages :=
   #0 'only.start.page :=
+  #0 'wave.dash.in.pages :=
   #1 'show.urldate :=
   #1 'show.url :=
   #1 'show.doi :=
@@ -79,6 +86,7 @@
   #0 'show.preprint :=
   #0 'show.note :=
   #0 'show.english.translation :=
+  #1 'end.with.period :=
 }
 
 ENTRY
@@ -238,6 +246,22 @@
   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 >
+}
+
 STRINGS { s t }
 
 FUNCTION {output.nonnull}
@@ -313,7 +337,10 @@
 }
 
 FUNCTION {fin.entry}
-{ add.period$
+{ end.with.period
+    'add.period$
+    'skip$
+  if$
   write$
   show.english.translation entry.lang lang.zh = and
     { ")"
@@ -400,13 +427,21 @@
   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$
+}
+
 INTEGERS { byte second.byte }
 
 INTEGERS { char.lang tmp.lang }
@@ -538,7 +573,7 @@
     { 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$
@@ -701,18 +736,14 @@
   "\bibitem[" write$
   label ")" *
   make.full.names duplicate$ short.list =
-     { pop$ }
-     { * }
+    { pop$ }
+    { duplicate$ "]" contains
+        { "{" swap$ * "}" * }
+        'skip$
+      if$
+      *
+    }
   if$
-  's :=
-  s text.length$ 'charptr :=
-    { charptr #0 > s charptr #1 substring$ "[" = not and }
-    { charptr #1 - 'charptr := }
-  while$
-  charptr #0 >
-    { "{" s * "}" * }
-    { s }
-  if$
   "]{" * write$
   cite$ write$
   "}" write$
@@ -893,6 +924,7 @@
     }
     { format.title.vol.num }
   if$
+  format.btitle
   link.title
     'add.link
     'skip$
@@ -924,6 +956,7 @@
     }
     { format.booktitle.vol.num }
   if$
+  format.btitle
   in.booktitle
     { duplicate$ empty$ not entry.lang lang.en = and
         { "In: " swap$ * }
@@ -993,7 +1026,7 @@
   if$
   duplicate$ empty$ not
     { italic.journal entry.lang lang.en = and
-        'italicize
+        'emphasize
         'skip$
       if$
     }
@@ -1028,7 +1061,11 @@
         'skip$
       if$
       'entry.mark :=
-      "[" entry.mark * "]" *
+      space.before.mark
+        { " " }
+        { "\allowbreak" }
+      if$
+      "[" * entry.mark * "]" *
     }
     { "" }
   if$
@@ -1170,21 +1207,6 @@
   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$ "" }
@@ -1229,23 +1251,6 @@
   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$
-}
-
 FUNCTION {format.year}
 { year empty$ not
     { year extract.before.slash extra.label * }
@@ -1286,12 +1291,17 @@
 }
 
 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$
 }
 
@@ -1316,7 +1326,10 @@
   ""
     { t empty$ not }
     { t #1 #1 substring$ "-" =
-        { "-" *
+        { wave.dash.in.pages
+            { "~" * }
+            { "-" * }
+          if$
             { t #1 #1 substring$ "-" = }
             { t #2 global.max$ substring$ 't := }
           while$
@@ -2206,7 +2219,10 @@
 
 FUNCTION {calc.label}
 { calc.short.authors
-  short.list
+  short.list "]" contains
+    { "{" short.list * "}" * }
+    { short.list }
+  if$
   "("
   *
   format.year duplicate$ empty$
@@ -2214,6 +2230,10 @@
      { pop$ "" }
      'skip$
   if$
+  duplicate$ "]" contains
+    { "{" swap$ * "}" * }
+    'skip$
+  if$
   *
   'label :=
   short.label

Modified: trunk/Master/texmf-dist/doc/bibtex/gbt7714/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/bibtex/gbt7714/CHANGELOG.md	2021-06-27 18:10:58 UTC (rev 59726)
+++ trunk/Master/texmf-dist/doc/bibtex/gbt7714/CHANGELOG.md	2021-06-27 20:59:53 UTC (rev 59727)
@@ -5,6 +5,26 @@
 
 ## [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 @@
 ### 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

Modified: trunk/Master/texmf-dist/doc/bibtex/gbt7714/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/bibtex/gbt7714/README.md	2021-06-27 18:10:58 UTC (rev 59726)
+++ trunk/Master/texmf-dist/doc/bibtex/gbt7714/README.md	2021-06-27 20:59:53 UTC (rev 59727)
@@ -34,7 +34,7 @@
 
 ## 版本 v2.0 的重要修改
 
-从 v2.0 版本开始(2020-03-04),用户必须在文档中使用 `\biblilographystyle` 命令选择参考文献样式,
+从 v2.0 版本开始(2020-03-04),用户必须在文档中使用 `\bibliographystyle` 命令选择参考文献样式,
 如 `gbt7714-numerical` 或 `gbt7714-author-year`。
 在早期的版本中,选择文献样式的方法是将 `numbers` 或 `super` 等参数传递给 `gbt7714`,
 而不能使用 `\bibliographystyle`。

Modified: trunk/Master/texmf-dist/doc/bibtex/gbt7714/gbt7714.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx
===================================================================
--- trunk/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx	2021-06-27 18:10:58 UTC (rev 59726)
+++ trunk/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx	2021-06-27 20:59:53 UTC (rev 59727)
@@ -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 <zepinglee AT gmail.com>
+% Copyright (C) 2016—2021 by Zeping Lee <zepinglee AT gmail.com>
 %
 % This file may be distributed and/or modified under the
 % conditions of the LaTeX Project Public License, either version 1.3c
@@ -10,7 +10,7 @@
 % 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
 %
@@ -17,7 +17,7 @@
 % \iffalse
 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
 %<package>\ProvidesPackage{gbt7714}
-%<package>  [2020/12/17 v2.1 GB/T 7714—2015 BibTeX Style]
+%<package>  [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 at 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 at citesuper[3]{\ifNAT at swa
-  \if*#2*\else#2\NAT at spacechar\fi
-  % \unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close}%
-  %  \if*#3*\else\NAT at 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 at citesuper[3]{%
+  \ifNAT at swa
+    \if*#2*\else
+      #2\NAT at spacechar
+    \fi
+    % \unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close}%
+    %  \if*#3*\else\NAT at 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 at citenum%
-    [3]{\ifNAT at swa\NAT@@open\if*#2*\else#2\NAT at spacechar\fi
-        % #1\if*#3*\else\NAT at cmt#3\fi\NAT@@close\else#1\fi\endgroup}
-        #1\NAT@@close\textsuperscript{\if*#3*\else#3\fi}\else#1\fi\endgroup}
+\renewcommand\NAT at citenum[3]{%
+  \ifNAT at swa
+    \NAT@@open
+    \if*#2*\else
+      #2\NAT at spacechar
+    \fi
+    % #1\if*#3*\else\NAT at 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 at mbox{\NAT@@close}%
         \@ifnum{\NAT at ctype=\z@}{%
-          \if*#2*\else\textsuperscript{#2}\fi
+          \if*#2*\else
+            \textsuperscript{#2}%
+          \fi
         }{}%
+        \NAT at 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 @@
   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,6 +862,7 @@
   show.missing.address.publisher
   space.before.pages
   only.start.page
+  wave.dash.in.pages
   show.urldate
   show.url
   show.doi
@@ -824,13 +869,14 @@
   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
-%</authoryear>
+%</author-year>
 }
 
 %    \end{macrocode}
@@ -859,12 +905,12 @@
 %
 % 英文姓名转为全大写:
 %    \begin{macrocode}
-%<*!(nouppercase|thu)>
+%<*!(no-uppercase|thu)>
   #1 'uppercase.name :=
-%</!(nouppercase|thu)>
-%<*nouppercase|thu>
+%</!(no-uppercase|thu)>
+%<*no-uppercase|thu>
   #0 'uppercase.name :=
-%</nouppercase|thu>
+%</no-uppercase|thu>
 %    \end{macrocode}
 %
 % 使用 TeX 宏输出“和”、“等”
@@ -882,9 +928,9 @@
 %<*numerical|ucas>
   #0 'year.after.author :=
 %</numerical|ucas>
-%<*authoryear&!ucas>
+%<*author-year&!ucas>
   #1 'year.after.author :=
-%</authoryear&!ucas>
+%</author-year&!ucas>
 %    \end{macrocode}
 %
 % 采用著者-出版年制时,作者姓名与年份之间使用句点连接:
@@ -892,74 +938,94 @@
 %<*numerical>
   #1 'period.after.author :=
 %</numerical>
-%<*authoryear>
-%<*2015&!(period|thu|ustc)>
+%<*author-year>
+%<*2015&!(period|ustc)>
   #0 'period.after.author :=
-%</2015&!(period|thu|ustc)>
-%<*period|2005|thu|ustc>
+%</2015&!(period|ustc)>
+%<*period|2005|ustc>
   #1 'period.after.author :=
-%</period|2005|thu|ustc>
-%</authoryear>
+%</period|2005|ustc>
+%</author-year>
 %    \end{macrocode}
 %
+% 书名使用斜体:
+%    \begin{macrocode}
+%<*!italic-book-title>
+  #0 'italic.book.title :=
+%</!italic-book-title>
+%<*italic-book-title>
+  #1 'italic.book.title :=
+%</italic-book-title>
+%    \end{macrocode}
+%
 % 英文标题转为 sentence case (句首字母大写,其余小写):
-%<*!nosentencecase>
 %    \begin{macrocode}
-%</!nosentencecase>
+%<*!no-sentence-case>
   #1 'sentence.case.title :=
-%<*nosentencecase>
+%</!no-sentence-case>
+%<*no-sentence-case>
   #0 'sentence.case.title :=
-%</nosentencecase>
+%</no-sentence-case>
 %    \end{macrocode}
 %
 % 在标题添加超链接:
 %    \begin{macrocode}
-%<*!linktitle>
+%<*!link-title>
   #0 'link.title :=
-%</!linktitle>
-%<*linktitle>
+%</!link-title>
+%<*link-title>
   #1 'link.title :=
-%</linktitle>
+%</link-title>
 %    \end{macrocode}
 %
 % 期刊是否含标题:
 %    \begin{macrocode}
-%<*!(title-in-journal|npr)>
+%<*!no-title-in-journal>
   #1 'title.in.journal :=
-%</!(title-in-journal|npr)>
-%<*title-in-journal|npr>
+%</!no-title-in-journal>
+%<*no-title-in-journal>
   #0 'title.in.journal :=
-%</title-in-journal|npr>
+%</no-title-in-journal>
 %    \end{macrocode}
 %
 % 著录文献类型标识(比如“[M/OL]“):
 %    \begin{macrocode}
-%<*!nomark>
+%<*!no-mark>
   #1 'show.mark :=
-%</!nomark>
-%<*nomark>
+%</!no-mark>
+%<*no-mark>
   #0 'show.mark :=
-%</nomark>
+%</no-mark>
 %    \end{macrocode}
 %
+% 文献类型标识前是否有空格:
+%    \begin{macrocode}
+%<*!space-before-mark>
+  #0 'space.before.mark :=
+%</!space-before-mark>
+%<*space-before-mark>
+  #1 'space.before.mark :=
+%</space-before-mark>
+%    \end{macrocode}
+%
 % 是否显示载体类型标识(比如“/OL“):
 %    \begin{macrocode}
-%<*!no.medium.type>
+%<*!no-medium-type>
   #1 'show.medium.type :=
-%</!no.medium.type>
-%<*no.medium.type>
+%</!no-medium-type>
+%<*no-medium-type>
   #0 'show.medium.type :=
-%</no.medium.type>
+%</no-medium-type>
 %    \end{macrocode}
 %
 % 使用“//”表示析出文献
 %    \begin{macrocode}
-%<*!noslash>
+%<*!no-slash>
   #1 'slash.for.extraction :=
-%</!noslash>
-%<*noslash>
+%</!no-slash>
+%<*no-slash>
   #0 'slash.for.extraction :=
-%</noslash>
+%</no-slash>
 %    \end{macrocode}
 %
 % 使用“In:”表示析出文献
@@ -969,22 +1035,22 @@
 %
 % 期刊名使用缩写:
 %    \begin{macrocode}
-%<*!(short-journal|npr)>
+%<*!short-journal>
   #0 'short.journal :=
-%</!(short-journal|npr)>
-%<*short-journal|npr>
+%</!short-journal>
+%<*short-journal>
   #1 'short.journal :=
-%</short-journal|npr>
+%</short-journal>
 %    \end{macrocode}
 %
 % 期刊名使用斜体:
 %    \begin{macrocode}
-%<*!italicjournal>
+%<*!italic-journal>
   #0 'italic.journal :=
-%</!italicjournal>
-%<*italicjournal>
+%</!italic-journal>
+%<*italic-journal>
   #1 'italic.journal :=
-%</italicjournal>
+%</italic-journal>
 %    \end{macrocode}
 %
 % 期刊的卷使用粗体:
@@ -994,34 +1060,44 @@
 %
 % 无出版地或出版者时,著录“出版地不详”,“出版者不详”,“S.l.” 或 “s.n.”:
 %    \begin{macrocode}
-%<*!(noslsn|thu|ustc|ucas|npr)>
+%<*!sl-sn>
+  #0 'show.missing.address.publisher :=
+%</!sl-sn>
+%<*sl-sn>
   #1 'show.missing.address.publisher :=
-%</!(noslsn|thu|ustc|ucas|npr)>
-%<*noslsn|thu|ustc|ucas|npr>
-  #0 'show.missing.address.publisher :=
-%</noslsn|thu|ustc|ucas|npr>
+%</sl-sn>
 %    \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|thu>
+%</!no-space-before-pages>
+%<*no-space-before-pages>
   #0 'space.before.pages :=
-%</no-space-before-pages|thu>
+%</no-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|npr>
+%</!only-start-page>
+%<*only-start-page>
   #1 'only.start.page :=
-%</only-start-page|npr>
+%</only-start-page>
 %    \end{macrocode}
 %
+% 起止页码使用波浪号:
+%    \begin{macrocode}
+%<*!wave-dash-in-pages>
+  #0 'wave.dash.in.pages :=
+%</!wave-dash-in-pages>
+%<*wave-dash-in-pages>
+  #1 'wave.dash.in.pages :=
+%</wave-dash-in-pages>
+%    \end{macrocode}
+%
 % 是否著录非电子文献的引用日期:
 %    \begin{macrocode}
 %<*!no-urldate>
@@ -1034,32 +1110,32 @@
 %
 % 是否著录 URL:
 %    \begin{macrocode}
-%<*!nourl>
+%<*!no-url>
   #1 'show.url :=
-%</!nourl>
-%<*nourl>
+%</!no-url>
+%<*no-url>
   #0 'show.url :=
-%</nourl>
+%</no-url>
 %    \end{macrocode}
 %
 % 是否著录 DOI:
 %    \begin{macrocode}
-%<*!nodoi&2015>
+%<*!(no-doi|2005)>
   #1 'show.doi :=
-%</!nodoi&2015>
-%<*nodoi|2005>
+%</!(no-doi|2005)>
+%<*no-doi|2005>
   #0 'show.doi :=
-%</nodoi|2005>
+%</no-doi|2005>
 %    \end{macrocode}
 %
 % 是否著录 e-print:
 %    \begin{macrocode}
-%<*!(preprint|npr)>
+%<*!preprint>
   #0 'show.preprint :=
-%</!(preprint|npr)>
-%<*preprint|npr>
+%</!preprint>
+%<*preprint>
   #1 'show.preprint :=
-%</preprint|npr>
+%</preprint>
 %    \end{macrocode}
 %
 % 在每一条文献最后输出注释(note)的内容:
@@ -1069,23 +1145,33 @@
 %
 % 中文文献是否显示英文翻译
 %    \begin{macrocode}
-%<*!(show-english-translation|npr)>
+%<*!show-english-translation>
   #0 'show.english.translation :=
-%</!(show-english-translation|npr)>
-%<*show-english-translation|npr>
+%</!show-english-translation>
+%<*show-english-translation>
   #1 'show.english.translation :=
-%</show-english-translation|npr>
+%</show-english-translation>
 %    \end{macrocode}
 %
+% 结尾加句点
+%    \begin{macrocode}
+%<*!no-period-at-end>
+  #1 'end.with.period :=
+%</!no-period-at-end>
+%<*no-period-at-end>
+  #0 'end.with.period :=
+%</no-period-at-end>
+%    \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 :=
-%</authoryear>
+%</author-year>
 }
 
 %    \end{macrocode}
@@ -1382,9 +1468,9 @@
   if$
 }
 
-%<*2015>
+%<*!2005>
 FUNCTION {bbl.wide.space} { "\quad " }
-%</2015>
+%</!2005>
 %<*2005>
 FUNCTION {bbl.wide.space} { "\ " }
 %</2005>
@@ -1437,6 +1523,22 @@
   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 @@
 %
 %    \begin{macrocode}
 FUNCTION {fin.entry}
-{ add.period$
+{ end.with.period
+    'add.period$
+    'skip$
+  if$
   write$
   show.english.translation entry.lang lang.zh = and
     { ")"
@@ -1659,13 +1764,21 @@
   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$
+}
+
 %    \end{macrocode}
 %
 % \subsubsection{Detect Language}
@@ -1898,7 +2011,7 @@
     { 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 @@
 { author empty$ not
     { author format.names }
     { "empty author in " cite$ * warning$
-%<*authoryear>
+%<*author-year>
       bbl.anonymous
-%</authoryear>
+%</author-year>
 %<*numerical>
       ""
 %</numerical>
@@ -2066,18 +2179,14 @@
   "\bibitem[" write$
   label ")" *
   make.full.names duplicate$ short.list =
-     { pop$ }
-     { * }
+    { pop$ }
+    { duplicate$ "]" contains
+        { "{" swap$ * "}" * }
+        'skip$
+      if$
+      *
+    }
   if$
-  's :=
-  s text.length$ 'charptr :=
-    { charptr #0 > s charptr #1 substring$ "[" = not and }
-    { charptr #1 - 'charptr := }
-  while$
-  charptr #0 >
-    { "{" s * "}" * }
-    { s }
-  if$
   "]{" * write$
   cite$ write$
   "}" write$
@@ -2317,6 +2426,7 @@
     }
     { format.title.vol.num }
   if$
+  format.btitle
   link.title
     'add.link
     'skip$
@@ -2351,6 +2461,7 @@
     }
     { format.booktitle.vol.num }
   if$
+  format.btitle
   in.booktitle
     { duplicate$ empty$ not entry.lang lang.en = and
         { "In: " swap$ * }
@@ -2385,48 +2496,6 @@
     { "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$
-%</npr>
   's :=
   s empty$
     { t }
@@ -2462,7 +2531,7 @@
   if$
   duplicate$ empty$ not
     { italic.journal entry.lang lang.en = and
-        'italicize
+        'emphasize
         'skip$
       if$
     }
@@ -2502,7 +2571,11 @@
         'skip$
       if$
       'entry.mark :=
-      "[" entry.mark * "]" *
+      space.before.mark
+        { " " }
+        { "\allowbreak" }
+      if$
+      "[" * entry.mark * "]" *
     }
     { "" }
   if$
@@ -2669,21 +2742,6 @@
   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 @@
   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,12 +2834,17 @@
 % 专利和报纸都是使用日期而不是年
 %    \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 @@
   ""
     { 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 @@
     { editor empty$ not
         { format.editors }
         { "empty author and editor in " cite$ * warning$
-%<*authoryear>
+%<*author-year>
           bbl.anonymous
-%</authoryear>
+%</author-year>
 %<*numerical>
           ""
 %</numerical>
@@ -3513,9 +3562,9 @@
     { editor empty$ not
         { format.editors }
         { "empty author and editor in " cite$ * warning$
-%<*authoryear>
+%<*author-year>
           bbl.anonymous
-%</authoryear>
+%</author-year>
 %<*numerical>
           ""
 %</numerical>
@@ -3536,9 +3585,9 @@
   new.block
   title.in.journal
     { format.series.vol.num.title "title" output.check
-%<*2015>
+%<*!2005>
       "Z" set.entry.mark
-%</2015>
+%</!2005>
 %<*2005>
       "M" set.entry.mark
 %</2005>
@@ -3588,9 +3637,9 @@
                 { entry.is.electronic
                     'electronic
                     {
-%<*2015>
+%<*!2005>
                       "Z" set.entry.mark
-%</2015>
+%</!2005>
 %<*2005>
                       "M" set.entry.mark
 %</2005>
@@ -4131,9 +4180,18 @@
   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 @@
      { pop$ "" }
      'skip$
   if$
+  duplicate$ "]" contains
+    { "{" swap$ * "}" * }
+    'skip$
+  if$
   *
   'label :=
   short.label
@@ -4182,7 +4244,7 @@
 % 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 @@
   if$
 }
 
-%</authoryear>
+%</author-year>
 %    \end{macrocode}
 %
 % 顺序编码制的排序要简单得多
@@ -4365,7 +4427,7 @@
   label sortify
   "    "
   *
-%<*authoryear>
+%<*author-year>
   sort.language.label
   "    "
   *
@@ -4391,7 +4453,7 @@
   cite$
   *
   #1 entry.max$ substring$
-%</authoryear>
+%</author-year>
 %<*numerical>
   seq.num #1 + 'seq.num :=
   seq.num  int.to.fix
@@ -4602,7 +4664,7 @@
 ITERATE {call.type$}
 
 EXECUTE {end.bib}
-%</authoryear|numerical>
+%</author-year|numerical>
 %    \end{macrocode}
 % \end{environment}
 %

Modified: trunk/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.ins
===================================================================
--- trunk/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.ins	2021-06-27 18:10:58 UTC (rev 59726)
+++ trunk/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.ins	2021-06-27 20:59:53 UTC (rev 59727)
@@ -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 <zepinglee AT gmail.com>
+Copyright (C) 2016—\the\year by Zeping Lee <zepinglee AT gmail.com>
 -------------------------------------------------------------------
 This file may be distributed and/or modified under the
 conditions of the LaTeX Project Public License, either version 1.3c
@@ -17,7 +17,7 @@
 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
@@ -24,6 +24,6 @@
 \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

Modified: trunk/Master/texmf-dist/tex/latex/gbt7714/gbt7714.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/gbt7714/gbt7714.sty	2021-06-27 18:10:58 UTC (rev 59726)
+++ trunk/Master/texmf-dist/tex/latex/gbt7714/gbt7714.sty	2021-06-27 20:59:53 UTC (rev 59727)
@@ -8,9 +8,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-2020 by Zeping Lee <zepinglee AT gmail.com>
+%% Copyright (C) 2016—2021 by Zeping Lee <zepinglee AT gmail.com>
 %% -------------------------------------------------------------------
 %% This file may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either version 1.3c
@@ -18,11 +18,11 @@
 %% 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.
 %% -------------------------------------------------------------------
 \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]
 \newif\ifgbt at legacy@interface
 \newif\ifgbt at mmxv
 \newif\ifgbt at numerical
@@ -57,11 +57,11 @@
   \gbt at legacy@interfacetrue
   \gbt at numericalfalse
 }
-\PassOptionsToPackage{compress}{natbib}
 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{natbib}}
 \ProcessOptions\relax
 \RequirePackage{natbib}
 \RequirePackage{url}
+\def\NAT at cmprs{\@ne}
 \renewcommand\newblock{\space}
 \newcommand\bibstyle at super{\bibpunct{[}{]}{,}{s}{,}{\textsuperscript{,}}}
 \newcommand\bibstyle at numbers{\bibpunct{[}{]}{,}{n}{,}{,}}
@@ -71,16 +71,44 @@
 \@namedef{bibstyle at gbt7714-author-year}{\bibstyle at authoryear}
 \@namedef{bibstyle at gbt7714-2005-numerical}{\bibstyle at super}
 \@namedef{bibstyle at gbt7714-2005-author-year}{\bibstyle at authoryear}
-\renewcommand\NAT at citesuper[3]{\ifNAT at swa
-  \if*#2*\else#2\NAT at spacechar\fi
-  % \unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close}%
-  %  \if*#3*\else\NAT at 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 at citenum%
-    [3]{\ifNAT at swa\NAT@@open\if*#2*\else#2\NAT at spacechar\fi
-        % #1\if*#3*\else\NAT at cmt#3\fi\NAT@@close\else#1\fi\endgroup}
-        #1\NAT@@close\textsuperscript{\if*#3*\else#3\fi}\else#1\fi\endgroup}
+\renewcommand\NAT at citesuper[3]{%
+  \ifNAT at swa
+    \if*#2*\else
+      #2\NAT at spacechar
+    \fi
+    % \unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close}%
+    %  \if*#3*\else\NAT at 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
+}
+\renewcommand\NAT at citenum[3]{%
+  \ifNAT at swa
+    \NAT@@open
+    \if*#2*\else
+      #2\NAT at spacechar
+    \fi
+    % #1\if*#3*\else\NAT at cmt#3\fi\NAT@@close\else#1\fi\endgroup}
+    #1\NAT@@close
+    \if*#3*\else
+      \textsuperscript{#3}%
+    \fi
+  \else
+    #1%
+  \fi
+  \endgroup
+}
 \def\NAT at citexnum[#1][#2]#3{%
   \NAT at reset@parser
   \NAT at sort@cites{#3}%
@@ -161,8 +189,11 @@
         % }{}%
         \NAT at mbox{\NAT@@close}%
         \@ifnum{\NAT at ctype=\z@}{%
-          \if*#2*\else\textsuperscript{#2}\fi
+          \if*#2*\else
+            \textsuperscript{#2}%
+          \fi
         }{}%
+        \NAT at super@kern
       \fi
   }{#1}{#2}%
 }%



More information about the tex-live-commits mailing list.