Debian Codegraph @

texmf-dist/bibtex/bst/spim-phdthesisthemes/spimphdthesis.bst

raw
1 %% DINAT.BST Version 2.6 2022-02-10
2 %% (c) 2000 Helge Baumann email:[email protected]
3 %% (c) 2020-2025 Stephane Galland email:[email protected]
4 %%------------------------------------------------------------------------------
5 %% For use with BibTeX version 0.99a or later.
6 %%------------------------------------------------------------------------------
7 %% Copying of this file is authorized only if either
8 %% (1) you make absolutely no changes to your copy, including name, or
9 %% (2) if you do make changes, you name it something other than dinat.bst,
10 %% natdin.bst, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
11 %% This restriction helps ensure that all standard styles are identical.
12 %%------------------------------------------------------------------------------
13 %% This is a full author-year citation style bibliography. As such, it is
14 %% non-standard LaTeX, and requires the natbib-package by Patrick W. Daly,
15 %% version 7 or higher to function properly.
16 %% It should be used with the following configuration in natbib.cfg:
17 %% \newcommand{\bibstyle@dinat}%
18 %% {\bibpunct{(}{)}{;}{a}{}{,~}%
19 %% \gdef\NAT@biblabelnum##1{\textbf{##1}}}
20 %%------------------------------------------------------------------------------
21 %% The form of the \bibitem entries is
22 %% \bibitem[Jones u. a.(1990)Jones, Baker und Smith]{key}...
23 %% If there are more [Jones u. a. 1990], a single character is added to
24 %% the year like in [Jones u.a.(1990{\natexlab{a}})Jones, Baker und Smith].
25 %% The resulting bibliography entry is
26 %% \textsc{Jones}, \textsc{Baker} und \textsc{Smith} ...
27 %% The \cite command functions as follows:
28 %% \cite{key} ==>> Jones u. a. (1990)
29 %% \cite[chap. 2]{key} ==>> (Jones u. a. 1990, chap. 2)
30 %% \cite[e.g.][]{key} ==>> (e.g. Jones u. a. 1990)
31 %% \cite[e.g.][p. 32]{key} ==>> (e.g. Jones u. a. p. 32)
32 %% \citep{key} ==>> (Jones u. a. 1990)
33 %% \citep*{key} ==>> (Jones, Baker und Smith 1990)
34 %% \citet{key} ==>> Jones u. a. (1990)
35 %% \citet*{key} ==>> Jones, Baker und Smith (1990)
36 %% \citeauthor{key} ==>> Jones u. a.
37 %% \citeauthor*{key} ==>> Jones, Baker und Smith
38 %% \citeyear{key} ==>> 1990
39 %%------------------------------------------------------------------------------
40 %% This bibliography style file is intended for texts in german.
41 %% It draws up bibliographies in accordance with the german DIN 1505,
42 %% part 2 and 3, as discribed in the german text
43 %% http://www.fh-hamburg.de/pers/Lorenzen/tum/litverz.ps
44 %%------------------------------------------------------------------------------
45 %% This style is based on the natdin.bst style.
46 %% The intention for designing a new style for the same result
47 %% were the many bugs and the poor design of the original style.
48 %% So i simplified the programming and add some comments for rework.
49 %% The names of the functions were changed to reflect their functionality:
50 %% out.*: write the top of the stack to the bbl-file
51 %% format.*: format the top of the stack
52 %% push.*: put one item on top of the stack
53 %%------------------------------------------------------------------------------
54 %% There are some non standard fields for most entries:
55 %% isbn: international book number
56 %% issn: internation journal number
57 %% url: for electronic published documents or additional information
58 %% if there is no publisher and address, the url is used instead,
59 %% else it acts like a additional note
60 %% urldate: the date of the access to the url
61 %%------------------------------------------------------------------------------
62 %% Author(s):
63 %% HB: Helge Baumann, [email protected]
64 %%------------------------------------------------------------------------------
65 %% History:
66 %% (only main changes are listed, for others see the webpage)
67 %% 2000-04-10 (HB): Initial release
68 %% 2000-04-18 (HB): Version 1.1:
69 %% corrected some typos and oversights
70 %% minor changes in output
71 %% 2000-04-25 (HB): Version 1.2:
72 %% dinat only: added \natexlab
73 %% using full key/cite for label
74 %% 2000-05-02 (HB): Version 2.0:
75 %% added urldate for date of visit
76 %% added labels in bibliography, so the seperate
77 %% style dinnat.bst is not needed anymore
78 %% 2000-05-09 (HB): Version 2.1:
79 %% removed blanc in bibpunct
80 %% put text ("u.\,a." ...) in functions
81 %% rebuild some push functions
82 %% changed \cite to \citep
83 %% removed push.crossref.editor (not used)
84 %% 2000-07-12 (HB): version 2.2:
85 %% added push.crossref
86 %% changed many crossrefs
87 %% corrected typos
88 %% put \, in curly braces
89 %% 2000-10-03 (HB): version 2.3:
90 %% changed remaining "u.~a."
91 %% added \labelsep behind dinatlabel
92 %% added mastersthesis again, keeping (wrong)
93 %% masterthesis (sorry for that)
94 %% minor changes in proceedings
95 %% 2000-11-05 (HB): version 2.4:
96 %% improved inbook
97 %% removed extra period from proceedings
98 %% added missing colon in misc
99 %% improved name formatting
100 %% removed long dashes from ISBN/ISSN
101 %% restructured format.dashes
102 %% 2000-11-14 (HB): version 2.5:
103 %% always use key for label if present
104 %% 2020-04-44 (SG): version 2.6:
105 %% #1 - Enable French and English translations
106 %% #2 - Add DOI
107 %% #3 - Underline the document's author name
108 %% #4 - Change graphical style to PhD thesis standard
109 %%------------------------------------------------------------------------------
110
111
112 %%------------------------------------------------------------------------------
113 %% push standard text items on top of the stack
114 %%------------------------------------------------------------------------------
115 %%%% (SG) Begin #1
116 FUNCTION {push.bd} { "\phdthesisbibVolume" }
117 FUNCTION {push.diplom} { "\phdthesisbibmasterthesis" }
118 FUNCTION {push.disser} { "\phdthesisbibphdthesis" }
119 FUNCTION {push.forschung} { "\phdthesisbibresearchreport" }
120 FUNCTION {push.hrsg} { "\phdthesisbibeditors" }
121 FUNCTION {push.in} { "\phdthesisbibIn" }
122 FUNCTION {push.isbn} { "ISBN\xspace" }
123 FUNCTION {push.issn} { "ISSN\xspace" }
124 %%%% (SG) Begin #2
125 FUNCTION {push.doi} { "DOI:\xspace" }
126 %%%% (SG) End #2
127 FUNCTION {push.kap} { "\phdthesisbibChapter" }
128 FUNCTION {push.nr} { "\phdthesisbibnumber" }
129 FUNCTION {push.sn} { "\phdthesisbibpages" }
130 FUNCTION {push.s} { "\phdthesisbibpages" }
131 FUNCTION {push.siehe} { "\phdthesisbibSee" }
132 FUNCTION {push.ua} { "\phdthesisbibetal" }
133 FUNCTION {push.und} { "\phdthesisbiband" }
134 FUNCTION {push.url.name} { "URL" }
135 FUNCTION {push.veranst} { "\phdthesisbibevent" }
136 FUNCTION {push.von} { "\phdthesisbibof" }
137 FUNCTION {push.zugriff} { "\phdthesisbibAccessDate" }
138 %%%% (SG) End #1
139
140 FUNCTION {push.cite} { "\citep" }
141
142
143 %%------------------------------------------------------------------------------
144 %% Definitions for every bibliography entry
145 %%------------------------------------------------------------------------------
146 ENTRY
147 % fields (crossref is default)
148 { address
149 author
150 booktitle
151 chapter
152 edition
153 editor
154 howpublished
155 institution
156 isbn
157 issn
158 %%%% (SG) Begin #2
159 doi
160 %%%% (SG) End #2
161 journal
162 key
163 month
164 note
165 number
166 organization
167 pages
168 publisher
169 school
170 series
171 title
172 type
173 url
174 urldate
175 volume
176 year
177 }
178 % INTEGERS
179 {}
180 % STRINGS (sort.key$ is default)
181 { label extra.label sort.label short.list dinat.label }
182
183
184 %%------------------------------------------------------------------------------
185 %% required macros for abbr. names of month
186 %%------------------------------------------------------------------------------
187
188 %%% (SG) Begin #1
189 MACRO {jan} {"\phdthesisbibJanuary"}
190
191 MACRO {feb} {"\phdthesisbibFebruary"}
192
193 MACRO {mar} {"\phdthesisbibMarch"}
194
195 MACRO {apr} {"\phdthesisbibApril"}
196
197 MACRO {may} {"\phdthesisbibMay"}
198
199 MACRO {jun} {"\phdthesisbibJune"}
200
201 MACRO {jul} {"\phdthesisbibJuly"}
202
203 MACRO {aug} {"\phdthesisbibAugust"}
204
205 MACRO {sep} {"\phdthesisbibSeptember"}
206
207 MACRO {oct} {"\phdthesisbibOctober"}
208
209 MACRO {nov} {"\phdthesisbibNovember"}
210
211 MACRO {dec} {"\phdthesisbibDecember"}
212 %%% (SG) End #1
213
214
215 %%------------------------------------------------------------------------------
216 %% macros for common journals
217 %%------------------------------------------------------------------------------
218 MACRO {acmcs} {"ACM Computing Surveys"}
219
220 MACRO {acta} {"Acta Informatica"}
221
222 MACRO {cacm} {"Communications of the ACM"}
223
224 MACRO {ibmjrd} {"IBM Journal of Research and Development"}
225
226 MACRO {ibmsj} {"IBM Systems Journal"}
227
228 MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
229
230 MACRO {ieeetc} {"IEEE Transactions on Computers"}
231
232 MACRO {ieeetcad}
233 {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
234
235 MACRO {ipl} {"Information Processing Letters"}
236
237 MACRO {jacm} {"Journal of the ACM"}
238
239 MACRO {jcss} {"Journal of Computer and System Sciences"}
240
241 MACRO {scp} {"Science of Computer Programming"}
242
243 MACRO {sicomp} {"SIAM Journal on Computing"}
244
245 MACRO {tocs} {"ACM Transactions on Computer Systems"}
246
247 MACRO {tods} {"ACM Transactions on Database Systems"}
248
249 MACRO {tog} {"ACM Transactions on Graphics"}
250
251 MACRO {toms} {"ACM Transactions on Mathematical Software"}
252
253 MACRO {toois} {"ACM Transactions on Office Information Systems"}
254
255 MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
256
257 MACRO {tcs} {"Theoretical Computer Science"}
258
259
260 %%------------------------------------------------------------------------------
261 %% for debugging (not used)
262 %%------------------------------------------------------------------------------
263 FUNCTION {show}
264 % show quoted top of stack
265 { duplicate$ ":::: `" swap$ * "'" * top$
266 }
267
268 FUNCTION {show.stack}
269 % show and clear whole stack
270 { "STACK====================================================================="
271 top$
272 stack$
273 "ENDSTACK=================================================================="
274 top$
275 }
276
277
278 %%------------------------------------------------------------------------------
279 %% logical functions
280 %%------------------------------------------------------------------------------
281 FUNCTION {not}
282 { { #0 }
283 { #1 }
284 if$
285 }
286
287 FUNCTION {and}
288 { { skip$ }
289 { pop$ #0 }
290 if$
291 }
292
293 FUNCTION {or}
294 { { pop$ #1 }
295 { skip$ }
296 if$
297 }
298
299
300 %%------------------------------------------------------------------------------
301 %% variables for the recent output state
302 %%------------------------------------------------------------------------------
303 INTEGERS { output.state
304 before.all
305 mid.sentence
306 after.sentence
307 after.block
308 colon.after
309 period.dash }
310
311 FUNCTION {init.state.consts}
312 % initialisation of the state variables
313 { #0 'before.all :=
314 #1 'mid.sentence :=
315 #2 'after.sentence :=
316 #3 'after.block :=
317 #4 'colon.after :=
318 #5 'period.dash :=
319 }
320
321 FUNCTION {set.period.dash}
322 % set ". -- "
323 { output.state before.all =
324 { skip$ }
325 { period.dash 'output.state := }
326 if$
327 }
328
329 FUNCTION {set.period.dash.check}
330 % only if not empty
331 { empty$
332 { skip$ }
333 { set.period.dash }
334 if$
335 }
336
337 FUNCTION {set.colon.after}
338 % set ": "
339 { output.state before.all =
340 { skip$ }
341 { colon.after 'output.state := }
342 if$
343 }
344
345 FUNCTION {new.sentence}
346 % set ". "
347 { output.state before.all =
348 { skip$ }
349 { after.sentence 'output.state := }
350 if$
351 }
352
353 FUNCTION {new.sentence.check}
354 % only if not empty
355 { empty$
356 { skip$ }
357 { new.sentence }
358 if$
359 }
360
361 FUNCTION {part.of.sentence}
362 % set ", "
363 { output.state before.all =
364 { skip$ }
365 { mid.sentence 'output.state := }
366 if$
367 }
368
369
370 %%------------------------------------------------------------------------------
371 %% output lines to bbl. file
372 %%------------------------------------------------------------------------------
373 STRINGS { h s t u v }
374
375 FUNCTION {out.block}
376 % writes the second but last element with seperator
377 { 's :=
378 output.state after.block =
379 { add.period$ write$
380 newline$
381 "\newblock " write$
382 }
383 { output.state before.all =
384 { write$ }
385 { output.state colon.after =
386 { ": " * write$
387 newline$
388 "\newblock " write$
389 }
390 { output.state period.dash =
391 { ". -- " * write$
392 newline$
393 "\newblock " write$
394 }
395 { output.state mid.sentence =
396 { ", " * write$ }
397 { write$
398 newline$
399 "\newblock " write$
400 }
401 if$
402 }
403 if$
404 }
405 if$
406 }
407 if$
408 after.block 'output.state :=
409 }
410 if$
411 s
412 }
413
414 FUNCTION {out}
415 % write only if not empty
416 { duplicate$ empty$
417 { pop$ }
418 { out.block }
419 if$
420 }
421
422 FUNCTION {out.check.required}
423 % write if not empty, else drop warning
424 { 't :=
425 duplicate$ empty$
426 { pop$ "empty " t * " in " * cite$ * warning$ }
427 { out.block }
428 if$
429 }
430
431 FUNCTION {out.check.din}
432 % write if not empty, else drop note
433 { 't :=
434 duplicate$ empty$
435 { pop$ "DIN: empty " t * " in " * cite$ * top$ }
436 { out.block }
437 if$
438 }
439
440
441 %%------------------------------------------------------------------------------
442 %% format entries for full author/editor citations
443 %%------------------------------------------------------------------------------
444 INTEGERS { nameptr namesleft pos len }
445
446 FUNCTION {format.full.names}
447 % format all names
448 { 's :=
449 ""
450 #1 'nameptr :=
451 s num.names$ 'namesleft :=
452 { namesleft #0 > } % while
453 { s nameptr "{vv~}{ll}" format.name$ 't :=
454 nameptr #1 =
455 { % first name
456 t *
457 }
458 { namesleft #1 =
459 { % last name
460 t "others" =
461 { " " * push.ua * }
462 { " " * push.und * " " * t * }
463 if$
464 }
465 { % other names
466 ", " * t *
467 }
468 if$
469 }
470 if$
471 nameptr #1 + 'nameptr :=
472 namesleft #1 - 'namesleft :=
473 }
474 while$ % { namesleft #0 > }
475 }
476
477 FUNCTION {key.full}
478 { key empty$
479 { cite$ }
480 { key }
481 if$
482 }
483
484 FUNCTION {author.key.full}
485 { author empty$
486 { key.full }
487 { author format.full.names }
488 if$
489 }
490
491 FUNCTION {editor.key.full}
492 { editor empty$
493 { key.full }
494 { editor format.full.names }
495 if$
496 }
497
498 FUNCTION {author.editor.key.full}
499 { author empty$
500 { editor.key.full }
501 { author format.full.names }
502 if$
503 }
504
505 FUNCTION {make.full.names}
506 { type$ "book" =
507 type$ "inbook" =
508 or
509 { author.editor.key.full }
510 { type$ "proceedings" =
511 { editor.key.full }
512 { author.key.full }
513 if$
514 }
515 if$
516 }
517
518
519 %%------------------------------------------------------------------------------
520 %% write bibentry to bbl. file
521 %%------------------------------------------------------------------------------
522 FUNCTION {out.bibitem.start}
523 % start of entry
524 { newline$
525 "\bibitem[" label * ")" *
526 make.full.names
527 duplicate$ short.list =
528 { pop$ }
529 { * }
530 if$
531 "]{" * cite$ * "}" *
532 write$
533 newline$
534 "\dinatlabel{" dinat.label * "} " *
535 write$
536 ""
537 before.all 'output.state :=
538 }
539
540 FUNCTION {out.bibitem.end}
541 % end of entry
542 { write$
543 newline$
544 }
545
546
547 %%------------------------------------------------------------------------------
548 %% format text
549 %%------------------------------------------------------------------------------
550 FUNCTION {format.emphasize}
551 % emphasize top of stack
552 { duplicate$ empty$
553 { pop$ "" }
554 %%%% (SG) Begin #4
555 { "\phdthesisbibemph{" swap$ * "}" * }
556 %%%% (SG) End #4
557 if$
558 }
559
560 %%%% (SG) Begin #4
561 FUNCTION {format.strong.emphasize}
562 % strong emphasize top of stack
563 { duplicate$ empty$
564 { pop$ "" }
565 { "\phdthesisbibEmph{" swap$ * "}" * }
566 if$
567 }
568
569 FUNCTION {format.quote}
570 % put quotes around the top of stack
571 { duplicate$ empty$
572 { pop$ "" }
573 { "``" swap$ * "''" * }
574 if$
575 }
576 %%%% (SG) End #4
577
578 FUNCTION {format.smallcaps}
579 % top of stack in small caps
580 { duplicate$ empty$
581 { pop$ "" }
582 { "\textsc{" swap$ * "}" * }
583 if$
584 }
585
586 FUNCTION {format.dashes}
587 % replace single dashes (-) with tex-styled dashes (--)
588 { 't :=
589 ""
590 { t empty$ not } % while$
591 { t #1 #2 substring$ "--" =
592 { { t #1 #1 substring$ "-" = }
593 { "-" *
594 t #2 global.max$ substring$ 't :=
595 }
596 while$
597 }
598 { t #1 #1 substring$ "-" =
599 { "--" * }
600 { t #1 #1 substring$ * }
601 if$
602 t #2 global.max$ substring$ 't :=
603 }
604 if$
605 }
606 while$ % { t empty$ not }
607 }
608
609
610 %%------------------------------------------------------------------------------
611 %% manipulte entries on the stack
612 %%------------------------------------------------------------------------------
613 FUNCTION {tie.or.space.connect}
614 % connect two top items with space or ~, if second is shorter than 3
615 { duplicate$ text.length$ #3 <
616 { "~" }
617 { " " }
618 if$
619 swap$ * *
620 }
621
622 FUNCTION {push.field.or.null}
623 % push an empty item on the stack if it's a missing entry
624 { duplicate$ empty$
625 { pop$ "" }
626 { skip$ }
627 if$
628 }
629
630
631 %%------------------------------------------------------------------------------
632 %% format text on stack
633 %%------------------------------------------------------------------------------
634 STRINGS { hrsg }
635
636 %%%% (SG) Begin #3
637 STRINGS { nt }
638 %%%% (SG) End #3
639
640 FUNCTION {format.names}
641 % format all names on top of stack
642 { 's :=
643 ""
644 #1 'nameptr :=
645 s num.names$ 'namesleft :=
646 { namesleft #0 > } % while names left
647 {
648 % first get last name in small caps
649 s nameptr "{ll}" format.name$ 't :=
650 t format.smallcaps 't :=
651 % second get all first names
652 s nameptr "{, ff}" format.name$ 'u :=
653 u text.length$ 'len :=
654 #1 'pos :=
655 "" 'v :=
656 { pos len < } % while
657 { u pos #1 substring$ "~" =
658 { v "" =
659 { u #1 pos #1 - substring$ 'v := }
660 { skip$ }
661 if$
662 % cut second and more first names
663 v u pos #2 substring$ * "." * 'v :=
664 }
665 { skip$ }
666 if$
667 pos #1 + 'pos :=
668 }
669 while$ % { pos len < }
670 v "" =
671 { u 'v := }
672 { skip$ }
673 if$
674 % third get all "von"
675 s nameptr "{ vv}" format.name$ 'u :=
676 %%%% (SG) Begin #3
677 s nameptr "{ll}" format.name$ purify$ "l" change.case$ 'nt :=
678 % put it all together
679 "\underlineifauthor{" nt * "}{" *
680 t * v * u * hrsg *
681 "}" * 't :=
682 %%%% (SG) End #3
683
684 nameptr #1 =
685 { %first name
686 t *
687 }
688 { namesleft #1 =
689 { % last name
690 t "others" format.smallcaps =
691 t "others" format.smallcaps hrsg * =
692 or
693 { " " * push.ua * }
694 { "~; " * t * }
695 if$
696 }
697 { % other names
698 "~; " * t *
699 }
700 if$
701 }
702 if$
703 nameptr #1 + 'nameptr :=
704 namesleft #1 - 'namesleft :=
705 }
706 while$ % { namesleft #0 > }
707 "" 'hrsg :=
708 }
709
710
711 %%------------------------------------------------------------------------------
712 %% push formatted or empty field(s) on top of the stack
713 %%------------------------------------------------------------------------------
714 FUNCTION {push.authors}
715 % format author names
716 { author empty$
717 { "" }
718 { author format.names }
719 if$
720 }
721
722 FUNCTION {push.editors}
723 % format editor names
724 { editor empty$
725 { "" }
726 { " (" push.hrsg * ")" * 'hrsg :=
727 editor format.names
728 }
729 if$
730 }
731
732 FUNCTION {push.authors.editors}
733 % format author and/or editor names
734 { author empty$
735 { push.editors }
736 { push.authors
737 editor empty$
738 { skip$ }
739 { "~; " * push.editors * }
740 if$
741 }
742 if$
743 }
744
745
746 FUNCTION {push.organization}
747 % format organization
748 { organization empty$
749 { "" }
750 { organization
751 " (" * push.veranst * ")" *
752 }
753 if$
754 }
755
756 FUNCTION {push.title}
757 % title as in entry
758 { title empty$
759 { "" }
760 %%%% (SG) Begin #4
761 { title format.quote format.strong.emphasize }
762 %%%% (SG) End #4
763 if$
764 }
765
766 FUNCTION {push.url}
767 % prefixed with "URL" and special formatting
768 { url empty$
769 { "" }
770 { push.url.name " \url{" * url * "}" *
771 urldate empty$
772 { skip$ }
773 { ". -- " * push.zugriff * ": " * urldate * }
774 if$
775 }
776 if$
777 }
778
779 FUNCTION {push.date}
780 % format: month year
781 { year empty$
782 { month empty$
783 { "" }
784 { "there's a month but no year in " cite$ * warning$
785 month
786 }
787 if$
788 }
789 { month empty$
790 { year }
791 { month " " * year * }
792 if$
793 }
794 if$
795 }
796
797 FUNCTION {push.address.publisher.year}
798 % the whole imprint
799 { address empty$
800 { publisher empty$
801 { url empty$
802 { year empty$
803 { "no publisher, address, url or date in " cite$ * warning$
804 "" }
805 { push.date }
806 if$
807 }
808 { "no proper publisher, using url in " cite$ * warning$
809 push.url
810 year empty$
811 { skip$ }
812 { ", " * push.date * }
813 if$
814 }
815 if$
816 }
817 { publisher
818 year empty$
819 { "there's a publisher but no year in " cite$ * warning$ }
820 { ", " * push.date * }
821 if$
822 }
823 if$
824 }
825 { address
826 publisher empty$
827 { "there's an address but no publisher in " cite$ * warning$ }
828 { "~: " * publisher * }
829 if$
830 year empty$
831 { skip$ }
832 { ", " * push.date * }
833 if$
834 }
835 if$
836 }
837
838 FUNCTION {push.btitle}
839 % the booktitle
840 { title empty$
841 { "" }
842 { title format.emphasize }
843 if$
844 }
845
846 FUNCTION {push.btitle.vol}
847 % booktitle in multivolume works
848 { number empty$
849 { series empty$
850 { push.btitle
851 volume empty$
852 { skip$ }
853 { ". " * push.bd * volume tie.or.space.connect }
854 if$
855 }
856 { volume empty$
857 { push.btitle }
858 { series format.emphasize ". " *
859 push.bd * volume tie.or.space.connect
860 ": " * push.btitle *
861 }
862 if$
863 }
864 if$
865 }
866 { push.btitle }
867 if$
868 }
869
870 FUNCTION {push.article.in.journal}
871 % source of article
872 { journal empty$
873 { "" }
874 { author missing$
875 title missing$
876 and
877 { journal format.emphasize }
878 { push.in " " * journal format.emphasize * }
879 if$
880 }
881 if$
882 }
883
884 FUNCTION {push.series.number}
885 % series and number like DIN
886 { volume empty$
887 { series empty$
888 { number empty$
889 { "" }
890 { "there's a number but no series in " cite$ * warning$
891 "(" number * ")" * }
892 if$
893 }
894 { "(" series *
895 number empty$
896 { skip$ }
897 { number tie.or.space.connect }
898 if$
899 ")" *
900 }
901 if$
902 }
903 { series empty$
904 { "" }
905 { type$ "proceedings" =
906 { "(" series *
907 number empty$
908 { skip$ }
909 { number tie.or.space.connect }
910 if$
911 ")" *
912 }
913 { "" }
914 if$
915 }
916 if$
917 }
918 if$
919 }
920
921 FUNCTION {push.misc.series}
922 % series in MISC
923 { series empty$
924 { "" }
925 { "(" series * ")" * }
926 if$
927 }
928
929 FUNCTION {push.edition}
930 % like in entry
931 { edition empty$
932 { "" }
933 { edition }
934 if$
935 }
936
937 FUNCTION {push.isbn.issn}
938 % preceeded with ISSN/ISBN
939 { isbn empty$
940 { issn empty$
941 { "" }
942 { push.issn " " * issn * }
943 if$
944 }
945 { push.isbn " " * isbn * }
946 if$
947 }
948
949 %%%% (SG) Begin #2
950 FUNCTION {push.doi.link}
951 % preceeded with DOI and add hyperref link
952 { doi empty$
953 { "" }
954 { push.doi "\href{http://www.doi.org/" * doi * "}{" * doi * "}" * }
955 if$
956 }
957 %%%% (SG) End #2
958
959 FUNCTION {push.pages.book}
960 % as length of a book
961 { pages empty$
962 { "" }
963 { pages format.dashes "~" * push.sn * }
964 if$
965 }
966
967 FUNCTION {push.pages}
968 % as part of a book
969 { pages empty$
970 { "" }
971 { push.s "~" * pages format.dashes * }
972 if$
973 }
974
975 FUNCTION {push.vol.year.num.pages}
976 % for journals etc.
977 { volume push.field.or.null
978 year empty$
979 { "there's no year in " cite$ * warning$ }
980 { duplicate$ empty$
981 { pop$ "(" }
982 { " (" * }
983 if$
984 year * ")" *
985 }
986 if$
987 month empty$
988 { skip$ }
989 { duplicate$ empty$
990 { pop$ month }
991 { ", " * month * }
992 if$
993 }
994 if$
995 number empty$
996 { skip$ }
997 { duplicate$ empty$
998 { pop$ push.nr }
999 { ", " * push.nr * }
1000 if$
1001 "~" * number *
1002 }
1003 if$
1004 pages empty$
1005 { skip$ }
1006 { duplicate$ empty$
1007 { skip$ }
1008 { ", " *
1009 title missing$
1010 { push.pages.book * }
1011 { push.pages * }
1012 if$
1013 }
1014 if$
1015 }
1016 if$
1017 }
1018
1019 FUNCTION {push.chapter.pages}
1020 % chapter and pages
1021 { chapter empty$
1022 { push.pages }
1023 { type empty$
1024 { push.kap }
1025 { type }
1026 if$
1027 chapter tie.or.space.connect
1028 pages empty$
1029 { skip$ }
1030 { ", " * push.pages * }
1031 if$
1032 }
1033 if$
1034 }
1035
1036 FUNCTION {push.in.ed.booktitle}
1037 % main title and volume
1038 { booktitle empty$
1039 { "" }
1040 { push.in " " *
1041 editor empty$
1042 { skip$ }
1043 { push.editors * ": " * }
1044 if$
1045 booktitle format.emphasize *
1046 volume empty$
1047 { skip$ }
1048 { " " * push.bd * "~" * volume * }
1049 if$
1050 }
1051 if$
1052 }
1053
1054 FUNCTION {push.mastersthesis.type}
1055 % type of a mastersthesis
1056 { type empty$
1057 { push.diplom }
1058 { type }
1059 if$
1060 }
1061
1062 FUNCTION {push.phdthesis.type}
1063 % type of a phdthesis
1064 { type empty$
1065 { push.disser }
1066 { type }
1067 if$
1068 }
1069
1070 FUNCTION {push.tr.number}
1071 % type and number of a technical report
1072 { number empty$
1073 { " " }
1074 { "(" number * "). " * }
1075 if$
1076 "-- " *
1077 type empty$
1078 { push.forschung * }
1079 { type * }
1080 if$
1081 }
1082
1083 FUNCTION {push.article.crossref}
1084 % article from a journal
1085 { key empty$
1086 { journal empty$
1087 { "need key or journal for " cite$ * " to crossref " * crossref *
1088 warning$
1089 ""
1090 }
1091 { push.in " " * journal format.emphasize * }
1092 if$
1093 }
1094 { push.in " " * key * }
1095 if$
1096 " " * push.cite * "{" * crossref * "}" *
1097 pages empty$
1098 { skip$ }
1099 { ", " * push.pages * }
1100 if$
1101 }
1102
1103 FUNCTION {push.book.crossref}
1104 % crossreference in BOOKs
1105 { volume empty$
1106 { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
1107 push.siehe
1108 }
1109 { ". -- " push.bd * "~" * volume *
1110 " " * push.von *
1111 }
1112 if$
1113 " " * push.cite * "{" * crossref * "}" *
1114 }
1115
1116 FUNCTION {push.incoll.inproc.crossref}
1117 % crossreference with In:
1118 { editor empty$
1119 editor push.field.or.null author push.field.or.null =
1120 or
1121 { key empty$
1122 { booktitle empty$
1123 { push.siehe }
1124 { push.in " " * booktitle format.emphasize * "." * }
1125 if$
1126 }
1127 { push.in }
1128 if$
1129 }
1130 { push.in }
1131 if$
1132 " " * push.cite * "{" * crossref * "}" *
1133 chapter empty$
1134 { skip$ }
1135 { ", " *
1136 type empty$
1137 { push.kap * }
1138 { type * }
1139 if$
1140 chapter tie.or.space.connect
1141 }
1142 if$
1143 pages empty$
1144 { skip$ }
1145 { ", " * push.pages * }
1146 if$
1147 }
1148
1149 FUNCTION {push.crossref}
1150 % a simple crossref
1151 { crossref empty$
1152 { "" }
1153 { push.siehe " " * push.cite * "{" * crossref * "}" * }
1154 if$
1155 }
1156
1157
1158 %%------------------------------------------------------------------------------
1159 %% functions for the different entries
1160 %%------------------------------------------------------------------------------
1161 FUNCTION {article}
1162 % required: author, title, journal, year
1163 % optional: volume, number, pages, month, note, url, issn
1164 { out.bibitem.start
1165 push.authors "author" out.check.required
1166 set.colon.after
1167 push.title "title" out.check.required
1168 crossref missing$
1169 { push.article.in.journal out.block
1170 new.sentence
1171 push.vol.year.num.pages out
1172 }
1173 { push.article.crossref out.block }
1174 if$
1175 url set.period.dash.check
1176 push.url out
1177 note set.period.dash.check
1178 note out
1179 issn set.period.dash.check
1180 push.isbn.issn out
1181 %%%% (SG) Begin #2
1182 push.doi.link out
1183 %%%% (SG) End #2
1184 out.bibitem.end
1185 }
1186
1187 FUNCTION {book}
1188 % required: author/editor, title, publisher, year
1189 % optional: volume oder number, series, address, edition, pages, month,
1190 % note, url, isbn
1191 { out.bibitem.start
1192 author empty$
1193 { push.editors "author and editor" out.check.required }
1194 { push.authors.editors out.block }
1195 if$
1196 set.colon.after
1197 crossref missing$
1198 { push.btitle.vol }
1199 { push.btitle }
1200 if$
1201 "title" out.check.required
1202 push.edition out
1203 push.address.publisher.year "publisher" out.check.required
1204 new.sentence
1205 crossref missing$
1206 { push.series.number out }
1207 { push.book.crossref out.block }
1208 if$
1209 pages set.period.dash.check
1210 push.pages.book out
1211 address empty$
1212 publisher empty$
1213 and
1214 { skip$ }
1215 { url set.period.dash.check
1216 push.url out
1217 }
1218 if$
1219 note set.period.dash.check
1220 note out
1221 isbn set.period.dash.check
1222 push.isbn.issn out
1223 %%%% (SG) Begin #2
1224 push.doi.link out
1225 %%%% (SG) End #2
1226 out.bibitem.end
1227 }
1228
1229 % booklet see below
1230
1231 % conference see below
1232
1233 FUNCTION {inbook}
1234 % required: author/editor, title, chapter/pages, publisher, year
1235 % optional: volume oder number, series, type, address, month, note, url, isbn
1236 { out.bibitem.start
1237 author empty$
1238 { push.editors "author and editor" out.check.required }
1239 { push.authors out.block }
1240 if$
1241 set.colon.after
1242 push.btitle.vol "title" out.check.required
1243 push.chapter.pages out
1244 crossref missing$
1245 { push.in.ed.booktitle "booktitle" out.check.required
1246 address empty$
1247 { part.of.sentence
1248 push.address.publisher.year out
1249 }
1250 { push.address.publisher.year "publisher" out.check.required }
1251 if$
1252 new.sentence
1253 series empty$
1254 { skip$ }
1255 { push.series.number out }
1256 if$
1257 part.of.sentence
1258 address empty$
1259 publisher empty$
1260 and
1261 { skip$ }
1262 { url set.period.dash.check
1263 push.url out
1264 }
1265 if$
1266 }
1267 { push.crossref out.block
1268 url set.period.dash.check
1269 push.url out
1270 }
1271 if$
1272 note set.period.dash.check
1273 note out
1274 isbn set.period.dash.check
1275 push.isbn.issn out
1276 %%%% (SG) Begin #2
1277 push.doi.link out
1278 %%%% (SG) End #2
1279 out.bibitem.end
1280 }
1281
1282 FUNCTION {incollection}
1283 % required: author, title, booktitle, publisher, year
1284 % optional: editor, volume oder number, series, type, chapter,
1285 % pages, address, edition, month, note, url
1286 { out.bibitem.start
1287 push.authors "author" out.check.required
1288 set.colon.after
1289 push.title "title" out.check.required
1290 crossref missing$
1291 { push.in.ed.booktitle "booktitle" out.check.required
1292 push.edition out
1293 push.address.publisher.year "publisher" out.check.required
1294 new.sentence
1295 push.series.number out
1296 part.of.sentence
1297 push.chapter.pages "pages" out.check.required
1298 address empty$
1299 publisher empty$
1300 and
1301 { skip$ }
1302 { url set.period.dash.check
1303 push.url out
1304 }
1305 if$
1306 }
1307 { push.incoll.inproc.crossref out.block
1308 url set.period.dash.check
1309 push.url out
1310 }
1311 if$
1312 note set.period.dash.check
1313 note out
1314 isbn set.period.dash.check
1315 issn set.period.dash.check
1316 push.isbn.issn out
1317 %%%% (SG) Begin #2
1318 push.doi.link out
1319 %%%% (SG) End #2
1320 out.bibitem.end
1321 }
1322
1323 FUNCTION {inproceedings}
1324 % required: author, title, booktitle, year
1325 % optional: editor, volume oder number, series, pages, address, month,
1326 % organization, publisher, note, url
1327 { out.bibitem.start
1328 push.authors "author" out.check.required
1329 set.colon.after
1330 push.title "title" out.check.required
1331 crossref missing$
1332 { push.in.ed.booktitle "booktitle" out.check.required
1333 address empty$
1334 { organization new.sentence.check
1335 push.organization out
1336 part.of.sentence
1337 push.address.publisher.year out
1338 }
1339 { push.address.publisher.year "publisher" out.check.required }
1340 if$
1341 new.sentence
1342 series empty$
1343 { skip$ }
1344 { push.series.number out }
1345 if$
1346 part.of.sentence
1347 push.pages "pages" out.check.required
1348 address empty$
1349 publisher empty$
1350 and
1351 { skip$ }
1352 { url set.period.dash.check
1353 push.url out
1354 }
1355 if$
1356 }
1357 { push.incoll.inproc.crossref out.block
1358 url set.period.dash.check
1359 push.url out
1360 }
1361 if$
1362 note set.period.dash.check
1363 note out
1364 isbn set.period.dash.check
1365 issn set.period.dash.check
1366 push.isbn.issn out
1367 %%%% (SG) Begin #2
1368 push.doi.link out
1369 %%%% (SG) End #2
1370 out.bibitem.end
1371 }
1372
1373 FUNCTION {manual}
1374 % required: title
1375 % optional: author, organization, address, edition, month, year, note, url
1376 { out.bibitem.start
1377 author empty$
1378 { organization empty$
1379 { title empty$
1380 { skip$ }
1381 { push.btitle "title" out.check.required }
1382 if$
1383 }
1384 { push.organization out.block
1385 set.colon.after
1386 push.btitle "title" out.check.required
1387 }
1388 if$
1389 }
1390 { push.authors out.block
1391 set.colon.after
1392 push.btitle "title" out.check.required
1393 }
1394 if$
1395 push.edition "edition" out.check.required
1396 author empty$
1397 { organization empty$
1398 { address out
1399 part.of.sentence
1400 }
1401 { skip$ }
1402 if$
1403 }
1404 { address ": " * push.organization * out
1405 part.of.sentence
1406 }
1407 if$
1408 push.date out
1409 pages set.period.dash.check
1410 push.pages.book out
1411 url set.period.dash.check
1412 push.url out
1413 note set.period.dash.check
1414 note out
1415 out.bibitem.end
1416 }
1417
1418 FUNCTION {mastersthesis}
1419 % required: author, title, school, year
1420 % optional: type, address, month, note, url
1421 { out.bibitem.start
1422 push.authors "author" out.check.required
1423 set.colon.after
1424 push.btitle "title" out.check.required
1425 address out
1426 part.of.sentence
1427 school "school" out.check.required
1428 part.of.sentence
1429 push.mastersthesis.type out.block
1430 part.of.sentence
1431 push.date "year" out.check.required
1432 pages set.period.dash.check
1433 push.pages.book out
1434 url set.period.dash.check
1435 push.url out
1436 note set.period.dash.check
1437 note out
1438 out.bibitem.end
1439 }
1440
1441 FUNCTION {misc}
1442 % required:
1443 % optional: author, title, howpublished, month, year, note, url
1444 { out.bibitem.start
1445 note empty$
1446 { title empty$
1447 { skip$ }
1448 { push.authors.editors out.block
1449 set.colon.after
1450 push.btitle out
1451 howpublished out
1452 push.date out
1453 push.crossref out
1454 url set.period.dash.check
1455 push.url out
1456 }
1457 if$
1458 }
1459 { note #1 #4 substring$ "u" change.case$ "NORM" =
1460 { note out
1461 part.of.sentence
1462 push.date out
1463 push.title format.emphasize out
1464 push.crossref out
1465 }
1466 { author empty$
1467 { editor empty$
1468 { organization empty$
1469 { skip$ }
1470 { push.organization out.block
1471 set.colon.after
1472 }
1473 if$
1474 }
1475 { push.editors push.organization * out.block
1476 set.colon.after
1477 }
1478 if$
1479 }
1480 { push.authors.editors out.block
1481 set.colon.after
1482 }
1483 if$
1484 push.btitle out
1485 push.crossref out
1486 howpublished out
1487 push.date out
1488 new.sentence
1489 push.misc.series out
1490 url set.period.dash.check
1491 push.url out
1492 note set.period.dash.check
1493 note out
1494 }
1495 if$
1496 }
1497 if$
1498 out.bibitem.end
1499 }
1500
1501 FUNCTION {phdthesis}
1502 % required: author, title, school, year
1503 % optional: type, address, month, note, url
1504 { out.bibitem.start
1505 push.authors "author" out.check.required
1506 set.colon.after
1507 push.btitle "title" out.check.required
1508 address out
1509 part.of.sentence
1510 school "school" out.check.required
1511 part.of.sentence
1512 push.phdthesis.type out.block
1513 part.of.sentence
1514 push.date "year" out.check.required
1515 pages set.period.dash.check
1516 push.pages.book out
1517 url set.period.dash.check
1518 push.url out
1519 note set.period.dash.check
1520 note out
1521 out.bibitem.end
1522 }
1523
1524 FUNCTION {proceedings}
1525 % required: title, year
1526 % optional: editor, volume oder number, series, address, month,
1527 % organization, publisher, note, url
1528 { out.bibitem.start
1529 editor empty$
1530 { push.organization }
1531 { push.editors
1532 organization empty$
1533 { skip$ }
1534 { "~; " * push.organization * }
1535 if$
1536 }
1537 if$
1538 out.block
1539 set.colon.after
1540 push.btitle "title" out.check.required
1541 volume empty$
1542 { skip$ }
1543 { push.bd "~" * volume format.emphasize * out.block }
1544 if$
1545 push.address.publisher.year "publisher" out.check.required
1546 push.series.number out
1547 pages set.period.dash.check
1548 push.pages.book out
1549 address empty$
1550 publisher empty$
1551 and
1552 { skip$ }
1553 { url set.period.dash.check
1554 push.url out
1555 }
1556 if$
1557 note set.period.dash.check
1558 note out
1559 isbn set.period.dash.check
1560 issn set.period.dash.check
1561 push.isbn.issn out
1562 %%%% (SG) Begin #2
1563 push.doi.link out
1564 %%%% (SG) End #2
1565 out.bibitem.end
1566 }
1567
1568 FUNCTION {techreport}
1569 % required: author, title, institution, year
1570 % optional: type, number, address, month, note, url
1571 { out.bibitem.start
1572 author empty$
1573 { push.editors "author and editor" out.check.required }
1574 { push.authors.editors out.block }
1575 if$
1576 set.colon.after
1577 push.title "title" out.check.required
1578 institution empty$
1579 { skip$ }
1580 { institution new.sentence.check
1581 "/ " institution * out.block
1582 }
1583 if$
1584 push.address.publisher.year out
1585 number new.sentence.check
1586 push.tr.number "number" out.check.required
1587 pages set.period.dash.check
1588 push.pages.book out
1589 address empty$
1590 publisher empty$
1591 and
1592 { skip$ }
1593 { url set.period.dash.check
1594 push.url out
1595 }
1596 if$
1597 note "note" out.check.required
1598 isbn set.period.dash.check
1599 issn set.period.dash.check
1600 push.isbn.issn out
1601 %%%% (SG) Begin #2
1602 push.doi.link out
1603 %%%% (SG) End #2
1604 out.bibitem.end
1605 }
1606
1607 FUNCTION {booklet}
1608 % required: title
1609 % optional: author, howpublished, address, month, year, note, url
1610 { misc % so far
1611 }
1612
1613 FUNCTION {conference}
1614 % required: author, title, note
1615 % optional: month, year, url
1616 { inproceedings % like stated in BibTeXing by O. Patashnik
1617 }
1618
1619 FUNCTION {masterthesis}
1620 % required: author, title, school, year
1621 % optional: type, address, month, note, url
1622 { mastersthesis % just because of a typo in former version
1623 }
1624
1625 FUNCTION {unpublished}
1626 % required: author, title, note
1627 % optional: month, year, url
1628 { misc % so far
1629 }
1630
1631 FUNCTION {default.type}
1632 % all other types
1633 { misc
1634 }
1635
1636
1637 %%------------------------------------------------------------------------------
1638 %% for producing the labels
1639 %%------------------------------------------------------------------------------
1640 FUNCTION {sortify}
1641 % simplify for sorting
1642 { purify$
1643 "l" change.case$
1644 }
1645
1646 FUNCTION {chop.word}
1647 % cut a word
1648 { 's :=
1649 'len :=
1650 s #1 len substring$ =
1651 { s len #1 + global.max$ substring$ }
1652 { s }
1653 if$
1654 }
1655
1656 FUNCTION {chop.article}
1657 % cut article from a word
1658 { 't :=
1659 "A " #2
1660 "An " #3
1661 "Der " #4
1662 "Die " #4
1663 "Das " #4
1664 "Ein " #4
1665 "Eine " #5
1666 "The " #4 t chop.word
1667 chop.word
1668 chop.word
1669 chop.word
1670 chop.word
1671 chop.word
1672 chop.word
1673 chop.word
1674 }
1675
1676
1677 FUNCTION {format.lab.names}
1678 % format names for the label
1679 { 's :=
1680 s #1 "{vv~}{ll}" format.name$
1681 s num.names$ duplicate$
1682 #2 >
1683 { pop$ " " * push.ua * }
1684 { #2 <
1685 { skip$ }
1686 { s #2 "{ll}" format.name$ "others" =
1687 { " " * push.ua * }
1688 { " " * push.und * " " * s #2 "{vv~}{ll}" format.name$ * }
1689 if$
1690 }
1691 if$
1692 }
1693 if$
1694 }
1695
1696 FUNCTION {author.label}
1697 % label from key or author
1698 { key empty$
1699 { author empty$
1700 { cite$ }
1701 { author format.lab.names }
1702 if$
1703 }
1704 { key }
1705 if$
1706 }
1707
1708 FUNCTION {author.editor.label}
1709 % label from key, author or editor
1710 { key empty$
1711 { author empty$
1712 { editor empty$
1713 { cite$ }
1714 { editor format.lab.names }
1715 if$
1716 }
1717 { author format.lab.names }
1718 if$
1719 }
1720 { key }
1721 if$
1722 }
1723
1724 FUNCTION {author.organization.label}
1725 % label from key, author or organization
1726 { key empty$
1727 { author empty$
1728 { organization empty$
1729 { cite$ }
1730 { organization chop.article }
1731 if$
1732 }
1733 { author format.lab.names }
1734 if$
1735 }
1736 { key }
1737 if$
1738 }
1739
1740 FUNCTION {editor.organization.label}
1741 % label from key, editor or organization
1742 { key empty$
1743 { editor empty$
1744 { organization empty$
1745 { cite$ }
1746 { organization chop.article }
1747 if$
1748 }
1749 { editor format.lab.names }
1750 if$
1751 }
1752 { key }
1753 if$
1754 }
1755
1756 FUNCTION {calc.short.authors}
1757 % make short label (only first author)
1758 { type$ "book" =
1759 type$ "inbook" =
1760 or
1761 { author.editor.label }
1762 { type$ "proceedings" =
1763 { editor.organization.label }
1764 { type$ "manual" =
1765 { author.organization.label }
1766 { author.label }
1767 if$
1768 }
1769 if$
1770 }
1771 if$
1772 'short.list :=
1773 }
1774
1775 FUNCTION {calc.label}
1776 % make a full label
1777 { calc.short.authors
1778 short.list "(" *
1779 year push.field.or.null format.dashes * 'label :=
1780 short.list " " *
1781 year push.field.or.null format.dashes * 'dinat.label :=
1782 label sortify 'sort.label :=
1783 }
1784
1785
1786 %%------------------------------------------------------------------------------
1787 %% sorting
1788 %%------------------------------------------------------------------------------
1789 FUNCTION {sort.format.names}
1790 % format names for sorting
1791 { 's :=
1792 #1 'nameptr :=
1793 ""
1794 s num.names$ 'namesleft :=
1795 { namesleft #0 > } % while
1796 { nameptr #1 =
1797 { skip$ }
1798 { " " * }
1799 if$
1800 s nameptr "{ll{ }}{ ff{ }}{ vv{ }}{ jj{ }}" format.name$ 't :=
1801 namesleft #1 =
1802 t "others" =
1803 and
1804 { "[" * push.ua * "]" * }
1805 { t sortify * }
1806 if$
1807 nameptr #1 + 'nameptr :=
1808 namesleft #1 - 'namesleft :=
1809 }
1810 while$ % { namesleft #0 > }
1811 }
1812
1813 FUNCTION {sort.format.title}
1814 % format title for sorting (without article)
1815 { chop.article
1816 sortify
1817 #1 global.max$ substring$
1818 }
1819
1820 FUNCTION {author.sort}
1821 % author or key for sorting
1822 { key empty$
1823 { author empty$
1824 { "to sort, need author or key in " cite$ * warning$
1825 ""
1826 }
1827 { author sort.format.names }
1828 if$
1829 }
1830 { key sortify }
1831 if$
1832 }
1833
1834 FUNCTION {author.editor.sort}
1835 % author, editor or key for sorting
1836 { key empty$
1837 { author empty$
1838 { editor empty$
1839 { "to sort, need author, editor, or key in " cite$ * warning$
1840 ""
1841 }
1842 { editor sort.format.names }
1843 if$
1844 }
1845 { author sort.format.names }
1846 if$
1847 }
1848 { key sortify }
1849 if$
1850 }
1851
1852 FUNCTION {author.organization.sort}
1853 % author, organization or key for sorting
1854 { key empty$
1855 { author empty$
1856 { organization empty$
1857 { "to sort, need author, organization, or key in " cite$ * warning$
1858 ""
1859 }
1860 { organization chop.article sortify }
1861 if$
1862 }
1863 { author sort.format.names }
1864 if$
1865 }
1866 { key sortify }
1867 if$
1868 }
1869
1870 FUNCTION {editor.organization.sort}
1871 % editor, organization or key for sorting
1872 { key empty$
1873 { editor empty$
1874 { organization empty$
1875 { "to sort, need editor, organization, or key in " cite$ * warning$
1876 ""
1877 }
1878 { organization chop.article sortify }
1879 if$
1880 }
1881 { editor sort.format.names }
1882 if$
1883 }
1884 { key sortify }
1885 if$
1886 }
1887
1888 FUNCTION {presort}
1889 % first sort
1890 { calc.label
1891 sort.label
1892 " " *
1893 type$ "book" =
1894 type$ "inbook" =
1895 or
1896 { author.editor.sort }
1897 { type$ "proceedings" =
1898 { editor.organization.sort }
1899 { type$ "manual" =
1900 { author.organization.sort }
1901 { author.sort }
1902 if$
1903 }
1904 if$
1905 }
1906 if$
1907 " " *
1908 year push.field.or.null sortify *
1909 " " *
1910 title push.field.or.null sort.format.title *
1911 #1 entry.max$ substring$
1912 'sort.label :=
1913 sort.label *
1914 #1 entry.max$ substring$
1915 'sort.key$ :=
1916 }
1917
1918 STRINGS { last.label next.extra }
1919
1920 INTEGERS { last.extra.num label.count }
1921
1922 FUNCTION {initialize.label}
1923 { "" 'last.label :=
1924 #0 'label.count :=
1925 }
1926
1927 FUNCTION {forward.pass}
1928 % find maximum additional character for identical labels
1929 { last.label label =
1930 { last.extra.num #1 + 'last.extra.num :=
1931 last.extra.num int.to.chr$ 'extra.label :=
1932 }
1933 { "a" chr.to.int$ 'last.extra.num :=
1934 "" 'extra.label :=
1935 label 'last.label :=
1936 }
1937 if$
1938 label.count #1 + 'label.count :=
1939 }
1940
1941 FUNCTION {reverse.pass}
1942 % add additional characters to identical labels
1943 { next.extra "b" =
1944 { "a" 'extra.label := }
1945 { skip$ }
1946 if$
1947 extra.label 'next.extra :=
1948 extra.label empty$
1949 { "" }
1950 { "{\natexlab{" extra.label * "}}" * }
1951 if$
1952 'extra.label :=
1953 label extra.label * 'label :=
1954 dinat.label extra.label * 'dinat.label :=
1955 }
1956
1957 FUNCTION {bib.sort.order}
1958 { sort.label 'sort.key$ :=
1959 }
1960
1961
1962 %%------------------------------------------------------------------------------
1963 %% making the bbl. file
1964 %%------------------------------------------------------------------------------
1965 FUNCTION {begin.bib}
1966 % beginning of the file
1967 { preamble$ empty$
1968 { skip$ }
1969 { preamble$
1970 write$
1971 newline$
1972 }
1973 if$
1974 "\begin{thebibliography}{" label.count int.to.str$ * "}" *
1975 write$
1976 newline$
1977 "% this bibliography was produced with the style dinat.bst v2.5"
1978 write$
1979 newline$
1980 "\makeatletter"
1981 write$
1982 newline$
1983 "\newcommand{\dinatlabel}[1]%"
1984 write$
1985 newline$
1986 "{\ifNAT@numbers\else\NAT@biblabelnum{#1}\hspace{2\labelsep}\fi}"
1987 write$
1988 newline$
1989 "\makeatother"
1990 write$
1991 newline$
1992 "\expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi"
1993 write$
1994 newline$
1995 "\expandafter\ifx\csname url\endcsname\relax\def\url#1{\texttt{#1}}\fi"
1996 write$
1997 newline$
1998 }
1999
2000 FUNCTION {end.bib}
2001 % end of the bbl. file
2002 { newline$
2003 "\end{thebibliography}" write$ newline$
2004 }
2005
2006
2007 %%------------------------------------------------------------------------------
2008 %% processing the .bib file
2009 %%------------------------------------------------------------------------------
2010 READ
2011
2012 ITERATE {presort}
2013
2014 SORT
2015
2016 EXECUTE {initialize.label}
2017
2018 ITERATE {forward.pass}
2019
2020 REVERSE {reverse.pass}
2021
2022 ITERATE {bib.sort.order}
2023
2024 SORT
2025
2026 EXECUTE {begin.bib}
2027
2028 EXECUTE {init.state.consts}
2029
2030 ITERATE {call.type$}
2031
2032 EXECUTE {end.bib}