Debian Codegraph @

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

raw
1 %%
2 %% unbtex-num-en.bst bibliography style file is adapted from abntex-num.bst
3 %% to format bibliographic references in ABNT style and numeric citation
4 %% scheme for documents written in English, following sugestions avaliable at
5 %%
6 %% https://github.com/abntex/abntex2/issues/97
7 %%
8 %% abntex2-num.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 {""} %#0
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 { bbl.etal *}
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 #20 >
542 { "," * }
543 'skip$
544 if$
545 t "others" =
546 { bbl.etal * }
547 { bbl.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 booksubtitle empty$ 'skip$ {booksubtitle ": " swap$ * "t" change.case$ *
1041 apply.title.command} if$}
1042 if$
1043 }
1044 FUNCTION {format.editors}
1045 { editor empty$
1046 {"inbook" type$ = 'bbl.same.field 'skip$ if$}
1047 {author empty$
1048 {editor "editor" format.names " (" *
1049 editortype empty$ {bbl.editor} {editortype} if$
1050 ")" * * }
1051 {"inbook" type$ =
1052 {bbl.same.field }
1053 {editor "editor" format.names " (" *
1054 editortype empty$ {bbl.editor} {editortype} if$
1055 ")" * *}
1056 if$}
1057 if$}
1058 if$
1059 }
1060 FUNCTION {format.in.ed.booktitle}
1061 { editor empty$
1062 {organization empty$ not author empty$ not and %if one of two not empty
1063 {word.in organization "u" change.case$ * output
1064 format.conference.info
1065 booktitle empty$ {""} {new.sentence format.booktitle} if$}
1066 {word.in
1067 organization empty$ author empty$ and 'skip$
1068 {"inbook" type$ = {bbl.same.field * output new.sentence ""}
1069 'skip$ if$ } if$
1070 booktitle empty$ 'skip$ {format.booktitle *} if$}
1071 if$}
1072 {word.in format.editors * output
1073 booktitle empty$ {""} {new.sentence format.booktitle} if$}
1074 if$
1075 output
1076 new.sentence
1077 }
1078 FUNCTION {empty.misc.check}
1079 { author empty$ title empty$ howpublished empty$
1080 month empty$ year empty$ note empty$
1081 and and and and and
1082 key empty$ not and
1083 { "todos os campos relevantes estão vazios ou faltando em " cite$ * warning$ }
1084 'skip$
1085 if$
1086 }
1087 FUNCTION {format.type}
1088 { type "type" bibinfo.check
1089 duplicate$ empty$ 'skip$
1090 {new.block "" swap$ * }
1091 if$
1092 }
1093
1094 FUNCTION {format.year}
1095 {year empty$
1096 { "campo year vazio ou faltando em " cite$ *
1097 abnt.missing.year {" (reference with [n.d.] no data)" *} 'skip$ if$ warning$
1098 abnt.missing.year {" " } {""} if$ bbl.missing.year *}
1099 {year n.dashify "year" bibinfo.check}
1100 if$
1101 }
1102
1103 FUNCTION {format.year.presented}
1104 {year-presented empty$
1105 {""}
1106 {year-presented n.dashify}
1107 if$
1108 }
1109
1110 FUNCTION {format.field.address}
1111 { 't :=
1112 address empty$ organization empty$ and url empty$ and t empty$ and
1113 {bbl.no.address.no.publisher}
1114 {address empty$
1115 %if an url is present we don't give a missing address "[s.l.]" notice
1116 {url empty$ {bbl.no.address ": "} {"" ""} if$}
1117 {address ": "}
1118 if$
1119 t empty$
1120 {%if an organization is present then it is OK not to have a publisher
1121 organization empty$ {* bbl.no.publisher * } 'pop$ if$}
1122 {* t * }
1123 if$}
1124 if$
1125 }
1126
1127 FUNCTION {format.address}
1128 {address empty$
1129 { bbl.no.address}
1130 { address}
1131 if$
1132 }
1133
1134 FUNCTION {format.publisher.address}
1135 { publisher "publisher" bibinfo.check format.field.address}
1136
1137 FUNCTION {format.publisher.address.relax}
1138 {publisher empty$ address empty$ and {""}
1139 {publisher "publisher" bibinfo.check format.field.address}
1140 if$}
1141
1142 FUNCTION {format.organization.address}
1143 { organization "organization" bibinfo.check format.field.address}
1144
1145 %retains current authorship for future use
1146 FUNCTION {compare.authorship}
1147 {abnt.repeated.author.omit
1148 {duplicate$ "" = 'skip$
1149 {duplicate$ previous.author =
1150 {duplicate$ 'previous.author :=
1151 pop$ bbl.same.field
1152 #1 'repeated.author :=}
1153 {duplicate$ 'previous.author :=
1154 #0 'repeated.author :=}
1155 if$}
1156 if$}
1157 'skip$
1158 if$
1159 }
1160
1161 FUNCTION {format.author.or.organization}
1162 { author empty$
1163 { organization empty$ 'skip$
1164 { organization "u" change.case$ "organization" bibinfo.check output}
1165 if$}
1166 { format.authors output.nonnull }
1167 if$
1168 compare.authorship
1169 }
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 := s num.names$ 'numnames :=
1215 numnames 'namesleft :=
1216 { namesleft #0 > }
1217 {abnt.last.names
1218 {s nameptr "{ll}{ jj}" format.name$}
1219 {s nameptr "{ll}" format.name$ #1 "{ll}" format.name$
1220 s nameptr "{ jj}" format.name$ *}
1221 if$
1222 't :=
1223 nameptr #1 >
1224 {namesleft #1 >
1225 { numnames abnt.etal.cite > abnt.etal.cite #0 = not and
1226 {#0 'namesleft := abnt.etal.cite {bbl.etal *} 'skip$ if$}
1227 {", " * t * } if$ }
1228 { t "others" =
1229 {abnt.etal.cite {bbl.etal *} 'skip$ if$}
1230 {numnames nameptr =
1231 {bbl.and * t *}
1232 'skip$ if$}
1233 if$
1234 }
1235 if$ }
1236 't
1237 if$
1238 nameptr #1 + 'nameptr :=
1239 namesleft #1 - 'namesleft := }
1240 while$
1241 }
1242
1243 %generates the second label in \abntrefinfo to be used with \cite
1244 FUNCTION {format.names.for.label2} %abnt-alf only
1245 { 's := "" 't :=
1246 #1 'nameptr := s num.names$ 'numnames :=
1247 numnames 'namesleft :=
1248 { namesleft #0 > }
1249 {abnt.last.names
1250 {s nameptr "{ll}{ jj}" format.name$}
1251 {s nameptr "{ll}" format.name$ #1 "{ll}" format.name$
1252 s nameptr "{ jj}" format.name$ *}
1253 if$
1254 abnt.cite.style #0 = {"u" change.case$} 'skip$ if$ 't :=
1255 nameptr #1 >
1256 {namesleft #1 >
1257 { numnames abnt.etal.cite >
1258 {#0 'namesleft := abnt.etal.cite {bbl.etal *} 'skip$ if$}
1259 {"; " * t * } if$ }
1260 { t "OTHERS" = t "others" = or
1261 {abnt.etal.cite {bbl.etal *} 'skip$ if$}
1262 {numnames nameptr = { bbl.semicolon * t *} 'skip$ if$}
1263 if$
1264 }
1265 if$ }
1266 't
1267 if$
1268 nameptr #1 + 'nameptr :=
1269 namesleft #1 - 'namesleft := }
1270 while$
1271 }
1272
1273 FUNCTION {format.title.for.label}
1274 { 's :=
1275 #1 'title.pos := #1 'first.word :=
1276 "" 't :=
1277 {first.word}
1278 {s title.pos #1 substring$ 'title.char :=
1279 title.char "." = title.char ":" = or title.char ";" = or
1280 title.char "," = or title.char " " = or s t = or
1281 {#0 'first.word :=
1282 title.pos #1 + 'title.pos :=}
1283 {title.pos #1 + 'title.pos := t title.char * 't :=}
1284 if$
1285 }
1286 while$
1287 s t = %title equals first word, dont use bbl.ldots
1288 {t "}{" * t
1289 abnt.cite.style #0 = {"u" change.case$ * } 'skip$ if$}
1290 {t bbl.ldots * "}{" * t
1291 abnt.cite.style #0 = {"u" change.case$} 'skip$ if$ * bbl.ldots *}
1292 if$
1293 }
1294
1295 %cvs keys have the general form $key: value $
1296 INTEGERS {key.pos value.pos}
1297 FUNCTION {extract.cvs.key} %we borrow the functionality of format.title.for.label
1298 { 's := %holds the entire cvs string
1299 #1 'key.pos :=
1300 #0 'value.pos := %0= between first $ and :, 1=between : and second $, 2= at the end
1301 "" 't := %holds the resulting value
1302 {value.pos #0 = value.pos #1 = or}
1303 { s key.pos #1 substring$ 'title.char :=
1304 value.pos #0 =
1305 { title.char ":" = {#1 'value.pos := key.pos #1 + 'key.pos :=} 'skip$ if$}
1306 { title.char "$" =
1307 {#2 'value.pos :=}
1308 {t title.char * 't :=}
1309 if$}
1310 if$
1311 key.pos #1 + 'key.pos :=
1312 }
1313 while$
1314 t
1315 }
1316
1317 %generates and extended label of type {Author}{AUTHOR}{YEAR}
1318 %for abnt.cite.style=1 they will be of type {Author}{Author}{YEAR}
1319 %final result is placed into variable label
1320 FUNCTION {calc.extended.label}
1321 { "{"
1322 author empty$ not
1323 {author format.names.for.label1 * "}{" * author format.names.for.label2 *}
1324 {editor empty$ not
1325 {editor format.names.for.label1 * "}{" * editor format.names.for.label2 *}
1326 {org-short empty$ not
1327 {org-short * "}{" * org-short "u" change.case$ *}
1328 {organization empty$ not
1329 {organization * "}{" * organization "u" change.case$ *}
1330 {title empty$ not
1331 {title format.title.for.label *}
1332 {"nada}{NADA" *}
1333 if$}
1334 if$}
1335 if$}
1336 if$}
1337 if$
1338 "}{" *
1339 year empty$ 'skip$ {year *} if$
1340 'label := %place the stack into label
1341 % final } will be placed in reverse.pass
1342 }
1343 %generates and simple label of type "Author YEAR"
1344 %final result is placed onto the stack
1345 FUNCTION {calc.simple.label}
1346 { author empty$ not
1347 {author format.names.for.label1}
1348 {editor empty$ not
1349 {editor format.names.for.label1}
1350 {organization empty$ not
1351 {organization}
1352 {title empty$ not
1353 {title}
1354 {""}
1355 if$}
1356 if$}
1357 if$}
1358 if$
1359 year empty$ 'skip$ {" " * year *} if$
1360 }
1361
1362 FUNCTION {output.bibitem}
1363 { newline$
1364 abnt.alf
1365 {"\bibitem[" write$
1366 calc.simple.label
1367 write$ "]{"}
1368 {"\bibitem{"}
1369 if$
1370 write$ cite$ write$ "}" write$ newline$
1371 abnt.refinfo #1 = {"\abntrefinfo" write$ label write$ newline$} 'skip$ if$
1372 "{" write$
1373 "" before.all 'output.state :=
1374 }
1375 FUNCTION {output.hiddenbibitem}
1376 { newline$
1377 abnt.alf
1378 {"\hiddenbibitem[" write$
1379 calc.simple.label
1380 write$ "]{"}
1381 {"\bibitem{"}
1382 if$
1383 write$ cite$ write$ "}" write$ newline$
1384 abnt.refinfo #1 = {"\abntrefinfo" write$ label write$ newline$} 'skip$ if$
1385 "{" write$
1386 "" before.all 'output.state :=
1387 }
1388 FUNCTION {fin.entry}
1389 { add.period$ write$
1390 reprinted-from empty$ 'skip$
1391 {" " reprinted-text empty$
1392 {bbl.reprint} {reprinted-text} if$ * bbl.colon *
1393 "\abntreprintinfo{ " * reprinted-from * "}" * write$}
1394 if$
1395 abnt-note empty$ 'skip$
1396 {"\footnote{" abnt-note * "}" * write$} if$
1397 "}" write$
1398 %newline$
1399 write.entry.verbatim
1400 }
1401
1402 FUNCTION { abnt.display.options}
1403 { 's := 't :=
1404 abnt.show.options #1 = % "warn"
1405 {"opção " t * " passou para " * s * warning$ } 'skip$ if$
1406
1407 abnt.show.options #2 = % "list"
1408 {"Op\c c\~ao selecionada {\tt " t * "=}\verb+" * s * "+" * output new.sentence } 'skip$ if$
1409 }
1410
1411 FUNCTION { abnt-options1 }
1412 {
1413 abnt-show-options empty$
1414 'skip$
1415 {abnt-show-options "no" =
1416 {#0} {abnt-show-options "warn" =
1417 {#1} {abnt-show-options "list" =
1418 {#2 } {#0 } if$} if$} if$
1419 'abnt.show.options :=} % #0 "no"; #1 "warn"; #2 "list"
1420 if$
1421
1422 abnt.show.options #2 =
1423 {output.bibitem "Mudan\c ca de estilo ap\'os este ponto com o comando \verb!\citeoption{"
1424 cite$ * "}! " *
1425 output new.sentence} 'skip$ if$
1426
1427 abnt-show-options empty$
1428 'skip$ {"abnt-show-options" abnt-show-options abnt.display.options} if$
1429
1430 abnt-cite-style empty$
1431 'skip$
1432 {abnt-cite-style "(AUTHOR, YEAR)" =
1433 {#0 'abnt.cite.style :=}
1434 {abnt-cite-style "(Author, YEAR)" =
1435 {#1 'abnt.cite.style :=}
1436 {"opção " abnt-cite-style * " desconhecida" * warning$}
1437 if$}
1438 if$
1439 "abnt-cite-style" abnt-cite-style abnt.display.options}if$
1440
1441 abnt-experimental empty$
1442 'skip$ {abnt-experimental "yes" = 'abnt.experimental :=
1443 "abnt-experimental" abnt-experimental abnt.display.options} if$
1444
1445 abnt-emphasize duplicate$ empty$
1446 'pop$ {'abnt.emphasize :=
1447 "abnt-emphasize" abnt.emphasize abnt.display.options
1448 abnt-emphasize "\bf" = abnt-emphasize "\it" = or abnt-emphasize "\em" = or
1449 abnt-emphasize "\bfseries" = or
1450 {"não use " abnt-emphasize * " para abnt-emphasize em " * cite$ *
1451 ", isto alterará TODO o texto. Use \textbf ou \emph. Veja a documentação abnt-bibtex-doc para mais detalhes." * warning$}
1452 'skip$ if$
1453 } if$
1454
1455 abnt-doi empty$
1456 'skip$
1457 {abnt-doi "expand" =
1458 {abnt.doi.expand.to.url 'abnt.doi :=}
1459 {abnt-doi "link" =
1460 {abnt.doi.link 'abnt.doi :=}
1461 {abnt-doi "doi" =
1462 {abnt.doi.leave.as.is 'abnt.doi :=}
1463 {"opção " abnt-doi * " desconhecida" * warning$}
1464 if$}
1465 if$}
1466 if$
1467 "abnt-doi" abnt-doi abnt.display.options}if$
1468 }
1469 FUNCTION { abnt-options2 }
1470 {
1471 abnt-full-initials empty$
1472 'skip$ {abnt-full-initials "yes" = 'abnt.full.initials :=
1473 "abnt-full-initials" abnt-full-initials abnt.display.options} if$
1474
1475 abnt-last-names empty$
1476 'skip$
1477 {abnt-last-names "abnt" = {#0}
1478 {abnt-last-names "bibtex" = {#1} {#0} if$} if$
1479 'abnt.last.names :=
1480 "abnt-last-names" abnt-last-names abnt.display.options}
1481 if$
1482
1483 abnt-ldots-type empty$
1484 'skip$
1485 {abnt-ldots-type "none" = {#0}
1486 {abnt-ldots-type "normal" = {#1}
1487 {abnt-ldots-type "math" = {#2}
1488 {abnt-ldots-type "text" = {#1} {#0}
1489 if$} if$} if$} if$
1490 'abnt.ldots.type :=
1491 "abnt-ldots-type" abnt-ldots-type abnt.display.options}
1492 if$
1493
1494 abnt-missing-year empty$
1495 'skip$
1496 {abnt-missing-year "void" = {#0}
1497 {abnt-missing-year "sd" = {#1} {#0} if$}
1498 if$
1499 'abnt.missing.year :=
1500 "abnt-missing-year" abnt-missing-year abnt.display.options}
1501 if$
1502
1503 abnt-and-type empty$
1504 'skip$ {abnt-and-type "e" =
1505 {#0} {abnt-and-type "&" =
1506 {#1} {#0} if$} if$
1507 'abnt.and.type :=
1508 "abnt-and-type" abnt-and-type abnt.display.options}
1509 if$
1510
1511 abnt-thesis-year empty$
1512 'skip$ {abnt-thesis-year "final" =
1513 {#0} {abnt-thesis-year "title" =
1514 {#1} {abnt-thesis-year "both" =
1515 {#2} {#0} if$} if$} if$
1516 'abnt.thesis.year :=
1517 "abnt-thesis-year" abnt-thesis-year abnt.display.options}
1518 if$
1519
1520 abnt-refinfo empty$
1521 'skip$ {abnt-refinfo "yes" = 'abnt.refinfo :=
1522 "abnt-refinfo" abnt-refinfo abnt.display.options} if$
1523 }
1524 FUNCTION { abnt-options3 }
1525 {
1526
1527 abnt-dont-use-etal empty$
1528 'skip$ {abnt-dont-use-etal "yes" = {#0 'abnt.etal.list :=} 'skip$ if$
1529 "Uso da opção abnt-dont-use-etal se tornou obsoleto, usamos abnt-etal-list." warning$
1530 "abnt-etal-list" abnt.etal.list int.to.str$ abnt.display.options} if$
1531
1532 abnt-etal-cite empty$
1533 'skip$ {abnt-etal-cite str.to.int 'abnt.etal.cite :=
1534 "abnt-etal-cite" abnt.etal.cite int.to.str$ abnt.display.options} if$
1535
1536 abnt-etal-list empty$
1537 'skip$ {abnt-etal-list str.to.int 'abnt.etal.list :=
1538 "abnt-etal-list" abnt.etal.list int.to.str$ abnt.display.options} if$
1539
1540 abnt-etal-text missing$
1541 'skip$ {abnt-etal-text 'abnt.etal.text :=
1542 "abnt-etal-text" abnt.etal.text abnt.display.options} if$
1543
1544 abnt-no-etal-label empty$
1545 'skip$ {abnt-no-etal-label "yes" = {#0 'abnt.etal.cite :=} 'skip$ if$
1546 "Uso da opção abnt-no-etal-label se tornou obsoleto, usamos abnt-etal-cite." warning$
1547 "abnt-etal-cite" abnt.etal.cite int.to.str$ abnt.display.options} if$
1548
1549 abnt-repeated-author-omit empty$
1550 'skip$ {abnt-repeated-author-omit "yes" =
1551 {#1 'abnt.repeated.author.omit :=}
1552 {#0 'abnt.repeated.author.omit := "" 'previous.author :=} if$
1553 "abnt-repeated-author-omit" abnt-repeated-author-omit abnt.display.options} if$
1554
1555 abnt-repeated-title-omit empty$ 'skip$
1556 {abnt-repeated-title-omit "yes" =
1557 {#1 'abnt.repeated.title.omit :=}
1558 {#0 'abnt.repeated.title.omit := "" 'previous.title :=} if$
1559 "abnt-repeated-title-omit" abnt-repeated-title-omit abnt.display.options
1560 abnt.repeated.author.omit not abnt.repeated.title.omit and
1561 {"Use abnt-repeated-title-omit=yes junto com abnt-repeated-author-omit=yes"
1562 warning$} 'skip$ if$} if$
1563
1564 abnt-title-command empty$
1565 'skip$ {abnt-title-command "yes" =
1566 {#1 'abnt.title.command :=}
1567 {#0 'abnt.title.command :=} if$
1568 "abnt-title-command" abnt-title-command abnt.display.options} if$
1569
1570 abnt-url-package empty$ 'skip$
1571 {abnt-url-package "url" =
1572 {#1 'abnt.url.package :=}
1573 {abnt-url-package "hyperref" = {#2 'abnt.url.package :=} 'skip$ if$}
1574 if$
1575 "abnt-url-package" abnt-url-package abnt.display.options}
1576 if$
1577
1578 abnt-verbatim-entry empty$
1579 'skip$ {abnt-verbatim-entry "yes" = 'abnt.verbatim.entry :=
1580 "abnt-verbatim-entry" abnt-verbatim-entry abnt.display.options} if$
1581
1582 abnt.show.options #2 = 'fin.entry 'skip$ if$
1583 }
1584
1585 %we had to break this function in two parts because of the following message:
1586 %Sorry---you've exceeded BibTeX's single function space 100
1587 %(That was a fatal error)
1588 FUNCTION { iso-options1 }
1589 {
1590 iso-abbreviation empty$
1591 'skip$ {iso-abbreviation "standard" = 'iso.abbreviation :=
1592 "iso-abbreviation" iso-abbreviation abnt.display.options} if$
1593 iso-author-punctuation empty$
1594 'skip$ {iso-author-punctuation "void" = 'iso.author.punctuation :=
1595 "iso-author-punctuation" iso-author-punctuation abnt.display.options} if$
1596 iso-date-place empty$
1597 'skip$ {iso-date-place "ISO" = 'iso.date.place :=
1598 "iso-date-place" iso-date-place abnt.display.options} if$
1599 }
1600
1601 FUNCTION { abnt-options }
1602 {
1603 abnt-options1
1604 abnt-options2
1605 abnt-options3
1606 iso-options1
1607 }
1608
1609 FUNCTION { iso-options } { abnt-options }
1610
1611 FUNCTION { iso.year.label }
1612 { iso.date.place
1613 { abnt.alf
1614 {year.label output new.sentence}
1615 'skip$ if$}
1616 'skip$ if$}
1617
1618 FUNCTION { iso.date }
1619 { iso.date.place
1620 { abnt.alf
1621 'skip$
1622 {year output new.sentence}
1623 if$}
1624 'skip$ if$}
1625
1626 FUNCTION { non.iso.date }
1627 {iso.date.place 'skip$ {format.date output} if$}
1628
1629 FUNCTION {article}
1630 { output.bibitem
1631 format.author.or.organization new.sentence
1632 iso.year.label
1633 format.title "title" output.check new.block
1634 format.journal output
1635 iso.date.place {format.year output} 'skip$ if$
1636 %iso.date.place {format.date output} 'skip$ if$
1637 %iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1638 % {format.year output new.sentence} if$
1639 section "section" bibinfo.check output.dash
1640 publisher "publisher" bibinfo.check output
1641 address "address" bibinfo.check output
1642 format.volume output
1643 format.number output
1644 format.pages output
1645 non.iso.date
1646 format.issn output new.block
1647 format.note output new.block
1648 format.doi output new.block
1649 format.url
1650 fin.entry
1651 }
1652 FUNCTION {book}
1653 { output.bibitem
1654 format.author.or.editor.or.organization new.sentence
1655 iso.year.label
1656 format.type output new.sentence
1657 format.btitle "title" output.check new.sentence
1658 format.furtherresp new.sentence
1659 format.edition output new.sentence
1660 format.publisher.address output
1661 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1662 {format.year output new.sentence} if$
1663 format.volume output new.sentence
1664 format.book.pages output
1665 format.illustrated
1666 format.dimensions new.sentence
1667 format.howpublished output new.sentence
1668 format.volume.number.series output new.sentence
1669 format.note output
1670 format.issn output %pode parecer curioso, mas revistas inteiras são tratadas como livro
1671 format.isbn output new.sentence
1672 format.doi output new.block
1673 format.url
1674 fin.entry
1675 }
1676 FUNCTION {booklet}
1677 { output.bibitem
1678 format.author.or.editor.or.organization new.sentence
1679 iso.year.label
1680 format.type output new.sentence
1681 format.btitle "title" output.check new.sentence
1682 format.edition output new.sentence
1683 address "address" bibinfo.check output
1684 format.bvolume output
1685 %format.date output new.sentence
1686 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1687 {format.year output new.sentence} if$
1688 format.book.pages output new.sentence
1689 format.volume.number.series output new.sentence
1690 format.note output
1691 format.isbn output new.sentence
1692 format.doi output new.block
1693 format.url
1694 fin.entry
1695 }
1696
1697 FUNCTION {hidden}
1698 { output.hiddenbibitem
1699 fin.entry}
1700
1701 FUNCTION {inbook}
1702 { output.bibitem
1703 format.author.or.organization new.sentence
1704 iso.year.label
1705 format.title "title" output.check new.block
1706 format.in.ed.booktitle
1707 format.furtherresp new.sentence
1708 format.edition output new.sentence
1709 format.publisher.address output
1710 %format.year output new.sentence
1711 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1712 {format.year output new.sentence} if$
1713 format.bvolume.if.no.series output
1714 format.volume.number.series output
1715 format.chapter.pages output new.sentence
1716 format.isbn output new.block
1717 format.note output new.block
1718 format.doi output new.block
1719 format.url
1720 fin.entry
1721 }
1722
1723 FUNCTION {incollection}
1724 { output.bibitem
1725 format.author.or.organization new.sentence
1726 iso.year.label
1727 format.title "title" output.check new.sentence
1728 format.in.ed.booktitle
1729 format.edition output new.sentence
1730 format.publisher.address output
1731 %format.year output
1732 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1733 {format.year output} if$
1734 format.volume.number.series output new.sentence
1735 format.bvolume.if.no.series output
1736 format.chapter.pages output new.sentence
1737 format.isbn output new.block
1738 format.note output new.block
1739 format.doi output new.block
1740 format.url
1741 fin.entry
1742 }
1743 FUNCTION {inproceedings}
1744 { output.bibitem
1745 format.author.or.organization new.sentence
1746 iso.year.label
1747 format.title "title" output.check new.sentence
1748 format.in.ed.booktitle
1749 format.publisher.address output
1750 %format.year output new.sentence
1751 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1752 {format.year output new.sentence} if$
1753 format.bvolume.if.no.series output
1754 format.volume.number.series output
1755 format.pages output
1756 format.isbn output
1757 format.issn output new.sentence
1758 format.note output new.sentence
1759 format.doi output new.block
1760 format.url
1761 fin.entry
1762 }
1763 FUNCTION {journalpart}
1764 { output.bibitem
1765 format.author.or.editor.or.organization new.sentence
1766 iso.year.label
1767 format.type output new.sentence
1768 format.btitle "title" output.check new.sentence
1769 format.furtherresp new.sentence
1770 format.edition output new.sentence
1771 format.publisher.address output
1772 format.volume output
1773 format.number output
1774 %format.date output new.sentence
1775 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1776 {format.date output new.sentence} if$
1777 format.book.pages output
1778 format.illustrated
1779 format.dimensions new.sentence
1780 format.note output
1781 format.issn output %pode parecer curioso, mas revistas inteiras são tratadas como livro
1782 format.isbn output new.sentence
1783 format.doi output new.block
1784 format.url
1785 fin.entry
1786 }
1787 FUNCTION {conference} { inproceedings }
1788 FUNCTION {manual}
1789 { output.bibitem
1790 format.author.or.editor.or.organization new.sentence
1791 iso.year.label
1792 format.btitle "title" output.check new.block
1793 format.furtherresp new.sentence
1794 format.edition output new.sentence
1795 format.address output
1796 %format.date output new.sentence
1797 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1798 {format.year output new.sentence} if$
1799 format.bvolume.if.no.series output
1800 format.book.pages output new.sentence
1801 format.volume.number.series output new.sentence
1802 format.note output new.sentence
1803 format.doi output new.block
1804 format.url
1805 fin.entry
1806 }
1807
1808 FUNCTION {misc}
1809 { output.bibitem
1810 format.author.or.editor.or.organization new.sentence
1811 iso.year.label
1812 format.type output
1813 format.btitle output new.sentence
1814 format.furtherresp new.sentence
1815 format.publisher.address.relax output
1816 %format.date output new.block
1817 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1818 {format.year output new.sentence} if$
1819 format.book.pages output new.sentence
1820 format.illustrated
1821 format.dimensions new.sentence
1822 format.howpublished output new.block
1823 format.volume.number.series output new.sentence
1824 format.note output new.block
1825 format.doi output new.block
1826 format.url
1827 fin.entry
1828 empty.misc.check
1829 }
1830
1831 FUNCTION {patent}
1832 { output.bibitem
1833 format.editor.or.organization new.sentence
1834 iso.year.label
1835 format.authors.plain output new.sentence
1836 format.btitle output new.sentence
1837 format.furtherresp new.sentence
1838 %format.date output new.block
1839 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1840 {format.year output new.sentence} if$
1841 format.patent.number output
1842 format.howpublished output new.block
1843 format.note output new.block
1844 format.url
1845 fin.entry
1846 empty.misc.check
1847 }
1848
1849 FUNCTION {format.thesis.type}
1850 { type$ "phdthesis" =
1851 {bbl.phdthesis}
1852 {type$ "mastersthesis" =
1853 {bbl.mthesis}
1854 {type$ "monography" =
1855 {bbl.monography}
1856 {bbl.void}
1857 if$}
1858 if$}
1859 if$
1860 type empty$
1861 {type missing$
1862 {type$ "phdthesis" =
1863 { " (" bbl.phd * ")" *}
1864 {type$ "mastersthesis" = { " (" bbl.master * ")" *} {pop$ ""} if$}
1865 if$}
1866 {""}
1867 if$}
1868 {type$ "thesis" =
1869 {type}
1870 {" (" type * ")" * "type" bibinfo.check}
1871 if$}
1872 if$
1873 * %joins first and second part of this function
1874 }
1875 FUNCTION {thesis}
1876 { output.bibitem
1877 format.authors "author" output.check new.block
1878 iso.year.label
1879 format.btitle "title" output.check new.block
1880 abnt.thesis.year #1 = abnt.thesis.year #2 = or
1881 {format.date "year" output.check new.sentence} 'skip$ if$
1882 format.year.presented output new.sentence
1883 format.book.pages output new.sentence
1884 format.thesis.type output.nonnull
1885 school "school" bibinfo.warn output.dash
1886 address "address" bibinfo.check output
1887 abnt.thesis.year #0 = abnt.thesis.year #2 = or
1888 {format.date "year" output.check new.sentence} 'skip$ if$
1889 format.note output new.block
1890 format.doi output new.block
1891 format.url
1892 fin.entry
1893 }
1894
1895 FUNCTION {phdthesis} { thesis }
1896 FUNCTION {mastersthesis} { thesis }
1897 FUNCTION {monography} { thesis }
1898
1899 FUNCTION {proceedings}
1900 { output.bibitem
1901 iso.year.label
1902 format.editor.or.organization
1903 format.conference.info
1904 format.btitle "title" output.check
1905 format.bvolume output
1906 format.volume.number.series output
1907 editor empty$
1908 { publisher empty$
1909 'skip$
1910 { new.sentence format.publisher.address output format.year output}
1911 if$
1912 }
1913 { publisher empty$
1914 { new.sentence
1915 format.organization.address output format.year output}
1916 { new.sentence
1917 organization "organization" bibinfo.check output
1918 format.publisher.address output format.year output}
1919 if$ }
1920 if$
1921 new.sentence format.book.pages output new.sentence
1922 format.isbn output
1923 format.issn output new.block
1924 format.note output new.block
1925 format.doi output new.block
1926 format.url
1927 fin.entry
1928 }
1929
1930 FUNCTION {techreport} {manual}
1931
1932 FUNCTION {unpublished}
1933 { output.bibitem
1934 format.author.or.editor.or.organization new.sentence
1935 iso.year.label
1936 format.title "title" output.check new.sentence
1937 format.note "note" output.check new.sentence
1938 %format.date output new.sentence
1939 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1940 {format.year output new.sentence} if$
1941 format.doi output new.block
1942 format.url
1943 fin.entry
1944 }
1945
1946 FUNCTION {default.type} { misc }
1947 READ
1948 FUNCTION {sortify}
1949 { purify$
1950 "l" change.case$
1951 }
1952 INTEGERS { len }
1953 FUNCTION {chop.word}
1954 { 's :=
1955 'len :=
1956 s #1 len substring$ =
1957 { s len #1 + global.max$ substring$ }
1958 's
1959 if$
1960 }
1961 FUNCTION {sort.format.names}
1962 { 's :=
1963 #1 'nameptr :=
1964 ""
1965 s num.names$ 'numnames :=
1966 numnames 'namesleft :=
1967 { namesleft #0 > }
1968 { format.single.name 't :=
1969 nameptr #1 >
1970 {
1971 nameptr #3
1972 #1 + =
1973 numnames #3
1974 > and
1975 { "others" 't :=
1976 #1 'namesleft := }
1977 'skip$
1978 if$
1979 " " *
1980 namesleft #1 = t "others" = and
1981 { "zzzzz" * }
1982 { t sortify * }
1983 if$
1984 }
1985 { t sortify * }
1986 if$
1987 nameptr #1 + 'nameptr :=
1988 namesleft #1 - 'namesleft :=
1989 }
1990 while$
1991 }
1992
1993 FUNCTION {sort.format.title}
1994 { 't :=
1995 "A " #2
1996 "An " #3
1997 "The " #4 t chop.word
1998 chop.word
1999 chop.word
2000 sortify
2001 #1 global.max$ substring$
2002 }
2003 FUNCTION {any.sort}
2004 { author empty$
2005 { organization empty$
2006 { editor empty$
2007 { title empty$
2008 { key empty$
2009 { "para ordenar, precisa dos campos author, organization, editor, title ou key in " cite$ * warning$ ""}
2010 { key sortify }
2011 if$}
2012 { title sortify}
2013 if$}
2014 { editor sort.format.names }
2015 if$}
2016 { organization sortify }
2017 if$}
2018 { author sort.format.names }
2019 if$
2020 }
2021
2022 FUNCTION {presort}
2023 {
2024 any.sort
2025 " " * year field.or.null sortify * " " * title field.or.null
2026 sort.format.title * #1 entry.max$ substring$
2027 %for non-alpha style we drop a void sort.key such that SORT has no effect
2028 abnt.alf 'skip$ {pop$ ""} if$ 'sort.key$ :=
2029 year empty$ {""} {year} if$ 'year.label :=
2030 calc.extended.label
2031 }
2032
2033 FUNCTION {set.default.abnt.variables}
2034 { %if you change abnt-num to abnt-alf by hand you need also to change
2035 %the name of RCSfile by hand, otherwise cvs takes care of it.
2036 %
2037 "$RCSfile: unbtex-num-en.bst,v $ " extract.cvs.key
2038 %
2039 "unbtex-alf-en.bst,v " = 'abnt.alf := % #1 para abnt-alf #0 para abnt-num
2040 "$Revision: v-1.9.7 $" extract.cvs.key 'abnt.bst.revision :=
2041 #0 'abnt.and.type := % #0 "e"; #1 "&"
2042 "\emph" 'abnt.emphasize :=
2043 #0 'abnt.cite.style := %default norm version for NBR10520
2044 %#0 \cite=(AUTHOR, YEAR)
2045 %#1 \cite=(Author, YEAR)
2046 #0 'abnt.experimental :=
2047 abnt.doi.expand.to.url 'abnt.doi :=
2048 #3 'abnt.etal.cite :=
2049 #3 'abnt.etal.list :=
2050 "et al." 'abnt.etal.text :=
2051 #0 'abnt.full.initials :=
2052 #0 'abnt.last.names := %#0 abnt-style, #1 bibtex-style
2053 #1 'abnt.ldots.type := %#0 use nothing, #1 use \ldots, #2 use $\ldots$, 3# use {...}
2054 #0 'abnt.missing.year := %#0 "void"; #1 "[n.d.]"
2055 #0 'repeated.author :=
2056 #0 'abnt.repeated.author.omit :=
2057 #0 'abnt.repeated.title.omit :=
2058 #1 'abnt.refinfo :=
2059 #0 'abnt.show.options := % #0 "no"; #1 "warn"; #2 "list"
2060 #0 'abnt.thesis.year := % #0 "final"; #1 "title"; #2 "both"
2061 #0 'abnt.title.command := % #0 "no"; #1 "yes"
2062 #0 'abnt.url.package := % #0 "none"'; #2 "url"; #2 "hyperref"
2063 #0 'abnt.verbatim.entry :=
2064 }
2065 FUNCTION {set.default.iso.variables}
2066 { #0 'iso.abbreviation := % #0 ABNT-style; #1 ISO-style
2067 #0 'iso.author.punctuation := % #0 ABNT (Smith, A. B.); #1 ISO (Smith, AB)
2068 #0 'iso.date.place := % #0 ABNT-sty; #1 ISO-style
2069 }
2070 EXECUTE {set.default.abnt.variables}
2071 EXECUTE {set.default.iso.variables}
2072 FUNCTION {process.early.abnt.options}
2073 {%here we intercept all entries which need priority handling
2074 %note: we cannot use type$ at this point
2075 abnt-and-type missing$
2076 abnt-experimental missing$ and
2077 abnt-etal-cite missing$ and
2078 abnt-etal-text missing$ and
2079 abnt-ldots-type missing$ and
2080 abnt-cite-style missing$ and
2081 abnt-no-etal-label missing$ and
2082 abnt-title-command missing$ and
2083 'skip$ {call.type$} if$
2084 }
2085 ITERATE {process.early.abnt.options}
2086 FUNCTION {search.reprinted}
2087 { reprinted-from missing$ 'skip$
2088 {"\nocite{" reprinted-from * "}" * write$ newline$
2089 }
2090 if$
2091 }
2092 ITERATE {search.reprinted}
2093 FUNCTION {abntreprintinfo}
2094 {"\providecommand{\abntreprintinfo}[1]{%" write$ newline$
2095 " \citeonline{#1}}" write$ newline$}
2096 EXECUTE {abntreprintinfo}
2097 ITERATE {presort}
2098 SORT
2099 STRINGS { last.label next.extra}
2100 INTEGERS { last.extra.num }
2101 FUNCTION {forward.pass}
2102 { last.label label =
2103 { last.extra.num #1 + 'last.extra.num :=
2104 last.extra.num int.to.chr$ 'extra.label :=
2105 }
2106 { "a" chr.to.int$ 'last.extra.num :=
2107 "" 'extra.label :=
2108 label 'last.label :=
2109 }
2110 if$
2111 }
2112
2113 FUNCTION {reverse.pass}
2114 { next.extra "b" =
2115 { "a" 'extra.label := }
2116 'skip$
2117 if$
2118 label extra.label * 'label :=
2119 year.label extra.label * 'year.label :=
2120 extra.label 'next.extra :=
2121 label "}" * 'label :=
2122 }
2123 ITERATE {forward.pass}
2124 REVERSE {reverse.pass}
2125 FUNCTION {begin.bib}
2126 {
2127 abnt.alf
2128 {"\setlength{\labelsep}{0pt}" write$}
2129 'skip$
2130 if$
2131 "\begin{thebibliography}{}" write$ newline$
2132 preamble$ empty$
2133 'skip$
2134 { preamble$ write$ newline$ }
2135 if$
2136 abnt.refinfo #1 =
2137 {"\providecommand{\abntrefinfo}[3]{}" write$ newline$}
2138 'skip$ if$
2139 "\providecommand{\abntbstabout}[1]{}" write$ newline$
2140 abnt.title.command
2141 {"\providecommand{\bibtextitlecommand}[2]{#2}" write$ newline$}
2142 'skip$ if$
2143 "\abntbstabout{" abnt.bst.revision * "}" * write$ newline$
2144 % Ajusta o espaçamento entre linhas nas referências bibliográficas
2145 %"\setlength{\baselineskip}{1.0\baselineskip}" write$ newline$
2146 %"\setlength{\itemsep}{0pt}" write$ newline$
2147 }
2148 EXECUTE {begin.bib}
2149 EXECUTE {init.state.consts}
2150 FUNCTION {process.entry}{call.type$}
2151 ITERATE {process.entry}
2152 FUNCTION {end.bib}
2153 { newline$ "\end{thebibliography}" write$ newline$
2154 }
2155 EXECUTE {end.bib}