diff options
author | Karl Berry <karl@freefriends.org> | 2020-03-14 20:39:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-03-14 20:39:01 +0000 |
commit | 8f355f2ef89606139b19478647af702523f7d9e7 (patch) | |
tree | 3fd372bc702fa67ca8d45760aab8f42cf1b3bc1b /Master/texmf-dist/source | |
parent | 75992f7fdc6967d0d67027de3074560ca24878ff (diff) |
gbt7714 (14mar20)
git-svn-id: svn://tug.org/texlive/trunk@54293 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx | 284 | ||||
-rw-r--r-- | Master/texmf-dist/source/bibtex/gbt7714/gbt7714.ins | 2 |
2 files changed, 244 insertions, 42 deletions
diff --git a/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx b/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx index 57254acc42b..e42938874cd 100644 --- a/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx +++ b/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx @@ -17,7 +17,7 @@ % \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{gbt7714} -%<package> [2020/03/04 v2.0 GB/T 7714-2015 BibTeX Style] +%<package> [2020/03/14 v2.0.1 GB/T 7714-2015 BibTeX Style] % %<*driver> \documentclass[a4paper]{ltxdoc} @@ -285,10 +285,13 @@ % period.between.author.year & |#0| & 著者和年份之间使用句点连接 \\ % sentence.case.title & |#1| & 将西文的题名转为 sentence case \\ % link.title & |#0| & 在题名上添加 url 的超链接 \\ +% title.in.journal & |#1| & 期刊是否显示标题 \\ % show.mark & |#1| & 显示文献类型标识 \\ % show.medium.type & |#1| & 显示载体类型标识 \\ -% italic.jounal & |#0| & 西文期刊名使用斜体 \\ +% italic.journal & |#0| & 西文期刊名使用斜体 \\ % show.missing.address.publisher & |#1| & 出版项缺失时显示“出版者不详” \\ +% space.before.pages & |#0| & 页码前有空白 \\ +% only.start.page & |#0| & 只显示起始页码 \\ % show.url & |#1| & 显示 url \\ % show.doi & |#1| & 显示 doi \\ % show.note & |#0| & 显示 note 域的信息 \\ @@ -363,14 +366,16 @@ % 吴凯. % \newblock 发布GBT7714-2005.bst version1 Beta版\allowbreak[EB/OL]. % \newblock 2006. -% \newblock \url{http://bbs.ctex.org/forum.php?mod=viewthread&tid=33591}. +% \newblock \url{http://bbs.ctex.org/forum.php?mod=viewthread&tid=33591} +% (not accessible). % % \bibitem[李志奇(2013)]{lqz2013} % 李志奇. % \newblock % 基于biblatex的符合GBT7714-2005的中文文献生成工具\allowbreak[EB/OL]. % \newblock 2013. -% \newblock \url{http://bbs.ctex.org/forum.php?mod=viewthread&tid=74474}. +% \newblock \url{http://bbs.ctex.org/forum.php?mod=viewthread&tid=74474} +% (not accessible). % % \bibitem[胡海星(2013)]{hhx2013} % 胡海星. @@ -422,8 +427,6 @@ \newcommand\gbt@obselete@option[1]{% \PackageWarning{gbt7714}{The option "#1" is obselete}% } -\DeclareOption{authoryear}{} - \DeclareOption{2015}{% \gbt@obselete@option{2015}% \gbt@legacy@interfacetrue @@ -469,6 +472,7 @@ % 定义接口切换引用文献的标注法,可用 \cs{citestyle} 调用 \opt{numerical} % 或 \opt{authoryear},参见 \pkg{natbib}。 % \begin{macrocode} +\renewcommand\newblock{\space} \newcommand\bibstyle@super{\bibpunct{[}{]}{,}{s}{,}{\textsuperscript{,}}} \newcommand\bibstyle@numbers{\bibpunct{[}{]}{,}{n}{,}{,}} \newcommand\bibstyle@authoryear{\bibpunct{(}{)}{;}{a}{,}{,}} @@ -778,16 +782,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 %<*authoryear> lang.zh.order lang.ja.order @@ -849,6 +858,16 @@ FUNCTION {load.config} %</linktitle> % \end{macrocode} % +% 期刊是否含标题: +% \begin{macrocode} +%<*!title-in-journal&!npr> + #1 'title.in.journal := +%</!title-in-journal&!npr> +%<*title-in-journal|npr> + #0 'title.in.journal := +%</title-in-journal|npr> +% \end{macrocode} +% % 著录文献类型标识(比如“[M/OL]“): % \begin{macrocode} #1 'show.mark := @@ -878,11 +897,21 @@ FUNCTION {load.config} #0 'in.booktitle := % \end{macrocode} % +% 期刊名使用缩写: +% \begin{macrocode} +%<*!abbreviate-journal&!npr> + #0 'abbreviate.journal := +%</!abbreviate-journal&!npr> +%<*abbreviate-journal|npr> + #1 'abbreviate.journal := +%</abbreviate-journal|npr> +% \end{macrocode} +% % 期刊名使用斜体: % \begin{macrocode} - #0 'italic.jounal := + #0 'italic.journal := %<*italicjournal> - #1 'italic.jounal := + #1 'italic.journal := %</italicjournal> % \end{macrocode} % @@ -901,6 +930,26 @@ FUNCTION {load.config} %</noslsn|thu|ustc> % \end{macrocode} % +% 页码是否只含起始页: +% \begin{macrocode} +%<*!space-begore-pages&!npr> + #0 'space.before.pages := +%</!space-begore-pages&!npr> +%<*space-begore-pages|npr> + #1 'space.before.pages := +%</space-begore-pages|npr> +% \end{macrocode} +% +% 页码前是否有空白: +% \begin{macrocode} +%<*!only-start-page&!npr> + #0 'only.start.page := +%</!only-start-page&!npr> +%<*only-start-page|npr> + #1 'only.start.page := +%</only-start-page|npr> +% \end{macrocode} +% % 是否著录 URL: % \begin{macrocode} #1 'show.url := @@ -924,6 +973,16 @@ FUNCTION {load.config} #0 'show.note := % \end{macrocode} % +% 中文文献是否显示英文翻译 +% \begin{macrocode} +%<*!show-english-translation&!npr> + #0 'show.english.translation := +%</!show-english-translation&!npr> +%<*show-english-translation|npr> + #1 'show.english.translation := +%</show-english-translation|npr> +% \end{macrocode} +% % 参考文献表按照“著者-出版年”组织时,各个文种的顺序: % \begin{macrocode} %<*authoryear> @@ -970,6 +1029,7 @@ ENTRY series title translator + translation url urldate volume @@ -1346,6 +1406,12 @@ FUNCTION {output.check} FUNCTION {fin.entry} { add.period$ write$ + show.english.translation entry.lang lang.zh = and + { ")" + write$ + } + 'skip$ + if$ newline$ } @@ -2156,12 +2222,93 @@ 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$ +%<*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 } + { 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$ } % \end{macrocode} @@ -2508,7 +2655,12 @@ FUNCTION {hyphenate} FUNCTION {format.pages} { pages empty$ { "" } - { pages hyphenate } + { pages + only.start.page + 'extract.before.dash + 'hyphenate + if$ + } if$ } @@ -2541,7 +2693,12 @@ FUNCTION {format.journal.number} FUNCTION {format.journal.pages} { pages empty$ { "" } - { ":\penalty0 " pages hyphenate * } + { space.before.pages + { ": " } + { ":\penalty0 " } + if$ + format.pages * + } if$ } @@ -2623,9 +2780,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$ } @@ -2663,7 +2826,7 @@ FUNCTION {is.in.url} FUNCTION {format.doi} { "" - doi empty$ not show.doi and + doi empty$ not { "" 's := doi 't := #0 'numnames := @@ -2691,11 +2854,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$ @@ -2727,6 +2895,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$ +} + % \end{macrocode} % % The function empty.misc.check complains if all six fields are empty, and @@ -2760,6 +2952,7 @@ FUNCTION {empty.misc.check} % \begin{macrocode} FUNCTION {monograph} { output.bibitem + output.translation author empty$ not { format.authors } { editor empty$ not @@ -2798,8 +2991,8 @@ FUNCTION {monograph} %</numerical> 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 @@ -2820,6 +3013,7 @@ FUNCTION {monograph} % \begin{macrocode} FUNCTION {incollection} { output.bibitem + output.translation format.authors output author format.key output %<*authoryear> @@ -2848,8 +3042,8 @@ FUNCTION {incollection} %</numerical> 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 @@ -2862,6 +3056,7 @@ FUNCTION {incollection} % \begin{macrocode} FUNCTION {periodical} { output.bibitem + output.translation format.authors output author format.key output %<*authoryear> @@ -2883,8 +3078,8 @@ FUNCTION {periodical} format.date "year" output.check %</numerical> format.urldate "" output.after - format.url output - format.doi output + output.url + output.doi new.block format.note output fin.entry @@ -2906,6 +3101,7 @@ FUNCTION {periodical} % \begin{macrocode} FUNCTION {article} { output.bibitem + output.translation format.authors output author format.key output %<*authoryear> @@ -2916,10 +3112,14 @@ FUNCTION {article} format.year "year" output.check %</authoryear> 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 %<*numerical> format.date "year" output.check @@ -2928,8 +3128,8 @@ FUNCTION {article} 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 @@ -2943,6 +3143,7 @@ FUNCTION {article} % \begin{macrocode} FUNCTION {patent} { output.bibitem + output.translation format.authors output author format.key output %<*authoryear> @@ -2959,8 +3160,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 @@ -2974,6 +3175,7 @@ FUNCTION {electronic} { #1 #1 check.electronic #1 'entry.is.electronic := output.bibitem + output.translation format.authors output author format.key output %<*authoryear> @@ -2998,8 +3200,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 @@ -3928,9 +4130,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/source/bibtex/gbt7714/gbt7714.ins b/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.ins index a2161d12a85..5d0ba5e3498 100644 --- a/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.ins +++ b/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.ins @@ -5,7 +5,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-\the\year by Zeping Lee <zepinglee AT gmail.com> ------------------------------------------------------------------- |