Debian Codegraph @

texmf-dist/bibtex/bst/unbtex/unbtex-alf-en.bst

raw
1 %%
2 %% unbtex-alf-en.bst bibliography style file is adapted from abntex-alf.bst
3 %% to format bibliographic references in ABNT style and author-year citation
4 %% scheme for documents written in English, following sugestions avaliable at
5 %%
6 %% https://github.com/abntex/abntex2/issues/97
7 %%
8 %% abntex2-alf.bst, v1.9.7 laurocesar
9 %% Copyright 2012-2018 by abnTeX2 group at https://www.abntex.net.br/
10 %%
11 %% This work may be distributed and/or modified under the conditions of the
12 %% LaTeX Project Public License, either version 1.3 of this license or (at
13 %% your option) any later version.
14 %% The latest version of this license is in
15 %% https://www.latex-project.org/lppl.txt
16 %% and version 1.3 or later is part of all distributions of LaTeX version
17 %% 2005/12/01 or later.
18 %%
19 %% This work has the LPPL maintenance status `maintained'.
20 %%
21 %% The Current Maintainer of this work is the abnTeX2 team, led by Lauro
22 %% César Araujo. Further information are available on
23 %% https://www.abntex.net.br/
24 %%
25
26 ENTRY
27 { address author
28 booktitle booksubtitle
29 chapter conference-number conference-year conference-location
30 edition editor editortype
31 dimensions furtherresp
32 howpublished illustrated institution
33 isbn issn journal key month note marginnote number organization
34 org-short pages pagename
35 publisher reprinted-from reprinted-text school
36 series subtitle section title type doi url urlaccessdate
37 volume year year-presented
38 abnt-and-type
39 abnt-doi abnt-dont-use-etal
40 abnt-etal-cite abnt-etal-list abnt-etal-text abnt-emphasize abnt-experimental
41 abnt-full-initials
42 abnt-last-names abnt-ldots-type
43 abnt-missing-year abnt-cite-style abnt-no-etal-label abnt-note
44 abnt-repeated-author-omit abnt-repeated-title-omit
45 abnt-show-options abnt-refinfo abnt-thesis-year abnt-url-package
46 abnt-title-command
47 abnt-verbatim-entry
48 iso-abbreviation iso-author-punctuation iso-date-place
49 }{}{ label extra.label year.label}
50
51 %revision string
52 STRINGS { abnt.bst.revision }
53
54 %general purpose strings
55 STRINGS { r s t }
56
57 %variables needed to implement the various abnt options
58 STRINGS {abnt.etal.text abnt.emphasize previous.author previous.title}
59 INTEGERS {abnt.alf abnt.cite.style abnt.doi
60 abnt.experimental abnt.etal.cite abnt.etal.list
61 abnt.full.initials
62 abnt.last.names abnt.ldots.type
63 abnt.missing.year
64 abnt.refinfo abnt.repeated.author.omit abnt.repeated.title.omit
65 abnt.show.options abnt.and.type
66 abnt.title.command
67 abnt.thesis.year
68 abnt.url.package abnt.verbatim.entry
69 iso.abbreviation iso.author.punctuation iso.date.place
70 repeated.author}
71
72 %needed for title formatting
73 INTEGERS { title.lenght title.pos first.word no.bracket}
74 STRINGS { title.char}
75
76 %needed for controlling the sentence position
77 INTEGERS {output.state before.all mid.sentence after.sentence after.block }
78
79 %needed for url identification
80 INTEGERS {url.type}
81
82 %static values for options
83 %values for abnt.doi
84 FUNCTION {abnt.doi.expand.to.url} {#0} %expands a doi address to its url correspondent
85 FUNCTION {abnt.doi.link} {#1} %links doi to its url correspondent
86 FUNCTION {abnt.doi.leave.as.is} {#2} %shows doi as is, external viewer will have
87 %to know what to do with a "doi:" document
88
89 %values for url types
90 FUNCTION {unknown.url} {#0}
91 FUNCTION {http.url} {#1}
92 FUNCTION {file.url} {#2}
93 FUNCTION {ftp.url} {#3}
94 FUNCTION {doi.url} {#4}
95 FUNCTION {mailto.url} {#5}
96
97 FUNCTION {init.state.consts}
98 { #0 'before.all :=
99 #1 'mid.sentence :=
100 #2 'after.sentence :=
101 #3 'after.block :=
102 }
103
104 %output.nonnull decides what is written before the argument s, if a comma, period etc.
105 FUNCTION {output.nonnull}
106 { 's := %the argument is written into s
107 output.state mid.sentence =
108 { ", " * write$ } %mid.sentence first write comma
109 { output.state after.block =
110 { add.period$ write$ newline$ }
111 { output.state before.all = 'write$
112 { add.period$ " " * write$ }
113 if$}
114 if$
115 mid.sentence 'output.state := }
116 if$
117 s %now comes s
118 }
119 FUNCTION {output.nonnull.dash}
120 { 's := %the argument is written into s
121 output.state mid.sentence =
122 { " --- " * write$ } %mid.sentence first write comma
123 { output.state after.block =
124 { add.period$ write$ newline$ write$}
125 { output.state before.all = 'write$
126 { add.period$ " " * write$ }
127 if$}
128 if$
129 mid.sentence 'output.state := }
130 if$
131 s %now comes s
132 }
133 FUNCTION {output} %does nothing or calls output.nonull
134 { duplicate$ empty$
135 'pop$
136 'output.nonnull
137 if$
138 }
139 FUNCTION {output.dash} %does nothing or calls output.nonull
140 { duplicate$ empty$
141 'pop$
142 'output.nonnull.dash
143 if$
144 }
145 FUNCTION {output.check} %like ouput, but complains if t empty
146 { 't :=
147 duplicate$ empty$
148 { pop$ "campo " t * " vazio em " * cite$ * warning$ }
149 'output.nonnull
150 if$
151 }
152
153 FUNCTION {new.block}
154 { output.state before.all =
155 'skip$
156 { after.block 'output.state := }
157 if$
158 }
159 FUNCTION {new.sentence}
160 { output.state after.block =
161 'skip$
162 { output.state before.all =
163 'skip$
164 { after.sentence 'output.state := }
165 if$
166 }
167 if$
168 }
169 FUNCTION {add.blank} { " " * before.all 'output.state :=}
170
171 FUNCTION {date.block} {new.block}
172
173 FUNCTION {not}
174 { { #0 }
175 { #1 }
176 if$
177 }
178 FUNCTION {and}
179 { 'skip$
180 { pop$ #0 }
181 if$
182 }
183 FUNCTION {or}
184 { { pop$ #1 }
185 'skip$
186 if$
187 }
188 FUNCTION {new.block.checka}
189 { empty$
190 'skip$
191 'new.block
192 if$
193 }
194 FUNCTION {new.block.checkb}
195 { empty$
196 swap$ empty$
197 and
198 'skip$
199 'new.block
200 if$
201 }
202 FUNCTION {new.sentence.checka}
203 { empty$
204 'skip$
205 'new.sentence
206 if$
207 }
208 FUNCTION {new.sentence.checkb}
209 { empty$
210 swap$ empty$
211 and
212 'skip$
213 'new.sentence
214 if$
215 }
216 FUNCTION {field.or.null}
217 { duplicate$ empty$
218 { pop$ "" }
219 'skip$
220 if$
221 }
222 FUNCTION {emphasize}
223 { duplicate$ empty$
224 { pop$ "" }
225 { abnt.emphasize "{" * swap$ * "}" * }
226 if$
227 }
228
229 FUNCTION {tie.or.space.prefix} %if text length less than 3 chars. uses a tie
230 { duplicate$ text.length$ #5 <
231 { "~" }
232 { " " }
233 if$
234 swap$
235 }
236
237 FUNCTION {no.space} { { "" } swap$ }
238
239 FUNCTION {space.word} { " " swap$ * " " * }
240
241 FUNCTION {bbl.and}
242 { abnt.and.type #0 = {" and "} 'skip$ if$
243 abnt.and.type #1 = {" \& "} 'skip$ if$}
244 FUNCTION {bbl.chapter} { "chap." }
245 FUNCTION {bbl.colon} {": "}
246 FUNCTION {bbl.editors} { "Eds." }
247 FUNCTION {bbl.editor} { "Ed." }
248 FUNCTION {bbl.edby} { "edited by" }
249 FUNCTION {bbl.edition} { "ed." }
250 FUNCTION {bbl.empty} {""}
251 FUNCTION {bbl.etal}{abnt.etal.text "" = {""} {" " abnt.etal.text *} if$}
252 FUNCTION {bbl.doi.url} {"https://dx.doi.org/"}
253 FUNCTION {bbl.in}{ "In" iso.abbreviation 'skip$ { bbl.colon *} if$}
254 FUNCTION {bbl.ldots} %#0 use nothing, #1 use \ldots, #2 use $\ldots$, 3# use {...}
255 {abnt.ldots.type
256 {abnt.ldots.type #1 = {"\ldots"} 'skip$ if$
257 abnt.ldots.type #2 = {"$\ldots$"} 'skip$ if$
258 abnt.ldots.type #3 = {"{...}"} 'skip$ if$}
259 {""} %for #0 use nothing
260 if$}
261 FUNCTION {bbl.master} { "Master of Science" }
262 FUNCTION {bbl.missing.year}
263 {abnt.missing.year
264 {"[\emph{n.d.}]"} %#1
265 {""}
266 if$}
267 FUNCTION {bbl.monography} { "Monography" }
268 FUNCTION {bbl.mthesis} { "Dissertation" }
269 FUNCTION {bbl.no.address} {"[\emph{S.l.}]"}
270 FUNCTION {bbl.no.address.no.publisher} {"[\emph{S.l.}: \emph{s.n.}]"}
271 FUNCTION {bbl.no.publisher} {"[\emph{s.n.}]"}
272 FUNCTION {bbl.number} { iso.abbreviation {"no."} {"n."} if$ }
273 FUNCTION {bbl.nr} { "n." }
274 FUNCTION {bbl.of} { "of" }
275 FUNCTION {bbl.phd} { "Doctor in Philosophy" }
276 FUNCTION {bbl.phdthesis} { "Thesis" }
277 FUNCTION {bbl.pages}
278 {pagename empty$
279 { "p." }
280 {pagename}
281 if$
282 }
283 FUNCTION {bbl.page} { bbl.pages }
284 FUNCTION {bbl.reprint} {"Reprint from"}
285 FUNCTION {bbl.semicolon} { "; "}
286 FUNCTION {bbl.same.field} {"\underline{\ \ \ \ \ \ \ \ }"}
287 FUNCTION {bbl.techrep} { "Technical Report" }
288 FUNCTION {bbl.url.accessdate}
289 {iso.abbreviation { "Cited "} {"Accessed on: "} if$}
290 FUNCTION {bbl.url.available}
291 { iso.abbreviation {"Available from Internet: "} {"Available at: "} if$}
292 FUNCTION {bbl.void} {""}
293 FUNCTION {bbl.volume} { iso.abbreviation {"vol."} {"v."} if$ }
294
295 MACRO {jan} {"Jan."}
296 MACRO {feb} {"Feb."}
297 MACRO {mar} {"Mar."}
298 MACRO {apr} {"Apr."}
299 MACRO {may} {"May"}
300 MACRO {jun} {"Jun."}
301 MACRO {jul} {"Jul."}
302 MACRO {aug} {"Aug."}
303 MACRO {sep} {"Sep."}
304 MACRO {oct} {"Oct."}
305 MACRO {nov} {"Nov."}
306 MACRO {dec} {"Dec."}
307
308 FUNCTION {is.num}
309 { chr.to.int$
310 duplicate$ "0" chr.to.int$ < not
311 swap$ "9" chr.to.int$ > not and
312 }
313 FUNCTION {str.to.int}
314 { duplicate$ is.num
315 {chr.to.int$ #48 -}
316 'skip$
317 if$
318 }
319 FUNCTION {bibinfo.check} %usage: field "field" bibinfo.check
320 { swap$ duplicate$ missing$
321 {pop$ pop$ ""}
322 { duplicate$ empty$
323 {swap$ pop$}
324 {swap$ pop$}
325 if$
326 }
327 if$
328 }
329 FUNCTION {bibinfo.warn}
330 { swap$
331 duplicate$ missing$
332 {swap$ "faltando " swap$ * " em " * cite$ * warning$ pop$ ""}
333 { duplicate$ empty$
334 {swap$ "vazio " swap$ * " em " * cite$ * warning$}
335 {swap$ pop$}
336 if$
337 }
338 if$
339 }
340
341 FUNCTION {write.field.verbatim}
342 {
343 duplicate$ missing$
344 {pop$ pop$}
345 {
346 s text.length$ #0 >
347 {s "," * newline$ write$ "" 's :=}
348 'skip$
349 if$
350 swap$
351 "={" * swap$ * "}" *
352 s swap$ * 's :=
353 }
354 if$
355 }
356
357 FUNCTION {write.entry.verbatim1}
358 {
359 "address" address write.field.verbatim
360 "author" author write.field.verbatim
361 "booktitle" booktitle write.field.verbatim
362 "booksubtitle" booksubtitle write.field.verbatim
363 "chapter" chapter write.field.verbatim
364 "conference-number" conference-number write.field.verbatim
365 "conference-year" conference-year write.field.verbatim
366 "conference-location" conference-location write.field.verbatim
367 "edition" edition write.field.verbatim
368 "editor" editor write.field.verbatim
369 "editortype" editortype write.field.verbatim
370 "dimensions" dimensions write.field.verbatim
371 "furtherresp" furtherresp write.field.verbatim
372 "howpublished" howpublished write.field.verbatim
373 "illustrated" illustrated write.field.verbatim
374 "institution" institution write.field.verbatim
375 "isbn" isbn write.field.verbatim
376 "issn" issn write.field.verbatim
377 "journal" journal write.field.verbatim
378 }
379 FUNCTION {write.entry.verbatim2}
380 {
381 "key" key write.field.verbatim
382 "month" month write.field.verbatim
383 "note" note write.field.verbatim
384 "marginnote" marginnote write.field.verbatim
385 "number" number write.field.verbatim
386 "organization" organization write.field.verbatim
387 "org-short" org-short write.field.verbatim
388 "pages" pages write.field.verbatim
389 "pagename" pagename write.field.verbatim
390 "publisher" publisher write.field.verbatim
391 "reprinted-from" reprinted-from write.field.verbatim
392 "reprinted-text" reprinted-text write.field.verbatim
393 "school" school write.field.verbatim
394 "series" series write.field.verbatim
395 "subtitle" subtitle write.field.verbatim
396 "section" section write.field.verbatim
397 "title" title write.field.verbatim
398 "type" type write.field.verbatim
399 }
400 FUNCTION {write.entry.verbatim3}
401 {
402 "doi" doi write.field.verbatim
403 "url" url write.field.verbatim
404 "urlaccessdate" urlaccessdate write.field.verbatim
405 "volume" volume write.field.verbatim
406 "year" year write.field.verbatim
407 "abnt-emphasize" abnt-emphasize write.field.verbatim
408 "abnt-experimental" abnt-experimental write.field.verbatim
409 "abnt-doi" abnt-doi write.field.verbatim
410 "abnt-dont-use-etal" abnt-dont-use-etal write.field.verbatim
411 "abnt-full-initials" abnt-full-initials write.field.verbatim
412 "abnt-ldots-type" abnt-ldots-type write.field.verbatim
413 "abnt-missing-year" abnt-missing-year write.field.verbatim
414 "abnt-cite-style" abnt-cite-style write.field.verbatim
415 "abnt-no-etal-label" abnt-no-etal-label write.field.verbatim
416 %abnt-note
417 "abnt-repeated-author-omit" abnt-repeated-author-omit write.field.verbatim
418 "abnt-repeated-title-omit" abnt-repeated-title-omit write.field.verbatim
419 "abnt-show-options" abnt-show-options write.field.verbatim
420 "abnt-refinfo" abnt-refinfo write.field.verbatim
421 "abnt-thesis-year" abnt-thesis-year write.field.verbatim
422 "abnt-title-command" abnt-title-command write.field.verbatim
423 "abnt-url-package" abnt-url-package write.field.verbatim
424 "abnt-verbatim-entry" abnt-verbatim-entry write.field.verbatim
425 }
426
427 FUNCTION {write.entry.verbatim}
428 {"" 's := "" 't :=
429 abnt.verbatim.entry
430 {"{\footnotesize\begin{verbatim}" newline$ write$
431 "@" type$ * "{" * cite$ * 's :=
432 write.entry.verbatim1
433 write.entry.verbatim2
434 write.entry.verbatim3
435 s "" = {"}"} {s "}" *} if$
436 newline$ write$
437 "\end{verbatim}}" newline$ write$}
438 {newline$}
439 if$}
440
441 STRINGS { bibinfo}
442 INTEGERS { nameptr namesleft numnames }
443
444 FUNCTION {get.person} {"{vv }{ll}{, jj}{, ff}" format.name$}
445 FUNCTION {get.last.name} {#1 "{ll}" format.name$}
446 FUNCTION {get.first.name} {#1 "{ff}" format.name$}
447 FUNCTION {get.von} {#1 "{vv}" format.name$}
448 FUNCTION {get.jr} {#1 "{jj}" format.name$}
449 FUNCTION {is.composed.von}
450 {get.person
451 get.von duplicate$ empty$ {pop$ #0}
452 {duplicate$
453 get.first.name empty$ not
454 swap$ get.last.name empty$ not and
455 } if$
456 }
457
458 FUNCTION {recompose.name}
459 {get.person duplicate$ duplicate$ duplicate$
460 get.von #1 "{ll }" format.name$ swap$
461 get.last.name *
462 swap$ #1 "{, ff}" format.name$ *
463 swap$ get.von #1 "{ ff}" format.name$ *
464 }
465
466 FUNCTION {format.single.name}
467 {
468 s nameptr get.person 'r :=
469 abnt.last.names
470 {r #1 "{ll}{ jj}" format.name$ "u" change.case$
471 abnt.full.initials
472 {r #1 "{, ff}{ vv}" format.name$ *}
473 {r #1 "{, f.}{ vv}" format.name$ *}
474 if$}
475 {%r #1 is.composed.von {r #1 recompose.name 'r :=} 'skip$ if$
476 r #1 "{ll}" format.name$
477 #1 "{ll}" format.name$
478 r #1 "{ jj}" format.name$ * "u" change.case$
479 abnt.full.initials
480 {r #1 "{, ff}{ vv}" format.name$ *
481 r #1 "{ll}" format.name$
482 #1 "{ ff}{ vv}" format.name$ *}
483 {iso.author.punctuation
484 {r #1 "{, f{}}{ vv}" format.name$ *}
485 {r #1 "{, f.}{ vv}" format.name$ *} if$
486 r #1 "{ll}" format.name$
487 #1 "{ f.}{ vv}" format.name$ *}
488 if$}
489
490 if$
491 }
492 FUNCTION {format.names}
493 { 'bibinfo := duplicate$ empty$ 'skip$
494 {'s :=
495 "" 't :=
496 #1 'nameptr := s num.names$ 'numnames :=
497 numnames 'namesleft :=
498 { namesleft #0 > }
499 { format.single.name
500 bibinfo bibinfo.check
501 't :=
502 nameptr #1 >
503 {nameptr #1 #1 + = numnames abnt.etal.list > and
504 {abnt.etal.list {"others" 't := #1 'namesleft :=} 'skip$ if$ }
505 'skip$
506 if$
507 namesleft #1 >
508 { "; " * t * }
509 { numnames #2 >
510 { "" * }
511 'skip$
512 if$
513 s nameptr "{ll}" format.name$ duplicate$ "others" =
514 { 't := }
515 { pop$ }
516 if$
517 t "others" =
518 { " \emph{et al.}" *}
519 { "; " * t *}
520 if$ }
521 if$ }
522 't
523 if$
524 nameptr #1 + 'nameptr :=
525 namesleft #1 - 'namesleft := }
526 while$
527 } if$
528 }
529
530 %from plain.bst
531 FUNCTION {format.names.plain}
532 { 's :=
533 #1 'nameptr :=
534 s num.names$ 'numnames :=
535 numnames 'namesleft :=
536 { namesleft #0 > }
537 { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ 't :=
538 nameptr #1 >
539 { namesleft #1 >
540 { ", " * t * }
541 { numnames #2 >
542 { "," * }
543 'skip$
544 if$
545 t "others" =
546 { " \emph{et al.}" * }
547 { " and " * t * }
548 if$
549 }
550 if$
551 }
552 't
553 if$
554 nameptr #1 + 'nameptr :=
555 namesleft #1 - 'namesleft :=
556 }
557 while$
558 }
559 FUNCTION {format.names.ed} {format.names}
560
561 FUNCTION {format.authors}
562 {
563 author "author" format.names
564 }
565
566 FUNCTION {format.authors.plain}
567 {
568 author format.names.plain
569 }
570
571 FUNCTION {get.bbl.editor} { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ }
572
573 FUNCTION {format.book.pages}
574 { pages "pages" bibinfo.check duplicate$ empty$
575 'skip$
576 { "~" * bbl.pages * }
577 if$
578 }
579 FUNCTION {format.dimensions}
580 { dimensions empty$
581 'skip$
582 { dimensions output}
583 if$
584 }
585 FUNCTION {format.furtherresp}
586 { furtherresp empty$
587 'skip$
588 { furtherresp output}
589 if$
590 }
591 FUNCTION {format.illustrated}
592 { illustrated missing$
593 'skip$
594 {illustrated empty$
595 {"il." output}
596 {illustrated output}
597 if$}
598 if$
599 }
600 FUNCTION {format.isbn}
601 { isbn "isbn" bibinfo.check duplicate$ empty$
602 'skip$
603 {new.block "ISBN " swap$ *}
604 if$
605 }
606
607 FUNCTION {format.issn}
608 { issn "issn" bibinfo.check
609 duplicate$ empty$ 'skip$
610 {new.block "ISSN " swap$ *}
611 if$
612 }
613
614 FUNCTION {format.doi}
615 { doi "doi" bibinfo.check
616 duplicate$ empty$ 'skip$
617 {new.block duplicate$ "DOI \href{https://dx.doi.org/" swap$ * "}{" * swap$ * "}" *}
618 if$
619 }
620
621 FUNCTION {format.note}
622 { note empty$
623 { "" }
624 { note #1 #1 substring$
625 duplicate$ "{" =
626 'skip$
627 { output.state mid.sentence =
628 { "l" }
629 { "u" }
630 if$
631 change.case$ }
632 if$
633 note #2 global.max$ substring$ * "note" bibinfo.check }
634 if$
635 }
636
637 FUNCTION {format.howpublished}
638 { howpublished empty$
639 { "" }
640 { howpublished #1 #1 substring$
641 duplicate$ "{" =
642 'skip$
643 { output.state mid.sentence =
644 { "l" }
645 { "u" }
646 if$
647 change.case$ }
648 if$
649 howpublished #2 global.max$ substring$ * "howpublished" bibinfo.check }
650 if$
651 }
652
653 %ABNT styles require that the title acts as an author if
654 %typical author fields are absent. In this case the first
655 %word is uppercase. Our main problem is to establish what
656 %the first word actually is since portuguese uses accents.
657 %For example: Fun{\c c}\ão (Função) is a whole word but contains a
658 %space, but if we write Fun\c{c}\ão \c is converted to uppercase...
659 %You get the problem, don't you?
660 FUNCTION {format.title.as.author}
661 { 's := %holds the title
662 #1 'title.pos := %our position in the title
663 #1 'first.word := %boolean, true if we already have the first word
664 #1 'no.bracket := %boolean, false if we are inside a {}
665 "" 't := %holds the first title.pos characters of the title
666 {first.word}
667 {s title.pos #1 substring$ 'title.char :=
668 %checks if the character is a {
669 title.char "{" = {#0 'no.bracket :=} 'skip$ if$
670 %if we are in a bracket
671 no.bracket 'skip$ {title.char "}" = {#1 'no.bracket :=} 'skip$ if$} if$
672 type$ "journalpart" =
673 {title.char "." = title.char ":" = or title.char "!" = or
674 title.char "," = or title.char ";" = or title.char "?" = or}
675 {title.char " " =}
676 if$ s t = or no.bracket and
677 {#0 'first.word :=
678 t title.char * "u" change.case$
679 title.pos #1 + 'title.pos :=
680 s title.pos global.max$ substring$ * 's :=}
681 {title.pos #1 + 'title.pos := t title.char * 't :=}
682 if$
683 }
684 while$
685 s
686 }
687
688 %compares current title with the title of the previous entry
689 FUNCTION {compare.title}
690 {abnt.repeated.title.omit
691 {duplicate$ "" = 'skip$
692 {duplicate$ previous.title = repeated.author and
693 {duplicate$ 'previous.title := pop$ bbl.same.field}
694 {duplicate$ 'previous.title :=}
695 if$}
696 if$}
697 'skip$
698 if$
699 }
700
701 FUNCTION {apply.title.command}
702 {abnt.title.command
703 {duplicate$ empty$ 'skip$
704 {"\bibtextitlecommand{" type$ * "}{" * swap$ * "}" *}
705 if$}
706 'skip$ if$
707 }
708
709 FUNCTION {format.title}
710 {author empty$ editor empty$ and organization empty$ and
711 {title format.title.as.author}
712 {title duplicate$ empty$ {pop$ ""} {"t" change.case$} if$}
713 if$
714 subtitle empty$ 'skip$ {subtitle ": " swap$ * "t" change.case$ *} if$
715 apply.title.command
716 compare.title
717 }
718
719 FUNCTION {n.dashify}
720 {
721 't :=
722 ""
723 { t empty$ not }
724 { t #1 #1 substring$ "-" =
725 { t #1 #2 substring$ "--" = not
726 { "--" *
727 t #2 global.max$ substring$ 't :=
728 }
729 { { t #1 #1 substring$ "-" = }
730 { "-" *
731 t #2 global.max$ substring$ 't :=
732 }
733 while$
734 }
735 if$
736 }
737 { t #1 #1 substring$ *
738 t #2 global.max$ substring$ 't :=
739 }
740 if$
741 }
742 while$
743 }
744
745 %FUNCTION {word.in} { bbl.in " " * }
746 FUNCTION {word.in} {"\emph{In}: "}
747
748 FUNCTION {format.month}
749 { month empty$ 'skip$
750 {month "month" bibinfo.check}
751 if$
752 }
753
754 FUNCTION {format.date}
755 { year empty$
756 { month empty$
757 { bbl.missing.year }
758 { "existe o campo month (mês) mas não o campo year (ano) em " cite$ * warning$ month}
759 if$}
760 { month empty$
761 { year n.dashify}
762 { month " " * year * }
763 if$}
764 if$
765 }
766 FUNCTION {format.btitle}
767 {author empty$ editor empty$ and organization empty$ and
768 {title format.title.as.author "title" bibinfo.check duplicate$ empty$ 'skip$ {} if$
769 subtitle empty$ 'skip$ {subtitle ": " swap$ * "t" change.case$ *} if$}
770 {title "title" bibinfo.check emphasize duplicate$ empty$ 'skip$ {} if$
771 subtitle empty$ 'skip$ {subtitle ": " swap$ * "t" change.case$ *} if$}
772 if$
773 apply.title.command
774 compare.title
775 }
776 FUNCTION {either.or.check}
777 { empty$
778 'pop$
779 { "não posso usar ambos " swap$ * " os campos em " * cite$ * warning$ }
780 if$
781 }
782
783 FUNCTION {format.volume} %leaves formatted or empty volume on the stack
784 {volume duplicate$ empty$
785 'skip$
786 {volume #1 #1 substring$ is.num
787 {bbl.volume swap$ tie.or.space.prefix * *}
788 'skip$
789 if$}
790 if$
791 }
792
793 FUNCTION {format.number} %leaves formatted or empty number on the stack
794 { number duplicate$ empty$
795 'skip$
796 {bbl.number swap$ tie.or.space.prefix * *}
797 if$
798 }
799
800 FUNCTION {format.patent.number}
801 { number
802 }
803
804 FUNCTION {format.bvolume}
805 { volume empty$
806 { "" }
807 { format.volume
808 number empty$ 'skip$ {output format.number} if$
809 series "series" bibinfo.check
810 duplicate$ empty$ 'pop$
811 { swap$ bbl.of space.word * swap$
812 emphasize * }
813 if$
814 }
815 if$
816 }
817
818 FUNCTION {format.bvolume.if.no.series}
819 { series empty$
820 { format.bvolume }
821 { "" }
822 if$
823 }
824
825 FUNCTION {format.number.or.volume}
826 {number empty$
827 {format.volume}
828 {number} %we use the pure number here without leading "n."
829 if$
830 }
831
832 FUNCTION {format.volume.and.number}
833 {format.volume output
834 format.number
835 }
836
837 FUNCTION {format.volume.number.series}
838 { number empty$ volume empty$ and
839 { series empty$
840 { "" }
841 {" (" series "series" bibinfo.check * ")" *}
842 if$}
843 { series empty$
844 {""} %{ format.number.or.volume }
845 { " (" series "series" bibinfo.check * ", " *
846 format.number.or.volume * ")" * }
847 if$ }
848 if$
849 }
850
851 FUNCTION {extract.num}
852 { duplicate$ 't :=
853 "" 's :=
854 { t empty$ not }
855 { t #1 #1 substring$
856 t #2 global.max$ substring$ 't :=
857 duplicate$ is.num
858 { s swap$ * 's := }
859 { pop$ "" 't := }
860 if$ }
861 while$
862 s empty$
863 'skip$
864 { pop$ s }
865 if$
866 }
867
868 FUNCTION {format.edition}
869 { edition duplicate$ empty$ 'skip$
870 {output.state mid.sentence = { "l" } { "t" } if$ change.case$
871 "edition" bibinfo.check
872 edition #1 #1 substring$ is.num {". " * bbl.edition * } 'skip$ if$}
873 if$
874 }
875 INTEGERS { multiresult }
876 FUNCTION {multi.page.check}
877 { 't :=
878 #0 'multiresult :=
879 { multiresult not
880 t empty$ not
881 and }
882 { t #1 #1 substring$
883 duplicate$ "-" =
884 swap$ duplicate$ "," =
885 swap$ "+" =
886 or or
887 { #1 'multiresult := }
888 { t #2 global.max$ substring$ 't := }
889 if$ }
890 while$
891 multiresult
892 }
893 FUNCTION {format.pages}
894 { pages duplicate$ empty$ 'skip$
895 { duplicate$ multi.page.check
896 { n.dashify bbl.pages swap$}
897 { bbl.page swap$ }
898 if$
899 tie.or.space.prefix "pages" bibinfo.check * * }
900 if$
901 }
902 FUNCTION {format.journal.pages}
903 { pages empty$ {""}
904 { pages n.dashify bbl.pages
905 swap$ tie.or.space.prefix "pages" bibinfo.check * *}
906 if$
907 }
908
909 FUNCTION {get.url.type}
910 {s #1 #5 substring$ "https:" = {http.url}
911 {s #1 #6 substring$ "https:" = {http.url}
912 {s #1 #5 substring$ "file:" = {file.url}
913 {s #1 #4 substring$ "ftp:" = {ftp.url}
914 {s #1 #4 substring$ "doi:" = {doi.url}
915 {s #1 #7 substring$ "mailto:" = {mailto.url} {unknown.url} if$}
916 if$}
917 if$}
918 if$}
919 if$}
920 if$
921 'url.type :=
922 }
923
924 FUNCTION {expand.doi}
925 {s
926 url.type doi.url =
927 {#5 global.max$ substring$ bbl.doi.url swap$ *}
928 'skip$ if$
929 }
930
931 INTEGERS {url.pos url.length}
932 FUNCTION {filter.url.tex}
933 {s text.length$ #1 + 'url.length :=
934 #1 'url.pos := "" 't :=
935 {url.pos url.length <}
936 {s url.pos #1 substring$
937 duplicate$ "_" = {pop$ "\underline{\ }" } 'skip$ if$
938 duplicate$ "%" = {pop$ "\%" } 'skip$ if$
939 duplicate$ "&" = {pop$ "\&" } 'skip$ if$
940 duplicate$ "~" = {pop$ "\~{}" } 'skip$ if$
941 duplicate$ "/" = {pop$ "\-/" } 'skip$ if$
942 duplicate$ "." = {pop$ "\-." } 'skip$ if$
943 duplicate$ "\" = {pop$ "{\textbackslash}" } 'skip$ if$
944 duplicate$ "#" = {pop$ "\#" } 'skip$ if$
945 duplicate$ "_" = {pop$ "\_" } 'skip$ if$
946 t swap$ * 't :=
947 url.pos #1 + 'url.pos :=
948 }
949 while$
950 t
951 }
952 FUNCTION {filter.url.html}
953 {s text.length$ #1 + 'url.length :=
954 #1 'url.pos := "" 't :=
955 {url.pos url.length <}
956 {s url.pos #1 substring$
957 duplicate$ "%" = {pop$ "\%" } 'skip$ if$
958 duplicate$ "#" = {pop$ "\#" } 'skip$ if$
959 duplicate$ "_" = {pop$ "\_" } 'skip$ if$
960 t swap$ * 't :=
961 url.pos #1 + 'url.pos :=
962 }
963 while$
964 t
965 }
966
967 FUNCTION {compose.url}
968 {'s :=
969 get.url.type
970 bbl.url.available
971 abnt.url.package #0 =
972 { "$<$" *
973 abnt.doi abnt.doi.expand.to.url = 'expand.doi {s} if$
974 * "$>$" *} 'skip$ if$
975 abnt.url.package #1 =
976 { "\url{" * filter.url.html * "}" *} 'skip$ if$
977 abnt.url.package #2 =
978 {url.type http.url =
979 {"\htmladdnormallink{$<$" * filter.url.tex * "$>$}{" * filter.url.html * "}" *}
980 'skip$ if$
981 url.type doi.url = url.type ftp.url = or url.type mailto.url = or
982 {"\htmladdnormallink{$<$" *
983 abnt.doi abnt.doi.expand.to.url = 'expand.doi {s} if$
984 * "$>$}{" *
985 abnt.doi abnt.doi.leave.as.is = {s} 'expand.doi if$
986 * "}" * }
987 'skip$ if$
988 url.type unknown.url =
989 {"$<$" * filter.url.tex * "$>$" *}
990 'skip$ if$} 'skip$ if$
991 }
992 FUNCTION {format.url}
993 { url empty$ 'skip$
994 {url compose.url output new.sentence }
995 if$
996 urlaccessdate duplicate$ empty$ 'skip$
997 { bbl.url.accessdate swap$ *}
998 if$
999 "urlaccessdate" bibinfo.check output new.sentence
1000 }
1001
1002 FUNCTION {format.conference.info}
1003 { conference-number empty$
1004 'skip$
1005 {conference-number "." * output}
1006 if$
1007 conference-year empty$
1008 'skip$
1009 {conference-year output}
1010 if$
1011 conference-location empty$
1012 'skip$
1013 {conference-location output}
1014 if$
1015 new.sentence
1016 }
1017
1018 FUNCTION {format.chapter.pages}
1019 { chapter empty$
1020 'format.pages
1021 { type empty$
1022 { bbl.chapter }
1023 { type "l" change.case$
1024 "type" bibinfo.check }
1025 if$
1026 chapter tie.or.space.prefix "chapter" bibinfo.check * *
1027 pages empty$
1028 'skip$
1029 { ", " * format.pages * }
1030 if$ }
1031 if$
1032 }
1033
1034 FUNCTION {format.booktitle}
1035 {author empty$ editor empty$ and organization empty$ and
1036 {booktitle format.title.as.author "booktitle" bibinfo.check duplicate$ empty$ 'skip$ {} if$
1037 booksubtitle empty$ 'skip$ {booksubtitle ": " swap$ * "t" change.case$ *
1038 apply.title.command} if$}
1039 {booktitle "booktitle" bibinfo.check emphasize duplicate$ empty$ 'skip$ {} if$
1040 %{booktitle "booktitle" bibinfo.check "u" change.case$ duplicate$ empty$ 'skip$ {} if$
1041 booksubtitle empty$ 'skip$ {booksubtitle ": " swap$ * "t" change.case$ *
1042 apply.title.command} if$}
1043 if$
1044 }
1045 FUNCTION {format.editors}
1046 { editor empty$
1047 {"inbook" type$ = 'bbl.same.field 'skip$ if$}
1048 {author empty$
1049 {editor "editor" format.names " (" *
1050 editortype empty$ {bbl.editor} {editortype} if$
1051 ")" * * }
1052 {"inbook" type$ =
1053 {bbl.same.field }
1054 {editor "editor" format.names " (" *
1055 editortype empty$ {bbl.editor} {editortype} if$
1056 ")" * *}
1057 if$}
1058 if$}
1059 if$
1060 }
1061 FUNCTION {format.in.ed.booktitle}
1062 { editor empty$
1063 {organization empty$ not author empty$ not and %if one of two not empty
1064 {word.in organization "u" change.case$ * output
1065 format.conference.info
1066 booktitle empty$ {""} {new.sentence format.booktitle} if$}
1067 {word.in
1068 organization empty$ author empty$ and 'skip$
1069 {"inbook" type$ = {bbl.same.field * output new.sentence ""}
1070 'skip$ if$ } if$
1071 booktitle empty$ 'skip$ {format.booktitle *} if$}
1072 if$}
1073 {word.in format.editors * output
1074 booktitle empty$ {""} {new.sentence format.booktitle} if$}
1075 if$
1076 output
1077 new.sentence
1078 }
1079 FUNCTION {empty.misc.check}
1080 { author empty$ title empty$ howpublished empty$
1081 month empty$ year empty$ note empty$
1082 and and and and and
1083 key empty$ not and
1084 { "todos os campos relevantes estão vazios ou faltando em " cite$ * warning$ }
1085 'skip$
1086 if$
1087 }
1088 FUNCTION {format.type}
1089 { type "type" bibinfo.check
1090 duplicate$ empty$ 'skip$
1091 {new.block "" swap$ * }
1092 if$
1093 }
1094
1095 FUNCTION {format.year}
1096 {year empty$
1097 { "campo year vazio ou faltando em " cite$ *
1098 abnt.missing.year {" (reference with [n.d.] no data)" *} 'skip$ if$ warning$
1099 abnt.missing.year {" " } {""} if$ bbl.missing.year *}
1100 {year n.dashify "year" bibinfo.check}
1101 if$
1102 }
1103
1104 FUNCTION {format.year.presented}
1105 {year-presented empty$
1106 {""}
1107 {year-presented n.dashify}
1108 if$
1109 }
1110
1111 FUNCTION {format.field.address}
1112 { 't :=
1113 address empty$ organization empty$ and url empty$ and t empty$ and
1114 {bbl.no.address.no.publisher}
1115 {address empty$
1116 %if an url is present we don't give a missing address "[s.l.]" notice
1117 {url empty$ {bbl.no.address ": "} {"" ""} if$}
1118 {address ": "}
1119 if$
1120 t empty$
1121 {%if an organization is present then it is OK not to have a publisher
1122 organization empty$ {* bbl.no.publisher * } 'pop$ if$}
1123 {* t * }
1124 if$}
1125 if$
1126 }
1127
1128 FUNCTION {format.address}
1129 {address empty$
1130 { bbl.no.address}
1131 { address}
1132 if$
1133 }
1134
1135 FUNCTION {format.publisher.address}
1136 { publisher "publisher" bibinfo.check format.field.address}
1137
1138 FUNCTION {format.publisher.address.relax}
1139 {publisher empty$ address empty$ and {""}
1140 {publisher "publisher" bibinfo.check format.field.address}
1141 if$}
1142
1143 FUNCTION {format.organization.address}
1144 { organization "organization" bibinfo.check format.field.address}
1145
1146 %retains current authorship for future use
1147 FUNCTION {compare.authorship}
1148 {abnt.repeated.author.omit
1149 {duplicate$ "" = 'skip$
1150 {duplicate$ previous.author =
1151 {duplicate$ 'previous.author :=
1152 pop$ bbl.same.field
1153 #1 'repeated.author :=}
1154 {duplicate$ 'previous.author :=
1155 #0 'repeated.author :=}
1156 if$}
1157 if$}
1158 'skip$
1159 if$
1160 }
1161
1162 FUNCTION {format.author.or.organization}
1163 { author empty$
1164 { organization empty$ 'skip$
1165 { organization "u" change.case$ "organization" bibinfo.check output}
1166 if$}
1167 { format.authors output.nonnull }
1168 if$
1169 compare.authorship
1170 }
1171
1172 FUNCTION {format.editor.or.organization}
1173 { editor empty$
1174 { organization empty$ 'skip$
1175 { organization "u" change.case$ "organization" bibinfo.check output}
1176 if$}
1177 { format.editors output.nonnull }
1178 if$
1179 compare.authorship
1180 }
1181
1182 FUNCTION {format.author.or.editor.or.organization}
1183 { author empty$
1184 { editor empty$
1185 { organization empty$
1186 'skip$
1187 { organization "u" change.case$ "organization" bibinfo.check output}
1188 if$}
1189 { format.editors output.nonnull }
1190 if$}
1191 { format.authors output.nonnull }
1192 if$
1193 compare.authorship
1194 }
1195
1196 FUNCTION {format.reprint}
1197 { reprinted-text missing$
1198 {""}
1199 {reprinted-text empty$
1200 {bbl.reprint} {reprinted-text} if$
1201 bbl.colon *}
1202 if$
1203 }
1204
1205 FUNCTION {format.journal}
1206 {
1207 format.reprint
1208 journal emphasize *
1209 }
1210
1211 %generates the first label in \abntrefinfo to be used with \citeonline
1212 FUNCTION {format.names.for.label1} %abnt-alf only
1213 { 's := "" 't :=
1214 #1 'nameptr :=
1215 s num.names$ 'numnames :=
1216 numnames 'namesleft :=
1217 { namesleft #0 > }
1218 {abnt.last.names
1219 {s nameptr "{ll}{ jj}" format.name$}
1220 {s nameptr "{ll}" format.name$ #1 "{ll}" format.name$
1221 s nameptr "{ jj}" format.name$ *}
1222 if$
1223 't :=
1224 nameptr #1 >
1225 {namesleft #1 >
1226 { numnames abnt.etal.cite > abnt.etal.cite #0 = not and
1227 {#0 'namesleft := abnt.etal.cite {" \emph{et al.}" *} 'skip$ if$}
1228 {", " * t * } if$ }
1229 { t "others" =
1230 {abnt.etal.cite {" \emph{et al.}" *} 'skip$ if$}
1231 {numnames nameptr = %{bbl.and * t *}
1232 {numnames #2 > {", and " * t *} {" and " * t *} if$} % coloca vírgula antes do "and" se houver mais de dois autores
1233 'skip$ if$}
1234 if$
1235 }
1236 if$ }
1237 't
1238 if$
1239 nameptr #1 + 'nameptr :=
1240 namesleft #1 - 'namesleft := }
1241 while$
1242 }
1243
1244 %generates the second label in \abntrefinfo to be used with \cite
1245 FUNCTION {format.names.for.label2} %abnt-alf only
1246 { 's := "" 't :=
1247 #1 'nameptr := s num.names$ 'numnames :=
1248 numnames 'namesleft :=
1249 { namesleft #0 > }
1250 {abnt.last.names
1251 {s nameptr "{ll}{ jj}" format.name$}
1252 {s nameptr "{ll}" format.name$ #1 "{ll}" format.name$
1253 s nameptr "{ jj}" format.name$ *}
1254 if$
1255 % Desabilita caixa alta nas citações do comando \cite ao logo do texto
1256 %abnt.cite.style #0 = {"u" change.case$} 'skip$ if$ 't :=
1257 abnt.cite.style #0 = {} 'skip$ if$ 't :=
1258 nameptr #1 >
1259 {namesleft #1 >
1260 { numnames abnt.etal.cite >
1261 {#0 'namesleft := abnt.etal.cite {" \emph{et al.}" *} 'skip$ if$}
1262 {"; " * t * } if$ }
1263 { t "OTHERS" = t "others" = or
1264 {abnt.etal.cite {" \emph{et al.}" *} 'skip$ if$}
1265 {numnames nameptr = { bbl.semicolon * t *} 'skip$ if$}
1266 if$
1267 }
1268 if$ }
1269 't
1270 if$
1271 nameptr #1 + 'nameptr :=
1272 namesleft #1 - 'namesleft := }
1273 while$
1274 }
1275
1276 FUNCTION {format.title.for.label}
1277 { 's :=
1278 #1 'title.pos := #1 'first.word :=
1279 "" 't :=
1280 {first.word}
1281 {s title.pos #1 substring$ 'title.char :=
1282 title.char "." = title.char ":" = or title.char ";" = or
1283 title.char "," = or title.char " " = or s t = or
1284 {#0 'first.word :=
1285 title.pos #1 + 'title.pos :=}
1286 {title.pos #1 + 'title.pos := t title.char * 't :=}
1287 if$
1288 }
1289 while$
1290 s t = %title equals first word, dont use bbl.ldots
1291 {t "}{" * t
1292 %abnt.cite.style #0 = {"u" change.case$ * } 'skip$ if$}
1293 abnt.cite.style #0 = { * } 'skip$ if$}
1294 {t bbl.ldots * "}{" * t
1295 %abnt.cite.style #0 = {"u" change.case$} 'skip$ if$ * bbl.ldots *}
1296 abnt.cite.style #0 = {} 'skip$ if$ * bbl.ldots *}
1297 if$
1298 }
1299
1300 %cvs keys have the general form $key: value $
1301 INTEGERS {key.pos value.pos}
1302 FUNCTION {extract.cvs.key} %we borrow the functionality of format.title.for.label
1303 { 's := %holds the entire cvs string
1304 #1 'key.pos :=
1305 #0 'value.pos := %0= between first $ and :, 1=between : and second $, 2= at the end
1306 "" 't := %holds the resulting value
1307 {value.pos #0 = value.pos #1 = or}
1308 { s key.pos #1 substring$ 'title.char :=
1309 value.pos #0 =
1310 { title.char ":" = {#1 'value.pos := key.pos #1 + 'key.pos :=} 'skip$ if$}
1311 { title.char "$" =
1312 {#2 'value.pos :=}
1313 {t title.char * 't :=}
1314 if$}
1315 if$
1316 key.pos #1 + 'key.pos :=
1317 }
1318 while$
1319 t
1320 }
1321
1322 %generates and extended label of type {Author}{AUTHOR}{YEAR}
1323 %for abnt.cite.style=1 they will be of type {Author}{Author}{YEAR}
1324 %final result is placed into variable label
1325 FUNCTION {calc.extended.label}
1326 { "{"
1327 author empty$ not
1328 {author format.names.for.label1 * "}{" * author format.names.for.label2 *}
1329 {editor empty$ not
1330 {editor format.names.for.label1 * "}{" * editor format.names.for.label2 *}
1331 {org-short empty$ not
1332 %{org-short * "}{" * org-short "u" change.case$ *}
1333 {org-short * "}{" * org-short *}
1334 {organization empty$ not
1335 %{organization * "}{" * organization "u" change.case$ *}
1336 {organization * "}{" * organization *}
1337 {title empty$ not
1338 {title format.title.for.label *}
1339 {"nada}{NADA" *}
1340 if$}
1341 if$}
1342 if$}
1343 if$}
1344 if$
1345 "}{" *
1346 year empty$ 'skip$ {year *} if$
1347 'label := %place the stack into label
1348 % final } will be placed in reverse.pass
1349 }
1350 %generates and simple label of type "Author YEAR"
1351 %final result is placed onto the stack
1352 FUNCTION {calc.simple.label}
1353 { author empty$ not
1354 {author format.names.for.label1}
1355 {editor empty$ not
1356 {editor format.names.for.label1}
1357 {organization empty$ not
1358 {organization}
1359 {title empty$ not
1360 {title}
1361 {""}
1362 if$}
1363 if$}
1364 if$}
1365 if$
1366 year empty$ 'skip$ {" " * year *} if$
1367 }
1368
1369 FUNCTION {output.bibitem}
1370 { newline$
1371 abnt.alf
1372 {"\bibitem[" write$
1373 calc.simple.label
1374 write$ "]{"}
1375 {"\bibitem{"}
1376 if$
1377 write$ cite$ write$ "}" write$ newline$
1378 abnt.refinfo #1 = {"\abntrefinfo" write$ label write$ newline$} 'skip$ if$
1379 "{" write$
1380 "" before.all 'output.state :=
1381 }
1382 FUNCTION {output.hiddenbibitem}
1383 { newline$
1384 abnt.alf
1385 {"\hiddenbibitem[" write$
1386 calc.simple.label
1387 write$ "]{"}
1388 {"\bibitem{"}
1389 if$
1390 write$ cite$ write$ "}" write$ newline$
1391 abnt.refinfo #1 = {"\abntrefinfo" write$ label write$ newline$} 'skip$ if$
1392 "{" write$
1393 "" before.all 'output.state :=
1394 }
1395 FUNCTION {fin.entry}
1396 { add.period$ write$
1397 reprinted-from empty$ 'skip$
1398 {" " reprinted-text empty$
1399 {bbl.reprint} {reprinted-text} if$ * bbl.colon *
1400 "\abntreprintinfo{ " * reprinted-from * "}" * write$}
1401 if$
1402 abnt-note empty$ 'skip$
1403 {"\footnote{" abnt-note * "}" * write$} if$
1404 "}" write$
1405 %newline$
1406 write.entry.verbatim
1407 }
1408
1409 FUNCTION { abnt.display.options}
1410 { 's := 't :=
1411 abnt.show.options #1 = % "warn"
1412 {"opção " t * " passou para " * s * warning$ } 'skip$ if$
1413
1414 abnt.show.options #2 = % "list"
1415 {"Op\c c\~ao selecionada {\tt " t * "=}\verb+" * s * "+" * output new.sentence } 'skip$ if$
1416 }
1417
1418 FUNCTION { abnt-options1 }
1419 {
1420 abnt-show-options empty$
1421 'skip$
1422 {abnt-show-options "no" =
1423 {#0} {abnt-show-options "warn" =
1424 {#1} {abnt-show-options "list" =
1425 {#2 } {#0 } if$} if$} if$
1426 'abnt.show.options :=} % #0 "no"; #1 "warn"; #2 "list"
1427 if$
1428
1429 abnt.show.options #2 =
1430 {output.bibitem "Mudan\c ca de estilo ap\'os este ponto com o comando \verb!\citeoption{"
1431 cite$ * "}! " *
1432 output new.sentence} 'skip$ if$
1433
1434 abnt-show-options empty$
1435 'skip$ {"abnt-show-options" abnt-show-options abnt.display.options} if$
1436
1437 abnt-cite-style empty$
1438 'skip$
1439 {abnt-cite-style "(AUTHOR, YEAR)" =
1440 {#0 'abnt.cite.style :=}
1441 {abnt-cite-style "(Author, YEAR)" =
1442 {#1 'abnt.cite.style :=}
1443 {"opção " abnt-cite-style * " desconhecida" * warning$}
1444 if$}
1445 if$
1446 "abnt-cite-style" abnt-cite-style abnt.display.options}if$
1447
1448 abnt-experimental empty$
1449 'skip$ {abnt-experimental "yes" = 'abnt.experimental :=
1450 "abnt-experimental" abnt-experimental abnt.display.options} if$
1451
1452 abnt-emphasize duplicate$ empty$
1453 'pop$ {'abnt.emphasize :=
1454 "abnt-emphasize" abnt.emphasize abnt.display.options
1455 abnt-emphasize "\bf" = abnt-emphasize "\it" = or abnt-emphasize "\em" = or
1456 abnt-emphasize "\bfseries" = or
1457 {"não use " abnt-emphasize * " para abnt-emphasize em " * cite$ *
1458 ", isto alterará TODO o texto. Use \textbf ou \emph. Veja a documentação abnt-bibtex-doc para mais detalhes." * warning$}
1459 'skip$ if$
1460 } if$
1461
1462 abnt-doi empty$
1463 'skip$
1464 {abnt-doi "expand" =
1465 {abnt.doi.expand.to.url 'abnt.doi :=}
1466 {abnt-doi "link" =
1467 {abnt.doi.link 'abnt.doi :=}
1468 {abnt-doi "doi" =
1469 {abnt.doi.leave.as.is 'abnt.doi :=}
1470 {"opção " abnt-doi * " desconhecida" * warning$}
1471 if$}
1472 if$}
1473 if$
1474 "abnt-doi" abnt-doi abnt.display.options}if$
1475 }
1476 FUNCTION { abnt-options2 }
1477 {
1478 abnt-full-initials empty$
1479 'skip$ {abnt-full-initials "yes" = 'abnt.full.initials :=
1480 "abnt-full-initials" abnt-full-initials abnt.display.options} if$
1481
1482 abnt-last-names empty$
1483 'skip$
1484 {abnt-last-names "abnt" = {#0}
1485 {abnt-last-names "bibtex" = {#1} {#0} if$} if$
1486 'abnt.last.names :=
1487 "abnt-last-names" abnt-last-names abnt.display.options}
1488 if$
1489
1490 abnt-ldots-type empty$
1491 'skip$
1492 {abnt-ldots-type "none" = {#0}
1493 {abnt-ldots-type "normal" = {#1}
1494 {abnt-ldots-type "math" = {#2}
1495 {abnt-ldots-type "text" = {#1} {#0}
1496 if$} if$} if$} if$
1497 'abnt.ldots.type :=
1498 "abnt-ldots-type" abnt-ldots-type abnt.display.options}
1499 if$
1500
1501 abnt-missing-year empty$
1502 'skip$
1503 {abnt-missing-year "void" = {#0}
1504 {abnt-missing-year "sd" = {#1} {#0} if$}
1505 if$
1506 'abnt.missing.year :=
1507 "abnt-missing-year" abnt-missing-year abnt.display.options}
1508 if$
1509
1510 abnt-and-type empty$
1511 'skip$ {abnt-and-type " and " =
1512 {#0} {abnt-and-type "&" =
1513 {#1} {#0} if$} if$
1514 'abnt.and.type :=
1515 "abnt-and-type" abnt-and-type abnt.display.options}
1516 if$
1517
1518 abnt-thesis-year empty$
1519 'skip$ {abnt-thesis-year "final" =
1520 {#0} {abnt-thesis-year "title" =
1521 {#1} {abnt-thesis-year "both" =
1522 {#2} {#0} if$} if$} if$
1523 'abnt.thesis.year :=
1524 "abnt-thesis-year" abnt-thesis-year abnt.display.options}
1525 if$
1526
1527 abnt-refinfo empty$
1528 'skip$ {abnt-refinfo "yes" = 'abnt.refinfo :=
1529 "abnt-refinfo" abnt-refinfo abnt.display.options} if$
1530 }
1531 FUNCTION { abnt-options3 }
1532 {
1533
1534 abnt-dont-use-etal empty$
1535 'skip$ {abnt-dont-use-etal "yes" = {#0 'abnt.etal.list :=} 'skip$ if$
1536 "Uso da opção abnt-dont-use-etal se tornou obsoleto, usamos abnt-etal-list." warning$
1537 "abnt-etal-list" abnt.etal.list int.to.str$ abnt.display.options} if$
1538
1539 abnt-etal-cite empty$
1540 'skip$ {abnt-etal-cite str.to.int 'abnt.etal.cite :=
1541 "abnt-etal-cite" abnt.etal.cite int.to.str$ abnt.display.options} if$
1542
1543 abnt-etal-list empty$
1544 'skip$ {abnt-etal-list str.to.int 'abnt.etal.list :=
1545 "abnt-etal-list" abnt.etal.list int.to.str$ abnt.display.options} if$
1546
1547 abnt-etal-text missing$
1548 'skip$ {abnt-etal-text 'abnt.etal.text :=
1549 "abnt-etal-text" abnt.etal.text abnt.display.options} if$
1550
1551 abnt-no-etal-label empty$
1552 'skip$ {abnt-no-etal-label "yes" = {#0 'abnt.etal.cite :=} 'skip$ if$
1553 "Uso da opção abnt-no-etal-label se tornou obsoleto, usamos abnt-etal-cite." warning$
1554 "abnt-etal-cite" abnt.etal.cite int.to.str$ abnt.display.options} if$
1555
1556 abnt-repeated-author-omit empty$
1557 'skip$ {abnt-repeated-author-omit "yes" =
1558 {#1 'abnt.repeated.author.omit :=}
1559 {#0 'abnt.repeated.author.omit := "" 'previous.author :=} if$
1560 "abnt-repeated-author-omit" abnt-repeated-author-omit abnt.display.options} if$
1561
1562 abnt-repeated-title-omit empty$ 'skip$
1563 {abnt-repeated-title-omit "yes" =
1564 {#1 'abnt.repeated.title.omit :=}
1565 {#0 'abnt.repeated.title.omit := "" 'previous.title :=} if$
1566 "abnt-repeated-title-omit" abnt-repeated-title-omit abnt.display.options
1567 abnt.repeated.author.omit not abnt.repeated.title.omit and
1568 {"Use abnt-repeated-title-omit=yes junto com abnt-repeated-author-omit=yes"
1569 warning$} 'skip$ if$} if$
1570
1571 abnt-title-command empty$
1572 'skip$ {abnt-title-command "yes" =
1573 {#1 'abnt.title.command :=}
1574 {#0 'abnt.title.command :=} if$
1575 "abnt-title-command" abnt-title-command abnt.display.options} if$
1576
1577 abnt-url-package empty$ 'skip$
1578 {abnt-url-package "url" =
1579 {#1 'abnt.url.package :=}
1580 {abnt-url-package "hyperref" = {#2 'abnt.url.package :=} 'skip$ if$}
1581 if$
1582 "abnt-url-package" abnt-url-package abnt.display.options}
1583 if$
1584
1585 abnt-verbatim-entry empty$
1586 'skip$ {abnt-verbatim-entry "yes" = 'abnt.verbatim.entry :=
1587 "abnt-verbatim-entry" abnt-verbatim-entry abnt.display.options} if$
1588
1589 abnt.show.options #2 = 'fin.entry 'skip$ if$
1590 }
1591
1592 %we had to break this function in two parts because of the following message:
1593 %Sorry---you've exceeded BibTeX's single function space 100
1594 %(That was a fatal error)
1595 FUNCTION { iso-options1 }
1596 {
1597 iso-abbreviation empty$
1598 'skip$ {iso-abbreviation "standard" = 'iso.abbreviation :=
1599 "iso-abbreviation" iso-abbreviation abnt.display.options} if$
1600 iso-author-punctuation empty$
1601 'skip$ {iso-author-punctuation "void" = 'iso.author.punctuation :=
1602 "iso-author-punctuation" iso-author-punctuation abnt.display.options} if$
1603 iso-date-place empty$
1604 'skip$ {iso-date-place "ISO" = 'iso.date.place :=
1605 "iso-date-place" iso-date-place abnt.display.options} if$
1606 }
1607
1608 FUNCTION { abnt-options }
1609 {
1610 abnt-options1
1611 abnt-options2
1612 abnt-options3
1613 iso-options1
1614 }
1615
1616 FUNCTION { iso-options } { abnt-options }
1617
1618 FUNCTION { iso.year.label }
1619 { iso.date.place
1620 { abnt.alf
1621 {year.label output new.sentence}
1622 'skip$ if$}
1623 'skip$ if$}
1624
1625 FUNCTION { iso.date }
1626 { iso.date.place
1627 { abnt.alf
1628 'skip$
1629 {year output new.sentence}
1630 if$}
1631 'skip$ if$}
1632
1633 FUNCTION { non.iso.date }
1634 {iso.date.place 'skip$ {format.date output} if$}
1635
1636 FUNCTION {article}
1637 { output.bibitem
1638 format.author.or.organization new.sentence
1639 iso.year.label
1640 format.title "title" output.check new.block
1641 format.journal output
1642 iso.date.place {format.year output} 'skip$ if$
1643 %iso.date.place {format.date output} 'skip$ if$
1644 %iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1645 % {format.year output new.sentence} if$
1646 section "section" bibinfo.check output.dash
1647 publisher "publisher" bibinfo.check output
1648 address "address" bibinfo.check output
1649 format.volume output
1650 format.number output
1651 format.pages output
1652 non.iso.date
1653 format.issn output new.block
1654 format.note output new.block
1655 format.doi output new.block
1656 format.url
1657 fin.entry
1658 }
1659 FUNCTION {book}
1660 { output.bibitem
1661 format.author.or.editor.or.organization new.sentence
1662 iso.year.label
1663 format.type output new.sentence
1664 format.btitle "title" output.check new.sentence
1665 format.furtherresp new.sentence
1666 format.edition output new.sentence
1667 format.publisher.address output
1668 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1669 {format.year output new.sentence} if$
1670 format.volume output new.sentence
1671 format.book.pages output
1672 format.illustrated
1673 format.dimensions new.sentence
1674 format.howpublished output new.sentence
1675 format.volume.number.series output new.sentence
1676 format.note output
1677 format.issn output %pode parecer curioso, mas revistas inteiras são tratadas como livro
1678 format.isbn output new.sentence
1679 format.doi output new.block
1680 format.url
1681 fin.entry
1682 }
1683 FUNCTION {booklet}
1684 { output.bibitem
1685 format.author.or.editor.or.organization new.sentence
1686 iso.year.label
1687 format.type output new.sentence
1688 format.btitle "title" output.check new.sentence
1689 format.edition output new.sentence
1690 address "address" bibinfo.check output
1691 format.bvolume output
1692 %format.date output new.sentence
1693 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1694 {format.year output new.sentence} if$
1695 format.book.pages output new.sentence
1696 format.volume.number.series output new.sentence
1697 format.note output
1698 format.isbn output new.sentence
1699 format.doi output new.block
1700 format.url
1701 fin.entry
1702 }
1703
1704 FUNCTION {hidden}
1705 { output.hiddenbibitem
1706 fin.entry}
1707
1708 FUNCTION {inbook}
1709 { output.bibitem
1710 format.author.or.organization new.sentence
1711 iso.year.label
1712 format.title "title" output.check new.block
1713 format.in.ed.booktitle
1714 format.furtherresp new.sentence
1715 format.edition output new.sentence
1716 format.publisher.address output
1717 %format.year output new.sentence
1718 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1719 {format.year output new.sentence} if$
1720 format.bvolume.if.no.series output
1721 format.volume.number.series output
1722 format.chapter.pages output new.sentence
1723 format.isbn output new.block
1724 format.note output new.block
1725 format.doi output new.block
1726 format.url
1727 fin.entry
1728 }
1729
1730 FUNCTION {incollection}
1731 { output.bibitem
1732 format.author.or.organization new.sentence
1733 iso.year.label
1734 format.title "title" output.check new.sentence
1735 format.in.ed.booktitle
1736 format.edition output new.sentence
1737 format.publisher.address output
1738 %format.year output
1739 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1740 {format.year output} if$
1741 format.volume.number.series output new.sentence
1742 format.bvolume.if.no.series output
1743 format.chapter.pages output new.sentence
1744 format.isbn output new.block
1745 format.note output new.block
1746 format.doi output new.block
1747 format.url
1748 fin.entry
1749 }
1750 FUNCTION {inproceedings}
1751 { output.bibitem
1752 format.author.or.organization new.sentence
1753 iso.year.label
1754 format.title "title" output.check new.sentence
1755 format.in.ed.booktitle
1756 format.publisher.address output
1757 %format.year output new.sentence
1758 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1759 {format.year output new.sentence} if$
1760 format.bvolume.if.no.series output
1761 format.volume.number.series output
1762 format.pages output
1763 format.isbn output
1764 format.issn output new.sentence
1765 format.note output new.sentence
1766 format.doi output new.block
1767 format.url
1768 fin.entry
1769 }
1770 FUNCTION {journalpart}
1771 { output.bibitem
1772 format.author.or.editor.or.organization new.sentence
1773 iso.year.label
1774 format.type output new.sentence
1775 format.btitle "title" output.check new.sentence
1776 format.furtherresp new.sentence
1777 format.edition output new.sentence
1778 format.publisher.address output
1779 format.volume output
1780 format.number output
1781 %format.date output new.sentence
1782 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1783 {format.date output new.sentence} if$
1784 format.book.pages output
1785 format.illustrated
1786 format.dimensions new.sentence
1787 format.note output
1788 format.issn output %pode parecer curioso, mas revistas inteiras são tratadas como livro
1789 format.isbn output new.sentence
1790 format.doi output new.block
1791 format.url
1792 fin.entry
1793 }
1794 FUNCTION {conference} { inproceedings }
1795 FUNCTION {manual}
1796 { output.bibitem
1797 format.author.or.editor.or.organization new.sentence
1798 iso.year.label
1799 format.btitle "title" output.check new.block
1800 format.furtherresp new.sentence
1801 format.edition output new.sentence
1802 format.address output
1803 %format.date output new.sentence
1804 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1805 {format.year output new.sentence} if$
1806 format.bvolume.if.no.series output
1807 format.book.pages output new.sentence
1808 format.volume.number.series output new.sentence
1809 format.note output new.sentence
1810 format.doi output new.block
1811 format.url
1812 fin.entry
1813 }
1814
1815 FUNCTION {misc}
1816 { output.bibitem
1817 format.author.or.editor.or.organization new.sentence
1818 iso.year.label
1819 format.type output
1820 format.btitle output new.sentence
1821 format.furtherresp new.sentence
1822 format.publisher.address.relax output
1823 %format.date output new.block
1824 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1825 {format.year output new.sentence} if$
1826 format.book.pages output new.sentence
1827 format.illustrated
1828 format.dimensions new.sentence
1829 format.howpublished output new.block
1830 format.volume.number.series output new.sentence
1831 format.note output new.block
1832 format.doi output new.block
1833 format.url
1834 fin.entry
1835 empty.misc.check
1836 }
1837
1838 FUNCTION {patent}
1839 { output.bibitem
1840 format.editor.or.organization new.sentence
1841 iso.year.label
1842 format.authors.plain output new.sentence
1843 format.btitle output new.sentence
1844 format.furtherresp new.sentence
1845 %format.date output new.block
1846 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1847 {format.year output new.sentence} if$
1848 format.patent.number output
1849 format.howpublished output new.block
1850 format.note output new.block
1851 format.url
1852 fin.entry
1853 empty.misc.check
1854 }
1855
1856 FUNCTION {format.thesis.type}
1857 { type$ "phdthesis" =
1858 {bbl.phdthesis}
1859 {type$ "mastersthesis" =
1860 {bbl.mthesis}
1861 {type$ "monography" =
1862 {bbl.monography}
1863 {bbl.void}
1864 if$}
1865 if$}
1866 if$
1867 type empty$
1868 {type missing$
1869 {type$ "phdthesis" =
1870 { " (" bbl.phd * ")" *}
1871 {type$ "mastersthesis" = { " (" bbl.master * ")" *} {pop$ ""} if$}
1872 if$}
1873 {""}
1874 if$}
1875 {type$ "thesis" =
1876 {type}
1877 {" (" type * ")" * "type" bibinfo.check}
1878 if$}
1879 if$
1880 * %joins first and second part of this function
1881 }
1882 FUNCTION {thesis}
1883 { output.bibitem
1884 format.authors "author" output.check new.block
1885 iso.year.label
1886 format.btitle "title" output.check new.block
1887 abnt.thesis.year #1 = abnt.thesis.year #2 = or
1888 {format.date "year" output.check new.sentence} 'skip$ if$
1889 format.year.presented output new.sentence
1890 format.book.pages output new.sentence
1891 format.thesis.type output.nonnull
1892 school "school" bibinfo.warn output.dash
1893 address "address" bibinfo.check output
1894 abnt.thesis.year #0 = abnt.thesis.year #2 = or
1895 {format.date "year" output.check new.sentence} 'skip$ if$
1896 format.note output new.block
1897 format.doi output new.block
1898 format.url
1899 fin.entry
1900 }
1901
1902 FUNCTION {phdthesis} { thesis }
1903 FUNCTION {mastersthesis} { thesis }
1904 FUNCTION {monography} { thesis }
1905
1906 FUNCTION {proceedings}
1907 { output.bibitem
1908 iso.year.label
1909 format.editor.or.organization
1910 format.conference.info
1911 format.btitle "title" output.check
1912 format.bvolume output
1913 format.volume.number.series output
1914 editor empty$
1915 { publisher empty$
1916 'skip$
1917 { new.sentence format.publisher.address output format.year output}
1918 if$
1919 }
1920 { publisher empty$
1921 { new.sentence
1922 format.organization.address output format.year output}
1923 { new.sentence
1924 organization "organization" bibinfo.check output
1925 format.publisher.address output format.year output}
1926 if$ }
1927 if$
1928 new.sentence format.book.pages output new.sentence
1929 format.isbn output
1930 format.issn output new.block
1931 format.note output new.block
1932 format.doi output new.block
1933 format.url
1934 fin.entry
1935 }
1936
1937 FUNCTION {techreport} {manual}
1938
1939 FUNCTION {unpublished}
1940 { output.bibitem
1941 format.author.or.editor.or.organization new.sentence
1942 iso.year.label
1943 format.title "title" output.check new.sentence
1944 format.note "note" output.check new.sentence
1945 %format.date output new.sentence
1946 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1947 {format.year output new.sentence} if$
1948 format.doi output new.block
1949 format.url
1950 fin.entry
1951 }
1952
1953 FUNCTION {default.type} { misc }
1954 READ
1955 FUNCTION {sortify}
1956 { purify$
1957 "l" change.case$
1958 }
1959 INTEGERS { len }
1960 FUNCTION {chop.word}
1961 { 's :=
1962 'len :=
1963 s #1 len substring$ =
1964 { s len #1 + global.max$ substring$ }
1965 's
1966 if$
1967 }
1968 FUNCTION {sort.format.names}
1969 { 's :=
1970 #1 'nameptr :=
1971 ""
1972 s num.names$ 'numnames :=
1973 numnames 'namesleft :=
1974 { namesleft #0 > }
1975 { format.single.name 't :=
1976 nameptr #1 >
1977 {
1978 nameptr #3
1979 #1 + =
1980 numnames #3
1981 > and
1982 { "others" 't :=
1983 #1 'namesleft := }
1984 'skip$
1985 if$
1986 " " *
1987 namesleft #1 = t "others" = and
1988 { "zzzzz" * }
1989 { t sortify * }
1990 if$
1991 }
1992 { t sortify * }
1993 if$
1994 nameptr #1 + 'nameptr :=
1995 namesleft #1 - 'namesleft :=
1996 }
1997 while$
1998 }
1999
2000 FUNCTION {sort.format.title}
2001 { 't :=
2002 "A " #2
2003 "An " #3
2004 "The " #4 t chop.word
2005 chop.word
2006 chop.word
2007 sortify
2008 #1 global.max$ substring$
2009 }
2010 FUNCTION {any.sort}
2011 { author empty$
2012 { organization empty$
2013 { editor empty$
2014 { title empty$
2015 { key empty$
2016 { "para ordenar, precisa dos campos author, organization, editor, title ou key in " cite$ * warning$ ""}
2017 { key sortify }
2018 if$}
2019 { title sortify}
2020 if$}
2021 { editor sort.format.names }
2022 if$}
2023 { organization sortify }
2024 if$}
2025 { author sort.format.names }
2026 if$
2027 }
2028
2029 FUNCTION {presort}
2030 {
2031 any.sort
2032 " " * year field.or.null sortify * " " * title field.or.null
2033 sort.format.title * #1 entry.max$ substring$
2034 %for non-alpha style we drop a void sort.key such that SORT has no effect
2035 abnt.alf 'skip$ {pop$ ""} if$ 'sort.key$ :=
2036 year empty$ {""} {year} if$ 'year.label :=
2037 calc.extended.label
2038 }
2039
2040 FUNCTION {set.default.abnt.variables}
2041 { %if you change abnt-num to abnt-alf by hand you need also to change
2042 %the name of RCSfile by hand, otherwise cvs takes care of it.
2043 %
2044 "$RCSfile: unbtex-alf-en.bst,v $ " extract.cvs.key
2045 %
2046 "unbtex-alf-en.bst,v " = 'abnt.alf := % #1 para abnt-alf #0 para abnt-num
2047 "$Revision: v-1.9.7 $" extract.cvs.key 'abnt.bst.revision :=
2048 #0 'abnt.and.type := % #0 "and"; #1 "&"
2049 "\emph" 'abnt.emphasize :=
2050 #0 'abnt.cite.style := %default norm version for NBR10520
2051 %#0 \cite=(AUTHOR, YEAR)
2052 %#1 \cite=(Author, YEAR)
2053 #0 'abnt.experimental :=
2054 abnt.doi.expand.to.url 'abnt.doi :=
2055 #3 'abnt.etal.cite :=
2056 #3 'abnt.etal.list :=
2057 "et al." 'abnt.etal.text :=
2058 #0 'abnt.full.initials :=
2059 #0 'abnt.last.names := %#0 abnt-style, #1 bibtex-style
2060 #1 'abnt.ldots.type := %#0 use nothing, #1 use \ldots, #2 use $\ldots$, 3# use {...}
2061 #0 'abnt.missing.year := %#0 "void"; #1 "[n.d.]"
2062 #0 'repeated.author :=
2063 #0 'abnt.repeated.author.omit :=
2064 #0 'abnt.repeated.title.omit :=
2065 #1 'abnt.refinfo :=
2066 #0 'abnt.show.options := % #0 "no"; #1 "warn"; #2 "list"
2067 #0 'abnt.thesis.year := % #0 "final"; #1 "title"; #2 "both"
2068 #0 'abnt.title.command := % #0 "no"; #1 "yes"
2069 #0 'abnt.url.package := % #0 "none"'; #2 "url"; #2 "hyperref"
2070 #0 'abnt.verbatim.entry :=
2071 }
2072 FUNCTION {set.default.iso.variables}
2073 { #0 'iso.abbreviation := % #0 ABNT-style; #1 ISO-style
2074 #0 'iso.author.punctuation := % #0 ABNT (Smith, A. B.); #1 ISO (Smith, AB)
2075 #0 'iso.date.place := % #0 ABNT-sty; #1 ISO-style
2076 }
2077 EXECUTE {set.default.abnt.variables}
2078 EXECUTE {set.default.iso.variables}
2079 FUNCTION {process.early.abnt.options}
2080 {%here we intercept all entries which need priority handling
2081 %note: we cannot use type$ at this point
2082 abnt-and-type missing$
2083 abnt-experimental missing$ and
2084 abnt-etal-cite missing$ and
2085 abnt-etal-text missing$ and
2086 abnt-ldots-type missing$ and
2087 abnt-cite-style missing$ and
2088 abnt-no-etal-label missing$ and
2089 abnt-title-command missing$ and
2090 'skip$ {call.type$} if$
2091 }
2092 ITERATE {process.early.abnt.options}
2093 FUNCTION {search.reprinted}
2094 { reprinted-from missing$ 'skip$
2095 {"\nocite{" reprinted-from * "}" * write$ newline$
2096 }
2097 if$
2098 }
2099 ITERATE {search.reprinted}
2100 FUNCTION {abntreprintinfo}
2101 {"\providecommand{\abntreprintinfo}[1]{%" write$ newline$
2102 " \citeonline{#1}}" write$ newline$}
2103 EXECUTE {abntreprintinfo}
2104 ITERATE {presort}
2105 SORT
2106 STRINGS { last.label next.extra}
2107 INTEGERS { last.extra.num }
2108 FUNCTION {forward.pass}
2109 { last.label label =
2110 { last.extra.num #1 + 'last.extra.num :=
2111 last.extra.num int.to.chr$ 'extra.label :=
2112 }
2113 { "a" chr.to.int$ 'last.extra.num :=
2114 "" 'extra.label :=
2115 label 'last.label :=
2116 }
2117 if$
2118 }
2119
2120 FUNCTION {reverse.pass}
2121 { next.extra "b" =
2122 { "a" 'extra.label := }
2123 'skip$
2124 if$
2125 label extra.label * 'label :=
2126 year.label extra.label * 'year.label :=
2127 extra.label 'next.extra :=
2128 label "}" * 'label :=
2129 }
2130 ITERATE {forward.pass}
2131 REVERSE {reverse.pass}
2132 FUNCTION {begin.bib}
2133 {
2134 abnt.alf
2135 {"\setlength{\labelsep}{0pt}" write$}
2136 'skip$
2137 if$
2138 "\begin{thebibliography}{}" write$ newline$
2139 preamble$ empty$
2140 'skip$
2141 { preamble$ write$ newline$ }
2142 if$
2143 abnt.refinfo #1 =
2144 {"\providecommand{\abntrefinfo}[3]{}" write$ newline$}
2145 'skip$ if$
2146 "\providecommand{\abntbstabout}[1]{}" write$ newline$
2147 abnt.title.command
2148 {"\providecommand{\bibtextitlecommand}[2]{#2}" write$ newline$}
2149 'skip$ if$
2150 "\abntbstabout{" abnt.bst.revision * "}" * write$ newline$
2151 % Ajusta o espaçamento entre linhas nas referências bibliográficas
2152 %"\setlength{\baselineskip}{1.0\baselineskip}" write$ newline$
2153 %"\setlength{\itemsep}{0pt}" write$ newline$
2154 }
2155 EXECUTE {begin.bib}
2156 EXECUTE {init.state.consts}
2157 FUNCTION {process.entry}{call.type$}
2158 ITERATE {process.entry}
2159 FUNCTION {end.bib}
2160 { newline$ "\end{thebibliography}" write$ newline$
2161 }
2162 EXECUTE {end.bib}