Debian Codegraph @

texmf-dist/bibtex/bst/fcavtex/fcavtex.bst

raw
1 %% fcavtex.bst, v-1.1 waltermaldonado
2 %% Copyright 2015 by Walter Maldonado Jr
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 %% This file is a modified version of the one provided by Lauro César Araujo
15 %% Further information are available on https://github.com/waltermaldonado/fcavTeX
16 %%
17 %% The Current Maintainer of this work is Walter Maldonado Jr
18 %%
19 %% Creator and original mantainer: Gerald Weber <[email protected]>
20 %% Copyright 2001-2002 by the abnTeX group at http://abntex.codigolivre.org.br
21 %%
22 %% This file is an *extensive* modification from a file generated with the docstrip utility.
23 %% The original source files were:
24 %% 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')
25 %% These sourefiles are copyrighted by Patrick W Daly
26
27 ENTRY
28 { address author
29 booktitle booksubtitle
30 chapter conference-number conference-year conference-location
31 edition editor editortype
32 dimensions furtherresp
33 howpublished illustrated institution
34 isbn issn journal key month note marginnote number organization
35 org-short pages pagename
36 publisher reprinted-from reprinted-text school
37 series subtitle section title type url urldate
38 volume year year-presented
39 abnt-and-type
40 abnt-doi abnt-dont-use-etal
41 abnt-etal-cite abnt-etal-list abnt-etal-text abnt-emphasize abnt-experimental
42 abnt-full-initials
43 abnt-last-names abnt-ldots-type
44 abnt-missing-year abnt-cite-style abnt-no-etal-label abnt-note
45 abnt-repeated-author-omit abnt-repeated-title-omit
46 abnt-show-options abnt-refinfo abnt-thesis-year abnt-url-package
47 abnt-title-command
48 abnt-verbatim-entry
49 iso-abbreviation iso-author-punctuation iso-date-place
50 }{}{ label extra.label year.label}
51
52 %revision string
53 STRINGS { abnt.bst.revision }
54
55 %general purpose strings
56 STRINGS { r s t }
57
58 %variables needed to implement the various abnt options
59 STRINGS {abnt.etal.text abnt.emphasize previous.author previous.title}
60 INTEGERS {abnt.alf abnt.cite.style abnt.doi
61 abnt.experimental abnt.etal.cite abnt.etal.list
62 abnt.full.initials
63 abnt.last.names abnt.ldots.type
64 abnt.missing.year
65 abnt.refinfo abnt.repeated.author.omit abnt.repeated.title.omit
66 abnt.show.options abnt.and.type
67 abnt.title.command
68 abnt.thesis.year
69 abnt.url.package abnt.verbatim.entry
70 iso.abbreviation iso.author.punctuation iso.date.place
71 repeated.author}
72
73 %needed for title formatting
74 INTEGERS { title.lenght title.pos first.word no.bracket}
75 STRINGS { title.char}
76
77 %needed for controlling the sentence position
78 INTEGERS {output.state before.all mid.sentence after.sentence after.block }
79
80 %needed for url identification
81 INTEGERS {url.type}
82
83 %static values for options
84 %values for abnt.doi
85 FUNCTION {abnt.doi.expand.to.url} {#0} %expands a doi address to its url correspondent
86 FUNCTION {abnt.doi.link} {#1} %links doi to its url correspondent
87 FUNCTION {abnt.doi.leave.as.is} {#2} %shows doi as is, external viewer will have
88 %to know what to do with a "doi:" document
89
90 %values for url types
91 FUNCTION {unknown.url} {#0}
92 FUNCTION {http.url} {#1}
93 FUNCTION {file.url} {#2}
94 FUNCTION {ftp.url} {#3}
95 FUNCTION {doi.url} {#4}
96 FUNCTION {mailto.url} {#5}
97
98 FUNCTION {init.state.consts}
99 { #0 'before.all :=
100 #1 'mid.sentence :=
101 #2 'after.sentence :=
102 #3 'after.block :=
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 "urldate" urldate 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 "{, f.}{ vv}" format.name$ *
486 r #1 "{ll}" format.name$
487 #1 "{ f.}{ 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$ ""} {} 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.volume.no.bbl} %leaves formatted or empty volume on the stack
794 {volume duplicate$ empty$
795 'skip$
796 {volume #1 #1 substring$ is.num
797 {"" swap$ tie.or.space.prefix * "." * *}
798 'skip$
799 if$}
800 if$
801 }
802
803 FUNCTION {anais.check.url}
804 { url empty$
805 {"Anais\ldots" emphasize}
806 {"Anais eletrônicos\ldots" emphasize}
807 if$
808 }
809
810 FUNCTION {format.number} %leaves formatted or empty number on the stack
811 { number duplicate$ empty$
812 'skip$
813 {bbl.number swap$ tie.or.space.prefix * *}
814 if$
815 }
816
817 FUNCTION {format.patent.number}
818 { number
819 }
820
821 FUNCTION {format.bvolume}
822 { volume empty$
823 { "" }
824 { format.volume
825 number empty$ 'skip$ {output format.number} if$
826 series "series" bibinfo.check
827 duplicate$ empty$ 'pop$
828 { swap$ bbl.of space.word * swap$
829 emphasize * }
830 if$
831 }
832 if$
833 }
834
835 FUNCTION {format.bvolume.if.no.series}
836 { series empty$
837 { format.bvolume }
838 { "" }
839 if$
840 }
841
842
843 FUNCTION {format.number.or.volume}
844 {number empty$
845 {format.volume}
846 {number} %we use the pure number here without leading "n."
847 if$
848 }
849
850 FUNCTION {format.volume.and.number}
851 {format.volume output
852 format.number
853 }
854
855 FUNCTION {format.volume.number.series}
856 { number empty$ volume empty$ and
857 { series empty$
858 { "" }
859 {" (" series "series" bibinfo.check * ")" *}
860 if$}
861 { series empty$
862 {""} %{ format.number.or.volume }
863 { " (" series "series" bibinfo.check * ", " *
864 format.number.or.volume * ")" * }
865 if$ }
866 if$
867 }
868
869 FUNCTION {extract.num}
870 { duplicate$ 't :=
871 "" 's :=
872 { t empty$ not }
873 { t #1 #1 substring$
874 t #2 global.max$ substring$ 't :=
875 duplicate$ is.num
876 { s swap$ * 's := }
877 { pop$ "" 't := }
878 if$ }
879 while$
880 s empty$
881 'skip$
882 { pop$ s }
883 if$
884 }
885
886 FUNCTION {format.edition}
887 { edition duplicate$ empty$ 'skip$
888 {output.state mid.sentence = { "l" } { "t" } if$ change.case$
889 "edition" bibinfo.check
890 edition #1 #1 substring$ is.num {". " * bbl.edition * } 'skip$ if$}
891 if$
892 }
893 INTEGERS { multiresult }
894 FUNCTION {multi.page.check}
895 { 't :=
896 #0 'multiresult :=
897 { multiresult not
898 t empty$ not
899 and }
900 { t #1 #1 substring$
901 duplicate$ "-" =
902 swap$ duplicate$ "," =
903 swap$ "+" =
904 or or
905 { #1 'multiresult := }
906 { t #2 global.max$ substring$ 't := }
907 if$ }
908 while$
909 multiresult
910 }
911 FUNCTION {format.pages}
912 { pages duplicate$ empty$ 'skip$
913 { duplicate$ multi.page.check
914 { n.dashify bbl.pages swap$}
915 { bbl.page swap$ }
916 if$
917 tie.or.space.prefix "pages" bibinfo.check * * }
918 if$
919 }
920 FUNCTION {format.journal.pages}
921 { pages empty$ {""}
922 { pages n.dashify bbl.pages
923 swap$ tie.or.space.prefix "pages" bibinfo.check * *}
924 if$
925 }
926
927 FUNCTION {get.url.type}
928 {s #1 #5 substring$ "http:" = {http.url}
929 {s #1 #6 substring$ "https:" = {http.url}
930 {s #1 #5 substring$ "file:" = {file.url}
931 {s #1 #4 substring$ "ftp:" = {ftp.url}
932 {s #1 #4 substring$ "doi:" = {doi.url}
933 {s #1 #7 substring$ "mailto:" = {mailto.url} {unknown.url} if$}
934 if$}
935 if$}
936 if$}
937 if$}
938 if$
939 'url.type :=
940 }
941
942 FUNCTION {expand.doi}
943 {s
944 url.type doi.url =
945 {#5 global.max$ substring$ bbl.doi.url swap$ *}
946 'skip$ if$
947 }
948
949 INTEGERS {url.pos url.length}
950 FUNCTION {filter.url.tex}
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$ "\underline{\ }" } 'skip$ if$
956 duplicate$ "%" = {pop$ "\%" } 'skip$ if$
957 duplicate$ "&" = {pop$ "\&" } 'skip$ if$
958 duplicate$ "~" = {pop$ "\~{}" } 'skip$ if$
959 duplicate$ "/" = {pop$ "\-/" } 'skip$ if$
960 duplicate$ "." = {pop$ "\-." } 'skip$ if$
961 duplicate$ "\" = {pop$ "{\textbackslash}" } 'skip$ if$
962 duplicate$ "#" = {pop$ "\#" } 'skip$ if$
963 duplicate$ "_" = {pop$ "\_" } 'skip$ if$
964 t swap$ * 't :=
965 url.pos #1 + 'url.pos :=
966 }
967 while$
968 t
969 }
970 FUNCTION {filter.url.html}
971 {s text.length$ #1 + 'url.length :=
972 #1 'url.pos := "" 't :=
973 {url.pos url.length <}
974 {s url.pos #1 substring$
975 t swap$ * 't :=
976 url.pos #1 + 'url.pos :=
977 }
978 while$
979 t
980 }
981
982 FUNCTION {compose.url}
983 {'s :=
984 get.url.type
985 bbl.url.available
986 abnt.url.package #0 =
987 { "$<$" *
988 abnt.doi abnt.doi.expand.to.url = 'expand.doi {s} if$
989 * "$>$" *} 'skip$ if$
990 abnt.url.package #1 =
991 { "\url{" * filter.url.html * "}" *} 'skip$ if$
992 abnt.url.package #2 =
993 {url.type http.url =
994 {"\htmladdnormallink{$<$" * filter.url.tex * "$>$}{" * filter.url.html * "}" *}
995 'skip$ if$
996 url.type doi.url = url.type ftp.url = or url.type mailto.url = or
997 {"\htmladdnormallink{$<$" *
998 abnt.doi abnt.doi.expand.to.url = 'expand.doi {s} if$
999 * "$>$}{" *
1000 abnt.doi abnt.doi.leave.as.is = {s} 'expand.doi if$
1001 * "}" * }
1002 'skip$ if$
1003 url.type unknown.url =
1004 {"$<$" * filter.url.tex * "$>$" *}
1005 'skip$ if$} 'skip$ if$
1006 }
1007 FUNCTION {format.url}
1008 { url empty$ 'skip$
1009 {url compose.url output new.sentence }
1010 if$
1011 urldate empty$ 'skip$
1012 { ". " * bbl.url.accessdate *
1013 urldate #9 #2 substring$ * " " *
1014 urldate #6 #2 substring$ "01" =
1015 {"jan."}
1016 {urldate #6 #2 substring$ "02" =
1017 {"fev."}
1018 {urldate #6 #2 substring$ "03" =
1019 {"mar."}
1020 {urldate #6 #2 substring$ "04" =
1021 {"abr."}
1022 {urldate #6 #2 substring$ "05" =
1023 {"maio"}
1024 {urldate #6 #2 substring$ "06" =
1025 {"jun."}
1026 {urldate #6 #2 substring$ "07" =
1027 {"jul."}
1028 {urldate #6 #2 substring$ "08" =
1029 {"ago."}
1030 {urldate #6 #2 substring$ "09" =
1031 {"set."}
1032 {urldate #6 #2 substring$ "10" =
1033 {"out."}
1034 {urldate #6 #2 substring$ "11" =
1035 {"nov."}
1036 {urldate #6 #2 substring$ "12" =
1037 {"dez."}
1038 {urldate #6 #2 substring$}
1039 if$ }
1040 if$ }
1041 if$ }
1042 if$ }
1043 if$ }
1044 if$ }
1045 if$ }
1046 if$ }
1047 if$ }
1048 if$ }
1049 if$ }
1050 if$
1051 * " " *
1052 urldate #1 #4 substring$ *}
1053 if$
1054 "urldate" bibinfo.check output new.sentence
1055 }
1056
1057 FUNCTION {format.conference.info}
1058 { conference-number empty$
1059 'skip$
1060 {conference-number "." * output}
1061 if$
1062 conference-year empty$
1063 'skip$
1064 {conference-year output}
1065 if$
1066 conference-location empty$
1067 'skip$
1068 {conference-location output}
1069 if$
1070 new.sentence
1071 }
1072
1073
1074 FUNCTION {format.chapter.pages}
1075 { chapter empty$
1076 'format.pages
1077 { type empty$
1078 { bbl.chapter }
1079 { type "l" change.case$
1080 "type" bibinfo.check }
1081 if$
1082 chapter tie.or.space.prefix "chapter" bibinfo.check * *
1083 pages empty$
1084 'skip$
1085 { ", " * format.pages * }
1086 if$ }
1087 if$
1088 }
1089
1090 FUNCTION {format.booktitle}
1091 {author empty$ editor empty$ and organization empty$ and
1092 {booktitle format.title.as.author "booktitle" bibinfo.check duplicate$ empty$ 'skip$ {} if$
1093 booksubtitle empty$ 'skip$ {booksubtitle ": " swap$ * "t" change.case$ *
1094 apply.title.command} if$}
1095 {booktitle "booktitle" bibinfo.check "u" change.case$ duplicate$ empty$ 'skip$ {} if$
1096 booksubtitle empty$ 'skip$ {booksubtitle ": " swap$ * "t" change.case$ *
1097 apply.title.command} if$}
1098 if$
1099 }
1100
1101 FUNCTION {format.booktitle.book}
1102 {author empty$ editor empty$ and organization empty$ and
1103 {booktitle format.title.as.author "booktitle" bibinfo.check duplicate$ empty$ 'skip$ {} if$
1104 booksubtitle empty$ 'skip$ {booksubtitle ": " swap$ * "t" change.case$ *
1105 apply.title.command} if$}
1106 {booktitle "booktitle" bibinfo.check emphasize duplicate$ empty$ 'skip$ {} if$
1107 booksubtitle empty$ 'skip$ {booksubtitle ": " swap$ * "t" change.case$ *
1108 apply.title.command} if$}
1109 if$
1110 }
1111
1112 FUNCTION {format.editors}
1113 { editor empty$
1114 {"inbook" type$ = 'bbl.same.field 'skip$ if$}
1115 {author empty$
1116 {editor "editor" format.names " (" *
1117 editortype empty$ {bbl.editor} {editortype} if$
1118 ")" * * }
1119 {"inbook" type$ =
1120 {bbl.same.field }
1121 {editor "editor" format.names " (" *
1122 editortype empty$ {bbl.editor} {editortype} if$
1123 ")" * *}
1124 if$}
1125 if$}
1126 if$
1127 }
1128 FUNCTION {format.in.ed.booktitle}
1129 { editor empty$
1130 {organization empty$ not author empty$ not and %if one of two not empty
1131 {word.in organization "u" change.case$ * output
1132 format.conference.info
1133 booktitle empty$ {""} {new.sentence format.booktitle} if$}
1134 {word.in
1135 organization empty$ author empty$ and 'skip$
1136 {"inbook" type$ = {bbl.same.field * output new.sentence ""}
1137 'skip$ if$ } if$
1138 booktitle empty$ 'skip$ {format.booktitle *} if$}
1139 if$}
1140 {word.in format.editors * output
1141 booktitle empty$ {""} {new.sentence format.booktitle} if$}
1142 if$
1143 output
1144 new.sentence
1145 }
1146
1147 FUNCTION {format.in.ed.booktitle.book}
1148 { editor empty$
1149 {organization empty$ not author empty$ not and %if one of two not empty
1150 {word.in organization "u" change.case$ * output
1151 format.conference.info
1152 booktitle empty$ {""} {new.sentence format.booktitle.book} if$}
1153 {word.in
1154 organization empty$ author empty$ and 'skip$
1155 {"inbook" type$ = {bbl.same.field * output new.sentence ""}
1156 'skip$ if$ } if$
1157 booktitle empty$ 'skip$ {format.booktitle.book *} if$}
1158 if$}
1159 {word.in format.editors * output
1160 booktitle empty$ {""} {new.sentence format.booktitle.book} if$}
1161 if$
1162 output
1163 new.sentence
1164 }
1165
1166 FUNCTION {empty.misc.check}
1167 { author empty$ title empty$ howpublished empty$
1168 month empty$ year empty$ note empty$
1169 and and and and and
1170 key empty$ not and
1171 { "todos os campos relevantes estão vazios ou faltando em " cite$ * warning$ }
1172 'skip$
1173 if$
1174 }
1175 FUNCTION {format.type}
1176 { type "type" bibinfo.check
1177 duplicate$ empty$ 'skip$
1178 {new.block "" swap$ * }
1179 if$
1180 }
1181
1182
1183 FUNCTION {format.year}
1184 {year empty$
1185 { "campo year vazio ou faltando em " cite$ *
1186 abnt.missing.year {" (vou colocar [s.d.])" *} 'skip$ if$ warning$
1187 abnt.missing.year {", " } {""} if$ bbl.missing.year *}
1188 {year n.dashify "year" bibinfo.check}
1189 if$
1190 }
1191
1192 FUNCTION {format.year.presented}
1193 {year-presented empty$
1194 {""}
1195 {year-presented n.dashify}
1196 if$
1197 }
1198
1199 FUNCTION {format.field.address}
1200 { 't :=
1201 address empty$ organization empty$ and url empty$ and t empty$ and
1202 {bbl.no.address.no.publisher}
1203 {address empty$
1204 %if an url is present we don't give a missing address "[s.l.]" notice
1205 {url empty$ {bbl.no.address ": "} {"" ""} if$}
1206 {address ": "}
1207 if$
1208 t empty$
1209 {%if an organization is present then it is OK not to have a publisher
1210 organization empty$ {* bbl.no.publisher * } 'pop$ if$}
1211 {* t * }
1212 if$}
1213 if$
1214 }
1215
1216 FUNCTION {format.address}
1217 {address empty$
1218 { bbl.no.address}
1219 { address}
1220 if$
1221 }
1222
1223 FUNCTION {format.publisher.address}
1224 { publisher "publisher" bibinfo.check format.field.address}
1225
1226 FUNCTION {format.publisher.address.relax}
1227 {publisher empty$ address empty$ and {""}
1228 {publisher "publisher" bibinfo.check format.field.address}
1229 if$}
1230
1231 FUNCTION {format.organization.address}
1232 { organization "organization" bibinfo.check format.field.address}
1233
1234 %retains current authorship for future use
1235 FUNCTION {compare.authorship}
1236 {abnt.repeated.author.omit
1237 {duplicate$ "" = 'skip$
1238 {duplicate$ previous.author =
1239 {duplicate$ 'previous.author :=
1240 pop$ bbl.same.field
1241 #1 'repeated.author :=}
1242 {duplicate$ 'previous.author :=
1243 #0 'repeated.author :=}
1244 if$}
1245 if$}
1246 'skip$
1247 if$
1248 }
1249
1250 FUNCTION {format.author.or.organization}
1251 { author empty$
1252 { organization empty$ 'skip$
1253 { organization "u" change.case$ "organization" bibinfo.check output}
1254 if$}
1255 { format.authors output.nonnull }
1256 if$
1257 compare.authorship
1258 }
1259
1260
1261 FUNCTION {format.editor.or.organization}
1262 { editor empty$
1263 { organization empty$ 'skip$
1264 { organization "u" change.case$ "organization" bibinfo.check output}
1265 if$}
1266 { format.editors output.nonnull }
1267 if$
1268 compare.authorship
1269 }
1270
1271 FUNCTION {format.author.or.editor.or.organization}
1272 { author empty$
1273 { editor empty$
1274 { organization empty$
1275 'skip$
1276 { organization "u" change.case$ "organization" bibinfo.check output}
1277 if$}
1278 { format.editors output.nonnull }
1279 if$}
1280 { format.authors output.nonnull }
1281 if$
1282 compare.authorship
1283 }
1284
1285 FUNCTION {format.reprint}
1286 { reprinted-text missing$
1287 {""}
1288 {reprinted-text empty$
1289 {bbl.reprint} {reprinted-text} if$
1290 bbl.colon *}
1291 if$
1292 }
1293
1294 FUNCTION {format.journal}
1295 {
1296 format.reprint
1297 journal emphasize *
1298 }
1299
1300
1301 %generates the first label in \abntrefinfo to be used with \citeonline
1302 FUNCTION {format.names.for.label1} %abnt-alf only
1303 { 's := "" 't :=
1304 #1 'nameptr := s num.names$ 'numnames :=
1305 numnames 'namesleft :=
1306 { namesleft #0 > }
1307 {abnt.last.names
1308 {s nameptr "{ll}{ jj}" format.name$}
1309 {s nameptr "{ll}" format.name$ #1 "{ll}" format.name$
1310 s nameptr "{ jj}" format.name$ *}
1311 if$
1312 't :=
1313 nameptr #1 >
1314 {namesleft #1 >
1315 { numnames abnt.etal.cite > abnt.etal.cite #0 = not and
1316 {#0 'namesleft := abnt.etal.cite {bbl.etal *} 'skip$ if$}
1317 {", " * t * } if$ }
1318 { t "others" =
1319 {abnt.etal.cite {bbl.etal *} 'skip$ if$}
1320 {numnames nameptr =
1321 {bbl.and * t *}
1322 'skip$ if$}
1323 if$
1324 }
1325 if$ }
1326 't
1327 if$
1328 nameptr #1 + 'nameptr :=
1329 namesleft #1 - 'namesleft := }
1330 while$
1331 }
1332
1333 %generates the second label in \abntrefinfo to be used with \cite
1334 FUNCTION {format.names.for.label2} %abnt-alf only
1335 { 's := "" 't :=
1336 #1 'nameptr := s num.names$ 'numnames :=
1337 numnames 'namesleft :=
1338 { namesleft #0 > }
1339 {abnt.last.names
1340 {s nameptr "{ll}{ jj}" format.name$}
1341 {s nameptr "{ll}" format.name$ #1 "{ll}" format.name$
1342 s nameptr "{ jj}" format.name$ *}
1343 if$
1344 abnt.cite.style #0 = {"u" change.case$} 'skip$ if$ 't :=
1345 nameptr #1 >
1346 {namesleft #1 >
1347 { numnames abnt.etal.cite >
1348 {#0 'namesleft := abnt.etal.cite {bbl.etal *} 'skip$ if$}
1349 {"; " * t * } if$ }
1350 { t "OTHERS" = t "others" = or
1351 {abnt.etal.cite {bbl.etal *} 'skip$ if$}
1352 {numnames nameptr = { bbl.semicolon * t *} 'skip$ if$}
1353 if$
1354 }
1355 if$ }
1356 't
1357 if$
1358 nameptr #1 + 'nameptr :=
1359 namesleft #1 - 'namesleft := }
1360 while$
1361 }
1362
1363 FUNCTION {format.title.for.label}
1364 { 's :=
1365 #1 'title.pos := #1 'first.word :=
1366 "" 't :=
1367 {first.word}
1368 {s title.pos #1 substring$ 'title.char :=
1369 title.char "." = title.char ":" = or title.char ";" = or
1370 title.char "," = or title.char " " = or s t = or
1371 {#0 'first.word :=
1372 title.pos #1 + 'title.pos :=}
1373 {title.pos #1 + 'title.pos := t title.char * 't :=}
1374 if$
1375 }
1376 while$
1377 s t = %title equals first word, dont use bbl.ldots
1378 {t "}{" * t
1379 abnt.cite.style #0 = {"u" change.case$ * } 'skip$ if$}
1380 {t bbl.ldots * "}{" * t
1381 abnt.cite.style #0 = {"u" change.case$} 'skip$ if$ * bbl.ldots *}
1382 if$
1383 }
1384
1385 %cvs keys have the general form $key: value $
1386 INTEGERS {key.pos value.pos}
1387 FUNCTION {extract.cvs.key} %we borrow the functionality of format.title.for.label
1388 { 's := %holds the entire cvs string
1389 #1 'key.pos :=
1390 #0 'value.pos := %0= between first $ and :, 1=between : and second $, 2= at the end
1391 "" 't := %holds the resulting value
1392 {value.pos #0 = value.pos #1 = or}
1393 { s key.pos #1 substring$ 'title.char :=
1394 value.pos #0 =
1395 { title.char ":" = {#1 'value.pos := key.pos #1 + 'key.pos :=} 'skip$ if$}
1396 { title.char "$" =
1397 {#2 'value.pos :=}
1398 {t title.char * 't :=}
1399 if$}
1400 if$
1401 key.pos #1 + 'key.pos :=
1402 }
1403 while$
1404 t
1405 }
1406
1407 %generates and extended label of type {Author}{AUTHOR}{YEAR}
1408 %for abnt.cite.style=1 they will be of type {Author}{Author}{YEAR}
1409 %final result is placed into variable label
1410 FUNCTION {calc.extended.label}
1411 { "{"
1412 author empty$ not
1413 {author format.names.for.label1 * "}{" * author format.names.for.label2 *}
1414 {editor empty$ not
1415 {editor format.names.for.label1 * "}{" * editor format.names.for.label2 *}
1416 {org-short empty$ not
1417 {org-short * "}{" * org-short "u" change.case$ *}
1418 {organization empty$ not
1419 {organization * "}{" * organization "u" change.case$ *}
1420 {title empty$ not
1421 {title format.title.for.label *}
1422 {"nada}{NADA" *}
1423 if$}
1424 if$}
1425 if$}
1426 if$}
1427 if$
1428 "}{" *
1429 year empty$ 'skip$ {year *} if$
1430 'label := %place the stack into label
1431 % final } will be placed in reverse.pass
1432 }
1433 %generates and simple label of type "Author YEAR"
1434 %final result is placed onto the stack
1435 FUNCTION {calc.simple.label}
1436 { author empty$ not
1437 {author format.names.for.label1}
1438 {editor empty$ not
1439 {editor format.names.for.label1}
1440 {organization empty$ not
1441 {organization}
1442 {title empty$ not
1443 {title}
1444 {""}
1445 if$}
1446 if$}
1447 if$}
1448 if$
1449 year empty$ 'skip$ {" " * year *} if$
1450 }
1451
1452 FUNCTION {output.bibitem}
1453 { newline$
1454 abnt.alf
1455 {"\bibitem[" write$
1456 calc.simple.label
1457 write$ "]{"}
1458 {"\bibitem{"}
1459 if$
1460 write$ cite$ write$ "}" write$ newline$
1461 abnt.refinfo #1 = {"\abntrefinfo" write$ label write$ newline$} 'skip$ if$
1462 "{" write$
1463 "" before.all 'output.state :=
1464 }
1465 FUNCTION {output.hiddenbibitem}
1466 { newline$
1467 abnt.alf
1468 {"\hiddenbibitem[" write$
1469 calc.simple.label
1470 write$ "]{"}
1471 {"\bibitem{"}
1472 if$
1473 write$ cite$ write$ "}" write$ newline$
1474 abnt.refinfo #1 = {"\abntrefinfo" write$ label write$ newline$} 'skip$ if$
1475 "{" write$
1476 "" before.all 'output.state :=
1477 }
1478 FUNCTION {fin.entry}
1479 { add.period$ write$
1480 reprinted-from empty$ 'skip$
1481 {" " reprinted-text empty$
1482 {bbl.reprint} {reprinted-text} if$ * bbl.colon *
1483 "\abntreprintinfo{ " * reprinted-from * "}" * write$}
1484 if$
1485 abnt-note empty$ 'skip$
1486 {"\footnote{" abnt-note * "}" * write$} if$
1487 "}" write$
1488 %newline$
1489 write.entry.verbatim
1490 }
1491
1492 FUNCTION { abnt.display.options}
1493 { 's := 't :=
1494 abnt.show.options #1 = % "warn"
1495 {"opção " t * " passou para " * s * warning$ } 'skip$ if$
1496
1497 abnt.show.options #2 = % "list"
1498 {"Op\c c\~ao selecionada {\tt " t * "=}\verb+" * s * "+" * output new.sentence } 'skip$ if$
1499 }
1500
1501 FUNCTION { abnt-options1 }
1502 {
1503 abnt-show-options empty$
1504 'skip$
1505 {abnt-show-options "no" =
1506 {#0} {abnt-show-options "warn" =
1507 {#1} {abnt-show-options "list" =
1508 {#2 } {#0 } if$} if$} if$
1509 'abnt.show.options :=} % #0 "no"; #1 "warn"; #2 "list"
1510 if$
1511
1512 abnt.show.options #2 =
1513 {output.bibitem "Mudan\c ca de estilo ap\'os este ponto com o comando \verb!\citeoption{"
1514 cite$ * "}! " *
1515 output new.sentence} 'skip$ if$
1516
1517 abnt-show-options empty$
1518 'skip$ {"abnt-show-options" abnt-show-options abnt.display.options} if$
1519
1520 abnt-cite-style empty$
1521 'skip$
1522 {abnt-cite-style "(AUTHOR, YEAR)" =
1523 {#0 'abnt.cite.style :=}
1524 {abnt-cite-style "(Author, YEAR)" =
1525 {#1 'abnt.cite.style :=}
1526 {"opção " abnt-cite-style * " desconhecida" * warning$}
1527 if$}
1528 if$
1529 "abnt-cite-style" abnt-cite-style abnt.display.options}if$
1530
1531 abnt-experimental empty$
1532 'skip$ {abnt-experimental "yes" = 'abnt.experimental :=
1533 "abnt-experimental" abnt-experimental abnt.display.options} if$
1534
1535 abnt-emphasize duplicate$ empty$
1536 'pop$ {'abnt.emphasize :=
1537 "abnt-emphasize" abnt.emphasize abnt.display.options
1538 abnt-emphasize "\bf" = abnt-emphasize "\it" = or abnt-emphasize "\em" = or
1539 abnt-emphasize "\bfseries" = or
1540 {"não use " abnt-emphasize * " para abnt-emphasize em " * cite$ *
1541 ", isto alterará TODO o texto. Use \textbf ou \emph. Veja a documentação abnt-bibtex-doc para mais detalhes." * warning$}
1542 'skip$ if$
1543 } if$
1544
1545 abnt-doi empty$
1546 'skip$
1547 {abnt-doi "expand" =
1548 {abnt.doi.expand.to.url 'abnt.doi :=}
1549 {abnt-doi "link" =
1550 {abnt.doi.link 'abnt.doi :=}
1551 {abnt-doi "doi" =
1552 {abnt.doi.leave.as.is 'abnt.doi :=}
1553 {"opção " abnt-doi * " desconhecida" * warning$}
1554 if$}
1555 if$}
1556 if$
1557 "abnt-doi" abnt-doi abnt.display.options}if$
1558 }
1559 FUNCTION { abnt-options2 }
1560 {
1561 abnt-full-initials empty$
1562 'skip$ {abnt-full-initials "yes" = 'abnt.full.initials :=
1563 "abnt-full-initials" abnt-full-initials abnt.display.options} if$
1564
1565 abnt-last-names empty$
1566 'skip$
1567 {abnt-last-names "abnt" = {#0}
1568 {abnt-last-names "bibtex" = {#1} {#0} if$} if$
1569 'abnt.last.names :=
1570 "abnt-last-names" abnt-last-names abnt.display.options}
1571 if$
1572
1573
1574 abnt-ldots-type empty$
1575 'skip$
1576 {abnt-ldots-type "none" = {#0}
1577 {abnt-ldots-type "normal" = {#1}
1578 {abnt-ldots-type "math" = {#2}
1579 {abnt-ldots-type "text" = {#1} {#0}
1580 if$} if$} if$} if$
1581 'abnt.ldots.type :=
1582 "abnt-ldots-type" abnt-ldots-type abnt.display.options}
1583 if$
1584
1585 abnt-missing-year empty$
1586 'skip$
1587 {abnt-missing-year "void" = {#0}
1588 {abnt-missing-year "sd" = {#1} {#0} if$}
1589 if$
1590 'abnt.missing.year :=
1591 "abnt-missing-year" abnt-missing-year abnt.display.options}
1592 if$
1593
1594
1595 abnt-and-type empty$
1596 'skip$ {abnt-and-type "e" =
1597 {#0} {abnt-and-type "&" =
1598 {#1} {#0} if$} if$
1599 'abnt.and.type :=
1600 "abnt-and-type" abnt-and-type abnt.display.options}
1601 if$
1602
1603 abnt-thesis-year empty$
1604 'skip$ {abnt-thesis-year "final" =
1605 {#0} {abnt-thesis-year "title" =
1606 {#1} {abnt-thesis-year "both" =
1607 {#2} {#0} if$} if$} if$
1608 'abnt.thesis.year :=
1609 "abnt-thesis-year" abnt-thesis-year abnt.display.options}
1610 if$
1611
1612 abnt-refinfo empty$
1613 'skip$ {abnt-refinfo "yes" = 'abnt.refinfo :=
1614 "abnt-refinfo" abnt-refinfo abnt.display.options} if$
1615 }
1616 FUNCTION { abnt-options3 }
1617 {
1618
1619 abnt-dont-use-etal empty$
1620 'skip$ {abnt-dont-use-etal "yes" = {#0 'abnt.etal.list :=} 'skip$ if$
1621 "Uso da opção abnt-dont-use-etal se tornou obsoleto, usamos abnt-etal-list." warning$
1622 "abnt-etal-list" abnt.etal.list int.to.str$ abnt.display.options} if$
1623
1624 abnt-etal-cite empty$
1625 'skip$ {abnt-etal-cite str.to.int 'abnt.etal.cite :=
1626 "abnt-etal-cite" abnt.etal.cite int.to.str$ abnt.display.options} if$
1627
1628 abnt-etal-list empty$
1629 'skip$ {abnt-etal-list str.to.int 'abnt.etal.list :=
1630 "abnt-etal-list" abnt.etal.list int.to.str$ abnt.display.options} if$
1631
1632 abnt-etal-text missing$
1633 'skip$ {abnt-etal-text 'abnt.etal.text :=
1634 "abnt-etal-text" abnt.etal.text abnt.display.options} if$
1635
1636 abnt-no-etal-label empty$
1637 'skip$ {abnt-no-etal-label "yes" = {#0 'abnt.etal.cite :=} 'skip$ if$
1638 "Uso da opção abnt-no-etal-label se tornou obsoleto, usamos abnt-etal-cite." warning$
1639 "abnt-etal-cite" abnt.etal.cite int.to.str$ abnt.display.options} if$
1640
1641 abnt-repeated-author-omit empty$
1642 'skip$ {abnt-repeated-author-omit "yes" =
1643 {#1 'abnt.repeated.author.omit :=}
1644 {#0 'abnt.repeated.author.omit := "" 'previous.author :=} if$
1645 "abnt-repeated-author-omit" abnt-repeated-author-omit abnt.display.options} if$
1646
1647 abnt-repeated-title-omit empty$ 'skip$
1648 {abnt-repeated-title-omit "yes" =
1649 {#1 'abnt.repeated.title.omit :=}
1650 {#0 'abnt.repeated.title.omit := "" 'previous.title :=} if$
1651 "abnt-repeated-title-omit" abnt-repeated-title-omit abnt.display.options
1652 abnt.repeated.author.omit not abnt.repeated.title.omit and
1653 {"Use abnt-repeated-title-omit=yes junto com abnt-repeated-author-omit=yes"
1654 warning$} 'skip$ if$} if$
1655
1656 abnt-title-command empty$
1657 'skip$ {abnt-title-command "yes" =
1658 {#1 'abnt.title.command :=}
1659 {#0 'abnt.title.command :=} if$
1660 "abnt-title-command" abnt-title-command abnt.display.options} if$
1661
1662 abnt-url-package empty$ 'skip$
1663 {abnt-url-package "url" =
1664 {#1 'abnt.url.package :=}
1665 {abnt-url-package "hyperref" = {#2 'abnt.url.package :=} 'skip$ if$}
1666 if$
1667 "abnt-url-package" abnt-url-package abnt.display.options}
1668 if$
1669
1670 abnt-verbatim-entry empty$
1671 'skip$ {abnt-verbatim-entry "yes" = 'abnt.verbatim.entry :=
1672 "abnt-verbatim-entry" abnt-verbatim-entry abnt.display.options} if$
1673
1674 abnt.show.options #2 = 'fin.entry 'skip$ if$
1675 }
1676
1677 %we had to break this function in two parts because of the following message:
1678 %Sorry---you've exceeded BibTeX's single function space 100
1679 %(That was a fatal error)
1680 FUNCTION { iso-options1 }
1681 {
1682 iso-abbreviation empty$
1683 'skip$ {iso-abbreviation "standard" = 'iso.abbreviation :=
1684 "iso-abbreviation" iso-abbreviation abnt.display.options} if$
1685 iso-author-punctuation empty$
1686 'skip$ {iso-author-punctuation "void" = 'iso.author.punctuation :=
1687 "iso-author-punctuation" iso-author-punctuation abnt.display.options} if$
1688 iso-date-place empty$
1689 'skip$ {iso-date-place "ISO" = 'iso.date.place :=
1690 "iso-date-place" iso-date-place abnt.display.options} if$
1691 }
1692
1693 FUNCTION { abnt-options }
1694 {
1695 abnt-options1
1696 abnt-options2
1697 abnt-options3
1698 iso-options1
1699 }
1700
1701 FUNCTION { iso-options } { abnt-options }
1702
1703 FUNCTION { iso.year.label }
1704 { iso.date.place
1705 { abnt.alf
1706 {year.label output new.sentence}
1707 'skip$ if$}
1708 'skip$ if$}
1709
1710 FUNCTION { iso.date }
1711 { iso.date.place
1712 { abnt.alf
1713 'skip$
1714 {year output new.sentence}
1715 if$}
1716 'skip$ if$}
1717
1718 FUNCTION { non.iso.date }
1719 {iso.date.place 'skip$ {format.date output} if$}
1720
1721 FUNCTION {article}
1722 { output.bibitem
1723 format.author.or.organization new.sentence
1724 iso.year.label
1725 format.title "title" output.check new.block
1726 format.journal output
1727 iso.date.place {format.year output} 'skip$ if$
1728 %iso.date.place {format.date output} 'skip$ if$
1729 %iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1730 % {format.year output new.sentence} if$
1731 section "section" bibinfo.check output.dash
1732 publisher "publisher" bibinfo.check output
1733 address "address" bibinfo.check output
1734 format.volume output
1735 format.number output
1736 format.pages output
1737 non.iso.date
1738 format.note output new.block
1739 format.url
1740 fin.entry
1741 }
1742 FUNCTION {book}
1743 { output.bibitem
1744 format.author.or.editor.or.organization new.sentence
1745 iso.year.label
1746 format.type output new.sentence
1747 format.btitle "title" output.check new.sentence
1748 format.furtherresp new.sentence
1749 format.edition output new.sentence
1750 format.publisher.address output
1751 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1752 {format.year output new.sentence} if$
1753 format.volume output new.sentence
1754 format.book.pages output
1755 format.illustrated
1756 format.dimensions new.sentence
1757 format.howpublished output new.sentence
1758 format.volume.number.series output new.sentence
1759 format.note output
1760 format.issn output %pode parecer curioso, mas revistas inteiras são tratadas como livro
1761 format.isbn output new.sentence
1762 format.url
1763 fin.entry
1764 }
1765 FUNCTION {booklet}
1766 { output.bibitem
1767 format.author.or.editor.or.organization new.sentence
1768 iso.year.label
1769 format.type output new.sentence
1770 format.btitle "title" output.check new.sentence
1771 format.edition output new.sentence
1772 address "address" bibinfo.check output
1773 format.bvolume output
1774 %format.date output new.sentence
1775 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1776 {format.year output new.sentence} if$
1777 format.book.pages output new.sentence
1778 format.volume.number.series output new.sentence
1779 format.note output
1780 format.isbn output new.sentence
1781 format.url
1782 fin.entry
1783 }
1784
1785 FUNCTION {hidden}
1786 { output.hiddenbibitem
1787 fin.entry}
1788
1789 FUNCTION {inbook}
1790 { output.bibitem
1791 format.author.or.organization new.sentence
1792 iso.year.label
1793 format.title "title" output.check new.block
1794 format.in.ed.booktitle.book
1795 format.furtherresp new.sentence
1796 format.edition output new.sentence
1797 format.publisher.address output
1798 %format.year output new.sentence
1799 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1800 {format.year output new.sentence} if$
1801 format.bvolume.if.no.series output
1802 format.volume.number.series output
1803 format.chapter.pages output new.sentence
1804 format.isbn output new.block
1805 format.note output new.block
1806 format.url
1807 fin.entry
1808 }
1809
1810 FUNCTION {incollection}
1811 { output.bibitem
1812 format.author.or.organization new.sentence
1813 iso.year.label
1814 format.title "title" output.check new.sentence
1815 format.in.ed.booktitle.book
1816 format.edition output new.sentence
1817 format.publisher.address output
1818 %format.year output
1819 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1820 {format.year output} if$
1821 format.volume.number.series output new.sentence
1822 format.bvolume.if.no.series output
1823 format.chapter.pages output new.sentence
1824 format.isbn output new.block
1825 format.note output new.block
1826 format.url
1827 fin.entry
1828 }
1829 FUNCTION {inproceedings}
1830 { output.bibitem
1831 format.author.or.organization new.sentence
1832 iso.year.label
1833 format.title "title" output.check new.sentence
1834 format.in.ed.booktitle
1835 format.volume.no.bbl output
1836 format.year output
1837 address output new.sentence
1838 anais.check.url output
1839 format.publisher.address output
1840 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1841 {format.year output new.sentence} if$
1842 format.pages output
1843 format.isbn output
1844 format.issn output new.sentence
1845 format.note output new.sentence
1846 format.url
1847 fin.entry
1848 }
1849 FUNCTION {journalpart}
1850 { output.bibitem
1851 format.author.or.editor.or.organization new.sentence
1852 iso.year.label
1853 format.type output new.sentence
1854 format.btitle "title" output.check new.sentence
1855 format.furtherresp new.sentence
1856 format.edition output new.sentence
1857 format.publisher.address output
1858 format.volume output
1859 format.number output
1860 %format.date output new.sentence
1861 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1862 {format.date output new.sentence} if$
1863 format.book.pages output
1864 format.illustrated
1865 format.dimensions new.sentence
1866 format.note output
1867 format.issn output %pode parecer curioso, mas revistas inteiras são tratadas como livro
1868 format.isbn output new.sentence
1869 format.url
1870 fin.entry
1871 }
1872 FUNCTION {conference} { inproceedings }
1873 FUNCTION {manual}
1874 { output.bibitem
1875 format.author.or.editor.or.organization new.sentence
1876 iso.year.label
1877 format.btitle "title" output.check new.block
1878 format.furtherresp new.sentence
1879 format.edition output new.sentence
1880 format.address output
1881 %format.date output new.sentence
1882 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1883 {format.year output new.sentence} if$
1884 format.bvolume.if.no.series output
1885 format.book.pages output new.sentence
1886 format.volume.number.series output new.sentence
1887 format.note output new.sentence
1888 format.url
1889 fin.entry
1890 }
1891
1892 FUNCTION {misc}
1893 { output.bibitem
1894 format.author.or.editor.or.organization new.sentence
1895 iso.year.label
1896 format.type output
1897 format.btitle output new.sentence
1898 format.furtherresp new.sentence
1899 format.publisher.address.relax output
1900 %format.date output new.block
1901 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1902 {format.year output new.sentence} if$
1903 format.book.pages output new.sentence
1904 format.illustrated
1905 format.dimensions new.sentence
1906 format.howpublished output new.block
1907 format.volume.number.series output new.sentence
1908 format.note output new.block
1909 format.url
1910 fin.entry
1911 empty.misc.check
1912 }
1913
1914 FUNCTION {patent}
1915 { output.bibitem
1916 format.editor.or.organization new.sentence
1917 iso.year.label
1918 format.authors.plain output new.sentence
1919 format.btitle output new.sentence
1920 format.furtherresp new.sentence
1921 %format.date output new.block
1922 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
1923 {format.year output new.sentence} if$
1924 format.patent.number output
1925 format.howpublished output new.block
1926 format.note output new.block
1927 format.url
1928 fin.entry
1929 empty.misc.check
1930 }
1931
1932 FUNCTION {format.thesis.type}
1933 { type$ "phdthesis" =
1934 {bbl.phdthesis}
1935 {type$ "mastersthesis" =
1936 {bbl.mthesis}
1937 {type$ "monography" =
1938 {bbl.monography}
1939 {bbl.void}
1940 if$}
1941 if$}
1942 if$
1943 type empty$
1944 {type missing$
1945 {type$ "phdthesis" =
1946 { " (" bbl.phd * ")" *}
1947 {type$ "mastersthesis" = { " (" bbl.master * ")" *} {pop$ ""} if$}
1948 if$}
1949 {""}
1950 if$}
1951 {type$ "thesis" =
1952 {type}
1953 {" (" type * ")" * "type" bibinfo.check}
1954 if$}
1955 if$
1956 * %joins first and second part of this function
1957 }
1958 FUNCTION {thesis}
1959 { output.bibitem
1960 format.authors "author" output.check new.block
1961 iso.year.label
1962 format.btitle "title" output.check new.block
1963 abnt.thesis.year #1 = abnt.thesis.year #2 = or
1964 {format.date "year" output.check new.sentence} 'skip$ if$
1965 format.year.presented output new.sentence
1966 format.book.pages output new.sentence
1967 format.thesis.type output.nonnull
1968 school "school" bibinfo.warn output.dash
1969 address "address" bibinfo.check output
1970 abnt.thesis.year #0 = abnt.thesis.year #2 = or
1971 {format.date "year" output.check new.sentence} 'skip$ if$
1972 format.note output new.block
1973 format.url
1974 fin.entry
1975 }
1976
1977 FUNCTION {phdthesis} { thesis }
1978 FUNCTION {mastersthesis} { thesis }
1979 FUNCTION {monography} { thesis }
1980
1981 FUNCTION {proceedings}
1982 { output.bibitem
1983 iso.year.label
1984 format.editor.or.organization
1985 format.conference.info
1986 format.btitle "title" output.check
1987 format.bvolume output
1988 format.volume.number.series output
1989 editor empty$
1990 { publisher empty$
1991 'skip$
1992 { new.sentence format.publisher.address output format.year output}
1993 if$
1994 }
1995 { publisher empty$
1996 { new.sentence
1997 format.organization.address output format.year output}
1998 { new.sentence
1999 organization "organization" bibinfo.check output
2000 format.publisher.address output format.year output}
2001 if$ }
2002 if$
2003 new.sentence format.book.pages output new.sentence
2004 format.isbn output
2005 format.issn output new.block
2006 format.note output new.block
2007 format.url
2008 fin.entry
2009 }
2010
2011 FUNCTION {techreport} {manual}
2012
2013 FUNCTION {unpublished}
2014 { output.bibitem
2015 format.author.or.editor.or.organization new.sentence
2016 iso.year.label
2017 format.title "title" output.check new.sentence
2018 format.note "note" output.check new.sentence
2019 %format.date output new.sentence
2020 iso.date.place {abnt.alf 'skip$ {format.year output new.sentence} if$}
2021 {format.year output new.sentence} if$
2022 format.url
2023 fin.entry
2024 }
2025
2026 FUNCTION {default.type} { misc }
2027 READ
2028 FUNCTION {sortify}
2029 { purify$
2030 "l" change.case$
2031 }
2032 INTEGERS { len }
2033 FUNCTION {chop.word}
2034 { 's :=
2035 'len :=
2036 s #1 len substring$ =
2037 { s len #1 + global.max$ substring$ }
2038 's
2039 if$
2040 }
2041 FUNCTION {sort.format.names}
2042 { 's :=
2043 #1 'nameptr :=
2044 ""
2045 s num.names$ 'numnames :=
2046 numnames 'namesleft :=
2047 { namesleft #0 > }
2048 { format.single.name 't :=
2049 nameptr #1 >
2050 {
2051 nameptr #3
2052 #1 + =
2053 numnames #3
2054 > and
2055 { "others" 't :=
2056 #1 'namesleft := }
2057 'skip$
2058 if$
2059 " " *
2060 namesleft #1 = t "others" = and
2061 { "zzzzz" * }
2062 { t sortify * }
2063 if$
2064 }
2065 { t sortify * }
2066 if$
2067 nameptr #1 + 'nameptr :=
2068 namesleft #1 - 'namesleft :=
2069 }
2070 while$
2071 }
2072
2073 FUNCTION {sort.format.title}
2074 { 't :=
2075 "A " #2
2076 "An " #3
2077 "The " #4 t chop.word
2078 chop.word
2079 chop.word
2080 sortify
2081 #1 global.max$ substring$
2082 }
2083 FUNCTION {any.sort}
2084 { author empty$
2085 { organization empty$
2086 { editor empty$
2087 { title empty$
2088 { key empty$
2089 { "para ordenar, precisa dos campos author, organization, editor, title ou key in " cite$ * warning$ ""}
2090 { key sortify }
2091 if$}
2092 { title sortify}
2093 if$}
2094 { editor sort.format.names }
2095 if$}
2096 { organization sortify }
2097 if$}
2098 { author sort.format.names }
2099 if$
2100 }
2101
2102 FUNCTION {presort}
2103 {
2104 any.sort
2105 " " * year field.or.null sortify * " " * title field.or.null
2106 sort.format.title * #1 entry.max$ substring$
2107 %for non-alpha style we drop a void sort.key such that SORT has no effect
2108 abnt.alf 'skip$ {pop$ ""} if$ 'sort.key$ :=
2109 year empty$ {""} {year} if$ 'year.label :=
2110 calc.extended.label
2111 }
2112
2113 FUNCTION {set.default.abnt.variables}
2114 { %if you change abnt-num to abnt-alf by hand you need also to change
2115 %the name of RCSfile by hand, otherwise cvs takes care of it.
2116 %
2117 "$RCSfile: abnt-alf.bst,v $ " extract.cvs.key
2118 %
2119 "abnt-alf.bst,v " = 'abnt.alf := % #1 para abnt-alf #0 para abnt-num
2120 "$Revision: v-1.1 $" extract.cvs.key 'abnt.bst.revision :=
2121 #0 'abnt.and.type := % #0 "e"; #1 "&"
2122 "\emph" 'abnt.emphasize :=
2123 #0 'abnt.cite.style := %default norm version for NBR10520
2124 %#0 \cite=(AUTHOR, YEAR)
2125 %#1 \cite=(Author, YEAR)
2126 #0 'abnt.experimental :=
2127 abnt.doi.expand.to.url 'abnt.doi :=
2128 #3 'abnt.etal.cite :=
2129 #3 'abnt.etal.list :=
2130 "et al." 'abnt.etal.text :=
2131 #0 'abnt.full.initials :=
2132 #0 'abnt.last.names := %#0 abnt-style, #1 bibtex-style
2133 #1 'abnt.ldots.type := %#0 use nothing, #1 use \ldots, #2 use $\ldots$, 3# use {...}
2134 #0 'abnt.missing.year := %#0 "void"; #1 "[s.d.]"
2135 #0 'repeated.author :=
2136 #0 'abnt.repeated.author.omit :=
2137 #0 'abnt.repeated.title.omit :=
2138 #1 'abnt.refinfo :=
2139 #0 'abnt.show.options := % #0 "no"; #1 "warn"; #2 "list"
2140 #0 'abnt.thesis.year := % #0 "final"; #1 "title"; #2 "both"
2141 #0 'abnt.title.command := % #0 "no"; #1 "yes"
2142 #0 'abnt.url.package := % #0 "none"'; #2 "url"; #2 "hyperref"
2143 #0 'abnt.verbatim.entry :=
2144 }
2145 FUNCTION {set.default.iso.variables}
2146 { #0 'iso.abbreviation := % #0 ABNT-style; #1 ISO-style
2147 #0 'iso.author.punctuation := % #0 ABNT (Smith, A. B.); #1 ISO (Smith, AB)
2148 #0 'iso.date.place := % #0 ABNT-sty; #1 ISO-style
2149 }
2150 EXECUTE {set.default.abnt.variables}
2151 EXECUTE {set.default.iso.variables}
2152 FUNCTION {process.early.abnt.options}
2153 {%here we intercept all entries which need priority handling
2154 %note: we cannot use type$ at this point
2155 abnt-and-type missing$
2156 abnt-experimental missing$ and
2157 abnt-etal-cite missing$ and
2158 abnt-etal-text missing$ and
2159 abnt-ldots-type missing$ and
2160 abnt-cite-style missing$ and
2161 abnt-no-etal-label missing$ and
2162 abnt-title-command missing$ and
2163 'skip$ {call.type$} if$
2164 }
2165 ITERATE {process.early.abnt.options}
2166 FUNCTION {search.reprinted}
2167 { reprinted-from missing$ 'skip$
2168 {"\nocite{" reprinted-from * "}" * write$ newline$
2169 }
2170 if$
2171 }
2172 ITERATE {search.reprinted}
2173 FUNCTION {abntreprintinfo}
2174 {"\providecommand{\abntreprintinfo}[1]{%" write$ newline$
2175 " \citeonline{#1}}" write$ newline$}
2176 EXECUTE {abntreprintinfo}
2177 ITERATE {presort}
2178 SORT
2179 STRINGS { last.label next.extra}
2180 INTEGERS { last.extra.num }
2181 FUNCTION {forward.pass}
2182 { last.label label =
2183 { last.extra.num #1 + 'last.extra.num :=
2184 last.extra.num int.to.chr$ 'extra.label :=
2185 }
2186 { "a" chr.to.int$ 'last.extra.num :=
2187 "" 'extra.label :=
2188 label 'last.label :=
2189 }
2190 if$
2191 }
2192
2193 FUNCTION {reverse.pass}
2194 { next.extra "b" =
2195 { "a" 'extra.label := }
2196 'skip$
2197 if$
2198 label extra.label * 'label :=
2199 year.label extra.label * 'year.label :=
2200 extra.label 'next.extra :=
2201 label "}" * 'label :=
2202 }
2203 ITERATE {forward.pass}
2204 REVERSE {reverse.pass}
2205 FUNCTION {begin.bib}
2206 {
2207 abnt.alf
2208 {"\setlength{\labelsep}{0pt}" write$}
2209 'skip$
2210 if$
2211 "\begin{thebibliography}{}" write$ newline$
2212 preamble$ empty$
2213 'skip$
2214 { preamble$ write$ newline$ }
2215 if$
2216 abnt.refinfo #1 =
2217 {"\providecommand{\abntrefinfo}[3]{}" write$ newline$}
2218 'skip$ if$
2219 "\providecommand{\abntbstabout}[1]{}" write$ newline$
2220 abnt.title.command
2221 {"\providecommand{\bibtextitlecommand}[2]{#2}" write$ newline$}
2222 'skip$ if$
2223 "\abntbstabout{" abnt.bst.revision * "}" * write$ newline$
2224 %Se você não usa abntcite e precisa que a margem direita não
2225 %seja justificada, descomente a linha seguinte
2226 %alternativamente coloque \bibliography{abnt-nrj,...
2227 "\justifying" write$ newline$
2228 }
2229 EXECUTE {begin.bib}
2230 EXECUTE {init.state.consts}
2231 FUNCTION {process.entry}{call.type$}
2232 ITERATE {process.entry}
2233 FUNCTION {end.bib}
2234 { newline$ "\end{thebibliography}" write$ newline$
2235 }
2236 EXECUTE {end.bib}
2237 FUNCTION {apresentacao}
2238 { "+---------------------------------------------------------+"
2239 "| http://www.abntex.net.br/ |"
2240 "| Em caso de dúvidas ou problemas com este estilo procure |"
2241 abnt.alf
2242 {"| Estilo bibliográfico abntex2-alf.bst versão " abnt.bst.revision * " |" *}
2243 {"| Estilo bibliográfico abntex2-num.bst versão " abnt.bst.revision * " |" *}
2244 if$
2245 "+---------------------------------------------------------+"
2246 stack$
2247 }
2248 EXECUTE{apresentacao}