% ----------------------------------------------------------------------
% jass.bst
% BibTeX style file for the Japanese Journal of Language in Society
% written by Yasuharu DEN (den@chiba-u.jp)
%
% Copyright (c) The Japanese Association of Sociolinguistic Sciences.
% All rights reserved.
%
% created from
%   jecon.bst Version 3.2 <2015-01-24>
%   written by Shiro TAKEDA
%   http://shirotakeda.org/ja/tex-ja/jecon-ja.html
%
% Description: $B!X<R2q8@8l2J3X!Y(BBibTeX$B%9%?%$%k%U%!%$%k(B
%
% Changes:
%   2021/12/07  v1.2 $B%\!<%k%I%U%)%s%H$N;XDj$r$9$Y$F:o=|(B
%   2016/02/07  v1.1 $BF|K\8lJ88%$N9`L\4V$N6u$-$rA43Q6uGr$+$i(B\hspace{1zw}$B$KJQ99(B
%   2016/01/24  v1.0 $B8x3+(B
%
% ----------------------------------------------------------------------
%YD %YD$B$G;O$^$k9T$OK\%9%?%$%k%U%!%$%k$N%3%a%s%H!"$=$l0J30$O(B jecon.bst $BCf(B
%YD $B$K$b$H$+$i$"$C$?%3%a%s%H(B
% ----------------------------------------------------------------------
% version $B;XDj(B
%YD FUNCTION {jecon.version} { "3.2" }
%YD JASS$BMQ$KJQ99(B
FUNCTION {jass.version} { "1.2" }

% Debug mode$B!%(B0 $B0J30$r;XDj$9$k$HMM!9$J>pJs$rI=<($5$;$k$3$H$,2DG=!%(B
FUNCTION {jecon.debug}
{ #0 }    % Debug mode off.
% { #1 }    % Debug mode on.


% $B0J2<$O85$N(B jpolisci.bst $B$N%X%C%@!<ItJ,$G$9!%(B
%
%%%%%% $B$3$3$+$i(B Original header.
%
% JPOLISCI: a bibliography style for papers in political sicence
%           and other fields that cite Japanese literature.
%           Vertical writing (tate-gaki) compatible.

	% Version 20000910 for JBibTeX versions 0.30 or later,
        % and pLaTeX2e or later.
	% Copyright (C) 2000, all rights reserved.
	%
	% This file was derived from jbtxbst.doc.
	%
	% Copying of this file is authorized only if either
	% (1) you make absolutely no changes to your copy, including name, or
	% (2) if you do make changes, you name it something other than
	% jbtxbst.doc, jplain.bst, junsrt.bst, jalpha.bst, jabbrv.bst,
	% tipsj.bst, jipsj.bst, tieice.bst, jname.bst, jorsj.bst, jglsj.bst,
        % seg.bst, jpolisci.bst.
	%
	% This restriction helps ensure that all standard styles are identical.
	% The file jbtxbst.doc has the documentation for this style.
	%

        % Author:
        %
        % $BHSED=$(B Osamu Iida
        % email: oiida@newmail.net
        % URL  : http://www.bol.ucla.edu/~oiida/jpolisci/ (in Japanese)
        %
        % Bug reports, technical suggestions and any other comments
        % will be appreciated.
        % 

        % Acknowledgement:
        %
        % The following files were referred to while creating this file:
        %
        %   jglsj.bst  (by $B@iMUCR>O(B Tomoaki Chiba)
        %     Function "format.lab.name" in jpolisci.bst derived from
        %     it with small modifications only. The author appreciates it.
        %
        %   seg.bst (by Martin Karrenbach)
        %     A method for making two sorts of labels is based on this
        %     file's feats.
        %
        %   jalpha.bst (by $B>>0f@50l(B Shoichi Matsui)
        %     jpolisci.bst principally owes its functionality to it.
        %
        %   $BF#EDbC:n!XB3(B LaTeX2e $B3,Dt!&=DAHJT!Y!J%"%8%=%s!&%&%'%9%l%$!"(B1998 $BG/!K!#(B
        %
        % Friends in BBSes at IR-web <http://pws.prserv.net/oi/ -- now
        % obsolete> and KH's Web Site <http://home.att.ne.jp/wind/polisci/>
        % gave me titles of Japanese political science journals which are
        % included in MACROs.

        % This file is distributed with absolutely no warranty.
        % The author doesn't assume any kind of responsibility for
        % any inconvenience caused by using this file.

        % Last modified: 2000/12/05

%%%%%% Original header $B$3$3$^$G!#(B
%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%	$BMQ8l(B

%% $B!V%(%s%H%j!<!W!'0l$D$NJ88%$N$3$H!%%(%s%H%j!<$N%?%$%W$H$O(B article$B!$(Bbook $BEy$N(B
%% $BJ88%$N<oN`$N$3$H!%(B

%% $B!V%U%#!<%k%I!W!'%(%s%H%j!<Fb$G;XDj$5$l$F$$$k(B title, author, year $BEy$N$3$H!%(B

%% $B!V%-!<%o!<%I!W!'(B\cite$BL?Na$N0z?t$H$J$k3F%(%s%H%j!<$K;XDj$5$l$F$$$kJ8;zNs$N$3(B
%% $B$H!%(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%	$B%+%9%?%^%$%:$N$?$a$N4X?t(B
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% \bysame $B$r;H$&$+H]$+!#;H$o$J$$$J$i(B 0$B!";H$&$J$i(B 0 $B0J30$r;XDj(B (bst $B%U%!%$(B
% $B%k$G$O@0?t$rI=$9$H$-?t;z$K(B # $B$rIU$1$k(B)$B!#(B
% \bysame $B$H$O!";29MJ88%ItJ,F1$8Cx<TL>$,O"B3$9$k$H$-$K(B --- $B$G>JN,$9$k$b$N!#(B
%
FUNCTION {bst.use.bysame}
%YD { #1 }     % #0 $B0J30(B -> Use \bysame
{ #0 }    % Not use \bysame

% \bysame $B$NDj5A!#(B\bysame $B$r;H$C$?$H$-$N2#K@$N7A<0$rJQ$($k$K$O0J2<$NDj5A$r=$@5(B
% $B$9$k!#(B
%
FUNCTION {bst.bysame.definition}
{ "\hskip.3em \leavevmode\rule[.5ex]{3em}{.3pt}\hskip0.5em" } 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Economics $B$N(B reference $B$G$O(B, first author $BL>$O!V@+(B, $BL>!W$N=gHV$GI=5-$7!"(B
% second author $B0J2<$O!VL>(B $B@+!W$H$9$k$H$$$&>l9g$,B?$$$,!"$3$l$rJQ99$9$k$?$a$N4X?t!#(B
% Editor $B$K$bE,MQ!#F|K\8lJ88%$O4X78$J$7!#(B#0 $B$+(B #1 $B$+(B #2 $B$rA*Br2D!#(B
%
FUNCTION {bst.author.name}
%YD { #0 }    % (default)
{ #1 }
% { #2 }

% [#0 $B$N%1!<%9(B] $B$3$lIaDL$N7P:Q3XIw!#(B
% Fujita, Masahisa, Paul R. Krugman, and Anthony J. Venables. 

% [#1 $B$N%1!<%9(B] $BA40w!V@+(B, $BL>!W$N%1!<%9!#(B
% Fujita, Masahisa, Krugman, Paul R., and Venables, Anthony J.

% [#2 $B$N%1!<%9(B] $BA40w!VL>(B $B@+!W$N%1!<%9!#(B
% Masahisa Fujita, Paul R. Krugman, and Anthony J. Venables.

% Economics $B$N(B reference $B$G$O(B, first author $BL>$O!V@+(B, $BL>!W$N=gHV$GI=5-$7!"(B
% second author $B0J2<$O!VL>(B $B@+!W$H$9$k$H$$$&>l9g$,B?$$$,!"$3$l$rJQ99$9$k$?$a$N4X?t!#(B
% Editor $B$K$bE,MQ!#F|K\8lJ88%$O4X78$J$7!#(B#0 $B$+(B #1 $B$+(B #2 $B$rA*Br2D!#(B
%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% bib$B%U%!%$%k$K$*$1$kF|K\?ML>$N5-=RJ}K!$NA*Br!#(B
%
% $BIaDL$N(Bbib$B%U%!%$%k$G$OF|K\?ML>$O!V(Bauthor = {$B@+(B $BL>(B}$B!W$H$$$&=q$-J}$r$9$k!#$7$+$7!"(B
% $B0lIt$NJ88%4IM}%=%U%H$OF|K\?ML>$r!V(Bauthor = {$B@+(B, $BL>(B}$B!W$H$$$&7A<0$G(Bbib$B%U%!%$%k$K(B
% $B=PNO$9$k!#(Bbib$B%U%!%$%k$,$3$N$I$A$i$N7A<0$G5-=R$5$l$F$$$k$+$NA*Br!#(Beditor$B!"(Byomi$B!"(B
% jauthor$B$K$bF1$8A*Br$,E,MQ$5$l$^$9!#>\$7$/$O(Bjecon-sample.pdf$B$G!#(B
%
FUNCTION {bst.sei.mei.order}
{ #0 }    % (default) $BIaDL$N=q$-J}(B $B"*(B author = {$BIpED(B $B;KO:(B} or author = {$B;KO:(B, $BIpED(B}
% { #1 }    % $B5U$N=q$-J}(B $B"*(B author = {$BIpED(B, $B;KO:(B} or author = {$B;KO:(B $BIpED(B} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Author (editor) $BL>$N(B first name $B$rF,J8;z$@$1$KN,$9!#(B
%
FUNCTION {bst.first.name.initial}
{ #0 }    % #0 -> $BN,$5$J$$!#(B (default)
% { #1 }    % #0 $B0J30(B -> first name $B$rF,J8;z$KN,$9!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Title $B$N@hF,J8;z0J30$r>.J8;z$KJQ49$9$k(B (book $B$N(B tile $B$O=|$/!#85!9>.J8(B
% $B;z$J$i$J$K$bJQ$o$i$J$$(B)$B!#(B
%
FUNCTION {bst.title.lower.case}
%YD { #0 }    % #0 $B$J$i>.J8;z$KJQ49$7$J$$(B ($B$=$N$^$^(B)  (default)
{ #1 }    % #0 $B0J30$J$i!">.J8;z$KJQ49$9$k!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Title $B$rI=<($9$k$+$7$J$$$+!%(B
%
FUNCTION {bst.hide.title}
{ #0 }    % #0 -> $BI=<($9$k!%IaDL$O$3$A$i!%(B (default)
% { #1 }    % #0 $B0J30(B -> $B1#$9(B ($BI=<($7$J$$(B)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% $BF1$8G/$KF1$8Cx<T$N1Q8l!"F|K\8lJ88%$NN>J}$,$"$j!"$+$DF|K\8lJ88%$N(B yomi
% $B$K1Q8lJ88%$NCx<T$HF1$8$b$N$,;XDj$7$F$"$k$H$-$K!"N><T$r:.$<$FI=<($9$k$?(B
% $B$a$N%*%W%7%g%s!#(B
% yomi$B$rF|K\8l$G=q$$$F$$$k$J$i4X78$J$7!%(B
FUNCTION {bst.mixed.order}
%YD { #0 }    % #0 -> $B:.$<$J$$!%IaDL$O$3$A$i!%(B (default)
{ #1 }    % #0 $B0J30(B -> $B:.$<$k!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% month $B$rI=<($9$k$+H]$+!#1#$9(B($BI=<($7$J$$(B)$B$J$i(B 0 $B0J30!"1#$5$J$$(B($BI=<($9$k(B)$B$J$i(B 
% 0 $B$r;XDj!#1#$9>l9g$G$b(B month $B%U%#!<%k%I$NCM$OJB$YBX$($N%-!<$H$7$F$OMxMQ$5$l(B
% $B$k!#$3$l$bIaDL$OJQ99$7$J$$!%(B
FUNCTION {bst.hide.month}
%YD { #0 }    % #0 -> $BI=<($9$k!%IaDL$O$3$A$i!%(B (default)
{ #1 }    % #0 $B0J30(B -> $B1#$9(B ($BI=<($7$J$$(B)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% number filed $B$rI=<($9$k$+H]$+!#1#$9(B($BI=<($7$J$$(B)$B$J$i(B 0 $B0J30!"1#$5$J$$(B($BI=<($9(B
% $B$k(B)$B$J$i(B 0 $B$r;XDj!#$3$l$bIaDL$OJQ99$7$J$$!%(B
FUNCTION {bst.hide.number}
{ #0 }    % #0 -> $BI=<($9$k!%IaDL$O$3$A$i!%(B (default)
% { #1 }    % #0 $B0J30(B -> $B1#$9(B ($BI=<($7$J$$(B)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% $B$3$l$NCM$K(B 0 $B0J30$r;XDj$9$k$H!"(Breference $BItJ,$G(B plain.bst $B$N$h$&$KJ88%(B
% $B$NA0$K(B number index ([1]$B$N$h$&$J$b$N(B)$B$rIU$1$k$3$H$,$G$-$k(B ($B0zMQItJ,$O(B
% author-year$B$GJQ$o$i$J$$(B)$B!#(B
%
FUNCTION {bst.use.number.index}
{ #0 }    % Not use number index  (default)
% { #1 }    % #0 $B0J30(B -> Use number index

% number index $B$NA0$KIU$1$kJ8;zNs(B (bst.use.number.index$B$K(B0$B0J30$r;XDj$7$F$$$k$H(B
% $B$-$N$_M-8z(B)$B!%(B
%
FUNCTION {bst.number.index.pre}
{ "[" }    % (default) 

% number index $B$N8e$KIU$1$kJ8;zNs!#(B \hskip1.0em $B$O6uGr$NBg$-$5!#6uGr$ND9$5$O<+(B
% $BJ,$GD4@0$7$?$[$&$,$h$$!#(B (bst.use.number.index$B$K(B0$B0J30$r;XDj$7$F$$$k$H$-$N$_(B
% $BM-8z(B)$B!%(B
FUNCTION {bst.number.index.post}
{ "]\hskip1.0em " }    % (default)

% number index $B$N:GBg$N7e?t(B ($BJ88%$,(B100$B8D0J>e$J$i(B3$B!"(B100$B8D$h$j>/$J$$$J$i(B2$B!"(B10$B8D$h(B
% $B$j>/$J$1$l$P(B1$B$r;XDj(B)$B!#$H$j$"$($:(B 3 $B$r;XDj$7$F$*$1$PLdBj$J$$$,!"(B3 $B$@$H%$%s%G%s(B
% $B%H$,Bg$-L\$K$J$k!#CM$O(B 1, 2, 3 $B$N$I$l$+$r;XDj!%(B
%
FUNCTION {bst.number.index.digit}
{ "3" }    % (default)

% $B0J2<$O!"(Bnumber index $B$rI=<($9$k$H$-$K8+$?L\$rD4@0$9$k$?$a$N4X?t!#(Bcomputer
% modern $B0J30$N%U%)%s%H$r;HMQ$9$k$h$&$J$H$-$OMWD4@0!#(B
%
% Reference $BItJ,$NJ88%$N(B2$B9TL\0J9_$N%$%s%G%s%HI}$NCM$r;XDj!%(B
%
% bst.number.index.digit $B$NCM$K$h$C$F%$%s%G%s%HI}$OJQ$o$k$N$G!$$=$l$>$l$N%1!<%9(B
% $B$K$D$$$F;XDj$9$k!%(B
%
% bst.number.index.digit = 1 $B$N$H$-$N@_Dj(B
FUNCTION {bst.number.index.bibhang.one}
{ "2.05em" }    % (default)
% bst.number.index.digit = 2 $B$N$H$-$N@_Dj(B
FUNCTION {bst.number.index.bibhang.ten}
{ "2.55em" }    % (default)
% bst.number.index.digit = 3 $B$N$H$-$N@_Dj(B
FUNCTION {bst.number.index.bibhang.hund}
{ "3.05em" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% year $B$NI=<(0LCV$rJQ99!#(B
%
% 0 $B$J$i(B author $B$N$9$08e$K(B year $B$rI=<(!#(B0 $B0J30$J$i(B year $B$O8e$m$K$b$C$F$/$k!#8e(B
% $B$m$H$O(B note $B%U%#!<%k%I$,$J$1$l$P0lHV:G8e!$(Bnote $B%U%#!<%k%I$,$"$l$P(B note $B%U%#!<(B
% $B%k%I$rI=<($9$kA0!%(B
FUNCTION {bst.year.backward}
{ #0 }    % (default)
% { #1 }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% $BF|K\8lJ88%$N?t;z$r4A?t;z$K$9$k!%(B
%
% $B=D=q$-MQ$G$9!%(B
%
% 0 $B0J30$J$i4A?t;z$KJQ49!#(B
FUNCTION {bst.kansuji.jp}
{ #0 }    % $BJQ49$7$J$$!#(B(default)
% { #1 }    % $B4A?t;z$KJQ49$9$k!#(B

% bst.kansuji.jp $B$,Hs%<%m$N$H$-$K!$(Bpages $B$G$N%Z!<%8?t$H%Z!<%8?t$r7k$V@~$NDj5A(B
% $B$r;XDj$9$k!%(Bpages = 100-200 $B$H;XDj$7$F$$$k$H$-$K!$(B"-" $B$KCV$-49$o$k@~$NDj5A!%(B
%
% $B=D=q$-$NI=<($r;XDj$7$F$$$k$H$-$G$b(B - $B$O2#K@$N$^$^I=<($5$l$^$9!%$3$l$r=DK@$K(B
% $BI=<($9$k$?$a$N;XDj$G$9!%(B
% 
FUNCTION {bst.tatebo.definition}
{ "\hskip.1em \leavevmode\rule[0ex]{1em}{.3pt}\hskip0.1em" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% 0 $B0J30$r;XDj$9$k$H?7$7$$G/$NJ88%$rA0$K$b$C$F$/$k!#(B
%
% 0 $B$J$iIaDL$NJB$S=g!#DL>o$O(B 0 $B$N$^$^$G$$$$$G$7$g$&!%(B
%
FUNCTION {bst.reverse.year}
{ #0 }    % $BIaDL$NJB$S=g(B ($B8E$$J88%$[$I>e(B) (default)
% { #1 }    % $BIaDL$H$O5U(B ($B?7$7$$J88%$[$I>e(B)

% 0 $B0J30$J$i(B year $B$rM%@hE*$J%-!<$H$7$F%=!<%H(B($BJB$YBX$((B)$B$r$9$k!#(B
% 
% $BIaDL$G$O8E$$J88%$[$I>e$KJB$Y$i$l$k$,!"(Bbst.reverse.year $B$,Hs%<%m$J$i?7$7$$J8(B
% $B8%$[$I>e$H$J$k!#(B
%
FUNCTION {bst.sort.year}
{ #0 }    % $B$3$N>l9g!"(Byear $B$O(B author $B$K<!$0%=!<%H$N%-!<(B ($BIaDL$N%1!<%9(B) (default)
% { #1 }    % $B$3$N>l9g!"(Byear $B$O:GM%@h$5$l$k%=!<%H$N%-!<(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% $B0zMQ=g$G;29MJ88%$rJB$Y$k@_Dj!%(B
%
% 0 $B0J30$r;XDj$9$k$H0zMQ$r$7$?$=$N$^$^$N=g$G(B reference $B$KJ88%$rJB$Y$k!%(B\bysame 
% $B$H0l=o$KMxMQ$9$k$HI=<($,$*$+$7$/$J$k%1!<%9$"$j!%(B
%
FUNCTION {bst.no.sort}
{ #0 }    % $BJ88%$N=gHV$rIaDL$K%=!<%H$9$k!%(B(default)
% { #1 }    % $B0zMQ=g$KJB$Y$k!%(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% $BJ88%$NJB$YBX$($N$H$-J88%%(%s%H%j!<$N%?%$%WJL(B (article, book, incollection $BEy(B)
% $B$K$^$H$a$k$?$a$N@_Dj!%(B
%
FUNCTION {bst.sort.entry.type}
{ #0 }    % #0 -> $B%?%$%WJL$K$^$H$a$J$$!%(B(default)
% { #1 }    % $B$^$H$a$k!%(B
%
% $B$3$N@_Dj$O(B absorder $B$h$j$bM%@h$7$^$9!%$I$&$$$&=gHV$GJB$Y$k$+(B (article, book,
% incollection $BEy$r$I$&JB$Y$k$+(B) $B$O(B bst.sort.entry.type.order $B$H$$$&4X?t$N@_Dj(B
% $B$G7h$^$j$^$9!%%G%U%)!<%k%H$G$O(B alphabet $B=g$K$7$F$"$j$^$9(B (article, book,
% booklet, comment,..., unpublished $B=g(B)$B!%>\$7$/$O(B jecon-sample.pdf $B$r;2>H!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% $BJ88%$NJB$YBX$($N$H$-(B absorder filed $B$NCM$rMxMQ$9$k$+H]$+!#MxMQ$9$k$J$i(B
% 0$B!"MxMQ$7$J$$$J$i(B 0 $B0J30$r;XDj!#(B
%
FUNCTION {bst.notuse.absorder.field}
{ #0 }    % #0 -> $BMxMQ$9$k!#(B(default)
% { #1 }    % #0 $B0J30(B -> $BMxMQ$7$J$$!#(B
%
% Reference $B$G$NJ88%JB$YBX$($NM%@h=g=x$K$D$$$F$O(B 
% 
% absorder -> author (or yomi) -> year -> order -> month -> title
%
% $B$H$7$F$"$k!#>\$7$/$O(B jecon-sample.pdf $B$r;2>H!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% $BJ88%$NJB$YBX$($N$H$-(B order filed $B$NCM$rMxMQ$9$k$+H]$+!#MxMQ$9$k$J$i(B
% 0$B!"MxMQ$7$J$$$J$i(B 0 $B0J30$r;XDj!#(B
FUNCTION {bst.notuse.order.field}
{ #0 }    % #0 -> $BMxMQ$9$k!#(B(default)
% { #1 }    % #0 $B0J30(B -> $BMxMQ$7$J$$!#(B

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%	and

%%% $BFs?M$N(B authors, editors $B$N4V$NJ8;zNs(B
%
% "Mr.A _ Mr.B " $B$N(B "_" $B$NItJ,$KF~$kJ8;zNs(B
%
FUNCTION {bst.and}
%YD { " and " }    % (default)
{ ", \& " }

%%% $B;0?M0J>e$N(B authors, editors $B$N4V$NJ8;zNs(B
%
% "Mr.A, Mr.B _ Mr.C" $B$N(B "_" $B$NItJ,$KF~$kJ8;zNs(B
%
FUNCTION {bst.ands}
%YD { ", and " }    % (default)
{ ", \& " }

% $BJ#?t$N(B authors, editors $B$N4V$NJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
% "A$B;a(B _ B$B;a(B _ C$B;a(B" $B$N(B "_" $B$NItJ,$KF~$kJ8;zNs(B
%
FUNCTION {bst.and.jp}
{ "$B!&(B" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%	$B!V0zMQItJ,!W$G$N(B author $BL>$N4V$KF~$kJ8;zNs(B

%%% $BFs?M$N(B authors, editors $B$N4V$NJ8;zNs(B
%
% $B0zMQItJ,$N(B "Mr.A _ Mr.B " $B$N(B "_" $B$NItJ,$KF~$kJ8;zNs(B
%
FUNCTION {bst.cite.and}
%YD { " and " }    % (default)
{ " \& " }

%%% $B;0?M0J>e$N(B authors, editors $B$N4V$NJ8;zNs(B
%
% $B0zMQItJ,$N(B "Mr.A, Mr.B _ Mr.C" $B$N(B "_" $B$NItJ,$KF~$kJ8;zNs(B
%
FUNCTION {bst.cite.ands}
%YD { " and " }    % (default)
{ " \& " }

% $BJ#?t$N(B authors, editors $B$N4V$NJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
% $B0zMQItJ,$N(B "A$B;a(B _ B$B;a(B _ C$B;a(B" $B$N(B "_" $B$NItJ,$KF~$kJ8;zNs(B
%
FUNCTION {bst.cite.and.jp}
{ "$B!&(B" }    % (default)


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% $B2??M0J>e$NCx<T$,$$$k$H$-$K0zMQItJ,$G(B et al.$B$G>JN,$9$k$+!#(B3$B?M0J>e$N$H$-(B
% $B$KN,$9$H$-$O(B #3 $B$r;XDj!#(B
FUNCTION {bst.and.others.num}
{ #3 }    % 3$B?M0J>e$J$i>JN,$9$k!#(B(default)
% { #4 }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%	author $BL>$rN,$9:]$NJ8;zNs(B

%%% $B1Q8lMQ(B
%
FUNCTION {bst.and.others}
{ " et~al." }    % (default)

%%% $BF|K\8lMQ(B
%
FUNCTION {bst.and.others.jp}
%YD { "$BB>(B" }    % (default)
{ "$B$[$+(B" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	author 

% author $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.author.pre}
{ "" }    % (default)

% author $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.author.post}
{ "" }    % (default)

% author $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.author.pre.jp}
{ "" }    % (default)

% author $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.author.post.jp}
{ "" }    % (default)

%%% $BF|K\8lJ88%$N(B author, editor $B$N@+!&L>$N4V$KF~$l$kJ8;zNs(B 
% ($B@+L>$N$I$A$i$+0lJ}$,0lJ8;z$N%1!<%9(B)
%
FUNCTION {bst.sei.mei.one.jp}
{ "" }    % (default)
% { "$B!!(B" }

%%% $BF|K\8lJ88%$N(B author, editor $B$N@+!&L>$N4V$KF~$l$kJ8;zNs(B 
% ($B@+!&L>$H$bFsJ8;z0J>e$N%1!<%9(B)
%
FUNCTION {bst.sei.mei.two.jp}
{ "" }    % (default)
% { " " }


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	year

% year $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.year.pre}
{ " (" }    % (default)

% year $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.year.post}
%YD { ") " }    % (default)
{ "). " }

% year $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.year.pre.jp}
{ " (" }    % (default)

% year $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.year.post.jp}
%YD { ") " }    % (default)
{ "). " }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	title (book $B0J30(B)

% title $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.title.pre}
%YD { "``" }    % (default)
{ "" }

% title $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.title.post}
%YD { ",''" }    % (default)
{ "." }

% title $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.title.pre.jp}
%YD { "$B!V(B" }    % (default)
{ "" }

% title $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.title.post.jp}
%YD { "$B!W!$(B" }    % (default)
{ "\hspace{1zw}" }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	book $BMQ(B title

% book $B$N(B title $BA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.book.pre}
%YD { " {\it " }    % (default)
{ "{\it " }

% book $B$N(B title $B8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.book.post}
{ "}" }    % (default)

% book $B$N(B title $BA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.book.pre.jp}
%YD { "$B!X(B" }    % (default)
{ "" }

% book $B$N(B title $B8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.book.post.jp}
%YD { "$B!Y(B" }    % (default)
{ "" }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	booktitle

% booktitle $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.btitle.pre}
%YD { " {\it " }    % (default)
{ "{\it " }

% booktitle $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.btitle.post}
{ "}" }    % (default)

% booktitle $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.btitle.pre.jp}
%YD { "$B!X(B" }    % (default)
{ "" }

% booktitle $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.btitle.post.jp}
%YD { "$B!Y(B" }    % (default)
{ "" }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	journal name

% journal name $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.journal.pre}
{ " {\it " }    % (default)

% journal name $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.journal.post}
{ "}" }    % (default)

% journal name $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.journal.pre.jp}
%YD { "$B!X(B" }    % (default)
{ "" }

% journal name $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.journal.post.jp}
%YD { "$B!Y(B" }    % (default)
{ "" }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	editor $B5-9f(B

% $BJ#?t(B editor $B$rI=$9J8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.editors}
%YD { " eds. " }    % (default)
{ " (Eds.)" }

% $B0l?M$N(B editor $B$rI=$9J8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.editor}
%YD { " ed. " }    % (default)
{ " (Ed.)" }

% editor $B$rI=$9J8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.editor.jp}
{ "$B!JJT!K(B" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	edition

% edition $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.edition.pre}
{ ", " }    % (default)

% edition $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.edition.post}
{ " edition" }    % (default)

% edition $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.edition.pre.jp}
%YD { "$B!$Bh(B" }    % (default)
{ "\hspace{1zw}" }

% edition $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.edition.post.jp}
{ "$BHG(B" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	volume

% volume $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.volume.pre}
%YD { ", Vol. " }    % (default)
{ ", " }

% volume $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.volume.post}
%YD { "" }    % (default)
{ "" }

% volume $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.volume.pre.jp}
%YD { "$B!$Bh(B" }    % (default)
{ ", " }

% volume $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.volume.post.jp}
%YD { "$B4,(B" }    % (default)
{ "" }

%YD series $B$NCf$N(B volume
%YD volume $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
FUNCTION {bst.volume.pre.inseries}
{ ", Vol. " }

%YD volume $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
FUNCTION {bst.volume.post.inseries}
{ "" }

%YD volume $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
FUNCTION {bst.volume.pre.jp.inseries}
{ " " }

%YD volume $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
FUNCTION {bst.volume.post.jp.inseries}
{ "" }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	number

% number $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.number.pre}
%YD { ", No. " }    % (default)
{ " (" }

% number $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.number.post}
%YD { "" }    % (default)
{ ")" }

% number $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.number.pre.jp}
%YD { "$B!$Bh(B" }    % (default)
{ " (" }

% number $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.number.post.jp}
%YD { "$B9f(B" }    % (default)
{ ")" }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	in 

% In ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.in}
%YD { " in " }    % (default)
{ " In " }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	page

% page $B$NA0$KIU$1$kJ8;zNs(B ($BJ#?t%Z!<%8(B) ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.pages.pre}
{ ", pp." }    % (default)

%YD $BDj4|4)9TJ*MQ(B
FUNCTION {bst.pages.pre.periodical}
{ ", " }

% page $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.page.pre}
{ ", p." }    % (default)

%YD $BDj4|4)9TJ*MQ(B
FUNCTION {bst.page.pre.periodical}
{ ", " }

% page $B$N8e$KIU$1$kJ8;zNs(B ($BJ#?t%Z!<%8(B) ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.pages.post}
{ "" }    % (default)

% page $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.page.post}
{ "" }    % (default)

% page $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
%YD pages $B$H(B page $B$r6hJL(B
FUNCTION {bst.pages.pre.jp}
%YD { "$B!$(B" }    % (default)
{ ", pp. " }

%YD $BDj4|4)9TJ*MQ(B
FUNCTION {bst.pages.pre.jp.periodical}
{ ", " }

FUNCTION {bst.page.pre.jp}
%YD { "$B!$(B" }    % (default)
{ ", p. " }

%YD $BDj4|4)9TJ*MQ(B
FUNCTION {bst.page.pre.jp.periodical}
{ ", " }

% page $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.page.post.jp}
%YD { "$BJG(B" }    % (default)
{ "" }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	chapter

% chapter $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.chapter.pre}
{ ", Chap." }    % (default)

% chapter $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.chapter.post}
{ "" }    % (default)

% chapter $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.chapter.pre.jp}
{ "$B!$Bh(B" }    % (default)

% chapter $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.chapter.post.jp}
{ "$B>O(B" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	month

% month $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.month.pre}
{ ", " }    % (default)

% month $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.month.post}
{ "" }    % (default)

% month $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.month.pre.jp}
{ "$B!$(B" }    % (default)

% month $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.month.post.jp}
{ "$B7n(B" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	address
% address $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.address.pre}
%YD { ", " }    % (default)
{ ". " }

% address $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.address.post}
{ "" }    % (default)

% address $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.address.pre.jp}
%YD { "$B!$(B" }    % (default)
{ "\hspace{1zw}" }

% address $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.address.post.jp}
{ "" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	publisher

% publisher $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.publisher.pre}
{ ": " }    % (default)

% publisher $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.publisher.post}
{ "" }    % (default)

% publisher $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.publisher.pre.jp}
%YD { "$B!$(B" }    % (default)
{ "\hspace{1zw}" }

% publisher $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.publisher.post.jp}
{ "" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	series

% series $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.series.pre}
{ ", " }    % (default)

% series $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.series.post}
{ "" }    % (default)

% series $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.series.pre.jp}
%YD { "$B!$(B" }    % (default)
{ "" }

% series $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.series.post.jp}
%YD { "" }    % (default)
{ "\hspace{1zw}" }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	organization

% organization $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.organization.pre}
{ ", " }    % (default)

% organization $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.organization.post}
{ "" }    % (default)

% organization $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.organization.pre.jp}
{ "$B!$(B" }    % (default)

% organization $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.organization.post.jp}
{ "" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	school

% school $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.school.pre}
{ ", " }    % (default)

% school $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.school.post}
{ "" }    % (default)

% school $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.school.pre.jp}
{ "$B!$(B" }    % (default)

% school $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.school.post.jp}
{ "" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	institution

% institution $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.institution.pre}
{ ", " }    % (default)

% institution $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.institution.post}
{ "" }    % (default)

% institution $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.institution.pre.jp}
{ "$B!$(B" }    % (default)

% institution $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.institution.post.jp}
{ "" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	howpublished

% howpublished $B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.howpublished.pre}
{ " " }    % (default)

% howpublished $B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.howpublished.post}
{ "" }    % (default)

% howpublished $B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.howpublished.pre.jp}
%YD { "$B!$(B" }    % (default)
{ "" }

% howpublished $B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.howpublished.post.jp}
{ "" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%       url

% URL$B%U%#!<%k%I!%Hs%<%m$r;XDj$9$k$H(BURL$B$,I=<($5$l$k!%%<%m$N$H$-$OHsI=<(!%(B
FUNCTION {bst.show.url}
{ #1 }    % non-#0 -> URL$B$rI=<((B (default)
% { #0 }    % #0 -> URL$B$rHsI=<((B

% URL$B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.url.pre}
%YD { ", URL: \url{" }	% (default)
{ ", $<$\url{" }

% URL$B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.url.post}
%YD { "}" }    % (default)
{ "}$>$" }

% URL$B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.url.pre.jp}
%YD { "$B!$(BURL$B!'(B\url{" }	% (default)
{ "\hspace{1zw}$<$\url{" }

% URL$B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.url.post.jp}
%YD { "}" }    % (default)
{ "}$>$" }


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%       Access

% Access$B%U%#!<%k%I!%(Baccess$B%U%#!<%k%I$O(BURL$B$K%"%/%;%9$7$?F|IU$1$r;XDj$7$F$*$/!%$3(B
% $B$l$OIaDL$N(Bbib$B%U%!%$%k$K$O$J$$%U%#!<%k%I!%(B

% access$B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.access.pre}
%YD { ", accessed on " } % (default)
{ " (" }

% access$B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.access.post}
%YD { "" }    % (default)
{ ")" }

% access$B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.access.pre.jp}
%YD { "$B!J%"%/%;%9F|(B: " } % (default)
{ "$B!J(B" }

% access$B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.access.post.jp}
%YD { "$B!K(B" }    % (default)
{ "$B!K(B" }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%       DOI (digital object identifier)

% DOI$B%U%#!<%k%I!%(BDOI$B$r;XDj!%$3$l$bIaDL$N(Bbib$B%U%!%$%k$K$O$J$$%U%#!<%k%I!%(B

% $BHs%<%m$J$i(BDOI$B$rI=<(!%%<%m$J$iHsI=<(!%(B
FUNCTION {bst.show.doi}
%YD { #1 }    % non-#0 -> Show DOI field (default)
{ #0 }    % #0 -> Not show DOI field.

% DOI$B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.doi.pre}
{ ", DOI: \url{http://dx.doi.org/" } % (default)

% DOI$B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.doi.post}
{ "}" }    % (default)

% DOI$B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.doi.pre.jp}
{ "$B!$(BDOI: \url{http://dx.doi.org/" } % (default)

% DOI$B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.doi.post.jp}
{ "}" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	$BK.Lu=q(B

FUNCTION {bst.hoyakusho.pre.jp}
{ "$B!J(B" }    % (default)

FUNCTION {bst.hoyakusho.post.jp}
{ "$B!K(B" }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% $B6gE@$N;XDj!%(B
%YD $B<B:]$K$O2?$bDI2C$7$J$$(B
FUNCTION {bst.kuten.jp}
%YD { "$B!%(B" }    % (default)
{ "" }

% $BFIE@$N;XDj!%(B
FUNCTION {bst.touten.jp}
%YD { "$B!$(B" }    % (default)
{ "\hspace{1zw}" }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	
% 0 $B0J30$r;XDj$9$l$P!$(Bpage $B$r7R$0(B "-" $B$r(B "--" $B$KJQ99$7$J$$!%(B
FUNCTION {bst.dashify.off}
{ #0 }
%YD { #1 }    % (default)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% $BHs%<%m$r;XDj$9$k$H(B \harvarditem $B$r=PNO$7$J$$!%(B
FUNCTION {bst.harvarditem.off}
{ #0 }    % (default)
% { #1 }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	\thebibliography$B4D6-$NDj5A(B
%
% thebibliography$BL?Na$NA0$d8e$K2?$+$rF~$l$?$$$H$-$OJQ99$7$F$/$@$5$$!%(B
%
%YD $BM>J,$J6u9T$rM^@)(B
FUNCTION {bst.thebibliography.begin}
{
  %YD "" write$ newline$
  "\begin{thebibliography}{xxx}" write$ newline$
  %YD "" write$ newline$
}

FUNCTION {bst.thebibliography.end}
{ 
  %YD "" write$ newline$
  "\end{thebibliography}" write$ newline$
  %YD "" write$ newline$
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	$B$=$NB>$N4X?t(B

% note$B$NA0$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.note.pre}
{ ", " }    % (default)

% note$B$N8e$KIU$1$kJ8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.note.post}
{ "" }    % (default)

% note$B$NA0$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.note.pre.jp}
%YD { "$B!$(B" }    % (default)
{ "\hspace{1zw}" }

% note$B$N8e$KIU$1$kJ8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.note.post.jp}
{ "" }    % (default)

% Technical report $B$rI=$9J8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.techrep}
{ " Tech. Rep." }    % (default)

% Technical report $B$rI=$9J8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.techrep.jp}
{ " $B%F%/%K%+%k!&%l%]!<%H(B" }    % (default)

% master thesis $B$rI=$9J8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.mthesis}
%YD { " Master's thesis" }    % (default)
{ ". Master's thesis" }

% master thesis $B$rI=$9J8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.mthesis.jp}
%YD { "$B=$;NO@J8(B" }    % (default)
{ "\hspace{1zw}$B=$;NO@J8(B" }

% phd thesis $B$rI=$9J8;zNs(B ($B1Q8lJ88%MQ(B)
%
FUNCTION {bst.phdthesis}
%YD { " Ph.D. dissertation" }    % (default)
{ ". Doctoral dissertation" }

% phd thesis $B$rI=$9J8;zNs(B ($BF|K\8lJ88%MQ(B)
%
FUNCTION {bst.phdthesis.jp}
%YD { "$BGn;NO@J8(B" }    % (default)
{ "\hspace{1zw}$BGn;NO@J8(B" }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%	$B%+%9%?%^%$%:$N$?$a$N4X?t$O$3$3$^$G!#(B
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% $B0J2<$O1Q8lJ88%MQ(B

FUNCTION {bst.first}
{ "1st" }

FUNCTION {bst.second}
{ "2nd" }

FUNCTION {bst.third}
{ "3rd" }

FUNCTION {bst.fourth}
{ "4th" }

FUNCTION {bst.fifth}
{ "5th" }

FUNCTION {bst.st}
{ "st" }

FUNCTION {bst.nd}
{ "nd" }

FUNCTION {bst.rd}
{ "rd" }

FUNCTION {bst.th}
{ "th" }

%%%%% memo by Takeda

% "a" 'b := $B$O(B b $B$H$$$&JQ?t$K(B "a" $B$H$$$&J8;zNs$rBeF~$9$k$H$$$&$3$H!#(B

% #0 $B$O@0?t$N(B 0$B!"(B#1 $B$O@0?t$N(B 1$B!%!%!%$rI=$9!#(B

%%% $B4X?t$N=q<0(B
%
% FUNCTION {name}
% { 's :=
%
% }
%
% $B>e$O(B name $B$H$$$&4X?t$NDj5A!#8F=P$7B&$G$O(B
%
% "hoge" name
%
% $B$H$$$&7A$G;XDj!#(B"hoge" $B$H$$$&J8;zNs$,!"JQ?t(B s $B$KBeF~$5$l$k!#(B
%
% $B0z?t$,Fs$D0J>e$N4X?t$NDj5A(B --> $B4X?t(B chop.word $B$r;2>H!#(B

ENTRY

  %%% $BJ88%%U%#!<%k%I$N@k8@(B
  { access address author booktitle chapter doi edition editor howpublished
    institution journal key month note number organization pages publisher
    school series title type url volume year yomi

    % $B0J2<$OIaDL$N(B bst $B%U%!%$%k$G$OMxMQ$5$l$J$$%U%#!<%k%I(B
    jauthor jkanyaku jtitle jpublisher jyear
    order absorder
  }

  % $B0J2<!$%(%s%H%j!<JQ?t$NDj5A!%%(%s%H%j!<JQ?t$H$O!$J88%%(%s%H%j!<JL$K0[$J$C(B
  % $B$?CM$r;}$DJQ?t$N$3$H!%(B

  %% $B$3$l$O(B entry $BJL$N@0?t7?JQ?t(B ($B@0?t7?%(%s%H%jJQ?t(B)
  { is.kanji.entry is.kanji.entry.two order.cited }

  %% $B$3$l$O(B entry $BJL$NJ8;zNs7?JQ?t(B ($BJ8;zNs7?%(%s%H%jJQ?t(B)
  { label cyear flabel alabel extra.label sort.label sort.label.abb
    extra.label.bysame }

%%% $BJQ?t@k8@(B

%% $BJ8;zNs7?Bg0hJQ?t(B
STRINGS { s t ss tt sss }
STRINGS { year.num }
STRINGS { num.kanji }
STRINGS { preone preten }
STRINGS { last.sort.label next.extra prev.author this.author }
STRINGS { hang }
STRINGS { item.type }

%% $B@0?t7?Bg0hJQ?t(B
INTEGERS { nameptr namesleft numnames  alphabet.in.author name.num }
INTEGERS { bysame.check }
INTEGERS { multiresult }
INTEGERS { index }
INTEGERS { len }
INTEGERS { last.extra.num }
INTEGERS { output.state before.all mid.sentence after.sentence after.block int }
INTEGERS { last.period.comma }
%YD $BK.Lu=q$N8e$N6gE@$N=hM}$N$?$a(B
INTEGERS { has.hoyakusho }

%%% $BJQ?t$N@bL@(B

% alabel: $B0zMQItJ,$GMxMQ$5$l$k(B author (editor) $BL>(B ($B>JN,7A(B)$B$rJ];}$9$kJQ?t!%(B 
% reference $BItJ,$NI=<($K$OL54X78!%(B

% flabel: $B0zMQItJ,$GMxMQ$5$l$k(B author (editor) $BL>$rJ];}$9$kJQ?t!%(B reference $BIt(B
% $BJ,$NI=<($K$OL54X78!%(B

% sort.label: $BJ88%$N%=!<%H$N$?$a$N(B author (editor) $BL>$rJ];}$9$kJQ?t!%(B

% sort.label.abb: $BJ88%$N%=!<%H$N$?$a$N(B author (editor) $BL>$rJ];}$9$kJQ?t!%$3$A$i(B
% $B$O(B abbreviated name $B$G$NI=8=!%(B

% sort.key$: $BJ88%$N%=!<%H(B ($BJB$YBX$((B) $B$N$?$a$KMxMQ$5$l$kJ8;zNs$rJ];}$9$k!%(B
% jecon.debug $B$rHs%<%m$K$9$l$P$I$N$h$&$JCM$,F~$C$F$$$k$+I=<($G$-$k(B ($BDL>o$O(B 
% author - year - title - month $BEy$,7R$C$?J8;zNs$,;XDj$5$l$k(B)$B!%(B

%%% $BHFMQ$N4X?t$NDj5A(B

FUNCTION {not}
{   { #0 }
    { #1 }
  if$
}

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

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

%%% $BJQ?t$NCM$r=i4|2=$9$k4X?t(B
FUNCTION {init.state.consts}
{ #0 'before.all :=
  #1 'mid.sentence :=
  #2 'after.sentence :=
  #3 'after.block :=
}

%%% comma $B$r=|5n$7!"(Bperiod $B$rIU$1$k(B($B$KJQ$($k(B)$B4X?t(B ($B1Q8lJ88%MQ(B)
%
% #-1 #1 substring$ $B$O8e$m$+$i0lJ8;zL\$rH4$-=P$9=hM}$r$9$k!#(B
%%%
FUNCTION {add.period.x}
{ duplicate$
  % $B8e$m$+$i(B1$BJ8;z$H$C$FHf3S(B
  #-1 #1 substring$ "," =
    { #-2 global.max$ substring$ "." * }
    { duplicate$
      % $B8e$m$+$i(B2$BJ8;z$H$C$FHf3S(B
      #-1 #2 substring$ ". " =
        { #-3 global.max$ substring$ "." * }
        { duplicate$
          #-1 #2 substring$ ". " =
            { #-3 global.max$ substring$ "." * }
            { duplicate$
              #-1 #2 substring$ ",'" =
                { #-3 global.max$ substring$ ".'" * }
                { duplicate$
                  #-1 #2 substring$ ".'" =
                    { #-3 global.max$ substring$ ".'" * }
                    { duplicate$
                      #-1 #2 substring$ ".~" =
                        { #-3 global.max$ substring$ ".~" * }
                        { duplicate$
                          #-1 #2 substring$ ",~" =
                          { #-3 global.max$ substring$ ".~" * }
                          { duplicate$
                            % $B8e$m$+$i(B3$BJ8;z$H$C$FHf3S(B
                            #-1 #3 substring$ ",''" =
                              { #-4 global.max$ substring$ ".''" * }
                              { duplicate$
                                #-1 #3 substring$ ".''" =
                                  { #-4 global.max$ substring$ ".''" * }
                                  { add.period$ }
                                if$
                              }
                            if$
                          }
                        if$
                      }
                    if$
                  }
                if$
              }
            if$
          }
        if$
      }
     if$
   }
  if$
}

%%% "$B!"(B" $B$d(B "$B!$(B" $B$r=|5n$7!"(B"$B!%(B" $B$rIU$1$k(B($B$KJQ$($k(B)$B4X?t(B ($BF|K\8lJ88%MQ(B)
FUNCTION {add.kanji.period.x}
{
  duplicate$
  % $B8e$m$+$i(B1$BJ8;z$H$C$FHf3S(B
  #-1 #1 substring$ "$B!$(B" =
    { #-2 global.max$ substring$ bst.kuten.jp * }
    { duplicate$
      % $B8e$m$+$i(B1$BJ8;z$H$C$FHf3S(B
      #-1 #1 substring$ "$B!"(B" =
        { #-2 global.max$ substring$ bst.kuten.jp * }
        { duplicate$
          % $B8e$m$+$i(B1$BJ8;z$H$C$FHf3S(B
          #-1 #1 substring$ "." =
            {#-2 global.max$ substring$ bst.kuten.jp * }
	    {#-1 global.max$ substring$ bst.kuten.jp * }
          if$
        }
     if$
   }
  if$
}

%%% $B:G8e$NJ8;z$,(B period or comma $B$+$I$&$+$rH=Dj!#(B period or comma $B$N>l9g$K$O(B
%%% last.period.comma $B$KHs%<%m$rBeF~$9$k!#(B 
INTEGERS { comma.period.a.p comma.period.b.p }
STRINGS { pc }
FUNCTION {period.comma.a.p}
{ 'pc :=
  pc #-1 #1 substring$ "." = 
  pc #-1 #1 substring$ "," = or
  pc #-1 #2 substring$ ". " = or
  pc #-1 #2 substring$ ", " = or
  pc #-1 #2 substring$ ".'" = or
  pc #-1 #2 substring$ ",'" = or
  pc #-1 #3 substring$ ".''" = or
  pc #-1 #3 substring$ ",''" = or
    { #1 'comma.period.a.p := }
    { #0 'comma.period.a.p := }
  if$
}

FUNCTION {period.comma.b.p}
{ 'pc :=
  pc #-1 #3 substring$ ".' " =
  pc #-1 #3 substring$ ",' " = or
  pc #-1 #4 substring$ ".'' " = or
  pc #-1 #4 substring$ ",'' " = or
  pc #-1 #2 substring$ ".~" = or
  pc #-1 #2 substring$ ",~" = or
  pc #-1 #1 substring$ "$B!#(B" = or
  pc #-1 #1 substring$ "$B!%(B" = or
    { #1 'comma.period.b.p := }
    { #0 'comma.period.b.p := }
  if$
}

FUNCTION {period.comma.p}
{ duplicate$ 't :=
  t period.comma.a.p
  t period.comma.b.p
  comma.period.a.p #1 =
  comma.period.b.p #1 = or
    { #1 'last.period.comma := }
    { #0 'last.period.comma := }
  if$
}

%%% $BJ8;zNs$N:G=i$K$D$$$F$$$k(B comma or period $B$r=|5n$7$?J8;zNs$rJV$9!#(B
FUNCTION {remove.pre.comma.period}
{ 's :=
  s empty$
    { "" }
    %% ascii character
    { s #1 #1 substring$ "," =
      s #1 #1 substring$ "." = or
       { s #2 global.max$ substring$ }
       %% multi-byte character
       { s #1 #2 substring$ "$B!$(B" =
         s #1 #2 substring$ "$B!"(B" = or
         s #1 #2 substring$ "$B!#(B" = or
         s #1 #2 substring$ "$B!%(B" = or
          { s #3 global.max$ substring$ }
          's
         if$
       }
      if$
    }
  if$
}

%%%
%
% 
%
FUNCTION {output.nonnull.nocomma}
{ 's :=
  output.state mid.sentence =
    % mid.sentence $B$N$H$-!#(B 
    { % $B$D$$$G$KD>6a$N(B field $B$,(B period or comma $B$G=*$C$F$$$k$+H=CG!#(B
      period.comma.p
      % pop $B$7$F=q$-9~$_!#(B
      write$ }
 
    % mid.sentence $B$G$O$J$$$H$-(B
    { output.state after.block =

        % after.block $B$N$H$-!#(B period $B$rIU2C$7$F(B write$B!#(B
	{ is.kanji.entry
            { add.kanji.period.x write$}
	    { add.period.x " " * write$ }
	  if$
	}
	% after.block $B$8$c$J$$$H$-!#(B
	{ output.state before.all =
            % before.all $B$N$H$-!#$=$N$^$^(B write$B!#(B
  	    'write$
            % before.all $B$8$c$J$$$H$-!#(B period $B$rIU2C$7$F(B write$B!#(B
	    { is.kanji.entry
 		{ add.kanji.period.x write$ }
		{ add.period$ " " * write$ }
	      if$
	    }
	  if$
	}
      if$
      
      % mid.sentence $B0J30$N$H$-$O(B mid.sentence $B$K>uBV$rJQ99!#(B
      mid.sentence 'output.state :=
    }
  if$
  % $BD>6a$N(B filed $B$,(B period or comma $B$G=*$o$C$F$$$k$J$i!"$=$N8e$N(B comma $B$O=|5n$9$k!#(B
  last.period.comma #0 =
    { s }
    { s remove.pre.comma.period }
  if$
}

FUNCTION {output.nocomma}
{ duplicate$ empty$
    'pop$
    'output.nonnull.nocomma
  if$
}
%%% output.nonnull.nocomma $B$K%A%'%C%/5!G=$rIU2C$7$?$b$N!#%(%s%H%j!<$,6u$J$i(B 
%%% warning $B$,=PNO$5$l$k!#(B
FUNCTION {output.check.nocomma}
{ 't :=
  duplicate$ empty$
    { pop$ "empty " t * " in " * cite$ * warning$ }
    'output.nonnull.nocomma
  if$
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% bbl $B%U%!%$%k$X$N=PNO$N7A<0(B

% \harvarditem[Brezis et~al.]{Brezis, Krugman and
%   Tsiddon}{1993}{brezis93:_leapf_inter_compet}
% Brezis, Elise~S., Paul~R. Krugman, and Daniel Tsiddon  (1993) ``Leapfrogging in
%   International Competition: A Theory of Cycles in National Technological
%   Leadership.'', {\em American Economic Review.}, Vol.~83. No.~5. pp.
%   1211--1219.

% \harvarditem[abbreviated citation]{full citation}{year}{keyword} ...
%
% $B$H$$$&7A<0$G=PNO$9$k!#(B

%%% period $B$rIU$1$F!"2~9T$9$k!#(B
FUNCTION {fin.entry}
{ is.kanji.entry
  %YD $BK.Lu=q$,$"$k>l9g$bF|K\8lJ88%$HF1$807$$(B
  has.hoyakusho or  
    { add.kanji.period.x }
    { add.period.x }
  if$
  write$
  newline$
}

%YD article/inproceedings $BMQ(B
%YD $BF|K\8lJ88%$G$b1Q8lJ88%$HF1$807$$(B
FUNCTION {fin.entry.periodical}
{ add.period.x
  write$
  newline$
}

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

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

FUNCTION {new.block.check}
{ empty$
    'skip$
    'new.block
  if$
}

FUNCTION {field.or.null}
{ duplicate$ empty$
    { pop$ "" }
    'skip$
  if$
}

%%% booktitle $B$N@07A!#(B
FUNCTION {format.btitle}
{ booktitle empty$
    { "" }
    { booktitle is.kanji.str$
	{ bst.btitle.pre.jp booktitle * bst.btitle.post.jp * }
	{ bst.btitle.pre booktitle * bst.btitle.post * }
      if$
    }
  if$
}

%%% journal $B$N@07A!#(B
FUNCTION {format.journal}
{ journal empty$
    { "" }
    { journal is.kanji.str$
	{ bst.journal.pre.jp journal * bst.journal.post.jp * }
 	{ bst.journal.pre journal * bst.journal.post * }
      if$
    }
  if$
}

%%% book $B$N(B title $B$N@07A!#(B
FUNCTION {format.book}
{ title empty$
    { "" }
    { title is.kanji.str$
	{ bst.book.pre.jp title * bst.book.post.jp * }
 	{ bst.book.pre title * bst.book.post * }
      if$
    }
  if$
}

%YD inproceedings $B$N(B booktitle $B$N@07A!#(B
FUNCTION {format.proceedings}
{ booktitle empty$
    { "" }
    { booktitle is.kanji.str$
	{ bst.journal.pre.jp booktitle * bst.journal.post.jp * }
 	{ bst.journal.pre booktitle * bst.journal.post * }
      if$
    }
  if$
}

%%% $B0J2<!"(Bauthor, editor $B$N=hM}(B

% $BF|K\8l(B author $BL>$N$H$-$K(B alphabet $B$,4^$^$l$F$$$k$+$I$&$+H=CG$9$k4X?t!#4^$^$l(B
% $B$F$$$k$J$i(B alphabet.in.author $B$K(B 1 $B$rBeF~!"4^$^$l$F$$$J$$$J$i(B 0 $B$rBeF~!#$3$l(B
% $B$O(B Alphabet + $BJR2>L>$N309q?ML>$r=hM}$9$k$?$a$N$b$N!#(B
FUNCTION {set.alphabet.in.author}
{ name.num "{ff}" format.name$ 't :=
  #0 'alphabet.in.author :=
  "" t =
    % first name $B$,$J$$$H$-$O(B 0$B!#(B
    { #0 'alphabet.in.author := }
    { 
      % $B5-9f=|5n(B
      t purify$ 't :=
      % $B0lJ8;zL\$@$1<h$j=P$9!#(B
      t #1 text.prefix$ 't :=
      % $BF|K\8l$+(B alphabet $B$+!)(B
      t is.kanji.str$
        { #0 'alphabet.in.author :=
        }
        { #1 'alphabet.in.author :=
        }
      if$
    }
  if$
}

%%% $BJ8;z$N?t$rH=CG$9$k4X?t(B ($BF|K\8lMQ(B)$B!#(B
% $BF|K\8l$N>l9g(B 1 $BJ8;z$,(B 2 $BJ8;z$HH=CG$5$l$k$3$H$KCm0U!#(B
FUNCTION {count.number.of.letters}
{ 'sss :=
   sss text.length$ #2 =
      % $B0lJ8;z$N%1!<%9$G$O(B "1" $B$rJV$9!#(B
      { "1" }
      % $B0lJ8;z0J30$N%1!<%9$G$O(B "0" $B$rJV$9!#(B
      { "0" }
   if$
}

%%% name $B$r=hM}$9$k4X?t(B
FUNCTION {format.names}
{ 's :=
  % nameptr $B$K(B 1 $B$rBeF~(B
  #1 'nameptr :=
  % numnames $B$K(B author (editor) $B$N?t$rBeF~(B
  s num.names$ 'numnames :=
  numnames 'namesleft :=
  % namesleft $B$,(B 0 $B$h$jBg$J$i7+$jJV$7(B (while)
  { namesleft #0 > }
    % s $B$KF|K\8l4^$`$+!)(B
    { s is.kanji.str$
        % $BF|K\8l4^$`%1!<%9$N=hM}(B
        { nameptr 'name.num :=
          s set.alphabet.in.author
          alphabet.in.author #0 =
            % first name$B$,F|K\8l$N%1!<%9!JF|K\?ML>$H$$$&$3$H!K(B

            % $BCm!'F|K\8l$N(B author $B$O(B "$B@+(B $BL>(B" $B$N=g$G;XDj$5$l$k$,!"(Bbst $B$G$O(B
            % $B=gHVDL$j$K@+!a(Bfirst name$B!"L>!a(Blast name $B$H$7$F07$o$l$k!#(B
            { bst.sei.mei.order #0 =
                { s nameptr "{ff}" format.name$ 'ss :=
                  s nameptr "{ll}" format.name$ 'tt := }
                % $BIaDL$H5U=g$N%1!<%9(B
                { s nameptr "{ll}" format.name$ 'ss :=
                  s nameptr "{ff}" format.name$ 'tt := }
              if$
              ss "" =
                %% $B@+$N$_$N%1!<%9$O$=$N$^$^(B
                { tt 't := }
                %% $B@+!&L>$H$b$K$"$k%1!<%9(B
                { ss count.number.of.letters "1" =
                  tt count.number.of.letters "1" = or
                    { ss bst.sei.mei.one.jp * tt * 't := }
                    { ss bst.sei.mei.two.jp * tt * 't := }
                  if$
                }
              if$
            }
            % first name $B$,(B alphabet $B$N%1!<%9(B ($B$D$^$j!"%+%?%+%J$N309q?ML>(B)
            { nameptr #1 =
               % first author $B$N%1!<%9(B (last name - first name $B$N(B order)
               { bst.author.name #0 =
                 bst.author.name #1 = or
                   % Last name - first name
                   { s nameptr "{ll}" format.name$ 'ss :=
                     s nameptr "{ff}" format.name$ 'tt :=
                     ss bst.touten.jp * tt * 't := }
                   % First name - Last name
                   { s nameptr "{ff~}{ll}" format.name$ 't := }
                 if$
               }
               % first author $B0J30$N%1!<%9(B (first name - last name $B$N(B order)
               { bst.author.name #0 =
                 bst.author.name #2 = or
                   % First name - Last name
                   { s nameptr "{ff~}{ll}" format.name$ 't := }
                   % Last name - First name
                   { s nameptr "{ll}" format.name$ 'ss :=
                     s nameptr "{ff}" format.name$ 'tt :=
                     ss bst.touten.jp * tt * 't := }
                 if$
               }
              if$
            }
          if$
        }
        % author $B$KF|K\8l4^$^$J$$%1!<%9$N=hM}(B
        { nameptr #1 =
           % $B0lHVL\$N(B author
	   { bst.author.name #0 =
	     bst.author.name #1 =
	     or
	        { bst.first.name.initial #0 = 
		   { s nameptr "{vv~}{ll}{, ff}{, jj}" format.name$ 't := }
		   { s nameptr "{vv~}{ll}{, f.}{, jj}" format.name$ 't := }
		  if$
		}
	        { bst.first.name.initial #0 = 
	           { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := }
	           { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := }
		  if$
		}
	     if$
	   }
           % $BFsHVL\0J9_$N(B author
	   { bst.author.name #0 =
	     bst.author.name #2 =
	     or
	        { bst.first.name.initial #0 = 
                   { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := }
                   { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := }
		 if$
	        }
	        { bst.first.name.initial #0 = 
   	           { s nameptr "{vv~}{ll}{, ff}{, jj}" format.name$ 't := }
   	           { s nameptr "{vv~}{ll}{, f.}{, jj}" format.name$ 't := }
		 if$
	        }
	     if$
	   }
          if$
        }
      if$
      nameptr #1 >
        % $BFsHVL\0J9_$N(B author $B$N%1!<%9$G$N=hM}(B
	{ namesleft #1 >
 	    { s is.kanji.str$
 		{ bst.and.jp  * t * }
 		{ ", " * t * }
	      if$
	    }
	    { t "others" =
  		{ s is.kanji.str$
  		    { bst.and.others.jp * }
                    { bst.and.others * }
 		  if$
 		}
  		{ s is.kanji.str$
 		    { bst.and.jp * t * }
		    { numnames #2 =
  			{ bst.and * t * }
  			{ bst.ands * t * }
		      if$
		    }
 		   if$
 		}
	      if$
	    }
	  if$
	}
	't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

%%% author $B$N@07A(B
FUNCTION {format.authors}
{ author empty$
    { "" }
    { extra.label.bysame "bysame" =
	{"\bysame "}
 	{ author is.kanji.str$
 	    { bst.author.pre.jp author format.names * bst.author.post.jp * }
   	    { bst.author.pre author format.names * bst.author.post * }
	  if$
	}
      if$
    }
  if$
}

%%% editor $B$N@07A(B
FUNCTION {format.editors}
{ editor empty$
    { "" }
    { extra.label.bysame "bysame" =
	{ #1 'bysame.check :=
	   "\bysame " }
	{ editor is.kanji.str$
	    { bst.author.pre.jp editor format.names * }
 	    { bst.author.pre editor format.names * bst.author.post * }
	  if$
	}
      if$
      #1 bysame.check =
        { "" * }
        { editor num.names$ #1 >
 	  { editor is.kanji.str$
              { bst.editor.jp * }
	      { bst.editors * }
	    if$
 	  }
  	  { editor is.kanji.str$
 	      { bst.editor.jp * }
	      { bst.editor * }
	    if$
 	  }
        if$
        }
      if$
    }
  if$
}

%%% format.in.ed.booktitle $BMQ(B
FUNCTION {format.editors.x}
{ editor empty$
    { "" }
    { editor format.names 
      editor num.names$ #1 >
 	{ editor is.kanji.str$
 	    { bst.editor.jp * }
	    { bst.editors * }
	  if$
 	}
  	{ editor is.kanji.str$
 	    { bst.editor.jp * }
	    { bst.editor * }
	  if$
 	}
      if$
    }
  if$
}

%%% $B!V(B?.$B!W!"!V(B?,$B!W$N$h$&$J%1!<%9$G!"(Bperiod$B!"(Bcomma $B$r=|5n$9$k4X?t(B
FUNCTION {remove.irrelevant.period.comma}
{ 's :=
  s empty$
    { "" }
    % $B8e$m$+$i(B3$BJ8;z$H$C$FHf3S(B
    { s #-1 #3 substring$ "?,'" =
      s #-1 #3 substring$ "?.'" = or
        % $B8e$m$+$i(B3$BJ8;z$r=|$$$?$b$N$K(B "'" $B$rIU$1$k!%(B
        { s #-3 global.max$ substring$ "'" * }
	{ s #-1 #4 substring$ "?,''" =
          s #-1 #4 substring$ "?.''" = or
            { s #-4 global.max$ substring$ "''" * }
	    { s #-1 #2 substring$ "?," =
              s #-1 #2 substring$ "?." = or
                { s #-2 global.max$ substring$ "" * }
                { s #-1 #3 substring$ "?,~" =
                  s #-1 #3 substring$ "?.~" = or
                    { s #-4 global.max$ substring$ "?~" * }
                    { s #-1 #3 substring$ "?, " =
                      s #-1 #3 substring$ "?. " = or
                        { s #-4 global.max$ substring$ "? " * }
                        's
                      if$
                    }
                  if$
                }
	      if$
            }
          if$
        }
      if$
    }
  if$
}

%%% $B:G8e$K$D$$$F$$$k$N!V!$!W!"!V!"!W!"!V!%!W!"!V!%!W$r=|5n$9$k4X?t(B ($BK.Lu=qMQ(B)
FUNCTION {remove.irrelevant.kutoten}
{ 's :=
  s empty$
    { "" * }
    { s #-1 #1 substring$ "$B!"(B" =
      s #-1 #1 substring$ "$B!$(B" = or
      s #-1 #1 substring$ "$B!#(B" = or
      s #-1 #1 substring$ "$B!%(B" = or
        { s #-2 global.max$ substring$ "" * }
        { s }
      if$
    }
  if$
}

%%% title $B$N@07A(B
FUNCTION {format.title.sub}
{ bst.title.lower.case #0 =
     { bst.title.pre title * bst.title.post * }
     { bst.title.pre title "t" change.case$ * bst.title.post * }
  if$
}

FUNCTION {format.title}
{ title empty$
  bst.hide.title #0 = not or
    { "" }
    { title is.kanji.str$
      { bst.title.pre.jp title * bst.title.post.jp * }
      { format.title.sub remove.irrelevant.period.comma }
     if$
    }
  if$
}

%%% jtitle $B$N@07A(B
FUNCTION {format.jtitle}
{ jtitle empty$
    { "" }
    { bst.book.pre.jp jtitle * bst.book.post.jp * }
  if$
}

%YD phdthesis/mastersthesis $B$N(B title $B$N@07A(B
FUNCTION {format.thesis}
{ format.book }

%%% misc $B$N(B title $B$N=hM}(B
FUNCTION {format.misc.title}
{ title empty$
    { "" }
    { title is.kanji.str$
      { bst.title.pre.jp title * bst.title.post.jp * }
      { bst.title.pre title * bst.title.post * }
     if$
    }
  if$
}

% - $B$r(B -- $B$K$9$k4X?t(B (pages $BMQ(B)
FUNCTION {n.dashify}
{ 't :=
  ""
  %% while$ $B$N>r7o(B (t $B$,(B empty $B$G$J$$$J$i<B9T(B)
  { t empty$ not }
  %% $B=hM}(B
  { t #1 #1 substring$ "-" =
      { t #1 #2 substring$ "--" = not
          { bst.dashify.off
              { "-" * }
              { "--" * }
            if$
            t #2 global.max$ substring$ 't :=
          }
          { { t #1 #1 substring$ "-" = }
            { "-" *
              t #2 global.max$ substring$ 't :=
            }
            while$
          }
        if$
      }
      { t #1 #1 substring$ is.kanji.str$
        { t #1 #2 substring$ *
          t #3 global.max$ substring$ 't :=
        }
         { t #1 #1 substring$ *
          t #2 global.max$ substring$ 't :=
        }
        if$
      }
    if$
  }
  while$
}

%%% $BM?$($i$l$??t$r4A?t;z$KJQ49(B: 0->$B!;(B, 1->$B0l(B, 2->$BFs(B,..., 9->$B6e(B $B$H$$$&BP1~4X78!#(B
%%% $B$5$i$K!"(B"-" $B$O=DK@$KJQ49$9$k!#(B
FUNCTION {convert.num.kanji}
{ 's :=
  s "1" =
    { "$B0l(B" }
    { s "2" =
        { "$BFs(B" }
        { s "3" =
            { "$B;0(B" }
            { s "4" =
                { "$B;M(B" }
                { s "5" =
                    { "$B8^(B" }
                    { s "6" =
                        { "$BO;(B" }
                        { s "7" =
                            { "$B<7(B" }
                            { s "8" =
                                { "$BH,(B" }
                                { s "9" =
                                    { "$B6e(B" }
                                    { s "0" =
                                        { "$B!;(B" }
                                        { s "-" =
                                           { "\tatebo{}" }
                                           { s }
                                          if$
                                        }
                                      if$
                                    }
                                if$
                                }
                            if$
                            }
                        if$
                        }
                    if$
                    }
                if$
                }
            if$
            }
        if$
        }
    if$
    }
  if$
}

%%% $BH>3Q$N(B alphabet $B$rA43Q$N(B alphabet $B$KJQ99$9$k4X?t(B (a-j $B$^$G$N$_(B)$B!#(B
FUNCTION {convert.alphabet.zenkaku}
{ 's :=
  s "a" =
    { "$B#a(B" }
    { s "b" =
        { "$B#b(B" }
        { s "c" =
            { "$B#c(B" }
            { s "d" =
                { "$B#d(B" }
                { s "e" =
                    { "$B#e(B" }
                    { s "f" =
                        { "$B#f(B" }
                        { s "g" =
                            { "$B#g(B" }
                            { s "h" =
                                { "$B#h(B" }
                                { s "i" =
                                    { "$B#i(B" }
                                    { s "j" =
                                        { "$B#j(B" }
                                        { s }
                                    if$
                                    }
                                if$
                                }
                            if$
                            }
                        if$
                        }
                    if$
                    }
                if$
                }
            if$
            }
        if$
        }
    if$
    }
  if$
}

%%% year $B$r4A?t;z$KJQ49(B
FUNCTION{convert.year.kanji}
{ 't :=
  %% bst.kansuji.jp $B$,Hs%<%m$G$+$D!$(Bt $B$,4A;z$8$c$J$$$N$J$i!$4A;z$KJQ49(B
  bst.kansuji.jp #0 = not t is.kanji.str$ not and 
     { "" 'tt :=
       { t empty$ not }
       { tt t #1 #1 substring$ convert.num.kanji convert.alphabet.zenkaku * 'tt :=
         t #2 global.max$ substring$ 't := }
       while$
     }
     { t 'tt := }
  if$
 tt
}

%%% bst.kansuji.jp $B$,Hs%<%m$N$H$-!"?t;z$r4A?t;z$KJQ49$9$k4X?t!#(B
FUNCTION{convert.num}
{ 't :=
  bst.kansuji.jp #0 = t is.kanji.str$ or
     { t 'tt := }
     { "" 'tt :=
       { t empty$ not }
       { t #1 #1 substring$ convert.num.kanji 'ss :=
         tt ss * 'tt :=
         t #2 global.max$ substring$ 't :=
         }
       while$
     }
  if$
 tt
}

%% $BJQ?tDj5A(B
STRINGS { da db dc dd }
%% pages $B$N(B "--" $B$r(B "-" $B$KJQ49$9$k!%(B
FUNCTION {remove.duplicate.dash}
{ 'da :=
  "" 'db :=
  "" 'dc :=
  "" 'dd :=
  { da empty$ not }
  { da #1 #1 substring$ 'db :=
    db "-" = dc "-" = and
       'skip$
       { dd db * 'dd := }
    if$
    db 'dc :=
    da #2 global.max$ substring$ 'da :=
  }
  while$
  dd
}

%%% bst.kansuji.jp $B$,Hs%<%m$N$H$-!"(Bpages $B$r4A?t;z$KJQ49$9$k4X?t!#(B
FUNCTION{convert.num.pages}
{ 't :=
  bst.kansuji.jp #0 = t is.kanji.str$ or
     { t 'tt := }
     { "" 'tt :=
       t remove.duplicate.dash 't :=
       { t empty$ not }
       { t #1 #1 substring$ convert.num.kanji 'ss :=
         tt ss * 'tt :=
         t #2 global.max$ substring$ 't :=
         }
       while$
     }
  if$
 tt
}

%%% year $B$N=hM}(B
FUNCTION {format.year}
{ year empty$
    { "there's no year in " cite$ * warning$
      "" }
    { is.kanji.entry
        { bst.kansuji.jp #0 =
           { bst.year.pre.jp year * extra.label * bst.year.post.jp * }
           { bst.year.pre.jp year convert.year.kanji *
             extra.label convert.alphabet.zenkaku * bst.year.post.jp * }
          if$
        }
        { bst.year.pre year * extra.label * bst.year.post * }
      if$
    }
  if$
}

%%% book $B$N(B page $B$N=hM}(B
FUNCTION {format.book.pages}
{ pages empty$
    { "" }
    { is.kanji.entry
        %YD { bst.page.pre.jp pages convert.num.pages * bst.page.post.jp * }
        { bst.pages.pre.jp pages convert.num.pages * bst.page.post.jp * }
        { bst.pages.pre pages * bst.pages.post * }
      if$
    }
  if$
}

%%% 2$BJ8;z0J2<$J$iA0$K(B tie $B$rIU$1$k!%(B
FUNCTION {tie.or.space.connect}
{ duplicate$ text.length$ #3 <
    { "~" }
    { " " }
  if$
  swap$ * *
}

FUNCTION {either.or.check}
{ empty$
    'pop$
    { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  if$
}

%%% book $B$N(B volume $B$N@07A(B
FUNCTION {format.bvolume}
{ volume empty$
    { "" }
    { %YD series $B$,$"$k$H$-$NI=<(=g$rF|K\8l$H1Q8l$G5U$K$9$k!#(B
      %YD is.kanji.entry
      %YD   { bst.volume.pre.jp volume convert.num * bst.volume.post.jp * }
      %YD   { bst.volume.pre volume * bst.volume.post * }
      %YD if$
      %YD series empty$
      %YD   'skip$
      %YD   %% series $B$b$"$k$H$-(B
      %YD   { is.kanji.entry
      %YD       { bst.series.pre.jp * series convert.num * bst.series.post.jp * }
      %YD       { " of " * series * bst.series.post * }
      %YD     if$
      %YD   }
      %YD if$
      series empty$
        { is.kanji.entry
	    { bst.volume.pre.jp volume convert.num * bst.volume.post.jp * }
	    { bst.volume.pre volume * bst.volume.post * }
	  if$
	}
	{ is.kanji.entry
	    { bst.series.pre.jp series *
	      bst.volume.pre.jp.inseries * volume convert.num * bst.volume.post.jp.inseries *
	      bst.series.post.jp * }
	    { bst.series.pre
	      bst.volume.pre.inseries * volume * bst.volume.post.inseries *
	      " of " * series * bst.series.post * }
	  if$
	}
      if$
%       "volume and number" number either.or.check
    }
  if$
}

%%% series $B$N=PNO(B
FUNCTION {output.series}
{ series empty$
    { "" }
    { is.kanji.entry
        { bst.series.pre.jp series convert.num * bst.series.post.jp * }
        { bst.series.pre series * bst.series.post * }
      if$
    }
 if$
}

%%% number $B$H(B series $B$r=PNO(B
FUNCTION {format.number.series}
{ volume empty$
    { number empty$
      bst.hide.number #0 = not or
        % number is empty
   	{ series empty$
	    { "" }
	    % series is not empty.
	    { output.series }
	  if$
	}
        % number is not empty$
	{ series empty$
	    { is.kanji.entry
	        { bst.number.pre.jp number convert.num * bst.number.post.jp * }
		{ bst.number.pre number * bst.number.post * }
	      if$
	    }
	    % series is not empty.  $BF|K\8l$H1Q8l$G=g=x5U$K$9$k!#(B
	    { is.kanji.entry
 	        { bst.series.pre.jp series convert.num * bst.series.post.jp *
		  bst.number.pre.jp * number convert.num * bst.number.post.jp * }
		{ bst.in bst.series.pre * series * bst.series.post *
		  bst.number.pre * number * bst.number.post * }
	      if$
	    }
	  if$
	}
      if$
    }
    { "" }
  if$
}

%%% $B?t;z$+$I$&$+H=CG$9$k(B
FUNCTION {is.num}
{ chr.to.int$
  duplicate$ "0" chr.to.int$ < not
  swap$ "9" chr.to.int$ > not and
}

FUNCTION {extract.num}
{ duplicate$ 't :=
  "" 's :=
  { t empty$ not }
  { t #1 #1 substring$
    t #2 global.max$ substring$ 't :=
    duplicate$ is.num
      { s swap$ * 's := }
      { pop$ "" 't := }
    if$
  }
  while$
  s empty$
    'skip$
    { pop$ s }
  if$
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%	edition $B=hM}MQ$N%W%m%0%i%`(B

% $B1Q8l$N(B edition $B$OA4$F(B 1st, 2nd, 3rd, 4th etc. $B$KJQ49$9$k!#(B
FUNCTION {eng.ord}
{ duplicate$ "1" swap$ *
  #-2 #1 substring$ "1" =
     { bst.th * }
     { duplicate$ #-1 #1 substring$
       duplicate$ "1" =
         { pop$ bst.st * }
         { duplicate$ "2" =
             { pop$ bst.nd * }
             { "3" =
                 { bst.rd * }
                 { bst.th * }
               if$
             }
           if$
          }
       if$
     }
   if$
}

% edition entry $B$N(B first, second $BEy$r(B 1st, 2nd $B$KJQ49$9$k(B (from jfm.bst)$B!#(B
FUNCTION {convert.edition}
{ edition extract.num "l" change.case$ 's :=
  s "first" = s "1" = or
    { bst.first }
    { s "second" = s "2" = or
        { bst.second }
        { s "third" = s "3" = or
            { bst.third }
            { s "fourth" = s "4" = or
                { bst.fourth }
                { s "fifth" = s "5" = or
                    { bst.fifth }
                    { s #1 #1 substring$ is.num
                        { s eng.ord }
                        { edition }
                      if$
                    }
                  if$
                }
              if$
            }
          if$
        }
      if$
    }
  if$
}

% $BF|K\8lJ88%$N>l9g$K$O1Q8l$N7n$r?t;z$KJQ49$9$k!#(B
FUNCTION {convert.month}
{ 't := 
  t "January" =
    { "1" }
    { t "February" =
        { "2" }
        { t "March" =
            { "3" }
            { t "April" =
                { "4" }
                { t "May" =
                    { "5" }
                    { t "June" =
                        { "6" }
                        { t "July" =
                            { "7" }
                            { t "August" =
                                { "8" }
                                { t "September" =
                                    { "9" }
                                    { t "October" =
                                        { "10" }
                                        { t "November" =
                                            { "11" }
                                            { t "December" =
                                                { "12" }
                                                't
                                            if$
                                            }
                                        if$
                                        }
                                    if$
                                    }
                                if$
                                }
                            if$
                            }
                        if$
                        }
                    if$
                    }
                if$
                }
            if$
            }
        if$
        }
    if$
    }
  if$
}

%%% edition $B$N@07A(B
FUNCTION {format.edition}
{ edition empty$
    { "" }
    { is.kanji.entry
	{ bst.edition.pre.jp edition convert.num * bst.edition.post.jp * }
        { output.state mid.sentence =
            { bst.edition.pre convert.edition "l" change.case$ * bst.edition.post * }
            { bst.edition.pre convert.edition "t" change.case$ * bst.edition.post * }
          if$
        }
      if$
    }
  if$
}

%%% month $B$N@07A!#(B
FUNCTION {format.month}
{ month empty$
  % bst.hide.month $B$,Hs%<%m$J$i(B month $B$O=PNO$;$:(B
  bst.hide.month #0 = not or
    { "" }
    { is.kanji.entry
        { bst.month.pre.jp month convert.month convert.num * bst.month.post.jp * }
        { bst.month.pre month * bst.month.post * }
      if$
    }
  if$
}

%%% year $B$H(B month $B$r0l=o$K=hM}$9$k$?$a$N$b$N!#(B
FUNCTION {format.date}
{ is.kanji.entry
   %% $BF|K\8lJ88%(B -> $BG/(B - $B7n(B
   { format.year format.month * }
   %% $B1Q8l(B -> $B7n(B - $BG/(B
   { format.month format.year * }
  if$
}

%%% $BJ#?t$N%Z!<%8$,;XDj$5$l$F$$$k$+%A%'%C%/(B (1-100$BEy$N$h$&$K(B)$B!%(B
FUNCTION { multi.page.check }
{ 't :=
  #0 'multiresult :=
    { multiresult not
      t empty$ not
      and
    }
    { t #1 #1 substring$
      duplicate$ "-" =
      swap$ duplicate$ "," =
      swap$ "+" =
      or or
	{ #1 'multiresult := }
	{ t #2 global.max$ substring$ 't := }
      if$
    }
  while$
  multiresult
}

%%% pages $B$N@07A!#(B
FUNCTION {format.pages}
{ pages empty$
    { "" }
    { is.kanji.entry
        { pages multi.page.check
          %YD { bst.page.pre.jp pages n.dashify convert.num.pages * bst.page.post.jp * }
          { bst.pages.pre.jp pages n.dashify convert.num.pages * bst.page.post.jp * }
          { bst.page.pre.jp pages convert.num.pages * bst.page.post.jp * }
         if$
        }
        { pages multi.page.check
 	  { bst.pages.pre pages n.dashify tie.or.space.connect * bst.pages.post }
	  { bst.page.pre pages tie.or.space.connect * bst.page.post }
         if$
        }
       if$
   }
 if$
}

%YD $BDj4|4)9TJ*MQ(B
FUNCTION {format.pages.periodical}
{ pages empty$
    { "" }
    { is.kanji.entry
        { pages multi.page.check
          { bst.pages.pre.jp.periodical pages n.dashify convert.num.pages * bst.page.post.jp * }
          { bst.page.pre.jp.periodical pages convert.num.pages * bst.page.post.jp * }
         if$
        }
        { pages multi.page.check
 	  { bst.pages.pre.periodical pages n.dashify tie.or.space.connect * bst.pages.post }
	  { bst.page.pre.periodical pages tie.or.space.connect * bst.page.post }
         if$
        }
       if$
   }
 if$
}

%%% number $B$r@07A(B
FUNCTION {format.number}
{ number empty$
  % bst.hide.number $B$,Hs%<%m$J$i(B number $B$O=PNO$;$:(B
  bst.hide.number #0 = not or
    { "" }
    { is.kanji.entry
        { bst.number.pre.jp number convert.num * bst.number.post.jp * }
	{ bst.number.pre number * bst.number.post * }
      if$
    }
  if$
}

%%% volume $B$r@07A(B
FUNCTION {format.volume}
{ volume empty$
    'skip$
    { is.kanji.entry
        { bst.volume.pre.jp volume convert.num * bst.volume.post.jp * }
	{ bst.volume.pre volume * bst.volume.post * }
      if$
    }
  if$
}

%%% number$B!"(Bpage $B$r=PNO(B
FUNCTION {format.number.pages}
%YD { format.number format.pages * }
{ format.number format.pages.periodical * }

%%% volume$B!"(Bpage $B$r=PNO(B
FUNCTION {format.volume.pages}
%YD { format.volume format.pages * }
{ format.volume format.pages.periodical * }

%%% volume$B!"(Bnumber$B!"(Bpage $B$r=PNO(B
FUNCTION {format.volume.number.pages}
%YD { format.volume format.number * format.pages * }
{ format.volume format.number * format.pages.periodical * }

% volume, number, page $B$r0l=o$K=hM}$9$k4X?t!#(B
FUNCTION {format.vol.num.pages}
{ volume empty$
    %% volume is empty.
    { number empty$
        %% number is empty.
        { pages empty$
	    % $B$3$N>l9g$O(B warning $B$r=P$9!#(B
            { "there is no volume, number, and pages in " cite$ * warning$ "" }	
	    %YD { "" format.pages * }
	    { "" format.pages.periodical * }
         if$
        }
        %% number is not empty.
	% $B$3$N>l9g$O(B warning $B$r=P$9!#(B
	{ "there's a number but no volume in " cite$ * warning$
	  format.number.pages }
     if$
    }
    %% volume is not empty.
    { number empty$
        %% number is empty.
	{ format.volume.pages }
        %% number is not empty.
	{ format.volume.number.pages }
     if$
    }
  if$
}

%%% chapter $B$N@07A!#(B
FUNCTION {format.chapter}
{ chapter empty$
    { "" }
    { type empty$
        { is.kanji.entry
            { bst.chapter.pre.jp chapter convert.num * bst.chapter.post.jp * }
            { bst.chapter.pre chapter tie.or.space.connect * bst.chapter.post }
          if$
        }
        { is.kanji.entry
            { bst.touten.jp * type " " * chapter convert.num * }
            { ", " * type " " * chapter * }
          if$
        }
      if$
    }
  if$
}

%%% chapter, pages $B$r0l=o$K=hM}$9$k4X?t(B
FUNCTION {format.chapter.pages}
{ chapter empty$
    { pages empty$
        { "" }
	{ "" format.pages * }
      if$
    }
    { pages empty$
        { "" format.chapter * }
        { "" format.chapter * format.pages * }
      if$
    }
  if$
}

%%% editor and booktitle $B$N@07A!#(B
FUNCTION {format.in.ed.booktitle}
{ booktitle empty$
    { "" }
    { editor empty$
 	{ is.kanji.entry
    	    { format.btitle remove.pre.comma.period }
   	    { bst.in format.btitle * }
 	  if$
 	}
 	{ is.kanji.entry
  	    { format.editors.x "" * format.btitle * }
    	    %YD { bst.in format.editors.x * " " * format.btitle * }
    	    { bst.in format.editors.x * ", " * format.btitle * }
 	  if$
 	}
      if$
    }
  if$
}

%%% howpublished $B$N@07A!#(B
FUNCTION {format.howpublished}
{ howpublished empty$
    { "" }
    { is.kanji.entry
        { bst.howpublished.pre.jp howpublished * bst.howpublished.post.jp * }
        { bst.howpublished.pre howpublished * bst.howpublished.post * }
      if$
    }
  if$
}

%%% address $B$N@07A!#(B
FUNCTION {format.address}
{ address empty$
    { "" }
    { address is.kanji.str$
        { bst.address.pre.jp address * bst.address.post.jp * }
        { bst.address.pre address * bst.address.post * }
      if$
    }
  if$
}

%%% publisher $B$N@07A!#(B
FUNCTION {format.publisher}
{ publisher empty$
    { "" }
    { is.kanji.entry 
        { bst.publisher.pre.jp publisher * bst.publisher.post.jp * }
	{ bst.publisher.pre publisher * bst.publisher.post * }
      if$
    }
  if$
}

%%% organization $B$N@07A!#(B
FUNCTION {format.organization}
{ organization empty$
    { "" }
    { is.kanji.entry
        { bst.organization.pre.jp organization * bst.organization.post.jp * }
	{ bst.organization.pre organization * bst.organization.post * }
      if$
    }
  if$
}

%% publisher $B$H(B address $B$r=PNO$9$k4X?t(B
FUNCTION {output.publisher.address}
{ address empty$
    { format.publisher "publisher" output.check.nocomma }
    % $BF|K\8l!"1Q8l$G(B publisher $B$H(B address $B$N=g=x$,5U(B
    { is.kanji.entry
	{ format.publisher "publisher" output.check.nocomma
	  format.address output.nocomma }
	{ format.address output.nocomma
	  format.publisher "publisher" output.check.nocomma }
      if$
    }
  if$
}

%% address, organization, publisher $B$r=PNO$9$k4X?t(B
FUNCTION {output.address.organization.publisher}
{ address empty$
    %% address is empty
    { organization empty$
        %% organization is empty
        { publisher empty$
	    'skip$
	    { format.publisher "publisher" output.check.nocomma }
	  if$
        }
        %% organization is not empty
        { publisher empty$
	    { format.organization "organization" output.check.nocomma }
	    { format.organization "organization" output.check.nocomma
	      format.publisher "publisher" output.check.nocomma }
	  if$
        }
     if$
    }
    %% address is not empty
    { organization empty$
        %% organization is empty
        { publisher empty$
	    %% publisher is empty
	    { format.address output.nocomma }
	    %% publisher is not empty
	    { is.kanji.entry
	        { format.publisher "publisher" output.check.nocomma
		  format.address output.nocomma }
		{ format.address output.nocomma
		  format.publisher "publisher" output.check.nocomma }
	      if$
	    }
	 if$
        }
        %% organization is not empty
        { publisher empty$
	    %% publisher is empty
	    { format.organization "organization" output.check.nocomma
	      format.address output.nocomma }
	    %% publisher is not empty
	    { is.kanji.entry
	        { format.organization "organization" output.check.nocomma
		  format.publisher "publisher" output.check.nocomma
		  format.address output.nocomma }
		{ format.organization "organization" output.check.nocomma
		  format.address output.nocomma
		  format.publisher "publisher" output.check.nocomma }
	      if$
	    }
	 if$
        }
     if$
    }
  if$
}

%%% misc $BMQ(B
FUNCTION {empty.misc.check}
{ author empty$ title empty$ howpublished empty$
  month empty$ year empty$ note empty$
  and and and and and
  key empty$ not and
    { "all relevant fields are empty in " cite$ * warning$ }
    'skip$
  if$
}

FUNCTION {format.thesis.type}
{ type empty$
    'skip$
    { pop$ " " type * }
  if$
}

FUNCTION {format.tr.number}
{ type empty$
    { "Technical Report" }
    { " " type * }
  if$
  number empty$
    { "t" change.case$ }
    { number tie.or.space.connect }
  if$
}

%%% phdthesis $B$N@07A(B
FUNCTION {format.phd}
{ is.kanji.entry
    { bst.phdthesis.jp }
    { bst.phdthesis }
   if$
}

%%% mastersthesis $B$N@07A(B
FUNCTION {format.mthesis}
{ is.kanji.entry
    { bst.mthesis.jp }
    { bst.mthesis }
   if$
}

%%% school $B$N@07A(B
FUNCTION {format.school}
{ school empty$
    { "" }
    { is.kanji.entry
        { bst.school.pre.jp school * bst.school.post.jp * }
        { bst.school.pre school * bst.school.post * }
      if$
    }
  if$
}

%%% institution $B$N@07A(B
FUNCTION {format.institution}
{ institution empty$
    { "" }
    { is.kanji.entry
        { bst.institution.pre.jp institution * bst.institution.post.jp * }
	{ bst.institution.pre institution * bst.institution.post * }
      if$
    }
  if$
}  

%%% hoyakusho $B$N@07A(B
FUNCTION {format.hoyakusho}
{ jauthor empty$
  jkanyaku empty$
  jtitle empty$
  jpublisher empty$
  jyear empty$
  and and and and
    { "" }
    { %YD has.hoyakusho $B%U%i%0$r%;%C%H(B
      #1 'has.hoyakusho :=
      is.kanji.entry
        { bst.touten.jp *  }
        %YD { ", " *  }
        { ". " *  }
      if$
      jauthor empty$
        { jkanyaku empty$
            { "" }
            { jkanyaku format.names "$B4FLu(B" * }
          if$
        }
        { jauthor format.names "$BLu(B" *
          jkanyaku empty$
            { "" * }
            { bst.touten.jp * jkanyaku format.names * "$B4FLu(B" * }
          if$
        }
      if$
      %YD jyear $B$r(B jtitle $B$h$jA0$KI=<(!#=q<0$bJQ99(B
      jyear empty$
        { "" * }
        { "" * bst.year.pre * jyear * bst.year.post * }
      if$
      jtitle empty$
        { "" * }
        %YD { bst.touten.jp * format.jtitle * bst.touten.jp * }
        { format.jtitle * }
      if$
      jpublisher empty$
        { "" * }
        %YD { jpublisher * bst.touten.jp * }
        { bst.touten.jp * jpublisher * }
      if$
      %YD jyear empty$
      %YD   { "" * }
      %YD   { "" * jyear convert.year.kanji * "$BG/(B" * }
      %YD if$
      remove.irrelevant.kutoten
      bst.hoyakusho.pre.jp swap$ * bst.hoyakusho.post.jp *
    }
 if$
}

FUNCTION {format.url}
{ url empty$
    { "" }
    { type$ "online" = bst.show.url or
        { is.kanji.entry
            { bst.url.pre.jp url * bst.url.post.jp *
                access empty$
                    { "" * }
                    { bst.access.pre.jp * access * bst.access.post.jp * }
                if$
            }
            { bst.url.pre url * bst.url.post *
                access empty$
                    { "" * }
                    { bst.access.pre * access * bst.access.post * }
                if$
            }
          if$
        }
        { "" }
      if$
    }
  if$
}

FUNCTION {format.doi}
{ doi empty$ bst.show.doi not or
    { "" }
    { bst.doi.pre doi * bst.doi.post * }
  if$
}

FUNCTION {format.note}
{ note empty$
    { "" }
    { is.kanji.entry
        { bst.note.pre.jp note * bst.note.post.jp * }
        { bst.note.pre note * bst.note.post * }
      if$
    }
  if$
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	 \havarditem $B$N=PNO!%(B

FUNCTION {output.number.index}
{
  bst.use.number.index #0 =
     'skip$
     { index #1 + 'index :=
       "" 'preone :=
       "" 'preten :=
       bst.number.index.digit "1" =
         'skip$
         { bst.number.index.digit "2" =
           { "\hskip0.5em" 'preone := }
           { bst.number.index.digit "3" =
              { "\hskip1em" 'preone :=
                "\hskip0.5em" 'preten := }
              'skip$
             if$
           }
         if$
         }
       if$  
     }
  if$
  newline$
  ""
  % $B0J2<$b!"(Bnumber index $B$rIU$1$k>l9g$N=hM}(B
  bst.use.number.index #0 =
     'skip$
     { index #10 <
         % number index $B$N7e$K1~$8$FA0$K6uGr$rF~$l$k!#(B
         { preone }
	 { index #100 <
	     { preten }
             { "" }
	   if$
	 }
       if$
       bst.number.index.pre * index int.to.str$ * bst.number.index.post * write$
     }
 if$
}

FUNCTION {output.bibitem}
{ bst.harvarditem.off
    { before.all 'output.state :=
      "" }
    { newline$
      "\harvarditem[" write$
      alabel write$			% alabel $B$,(B abbreviated citation
      "]{" write$
      flabel write$			% flabel $B$,(B full citation
      "}{" write$
      is.kanji.entry
         { cyear convert.year.kanji write$ }	% cyear $B$,(B year
         { cyear write$ }
      if$
      % cyear $B$,(B year
      "}{" write$
      cite$ write$			% cite$ $B$G(B keyword $B$,%W%C%7%e$5$l$k!#(B
      "}" write$
      before.all 'output.state :=
      %YD has.hoyakusho $B$r=i4|2=(B
      #0 'has.hoyakusho :=
    
      % $B0J2<$O!"(Bnumber index $B$rIU$1$k>l9g$N=hM}(B
      output.number.index
    }
  if$
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	 $B%(%s%H%j!<$N%?%$%WJL$N=hM}(B

% FUNCTION {article} $B$O(B article $B%?%$%W$N%(%s%H%j!<$r=hM}$9$k$?$a$N4X?t!#(B

FUNCTION {test}
{
  output.bibitem
  author output.nocomma
  year output.nocomma
  fin.entry
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	 article $B$N=hM}(B

FUNCTION {article}
{ output.bibitem
  format.authors "author" output.check.nocomma
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
  format.title "title" output.check.nocomma

  format.journal "journal" output.check.nocomma
  format.vol.num.pages output.nocomma

  bst.year.backward #0 =
    { format.month output.nocomma }
    { format.date output.nocomma }
  if$
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  %YD $BDj4|4)9TJ*MQ(B
  fin.entry.periodical
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	 book $B$N=hM}(B

FUNCTION {book}
{ output.bibitem
  author empty$
    { format.editors "author and editor" output.check.nocomma }
    { format.authors output.nonnull.nocomma
      "author and editor" editor either.or.check 
    }
  if$
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
  %YD format.book "title" output.check.nocomma
  %YD
  %YD format.bvolume output.nocomma
  %YD format.number.series output.nocomma

  %YD $BF|K\8lJ88%$G$O%7%j!<%:$r@h$KI=<((B
  is.kanji.entry
    { format.bvolume output.nocomma
      format.number.series output.nocomma
    }
    'skip$
  if$
  format.book "title" output.check.nocomma
  %YD edition $B$r(B title $B$ND>8e$K0\F0(B
  format.edition output.nocomma
  %YD $B1Q8lJ88%$G$O%7%j!<%:$r8e$KI=<((B
  is.kanji.entry
    'skip$
    { format.bvolume output.nocomma
      format.number.series output.nocomma
    }
  if$
  output.publisher.address

  %YD format.edition output.nocomma
  format.book.pages output.nocomma
  bst.year.backward #0 =
    'skip$
    { format.year "year" output.check.nocomma }
  if$
  %YD format.hoyakusho output.nocomma
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  %YD hoyakusho $B$rKvHx$K0\F0(B
  format.hoyakusho output.nocomma
  fin.entry
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	 booklet $B$N=hM}(B

FUNCTION {booklet}
{ output.bibitem
  format.authors output.nocomma
  format.year output.nocomma
  format.misc.title "title" output.check.nocomma
  format.howpublished output.nocomma
  format.address output.nocomma
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  fin.entry
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	inbook $B$N=hM}(B

FUNCTION {inbook}
{ output.bibitem
  author empty$
    { format.editors "author and editor" output.check.nocomma }
    { format.authors output.nonnull.nocomma
      "author and editor" editor either.or.check
    }
  if$
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
%   format.book remove.pre.comma.period "title" output.check.nocomma
  %YD format.book "title" output.check.nocomma
  %YD format.edition output.nocomma
  %YD
  %YD format.bvolume output.nocomma
  %YD format.chapter.pages "chapter and pages" output.check.nocomma
  %YD format.number.series output.nocomma

  %YD $BF|K\8lJ88%$G$O%7%j!<%:$r@h$KI=<((B
  is.kanji.entry
    { format.bvolume output.nocomma
      format.number.series output.nocomma
    }
    'skip$
  if$
  format.book "title" output.check.nocomma
  format.edition output.nocomma
  %YD $B1Q8lJ88%$G$O%7%j!<%:$r8e$KI=<((B
  is.kanji.entry
    'skip$
    { format.bvolume output.nocomma
      format.number.series output.nocomma
    }
  if$
  %YD pages $B$r%7%j!<%:$N8e$KI=<((B
  format.chapter.pages "chapter and pages" output.check.nocomma
  output.publisher.address
  bst.year.backward #0 =
    'skip$
    { format.year "year" output.check.nocomma }
  if$
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  fin.entry
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	incollection $B$N=hM}(B

FUNCTION {incollection}
{ output.bibitem
  format.authors "author" output.check.nocomma
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
  format.title "title" output.check.nocomma

  format.in.ed.booktitle "booktitle" output.check.nocomma
  %YD edition $B$r(B booktitle $B$ND>8e$K0\F0(B
  format.edition output.nocomma
  format.bvolume output.nocomma
  %YD pages $B$r(B address, publisher $B$NA0$KI=<((B
  format.chapter.pages output.nocomma
  output.address.organization.publisher
  %YD format.edition output.nocomma
  %YD format.chapter.pages output.nocomma
  bst.year.backward #0 =
    'skip$
    { format.year "year" output.check.nocomma }
  if$
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  fin.entry
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	inproceedings $B$N=hM}(B

FUNCTION {inproceedings}
{ output.bibitem
  format.authors "author" output.check.nocomma
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
  format.title "title" output.check.nocomma

  %YD format.in.ed.booktitle "booktitle" output.check.nocomma
  %YD format.bvolume output.nocomma
  %YD format.number.series output.nocomma
  %YD format.pages output.nocomma
  format.proceedings "booktitle" output.check.nocomma
  format.pages.periodical output.nocomma
  output.address.organization.publisher
  bst.year.backward #0 =
    { format.month output.nocomma }
    { format.date output.nocomma }
  if$
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  %YD $BDj4|4)9TJ*MQ(B
  fin.entry.periodical
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	conference $B$N=hM}(B

FUNCTION {conference}
{ inproceedings }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	manual $B$N=hM}(B

FUNCTION {manual}
{ output.bibitem
  author empty$
    { organization empty$
	'skip$
	{ organization output.nonnull.nocomma
	  address output.nocomma
	}
      if$
    }
    { format.authors output.nonnull.nocomma }
  if$
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
  format.book "title" output.check.nocomma
  author empty$
    { organization empty$
	{ format.address new.block.check
	  format.address output.nocomma
	}
	'skip$
      if$
    }
    { output.address.organization.publisher }
  if$
  format.edition output.nocomma
  bst.year.backward #0 =
    'skip$
    { format.year "year" output.check.nocomma }
  if$
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  fin.entry
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	mastersthesis $B$N=hM}(B

FUNCTION {mastersthesis}
{ output.bibitem
  format.authors "author" output.check.nocomma
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
  %YD format.title "title" output.check.nocomma
  format.thesis "title" output.check.nocomma
  format.mthesis format.thesis.type output.nonnull.nocomma
  format.school "school" output.check.nocomma
  format.address output.nocomma
  bst.year.backward #0 =
    'skip$
    { format.year "year" output.check.nocomma }
  if$
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  fin.entry
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	misc $B$N=hM}(B

FUNCTION {misc}
{ output.bibitem
  format.authors "author" output.check.nocomma
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
  format.misc.title output.nocomma
  format.howpublished output.nocomma
  remove.irrelevant.kutoten
  bst.year.backward #0 =
    { format.month output.nocomma }
    { format.date output.nocomma }
  if$
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  fin.entry
  empty.misc.check
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	online $B$N=hM}(B

FUNCTION {online}
{ output.bibitem
  format.authors "author" output.check.nocomma
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
  format.misc.title output.nocomma
  format.howpublished output.nocomma
  remove.irrelevant.kutoten
  bst.year.backward #0 =
    { format.month output.nocomma }
    { format.date output.nocomma }
  if$
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  fin.entry
  empty.misc.check
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	phdthesis $B$N=hM}(B

FUNCTION {phdthesis}
{ output.bibitem
  format.authors "author" output.check.nocomma
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
  %YD format.title "title" output.check.nocomma
  format.thesis "title" output.check.nocomma
  format.phd
  format.thesis.type output.nonnull.nocomma
  format.school "school" output.check.nocomma
  address empty$
    'skip$
    { format.address output.nocomma }
  if$
  bst.year.backward #0 =
    'skip$
    { format.year "year" output.check.nocomma }
  if$
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  fin.entry
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	proceedings $B$N=hM}(B

FUNCTION {proceedings}
{ output.bibitem
  editor empty$
    { organization output.nocomma }
    { format.editors output.nonnull.nocomma }
  if$
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
  format.btitle remove.pre.comma.period "title" output.check.nocomma
  format.bvolume output.nocomma
  format.number.series output.nocomma
  output.address.organization.publisher
  bst.year.backward #0 =
    'skip$
    { format.year "year" output.check.nocomma }
  if$
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  fin.entry
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	techreport $B$N=hM}(B

FUNCTION {techreport}
{ output.bibitem
  format.authors "author" output.check.nocomma
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
  format.title "title" output.check.nocomma
  format.tr.number output.nonnull.nocomma
  format.institution "institution" output.check.nocomma
  format.address output.nocomma
  format.chapter.pages output.nocomma %%% added
  bst.year.backward #0 =
    'skip$
    { format.year "year" output.check.nocomma }
  if$
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  fin.entry
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	unpublished $B$N=hM}(B

FUNCTION {unpublished}
{ output.bibitem
  format.authors "author" output.check.nocomma
  bst.year.backward #0 =
    { format.year "year" output.check.nocomma }
    'skip$
  if$
  format.title "title" output.check.nocomma
  bst.year.backward #0 =
    { format.month remove.pre.comma.period output.nocomma }
    { format.date remove.pre.comma.period output.nocomma }
  if$
  format.url output.nocomma
  format.doi output.nocomma
  format.note output.nocomma
  fin.entry
}

FUNCTION {default.type}
{ misc }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	$B7n$NN,>NDj5A(B

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"}

%%% $B%(%s%H%j$rFI$_9~$`(B
READ

%%% $B%(%s%H%j!<$,F|K\8lJ88%$+H=CG$9$k$?$a$N4X?t(B (yomi $B$O=|$/(B)
FUNCTION {set.is.kanji.entry}
{
  author    field.or.null is.kanji.str$
  title     field.or.null is.kanji.str$ or
  editor    field.or.null is.kanji.str$ or
  journal   field.or.null is.kanji.str$ or
  booktitle field.or.null is.kanji.str$ or
  series    field.or.null is.kanji.str$ or
  'is.kanji.entry :=
}

%%% $B%(%s%H%j!<$,F|K\8lJ88%$+H=CG$9$k$?$a$N4X?t(B (yomi $B$b4^$a$F(B)
FUNCTION {set.is.kanji.entry.two}
{
  author    field.or.null is.kanji.str$
  title     field.or.null is.kanji.str$ or
  editor    field.or.null is.kanji.str$ or
  journal   field.or.null is.kanji.str$ or
  booktitle field.or.null is.kanji.str$ or
  series    field.or.null is.kanji.str$ or
  yomi      field.or.null is.kanji.str$ or
  'is.kanji.entry.two :=
}

%%% $BA4$F$N%(%s%H%j!<$KBP$7<B9T(B
ITERATE {set.is.kanji.entry}
ITERATE {set.is.kanji.entry.two}

%%% $B0zMQ=g$rJ];}$9$kJQ?t(B
INTEGERS { order.num }
FUNCTION {initialize.order.num}
{
  #1 'order.num :=
}
%%% $B=i4|CM$K(B1$B$r@_Dj(B
EXECUTE {initialize.order.num}

%%% $BJQ?t(B order.cited $B$K$O0zMQ=g$N?tCM$,F~$k!%(B
FUNCTION {set.order.cited}
{
  order.num 'order.cited :=
  #1 order.num + 'order.num :=
}
%%% $BA4$F$N%(%s%H%j!<$KBP$7<B9T(B
ITERATE {set.order.cited}
  
% FUNCTION {init.field.constants}
% { #0 'author.field :=
%   #1 'editor.field :=
%   #2 'organization.field :=
%   #3 'title.field :=
%   #4 'key.field :=
% }

% EXECUTE {init.field.constants}

%%% $B5-9f$r=|5n$7!">.J8;z$KJQ49(B
FUNCTION {sortify}
{ purify$ "l" change.case$ }

%%% $B@hF,2?J8;z$+$r=|5n$9$k!#(B
FUNCTION {chop.word}
{ 's :=
  'len :=
  s #1 len substring$ =
    { s len #1 + global.max$ substring$ }
    's
  if$
}

%%% $B%=!<%HMQ$KL>A0$r2C9)(B
FUNCTION {sort.format.names}
{ 's :=
  yomi empty$
     'skip$
     { yomi 's := }
  if$
  #1 'nameptr :=
  ""
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { nameptr #1 >
        { ", " * }
	'skip$
      if$
      s is.kanji.str$
         { bst.sei.mei.order #0 =
             { s nameptr "{ff }{ll}" format.name$ 't := }
             { s nameptr "{ll }{ff}" format.name$ 't := }
           if$
         }
         { s nameptr "{ll}{ ff}{ jj}" format.name$ 't := }
      if$
      nameptr numnames = t "others" = and
 	{ s is.kanji.str$
  		{ bst.and.others.jp * }
 		{ bst.and.others *}
	  if$
 	}
	{ t sortify * }
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

%%% $B%=!<%HMQ$KL>A0$r2C9)(B
FUNCTION {sort.format.names.abb}
{ 's :=
  yomi empty$
     'skip$
     { yomi 's := }
  if$
  s num.names$ 'numnames :=
  numnames bst.and.others.num <
     { s sort.format.names }
     { s is.kanji.str$
         % author $BL>$,F|K\8l$r4^$`%1!<%9(B
         { bst.sei.mei.order #0 =
             { s #1 "{ff }{ll}" format.name$ " et al. " * }
             { s #1 "{ll }{ff}" format.name$ " et al. " * }
           if$
         }
         { s #1 "{ll}{ ff}{ jj}" format.name$ " et al. " * }
       if$
     }
  if$
}

%%% Full author name $B$N(B label $B$N:n@.(B
FUNCTION {format.lab.names.full}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
      { s is.kanji.str$
          % author $BL>$KF|K\8l4^$`%1!<%9(B
          { nameptr 'name.num :=
            s set.alphabet.in.author
            alphabet.in.author #0 =
              % first name $B$bF|K\8l!JF|K\?ML>$N%1!<%9!K(B
              { s nameptr "{ll}" format.name$ 't :=
                t "others" =
                  'skip$
                  { bst.sei.mei.order #0 =
                     { s nameptr "{ff}" format.name$ 't := }
                     { s nameptr "{ll}" format.name$ 't := }
                   if$
                  }
                if$
                t empty$
                  { s #1 "{ll}" format.name$ 't := }
                  'skip$
                if$
              }
              % first name $B$,(B alphabet $B$N%1!<%9!J309q?ML>$N%1!<%9!K(B
              { s nameptr "{ll}" format.name$ 't := }
            if$
	    nameptr #1 >
              { namesleft #1 >
                  { bst.cite.and.jp * t * }
                  { t "others" =
                      { bst.and.others.jp * }
                      { bst.cite.and.jp * t * }
                    if$
                  }
                if$
              }
              't
            if$
            nameptr #1 + 'nameptr :=
            namesleft #1 - 'namesleft :=
          }

          % author $BL>$KF|K\8l4^$^$J$$%1!<%9(B
          { s nameptr "{vv~}{ll}" format.name$ 't :=
              nameptr #1 >
                { namesleft #1 >
                    { ", " * t * }
                    { t "others" =
                        { bst.and.others * }
                        { numnames #2 > 
                           { bst.cite.ands * t * }
                           { bst.cite.and * t * }
                          if$
                        }
                      if$
                    }
                  if$
                }
                't
              if$
              nameptr #1 + 'nameptr :=
              namesleft #1 - 'namesleft :=
          }
        if$
      }
    while$
    numnames #1 > #1 #2 = and {", eds" *} {} if$
    numnames #1 = #1 #2 = and {", ed" *} {} if$
}

%%% author name $B$N(B label $B$N:n@.(B (abbreviated name).
FUNCTION {format.lab.names.abb}
{ 's :=
   s num.names$ 'numnames :=
   numnames bst.and.others.num <
     % author $B?t$,(B bst.and.others.num $B$h$j>.$5$$$J$i(B full $B$GI=<(!#(B
     { s format.lab.names.full }
     % author $B?t$,(B bst.and.others.num $B0J>e$J$i(B 1st author $B$N$_I=<(!#$"$H$ON,!#(B
     { s is.kanji.str$
         % author $BL>$,F|K\8l$r4^$`%1!<%9(B
         { #1 'name.num :=
           s set.alphabet.in.author
           alphabet.in.author #0 =
            % first name $B$bF|K\8l$N%1!<%9!JF|K\?ML>$N%1!<%9!K(B
            
            % $BCm!'F|K\8l$N(B author $B$O(B "$B@+(B $BL>(B" $B$N=g$G;XDj$5$l$k$,!"(Bbst $B$G$O(B
            % $B=gHVDL$j$K@+!a(Bfirst name$B!"L>!a(Blast name $B$H$7$F07$o$l$k!#(B
            { bst.sei.mei.order #0 =
                { s #1 "{ff}" format.name$ 't := }
                { s #1 "{ll}" format.name$ 't := }
              if$
              t empty$
                { s #1 "{ll}" format.name$ 't := }
                'skip$
              if$
              t bst.and.others.jp * }

            % first name $B$,(B alphabet $B$N%1!<%9!J309q?ML>$N%1!<%9!K(B
            { s #1 "{ll}" format.name$ 't := 
              t bst.and.others.jp * }
          if$
         }
         % author$BL>$,%"%k%U%!%Y%C%H$N%1!<%9(B
         { s #1 "{ll}" format.name$ bst.and.others * }
       if$
     }
   if$
}

%%% $B$3$l$O(B abbreviated author $BL>(B
FUNCTION {author.key.label.abb}
{ author empty$
    { key empty$
	{ cite$ #1 #3 substring$ }
	{ key #3 text.prefix$ }
      if$
    }
    { author format.lab.names.abb }
  if$
}

%%% $B$3$l$O(B full author $BL>(B
FUNCTION {author.key.label.full}
{ author empty$
    { key empty$
	{ cite$ #1 #3 substring$ }
	{ key #3 text.prefix$ }
      if$
    }
    { author format.lab.names.full }
  if$
}

%%% $B$3$l$O(B sort $BMQ$N(B author $BL>(B
FUNCTION {author.key.label.sort}
{ author empty$
    { key empty$
	{ cite$ #1 #3 substring$ }
	{ key #3 text.prefix$ }
      if$
    }
    { author sort.format.names }
  if$
}

%%% $B$3$l$O(B sort $BMQ$NL>A0$r:n@.(B
FUNCTION {author.editor.key.label.sort}
{ author empty$
    { editor empty$
	{ key empty$
	    { cite$ #1 #3 substring$ }
	    { key #3 text.prefix$ }
	  if$
	}
        { yomi empty$
           { editor sort.format.names }
           { bst.mixed.order #0 = 
              { editor sort.format.names }
              { yomi sort.format.names }
    	if$
          }
          if$
        }
      if$
    }
    { yomi empty$
       { author sort.format.names }
       { bst.mixed.order #0 = 
          { author sort.format.names }
          { yomi sort.format.names }
	if$
      }
      if$
    }
  if$
}

%%% $B$3$l$O(B abbreviated author $BL>$r:n@.$9$k4X?t(B
FUNCTION {author.editor.key.label.abb}
{ author empty$
    { editor empty$
	{ key empty$
	    { cite$ #1 #3 substring$ }
	    { key #3 text.prefix$ }
	  if$
	}
 	{ editor format.lab.names.abb }
      if$
    }
    { author format.lab.names.abb }
  if$
}

%%% $B$3$l$O(B full author $BL>(B
FUNCTION {author.editor.key.label.full}
{ author empty$
    { editor empty$
	{ key empty$
	    { cite$ #1 #3 substring$ }
	    { key #3 text.prefix$ }
	  if$
	}
	{ editor format.lab.names.full }
      if$
    }
    { author format.lab.names.full }
  if$
}

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

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

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

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

%%% $BM?$($i$l$??t$rJQ49(B: 0->9, 1->8, 2->7,..., 9->0 $B$H$$$&BP1~4X78!#(B
FUNCTION {reverse.num}
{ 's :=
  s "1" =
    { "8" 'year.num := }
    { s "2" =
        { "7" 'year.num := }
        { s "3" =
            { "6" 'year.num := }
            { s "4" =
                { "5" 'year.num := }
                { s "5" =
                    { "4" 'year.num := }
                    { s "6" =
                        { "3" 'year.num := }
                        { s "7" =
                            { "2" 'year.num := }
                            { s "8" =
                                { "1" 'year.num := }
                                { s "9" =
                                    { "0" 'year.num := }
                                    { s "0" =
                                        { "9" 'year.num := }
                                        { "9" 'year.num := }
                                    if$
                                    }
                                if$
                                }
                            if$
                            }
                        if$
                        }
                    if$
                    }
                if$
                }
            if$
            }
        if$
        }
    if$
    }
  if$
  year.num
}

%%% year $B$rJQ49(B ($BBg$-$$?t;z(B -> $B>.$5$$?t;z(B)
FUNCTION {convert.year}
{ 't := 
  bst.reverse.year #0 =
    % $BIaDL$N(B year $B$NJB$S=g(B
    { t 'tt := }
    % year $B$NJB$S=g$r$R$C$/$jJV$9%1!<%9(B ($B?7$7$$$[$I@h$KI=<($9$k%1!<%9(B)$B!#(B
    { t #1 #1 substring$ reverse.num 
      t #2 #1 substring$ reverse.num *
      t #3 #1 substring$ reverse.num *
      t #4 #1 substring$ reverse.num * 'tt := }
  if$
  tt
}

%%% cyear $B$r7W;;!%(B cyear $B$O0zMQItJ,$GI=<($5$l$kG/$rJ];}$9$kJQ?t!%(Breference $BIt(B
%%% $BJ,$NI=<($K$O4X78$J$$!%$^$?F1;~$K$3$3$G(B sort.label $B$r7W;;$7$F$$$k!%(B
%%% sort.label $B$OJ88%$N(B sort $B$N$?$a$KMxMQ$5$l$k(B author (editor) $BL>$rJ];}$9$kJQ(B
%%% $B?t!%(Byomi field $B$,$"$k>l9g$K$O7k6I(B sort.label $B$NCf?H$O;H$o$l$J$$!%(B
FUNCTION {calc.cyear}
{ type$ "book" =
  type$ "inbook" =
  or
    'author.editor.key.label.sort
    { type$ "proceedings" =
	'editor.key.organization.label.full
	{ type$ "manual" =
	    'author.key.organization.label.full
	    'author.key.label.sort
	  if$
	}
      if$
    }
  if$
  duplicate$
  year 'cyear :=
  " " year convert.year * field.or.null *
  sortify 'sort.label :=
  % For debug
  jecon.debug #0 = not
    { "sort.label = ``\texttt{" write$
      sort.label write$
      "}''\\" write$
      newline$
    }
    'skip$
 if$
}

FUNCTION {calc.sort.label.abb}
{ yomi empty$
    { author empty$
        { editor empty$
           { "" }
           { editor 's := }
          if$
        }
        { author 's := }
      if$
    }
    { yomi 's := }
  if$
  s sort.format.names.abb 't := 
  t sortify " " * year convert.year * 'sort.label.abb :=
  jecon.debug #0 = not
    { "sort.label.abb = ``\texttt{" write$
      sort.label.abb write$
      "}''\\" write$
      newline$
    }
    'skip$
  if$
}

%%% flabel $B$r7W;;!%(Bflabel $B$O0zMQItJ,$NCx<TL>$rJ];}$9$kJQ?t!%(Breference $BItJ,$K$O(B
%%% $B4X78$J$$!%(B
FUNCTION {calc.flabel}
{ type$ "book" =
  type$ "inbook" =
  or
    'author.editor.key.label.full
    { type$ "proceedings" =
	'editor.key.organization.label.full
	{ type$ "manual" =
	    'author.key.organization.label.full
	    'author.key.label.full
	  if$
	}
      if$
    }
  if$
  'flabel :=
  % For debug
  jecon.debug #0 = not
    { "flabel = ``\texttt{" write$
      flabel write$
      "}''\\" write$
      newline$
    }
    'skip$
 if$
}

%%% alabel $B$r7W;;!%(Balabel $B$O0zMQItJ,$NCx<TL>(B ($BC;=L7AI=<((B) $B$rJ];}$9$kJQ?t!%(B
%%% reference $BItJ,$O4X78$J$$!%(B
FUNCTION {calc.alabel}
{ type$ "book" =
  type$ "inbook" =
  or
    'author.editor.key.label.abb
    { type$ "proceedings" =
	'editor.key.organization.label.abb
	{ type$ "manual" =
	    'author.key.organization.label.abb
	    'author.key.label.abb
	  if$
	}
      if$
    }
  if$
  'alabel :=
  % For debug
  jecon.debug #0 = not
    { "alabel = ``\texttt{" write$
      alabel write$
      "}''\\" write$
      newline$
    }
    'skip$
 if$
}

%%% $B%=!<%HMQ$K(B title $B$r2C9)(B
FUNCTION {sort.format.title}
{ 't :=
  "A " #2
    "An " #3
      "The " #4 t chop.word
    chop.word
  chop.word
  sortify
  #1 global.max$ substring$
}

FUNCTION {author.organization.sort}
{ author empty$
    { organization empty$
	{ key empty$
	    { "to sort, need author, organization, or key in " cite$ * warning$
	      ""
	    }
	    { key sortify }
	  if$
	}
	{ "The " #4 organization chop.word sortify }
      if$
    }
    { author sort.format.names }
  if$
}

FUNCTION {editor.organization.sort}
{ editor empty$
    { organization empty$
	{ key empty$
	    { "to sort, need editor, organization, or key in " cite$ * warning$
	      ""
	    }
	    { key sortify }
	  if$
	}
	{ "The " #4 organization chop.word sortify }
      if$
    }
    { editor sort.format.names }
  if$
}

%%% $B=g=x$r%=!<%H$9$k$?$a$K(B yomi $B$r2C9)$9$k!#(B
% FUNCTION {yomi.label}
% { yomi is.kanji.str$
%     % yomi $B$,$R$i$,$J$N%1!<%9!#(Byear (+ month) $B$rIU$1B-$9$N$_!#(B
%     { yomi " " * year convert.year * }
%     % yomi $B$,(B alphabet $B$N%1!<%9!#L>A0$r2C9)$7$F$+$i>.J8;z$KJQ49$7!"(Byear $B$r(B
%     % $BIU$1B-$9(B
%     { yomi sort.format.names "l" change.case$ " " * year convert.year * }
%   if$
% }

%%% $B?t;z$,0lJ8;z(B ($B$D$^$j(B, 1,...,9$BEy(B) $B$J$i$=$NA0$K(B 00 $B$r!$?t;z$,FsJ8;z(B
%%% (10,...,99) $B$J$i(B 0 $B$rIU$1$k!%(B10, 11, 12 $B$N;XDj$,(B 2, 3, 4,... $B$h$j$bM%@h$5(B
%%% $B$l$k$N$rKI$0$?$a!#(B
FUNCTION {add.zero.to.number}
{ 's :=
    s text.length$ #1 =
      { "00" s * }
      { s text.length$ #2 =
          { "0" s * }
          { s }
        if$
      }
   if$
}

%% entry type $B$K?tCM$r3dEv$F$k!%?tCM$,>.$5$$$[$&$,(B bst.sort.entry.type $B$,Hs%<(B
%% $B%m$N$H$-$K@h$KNs5s$5$l$k$3$H$K$J$k!%(B
FUNCTION {bst.sort.entry.type.order}
{ 'item.type :=
  item.type "article" =
    { "01" }
    { item.type "book" =
        { "02" }
        { item.type "booklet" =
            { "03" }
            { item.type "comment" =
                { "04" }
                { item.type "conference" =
                    { "05" }
                    { item.type "inbook" =
                        { "06" }
                        { item.type "incollection" =
                            { "07" }
                            { item.type "inproceedings" =
                                { "08" }
                                { item.type "manual" =
                                    { "09" }
                                    { item.type "masterthesis" =
                                        { "10" }
                                        { item.type "misc" =
                                           { "11" }
                                           { item.type "phdthesis" =
                                              { "12" }
                                              { item.type "proceedings" =
                                                 { "13" }
                                                 { item.type "techreport" =
                                                    { "14" }
                                                    { item.type "unpublished" =
                                                       { "15" }
                                                       { "16" }
                                                      if$
                                                    }
                                                   if$
                                                 }
                                                if$
                                              }
                                             if$
                                           }
                                          if$
                                        }
                                      if$
                                    }
                                if$
                                }
                            if$
                            }
                        if$
                        }
                    if$
                    }
                if$
                }
            if$
            }
        if$
        }
    if$
    }
  if$
}

%%% $B$^$:!"(Bauthor -> year -> absorder -> order -> month -> title $B$G(B sort.key$ $B$r(B
%%% $B:n@.$9$k!#0l2sL\$N%=!<%H$GMxMQ$9$k!%(B
FUNCTION {presort.one}
{
  calc.cyear
  pop$
  ""
  sort.label.abb *
  " "
  bst.no.sort #0 = not
    { * order.cited int.to.str$ add.zero.to.number * " " * }
    { * " " * }
  if$
  title is.kanji.str$ 
    { bst.mixed.order #0 =
       { "" }
       { " " }
     if$
    }
    { " " }
  if$
  "" *
  bst.sort.entry.type #0 = not
    { type$ bst.sort.entry.type.order * " " * }
    'skip$
  if$
  absorder empty$
    % absorder $B$,(B empty $B$N$H$-$O(B 0 $B$N$H$-$H0l=o(B /// ($B$3$l$O?t;z$h$j$OA0(B)
    { "/// " * }
    { bst.notuse.absorder.field #0 =
       { absorder "999" =
          % 999 $B$N$H$-$O(B zz 
          { "zzz " * }
          { absorder add.zero.to.number "000" =
             % 000 $B$N$H$-$O(B /// ($B$3$l$O?t;z$h$j$OA0(B)
             { "/// " * }
             { absorder add.zero.to.number * " " * }
            if$
          }
         if$
       }
       % absorder field $B$r;2>H$7$J$$>l9g$O(B ///
       { "/// " * }
      if$
    }
  if$
  " " *
  order empty$
    % order $B$,(B empty $B$N$H$-$O(B 0 $B$N$H$-$H0l=o$G(B /// ($B$3$l$O?t;z$h$j$OA0(B)
    { "/// " * }
    { bst.notuse.order.field #0 =
       { order "999" =
          % 999 $B$N$H$-$O(B zz 
          { "zzz " * }
          { order add.zero.to.number "000" =
             % 000 $B$N$H$-$O(B /// ($B$3$l$O?t;z$h$j$OA0(B)
             { "/// " * }
             { order add.zero.to.number * " " * }
            if$
          }
         if$
       }
       % order field $B$r;2>H$7$J$$>l9g$O(B ///
       { "/// " * }
      if$
    }
  if$
  month empty$
    % month $B$,(B empty $B$N$H$-$O(B 0 $B$N$H$-$H0l=o$G(B /// ($B$3$l$O?t;z$h$j$OA0(B)
    { * "/// " * }
       { month "999" =
          % 999 $B$N$H$-$O(B zz 
          { * month add.zero.to.number * "zzz " * }
          { month add.zero.to.number "000" =
             % 000 $B$N$H$-$O(B /// ($B$3$l$O?t;z$h$j$OA0(B)
             { * month add.zero.to.number * "/// " * }
             { * month add.zero.to.number * " " * }
            if$
          }
         if$
       }
  if$
  title field.or.null sort.format.title
  *
  #1 entry.max$ substring$
  'sort.key$ :=
  % For debug$B!%%G%P%C%0$9$k$H$-$K$O$3$N4X?t$G:n@.$5$l$k(B sort.key$$B$NCf?H$r=PNO(B
  % $B$9$k!%(B
  jecon.debug #0 = not
    { "\verb|sort.key$| = ``\texttt{" write$
      sort.key$ write$
      "}''\\" write$
      newline$
    }
    'skip$
  if$
}

%%% $B$3$l$O(B absorder -> author -> year -> order -> month -> title $B$G(B sort.key$ $B$r(B
%%% $B:n@.$9$k!#:G=*E*$JJB$YBX$($O$3$A$i$G;XDj$9$k(B sort.key$ $B$G$*$3$J$&!#(B
FUNCTION {presort.two}
{
  bst.no.sort #0 = not
    %% $BJB$YBX$($7$J$$(B($B0zMQ=g$G$=$N$^$^JB$Y$k(B)$B%1!<%9$N$?$a$N@_Dj!%(B
    { order.cited int.to.str$ add.zero.to.number " " * }
    { "" }
  if$
  bst.sort.year #0 = not
    %% year $B$r%-!<$H$7$FJB$Y$k$?$a$N@_Dj!%(B
    { is.kanji.entry.two
        %% $BF|K\8lJ88%(B
        { year convert.year * }
        %% $B1Q8lJ88%(B
        { year convert.year * }
      if$
    }
    'skip$
  if$
  bst.sort.entry.type #0 = not
    %% $B%(%s%H%j!<$N%?%$%WJL$KJ,$1$FJB$Y$k$?$a$N@_Dj!%(B
    { type$ bst.sort.entry.type.order * " " * }
    'skip$
  if$
  absorder empty$
    % absorder $B$,(B empty $B$N$H$-$O(B 0 $B$N$H$-$H0l=o(B /// ($B$3$l$O?t;z$h$j$OA0(B)
    { "/// " * }
    { bst.notuse.absorder.field #0 =
       { absorder "999" =
          % 999 $B$N$H$-$O(B zz 
          { "zzz " * }
	  { absorder add.zero.to.number "000" =
	     % 000 $B$N$H$-$O(B /// ($B$3$l$O?t;z$h$j$OA0(B)
	     { "/// " * }
	     { absorder add.zero.to.number * " " * }
	    if$
	  }
	 if$
       }
       % absorder field $B$r;2>H$7$J$$>l9g$O(B ///
       { "/// " * }
      if$
    }
  if$
  " " *
  sort.label.abb *
  " " *  
  title is.kanji.str$
    { bst.mixed.order #0 =
       { "" }
       { " " }
     if$
    }
    { " " }
  if$
  order empty$
    % order $B$,(B empty $B$N$H$-$O(B 0 $B$N$H$-$H0l=o$G(B /// ($B$3$l$O?t;z$h$j$OA0(B)
    { "/// " * }
    { bst.notuse.order.field #0 =
       { order "999" =
          % 999 $B$N$H$-$O(B zz 
          { "zzz " * }
	  { order add.zero.to.number "000" =
	     % 000 $B$N$H$-$O(B /// ($B$3$l$O?t;z$h$j$OA0(B)
	     { "/// " * }
	     { order add.zero.to.number * " " * }
	    if$
	  }
	 if$
       }
       % order field $B$r;2>H$7$J$$>l9g$O(B ///
       { "/// " * }
      if$
    }
  if$
  month empty$
    % month $B$,(B empty $B$N$H$-$O(B 0 $B$N$H$-$H0l=o$G(B /// ($B$3$l$O?t;z$h$j$OA0(B)
    { * "/// " * }
       { month "999" =
          % 999 $B$N$H$-$O(B zz 
          { * month add.zero.to.number * "zzz " * }
	  { month add.zero.to.number "000" =
	     % 000 $B$N$H$-$O(B /// ($B$3$l$O?t;z$h$j$OA0(B)
	     { * month add.zero.to.number * "/// " * }
	     { * month add.zero.to.number * " " * }
	    if$
	  }
	 if$
       }
  if$
  title field.or.null sort.format.title
  *
  #1 entry.max$ substring$
  'sort.key$ :=
  % For debug$B!%%G%P%C%0$9$k$H$-$K$O$3$N4X?t$G:n@.$5$l$k(B sort.key$$B$NCf?H$r=PNO(B
  % $B$9$k!%(B
  jecon.debug #0 = not
    { "\verb|sort.key$| = ``\texttt{" write$
      sort.key$ write$
      "+}''\\" write$
      newline$
    }
    'skip$
 if$
}

%%% $B0J2<$O%G%P%C%0MQ$N%3!<%I(B
FUNCTION {calc.alabel.mess}
{ jecon.debug #0 = not
    { "\textbf{Iteration of calc.alabel}\\" write$
      newline$ }
    'skip$
 if$
}
FUNCTION {calc.flabel.mess}
{ jecon.debug #0 = not
    { "\textbf{Iteration of calc.flabel}\\" write$
      newline$ }
    'skip$
 if$
}
FUNCTION {calc.sort.label.abb.mess}
{ jecon.debug #0 = not
    { "\textbf{Iteration of calc.sort.label.abb}\\" write$
      newline$ }
    'skip$
 if$
}
FUNCTION {presort.one.mess}
{ jecon.debug #0 = not
    { "\textbf{Iteration of presort.one ($B%=!<%H(B1$B2sL\(B)}\\" write$
      newline$ }
    'skip$
 if$
}
FUNCTION {presort.two.mess}
{ jecon.debug #0 = not
    { "\textbf{Iteration of presort.two ($B%=!<%H(B2$B2sL\(B)}\\" write$
      newline$ }
    'skip$
 if$
}
%%% $B%G%P%C%0MQ%3!<%I$3$3$^$G!%(B

%%% alabel $B$N:n@.(B
EXECUTE {calc.alabel.mess}
ITERATE {calc.alabel}

%%% flabel $B$N:n@.(B
EXECUTE {calc.flabel.mess}
ITERATE {calc.flabel}

%%%
EXECUTE {calc.sort.label.abb.mess}
ITERATE {calc.sort.label.abb}

%%% presort $B$N<B9T(B 
EXECUTE {presort.one.mess}
ITERATE {presort.one}

%%% sort.key$ $B$rMxMQ$7$FJ88%$NJB$YBX$(!%0l2sL\$NJB$YBX$(!%(B

% $B$3$l$O2>$NJB$S=g$r7h$a$k$?$a$N$b$N$G!$:G=*E*$K$O$b$&0lEYJB$YBX$($r$*$3$J$&!%(B
% $BFs2sJB$SBX$($r$9$k$N$O(B bst.mixed.order $B$G;XDj$9$k(B "$BF1$8G/$KF1$8Cx<T$N1Q8l!"(B
% $BF|K\8lJ88%$NN>J}$,$"$j!"$+$DF|K\8lJ88%$N(B yomi $B$K1Q8lJ88%$NCx<T$HF1$8$b$N$,;X(B
% $BDj$7$F$"$k$H$-$K!"N><T$r:.$<$FI=<($9$k(B"$B$KBP1~$9$k$?$a!%(B

SORT

% \bysame $B$r;H$&>l9g$O!"(Bsort.label $B$,A02s$N$b$N$HF10l$G$"$l$P!"(Bextra.label$B$r%;%C%H(B
% author $B$,A02s$N$b$N$HF10l$G$"$l$P!"(Bextra.label.bysame$B$r%;%C%H(B
FUNCTION {forward.pass}
{ bst.use.bysame #0 =
%   bst.no.sort #0 = not or
    % \bysame $B$r;H$o$J$$>l9g(B
    { last.sort.label sort.label.abb =
        { last.extra.num #1 + 'last.extra.num :=
          last.extra.num int.to.chr$ 'extra.label :=
        }
        { "a" chr.to.int$ 'last.extra.num :=
          "" 'extra.label :=
          sort.label.abb 'last.sort.label :=
        }
      if$
    }
    % \bysame $B$r;H$&>l9g(B
    { last.sort.label sort.label.abb =
        { last.extra.num #1 + 'last.extra.num :=
          last.extra.num int.to.chr$ 'extra.label :=
        }
        { "a" chr.to.int$ 'last.extra.num :=
          "" 'extra.label :=
          sort.label.abb 'last.sort.label :=
        }
      if$
      author empty$
        { editor empty$
          { "" }
          'format.editors
          if$
        }
        'format.authors
      if$
      'this.author :=
      % format.names 'this.author :=
      this.author prev.author =
        { "bysame" 'extra.label.bysame := }
        { this.author "" =
            { "abcxyz" }
            'this.author
          if$
          'prev.author :=
        }
      if$
    }
  if$
}

%%% $BF1$8G/!"F1$8Cx<T$NJ88%$,J#?t$"$k$H$-$N(B year $B$K(B a $B$rIU$1$k$?$a$N4X?t(B
FUNCTION {reverse.pass}
{ next.extra "b" =
    { "a" 'extra.label := }
    'skip$
  if$
  extra.label empty$ not
    { cyear extra.label * }
    { cyear "" * }
  if$
  "" field.or.null *
  'cyear :=
  extra.label 'next.extra :=
}

%%% \bysame $B$rIU$1$k!#(B
ITERATE {forward.pass}

%%% $BF1$8Cx<T$NF1$8G/$NJ88%$,J#?t$"$k$H$-(B a $B$rIU$1$k!#(B
REVERSE {reverse.pass}

%%% $B#22sL\$NJB$YBX$(!%$3$l$G:G=*E*$KJ88%$NJB$S=g$,A*Br$5$l$k!%(B
EXECUTE {presort.two.mess}
ITERATE {presort.two}

%%% sort.key$ $B$rMxMQ$7$FJ88%$NJB$YBX$((B ($B#22sL\(B)
SORT

FUNCTION{punctuation}
%YD JASS$BMQ$KJQ99(B
{
  "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"  write$ newline$
  "%"                                                                    write$ newline$
  %YD "%  This bbl file is created by jecon.bst ver." jecon.version *        write$ newline$
  %YD "%  The latest jecon.bst is available at"                              write$ newline$
  %YD "%  <http://shirotakeda.org/ja/tex-ja/jecon-ja.html>"             write$ newline$
  "%  This bbl file is created by jass.bst ver." jass.version *          write$ newline$
  "%"                                                                    write$ newline$
  "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"  write$ newline$
  newline$
}

EXECUTE {punctuation}

%YD $BM>J,$J6u9T$rM^@)(B
FUNCTION {begin.bib}
{
  preamble$ empty$
    'skip$
    { preamble$ write$ newline$ }
  if$
  bst.use.bysame #0 =
     % \bysame $B$r;H$o$J$$%1!<%9(B
     'skip$
     % \bysame $B$r;H$&%1!<%9(B
     { "%%% Definition of \bysame" write$ newline$
       "\ifx\undefined\bysame" write$ newline$
       "\newcommand{\bysame}{" bst.bysame.definition * "}" *
       write$ newline$
       "\fi" write$ newline$ newline$ }
  if$
  %% $B?t;z$r4A?t;z$KJQ49$9$k$H$-$N(B
  bst.kansuji.jp #0 =
     'skip$
     { "%%% Definition of \tatebo" write$ newline$
       "\ifx\undefined\tatebo" write$ newline$
       "\newcommand{\tatebo}{" bst.tatebo.definition * "}" *
       write$ newline$
       "\fi" write$ newline$ newline$ }
  if$
  %% $BJ88%$K(B number index $B$rIU$1$k$H$-$N(B:
  bst.use.number.index #0 =
     'skip$
     { bst.number.index.digit "1" =
         % $B0l7e$N$H$-(B
         { bst.number.index.bibhang.one }
         { bst.number.index.digit "2" =
            % $BFs7e$N$H$-(B
            { bst.number.index.bibhang.ten }
            % $B;07e0J>e$N$H$-(B
            { bst.number.index.bibhang.hund }
           if$
         }
       if$
       'hang :=
       "%%% Redefinition of \bibhang" write$ newline$
       "\ifx\undefined\bibhang" write$ newline$
       "\relax" write$ newline$
       "\else" write$ newline$
       "\setlength{\bibhang}{"
       hang * "}" * write$ newline$ 
       "\fi" write$ newline$ newline$
       }
  if$

  bst.thebibliography.begin
  %YD newline$

  %% $BJQ?t(B index $B$r=i4|2=$7$F$$$k!%(B
  #0 'index :=
}

FUNCTION {end.bib}
{
  newline$
  bst.thebibliography.end
  %YD newline$
 }

EXECUTE {begin.bib}

EXECUTE {init.state.consts}

%% $B3F%(%s%H%j!<$K$=$N%(%s%H%j!<$N%?%$%W$r<B9T$9$k!%$D$^$j!$(Barticle $B%(%s%H%j!<(B
%% $B$K$O(B article $B$H$$$&4X?t$r<B9T$9$kEy!%(B
ITERATE {call.type$}

EXECUTE {end.bib}

% $B=*!%(B

%  --------------------
%  Local Variables:
%  fill-column: 80
%  mode: bst
%  End:
