<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \iffalse meta-comment
% GB/T 7714 BibTeX Style
% https://github.com/zepinglee/gbt7714-bibtex-style
%
% Copyright (c) 2016-2025 by Zeping Lee &lt;zepinglee AT gmail.com&gt;
%
% 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 2008 or later.
%
% \fi
%
% \iffalse
%&lt;package&gt;\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%&lt;package&gt;\ProvidesPackage{gbt7714}
%&lt;package&gt;  [2025/03/11 v2.1.7 GB/T 7714 BibTeX Style]
%
%&lt;*driver&gt;
\documentclass[a4paper]{l3doc}
\usepackage{hypdoc}
\usepackage[UTF8]{ctex}
\usepackage{fontspec}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{gbt7714}
\usepackage{hologo}
\usepackage{listings}
\makeatletter
\hypersetup{allcolors=blue}
\IfFileExists{/System/Library/Fonts/Palatino.ttc}{
  \setmainfont{Palatino}
  \setsansfont[Scale=MatchLowercase]{Helvetica}
  \setmonofont[Scale=MatchLowercase]{Menlo}
}{}
\citestyle{super}
\lstnewenvironment{latex}{%
  \lstset{
    basicstyle = \ttfamily\small,
    language = [LaTeX]TeX,
    gobble = 4,
    frame = single,
  }%
}{}
\lstnewenvironment{pseudocode}{%
  \lstset{
    basicstyle=\ttfamily\small,
    language=bash,
    gobble=2,
    frame=single,
  }%
}{}
\DeclareRobustCommand\file{\nolinkurl}
\DeclareRobustCommand\env{\texttt}
\DeclareRobustCommand\pkg{\textsf}
\DeclareRobustCommand\cls{\textsf}
\DeclareRobustCommand\opt{\texttt}
\setlength\partopsep{\z@}
\def\@listi{\leftmargin\leftmargini
            \parsep \z@
            \topsep 5\p@ \@plus2\p@ \@minus3\p@
        \itemsep\z@}
\let\@listI\@listi
\@listi
\makeatother
\EnableCrossrefs
\CodelineIndex
% \OnlyDescription

\begin{document}
  \DocInput{\jobname.dtx}
