From 8f355f2ef89606139b19478647af702523f7d9e7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 14 Mar 2020 20:39:01 +0000 Subject: gbt7714 (14mar20) git-svn-id: svn://tug.org/texlive/trunk@54293 c570f23f-e606-0410-a88d-b1316a301751 --- .../bibtex/bst/gbt7714/gbt7714-author-year.bst | 181 +++++++++++++++++---- .../bibtex/bst/gbt7714/gbt7714-numerical.bst | 181 +++++++++++++++++---- 2 files changed, 292 insertions(+), 70 deletions(-) (limited to 'Master/texmf-dist/bibtex/bst') diff --git a/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-author-year.bst b/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-author-year.bst index 40757392523..65cc492ee71 100644 --- a/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-author-year.bst +++ b/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-author-year.bst @@ -8,7 +8,7 @@ %% ------------------------------------------------------------------- %% GB/T 7714-2015 BibTeX Style %% https://github.com/CTeX-org/gbt7714-bibtex-style -%% Version: 2020/03/04 v2.0 +%% Version: 2020/03/14 v2.0.1 %% ------------------------------------------------------------------- %% Copyright (C) 2016-2020 by Zeping Lee %% ------------------------------------------------------------------- @@ -26,16 +26,21 @@ INTEGERS { period.between.author.year sentence.case.title link.title + title.in.journal show.mark show.medium.type slash.for.extraction in.booktitle - italic.jounal + abbreviate.journal + italic.journal bold.journal.volume show.missing.address.publisher + space.before.pages + only.start.page show.url show.doi show.note + show.english.translation lang.zh.order lang.ja.order lang.en.order @@ -50,16 +55,21 @@ FUNCTION {load.config} #0 'period.between.author.year := #1 'sentence.case.title := #0 'link.title := + #1 'title.in.journal := #1 'show.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 := #1 'show.missing.address.publisher := + #0 'space.before.pages := + #0 'only.start.page := #1 'show.url := #1 'show.doi := #0 'show.note := + #0 'show.english.translation := #1 'lang.zh.order := #2 'lang.ja.order := #3 'lang.en.order := @@ -91,6 +101,7 @@ ENTRY series title translator + translation url urldate volume @@ -272,6 +283,12 @@ FUNCTION {output.check} FUNCTION {fin.entry} { add.period$ write$ + show.english.translation entry.lang lang.zh = and + { ")" + write$ + } + 'skip$ + if$ newline$ } @@ -863,12 +880,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} @@ -1107,7 +1163,12 @@ FUNCTION {hyphenate} FUNCTION {format.pages} { pages empty$ { "" } - { pages hyphenate } + { pages + only.start.page + 'extract.before.dash + 'hyphenate + if$ + } if$ } @@ -1132,7 +1193,12 @@ FUNCTION {format.journal.number} FUNCTION {format.journal.pages} { pages empty$ { "" } - { ":\penalty0 " pages hyphenate * } + { space.before.pages + { ": " } + { ":\penalty0 " } + if$ + format.pages * + } if$ } @@ -1204,9 +1270,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$ } @@ -1240,7 +1312,7 @@ FUNCTION {is.in.url} FUNCTION {format.doi} { "" - doi empty$ not show.doi and + doi empty$ not { "" 's := doi 't := #0 'numnames := @@ -1268,11 +1340,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$ @@ -1304,6 +1381,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$ @@ -1316,6 +1417,7 @@ FUNCTION {empty.misc.check} FUNCTION {monograph} { output.bibitem + output.translation author empty$ not { format.authors } { editor empty$ not @@ -1344,8 +1446,8 @@ FUNCTION {monograph} format.address.publisher output 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 @@ -1353,6 +1455,7 @@ FUNCTION {monograph} FUNCTION {incollection} { output.bibitem + output.translation format.authors output author format.key output period.between.author.year @@ -1376,8 +1479,8 @@ FUNCTION {incollection} format.address.publisher output 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 @@ -1385,6 +1488,7 @@ FUNCTION {incollection} FUNCTION {periodical} { output.bibitem + output.translation format.authors output author format.key output period.between.author.year @@ -1401,8 +1505,8 @@ FUNCTION {periodical} new.block format.address.publisher output format.urldate "" output.after - format.url output - format.doi output + output.url + output.doi new.block format.note output fin.entry @@ -1410,6 +1514,7 @@ FUNCTION {periodical} FUNCTION {article} { output.bibitem + output.translation format.authors output author format.key output period.between.author.year @@ -1418,17 +1523,21 @@ FUNCTION {article} if$ format.year "year" output.check 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.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 @@ -1436,6 +1545,7 @@ FUNCTION {article} FUNCTION {patent} { output.bibitem + output.translation format.authors output author format.key output period.between.author.year @@ -1450,8 +1560,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 @@ -1461,6 +1571,7 @@ FUNCTION {electronic} { #1 #1 check.electronic #1 'entry.is.electronic := output.bibitem + output.translation format.authors output author format.key output period.between.author.year @@ -1477,8 +1588,8 @@ 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 @@ -2008,9 +2119,9 @@ FUNCTION {begin.bib} show.doi { "\expandafter\ifx\csname href\endcsname\relax" write$ newline$ - " \def\doi#1{#1}\else" + " \DeclareUrlCommand\doi{\urlstyle{rm}}\else" write$ newline$ - " \def\doi#1{\href{https://doi.org/#1}{#1}}\fi" + " \providecommand\doi[1]{\href{https://doi.org/#1}{\nolinkurl{#1}}}\fi" write$ newline$ } 'skip$ diff --git a/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-numerical.bst b/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-numerical.bst index 8fdb37194dc..c8424d0242d 100644 --- a/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-numerical.bst +++ b/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-numerical.bst @@ -8,7 +8,7 @@ %% ------------------------------------------------------------------- %% GB/T 7714-2015 BibTeX Style %% https://github.com/CTeX-org/gbt7714-bibtex-style -%% Version: 2020/03/04 v2.0 +%% Version: 2020/03/14 v2.0.1 %% ------------------------------------------------------------------- %% Copyright (C) 2016-2020 by Zeping Lee %% ------------------------------------------------------------------- @@ -26,16 +26,21 @@ INTEGERS { period.between.author.year sentence.case.title link.title + title.in.journal show.mark show.medium.type slash.for.extraction in.booktitle - italic.jounal + abbreviate.journal + italic.journal bold.journal.volume show.missing.address.publisher + space.before.pages + only.start.page show.url show.doi show.note + show.english.translation } FUNCTION {load.config} @@ -44,16 +49,21 @@ FUNCTION {load.config} #3 'max.num.authors := #1 'sentence.case.title := #0 'link.title := + #1 'title.in.journal := #1 'show.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 := #1 'show.missing.address.publisher := + #0 'space.before.pages := + #0 'only.start.page := #1 'show.url := #1 'show.doi := #0 'show.note := + #0 'show.english.translation := } ENTRY @@ -80,6 +90,7 @@ ENTRY series title translator + translation url urldate volume @@ -261,6 +272,12 @@ FUNCTION {output.check} FUNCTION {fin.entry} { add.period$ write$ + show.english.translation entry.lang lang.zh = and + { ")" + write$ + } + 'skip$ + if$ newline$ } @@ -852,12 +869,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} @@ -1096,7 +1152,12 @@ FUNCTION {hyphenate} FUNCTION {format.pages} { pages empty$ { "" } - { pages hyphenate } + { pages + only.start.page + 'extract.before.dash + 'hyphenate + if$ + } if$ } @@ -1121,7 +1182,12 @@ FUNCTION {format.journal.number} FUNCTION {format.journal.pages} { pages empty$ { "" } - { ":\penalty0 " pages hyphenate * } + { space.before.pages + { ": " } + { ":\penalty0 " } + if$ + format.pages * + } if$ } @@ -1193,9 +1259,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$ } @@ -1229,7 +1301,7 @@ FUNCTION {is.in.url} FUNCTION {format.doi} { "" - doi empty$ not show.doi and + doi empty$ not { "" 's := doi 't := #0 'numnames := @@ -1257,11 +1329,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$ @@ -1293,6 +1370,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$ @@ -1305,6 +1406,7 @@ FUNCTION {empty.misc.check} FUNCTION {monograph} { output.bibitem + output.translation author empty$ not { format.authors } { editor empty$ not @@ -1329,8 +1431,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 @@ -1338,6 +1440,7 @@ FUNCTION {monograph} FUNCTION {incollection} { output.bibitem + output.translation format.authors output author format.key output new.block @@ -1357,8 +1460,8 @@ FUNCTION {incollection} 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 @@ -1366,6 +1469,7 @@ FUNCTION {incollection} FUNCTION {periodical} { output.bibitem + output.translation format.authors output author format.key output new.block @@ -1378,8 +1482,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 @@ -1387,21 +1491,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 @@ -1409,6 +1518,7 @@ FUNCTION {article} FUNCTION {patent} { output.bibitem + output.translation format.authors output author format.key output new.block @@ -1418,8 +1528,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 @@ -1429,6 +1539,7 @@ FUNCTION {electronic} { #1 #1 check.electronic #1 'entry.is.electronic := output.bibitem + output.translation format.authors output author format.key output new.block @@ -1444,8 +1555,8 @@ 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 @@ -1829,9 +1940,9 @@ FUNCTION {begin.bib} show.doi { "\expandafter\ifx\csname href\endcsname\relax" write$ newline$ - " \def\doi#1{#1}\else" + " \DeclareUrlCommand\doi{\urlstyle{rm}}\else" write$ newline$ - " \def\doi#1{\href{https://doi.org/#1}{#1}}\fi" + " \providecommand\doi[1]{\href{https://doi.org/#1}{\nolinkurl{#1}}}\fi" write$ newline$ } 'skip$ -- cgit v1.2.3