Debian Codegraph @

texmf-dist/bibtex/bst/abntex2/abntex2-num.bst

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