diff options
author | Karl Berry <karl@freefriends.org> | 2020-03-06 21:29:33 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-03-06 21:29:33 +0000 |
commit | 79c7361836cfe04ef5ad28226f59da581b8484dd (patch) | |
tree | 6bd0f7c5aee1d03f726621dd921407141a378e44 | |
parent | 0968f14db24f085ffca6486c656ede0c1301c888 (diff) |
gbt7714 (6mar20)
git-svn-id: svn://tug.org/texlive/trunk@54128 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-author-year.bst (renamed from Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-plain.bst) | 32 | ||||
-rw-r--r-- | Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-numerical.bst (renamed from Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-unsrt.bst) | 32 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/gbt7714/CHANGELOG.md | 89 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/gbt7714/README.md | 29 | ||||
-rw-r--r-- | Master/texmf-dist/doc/bibtex/gbt7714/gbt7714.pdf | bin | 328498 -> 337101 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx | 349 | ||||
-rw-r--r-- | Master/texmf-dist/source/bibtex/gbt7714/gbt7714.ins | 27 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/gbt7714/gbt7714.sty | 124 |
8 files changed, 332 insertions, 350 deletions
diff --git a/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-plain.bst b/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-author-year.bst index e0efd390dc0..40757392523 100644 --- a/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-plain.bst +++ b/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-author-year.bst @@ -1,5 +1,5 @@ %% -%% This is file `gbt7714-plain.bst', +%% This is file `gbt7714-author-year.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/11/20 v1.1.2 +%% Version: 2020/03/04 v2.0 %% ------------------------------------------------------------------- -%% 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 @@ -27,6 +27,7 @@ INTEGERS { sentence.case.title link.title show.mark + show.medium.type slash.for.extraction in.booktitle italic.jounal @@ -50,6 +51,7 @@ FUNCTION {load.config} #1 'sentence.case.title := #0 'link.title := #1 'show.mark := + #1 'show.medium.type := #1 'slash.for.extraction := #0 'in.booktitle := #0 'italic.jounal := @@ -882,14 +884,20 @@ FUNCTION {set.entry.mark} FUNCTION {format.mark} { show.mark - { 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 := "\allowbreak[" entry.mark * "]" * } { "" } @@ -1993,14 +2001,16 @@ 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$ + " \def\doi#1{#1}\else" write$ newline$ - "\providecommand{\doi}[1]{\href{https://doi.org/#1}{#1}}" + " \def\doi#1{\href{https://doi.org/#1}{#1}}\fi" write$ newline$ } 'skip$ diff --git a/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-unsrt.bst b/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-numerical.bst index 0fbf2e03a8e..8fdb37194dc 100644 --- a/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-unsrt.bst +++ b/Master/texmf-dist/bibtex/bst/gbt7714/gbt7714-numerical.bst @@ -1,5 +1,5 @@ %% -%% This is file `gbt7714-unsrt.bst', +%% This is file `gbt7714-numerical.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/11/20 v1.1.2 +%% Version: 2020/03/04 v2.0 %% ------------------------------------------------------------------- -%% 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 @@ -27,6 +27,7 @@ INTEGERS { sentence.case.title link.title show.mark + show.medium.type slash.for.extraction in.booktitle italic.jounal @@ -44,6 +45,7 @@ FUNCTION {load.config} #1 'sentence.case.title := #0 'link.title := #1 'show.mark := + #1 'show.medium.type := #1 'slash.for.extraction := #0 'in.booktitle := #0 'italic.jounal := @@ -871,14 +873,20 @@ FUNCTION {set.entry.mark} FUNCTION {format.mark} { show.mark - { 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 := "\allowbreak[" entry.mark * "]" * } { "" } @@ -1814,14 +1822,16 @@ 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$ + " \def\doi#1{#1}\else" write$ newline$ - "\providecommand{\doi}[1]{\href{https://doi.org/#1}{#1}}" + " \def\doi#1{\href{https://doi.org/#1}{#1}}\fi" write$ newline$ } 'skip$ diff --git a/Master/texmf-dist/doc/bibtex/gbt7714/CHANGELOG.md b/Master/texmf-dist/doc/bibtex/gbt7714/CHANGELOG.md deleted file mode 100644 index 8e440249127..00000000000 --- a/Master/texmf-dist/doc/bibtex/gbt7714/CHANGELOG.md +++ /dev/null @@ -1,89 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - -## [Unreleased] - -## [v1.1.2] - 2019-11-20 -### Changed -- 不再依赖 `etoolbox` - -### Fixed -- 修正与 `newtx` 冲突([#42](https://github.com/CTeX-org/gbt7714-bibtex-style/issues/42)) - -## [v1.1.1] - 2019-03-21 -### Added -- 允许自定义文种的顺序 - -## [v1.1] - 2019-01-02 -### Added -- 允许自定义“et al” - -### Changed -- 修正 series 的 bug - -## [v1.0.9] - 2018-08-05 -### Added -- 增加选项在题名添加超链接 - -### Changed -- 不再转换题名 volume 的大小写 -- 修正不显示 url 的选项 - -## [v1.0.8] - 2018-06-23 -### Added -- 新增接口供用户自定义样式 -- 支持 howpublished 中的 url - -### Changed -- 使用 `xurl` 的方法改进 URL 断行 -- 使用“~”连接英文姓名 - -## [v1.0.7] - 2018-05-12 -### Changed -- 修正了检测 Unicode 语言 - -## [v1.0.6] - 2018-05-10 -### Changed -- 文献列表的数字标签左对齐 -- 不再处理中文标题的英文单词的大小写 - -## [v1.0.5] - 2018-04-18 -### Added -- 允许著录多个 DOI - -## [v1.0.4] - 2018-04-12 -### Changed -- 页码的连接号由 en dash 改为 hyphen - -## [v1.0.3] - 2018-03-29 -### Changed -- 顺序编码制连续两个文献引用之间使用连接号 - -## [v1.0.2] - 2018-03-16 -### Changed -- 正确识别姓名中的“others” - -## [v1.0.1] - 2018-03-09 -### Changed -- 著者出版年制的文献引用不再排序 - -## [v1.0] - 2018-01-01 -### Changed -- Initial release. - -[Unreleased]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.1.2...HEAD -[v1.1.2]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.1.1...v1.1.2 -[v1.1.1]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.1...v1.1.1 -[v1.1]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.0.9...v1.1 -[v1.0.9]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.0.8...v1.0.9 -[v1.0.8]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.0.7...v1.0.8 -[v1.0.7]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.0.6...v1.0.7 -[v1.0.6]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.0.5...v1.0.6 -[v1.0.5]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.0.4...v1.0.5 -[v1.0.4]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.0.3...v1.0.4 -[v1.0.3]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.0.2...v1.0.3 -[v1.0.2]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.0.1...v1.0.2 -[v1.0.1]: https://github.com/CTeX-org/gbt7714-bibtex-style/compare/v1.0...v1.0.1 -[v1.0]: https://github.com/CTeX-org/gbt7714-bibtex-style/releases/tag/v1.0 diff --git a/Master/texmf-dist/doc/bibtex/gbt7714/README.md b/Master/texmf-dist/doc/bibtex/gbt7714/README.md index 81fb4fb9c9d..7afe22f3b7a 100644 --- a/Master/texmf-dist/doc/bibtex/gbt7714/README.md +++ b/Master/texmf-dist/doc/bibtex/gbt7714/README.md @@ -4,7 +4,7 @@ [![CTAN](https://img.shields.io/ctan/v/gbt7714.svg)](https://ctan.org/pkg/gbt7714) [![GitHub release](https://img.shields.io/github/release/CTeX-org/gbt7714-bibtex-style/all.svg)](https://github.com/CTeX-org/gbt7714-bibtex-style/releases/latest) [![GitHub commits](https://img.shields.io/github/commits-since/CTeX-org/gbt7714-bibtex-style/latest.svg)](https://github.com/CTeX-org/gbt7714-bibtex-style/commits/master) -[![Travis build](https://travis-ci.org/CTeX-org/gbt7714-bibtex-style.svg?branch=master)](https://travis-ci.org/CTeX-org/gbt7714-bibtex-style) +[![Build](https://github.com/CTeX-org/gbt7714-bibtex-style/workflows/build/badge.svg)](https://github.com/CTeX-org/gbt7714-bibtex-style/actions) ## Introduction @@ -24,50 +24,38 @@ and English) for each biblilography entry. ## 新特性 - 兼容 `natbib` -- 支持顺序编码制和著者-出版年制两种风格 +- 支持“顺序编码制”和“著者-出版年制”两种风格 - 自动识别语言并进行相应处理 - 提供了简单的接口供用户修改样式 ## 使用方法 -1. 将 `bst` 文件和 `sty` 文件复制到工作目录。 +1. 在导言区调用宏包 `gbt7714`; -2. 在导言区调用宏包 `gbt7714`,可选的参数如下表。 - 默认的参数是 `super`,额外的参数会传递给 `natbib` 宏包。 +2. 在正文中 `\cite` 文献; -可选参数 | 引用标注 | 参考文献列表 ---- | --- | --- -`super`(默认) | 角标数字 | 顺序编码 -`numbers` | 数字 | 顺序编码 -`authoryear` | 著者-出版年 | 著者-出版年 -`2015`(默认) | - | GB/T 7714-2015 版 -`2005` | - | GB/T 7714-2005 版 - -比如: `\usepackage[authoryear]{gbt7714}` - -3. 在正文中 `\cite` 文献。 +3. 使用 `\bibliographystyle` 选择参考文献表的样式; 4. 使用 `\bibliography` 命令生成参考文献表。 ## 注意事项 -1. **不再**需要调用 `\bibliographystyle` 命令。 -2. `bib` 数据库应使用 UTF-8 编码。 -3. 使用著者-出版年制参考文献表时,中文的文献**必须**在 `key` 域填写 +1. `bib` 数据库应使用 UTF-8 编码。 +2. 使用著者-出版年制参考文献表时,中文的文献**必须**在 `key` 域填写 著者姓名的拼音,才能按照拼音排序,比如: ``` @book{capital, author = {马克思 and 恩格斯}, key = {ma3 ke4 si1 en1 ge2 si1}, ... +} ``` 同一处引用多篇文献时,应将各篇文献的 key 一同写在 `\cite` 命令中, 如 `\cite{knuth84,lamport94,mittelbach04}`。 如遇连续编号,可以自动转为起讫序号并用短横线连接。 -它可以自动排序并用处理连续编号。 若需要标出引文的页码,可以标在 `\cite` 的可选参数中,如 `\cite[42]{knuth84}`。 @@ -81,6 +69,7 @@ and English) for each biblilography entry. mark = {Z}, medium = {DK}, ... +} ``` 可选的语言有 `english`, `chinese`, `japanese`, `russian`。 diff --git a/Master/texmf-dist/doc/bibtex/gbt7714/gbt7714.pdf b/Master/texmf-dist/doc/bibtex/gbt7714/gbt7714.pdf Binary files differindex 296a5e5776d..0b2e6e9a5e2 100644 --- a/Master/texmf-dist/doc/bibtex/gbt7714/gbt7714.pdf +++ b/Master/texmf-dist/doc/bibtex/gbt7714/gbt7714.pdf diff --git a/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx b/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx index 4721ba99d62..57254acc42b 100644 --- a/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx +++ b/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.dtx @@ -2,7 +2,7 @@ % GB/T 7714-2015 BibTeX Style % https://github.com/CTeX-org/gbt7714-bibtex-style % -% 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 @@ -12,90 +12,45 @@ % and version 1.3c or later is part of all distributions of LaTeX % version 2005/12/01 or later. % -%<*internal> -\iffalse -\fi -\begingroup - \def\nameoflatex{LaTeX2e} -\expandafter\endgroup\ifx\nameoflatex\fmtname\else -\csname fi\endcsname -%</internal> -%<*install> -\input docstrip.tex -\keepsilent -\askforoverwritefalse -\preamble -------------------------------------------------------------------- -GB/T 7714-2015 BibTeX Style -https://github.com/CTeX-org/gbt7714-bibtex-style -Version: 2019/11/20 v1.1.2 -------------------------------------------------------------------- -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 -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. -------------------------------------------------------------------- -\endpreamble -\nopostamble -\generate{ - \file{\jobname.sty}{\from{\jobname.dtx}{package}} - \file{\jobname-plain.bst}{\from{\jobname.dtx}{2015,authoryear}} - \file{\jobname-unsrt.bst}{\from{\jobname.dtx}{2015,numerical}} -} -\endbatchfile -%</install> -%<*internal> -\fi -%</internal> -%<*driver> -\ProvidesFile{\jobname.dtx} -%</driver> +% \fi +% +% \iffalse %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{gbt7714} -%<*package> - [2019/11/20 v1.1.2 GB/T 7714-2015 BibTeX Style] -%</package> +%<package> [2020/03/04 v2.0 GB/T 7714-2015 BibTeX Style] % %<*driver> \documentclass[a4paper]{ltxdoc} -\usepackage[paper=a4paper,margin=1in,left=1.25in]{geometry} \usepackage{hypdoc} -\hypersetup{allcolors=blue} \usepackage[UTF8]{ctex} +\usepackage{caption} +\usepackage{booktabs} +\usepackage{gbt7714} +\usepackage{listings} +\makeatletter +\hypersetup{allcolors=blue} \IfFileExists{/System/Library/Fonts/Times.ttc}{ \setmainfont{Times} \setsansfont[Scale=MatchLowercase]{Helvetica} \setmonofont[Scale=MatchLowercase]{Menlo} }{} -\usepackage{caption} -\usepackage{booktabs} -\usepackage{gbt7714} -\usepackage{listings} +\citestyle{super} \lstnewenvironment{latex}{% - \lstset{% + \lstset{ basicstyle = \ttfamily\small, language = [LaTeX]TeX, - gobble = 2, - frame = single,}}{} + gobble = 4, + frame = single, + }% +}{} \lstnewenvironment{pseudocode}{% - \lstset{% + \lstset{ basicstyle=\ttfamily\small, language=bash, gobble=2, - frame=single,}}{} -\makeatletter -\def\DescribeOption{\leavevmode\@bsphack\begingroup\MakePrivateLetters - \Describe@Option} -\def\Describe@Option#1{\endgroup - \marginpar{\raggedleft\PrintDescribeOption{#1}}% - \SpecialEnvIndex{#1}\@esphack\ignorespaces} -\@ifundefined{PrintDescribeOption} - {\def\PrintDescribeOption#1{\strut \MacroFont #1\ }}{} + frame=single, + }% +}{} \DeclareRobustCommand\file{\nolinkurl} \DeclareRobustCommand\env{\texttt} \DeclareRobustCommand\pkg{\textsf} @@ -121,7 +76,7 @@ version 2005/12/01 or later. % % % -% \GetFileInfo{\jobname.dtx} +% \GetFileInfo{gbt7714.sty} % % \title{GB/T 7714-2015 \BibTeX{} style} % \author{Zeping Lee\thanks{zepinglee AT gmail.com}} @@ -155,45 +110,52 @@ version 2005/12/01 or later. % % \section{使用方法} % -% \DescribeOption{super} -% \DescribeOption{numbers} -% \DescribeOption{authoryear} % 按照国标的规定,参考文献的标注体系分为“顺序编码制”和 -% “著者-出版年制”(\opt{authoryear}), -% 其中顺序编码制根据引用标注样式的不同分为角标数字式(\opt{super})和 -% 与正文平排的数字式(\opt{numbers})。 +% “著者-出版年制”。 +% 用户应在导言区调用宏包 \pkg{gbt7714},并且使用 \cs{bibliographystyle} +% 命令选择参考文献表的样式,比如: +% \begin{latex} +% \bibliographystyle{gbt7714-numerical} % 顺序编码制 +% \end{latex} +% 或者 +% \begin{latex} +% \bibliographystyle{gbt7714-author-year} % 著者-出版年制 +% \end{latex} % -% 用户应在导言区调用宏包 \pkg{gbt7714},并在参数中选择参考文献的标注样式。 -% 默认的参数是 \opt{super},额外的参数会传递给 \pkg{natbib} 宏包,比如: +% 注意,版本 v2.0 更改了设置参考文献表样式的方法, +% 要求直接使用 \cs{bibliographystyle},不再使用宏包的参数, +% 而且更改了 \file{bst} 的文件名。 +% +% 顺序编码制的引用标注默认使用角标式, +% 如“张三\textsuperscript{[2]}提出”。 +% 如果要使用正文模式,如“文献 [3] 中说明”, +% 可以使用 \cs{citestyle} 命令进行切换: % \begin{latex} -% \usepackage[authoryear]{gbt7714} +% \citestyle{numbers} % \end{latex} -% 然后\emph{不再}需要调用 \cs{bibliographystyle} 命令设置参考文献列表风格。 +% +% 同一处引用多篇文献时,应当将各篇文献的 key 一同写在 \cs{cite} 命令中。 +% 如遇连续编号,默认会自动转为起讫序号并用短横线连接 +% (见\pkg{natbib} 的 \opt{compress} 选项)。 +% 如果要对引用的编号进行自动排序,需要在调用 \pkg{gbt7714} 时加 +% \opt{sort\&compress} 参数: +% \begin{latex} +% \usepackage[sort&compress]{gbt7714} +% \end{latex} +% 这些参数会传给 \pkg{natbib} 处理。 +% +% 若需要标出引文的页码,可以标在 \cs{cite} 的可选参数中,如 +% |\cite[42]{knuth84}|。 +% 更多的引用标注方法可以参考 \pkg{natbib} 宏包的使用说明\cite{natbib}。 % % 使用时需要注意以下几点: % \begin{itemize} -% \item \emph{不}再需要调用 \cs{bibliographystyle} 命令选择参考文献表的格式。 -% \item bib 数据库应使用 UTF-8 编码。 +% \item \file{.bib} 数据库应使用 UTF-8 编码。 % \item 使用著者-出版年制参考文献表时,中文的文献\emph{必须} % 在 key 域填写作者姓名的拼音,才能按照拼音排序, % 详见第~\ref{sec:sort}~节。 % \end{itemize} % -% \DescribeMacro{\cite} -% 在正文中引用文献时应使用 \cs{cite} 命令。 -% 同一处引用多篇文献时,应将各篇文献的 key 一同写在 \cs{cite} 命令中, -% 如 |\cite{knuth84,lamport94,mittelbach04}|。 -% 如遇连续编号,可以自动转为起讫序号并用短横线连接。 -% 它可以自动排序并用处理连续编号。 -% 若需要标出引文的页码,可以标在 \cs{cite} 的可选参数中,如 -% |\cite[42]{knuth84}|。 -% 更多的引用标注方法可以参考 \pkg{natbib} 宏包的使用说明\cite{natbib}。 -% -% \DescribeMacro{\bibliography} -% 参考文献表可以在文中使用 \cs{bibliography} 命令调用。 -% 注意文献列表的样式已经在模板中根据选项设置, -% 用户\emph{不再}需要使用 \cs{bibliographystyle} 命令。 -% % % \section{文献类型} % @@ -270,11 +232,12 @@ version 2005/12/01 or later. % 本宏包默认情况下可以自动识别文献语言,并自动处理文献类型和载体类型标识, % 但是在少数情况下需要用户手动指定,如: % \begin{latex} -% @misc{citekey, -% language = {japanese}, -% mark = {Z}, -% medium = {DK}, -% ... +% @misc{citekey, +% language = {japanese}, +% mark = {Z}, +% medium = {DK}, +% ... +% } % \end{latex} % 可选的语言有 english, chinese, japanese, russian。 % @@ -288,11 +251,14 @@ version 2005/12/01 or later. % 然而由于 \BibTeX{} 功能的局限性,无法自动获取著者姓名的拼音或笔画笔顺, % 所以\emph{必须}在 bib 数据库中的 key 域手动录入著者姓名的拼音,如: % \begin{latex} -% @book{capital, -% author = {马克思 and 恩格斯}, -% key = {ma3 ke4 si1 en1 ge2 si1}, -% ... +% @book{capital, +% author = {马克思 and 恩格斯}, +% key = {ma3 ke4 si1 en1 ge2 si1}, +% ... +% } % \end{latex} +% 注意名字之间需要额外的空格,比如“张三, 李四”要排在 +% “张三丰”前面。 % % % \section{自定义样式} @@ -320,6 +286,7 @@ version 2005/12/01 or later. % sentence.case.title & |#1| & 将西文的题名转为 sentence case \\ % link.title & |#0| & 在题名上添加 url 的超链接 \\ % show.mark & |#1| & 显示文献类型标识 \\ +% show.medium.type & |#1| & 显示载体类型标识 \\ % italic.jounal & |#0| & 西文期刊名使用斜体 \\ % show.missing.address.publisher & |#1| & 出版项缺失时显示“出版者不详” \\ % show.url & |#1| & 显示 url \\ @@ -445,28 +412,56 @@ version 2005/12/01 or later. % % \section{宏包的代码实现} % -% 下面声明和处理宏包的选项,有 \opt{authoryear} 和 \opt{numbers}。 +% 兼容过时的接口 % \begin{macrocode} %<*package> -\newif\if@gbt@mmxv -\newif\if@gbt@numerical -\newif\if@gbt@super -\DeclareOption{2015}{\@gbt@mmxvtrue} -\DeclareOption{2005}{\@gbt@mmxvfalse} -\DeclareOption{super}{\@gbt@numericaltrue\@gbt@supertrue} -\DeclareOption{numbers}{\@gbt@numericaltrue\@gbt@superfalse} -\DeclareOption{authoryear}{\@gbt@numericalfalse} +\newif\ifgbt@legacy@interface +\newif\ifgbt@mmxv +\newif\ifgbt@numerical +\newif\ifgbt@super +\newcommand\gbt@obselete@option[1]{% + \PackageWarning{gbt7714}{The option "#1" is obselete}% +} +\DeclareOption{authoryear}{} + +\DeclareOption{2015}{% + \gbt@obselete@option{2015}% + \gbt@legacy@interfacetrue + \gbt@mmxvtrue +} +\DeclareOption{2005}{% + \gbt@obselete@option{2005}% + \gbt@legacy@interfacetrue + \gbt@mmxvfalse +} +\DeclareOption{super}{% + \gbt@obselete@option{super}% + \gbt@legacy@interfacetrue + \gbt@numericaltrue + \gbt@supertrue +} +\DeclareOption{numbers}{% + \gbt@obselete@option{numbers}% + \gbt@legacy@interfacetrue + \gbt@numericaltrue + \gbt@superfalse +} +\DeclareOption{authoryear}{% + \gbt@obselete@option{authoryear}% + \gbt@legacy@interfacetrue + \gbt@numericalfalse +} +% \end{macrocode} +% +% 将选项传递给 \pkg{natbib} +% \begin{macrocode} \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{natbib}} -\ExecuteOptions{2015,super} \ProcessOptions\relax % \end{macrocode} % -% 只在顺序编码时使用 \opt{sort\&compress}。 +% 调用宏包,注意只需要 \opt{compress} 不需要 \opt{sort}。 % \begin{macrocode} -\if@gbt@numerical - \PassOptionsToPackage{sort&compress}{natbib} -\fi -\RequirePackage{natbib} +\RequirePackage[compress]{natbib} \RequirePackage{url} % \end{macrocode} % @@ -477,51 +472,16 @@ version 2005/12/01 or later. \newcommand\bibstyle@super{\bibpunct{[}{]}{,}{s}{,}{\textsuperscript{,}}} \newcommand\bibstyle@numbers{\bibpunct{[}{]}{,}{n}{,}{,}} \newcommand\bibstyle@authoryear{\bibpunct{(}{)}{;}{a}{,}{,}} +\newcommand\bibstyle@inline{\bibstyle@numbers} % \end{macrocode} % \end{macro} % -% \begin{macro}{\gbtbibstyle} -% 定义接口切换参考文献表的风格,可选 \opt{authoryear} 和 \opt{numerical}, -% 这个仅用于\pkg{chapterbib}。 +% 在使用 \cs{bibliographystyle} 时自动切换引用文献的标注的样式。 % \begin{macrocode} -\newcommand\gbtbibstyle[1]{% - \@ifundefined{gbt@bib@#1}{% - \PackageError{gbt7714}{Invalid argument #1}{}% - }{% - \@nameuse{gbt@bib@#1} - }% -} -\newcommand\gbt@bib@numerical{% - \if@gbt@mmxv - \bibliographystyle{gbt7714-unsrt}% - \else - \bibliographystyle{gbt7714-2005-unsrt}% - \fi -} -\newcommand\gbt@bib@authoryear{% - \if@gbt@mmxv - \bibliographystyle{gbt7714-plain}% - \else - \bibliographystyle{gbt7714-2005-plain}% - \fi -} -% \end{macrocode} -% \end{macro} -% -% 处理宏包选项。 -% \begin{macrocode} -\if@gbt@numerical - \if@gbt@super - \citestyle{super}% - \gbtbibstyle{numerical}% - \else - \citestyle{numbers} - \gbtbibstyle{numerical}% - \fi -\else - \citestyle{authoryear} - \gbtbibstyle{authoryear}% -\fi +\@namedef{bibstyle@gbt7714-numerical}{\bibstyle@super} +\@namedef{bibstyle@gbt7714-author-year}{\bibstyle@authoryear} +\@namedef{bibstyle@gbt7714-2005-numerical}{\bibstyle@super} +\@namedef{bibstyle@gbt7714-2005-author-year}{\bibstyle@authoryear} % \end{macrocode} % % \begin{macro}{\cite} @@ -572,8 +532,6 @@ version 2005/12/01 or later. % % 在顺序编码制下,\pkg{natbib} 只有在三个以上连续文献引用才会使用连接号, % 这里修改为允许两个引用使用连接号。 -% \changes{v1.0.3}{2018/03/29}{顺序编码制连续两个文献引用之间使用连接号} -% \changes{v1.0.4}{2018/04/12}{页码的连接号由 en dash 改为 hyphen} % \begin{macrocode} % \ifx\NAT@last@yr\relax % \def@NAT@last@yr{\@citea}% @@ -762,10 +720,44 @@ version 2005/12/01 or later. \do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z } \Urlmuskip=0mu plus 0.1mu -%</package> % \end{macrocode} % \end{macro} % +% 兼容 v2.0 前过时的接口: +% \begin{macrocode} +\newif\ifgbt@bib@style@written +\@ifpackageloaded{chapterbib}{}{% + \def\bibliography#1{% + \ifgbt@bib@style@written\else + \bibliographystyle{gbt7714-numerical}% + \fi + \if@filesw + \immediate\write\@auxout{\string\bibdata{\zap@space#1 \@empty}}% + \fi + \@input@{\jobname.bbl}} + \def\bibliographystyle#1{% + \gbt@bib@style@writtentrue + \ifx\@begindocumenthook\@undefined\else + \expandafter\AtBeginDocument + \fi + {\if@filesw + \immediate\write\@auxout{\string\bibstyle{#1}}% + \fi}% + }% +} +\ifgbt@legacy@interface + \ifgbt@numerical + \ifgbt@super\else + \citestyle{numbers} + \fi + \bibliographystyle{gbt7714-numerical} + \else + \bibliographystyle{gbt7714-author-year} + \fi +\fi +%</package> +% \end{macrocode} +% % % % \section{BibTeX 样式的代码实现} @@ -787,6 +779,7 @@ INTEGERS { sentence.case.title link.title show.mark + show.medium.type slash.for.extraction in.booktitle italic.jounal @@ -864,6 +857,14 @@ FUNCTION {load.config} %</nomark> % \end{macrocode} % +% 是否显示载体类型标识(比如“/OL“): +% \begin{macrocode} + #1 'show.medium.type := +%<*no.medium.type> + #0 'show.medium.type := +%</no.medium.type> +% \end{macrocode} +% % 使用“//”表示析出文献 % \begin{macrocode} #1 'slash.for.extraction := @@ -2186,14 +2187,20 @@ FUNCTION {format.mark} medium empty$ not or entry.is.electronic or and %</thu> - { 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 := %<*!thu> "\allowbreak[" entry.mark * "]" * %</!thu> @@ -3914,14 +3921,16 @@ 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$ + " \def\doi#1{#1}\else" write$ newline$ - "\providecommand{\doi}[1]{\href{https://doi.org/#1}{#1}}" + " \def\doi#1{\href{https://doi.org/#1}{#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 new file mode 100644 index 00000000000..a2161d12a85 --- /dev/null +++ b/Master/texmf-dist/source/bibtex/gbt7714/gbt7714.ins @@ -0,0 +1,27 @@ +\input docstrip.tex +\keepsilent +\askforoverwritefalse +\preamble +------------------------------------------------------------------- +GB/T 7714-2015 BibTeX Style +https://github.com/CTeX-org/gbt7714-bibtex-style +Version: 2020/03/04 v2.0 +------------------------------------------------------------------- +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 +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. +------------------------------------------------------------------- +\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}} +} +\endbatchfile diff --git a/Master/texmf-dist/tex/latex/gbt7714/gbt7714.sty b/Master/texmf-dist/tex/latex/gbt7714/gbt7714.sty index 18bf8f8042b..92d2e5ed6b3 100644 --- a/Master/texmf-dist/tex/latex/gbt7714/gbt7714.sty +++ b/Master/texmf-dist/tex/latex/gbt7714/gbt7714.sty @@ -8,9 +8,9 @@ %% ------------------------------------------------------------------- %% GB/T 7714-2015 BibTeX Style %% https://github.com/CTeX-org/gbt7714-bibtex-style -%% Version: 2019/11/20 v1.1.2 +%% Version: 2020/03/04 v2.0 %% ------------------------------------------------------------------- -%% 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 @@ -22,59 +22,55 @@ %% ------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{gbt7714} - [2019/11/20 v1.1.2 GB/T 7714-2015 BibTeX Style] -\newif\if@gbt@mmxv -\newif\if@gbt@numerical -\newif\if@gbt@super -\DeclareOption{2015}{\@gbt@mmxvtrue} -\DeclareOption{2005}{\@gbt@mmxvfalse} -\DeclareOption{super}{\@gbt@numericaltrue\@gbt@supertrue} -\DeclareOption{numbers}{\@gbt@numericaltrue\@gbt@superfalse} -\DeclareOption{authoryear}{\@gbt@numericalfalse} + [2020/03/04 v2.0 GB/T 7714-2015 BibTeX Style] +\newif\ifgbt@legacy@interface +\newif\ifgbt@mmxv +\newif\ifgbt@numerical +\newif\ifgbt@super +\newcommand\gbt@obselete@option[1]{% + \PackageWarning{gbt7714}{The option "#1" is obselete}% +} +\DeclareOption{authoryear}{} + +\DeclareOption{2015}{% + \gbt@obselete@option{2015}% + \gbt@legacy@interfacetrue + \gbt@mmxvtrue +} +\DeclareOption{2005}{% + \gbt@obselete@option{2005}% + \gbt@legacy@interfacetrue + \gbt@mmxvfalse +} +\DeclareOption{super}{% + \gbt@obselete@option{super}% + \gbt@legacy@interfacetrue + \gbt@numericaltrue + \gbt@supertrue +} +\DeclareOption{numbers}{% + \gbt@obselete@option{numbers}% + \gbt@legacy@interfacetrue + \gbt@numericaltrue + \gbt@superfalse +} +\DeclareOption{authoryear}{% + \gbt@obselete@option{authoryear}% + \gbt@legacy@interfacetrue + \gbt@numericalfalse +} \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{natbib}} -\ExecuteOptions{2015,super} \ProcessOptions\relax -\if@gbt@numerical - \PassOptionsToPackage{sort&compress}{natbib} -\fi -\RequirePackage{natbib} +\RequirePackage[compress]{natbib} \RequirePackage{url} \newcommand\bibstyle@super{\bibpunct{[}{]}{,}{s}{,}{\textsuperscript{,}}} \newcommand\bibstyle@numbers{\bibpunct{[}{]}{,}{n}{,}{,}} \newcommand\bibstyle@authoryear{\bibpunct{(}{)}{;}{a}{,}{,}} -\newcommand\gbtbibstyle[1]{% - \@ifundefined{gbt@bib@#1}{% - \PackageError{gbt7714}{Invalid argument #1}{}% - }{% - \@nameuse{gbt@bib@#1} - }% -} -\newcommand\gbt@bib@numerical{% - \if@gbt@mmxv - \bibliographystyle{gbt7714-unsrt}% - \else - \bibliographystyle{gbt7714-2005-unsrt}% - \fi -} -\newcommand\gbt@bib@authoryear{% - \if@gbt@mmxv - \bibliographystyle{gbt7714-plain}% - \else - \bibliographystyle{gbt7714-2005-plain}% - \fi -} -\if@gbt@numerical - \if@gbt@super - \citestyle{super}% - \gbtbibstyle{numerical}% - \else - \citestyle{numbers} - \gbtbibstyle{numerical}% - \fi -\else - \citestyle{authoryear} - \gbtbibstyle{authoryear}% -\fi +\newcommand\bibstyle@inline{\bibstyle@numbers} +\@namedef{bibstyle@gbt7714-numerical}{\bibstyle@super} +\@namedef{bibstyle@gbt7714-author-year}{\bibstyle@authoryear} +\@namedef{bibstyle@gbt7714-2005-numerical}{\bibstyle@super} +\@namedef{bibstyle@gbt7714-2005-author-year}{\bibstyle@authoryear} \def\NAT@citexnum[#1][#2]#3{% \NAT@reset@parser \NAT@sort@cites{#3}% @@ -268,3 +264,33 @@ \do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z } \Urlmuskip=0mu plus 0.1mu +\newif\ifgbt@bib@style@written +\@ifpackageloaded{chapterbib}{}{% + \def\bibliography#1{% + \ifgbt@bib@style@written\else + \bibliographystyle{gbt7714-numerical}% + \fi + \if@filesw + \immediate\write\@auxout{\string\bibdata{\zap@space#1 \@empty}}% + \fi + \@input@{\jobname.bbl}} + \def\bibliographystyle#1{% + \gbt@bib@style@writtentrue + \ifx\@begindocumenthook\@undefined\else + \expandafter\AtBeginDocument + \fi + {\if@filesw + \immediate\write\@auxout{\string\bibstyle{#1}}% + \fi}% + }% +} +\ifgbt@legacy@interface + \ifgbt@numerical + \ifgbt@super\else + \citestyle{numbers} + \fi + \bibliographystyle{gbt7714-numerical} + \else + \bibliographystyle{gbt7714-author-year} + \fi +\fi |