\end{document}
%&lt;/driver&gt;
% \fi
%
%
%
% \GetFileInfo{gbt7714.sty}
%
% \title{GB/T 7714 \hologo{BibTeX} style}
% \author{Zeping Lee\thanks{zepinglee AT gmail.com}}
% \date{\filedate\qquad\fileversion}
% \maketitle
%
%
%
% \begin{abstract}
% The \pkg{gbt7714} package provides a \BibTeX{} implementation for the China's
% national bibliography style standard GB/T 7714.
% It consists of \file{.bst} files for numeric and author-date styles as well as a
% \LaTeX{} package which provides the citation style defined in the standard.
% It is compatible with \pkg{natbib} and supports language detection (Chinese
% and English) for each biblilography entry.
% \end{abstract}
%
% \section{邂莉急
%
% GB/T 7714窶�2015 縲贋ｿ｡諱ｯ荳取枚迪ｮ\quad 蜿り�枚迪ｮ闡怜ｽ戊ｧ��縲欺cite{gbt7714-2015}
% �井ｻ･荳狗ｮ遘ｰ窶懷嵜譬�晢ｼ画弍荳ｭ蝗ｽ逧�盾閠�枚迪ｮ譬ｼ蠑乗耳闕先��㊥縲�
% 蝗ｽ蜀�噪扈晏､ｧ驛ｨ蛻�ｭｦ譛ｯ譛溷�縲∝ｭｦ菴崎ｮｺ譁��菴ｿ逕ｨ莠�渕莠手ｯ･譬�㊥逧��ｼ蠑上�
% 譛ｬ螳丞桁譏ｯ蝗ｽ譬�噪 \BibTeX{}\cite{bibtex} 螳樒鴫�悟�譛我ｻ･荳狗音諤ｧ��
% \begin{itemize}
%   \item 蜈ｼ螳ｹ \pkg{natbib} 螳丞桁\cite{natbib}縲�
%   \item 謾ｯ謖≫憺｡ｺ蠎冗ｼ也�∝宛窶晏柱窶懆送閠�-蜃ｺ迚亥ｹｴ蛻ｶ窶昜ｸ､遘埼｣取�ｼ縲�
%   \item 閾ｪ蜉ｨ隸�悪隸ｭ險蟷ｶ霑幄｡檎嶌蠎泌､�炊縲�
%   \item 謠蝉ｾ帑ｺ�ｮ蜊慕噪謗･蜿｣萓帷畑謌ｷ菫ｮ謾ｹ譬ｷ蠑上�
%   \item 蜷梧慮謠蝉ｾ帑ｺ� 2005 迚育噪 \file{.bst} 譁�ｻｶ縲�
% \end{itemize}
% 譛ｬ螳丞桁逧�ｸｻ鬘ｵ�喀url{https://github.com/zepinglee/gbt7714-bibtex-style}縲�
%
%
% \section{迚域悽 v2.0 逧�㍾隕∽ｿｮ謾ｹ}
%
% 莉� v2.0 迚域悽蠑蟋具ｼ�2020-03-04�会ｼ檎畑謌ｷ蠢�｡ｻ蝨ｨ譁�｡｣荳ｭ菴ｿ逕ｨ \cs{biblilographystyle} 蜻ｽ莉､騾画叫蜿り�枚迪ｮ譬ｷ蠑擾ｼ�
% 螯� \opt{gbt7714-numerical} 謌� \opt{gbt7714-author-year}縲�
% 蝨ｨ譌ｩ譛溽噪迚域悽荳ｭ�碁画叫譁�鍵譬ｷ蠑冗噪譁ｹ豕墓弍蟆� \opt{numbers} 謌� \opt{super} 遲牙盾謨ｰ莨�騾堤ｻ�
% \pkg{gbt7714}��
% 閠御ｸ崎�菴ｿ逕ｨ \cs{bibliographystyle}縲�
% 霑呵ｷ滓��㊥逧� LaTeX 謗･蜿｣荳堺ｸ閾ｴ�梧園莉･蟆�｢ｫ蠑�畑縲�
%
%
% \section{菴ｿ逕ｨ譁ｹ豕扶
%
% 莉･荳区弍 \pkg{gbt7714} 螳丞桁逧�ｸ荳ｪ邂蜊慕､ｺ萓九�
% \begin{latex}
%   \documentclass{ctexart}
%   \usepackage{gbt7714}
%   \bibliographystyle{gbt7714-numerical}
%   \begin{document}
%     \cite{...}
%     ...
%     \bibliography{bibfile}
%   \end{document}
% \end{latex}
%
% 謖臥�蝗ｽ譬�噪隗�ｮ夲ｼ悟盾閠�枚迪ｮ逧���ｳｨ菴鍋ｳｻ蛻�ｸｺ窶憺｡ｺ蠎冗ｼ也�∝宛窶晏柱
% 窶懆送閠�-蜃ｺ迚亥ｹｴ蛻ｶ窶昴�
% 逕ｨ謌ｷ蠎泌惠蟇ｼ險蛹ｺ隹�畑螳丞桁 \pkg{gbt7714}�悟ｹｶ荳比ｽｿ逕ｨ \cs{bibliographystyle}
% 蜻ｽ莉､騾画叫蜿り�枚迪ｮ陦ｨ逧��ｷ蠑擾ｼ梧ｯ泌ｦゑｼ�
% \begin{latex}
%   \bibliographystyle{gbt7714-numerical}  % 鬘ｺ蠎冗ｼ也�∝宛
% \end{latex}
% 謌冶�
% \begin{latex}
%   \bibliographystyle{gbt7714-author-year}  % 闡苓�-蜃ｺ迚亥ｹｴ蛻ｶ
% \end{latex}
% 豁､螟冶ｿ伜庄莉･菴ｿ逕ｨ 2005 迚育噪譬ｼ蠑� \file{gbt7714-2005-numerical} 蜥�
% \file{gbt7714-2005-author-year}縲�
%
% 豕ｨ諢擾ｼ檎沿譛ｬ v2.0 譖ｴ謾ｹ莠�ｮｾ鄂ｮ蜿り�枚迪ｮ陦ｨ譬ｷ蠑冗噪譁ｹ豕包ｼ�
% 隕∵ｱら峩謗･菴ｿ逕ｨ \cs{bibliographystyle}�御ｸ榊�菴ｿ逕ｨ螳丞桁逧�盾謨ｰ��
% 閠御ｸ疲峩謾ｹ莠� \file{bst} 逧�枚莉ｶ蜷阪�
%
% \begin{function}{\citestyle}
%   \begin{syntax}
%     |\citestyle|\Arg{citation style}
%   \end{syntax}
% 蜿ｯ騾会ｼ喀opt{super}, \opt{numbers}, \opt{author-year}縲�
% 菴ｿ逕ｨ \cs{bibliography} 騾画叫蜿り�枚迪ｮ陦ｨ逧��ｷ蠑乗慮莨夊�蜉ｨ隶ｾ鄂ｮ蟇ｹ蠎皮噪蠑慕畑譬ｷ蠑上�
% 鬘ｺ蠎冗ｼ也�∝宛逧�ｼ慕畑譬�ｳｨ鮟倩ｮ､菴ｿ逕ｨ隗呈��ｼ擾ｼ�\opt{super}�会ｼ�
% 螯や懷ｼ�荳噂textsuperscript{[2]}謠仙�窶昴�
% 螯よ棡隕∽ｽｿ逕ｨ豁｣譁�ｨ｡蠑擾ｼ悟ｦや懈枚迪ｮ [3] 荳ｭ隸ｴ譏寂晢ｼ�
% 蜿ｯ莉･菴ｿ逕ｨ \cs{citestyle} 蜻ｽ莉､蛻�困荳ｺ謨ｰ蟄怜ｼ擾ｼ�\opt{numbers}�峨�
% \begin{latex}
%   \citestyle{numbers}
% \end{latex}
% 闡苓�-蜃ｺ迚亥ｹｴ蛻ｶ騾壼ｸｸ荳埼怙隕∽ｿｮ謾ｹ蠑慕畑譬ｷ蠑上�
% \end{function}
%
% \DescribeOption{sort\&amp;compress}
% 蜷御ｸ螟�ｼ慕畑螟夂ｯ�枚迪ｮ譌ｶ�悟ｺ泌ｽ灘ｰ�推遽�枚迪ｮ逧� key 荳蜷悟�蝨ｨ \cs{cite} 蜻ｽ莉､荳ｭ縲�
% 螯る∞霑樒ｻｭ郛門捷�碁ｻ倩ｮ､莨夊�蜉ｨ霓ｬ荳ｺ襍ｷ隶ｫ蠎丞捷蟷ｶ逕ｨ遏ｭ讓ｪ郤ｿ霑樊磁
% �郁ｧ―pkg{natbib} 逧� \opt{compress} 騾蛾｡ｹ�峨�
% 螯よ棡隕∝ｯｹ蠑慕畑逧�ｼ門捷霑幄｡瑚�蜉ｨ謗貞ｺ擾ｼ碁怙隕∝惠隹�畑 \pkg{gbt7714} 譌ｶ蜉�
% \opt{sort\&amp;compress} 蜿よ焚��
% 霑吩ｺ帛盾謨ｰ莨壻ｼ�扈� \pkg{natbib} 螟�炊縲�
% \begin{latex}
%   \usepackage[sort&amp;compress]{gbt7714}
% \end{latex}
% 豕ｨ諢丞嵜譬�ｸｭ隕∵ｱ� 2 荳ｪ謌紋ｻ･荳顔噪霑樒ｻｭ郛門捷逕ｨ霑樊磁蜿ｷ�御ｸ榊酔莠� \pkg{natbib} 鮟倩ｮ､逧� 3 荳ｪ謌紋ｻ･荳翫�
% 螳丞桁荳ｭ蟾ｲ扈丈ｽ應ｺ�ｿｮ謾ｹ縲�
%
% 闍･髴隕∵���蠑墓枚逧�｡ｵ遐�ｼ悟庄莉･譬�惠 \cs{cite} 逧�庄騾牙盾謨ｰ荳ｭ�悟ｦ�
% |\cite[42]{knuth84}|縲�
% 譖ｴ螟夂噪蠑慕畑譬�ｳｨ譁ｹ豕募庄莉･蜿り� \pkg{natbib} 螳丞桁逧�ｽｿ逕ｨ隸ｴ譏蚕cite{natbib}縲�
%
% 菴ｿ逕ｨ譌ｶ髴隕∵ｳｨ諢丈ｻ･荳句�轤ｹ��
% \begin{itemize}
%   \item \file{.bib} 謨ｰ謐ｮ蠎灘ｺ比ｽｿ逕ｨ UTF-8 郛也�√�
%   \item 菴ｿ逕ｨ闡苓�-蜃ｺ迚亥ｹｴ蛻ｶ蜿り�枚迪ｮ陦ｨ譌ｶ�御ｸｭ譁�噪譁�鍵\emph{蠢�｡ｻ}
%         蝨ｨ key 蝓溷｡ｫ蜀吩ｽ懆�ｧ灘錐逧�蕎髻ｳ�梧燕閭ｽ謖臥�諡ｼ髻ｳ謗貞ｺ擾ｼ�
%         隸ｦ隗∫ｬｬ~\ref{sec:sort}~闃ゅ�
% \end{itemize}
%
%
% \section{譁�鍵邀ｻ蝙急
%
% 蝗ｽ譬�ｸｭ隗�ｮ壻ｺ� 16 遘榊盾閠�枚迪ｮ邀ｻ蝙具ｼ�
% 陦ｨ~\ref{tab:entry-types} 蛻嶺ｸｾ莠� \file{bib} 謨ｰ謐ｮ蠎謎ｸｭ蟇ｹ蠎皮噪譁�鍵邀ｻ蝙九�
% 霑吩ｺ帛ｰｽ蜿ｯ閭ｽ蜈ｼ螳ｹ \BibTeX{} 蜥� \pkg{biblatex} 逧���㊥邀ｻ蝙具ｼ御ｽ�弍譁ｰ蠅樔ｺ�凶蟷ｲ譁�鍵邀ｻ蝙具ｼ亥ｸｦ * 蜿ｷ�峨�
%
% \begin{table}[htb]
%   \centering\small
%   \caption{蜈ｨ驛ｨ譁�鍵邀ｻ蝙急
%   \label{tab:entry-types}
%   \begin{tabular}{lcl}
%     \toprule
%     譁�鍵邀ｻ蝙�         &amp; 譬�ｯ�ｻ｣遐� &amp; Entry Type                  \\
%     \midrule
%     譎ｮ騾壼崟荵ｦ         &amp; M        &amp; book                        \\
%     蝗ｾ荵ｦ逧�梵蜃ｺ譁�鍵   &amp; M        &amp; incollection                \\
%     莨夊ｮｮ蠖�           &amp; C        &amp; proceedings                 \\
%     莨夊ｮｮ蠖慕噪譫仙�譁�鍵 &amp; C        &amp; inproceedings 謌� conference \\
%     豎�ｼ�             &amp; G        &amp; collection*                 \\
%     謚･郤ｸ             &amp; N        &amp; newspaper*                  \\
%     譛溷�逧�梵蜃ｺ譁�鍵   &amp; J        &amp; article                     \\
%     蟄ｦ菴崎ｮｺ譁�         &amp; D        &amp; mastersthesis 謌� phdthesis  \\
%     謚･蜻�             &amp; R        &amp; techreport                  \\
%     譬�㊥             &amp; S        &amp; standard*                   \\
%     荳灘茜             &amp; P        &amp; patent*                     \\
%     謨ｰ謐ｮ蠎�           &amp; DB       &amp; database*                   \\
%     隶｡邂玲惻遞句ｺ�       &amp; CP       &amp; software*                   \\
%     逕ｵ蟄仙�蜻�         &amp; EB       &amp; online*                     \\
%     譯｣譯�             &amp; A        &amp; archive*                    \\
%     闊�崟             &amp; CM       &amp; map*                        \\
%     謨ｰ謐ｮ髮�           &amp; DS       &amp; dataset*                    \\
%     蜈ｶ莉�             &amp; Z        &amp; misc                        \\
%     \bottomrule
%   \end{tabular}
% \end{table}
%
%
% \section{闡怜ｽ暮｡ｹ逶ｮ}
%
% 逕ｱ莠主嵜譬�ｸｭ隗�ｮ夂噪闡怜ｽ暮｡ｹ逶ｮ螟壻ｺ� \BibTeX{} 逧���㊥蝓滂ｼ�
% 蠢�｡ｻ譁ｰ蠅樔ｸ莠幄送蠖暮｡ｹ逶ｮ�亥ｸｦ * 蜿ｷ�会ｼ�
% 霑吩ｺ帶眠蠅樒噪邀ｻ蝙句惠隶ｾ隶｡譌ｶ蜿り�ｺ� BibLaTeX�悟ｦ� date 蜥� urldate縲�
% 譛ｬ螳丞桁謾ｯ謖∫噪蜈ｨ驛ｨ蝓溷ｦゆｸ具ｼ�
% \begin{description}
%   \item[author]       荳ｻ隕∬ｴ｣莉ｻ閠�
%   \item[title]        鬚伜錐
%   \item[mark*]        譁�鍵邀ｻ蝙区��ｯ�
%   \item[medium*]      霓ｽ菴鍋ｱｻ蝙区��ｯ�
%   \item[translator*]  隸題�
%   \item[editor]       郛冶ｾ�
%   \item[organization] 扈�ｻ�ｼ育畑莠惹ｼ夊ｮｮ��
%   \item[booktitle]    蝗ｾ荵ｦ鬚伜錐
%   \item[series]       邉ｻ蛻�
%   \item[journal]      譛溷�鬚伜錐
%   \item[edition]      迚域悽
%   \item[address]      蜃ｺ迚亥慍
%   \item[publisher]    蜃ｺ迚郁�
%   \item[school]       蟄ｦ譬｡�育畑莠� \texttt{@phdthesis}��
%   \item[institution]  譛ｺ譫�ｼ育畑莠� \texttt{@techreport}��
%   \item[year]         蜃ｺ迚亥ｹｴ
%   \item[volume]       蜊ｷ
%   \item[number]       譛滂ｼ域�閠�ｸ灘茜蜿ｷ��
%   \item[pages]        蠑墓枚鬘ｵ遐�
%   \item[date*]        譖ｴ譁ｰ謌紋ｿｮ謾ｹ譌･譛�
%   \item[urldate*]     蠑慕畑譌･譛�
%   \item[url]          闔ｷ蜿門柱隶ｿ髣ｮ霍ｯ蠕�
%   \item[doi]          謨ｰ蟄怜ｯｹ雎｡蜚ｯ荳譬�ｯ�ｬｦ
%   \item[langid*]      隸ｭ險
%   \item[key]          諡ｼ髻ｳ�育畑莠取賜蠎擾ｼ�
% \end{description}
% 荳肴髪謖∫噪 \BibTeX{} 譬�㊥闡怜ｽ暮｡ｹ逶ｮ譛� annote, chapter, crossref, month, type縲�
%
% 譛ｬ螳丞桁鮟倩ｮ､諠��荳句庄莉･閾ｪ蜉ｨ隸�悪譁�鍵隸ｭ險�悟ｹｶ閾ｪ蜉ｨ螟�炊譁�鍵邀ｻ蝙句柱霓ｽ菴鍋ｱｻ蝙区��ｯ�ｼ�
% 菴�弍蝨ｨ蟆第焚諠��荳矩怙隕∫畑謌ｷ謇句勘謖�ｮ夲ｼ悟ｦゑｼ�
% \begin{latex}
%   @misc{citekey,
%     langid = {japanese},
%     mark   = {Z},
%     medium = {DK},
%     ...
%   }
% \end{latex}
% 蜿ｯ騾臥噪隸ｭ險譛� english, chinese, japanese, russian縲�
%
%
% \section{譁�鍵蛻苓｡ｨ逧�賜蠎殉
% \label{sec:sort}
%
% 蝗ｽ譬�ｧ�ｮ壼盾閠�枚迪ｮ陦ｨ驥�畑闡苓�-蜃ｺ迚亥ｹｴ蛻ｶ扈�ｻ�慮�悟推遽�枚迪ｮ鬥門�謖画枚遘埼寔荳ｭ��
% 辟ｶ蜷取潔闡苓�ｭ鈴｡ｺ蜥悟�迚亥ｹｴ謗貞���
% 荳ｭ譁�枚迪ｮ蜿ｯ莉･謖芽送閠�ｱ芽ｯｭ諡ｼ髻ｳ蟄鈴｡ｺ謗貞��御ｹ溷庄莉･謖芽送閠�噪隨皮判隨秘｡ｺ謗貞�縲�
% 辟ｶ閠檎罰莠� \BibTeX{} 蜉溯�逧�ｱ髯先ｧ�梧裏豕戊�蜉ｨ闔ｷ蜿冶送閠�ｧ灘錐逧�蕎髻ｳ謌也ｬ皮判隨秘｡ｺ��
% 謇莉･\emph{蠢�｡ｻ}蝨ｨ bib 謨ｰ謐ｮ蠎謎ｸｭ逧� key 蝓滓焔蜉ｨ蠖募�闡苓�ｧ灘錐逧�蕎髻ｳ逕ｨ莠取賜蠎擾ｼ悟ｦゑｼ�
% \begin{latex}
%   @book{capital,
%     author = {鬩ｬ蜈区� and 諱ｩ譬ｼ譁ｯ},
%     key    = {ma3 ke4 si1 &amp; en1 ge2 si1},
%     ...
%   }
% \end{latex}
%
% 蟇ｹ莠手送閠�-蜃ｺ迚亥ｹｴ逧��ｷ蠑擾ｼ悟ｦよ棡荳ｭ譁�枚迪ｮ霎�､壽慮譖ｴ謗ｨ闕蝉ｽｿ逕ｨ \pkg{biblatex} 螳丞桁��
% 蜈ｶ蜷守ｫｯ \file{biber} 蜿ｯ莉･閾ｪ蜉ｨ螟�炊荳ｭ譁�潔辣ｧ諡ｼ髻ｳ謗貞ｺ擾ｼ梧裏鬘ｻ謇句勘蝪ｫ蜀呎蕎髻ｳ縲�
%
%
% \section{閾ｪ螳壻ｹ画�ｷ蠑殉
%
% \BibTeX{} 蟇ｹ閾ｪ螳壻ｹ画�ｷ蠑冗噪謾ｯ謖∵ｯ碑ｾ�怏髯撰ｼ�
% 謇莉･逕ｨ謌ｷ蜿ｪ閭ｽ騾夊ｿ�ｿｮ謾ｹ \file{bst} 譁�ｻｶ譚･菫ｮ謾ｹ譁�鍵蛻苓｡ｨ逧��ｼ蠑上�
% 譛ｬ螳丞桁謠蝉ｾ帑ｺ�ｸ莠帶磁蜿｣萓帷畑謌ｷ譖ｴ譁ｹ萓ｿ蝨ｰ菫ｮ謾ｹ縲�
%
% 蝨ｨ \file{bst} 譁�ｻｶ蠑蟋句､�噪 |load.config| 蜃ｽ謨ｰ荳ｭ��
% 譛我ｸ扈��鄂ｮ蜿よ焚逕ｨ譚･謗ｧ蛻ｶ譬ｷ蠑擾ｼ瑚｡ｨ~\ref{tab:config} 蛻怜�莠�ｯ丈ｸ鬘ｹ逧�ｻ倩ｮ､蛟ｼ蜥悟粥閭ｽ縲�
% 闍･蜿倬㍼陲ｫ隶ｾ荳ｺ |#1| 蛻呵｡ｨ遉ｺ隸･鬘ｹ陲ｫ蜷ｯ逕ｨ�瑚ｮｾ荳ｺ |#0| 蛻吩ｸ榊星逕ｨ縲�
% 鮟倩ｮ､逧�ｼ譏ｯ荳･譬ｼ驕ｵ蠕ｪ蝗ｽ譬�噪驟咲ｽｮ縲�
%
% \begin{table}[htb]
% \centering\small
% \caption{蜿り�枚迪ｮ陦ｨ譬ｷ蠑冗噪驟咲ｽｮ蜿よ焚}
% \label{tab:config}
% \begin{tabular}{lcl}
%   \toprule
%   蜿よ焚蛟ｼ                         &amp; 鮟倩ｮ､蛟ｼ &amp; 蜉溯�                           \\
%   \midrule
%   uppercase.name                 &amp; |#1|   &amp; 蟆�送閠�ｧ灘錐霓ｬ荳ｺ螟ｧ蜀�             \\
%   max.num.authors                &amp; |#3|   &amp; 霎灘�闡苓�噪譛螟壽焚驥�             \\
%   year.after.author              &amp; |#0|   &amp; 蟷ｴ莉ｽ鄂ｮ莠手送閠�ｹ句錘               \\
%   period.after.author            &amp; |#0|   &amp; 闡苓�柱蟷ｴ莉ｽ荵矩龍菴ｿ逕ｨ蜿･轤ｹ霑樊磁     \\
%   italic.book.title              &amp; |#0|   &amp; 隘ｿ譁�ｹｦ邀榊錐菴ｿ逕ｨ譁應ｽ�             \\
%   sentence.case.title            &amp; |#1|   &amp; 蟆�･ｿ譁�噪鬚伜錐霓ｬ荳ｺ sentence case \\
%   link.title                     &amp; |#0|   &amp; 蝨ｨ鬚伜錐荳頑ｷｻ蜉� url 逧�ｶ�得謗･      \\
%   title.in.journal               &amp; |#1|   &amp; 譛溷�譏ｯ蜷ｦ譏ｾ遉ｺ譬�｢�               \\
%   show.patent.country            &amp; |#0|   &amp; 荳灘茜鬚伜錐譏ｯ蜷ｦ蜷ｫ蝗ｽ蛻ｫ             \\
%   space.before.mark              &amp; |#0|   &amp; 譁�鍵邀ｻ蝙区��ｯ�燕譏ｯ蜷ｦ譛臥ｩｺ譬ｼ       \\
%   show.mark                      &amp; |#1|   &amp; 譏ｾ遉ｺ譁�鍵邀ｻ蝙区��ｯ�               \\
%   show.medium.type               &amp; |#1|   &amp; 譏ｾ遉ｺ霓ｽ菴鍋ｱｻ蝙区��ｯ�               \\
%   component.part.label           &amp; |"slash"| &amp; 陦ｨ遉ｺ譫仙�譁�鍵逧�ｬｦ蜿ｷ�悟庄騾会ｼ嘶"in"|, |"none"| \\
%   italic.journal                 &amp; |#0|   &amp; 隘ｿ譁�悄蛻雁錐菴ｿ逕ｨ譁應ｽ�             \\
%   link.journal                   &amp; |#0|   &amp; 蝨ｨ譛溷�鬚伜錐荳頑ｷｻ蜉� url 逧�ｶ�得謗･      \\
%   show.missing.address.publisher &amp; |#0|   &amp; 蜃ｺ迚磯｡ｹ郛ｺ螟ｱ譌ｶ譏ｾ遉ｺ窶懷�迚郁�ｸ崎ｯｦ窶�   \\
%   space.before.pages             &amp; |#1|   &amp; 鬘ｵ遐∽ｸ主燕髱｢逧��蜿ｷ荵矩龍譛臥ｩｺ譬ｼ     \\
%   only.start.page                &amp; |#0|   &amp; 蜿ｪ譏ｾ遉ｺ襍ｷ蟋矩｡ｵ遐�                 \\
%   wave.dash.in.pages             &amp; |#0|   &amp; 襍ｷ豁｢鬘ｵ遐∽ｽｿ逕ｨ豕｢豬ｪ蜿ｷ             \\
%   show.urldate                   &amp; |#1|   &amp; 譏ｾ遉ｺ蠑慕畑譌･譛� urldate           \\
%   show.url                       &amp; |#1|   &amp; 譏ｾ遉ｺ url                       \\
%   show.doi                       &amp; |#1|   &amp; 譏ｾ遉ｺ DOI                       \\
%   show.preprint                  &amp; |#1|   &amp; 譏ｾ遉ｺ鬚�魂譛ｬ菫｡諱ｯ                 \\
%   show.note                      &amp; |#0|   &amp; 譏ｾ遉ｺ note 蝓溽噪菫｡諱ｯ             \\
%   end.with.period                &amp; |#1|   &amp; 扈灘ｰｾ蜉�蜿･轤ｹ                     \\
%   \bottomrule
% \end{tabular}
% \end{table}
%
% 闍･逕ｨ謌ｷ髴隕∝ｮ壼宛譖ｴ螟壼�螳ｹ�悟庄莉･蟄ｦ荵� \file{bst} 譁�ｻｶ逧�ｯｭ豕募ｹｶ菫ｮ謾ｹ
% \cite{btxhak,ttb,tlc2}�梧�閠�＃邉ｻ菴懆��
%
%
% \section{逶ｸ蜈ｳ蟾･菴怡
%
% TeX 遉ｾ蛹ｺ荵滓怏蜈ｶ莉門�莠� GB/T 7714 邉ｻ蛻怜盾閠�枚迪ｮ譬�㊥逧�ｷ･菴懊�
% 2005 蟷ｴ蜷ｴ蜃ｯ\cite{wk2006}蜿大ｸ�ｺ�渕莠� GB/T 7714窶�2005 逧� \BibTeX{} 譬ｷ蠑擾ｼ�
% 謾ｯ謖�｡ｺ蠎冗ｼ也�∝宛蜥瑚送閠��迚亥ｹｴ蛻ｶ荳､遘埼｣取�ｼ縲�
% 譚主ｿ怜･Ⅸcite{lqz2013}蜿大ｸ�ｺ�ｸ･譬ｼ驕ｵ蠕ｪ GB/T 7714窶�2005 逧� BibLaTeX 逧��ｷ蠑上�
% 閭｡豬ｷ譏歃cite{hhx2013}謠蝉ｾ帑ｺ�嘗荳荳ｪ \BibTeX{} 螳樒鴫��
% 霑倡ｻ呎ｯ剰｡� bst 莉｣遐∝�莠� java 隸ｭ險豕ｨ驥翫�
% 豐亥捉\cite{sz2016}蝓ｺ莠� \pkg{biblatex-caspervector}\cite{vector2012} 霑幄｡御ｿｮ謾ｹ��
% 莉･隨ｦ蜷亥嵜譬�噪譬ｼ蠑上�
% 閭｡謖ｯ髴�書蟶�ｺ�ｬｦ蜷� GB/T 7714窶�2015 譬�㊥逧� BibLaTeX 蜿り�枚迪ｮ譬ｷ蠑十cite{hzz2016}��
% 蟷ｶ霑幄｡御ｺ�ｯ碑ｾ�ｮ悟埋逧�戟扈ｭ扈ｴ謚､縲�
%
%
% \begin{thebibliography}{12}
% \providecommand{\natexlab}[1]{#1}
% \providecommand{\url}[1]{#1}
% \expandafter\ifx\csname urlstyle\endcsname\relax\relax\else
%   \urlstyle{same}\fi
% \providecommand{\href}[2]{\url{#2}}
% \providecommand{\doi}[1]{\href{https://doi.org/#1}{#1}}
%
% \bibitem[{荳ｭ蝗ｽ蝗ｽ螳ｶ譬�㊥蛹門ｧ泌遭莨嘲(2015)]{gbt7714-2015}
% {荳ｭ蝗ｽ蝗ｽ螳ｶ譬�㊥蛹門ｧ泌遭莨嘲.
% \newblock 菫｡諱ｯ荳取枚迪ｮ\quad 蜿り�枚迪ｮ闡怜ｽ戊ｧ��: GB/T
%   7714窶�2015[S].
% \newblock 蛹嶺ｺｬ: 荳ｭ蝗ｽ譬�㊥蜃ｺ迚育､ｾ, 2015.
%
% \bibitem[Patashnik(1988{\natexlab{a}})]{bibtex}
% PATASHNIK~O.
% \newblock {\BibTeX}ing[M/OL].
% \newblock 1988{\natexlab{a}}.
% \newblock \url{http://mirrors.ctan.org/biblio/bibtex/base/btxdoc.pdf}.
%
% \bibitem[Daly(1999)]{natbib}
% DALY~P~W.
% \newblock Natural sciences citations and references[M/OL].
% \newblock 1999.
% \newblock \url{http://mirrors.ctan.org/macros/latex/contrib/natbib/natbib.pdf}.
%
% \bibitem[Patashnik(1988{\natexlab{b}})]{btxhak}
% PATASHNIK~O.
% \newblock Designing {\BibTeX} styles[M/OL].
% \newblock 1988{\natexlab{b}}.
% \newblock \url{http://mirrors.ctan.org/biblio/bibtex/base/btxhak.pdf}.
%
% \bibitem[Markey(2003)]{ttb}
% MARKEY~N.
% \newblock Tame the beast[M/OL].
% \newblock 2003.
% \newblock \url{http://mirrors.ctan.org/info/bibtex/tamethebeast/ttb_en.pdf}.
%
% \bibitem[Mittelbach et~al.(2004)Mittelbach, Goossens, Braams, Carlisle, and
%   Rowley]{tlc2}
% MITTELBACH~F, GOOSSENS~M, BRAAMS~J, et~al.
% \newblock The {\LaTeX} companion[M].
% \newblock 2nd ed.
% \newblock Reading, MA, USA: Addison-Wesley, 2004.
%
% \bibitem[蜷ｴ蜃ｯ(2006)]{wk2006}
% 蜷ｴ蜃ｯ.
% \newblock 蜿大ｸエBT7714-2005.bst version1 Beta迚�[EB/OL].
% \newblock 2006.
% \newblock CTeX 隶ｺ蝮幢ｼ亥ｷｲ蜈ｳ髣ｭ��.
%
% \bibitem[譚主ｿ怜･�(2013)]{lqz2013}
% 譚主ｿ怜･�.
% \newblock
%   蝓ｺ莠暫iblatex逧�ｬｦ蜷�GBT7714窶�2005逧�ｸｭ譁�枚迪ｮ逕滓�蟾･蜈ｷ[EB/OL].
% \newblock 2013.
% \newblock CTeX 隶ｺ蝮幢ｼ亥ｷｲ蜈ｳ髣ｭ��.
%
% \bibitem[閭｡豬ｷ譏�(2013)]{hhx2013}
% 閭｡豬ｷ譏�.
% \newblock A GB/T 7714窶�2005 national standard compliant BibTeX
%   style[EB/OL].
% \newblock 2013.
% \newblock \url{https://github.com/Haixing-Hu/GBT7714-2005-BibTeX-Style}.
%
% \bibitem[豐亥捉(2016)]{sz2016}
% 豐亥捉.
% \newblock 蝓ｺ莠残aspervector謾ｹ蜀咏噪隨ｦ蜷�GB/T
%   7714窶�2005譬�㊥逧�盾閠�枚迪ｮ譬ｼ蠑充EB/OL].
% \newblock 2016.
% \newblock \url{https://github.com/szsdk/biblatex-gbt77142005}.
%
% \bibitem[Vector(2012)]{vector2012}
% VECTOR~C~T.
% \newblock biblatex 蜿り�枚迪ｮ蜥悟ｼ慕畑譬ｷ蠑�: caspervector[M/OL].
% \newblock 2012.
% \newblock
%   \url{http://mirrors.ctan.org/macros/latex/contrib/biblatex-contrib/biblatex-caspervector/doc/caspervector.pdf}.
%
% \bibitem[閭｡謖ｯ髴�(2016)]{hzz2016}
% 閭｡謖ｯ髴�.
% \newblock 隨ｦ蜷� GB/T 7714窶�2015 譬�㊥逧� biblatex
%   蜿り�枚迪ｮ譬ｷ蠑充M/OL].
% \newblock 2016.
% \newblock
%   \url{http://mirrors.ctan.org/macros/latex/contrib/biblatex-contrib/biblatex-gb7714-2015/biblatex-gb7714-2015.pdf}.
%
% \end{thebibliography}
%
%
%
%
% \clearpage
% \appendix
% \StopEventually{}
%
% \section{螳丞桁逧�ｻ｣遐∝ｮ樒鴫}
%
% 蜈ｼ螳ｹ霑�慮逧�磁蜿｣
%    \begin{macrocode}
%&lt;*package&gt;
\newif\ifgbt@legacy@interface
\newif\ifgbt@mmxv
\newif\ifgbt@numerical
\newif\ifgbt@super
\newcommand\gbt@obsolete@option[1]{%
  \PackageWarning{gbt7714}{The option "#1" is obsolete}%
}
\DeclareOption{2015}{%
  \gbt@obsolete@option{2015}%
  \gbt@legacy@interfacetrue
  \gbt@mmxvtrue
}
\DeclareOption{2005}{%
  \gbt@obsolete@option{2005}%
  \gbt@legacy@interfacetrue
  \gbt@mmxvfalse
}
\DeclareOption{super}{%
  \gbt@obsolete@option{super}%
  \gbt@legacy@interfacetrue
  \gbt@numericaltrue
  \gbt@supertrue
}
\DeclareOption{numbers}{%
  \gbt@obsolete@option{numbers}%
  \gbt@legacy@interfacetrue
  \gbt@numericaltrue
  \gbt@superfalse
}
\DeclareOption{authoryear}{%
  \gbt@obsolete@option{authoryear}%
  \gbt@legacy@interfacetrue
  \gbt@numericalfalse
}
%    \end{macrocode}
%
% 蟆�蛾｡ｹ莨�騾堤ｻ� \pkg{natbib}
%    \begin{macrocode}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{natbib}}
\ProcessOptions\relax
%    \end{macrocode}
%
% 隹�畑螳丞桁�梧ｳｨ諢丞宵髴隕� \opt{compress} 荳埼怙隕� \opt{sort}縲�
%    \begin{macrocode}
\RequirePackage{natbib}
\RequirePackage{url}
%    \end{macrocode}
%
% 螯よ棡蟆� \opt{compress} 莨�扈� \pkg{natbib} 螳ｹ譏灘ｯｼ閾ｴ option clash縲�
% 霑咎㈹逶ｴ謗･菫ｮ謾ｹ蜀�Κ蜻ｽ莉､縲�
%    \begin{macrocode}
\def\NAT@cmprs{\@ne}
%    \end{macrocode}
%
% \begin{macro}{\citestyle}
% 螳壻ｹ画磁蜿｣蛻�困蠑慕畑譁�鍵逧���ｳｨ豕包ｼ悟庄逕ｨ \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}{,}{,}}
\newcommand\bibstyle@inline{\bibstyle@numbers}
%    \end{macrocode}
% \end{macro}
%
% 蝨ｨ菴ｿ逕ｨ \cs{bibliographystyle} 譌ｶ閾ｪ蜉ｨ蛻�困蠑慕畑譁�鍵逧���ｳｨ逧��ｷ蠑上�
%    \begin{macrocode}
\@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}
% 荳矩擇菫ｮ謾ｹ \pkg{natbib} 逧�ｼ慕畑譬ｼ蠑上�
% 荳ｺ莠�㍼蟆台ｾ晁ｵ也噪螳丞桁�瑚ｿ咎㈹逶ｴ謗･驥榊ｮ壻ｹ牙多莉､荳堺ｽｿ逕ｨ \pkg{etoolbox} 逧� \cs{patchcmd}縲�
%
% Super 譬ｷ蠑冗噪 \cs{citep} 逧�｡ｵ遐∽ｹ滉ｸｺ荳頑���
% 蜿ｦ螟門刈荳� |\kern\p@| 蜴ｻ謗我ｸ頑��ｼ丞ｼ慕畑蜷惹ｸ惹ｸｭ譁�ｹ矩龍螟壻ｽ咏噪遨ｺ譬ｼ��
% 蜿り� \href{https://github.com/tuna/thuthesis/issues/624}{tuna/thuthesis\#624}縲�
%    \begin{macrocode}
\renewcommand\NAT@citesuper[3]{%
  \ifNAT@swa
    \if*#2*\else
      #2\NAT@spacechar
    \fi
    % \unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close}%
    %  \if*#3*\else\NAT@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@citenum[3]{%
  \ifNAT@swa
    \NAT@@open
    \if*#2*\else
      #2\NAT@spacechar
    \fi
    % #1\if*#3*\else\NAT@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} 逧�｡ｵ遐�ｼ�
%    \begin{macrocode}
\def\NAT@citexnum[#1][#2]#3{%
  \NAT@reset@parser
  \NAT@sort@cites{#3}%
  \NAT@reset@citea
  \@cite{\def\NAT@num{-1}\let\NAT@last@yr\relax\let\NAT@nm\@empty
    \@for\@citeb:=\NAT@cite@list\do
    {\@safe@activestrue
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
     \@safe@activesfalse
     \@ifundefined{b@\@citeb\@extra@b@citeb}{%
       {\reset@font\bfseries?}
        \NAT@citeundefined\PackageWarning{natbib}%
       {Citation `\@citeb' on page \thepage \space undefined}}%
     {\let\NAT@last@num\NAT@num\let\NAT@last@nm\NAT@nm
      \NAT@parse{\@citeb}%
      \ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
        \let\NAT@name=\NAT@all@names
        \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
      \fi
      \ifNAT@full\let\NAT@nm\NAT@all@names\else
        \let\NAT@nm\NAT@name\fi
      \ifNAT@swa
       \@ifnum{\NAT@ctype&gt;\@ne}{%
        \@citea
        \NAT@hyper@{\@ifnum{\NAT@ctype=\tw@}{\NAT@test{\NAT@ctype}}{\NAT@alias}}%
       }{%
        \@ifnum{\NAT@cmprs&gt;\z@}{%
         \NAT@ifcat@num\NAT@num
          {\let\NAT@nm=\NAT@num}%
          {\def\NAT@nm{-2}}%
         \NAT@ifcat@num\NAT@last@num
          {\@tempcnta=\NAT@last@num\relax}%
          {\@tempcnta\m@ne}%
         \@ifnum{\NAT@nm=\@tempcnta}{%
          \@ifnum{\NAT@merge&gt;\@ne}{}{\NAT@last@yr@mbox}%
         }{%
           \advance\@tempcnta by\@ne
           \@ifnum{\NAT@nm=\@tempcnta}{%
%    \end{macrocode}
%
% 蝨ｨ鬘ｺ蠎冗ｼ也�∝宛荳具ｼ圭pkg{natbib} 蜿ｪ譛牙惠荳我ｸｪ莉･荳願ｿ樒ｻｭ譁�鍵蠑慕畑謇堺ｼ壻ｽｿ逕ｨ霑樊磁蜿ｷ��
% 霑咎㈹菫ｮ謾ｹ荳ｺ蜈∬ｮｸ荳､荳ｪ蠑慕畑菴ｿ逕ｨ霑樊磁蜿ｷ縲�
%    \begin{macrocode}
             % \ifx\NAT@last@yr\relax
             %   \def@NAT@last@yr{\@citea}%
             % \else
             %   \def@NAT@last@yr{--\NAT@penalty}%
             % \fi
             \def@NAT@last@yr{-\NAT@penalty}%
           }{%
             \NAT@last@yr@mbox
           }%
         }%
        }{%
         \@tempswatrue
         \@ifnum{\NAT@merge&gt;\@ne}{\@ifnum{\NAT@last@num=\NAT@num\relax}{\@tempswafalse}{}}{}%
         \if@tempswa\NAT@citea@mbox\fi
        }%
       }%
       \NAT@def@citea
      \else
        \ifcase\NAT@ctype
          \ifx\NAT@last@nm\NAT@nm \NAT@yrsep\NAT@penalty\NAT@space\else
            \@citea \NAT@test{\@ne}\NAT@spacechar\NAT@mbox{\NAT@super@kern\NAT@@open}%
          \fi
          \if*#1*\else#1\NAT@spacechar\fi
          \NAT@mbox{\NAT@hyper@{{\citenumfont{\NAT@num}}}}%
          \NAT@def@citea@box
        \or
          \NAT@hyper@citea@space{\NAT@test{\NAT@ctype}}%
        \or
          \NAT@hyper@citea@space{\NAT@test{\NAT@ctype}}%
        \or
          \NAT@hyper@citea@space\NAT@alias
        \fi
      \fi
     }%
    }%
      \@ifnum{\NAT@cmprs&gt;\z@}{\NAT@last@yr}{}%
      \ifNAT@swa\else
%    \end{macrocode}
%
% 蟆�｡ｵ遐∵叛蝨ｨ諡ｬ蜿ｷ螟冶ｾｹ�悟ｹｶ荳皮ｽｮ莠惹ｸ頑���
%    \begin{macrocode}
        % \@ifnum{\NAT@ctype=\z@}{%
        %   \if*#2*\else\NAT@cmt#2\fi
        % }{}%
        \NAT@mbox{\NAT@@close}%
        \@ifnum{\NAT@ctype=\z@}{%
          \if*#2*\else
            \textsuperscript{#2}%
          \fi
        }{}%
        \NAT@super@kern
      \fi
  }{#1}{#2}%
}%
%    \end{macrocode}
%
% Author-year 讓｡蠑冗噪 \cs{citep} 逧�｡ｵ遐�ｼ�
%    \begin{macrocode}
\renewcommand\NAT@cite%
    [3]{\ifNAT@swa\NAT@@open\if*#2*\else#2\NAT@spacechar\fi
        #1\NAT@@close\if*#3*\else\textsuperscript{#3}\fi\else#1\fi\endgroup}
%    \end{macrocode}
% \end{macro}
%
% Author-year 讓｡蠑冗噪 \cs{citet} 逧�｡ｵ遐�ｼ�
%    \begin{macrocode}
\def\NAT@citex%
  [#1][#2]#3{%
  \NAT@reset@parser
  \NAT@sort@cites{#3}%
  \NAT@reset@citea
  \@cite{\let\NAT@nm\@empty\let\NAT@year\@empty
    \@for\@citeb:=\NAT@cite@list\do
    {\@safe@activestrue
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
     \@safe@activesfalse
     \@ifundefined{b@\@citeb\@extra@b@citeb}{\@citea%
       {\reset@font\bfseries ?}\NAT@citeundefined
                 \PackageWarning{natbib}%
       {Citation `\@citeb' on page \thepage \space undefined}\def\NAT@date{}}%
     {\let\NAT@last@nm=\NAT@nm\let\NAT@last@yr=\NAT@year
      \NAT@parse{\@citeb}%
      \ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
        \let\NAT@name=\NAT@all@names
        \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
      \fi
     \ifNAT@full\let\NAT@nm\NAT@all@names\else
       \let\NAT@nm\NAT@name\fi
     \ifNAT@swa\ifcase\NAT@ctype
       \if\relax\NAT@date\relax
         \@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}\NAT@date}%
       \else
         \ifx\NAT@last@nm\NAT@nm\NAT@yrsep
            \ifx\NAT@last@yr\NAT@year
              \def\NAT@temp{{?}}%
              \ifx\NAT@temp\NAT@exlab\PackageWarningNoLine{natbib}%
               {Multiple citation on page \thepage: same authors and
               year\MessageBreak without distinguishing extra
               letter,\MessageBreak appears as question mark}\fi
              \NAT@hyper@{\NAT@exlab}%
            \else\unskip\NAT@spacechar
              \NAT@hyper@{\NAT@date}%
            \fi
         \else
           \@citea\NAT@hyper@{%
             \NAT@nmfmt{\NAT@nm}%
             \hyper@natlinkbreak{%
               \NAT@aysep\NAT@spacechar}{\@citeb\@extra@b@citeb
             }%
             \NAT@date
           }%
         \fi
       \fi
     \or\@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}}%
     \or\@citea\NAT@hyper@{\NAT@date}%
     \or\@citea\NAT@hyper@{\NAT@alias}%
     \fi \NAT@def@citea
     \else
       \ifcase\NAT@ctype
        \if\relax\NAT@date\relax
          \@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}}%
        \else
         \ifx\NAT@last@nm\NAT@nm\NAT@yrsep
            \ifx\NAT@last@yr\NAT@year
              \def\NAT@temp{{?}}%
              \ifx\NAT@temp\NAT@exlab\PackageWarningNoLine{natbib}%
               {Multiple citation on page \thepage: same authors and
               year\MessageBreak without distinguishing extra
               letter,\MessageBreak appears as question mark}\fi
              \NAT@hyper@{\NAT@exlab}%
            \else
              \unskip\NAT@spacechar
              \NAT@hyper@{\NAT@date}%
            \fi
         \else
           \@citea\NAT@hyper@{%
             \NAT@nmfmt{\NAT@nm}%
             \hyper@natlinkbreak{\NAT@spacechar\NAT@@open\if*#1*\else#1\NAT@spacechar\fi}%
               {\@citeb\@extra@b@citeb}%
             \NAT@date
           }%
         \fi
        \fi
       \or\@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}}%
       \or\@citea\NAT@hyper@{\NAT@date}%
       \or\@citea\NAT@hyper@{\NAT@alias}%
       \fi
       \if\relax\NAT@date\relax
         \NAT@def@citea
       \else
         \NAT@def@citea@close
       \fi
     \fi
     }}\ifNAT@swa\else
%    \end{macrocode}
%
% 蟆�｡ｵ遐∵叛蝨ｨ諡ｬ蜿ｷ螟冶ｾｹ�悟ｹｶ荳皮ｽｮ莠惹ｸ頑���
%    \begin{macrocode}
       % \if*#2*\else\NAT@cmt#2\fi
       \if\relax\NAT@date\relax\else\NAT@@close\fi
       \if*#2*\else\textsuperscript{#2}\fi
     \fi}{#1}{#2}}
%    \end{macrocode}
%
% \begin{environment}{thebibliography}
% 蜿り�枚迪ｮ蛻苓｡ｨ逧���ｭｾ蟾ｦ蟇ｹ鮨�
%    \begin{macrocode}
\renewcommand\@biblabel[1]{[#1]\hfill}
%    \end{macrocode}
% \end{environment}
%
% Patch \pkg{natbib} 蜀�Κ蜻ｽ莉､�御ｻ･謾ｯ謖� \cs{noopsort}縲�
% 蜿り� \url{https://tex.stackexchange.com/a/39718/82731}縲�
%    \begin{macrocode}
\let\NAT@bare@aux\NAT@bare
\def\NAT@bare#1(#2){%
 \begingroup\edef\x{\endgroup
   \unexpanded{\NAT@bare@aux#1}(\@firstofone#2)}\x}
%    \end{macrocode}
%
% \begin{macro}{\url}
% 菴ｿ逕ｨ \pkg{xurl} 螳丞桁逧�婿豕包ｼ悟｢槫刈 URL 蜿ｯ譁ｭ陦檎噪菴咲ｽｮ縲�
%    \begin{macrocode}
\g@addto@macro\UrlBreaks{%
  \do0\do1\do2\do3\do4\do5\do6\do7\do8\do9%
  \do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M
  \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
  \do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l\do\m
  \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
%    \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
%&lt;/package&gt;
%    \end{macrocode}
%
%
%
% \section{BibTeX 譬ｷ蠑冗噪莉｣遐∝ｮ樒鴫}
% \label{bst-implementation}
% \linespread{1}
%
% \subsection{閾ｪ螳壻ｹ蛾蛾｡ｹ}
% \label{sec:options}
%
% \begin{environment}{bst}
% 霑咎㈹螳壻ｹ我ｺ�ｸ莠帛序驥冗畑莠主ｮ壼宛譬ｷ蠑擾ｼ�
% 蜿ｯ莉･蝨ｨ荳矩擇逧� |load.config| 蜃ｽ謨ｰ荳ｭ騾画叫譏ｯ蜷ｦ蜷ｯ逕ｨ縲�
%    \begin{macrocode}
%&lt;*author-year|numerical&gt;
INTEGERS {
  citation.et.al.min
  citation.et.al.use.first
  bibliography.et.al.min
  bibliography.et.al.use.first
  uppercase.name
  terms.in.macro
  year.after.author
  period.after.author
  italic.book.title
  sentence.case.title
  link.title
  title.in.journal
  show.patent.country
  show.mark
  space.before.mark
  show.medium.type
  short.journal
  italic.journal
  link.journal
  bold.journal.volume
  show.missing.address.publisher
  space.before.pages
  only.start.page
  wave.dash.in.pages
  show.urldate
  show.url
  show.doi
  show.preprint
  show.note
  show.english.translation
  end.with.period
%&lt;*author-year&gt;
  lang.zh.order
  lang.ja.order
  lang.en.order
  lang.ru.order
  lang.other.order
%&lt;/author-year&gt;
}

STRINGS {
  component.part.label
}

%    \end{macrocode}
%
% 荳矩擇豈丈ｸｪ蜿倬㍼闍･陲ｫ隶ｾ荳ｺ |#1| 蛻吝星逕ｨ隸･鬘ｹ�瑚凶陲ｫ隶ｾ荳ｺ |#0| 蛻吩ｸ榊星逕ｨ縲�
% 鮟倩ｮ､逧�ｼ譏ｯ荳･譬ｼ驕ｵ蠕ｪ蝗ｽ譬�噪驟咲ｽｮ縲�
%    \begin{macrocode}
FUNCTION {load.config}
{
%    \end{macrocode}
%
% 螯よ棡蟋灘錐逧�焚驥丞､ｧ莠守ｭ我ｺ� |et.al.min|�悟宵闡怜ｽ募燕 |et.al.use.first| 荳ｪ��
% 蜈ｶ蜷主刈窶彳t al.窶晄�窶懃ｭ俄昴�
%    \begin{macrocode}
%&lt;*!ucas&gt;
  #2 'citation.et.al.min :=
  #1 'citation.et.al.use.first :=
%&lt;/!ucas&gt;
%&lt;*ucas&gt;
  #3 'citation.et.al.min :=
  #1 'citation.et.al.use.first :=
%&lt;/ucas&gt;
  #4 'bibliography.et.al.min :=
  #3 'bibliography.et.al.use.first :=
%    \end{macrocode}
%
% 闍ｱ譁�ｧ灘錐霓ｬ荳ｺ蜈ｨ螟ｧ蜀呻ｼ�
%    \begin{macrocode}
%&lt;*!(no-uppercase|thu)&gt;
  #1 'uppercase.name :=
%&lt;/!(no-uppercase|thu)&gt;
%&lt;*no-uppercase|thu&gt;
  #0 'uppercase.name :=
%&lt;/no-uppercase|thu&gt;
%    \end{macrocode}
%
% 菴ｿ逕ｨ TeX 螳剰ｾ灘�窶懷柱窶昴≫懃ｭ俄�
%    \begin{macrocode}
%&lt;*!(macro|ucas)&gt;
  #0 'terms.in.macro :=
%&lt;/!(macro|ucas)&gt;
%&lt;*macro|ucas&gt;
  #1 'terms.in.macro :=
%&lt;/macro|ucas&gt;
%    \end{macrocode}
%
% 蟆�ｹｴ莉ｽ鄂ｮ莠手送閠�錘髱｢�郁送閠�-蜃ｺ迚亥ｹｴ蛻ｶ鮟倩ｮ､��
%    \begin{macrocode}
%&lt;*numerical|ucas&gt;
  #0 'year.after.author :=
%&lt;/numerical|ucas&gt;
%&lt;*author-year&amp;!ucas&gt;
  #1 'year.after.author :=
%&lt;/author-year&amp;!ucas&gt;
%    \end{macrocode}
%
% 驥�畑闡苓�-蜃ｺ迚亥ｹｴ蛻ｶ譌ｶ�御ｽ懆�ｧ灘錐荳主ｹｴ莉ｽ荵矩龍菴ｿ逕ｨ蜿･轤ｹ霑樊磁��
%    \begin{macrocode}
%&lt;*numerical&gt;
  #1 'period.after.author :=
%&lt;/numerical&gt;
%&lt;*author-year&gt;
%&lt;*2015&amp;!(period|ustc)&gt;
  #0 'period.after.author :=
%&lt;/2015&amp;!(period|ustc)&gt;
%&lt;*period|2005|ustc&gt;
  #1 'period.after.author :=
%&lt;/period|2005|ustc&gt;
%&lt;/author-year&gt;
%    \end{macrocode}
%
% 荵ｦ蜷堺ｽｿ逕ｨ譁應ｽ難ｼ�
%    \begin{macrocode}
%&lt;*!italic-book-title&gt;
  #0 'italic.book.title :=
%&lt;/!italic-book-title&gt;
%&lt;*italic-book-title&gt;
  #1 'italic.book.title :=
%&lt;/italic-book-title&gt;
%    \end{macrocode}
%
% 闍ｱ譁���｢倩ｽｬ荳ｺ sentence case �亥唱鬥門ｭ玲ｯ榊､ｧ蜀呻ｼ悟�菴吝ｰ丞��会ｼ�
%    \begin{macrocode}
%&lt;*!no-sentence-case&gt;
  #1 'sentence.case.title :=
%&lt;/!no-sentence-case&gt;
%&lt;*no-sentence-case&gt;
  #0 'sentence.case.title :=
%&lt;/no-sentence-case&gt;
%    \end{macrocode}
%
% 蝨ｨ譬�｢俶ｷｻ蜉�雜�得謗･��
%    \begin{macrocode}
%&lt;*!link-title&gt;
  #0 'link.title :=
%&lt;/!link-title&gt;
%&lt;*link-title&gt;
  #1 'link.title :=
%&lt;/link-title&gt;
%    \end{macrocode}
%
% 譛溷�譏ｯ蜷ｦ蜷ｫ譬�｢假ｼ�
%    \begin{macrocode}
%&lt;*!no-title-in-journal&gt;
  #1 'title.in.journal :=
%&lt;/!no-title-in-journal&gt;
%&lt;*no-title-in-journal&gt;
  #0 'title.in.journal :=
%&lt;/no-title-in-journal&gt;
%    \end{macrocode}
%
% 荳灘茜鬚伜錐譏ｯ蜷ｦ蜷ｫ荳灘茜蝗ｽ蛻ｫ
%    \begin{macrocode}
%&lt;*!(show-patent-country|2005|ustc|thu)&gt;
  #0 'show.patent.country :=
%&lt;/!(show-patent-country|2005|ustc|thu)&gt;
%&lt;*(show-patent-country|2005|ustc|thu)&gt;
  #1 'show.patent.country :=
%&lt;/(show-patent-country|2005|ustc|thu)&gt;
%    \end{macrocode}
%
% 闡怜ｽ墓枚迪ｮ邀ｻ蝙区��ｯ�ｼ域ｯ泌ｦや彈M/OL]窶懶ｼ会ｼ�
%    \begin{macrocode}
%&lt;*!no-mark&gt;
  #1 'show.mark :=
%&lt;/!no-mark&gt;
%&lt;*no-mark&gt;
  #0 'show.mark :=
%&lt;/no-mark&gt;
%    \end{macrocode}
%
% 譁�鍵邀ｻ蝙区��ｯ�燕譏ｯ蜷ｦ譛臥ｩｺ譬ｼ��
%    \begin{macrocode}
%&lt;*!space-before-mark&gt;
  #0 'space.before.mark :=
%&lt;/!space-before-mark&gt;
%&lt;*space-before-mark&gt;
  #1 'space.before.mark :=
%&lt;/space-before-mark&gt;
%    \end{macrocode}
%
% 譏ｯ蜷ｦ譏ｾ遉ｺ霓ｽ菴鍋ｱｻ蝙区��ｯ�ｼ域ｯ泌ｦや�/OL窶懶ｼ会ｼ�
%    \begin{macrocode}
%&lt;*!no-medium-type&gt;
  #1 'show.medium.type :=
%&lt;/!no-medium-type&gt;
%&lt;*no-medium-type&gt;
  #0 'show.medium.type :=
%&lt;/no-medium-type&gt;
%    \end{macrocode}
%
% 菴ｿ逕ｨ窶�//窶晁｡ｨ遉ｺ譫仙�譁�鍵
%    \begin{macrocode}
%&lt;*!(in-collection|no-slash)&gt;
  "slash" 'component.part.label :=
%&lt;/!(in-collection|no-slash)&gt;
%&lt;*in-collection&gt;
  "in" 'component.part.label :=
%&lt;/in-collection&gt;
%&lt;*no-slash&gt;
  "none" 'component.part.label :=
%&lt;/no-slash&gt;
%    \end{macrocode}
%
% 譛溷�蜷堺ｽｿ逕ｨ郛ｩ蜀呻ｼ�
%    \begin{macrocode}
%&lt;*!short-journal&gt;
  #0 'short.journal :=
%&lt;/!short-journal&gt;
%&lt;*short-journal&gt;
  #1 'short.journal :=
%&lt;/short-journal&gt;
%    \end{macrocode}
%
% 譛溷�蜷堺ｽｿ逕ｨ譁應ｽ難ｼ�
%    \begin{macrocode}
%&lt;*!italic-journal&gt;
  #0 'italic.journal :=
%&lt;/!italic-journal&gt;
%&lt;*italic-journal&gt;
  #1 'italic.journal :=
%&lt;/italic-journal&gt;
%    \end{macrocode}
%
% 蝨ｨ譛溷�鬚伜錐豺ｻ蜉�雜�得謗･��
%    \begin{macrocode}
%&lt;*!link-journal&gt;
  #0 'link.journal :=
%&lt;/!link-journal&gt;
%&lt;*link-journal&gt;
  #1 'link.journal :=
%&lt;/link-journal&gt;
%    \end{macrocode}
%
% 譛溷�逧�差菴ｿ逕ｨ邊嶺ｽ難ｼ�
%    \begin{macrocode}
  #0 'bold.journal.volume :=
%    \end{macrocode}
%
% 譌�蜃ｺ迚亥慍謌門�迚郁�慮�瑚送蠖補懷�迚亥慍荳崎ｯｦ窶晢ｼ娯懷�迚郁�ｸ崎ｯｦ窶晢ｼ娯彜.l.窶� 謌� 窶徭.n.窶晢ｼ�
%    \begin{macrocode}
%&lt;*!sl-sn&gt;
  #0 'show.missing.address.publisher :=
%&lt;/!sl-sn&gt;
%&lt;*sl-sn&gt;
  #1 'show.missing.address.publisher :=
%&lt;/sl-sn&gt;
%    \end{macrocode}
%
% 鬘ｵ遐∽ｸ主燕髱｢逧��蜿ｷ荵矩龍譏ｯ蜷ｦ譛臥ｩｺ譬ｼ��
%    \begin{macrocode}
%&lt;*!no-space-before-pages&gt;
  #1 'space.before.pages :=
%&lt;/!no-space-before-pages&gt;
%&lt;*no-space-before-pages&gt;
  #0 'space.before.pages :=
%&lt;/no-space-before-pages&gt;
%    \end{macrocode}
%
% 鬘ｵ遐∵弍蜷ｦ蜿ｪ蜷ｫ襍ｷ蟋矩｡ｵ��
%    \begin{macrocode}
%&lt;*!only-start-page&gt;
  #0 'only.start.page :=
%&lt;/!only-start-page&gt;
%&lt;*only-start-page&gt;
  #1 'only.start.page :=
%&lt;/only-start-page&gt;
%    \end{macrocode}
%
% 襍ｷ豁｢鬘ｵ遐∽ｽｿ逕ｨ豕｢豬ｪ蜿ｷ��
%    \begin{macrocode}
%&lt;*!wave-dash-in-pages&gt;
  #0 'wave.dash.in.pages :=
%&lt;/!wave-dash-in-pages&gt;
%&lt;*wave-dash-in-pages&gt;
  #1 'wave.dash.in.pages :=
%&lt;/wave-dash-in-pages&gt;
%    \end{macrocode}
%
% 譏ｯ蜷ｦ闡怜ｽ暮撼逕ｵ蟄先枚迪ｮ逧�ｼ慕畑譌･譛滂ｼ�
%    \begin{macrocode}
%&lt;*!no-urldate&gt;
  #1 'show.urldate :=
%&lt;/!no-urldate&gt;
%&lt;*no-urldate&gt;
  #0 'show.urldate :=
%&lt;/no-urldate&gt;
%    \end{macrocode}
%
% 譏ｯ蜷ｦ闡怜ｽ� URL��
%    \begin{macrocode}
%&lt;*!no-url&gt;
  #1 'show.url :=
%&lt;/!no-url&gt;
%&lt;*no-url&gt;
  #0 'show.url :=
%&lt;/no-url&gt;
%    \end{macrocode}
%
% 譏ｯ蜷ｦ闡怜ｽ� DOI��
%    \begin{macrocode}
%&lt;*!(no-doi|2005)&gt;
  #1 'show.doi :=
%&lt;/!(no-doi|2005)&gt;
%&lt;*no-doi|2005&gt;
  #0 'show.doi :=
%&lt;/no-doi|2005&gt;
%    \end{macrocode}
%
% 譏ｯ蜷ｦ闡怜ｽ� e-print��
%    \begin{macrocode}
%&lt;*!preprint&gt;
  #1 'show.preprint :=
%&lt;/!preprint&gt;
%&lt;*preprint&gt;
  #0 'show.preprint :=
%&lt;/preprint&gt;
%    \end{macrocode}
%
% 蝨ｨ豈丈ｸ譚｡譁�鍵譛蜷手ｾ灘�豕ｨ驥奇ｼ�note�臥噪蜀�ｮｹ��
%    \begin{macrocode}
  #0 'show.note :=
%    \end{macrocode}
%
% 荳ｭ譁�枚迪ｮ譏ｯ蜷ｦ譏ｾ遉ｺ闍ｱ譁�ｿｻ隸�
%    \begin{macrocode}
%&lt;*!show-english-translation&gt;
  #0 'show.english.translation :=
%&lt;/!show-english-translation&gt;
%&lt;*show-english-translation&gt;
  #1 'show.english.translation :=
%&lt;/show-english-translation&gt;
%    \end{macrocode}
%
% 扈灘ｰｾ蜉�蜿･轤ｹ
%    \begin{macrocode}
%&lt;*!no-period-at-end&gt;
  #1 'end.with.period :=
%&lt;/!no-period-at-end&gt;
%&lt;*no-period-at-end&gt;
  #0 'end.with.period :=
%&lt;/no-period-at-end&gt;
%    \end{macrocode}
%
% 蜿り�枚迪ｮ陦ｨ謖臥�窶懆送閠�-蜃ｺ迚亥ｹｴ窶晉ｻ�ｻ�慮�悟推荳ｪ譁�ｧ咲噪鬘ｺ蠎擾ｼ�
%    \begin{macrocode}
%&lt;*author-year&gt;
  #1 'lang.zh.order :=
  #2 'lang.ja.order :=
  #3 'lang.en.order :=
  #4 'lang.ru.order :=
  #5 'lang.other.order :=
%&lt;/author-year&gt;
}

%    \end{macrocode}
%
%
% \subsection{The ENTRY declaration}
%
%   Like Scribe's (according to pages 231-2 of the April '84 edition),
%   but no fullauthor or editors fields because BibTeX does name handling.
%   The annote field is commented out here because this family doesn't
%   include an annotated bibliography style.  And in addition to the fields
%   listed here, BibTeX has a built-in crossref field, explained later.
%    \begin{macrocode}
ENTRY
  { address
    archivePrefix
    author
    booktitle
    date
    doi
    edition
    editor
    eprint
    eprinttype
    entrysubtype
    howpublished
    institution
    journal
    journaltitle
    key
    langid
    language
    location
    mark
    medium
    note
    number
    organization
    pages
    publisher
    school
    series
    shortjournal
    title
    translation
    translator
    url
    urldate
    volume
    year
  }
  { entry.lang entry.is.electronic is.pure.electronic entry.numbered }
%    \end{macrocode}
%
% These string entry variables are used to form the citation label.
% In a storage pinch, sort.label can be easily computed on the fly.
%    \begin{macrocode}
  { label extra.label sort.label short.list entry.mark entry.url }

%    \end{macrocode}
%
%
% \subsection{Entry functions}
%
% Each entry function starts by calling output.bibitem, to write the
% |\bibitem| and its arguments to the .BBL file.  Then the various fields
% are formatted and printed by output or output.check.  Those functions
% handle the writing of separators (commas, periods, |\newblock|'s),
% taking care not to do so when they are passed a null string.
% Finally, fin.entry is called to add the final period and finish the
% entry.
%
% A bibliographic reference is formatted into a number of `blocks':
% in the open format, a block begins on a new line and subsequent
% lines of the block are indented.  A block may contain more than
% one sentence (well, not a grammatical sentence, but something to
% be ended with a sentence ending period).  The entry functions should
% call new.block whenever a block other than the first is about to be
% started.  They should call new.sentence whenever a new sentence is
% to be started.  The output functions will ensure that if two
% new.sentence's occur without any non-null string being output between
% them then there won't be two periods output.  Similarly for two
% successive new.block's.
%
% The output routines don't write their argument immediately.
% Instead, by convention, that argument is saved on the stack to be
% output next time (when we'll know what separator needs to come
% after it).  Meanwhile, the output routine has to pop the pending
% output off the stack, append any needed separator, and write it.
%
% To tell which separator is needed, we maintain an output.state.
% It will be one of these values:
%       before.all              just after the |\bibitem|
%       mid.sentence            in the middle of a sentence: comma needed
%                                       if more sentence is output
%       after.sentence          just after a sentence: period needed
%       after.block             just after a block (and sentence):
%                                       period and |\newblock| needed.
% Note: These styles don't use after.sentence
%
% VAR: output.state : INTEGER           -- state variable for output
%
% The output.nonnull function saves its argument (assumed to be nonnull)
% on the stack, and writes the old saved value followed by any needed
% separator.  The ordering of the tests is decreasing frequency of
% occurrence.
%
% 逕ｱ莠惹ｸ楢送荳ｭ逧�梵蜃ｺ譁�鍵髴隕∫畑蛻ｰ蠕育音谿顔噪窶�//窶晢ｼ梧園莉･謌大処蜉�莠�ｸ荳ｪ after.slash縲�
% 蜈ｶ莉夜怙隕∝惠迚ｹ螳夂ｬｦ蜿ｷ蜷朱擇霎灘��梧園莉･蜀吩ｺ�ｸ荳ｪ output.after縲�
%
% \begin{pseudocode}
% output.nonnull(s) ==
%  BEGIN
%       s := argument on stack
%       if output.state = mid.sentence then
%           write$(pop() * ", ")
%                 -- "pop" isn't a function: just use stack top
%       else
%           if output.state = after.block then
%               write$(add.period$(pop()))
%               newline$
%               write$("\newblock ")
%           else
%               if output.state = before.all then
%                   write$(pop())
%               else        -- output.state should be after.sentence
%                   write$(add.period$(pop()) * " ")
%               fi
%           fi
%           output.state := mid.sentence
%       fi
%       push s on stack
%  END
% \end{pseudocode}
%
% The output function calls output.nonnull if its argument is non-empty;
% its argument may be a missing field (thus, not necessarily a string)
%
% \begin{pseudocode}
% output(s) ==
%  BEGIN
%       if not empty$(s) then output.nonnull(s)
%       fi
%  END
% \end{pseudocode}
%
% The output.check function is the same as the output function except that, if
% necessary, output.check warns the user that the t field shouldn't be empty
% (this is because it probably won't be a good reference without the field;
% the entry functions try to make the formatting look reasonable even when
% such fields are empty).
%
% \begin{pseudocode}
% output.check(s,t) ==
%  BEGIN
%       if empty$(s) then
%           warning$("empty " * t * " in " * cite$)
%       else output.nonnull(s)
%       fi
%  END
% \end{pseudocode}
%
% The output.bibitem function writes the |\bibitem| for the current entry
% (the label should already have been set up), and sets up the separator
% state for the output functions.  And, it leaves a string on the stack
% as per the output convention.
%
% \begin{pseudocode}
% output.bibitem ==
%  BEGIN
%       newline$
%       write$("\bibitem[")     % for alphabetic labels,
%       write$(label)           % these three lines
%       write$("]{")            % are used
%       write$("\bibitem{")             % this line for numeric labels
%       write$(cite$)
%       write$("}")
%       push "" on stack
%       output.state := before.all
%  END
% \end{pseudocode}
%
% The fin.entry function finishes off an entry by adding a period to the
% string remaining on the stack.  If the state is still before.all
% then nothing was produced for this entry, so the result will look bad,
% but the user deserves it. (We don't omit the whole entry because the
% entry was cited, and a bibitem is needed to define the citation label.)
%
% \begin{pseudocode}
% fin.entry ==
%  BEGIN
%       write$(add.period$(pop()))
%       newline$
%  END
% \end{pseudocode}
%
% The new.block function prepares for a new block to be output, and
% new.sentence prepares for a new sentence.
%
% \begin{pseudocode}
% new.block ==
%  BEGIN
%       if output.state &lt;&gt; before.all then
%           output.state := after.block
%       fi
%  END
% \end{pseudocode}
%
% \begin{pseudocode}
% new.sentence ==
%  BEGIN
%       if output.state &lt;&gt; after.block then
%           if output.state &lt;&gt; before.all then
%               output.state :=  after.sentence
%           fi
%       fi
%  END
% \end{pseudocode}
%    \begin{macrocode}
INTEGERS { output.state before.all mid.sentence after.sentence after.block after.slash }

INTEGERS { lang.zh lang.ja lang.en lang.ru lang.other }

INTEGERS { charptr len }

FUNCTION {init.state.consts}
{ #0 'before.all :=
  #1 'mid.sentence :=
  #2 'after.sentence :=
  #3 'after.block :=
  #4 'after.slash :=
  #3 'lang.zh :=
  #4 'lang.ja :=
  #1 'lang.en :=
  #2 'lang.ru :=
  #0 'lang.other :=
}

%    \end{macrocode}
%
% 荳矩擇譏ｯ荳莠帛ｸｸ驥冗噪螳壻ｹ�
%    \begin{macrocode}
FUNCTION {bbl.anonymous}
{ entry.lang lang.zh =
    { "菴壼錐" }
    { "Anon" }
  if$
}

FUNCTION {bbl.space}
{ entry.lang lang.zh =
    { "\ " }
    { " " }
  if$
}

FUNCTION {bbl.and}
{ "" }

FUNCTION {bbl.et.al}
{ entry.lang lang.zh =
    { "遲�" }
    { entry.lang lang.ja =
        { "莉�" }
        { entry.lang lang.ru =
            { "ﾐｸﾐｴﾑ" }
            { "et~al." }
          if$
        }
      if$
    }
  if$
}

FUNCTION {citation.and}
{ terms.in.macro
    { "{\biband}" }
    'bbl.and
  if$
}

FUNCTION {citation.et.al}
{ terms.in.macro
    { "{\bibetal}" }
    'bbl.et.al
  if$
}

FUNCTION {bbl.colon} { ": " }

FUNCTION {bbl.pages.colon}
{ space.before.pages
    { ": " }
    { ":\allowbreak " }
  if$
}

%&lt;*!2005&gt;
FUNCTION {bbl.wide.space} { "\quad " }
%&lt;/!2005&gt;
%&lt;*2005&gt;
FUNCTION {bbl.wide.space} { "\ " }
%&lt;/2005&gt;

FUNCTION {bbl.slash} { "//\allowbreak " }

FUNCTION {bbl.sine.loco}
{ entry.lang lang.zh =
    { "[蜃ｺ迚亥慍荳崎ｯｦ]" }
    { "[S.l.]" }
  if$
}

FUNCTION {bbl.sine.nomine}
{ entry.lang lang.zh =
    { "[蜃ｺ迚郁�ｸ崎ｯｦ]" }
    { "[s.n.]" }
  if$
}

FUNCTION {bbl.sine.loco.sine.nomine}
{ entry.lang lang.zh =
    { "[蜃ｺ迚亥慍荳崎ｯｦ: 蜃ｺ迚郁�ｸ崎ｯｦ]" }
    { "[S.l.: s.n.]" }
  if$
}

%    \end{macrocode}
%
% These three functions pop one or two (integer) arguments from the stack
% and push a single one, either 0 or 1.
% The |'skip$| in the `and' and `or' functions are used because
% the corresponding |if$| would be idempotent
%    \begin{macrocode}
FUNCTION {not}
{   { #0 }
    { #1 }
  if$
}

FUNCTION {and}
{   'skip$
    { pop$ #0 }
  if$
}

FUNCTION {or}
{   { pop$ #1 }
    'skip$
  if$
}

STRINGS { x y }

FUNCTION {contains}
{ 'y :=
  'x :=
  y text.length$ 'len :=
  x text.length$ len - #1 + 'charptr :=
    { charptr #0 &gt;
      x charptr len substring$ y = not
      and
    }
    { charptr #1 - 'charptr := }
  while$
  charptr #0 &gt;
}

%    \end{macrocode}
%
% the variables s and t are temporary string holders
%    \begin{macrocode}
STRINGS { s t }

FUNCTION {output.nonnull}
{ 's :=
  output.state mid.sentence =
    { ", " * write$ }
    { output.state after.block =
        { add.period$ write$
          newline$
          "\newblock " write$
        }
        { output.state before.all =
            'write$
            { output.state after.slash =
                { bbl.slash * write$
                  newline$
                }
                { add.period$ " " * write$ }
              if$
            }
          if$
        }
      if$
      mid.sentence 'output.state :=
    }
  if$
  s
}

FUNCTION {output}
{ duplicate$ empty$
    'pop$
    'output.nonnull
  if$
}

FUNCTION {output.after}
{ 't :=
  duplicate$ empty$
    'pop$
    { 's :=
      output.state mid.sentence =
        { t * write$ }
        { output.state after.block =
            { add.period$ write$
              newline$
              "\newblock " write$
            }
            { output.state before.all =
                'write$
                { output.state after.slash =
                    { bbl.slash * write$ }
                    { add.period$ " " * write$ }
                  if$
                }
              if$
            }
          if$
          mid.sentence 'output.state :=
        }
      if$
      s
    }
  if$
}

FUNCTION {output.check}
{ 't :=
  duplicate$ empty$
    { pop$ "empty " t * " in " * cite$ * warning$ }
    'output.nonnull
  if$
}

%    \end{macrocode}
%
% This function finishes all entries.
%
%    \begin{macrocode}
FUNCTION {fin.entry}
{ end.with.period
    'add.period$
    'skip$
  if$
  write$
  show.english.translation entry.lang lang.zh = and
    { ")"
      write$
    }
    'skip$
  if$
  newline$
}

FUNCTION {new.block}
{ output.state before.all =
    'skip$
    { output.state after.slash =
        'skip$
        { after.block 'output.state := }
      if$
    }
  if$
}

FUNCTION {new.sentence}
{ output.state after.block =
    'skip$
    { output.state before.all =
        'skip$
        { output.state after.slash =
            'skip$
            { after.sentence 'output.state := }
          if$
        }
      if$
    }
  if$
}

FUNCTION {new.slash}
{ output.state before.all =
    'skip$
    { component.part.label "slash" =
        { after.slash 'output.state := }
        { new.block
          component.part.label "in" =
            { entry.lang lang.en =
                { "In: " output
                  write$
                  ""
                  before.all 'output.state :=
                }
                'skip$
              if$
            }
            'skip$
          if$
        }
      if$
    }
  if$
}

%    \end{macrocode}
%
% Sometimes we begin a new block only if the block will be big enough.  The
% new.block.checka function issues a new.block if its argument is nonempty;
% new.block.checkb does the same if either of its TWO arguments is nonempty.
%    \begin{macrocode}
FUNCTION {new.block.checka}
{ empty$
    'skip$
    'new.block
  if$
}

FUNCTION {new.block.checkb}
{ empty$
  swap$ empty$
  and
    'skip$
    'new.block
  if$
}

%    \end{macrocode}
%
% The new.sentence.check functions are analogous.
%    \begin{macrocode}
FUNCTION {new.sentence.checka}
{ empty$
    'skip$
    'new.sentence
  if$
}

FUNCTION {new.sentence.checkb}
{ empty$
  swap$ empty$
  and
    'skip$
    'new.sentence
  if$
}

%    \end{macrocode}
%
%
% \subsection{Formatting chunks}
%
% Here are some functions for formatting chunks of an entry.
% By convention they either produce a string that can be followed by
% a comma or period (using |add.period$|, so it is OK to end in a period),
% or they produce the null string.
%
% A useful utility is the field.or.null function, which checks if the
% argument is the result of pushing a `missing' field (one for which no
% assignment was made when the current entry was read in from the database)
% or the result of pushing a string having no non-white-space characters.
% It returns the null string if so, otherwise it returns the field string.
% Its main (but not only) purpose is to guarantee that what's left on the
% stack is a string rather than a missing field.
%
% \begin{pseudocode}
% field.or.null(s) ==
%  BEGIN
%       if empty$(s) then return ""
%       else return s
%  END
% \end{pseudocode}
%
% Another helper function is emphasize, which returns the argument emphazised,
% if that is non-empty, otherwise it returns the null string.  Italic
% corrections aren't used, so this function should be used when punctation
% will follow the result.
%
% \begin{pseudocode}
% emphasize(s) ==
%  BEGIN
%       if empty$(s) then return ""
%       else return "{\em " * s * "}"
% \end{pseudocode}
%
% The `pop\$' in this function gets rid of the duplicate `empty' value and
% the `skip\$' returns the duplicate field value
%    \begin{macrocode}
FUNCTION {field.or.null}
{ duplicate$ empty$
    { pop$ "" }
    'skip$
  if$
}

FUNCTION {emphasize}
{ duplicate$ empty$
    { pop$ "" }
    { "\emph{" swap$ * "}" * }
  if$
}

FUNCTION {format.btitle}
{ italic.book.title
  entry.lang lang.en = and
    'emphasize
    'skip$
  if$
}

%    \end{macrocode}
%
% \subsubsection{Detect Language}
%    \begin{macrocode}
INTEGERS { byte second.byte }

INTEGERS { char.lang tmp.lang }

STRINGS { tmp.str }

FUNCTION {get.str.lang}
{ 'tmp.str :=
  lang.other 'tmp.lang :=
  #1 'charptr :=
  tmp.str text.length$ #1 + 'len :=
    { charptr len &lt; }
    { tmp.str charptr #1 substring$ chr.to.int$ 'byte :=
      byte #128 &lt;
        { charptr #1 + 'charptr :=
          byte #64 &gt; byte #91 &lt; and byte #96 &gt; byte #123 &lt; and or
            { lang.en 'char.lang := }
            { lang.other 'char.lang := }
          if$
        }
        { tmp.str charptr #1 + #1 substring$ chr.to.int$ 'second.byte :=
          byte #224 &lt;
%    \end{macrocode}
% 菫�枚隘ｿ驥悟ｰ泌ｭ玲ｯ搾ｼ啅+0400 蛻ｰ U+052F�悟ｯｹ蠎� UTF-8 莉� D0 80 蛻ｰ D4 AF縲�
%    \begin{macrocode}
            { charptr #2 + 'charptr :=
              byte #207 &gt; byte #212 &lt; and
              byte #212 = second.byte #176 &lt; and or
                { lang.ru 'char.lang := }
                { lang.other 'char.lang := }
              if$
            }
            { byte #240 &lt;
%    \end{macrocode}
% CJK Unified Ideographs: U+4E00--U+9FFF; UTF-8: E4 B8 80--E9 BF BF.
%    \begin{macrocode}
                { charptr #3 + 'charptr :=
                  byte #227 &gt; byte #234 &lt; and
                    { lang.zh 'char.lang := }
%    \end{macrocode}
% CJK Unified Ideographs Extension A: U+3400--U+4DBF; UTF-8: E3 90 80--E4 B6 BF.
%    \begin{macrocode}
                    { byte #227 =
                        { second.byte #143 &gt;
                            { lang.zh 'char.lang := }
%    \end{macrocode}
% 譌･隸ｭ蛛�錐�啅+3040--U+30FF, UTF-8: E3 81 80--E3 83 BF.
%    \begin{macrocode}
                            { second.byte #128 &gt; second.byte #132 &lt; and
                                { lang.ja 'char.lang := }
                                { lang.other 'char.lang := }
                              if$
                            }
                          if$
                        }
%    \end{macrocode}
% CJK Compatibility Ideographs: U+F900--U+FAFF, UTF-8: EF A4 80--EF AB BF.
%    \begin{macrocode}
                        { byte #239 =
                          second.byte #163 &gt; second.byte #172 &lt; and and
                            { lang.zh 'char.lang := }
                            { lang.other 'char.lang := }
                          if$
                        }
                      if$
                    }
                  if$
                }
%    \end{macrocode}
% CJK Unified Ideographs Extension B--F: U+20000--U+2EBEF,
% UTF-8: F0 A0 80 80--F0 AE AF AF.
% CJK Compatibility Ideographs Supplement: U+2F800--U+2FA1F,
% UTF-8: F0 AF A0 80--F0 AF A8 9F.
%    \begin{macrocode}
                { charptr #4 + 'charptr :=
                  byte #240 = second.byte #159 &gt; and
                    { lang.zh 'char.lang := }
                    { lang.other 'char.lang := }
                  if$
                }
              if$
            }
          if$
        }
      if$
      char.lang tmp.lang &gt;
        { char.lang 'tmp.lang := }
        'skip$
      if$
    }
  while$
  tmp.lang
}

FUNCTION {check.entry.lang}
{ author field.or.null
  title field.or.null *
  get.str.lang
}

STRINGS { entry.langid }

FUNCTION {set.entry.lang}
{ "" 'entry.langid :=
  language empty$ not
    { language 'entry.langid := }
    'skip$
  if$
  langid empty$ not
    { langid 'entry.langid := }
    'skip$
  if$
  entry.langid empty$
    { check.entry.lang }
    { entry.langid "english" = entry.langid "american" = or entry.langid "british" = or
        { lang.en }
        { entry.langid "chinese" =
            { lang.zh }
            { entry.langid "japanese" =
                { lang.ja }
                { entry.langid "russian" =
                    { lang.ru }
                    { check.entry.lang }
                  if$
                }
              if$
            }
          if$
        }
      if$
    }
  if$
  'entry.lang :=
}

FUNCTION {set.entry.numbered}
{ type$ "patent" =
  type$ "standard" = or
  type$ "techreport" = or
    { #1 'entry.numbered := }
    { #0 'entry.numbered := }
  if$
}

%    \end{macrocode}
%
% \subsubsection{Format names}
%
% The format.names function formats the argument (which should be in
% BibTeX name format) into "First Von Last, Junior", separated by commas
% and with an "and" before the last (but ending with "et~al." if the last
% of multiple authors is "others").  This function's argument should always
% contain at least one name.
%
% \begin{pseudocode}
% VAR: nameptr, namesleft, numnames: INTEGER
% pseudoVAR: nameresult: STRING         (it's what's accumulated on the stack)
%
% format.names(s) ==
%  BEGIN
%       nameptr := 1
%       numnames := num.names$(s)
%       namesleft := numnames
%       while namesleft &gt; 0
%         do
%                               % for full names:
%           t := format.name$(s, nameptr, "{ff~}{vv~}{ll}{, jj}")
%                               % for abbreviated first names:
%           t := format.name$(s, nameptr, "{f.~}{vv~}{ll}{, jj}")
%           if nameptr &gt; 1 then
%               if namesleft &gt; 1 then nameresult := nameresult * ", " * t
%               else if numnames &gt; 2
%                      then nameresult := nameresult * ","
%                    fi
%                    if t = "others"
%                      then nameresult := nameresult * " et~al."
%                      else nameresult := nameresult * " and " * t
%                    fi
%               fi
%           else nameresult := t
%           fi
%           nameptr := nameptr + 1
%           namesleft := namesleft - 1
%         od
%       return nameresult
%  END
% \end{pseudocode}
%
% The format.authors function returns the result of format.names(author)
% if the author is present, or else it returns the null string
%
% \begin{pseudocode}
% format.authors ==
%  BEGIN
%       if empty$(author) then return ""
%       else return format.names(author)
%       fi
%  END
% \end{pseudocode}
%
% Format.editors is like format.authors, but it uses the editor field,
% and appends ", editor" or ", editors"
%
% \begin{pseudocode}
% format.editors ==
%  BEGIN
%       if empty$(editor) then return ""
%       else
%           if num.names$(editor) &gt; 1 then
%               return format.names(editor) * ", editors"
%           else
%               return format.names(editor) * ", editor"
%           fi
%       fi
%  END
% \end{pseudocode}
%
% Other formatting functions are similar, so no "comment version" will be
% given for them.
%    \begin{macrocode}
INTEGERS { nameptr namesleft numnames name.lang }

FUNCTION {format.name}
{ "{vv~}{ll}{, jj}{, ff}" format.name$ 't :=
  t "others" =
    { bbl.et.al }
    { t get.str.lang 'name.lang :=
      name.lang lang.en =
        { t #1 "{vv~}{ll}{ f{~}}" format.name$
          uppercase.name
            { "u" change.case$ }
            'skip$
          if$
          t #1 "{, jj}" format.name$ *
        }
        { t #1 "{ll}{ff}" format.name$ }
      if$
    }
  if$
}

FUNCTION {format.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  ""
  numnames 'namesleft :=
    { namesleft #0 &gt; }
    { s nameptr format.name bbl.et.al =
      numnames bibliography.et.al.min #1 - &gt; nameptr bibliography.et.al.use.first &gt; and or
        { ", " *
          bbl.et.al *
          #1 'namesleft :=
        }
        { nameptr #1 &gt;
            { namesleft #1 = bbl.and "" = not and
                { bbl.and * }
                { ", " * }
              if$
            }
            'skip$
          if$
          s nameptr format.name *
        }
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

FUNCTION {format.key}
{ empty$
    { key field.or.null }
    { "" }
  if$
}

FUNCTION {format.authors}
{ author empty$ not
    { author format.names }
    { "empty author in " cite$ * warning$
%&lt;*author-year&gt;
      bbl.anonymous
%&lt;/author-year&gt;
%&lt;*numerical&gt;
      ""
%&lt;/numerical&gt;
    }
  if$
}

FUNCTION {format.editors}
{ editor empty$
    { "" }
    { editor format.names }
  if$
}

FUNCTION {format.translators}
{ translator empty$
    { "" }
    { translator format.names
      entry.lang lang.zh =
        { translator num.names$ #3 &gt;
            { "隸�" * }
            { ", 隸�" * }
          if$
        }
        'skip$
      if$
    }
  if$
}

FUNCTION {format.full.names}
{'s :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 &gt; }
    { s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't :=
      t get.str.lang 'name.lang :=
      name.lang lang.en =
        { t #1 "{vv~}{ll}" format.name$ 't := }
        { t #1 "{ll}{ff}" format.name$ 't := }
      if$
      nameptr #1 &gt;
        {
          namesleft #1 &gt;
            { ", " * t * }
            {
              numnames #2 &gt;
                { "," * }
                'skip$
              if$
              t "others" =
                { " et~al." * }
                { " and " * t * }
              if$
            }
          if$
        }
        't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

FUNCTION {author.editor.full}
{ author empty$
    { editor empty$
        { "" }
        { editor format.full.names }
      if$
    }
    { author format.full.names }
  if$
}

FUNCTION {author.full}
{ author empty$
    { "" }
    { author format.full.names }
  if$
}

FUNCTION {editor.full}
{ editor empty$
    { "" }
    { editor format.full.names }
  if$
}

FUNCTION {make.full.names}
{ type$ "book" =
  type$ "inbook" = booktitle empty$ not and
  or
    'author.editor.full
    { type$ "collection" =
      type$ "proceedings" =
      or
        'editor.full
        'author.full
      if$
    }
  if$
}

FUNCTION {output.bibitem}
{ newline$
  "\bibitem[" write$
  label ")" *
  make.full.names duplicate$ short.list =
    { pop$ }
    { duplicate$ "]" contains
        { "{" swap$ * "}" * }
        'skip$
      if$
      *
    }
  if$
  "]{" * write$
  cite$ write$
  "}" write$
  newline$
  ""
  before.all 'output.state :=
}

%    \end{macrocode}
%
% \subsubsection{Format title}
%
% The |format.title| function is used for non-book-like titles.
% For most styles we convert to lowercase (except for the very first letter,
% and except for the first one after a colon (followed by whitespace)),
% and hope the user has brace-surrounded words that need to stay capitilized;
% for some styles, however, we leave it as it is in the database.
%    \begin{macrocode}
FUNCTION {change.sentence.case}
{ entry.lang lang.en =
    { "t" change.case$ }
    'skip$
  if$
}

FUNCTION {add.link}
{ url empty$ not
    { "\href{" url * "}{" * swap$ * "}" * }
    { doi empty$ not
        { "\href{https://doi.org/" doi * "}{" * swap$ * "}" * }
        'skip$
      if$
    }
  if$
}

FUNCTION {format.title}
{ title empty$
    { "" }
    { title
      sentence.case.title
        'change.sentence.case
        'skip$
      if$
      entry.numbered number empty$ not and
        { bbl.colon *
          type$ "patent" = show.patent.country and
            { address empty$ not
                { address * ", " * }
                { location empty$ not
                    { location * ", " * }
                    { entry.lang lang.zh =
                        { "荳ｭ蝗ｽ" * ", " * }
                        'skip$
                      if$
                    }
                  if$
                }
              if$
            }
            'skip$
          if$
          number *
        }
        'skip$
      if$
      link.title
        'add.link
        'skip$
      if$
    }
  if$
}

%    \end{macrocode}
%
% For several functions we'll need to connect two strings with a
% tie (|~|) if the second one isn't very long (fewer than 3 characters).
% The tie.or.space.connect function does that.  It concatenates the two
% strings on top of the stack, along with either a tie or space between
% them, and puts this concatenation back onto the stack:
%
% \begin{pseudocode}
% tie.or.space.connect(str1,str2) ==
%    BEGIN
%       if text.length$(str2) &lt; 3
%         then return the concatenation of str1, "~", and str2
%         else return the concatenation of str1, " ", and str2
%    END
% \end{pseudocode}
%    \begin{macrocode}
FUNCTION {tie.or.space.connect}
{ duplicate$ text.length$ #3 &lt;
    { "~" }
    { " " }
  if$
  swap$ * *
}

%    \end{macrocode}
%
% The either.or.check function complains if both fields or an either-or pair
% are nonempty.
%
% \begin{pseudocode}
% either.or.check(t,s) ==
%  BEGIN
%       if empty$(s) then
%           warning$(can't use both " * t * " fields in " * cite$)
%       fi
%  END
% \end{pseudocode}
%    \begin{macrocode}
FUNCTION {either.or.check}
{ empty$
    'pop$
    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  if$
}

%    \end{macrocode}
%
% The format.bvolume function is for formatting the volume and perhaps
% series name of a multivolume work.  If both a volume and a series field
% are there, we assume the series field is the title of the whole multivolume
% work (the title field should be the title of the thing being referred to),
% and we add an "of &lt;series&gt;".  This function is called in mid-sentence.
%
% The format.number.series function is for formatting the series name
% and perhaps number of a work in a series.  This function is similar to
% format.bvolume, although for this one the series must exist (and the
% volume must not exist).  If the number field is empty we output either
% the series field unchanged if it exists or else the null string.
% If both the number and series fields are there we assume the series field
% gives the name of the whole series (the title field should be the title
% of the work being one referred to), and we add an "in &lt;series&gt;".
% We capitilize Number when this function is used at the beginning of a block.
%    \begin{macrocode}
FUNCTION {is.digit}
{ duplicate$ empty$
    { pop$ #0 }
    { chr.to.int$
      duplicate$ "0" chr.to.int$ &lt;
      { pop$ #0 }
      { "9" chr.to.int$ &gt;
          { #0 }
          { #1 }
        if$
      }
    if$
    }
  if$
}

FUNCTION {is.number}
{ 's :=
  s empty$
    { #0 }
    { s text.length$ 'charptr :=
        { charptr #0 &gt;
          s charptr #1 substring$ is.digit
          and
        }
        { charptr #1 - 'charptr := }
      while$
      charptr not
    }
  if$
}

FUNCTION {format.volume}
{ volume empty$ not
    { volume is.number
        { entry.lang lang.zh =
            { "隨ｬ " volume * " 蜊ｷ" * }
            { "Vol." volume tie.or.space.connect }
          if$
        }
        { volume }
      if$
    }
    { "" }
  if$
}

FUNCTION {format.number}
{ number empty$ not
    { number is.number
        { entry.lang lang.zh =
            { "隨ｬ " number * " 蜀�" * }
            { "No." number tie.or.space.connect }
          if$
        }
        { number }
      if$
    }
    { "" }
  if$
}

FUNCTION {format.volume.number}
{ volume empty$ not
    { format.volume }
    { format.number }
  if$
}

FUNCTION {format.title.vol.num}
{ title
  sentence.case.title
    'change.sentence.case
    'skip$
  if$
  entry.numbered
    { number empty$ not
        { bbl.colon * number * }
        'skip$
      if$
    }
    { format.volume.number 's :=
      s empty$ not
        { bbl.colon * s * }
        'skip$
      if$
    }
  if$
}

FUNCTION {format.series.vol.num.title}
{ format.volume.number 's :=
  series empty$ not
    { series
      sentence.case.title
        'change.sentence.case
        'skip$
      if$
      entry.numbered
        { bbl.wide.space * }
        { bbl.colon *
          s empty$ not
            { s * bbl.wide.space * }
            'skip$
          if$
        }
      if$
      title *
      sentence.case.title
        'change.sentence.case
        'skip$
      if$
      entry.numbered number empty$ not and
        { bbl.colon * number * }
        'skip$
      if$
    }
    { format.title.vol.num }
  if$
  format.btitle
  link.title
    'add.link
    'skip$
  if$
}

FUNCTION {format.booktitle.vol.num}
{ booktitle
  entry.numbered
    'skip$
    { format.volume.number 's :=
      s empty$ not
        { bbl.colon * s * }
        'skip$
      if$
    }
  if$
}

%    \end{macrocode}
%
%    \begin{macrocode}
FUNCTION {format.series.vol.num.booktitle}
{ format.volume.number 's :=
  series empty$ not
    { series bbl.colon *
      entry.numbered not s empty$ not and
        { s * bbl.wide.space * }
        'skip$
      if$
      booktitle *
    }
    { format.booktitle.vol.num }
  if$
  format.btitle
}

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 {get.journal.title}
{ short.journal
    { shortjournal empty$ not
        { shortjournal }
        { journal empty$ not
            { journal abbreviate }
            { journaltitle empty$ not
                { journaltitle abbreviate }
                { "" }
              if$
            }
          if$
        }
      if$
    }
    { journal empty$ not
        { journal }
        { journaltitle empty$ not
            { journaltitle }
            { shortjournal empty$ not
                { shortjournal }
                { "" }
              if$
            }
          if$
        }
      if$
    }
  if$
}

FUNCTION {check.arxiv.preprint}
{ #1 #5 substring$ purify$ "l" change.case$ "arxiv" =
    { #1 }
    { #0 }
  if$
}

FUNCTION {format.journal}
{ get.journal.title
  duplicate$ empty$ not
    { italic.journal entry.lang lang.en = and
        'emphasize
        'skip$
      if$
      link.journal
        'add.link
        'skip$
      if$
    }
    'skip$
  if$
}

%    \end{macrocode}
%
% \subsubsection{Format entry type mark}
%
%    \begin{macrocode}
FUNCTION {set.entry.mark}
{ entry.mark empty$ not
    'pop$
    { mark empty$ not
        { pop$ mark 'entry.mark := }
        { 'entry.mark := }
      if$
    }
  if$
}

FUNCTION {format.mark}
{ show.mark
    { entry.mark
      show.medium.type
        { medium empty$ not
            { "/" * medium * }
            { entry.is.electronic
                { "/OL" * }
                'skip$
              if$
            }
          if$
        }
        'skip$
      if$
      'entry.mark :=
      space.before.mark
        { " " }
        { "\allowbreak" }
      if$
      "[" * entry.mark * "]" *
    }
    { "" }
  if$
}

%    \end{macrocode}
%
% \subsubsection{Format edition}
%
% The format.edition function appends " edition" to the edition, if present.
% We lowercase the edition (it should be something like "Third"), because
% this doesn't start a sentence.
%    \begin{macrocode}
FUNCTION {num.to.ordinal}
{ duplicate$ text.length$ 'charptr :=
  duplicate$ charptr #1 substring$ 's :=
  s "1" =
    { "st" * }
    { s "2" =
        { "nd" * }
        { s "3" =
            { "rd" * }
            { "th" * }
          if$
        }
      if$
    }
  if$
}

FUNCTION {format.edition}
{ edition empty$
    { "" }
    { edition is.number
        { edition "1" = not
            { entry.lang lang.zh =
                { edition " 迚�" * }
                { edition num.to.ordinal " ed." * }
              if$
            }
            'skip$
          if$
        }
        { entry.lang lang.en =
            { edition change.sentence.case 's :=
              s "Revised" = s "Revised edition" = or
                { "Rev. ed." }
                { s " ed." * }
              if$
            }
            { edition }
          if$
        }
      if$
    }
  if$
}

%    \end{macrocode}
%
% \subsubsection{Format publishing items}
%
% 蜃ｺ迚亥慍蝮蜥悟�迚育､ｾ莨壽怏 窶彈S.l.: s.n.]窶� 逧�ュ蜀ｵ�梧園莉･蠢�｡ｻ荳襍ｷ螟�炊縲�
%    \begin{macrocode}
FUNCTION {format.publisher}
{ publisher empty$ not
    { publisher }
    { school empty$ not
        { school }
        { organization empty$ not
            { organization }
            { institution empty$ not
                { institution }
                { "" }
              if$
            }
          if$
        }
      if$
    }
  if$
}

FUNCTION {format.address.publisher}
{ address empty$ not
    { address }
    { location empty$ not
        { location }
        { "" }
      if$
    }
  if$
  duplicate$ empty$ not
    { format.publisher empty$ not
        { bbl.colon * format.publisher * }
        { entry.is.electronic not show.missing.address.publisher and
            { bbl.colon * bbl.sine.nomine * }
            'skip$
          if$
        }
      if$
    }
    { pop$
      entry.is.electronic not show.missing.address.publisher and
        { format.publisher empty$ not
            { bbl.sine.loco bbl.colon * format.publisher * }
            { bbl.sine.loco.sine.nomine }
          if$
        }
        { format.publisher empty$ not
            { format.publisher }
            { "" }
          if$
        }
      if$
    }
  if$
}

%    \end{macrocode}
%
% \subsubsection{Format date}
%
% The format.date function is for the month and year, but we give a warning if
% there's an empty year but the month is there, and we return the empty string
% if they're both empty.
%
% 譛溷�髴隕∬送蠖戊ｵｷ豁｢闌�峩�悟�荳ｭ蟷ｴ莉ｽ菴ｿ逕ｨ窶�/窶晏�髫費ｼ悟差蜥梧悄菴ｿ逕ｨ窶�--窶晏�髫斐�
% 迚域悽 v2.0.2 蜑咲噪蟷ｴ莉ｽ荵滉ｽｿ逕ｨ窶�--窶晏�髫費ｼ御ｻ�署萓帛�螳ｹ諤ｧ�御ｸ榊�謗ｨ闕舌�
%    \begin{macrocode}
FUNCTION {extract.before.dash}
{ duplicate$ empty$
    { pop$ "" }
    { 's :=
      #1 'charptr :=
      s text.length$ #1 + 'len :=
        { charptr len &lt;
          s charptr #1 substring$ "-" = not
          and
        }
        { charptr #1 + 'charptr := }
      while$
      s #1 charptr #1 - substring$
    }
  if$
}

FUNCTION {extract.after.dash}
{ duplicate$ empty$
    { pop$ "" }
    { 's :=
      #1 'charptr :=
      s text.length$ #1 + 'len :=
        { charptr len &lt;
          s charptr #1 substring$ "-" = not
          and
        }
        { charptr #1 + 'charptr := }
      while$
        { charptr len &lt;
          s charptr #1 substring$ "-" =
          and
        }
        { charptr #1 + 'charptr := }
      while$
      s charptr global.max$ substring$
    }
  if$
}

FUNCTION {extract.before.slash}
{ duplicate$ empty$
    { pop$ "" }
    { 's :=
      #1 'charptr :=
      s text.length$ #1 + 'len :=
        { charptr len &lt;
          s charptr #1 substring$ "/" = not
          and
        }
        { charptr #1 + 'charptr := }
      while$
      s #1 charptr #1 - substring$
    }
  if$
}

FUNCTION {extract.after.slash}
{ duplicate$ empty$
    { pop$ "" }
    { 's :=
      #1 'charptr :=
      s text.length$ #1 + 'len :=
        { charptr len &lt;
          s charptr #1 substring$ "-" = not
          and
          s charptr #1 substring$ "/" = not
          and
        }
        { charptr #1 + 'charptr := }
      while$
        { charptr len &lt;
          s charptr #1 substring$ "-" =
          s charptr #1 substring$ "/" =
          or
          and
        }
        { charptr #1 + 'charptr := }
      while$
      s charptr global.max$ substring$
    }
  if$
}

%    \end{macrocode}
%
% 闡苓�-蜃ｺ迚亥ｹｴ蛻ｶ蠢�｡ｻ謠仙叙蜃ｺ蟷ｴ莉ｽ
%    \begin{macrocode}
FUNCTION {format.year}
{ year empty$ not
    { year extra.label * }
    { date empty$ not
        { date extract.before.dash extra.label * }
        { entry.is.electronic not
            { "empty year in " cite$ * warning$ }
            'skip$
          if$
          urldate empty$ not
            { "[" urldate extract.before.dash * extra.label * "]" * }
            { "" }
          if$
        }
      if$
    }
  if$
}

FUNCTION {format.periodical.year}
{ year empty$ not
    { year extract.before.slash
      "--" *
      year extract.after.slash
      duplicate$ empty$
        'pop$
        { * }
      if$
    }
    { date empty$ not
        { date extract.before.dash }
        { "empty year in " cite$ * warning$
          urldate empty$ not
            { "[" urldate extract.before.dash * "]" * }
            { "" }
          if$
        }
      if$
    }
  if$
}

%    \end{macrocode}
%
% 荳灘茜蜥梧冠郤ｸ驛ｽ譏ｯ菴ｿ逕ｨ譌･譛溯御ｸ肴弍蟷ｴ
%    \begin{macrocode}
FUNCTION {format.date}
{ date empty$ not
    { type$ "patent" = type$ "newspaper" = or
        { date }
        { entrysubtype empty$ not
            { type$ "article" = entrysubtype "newspaper" = and
                { date }
                { format.year }
              if$
            }
            { format.year }
          if$
        }
      if$
    }
    { year empty$ not
        { format.year }
        { "" }
      if$
    }
  if$
}

%    \end{macrocode}
%
% 譖ｴ譁ｰ縲∽ｿｮ謾ｹ譌･譛溷宵逕ｨ莠守鳩蟄占ｵ�ｺ� electronic
%    \begin{macrocode}
FUNCTION {format.editdate}
{ date empty$ not
    { "\allowbreak(" date * ")" * }
    { "" }
  if$
}

%    \end{macrocode}
%
% 蝗ｽ譬�ｸｭ逧�懷ｼ慕畑譌･譛溪晞�譏ｯ荳� URL 蜷梧慮蜃ｺ邇ｰ逧�ｼ梧園莉･蜈ｶ螳樔ｸｺ urldate�瑚ｿ吩ｸｪ陌ｽ辟ｶ
% 荳肴弍 \BibTeX{} 譬�㊥逧�沺�御ｽ�弍螳樣刔荳ｭ蠕亥ｸｸ隗√�
%    \begin{macrocode}
FUNCTION {format.urldate}
{ show.urldate show.url and entry.url empty$ not and
  is.pure.electronic or
  urldate empty$ not and
    { "\allowbreak[" urldate * "]" * }
    { "" }
  if$
}

%    \end{macrocode}
%
% \subsubsection{Format pages}
%
% By default, BibTeX sets the global integer variable |global.max$| to the BibTeX
% constant |glob_str_size|, the maximum length of a global string variable.
% Analogously, BibTeX sets the global integer variable |entry.max$| to
% |ent_str_size|, the maximum length of an entry string variable.
% The style designer may change these if necessary (but this is unlikely)
%
% The n.dashify function makes each single |`-'| in a string a double |`--'|
% if it's not already
%
% \begin{pseudocode}
% pseudoVAR: pageresult: STRING         (it's what's accumulated on the stack)
%
% n.dashify(s) ==
%  BEGIN
%       t := s
%       pageresult := ""
%       while (not empty$(t))
%         do
%           if (first character of t = "-")
%             then
%               if (next character isn't)
%                 then
%                   pageresult := pageresult * "--"
%                   t := t with the "-" removed
%                 else
%                   while (first character of t = "-")
%                     do
%                       pageresult := pageresult * "-"
%                       t := t with the "-" removed
%                     od
%               fi
%             else
%               pageresult := pageresult * the first character
%               t := t with the first character removed
%           fi
%         od
%       return pageresult
%  END
% \end{pseudocode}
%
% 蝗ｽ譬�㈹鬘ｵ遐∬激蝗ｴ逧�ｿ樊磁蜿ｷ菴ｿ逕ｨ hyphen�碁怙隕∝ｰ� dash 霓ｬ荳ｺ hyphen縲�
%    \begin{macrocode}
FUNCTION {hyphenate}
{ 't :=
  ""
    { t empty$ not }
    { t #1 #1 substring$ "-" =
        { wave.dash.in.pages
            { "��" * }
            { "-" * }
          if$
            { t #1 #1 substring$ "-" = }
            { t #2 global.max$ substring$ 't := }
          while$
        }
        { t #1 #1 substring$ *
          t #2 global.max$ substring$ 't :=
        }
      if$
    }
  while$
}

%    \end{macrocode}
%
% This function doesn't begin a sentence so "pages" isn't capitalized.
% Other functions that use this should keep that in mind.
%    \begin{macrocode}
FUNCTION {format.pages}
{ pages empty$
    { "" }
    { pages hyphenate }
  if$
}

FUNCTION {format.extracted.pages}
{ pages empty$
    { "" }
    { pages
      only.start.page
        'extract.before.dash
        'hyphenate
      if$
    }
  if$
}

%    \end{macrocode}
%
% The |format.vol.num.pages| function is for the volume, number, and page range
% of a journal article.  We use the format:  vol(number):pages, with some
% variations for empty fields.  This doesn't begin a sentence.
%
% 謚･郤ｸ蝨ｨ蜊ｷ蜿ｷ郛ｺ螟ｱ譌ｶ�梧悄蜿ｷ荳主燕髱｢逧�律譛溽峩謗･逶ｸ霑橸ｼ梧園莉･蠢�｡ｻ諡�ｼ霎灘�縲�
%    \begin{macrocode}
FUNCTION {format.journal.volume}
{ volume empty$ not
    { bold.journal.volume
        { "\textbf{" volume * "}" * }
        { volume }
      if$
    }
    { "" }
  if$
}

FUNCTION {format.journal.number}
{ number empty$ not
    { "\allowbreak (" number * ")" * }
    { "" }
  if$
}

FUNCTION {format.journal.pages}
{ pages empty$
    { "" }
    { format.extracted.pages }
  if$
}

%    \end{macrocode}
%
% 霑樒ｻｭ蜃ｺ迚育黄逧�ｹｴ蜊ｷ譛滓怏襍ｷ豁｢闌�峩�碁怙隕∫音谿雁､�炊
%    \begin{macrocode}
FUNCTION {format.periodical.year.volume.number}
{ year empty$ not
    { year extract.before.slash }
    { "empty year in periodical " cite$ * warning$ }
  if$
  volume empty$ not
    { ", " * volume extract.before.dash * }
    'skip$
  if$
  number empty$ not
    { "\allowbreak (" * number extract.before.dash * ")" * }
    'skip$
  if$
  "--" *
  year extract.after.slash empty$
  volume extract.after.dash empty$ and
  number extract.after.dash empty$ and not
    { year extract.after.slash empty$ not
        { year extract.after.slash * }
        { year extract.before.slash * }
      if$
      volume empty$ not
        { ", " * volume extract.after.dash * }
        'skip$
      if$
      number empty$ not
        { "\allowbreak (" * number extract.after.dash * ")" * }
        'skip$
      if$
    }
    'skip$
  if$
}

%    \end{macrocode}
%
% \subsubsection{Format url and doi}
%
% 莨�扈溽噪 \BibTeX{} 荵�諠ｯ菴ｿ逕ｨ howpublished 闡怜ｽ� url�瑚ｿ咎㈹謠蝉ｾ帶髪謖√�
%    \begin{macrocode}
FUNCTION {check.url}
{ url empty$ not
    { url 'entry.url :=
      #1 'entry.is.electronic :=
    }
    { howpublished empty$ not
        { howpublished #1 #5 substring$ "\url{" =
            { howpublished 'entry.url :=
              #1 'entry.is.electronic :=
            }
            'skip$
          if$
        }
        { note empty$ not
            { note #1 #5 substring$ "\url{" =
                { note 'entry.url :=
                  #1 'entry.is.electronic :=
                }
                'skip$
              if$
            }
            'skip$
          if$
        }
      if$
    }
  if$
}

FUNCTION {output.url}
{ show.url is.pure.electronic or
  entry.url empty$ not and
    { new.block
      entry.url #1 #5 substring$ "\url{" =
        { entry.url }
        { "\url{" entry.url * "}" * }
      if$
      output
    }
    'skip$
  if$
}

%    \end{macrocode}
%
% 髴隕∵｣豬� DOI 譏ｯ蜷ｦ蟾ｲ扈丞桁蜷ｫ蝨ｨ URL 荳ｭ縲�
%    \begin{macrocode}
FUNCTION {check.doi}
{ doi empty$ not
    { #1 'entry.is.electronic := }
    'skip$
  if$
}

FUNCTION {is.in.url}
{ 's :=
  s empty$
    { #1 }
    { entry.url empty$
        { #0 }
        { s text.length$ 'len :=
          entry.url "l" change.case$ text.length$ 'charptr :=
            { entry.url "l" change.case$ charptr len substring$ s "l" change.case$ = not
              charptr #0 &gt;
              and
            }
            { charptr #1 - 'charptr := }
          while$
          charptr
        }
      if$
    }
  if$
}

FUNCTION {format.doi}
{ ""
  doi empty$ not
    { "" 's :=
      doi 't :=
      #0 'numnames :=
        { t empty$ not}
        { t #1 #1 substring$ 'tmp.str :=
          tmp.str "," = tmp.str " " = or t #2 #1 substring$ empty$ or
            { t #2 #1 substring$ empty$
                { s tmp.str * 's := }
                'skip$
              if$
              s empty$ s is.in.url or
                'skip$
                { numnames #1 + 'numnames :=
                  numnames #1 &gt;
                    { ", " * }
                    { "DOI: " * }
                  if$
                  "\doi{" s * "}" * *
                }
              if$
              "" 's :=
            }
            { s tmp.str * 's := }
          if$
          t #2 global.max$ substring$ 't :=
        }
      while$
    }
    '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$
}

FUNCTION {check.electronic}
{ "" 'entry.url :=
  #0 'entry.is.electronic :=
    'check.doi
    'skip$
  if$
    'check.url
    'skip$
  if$
  medium empty$ not
    { medium "MT" = medium "DK" = or medium "CD" = or medium "OL" = or
        { #1 'entry.is.electronic := }
        'skip$
      if$
    }
    'skip$
  if$
}

FUNCTION {format.eprint}
{ archivePrefix empty$ not
    { archivePrefix }
    { eprinttype empty$ not
        { archivePrefix }
        { "" }
      if$
    }
  if$
  's :=
  s empty$ not
    { s ": \eprint{" *
      url empty$ not
        { url }
        { "https://" s "l" change.case$ * ".org/abs/" * eprint * }
      if$
      * "}{" *
      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 }
    { "" }
  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
% if there's been no sorting or alphabetic-label complaint.
%    \begin{macrocode}
FUNCTION {empty.misc.check}
{ author empty$ title empty$
  year empty$
  and and
  key empty$ not and
    { "all relevant fields are empty in " cite$ * warning$ }
    'skip$
  if$
}

%    \end{macrocode}
%
%
% \subsection{Functions for all entry types}
%
% Now we define the type functions for all entry types that may appear
% in the .BIB file---e.g., functions like `article' and `book'.  These
% are the routines that actually generate the .BBL-file output for
% the entry.  These must all precede the READ command.  In addition, the
% style designer should have a function `default.type' for unknown types.
% Note: The fields (within each list) are listed in order of appearance,
% except as described for an `inbook' or a `proceedings'.
%
% \subsubsection{荳楢送}
%
%    \begin{macrocode}
FUNCTION {monograph}
{ output.bibitem
  output.translation
  author empty$ not
    { format.authors }
    { editor empty$ not
        { format.editors }
        { "empty author and editor in " cite$ * warning$
%&lt;*author-year&gt;
          bbl.anonymous
%&lt;/author-year&gt;
%&lt;*numerical&gt;
          ""
%&lt;/numerical&gt;
        }
      if$
    }
  if$
  output
  year.after.author
    { period.after.author
        'new.sentence
        'skip$
      if$
      format.year "year" output.check
    }
    'skip$
  if$
  new.block
  format.series.vol.num.title "title" output.check
  "M" set.entry.mark
  format.mark "" output.after
  new.block
  format.translators output
  new.sentence
  format.edition output
  new.block
  format.address.publisher output
  year.after.author not
    { format.year "year" output.check }
    'skip$
  if$
  format.pages bbl.pages.colon output.after
  format.urldate "" output.after
  output.url
  output.doi
  new.block
  format.note output
  fin.entry
}

%    \end{macrocode}
%
% \subsubsection{荳楢送荳ｭ逧�梵蜃ｺ譁�鍵}
%
% An incollection is like inbook, but where there is a separate title
% for the referenced thing (and perhaps an editor for the whole).
% An incollection may CROSSREF a book.
%
%       Required: author, title, booktitle, publisher, year
%
%       Optional: editor, volume or number, series, type, chapter, pages,
%                       address, edition, month, note
%    \begin{macrocode}
FUNCTION {incollection}
{ output.bibitem
  output.translation
  format.authors output
  author format.key output
  year.after.author
    { period.after.author
        'new.sentence
        'skip$
      if$
      format.year "year" output.check
    }
    'skip$
  if$
  new.block
  format.title "title" output.check
  "M" set.entry.mark
  format.mark "" output.after
  new.block
  format.translators output
  new.slash
  format.editors output
  new.block
  format.series.vol.num.booktitle "booktitle" output.check
  new.block
  format.edition output
  new.block
  format.address.publisher output
  year.after.author not
    { format.year "year" output.check }
    'skip$
  if$
  format.extracted.pages bbl.pages.colon output.after
  format.urldate "" output.after
  output.url
  output.doi
  new.block
  format.note output
  fin.entry
}

%    \end{macrocode}
%
% \subsubsection{霑樒ｻｭ蜃ｺ迚育黄}
%
%    \begin{macrocode}
FUNCTION {periodical}
{ output.bibitem
  output.translation
  format.authors output
  author format.key output
  year.after.author
    { period.after.author
        'new.sentence
        'skip$
      if$
      format.year "year" output.check
    }
    'skip$
  if$
  new.block
  format.title "title" output.check
  "J" set.entry.mark
  format.mark "" output.after
  new.block
  format.periodical.year.volume.number output
  new.block
  format.address.publisher output
  year.after.author not
    { format.periodical.year "year" output.check }
    'skip$
  if$
  format.urldate "" output.after
  output.url
  output.doi
  new.block
  format.note output
  fin.entry
}

%    \end{macrocode}
%
% \subsubsection{霑樒ｻｭ蜃ｺ迚育黄荳ｭ逧�梵蜃ｺ譁�鍵}
%
% The article function is for an article in a journal.  An article may
% CROSSREF another article.
%
%       Required fields: author, title, journal, year
%
%       Optional fields: volume, number, pages, month, note
%
% The other entry functions are all quite similar, so no "comment version"
% will be given for them.
%    \begin{macrocode}
FUNCTION {journal.article}
{ output.bibitem
  output.translation
  format.authors output
  author format.key output
  year.after.author
    { period.after.author
        'new.sentence
        'skip$
      if$
      format.year "year" output.check
    }
    'skip$
  if$
  new.block
  title.in.journal
    { format.title "title" output.check
      entrysubtype empty$ not
        {
          entrysubtype "newspaper" =
            { "N" set.entry.mark }
            { "J" set.entry.mark }
          if$
        }
        { "J" set.entry.mark }
      if$
      format.mark "" output.after
      new.block
    }
    'skip$
  if$
  format.journal "journal" output.check
  year.after.author not
    { format.date "year" output.check }
    'skip$
  if$
  format.journal.volume output
  format.journal.number "" output.after
  format.journal.pages bbl.pages.colon output.after
  format.urldate "" output.after
  output.url
  output.doi
  new.block
  format.note output
  fin.entry
}

%    \end{macrocode}
%
% \subsubsection{荳灘茜譁�鍵}
%
% number 蝓滉ｹ溷庄莉･逕ｨ譚･陦ｨ遉ｺ荳灘茜蜿ｷ縲�
%    \begin{macrocode}
FUNCTION {patent}
{ output.bibitem
  output.translation
  format.authors output
  author format.key output
  year.after.author
    { period.after.author
        'new.sentence
        'skip$
      if$
      format.year "year" output.check
    }
    'skip$
  if$
  new.block
  format.title "title" output.check
  "P" set.entry.mark
  format.mark "" output.after
  new.block
  format.date "year" output.check
  format.urldate "" output.after
  output.url
  output.doi
  new.block
  format.note output
  fin.entry
}

%    \end{macrocode}
%
% \subsubsection{逕ｵ蟄占ｵ�ｺ図
%    \begin{macrocode}
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
  year.after.author
    { period.after.author
        'new.sentence
        'skip$
      if$
      format.year "year" output.check
    }
    'skip$
  if$
  new.block
  format.series.vol.num.title "title" output.check
  "EB" set.entry.mark
  format.mark "" output.after
  new.block
  format.address.publisher output
  year.after.author not
    { date empty$
        { format.date output }
        'skip$
      if$
    }
    'skip$
  if$
  format.pages bbl.pages.colon output.after
  format.editdate "" output.after
  format.urldate "" output.after
  output.url
  output.doi
  new.block
  format.note output
  fin.entry
}

%    \end{macrocode}
%
% \subsubsection{鬚�魂譛ｬ}
%
%    \begin{macrocode}
FUNCTION {preprint}
{ output.bibitem
  output.translation
  author empty$ not
    { format.authors }
    { editor empty$ not
        { format.editors }
        { "empty author and editor in " cite$ * warning$
%&lt;*author-year&gt;
          bbl.anonymous
%&lt;/author-year&gt;
%&lt;*numerical&gt;
          ""
%&lt;/numerical&gt;
        }
      if$
    }
  if$
  output
  year.after.author
    { period.after.author
        'new.sentence
        'skip$
      if$
      format.year "year" output.check
    }
    'skip$
  if$
  new.block
  title.in.journal
    { format.series.vol.num.title "title" output.check
%&lt;*2015&gt;
      "A" set.entry.mark
%&lt;/2015&gt;
%&lt;*!2015&gt;
      "Z" set.entry.mark
%&lt;/!2015&gt;
      format.mark "" output.after
      new.block
    }
    'skip$
  if$
  format.translators output
  new.sentence
  format.edition output
  new.block
  year.after.author not
    { date empty$
        { format.date output }
        'skip$
      if$
    }
    'skip$
  if$
  format.pages bbl.pages.colon output.after
  format.editdate "" output.after
  format.urldate "" output.after
  output.eprint
  output.url
  show.preprint not eprint empty$ or
    'output.doi
    'skip$
  if$
  new.block
  format.note output
  fin.entry
}

%    \end{macrocode}
%
% \subsubsection{蜈ｶ莉匁枚迪ｮ邀ｻ蝙急
%
% A misc is something that doesn't fit elsewhere.
%
%       Required: at least one of the `optional' fields
%
%       Optional: author, title, howpublished, month, year, note
%
% Misc 逕ｨ譚･閾ｪ蜉ｨ蛻､譁ｭ邀ｻ蝙九�
%    \begin{macrocode}
FUNCTION {misc}
{ get.journal.title
  duplicate$ empty$ not
    { check.arxiv.preprint
        'preprint
        'journal.article
      if$
    }
    { pop$
      booktitle empty$ not
        'incollection
        { publisher empty$ not
            'monograph
            { eprint empty$ not archivePrefix empty$ not or
                'preprint
                { entry.is.electronic
                    'electronic
                    {
%&lt;*!2005&gt;
                      "Z" set.entry.mark
%&lt;/!2005&gt;
%&lt;*2005&gt;
                      "M" set.entry.mark
%&lt;/2005&gt;
                      monograph
                    }
                  if$
                }
              if$
            }
          if$
        }
      if$
    }
  if$
  empty.misc.check
}

FUNCTION {archive}
{ "A" set.entry.mark
  misc
}

FUNCTION {article} { misc }

%    \end{macrocode}
%
% The book function is for a whole book.  A book may CROSSREF another book.
%
%       Required fields: author or editor, title, publisher, year
%
%       Optional fields: volume or number, series, address, edition, month,
%                       note
%    \begin{macrocode}
FUNCTION {book} { monograph }

%    \end{macrocode}
%
% A booklet is a bound thing without a publisher or sponsoring institution.
%
%       Required: title
%
%       Optional: author, howpublished, address, month, year, note
%    \begin{macrocode}
FUNCTION {booklet} { book }

FUNCTION {collection}
{ "G" set.entry.mark
  monograph
}

FUNCTION {database}
{ "DB" set.entry.mark
  electronic
}

FUNCTION {dataset}
{ "DS" set.entry.mark
  electronic
}

%    \end{macrocode}
%
% An inbook is a piece of a book: either a chapter and/or a page range.
% It may CROSSREF a book.  If there's no volume field, the type field
% will come before number and series.
%
%       Required: author or editor, title, chapter and/or pages, publisher,year
%
%       Optional: volume or number, series, type, address, edition, month, note
%
% 蜴溽函 BibTeX 逧�焚謐ｮ讓｡蝙倶ｸｭ \texttt{@inbook} 荳榊性 \texttt{booktitle} ��
% 謖臥�窶應ｸ楢送窶晏､�炊縲り� biblatex 逧� \texttt{@inbook} 霍� \texttt{incollection} 荳譬ｷ縲�
% 謖臥�窶應ｸ楢送逧�梵蜃ｺ譁�鍵窶晏､�炊縲�
%    \begin{macrocode}
FUNCTION {inbook} {
  booktitle empty$
    'book
    'incollection
  if$
}

%    \end{macrocode}
%
% An inproceedings is an article in a conference proceedings, and it may
% CROSSREF a proceedings.  If there's no address field, the month (\&amp; year)
% will appear just before note.
%
%       Required: author, title, booktitle, year
%
%       Optional: editor, volume or number, series, pages, address, month,
%                       organization, publisher, note
%    \begin{macrocode}
FUNCTION {inproceedings}
{ "C" set.entry.mark
  incollection
}

%    \end{macrocode}
%
% The conference function is included for Scribe compatibility.
%    \begin{macrocode}
FUNCTION {conference} { inproceedings }

FUNCTION {legislation} { archive }


FUNCTION {map}
{ "CM" set.entry.mark
  misc
}

%    \end{macrocode}
%
% A manual is technical documentation.
%
%       Required: title
%
%       Optional: author, organization, address, edition, month, year, note
%    \begin{macrocode}
FUNCTION {manual} { monograph }

%    \end{macrocode}
%
% A mastersthesis is a Master's thesis.
%
%       Required: author, title, school, year
%
%       Optional: type, address, month, note
%    \begin{macrocode}
FUNCTION {mastersthesis}
{ "D" set.entry.mark
  monograph
}

FUNCTION {newspaper}
{ "N" set.entry.mark
  article
}

FUNCTION {online}
{ "EB" set.entry.mark
  electronic
}

%    \end{macrocode}
%
% A phdthesis is like a mastersthesis.
%
%       Required: author, title, school, year
%
%       Optional: type, address, month, note
%    \begin{macrocode}
FUNCTION {phdthesis} { mastersthesis }

%    \end{macrocode}
%
% A proceedings is a conference proceedings.
% If there is an organization but no editor field, the organization will
% appear as the first optional field (we try to make the first block nonempty);
% if there's no address field, the month (\&amp; year) will appear just before note.
%
%       Required: title, year
%
%       Optional: editor, volume or number, series, address, month,
%                       organization, publisher, note
%    \begin{macrocode}
FUNCTION {proceedings}
{ "C" set.entry.mark
  monograph
}

FUNCTION {software}
{ "CP" set.entry.mark
  electronic
}

FUNCTION {standard}
{ "S" set.entry.mark
  misc
}

%    \end{macrocode}
%
% A techreport is a technical report.
%
%       Required: author, title, institution, year
%
%       Optional: type, number, address, month, note
%    \begin{macrocode}
FUNCTION {techreport}
{ "R" set.entry.mark
  misc
}

%    \end{macrocode}
%
% An unpublished is something that hasn't been published.
%
%       Required: author, title, note
%
%       Optional: month, year
%    \begin{macrocode}
FUNCTION {unpublished} { misc }

%    \end{macrocode}
%
% We use entry type `misc' for an unknown type; BibTeX gives a warning.
%    \begin{macrocode}
FUNCTION {default.type} { misc }

%    \end{macrocode}
%
%
% \subsection{Common macros}
%
% Here are macros for common things that may vary from style to style.
% Users are encouraged to use these macros.
%
% Months are either written out in full or abbreviated
%    \begin{macrocode}
MACRO {jan} {"January"}

MACRO {feb} {"February"}

MACRO {mar} {"March"}

MACRO {apr} {"April"}

MACRO {may} {"May"}

MACRO {jun} {"June"}

MACRO {jul} {"July"}

MACRO {aug} {"August"}

MACRO {sep} {"September"}

MACRO {oct} {"October"}

MACRO {nov} {"November"}

MACRO {dec} {"December"}

%    \end{macrocode}
%
% Journals are either written out in full or abbreviated;
% the abbreviations are like those found in ACM publications.
%
% To get a completely different set of abbreviations, it may be best to make
% a separate .bib file with nothing but those abbreviations; users could then
% include that file name as the first argument to the \cs{bibliography} command
%    \begin{macrocode}
MACRO {acmcs} {"ACM Computing Surveys"}

MACRO {acta} {"Acta Informatica"}

MACRO {cacm} {"Communications of the ACM"}

MACRO {ibmjrd} {"IBM Journal of Research and Development"}

MACRO {ibmsj} {"IBM Systems Journal"}

MACRO {ieeese} {"IEEE Transactions on Software Engineering"}

MACRO {ieeetc} {"IEEE Transactions on Computers"}

MACRO {ieeetcad}
 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}

MACRO {ipl} {"Information Processing Letters"}

MACRO {jacm} {"Journal of the ACM"}

MACRO {jcss} {"Journal of Computer and System Sciences"}

MACRO {scp} {"Science of Computer Programming"}

MACRO {sicomp} {"SIAM Journal on Computing"}

MACRO {tocs} {"ACM Transactions on Computer Systems"}

MACRO {tods} {"ACM Transactions on Database Systems"}

MACRO {tog} {"ACM Transactions on Graphics"}

MACRO {toms} {"ACM Transactions on Mathematical Software"}

MACRO {toois} {"ACM Transactions on Office Information Systems"}

MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}

MACRO {tcs} {"Theoretical Computer Science"}

%    \end{macrocode}
%
%
% \subsection{Format labels}
%
% The sortify function converts to lower case after |purify$|ing; it's
% used in sorting and in computing alphabetic labels after sorting
%
% The chop.word(w,len,s) function returns either s or, if the first len
% letters of s equals w (this comparison is done in the third line of the
% function's definition), it returns that part of s after w.
%    \begin{macrocode}
FUNCTION {sortify}
{ purify$
  "l" change.case$
}

%    \end{macrocode}
%
% We need the chop.word stuff for the dubious unsorted-list-with-labels case.
%    \begin{macrocode}
FUNCTION {chop.word}
{ 's :=
  'len :=
  s #1 len substring$ =
    { s len #1 + global.max$ substring$ }
    's
  if$
}

%    \end{macrocode}
%
% The |format.lab.names| function makes a short label by using the initials of
% the von and Last parts of the names (but if there are more than four names,
% (i.e., people) it truncates after three and adds a superscripted "+";
% it also adds such a "+" if the last of multiple authors is "others").
% If there is only one name, and its von and Last parts combined have just
% a single name-token ("Knuth" has a single token, "Brinch Hansen" has two),
% we take the first three letters of the last name.  The boolean
% et.al.char.used tells whether we've used a superscripted "+", so that we
% know whether to include a LaTeX macro for it.
%
% \begin{pseudocode}
% format.lab.names(s) ==
%  BEGIN
%       numnames := num.names$(s)
%       if numnames &gt; 1 then
%           if numnames &gt; 4 then
%               namesleft := 3
%           else
%               namesleft := numnames
%           nameptr := 1
%           nameresult := ""
%           while namesleft &gt; 0
%             do
%               if (name_ptr = numnames) and
%                    format.name$(s, nameptr, "{ff }{vv }{ll}{ jj}") = "others"
%                  then nameresult := nameresult * "{\etalchar{+}}"
%                       et.al.char.used := true
%                  else nameresult := nameresult *
%                               format.name$(s, nameptr, "{v{}}{l{}}")
%               nameptr := nameptr + 1
%               namesleft := namesleft - 1
%             od
%           if numnames &gt; 4 then
%               nameresult := nameresult * "{\etalchar{+}}"
%               et.al.char.used := true
%       else
%           t := format.name$(s, 1, "{v{}}{l{}}")
%           if text.length$(t) &lt; 2 then % there's just one name-token
%               nameresult := text.prefix$(format.name$(s,1,"{ll}"),3)
%           else
%               nameresult := t
%           fi
%       fi
%       return nameresult
%  END
% \end{pseudocode}
%
% Exactly what fields we look at in constructing the primary part of the label
% depends on the entry type; this selectivity (as opposed to, say, always
% looking at author, then editor, then key) helps ensure that "ignored" fields,
% as described in the LaTeX book, really are ignored.  Note that MISC is part
% of the deepest `else' clause in the nested part of calc.label; thus, any
% unrecognized entry type in the database is handled correctly.
%
% There is one auxiliary function for each of the four different sequences of
% fields we use.  The first of these functions looks at the author field, and
% then, if necessary, the key field.  The other three functions, which might
% look at two fields and the key field, are similar, except that the key field
% takes precedence over the organization field (for labels---not for sorting).
%
% The calc.label function calculates the preliminary label of an entry, which
% is formed by taking three letters of information from the author or editor or
% key or organization field (depending on the entry type and on what's empty,
% but ignoring a leading "The " in the organization), and appending the last
% two characters (digits) of the year. It is an error if the appropriate fields
% among author, editor, organization, and key are missing, and we use
% the first three letters of the |cite$| in desperation when this happens.
% The resulting label has the year part, but not the name part, |purify$|ed
% (|purify$|ing the year allows some sorting shenanigans by the user).
%
% This function also calculates the version of the label to be used in sorting.
%
% The final label may need a trailing 'a', 'b', etc., to distinguish it from
% otherwise identical labels, but we can't calculated those "extra.label"s
% until after sorting.
%
% \begin{pseudocode}
% calc.label ==
%  BEGIN
%       if type$ = "book" or "inbook" then
%           author.editor.key.label
%       else if type$ = "proceedings" then
%           editor.key.organization.label
%       else if type$ = "manual" then
%           author.key.organization.label
%       else
%           author.key.label
%       fi fi fi
%       label := label * substring$(purify$(field.or.null(year)), -1, 2)
%               % assuming we will also sort, we calculate a sort.label
%       sort.label := sortify(label), but use the last four, not two, digits
%  END
% \end{pseudocode}
%    \begin{macrocode}
FUNCTION {format.lab.name}
{ "{vv~}{ll}{, jj}{, ff}" format.name$ 't :=
  t "others" =
    { citation.et.al }
    { t get.str.lang 'name.lang :=
      name.lang lang.zh = name.lang lang.ja = or
        { t #1 "{ll}{ff}" format.name$ }
        { t #1 "{vv~}{ll}" format.name$ }
      if$
    }
  if$
}

%    \end{macrocode}
%
%    \begin{macrocode}
FUNCTION {format.lab.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  ""
  numnames 'namesleft :=
    { namesleft #0 &gt; }
    { s nameptr format.lab.name citation.et.al =
      numnames citation.et.al.min #1 - &gt; nameptr citation.et.al.use.first &gt; and or
        { bbl.space *
          citation.et.al *
          #1 'namesleft :=
        }
        { nameptr #1 &gt;
            { namesleft #1 = citation.and "" = not and
                { citation.and * }
                { ", " * }
              if$
            }
            'skip$
          if$
          s nameptr format.lab.name *
        }
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

FUNCTION {author.key.label}
{ author empty$
    { key empty$
        { cite$ #1 #3 substring$ }
        'key
      if$
    }
    { author format.lab.names }
  if$
}

FUNCTION {author.editor.key.label}
{ author empty$
    { editor empty$
        { key empty$
            { cite$ #1 #3 substring$ }
            'key
          if$
        }
        { editor format.lab.names }
      if$
    }
    { author format.lab.names }
  if$
}

FUNCTION {author.key.organization.label}
{ author empty$
    { key empty$
        { organization empty$
            { cite$ #1 #3 substring$ }
            { "The " #4 organization chop.word #3 text.prefix$ }
          if$
        }
        'key
      if$
    }
    { author format.lab.names }
  if$
}

FUNCTION {editor.key.organization.label}
{ editor empty$
    { key empty$
        { organization empty$
            { cite$ #1 #3 substring$ }
            { "The " #4 organization chop.word #3 text.prefix$ }
          if$
        }
        'key
      if$
    }
    { editor format.lab.names }
  if$
}

FUNCTION {calc.short.authors}
{ type$ "book" =
  type$ "inbook" = booktitle empty$ not and
  or
    'author.editor.key.label
    { type$ "collection" =
      type$ "proceedings" =
      or
        { editor empty$ not
            'editor.key.organization.label
            'author.key.organization.label
          if$
        }
        'author.key.label
      if$
    }
  if$
  'short.list :=
}

%    \end{macrocode}
%
% 螯よ棡 label 荳ｭ譛我ｸｭ諡ｬ蜿ｷ窶彈窶晢ｼ悟�蛻ｫ逕ｨ螟ｧ諡ｬ蜿ｷ菫晄侃襍ｷ譚･�碁亟豁｢ \cs{bibitem} 螟�炊蜃ｺ髞吶�
% 蜿ｦ螟紋ｸｺ莠��螳ｹ \pkg{bibunits}�娯從ame(year)fullname窶� 逧�ｯ丈ｸ鬘ｹ驛ｽ隕∝�蛻ｫ菫晄侃襍ｷ譚･��
% 蜿り� \href{https://github.com/tuna/thuthesis/issues/630}{tuna/thuthesis/\#630}縲�
%    \begin{macrocode}
FUNCTION {calc.label}
{ calc.short.authors
  short.list "]" contains
    { "{" short.list * "}" * }
    { short.list }
  if$
  "("
  *
  format.year duplicate$ empty$
  short.list key field.or.null = or
     { pop$ "" }
     'skip$
  if$
  duplicate$ "]" contains
    { "{" swap$ * "}" * }
    'skip$
  if$
  *
  'label :=
}

%    \end{macrocode}
%
%
% \subsection{Sorting}
%
% When sorting, we compute the sortkey by executing "presort" on each entry.
% The presort key contains a number of "sortify"ed strings, concatenated
% with multiple blanks between them.  This makes things like "brinch  per"
% come before "brinch hansen  per".
%
% The fields used here are: the sort.label for alphabetic labels (as set by
% |calc.label|), followed by the author names (or editor names or organization
% (with a leading "The " removed) or key field, depending on entry type and on
% what's empty), followed by year, followed by the first bit of the title
% (chopping off a leading "The ", "A ", or "An ").
% Names are formatted: Von Last First Junior.
% The names within a part will be separated by a single blank
% (such as "brinch hansen"), two will separate the name parts themselves
% (except the von and last), three will separate the names,
% four will separate the names from year (and from label, if alphabetic),
% and four will separate year from title.
%
% The |sort.format.names| function takes an argument that should be in
% BibTeX name format, and returns a string containing "   "-separated
% names in the format described above.  The function is almost the same
% as format.names.
%    \begin{macrocode}
%&lt;*author-year&gt;
FUNCTION {sort.language.label}
{ entry.lang lang.zh =
    { lang.zh.order }
    { entry.lang lang.ja =
        { lang.ja.order }
        { entry.lang lang.en =
            { lang.en.order }
            { entry.lang lang.ru =
                { lang.ru.order }
                { lang.other.order }
              if$
            }
          if$
        }
      if$
    }
  if$
  #64 +
  int.to.chr$
}

FUNCTION {sort.format.names}
{ 's :=
  #1 'nameptr :=
  ""
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 &gt; }
    {
      s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
      nameptr #1 &gt;
        {
          "   "  *
          namesleft #1 = t "others" = and
            { "zzzzz" * }
            { numnames #2 &gt; nameptr #2 = and
                { "zz" * year field.or.null * "   " * }
                'skip$
              if$
              t sortify *
            }
          if$
        }
        { t sortify * }
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

%    \end{macrocode}
%
% The sort.format.title function returns the argument,
% but first any leading "A "'s, "An "'s, or "The "'s are removed.
% The chop.word function uses s, so we need another string variable, t
%    \begin{macrocode}
FUNCTION {sort.format.title}
{ 't :=
  "A " #2
    "An " #3
      "The " #4 t chop.word
    chop.word
  chop.word
  sortify
  #1 global.max$ substring$
}

%    \end{macrocode}
%
% The auxiliary functions here, for the presort function, are analogous to
% the ones for calc.label; the same comments apply, except that the
% organization field takes precedence here over the key field.  For sorting
% purposes, we still remove a leading "The " from the organization field.
%    \begin{macrocode}
FUNCTION {anonymous.sort}
{ entry.lang lang.zh =
    { "yi4 ming2" }
    { "anon" }
  if$
}

FUNCTION {warn.empty.key}
{ entry.lang lang.zh =
    { "empty key in " cite$ * warning$ }
    'skip$
  if$
}

FUNCTION {author.sort}
{ key empty$
    { warn.empty.key
      author empty$
        { anonymous.sort }
        { author sort.format.names }
      if$
    }
    { key }
  if$
}

FUNCTION {author.editor.sort}
{ key empty$
    { warn.empty.key
      author empty$
        { editor empty$
            { anonymous.sort }
            { editor sort.format.names }
          if$
        }
        { author sort.format.names }
      if$
    }
    { key }
  if$
}

FUNCTION {author.organization.sort}
{ key empty$
    { warn.empty.key
      author empty$
        { organization empty$
            { anonymous.sort }
            { "The " #4 organization chop.word sortify }
          if$
        }
        { author sort.format.names }
      if$
    }
    { key }
  if$
}

FUNCTION {editor.organization.sort}
{ key empty$
    { warn.empty.key
      editor empty$
        { organization empty$
            { anonymous.sort }
            { "The " #4 organization chop.word sortify }
          if$
        }
        { editor sort.format.names }
      if$
    }
    { key }
  if$
}

%&lt;/author-year&gt;
%    \end{macrocode}
%
% 鬘ｺ蠎冗ｼ也�∝宛逧�賜蠎剰ｦ∫ｮ蜊募ｾ怜､�
%    \begin{macrocode}
%&lt;*numerical&gt;
INTEGERS { seq.num }

FUNCTION {init.seq}
{ #0 'seq.num :=}

FUNCTION {int.to.fix}
{ "000000000" swap$ int.to.str$ *
  #-1 #10 substring$
}

%&lt;/numerical&gt;
%    \end{macrocode}
%
% There is a limit, |entry.max$|, on the length of an entry string variable
% (which is what its |sort.key$| is), so we take at most that many characters
% of the constructed key, and hope there aren't many references that match
% to that many characters!
%    \begin{macrocode}
FUNCTION {presort}
{ set.entry.lang
  set.entry.numbered
  show.url show.doi check.electronic
  #0 'is.pure.electronic :=
  calc.label
  label sortify
  "    "
  *
%&lt;*author-year&gt;
  sort.language.label
  "    "
  *
  type$ "book" =
  type$ "inbook" = booktitle empty$ not and
  or
    'author.editor.sort
    { type$ "collection" =
      type$ "proceedings" =
      or
        'editor.organization.sort
        'author.sort
      if$
    }
  if$
  *
  "    "
  *
  year field.or.null sortify
  *
  "    "
  *
  cite$
  *
  #1 entry.max$ substring$
%&lt;/author-year&gt;
%&lt;*numerical&gt;
  seq.num #1 + 'seq.num :=
  seq.num  int.to.fix
%&lt;/numerical&gt;
  'sort.label :=
  sort.label *
  #1 entry.max$ substring$
  'sort.key$ :=
}

%    \end{macrocode}
%
% Now comes the final computation for alphabetic labels, putting in the 'a's
% and 'b's and so forth if required.  This involves two passes: a forward
% pass to put in the 'b's, 'c's and so on, and a backwards pass
% to put in the 'a's (we don't want to put in 'a's unless we know there
% are 'b's).
% We have to keep track of the longest (in |width$| terms) label, for use
% by the "thebibliography" environment.
%
% \begin{pseudocode}
% VAR: longest.label, last.sort.label, next.extra: string
%      longest.label.width, last.extra.num: integer
%
% initialize.longest.label ==
%  BEGIN
%       longest.label := ""
%       last.sort.label := int.to.chr$(0)
%       next.extra := ""
%       longest.label.width := 0
%       last.extra.num := 0
%  END
%
% forward.pass ==
%  BEGIN
%       if last.sort.label = sort.label then
%           last.extra.num := last.extra.num + 1
%           extra.label := int.to.chr$(last.extra.num)
%       else
%           last.extra.num := chr.to.int$("a")
%           extra.label := ""
%           last.sort.label := sort.label
%       fi
%  END
%
% reverse.pass ==
%  BEGIN
%       if next.extra = "b" then
%           extra.label := "a"
%       fi
%       label := label * extra.label
%       if width$(label) &gt; longest.label.width then
%           longest.label := label
%           longest.label.width := width$(label)
%       fi
%       next.extra := extra.label
%  END
% \end{pseudocode}
%    \begin{macrocode}
STRINGS { longest.label last.label next.extra last.extra.label }

INTEGERS { longest.label.width number.label }

FUNCTION {initialize.longest.label}
{ "" 'longest.label :=
  #0 int.to.chr$ 'last.label :=
  "" 'next.extra :=
  #0 'longest.label.width :=
  #0 'number.label :=
  "" 'last.extra.label :=
}

FUNCTION {forward.pass}
{
%&lt;*author-year&gt;
  last.label label =
    { "" 'extra.label :=
      last.extra.label text.length$ 'charptr :=
        { last.extra.label charptr #1 substring$ "z" =
          charptr #0 &gt; and
        }
        { "a" extra.label * 'extra.label :=
          charptr #1 - 'charptr :=
        }
      while$
      charptr #0 &gt;
        { last.extra.label charptr #1 substring$ chr.to.int$ #1 + int.to.chr$
          extra.label * 'extra.label :=
          last.extra.label #1 charptr #1 - substring$
          extra.label * 'extra.label :=
        }
        { "a" extra.label * 'extra.label := }
      if$
      extra.label 'last.extra.label :=
    }
    { "a" 'last.extra.label :=
      "" 'extra.label :=
      label 'last.label :=
    }
  if$
%&lt;/author-year&gt;
  number.label #1 + 'number.label :=
}

FUNCTION {reverse.pass}
{
%&lt;*author-year&gt;
  next.extra "b" =
    { "a" 'extra.label := }
    'skip$
  if$
  extra.label 'next.extra :=
  extra.label
  duplicate$ empty$
    'skip$
    { "{\natexlab{" swap$ * "}}" * }
  if$
  'extra.label :=
%&lt;/author-year&gt;
  label extra.label * 'label :=
}

FUNCTION {bib.sort.order}
{ sort.label  'sort.key$ :=
}

%    \end{macrocode}
%
%
% \subsection{Write bbl file}
%
% Now we're ready to start writing the .BBL file.
% We begin, if necessary, with a \LaTeX{} macro for unnamed names in an
% alphabetic label; next comes stuff from the `preamble' command in the
% database files.  Then we give an incantation containing the command
%     |\begin{thebibliography}{...}|
% where the `...' is the longest label.
%
% We also call init.state.consts, for use by the output routines.
%    \begin{macrocode}
FUNCTION {begin.bib}
{   preamble$ empty$
    'skip$
    { preamble$ write$ newline$ }
  if$
  "\begin{thebibliography}{" number.label int.to.str$ * "}" *
  write$ newline$
  terms.in.macro
    { "\providecommand{\biband}{蜥迎"
      write$ newline$
      "\providecommand{\bibetal}{遲厭"
      write$ newline$
    }
    'skip$
  if$
  "\providecommand{\natexlab}[1]{#1}"
  write$ newline$
  "\providecommand{\url}[1]{#1}"
  write$ newline$
  "\expandafter\ifx\csname urlstyle\endcsname\relax\else"
  write$ newline$
  "  \urlstyle{same}\fi"
  write$ newline$
  "\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$
  "\fi"
      write$ newline$
    }

%    \end{macrocode}
%
% Finally, we finish up by writing the `|\end{thebibliography}|' command.
%    \begin{macrocode}
FUNCTION {end.bib}
{ newline$
  "\end{thebibliography}" write$ newline$
}

%    \end{macrocode}
%
%
% \subsection{Main execution}
%
% Now we read in the .BIB entries.
%    \begin{macrocode}
READ

EXECUTE {init.state.consts}

EXECUTE {load.config}

%&lt;*numerical&gt;
EXECUTE {init.seq}

%&lt;/numerical&gt;
ITERATE {presort}

%    \end{macrocode}
%
% And now we can sort
%    \begin{macrocode}
SORT

EXECUTE {initialize.longest.label}

ITERATE {forward.pass}

REVERSE {reverse.pass}

ITERATE {bib.sort.order}

SORT

EXECUTE {begin.bib}

%    \end{macrocode}
%
% Now we produce the output for all the entries
%    \begin{macrocode}
ITERATE {call.type$}

EXECUTE {end.bib}
%&lt;/author-year|numerical&gt;
%    \end{macrocode}
% \end{environment}
%
% \Finale
\endinput
</pre></body></html>