Debian Codegraph @

texk/web2c/uptexdir/tests/nissya.bst

raw
1 %-----------------------------------------------------------------------------%
2 % nissya.bst: 『社会学評論』用 BibTeX style file.
3 %
4 % 飯田修さんによって作成された jpolisci.bst ファイルが、武田史郎さんによって経
5 % 済学用に書き換えられ、さらにそれを樋口耕一が『社会学評論』用に書き換えたのが
6 % このファイルです。
7 %
8 % 使い方などは、同梱の説明書(PDF)をまずご覧下さい。
9 %
10 % なお、どうしても文献リストに「編」ではなく「編著」と出力したい場合は、文献DB
11 % を作成する際、「editor」フィールドと「hentyo」フィールドに同じ名前を入力して
12 % 下さい。
13 %
14 % 以下は元の jecon.bst のヘッダー部分です.
15 %-----------------------------------------------------------------------------%
16 %
17 % jecon.bst: 経済学用 BibTeX style file.
18 %
19 % これは,飯田修さんによって作成された jpolisci.bst ファイルを経済学用に
20 % 武田史郎 <[email protected]> が改変したものです.
21 %
22 % First-written: <2002/11/03>
23 % Time-stamp: <2003-01-03 21:52:21 Shiro Takeda>
24 % Version 1.4
25 % $Id: nissya.bst,v 1.31 2005/02/18 19:23:10 ko-ichi Exp $
26 %
27 % 元の jpolisci.bst の著作権は飯田さんにあります.
28 % ぼくが改変した部分の著作権はどうでもいいです.好きなように扱ってくださ
29 % い.
30 %
31 % オリジナルの jpolisci.bst は,
32 % <http://www.bol.ucla.edu/~oiida/jpolisci/> で入手することができます.
33 %
34 % ぼくが改変した部分は主にプログラム中のコメント行の部分です.コメント行
35 % の部分 (とその周り) を見れば,どう変えたかわかると思います.
36 %
37 % コメント,要望は Shiro Takeda <[email protected]> まで.
38 %
39 % 以下は元の jpolisci.bst のヘッダー部分です.
40 %
41 % JPOLISCI: a bibliography style for papers in political sicence
42 % and other fields that cite Japanese literature.
43 % Vertical writing (tate-gaki) compatible.
44
45 % Version 20000910 for JBibTeX versions 0.30 or later,
46 % and pLaTeX2e or later.
47 % Copyright (C) 2000, all rights reserved.
48 %
49 % This file was derived from jbtxbst.doc.
50 %
51 % Copying of this file is authorized only if either
52 % (1) you make absolutely no changes to your copy, including name, or
53 % (2) if you do make changes, you name it something other than
54 % jbtxbst.doc, jplain.bst, junsrt.bst, jalpha.bst, jabbrv.bst,
55 % tipsj.bst, jipsj.bst, tieice.bst, jname.bst, jorsj.bst, jglsj.bst,
56 % seg.bst, jpolisci.bst.
57 %
58 % This restriction helps ensure that all standard styles are identical.
59 % The file jbtxbst.doc has the documentation for this style.
60 %
61
62 % Author:
63 %
64 % 飯田修 Osamu Iida
65 % email: [email protected]
66 % URL : http://www.bol.ucla.edu/~oiida/jpolisci/ (in Japanese)
67 %
68 % Bug reports, technical suggestions and any other comments
69 % will be appreciated.
70 %
71
72 % Acknowledgement:
73 %
74 % The following files were referred to while creating this file:
75 %
76 % jglsj.bst (by 千葉智章 Tomoaki Chiba)
77 % Function "format.lab.name" in jpolisci.bst derived from
78 % it with small modifications only. The author appreciates it.
79 %
80 % seg.bst (by Martin Karrenbach)
81 % A method for making two sorts of labels is based on this
82 % file's feats.
83 %
84 % jalpha.bst (by 松井正一 Shoichi Matsui)
85 % jpolisci.bst principally owes its functionality to it.
86 %
87 % 藤田眞作『続 LaTeX2e 階梯・縦組編』(アジソン・ウェスレイ、1998 年)。
88 %
89 % Friends in BBSes at IR-web <http://pws.prserv.net/oi/ -- now
90 % obsolete> and KH's Web Site <http://home.att.ne.jp/wind/polisci/>
91 % gave me titles of Japanese political science journals which are
92 % included in MACROs.
93
94 % This file is distributed with absolutely no warranty.
95 % The author doesn't assume any kind of responsibility for
96 % any inconvenience caused by using this file.
97
98 % Last modified: 2000/12/05
99
100 %------------------%
101 % 下準備・・・ %
102 %------------------%
103
104 ENTRY { address author booktitle chapter edition editor howpublished
105 institution journal key month note number organization pages publisher
106 school series title type volume year yomi jauthor jkanyaku jtitle
107 jpublisher jyear hentyo}
108
109 { is.kanji.entry field.used is.honyaku }
110
111 { label label2 label3 label4 label.pure extra.label sort.label extra.label.bysame }
112
113
114 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
115
116 FUNCTION {not}
117 { { #0 }
118 { #1 }
119 if$
120 }
121
122 FUNCTION {and}
123 { 'skip$
124 { pop$ #0 }
125 if$
126 }
127
128 FUNCTION {or}
129 { { pop$ #1 }
130 'skip$
131 if$
132 }
133
134 FUNCTION {init.state.consts}
135 { #0 'before.all :=
136 #1 'mid.sentence :=
137 #2 'after.sentence :=
138 #3 'after.block :=
139 }
140
141 STRINGS { s t u str.p.start str.p.end str.a str.b str.c str.last.author}
142
143 FUNCTION {add.kanji.period}
144 {
145 add.period$ duplicate$
146 #-1 #1 substring$ "." =
147 {#-2 global.max$ substring$ "." *}
148 'skip$
149 if$
150 }
151
152 %----------------%
153 % 出力系関数 %
154 %----------------%
155
156 FUNCTION {output.bibitem}
157 { newline$
158 "\nissyaitem[" write$
159 label3 write$
160 "]{" write$
161 label.pure write$
162 "}{" write$
163 label2 write$
164 "}{" write$
165 label4 write$
166 "}{" write$
167 label write$
168 "}{" write$
169 cite$ write$
170 "}" write$
171 newline$
172 ""
173 before.all 'output.state :=
174 }
175
176 FUNCTION {output.nonnull}
177 { 's :=
178 output.state mid.sentence =
179 {
180 is.kanji.entry
181 { write$ }
182 % { " " * write$ }
183 { "" * write$ }
184 if$
185 }
186 {
187 output.state after.block =
188 {
189 is.kanji.entry
190 {add.kanji.period write$}
191 {add.period$ write$}
192 if$
193 "" write$
194 }
195 {
196 output.state before.all =
197 'write$
198 {
199 is.kanji.entry
200 { add.kanji.period write$ }
201 { add.period$ " " * write$ }
202 if$
203 }
204 if$
205 }
206 if$
207 mid.sentence 'output.state :=
208 }
209 if$
210 s
211 }
212
213 FUNCTION {output}
214 { duplicate$ empty$
215 'pop$
216 'output.nonnull
217 if$
218 }
219
220 FUNCTION {output.check}
221 { 't :=
222 duplicate$ empty$
223 { pop$ "empty " t * " in " * cite$ * warning$ }
224 'output.nonnull
225 if$
226 }
227
228 FUNCTION {fin.entry}
229 {
230 is.kanji.entry
231 {is.honyaku
232 'skip$
233 {add.kanji.period}
234 if$}
235 {is.honyaku
236 'skip$
237 {add.period$}
238 if$}
239 if$
240 write$
241 newline$
242 }
243
244 FUNCTION {new.block}
245 { output.state before.all =
246 'skip$
247 { after.block 'output.state := }
248 if$
249 }
250
251 FUNCTION {new.sentence}
252 { output.state after.block =
253 'skip$
254 { output.state before.all =
255 'skip$
256 { after.sentence 'output.state := }
257 if$
258 }
259 if$
260 }
261
262 FUNCTION {new.block.checka}
263 { empty$
264 'skip$
265 'new.block
266 if$
267 }
268
269 FUNCTION {new.block.checkb}
270 { empty$
271 swap$ empty$
272 and
273 'skip$
274 'new.block
275 if$
276 }
277
278 FUNCTION {new.sentence.checka}
279 { empty$
280 'skip$
281 'new.sentence
282 if$
283 }
284
285 FUNCTION {new.sentence.checkb}
286 { empty$
287 swap$ empty$
288 and
289 'skip$
290 'new.sentence
291 if$
292 }
293
294 FUNCTION {field.or.null}
295 { duplicate$ empty$
296 { pop$ "" }
297 'skip$
298 if$
299 }
300
301 FUNCTION {emphasize}
302 { duplicate$ empty$
303 { pop$ "" }
304 % { duplicate$ is.kanji.str$
305 { duplicate$ is.kanji.str$ is.kanji.entry or
306 { "『" swap$ * "』" * }
307 {
308 % add.period$
309 "{\em " swap$ * ",} " *
310 }
311 if$
312 }
313 if$
314 }
315
316 %--------------------------%
317 % 著者名を整形する関数 %
318 %--------------------------%
319
320 INTEGERS { nameptr namesleft numnames }
321 FUNCTION {format.names}
322 { 's :=
323 #1 'nameptr :=
324 s num.names$ 'numnames :=
325 numnames 'namesleft :=
326
327 { namesleft #0 > }
328 {
329 s nameptr "{ff}{ll}" format.name$ is.kanji.str$
330 {s nameptr "{ff}{ll}" format.name$ 't :=}
331 { nameptr #1 >
332 %%% { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=}
333 %%% { s nameptr "{ll,}{~ff}{~vv}{, jj}" format.name$ 't :=}
334 { s nameptr "{f.~}{v~}{ll}{, jj}" format.name$ 't :=}
335 { s nameptr "{ll}{,~f.}{v}{, jj}" format.name$ 't :=}
336 if$
337 }
338 if$
339
340 nameptr #1 >
341 { namesleft #1 >
342 { s is.kanji.str$
343 { "・" * t * }
344 { ", " * t * }
345 if$
346 }
347 {
348 t "others" =
349 {
350 s is.kanji.str$
351 { "ほか" * }
352 { " et~al." *}
353 if$
354 }
355 {
356 s is.kanji.str$
357 {"・" * t * }
358 {
359 numnames #2 =
360 { " \& " * }
361 { ", \& " *}
362 if$
363 t *
364 }
365 if$
366 }
367 if$
368 }
369 if$
370 }
371 't
372 if$
373 nameptr #1 + 'nameptr :=
374 namesleft #1 - 'namesleft :=
375 }
376 while$
377 }
378 FUNCTION {format.names.ed}
379 { 's :=
380 #1 'nameptr :=
381 s num.names$ 'numnames :=
382 numnames 'namesleft :=
383
384 { namesleft #0 > }
385 {
386 s nameptr "{ff}{ll}" format.name$ is.kanji.str$
387 {s nameptr "{ff}{ll}" format.name$ 't :=}
388 %%% { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=}
389 { s nameptr "{f.~}{v~}{ll}{, jj}" format.name$ 't :=}
390 if$
391 nameptr #1 >
392 { namesleft #1 >
393 { s is.kanji.str$
394 { "・" * t * }
395 { ", " * t * }
396 if$
397 }
398 {
399 t "others" =
400 {
401 s is.kanji.str$
402 { "ほか" * }
403 { " et~al." *}
404 if$
405 }
406 {
407 s is.kanji.str$
408 {"・" * t * }
409 {
410 numnames #2 =
411 { " \& " * }
412 { ", \& " *}
413 if$
414 t *
415 }
416 if$
417 }
418 if$
419 }
420 if$
421 }
422 't
423 if$
424 nameptr #1 + 'nameptr :=
425 namesleft #1 - 'namesleft :=
426 }
427 while$
428 }
429
430 FUNCTION {format.authors}
431 { author empty$
432 { "" }
433 {
434 extra.label.bysame "bysame" =
435 {"\bysame "}
436 { author format.names }
437 if$
438 }
439 if$
440 }
441
442 INTEGERS {bysame.check}
443 FUNCTION {format.editors}
444 { editor empty$
445 { "" }
446 {
447 #0 'bysame.check :=
448 type$ "incollection" =
449 type$ "inbook" =
450 or
451 { editor format.names.ed }
452 {
453 extra.label.bysame "bysame" =
454 {
455 #1 'bysame.check :=
456 "\bysame "
457 }
458 { editor format.names }
459 if$
460 }
461 if$
462
463 hentyo empty$
464 {"編" 't :=}
465 {
466 editor hentyo =
467 {"編著" 't :=}
468 {"編" 't :=}
469 if$
470 }
471 if$
472
473 #1 bysame.check =
474 { "" *}
475 {
476 editor num.names$ #1 >
477 {
478 editor is.kanji.str$
479 {t * }
480 { " eds." * }
481 if$
482 }
483 {
484 editor is.kanji.str$
485 {t *}
486 { " ed." * }
487 if$
488 }
489 if$
490 }
491 if$
492 }
493 if$
494 }
495
496 %----------------------%
497 % その他の整形関数 %
498 %----------------------%
499
500
501 FUNCTION {format.title}
502 { title empty$
503 { "" }
504 { title is.kanji.str$
505 { "「" title * "」" * }
506 { " ``" title * ",'' " * }
507 % title add.period$
508 % " ``" swap$ * "'' " *
509 if$
510 }
511 if$
512 }
513
514 FUNCTION {format.misc.title}
515 { title empty$
516 { "" }
517 { title is.kanji.str$
518 { "「" title * "」" * }
519 { " ``" title * ",'' " *
520 }
521 if$
522 }
523 if$
524 }
525
526 INTEGERS { start.or.end }
527 FUNCTION {n.dashify}
528 {
529 't :=
530 ""
531 % 初ページ, 終ページの初期化
532 #0 'start.or.end :=
533 "" 'str.p.start :=
534 "" 'str.p.end :=
535 % 初ページ, 終ページの取得
536 { t empty$ not }
537 { t #1 #1 substring$ "-" =
538 {
539 #1 'start.or.end :=
540 t #2 global.max$ substring$ 't :=
541 }
542 { start.or.end
543 {
544 str.p.end t #1 #1 substring$ * 'str.p.end :=
545 t #2 global.max$ substring$ 't :=
546 }
547 {
548 str.p.start t #1 #1 substring$ * 'str.p.start :=
549 t #2 global.max$ substring$ 't :=
550 }
551 if$
552 }
553 if$
554 }
555 while$
556 % str.p.start * "--" * str.p.end * % そのまま書き出す場合
557 % ページ数の記載を省略(後ろのページ数は前のページ数と異なる桁だけ表記)
558 str.p.start text.length$ str.p.end text.length$ =
559 {
560 str.p.start 'str.a :=
561 str.p.end 'str.b :=
562 { str.a empty$ not }
563 { str.a #1 #1 substring$ str.b #1 #1 substring$ =
564 {
565 str.a #2 global.max$ substring$ 'str.a :=
566 str.b #2 global.max$ substring$ 'str.b :=
567 }
568 {
569 str.b 'str.p.end :=
570 "" 'str.a :=
571 }
572 if$
573 }
574 while$
575 }
576 { skip$ }
577 if$
578 start.or.end #1 =
579 {str.p.start * "--" * str.p.end *}
580 { str.p.start * }
581 if$
582 }
583
584 FUNCTION {format.date}
585 { year empty$
586 { month empty$
587 { "" }
588 { "there's a month but no year or yyear in " cite$ * warning$
589 }
590 if$
591 }
592 { is.kanji.entry
593 { extra.label empty$
594 { ", ~" year * extra.label * ", " * }
595 { ", ~" year * "" * extra.label * ", " * }
596 % { " (\kanji " year * extra.label * ") " * }
597 % { " (\kanji " year * "\rensuji{" * extra.label * "}) " * }
598 if$
599 }
600 { ",\hspace{.3em}" year * extra.label * ", " * }
601 if$
602 }
603 if$
604 }
605
606 FUNCTION {format.btitle}
607 { title emphasize
608 }
609
610 FUNCTION {tie.or.space.connect}
611 { duplicate$ text.length$ #3 <
612 { "~" }
613 { " " }
614 if$
615 swap$ * *
616 }
617
618 FUNCTION {either.or.check}
619 { empty$ 'pop$
620 {"can't use both " swap$ * " fields in " * cite$ * warning$ }
621 if$
622 }
623
624 FUNCTION {format.bvolume}
625 { volume empty$
626 { "" }
627 { volume is.kanji.str$
628 { "第" volume * "巻, " *}
629 { is.kanji.entry
630 {"第 " volume * "巻, " *}
631 % {"第\kanji " volume * "巻、" *}
632 {"Vol." volume tie.or.space.connect}
633 if$
634 }
635 if$
636 series empty$
637 'skip$
638 { series is.kanji.str$
639 { series ", " * swap$ * }
640 { " of " * series emphasize * }
641 if$
642 }
643 if$
644 "volume and number" number either.or.check
645 }
646 if$
647 }
648
649 FUNCTION {format.number.series}
650 { volume empty$
651 { number empty$
652 { series field.or.null }
653 { number is.kanji.str$
654 { " 第" number * "号, " * }
655 {"No." number tie.or.space.connect}
656 if$
657 series empty$
658 { "there's a number but no series in " cite$ * warning$ }
659 { series is.kanji.str$
660 { series ", " * swap$ * }
661 { " in " * series * }
662 if$
663 }
664 if$
665 }
666 if$
667 }
668 { "" }
669 if$
670 }
671
672 FUNCTION {format.edition}
673 { edition empty$
674 { "" }
675 { edition is.kanji.str$
676 { ", 第" edition * "版" * }
677 % { "、第" edition * "版、" * }
678 { is.kanji.entry
679 {", 第" edition * "版" *}
680 % {"、第" edition * "版、" *}
681 { output.state mid.sentence =
682 { edition "l" change.case$ ". edition" * }
683 { edition "t" change.case$ ". edition" * }
684 if$
685 }
686 if$
687 }
688 if$
689 }
690 if$
691 }
692
693 INTEGERS { multiresult }
694
695 FUNCTION {multi.page.check}
696 { 't :=
697 #0 'multiresult :=
698 { multiresult not
699 t empty$ not
700 and
701 }
702 { t #1 #1 substring$
703 duplicate$ "-" =
704 swap$ duplicate$ "," =
705 swap$ "+" =
706 or or
707 { #1 'multiresult := }
708 { t #2 global.max$ substring$ 't := }
709 if$
710 }
711 while$
712 multiresult
713 }
714
715 FUNCTION {format.pages}
716 { pages empty$
717 { "" }
718 { pages is.kanji.str$
719 % { pages "頁" * }
720 { pages "" * }
721 { is.kanji.entry
722 { pages multi.page.check
723 % { "" pages n.dashify * "頁" * }
724 { "" pages n.dashify * "" * }
725 % { "" pages n.dashify * "頁" * }
726 { "" pages n.dashify * "" * }
727 if$
728 }
729 { pages multi.page.check
730 % { "pp." pages n.dashify tie.or.space.connect }
731 { "" pages n.dashify tie.or.space.connect }
732 % { "p." pages tie.or.space.connect }
733 { "" pages tie.or.space.connect }
734 if$
735 }
736 if$
737 }
738 if$
739 }
740 if$
741 }
742
743 FUNCTION {format.vol.num.pages}
744 { volume empty$
745 {"" *}
746 { "" volume * }
747 if$
748 number empty$
749 {"" *}
750 { "(" * number * ")" * }
751 if$
752 pages empty$
753 'skip$
754 { duplicate$ empty$
755 { pop$ format.pages }
756 {
757 % is.kanji.entry
758 % {":" * format.pages *}
759 % {
760 ": " * format.pages *
761 % }
762 % if$
763 }
764 if$
765 }
766 if$
767 }
768
769 FUNCTION {format.chapter.pages}
770 { chapter empty$
771 'format.pages
772 { type empty$
773 { chapter is.kanji.str$
774 { "" }
775 { is.kanji.entry
776 {"章"}
777 {"ch."}
778 if$
779 }
780 if$
781 }
782 { type "l" change.case$ }
783 if$
784 chapter is.kanji.str$ not is.kanji.entry and
785 {"第 " chapter * swap$ *}
786 % {"第\kanji " chapter * swap$ *}
787 { chapter is.kanji.str$ is.kanji.entry and
788 {"第" chapter * "章" * * }
789 {chapter tie.or.space.connect}
790 if$
791 }
792 if$
793 pages empty$
794 'skip$
795 { is.kanji.entry
796 { ", " * format.pages * }
797 { ", " * format.pages * }
798 if$
799 }
800 if$
801 }
802 if$
803 }
804
805 FUNCTION {format.in.ed.booktitle}
806 { booktitle empty$
807 { "" }
808 { editor empty$
809 { booktitle is.kanji.str$
810 { " " booktitle emphasize * }
811 { " " booktitle emphasize * }
812 if$
813 }
814 { booktitle is.kanji.str$
815 { "" format.editors * booktitle emphasize * }
816 { " " format.editors * ", " * booktitle emphasize * }
817 if$
818 }
819 if$
820 }
821 if$
822 }
823
824 FUNCTION {format.address}
825 { address empty$
826 { "" }
827 { is.kanji.entry
828 { address ":" * }
829 { address ": " * }
830 if$
831 }
832 if$
833 }
834
835 FUNCTION {empty.misc.check}
836 { author empty$ title empty$ howpublished empty$
837 month empty$ year empty$ note empty$
838 and and and and and
839 key empty$ not and
840 { "all relevant fields are empty in " cite$ * warning$ }
841 'skip$
842 if$
843 }
844
845 FUNCTION {format.thesis.type}
846 { type empty$
847 'skip$
848 { pop$
849 type "t" change.case$
850 }
851 if$
852 }
853
854 FUNCTION {format.tr.number}
855 { type empty$
856 { "Technical Report" }
857 'type
858 if$
859 number empty$
860 { "t" change.case$ }
861 { number tie.or.space.connect }
862 if$
863 }
864
865 FUNCTION {format.article.crossref}
866 { key empty$
867 { journal empty$
868 { "need key or journal for " cite$ * " to crossref " * crossref *
869 warning$
870 ""
871 }
872 { title is.kanji.str$
873 { "『" journal * "』" * }
874 { " {\em " journal * "\/} " * }
875 if$
876 }
877 if$
878 }
879 { title is.kanji.str$
880 { " " key * }
881 { " " key * }
882 if$
883 }
884 if$
885 " \cite{" * crossref * "}" *
886 }
887
888 FUNCTION {format.crossref.editor}
889 { editor format.names.ed }
890
891 FUNCTION {format.book.crossref}
892 { volume empty$
893 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
894 title is.kanji.str$
895 {" "} {" "} if$
896 }
897 { volume is.kanji.str$
898 { volume }
899 { is.kanji.entry
900 {"第 " volume * "巻" *}
901 % {"第\kanji " volume * "巻" *}
902 {"Vol." volume tie.or.space.connect " of " * }
903 if$
904 }
905 if$
906 }
907 if$
908 editor empty$
909 editor field.or.null author field.or.null =
910 or
911 { key empty$
912 { series empty$
913 { "need editor, key, or series for " cite$ * " to crossref " *
914 crossref * warning$
915 "" *
916 }
917 { series is.kanji.str$
918 { "『" series * "』, " * swap$ * }
919 { "{\em " * series * "\/} " * }
920 if$
921 }
922 if$
923 }
924 { key * }
925 if$
926 }
927 { format.crossref.editor * }
928 if$
929 " \cite{" * crossref * "}" *
930 }
931
932 FUNCTION {format.incoll.inproc.crossref}
933 { editor empty$
934 editor field.or.null author field.or.null =
935 or
936 { key empty$
937 { booktitle empty$
938 { "need editor, key, or booktitle for " cite$ * " to crossref " *
939 crossref * warning$
940 ""
941 }
942 { booktitle is.kanji.str$
943 { booktitle emphasize }
944 {" {\em " booktitle * "\/} " * }
945 if$
946 }
947 if$
948 }
949 { "" key * }
950 if$
951 }
952 {
953 "" format.crossref.editor *
954 is.kanji.entry
955 {
956 hentyo empty$
957 { "編 " * }
958 { "編著 " * }
959 if$
960 }
961 {
962 editor num.names$ #1 >
963 {" eds., " *}
964 {" ed., " *}
965 if$
966 }
967 if$
968 booktitle is.kanji.str$
969 { booktitle emphasize * ", " *}
970 {
971 " {\em " *
972 booktitle *
973 "},\/ " *
974 }
975 % {" {\em " booktitle * "\/} " * }
976 if$
977 address empty$
978 {"" *}
979 {address * ": " *}
980 if$
981 publisher empty$
982 {"" * }
983 {publisher *}
984 if$
985 is.kanji.entry
986 {", ~" *}
987 {", " * }
988 if$
989 }
990 if$
991 % " \cite{" * crossref * "}" *
992 }
993
994 FUNCTION {format.in.period}
995 { is.kanji.entry
996 { ", ~" * }
997 { ", " * }
998 if$
999 }
1000
1001 FUNCTION {format.hoyakusho}
1002 {
1003 jauthor empty$ % is.honyaku変数のセット
1004 jkanyaku empty$ % fin.entry時にこの変数を参照し、
1005 jtitle empty$ % ピリオドを付与を制御
1006 jpublisher empty$
1007 jyear empty$
1008 and and and and
1009 'skip$
1010 { #1 'is.honyaku := }
1011 if$
1012
1013 jauthor empty$
1014 jkanyaku empty$
1015 jtitle empty$
1016 jpublisher empty$
1017 jyear empty$
1018 and and and and
1019 { "" }
1020 { add.period$
1021 jyear empty$
1022 { "(" * }
1023 { "(=" * jyear * ", " * }
1024 if$
1025 jauthor empty$
1026 { jkanyaku empty$
1027 { "" * }
1028 { jkanyaku format.names
1029 "監訳" *
1030 }
1031 if$
1032 }
1033 { jauthor format.names
1034 "訳" *
1035 }
1036 if$
1037 jtitle empty$
1038 { "" * }
1039 { jtitle emphasize * }
1040 if$
1041 jpublisher empty$
1042 { "" * }
1043 { jpublisher * }
1044 if$
1045 % jyear empty$
1046 % { "" * }
1047 % { jyear is.kanji.str$
1048 % { jyear * "年" * }
1049 % { "" * jyear * "年" * }
1050 % if$
1051 % }
1052 % if$
1053 % add.kanji.period
1054 % "(=" swap$ * ")" *
1055 % add.kanji.period
1056 ".~)" *
1057 }
1058 if$
1059 }
1060
1061 FUNCTION {format.book.pages}
1062 { pages empty$
1063 { "" }
1064 { pages is.kanji.str$
1065 { pages "" * }
1066 { is.kanji.entry
1067 { " " pages * }
1068 { "" pages *}
1069 if$
1070 }
1071 if$
1072 }
1073 if$
1074 }
1075
1076 FUNCTION {article}
1077 { output.bibitem
1078 format.authors "author" output.check
1079 format.date "year" output.check
1080 format.title "title" output.check
1081 crossref missing$
1082 { journal emphasize "journal" output.check
1083 format.vol.num.pages output
1084 }
1085 { format.article.crossref output.nonnull
1086 format.pages output
1087 }
1088 if$
1089 new.block
1090 note output
1091 fin.entry
1092 }
1093
1094 %--------------------------------%
1095 % 文献タイプ名と同名の関数群 %
1096 %--------------------------------%
1097
1098 FUNCTION {book}
1099 { output.bibitem
1100 author empty$
1101 { format.editors "author and editor" output.check }
1102 { format.authors output.nonnull
1103 crossref missing$
1104 { "author and editor" editor either.or.check }
1105 'skip$
1106 if$
1107 }
1108 if$
1109
1110 format.date "year" output.check
1111 format.btitle "title" output.check
1112 crossref missing$
1113 { format.bvolume output
1114 format.number.series output
1115 format.address output
1116 publisher "publisher" output.check
1117 }
1118 { format.book.crossref output.nonnull
1119 }
1120 if$
1121 format.edition output
1122 format.book.pages output
1123 format.hoyakusho output
1124 new.block
1125 note output
1126 fin.entry
1127 }
1128
1129 FUNCTION {booklet}
1130 { output.bibitem
1131 format.authors output
1132 format.date output
1133 format.misc.title "title" output.check
1134 howpublished output
1135 address output
1136 new.block
1137 note output
1138 fin.entry
1139 }
1140
1141 FUNCTION {inbook}
1142 { output.bibitem
1143 author empty$
1144 { format.editors "author and editor" output.check }
1145 { format.authors output.nonnull
1146 crossref missing$
1147 { "author and editor" editor either.or.check }
1148 'skip$
1149 if$
1150 }
1151 if$
1152 format.date "year" output.check
1153 format.btitle "title" output.check
1154 crossref missing$
1155 { format.bvolume output
1156 format.chapter.pages "chapter and pages" output.check
1157 format.number.series output
1158 format.address output
1159 publisher "publisher" output.check
1160 }
1161 { format.chapter.pages "chapter and pages" output.check
1162 format.book.crossref output.nonnull
1163 }
1164 if$
1165 format.edition output
1166 new.block
1167 note output
1168 fin.entry
1169 }
1170
1171 FUNCTION {incollection}
1172 { output.bibitem
1173 format.authors "author" output.check
1174 format.date "year" output.check
1175 format.title "title" output.check
1176 crossref missing$
1177 { format.in.ed.booktitle "booktitle" output.check
1178 format.bvolume output
1179 format.number.series output
1180 format.address output
1181 publisher empty$
1182 { ", ~" }
1183 { publisher format.in.period }
1184 if$
1185 output.nonnull
1186 format.edition output
1187 format.chapter.pages output
1188 }
1189 { format.incoll.inproc.crossref output.nonnull
1190 format.chapter.pages output
1191 }
1192 if$
1193 new.block
1194 note output
1195 fin.entry
1196 }
1197
1198 FUNCTION {inproceedings}
1199 { output.bibitem
1200 format.authors "author" output.check
1201 format.date "year" output.check
1202 format.title "title" output.check
1203 crossref missing$
1204 { format.in.ed.booktitle "booktitle" output.check
1205 format.bvolume output
1206 format.number.series output
1207 address empty$
1208 { organization publisher new.sentence.checkb
1209 organization output
1210 publisher output
1211 }
1212 { address output.nonnull
1213 organization output
1214 publisher output
1215 }
1216 if$
1217 }
1218 { format.incoll.inproc.crossref output.nonnull
1219 format.pages output
1220 }
1221 if$
1222 new.block
1223 note output
1224 fin.entry
1225 }
1226
1227 FUNCTION {conference} { inproceedings }
1228
1229 FUNCTION {manual}
1230 { output.bibitem
1231 author empty$
1232 { organization empty$
1233 'skip$
1234 { organization output.nonnull
1235 address output
1236 }
1237 if$
1238 }
1239 { format.authors output.nonnull }
1240 if$
1241 format.date output
1242 format.btitle "title" output.check
1243 author empty$
1244 { organization empty$
1245 { address new.block.checka
1246 address output
1247 }
1248 'skip$
1249 if$
1250 }
1251 { organization address new.block.checkb
1252 organization output
1253 address output
1254 }
1255 if$
1256 format.edition output
1257 new.block
1258 note output
1259 fin.entry
1260 }
1261
1262 FUNCTION {mastersthesis}
1263 { output.bibitem
1264 format.authors "author" output.check
1265 format.date "year" output.check
1266 format.title "title" output.check
1267 % "Master's thesis" format.thesis.type output.nonnull
1268 school "school" output.check
1269 school is.kanji.str$
1270 {"修士論文" format.thesis.type output.nonnull}
1271 {"Master's thesis" format.thesis.type output.nonnull}
1272 if$
1273 address output
1274 new.block
1275 note output
1276 fin.entry
1277 }
1278
1279 FUNCTION {phdthesis}
1280 { output.bibitem
1281 format.authors "author" output.check
1282 format.date "year" output.check
1283 format.title "title" output.check
1284 % format.phd
1285 % format.thesis.type output.nonnull
1286 school "school" output.check
1287 school is.kanji.str$
1288 {"博士論文" format.thesis.type output.nonnull}
1289 {"Ph.D. dissertation" format.thesis.type output.nonnull}
1290 if$
1291 address output
1292 new.block
1293 note output
1294 fin.entry
1295 }
1296
1297 FUNCTION {misc}
1298 { output.bibitem
1299 format.authors output
1300 format.date output
1301 format.misc.title output
1302 howpublished output
1303 % new.block
1304 note output
1305 fin.entry
1306 empty.misc.check
1307 }
1308
1309 FUNCTION {proceedings}
1310 { output.bibitem
1311 editor empty$
1312 { organization output }
1313 { format.editors output.nonnull }
1314 if$
1315 format.date "year" output.check
1316 format.btitle "title" output.check
1317 format.bvolume output
1318 format.number.series output
1319 address empty$
1320 { editor empty$
1321 { publisher new.sentence.checka }
1322 { organization publisher new.sentence.checkb
1323 organization output
1324 }
1325 if$
1326 publisher output
1327 }
1328 { format.address output.nonnull
1329 editor empty$
1330 'skip$
1331 { organization output }
1332 if$
1333 publisher output
1334 }
1335 if$
1336 new.block
1337 note output
1338 fin.entry
1339 }
1340
1341 FUNCTION {techreport}
1342 { output.bibitem
1343 format.authors "author" output.check
1344 format.date "year" output.check
1345 format.title "title" output.check
1346 format.tr.number output.nonnull
1347 institution "institution" output.check
1348 address output
1349 new.block
1350 note output
1351 fin.entry
1352 }
1353
1354 FUNCTION {unpublished}
1355 { output.bibitem
1356 format.authors "author" output.check
1357 format.date output
1358 format.title "title" output.check
1359 note "note" output.check
1360 fin.entry
1361 }
1362
1363 FUNCTION {default.type} { misc }
1364
1365 MACRO {jan} {"January"}
1366
1367 MACRO {feb} {"February"}
1368
1369 MACRO {mar} {"March"}
1370
1371 MACRO {apr} {"April"}
1372
1373 MACRO {may} {"May"}
1374
1375 MACRO {jun} {"June"}
1376
1377 MACRO {jul} {"July"}
1378
1379 MACRO {aug} {"August"}
1380
1381 MACRO {sep} {"September"}
1382
1383 MACRO {oct} {"October"}
1384
1385 MACRO {nov} {"November"}
1386
1387 MACRO {dec} {"December"}
1388
1389 READ
1390
1391 FUNCTION {set.is.kanji.entry}
1392 {
1393 author field.or.null is.kanji.str$
1394 title field.or.null is.kanji.str$ or
1395 editor field.or.null is.kanji.str$ or
1396 journal field.or.null is.kanji.str$ or
1397 booktitle field.or.null is.kanji.str$ or
1398 series field.or.null is.kanji.str$ or
1399 'is.kanji.entry :=
1400 }
1401
1402 ITERATE {set.is.kanji.entry}
1403
1404 INTEGERS { author.field editor.field organization.field title.field key.field }
1405
1406 FUNCTION {init.field.constants}
1407 { #0 'author.field :=
1408 #1 'editor.field :=
1409 #2 'organization.field :=
1410 #3 'title.field :=
1411 #4 'key.field :=
1412 }
1413
1414 EXECUTE {init.field.constants}
1415
1416 FUNCTION {sortify}
1417 { purify$
1418 "l" change.case$
1419 }
1420
1421 INTEGERS { len }
1422
1423 FUNCTION {chop.word}
1424 { 's :=
1425 'len :=
1426 s #1 len substring$ =
1427 { s len #1 + global.max$ substring$ }
1428 's
1429 if$
1430 }
1431
1432 INTEGERS { et.al.char.used }
1433
1434 FUNCTION {initialize.et.al.char.used}
1435 { #0 'et.al.char.used :=
1436 }
1437
1438 EXECUTE {initialize.et.al.char.used}
1439
1440 %----------------------------%
1441 % 著者名ラベルの整形関数 %
1442 %----------------------------%
1443
1444 FUNCTION {format.lab.names}
1445 { 's :=
1446 s num.names$ 'numnames :=
1447 numnames #2 > % 3人以上の場合
1448 { s is.kanji.str$
1449 { s #1 "{ff}" format.name$ 't :=
1450 t empty$
1451 { s #1 "{ll}" format.name$}
1452 { s #1 "{ff}" format.name$}
1453 if$
1454 "ほか" * }
1455 { s #1 "{ll}" format.name$
1456 " et~al." * }
1457 if$
1458 }
1459 { numnames #2 = % 2人の場合
1460 { s is.kanji.str$ % 漢字著者の場合
1461 { s #1 "{ff}{vv}{ll}{jj}" format.name$ 't := % 1人め
1462 t is.kanji.str$
1463 {
1464 s #1 "{ff}" format.name$ 't :=
1465 t empty$
1466 { s #1 "{ll}" format.name$}
1467 { s #1 "{ff}" format.name$}
1468 if$
1469 }
1470 { s #1 "{ll}" format.name$}
1471 if$
1472 s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =% 2人目
1473 {"ほか" *}
1474 { "・" *
1475 s #2 "{ff}{vv}{ll}{jj}" format.name$ 't :=
1476 t is.kanji.str$
1477 {
1478 s #2 "{ff}" format.name$ 't :=
1479 t empty$
1480 { s #2 "{ll}" format.name$ *}
1481 { s #2 "{ff}" format.name$ *}
1482 if$
1483 }
1484 {s #2 "{ll}" format.name$ *}
1485 if$
1486 }
1487 if$
1488 }
1489 { s #1 "{ll}" format.name$
1490 s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1491 { " et~al." * }
1492 { " \& " *
1493 s #2 "{ll}" format.name$ *}
1494 if$
1495 }
1496 if$
1497 }
1498 { s is.kanji.str$
1499 { s #1 "{ff}" format.name$ 't :=
1500 t empty$
1501 { s #1 "{ll}" format.name$}
1502 { s #1 "{ff}" format.name$}
1503 if$
1504 }
1505 { s #1 "{ll}" format.name$ }
1506 if$
1507 }
1508 if$
1509 }
1510 if$
1511 author empty$
1512 {
1513 is.kanji.entry
1514 {"編" * }
1515 { numnames #1 >
1516 {" eds." *}
1517 {" ed." *}
1518 if$
1519 }
1520 if$
1521 }
1522 'skip$
1523 if$
1524 }
1525
1526 FUNCTION {format.lab.names.full}
1527 { 's :=
1528 "" 't :=
1529 s num.names$ 'numnames :=
1530 numnames #2 >
1531 {
1532 s is.kanji.str$
1533 {
1534 s #1 "{ff}{ll}" format.name$
1535 "ほか" *
1536 }
1537 {
1538 s #1 "{ll,}{~f.}{v}{, jj}" format.name$
1539 " et~al." *
1540 }
1541 if$
1542 }
1543 {
1544 numnames #2 =
1545 {
1546 s is.kanji.str$
1547 {
1548 s #1 "{ff}{ll}" format.name$
1549 s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1550 { "ほか" * }
1551 {
1552 "・" *
1553 s #2 "{ff}{ll}" format.name$ *
1554 }
1555 if$
1556 }
1557 {
1558 s #1 "{ll,}{~f.}{v}{, jj}" format.name$
1559 s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1560 {
1561 " et~al." *
1562 }
1563 {
1564 " \& " *
1565 s #2 "{ll,}{~f.}{v}{, jj}" format.name$ *
1566 }
1567 if$
1568 }
1569 if$
1570 }
1571 {
1572 s is.kanji.str$
1573 { s #1 "{ff}{ll}" format.name$ }
1574 { s #1 "{ll,}{~f.}{v}{, jj}" format.name$ }
1575 if$
1576 }
1577 if$
1578 }
1579 if$
1580 author empty$
1581 {
1582 is.kanji.entry
1583 {"編" * }
1584 { numnames #1 >
1585 {" eds." *}
1586 {" ed." *}
1587 if$
1588 }
1589 if$
1590 }
1591 'skip$
1592 if$
1593 }
1594
1595 INTEGERS {is.making.pure}
1596 STRINGS {hoka.kh}
1597 FUNCTION {format.lab.names.full.ff}
1598 {'s :=
1599 "" 't :=
1600 is.making.pure #2 =
1601 {"" 'hoka.kh :=}
1602 {
1603 s is.kanji.str$
1604 {"ほか" 'hoka.kh :=}
1605 {" et~al." 'hoka.kh :=}
1606 if$
1607 }
1608 if$
1609 s num.names$ 'numnames :=
1610 numnames #2 >
1611 {
1612 s is.kanji.str$
1613 {
1614 s #1 "{ff}{ll}" format.name$
1615 hoka.kh *
1616 }
1617 {
1618 %%% s #1 "{ff~}{vv~}{ll}{, jj}" format.name$
1619 s #1 "{f.~}{v~}{ll}{, jj}" format.name$
1620 hoka.kh *
1621 }
1622 if$
1623 }
1624 {
1625 numnames #2 =
1626 {
1627 s is.kanji.str$
1628 {
1629 s #1 "{ff}{ll}" format.name$
1630 s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1631 { t hoka.kh * 't :=}
1632 {
1633 t "・" * 't :=
1634 t s #2 "{ff}{ll}" format.name$ * 't :=
1635 }
1636 if$
1637 t *
1638 }
1639 {
1640 %%% s #1 "{ff~}{vv~}{ll}{, jj}" format.name$
1641 s #1 "{f.~}{v~}{ll}{, jj}" format.name$
1642 s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1643 {
1644 hoka.kh *
1645 }
1646 {
1647 " \& " *
1648 %%% s #2 "{ff~}{vv~}{ll}{, jj}" format.name$ *
1649 s #2 "{f.~}{v~}{ll}{, jj}" format.name$ *
1650 }
1651 if$
1652 }
1653 if$
1654 }
1655 {
1656 s is.kanji.str$
1657 { s #1 "{ff}{ll}" format.name$ }
1658 %%% { s #1 "{ff~}{vv~}{ll}{, jj}" format.name$ }
1659 { s #1 "{f.~}{v~}{ll}{, jj}" format.name$ }
1660 if$
1661 }
1662 if$
1663 }
1664 if$
1665
1666 is.making.pure #2 =
1667 'skip$
1668 {
1669 author empty$
1670 {
1671 is.kanji.entry
1672 {"編" * }
1673 { numnames #1 >
1674 {" eds." *}
1675 {" ed." *}
1676 if$
1677 }
1678 if$
1679 }
1680 'skip$
1681 if$
1682 }
1683 if$
1684
1685 }
1686
1687 FUNCTION {author.key.label}
1688 { author empty$
1689 { key empty$
1690 { cite$ #1 #3 substring$ }
1691 { key #3 text.prefix$ }
1692 if$
1693 }
1694 { author format.lab.names }
1695 if$
1696 }
1697
1698 FUNCTION {author.key.label.full}
1699 {
1700 author empty$
1701 {
1702 key empty$
1703 { cite$ #1 #3 substring$ }
1704 { key #3 text.prefix$ }
1705 if$
1706 }
1707 { author format.lab.names.full }
1708 if$
1709 }
1710
1711 FUNCTION {author.key.label.full.ff}
1712 {
1713 author empty$
1714 {
1715 key empty$
1716 { cite$ #1 #3 substring$ }
1717 { key #3 text.prefix$ }
1718 if$
1719 }
1720 { author format.lab.names.full.ff }
1721 if$
1722 }
1723
1724 FUNCTION {author.editor.key.label}
1725 { author empty$
1726 { editor empty$
1727 { key empty$
1728 { cite$ #1 #3 substring$ }
1729 { key #3 text.prefix$ }
1730 if$
1731 }
1732 { editor format.lab.names }
1733 if$
1734 }
1735 { author format.lab.names }
1736 if$
1737 }
1738
1739 FUNCTION {author.editor.key.label.full}
1740 { author empty$
1741 { editor empty$
1742 { key empty$
1743 { cite$ #1 #3 substring$ }
1744 { key #3 text.prefix$ }
1745 if$
1746 }
1747 { editor format.lab.names.full }
1748 if$
1749 }
1750 { author format.lab.names.full }
1751 if$
1752 }
1753
1754 FUNCTION {author.editor.key.label.full.ff}
1755 { author empty$
1756 { editor empty$
1757 { key empty$
1758 { cite$ #1 #3 substring$ }
1759 { key #3 text.prefix$ }
1760 if$
1761 }
1762 { editor format.lab.names.full.ff }
1763 if$
1764 }
1765 { author format.lab.names.full.ff }
1766 if$
1767 }
1768
1769
1770 FUNCTION {author.key.organization.label}
1771 { author empty$
1772 { key empty$
1773 { organization empty$
1774 { cite$ #1 #3 substring$ }
1775 { "The " #4 organization chop.word #3 text.prefix$ }
1776 if$
1777 }
1778 { key #3 text.prefix$ }
1779 if$
1780 }
1781 { author format.lab.names }
1782 if$
1783 }
1784
1785 FUNCTION {editor.key.organization.label}
1786 { editor empty$
1787 { key empty$
1788 { organization empty$
1789 { cite$ #1 #3 substring$ }
1790 { "The " #4 organization chop.word #3 text.prefix$ }
1791 if$
1792 }
1793 { key #3 text.prefix$ }
1794 if$
1795 }
1796 { editor format.lab.names }
1797 if$
1798 }
1799
1800 FUNCTION {calc.label}
1801 { type$ "book" =
1802 type$ "inbook" =
1803 or
1804 'author.editor.key.label
1805 { type$ "proceedings" =
1806 'editor.key.organization.label
1807 { type$ "manual" =
1808 'author.key.organization.label
1809 'author.key.label
1810 if$
1811 }
1812 if$
1813 }
1814 if$
1815 duplicate$
1816 "" swap$ *
1817 "" year *
1818 'label :=
1819 % 翻訳書対策
1820 jyear empty$
1821 'skip$
1822 {
1823 label "=" jyear * * 'label :=
1824 }
1825 if$
1826 pop$
1827 }
1828
1829 FUNCTION {calc.label2}
1830 {
1831 type$ "book" =
1832 type$ "inbook" =
1833 or
1834 'author.editor.key.label.full
1835 {
1836 type$ "proceedings" =
1837 'editor.key.organization.label
1838 { type$ "manual" =
1839 'author.key.organization.label
1840 'author.key.label.full
1841 if$
1842 }
1843 if$
1844 }
1845 if$
1846 duplicate$
1847 "" swap$ *
1848 'label2 :=
1849 sortify label sortify label2 * 'sort.label :=
1850 pop$
1851 }
1852
1853 FUNCTION {calc.label3}
1854 { type$ "book" =
1855 type$ "inbook" =
1856 or
1857 'author.editor.key.label
1858 { type$ "proceedings" =
1859 'editor.key.organization.label
1860 { type$ "manual" =
1861 'author.key.organization.label
1862 'author.key.label
1863 if$
1864 }
1865 if$
1866 }
1867 if$
1868 duplicate$
1869 "" swap$ *
1870 'label3 :=
1871 pop$
1872 }
1873
1874 FUNCTION {calc.label4}
1875 {
1876 type$ "book" =
1877 type$ "inbook" =
1878 or
1879 'author.editor.key.label.full.ff
1880 {
1881 type$ "proceedings" =
1882 'editor.key.organization.label
1883 { type$ "manual" =
1884 'author.key.organization.label
1885 'author.key.label.full.ff
1886 if$
1887 }
1888 if$
1889 }
1890 if$
1891 duplicate$
1892 "" swap$ *
1893 'label4 :=
1894 label4 purify$ 'label.pure :=
1895 pop$
1896 }
1897
1898 FUNCTION {calc.label.pure}
1899 {
1900 #2 'is.making.pure :=
1901 type$ "book" =
1902 type$ "inbook" =
1903 or
1904 'author.editor.key.label.full.ff
1905 {
1906 type$ "proceedings" =
1907 'editor.key.organization.label
1908 { type$ "manual" =
1909 'author.key.organization.label
1910 'author.key.label.full.ff
1911 if$
1912 }
1913 if$
1914 }
1915 if$
1916 duplicate$
1917 "" swap$ *
1918 't :=
1919 t purify$ 'label.pure :=
1920 pop$
1921 #1 'is.making.pure :=
1922 }
1923
1924 FUNCTION {sort.format.names}
1925 {
1926 's :=
1927 yomi empty$
1928 'skip$
1929 { yomi 's := }
1930 if$
1931 ""
1932 #1 'nameptr :=
1933 s num.names$ 'numnames :=
1934 numnames 'namesleft :=
1935 { namesleft #0 > }
1936 {
1937 nameptr #1 >
1938 { ", " * }
1939 'skip$
1940 if$
1941 s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1942 nameptr numnames = t "others" = and
1943 { s is.kanji.str$
1944 {"ほか" * }
1945 {" et~al." *}
1946 if$
1947 }
1948 { t sortify * }
1949 if$
1950 nameptr #1 + 'nameptr :=
1951 namesleft #1 - 'namesleft :=
1952 }
1953 while$
1954 }
1955
1956 FUNCTION {sort.format.title}
1957 { 't :=
1958 "A " #2
1959 "An " #3
1960 "The " #4 t chop.word
1961 chop.word
1962 chop.word
1963 sortify
1964 #1 global.max$ substring$
1965 }
1966
1967 FUNCTION {author.sort}
1968 { author empty$
1969 { key empty$
1970 { "to sort, need author or key in " cite$ * warning$ "" }
1971 { key sortify }
1972 if$
1973 }
1974 { author sort.format.names }
1975 if$
1976 }
1977
1978 FUNCTION {author.editor.sort}
1979 { author empty$
1980 { editor empty$
1981 { key empty$
1982 { "to sort, need author, editor, or key in " cite$ * warning$
1983 ""
1984 }
1985 { key sortify }
1986 if$
1987 }
1988 { editor sort.format.names }
1989 if$
1990 }
1991 { author sort.format.names }
1992 if$
1993 }
1994
1995 FUNCTION {author.organization.sort}
1996 { author empty$
1997 { organization empty$
1998 { key empty$
1999 { "to sort, need author, organization, or key in " cite$ * warning$
2000 ""
2001 }
2002 { key sortify }
2003 if$
2004 }
2005 { "The " #4 organization chop.word sortify }
2006 if$
2007 }
2008 { author sort.format.names }
2009 if$
2010 }
2011
2012 FUNCTION {editor.organization.sort}
2013 { editor empty$
2014 { organization empty$
2015 { key empty$
2016 { "to sort, need editor, organization, or key in " cite$ * warning$
2017 ""
2018 }
2019 { key sortify }
2020 if$
2021 }
2022 { "The " #4 organization chop.word sortify }
2023 if$
2024 }
2025 { editor sort.format.names }
2026 if$
2027 }
2028
2029 FUNCTION {presort}
2030 { calc.label
2031 type$ "book" =
2032 type$ "inbook" =
2033 or
2034 'author.editor.sort
2035 {
2036 type$ "proceedings" =
2037 'editor.organization.sort
2038 {
2039 type$ "manual" =
2040 'author.organization.sort
2041 'author.sort
2042 if$
2043 }
2044 if$
2045 }
2046 if$
2047 't :=
2048 pop$
2049 author empty$
2050 {t " 2 " * 't :=}
2051 {t " 1 " * 't :=}
2052 if$
2053 t " " * 't :=
2054 t year field.or.null sortify * 't :=
2055 t " " * 't :=
2056 t title field.or.null sort.format.title * 't :=
2057 t 'sort.key$ :=
2058 }
2059
2060 FUNCTION {presort2}
2061 { calc.label2 }
2062
2063 FUNCTION {presort3}
2064 { calc.label3 }
2065
2066 FUNCTION {presort4}
2067 { calc.label4 }
2068
2069 FUNCTION {presort5}
2070 { calc.label.pure }
2071
2072 ITERATE {presort}
2073 ITERATE {presort2}
2074 ITERATE {presort3}
2075 ITERATE {presort4}
2076 ITERATE {presort5}
2077
2078 SORT
2079
2080 STRINGS { longest.label last.sort.label next.extra prev.author this.author}
2081
2082 INTEGERS { longest.label.width last.extra.num }
2083
2084 FUNCTION {initialize.longest.label}
2085 { "" 'longest.label :=
2086 #0 int.to.chr$ 'last.sort.label :=
2087 "" 'next.extra :=
2088 #0 'longest.label.width :=
2089 #0 'last.extra.num :=
2090 "" 'this.author :=
2091 }
2092
2093 % sort.labelが前回のものと同一であれば、extra.labelをセット
2094 % authorが前回のものと同一であれば、extra.label.bysameをセット
2095
2096 FUNCTION {forward.pass}
2097 { last.sort.label sort.label =
2098 { last.extra.num #1 + 'last.extra.num :=
2099 last.extra.num int.to.chr$ 'extra.label :=
2100 }
2101 { "a" chr.to.int$ 'last.extra.num :=
2102 "" 'extra.label :=
2103 sort.label 'last.sort.label :=
2104 }
2105 if$
2106
2107 author empty$
2108 { editor empty$
2109 { "" }
2110 'format.editors
2111 if$
2112 }
2113 'format.authors
2114 if$
2115 'this.author :=
2116
2117 % format.names 'this.author :=
2118 this.author prev.author =
2119 { "bysame" 'extra.label.bysame := }
2120 { this.author "" =
2121 { "abcxyz" }
2122 'this.author
2123 if$
2124 'prev.author :=
2125 }
2126 if$
2127 }
2128
2129 FUNCTION {reverse.pass}
2130 { next.extra "b" =
2131 { "a" 'extra.label := }
2132 'skip$
2133 if$
2134 extra.label empty$ not
2135 { label "" * extra.label * "" * }
2136 { label extra.label * "" * }
2137 if$
2138 "" field.or.null *
2139 'label :=
2140 label width$ longest.label.width >
2141 { label 'longest.label :=
2142 label width$ 'longest.label.width :=
2143 }
2144 'skip$
2145 if$
2146 extra.label 'next.extra :=
2147 }
2148
2149 EXECUTE {initialize.longest.label}
2150
2151 ITERATE {forward.pass}
2152
2153 REVERSE {reverse.pass}
2154
2155 FUNCTION{punctuation}
2156 {
2157 "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" write$ newline$
2158 "%" write$ newline$
2159 "% This bbl file is created through nissya.bst" write$ newline$
2160 "% nissya.bst is available at" write$ newline$
2161 "% <http://hey.to/KO-ichi>" write$ newline$
2162 "%" write$ newline$
2163 "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" write$ newline$
2164 newline$
2165 }
2166
2167 EXECUTE {punctuation}
2168
2169 FUNCTION {begin.bib}
2170 { et.al.char.used
2171 { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
2172 'skip$
2173 if$
2174 preamble$ empty$
2175 'skip$
2176 { preamble$ write$ newline$ }
2177 if$
2178 "\ifx\undefined\bysame" write$ newline$
2179 "\newcommand{\bysame}{\rule[.5ex]{4zw}{.15pt}}"
2180 write$ newline$
2181 "\fi" write$ newline$
2182 newline$
2183 "\begin{thebibliography}{xx}" write$ newline$
2184 }
2185
2186 EXECUTE {begin.bib}
2187
2188 EXECUTE {init.state.consts}
2189
2190 ITERATE {call.type$}
2191
2192 FUNCTION {end.bib}
2193 { newline$
2194 "\end{thebibliography}" write$ newline$
2195 }
2196
2197 EXECUTE {end.bib}