From b3cf6973881fee79b4abb0be96dcfd5330bfeeea Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Fri, 10 Jul 2020 03:02:35 +0000
Subject: CTAN sync 202007100302

---
 .../latex/contrib/thuthesis/thuthesis-numeric.bst  | 331 +++++++++++++++++----
 1 file changed, 267 insertions(+), 64 deletions(-)

(limited to 'macros/latex/contrib/thuthesis/thuthesis-numeric.bst')

diff --git a/macros/latex/contrib/thuthesis/thuthesis-numeric.bst b/macros/latex/contrib/thuthesis/thuthesis-numeric.bst
index c8cd10f4b8..234b065a7d 100644
--- a/macros/latex/contrib/thuthesis/thuthesis-numeric.bst
+++ b/macros/latex/contrib/thuthesis/thuthesis-numeric.bst
@@ -1,5 +1,5 @@
 %%
-%% This is file `versions/thu/thuthesis-numeric.bst',
+%% This is file `variants/thu/thuthesis-numeric.bst',
 %% generated with the docstrip utility.
 %%
 %% The original source files were:
@@ -8,9 +8,9 @@
 %% -------------------------------------------------------------------
 %% GB/T 7714-2015 BibTeX Style
 %% https://github.com/CTeX-org/gbt7714-bibtex-style
-%% Version: 2019/03/21 v1.1.1
+%% Version: 2020/06/08 v2.0.2
 %% -------------------------------------------------------------------
-%% Copyright (C) 2016-2019 by Zeping Lee <zepinglee AT gmail.com>
+%% Copyright (C) 2016-2020 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
@@ -26,15 +26,23 @@ INTEGERS {
   period.between.author.year
   sentence.case.title
   link.title
+  title.in.journal
   show.mark
+  space.before.mark
+  show.medium.type
   slash.for.extraction
   in.booktitle
-  italic.jounal
+  abbreviate.journal
+  italic.journal
   bold.journal.volume
   show.missing.address.publisher
+  only.start.page
+  show.urldate
   show.url
   show.doi
+  show.preprint
   show.note
+  show.english.translation
 }
 
 FUNCTION {load.config}
@@ -43,25 +51,35 @@ FUNCTION {load.config}
   #3 'max.num.authors :=
   #1 'sentence.case.title :=
   #0 'link.title :=
+  #1 'title.in.journal :=
   #1 'show.mark :=
+  #1 'space.before.mark :=
+  #1 'show.medium.type :=
   #1 'slash.for.extraction :=
   #0 'in.booktitle :=
-  #0 'italic.jounal :=
+  #0 'abbreviate.journal :=
+  #0 'italic.journal :=
   #0 'bold.journal.volume :=
   #0 'show.missing.address.publisher :=
+  #0 'only.start.page :=
+  #1 'show.urldate :=
   #1 'show.url :=
   #0 'show.doi :=
+  #0 'show.preprint :=
   #0 'show.note :=
+  #0 'show.english.translation :=
 }
 
 ENTRY
   { address
+    archivePrefix
     author
     booktitle
     date
     doi
     edition
     editor
+    eprint
     howpublished
     institution
     journal
@@ -77,13 +95,14 @@ ENTRY
     school
     series
     title
+    translation
     translator
     url
     urldate
     volume
     year
   }
-  { entry.lang entry.is.electronic entry.numbered }
+  { entry.lang entry.is.electronic is.pure.electronic entry.numbered }
   { label extra.label sort.label short.list entry.mark entry.url }
 
 INTEGERS { output.state before.all mid.sentence after.sentence after.block after.slash }
@@ -259,6 +278,12 @@ FUNCTION {output.check}
 FUNCTION {fin.entry}
 { add.period$
   write$
+  show.english.translation entry.lang lang.zh = and
+    { ")"
+      write$
+    }
+    'skip$
+  if$
   newline$
 }
 
