Debian Codegraph @

texmf-dist/bibtex/bst/hithesis/hithesis.bst

raw
1 %=============================================================================
2 % FileName: hithesis.bst
3 % Author: Chu Yanshuo
4 % Email: [email protected]
5 % HomePage: http://yanshuo.name
6 % Version: 0.0.1
7 % LastChange: 2017-08-27 15:39:30
8 % History: 胡海星
9 %=============================================================================
10 %
11 ENTRY % class Entry {
12 { % public:
13 author % String author;
14 editor % String editor;
15 translator % String translator;
16 title % String title;
17 edition % String edition;
18 address % String address;
19 publisher % String publisher;
20 pages % String pages;
21 year % String year;
22 date % String date;
23 modifydate % String modifydate;
24 citedate % String citedate;
25 url % String url;
26 doi % String doi;
27 language % String language;
28 booktitle % String booktitle;
29 journal % String journal;
30 chapter % String chapter;
31 series % String series;
32 volume % String volume;
33 number % String number;
34 version % String version;
35 month % String month;
36 school % String school;
37 institution % String institution;
38 organization % String organization;
39 type % String type;
40 howpublished % String howpublished;
41 eid % String eid;
42 key % String key;
43 country % String country;
44 patentid % String patentid;
45 media % String media;
46 } { % // declare integer variables
47 required % int required; // withther the bibfield is required
48 } { % // declare String variables
49 label % String label; // label for the entry
50 mark % String mark; // mark for the entry
51 % // there is ahidden entry variable sort.key$
52 % String sort_key;
53 } % }
54 %
55 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 %
57 INTEGERS { % // declare global int variables
58 entry.count % static int entry_count; // number of entries
59 longest.label.width % static int longest_label_width; // width of the longest label
60 i % static int i;
61 j % static int j;
62 k % static int k;
63 } %
64 %
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66 %
67 STRINGS { % // declare global String variables
68 longest.label % static String longest_label; // the longest label
69 s % static String s;
70 t % static String t;
71 } %
72 %
73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74
75 % define global static constants
76 FUNCTION {true} {#1}
77 FUNCTION {false} {#0}
78 FUNCTION {debug.enabled} {true}
79 FUNCTION {cap.volume.en} {"Vol~"}
80 FUNCTION {cap.volume.zh} {"卷"}
81 FUNCTION {cap.edition.en} {"~ed"}
82 FUNCTION {cap.edition.zh} {"版"}
83 FUNCTION {cap.anonymous.en} {"Anon"}
84 FUNCTION {cap.anonymous.zh} {"佚名"}
85 FUNCTION {cap.no.address.en} {"[S.l.]"}
86 FUNCTION {cap.no.address.zh} {"[出版地不详]"}
87 FUNCTION {cap.no.publisher.en} {"[s.n.]"}
88 FUNCTION {cap.no.publisher.zh} {"[出版者不详]"}
89 FUNCTION {cap.et.al.en} {", et~al"}
90 FUNCTION {cap.et.al.zh} {", 等"}
91 FUNCTION {cap.translate.en} {"~trans"}
92 FUNCTION {cap.translate.zh} {"译"}
93 FUNCTION {cap.doi.url} {"http://dx.doi.org/"}
94 FUNCTION {cap.st.en} {"st"}
95 FUNCTION {cap.nd.en} {"nd"}
96 FUNCTION {cap.rd.en} {"rd"}
97 FUNCTION {cap.th.en} {"th"}
98
99 FUNCTION {cap.space} {" "}
100 FUNCTION {cap.period} {"\@. "}
101 FUNCTION {cap.comma} {"\@, "}
102 FUNCTION {cap.colon} {"\thinspace{}\textnormal{: }"}
103 FUNCTION {cap.double.slash} {" //\thinspace{}"}
104 FUNCTION {cap.dash} {"\textnormal{-}"}
105
106 % Predefined latex command used to format the style of bibitems
107 FUNCTION {env.bibbegin} { "\begin{thebibliography}" }
108 FUNCTION {env.bibend} { "\end{thebibliography}" }
109 FUNCTION {cmd.bibauthor} { "\providecommand{\bibauthor}[1]{#1}" }
110 FUNCTION {cmd.bibeditor} { "\providecommand{\bibeditor}[1]{#1}" }
111 FUNCTION {cmd.bibtranslator} { "\providecommand{\bibtranslator}[1]{#1}" }
112 FUNCTION {cmd.bibtitle} { "\providecommand{\bibtitle}[1]{#1}" }
113 FUNCTION {cmd.bibbooktitle} { "\providecommand{\bibbooktitle}[1]{#1}" }
114 FUNCTION {cmd.bibjournal} { "\providecommand{\bibjournal}[1]{#1}" }
115 FUNCTION {cmd.bibmark} { "\providecommand{\bibmark}[1]{\mbox{#1}}" }
116 FUNCTION {cmd.bibcountry} { "\providecommand{\bibcountry}[1]{#1}" }
117 FUNCTION {cmd.bibpatentid} { "\providecommand{\bibpatentid}[1]{#1}" }
118 FUNCTION {cmd.bibedition} { "\providecommand{\bibedition}[1]{#1}" }
119 FUNCTION {cmd.biborganization} { "\providecommand{\biborganization}[1]{#1}" }
120 FUNCTION {cmd.bibaddress} { "\providecommand{\bibaddress}[1]{#1}" }
121 FUNCTION {cmd.bibpublisher} { "\providecommand{\bibpublisher}[1]{#1}" }
122 FUNCTION {cmd.bibinstitution} { "\providecommand{\bibinstitution}[1]{#1}" }
123 FUNCTION {cmd.bibschool} { "\providecommand{\bibschool}[1]{#1}" }
124 FUNCTION {cmd.bibvolume} { "\providecommand{\bibvolume}[1]{#1}" }
125 FUNCTION {cmd.bibnumber} { "\providecommand{\bibnumber}[1]{#1}" }
126 FUNCTION {cmd.bibversion} { "\providecommand{\bibversion}[1]{#1}" }
127 FUNCTION {cmd.bibpages} { "\providecommand{\bibpages}[1]{#1}" }
128 FUNCTION {cmd.bibmodifydate} { "\providecommand{\bibmodifydate}[1]{#1}" }
129 FUNCTION {cmd.bibcitedate} { "\providecommand{\bibcitedate}[1]{#1}" }
130 FUNCTION {cmd.bibyear} { "\providecommand{\bibyear}[1]{#1}" }
131 FUNCTION {cmd.bibdate} { "\providecommand{\bibdate}[1]{#1}" }
132 FUNCTION {cmd.biburl} { "\providecommand{\biburl}[1]{\newline\url{#1}}" }
133
134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
135 %
136 FUNCTION {log.str} { % void Entry::log_str(String value, String message)
137 debug.enabled { % if (debug_enabled == 1) {
138 "DEBUG: " swap$ * " - '" * % message = "DEBUG: " + message + " - '";
139 swap$ * % message = message + value;
140 "'" * % message = message + "'";
141 top$ % log(message);
142 } { % } else {
143 pop$ pop$ % return;
144 } if$ % }
145 } % }
146 %
147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
148 %
149 FUNCTION {log.int} { % int Entry::log_int(int value, String message)
150 debug.enabled { % if (debug_enabled == 1) {
151 "DEBUG: " swap$ * " - " * % message = "DEBUG: " + message + " - ";
152 swap$ int.to.str$ * % message = message + int_to_str(value);
153 top$ % log(message);
154 } { % } else {
155 pop$ pop$ % return;
156 } if$ % }
157 } % }
158 %
159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
160 %
161 FUNCTION {not} { % int Entry::not(int x) {
162 { % if (x == 1) {
163 false % return false;
164 } { % } else {
165 true % return true;
166 } if$ % }
167 } % }
168 %
169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
170 %
171 FUNCTION {and} { % int Entry::and(int x, int y) {
172 { % if (y == 1) {
173 skip$ % return x;
174 } { % } else {
175 pop$ false % return false;
176 } if$ % }
177 } % }
178 %
179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
180 %
181 FUNCTION {or} { % int Entry::or(int x, int y) {
182 { % if (y == 1) {
183 pop$ true % return true;
184 } { % } else {
185 skip$ % return x;
186 } if$ % }
187 } % }
188 %
189 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
190 % // calculate the length in characters of a string
191 % // We need this function since text.length$ is NOT
192 % // the length in characters.
193 INTEGERS {length.i} % static int length_i;
194 FUNCTION {length} { % int Entry::length(String str) {
195 duplicate$ empty$ { % if (empty(str)) {
196 pop$ #0 % return 0;
197 } { % } else {
198 #1 'length.i := % length_i = 1;
199 false % int stop = false;
200 {not} { % while (! stop) {
201 duplicate$ length.i #1 substring$ % String tmp = substring(str, length_i, 1);
202 "" = { % if (tmp == "") {
203 true % stop = true;
204 } { % } else {
205 length.i #1 + 'length.i := % length_i = length_i + 1;
206 false % stop = false;
207 } if$ % }
208 } while$ % }
209 pop$ length.i #1 - % return length_i - 1;
210 } if$ % }
211 } % }
212 %
213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
214 %
215 FUNCTION {is.digit} { % int Entry::is_digit(String ch) {
216 chr.to.int$ % int ascii = chr_to_int(ch);
217 duplicate$ "0" chr.to.int$ < { % if (ascii < chr_to_int("0")) {
218 pop$ false % return false;
219 } { % } else {
220 "9" chr.to.int$ > { % if (ascii > chr_to_int("9")) {
221 false % return false;
222 } { % } else {
223 true % return true;
224 } if$ % }
225 } if$ % }
226 } % }
227 %
228 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
229 % // test if str is a number
230 FUNCTION {is.number} { % int Entry::is_number(String str) {
231 duplicate$ empty$ not swap$ % int result = (! empty(str));
232 { duplicate$ empty$ not} { % while (! empty(str)) {
233 duplicate$ #1 #1 substring$ is.digit { % if (is_digit(substring(str, 1, 1))) {
234 #2 global.max$ substring$ % str = substring(str, 2, global_max);
235 } { % } else {
236 pop$ pop$ false % result = false;
237 "" % str = "";
238 } if$ % }
239 } while$ % }
240 pop$ % return result;
241 } % }
242 %
243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
244 % // extract the number prefix of str
245 FUNCTION {extract.number} { % String Entry::extract_number(String str) {
246 duplicate$ % String suffix = str;
247 duplicate$ length swap$ % int n = length(str);
248 duplicate$ empty$ % int stop = empty(suffix);
249 { not } { % while (! stop) {
250 duplicate$ #1 #1 substring$ is.digit { % if (is_digit(substring(suffix, 1, 1))) {
251 #2 global.max$ substring$ % suffix = substring(suffix, 2, global_max);
252 duplicate$ empty$ % stop = empty(suffix);
253 } { % } else {
254 true % stop = true;
255 } if$ % }
256 } while$ % }
257 length - % int n = n - length(suffix);
258 #1 swap$ substring$ % return substring(str, 1, n);
259 } % }
260 %
261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
262 %
263 FUNCTION {get.last.chr} { % String Entry::get_last_chr(String str) {
264 duplicate$ length % int n = length(str);
265 duplicate$ #0 = { % if (n == 0) {
266 pop$ % return str;
267 } { % } else {
268 #1 substring$ % return substring(str, n, 1);
269 } if$ % }
270 } % }
271 %
272 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
273 %
274 FUNCTION {get.ordinal.suffix.en} { % String Entry::get_ordinal_suffix_en(String ch) {
275 duplicate$ "1" = { % if (num == "1") {
276 pop$ cap.st.en % return cap_st_en;
277 } { % } else {
278 duplicate$ "2" = { % if (num == "2") {
279 pop$ cap.nd.en % return cap_nd_en;
280 } { % } else {
281 duplicate$ "3" = { % if (num == "3") {
282 pop$ cap.rd.en % return cap_rd_en;
283 } { % } else {
284 pop$ cap.th.en % return cap_th_en;
285 } if$ % }
286 } if$ % }
287 } if$ % }
288 } % }
289 %
290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
291 %
292 FUNCTION {num.to.ordinal.en} { % String Entry::num_to_ordinal_en(String num) {
293 duplicate$ empty$ { % if (empty(num)) {
294 skip$ % return num;
295 } { % } else {
296 duplicate$ get.last.chr % String ch = get_last_chr(num);
297 get.ordinal.suffix.en % String str = get_ordinal_suffix_en(ch);
298 * % reutrn num + str;
299 } if$ % }
300 } % }
301 %
302 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
303 %
304 STRINGS {remove.dots.result} % static String remove_dots_result;
305 %
306 FUNCTION {remove.dots} { % String Entry::remove_dots(String str) {
307 "" 'remove.dots.result := % remove_dots_result = "";
308 { duplicate$ empty$ not } { % while (! empty(str)) {
309 duplicate$ #1 #2 substring$ % String tmp = substring(str, 1, 2);
310 "\." = { % if (tmp == "\.") {
311 #3 global.max$ substring$ % str = substring(str, 3, global_max);
312 } { % } else {
313 duplicate$ #1 #1 substring$ % tmp = substring(str, 1, 1);
314 duplicate$ "." = { % if (tmp == ".") {
315 pop$ #2 global.max$ substring$ % str = substring(str, 2, global_max);
316 } { % } else {
317 remove.dots.result swap$ * % tmp = remove_dots_result + tmp;
318 'remove.dots.result := % remove_dots_result = tmp;
319 #2 global.max$ substring$ % str = substring(str, 2, global_max);
320 } if$ % }
321 } if$ % }
322 } while$ % }
323 pop$ remove.dots.result % return remove_dots_result;
324 } % }
325 %
326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
327 %
328 FUNCTION {add.brace} { % String Entry::add_brace(String str) {
329 "{" swap$ * "}" * % return "{" + str + "}";
330 } % }
331 %
332 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
333 %
334 FUNCTION {add.bracket} { % String Entry::bracket(String str) {
335 "(" swap$ * ")" * % return "(" + str + ")";
336 } % }
337 %
338 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
339 %
340 FUNCTION {add.squarebracket} { % String Entry::add_squarebracket(String str) {
341 "[" swap$ * "]" * % return "[" + str + "]";
342 } % }
343 %
344 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
345 %
346 FUNCTION {add.textit} { % String Entry::add_textit(String str) {
347 "\textit{" swap$ * "}" * % return "\textit{" + str + "}";
348 } % }
349 %
350 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
351 %
352 FUNCTION {add.textbf} { % String Entry::add_textbf(String str) {
353 "\textbf{" swap$ * "}" * % return "\textbf{" + str + "}";
354 } % }
355 %
356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
357 % // test if str contains a dash '-'
358 FUNCTION {contain.dash} { % int Entry::contain_dash(String str) {
359 false swap$ % int result = false;
360 { duplicate$ empty$ not} { % while (! empty(str)) {
361 duplicate$ #1 #1 substring$ "-" = { % if (substring(str, 1, 1) == "-") {
362 pop$ pop$ true % result = true;
363 "" % str = "";
364 } { % } else {
365 #2 global.max$ substring$ % str = substring(str, 2, global_max);
366 } if$ % }
367 } while$ % }
368 pop$ % return result;
369 } % }
370 %
371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
372 % // extract the substring before the first '-'
373 % // returns the string itself if no '-'
374 FUNCTION {extract.before.first.dash} { % String Entry::extract_before_first_dash(String str) {
375 duplicate$ % String suffix = str;
376 duplicate$ length swap$ % int n = length(str);
377 duplicate$ empty$ % int stop = empty(suffix);
378 { not } { % while (! stop) {
379 duplicate$ #1 #1 substring$ "-" = { % if (substring(suffix, 1, 1) == "-") {
380 true % stop = true;
381 } { % } else {4r
382 #2 global.max$ substring$ % suffix = substring(suffix, 2, global_max);
383 duplicate$ empty$ % stop = empty(suffix);
384 } if$ % }
385 } while$ % }
386 length - % int n = n - length(suffix);
387 #1 swap$ substring$ % return substring(str, 1, n);
388 } % }
389 %
390 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
391 % // extract the substring after the first '-'
392 % // returns the string itself if no '-'
393 FUNCTION {extract.after.first.dash} { % String Entry::extract_after_first_dash(String str) {
394 duplicate$ % String suffix = str;
395 duplicate$ empty$ % int stop = empty(suffix);
396 { not } { % while (! stop) {
397 duplicate$ #1 #1 substring$ "-" = { % if (substring(suffix, 1, 1) == "-") {
398 true % stop = true;
399 } { % } else {4r
400 #2 global.max$ substring$ % suffix = substring(suffix, 2, global_max);
401 duplicate$ empty$ % stop = empty(suffix);
402 } if$ % }
403 } while$ % }
404 duplicate$ empty$ { % if (empty(suffix)) {
405 pop$ % return str;
406 } { % } else {
407 swap$ pop$ #2 global.max$ substring$ % return substring(suffix, 2, global_max);
408 } if$ % }
409 } % }
410 %
411 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
412 % // extract the substring after the last '-'
413 % // returns the empty string if no '-'
414 FUNCTION {extract.after.last.dash} { % String Entry::extract_after_last_dash(String str) {
415 duplicate$ contain.dash not { % if (! contain_dash(str)) {
416 pop$ "" % return "";
417 } { % } else {
418 {duplicate$ contain.dash} { % while (contain_dash(str)) {
419 extract.after.first.dash % str = extract_after_first_dash(str);
420 } while$ % }
421 % return str;
422 } if$ % }
423 } % }
424 %
425 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
426 %
427 FUNCTION {trim.start} { % String Entry::trim_start(String str) {
428 {duplicate$ #1 #1 substring$ " " =} { % while (substring(str, 1, 1) == " ") {
429 #2 global.max$ substring$ % str = substring(str, 2, global_max);
430 } while$ % }
431 % return str;
432 } % }
433 %
434 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
435 %
436 FUNCTION {trim.end} { % String Entry::trim_end(String str) {
437 {duplicate$ get.last.chr " " =} { % while (get_last_chr(str) == " ") {
438 duplicate$ length #1 - % int n = length(str) - 1;
439 #1 swap$ substring$ % str = substring(str, 1, n);
440 } while$ % }
441 % return str;
442 } % }
443 %
444 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
445 %
446 FUNCTION {trim} { % String Entry::trim(String str) {
447 trim.start % str = trim_start(str);
448 trim.end % return trim_end(str);
449 } % }
450 %
451 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
452 %
453 FUNCTION {start.bibitem} { % void Entry::start_bibitem() {
454 newline$ % writeln();
455 "\bibitem{" cite$ * "}" * write$ % write("\bibitem{" + this.cite + "}");
456 newline$ % writeln();
457 } % }
458 %
459 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
460 %
461 FUNCTION {end.bibitem} { % void Entry::end_bibitem() {
462 cap.period write$ % write(cap_period);
463 newline$ % writeln();
464 } % }
465 %
466 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
467 %
468 FUNCTION {is.in.chinese} { % int Entry::is_in_chinese() {
469 language empty$ { % if (empty(this.language)) {
470 false % return false;
471 } { % } else {
472 language "zh" = { % if (this.language == "zh") {
473 true % return true;
474 } { % } else {
475 false % return false;
476 } if$ % }
477 } if$ % }
478 } % }
479 %
480 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
481 %
482 FUNCTION {is.online} { % int Entry::is_online() {
483 url empty$ not { % if (! empty(this.url)) {
484 true % return true;
485 } { % } else {
486 doi empty$ not { % if (! empty(this.doi)) {
487 true % return true;
488 } { % } else {
489 false % return false;
490 } if$ % }
491 } if$ % }
492 } % }
493 %
494 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
495 %
496 FUNCTION {set.mark} { % void Entry::set_mark(String mark) {
497 'mark := % this.mark = mark;
498 is.online { % if (is_online()) {
499 mark "/OL" * 'mark := % this.mark = this.mark + "/OL";
500 } { % } else {
501 media empty$ not { % if (! empty(this.media)) {
502 mark "/" * media * 'mark := % this.mark = this.mark + "/" + this.media;
503 } 'skip$ if$ % }
504 } if$ % }
505 } % }
506 %
507 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
508 %
509 FUNCTION {cap.volume} { % String Entry::cap_volume() {
510 is.in.chinese { % if (is_in_chinese()) {
511 cap.volume.zh % return cap_volume_zh;
512 } { % } else {
513 cap.volume.en % return cap_volume_en;
514 } if$ % }
515 } % }
516 %
517 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
518 %
519 FUNCTION {cap.edition} { % String Entry::cap_edition() {
520 is.in.chinese { % if (is_in_chinese()) {
521 cap.edition.zh % return cap_edition_zh;
522 } { % } else {
523 cap.edition.en % return cap_edition_en;
524 } if$ % }
525 } % }
526 %
527 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
528 %
529 FUNCTION {cap.anonymous} { % String Entry::cap_anonymous() {
530 is.in.chinese { % if (is_in_chinese()) {
531 cap.anonymous.zh % return cap_anonymous_zh;
532 } { % } else {
533 cap.anonymous.en % return cap_anonymous_en;
534 } if$ % }
535 } % }
536 %
537 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
538 %
539 FUNCTION {cap.no.address} { % String Entry::cap_no_address() {
540 is.in.chinese { % if (is_in_chinese()) {
541 cap.no.address.zh % return cap_no_address_zh;
542 } { % } else {
543 cap.no.address.en % return cap_no_address_en;
544 } if$ % }
545 } % }
546 %
547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
548 %
549 FUNCTION {cap.no.publisher} { % String Entry::cap_no_publisher() {
550 is.in.chinese { % if (is_in_chinese()) {
551 cap.no.publisher.zh % return cap_no_publisher_zh;
552 } { % } else {
553 cap.no.publisher.en % return cap_no_publisher_en;
554 } if$ % }
555 } % }
556 %
557 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
558 %
559 FUNCTION {cap.et.al} { % String Entry::cap_et_al() {
560 is.in.chinese { % if (is_in_chinese()) {
561 cap.et.al.zh % return cap_et_al_zh;
562 } { % } else {
563 cap.et.al.en % return cap_et_al_en;
564 } if$ % }
565 } % }
566 %
567 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
568 %
569 FUNCTION {cap.translate} { % String Entry::cap_translate() {
570 is.in.chinese { % if (is_in_chinese()) {
571 cap.translate.zh % return cap_translate_zh;
572 } { % } else {
573 cap.translate.en % return cap_translate_en;
574 } if$ % }
575 } % }
576 %
577 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
578 %
579 FUNCTION {format.bibinfo} { % String Entry::format_bibinfo(String info, String type) {
580 swap$ add.brace swap$ % info = add_brace(info);
581 "\bib" swap$ * swap$ * % return "\bib" + type + info;
582 } % }
583 %
584 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
585 INTEGERS { nameindex namecount } % static int nameindex, namecount;
586 STRINGS { namelist nameformat } % static String namelist, nameformat;
587 STRINGS { firstname lastname jrname vonname} % static String firstname, lastname, jrname, vonname;
588 %
589 FUNCTION {format.names} { % String Entry::format_names(String names) {
590 'namelist := % namelist = names;
591 namelist num.names$ 'namecount := % namecount = num_names(namelist);
592 "" % String result = "";
593 #0 'nameindex := % nameindex = 0;
594 {nameindex namecount < nameindex #3 < and} { % while ((nameindex < namecount) && (nameindex < 3)) {
595 nameindex #1 + 'nameindex := % nameindex = nameindex + 1;
596 nameindex #1 > { % if (nameindex > 1) {
597 cap.comma * % result = result + cap_comma;
598 } 'skip$ if$ % }
599 namelist nameindex "{vv}" format.name$ % String tmp = format_name(namelist, nameindex, "{vv}");
600 'vonname := % vonname = tmp;
601 namelist nameindex "{jj}" format.name$ % tmp = format_name(namelist, nameindex, "{jj}");
602 remove.dots 'jrname := % jrname = remove_dots(tmp);
603 namelist nameindex "{f}" format.name$ % tmp = format_name(namelist, nameindex, "{f}");
604 remove.dots % tmp = remove_dots(tmp);
605 'firstname := % firstname = change_case(tmp, "u");
606 namelist nameindex "{ll}" format.name$ % tmp = format_name(namelist, nameindex, "{ll}");
607 'lastname := % lastname = change_case(tmp, "u");
608 jrname empty$ not { % if (! empty(jrname)) {
609 jrname * " " * % result = result + jrname + " "
610 } 'skip$ if$ % }
611 vonname empty$ not { % if (! empty(vonname)) {
612 vonname * " " * % result = result + vonname + " "
613 } 'skip$ if$ % }
614 lastname empty$ not { % if (! empty(lastname)) {
615 lastname * " " * % result = result + lastname + " "
616 } 'skip$ if$ % }
617 firstname empty$ not { % if (! empty(firstname)) {
618 firstname * " " * % result = result + firstname + " "
619 } 'skip$ if$ % }
620 trim.end % result = trim_end(result);
621 } while$ % }
622 nameindex namecount < { % if (nameindex < namecount) {
623 cap.et.al * % result = result + cap_et_al();
624 } 'skip$ if$ % }
625 } % }
626 %
627 %
628 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
629 % // format English names
630 FUNCTION {format.names.en} { % String Entry::format_names_en(String names) {
631 format.names % format_names(names);
632 } % }
633 %
634 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
635 % // format Chinese names
636 FUNCTION {format.names.zh} { % String Entry::format_names_zh(String names) {
637 format.names % format_names(names);
638 } % }
639 %
640 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
641 %
642 FUNCTION {format.author} { % String Emtry::format_author(String authors) {
643 is.in.chinese { % if (is_in_chinese) {
644 format.names.zh % authors = format_names_zh(authors);
645 } { % } else {
646 format.names.en % authors = format_names_en(authors);
647 } if$ % }
648 "author" format.bibinfo % return format_bibinfo(authors, "author");
649 } % }
650 %
651 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
652 %
653 FUNCTION {format.editor} { % String Emtry::format_author(String editors) {
654 is.in.chinese { % if (is_in_chinese) {
655 format.names.zh % editors = format_names_zh(editors);
656 } { % } else {
657 format.names.en % editors = format_names_en(editors);
658 } if$ % }
659 "editor" format.bibinfo % return format_bibinfo(editors, "editor");
660 } % }
661 %
662 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
663 %
664 FUNCTION {format.translator} { % String Emtry::format_translator(String translators) {
665 is.in.chinese { % if (is_in_chinese) {
666 duplicate$ % String names = translators;
667 format.names.zh % translators = format_names_zh(translators);
668 swap$ num.names$ #3 > { % if (num_names(names) > 3) {
669 cap.translate.zh * % translators = translators + cap_translate_zh;
670 } { % } else {
671 cap.comma * cap.translate.zh * % translators = translators + cap_comma + cap_translate_zh;
672 } if$ % }
673 } { % } else {
674 duplicate$ % String names = translators;
675 format.names.en % translators = format_names_en(translators);
676 swap$ num.names$ #3 > { % if (num_names(names) > 3) {
677 cap.translate.en * % translators = translators + cap_translate_en;
678 } { % } else {
679 cap.comma * cap.translate.en * % translators = translators + cap_comma + cap_translate_en;
680 } if$ % }
681 } if$ % }
682 "translator" format.bibinfo % return format_bibinfo(translator, "translator");
683 } % }
684 %
685 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
686 %
687 FUNCTION {format.title} { % String Emtry::format_title(String title) {
688 "title" format.bibinfo % return format_bibinfo(title, "title");
689 } % }
690 %
691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
692 %
693 FUNCTION {format.booktitle} { % String Emtry::format_booktitle(String booktitle) {
694 "booktitle" format.bibinfo % return format_bibinfo(booktitle, "booktitle");
695 } % }
696 %
697 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
698 %
699 FUNCTION {format.mark} { % String Emtry::format_mark(String mark) {
700 "[" swap$ * "]" * % mark = "[" + mark + "]";
701 "mark" format.bibinfo % return format_bibinfo(mark, "mark");
702 } % }
703 %
704 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
705 %
706 FUNCTION {format.country} { % String Emtry::format_country(String country) {
707 "country" format.bibinfo % return format_bibinfo(country, "country");
708 } % }
709 %
710 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
711 %
712 FUNCTION {format.patentid} { % String Emtry::format_patentid(String patentid) {
713 "patentid" format.bibinfo % return format_bibinfo(patentid, "patentid");
714 } % }
715 %
716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
717 %
718 FUNCTION {format.edition} { % String Emtry::format_edition(String edition) {
719 duplicate$ is.number { % if (is_number(edition)) {
720 is.in.chinese { % if (is_in_chinese()) {
721 cap.edition.zh * % edition = edition + cap_edition_zh;
722 } { % } else {
723 num.to.ordinal.en cap.edition.en * % edition = num_to_ordinal_en(edition) + cap_edition_en;
724 } if$ % }
725 } 'skip$ if$ % }
726 % // use a \mbox{} to prevent line break within edition
727 "\mbox{" swap$ * "}" * % edition = "\mbox{" + edition + "}";
728 "edition" format.bibinfo % return format_bibinfo(edition, "edition");
729 } % }
730 %
731 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
732 %
733 FUNCTION {format.organization} { % String Emtry::format_organization(String organization) {
734 "organization" format.bibinfo % return format_bibinfo(organization, "organization");
735 } % }
736 %
737 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
738 %
739 FUNCTION {format.address} { % String Emtry::format_address(String address) {
740 "address" format.bibinfo % return format_bibinfo(address, "address");
741 } % }
742 %
743 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
744 %
745 FUNCTION {format.publisher} { % String Emtry::format_publisher(String publisher) {
746 "publisher" format.bibinfo % return format_bibinfo(publisher, "publisher");
747 } % }
748 %
749 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
750 %
751 FUNCTION {format.institution} { % String Emtry::format_institution(String institution) {
752 "institution" format.bibinfo % return format_bibinfo(institution, "institution");
753 } % }
754 %
755 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
756 %
757 FUNCTION {format.school} { % String Emtry::format_school(String school) {
758 "school" format.bibinfo % return format_bibinfo(school, "school");
759 } % }
760 %
761 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
762 %
763 FUNCTION {format.year} { % String Emtry::format_year(String year) {
764 "year" format.bibinfo % return format_bibinfo(year, "year");
765 } % }
766 %
767 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
768 %
769 FUNCTION {format.date} { % String Emtry::format_date(String date) {
770 "date" format.bibinfo % return format_bibinfo(date, "date");
771 } % }
772 %
773 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
774 %
775 FUNCTION {format.journal} { % String Emtry::format_journal(String journal) {
776 "journal" format.bibinfo % return format_bibinfo(journal, "journal");
777 } % }
778 %
779 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
780 %
781 FUNCTION {format.volume} { % String Emtry::format_volume(String volume) {
782 "volume" format.bibinfo % return format_bibinfo(volume, "volume");
783 } % }
784 %
785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
786 %
787 FUNCTION {format.number} { % String Emtry::format_number(String number) {
788 add.bracket % number = add_bracket(number);
789 "number" format.bibinfo % return format_bibinfo(number, "number");
790 } % }
791 %
792 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
793 %
794 FUNCTION {format.report.number} { % String Emtry::format_report_number(String number) {
795 "number" format.bibinfo % return format_bibinfo(number, "number");
796 } % }
797 %
798 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
799 %
800 FUNCTION {format.version} { % String Emtry::format_version(String version) {
801 "version" format.bibinfo % return format_bibinfo(version, "version");
802 } % }
803 %
804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
805 %
806 FUNCTION {format.pages} { % String Emtry::format_pages(String pages) {
807 "pages" format.bibinfo % return format_bibinfo(pages, "pages");
808 } % }
809 %
810 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
811 %
812 FUNCTION {format.modifydate} { % String Emtry::format_modifydate(String modifydate) {
813 add.bracket % modifydate = add_bracket(modifydate);
814 "modifydate" format.bibinfo % return format_bibinfo(modifydate, "modifydate");
815 } % }
816 %
817 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
818 %
819 FUNCTION {format.citedate} { % String Emtry::format_citedate(String citedate) {
820 add.squarebracket % citedate = add_squarebracket(citedate);
821 "citedate" format.bibinfo % return format_bibinfo(citedate, "citedate");
822 } % }
823 %
824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
825 %
826 % // NOTE: do not use the format_bibinfo() for URL,
827 % // since if the URL contains special symbols such
828 % // as '%', the \biburl{} will be broken.
829 FUNCTION {format.url} { % String Emtry::format_url(String url) {
830 "\url{" swap$ * "}" * % return "\url{" + url + "}";
831 } % }
832 %
833 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
834 %
835 FUNCTION {get.full.title} { % String Entry::get_full_title() {
836 series empty$ { % if (empty(this.series)) {
837 volume empty$ { % if (empty(this.volume)) {
838 title % return this.title;
839 } { % } else {
840 title cap.colon * cap.volume * volume * % return this.title + cap_colon + cap_volume() + this.volume;
841 } if$ % }
842 } { % } else {
843 volume empty$ { % if (empty(this.volume)) {
844 series cap.colon * title * % return this.series + cap_colon + this.title;
845 } { % } else {
846 series cap.comma * cap.volume * volume * % String str = this.series + cap_comma + cal_volume() + this.volume;
847 cap.colon * title * % return str + cap_colon + this.title;
848 } if$ % }
849 } if$ % }
850 } % }
851 %
852 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
853 %
854 FUNCTION {get.full.booktitle} { % String Entry::get_full_booktitle() {
855 series empty$ { % if (empty(this.series)) {
856 volume empty$ { % if (empty(this.volume)) {
857 booktitle % return this.booktitle;
858 } { % } else {
859 booktitle cap.colon * cap.volume * volume * % return this.booktitle + cap_colon + cap_volume() + this.volume;
860 } if$ % }
861 } { % } else {
862 volume empty$ { % if (empty(this.volume)) {
863 series cap.colon * booktitle * % return this.series + cap_colon + this.booktitle;
864 } { % } else {
865 series cap.comma * cap.volume * volume * % String str = this.series + cap_comma + cal_volume() + this.volume;
866 cap.colon * booktitle * % return str + cap_colon + this.booktitle;
867 } if$ % }
868 } if$ % }
869 } % }
870 %
871 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
872 %
873 FUNCTION {get.pages} { % String Entry::get_pages() {
874 pages contain.dash { % if (contain_dash(this.pages)) {
875 pages extract.before.first.dash % String p1 = extract_before_first_dash(this.pages);
876 pages extract.after.last.dash % String p2 = extract_after_last_dash(this.pages);
877 cap.dash swap$ * * % return p1 + cap_dash + p2;
878 } { % } else {
879 pages % return this.pages;
880 } if$ % }
881 } % }
882 %
883 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
884 %
885 FUNCTION {output.author.or.editor} { % void Entry::output_author_or_editor(int required) {
886 'required := % this.required = required;
887 author empty$ not { % if (! empty(this.author)) {
888 author format.author write$ % write(format_author(this.author));
889 cap.period write$ % write(cap_period);
890 } { % } else {
891 editor empty$ not { % if (! empty(this.editor)) {
892 editor format.editor write$ % write(format_editor(this.editor));
893 cap.period write$ % write(cap_period);
894 } { % } else {
895 required { % if (required == 1) {
896 "Require author/editor: " cite$ * warning$% warning("Require author/editor: " + this.cite);
897 cap.anonymous format.author write$ % write(format_author(cap_anonymous()));
898 cap.period write$ % write(cap_period);
899 } 'skip$ if$ % }
900 } if$ % }
901 } if$ % }
902 } % }
903 %
904 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
905 %
906 FUNCTION {output.author} { % void Entry::output_author(int required) {
907 'required := % this.required = required;
908 author empty$ not { % if (! empty(this.author)) {
909 author format.author write$ % write(format_author(this.author));
910 cap.period write$ % write(cap_period);
911 } { % } else {
912 required { % if (required == 1) {
913 "Require author: " cite$ * warning$ % warning("Require author: " + this.cite);
914 cap.anonymous format.author write$ % write(format_author(cap_anonymous()));
915 cap.period write$ % write(cap_period);
916 } 'skip$ if$ % }
917 } if$ % }
918 } % }
919 %
920 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
921 %
922 FUNCTION {output.editor} { % void Entry::output_editor(int required) {
923 'required := % this.required = required;
924 editor empty$ not { % if (! empty(this.editor)) {
925 editor format.editor write$ % write(format_editor(this.editor));
926 cap.period write$ % write(cap_period);
927 } { % } else {
928 required { % if (required == 1) {
929 "Require editor: " cite$ * warning$ % warning("Require editor: " + this.cite);
930 cap.anonymous format.editor write$ % write(format_editor(cap_anonymous()));
931 cap.period write$ % write(cap_period);
932 } 'skip$ if$ % }
933 } if$ % }
934 } % }
935 %
936 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
937 %
938 FUNCTION {output.title} { % void Entry::output_title(int required) {
939 'required := % this.required = required;
940 title empty$ not { % if (! empty(this.title)) {
941 title format.title write$ % write(format_title(this.title));
942 } { % } else {
943 required { % if (required == 1) {
944 "Require title: " cite$ * warning$ % warning("Require title: " + this.cite);
945 } 'skip$ if$ % }
946 } if$ % }
947 } % }
948 %
949 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
950 %
951 FUNCTION {output.series.volume.title} { % void Entry::output_series_volume_title(int required) {
952 'required := % this.required = required;
953 title empty$ not { % if (! empty(this.title)) {
954 get.full.title format.booktitle write$ % write(format_booktitle(get_full_title()));
955 } { % } else {
956 required { % if (required == 1) {
957 "Require title: " cite$ * warning$ % warning("Require title: " + this.cite);
958 } 'skip$ if$ % }
959 } if$ % }
960 } % }
961 %
962 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
963 %
964 FUNCTION {output.series.volume.booktitle} { % void Entry::output_series_volume_booktitle(int required) {
965 'required := % this.required = required;
966 booktitle empty$ not { % if (! empty(this.booktitle)) {
967 get.full.booktitle format.booktitle write$ % write(format_booktitle(get_full_booktitle());
968 } { % } else {
969 required { % if (required == 1) {
970 "Require booktitle: " cite$ * warning$ % warning("Require booktitle: " + this.cite);
971 } 'skip$ if$ % }
972 } if$ % }
973 } % }
974 %
975 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
976 %
977 FUNCTION {output.journal} { % void Entry::output_journal(int required) {
978 'required := % this.required = required;
979 journal empty$ not { % if (! empty(this.journal)) {
980 cap.period write$ % write(cap_period);
981 journal format.journal write$ % write(format_journal(this.journal));
982 } { % } else {
983 required { % if (required == 1) {
984 "Require journal: " cite$ * warning$ % warning("Require journal: " + this.cite);
985 } 'skip$ if$ % }
986 } if$ % }
987 } % }
988 %
989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
990 %
991 FUNCTION {output.mark} { % void Entry::output_mark(int required) {
992 'required := % this.required = required;
993 mark empty$ not { % if (! empty(this.mark)) {
994 mark format.mark write$ % write(format_mark(this.mark));
995 } { % } else {
996 required { % if (required == 1) {
997 "Require mark: " cite$ * warning$ % warning("Require mark: " + this.cite);
998 } 'skip$ if$ % }
999 } if$ % }
1000 } % }
1001 %
1002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1003 %
1004 FUNCTION {output.translator} { % void Entry::output_translator(int required) {
1005 'required := % this.required = required;
1006 translator empty$ not { % if (! empty(this.translator)) {
1007 cap.period write$ % write(cap_period);
1008 translator format.translator write$ % write(format_translator(this.translator));
1009 } { % } else {
1010 required { % if (required == 1) {
1011 "Require translator: " cite$ * warning$ % warning("Require translator: " + this.cite);
1012 } 'skip$ if$ % }
1013 } if$ % }
1014 } % }
1015 %
1016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1017 %
1018 FUNCTION {output.edition} { % void Entry::output_edition(int required) {
1019 'required := % this.required = required;
1020 edition empty$ not { % if (! empty(this.edition)) {
1021 cap.period write$ % write(cap_period);
1022 edition format.edition write$ % write(format_edition(this.edition));
1023 } { % } else {
1024 required { % if (required == 1) {
1025 "Require edition: " cite$ * warning$ % warning("Require edition: " + this.cite);
1026 } 'skip$ if$ % }
1027 } if$ % }
1028 } % }
1029 %
1030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1031 %
1032 FUNCTION {output.address} { % void Entry::output_address(int required) {
1033 'required := % this.required = required;
1034 address empty$ not { % if (! empty(this.address)) {
1035 cap.period write$ % write(cap_period);
1036 address format.address write$ % write(format_address(this.address));
1037 } { % } else {
1038 required { % if (required == 1) {
1039 "Require address: " cite$ * warning$ % warning("Require address: " + this.cite);
1040 cap.period write$ % write(cap_period);
1041 cap.no.address format.address write$ % write(format_address(cap_no_address()));
1042 } 'skip$ if$ % }
1043 } if$ % }
1044 } % }
1045 %
1046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1047 %
1048 FUNCTION {output.publisher} { % void Entry::output_publisher(int required) {
1049 'required := % this.required = required;
1050 publisher empty$ not { % if (! empty(this.publisher)) {
1051 cap.colon write$ % write(cap_colon);
1052 publisher format.publisher write$ % write(format_publisher(this.publisher));
1053 } { % } else {
1054 required { % if (required == 1) {
1055 "Require publisher: " cite$ * warning$ % warning("Require publisher: " + this.cite);
1056 cap.colon write$ % write(cap_colon);
1057 cap.no.publisher format.publisher write$ % write(format_publisher(cap_no_publisher()));
1058 } 'skip$ if$ % }
1059 } if$ % }
1060 } % }
1061 %
1062 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1063 %
1064 FUNCTION {output.publisher.no.address} { % void Entry::output_publisher_no_address(int required) {
1065 'required := % this.required = required;
1066 publisher empty$ not { % if (! empty(this.publisher)) {
1067 cap.period write$ % write(cap_period);
1068 publisher format.publisher write$ % write(format_publisher(this.publisher));
1069 } { % } else {
1070 required { % if (required == 1) {
1071 "Require publisher: " cite$ * warning$ % warning("Require publisher: " + this.cite);
1072 cap.period write$ % write(cap_period);
1073 cap.no.publisher format.publisher write$ % write(format_publisher(cap_no_publisher()));
1074 } 'skip$ if$ % }
1075 } if$ % }
1076 } % }
1077 %
1078 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1079 %
1080 FUNCTION {output.school} { % void Entry::output_school(int required) {
1081 'required := % this.required = required;
1082 school empty$ not { % if (! empty(this.school)) {
1083 cap.colon write$ % write(cap_colon);
1084 school format.school write$ % write(format_school(this.school));
1085 } { % } else {
1086 required { % if (required == 1) {
1087 "Require school: " cite$ * warning$ % warning("Require publisher: " + this.cite);
1088 cap.colon write$ % write(cap_colon);
1089 cap.no.publisher format.school write$ % write(format_school(cap_no_publisher()));
1090 } 'skip$ if$ % }
1091 } if$ % }
1092 } % }
1093 %
1094 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1095 %
1096 FUNCTION {output.institution} { % void Entry::output_institution(int required) {
1097 'required := % this.required = required;
1098 institution empty$ not { % if (! empty(this.institution)) {
1099 cap.colon write$ % write(cap_colon);
1100 institution format.institution write$ % write(format_publisher(this.institution));
1101 } { % } else {
1102 required { % if (required == 1) {
1103 "Require institution: " cite$ * warning$ % warning("Require institution: " + this.cite);
1104 cap.colon write$ % write(cap_colon);
1105 cap.no.publisher format.institution write$ % write(format_institution(cap_no_publisher()));
1106 } 'skip$ if$ % }
1107 } if$ % }
1108 } % }
1109 %
1110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1111 %
1112 FUNCTION {output.year} { % void Entry::output_year(int required) {
1113 'required := % this.required = required;
1114 year empty$ not { % if (! empty(this.year)) {
1115 year format.year write$ % write(format_year(this.year));
1116 } { % } else {
1117 required { % if (required == 1) {
1118 "Require year: " cite$ * warning$ % warning("Require year: " + this.cite);
1119 } 'skip$ if$ % }
1120 } if$ % }
1121 } % }
1122 %
1123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1124 %
1125 FUNCTION {output.pages} { % void Entry::output_pages(int required) {
1126 'required := % this.required = required;
1127 pages empty$ not { % if (! empty(this.pages)) {
1128 cap.colon write$ % write(cap_colon);
1129 get.pages format.pages write$ % write(format_pages(get_pages()));
1130 } { % } else {
1131 required { % if (required == 1) {
1132 "Require pages: " cite$ * warning$ % warning("Require pages: " + this.cite);
1133 } 'skip$ if$ % }
1134 } if$ % }
1135 } % }
1136 %
1137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1138 %
1139 FUNCTION {output.modifydate} { % void Entry::output_modifydate(int required) {
1140 'required := % this.required = required;
1141 modifydate empty$ not { % if (! empty(this.modifydate)) {
1142 cap.space write$ % write(cap_space);
1143 modifydate format.modifydate write$ % write(format_modifydate(this.modifydate));
1144 } { % } else {
1145 required { % if (required == 1) {
1146 "Require modifydate: " cite$ * warning$ % warning("Require modifydate: " + this.cite);
1147 } 'skip$ if$ % }
1148 } if$ % }
1149 } % }
1150 %
1151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1152 %
1153 FUNCTION {output.citedate} { % void Entry::output_citedate(int required) {
1154 'required := % this.required = required;
1155 citedate empty$ not { % if (! empty(this.citedate)) {
1156 cap.space write$ % write(cap_space);
1157 citedate format.citedate write$ % write(format_citedate(this.citedate));
1158 } { % } else {
1159 required is.online or { % if ((required == 1) || (is_online())) {
1160 "Require citedate: " cite$ * warning$ % warning("Require citedate: " + this.cite);
1161 } 'skip$ if$ % }
1162 } if$ % }
1163 } % }
1164 %
1165 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1166 %
1167 FUNCTION {output.date} { % void Entry::output_date(int required) {
1168 'required := % this.required = required;
1169 date empty$ not { % if (! empty(this.date)) {
1170 date format.date write$ % write(format_date(this.date));
1171 } { % } else {
1172 required { % if (required == 1) {
1173 "Require date: " cite$ * warning$ % warning("Require date: " + this.cite);
1174 } 'skip$ if$ % }
1175 } if$ % }
1176 } % }
1177 %
1178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1179 %
1180 FUNCTION {output.volume} { % void Entry::output_volume(int required) {
1181 'required := % this.required = required;
1182 volume empty$ not { % if (! empty(this.volume)) {
1183 cap.comma write$ % write(cap_comma);
1184 volume format.volume write$ % write(format_volume(this.volume));
1185 } { % } else {
1186 required { % if (required == 1) {
1187 "Require volume: " cite$ * warning$ % warning("Require volume: " + this.cite);
1188 } 'skip$ if$ % }
1189 } if$ % }
1190 } % }
1191 %
1192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1193 %
1194 FUNCTION {output.number} { % void Entry::output_number(int required) {
1195 'required := % this.required = required;
1196 number empty$ not { % if (! empty(this.number)) {
1197 number format.number write$ % write(format_number(this.number));
1198 } { % } else {
1199 required { % if (required == 1) {
1200 "Require number: " cite$ * warning$ % warning("Require number: " + this.cite);
1201 } 'skip$ if$ % }
1202 } if$ % }
1203 } % }
1204 %
1205 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1206 %
1207 FUNCTION {output.report.number} { % void Entry::output_report_number(int required) {
1208 'required := % this.required = required;
1209 number empty$ not { % if (! empty(this.number)) {
1210 cap.colon write$ % write(cap_colon);
1211 number format.report.number write$ % write(format_report_number(this.number));
1212 } { % } else {
1213 required { % if (required == 1) {
1214 "Require number: " cite$ * warning$ % warning("Require number: " + this.cite);
1215 } 'skip$ if$ % }
1216 } if$ % }
1217 } % }
1218 %
1219 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1220 %
1221 FUNCTION {output.country} { % void Entry::output_country(int required) {
1222 'required := % this.required = required;
1223 country empty$ not { % if (! empty(this.country)) {
1224 cap.colon write$ % write(cap_colon);
1225 country format.country write$ % write(format_country(this.country));
1226 } { % } else {
1227 required { % if (required == 1) {
1228 "Require country: " cite$ * warning$ % warning("Require country: " + this.cite);
1229 } 'skip$ if$ % }
1230 } if$ % }
1231 } % }
1232 %
1233 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1234 %
1235 FUNCTION {output.patentid} { % void Entry::output_patentid(int required) {
1236 'required := % this.required = required;
1237 patentid empty$ not { % if (! empty(this.patentid)) {
1238 cap.comma write$ % write(cap_comma);
1239 patentid format.patentid write$ % write(format_patentid(this.patentid));
1240 } { % } else {
1241 required { % if (required == 1) {
1242 "Require patentid: " cite$ * warning$ % warning("Require patentid: " + this.cite);
1243 } 'skip$ if$ % }
1244 } if$ % }
1245 } % }
1246 %
1247 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1248 %
1249 FUNCTION {output.start.year} { % void Entry::output_start_year(int required) {
1250 'required := % this.required = required;
1251 year empty$ not { % if (! empty(this.year)) {
1252 year extract.before.first.dash % String str = extract_before_first_dash(this.year);
1253 format.year write$ % write(format_year(str));
1254 } { % } else {
1255 required { % if (required == 1) {
1256 "Require year: " cite$ * warning$ % warning("Require year: " + this.cite);
1257 } 'skip$ if$ % }
1258 } if$ % }
1259 } % }
1260 %
1261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1262 %
1263 FUNCTION {output.start.volume} { % void Entry::output_start_volume(int required) {
1264 'required := % this.required = required;
1265 volume empty$ not { % if (! empty(this.volume)) {
1266 cap.comma write$ % write(cap_comma);
1267 volume extract.before.first.dash % String str = extract_before_first_dash(this.volume);
1268 format.volume write$ % write(format_volume(str));
1269 } { % } else {
1270 required { % if (required == 1) {
1271 "Require volume: " cite$ * warning$ % warning("Require volume: " + this.cite);
1272 } 'skip$ if$ % }
1273 } if$ % }
1274 } % }
1275 %
1276 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1277 %
1278 FUNCTION {output.start.number} { % void Entry::output_start_number(int required) {
1279 'required := % this.required = required;
1280 number empty$ not { % if (! empty(this.number)) {
1281 number extract.before.first.dash % String str = extract_before_first_dash(this.number);
1282 format.number write$ % write(format_number(str));
1283 } { % } else {
1284 required { % if (required == 1) {
1285 "Require number: " cite$ * warning$ % warning("Require number: " + this.cite);
1286 } 'skip$ if$ % }
1287 } if$ % }
1288 } % }
1289 %
1290 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1291 %
1292 FUNCTION {output.end.year} { % void Entry::output_end_year(int required) {
1293 'required := % this.required = required;
1294 year empty$ not { % if (! empty(this.year)) {
1295 year extract.after.last.dash % String str = extract_after_last_dash(this.year);
1296 format.year write$ % write(format_year(str));
1297 } { % } else {
1298 required { % if (required == 1) {
1299 "Require year: " cite$ * warning$ % warning("Require year: " + this.cite);
1300 } 'skip$ if$ % }
1301 } if$ % }
1302 } % }
1303 %
1304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1305 %
1306 FUNCTION {output.end.volume} { % void Entry::output_end_volume(int required) {
1307 'required := % this.required = required;
1308 volume empty$ not { % if (! empty(this.volume)) {
1309 cap.comma write$ % write(cap_comma);
1310 volume extract.after.last.dash % String str = extract_after_last_dash(this.volume);
1311 format.volume write$ % write(format_volume(str));
1312 } { % } else {
1313 required { % if (required == 1) {
1314 "Require volume: " cite$ * warning$ % warning("Require volume: " + this.cite);
1315 } 'skip$ if$ % }
1316 } if$ % }
1317 } % }
1318 %
1319 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1320 %
1321 FUNCTION {output.end.number} { % void Entry::output_end_number(int required) {
1322 'required := % this.required = required;
1323 number empty$ not { % if (! empty(this.number)) {
1324 number extract.after.last.dash % String str = extract_after_last_dash(this.number);
1325 format.number write$ % write(format_number(str));
1326 } { % } else {
1327 required { % if (required == 1) {
1328 "Require number: " cite$ * warning$ % warning("Require number: " + this.cite);
1329 } 'skip$ if$ % }
1330 } if$ % }
1331 } % }
1332 %
1333 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1334 %
1335 FUNCTION {output.url.or.doi} { % void Entry::output_url_or_doi(int required) {
1336 'required := % this.required = required;
1337 url empty$ not { % if (! empty(this.url)) {
1338 cap.period write$ % write(cap_period);
1339 url format.url write$ % write(format_url(this.url));
1340 } { % } else {
1341 doi empty$ not { % if (! empty(this.doi)) {
1342 cap.period write$ % write(cap_period);
1343 cap.doi.url doi * format.url write$ % write(format_url(cap_doi_url + this.doi));
1344 } { % } else {
1345 required { % if (required == 1) {
1346 "Require URL or DOI: " cite$ * warning$ % warning("Require URL or DOI: " + this.cite);
1347 } 'skip$ if$ % }
1348 } if$ % }
1349 } if$ % }
1350 } % }
1351 %
1352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1353 %
1354 FUNCTION {output.url} { % void Entry::output_url(int required) {
1355 'required := % this.required = required;
1356 url empty$ not { % if (! empty(this.url)) {
1357 cap.period write$ % write(cap_period);
1358 url format.url write$ % write(format_url(this.url));
1359 } { % } else {
1360 required { % if (required == 1) {
1361 "Require URL: " cite$ * warning$ % warning("Require URL: " + this.cite);
1362 } 'skip$ if$ % }
1363 } if$ % }
1364 } % }
1365 %
1366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1367 %
1368 FUNCTION {output.version} { % void Entry::output_version(int required) {
1369 'required := % this.required = required;
1370 version empty$ not { % if (! empty(this.version)) {
1371 cap.period write$ % write(cap_period);
1372 version format.version write$ % write(format_version(this.version));
1373 } { % } else {
1374 required { % if (required == 1) {
1375 "Require version: " cite$ * warning$ % warning("Require version: " + this.cite);
1376 } 'skip$ if$ % }
1377 } if$ % }
1378 } % }
1379 %
1380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1381 %
1382 FUNCTION {book.impl} { % void Entry::book_impl() {
1383 start.bibitem % start_bibitem();
1384 true output.author.or.editor % output_author_or_editor(true);
1385 true output.series.volume.title % output_series_volume_title(true);
1386 true output.mark % output_mark(true);
1387 false output.translator % output_translator(false);
1388 false output.edition % output_edition(false);
1389 publisher empty$ not { % if (! empty(this.publisher)) {
1390 true output.address % output_address(true);
1391 true output.publisher % output_publisher(true);
1392 cap.comma write$ % write(cap_comma);
1393 } { % } else {
1394 cap.period write$ % write(cap_period);
1395 } if$ % }
1396 true output.year % output_year(true);
1397 false output.pages % output_pages(false);
1398 false output.citedate % output_citedate(false);
1399 false output.url.or.doi % output_url_or_doi(false);
1400 end.bibitem % end_bibitem();
1401 } % }
1402 %
1403 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1404 %
1405 FUNCTION {book} { % void Entry::book() {
1406 "M" set.mark % set_mark("M");
1407 book.impl % book_impl();
1408 } % }
1409 %
1410 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1411 %
1412 FUNCTION {collection} { % void Entry::collection() {
1413 "G" set.mark % set_mark("G");
1414 book.impl % book_impl();
1415 } % }
1416 %
1417 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1418 %
1419 FUNCTION {proceedings} { % void Entry::proceedings() {
1420 "C" set.mark % set_mark("C");
1421 start.bibitem % start_bibitem();
1422 true output.editor % output_editor(true);
1423 true output.series.volume.title % output_series_volume_title(true);
1424 true output.mark % output_mark(true);
1425 false output.translator % output_translator(false);
1426 false output.edition % output_edition(false);
1427 publisher empty$ not { % if (! empty(this.publisher)) {
1428 true output.address % output_address(true);
1429 true output.publisher % output_publisher(true);
1430 cap.comma write$ % write(cap_comma);
1431 } { % } else {
1432 cap.period write$ % write(cap_period);
1433 } if$ % }
1434 true output.year % output_year(true);
1435 false output.pages % output_pages(false);
1436 false output.citedate % output_citedate(false);
1437 false output.url.or.doi % output_url_or_doi(false);
1438 end.bibitem % end_bibitem();
1439 } % }
1440 %
1441 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1442 %
1443 FUNCTION {conference} { % void Entry::conference() {
1444 proceedings % proceedings();
1445 } % }
1446 %
1447 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1448 %
1449 FUNCTION {thesis.impl} { % void Entry::thesis_impl() {
1450 start.bibitem % start_bibitem();
1451 true output.author % output_author(true);
1452 true output.title % output_title(true);
1453 true output.mark % output_mark(true);
1454 false output.translator % output_translator(false);
1455 true output.address % output_address(true);
1456 true output.school % output_school(true);
1457 cap.comma write$ % write(cap_comma);
1458 true output.year % output_year(true);
1459 false output.pages % output_pages(false);
1460 false output.citedate % output_citedate(false);
1461 false output.url.or.doi % output_url_or_doi(false);
1462 end.bibitem % end_bibitem();
1463 } % }
1464 %
1465 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1466 %
1467 FUNCTION {phdthesis} { % void Entry::phdthesis() {
1468 "D" set.mark % set_mark("D");
1469 thesis.impl % thesis_impl();
1470 } % }
1471 %
1472 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1473 %
1474 FUNCTION {masterthesis} { % void Entry::masterthesis() {
1475 "D" set.mark % set_mark("D");
1476 thesis.impl % thesis_impl();
1477 } % }
1478 %
1479 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1480 %
1481 FUNCTION {bachelorthesis} { % void Entry::bachelorthesis() {
1482 "D" set.mark % set_mark("D");
1483 thesis.impl % thesis_impl();
1484 } % }
1485 %
1486 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1487 %
1488 FUNCTION {techreport} { % void Entry::techreport() {
1489 "R" set.mark % set_mark("R");
1490 start.bibitem % start_bibitem();
1491 true output.author % output_author(true);
1492 true output.title % output_title(true);
1493 false output.report.number % output_report_number(false);
1494 true output.mark % output_mark(true);
1495 false output.translator % output_translator(false);
1496 false output.edition % output_edition(false);
1497 false output.version % output_version(false);
1498 institution empty$ not { % if (! empty(this.institution)) {
1499 true output.address % output_address(true);
1500 true output.institution % output_institution(true);
1501 cap.comma write$ % write(cap_comma);
1502 } { % } else {
1503 cap.period write$ % write(cap_period);
1504 } if$ % }
1505 true output.year % output_year(true);
1506 false output.pages % output_pages(false);
1507 false output.citedate % output_citedate(false);
1508 false output.url.or.doi % output_url_or_doi(false);
1509 end.bibitem % end_bibitem();
1510 } % }
1511 %
1512 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1513 %
1514 FUNCTION {standard} { % void Entry::standard() {
1515 "S" set.mark % set_mark("S");
1516 start.bibitem % start_bibitem();
1517 true output.author % output_author(true);
1518 true output.title % output_title(true);
1519 true output.mark % output_mark(true);
1520 false output.translator % output_translator(false);
1521 false output.edition % output_edition(false);
1522 publisher empty$ not { % if (! empty(this.publisher)) {
1523 true output.address % output_address(true);
1524 true output.publisher % output_publisher(true);
1525 cap.comma write$ % write(cap_comma);
1526 } { % } else {
1527 cap.period write$ % write(cap_period);
1528 } if$ % }
1529 true output.year % output_year(true);
1530 false output.pages % output_pages(false);
1531 false output.citedate % output_citedate(false);
1532 false output.url.or.doi % output_url_or_doi(false);
1533 end.bibitem % end_bibitem();
1534 } % }
1535 %
1536 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1537 %
1538 FUNCTION {reference} { % void Entry::reference() {
1539 "K" set.mark % set_mark("K");
1540 start.bibitem % start_bibitem();
1541 false output.author.or.editor % output_author_or_editor(false);
1542 true output.series.volume.title % output_series_volume_title(true);
1543 true output.mark % output_mark(true);
1544 false output.translator % output_translator(false);
1545 false output.edition % output_edition(false);
1546 publisher empty$ not { % if (! empty(this.publisher)) {
1547 true output.address % output_address(true);
1548 true output.publisher % output_publisher(true);
1549 cap.comma write$ % write(cap_comma);
1550 } { % } else {
1551 cap.period write$ % write(cap_period);
1552 } if$ % }
1553 true output.year % output_year(true);
1554 false output.pages % output_pages(false);
1555 false output.citedate % output_citedate(false);
1556 false output.url.or.doi % output_url_or_doi(false);
1557 end.bibitem % end_bibitem();
1558 } % }
1559 %
1560 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1561 %
1562 FUNCTION {manual} { % void Entry::manual() {
1563 reference % reference();
1564 } % }
1565 %
1566 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1567 %
1568 FUNCTION {periodical.impl} { % void Entry::periodical_impl() {
1569 start.bibitem % start_bibitem();
1570 false output.editor % output_editor(false);
1571 true output.title % output_title(true);
1572 true output.mark % output_mark(true);
1573 cap.period write$ % write(cap_period);
1574 true output.start.year % output_start_year(true);
1575 false output.start.volume % output_start_volume(false);
1576 false output.start.number % output_start_number(false);
1577 cap.dash write$ % write(cap_dash);
1578 year contain.dash { % if (contain_dash(this.year)) {
1579 true output.end.year % output_end_year(true);
1580 false output.end.volume % output_end_volume(false);
1581 false output.end.number % output_end_number(false);
1582 } 'skip$ if$ % }
1583 publisher empty$ not { % if (! empty(this.publisher)) {
1584 true output.address % output_address(true);
1585 true output.publisher % output_publisher(true);
1586 cap.comma write$ % write(cap_comma);
1587 } { % } else {
1588 cap.period write$ % write(cap_period);
1589 } if$ % }
1590 true output.start.year % output_start_year(true);
1591 cap.dash write$ % write(cap_dash);
1592 year contain.dash { % if (contain_dash(this.year)) {
1593 true output.end.year % output_end_year(true);
1594 } 'skip$ if$ % }
1595 false output.citedate % output_citedate(false);
1596 false output.url.or.doi % output_url_or_doi(false);
1597 end.bibitem % end_bibitem();
1598 } % }
1599 %
1600 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1601 %
1602 FUNCTION {periodical} { % void Entry::periodical() {
1603 "J" set.mark % set_mark("J");
1604 periodical.impl % periodical_impl();
1605 } % }
1606 %
1607 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1608 %
1609 FUNCTION {newspaper} { % void Entry::newspaper() {
1610 "N" set.mark % set_mark("N");
1611 periodical.impl % periodical_impl();
1612 } % }
1613 %
1614 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1615 %
1616 FUNCTION {patent} { % void Entry::patent() {
1617 "P" set.mark % set_mark("P");
1618 start.bibitem % start_bibitem();
1619 true output.author % output_author(true);
1620 true output.title % output_title(true);
1621 true output.country % output_country(true);
1622 true output.patentid % output_patentid(true);
1623 true output.mark % output_mark(true);
1624 cap.period write$ % write(cap_period);
1625 true output.date % output_date(true);
1626 false output.citedate % output_citedate(false);
1627 false output.url.or.doi % output_url_or_doi(false);
1628 end.bibitem % end_bibitem();
1629 } % }
1630 %
1631 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1632 %
1633 FUNCTION {online} { % void Entry::online() {
1634 "EB" set.mark % set_mark("EB");
1635 start.bibitem % start_bibitem();
1636 false output.author % output_author(false);
1637 true output.title % output_title(true);
1638 true output.mark % output_mark(true);
1639 publisher empty$ not { % if (! empty(this.publisher)) {
1640 address empty$ not { % if (! empty(this.address)) {
1641 true output.address % output_address(true);
1642 true output.publisher % output_publisher(true);
1643 cap.comma write$ % write(cap_comma);
1644 } { % } else {
1645 true output.publisher.no.address % output_publisher_no_address(true);
1646 cap.comma write$ % write(cap_comma);
1647 } if$ % }
1648 } { % } else {
1649 cap.period write$ % write(cap_period);
1650 } if$ % }
1651 true output.year % output_year(true);
1652 false output.modifydate % output_modifydate(false);
1653 true output.citedate % output_citedate(true);
1654 true output.url % output_url(true);
1655 end.bibitem % end_bibitem();
1656 } % }
1657 %
1658 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1659 %
1660 FUNCTION {webpage} { % void Entry::online() {
1661 online % online();
1662 } % }
1663 %
1664 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1665 %
1666 FUNCTION {program.impl} { % void Entry::program_impl() {
1667 start.bibitem % start_bibitem();
1668 false output.author % output_author(false);
1669 true output.title % output_title(true);
1670 true output.mark % output_mark(true);
1671 publisher empty$ not { % if (! empty(this.publisher)) {
1672 true output.address % output_address(true);
1673 true output.publisher % output_publisher(true);
1674 cap.comma write$ % write(cap_comma);
1675 } { % } else {
1676 cap.period write$ % write(cap_period);
1677 } if$ % }
1678 true output.year % output_year(true);
1679 false output.citedate % output_citedate(false);
1680 false output.url.or.doi % output_url_or_doi(false);
1681 end.bibitem % end_bibitem();
1682 } % }
1683 %
1684 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1685 %
1686 FUNCTION {program} { % void Entry::program() {
1687 "CP" set.mark % set_mark("CP");
1688 program.impl % program_impl();
1689 } % }
1690 %
1691 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1692 %
1693 FUNCTION {database} { % void Entry::database() {
1694 "DB" set.mark % set_mark("DB");
1695 program.impl % program_impl();
1696 } % }
1697 %
1698 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1699 %
1700 FUNCTION {unpublished} { % void Entry::unpublished() {
1701 "H" set.mark % set_mark("H");
1702 start.bibitem % start_bibitem();
1703 true output.author % output_author(true);
1704 true output.title % output_title(true);
1705 true output.mark % output_mark(true);
1706 cap.period write$ % write(cap_period);
1707 true output.year % output_year(true);
1708 false output.citedate % output_citedate(false);
1709 false output.url.or.doi % output_url_or_doi(false);
1710 end.bibitem % end_bibitem();
1711 } % }
1712 %
1713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1714 %
1715 FUNCTION {manuscript} { % void Entry::manuscript() {
1716 unpublished % unpublished();
1717 } % }
1718 %
1719 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1720 %
1721 FUNCTION {inbook.impl} { % void Entry::inbook_impl() {
1722 start.bibitem % start_bibitem();
1723 true output.author % output_author(true);
1724 true output.title % output_title(true);
1725 true output.mark % output_mark(true);
1726 false output.translator % output_translator(false);
1727 cap.double.slash write$ % write(cap_double_slash);
1728 false output.editor % output_editor(false);
1729 true output.series.volume.booktitle % output_series_volume_booktitle(true);
1730 false output.edition % output_edition(false);
1731 publisher empty$ not { % if (! empty(this.publisher)) {
1732 true output.address % output_address(true);
1733 true output.publisher % output_publisher(true);
1734 cap.comma write$ % write(cap_comma);
1735 } { % } else {
1736 cap.period write$ % write(cap_period);
1737 } if$ % }
1738 true output.year % output_year(true);
1739 false output.pages % output_pages(false);
1740 false output.citedate % output_citedate(false);
1741 false output.url.or.doi % output_url_or_doi(false);
1742 end.bibitem % end_bibitem();
1743 } % }
1744 %
1745 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1746 %
1747 FUNCTION {inbook} { % void Entry::inbook() {
1748 "M" set.mark % set_mark("M");
1749 inbook.impl % inbook_impl();
1750 } % }
1751 %
1752 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1753 %
1754 FUNCTION {incollection} { % void Entry::incollection() {
1755 "G" set.mark % set_mark("G");
1756 inbook.impl % inbook_impl();
1757 } % }
1758 %
1759 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1760 %
1761 FUNCTION {inproceedings} { % void Entry::inproceedings() {
1762 "C" set.mark % set_mark("C");
1763 inbook.impl % inbook_impl();
1764 } % }
1765 %
1766 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1767 %
1768 FUNCTION {article} { % void Entry::article() {
1769 "J" set.mark % set_mark("J");
1770 start.bibitem % start_bibitem();
1771 true output.author % output_author(true);
1772 true output.title % output_title(true);
1773 true output.mark % output_mark(true);
1774 true output.journal % output_journal(true);
1775 cap.comma write$ % write(cap_comma);
1776 true output.year % output_year(true);
1777 false output.volume % output_volume(false);
1778 false output.number % output_number(false);
1779 false output.pages % output_pages(false);
1780 false output.citedate % output_citedate(false);
1781 false output.url.or.doi % output_url_or_doi(false);
1782 end.bibitem % end_bibitem();
1783 } % }
1784 %
1785 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1786 %
1787 FUNCTION {news} { % void Entry::news() {
1788 "N" set.mark % set_mark("N");
1789 start.bibitem % start_bibitem();
1790 true output.author % output_author(true);
1791 true output.title % output_title(true);
1792 true output.mark % output_mark(true);
1793 true output.journal % output_journal(true);
1794 cap.comma write$ % write(cap_comma);
1795 true output.date % output_date(true);
1796 false output.number % output_number(false);
1797 false output.citedate % output_citedate(false);
1798 false output.url.or.doi % output_url_or_doi(false);
1799 end.bibitem % end_bibitem();
1800 } % }
1801 %
1802 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1803 %
1804 FUNCTION {default.type} { % void Entry::default_type() {
1805 "Unsupported entry type for " cite$ * warning$ % warning("Unsupported entry type for " + this.cite);
1806 } % }
1807 %
1808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1809 %
1810 FUNCTION {longest.label.pass} { % void longest_label_pass(Entry entry) {
1811 entry.count #1 + 'entry.count := % entry_count = entry_count + 1;
1812 entry.count int.to.str$ 'label := % this.label = int_to_str(entry_count);
1813 label width$ longest.label.width > { % if (width(this.label) > longest_label_width) {
1814 label 'longest.label := % longest_label = this.label;
1815 label width$ 'longest.label.width := % longest_label_width = width(this.label);
1816 } 'skip$ if$ % }
1817 } % }
1818 %
1819 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1820 %
1821 FUNCTION {write.style.commands} { % void write_style_commands() {
1822 cmd.bibauthor write$ % write(cmd_bibauthor);
1823 newline$ % writeln();
1824 cmd.bibeditor write$ % write(cmd_bibeditor);
1825 newline$ % writeln();
1826 cmd.bibtranslator write$ % write(cmd_bibtranslator);
1827 newline$ % writeln();
1828 cmd.bibtitle write$ % write(cmd_bibtitle);
1829 newline$ % writeln();
1830 cmd.bibbooktitle write$ % write(cmd_bibbooktitle);
1831 newline$ % writeln();
1832 cmd.bibjournal write$ % write(cmd_bibjournal);
1833 newline$ % writeln();
1834 cmd.bibmark write$ % write(cmd_bibmark);
1835 newline$ % writeln();
1836 cmd.bibcountry write$ % write(cmd_bibcountry);
1837 newline$ % writeln();
1838 cmd.bibpatentid write$ % write(cmd_bibpatentid);
1839 newline$ % writeln();
1840 cmd.bibedition write$ % write(cmd_bibedition);
1841 newline$ % writeln();
1842 cmd.biborganization write$ % write(cmd_biborganization);
1843 newline$ % writeln();
1844 cmd.bibaddress write$ % write(cmd_bibaddress);
1845 newline$ % writeln();
1846 cmd.bibpublisher write$ % write(cmd_bibpublisher);
1847 newline$ % writeln();
1848 cmd.bibinstitution write$ % write(cmd_bibinstitution);
1849 newline$ % writeln();
1850 cmd.bibschool write$ % write(cmd_bibschool);
1851 newline$ % writeln();
1852 cmd.bibvolume write$ % write(cmd_bibvolume);
1853 newline$ % writeln();
1854 cmd.bibnumber write$ % write(cmd_bibnumber);
1855 newline$ % writeln();
1856 cmd.bibversion write$ % write(cmd_bibversion);
1857 newline$ % writeln();
1858 cmd.bibpages write$ % write(cmd_bibpages);
1859 newline$ % writeln();
1860 cmd.bibmodifydate write$ % write(cmd_bibmodifydate);
1861 newline$ % writeln();
1862 cmd.bibcitedate write$ % write(cmd_bibcitedate);
1863 newline$ % writeln();
1864 cmd.bibyear write$ % write(cmd_bibyear);
1865 newline$ % writeln();
1866 cmd.bibdate write$ % write(cmd_bibdate);
1867 newline$ % writeln();
1868 cmd.biburl write$ % write(cmd_biburl);
1869 newline$ % writeln();
1870 } % }
1871 %
1872 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1873 %
1874 FUNCTION {begin.bib} { % void begin_bib() {
1875 preamble$ empty$ not { % if (! empty(premble)) {
1876 preamble$ write$ % write(premeable);
1877 newline$ % writeln();
1878 } 'skip$ if$ % }
1879 env.bibbegin write$ % write(env_bibbegin);
1880 "{" longest.label * "}" * write$ % write("{" + longest.label + "}");
1881 newline$ % writeln();
1882 write.style.commands % write_style_commands();
1883 } % }
1884 %
1885 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1886 %
1887 FUNCTION {end.bib} { % void end_bib() {
1888 newline$ % writeln();
1889 env.bibend write$ % write(env_bibend);
1890 newline$ % writeln();
1891 } % }
1892 %
1893 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1894 %
1895 FUNCTION {initialize} { % void initialize() {
1896 #0 'entry.count := % entry_count = 0;
1897 #0 'longest.label.width := % longest_label_width = 0;
1898 "" 'longest.label := % longest_label = "";
1899 } % }
1900 %
1901 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1902 %
1903 % void main() {
1904 READ % List<Entry> entryList = read("<file>.bib");
1905 EXECUTE {initialize} % initialize();
1906 ITERATE {longest.label.pass} % for (Entry entry : entryList) {
1907 % longest_label_pass(entry);
1908 % }
1909 EXECUTE {begin.bib} % begin_bib();
1910 ITERATE {call.type$} % for (Entry entry : entryList) {
1911 % switch (typeof(entry)) {
1912 % case "book":
1913 % entry.book();
1914 % break;
1915 % case "article":
1916 % entry.article();
1917 % break;
1918 % .
1919 % .
1920 % .
1921 % case "incollection":
1922 % entry.incollection();
1923 % break;
1924 % case "misc":
1925 % entry.misc();
1926 % break;
1927 % default:
1928 % entry.default_type();
1929 % }
1930 % }
1931 EXECUTE {end.bib} % end_bib();
1932 % }
1933 %
1934 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1935 %% End of file `GBT7714-2005.bst'