Debian Codegraph @

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

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