@@ -463,15 +488,20 @@ FUNCTION {format.names}
 { 's :=
   #1 'nameptr :=
   s num.names$ 'numnames :=
+  ""
   numnames 'namesleft :=
     { namesleft #0 > }
     { s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't :=
+      nameptr #1 >
+        { ", " * }
+        'skip$
+      if$
       nameptr max.num.authors >
-        { bbl.et.al
+        { bbl.et.al *
           #1 'namesleft :=
         }
         { t "others" =
-            { bbl.et.al }
+            { bbl.et.al * }
             { t get.str.lang 'name.lang :=
               name.lang lang.en =
                 { t #1 "{vv~}{ll}{~f{~}}" format.name$
@@ -483,14 +513,11 @@ FUNCTION {format.names}
                 }
                 { t #1 "{ll}{ff}" format.name$ }
               if$
+              *
             }
           if$
         }
       if$
-      nameptr #1 >
-        { ", " swap$ * * }
-        'skip$
-      if$
       nameptr #1 + 'nameptr :=
       namesleft #1 - 'namesleft :=
     }
@@ -850,12 +877,51 @@ FUNCTION {format.series.vol.num.booktitle}
   if$
 }
 
-FUNCTION {format.journal}
-{ journal
-  italic.jounal entry.lang lang.en = and
-    'italicize
+FUNCTION {remove.period}
+{ 't :=
+  "" 's :=
+    { t empty$ not }
+    { t #1 #1 substring$ 'tmp.str :=
+      tmp.str "." = not
+        { s tmp.str * 's := }
+        'skip$
+      if$
+      t #2 global.max$ substring$ 't :=
+    }
+  while$
+  s
+}
+
+FUNCTION {abbreviate}
+{ remove.period
+  't :=
+  t "l" change.case$ 's :=
+  ""
+  s "physical review letters" =
+    { "Phys Rev Lett" }
     'skip$
   if$
+  's :=
+  s empty$
+    { t }
+    { pop$ s }
+  if$
+}
+
+FUNCTION {format.journal}
+{ journal empty$ not
+    { journal
+      abbreviate.journal
+        'abbreviate
+        'skip$
+      if$
+      italic.journal entry.lang lang.en = and
+        'italicize
+        'skip$
+      if$
+    }
+    { "" }
+  if$
 }
 
 FUNCTION {set.entry.mark}
@@ -874,15 +940,24 @@ FUNCTION {format.mark}
   type$ "phdthesis" = type$ "mastersthesis" = or type$ "patent" = or
   medium empty$ not or entry.is.electronic or
   and
-    { medium empty$ not
-        { entry.mark "/" * medium * 'entry.mark := }
-        { entry.is.electronic
-            { entry.mark "/OL" * 'entry.mark := }
-            'skip$
+    { entry.mark
+      show.medium.type
+        { medium empty$ not
+            { "/" * medium * }
+            { entry.is.electronic
+                { "/OL" * }
+                'skip$
+              if$
+            }
           if$
         }
+        'skip$
+      if$
+      'entry.mark :=
+      space.before.mark
+        { " [" entry.mark * "]" * }
+        { "\allowbreak[" entry.mark * "]" * }
       if$
-      " [" entry.mark * "]" *
     }
     { "" }
   if$
@@ -1064,7 +1139,9 @@ FUNCTION {format.editdate}
 }
 
 FUNCTION {format.urldate}
-{ urldate empty$ not entry.is.electronic and
+{ urldate empty$ not
+  show.urldate show.url and is.pure.electronic or and
+  url empty$ not and
     { "\allowbreak[" urldate * "]" * }
     { "" }
   if$
@@ -1095,6 +1172,18 @@ FUNCTION {format.pages}
   if$
 }
 
+FUNCTION {format.extracted.pages}
+{ pages empty$
+    { "" }
+    { pages
+      only.start.page
+        'extract.before.dash
+        'hyphenate
+      if$
+    }
+  if$
+}
+
 FUNCTION {format.journal.volume}
 { volume empty$ not
     { bold.journal.volume
@@ -1116,7 +1205,9 @@ FUNCTION {format.journal.number}
 FUNCTION {format.journal.pages}
 { pages empty$
     { "" }
-    { ":\penalty0 " pages hyphenate * }
+    { ": "
+      format.extracted.pages *
+    }
   if$
 }
 
@@ -1188,9 +1279,15 @@ FUNCTION {check.url}
 }
 
 FUNCTION {format.url}
+{ entry.url
+}
+
+FUNCTION {output.url}
 { entry.url empty$ not
-    { new.block entry.url }
-    { "" }
+    { new.block
+      entry.url output
+    }
+    'skip$
   if$
 }
 
@@ -1224,7 +1321,7 @@ FUNCTION {is.in.url}
 
 FUNCTION {format.doi}
 { ""
-  doi empty$ not show.doi and
+  doi empty$ not
     { "" 's :=
       doi 't :=
       #0 'numnames :=
@@ -1252,11 +1349,16 @@ FUNCTION {format.doi}
           t #2 global.max$ substring$ 't :=
         }
       while$
-      's :=
-      s empty$ not
-        { new.block s }
-        { "" }
-      if$
+    }
+    'skip$
+  if$
+}
+
+FUNCTION {output.doi}
+{ doi empty$ not show.doi and
+  show.english.translation entry.lang lang.zh = and not and
+    { new.block
+      format.doi output
     }
     'skip$
   if$
@@ -1281,6 +1383,27 @@ FUNCTION {check.electronic}
   if$
 }
 
+FUNCTION {format.eprint}
+{ ""
+  archivePrefix empty$ not
+    { archivePrefix * ": " *
+      "\eprint{https://" *
+      archivePrefix "l" change.case$ * ".org/abs/" * eprint * "}{" *
+      eprint * "}" *
+    }
+    { eprint }
+  if$
+}
+
+FUNCTION {output.eprint}
+{ show.preprint eprint empty$ not and
+    { new.block
+      format.eprint output
+    }
+    'skip$
+  if$
+}
+
 FUNCTION {format.note}
 { note empty$ not show.note and
     { note }
@@ -1288,6 +1411,30 @@ FUNCTION {format.note}
   if$
 }
 
+FUNCTION {output.translation}
+{ show.english.translation entry.lang lang.zh = and
+    { translation empty$ not
+        { translation }
+        { "[English translation missing!]" }
+      if$
+      " (in Chinese)" * output
+      write$
+      format.doi duplicate$ empty$ not
+        { newline$
+          write$
+        }
+        'pop$
+      if$
+      " \\" write$
+      newline$
+      "(" write$
+      ""
+      before.all 'output.state :=
+    }
+    'skip$
+  if$
+}
+
 FUNCTION {empty.misc.check}
 { author empty$ title empty$
   year empty$
@@ -1300,6 +1447,7 @@ FUNCTION {empty.misc.check}
 
 FUNCTION {monograph}
 { output.bibitem
+  output.translation
   author empty$ not
     { format.authors }
     { editor empty$ not
@@ -1324,8 +1472,8 @@ FUNCTION {monograph}
   format.year "year" output.check
   format.pages bbl.colon output.after
   format.urldate "" output.after
-  format.url output
-  format.doi output
+  output.url
+  output.doi
   new.block
   format.note output
   fin.entry
@@ -1333,6 +1481,7 @@ FUNCTION {monograph}
 
 FUNCTION {incollection}
 { output.bibitem
+  output.translation
   format.authors output
   author format.key output
   new.block
@@ -1350,10 +1499,10 @@ FUNCTION {incollection}
   new.block
   format.address.publisher output
   format.year "year" output.check
-  format.pages bbl.colon output.after
+  format.extracted.pages bbl.colon output.after
   format.urldate "" output.after
-  format.url output
-  format.doi output
+  output.url
+  output.doi
   new.block
   format.note output
   fin.entry
@@ -1361,6 +1510,7 @@ FUNCTION {incollection}
 
 FUNCTION {periodical}
 { output.bibitem
+  output.translation
   format.authors output
   author format.key output
   new.block
@@ -1373,8 +1523,8 @@ FUNCTION {periodical}
   format.address.publisher output
   format.date "year" output.check
   format.urldate "" output.after
-  format.url output
-  format.doi output
+  output.url
+  output.doi
   new.block
   format.note output
   fin.entry
@@ -1382,21 +1532,26 @@ FUNCTION {periodical}
 
 FUNCTION {article}
 { output.bibitem
+  output.translation
   format.authors output
   author format.key output
   new.block
-  format.title "title" output.check
-  "J" set.entry.mark
-  format.mark "" output.after
-  new.block
+  title.in.journal
+    { format.title "title" output.check
+      "J" set.entry.mark
+      format.mark "" output.after
+      new.block
+    }
+    'skip$
+  if$
   format.journal "journal" output.check
   format.date "year" output.check
   format.journal.volume output
   format.journal.number "" output.after
   format.journal.pages "" output.after
   format.urldate "" output.after
-  format.url output
-  format.doi output
+  output.url
+  output.doi
   new.block
   format.note output
   fin.entry
@@ -1404,6 +1559,7 @@ FUNCTION {article}
 
 FUNCTION {patent}
 { output.bibitem
+  output.translation
   format.authors output
   author format.key output
   new.block
@@ -1413,8 +1569,8 @@ FUNCTION {patent}
   new.block
   format.date "year" output.check
   format.urldate "" output.after
-  format.url output
-  format.doi output
+  output.url
+  output.doi
   new.block
   format.note output
   fin.entry
@@ -1423,7 +1579,9 @@ FUNCTION {patent}
 FUNCTION {electronic}
 { #1 #1 check.electronic
   #1 'entry.is.electronic :=
+  #1 'is.pure.electronic :=
   output.bibitem
+  output.translation
   format.authors output
   author format.key output
   new.block
@@ -1439,8 +1597,45 @@ FUNCTION {electronic}
   format.pages bbl.colon output.after
   format.editdate "" output.after
   format.urldate "" output.after
-  format.url output
-  format.doi output
+  output.url
+  output.doi
+  new.block
+  format.note output
+  fin.entry
+}
+
+FUNCTION {preprint}
+{ output.bibitem
+  output.translation
+  author empty$ not
+    { format.authors }
+    { editor empty$ not
+        { format.editors }
+        { "empty author and editor in " cite$ * warning$
+          ""
+        }
+      if$
+    }
+  if$
+  output
+  new.block
+  title.in.journal
+    { format.series.vol.num.title "title" output.check
+      "Z" set.entry.mark
+      format.mark "" output.after
+      new.block
+    }
+    'skip$
+  if$
+  format.translators output
+  new.sentence
+  format.edition output
+  new.block
+  output.eprint
+  format.year "year" output.check
+  format.pages bbl.colon output.after
+  format.urldate "" output.after
+  output.url
   new.block
   format.note output
   fin.entry
@@ -1453,10 +1648,14 @@ FUNCTION {misc}
         'incollection
         { publisher empty$ not
             'monograph
-            { entry.is.electronic
-                'electronic
-                { "Z" set.entry.mark
-                  monograph
+            { eprint empty$ not show.preprint and
+                'preprint
+                { entry.is.electronic
+                    'electronic
+                    { "Z" set.entry.mark
+                      monograph
+                    }
+                  if$
                 }
               if$
             }
@@ -1556,10 +1755,7 @@ FUNCTION {techreport}
   misc
 }
 
-FUNCTION {unpublished}
-{ "Z" set.entry.mark
-  misc
-}
+FUNCTION {unpublished} { misc }
 
 FUNCTION {default.type} { misc }
 
@@ -1760,6 +1956,7 @@ FUNCTION {presort}
 { set.entry.lang
   set.entry.numbered
   show.url show.doi check.electronic
+  #0 'is.pure.electronic :=
   calc.label
   label sortify
   "    "
@@ -1828,19 +2025,25 @@ FUNCTION {begin.bib}
   write$ newline$
   "\providecommand{\url}[1]{#1}"
   write$ newline$
-  "\expandafter\ifx\csname urlstyle\endcsname\relax\relax\else"
+  "\expandafter\ifx\csname urlstyle\endcsname\relax\else"
   write$ newline$
   "  \urlstyle{same}\fi"
   write$ newline$
-  show.doi
-    { "\providecommand{\href}[2]{\url{#2}}"
+  "\expandafter\ifx\csname href\endcsname\relax"
+  write$ newline$
+  "  \DeclareUrlCommand\doi{\urlstyle{rm}}"
+  write$ newline$
+  "  \def\eprint#1#2{#2}"
+      write$ newline$
+  "\else"
+  write$ newline$
+  "  \def\doi#1{\href{https://doi.org/#1}{\nolinkurl{#1}}}"
+  write$ newline$
+  "  \let\eprint\href"
       write$ newline$
-      "\providecommand{\doi}[1]{\href{https://doi.org/#1}{#1}}"
+  "\fi"
       write$ newline$
     }
-    'skip$
-  if$
-}
 
 FUNCTION {end.bib}
 { newline$
-- 
cgit v1.2.3

