├── .gitignore ├── IEEEtran.cls ├── IEEEtranN-nourl.bst ├── IEEEtranN.bst ├── LICENSE ├── Makefile ├── README.md ├── custom.latex ├── figures └── example.png ├── metadata.yaml ├── papers.bib ├── sections ├── main.md └── other.md └── template.latex /.gitignore: -------------------------------------------------------------------------------- 1 | *.tex 2 | tmp/ 3 | *.acn 4 | *.acr 5 | *.alg 6 | *.aux 7 | *.bbl 8 | *.blg 9 | *.dvi 10 | *.fdb_latexmk 11 | *.glg 12 | *.glo 13 | *.gls 14 | *.idx 15 | *.ilg 16 | *.ind 17 | *.ist 18 | *.lof 19 | *.log 20 | *.lot 21 | *.maf 22 | *.mtc 23 | *.mtc0 24 | *.nav 25 | *.nlo 26 | *.nls 27 | *.out 28 | *.pdfsync 29 | *.ps 30 | *.snm 31 | *.synctex.gz 32 | *.toc 33 | *.vrb 34 | *.xdy 35 | *.tdo 36 | *.pdf 37 | *.html 38 | .DS_Store 39 | *.bak 40 | 41 | .~lock.*.*# 42 | -------------------------------------------------------------------------------- /IEEEtranN-nourl.bst: -------------------------------------------------------------------------------- 1 | %% 2 | %% IEEEtranN.bst 3 | %% BibTeX Bibliography Style file 4 | %% Natbib version of IEEEtran.bst 5 | %% *** Not for normal IEEE work *** 6 | %% Version 1.13 (2008/09/30) 7 | %% 8 | %% Copyright (c) 2003-2008 Michael Shell 9 | %% 10 | %% Original starting code base and algorithms obtained from the output of 11 | %% Patrick W. Daly's makebst package as well as from prior versions of 12 | %% IEEE BibTeX styles: 13 | %% 14 | %% 1. Howard Trickey and Oren Patashnik's ieeetr.bst (1985/1988) 15 | %% 2. Silvano Balemi and Richard H. Roy's IEEEbib.bst (1993) 16 | %% 17 | %% Added sorting and natbib code is from Patrick W Daly's unsrtnat.bst 18 | %% 19 | %% 20 | %% Support sites: 21 | %% http://www.michaelshell.org/tex/ieeetran/ 22 | %% http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/ 23 | %% and/or 24 | %% http://www.ieee.org/ 25 | %% 26 | %% For use with BibTeX version 0.99a or later 27 | %% 28 | %% This is a natbib compatible citation style. 29 | %% 30 | %%************************************************************************* 31 | %% Legal Notice: 32 | %% This code is offered as-is without any warranty either expressed or 33 | %% implied; without even the implied warranty of MERCHANTABILITY or 34 | %% FITNESS FOR A PARTICULAR PURPOSE! 35 | %% User assumes all risk. 36 | %% In no event shall IEEE or any contributor to this code be liable for 37 | %% any damages or losses, including, but not limited to, incidental, 38 | %% consequential, or any other damages, resulting from the use or misuse 39 | %% of any information contained here. 40 | %% 41 | %% All comments are the opinions of their respective authors and are not 42 | %% necessarily endorsed by the IEEE. 43 | %% 44 | %% This work is distributed under the LaTeX Project Public License (LPPL) 45 | %% ( http://www.latex-project.org/ ) version 1.3, and may be freely used, 46 | %% distributed and modified. A copy of the LPPL, version 1.3, is included 47 | %% in the base LaTeX documentation of all distributions of LaTeX released 48 | %% 2003/12/01 or later. 49 | %% Retain all contribution notices and credits. 50 | %% ** Modified files should be clearly indicated as such, including ** 51 | %% ** renaming them and changing author support contact information. ** 52 | %% 53 | %% File list of work: IEEEabrv.bib, IEEEfull.bib, IEEEexample.bib, 54 | %% IEEEtran.bst, IEEEtranS.bst, IEEEtranSA.bst, 55 | %% IEEEtranN.bst, IEEEtranSN.bst, IEEEtran_bst_HOWTO.pdf 56 | %%************************************************************************* 57 | % 58 | % 59 | % Changelog: 60 | % 61 | % 1.12 (2007/01/11) Initial release 62 | % 63 | % 1.13 (2008/09/30) 64 | % 1. Fixed bug with edition number to ordinal conversion. Thanks to 65 | % Michael Roland for reporting this and correcting the algorithm. 66 | 67 | 68 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 69 | %% DEFAULTS FOR THE CONTROLS OF THE BST STYLE %% 70 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 71 | 72 | % These are the defaults for the user adjustable controls. The values used 73 | % here can be overridden by the user via IEEEtranBSTCTL entry type. 74 | 75 | % NOTE: The recommended LaTeX command to invoke a control entry type is: 76 | % 77 | %\makeatletter 78 | %\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}} 79 | %\def\@bstctlcite[#1]#2{\@bsphack 80 | % \@for\@citeb:=#2\do{% 81 | % \edef\@citeb{\expandafter\@firstofone\@citeb}% 82 | % \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}% 83 | % \@esphack} 84 | %\makeatother 85 | % 86 | % It is called at the start of the document, before the first \cite, like: 87 | % \bstctlcite{IEEEexample:BSTcontrol} 88 | % 89 | % IEEEtran.cls V1.6 and later does provide this command. 90 | 91 | 92 | 93 | % #0 turns off the display of the number for articles. 94 | % #1 enables 95 | FUNCTION {default.is.use.number.for.article} { #1 } 96 | 97 | 98 | % #0 turns off the display of the paper and type fields in @inproceedings. 99 | % #1 enables 100 | FUNCTION {default.is.use.paper} { #1 } 101 | 102 | 103 | % #0 turns off the forced use of "et al." 104 | % #1 enables 105 | FUNCTION {default.is.forced.et.al} { #0 } 106 | 107 | % The maximum number of names that can be present beyond which an "et al." 108 | % usage is forced. Be sure that num.names.shown.with.forced.et.al (below) 109 | % is not greater than this value! 110 | % Note: There are many instances of references in IEEE journals which have 111 | % a very large number of authors as well as instances in which "et al." is 112 | % used profusely. 113 | FUNCTION {default.max.num.names.before.forced.et.al} { #10 } 114 | 115 | % The number of names that will be shown with a forced "et al.". 116 | % Must be less than or equal to max.num.names.before.forced.et.al 117 | FUNCTION {default.num.names.shown.with.forced.et.al} { #1 } 118 | 119 | 120 | % #0 turns off the alternate interword spacing for entries with URLs. 121 | % #1 enables 122 | FUNCTION {default.is.use.alt.interword.spacing} { #1 } 123 | 124 | % If alternate interword spacing for entries with URLs is enabled, this is 125 | % the interword spacing stretch factor that will be used. For example, the 126 | % default "4" here means that the interword spacing in entries with URLs can 127 | % stretch to four times normal. Does not have to be an integer. Note that 128 | % the value specified here can be overridden by the user in their LaTeX 129 | % code via a command such as: 130 | % "\providecommand\BIBentryALTinterwordstretchfactor{1.5}" in addition to 131 | % that via the IEEEtranBSTCTL entry type. 132 | FUNCTION {default.ALTinterwordstretchfactor} { "4" } 133 | 134 | 135 | % #0 turns off the "dashification" of repeated (i.e., identical to those 136 | % of the previous entry) names. IEEE normally does this. 137 | % #1 enables 138 | FUNCTION {default.is.dash.repeated.names} { #1 } 139 | 140 | 141 | % The default name format control string. 142 | FUNCTION {default.name.format.string}{ "{f.~}{vv~}{ll}{, jj}" } 143 | 144 | 145 | % The default LaTeX font command for the names. 146 | FUNCTION {default.name.latex.cmd}{ "" } 147 | 148 | 149 | % The default URL prefix. 150 | FUNCTION {default.name.url.prefix}{ "[Online]. Available:" } 151 | 152 | 153 | % Other controls that cannot be accessed via IEEEtranBSTCTL entry type. 154 | 155 | % #0 turns off the terminal startup banner/completed message so as to 156 | % operate more quietly. 157 | % #1 enables 158 | FUNCTION {is.print.banners.to.terminal} { #1 } 159 | 160 | 161 | 162 | 163 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 164 | %% FILE VERSION AND BANNER %% 165 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 166 | 167 | FUNCTION{bst.file.version} { "1.13" } 168 | FUNCTION{bst.file.date} { "2008/09/30" } 169 | FUNCTION{bst.file.website} { "http://www.michaelshell.org/tex/ieeetran/bibtex/" } 170 | 171 | FUNCTION {banner.message} 172 | { is.print.banners.to.terminal 173 | { "-- IEEEtranN.bst version" " " * bst.file.version * 174 | " (" * bst.file.date * ") " * "by Michael Shell." * 175 | top$ 176 | "-- " bst.file.website * 177 | top$ 178 | "-- See the " quote$ * "IEEEtran_bst_HOWTO.pdf" * quote$ * " manual for usage information." * 179 | top$ 180 | "** Natbib version - not for normal IEEE work." 181 | top$ 182 | } 183 | { skip$ } 184 | if$ 185 | } 186 | 187 | FUNCTION {completed.message} 188 | { is.print.banners.to.terminal 189 | { "" 190 | top$ 191 | "Done." 192 | top$ 193 | } 194 | { skip$ } 195 | if$ 196 | } 197 | 198 | 199 | 200 | 201 | %%%%%%%%%%%%%%%%%%%%%% 202 | %% STRING CONSTANTS %% 203 | %%%%%%%%%%%%%%%%%%%%%% 204 | 205 | FUNCTION {bbl.and}{ "and" } 206 | FUNCTION {bbl.etal}{ "et~al." } 207 | FUNCTION {bbl.editors}{ "eds." } 208 | FUNCTION {bbl.editor}{ "ed." } 209 | FUNCTION {bbl.edition}{ "ed." } 210 | FUNCTION {bbl.volume}{ "vol." } 211 | FUNCTION {bbl.of}{ "of" } 212 | FUNCTION {bbl.number}{ "no." } 213 | FUNCTION {bbl.in}{ "in" } 214 | FUNCTION {bbl.pages}{ "pp." } 215 | FUNCTION {bbl.page}{ "p." } 216 | FUNCTION {bbl.chapter}{ "ch." } 217 | FUNCTION {bbl.paper}{ "paper" } 218 | FUNCTION {bbl.part}{ "pt." } 219 | FUNCTION {bbl.patent}{ "Patent" } 220 | FUNCTION {bbl.patentUS}{ "U.S." } 221 | FUNCTION {bbl.revision}{ "Rev." } 222 | FUNCTION {bbl.series}{ "ser." } 223 | FUNCTION {bbl.standard}{ "Std." } 224 | FUNCTION {bbl.techrep}{ "Tech. Rep." } 225 | FUNCTION {bbl.mthesis}{ "Master's thesis" } 226 | FUNCTION {bbl.phdthesis}{ "Ph.D. dissertation" } 227 | FUNCTION {bbl.st}{ "st" } 228 | FUNCTION {bbl.nd}{ "nd" } 229 | FUNCTION {bbl.rd}{ "rd" } 230 | FUNCTION {bbl.th}{ "th" } 231 | 232 | 233 | % This is the LaTeX spacer that is used when a larger than normal space 234 | % is called for (such as just before the address:publisher). 235 | FUNCTION {large.space} { "\hskip 1em plus 0.5em minus 0.4em\relax " } 236 | 237 | % The LaTeX code for dashes that are used to represent repeated names. 238 | % Note: Some older IEEE journals used something like 239 | % "\rule{0.275in}{0.5pt}\," which is fairly thick and runs right along 240 | % the baseline. However, IEEE now uses a thinner, above baseline, 241 | % six dash long sequence. 242 | FUNCTION {repeated.name.dashes} { "------" } 243 | 244 | 245 | 246 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 247 | %% PREDEFINED STRING MACROS %% 248 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 249 | 250 | MACRO {jan} {"Jan."} 251 | MACRO {feb} {"Feb."} 252 | MACRO {mar} {"Mar."} 253 | MACRO {apr} {"Apr."} 254 | MACRO {may} {"May"} 255 | MACRO {jun} {"Jun."} 256 | MACRO {jul} {"Jul."} 257 | MACRO {aug} {"Aug."} 258 | MACRO {sep} {"Sep."} 259 | MACRO {oct} {"Oct."} 260 | MACRO {nov} {"Nov."} 261 | MACRO {dec} {"Dec."} 262 | 263 | 264 | 265 | %%%%%%%%%%%%%%%%%% 266 | %% ENTRY FIELDS %% 267 | %%%%%%%%%%%%%%%%%% 268 | 269 | ENTRY 270 | { address 271 | assignee 272 | author 273 | booktitle 274 | chapter 275 | day 276 | dayfiled 277 | edition 278 | editor 279 | howpublished 280 | institution 281 | intype 282 | journal 283 | key 284 | language 285 | month 286 | monthfiled 287 | nationality 288 | note 289 | number 290 | organization 291 | pages 292 | paper 293 | publisher 294 | school 295 | series 296 | revision 297 | title 298 | type 299 | url 300 | volume 301 | year 302 | yearfiled 303 | CTLuse_article_number 304 | CTLuse_paper 305 | CTLuse_forced_etal 306 | CTLmax_names_forced_etal 307 | CTLnames_show_etal 308 | CTLuse_alt_spacing 309 | CTLalt_stretch_factor 310 | CTLdash_repeated_names 311 | CTLname_format_string 312 | CTLname_latex_cmd 313 | CTLname_url_prefix 314 | } 315 | {} 316 | { label extra.label sort.label short.list} 317 | 318 | 319 | 320 | 321 | %%%%%%%%%%%%%%%%%%%%%%% 322 | %% INTEGER VARIABLES %% 323 | %%%%%%%%%%%%%%%%%%%%%%% 324 | 325 | INTEGERS { prev.status.punct this.status.punct punct.std 326 | punct.no punct.comma punct.period 327 | prev.status.space this.status.space space.std 328 | space.no space.normal space.large 329 | prev.status.quote this.status.quote quote.std 330 | quote.no quote.close 331 | prev.status.nline this.status.nline nline.std 332 | nline.no nline.newblock 333 | status.cap cap.std 334 | cap.no cap.yes} 335 | 336 | INTEGERS { longest.label.width multiresult nameptr namesleft number.label numnames } 337 | 338 | INTEGERS { is.use.number.for.article 339 | is.use.paper 340 | is.forced.et.al 341 | max.num.names.before.forced.et.al 342 | num.names.shown.with.forced.et.al 343 | is.use.alt.interword.spacing 344 | is.dash.repeated.names} 345 | 346 | 347 | %%%%%%%%%%%%%%%%%%%%%% 348 | %% STRING VARIABLES %% 349 | %%%%%%%%%%%%%%%%%%%%%% 350 | 351 | STRINGS { bibinfo 352 | longest.label 353 | oldname 354 | s 355 | t 356 | ALTinterwordstretchfactor 357 | name.format.string 358 | name.latex.cmd 359 | name.url.prefix} 360 | 361 | 362 | 363 | 364 | %%%%%%%%%%%%%%%%%%%%%%%%% 365 | %% LOW LEVEL FUNCTIONS %% 366 | %%%%%%%%%%%%%%%%%%%%%%%%% 367 | 368 | FUNCTION {initialize.controls} 369 | { default.is.use.number.for.article 'is.use.number.for.article := 370 | default.is.use.paper 'is.use.paper := 371 | default.is.forced.et.al 'is.forced.et.al := 372 | default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al := 373 | default.num.names.shown.with.forced.et.al 'num.names.shown.with.forced.et.al := 374 | default.is.use.alt.interword.spacing 'is.use.alt.interword.spacing := 375 | default.is.dash.repeated.names 'is.dash.repeated.names := 376 | default.ALTinterwordstretchfactor 'ALTinterwordstretchfactor := 377 | default.name.format.string 'name.format.string := 378 | default.name.latex.cmd 'name.latex.cmd := 379 | default.name.url.prefix 'name.url.prefix := 380 | } 381 | 382 | 383 | % This IEEEtran.bst features a very powerful and flexible mechanism for 384 | % controlling the capitalization, punctuation, spacing, quotation, and 385 | % newlines of the formatted entry fields. (Note: IEEEtran.bst does not need 386 | % or use the newline/newblock feature, but it has been implemented for 387 | % possible future use.) The output states of IEEEtran.bst consist of 388 | % multiple independent attributes and, as such, can be thought of as being 389 | % vectors, rather than the simple scalar values ("before.all", 390 | % "mid.sentence", etc.) used in most other .bst files. 391 | % 392 | % The more flexible and complex design used here was motivated in part by 393 | % IEEE's rather unusual bibliography style. For example, IEEE ends the 394 | % previous field item with a period and large space prior to the publisher 395 | % address; the @electronic entry types use periods as inter-item punctuation 396 | % rather than the commas used by the other entry types; and URLs are never 397 | % followed by periods even though they are the last item in the entry. 398 | % Although it is possible to accommodate these features with the conventional 399 | % output state system, the seemingly endless exceptions make for convoluted, 400 | % unreliable and difficult to maintain code. 401 | % 402 | % IEEEtran.bst's output state system can be easily understood via a simple 403 | % illustration of two most recently formatted entry fields (on the stack): 404 | % 405 | % CURRENT_ITEM 406 | % "PREVIOUS_ITEM 407 | % 408 | % which, in this example, is to eventually appear in the bibliography as: 409 | % 410 | % "PREVIOUS_ITEM," CURRENT_ITEM 411 | % 412 | % It is the job of the output routine to take the previous item off of the 413 | % stack (while leaving the current item at the top of the stack), apply its 414 | % trailing punctuation (including closing quote marks) and spacing, and then 415 | % to write the result to BibTeX's output buffer: 416 | % 417 | % "PREVIOUS_ITEM," 418 | % 419 | % Punctuation (and spacing) between items is often determined by both of the 420 | % items rather than just the first one. The presence of quotation marks 421 | % further complicates the situation because, in standard English, trailing 422 | % punctuation marks are supposed to be contained within the quotes. 423 | % 424 | % IEEEtran.bst maintains two output state (aka "status") vectors which 425 | % correspond to the previous and current (aka "this") items. Each vector 426 | % consists of several independent attributes which track punctuation, 427 | % spacing, quotation, and newlines. Capitalization status is handled by a 428 | % separate scalar because the format routines, not the output routine, 429 | % handle capitalization and, therefore, there is no need to maintain the 430 | % capitalization attribute for both the "previous" and "this" items. 431 | % 432 | % When a format routine adds a new item, it copies the current output status 433 | % vector to the previous output status vector and (usually) resets the 434 | % current (this) output status vector to a "standard status" vector. Using a 435 | % "standard status" vector in this way allows us to redefine what we mean by 436 | % "standard status" at the start of each entry handler and reuse the same 437 | % format routines under the various inter-item separation schemes. For 438 | % example, the standard status vector for the @book entry type may use 439 | % commas for item separators, while the @electronic type may use periods, 440 | % yet both entry handlers exploit many of the exact same format routines. 441 | % 442 | % Because format routines have write access to the output status vector of 443 | % the previous item, they can override the punctuation choices of the 444 | % previous format routine! Therefore, it becomes trivial to implement rules 445 | % such as "Always use a period and a large space before the publisher." By 446 | % pushing the generation of the closing quote mark to the output routine, we 447 | % avoid all the problems caused by having to close a quote before having all 448 | % the information required to determine what the punctuation should be. 449 | % 450 | % The IEEEtran.bst output state system can easily be expanded if needed. 451 | % For instance, it is easy to add a "space.tie" attribute value if the 452 | % bibliography rules mandate that two items have to be joined with an 453 | % unbreakable space. 454 | 455 | FUNCTION {initialize.status.constants} 456 | { #0 'punct.no := 457 | #1 'punct.comma := 458 | #2 'punct.period := 459 | #0 'space.no := 460 | #1 'space.normal := 461 | #2 'space.large := 462 | #0 'quote.no := 463 | #1 'quote.close := 464 | #0 'cap.no := 465 | #1 'cap.yes := 466 | #0 'nline.no := 467 | #1 'nline.newblock := 468 | } 469 | 470 | FUNCTION {std.status.using.comma} 471 | { punct.comma 'punct.std := 472 | space.normal 'space.std := 473 | quote.no 'quote.std := 474 | nline.no 'nline.std := 475 | cap.no 'cap.std := 476 | } 477 | 478 | FUNCTION {std.status.using.period} 479 | { punct.period 'punct.std := 480 | space.normal 'space.std := 481 | quote.no 'quote.std := 482 | nline.no 'nline.std := 483 | cap.yes 'cap.std := 484 | } 485 | 486 | FUNCTION {initialize.prev.this.status} 487 | { punct.no 'prev.status.punct := 488 | space.no 'prev.status.space := 489 | quote.no 'prev.status.quote := 490 | nline.no 'prev.status.nline := 491 | punct.no 'this.status.punct := 492 | space.no 'this.status.space := 493 | quote.no 'this.status.quote := 494 | nline.no 'this.status.nline := 495 | cap.yes 'status.cap := 496 | } 497 | 498 | FUNCTION {this.status.std} 499 | { punct.std 'this.status.punct := 500 | space.std 'this.status.space := 501 | quote.std 'this.status.quote := 502 | nline.std 'this.status.nline := 503 | } 504 | 505 | FUNCTION {cap.status.std}{ cap.std 'status.cap := } 506 | 507 | FUNCTION {this.to.prev.status} 508 | { this.status.punct 'prev.status.punct := 509 | this.status.space 'prev.status.space := 510 | this.status.quote 'prev.status.quote := 511 | this.status.nline 'prev.status.nline := 512 | } 513 | 514 | 515 | FUNCTION {not} 516 | { { #0 } 517 | { #1 } 518 | if$ 519 | } 520 | 521 | FUNCTION {and} 522 | { { skip$ } 523 | { pop$ #0 } 524 | if$ 525 | } 526 | 527 | FUNCTION {or} 528 | { { pop$ #1 } 529 | { skip$ } 530 | if$ 531 | } 532 | 533 | 534 | % convert the strings "yes" or "no" to #1 or #0 respectively 535 | FUNCTION {yes.no.to.int} 536 | { "l" change.case$ duplicate$ 537 | "yes" = 538 | { pop$ #1 } 539 | { duplicate$ "no" = 540 | { pop$ #0 } 541 | { "unknown boolean " quote$ * swap$ * quote$ * 542 | " in " * cite$ * warning$ 543 | #0 544 | } 545 | if$ 546 | } 547 | if$ 548 | } 549 | 550 | 551 | % pushes true if the single char string on the stack is in the 552 | % range of "0" to "9" 553 | FUNCTION {is.num} 554 | { chr.to.int$ 555 | duplicate$ "0" chr.to.int$ < not 556 | swap$ "9" chr.to.int$ > not and 557 | } 558 | 559 | % multiplies the integer on the stack by a factor of 10 560 | FUNCTION {bump.int.mag} 561 | { #0 'multiresult := 562 | { duplicate$ #0 > } 563 | { #1 - 564 | multiresult #10 + 565 | 'multiresult := 566 | } 567 | while$ 568 | pop$ 569 | multiresult 570 | } 571 | 572 | % converts a single character string on the stack to an integer 573 | FUNCTION {char.to.integer} 574 | { duplicate$ 575 | is.num 576 | { chr.to.int$ "0" chr.to.int$ - } 577 | {"noninteger character " quote$ * swap$ * quote$ * 578 | " in integer field of " * cite$ * warning$ 579 | #0 580 | } 581 | if$ 582 | } 583 | 584 | % converts a string on the stack to an integer 585 | FUNCTION {string.to.integer} 586 | { duplicate$ text.length$ 'namesleft := 587 | #1 'nameptr := 588 | #0 'numnames := 589 | { nameptr namesleft > not } 590 | { duplicate$ nameptr #1 substring$ 591 | char.to.integer numnames bump.int.mag + 592 | 'numnames := 593 | nameptr #1 + 594 | 'nameptr := 595 | } 596 | while$ 597 | pop$ 598 | numnames 599 | } 600 | 601 | 602 | 603 | 604 | % The output routines write out the *next* to the top (previous) item on the 605 | % stack, adding punctuation and such as needed. Since IEEEtran.bst maintains 606 | % the output status for the top two items on the stack, these output 607 | % routines have to consider the previous output status (which corresponds to 608 | % the item that is being output). Full independent control of punctuation, 609 | % closing quote marks, spacing, and newblock is provided. 610 | % 611 | % "output.nonnull" does not check for the presence of a previous empty 612 | % item. 613 | % 614 | % "output" does check for the presence of a previous empty item and will 615 | % remove an empty item rather than outputing it. 616 | % 617 | % "output.warn" is like "output", but will issue a warning if it detects 618 | % an empty item. 619 | 620 | FUNCTION {output.nonnull} 621 | { swap$ 622 | prev.status.punct punct.comma = 623 | { "," * } 624 | { skip$ } 625 | if$ 626 | prev.status.punct punct.period = 627 | { add.period$ } 628 | { skip$ } 629 | if$ 630 | prev.status.quote quote.close = 631 | { "''" * } 632 | { skip$ } 633 | if$ 634 | prev.status.space space.normal = 635 | { " " * } 636 | { skip$ } 637 | if$ 638 | prev.status.space space.large = 639 | { large.space * } 640 | { skip$ } 641 | if$ 642 | write$ 643 | prev.status.nline nline.newblock = 644 | { newline$ "\newblock " write$ } 645 | { skip$ } 646 | if$ 647 | } 648 | 649 | FUNCTION {output} 650 | { duplicate$ empty$ 651 | 'pop$ 652 | 'output.nonnull 653 | if$ 654 | } 655 | 656 | FUNCTION {output.warn} 657 | { 't := 658 | duplicate$ empty$ 659 | { pop$ "empty " t * " in " * cite$ * warning$ } 660 | 'output.nonnull 661 | if$ 662 | } 663 | 664 | % "fin.entry" is the output routine that handles the last item of the entry 665 | % (which will be on the top of the stack when "fin.entry" is called). 666 | 667 | FUNCTION {fin.entry} 668 | { this.status.punct punct.no = 669 | { skip$ } 670 | { add.period$ } 671 | if$ 672 | this.status.quote quote.close = 673 | { "''" * } 674 | { skip$ } 675 | if$ 676 | write$ 677 | newline$ 678 | } 679 | 680 | 681 | FUNCTION {is.last.char.not.punct} 682 | { duplicate$ 683 | "}" * add.period$ 684 | #-1 #1 substring$ "." = 685 | } 686 | 687 | FUNCTION {is.multiple.pages} 688 | { 't := 689 | #0 'multiresult := 690 | { multiresult not 691 | t empty$ not 692 | and 693 | } 694 | { t #1 #1 substring$ 695 | duplicate$ "-" = 696 | swap$ duplicate$ "," = 697 | swap$ "+" = 698 | or or 699 | { #1 'multiresult := } 700 | { t #2 global.max$ substring$ 't := } 701 | if$ 702 | } 703 | while$ 704 | multiresult 705 | } 706 | 707 | FUNCTION {capitalize}{ "u" change.case$ "t" change.case$ } 708 | 709 | FUNCTION {emphasize} 710 | { duplicate$ empty$ 711 | { pop$ "" } 712 | { "\emph{" swap$ * "}" * } 713 | if$ 714 | } 715 | 716 | FUNCTION {do.name.latex.cmd} 717 | { name.latex.cmd 718 | empty$ 719 | { skip$ } 720 | { name.latex.cmd "{" * swap$ * "}" * } 721 | if$ 722 | } 723 | 724 | % IEEEtran.bst uses its own \BIBforeignlanguage command which directly 725 | % invokes the TeX hyphenation patterns without the need of the Babel 726 | % package. Babel does a lot more than switch hyphenation patterns and 727 | % its loading can cause unintended effects in many class files (such as 728 | % IEEEtran.cls). 729 | FUNCTION {select.language} 730 | { duplicate$ empty$ 'pop$ 731 | { language empty$ 'skip$ 732 | { "\BIBforeignlanguage{" language * "}{" * swap$ * "}" * } 733 | if$ 734 | } 735 | if$ 736 | } 737 | 738 | FUNCTION {tie.or.space.prefix} 739 | { duplicate$ text.length$ #3 < 740 | { "~" } 741 | { " " } 742 | if$ 743 | swap$ 744 | } 745 | 746 | FUNCTION {get.bbl.editor} 747 | { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } 748 | 749 | FUNCTION {space.word}{ " " swap$ * " " * } 750 | 751 | 752 | % Field Conditioners, Converters, Checkers and External Interfaces 753 | 754 | FUNCTION {empty.field.to.null.string} 755 | { duplicate$ empty$ 756 | { pop$ "" } 757 | { skip$ } 758 | if$ 759 | } 760 | 761 | FUNCTION {either.or.check} 762 | { empty$ 763 | { pop$ } 764 | { "can't use both " swap$ * " fields in " * cite$ * warning$ } 765 | if$ 766 | } 767 | 768 | FUNCTION {empty.entry.warn} 769 | { author empty$ title empty$ howpublished empty$ 770 | month empty$ year empty$ note empty$ url empty$ 771 | and and and and and and 772 | { "all relevant fields are empty in " cite$ * warning$ } 773 | 'skip$ 774 | if$ 775 | } 776 | 777 | 778 | % The bibinfo system provides a way for the electronic parsing/acquisition 779 | % of a bibliography's contents as is done by ReVTeX. For example, a field 780 | % could be entered into the bibliography as: 781 | % \bibinfo{volume}{2} 782 | % Only the "2" would show up in the document, but the LaTeX \bibinfo command 783 | % could do additional things with the information. IEEEtran.bst does provide 784 | % a \bibinfo command via "\providecommand{\bibinfo}[2]{#2}". However, it is 785 | % currently not used as the bogus bibinfo functions defined here output the 786 | % entry values directly without the \bibinfo wrapper. The bibinfo functions 787 | % themselves (and the calls to them) are retained for possible future use. 788 | % 789 | % bibinfo.check avoids acting on missing fields while bibinfo.warn will 790 | % issue a warning message if a missing field is detected. Prior to calling 791 | % the bibinfo functions, the user should push the field value and then its 792 | % name string, in that order. 793 | 794 | FUNCTION {bibinfo.check} 795 | { swap$ duplicate$ missing$ 796 | { pop$ pop$ "" } 797 | { duplicate$ empty$ 798 | { swap$ pop$ } 799 | { swap$ pop$ } 800 | if$ 801 | } 802 | if$ 803 | } 804 | 805 | FUNCTION {bibinfo.warn} 806 | { swap$ duplicate$ missing$ 807 | { swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ "" } 808 | { duplicate$ empty$ 809 | { swap$ "empty " swap$ * " in " * cite$ * warning$ } 810 | { swap$ pop$ } 811 | if$ 812 | } 813 | if$ 814 | } 815 | 816 | 817 | % IEEE separates large numbers with more than 4 digits into groups of 818 | % three. IEEE uses a small space to separate these number groups. 819 | % Typical applications include patent and page numbers. 820 | 821 | % number of consecutive digits required to trigger the group separation. 822 | FUNCTION {large.number.trigger}{ #5 } 823 | 824 | % For numbers longer than the trigger, this is the blocksize of the groups. 825 | % The blocksize must be less than the trigger threshold, and 2 * blocksize 826 | % must be greater than the trigger threshold (can't do more than one 827 | % separation on the initial trigger). 828 | FUNCTION {large.number.blocksize}{ #3 } 829 | 830 | % What is actually inserted between the number groups. 831 | FUNCTION {large.number.separator}{ "\," } 832 | 833 | % So as to save on integer variables by reusing existing ones, numnames 834 | % holds the current number of consecutive digits read and nameptr holds 835 | % the number that will trigger an inserted space. 836 | FUNCTION {large.number.separate} 837 | { 't := 838 | "" 839 | #0 'numnames := 840 | large.number.trigger 'nameptr := 841 | { t empty$ not } 842 | { t #-1 #1 substring$ is.num 843 | { numnames #1 + 'numnames := } 844 | { #0 'numnames := 845 | large.number.trigger 'nameptr := 846 | } 847 | if$ 848 | t #-1 #1 substring$ swap$ * 849 | t #-2 global.max$ substring$ 't := 850 | numnames nameptr = 851 | { duplicate$ #1 nameptr large.number.blocksize - substring$ swap$ 852 | nameptr large.number.blocksize - #1 + global.max$ substring$ 853 | large.number.separator swap$ * * 854 | nameptr large.number.blocksize - 'numnames := 855 | large.number.blocksize #1 + 'nameptr := 856 | } 857 | { skip$ } 858 | if$ 859 | } 860 | while$ 861 | } 862 | 863 | % Converts all single dashes "-" to double dashes "--". 864 | FUNCTION {n.dashify} 865 | { large.number.separate 866 | 't := 867 | "" 868 | { t empty$ not } 869 | { t #1 #1 substring$ "-" = 870 | { t #1 #2 substring$ "--" = not 871 | { "--" * 872 | t #2 global.max$ substring$ 't := 873 | } 874 | { { t #1 #1 substring$ "-" = } 875 | { "-" * 876 | t #2 global.max$ substring$ 't := 877 | } 878 | while$ 879 | } 880 | if$ 881 | } 882 | { t #1 #1 substring$ * 883 | t #2 global.max$ substring$ 't := 884 | } 885 | if$ 886 | } 887 | while$ 888 | } 889 | 890 | 891 | % This function detects entries with names that are identical to that of 892 | % the previous entry and replaces the repeated names with dashes (if the 893 | % "is.dash.repeated.names" user control is nonzero). 894 | FUNCTION {name.or.dash} 895 | { 's := 896 | oldname empty$ 897 | { s 'oldname := s } 898 | { s oldname = 899 | { is.dash.repeated.names 900 | { repeated.name.dashes } 901 | { s 'oldname := s } 902 | if$ 903 | } 904 | { s 'oldname := s } 905 | if$ 906 | } 907 | if$ 908 | } 909 | 910 | % Converts the number string on the top of the stack to 911 | % "numerical ordinal form" (e.g., "7" to "7th"). There is 912 | % no artificial limit to the upper bound of the numbers as the 913 | % two least significant digits determine the ordinal form. 914 | FUNCTION {num.to.ordinal} 915 | { duplicate$ #-2 #1 substring$ "1" = 916 | { bbl.th * } 917 | { duplicate$ #-1 #1 substring$ "1" = 918 | { bbl.st * } 919 | { duplicate$ #-1 #1 substring$ "2" = 920 | { bbl.nd * } 921 | { duplicate$ #-1 #1 substring$ "3" = 922 | { bbl.rd * } 923 | { bbl.th * } 924 | if$ 925 | } 926 | if$ 927 | } 928 | if$ 929 | } 930 | if$ 931 | } 932 | 933 | % If the string on the top of the stack begins with a number, 934 | % (e.g., 11th) then replace the string with the leading number 935 | % it contains. Otherwise retain the string as-is. s holds the 936 | % extracted number, t holds the part of the string that remains 937 | % to be scanned. 938 | FUNCTION {extract.num} 939 | { duplicate$ 't := 940 | "" 's := 941 | { t empty$ not } 942 | { t #1 #1 substring$ 943 | t #2 global.max$ substring$ 't := 944 | duplicate$ is.num 945 | { s swap$ * 's := } 946 | { pop$ "" 't := } 947 | if$ 948 | } 949 | while$ 950 | s empty$ 951 | 'skip$ 952 | { pop$ s } 953 | if$ 954 | } 955 | 956 | % Converts the word number string on the top of the stack to 957 | % Arabic string form. Will be successful up to "tenth". 958 | FUNCTION {word.to.num} 959 | { duplicate$ "l" change.case$ 's := 960 | s "first" = 961 | { pop$ "1" } 962 | { skip$ } 963 | if$ 964 | s "second" = 965 | { pop$ "2" } 966 | { skip$ } 967 | if$ 968 | s "third" = 969 | { pop$ "3" } 970 | { skip$ } 971 | if$ 972 | s "fourth" = 973 | { pop$ "4" } 974 | { skip$ } 975 | if$ 976 | s "fifth" = 977 | { pop$ "5" } 978 | { skip$ } 979 | if$ 980 | s "sixth" = 981 | { pop$ "6" } 982 | { skip$ } 983 | if$ 984 | s "seventh" = 985 | { pop$ "7" } 986 | { skip$ } 987 | if$ 988 | s "eighth" = 989 | { pop$ "8" } 990 | { skip$ } 991 | if$ 992 | s "ninth" = 993 | { pop$ "9" } 994 | { skip$ } 995 | if$ 996 | s "tenth" = 997 | { pop$ "10" } 998 | { skip$ } 999 | if$ 1000 | } 1001 | 1002 | 1003 | % Converts the string on the top of the stack to numerical 1004 | % ordinal (e.g., "11th") form. 1005 | FUNCTION {convert.edition} 1006 | { duplicate$ empty$ 'skip$ 1007 | { duplicate$ #1 #1 substring$ is.num 1008 | { extract.num 1009 | num.to.ordinal 1010 | } 1011 | { word.to.num 1012 | duplicate$ #1 #1 substring$ is.num 1013 | { num.to.ordinal } 1014 | { "edition ordinal word " quote$ * edition * quote$ * 1015 | " may be too high (or improper) for conversion" * " in " * cite$ * warning$ 1016 | } 1017 | if$ 1018 | } 1019 | if$ 1020 | } 1021 | if$ 1022 | } 1023 | 1024 | 1025 | 1026 | 1027 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1028 | %% LATEX BIBLIOGRAPHY CODE %% 1029 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1030 | 1031 | % from plainnat.bst 1032 | FUNCTION {format.full.names} 1033 | {'s := 1034 | #1 'nameptr := 1035 | s num.names$ 'numnames := 1036 | numnames 'namesleft := 1037 | { namesleft #0 > } 1038 | { s nameptr 1039 | "{vv~}{ll}" format.name$ 't := 1040 | nameptr #1 > 1041 | { 1042 | namesleft #1 > 1043 | { ", " * t * } 1044 | { 1045 | numnames #2 > 1046 | { "," * } 1047 | 'skip$ 1048 | if$ 1049 | t "others" = 1050 | { " et~al." * } 1051 | { " and " * t * } 1052 | if$ 1053 | } 1054 | if$ 1055 | } 1056 | 't 1057 | if$ 1058 | nameptr #1 + 'nameptr := 1059 | namesleft #1 - 'namesleft := 1060 | } 1061 | while$ 1062 | } 1063 | 1064 | FUNCTION {author.editor.full} 1065 | { author empty$ 1066 | { editor empty$ 1067 | { "" } 1068 | { editor format.full.names } 1069 | if$ 1070 | } 1071 | { author format.full.names } 1072 | if$ 1073 | } 1074 | 1075 | FUNCTION {author.full} 1076 | { author empty$ 1077 | { "" } 1078 | { author format.full.names } 1079 | if$ 1080 | } 1081 | 1082 | FUNCTION {editor.full} 1083 | { editor empty$ 1084 | { "" } 1085 | { editor format.full.names } 1086 | if$ 1087 | } 1088 | 1089 | FUNCTION {make.full.names} 1090 | { type$ "book" = 1091 | type$ "inbook" = 1092 | or 1093 | { author.editor.full } 1094 | { type$ "proceedings" = 1095 | type$ "periodical" = 1096 | or 1097 | { editor.full } 1098 | { author.full } 1099 | if$ 1100 | } 1101 | if$ 1102 | } 1103 | % END from plainnat.bst 1104 | 1105 | FUNCTION {start.entry} 1106 | { newline$ 1107 | "\bibitem[" write$ 1108 | label write$ 1109 | ")" make.full.names duplicate$ short.list = 1110 | { pop$ } 1111 | { * } 1112 | if$ 1113 | "]{" * write$ 1114 | cite$ write$ 1115 | "}" write$ 1116 | newline$ 1117 | "" 1118 | initialize.prev.this.status 1119 | } 1120 | 1121 | % Here we write out all the LaTeX code that we will need. The most involved 1122 | % code sequences are those that control the alternate interword spacing and 1123 | % foreign language hyphenation patterns. The heavy use of \providecommand 1124 | % gives users a way to override the defaults. Special thanks to Javier Bezos, 1125 | % Johannes Braams, Robin Fairbairns, Heiko Oberdiek, Donald Arseneau and all 1126 | % the other gurus on comp.text.tex for their help and advice on the topic of 1127 | % \selectlanguage, Babel and BibTeX. 1128 | FUNCTION {begin.bib} 1129 | { "% Generated by IEEEtranN.bst, version: " bst.file.version * " (" * bst.file.date * ")" * 1130 | write$ newline$ 1131 | preamble$ empty$ 'skip$ 1132 | { preamble$ write$ newline$ } 1133 | if$ 1134 | "\begin{thebibliography}{" number.label int.to.str$ * "}" * 1135 | write$ newline$ 1136 | "\providecommand{\natexlab}[1]{#1}" 1137 | write$ newline$ 1138 | "\providecommand{\url}[1]{#1}" 1139 | write$ newline$ 1140 | "\csname url@samestyle\endcsname" 1141 | write$ newline$ 1142 | "\providecommand{\newblock}{\relax}" 1143 | write$ newline$ 1144 | "\providecommand{\bibinfo}[2]{#2}" 1145 | write$ newline$ 1146 | "\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}" 1147 | write$ newline$ 1148 | "\providecommand{\BIBentryALTinterwordstretchfactor}{" 1149 | ALTinterwordstretchfactor * "}" * 1150 | write$ newline$ 1151 | "\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus " 1152 | write$ newline$ 1153 | "\BIBentryALTinterwordstretchfactor\fontdimen3\font minus \fontdimen4\font\relax}" 1154 | write$ newline$ 1155 | "\providecommand{\BIBforeignlanguage}[2]{{%" 1156 | write$ newline$ 1157 | "\expandafter\ifx\csname l@#1\endcsname\relax" 1158 | write$ newline$ 1159 | "\typeout{** WARNING: IEEEtranN.bst: No hyphenation pattern has been}%" 1160 | write$ newline$ 1161 | "\typeout{** loaded for the language `#1'. Using the pattern for}%" 1162 | write$ newline$ 1163 | "\typeout{** the default language instead.}%" 1164 | write$ newline$ 1165 | "\else" 1166 | write$ newline$ 1167 | "\language=\csname l@#1\endcsname" 1168 | write$ newline$ 1169 | "\fi" 1170 | write$ newline$ 1171 | "#2}}" 1172 | write$ newline$ 1173 | "\providecommand{\BIBdecl}{\relax}" 1174 | write$ newline$ 1175 | "\BIBdecl" 1176 | write$ newline$ 1177 | } 1178 | 1179 | FUNCTION {end.bib} 1180 | { newline$ "\end{thebibliography}" write$ newline$ } 1181 | 1182 | FUNCTION {if.url.alt.interword.spacing} 1183 | { is.use.alt.interword.spacing 1184 | {url empty$ 'skip$ {"\BIBentryALTinterwordspacing" write$ newline$} if$} 1185 | { skip$ } 1186 | if$ 1187 | } 1188 | 1189 | FUNCTION {if.url.std.interword.spacing} 1190 | { is.use.alt.interword.spacing 1191 | {url empty$ 'skip$ {"\BIBentrySTDinterwordspacing" write$ newline$} if$} 1192 | { skip$ } 1193 | if$ 1194 | } 1195 | 1196 | 1197 | 1198 | 1199 | %%%%%%%%%%%%%%%%%%%%% 1200 | %% FORMAT HANDLERS %% 1201 | %%%%%%%%%%%%%%%%%%%%% 1202 | 1203 | %% Lower Level Formats (used by higher level formats) 1204 | 1205 | FUNCTION {format.address.org.or.pub.date} 1206 | { 't := 1207 | "" 1208 | year empty$ 1209 | { "empty year in " cite$ * warning$ } 1210 | { skip$ } 1211 | if$ 1212 | address empty$ t empty$ and 1213 | year empty$ and month empty$ and 1214 | { skip$ } 1215 | { this.to.prev.status 1216 | this.status.std 1217 | cap.status.std 1218 | address "address" bibinfo.check * 1219 | t empty$ 1220 | { skip$ } 1221 | { punct.period 'prev.status.punct := 1222 | space.large 'prev.status.space := 1223 | address empty$ 1224 | { skip$ } 1225 | { ": " * } 1226 | if$ 1227 | t * 1228 | } 1229 | if$ 1230 | year empty$ month empty$ and 1231 | { skip$ } 1232 | { t empty$ address empty$ and 1233 | { skip$ } 1234 | { ", " * } 1235 | if$ 1236 | month empty$ 1237 | { year empty$ 1238 | { skip$ } 1239 | { year "year" bibinfo.check * } 1240 | if$ 1241 | } 1242 | { month "month" bibinfo.check * 1243 | year empty$ 1244 | { skip$ } 1245 | { " " * year "year" bibinfo.check * } 1246 | if$ 1247 | } 1248 | if$ 1249 | } 1250 | if$ 1251 | } 1252 | if$ 1253 | } 1254 | 1255 | 1256 | FUNCTION {format.names} 1257 | { 'bibinfo := 1258 | duplicate$ empty$ 'skip$ { 1259 | this.to.prev.status 1260 | this.status.std 1261 | 's := 1262 | "" 't := 1263 | #1 'nameptr := 1264 | s num.names$ 'numnames := 1265 | numnames 'namesleft := 1266 | { namesleft #0 > } 1267 | { s nameptr 1268 | name.format.string 1269 | format.name$ 1270 | bibinfo bibinfo.check 1271 | 't := 1272 | nameptr #1 > 1273 | { nameptr num.names.shown.with.forced.et.al #1 + = 1274 | numnames max.num.names.before.forced.et.al > 1275 | is.forced.et.al and and 1276 | { "others" 't := 1277 | #1 'namesleft := 1278 | } 1279 | { skip$ } 1280 | if$ 1281 | namesleft #1 > 1282 | { ", " * t do.name.latex.cmd * } 1283 | { s nameptr "{ll}" format.name$ duplicate$ "others" = 1284 | { 't := } 1285 | { pop$ } 1286 | if$ 1287 | t "others" = 1288 | { " " * bbl.etal emphasize * } 1289 | { numnames #2 > 1290 | { "," * } 1291 | { skip$ } 1292 | if$ 1293 | bbl.and 1294 | space.word * t do.name.latex.cmd * 1295 | } 1296 | if$ 1297 | } 1298 | if$ 1299 | } 1300 | { t do.name.latex.cmd } 1301 | if$ 1302 | nameptr #1 + 'nameptr := 1303 | namesleft #1 - 'namesleft := 1304 | } 1305 | while$ 1306 | cap.status.std 1307 | } if$ 1308 | } 1309 | 1310 | 1311 | 1312 | 1313 | %% Higher Level Formats 1314 | 1315 | %% addresses/locations 1316 | 1317 | FUNCTION {format.address} 1318 | { address duplicate$ empty$ 'skip$ 1319 | { this.to.prev.status 1320 | this.status.std 1321 | cap.status.std 1322 | } 1323 | if$ 1324 | } 1325 | 1326 | 1327 | 1328 | %% author/editor names 1329 | 1330 | FUNCTION {format.authors}{ author "author" format.names } 1331 | 1332 | FUNCTION {format.editors} 1333 | { editor "editor" format.names duplicate$ empty$ 'skip$ 1334 | { ", " * 1335 | get.bbl.editor 1336 | capitalize 1337 | * 1338 | } 1339 | if$ 1340 | } 1341 | 1342 | 1343 | 1344 | %% date 1345 | 1346 | FUNCTION {format.date} 1347 | { 1348 | month "month" bibinfo.check duplicate$ empty$ 1349 | year "year" bibinfo.check duplicate$ empty$ 1350 | { swap$ 'skip$ 1351 | { this.to.prev.status 1352 | this.status.std 1353 | cap.status.std 1354 | "there's a month but no year in " cite$ * warning$ } 1355 | if$ 1356 | * 1357 | } 1358 | { this.to.prev.status 1359 | this.status.std 1360 | cap.status.std 1361 | swap$ 'skip$ 1362 | { 1363 | swap$ 1364 | " " * swap$ 1365 | } 1366 | if$ 1367 | * 1368 | } 1369 | if$ 1370 | } 1371 | 1372 | FUNCTION {format.date.electronic} 1373 | { month "month" bibinfo.check duplicate$ empty$ 1374 | year "year" bibinfo.check duplicate$ empty$ 1375 | { swap$ 1376 | { pop$ } 1377 | { "there's a month but no year in " cite$ * warning$ 1378 | pop$ ")" * "(" swap$ * 1379 | this.to.prev.status 1380 | punct.no 'this.status.punct := 1381 | space.normal 'this.status.space := 1382 | quote.no 'this.status.quote := 1383 | cap.yes 'status.cap := 1384 | } 1385 | if$ 1386 | } 1387 | { swap$ 1388 | { swap$ pop$ ")" * "(" swap$ * } 1389 | { "(" swap$ * ", " * swap$ * ")" * } 1390 | if$ 1391 | this.to.prev.status 1392 | punct.no 'this.status.punct := 1393 | space.normal 'this.status.space := 1394 | quote.no 'this.status.quote := 1395 | cap.yes 'status.cap := 1396 | } 1397 | if$ 1398 | } 1399 | 1400 | 1401 | 1402 | %% edition/title 1403 | 1404 | % Note: IEEE considers the edition to be closely associated with 1405 | % the title of a book. So, in IEEEtran.bst the edition is normally handled 1406 | % within the formatting of the title. The format.edition function is 1407 | % retained here for possible future use. 1408 | FUNCTION {format.edition} 1409 | { edition duplicate$ empty$ 'skip$ 1410 | { this.to.prev.status 1411 | this.status.std 1412 | convert.edition 1413 | status.cap 1414 | { "t" } 1415 | { "l" } 1416 | if$ change.case$ 1417 | "edition" bibinfo.check 1418 | "~" * bbl.edition * 1419 | cap.status.std 1420 | } 1421 | if$ 1422 | } 1423 | 1424 | % This is used to format the booktitle of a conference proceedings. 1425 | % Here we use the "intype" field to provide the user a way to 1426 | % override the word "in" (e.g., with things like "presented at") 1427 | % Use of intype stops the emphasis of the booktitle to indicate that 1428 | % we no longer mean the written conference proceedings, but the 1429 | % conference itself. 1430 | FUNCTION {format.in.booktitle} 1431 | { booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ 1432 | { this.to.prev.status 1433 | this.status.std 1434 | select.language 1435 | intype missing$ 1436 | { emphasize 1437 | bbl.in " " * 1438 | } 1439 | { intype " " * } 1440 | if$ 1441 | swap$ * 1442 | cap.status.std 1443 | } 1444 | if$ 1445 | } 1446 | 1447 | % This is used to format the booktitle of collection. 1448 | % Here the "intype" field is not supported, but "edition" is. 1449 | FUNCTION {format.in.booktitle.edition} 1450 | { booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ 1451 | { this.to.prev.status 1452 | this.status.std 1453 | select.language 1454 | emphasize 1455 | edition empty$ 'skip$ 1456 | { ", " * 1457 | edition 1458 | convert.edition 1459 | "l" change.case$ 1460 | * "~" * bbl.edition * 1461 | } 1462 | if$ 1463 | bbl.in " " * swap$ * 1464 | cap.status.std 1465 | } 1466 | if$ 1467 | } 1468 | 1469 | FUNCTION {format.article.title} 1470 | { title duplicate$ empty$ 'skip$ 1471 | { this.to.prev.status 1472 | this.status.std 1473 | "t" change.case$ 1474 | } 1475 | if$ 1476 | "title" bibinfo.check 1477 | duplicate$ empty$ 'skip$ 1478 | { quote.close 'this.status.quote := 1479 | is.last.char.not.punct 1480 | { punct.std 'this.status.punct := } 1481 | { punct.no 'this.status.punct := } 1482 | if$ 1483 | select.language 1484 | "``" swap$ * 1485 | cap.status.std 1486 | } 1487 | if$ 1488 | } 1489 | 1490 | FUNCTION {format.article.title.electronic} 1491 | { title duplicate$ empty$ 'skip$ 1492 | { this.to.prev.status 1493 | this.status.std 1494 | cap.status.std 1495 | "t" change.case$ 1496 | } 1497 | if$ 1498 | "title" bibinfo.check 1499 | duplicate$ empty$ 1500 | { skip$ } 1501 | { select.language } 1502 | if$ 1503 | } 1504 | 1505 | FUNCTION {format.book.title.edition} 1506 | { title "title" bibinfo.check 1507 | duplicate$ empty$ 1508 | { "empty title in " cite$ * warning$ } 1509 | { this.to.prev.status 1510 | this.status.std 1511 | select.language 1512 | emphasize 1513 | edition empty$ 'skip$ 1514 | { ", " * 1515 | edition 1516 | convert.edition 1517 | status.cap 1518 | { "t" } 1519 | { "l" } 1520 | if$ 1521 | change.case$ 1522 | * "~" * bbl.edition * 1523 | } 1524 | if$ 1525 | cap.status.std 1526 | } 1527 | if$ 1528 | } 1529 | 1530 | FUNCTION {format.book.title} 1531 | { title "title" bibinfo.check 1532 | duplicate$ empty$ 'skip$ 1533 | { this.to.prev.status 1534 | this.status.std 1535 | cap.status.std 1536 | select.language 1537 | emphasize 1538 | } 1539 | if$ 1540 | } 1541 | 1542 | 1543 | 1544 | %% journal 1545 | 1546 | FUNCTION {format.journal} 1547 | { journal duplicate$ empty$ 'skip$ 1548 | { this.to.prev.status 1549 | this.status.std 1550 | cap.status.std 1551 | select.language 1552 | emphasize 1553 | } 1554 | if$ 1555 | } 1556 | 1557 | 1558 | 1559 | %% how published 1560 | 1561 | FUNCTION {format.howpublished} 1562 | { howpublished duplicate$ empty$ 'skip$ 1563 | { this.to.prev.status 1564 | this.status.std 1565 | cap.status.std 1566 | } 1567 | if$ 1568 | } 1569 | 1570 | 1571 | 1572 | %% institutions/organization/publishers/school 1573 | 1574 | FUNCTION {format.institution} 1575 | { institution duplicate$ empty$ 'skip$ 1576 | { this.to.prev.status 1577 | this.status.std 1578 | cap.status.std 1579 | } 1580 | if$ 1581 | } 1582 | 1583 | FUNCTION {format.organization} 1584 | { organization duplicate$ empty$ 'skip$ 1585 | { this.to.prev.status 1586 | this.status.std 1587 | cap.status.std 1588 | } 1589 | if$ 1590 | } 1591 | 1592 | FUNCTION {format.address.publisher.date} 1593 | { publisher "publisher" bibinfo.warn format.address.org.or.pub.date } 1594 | 1595 | FUNCTION {format.address.publisher.date.nowarn} 1596 | { publisher "publisher" bibinfo.check format.address.org.or.pub.date } 1597 | 1598 | FUNCTION {format.address.organization.date} 1599 | { organization "organization" bibinfo.check format.address.org.or.pub.date } 1600 | 1601 | FUNCTION {format.school} 1602 | { school duplicate$ empty$ 'skip$ 1603 | { this.to.prev.status 1604 | this.status.std 1605 | cap.status.std 1606 | } 1607 | if$ 1608 | } 1609 | 1610 | 1611 | 1612 | %% volume/number/series/chapter/pages 1613 | 1614 | FUNCTION {format.volume} 1615 | { volume empty.field.to.null.string 1616 | duplicate$ empty$ 'skip$ 1617 | { this.to.prev.status 1618 | this.status.std 1619 | bbl.volume 1620 | status.cap 1621 | { capitalize } 1622 | { skip$ } 1623 | if$ 1624 | swap$ tie.or.space.prefix 1625 | "volume" bibinfo.check 1626 | * * 1627 | cap.status.std 1628 | } 1629 | if$ 1630 | } 1631 | 1632 | FUNCTION {format.number} 1633 | { number empty.field.to.null.string 1634 | duplicate$ empty$ 'skip$ 1635 | { this.to.prev.status 1636 | this.status.std 1637 | status.cap 1638 | { bbl.number capitalize } 1639 | { bbl.number } 1640 | if$ 1641 | swap$ tie.or.space.prefix 1642 | "number" bibinfo.check 1643 | * * 1644 | cap.status.std 1645 | } 1646 | if$ 1647 | } 1648 | 1649 | FUNCTION {format.number.if.use.for.article} 1650 | { is.use.number.for.article 1651 | { format.number } 1652 | { "" } 1653 | if$ 1654 | } 1655 | 1656 | % IEEE does not seem to tie the series so closely with the volume 1657 | % and number as is done in other bibliography styles. Instead the 1658 | % series is treated somewhat like an extension of the title. 1659 | FUNCTION {format.series} 1660 | { series empty$ 1661 | { "" } 1662 | { this.to.prev.status 1663 | this.status.std 1664 | bbl.series " " * 1665 | series "series" bibinfo.check * 1666 | cap.status.std 1667 | } 1668 | if$ 1669 | } 1670 | 1671 | 1672 | FUNCTION {format.chapter} 1673 | { chapter empty$ 1674 | { "" } 1675 | { this.to.prev.status 1676 | this.status.std 1677 | type empty$ 1678 | { bbl.chapter } 1679 | { type "l" change.case$ 1680 | "type" bibinfo.check 1681 | } 1682 | if$ 1683 | chapter tie.or.space.prefix 1684 | "chapter" bibinfo.check 1685 | * * 1686 | cap.status.std 1687 | } 1688 | if$ 1689 | } 1690 | 1691 | 1692 | % The intended use of format.paper is for paper numbers of inproceedings. 1693 | % The paper type can be overridden via the type field. 1694 | % We allow the type to be displayed even if the paper number is absent 1695 | % for things like "postdeadline paper" 1696 | FUNCTION {format.paper} 1697 | { is.use.paper 1698 | { paper empty$ 1699 | { type empty$ 1700 | { "" } 1701 | { this.to.prev.status 1702 | this.status.std 1703 | type "type" bibinfo.check 1704 | cap.status.std 1705 | } 1706 | if$ 1707 | } 1708 | { this.to.prev.status 1709 | this.status.std 1710 | type empty$ 1711 | { bbl.paper } 1712 | { type "type" bibinfo.check } 1713 | if$ 1714 | " " * paper 1715 | "paper" bibinfo.check 1716 | * 1717 | cap.status.std 1718 | } 1719 | if$ 1720 | } 1721 | { "" } 1722 | if$ 1723 | } 1724 | 1725 | 1726 | FUNCTION {format.pages} 1727 | { pages duplicate$ empty$ 'skip$ 1728 | { this.to.prev.status 1729 | this.status.std 1730 | duplicate$ is.multiple.pages 1731 | { 1732 | bbl.pages swap$ 1733 | n.dashify 1734 | } 1735 | { 1736 | bbl.page swap$ 1737 | } 1738 | if$ 1739 | tie.or.space.prefix 1740 | "pages" bibinfo.check 1741 | * * 1742 | cap.status.std 1743 | } 1744 | if$ 1745 | } 1746 | 1747 | 1748 | 1749 | %% technical report number 1750 | 1751 | FUNCTION {format.tech.report.number} 1752 | { number "number" bibinfo.check 1753 | this.to.prev.status 1754 | this.status.std 1755 | cap.status.std 1756 | type duplicate$ empty$ 1757 | { pop$ 1758 | bbl.techrep 1759 | } 1760 | { skip$ } 1761 | if$ 1762 | "type" bibinfo.check 1763 | swap$ duplicate$ empty$ 1764 | { pop$ } 1765 | { tie.or.space.prefix * * } 1766 | if$ 1767 | } 1768 | 1769 | 1770 | 1771 | %% note 1772 | 1773 | FUNCTION {format.note} 1774 | { note empty$ 1775 | { "" } 1776 | { this.to.prev.status 1777 | this.status.std 1778 | punct.period 'this.status.punct := 1779 | note #1 #1 substring$ 1780 | duplicate$ "{" = 1781 | { skip$ } 1782 | { status.cap 1783 | { "u" } 1784 | { "l" } 1785 | if$ 1786 | change.case$ 1787 | } 1788 | if$ 1789 | note #2 global.max$ substring$ * "note" bibinfo.check 1790 | cap.yes 'status.cap := 1791 | } 1792 | if$ 1793 | } 1794 | 1795 | 1796 | 1797 | %% patent 1798 | 1799 | FUNCTION {format.patent.date} 1800 | { this.to.prev.status 1801 | this.status.std 1802 | year empty$ 1803 | { monthfiled duplicate$ empty$ 1804 | { "monthfiled" bibinfo.check pop$ "" } 1805 | { "monthfiled" bibinfo.check } 1806 | if$ 1807 | dayfiled duplicate$ empty$ 1808 | { "dayfiled" bibinfo.check pop$ "" * } 1809 | { "dayfiled" bibinfo.check 1810 | monthfiled empty$ 1811 | { "dayfiled without a monthfiled in " cite$ * warning$ 1812 | * 1813 | } 1814 | { " " swap$ * * } 1815 | if$ 1816 | } 1817 | if$ 1818 | yearfiled empty$ 1819 | { "no year or yearfiled in " cite$ * warning$ } 1820 | { yearfiled "yearfiled" bibinfo.check 1821 | swap$ 1822 | duplicate$ empty$ 1823 | { pop$ } 1824 | { ", " * swap$ * } 1825 | if$ 1826 | } 1827 | if$ 1828 | } 1829 | { month duplicate$ empty$ 1830 | { "month" bibinfo.check pop$ "" } 1831 | { "month" bibinfo.check } 1832 | if$ 1833 | day duplicate$ empty$ 1834 | { "day" bibinfo.check pop$ "" * } 1835 | { "day" bibinfo.check 1836 | month empty$ 1837 | { "day without a month in " cite$ * warning$ 1838 | * 1839 | } 1840 | { " " swap$ * * } 1841 | if$ 1842 | } 1843 | if$ 1844 | year "year" bibinfo.check 1845 | swap$ 1846 | duplicate$ empty$ 1847 | { pop$ } 1848 | { ", " * swap$ * } 1849 | if$ 1850 | } 1851 | if$ 1852 | cap.status.std 1853 | } 1854 | 1855 | FUNCTION {format.patent.nationality.type.number} 1856 | { this.to.prev.status 1857 | this.status.std 1858 | nationality duplicate$ empty$ 1859 | { "nationality" bibinfo.warn pop$ "" } 1860 | { "nationality" bibinfo.check 1861 | duplicate$ "l" change.case$ "united states" = 1862 | { pop$ bbl.patentUS } 1863 | { skip$ } 1864 | if$ 1865 | " " * 1866 | } 1867 | if$ 1868 | type empty$ 1869 | { bbl.patent "type" bibinfo.check } 1870 | { type "type" bibinfo.check } 1871 | if$ 1872 | * 1873 | number duplicate$ empty$ 1874 | { "number" bibinfo.warn pop$ } 1875 | { "number" bibinfo.check 1876 | large.number.separate 1877 | swap$ " " * swap$ * 1878 | } 1879 | if$ 1880 | cap.status.std 1881 | } 1882 | 1883 | 1884 | 1885 | %% standard 1886 | 1887 | FUNCTION {format.organization.institution.standard.type.number} 1888 | { this.to.prev.status 1889 | this.status.std 1890 | organization duplicate$ empty$ 1891 | { pop$ 1892 | institution duplicate$ empty$ 1893 | { "institution" bibinfo.warn } 1894 | { "institution" bibinfo.warn " " * } 1895 | if$ 1896 | } 1897 | { "organization" bibinfo.warn " " * } 1898 | if$ 1899 | type empty$ 1900 | { bbl.standard "type" bibinfo.check } 1901 | { type "type" bibinfo.check } 1902 | if$ 1903 | * 1904 | number duplicate$ empty$ 1905 | { "number" bibinfo.check pop$ } 1906 | { "number" bibinfo.check 1907 | large.number.separate 1908 | swap$ " " * swap$ * 1909 | } 1910 | if$ 1911 | cap.status.std 1912 | } 1913 | 1914 | FUNCTION {format.revision} 1915 | { revision empty$ 1916 | { "" } 1917 | { this.to.prev.status 1918 | this.status.std 1919 | bbl.revision 1920 | revision tie.or.space.prefix 1921 | "revision" bibinfo.check 1922 | * * 1923 | cap.status.std 1924 | } 1925 | if$ 1926 | } 1927 | 1928 | 1929 | %% thesis 1930 | 1931 | FUNCTION {format.master.thesis.type} 1932 | { this.to.prev.status 1933 | this.status.std 1934 | type empty$ 1935 | { 1936 | bbl.mthesis 1937 | } 1938 | { 1939 | type "type" bibinfo.check 1940 | } 1941 | if$ 1942 | cap.status.std 1943 | } 1944 | 1945 | FUNCTION {format.phd.thesis.type} 1946 | { this.to.prev.status 1947 | this.status.std 1948 | type empty$ 1949 | { 1950 | bbl.phdthesis 1951 | } 1952 | { 1953 | type "type" bibinfo.check 1954 | } 1955 | if$ 1956 | cap.status.std 1957 | } 1958 | 1959 | 1960 | 1961 | %% URL 1962 | 1963 | FUNCTION {format.url} 1964 | { } 1965 | 1966 | 1967 | 1968 | 1969 | %%%%%%%%%%%%%%%%%%%% 1970 | %% ENTRY HANDLERS %% 1971 | %%%%%%%%%%%%%%%%%%%% 1972 | 1973 | 1974 | % Note: In many journals, IEEE (or the authors) tend not to show the number 1975 | % for articles, so the display of the number is controlled here by the 1976 | % switch "is.use.number.for.article" 1977 | FUNCTION {article} 1978 | { std.status.using.comma 1979 | start.entry 1980 | if.url.alt.interword.spacing 1981 | format.authors "author" output.warn 1982 | name.or.dash 1983 | format.article.title "title" output.warn 1984 | format.journal "journal" bibinfo.check "journal" output.warn 1985 | format.volume output 1986 | format.number.if.use.for.article output 1987 | format.pages output 1988 | format.date "year" output.warn 1989 | format.note output 1990 | format.url output 1991 | fin.entry 1992 | if.url.std.interword.spacing 1993 | } 1994 | 1995 | FUNCTION {book} 1996 | { std.status.using.comma 1997 | start.entry 1998 | if.url.alt.interword.spacing 1999 | author empty$ 2000 | { format.editors "author and editor" output.warn } 2001 | { format.authors output.nonnull } 2002 | if$ 2003 | name.or.dash 2004 | format.book.title.edition output 2005 | format.series output 2006 | author empty$ 2007 | { skip$ } 2008 | { format.editors output } 2009 | if$ 2010 | format.address.publisher.date output 2011 | format.volume output 2012 | format.number output 2013 | format.note output 2014 | format.url output 2015 | fin.entry 2016 | if.url.std.interword.spacing 2017 | } 2018 | 2019 | FUNCTION {booklet} 2020 | { std.status.using.comma 2021 | start.entry 2022 | if.url.alt.interword.spacing 2023 | format.authors output 2024 | name.or.dash 2025 | format.article.title "title" output.warn 2026 | format.howpublished "howpublished" bibinfo.check output 2027 | format.organization "organization" bibinfo.check output 2028 | format.address "address" bibinfo.check output 2029 | format.date output 2030 | format.note output 2031 | format.url output 2032 | fin.entry 2033 | if.url.std.interword.spacing 2034 | } 2035 | 2036 | FUNCTION {electronic} 2037 | { std.status.using.period 2038 | start.entry 2039 | if.url.alt.interword.spacing 2040 | format.authors output 2041 | name.or.dash 2042 | format.date.electronic output 2043 | format.article.title.electronic output 2044 | format.howpublished "howpublished" bibinfo.check output 2045 | format.organization "organization" bibinfo.check output 2046 | format.address "address" bibinfo.check output 2047 | format.note output 2048 | format.url output 2049 | fin.entry 2050 | empty.entry.warn 2051 | if.url.std.interword.spacing 2052 | } 2053 | 2054 | FUNCTION {inbook} 2055 | { std.status.using.comma 2056 | start.entry 2057 | if.url.alt.interword.spacing 2058 | author empty$ 2059 | { format.editors "author and editor" output.warn } 2060 | { format.authors output.nonnull } 2061 | if$ 2062 | name.or.dash 2063 | format.book.title.edition output 2064 | format.series output 2065 | format.address.publisher.date output 2066 | format.volume output 2067 | format.number output 2068 | format.chapter output 2069 | format.pages output 2070 | format.note output 2071 | format.url output 2072 | fin.entry 2073 | if.url.std.interword.spacing 2074 | } 2075 | 2076 | FUNCTION {incollection} 2077 | { std.status.using.comma 2078 | start.entry 2079 | if.url.alt.interword.spacing 2080 | format.authors "author" output.warn 2081 | name.or.dash 2082 | format.article.title "title" output.warn 2083 | format.in.booktitle.edition "booktitle" output.warn 2084 | format.series output 2085 | format.editors output 2086 | format.address.publisher.date.nowarn output 2087 | format.volume output 2088 | format.number output 2089 | format.chapter output 2090 | format.pages output 2091 | format.note output 2092 | format.url output 2093 | fin.entry 2094 | if.url.std.interword.spacing 2095 | } 2096 | 2097 | FUNCTION {inproceedings} 2098 | { std.status.using.comma 2099 | start.entry 2100 | if.url.alt.interword.spacing 2101 | format.authors "author" output.warn 2102 | name.or.dash 2103 | format.article.title "title" output.warn 2104 | format.in.booktitle "booktitle" output.warn 2105 | format.series output 2106 | format.editors output 2107 | format.volume output 2108 | format.number output 2109 | publisher empty$ 2110 | { format.address.organization.date output } 2111 | { format.organization "organization" bibinfo.check output 2112 | format.address.publisher.date output 2113 | } 2114 | if$ 2115 | format.paper output 2116 | format.pages output 2117 | format.note output 2118 | format.url output 2119 | fin.entry 2120 | if.url.std.interword.spacing 2121 | } 2122 | 2123 | FUNCTION {manual} 2124 | { std.status.using.comma 2125 | start.entry 2126 | if.url.alt.interword.spacing 2127 | format.authors output 2128 | name.or.dash 2129 | format.book.title.edition "title" output.warn 2130 | format.howpublished "howpublished" bibinfo.check output 2131 | format.organization "organization" bibinfo.check output 2132 | format.address "address" bibinfo.check output 2133 | format.date output 2134 | format.note output 2135 | format.url output 2136 | fin.entry 2137 | if.url.std.interword.spacing 2138 | } 2139 | 2140 | FUNCTION {mastersthesis} 2141 | { std.status.using.comma 2142 | start.entry 2143 | if.url.alt.interword.spacing 2144 | format.authors "author" output.warn 2145 | name.or.dash 2146 | format.article.title "title" output.warn 2147 | format.master.thesis.type output.nonnull 2148 | format.school "school" bibinfo.warn output 2149 | format.address "address" bibinfo.check output 2150 | format.date "year" output.warn 2151 | format.note output 2152 | format.url output 2153 | fin.entry 2154 | if.url.std.interword.spacing 2155 | } 2156 | 2157 | FUNCTION {misc} 2158 | { std.status.using.comma 2159 | start.entry 2160 | if.url.alt.interword.spacing 2161 | format.authors output 2162 | name.or.dash 2163 | format.article.title output 2164 | format.howpublished "howpublished" bibinfo.check output 2165 | format.organization "organization" bibinfo.check output 2166 | format.address "address" bibinfo.check output 2167 | format.pages output 2168 | format.date output 2169 | format.note output 2170 | format.url output 2171 | fin.entry 2172 | empty.entry.warn 2173 | if.url.std.interword.spacing 2174 | } 2175 | 2176 | FUNCTION {patent} 2177 | { std.status.using.comma 2178 | start.entry 2179 | if.url.alt.interword.spacing 2180 | format.authors output 2181 | name.or.dash 2182 | format.article.title output 2183 | format.patent.nationality.type.number output 2184 | format.patent.date output 2185 | format.note output 2186 | format.url output 2187 | fin.entry 2188 | empty.entry.warn 2189 | if.url.std.interword.spacing 2190 | } 2191 | 2192 | FUNCTION {periodical} 2193 | { std.status.using.comma 2194 | start.entry 2195 | if.url.alt.interword.spacing 2196 | format.editors output 2197 | name.or.dash 2198 | format.book.title "title" output.warn 2199 | format.series output 2200 | format.volume output 2201 | format.number output 2202 | format.organization "organization" bibinfo.check output 2203 | format.date "year" output.warn 2204 | format.note output 2205 | format.url output 2206 | fin.entry 2207 | if.url.std.interword.spacing 2208 | } 2209 | 2210 | FUNCTION {phdthesis} 2211 | { std.status.using.comma 2212 | start.entry 2213 | if.url.alt.interword.spacing 2214 | format.authors "author" output.warn 2215 | name.or.dash 2216 | format.article.title "title" output.warn 2217 | format.phd.thesis.type output.nonnull 2218 | format.school "school" bibinfo.warn output 2219 | format.address "address" bibinfo.check output 2220 | format.date "year" output.warn 2221 | format.note output 2222 | format.url output 2223 | fin.entry 2224 | if.url.std.interword.spacing 2225 | } 2226 | 2227 | FUNCTION {proceedings} 2228 | { std.status.using.comma 2229 | start.entry 2230 | if.url.alt.interword.spacing 2231 | format.editors output 2232 | name.or.dash 2233 | format.book.title "title" output.warn 2234 | format.series output 2235 | format.volume output 2236 | format.number output 2237 | publisher empty$ 2238 | { format.address.organization.date output } 2239 | { format.organization "organization" bibinfo.check output 2240 | format.address.publisher.date output 2241 | } 2242 | if$ 2243 | format.note output 2244 | format.url output 2245 | fin.entry 2246 | if.url.std.interword.spacing 2247 | } 2248 | 2249 | FUNCTION {standard} 2250 | { std.status.using.comma 2251 | start.entry 2252 | if.url.alt.interword.spacing 2253 | format.authors output 2254 | name.or.dash 2255 | format.book.title "title" output.warn 2256 | format.howpublished "howpublished" bibinfo.check output 2257 | format.organization.institution.standard.type.number output 2258 | format.revision output 2259 | format.date output 2260 | format.note output 2261 | format.url output 2262 | fin.entry 2263 | if.url.std.interword.spacing 2264 | } 2265 | 2266 | FUNCTION {techreport} 2267 | { std.status.using.comma 2268 | start.entry 2269 | if.url.alt.interword.spacing 2270 | format.authors "author" output.warn 2271 | name.or.dash 2272 | format.article.title "title" output.warn 2273 | format.howpublished "howpublished" bibinfo.check output 2274 | format.institution "institution" bibinfo.warn output 2275 | format.address "address" bibinfo.check output 2276 | format.tech.report.number output.nonnull 2277 | format.date "year" output.warn 2278 | format.note output 2279 | format.url output 2280 | fin.entry 2281 | if.url.std.interword.spacing 2282 | } 2283 | 2284 | FUNCTION {unpublished} 2285 | { std.status.using.comma 2286 | start.entry 2287 | if.url.alt.interword.spacing 2288 | format.authors "author" output.warn 2289 | name.or.dash 2290 | format.article.title "title" output.warn 2291 | format.date output 2292 | format.note "note" output.warn 2293 | format.url output 2294 | fin.entry 2295 | if.url.std.interword.spacing 2296 | } 2297 | 2298 | 2299 | % The special entry type which provides the user interface to the 2300 | % BST controls 2301 | FUNCTION {IEEEtranBSTCTL} 2302 | { is.print.banners.to.terminal 2303 | { "** IEEEtran BST control entry " quote$ * cite$ * quote$ * " detected." * 2304 | top$ 2305 | } 2306 | { skip$ } 2307 | if$ 2308 | CTLuse_article_number 2309 | empty$ 2310 | { skip$ } 2311 | { CTLuse_article_number 2312 | yes.no.to.int 2313 | 'is.use.number.for.article := 2314 | } 2315 | if$ 2316 | CTLuse_paper 2317 | empty$ 2318 | { skip$ } 2319 | { CTLuse_paper 2320 | yes.no.to.int 2321 | 'is.use.paper := 2322 | } 2323 | if$ 2324 | CTLuse_forced_etal 2325 | empty$ 2326 | { skip$ } 2327 | { CTLuse_forced_etal 2328 | yes.no.to.int 2329 | 'is.forced.et.al := 2330 | } 2331 | if$ 2332 | CTLmax_names_forced_etal 2333 | empty$ 2334 | { skip$ } 2335 | { CTLmax_names_forced_etal 2336 | string.to.integer 2337 | 'max.num.names.before.forced.et.al := 2338 | } 2339 | if$ 2340 | CTLnames_show_etal 2341 | empty$ 2342 | { skip$ } 2343 | { CTLnames_show_etal 2344 | string.to.integer 2345 | 'num.names.shown.with.forced.et.al := 2346 | } 2347 | if$ 2348 | CTLuse_alt_spacing 2349 | empty$ 2350 | { skip$ } 2351 | { CTLuse_alt_spacing 2352 | yes.no.to.int 2353 | 'is.use.alt.interword.spacing := 2354 | } 2355 | if$ 2356 | CTLalt_stretch_factor 2357 | empty$ 2358 | { skip$ } 2359 | { CTLalt_stretch_factor 2360 | 'ALTinterwordstretchfactor := 2361 | "\renewcommand{\BIBentryALTinterwordstretchfactor}{" 2362 | ALTinterwordstretchfactor * "}" * 2363 | write$ newline$ 2364 | } 2365 | if$ 2366 | CTLdash_repeated_names 2367 | empty$ 2368 | { skip$ } 2369 | { CTLdash_repeated_names 2370 | yes.no.to.int 2371 | 'is.dash.repeated.names := 2372 | } 2373 | if$ 2374 | CTLname_format_string 2375 | empty$ 2376 | { skip$ } 2377 | { CTLname_format_string 2378 | 'name.format.string := 2379 | } 2380 | if$ 2381 | CTLname_latex_cmd 2382 | empty$ 2383 | { skip$ } 2384 | { CTLname_latex_cmd 2385 | 'name.latex.cmd := 2386 | } 2387 | if$ 2388 | CTLname_url_prefix 2389 | missing$ 2390 | { skip$ } 2391 | { CTLname_url_prefix 2392 | 'name.url.prefix := 2393 | } 2394 | if$ 2395 | 2396 | 2397 | num.names.shown.with.forced.et.al max.num.names.before.forced.et.al > 2398 | { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$ 2399 | max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al := 2400 | } 2401 | { skip$ } 2402 | if$ 2403 | } 2404 | 2405 | 2406 | %%%%%%%%%%%%%%%%%%% 2407 | %% ENTRY ALIASES %% 2408 | %%%%%%%%%%%%%%%%%%% 2409 | FUNCTION {conference}{inproceedings} 2410 | FUNCTION {online}{electronic} 2411 | FUNCTION {internet}{electronic} 2412 | FUNCTION {webpage}{electronic} 2413 | FUNCTION {www}{electronic} 2414 | FUNCTION {default.type}{misc} 2415 | 2416 | 2417 | 2418 | %%%%%%%%%%%%%%%%%% 2419 | %% MAIN PROGRAM %% 2420 | %%%%%%%%%%%%%%%%%% 2421 | 2422 | READ 2423 | 2424 | EXECUTE {initialize.controls} 2425 | EXECUTE {initialize.status.constants} 2426 | EXECUTE {banner.message} 2427 | 2428 | 2429 | 2430 | % BEGIN sort code based on unsrtnat.bst 2431 | FUNCTION {sortify} 2432 | { purify$ 2433 | "l" change.case$ 2434 | } 2435 | 2436 | INTEGERS { len } 2437 | 2438 | FUNCTION {chop.word} 2439 | { 's := 2440 | 'len := 2441 | s #1 len substring$ = 2442 | { s len #1 + global.max$ substring$ } 2443 | { s } 2444 | if$ 2445 | } 2446 | 2447 | STRINGS { last.label next.extra } 2448 | 2449 | INTEGERS { last.extra.num } 2450 | 2451 | FUNCTION {format.lab.names} 2452 | { 's := 2453 | s #1 "{vv~}{ll}" format.name$ 2454 | s num.names$ duplicate$ 2455 | #2 > 2456 | { pop$ " et~al." * } 2457 | { #2 < 2458 | 'skip$ 2459 | { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = 2460 | { " et~al." * } 2461 | { " and " * s #2 "{vv~}{ll}" format.name$ * } 2462 | if$ 2463 | } 2464 | if$ 2465 | } 2466 | if$ 2467 | } 2468 | 2469 | FUNCTION {author.key.label} 2470 | { author empty$ 2471 | { key empty$ 2472 | { cite$ #1 #3 substring$ } 2473 | { key } 2474 | if$ 2475 | } 2476 | { author format.lab.names } 2477 | if$ 2478 | } 2479 | 2480 | FUNCTION {author.editor.key.label} 2481 | { author empty$ 2482 | { editor empty$ 2483 | { key empty$ 2484 | { cite$ #1 #3 substring$ } 2485 | { key } 2486 | if$ 2487 | } 2488 | { editor format.lab.names } 2489 | if$ 2490 | } 2491 | { author format.lab.names } 2492 | if$ 2493 | } 2494 | 2495 | FUNCTION {author.key.organization.label} 2496 | { author empty$ 2497 | { key empty$ 2498 | { organization empty$ 2499 | { cite$ #1 #3 substring$ } 2500 | { "The " #4 organization chop.word #3 text.prefix$ } 2501 | if$ 2502 | } 2503 | { key } 2504 | if$ 2505 | } 2506 | { author format.lab.names } 2507 | if$ 2508 | } 2509 | 2510 | FUNCTION {author.key.organization.institution.label} 2511 | { author empty$ 2512 | { key empty$ 2513 | { organization empty$ 2514 | { institution empty$ 2515 | { cite$ #1 #3 substring$ } 2516 | { "The " #4 institution chop.word #3 text.prefix$ } 2517 | if$ 2518 | } 2519 | { "The " #4 organization chop.word #3 text.prefix$ } 2520 | if$ 2521 | } 2522 | { key } 2523 | if$ 2524 | } 2525 | { author format.lab.names } 2526 | if$ 2527 | } 2528 | 2529 | FUNCTION {editor.key.organization.label} 2530 | { editor empty$ 2531 | { key empty$ 2532 | { organization empty$ 2533 | { cite$ #1 #3 substring$ } 2534 | { "The " #4 organization chop.word #3 text.prefix$ } 2535 | if$ 2536 | } 2537 | { key } 2538 | if$ 2539 | } 2540 | { editor format.lab.names } 2541 | if$ 2542 | } 2543 | 2544 | FUNCTION {calc.label} 2545 | { type$ "book" = 2546 | type$ "inbook" = 2547 | or 2548 | { author.editor.key.label } 2549 | { type$ "proceedings" = 2550 | type$ "periodical" = 2551 | or 2552 | { editor.key.organization.label } 2553 | { type$ "manual" = 2554 | type$ "electronic" = 2555 | type$ "misc" = 2556 | or or 2557 | { author.key.organization.label } 2558 | { type$ "standard" = 2559 | { author.key.organization.institution.label } 2560 | { author.key.label } 2561 | if$ 2562 | } 2563 | if$ 2564 | } 2565 | if$ 2566 | } 2567 | if$ 2568 | duplicate$ 2569 | 'short.list := 2570 | "(" 2571 | * 2572 | type$ "patent" = 2573 | { year empty$ 2574 | { yearfiled } 2575 | { year } 2576 | if$ 2577 | } 2578 | { year } 2579 | if$ 2580 | duplicate$ 2581 | empty$ 2582 | short.list key empty.field.to.null.string = or 2583 | { pop$ "" } 2584 | { skip$ } 2585 | if$ 2586 | * 2587 | 'label := 2588 | } 2589 | 2590 | 2591 | INTEGERS { seq.num } 2592 | 2593 | FUNCTION {init.seq} 2594 | { #0 'seq.num :=} 2595 | 2596 | 2597 | FUNCTION {int.to.fix} 2598 | { "000000000" swap$ int.to.str$ * 2599 | #-1 #10 substring$ 2600 | } 2601 | 2602 | 2603 | FUNCTION {presort} 2604 | { type$ "ieeetranbstctl" = 2605 | { key empty$ 2606 | { "_" } 2607 | { key sortify } 2608 | if$ 2609 | " " 2610 | * 2611 | seq.num int.to.fix 2612 | } 2613 | { calc.label 2614 | label sortify 2615 | " " 2616 | * 2617 | seq.num #1 + 'seq.num := 2618 | seq.num int.to.fix 2619 | } 2620 | if$ 2621 | 'sort.label := 2622 | sort.label * 2623 | #1 entry.max$ substring$ 2624 | 'sort.key$ := 2625 | } 2626 | 2627 | 2628 | FUNCTION {initialize.longest.label} 2629 | { "" 'longest.label := 2630 | #0 int.to.chr$ 'last.label := 2631 | "" 'next.extra := 2632 | #0 'longest.label.width := 2633 | #0 'last.extra.num := 2634 | #0 'number.label := 2635 | } 2636 | 2637 | FUNCTION {forward.pass} 2638 | { type$ "ieeetranbstctl" = 2639 | { skip$ } 2640 | { last.label label = 2641 | { last.extra.num #1 + 'last.extra.num := 2642 | last.extra.num int.to.chr$ 'extra.label := 2643 | } 2644 | { "a" chr.to.int$ 'last.extra.num := 2645 | "" 'extra.label := 2646 | label 'last.label := 2647 | } 2648 | if$ 2649 | number.label #1 + 'number.label := 2650 | } 2651 | if$ 2652 | } 2653 | 2654 | FUNCTION {reverse.pass} 2655 | { type$ "ieeetranbstctl" = 2656 | { skip$ } 2657 | { next.extra "b" = 2658 | { "a" 'extra.label := } 2659 | { skip$ } 2660 | if$ 2661 | extra.label 'next.extra := 2662 | extra.label 2663 | duplicate$ empty$ 2664 | { skip$ } 2665 | { "{\natexlab{" swap$ * "}}" * } 2666 | if$ 2667 | 'extra.label := 2668 | label extra.label * 'label := 2669 | } 2670 | if$ 2671 | } 2672 | 2673 | FUNCTION {bib.sort.order} 2674 | { sort.label 'sort.key$ := 2675 | } 2676 | % END sort code based on unsrtnat.bst 2677 | 2678 | 2679 | 2680 | EXECUTE {init.seq} 2681 | 2682 | ITERATE {presort} 2683 | 2684 | SORT 2685 | 2686 | EXECUTE {initialize.longest.label} 2687 | 2688 | ITERATE {forward.pass} 2689 | REVERSE {reverse.pass} 2690 | 2691 | ITERATE {bib.sort.order} 2692 | 2693 | SORT 2694 | 2695 | EXECUTE {begin.bib} 2696 | ITERATE {call.type$} 2697 | EXECUTE {end.bib} 2698 | 2699 | EXECUTE{completed.message} 2700 | 2701 | 2702 | %% That's all folks, mds. 2703 | 2704 | -------------------------------------------------------------------------------- /IEEEtranN.bst: -------------------------------------------------------------------------------- 1 | %% 2 | %% IEEEtranN.bst 3 | %% BibTeX Bibliography Style file 4 | %% Natbib version of IEEEtran.bst 5 | %% *** Not for normal IEEE work *** 6 | %% Version 1.13 (2008/09/30) 7 | %% 8 | %% Copyright (c) 2003-2008 Michael Shell 9 | %% 10 | %% Original starting code base and algorithms obtained from the output of 11 | %% Patrick W. Daly's makebst package as well as from prior versions of 12 | %% IEEE BibTeX styles: 13 | %% 14 | %% 1. Howard Trickey and Oren Patashnik's ieeetr.bst (1985/1988) 15 | %% 2. Silvano Balemi and Richard H. Roy's IEEEbib.bst (1993) 16 | %% 17 | %% Added sorting and natbib code is from Patrick W Daly's unsrtnat.bst 18 | %% 19 | %% 20 | %% Support sites: 21 | %% http://www.michaelshell.org/tex/ieeetran/ 22 | %% http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/ 23 | %% and/or 24 | %% http://www.ieee.org/ 25 | %% 26 | %% For use with BibTeX version 0.99a or later 27 | %% 28 | %% This is a natbib compatible citation style. 29 | %% 30 | %%************************************************************************* 31 | %% Legal Notice: 32 | %% This code is offered as-is without any warranty either expressed or 33 | %% implied; without even the implied warranty of MERCHANTABILITY or 34 | %% FITNESS FOR A PARTICULAR PURPOSE! 35 | %% User assumes all risk. 36 | %% In no event shall IEEE or any contributor to this code be liable for 37 | %% any damages or losses, including, but not limited to, incidental, 38 | %% consequential, or any other damages, resulting from the use or misuse 39 | %% of any information contained here. 40 | %% 41 | %% All comments are the opinions of their respective authors and are not 42 | %% necessarily endorsed by the IEEE. 43 | %% 44 | %% This work is distributed under the LaTeX Project Public License (LPPL) 45 | %% ( http://www.latex-project.org/ ) version 1.3, and may be freely used, 46 | %% distributed and modified. A copy of the LPPL, version 1.3, is included 47 | %% in the base LaTeX documentation of all distributions of LaTeX released 48 | %% 2003/12/01 or later. 49 | %% Retain all contribution notices and credits. 50 | %% ** Modified files should be clearly indicated as such, including ** 51 | %% ** renaming them and changing author support contact information. ** 52 | %% 53 | %% File list of work: IEEEabrv.bib, IEEEfull.bib, IEEEexample.bib, 54 | %% IEEEtran.bst, IEEEtranS.bst, IEEEtranSA.bst, 55 | %% IEEEtranN.bst, IEEEtranSN.bst, IEEEtran_bst_HOWTO.pdf 56 | %%************************************************************************* 57 | % 58 | % 59 | % Changelog: 60 | % 61 | % 1.12 (2007/01/11) Initial release 62 | % 63 | % 1.13 (2008/09/30) 64 | % 1. Fixed bug with edition number to ordinal conversion. Thanks to 65 | % Michael Roland for reporting this and correcting the algorithm. 66 | 67 | 68 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 69 | %% DEFAULTS FOR THE CONTROLS OF THE BST STYLE %% 70 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 71 | 72 | % These are the defaults for the user adjustable controls. The values used 73 | % here can be overridden by the user via IEEEtranBSTCTL entry type. 74 | 75 | % NOTE: The recommended LaTeX command to invoke a control entry type is: 76 | % 77 | %\makeatletter 78 | %\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}} 79 | %\def\@bstctlcite[#1]#2{\@bsphack 80 | % \@for\@citeb:=#2\do{% 81 | % \edef\@citeb{\expandafter\@firstofone\@citeb}% 82 | % \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}% 83 | % \@esphack} 84 | %\makeatother 85 | % 86 | % It is called at the start of the document, before the first \cite, like: 87 | % \bstctlcite{IEEEexample:BSTcontrol} 88 | % 89 | % IEEEtran.cls V1.6 and later does provide this command. 90 | 91 | 92 | 93 | % #0 turns off the display of the number for articles. 94 | % #1 enables 95 | FUNCTION {default.is.use.number.for.article} { #1 } 96 | 97 | 98 | % #0 turns off the display of the paper and type fields in @inproceedings. 99 | % #1 enables 100 | FUNCTION {default.is.use.paper} { #1 } 101 | 102 | 103 | % #0 turns off the forced use of "et al." 104 | % #1 enables 105 | FUNCTION {default.is.forced.et.al} { #0 } 106 | 107 | % The maximum number of names that can be present beyond which an "et al." 108 | % usage is forced. Be sure that num.names.shown.with.forced.et.al (below) 109 | % is not greater than this value! 110 | % Note: There are many instances of references in IEEE journals which have 111 | % a very large number of authors as well as instances in which "et al." is 112 | % used profusely. 113 | FUNCTION {default.max.num.names.before.forced.et.al} { #10 } 114 | 115 | % The number of names that will be shown with a forced "et al.". 116 | % Must be less than or equal to max.num.names.before.forced.et.al 117 | FUNCTION {default.num.names.shown.with.forced.et.al} { #1 } 118 | 119 | 120 | % #0 turns off the alternate interword spacing for entries with URLs. 121 | % #1 enables 122 | FUNCTION {default.is.use.alt.interword.spacing} { #1 } 123 | 124 | % If alternate interword spacing for entries with URLs is enabled, this is 125 | % the interword spacing stretch factor that will be used. For example, the 126 | % default "4" here means that the interword spacing in entries with URLs can 127 | % stretch to four times normal. Does not have to be an integer. Note that 128 | % the value specified here can be overridden by the user in their LaTeX 129 | % code via a command such as: 130 | % "\providecommand\BIBentryALTinterwordstretchfactor{1.5}" in addition to 131 | % that via the IEEEtranBSTCTL entry type. 132 | FUNCTION {default.ALTinterwordstretchfactor} { "4" } 133 | 134 | 135 | % #0 turns off the "dashification" of repeated (i.e., identical to those 136 | % of the previous entry) names. IEEE normally does this. 137 | % #1 enables 138 | FUNCTION {default.is.dash.repeated.names} { #1 } 139 | 140 | 141 | % The default name format control string. 142 | FUNCTION {default.name.format.string}{ "{f.~}{vv~}{ll}{, jj}" } 143 | 144 | 145 | % The default LaTeX font command for the names. 146 | FUNCTION {default.name.latex.cmd}{ "" } 147 | 148 | 149 | % The default URL prefix. 150 | FUNCTION {default.name.url.prefix}{ "[Online]. Available:" } 151 | 152 | 153 | % Other controls that cannot be accessed via IEEEtranBSTCTL entry type. 154 | 155 | % #0 turns off the terminal startup banner/completed message so as to 156 | % operate more quietly. 157 | % #1 enables 158 | FUNCTION {is.print.banners.to.terminal} { #1 } 159 | 160 | 161 | 162 | 163 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 164 | %% FILE VERSION AND BANNER %% 165 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 166 | 167 | FUNCTION{bst.file.version} { "1.13" } 168 | FUNCTION{bst.file.date} { "2008/09/30" } 169 | FUNCTION{bst.file.website} { "http://www.michaelshell.org/tex/ieeetran/bibtex/" } 170 | 171 | FUNCTION {banner.message} 172 | { is.print.banners.to.terminal 173 | { "-- IEEEtranN.bst version" " " * bst.file.version * 174 | " (" * bst.file.date * ") " * "by Michael Shell." * 175 | top$ 176 | "-- " bst.file.website * 177 | top$ 178 | "-- See the " quote$ * "IEEEtran_bst_HOWTO.pdf" * quote$ * " manual for usage information." * 179 | top$ 180 | "** Natbib version - not for normal IEEE work." 181 | top$ 182 | } 183 | { skip$ } 184 | if$ 185 | } 186 | 187 | FUNCTION {completed.message} 188 | { is.print.banners.to.terminal 189 | { "" 190 | top$ 191 | "Done." 192 | top$ 193 | } 194 | { skip$ } 195 | if$ 196 | } 197 | 198 | 199 | 200 | 201 | %%%%%%%%%%%%%%%%%%%%%% 202 | %% STRING CONSTANTS %% 203 | %%%%%%%%%%%%%%%%%%%%%% 204 | 205 | FUNCTION {bbl.and}{ "and" } 206 | FUNCTION {bbl.etal}{ "et~al." } 207 | FUNCTION {bbl.editors}{ "eds." } 208 | FUNCTION {bbl.editor}{ "ed." } 209 | FUNCTION {bbl.edition}{ "ed." } 210 | FUNCTION {bbl.volume}{ "vol." } 211 | FUNCTION {bbl.of}{ "of" } 212 | FUNCTION {bbl.number}{ "no." } 213 | FUNCTION {bbl.in}{ "in" } 214 | FUNCTION {bbl.pages}{ "pp." } 215 | FUNCTION {bbl.page}{ "p." } 216 | FUNCTION {bbl.chapter}{ "ch." } 217 | FUNCTION {bbl.paper}{ "paper" } 218 | FUNCTION {bbl.part}{ "pt." } 219 | FUNCTION {bbl.patent}{ "Patent" } 220 | FUNCTION {bbl.patentUS}{ "U.S." } 221 | FUNCTION {bbl.revision}{ "Rev." } 222 | FUNCTION {bbl.series}{ "ser." } 223 | FUNCTION {bbl.standard}{ "Std." } 224 | FUNCTION {bbl.techrep}{ "Tech. Rep." } 225 | FUNCTION {bbl.mthesis}{ "Master's thesis" } 226 | FUNCTION {bbl.phdthesis}{ "Ph.D. dissertation" } 227 | FUNCTION {bbl.st}{ "st" } 228 | FUNCTION {bbl.nd}{ "nd" } 229 | FUNCTION {bbl.rd}{ "rd" } 230 | FUNCTION {bbl.th}{ "th" } 231 | 232 | 233 | % This is the LaTeX spacer that is used when a larger than normal space 234 | % is called for (such as just before the address:publisher). 235 | FUNCTION {large.space} { "\hskip 1em plus 0.5em minus 0.4em\relax " } 236 | 237 | % The LaTeX code for dashes that are used to represent repeated names. 238 | % Note: Some older IEEE journals used something like 239 | % "\rule{0.275in}{0.5pt}\," which is fairly thick and runs right along 240 | % the baseline. However, IEEE now uses a thinner, above baseline, 241 | % six dash long sequence. 242 | FUNCTION {repeated.name.dashes} { "------" } 243 | 244 | 245 | 246 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 247 | %% PREDEFINED STRING MACROS %% 248 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 249 | 250 | MACRO {jan} {"Jan."} 251 | MACRO {feb} {"Feb."} 252 | MACRO {mar} {"Mar."} 253 | MACRO {apr} {"Apr."} 254 | MACRO {may} {"May"} 255 | MACRO {jun} {"Jun."} 256 | MACRO {jul} {"Jul."} 257 | MACRO {aug} {"Aug."} 258 | MACRO {sep} {"Sep."} 259 | MACRO {oct} {"Oct."} 260 | MACRO {nov} {"Nov."} 261 | MACRO {dec} {"Dec."} 262 | 263 | 264 | 265 | %%%%%%%%%%%%%%%%%% 266 | %% ENTRY FIELDS %% 267 | %%%%%%%%%%%%%%%%%% 268 | 269 | ENTRY 270 | { address 271 | assignee 272 | author 273 | booktitle 274 | chapter 275 | day 276 | dayfiled 277 | edition 278 | editor 279 | howpublished 280 | institution 281 | intype 282 | journal 283 | key 284 | language 285 | month 286 | monthfiled 287 | nationality 288 | note 289 | number 290 | organization 291 | pages 292 | paper 293 | publisher 294 | school 295 | series 296 | revision 297 | title 298 | type 299 | url 300 | volume 301 | year 302 | yearfiled 303 | CTLuse_article_number 304 | CTLuse_paper 305 | CTLuse_forced_etal 306 | CTLmax_names_forced_etal 307 | CTLnames_show_etal 308 | CTLuse_alt_spacing 309 | CTLalt_stretch_factor 310 | CTLdash_repeated_names 311 | CTLname_format_string 312 | CTLname_latex_cmd 313 | CTLname_url_prefix 314 | } 315 | {} 316 | { label extra.label sort.label short.list} 317 | 318 | 319 | 320 | 321 | %%%%%%%%%%%%%%%%%%%%%%% 322 | %% INTEGER VARIABLES %% 323 | %%%%%%%%%%%%%%%%%%%%%%% 324 | 325 | INTEGERS { prev.status.punct this.status.punct punct.std 326 | punct.no punct.comma punct.period 327 | prev.status.space this.status.space space.std 328 | space.no space.normal space.large 329 | prev.status.quote this.status.quote quote.std 330 | quote.no quote.close 331 | prev.status.nline this.status.nline nline.std 332 | nline.no nline.newblock 333 | status.cap cap.std 334 | cap.no cap.yes} 335 | 336 | INTEGERS { longest.label.width multiresult nameptr namesleft number.label numnames } 337 | 338 | INTEGERS { is.use.number.for.article 339 | is.use.paper 340 | is.forced.et.al 341 | max.num.names.before.forced.et.al 342 | num.names.shown.with.forced.et.al 343 | is.use.alt.interword.spacing 344 | is.dash.repeated.names} 345 | 346 | 347 | %%%%%%%%%%%%%%%%%%%%%% 348 | %% STRING VARIABLES %% 349 | %%%%%%%%%%%%%%%%%%%%%% 350 | 351 | STRINGS { bibinfo 352 | longest.label 353 | oldname 354 | s 355 | t 356 | ALTinterwordstretchfactor 357 | name.format.string 358 | name.latex.cmd 359 | name.url.prefix} 360 | 361 | 362 | 363 | 364 | %%%%%%%%%%%%%%%%%%%%%%%%% 365 | %% LOW LEVEL FUNCTIONS %% 366 | %%%%%%%%%%%%%%%%%%%%%%%%% 367 | 368 | FUNCTION {initialize.controls} 369 | { default.is.use.number.for.article 'is.use.number.for.article := 370 | default.is.use.paper 'is.use.paper := 371 | default.is.forced.et.al 'is.forced.et.al := 372 | default.max.num.names.before.forced.et.al 'max.num.names.before.forced.et.al := 373 | default.num.names.shown.with.forced.et.al 'num.names.shown.with.forced.et.al := 374 | default.is.use.alt.interword.spacing 'is.use.alt.interword.spacing := 375 | default.is.dash.repeated.names 'is.dash.repeated.names := 376 | default.ALTinterwordstretchfactor 'ALTinterwordstretchfactor := 377 | default.name.format.string 'name.format.string := 378 | default.name.latex.cmd 'name.latex.cmd := 379 | default.name.url.prefix 'name.url.prefix := 380 | } 381 | 382 | 383 | % This IEEEtran.bst features a very powerful and flexible mechanism for 384 | % controlling the capitalization, punctuation, spacing, quotation, and 385 | % newlines of the formatted entry fields. (Note: IEEEtran.bst does not need 386 | % or use the newline/newblock feature, but it has been implemented for 387 | % possible future use.) The output states of IEEEtran.bst consist of 388 | % multiple independent attributes and, as such, can be thought of as being 389 | % vectors, rather than the simple scalar values ("before.all", 390 | % "mid.sentence", etc.) used in most other .bst files. 391 | % 392 | % The more flexible and complex design used here was motivated in part by 393 | % IEEE's rather unusual bibliography style. For example, IEEE ends the 394 | % previous field item with a period and large space prior to the publisher 395 | % address; the @electronic entry types use periods as inter-item punctuation 396 | % rather than the commas used by the other entry types; and URLs are never 397 | % followed by periods even though they are the last item in the entry. 398 | % Although it is possible to accommodate these features with the conventional 399 | % output state system, the seemingly endless exceptions make for convoluted, 400 | % unreliable and difficult to maintain code. 401 | % 402 | % IEEEtran.bst's output state system can be easily understood via a simple 403 | % illustration of two most recently formatted entry fields (on the stack): 404 | % 405 | % CURRENT_ITEM 406 | % "PREVIOUS_ITEM 407 | % 408 | % which, in this example, is to eventually appear in the bibliography as: 409 | % 410 | % "PREVIOUS_ITEM," CURRENT_ITEM 411 | % 412 | % It is the job of the output routine to take the previous item off of the 413 | % stack (while leaving the current item at the top of the stack), apply its 414 | % trailing punctuation (including closing quote marks) and spacing, and then 415 | % to write the result to BibTeX's output buffer: 416 | % 417 | % "PREVIOUS_ITEM," 418 | % 419 | % Punctuation (and spacing) between items is often determined by both of the 420 | % items rather than just the first one. The presence of quotation marks 421 | % further complicates the situation because, in standard English, trailing 422 | % punctuation marks are supposed to be contained within the quotes. 423 | % 424 | % IEEEtran.bst maintains two output state (aka "status") vectors which 425 | % correspond to the previous and current (aka "this") items. Each vector 426 | % consists of several independent attributes which track punctuation, 427 | % spacing, quotation, and newlines. Capitalization status is handled by a 428 | % separate scalar because the format routines, not the output routine, 429 | % handle capitalization and, therefore, there is no need to maintain the 430 | % capitalization attribute for both the "previous" and "this" items. 431 | % 432 | % When a format routine adds a new item, it copies the current output status 433 | % vector to the previous output status vector and (usually) resets the 434 | % current (this) output status vector to a "standard status" vector. Using a 435 | % "standard status" vector in this way allows us to redefine what we mean by 436 | % "standard status" at the start of each entry handler and reuse the same 437 | % format routines under the various inter-item separation schemes. For 438 | % example, the standard status vector for the @book entry type may use 439 | % commas for item separators, while the @electronic type may use periods, 440 | % yet both entry handlers exploit many of the exact same format routines. 441 | % 442 | % Because format routines have write access to the output status vector of 443 | % the previous item, they can override the punctuation choices of the 444 | % previous format routine! Therefore, it becomes trivial to implement rules 445 | % such as "Always use a period and a large space before the publisher." By 446 | % pushing the generation of the closing quote mark to the output routine, we 447 | % avoid all the problems caused by having to close a quote before having all 448 | % the information required to determine what the punctuation should be. 449 | % 450 | % The IEEEtran.bst output state system can easily be expanded if needed. 451 | % For instance, it is easy to add a "space.tie" attribute value if the 452 | % bibliography rules mandate that two items have to be joined with an 453 | % unbreakable space. 454 | 455 | FUNCTION {initialize.status.constants} 456 | { #0 'punct.no := 457 | #1 'punct.comma := 458 | #2 'punct.period := 459 | #0 'space.no := 460 | #1 'space.normal := 461 | #2 'space.large := 462 | #0 'quote.no := 463 | #1 'quote.close := 464 | #0 'cap.no := 465 | #1 'cap.yes := 466 | #0 'nline.no := 467 | #1 'nline.newblock := 468 | } 469 | 470 | FUNCTION {std.status.using.comma} 471 | { punct.comma 'punct.std := 472 | space.normal 'space.std := 473 | quote.no 'quote.std := 474 | nline.no 'nline.std := 475 | cap.no 'cap.std := 476 | } 477 | 478 | FUNCTION {std.status.using.period} 479 | { punct.period 'punct.std := 480 | space.normal 'space.std := 481 | quote.no 'quote.std := 482 | nline.no 'nline.std := 483 | cap.yes 'cap.std := 484 | } 485 | 486 | FUNCTION {initialize.prev.this.status} 487 | { punct.no 'prev.status.punct := 488 | space.no 'prev.status.space := 489 | quote.no 'prev.status.quote := 490 | nline.no 'prev.status.nline := 491 | punct.no 'this.status.punct := 492 | space.no 'this.status.space := 493 | quote.no 'this.status.quote := 494 | nline.no 'this.status.nline := 495 | cap.yes 'status.cap := 496 | } 497 | 498 | FUNCTION {this.status.std} 499 | { punct.std 'this.status.punct := 500 | space.std 'this.status.space := 501 | quote.std 'this.status.quote := 502 | nline.std 'this.status.nline := 503 | } 504 | 505 | FUNCTION {cap.status.std}{ cap.std 'status.cap := } 506 | 507 | FUNCTION {this.to.prev.status} 508 | { this.status.punct 'prev.status.punct := 509 | this.status.space 'prev.status.space := 510 | this.status.quote 'prev.status.quote := 511 | this.status.nline 'prev.status.nline := 512 | } 513 | 514 | 515 | FUNCTION {not} 516 | { { #0 } 517 | { #1 } 518 | if$ 519 | } 520 | 521 | FUNCTION {and} 522 | { { skip$ } 523 | { pop$ #0 } 524 | if$ 525 | } 526 | 527 | FUNCTION {or} 528 | { { pop$ #1 } 529 | { skip$ } 530 | if$ 531 | } 532 | 533 | 534 | % convert the strings "yes" or "no" to #1 or #0 respectively 535 | FUNCTION {yes.no.to.int} 536 | { "l" change.case$ duplicate$ 537 | "yes" = 538 | { pop$ #1 } 539 | { duplicate$ "no" = 540 | { pop$ #0 } 541 | { "unknown boolean " quote$ * swap$ * quote$ * 542 | " in " * cite$ * warning$ 543 | #0 544 | } 545 | if$ 546 | } 547 | if$ 548 | } 549 | 550 | 551 | % pushes true if the single char string on the stack is in the 552 | % range of "0" to "9" 553 | FUNCTION {is.num} 554 | { chr.to.int$ 555 | duplicate$ "0" chr.to.int$ < not 556 | swap$ "9" chr.to.int$ > not and 557 | } 558 | 559 | % multiplies the integer on the stack by a factor of 10 560 | FUNCTION {bump.int.mag} 561 | { #0 'multiresult := 562 | { duplicate$ #0 > } 563 | { #1 - 564 | multiresult #10 + 565 | 'multiresult := 566 | } 567 | while$ 568 | pop$ 569 | multiresult 570 | } 571 | 572 | % converts a single character string on the stack to an integer 573 | FUNCTION {char.to.integer} 574 | { duplicate$ 575 | is.num 576 | { chr.to.int$ "0" chr.to.int$ - } 577 | {"noninteger character " quote$ * swap$ * quote$ * 578 | " in integer field of " * cite$ * warning$ 579 | #0 580 | } 581 | if$ 582 | } 583 | 584 | % converts a string on the stack to an integer 585 | FUNCTION {string.to.integer} 586 | { duplicate$ text.length$ 'namesleft := 587 | #1 'nameptr := 588 | #0 'numnames := 589 | { nameptr namesleft > not } 590 | { duplicate$ nameptr #1 substring$ 591 | char.to.integer numnames bump.int.mag + 592 | 'numnames := 593 | nameptr #1 + 594 | 'nameptr := 595 | } 596 | while$ 597 | pop$ 598 | numnames 599 | } 600 | 601 | 602 | 603 | 604 | % The output routines write out the *next* to the top (previous) item on the 605 | % stack, adding punctuation and such as needed. Since IEEEtran.bst maintains 606 | % the output status for the top two items on the stack, these output 607 | % routines have to consider the previous output status (which corresponds to 608 | % the item that is being output). Full independent control of punctuation, 609 | % closing quote marks, spacing, and newblock is provided. 610 | % 611 | % "output.nonnull" does not check for the presence of a previous empty 612 | % item. 613 | % 614 | % "output" does check for the presence of a previous empty item and will 615 | % remove an empty item rather than outputing it. 616 | % 617 | % "output.warn" is like "output", but will issue a warning if it detects 618 | % an empty item. 619 | 620 | FUNCTION {output.nonnull} 621 | { swap$ 622 | prev.status.punct punct.comma = 623 | { "," * } 624 | { skip$ } 625 | if$ 626 | prev.status.punct punct.period = 627 | { add.period$ } 628 | { skip$ } 629 | if$ 630 | prev.status.quote quote.close = 631 | { "''" * } 632 | { skip$ } 633 | if$ 634 | prev.status.space space.normal = 635 | { " " * } 636 | { skip$ } 637 | if$ 638 | prev.status.space space.large = 639 | { large.space * } 640 | { skip$ } 641 | if$ 642 | write$ 643 | prev.status.nline nline.newblock = 644 | { newline$ "\newblock " write$ } 645 | { skip$ } 646 | if$ 647 | } 648 | 649 | FUNCTION {output} 650 | { duplicate$ empty$ 651 | 'pop$ 652 | 'output.nonnull 653 | if$ 654 | } 655 | 656 | FUNCTION {output.warn} 657 | { 't := 658 | duplicate$ empty$ 659 | { pop$ "empty " t * " in " * cite$ * warning$ } 660 | 'output.nonnull 661 | if$ 662 | } 663 | 664 | % "fin.entry" is the output routine that handles the last item of the entry 665 | % (which will be on the top of the stack when "fin.entry" is called). 666 | 667 | FUNCTION {fin.entry} 668 | { this.status.punct punct.no = 669 | { skip$ } 670 | { add.period$ } 671 | if$ 672 | this.status.quote quote.close = 673 | { "''" * } 674 | { skip$ } 675 | if$ 676 | write$ 677 | newline$ 678 | } 679 | 680 | 681 | FUNCTION {is.last.char.not.punct} 682 | { duplicate$ 683 | "}" * add.period$ 684 | #-1 #1 substring$ "." = 685 | } 686 | 687 | FUNCTION {is.multiple.pages} 688 | { 't := 689 | #0 'multiresult := 690 | { multiresult not 691 | t empty$ not 692 | and 693 | } 694 | { t #1 #1 substring$ 695 | duplicate$ "-" = 696 | swap$ duplicate$ "," = 697 | swap$ "+" = 698 | or or 699 | { #1 'multiresult := } 700 | { t #2 global.max$ substring$ 't := } 701 | if$ 702 | } 703 | while$ 704 | multiresult 705 | } 706 | 707 | FUNCTION {capitalize}{ "u" change.case$ "t" change.case$ } 708 | 709 | FUNCTION {emphasize} 710 | { duplicate$ empty$ 711 | { pop$ "" } 712 | { "\emph{" swap$ * "}" * } 713 | if$ 714 | } 715 | 716 | FUNCTION {do.name.latex.cmd} 717 | { name.latex.cmd 718 | empty$ 719 | { skip$ } 720 | { name.latex.cmd "{" * swap$ * "}" * } 721 | if$ 722 | } 723 | 724 | % IEEEtran.bst uses its own \BIBforeignlanguage command which directly 725 | % invokes the TeX hyphenation patterns without the need of the Babel 726 | % package. Babel does a lot more than switch hyphenation patterns and 727 | % its loading can cause unintended effects in many class files (such as 728 | % IEEEtran.cls). 729 | FUNCTION {select.language} 730 | { duplicate$ empty$ 'pop$ 731 | { language empty$ 'skip$ 732 | { "\BIBforeignlanguage{" language * "}{" * swap$ * "}" * } 733 | if$ 734 | } 735 | if$ 736 | } 737 | 738 | FUNCTION {tie.or.space.prefix} 739 | { duplicate$ text.length$ #3 < 740 | { "~" } 741 | { " " } 742 | if$ 743 | swap$ 744 | } 745 | 746 | FUNCTION {get.bbl.editor} 747 | { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } 748 | 749 | FUNCTION {space.word}{ " " swap$ * " " * } 750 | 751 | 752 | % Field Conditioners, Converters, Checkers and External Interfaces 753 | 754 | FUNCTION {empty.field.to.null.string} 755 | { duplicate$ empty$ 756 | { pop$ "" } 757 | { skip$ } 758 | if$ 759 | } 760 | 761 | FUNCTION {either.or.check} 762 | { empty$ 763 | { pop$ } 764 | { "can't use both " swap$ * " fields in " * cite$ * warning$ } 765 | if$ 766 | } 767 | 768 | FUNCTION {empty.entry.warn} 769 | { author empty$ title empty$ howpublished empty$ 770 | month empty$ year empty$ note empty$ url empty$ 771 | and and and and and and 772 | { "all relevant fields are empty in " cite$ * warning$ } 773 | 'skip$ 774 | if$ 775 | } 776 | 777 | 778 | % The bibinfo system provides a way for the electronic parsing/acquisition 779 | % of a bibliography's contents as is done by ReVTeX. For example, a field 780 | % could be entered into the bibliography as: 781 | % \bibinfo{volume}{2} 782 | % Only the "2" would show up in the document, but the LaTeX \bibinfo command 783 | % could do additional things with the information. IEEEtran.bst does provide 784 | % a \bibinfo command via "\providecommand{\bibinfo}[2]{#2}". However, it is 785 | % currently not used as the bogus bibinfo functions defined here output the 786 | % entry values directly without the \bibinfo wrapper. The bibinfo functions 787 | % themselves (and the calls to them) are retained for possible future use. 788 | % 789 | % bibinfo.check avoids acting on missing fields while bibinfo.warn will 790 | % issue a warning message if a missing field is detected. Prior to calling 791 | % the bibinfo functions, the user should push the field value and then its 792 | % name string, in that order. 793 | 794 | FUNCTION {bibinfo.check} 795 | { swap$ duplicate$ missing$ 796 | { pop$ pop$ "" } 797 | { duplicate$ empty$ 798 | { swap$ pop$ } 799 | { swap$ pop$ } 800 | if$ 801 | } 802 | if$ 803 | } 804 | 805 | FUNCTION {bibinfo.warn} 806 | { swap$ duplicate$ missing$ 807 | { swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ "" } 808 | { duplicate$ empty$ 809 | { swap$ "empty " swap$ * " in " * cite$ * warning$ } 810 | { swap$ pop$ } 811 | if$ 812 | } 813 | if$ 814 | } 815 | 816 | 817 | % IEEE separates large numbers with more than 4 digits into groups of 818 | % three. IEEE uses a small space to separate these number groups. 819 | % Typical applications include patent and page numbers. 820 | 821 | % number of consecutive digits required to trigger the group separation. 822 | FUNCTION {large.number.trigger}{ #5 } 823 | 824 | % For numbers longer than the trigger, this is the blocksize of the groups. 825 | % The blocksize must be less than the trigger threshold, and 2 * blocksize 826 | % must be greater than the trigger threshold (can't do more than one 827 | % separation on the initial trigger). 828 | FUNCTION {large.number.blocksize}{ #3 } 829 | 830 | % What is actually inserted between the number groups. 831 | FUNCTION {large.number.separator}{ "\," } 832 | 833 | % So as to save on integer variables by reusing existing ones, numnames 834 | % holds the current number of consecutive digits read and nameptr holds 835 | % the number that will trigger an inserted space. 836 | FUNCTION {large.number.separate} 837 | { 't := 838 | "" 839 | #0 'numnames := 840 | large.number.trigger 'nameptr := 841 | { t empty$ not } 842 | { t #-1 #1 substring$ is.num 843 | { numnames #1 + 'numnames := } 844 | { #0 'numnames := 845 | large.number.trigger 'nameptr := 846 | } 847 | if$ 848 | t #-1 #1 substring$ swap$ * 849 | t #-2 global.max$ substring$ 't := 850 | numnames nameptr = 851 | { duplicate$ #1 nameptr large.number.blocksize - substring$ swap$ 852 | nameptr large.number.blocksize - #1 + global.max$ substring$ 853 | large.number.separator swap$ * * 854 | nameptr large.number.blocksize - 'numnames := 855 | large.number.blocksize #1 + 'nameptr := 856 | } 857 | { skip$ } 858 | if$ 859 | } 860 | while$ 861 | } 862 | 863 | % Converts all single dashes "-" to double dashes "--". 864 | FUNCTION {n.dashify} 865 | { large.number.separate 866 | 't := 867 | "" 868 | { t empty$ not } 869 | { t #1 #1 substring$ "-" = 870 | { t #1 #2 substring$ "--" = not 871 | { "--" * 872 | t #2 global.max$ substring$ 't := 873 | } 874 | { { t #1 #1 substring$ "-" = } 875 | { "-" * 876 | t #2 global.max$ substring$ 't := 877 | } 878 | while$ 879 | } 880 | if$ 881 | } 882 | { t #1 #1 substring$ * 883 | t #2 global.max$ substring$ 't := 884 | } 885 | if$ 886 | } 887 | while$ 888 | } 889 | 890 | 891 | % This function detects entries with names that are identical to that of 892 | % the previous entry and replaces the repeated names with dashes (if the 893 | % "is.dash.repeated.names" user control is nonzero). 894 | FUNCTION {name.or.dash} 895 | { 's := 896 | oldname empty$ 897 | { s 'oldname := s } 898 | { s oldname = 899 | { is.dash.repeated.names 900 | { repeated.name.dashes } 901 | { s 'oldname := s } 902 | if$ 903 | } 904 | { s 'oldname := s } 905 | if$ 906 | } 907 | if$ 908 | } 909 | 910 | % Converts the number string on the top of the stack to 911 | % "numerical ordinal form" (e.g., "7" to "7th"). There is 912 | % no artificial limit to the upper bound of the numbers as the 913 | % two least significant digits determine the ordinal form. 914 | FUNCTION {num.to.ordinal} 915 | { duplicate$ #-2 #1 substring$ "1" = 916 | { bbl.th * } 917 | { duplicate$ #-1 #1 substring$ "1" = 918 | { bbl.st * } 919 | { duplicate$ #-1 #1 substring$ "2" = 920 | { bbl.nd * } 921 | { duplicate$ #-1 #1 substring$ "3" = 922 | { bbl.rd * } 923 | { bbl.th * } 924 | if$ 925 | } 926 | if$ 927 | } 928 | if$ 929 | } 930 | if$ 931 | } 932 | 933 | % If the string on the top of the stack begins with a number, 934 | % (e.g., 11th) then replace the string with the leading number 935 | % it contains. Otherwise retain the string as-is. s holds the 936 | % extracted number, t holds the part of the string that remains 937 | % to be scanned. 938 | FUNCTION {extract.num} 939 | { duplicate$ 't := 940 | "" 's := 941 | { t empty$ not } 942 | { t #1 #1 substring$ 943 | t #2 global.max$ substring$ 't := 944 | duplicate$ is.num 945 | { s swap$ * 's := } 946 | { pop$ "" 't := } 947 | if$ 948 | } 949 | while$ 950 | s empty$ 951 | 'skip$ 952 | { pop$ s } 953 | if$ 954 | } 955 | 956 | % Converts the word number string on the top of the stack to 957 | % Arabic string form. Will be successful up to "tenth". 958 | FUNCTION {word.to.num} 959 | { duplicate$ "l" change.case$ 's := 960 | s "first" = 961 | { pop$ "1" } 962 | { skip$ } 963 | if$ 964 | s "second" = 965 | { pop$ "2" } 966 | { skip$ } 967 | if$ 968 | s "third" = 969 | { pop$ "3" } 970 | { skip$ } 971 | if$ 972 | s "fourth" = 973 | { pop$ "4" } 974 | { skip$ } 975 | if$ 976 | s "fifth" = 977 | { pop$ "5" } 978 | { skip$ } 979 | if$ 980 | s "sixth" = 981 | { pop$ "6" } 982 | { skip$ } 983 | if$ 984 | s "seventh" = 985 | { pop$ "7" } 986 | { skip$ } 987 | if$ 988 | s "eighth" = 989 | { pop$ "8" } 990 | { skip$ } 991 | if$ 992 | s "ninth" = 993 | { pop$ "9" } 994 | { skip$ } 995 | if$ 996 | s "tenth" = 997 | { pop$ "10" } 998 | { skip$ } 999 | if$ 1000 | } 1001 | 1002 | 1003 | % Converts the string on the top of the stack to numerical 1004 | % ordinal (e.g., "11th") form. 1005 | FUNCTION {convert.edition} 1006 | { duplicate$ empty$ 'skip$ 1007 | { duplicate$ #1 #1 substring$ is.num 1008 | { extract.num 1009 | num.to.ordinal 1010 | } 1011 | { word.to.num 1012 | duplicate$ #1 #1 substring$ is.num 1013 | { num.to.ordinal } 1014 | { "edition ordinal word " quote$ * edition * quote$ * 1015 | " may be too high (or improper) for conversion" * " in " * cite$ * warning$ 1016 | } 1017 | if$ 1018 | } 1019 | if$ 1020 | } 1021 | if$ 1022 | } 1023 | 1024 | 1025 | 1026 | 1027 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1028 | %% LATEX BIBLIOGRAPHY CODE %% 1029 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1030 | 1031 | % from plainnat.bst 1032 | FUNCTION {format.full.names} 1033 | {'s := 1034 | #1 'nameptr := 1035 | s num.names$ 'numnames := 1036 | numnames 'namesleft := 1037 | { namesleft #0 > } 1038 | { s nameptr 1039 | "{vv~}{ll}" format.name$ 't := 1040 | nameptr #1 > 1041 | { 1042 | namesleft #1 > 1043 | { ", " * t * } 1044 | { 1045 | numnames #2 > 1046 | { "," * } 1047 | 'skip$ 1048 | if$ 1049 | t "others" = 1050 | { " et~al." * } 1051 | { " and " * t * } 1052 | if$ 1053 | } 1054 | if$ 1055 | } 1056 | 't 1057 | if$ 1058 | nameptr #1 + 'nameptr := 1059 | namesleft #1 - 'namesleft := 1060 | } 1061 | while$ 1062 | } 1063 | 1064 | FUNCTION {author.editor.full} 1065 | { author empty$ 1066 | { editor empty$ 1067 | { "" } 1068 | { editor format.full.names } 1069 | if$ 1070 | } 1071 | { author format.full.names } 1072 | if$ 1073 | } 1074 | 1075 | FUNCTION {author.full} 1076 | { author empty$ 1077 | { "" } 1078 | { author format.full.names } 1079 | if$ 1080 | } 1081 | 1082 | FUNCTION {editor.full} 1083 | { editor empty$ 1084 | { "" } 1085 | { editor format.full.names } 1086 | if$ 1087 | } 1088 | 1089 | FUNCTION {make.full.names} 1090 | { type$ "book" = 1091 | type$ "inbook" = 1092 | or 1093 | { author.editor.full } 1094 | { type$ "proceedings" = 1095 | type$ "periodical" = 1096 | or 1097 | { editor.full } 1098 | { author.full } 1099 | if$ 1100 | } 1101 | if$ 1102 | } 1103 | % END from plainnat.bst 1104 | 1105 | FUNCTION {start.entry} 1106 | { newline$ 1107 | "\bibitem[" write$ 1108 | label write$ 1109 | ")" make.full.names duplicate$ short.list = 1110 | { pop$ } 1111 | { * } 1112 | if$ 1113 | "]{" * write$ 1114 | cite$ write$ 1115 | "}" write$ 1116 | newline$ 1117 | "" 1118 | initialize.prev.this.status 1119 | } 1120 | 1121 | % Here we write out all the LaTeX code that we will need. The most involved 1122 | % code sequences are those that control the alternate interword spacing and 1123 | % foreign language hyphenation patterns. The heavy use of \providecommand 1124 | % gives users a way to override the defaults. Special thanks to Javier Bezos, 1125 | % Johannes Braams, Robin Fairbairns, Heiko Oberdiek, Donald Arseneau and all 1126 | % the other gurus on comp.text.tex for their help and advice on the topic of 1127 | % \selectlanguage, Babel and BibTeX. 1128 | FUNCTION {begin.bib} 1129 | { "% Generated by IEEEtranN.bst, version: " bst.file.version * " (" * bst.file.date * ")" * 1130 | write$ newline$ 1131 | preamble$ empty$ 'skip$ 1132 | { preamble$ write$ newline$ } 1133 | if$ 1134 | "\begin{thebibliography}{" number.label int.to.str$ * "}" * 1135 | write$ newline$ 1136 | "\providecommand{\natexlab}[1]{#1}" 1137 | write$ newline$ 1138 | "\providecommand{\url}[1]{#1}" 1139 | write$ newline$ 1140 | "\csname url@samestyle\endcsname" 1141 | write$ newline$ 1142 | "\providecommand{\newblock}{\relax}" 1143 | write$ newline$ 1144 | "\providecommand{\bibinfo}[2]{#2}" 1145 | write$ newline$ 1146 | "\providecommand{\BIBentrySTDinterwordspacing}{\spaceskip=0pt\relax}" 1147 | write$ newline$ 1148 | "\providecommand{\BIBentryALTinterwordstretchfactor}{" 1149 | ALTinterwordstretchfactor * "}" * 1150 | write$ newline$ 1151 | "\providecommand{\BIBentryALTinterwordspacing}{\spaceskip=\fontdimen2\font plus " 1152 | write$ newline$ 1153 | "\BIBentryALTinterwordstretchfactor\fontdimen3\font minus \fontdimen4\font\relax}" 1154 | write$ newline$ 1155 | "\providecommand{\BIBforeignlanguage}[2]{{%" 1156 | write$ newline$ 1157 | "\expandafter\ifx\csname l@#1\endcsname\relax" 1158 | write$ newline$ 1159 | "\typeout{** WARNING: IEEEtranN.bst: No hyphenation pattern has been}%" 1160 | write$ newline$ 1161 | "\typeout{** loaded for the language `#1'. Using the pattern for}%" 1162 | write$ newline$ 1163 | "\typeout{** the default language instead.}%" 1164 | write$ newline$ 1165 | "\else" 1166 | write$ newline$ 1167 | "\language=\csname l@#1\endcsname" 1168 | write$ newline$ 1169 | "\fi" 1170 | write$ newline$ 1171 | "#2}}" 1172 | write$ newline$ 1173 | "\providecommand{\BIBdecl}{\relax}" 1174 | write$ newline$ 1175 | "\BIBdecl" 1176 | write$ newline$ 1177 | } 1178 | 1179 | FUNCTION {end.bib} 1180 | { newline$ "\end{thebibliography}" write$ newline$ } 1181 | 1182 | FUNCTION {if.url.alt.interword.spacing} 1183 | { is.use.alt.interword.spacing 1184 | {url empty$ 'skip$ {"\BIBentryALTinterwordspacing" write$ newline$} if$} 1185 | { skip$ } 1186 | if$ 1187 | } 1188 | 1189 | FUNCTION {if.url.std.interword.spacing} 1190 | { is.use.alt.interword.spacing 1191 | {url empty$ 'skip$ {"\BIBentrySTDinterwordspacing" write$ newline$} if$} 1192 | { skip$ } 1193 | if$ 1194 | } 1195 | 1196 | 1197 | 1198 | 1199 | %%%%%%%%%%%%%%%%%%%%% 1200 | %% FORMAT HANDLERS %% 1201 | %%%%%%%%%%%%%%%%%%%%% 1202 | 1203 | %% Lower Level Formats (used by higher level formats) 1204 | 1205 | FUNCTION {format.address.org.or.pub.date} 1206 | { 't := 1207 | "" 1208 | year empty$ 1209 | { "empty year in " cite$ * warning$ } 1210 | { skip$ } 1211 | if$ 1212 | address empty$ t empty$ and 1213 | year empty$ and month empty$ and 1214 | { skip$ } 1215 | { this.to.prev.status 1216 | this.status.std 1217 | cap.status.std 1218 | address "address" bibinfo.check * 1219 | t empty$ 1220 | { skip$ } 1221 | { punct.period 'prev.status.punct := 1222 | space.large 'prev.status.space := 1223 | address empty$ 1224 | { skip$ } 1225 | { ": " * } 1226 | if$ 1227 | t * 1228 | } 1229 | if$ 1230 | year empty$ month empty$ and 1231 | { skip$ } 1232 | { t empty$ address empty$ and 1233 | { skip$ } 1234 | { ", " * } 1235 | if$ 1236 | month empty$ 1237 | { year empty$ 1238 | { skip$ } 1239 | { year "year" bibinfo.check * } 1240 | if$ 1241 | } 1242 | { month "month" bibinfo.check * 1243 | year empty$ 1244 | { skip$ } 1245 | { " " * year "year" bibinfo.check * } 1246 | if$ 1247 | } 1248 | if$ 1249 | } 1250 | if$ 1251 | } 1252 | if$ 1253 | } 1254 | 1255 | 1256 | FUNCTION {format.names} 1257 | { 'bibinfo := 1258 | duplicate$ empty$ 'skip$ { 1259 | this.to.prev.status 1260 | this.status.std 1261 | 's := 1262 | "" 't := 1263 | #1 'nameptr := 1264 | s num.names$ 'numnames := 1265 | numnames 'namesleft := 1266 | { namesleft #0 > } 1267 | { s nameptr 1268 | name.format.string 1269 | format.name$ 1270 | bibinfo bibinfo.check 1271 | 't := 1272 | nameptr #1 > 1273 | { nameptr num.names.shown.with.forced.et.al #1 + = 1274 | numnames max.num.names.before.forced.et.al > 1275 | is.forced.et.al and and 1276 | { "others" 't := 1277 | #1 'namesleft := 1278 | } 1279 | { skip$ } 1280 | if$ 1281 | namesleft #1 > 1282 | { ", " * t do.name.latex.cmd * } 1283 | { s nameptr "{ll}" format.name$ duplicate$ "others" = 1284 | { 't := } 1285 | { pop$ } 1286 | if$ 1287 | t "others" = 1288 | { " " * bbl.etal emphasize * } 1289 | { numnames #2 > 1290 | { "," * } 1291 | { skip$ } 1292 | if$ 1293 | bbl.and 1294 | space.word * t do.name.latex.cmd * 1295 | } 1296 | if$ 1297 | } 1298 | if$ 1299 | } 1300 | { t do.name.latex.cmd } 1301 | if$ 1302 | nameptr #1 + 'nameptr := 1303 | namesleft #1 - 'namesleft := 1304 | } 1305 | while$ 1306 | cap.status.std 1307 | } if$ 1308 | } 1309 | 1310 | 1311 | 1312 | 1313 | %% Higher Level Formats 1314 | 1315 | %% addresses/locations 1316 | 1317 | FUNCTION {format.address} 1318 | { address duplicate$ empty$ 'skip$ 1319 | { this.to.prev.status 1320 | this.status.std 1321 | cap.status.std 1322 | } 1323 | if$ 1324 | } 1325 | 1326 | 1327 | 1328 | %% author/editor names 1329 | 1330 | FUNCTION {format.authors}{ author "author" format.names } 1331 | 1332 | FUNCTION {format.editors} 1333 | { editor "editor" format.names duplicate$ empty$ 'skip$ 1334 | { ", " * 1335 | get.bbl.editor 1336 | capitalize 1337 | * 1338 | } 1339 | if$ 1340 | } 1341 | 1342 | 1343 | 1344 | %% date 1345 | 1346 | FUNCTION {format.date} 1347 | { 1348 | month "month" bibinfo.check duplicate$ empty$ 1349 | year "year" bibinfo.check duplicate$ empty$ 1350 | { swap$ 'skip$ 1351 | { this.to.prev.status 1352 | this.status.std 1353 | cap.status.std 1354 | "there's a month but no year in " cite$ * warning$ } 1355 | if$ 1356 | * 1357 | } 1358 | { this.to.prev.status 1359 | this.status.std 1360 | cap.status.std 1361 | swap$ 'skip$ 1362 | { 1363 | swap$ 1364 | " " * swap$ 1365 | } 1366 | if$ 1367 | * 1368 | } 1369 | if$ 1370 | } 1371 | 1372 | FUNCTION {format.date.electronic} 1373 | { month "month" bibinfo.check duplicate$ empty$ 1374 | year "year" bibinfo.check duplicate$ empty$ 1375 | { swap$ 1376 | { pop$ } 1377 | { "there's a month but no year in " cite$ * warning$ 1378 | pop$ ")" * "(" swap$ * 1379 | this.to.prev.status 1380 | punct.no 'this.status.punct := 1381 | space.normal 'this.status.space := 1382 | quote.no 'this.status.quote := 1383 | cap.yes 'status.cap := 1384 | } 1385 | if$ 1386 | } 1387 | { swap$ 1388 | { swap$ pop$ ")" * "(" swap$ * } 1389 | { "(" swap$ * ", " * swap$ * ")" * } 1390 | if$ 1391 | this.to.prev.status 1392 | punct.no 'this.status.punct := 1393 | space.normal 'this.status.space := 1394 | quote.no 'this.status.quote := 1395 | cap.yes 'status.cap := 1396 | } 1397 | if$ 1398 | } 1399 | 1400 | 1401 | 1402 | %% edition/title 1403 | 1404 | % Note: IEEE considers the edition to be closely associated with 1405 | % the title of a book. So, in IEEEtran.bst the edition is normally handled 1406 | % within the formatting of the title. The format.edition function is 1407 | % retained here for possible future use. 1408 | FUNCTION {format.edition} 1409 | { edition duplicate$ empty$ 'skip$ 1410 | { this.to.prev.status 1411 | this.status.std 1412 | convert.edition 1413 | status.cap 1414 | { "t" } 1415 | { "l" } 1416 | if$ change.case$ 1417 | "edition" bibinfo.check 1418 | "~" * bbl.edition * 1419 | cap.status.std 1420 | } 1421 | if$ 1422 | } 1423 | 1424 | % This is used to format the booktitle of a conference proceedings. 1425 | % Here we use the "intype" field to provide the user a way to 1426 | % override the word "in" (e.g., with things like "presented at") 1427 | % Use of intype stops the emphasis of the booktitle to indicate that 1428 | % we no longer mean the written conference proceedings, but the 1429 | % conference itself. 1430 | FUNCTION {format.in.booktitle} 1431 | { booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ 1432 | { this.to.prev.status 1433 | this.status.std 1434 | select.language 1435 | intype missing$ 1436 | { emphasize 1437 | bbl.in " " * 1438 | } 1439 | { intype " " * } 1440 | if$ 1441 | swap$ * 1442 | cap.status.std 1443 | } 1444 | if$ 1445 | } 1446 | 1447 | % This is used to format the booktitle of collection. 1448 | % Here the "intype" field is not supported, but "edition" is. 1449 | FUNCTION {format.in.booktitle.edition} 1450 | { booktitle "booktitle" bibinfo.check duplicate$ empty$ 'skip$ 1451 | { this.to.prev.status 1452 | this.status.std 1453 | select.language 1454 | emphasize 1455 | edition empty$ 'skip$ 1456 | { ", " * 1457 | edition 1458 | convert.edition 1459 | "l" change.case$ 1460 | * "~" * bbl.edition * 1461 | } 1462 | if$ 1463 | bbl.in " " * swap$ * 1464 | cap.status.std 1465 | } 1466 | if$ 1467 | } 1468 | 1469 | FUNCTION {format.article.title} 1470 | { title duplicate$ empty$ 'skip$ 1471 | { this.to.prev.status 1472 | this.status.std 1473 | "t" change.case$ 1474 | } 1475 | if$ 1476 | "title" bibinfo.check 1477 | duplicate$ empty$ 'skip$ 1478 | { quote.close 'this.status.quote := 1479 | is.last.char.not.punct 1480 | { punct.std 'this.status.punct := } 1481 | { punct.no 'this.status.punct := } 1482 | if$ 1483 | select.language 1484 | "``" swap$ * 1485 | cap.status.std 1486 | } 1487 | if$ 1488 | } 1489 | 1490 | FUNCTION {format.article.title.electronic} 1491 | { title duplicate$ empty$ 'skip$ 1492 | { this.to.prev.status 1493 | this.status.std 1494 | cap.status.std 1495 | "t" change.case$ 1496 | } 1497 | if$ 1498 | "title" bibinfo.check 1499 | duplicate$ empty$ 1500 | { skip$ } 1501 | { select.language } 1502 | if$ 1503 | } 1504 | 1505 | FUNCTION {format.book.title.edition} 1506 | { title "title" bibinfo.check 1507 | duplicate$ empty$ 1508 | { "empty title in " cite$ * warning$ } 1509 | { this.to.prev.status 1510 | this.status.std 1511 | select.language 1512 | emphasize 1513 | edition empty$ 'skip$ 1514 | { ", " * 1515 | edition 1516 | convert.edition 1517 | status.cap 1518 | { "t" } 1519 | { "l" } 1520 | if$ 1521 | change.case$ 1522 | * "~" * bbl.edition * 1523 | } 1524 | if$ 1525 | cap.status.std 1526 | } 1527 | if$ 1528 | } 1529 | 1530 | FUNCTION {format.book.title} 1531 | { title "title" bibinfo.check 1532 | duplicate$ empty$ 'skip$ 1533 | { this.to.prev.status 1534 | this.status.std 1535 | cap.status.std 1536 | select.language 1537 | emphasize 1538 | } 1539 | if$ 1540 | } 1541 | 1542 | 1543 | 1544 | %% journal 1545 | 1546 | FUNCTION {format.journal} 1547 | { journal duplicate$ empty$ 'skip$ 1548 | { this.to.prev.status 1549 | this.status.std 1550 | cap.status.std 1551 | select.language 1552 | emphasize 1553 | } 1554 | if$ 1555 | } 1556 | 1557 | 1558 | 1559 | %% how published 1560 | 1561 | FUNCTION {format.howpublished} 1562 | { howpublished duplicate$ empty$ 'skip$ 1563 | { this.to.prev.status 1564 | this.status.std 1565 | cap.status.std 1566 | } 1567 | if$ 1568 | } 1569 | 1570 | 1571 | 1572 | %% institutions/organization/publishers/school 1573 | 1574 | FUNCTION {format.institution} 1575 | { institution duplicate$ empty$ 'skip$ 1576 | { this.to.prev.status 1577 | this.status.std 1578 | cap.status.std 1579 | } 1580 | if$ 1581 | } 1582 | 1583 | FUNCTION {format.organization} 1584 | { organization duplicate$ empty$ 'skip$ 1585 | { this.to.prev.status 1586 | this.status.std 1587 | cap.status.std 1588 | } 1589 | if$ 1590 | } 1591 | 1592 | FUNCTION {format.address.publisher.date} 1593 | { publisher "publisher" bibinfo.warn format.address.org.or.pub.date } 1594 | 1595 | FUNCTION {format.address.publisher.date.nowarn} 1596 | { publisher "publisher" bibinfo.check format.address.org.or.pub.date } 1597 | 1598 | FUNCTION {format.address.organization.date} 1599 | { organization "organization" bibinfo.check format.address.org.or.pub.date } 1600 | 1601 | FUNCTION {format.school} 1602 | { school duplicate$ empty$ 'skip$ 1603 | { this.to.prev.status 1604 | this.status.std 1605 | cap.status.std 1606 | } 1607 | if$ 1608 | } 1609 | 1610 | 1611 | 1612 | %% volume/number/series/chapter/pages 1613 | 1614 | FUNCTION {format.volume} 1615 | { volume empty.field.to.null.string 1616 | duplicate$ empty$ 'skip$ 1617 | { this.to.prev.status 1618 | this.status.std 1619 | bbl.volume 1620 | status.cap 1621 | { capitalize } 1622 | { skip$ } 1623 | if$ 1624 | swap$ tie.or.space.prefix 1625 | "volume" bibinfo.check 1626 | * * 1627 | cap.status.std 1628 | } 1629 | if$ 1630 | } 1631 | 1632 | FUNCTION {format.number} 1633 | { number empty.field.to.null.string 1634 | duplicate$ empty$ 'skip$ 1635 | { this.to.prev.status 1636 | this.status.std 1637 | status.cap 1638 | { bbl.number capitalize } 1639 | { bbl.number } 1640 | if$ 1641 | swap$ tie.or.space.prefix 1642 | "number" bibinfo.check 1643 | * * 1644 | cap.status.std 1645 | } 1646 | if$ 1647 | } 1648 | 1649 | FUNCTION {format.number.if.use.for.article} 1650 | { is.use.number.for.article 1651 | { format.number } 1652 | { "" } 1653 | if$ 1654 | } 1655 | 1656 | % IEEE does not seem to tie the series so closely with the volume 1657 | % and number as is done in other bibliography styles. Instead the 1658 | % series is treated somewhat like an extension of the title. 1659 | FUNCTION {format.series} 1660 | { series empty$ 1661 | { "" } 1662 | { this.to.prev.status 1663 | this.status.std 1664 | bbl.series " " * 1665 | series "series" bibinfo.check * 1666 | cap.status.std 1667 | } 1668 | if$ 1669 | } 1670 | 1671 | 1672 | FUNCTION {format.chapter} 1673 | { chapter empty$ 1674 | { "" } 1675 | { this.to.prev.status 1676 | this.status.std 1677 | type empty$ 1678 | { bbl.chapter } 1679 | { type "l" change.case$ 1680 | "type" bibinfo.check 1681 | } 1682 | if$ 1683 | chapter tie.or.space.prefix 1684 | "chapter" bibinfo.check 1685 | * * 1686 | cap.status.std 1687 | } 1688 | if$ 1689 | } 1690 | 1691 | 1692 | % The intended use of format.paper is for paper numbers of inproceedings. 1693 | % The paper type can be overridden via the type field. 1694 | % We allow the type to be displayed even if the paper number is absent 1695 | % for things like "postdeadline paper" 1696 | FUNCTION {format.paper} 1697 | { is.use.paper 1698 | { paper empty$ 1699 | { type empty$ 1700 | { "" } 1701 | { this.to.prev.status 1702 | this.status.std 1703 | type "type" bibinfo.check 1704 | cap.status.std 1705 | } 1706 | if$ 1707 | } 1708 | { this.to.prev.status 1709 | this.status.std 1710 | type empty$ 1711 | { bbl.paper } 1712 | { type "type" bibinfo.check } 1713 | if$ 1714 | " " * paper 1715 | "paper" bibinfo.check 1716 | * 1717 | cap.status.std 1718 | } 1719 | if$ 1720 | } 1721 | { "" } 1722 | if$ 1723 | } 1724 | 1725 | 1726 | FUNCTION {format.pages} 1727 | { pages duplicate$ empty$ 'skip$ 1728 | { this.to.prev.status 1729 | this.status.std 1730 | duplicate$ is.multiple.pages 1731 | { 1732 | bbl.pages swap$ 1733 | n.dashify 1734 | } 1735 | { 1736 | bbl.page swap$ 1737 | } 1738 | if$ 1739 | tie.or.space.prefix 1740 | "pages" bibinfo.check 1741 | * * 1742 | cap.status.std 1743 | } 1744 | if$ 1745 | } 1746 | 1747 | 1748 | 1749 | %% technical report number 1750 | 1751 | FUNCTION {format.tech.report.number} 1752 | { number "number" bibinfo.check 1753 | this.to.prev.status 1754 | this.status.std 1755 | cap.status.std 1756 | type duplicate$ empty$ 1757 | { pop$ 1758 | bbl.techrep 1759 | } 1760 | { skip$ } 1761 | if$ 1762 | "type" bibinfo.check 1763 | swap$ duplicate$ empty$ 1764 | { pop$ } 1765 | { tie.or.space.prefix * * } 1766 | if$ 1767 | } 1768 | 1769 | 1770 | 1771 | %% note 1772 | 1773 | FUNCTION {format.note} 1774 | { note empty$ 1775 | { "" } 1776 | { this.to.prev.status 1777 | this.status.std 1778 | punct.period 'this.status.punct := 1779 | note #1 #1 substring$ 1780 | duplicate$ "{" = 1781 | { skip$ } 1782 | { status.cap 1783 | { "u" } 1784 | { "l" } 1785 | if$ 1786 | change.case$ 1787 | } 1788 | if$ 1789 | note #2 global.max$ substring$ * "note" bibinfo.check 1790 | cap.yes 'status.cap := 1791 | } 1792 | if$ 1793 | } 1794 | 1795 | 1796 | 1797 | %% patent 1798 | 1799 | FUNCTION {format.patent.date} 1800 | { this.to.prev.status 1801 | this.status.std 1802 | year empty$ 1803 | { monthfiled duplicate$ empty$ 1804 | { "monthfiled" bibinfo.check pop$ "" } 1805 | { "monthfiled" bibinfo.check } 1806 | if$ 1807 | dayfiled duplicate$ empty$ 1808 | { "dayfiled" bibinfo.check pop$ "" * } 1809 | { "dayfiled" bibinfo.check 1810 | monthfiled empty$ 1811 | { "dayfiled without a monthfiled in " cite$ * warning$ 1812 | * 1813 | } 1814 | { " " swap$ * * } 1815 | if$ 1816 | } 1817 | if$ 1818 | yearfiled empty$ 1819 | { "no year or yearfiled in " cite$ * warning$ } 1820 | { yearfiled "yearfiled" bibinfo.check 1821 | swap$ 1822 | duplicate$ empty$ 1823 | { pop$ } 1824 | { ", " * swap$ * } 1825 | if$ 1826 | } 1827 | if$ 1828 | } 1829 | { month duplicate$ empty$ 1830 | { "month" bibinfo.check pop$ "" } 1831 | { "month" bibinfo.check } 1832 | if$ 1833 | day duplicate$ empty$ 1834 | { "day" bibinfo.check pop$ "" * } 1835 | { "day" bibinfo.check 1836 | month empty$ 1837 | { "day without a month in " cite$ * warning$ 1838 | * 1839 | } 1840 | { " " swap$ * * } 1841 | if$ 1842 | } 1843 | if$ 1844 | year "year" bibinfo.check 1845 | swap$ 1846 | duplicate$ empty$ 1847 | { pop$ } 1848 | { ", " * swap$ * } 1849 | if$ 1850 | } 1851 | if$ 1852 | cap.status.std 1853 | } 1854 | 1855 | FUNCTION {format.patent.nationality.type.number} 1856 | { this.to.prev.status 1857 | this.status.std 1858 | nationality duplicate$ empty$ 1859 | { "nationality" bibinfo.warn pop$ "" } 1860 | { "nationality" bibinfo.check 1861 | duplicate$ "l" change.case$ "united states" = 1862 | { pop$ bbl.patentUS } 1863 | { skip$ } 1864 | if$ 1865 | " " * 1866 | } 1867 | if$ 1868 | type empty$ 1869 | { bbl.patent "type" bibinfo.check } 1870 | { type "type" bibinfo.check } 1871 | if$ 1872 | * 1873 | number duplicate$ empty$ 1874 | { "number" bibinfo.warn pop$ } 1875 | { "number" bibinfo.check 1876 | large.number.separate 1877 | swap$ " " * swap$ * 1878 | } 1879 | if$ 1880 | cap.status.std 1881 | } 1882 | 1883 | 1884 | 1885 | %% standard 1886 | 1887 | FUNCTION {format.organization.institution.standard.type.number} 1888 | { this.to.prev.status 1889 | this.status.std 1890 | organization duplicate$ empty$ 1891 | { pop$ 1892 | institution duplicate$ empty$ 1893 | { "institution" bibinfo.warn } 1894 | { "institution" bibinfo.warn " " * } 1895 | if$ 1896 | } 1897 | { "organization" bibinfo.warn " " * } 1898 | if$ 1899 | type empty$ 1900 | { bbl.standard "type" bibinfo.check } 1901 | { type "type" bibinfo.check } 1902 | if$ 1903 | * 1904 | number duplicate$ empty$ 1905 | { "number" bibinfo.check pop$ } 1906 | { "number" bibinfo.check 1907 | large.number.separate 1908 | swap$ " " * swap$ * 1909 | } 1910 | if$ 1911 | cap.status.std 1912 | } 1913 | 1914 | FUNCTION {format.revision} 1915 | { revision empty$ 1916 | { "" } 1917 | { this.to.prev.status 1918 | this.status.std 1919 | bbl.revision 1920 | revision tie.or.space.prefix 1921 | "revision" bibinfo.check 1922 | * * 1923 | cap.status.std 1924 | } 1925 | if$ 1926 | } 1927 | 1928 | 1929 | %% thesis 1930 | 1931 | FUNCTION {format.master.thesis.type} 1932 | { this.to.prev.status 1933 | this.status.std 1934 | type empty$ 1935 | { 1936 | bbl.mthesis 1937 | } 1938 | { 1939 | type "type" bibinfo.check 1940 | } 1941 | if$ 1942 | cap.status.std 1943 | } 1944 | 1945 | FUNCTION {format.phd.thesis.type} 1946 | { this.to.prev.status 1947 | this.status.std 1948 | type empty$ 1949 | { 1950 | bbl.phdthesis 1951 | } 1952 | { 1953 | type "type" bibinfo.check 1954 | } 1955 | if$ 1956 | cap.status.std 1957 | } 1958 | 1959 | 1960 | 1961 | %% URL 1962 | 1963 | FUNCTION {format.url} 1964 | { url empty$ 1965 | { "" } 1966 | { this.to.prev.status 1967 | this.status.std 1968 | cap.yes 'status.cap := 1969 | name.url.prefix " " * 1970 | "\url{" * url * "}" * 1971 | punct.no 'this.status.punct := 1972 | punct.period 'prev.status.punct := 1973 | space.normal 'this.status.space := 1974 | space.normal 'prev.status.space := 1975 | quote.no 'this.status.quote := 1976 | } 1977 | if$ 1978 | } 1979 | 1980 | 1981 | 1982 | 1983 | %%%%%%%%%%%%%%%%%%%% 1984 | %% ENTRY HANDLERS %% 1985 | %%%%%%%%%%%%%%%%%%%% 1986 | 1987 | 1988 | % Note: In many journals, IEEE (or the authors) tend not to show the number 1989 | % for articles, so the display of the number is controlled here by the 1990 | % switch "is.use.number.for.article" 1991 | FUNCTION {article} 1992 | { std.status.using.comma 1993 | start.entry 1994 | if.url.alt.interword.spacing 1995 | format.authors "author" output.warn 1996 | name.or.dash 1997 | format.article.title "title" output.warn 1998 | format.journal "journal" bibinfo.check "journal" output.warn 1999 | format.volume output 2000 | format.number.if.use.for.article output 2001 | format.pages output 2002 | format.date "year" output.warn 2003 | format.note output 2004 | format.url output 2005 | fin.entry 2006 | if.url.std.interword.spacing 2007 | } 2008 | 2009 | FUNCTION {book} 2010 | { std.status.using.comma 2011 | start.entry 2012 | if.url.alt.interword.spacing 2013 | author empty$ 2014 | { format.editors "author and editor" output.warn } 2015 | { format.authors output.nonnull } 2016 | if$ 2017 | name.or.dash 2018 | format.book.title.edition output 2019 | format.series output 2020 | author empty$ 2021 | { skip$ } 2022 | { format.editors output } 2023 | if$ 2024 | format.address.publisher.date output 2025 | format.volume output 2026 | format.number output 2027 | format.note output 2028 | format.url output 2029 | fin.entry 2030 | if.url.std.interword.spacing 2031 | } 2032 | 2033 | FUNCTION {booklet} 2034 | { std.status.using.comma 2035 | start.entry 2036 | if.url.alt.interword.spacing 2037 | format.authors output 2038 | name.or.dash 2039 | format.article.title "title" output.warn 2040 | format.howpublished "howpublished" bibinfo.check output 2041 | format.organization "organization" bibinfo.check output 2042 | format.address "address" bibinfo.check output 2043 | format.date output 2044 | format.note output 2045 | format.url output 2046 | fin.entry 2047 | if.url.std.interword.spacing 2048 | } 2049 | 2050 | FUNCTION {electronic} 2051 | { std.status.using.period 2052 | start.entry 2053 | if.url.alt.interword.spacing 2054 | format.authors output 2055 | name.or.dash 2056 | format.date.electronic output 2057 | format.article.title.electronic output 2058 | format.howpublished "howpublished" bibinfo.check output 2059 | format.organization "organization" bibinfo.check output 2060 | format.address "address" bibinfo.check output 2061 | format.note output 2062 | format.url output 2063 | fin.entry 2064 | empty.entry.warn 2065 | if.url.std.interword.spacing 2066 | } 2067 | 2068 | FUNCTION {inbook} 2069 | { std.status.using.comma 2070 | start.entry 2071 | if.url.alt.interword.spacing 2072 | author empty$ 2073 | { format.editors "author and editor" output.warn } 2074 | { format.authors output.nonnull } 2075 | if$ 2076 | name.or.dash 2077 | format.book.title.edition output 2078 | format.series output 2079 | format.address.publisher.date output 2080 | format.volume output 2081 | format.number output 2082 | format.chapter output 2083 | format.pages output 2084 | format.note output 2085 | format.url output 2086 | fin.entry 2087 | if.url.std.interword.spacing 2088 | } 2089 | 2090 | FUNCTION {incollection} 2091 | { std.status.using.comma 2092 | start.entry 2093 | if.url.alt.interword.spacing 2094 | format.authors "author" output.warn 2095 | name.or.dash 2096 | format.article.title "title" output.warn 2097 | format.in.booktitle.edition "booktitle" output.warn 2098 | format.series output 2099 | format.editors output 2100 | format.address.publisher.date.nowarn output 2101 | format.volume output 2102 | format.number output 2103 | format.chapter output 2104 | format.pages output 2105 | format.note output 2106 | format.url output 2107 | fin.entry 2108 | if.url.std.interword.spacing 2109 | } 2110 | 2111 | FUNCTION {inproceedings} 2112 | { std.status.using.comma 2113 | start.entry 2114 | if.url.alt.interword.spacing 2115 | format.authors "author" output.warn 2116 | name.or.dash 2117 | format.article.title "title" output.warn 2118 | format.in.booktitle "booktitle" output.warn 2119 | format.series output 2120 | format.editors output 2121 | format.volume output 2122 | format.number output 2123 | publisher empty$ 2124 | { format.address.organization.date output } 2125 | { format.organization "organization" bibinfo.check output 2126 | format.address.publisher.date output 2127 | } 2128 | if$ 2129 | format.paper output 2130 | format.pages output 2131 | format.note output 2132 | format.url output 2133 | fin.entry 2134 | if.url.std.interword.spacing 2135 | } 2136 | 2137 | FUNCTION {manual} 2138 | { std.status.using.comma 2139 | start.entry 2140 | if.url.alt.interword.spacing 2141 | format.authors output 2142 | name.or.dash 2143 | format.book.title.edition "title" output.warn 2144 | format.howpublished "howpublished" bibinfo.check output 2145 | format.organization "organization" bibinfo.check output 2146 | format.address "address" bibinfo.check output 2147 | format.date output 2148 | format.note output 2149 | format.url output 2150 | fin.entry 2151 | if.url.std.interword.spacing 2152 | } 2153 | 2154 | FUNCTION {mastersthesis} 2155 | { std.status.using.comma 2156 | start.entry 2157 | if.url.alt.interword.spacing 2158 | format.authors "author" output.warn 2159 | name.or.dash 2160 | format.article.title "title" output.warn 2161 | format.master.thesis.type output.nonnull 2162 | format.school "school" bibinfo.warn output 2163 | format.address "address" bibinfo.check output 2164 | format.date "year" output.warn 2165 | format.note output 2166 | format.url output 2167 | fin.entry 2168 | if.url.std.interword.spacing 2169 | } 2170 | 2171 | FUNCTION {misc} 2172 | { std.status.using.comma 2173 | start.entry 2174 | if.url.alt.interword.spacing 2175 | format.authors output 2176 | name.or.dash 2177 | format.article.title output 2178 | format.howpublished "howpublished" bibinfo.check output 2179 | format.organization "organization" bibinfo.check output 2180 | format.address "address" bibinfo.check output 2181 | format.pages output 2182 | format.date output 2183 | format.note output 2184 | format.url output 2185 | fin.entry 2186 | empty.entry.warn 2187 | if.url.std.interword.spacing 2188 | } 2189 | 2190 | FUNCTION {patent} 2191 | { std.status.using.comma 2192 | start.entry 2193 | if.url.alt.interword.spacing 2194 | format.authors output 2195 | name.or.dash 2196 | format.article.title output 2197 | format.patent.nationality.type.number output 2198 | format.patent.date output 2199 | format.note output 2200 | format.url output 2201 | fin.entry 2202 | empty.entry.warn 2203 | if.url.std.interword.spacing 2204 | } 2205 | 2206 | FUNCTION {periodical} 2207 | { std.status.using.comma 2208 | start.entry 2209 | if.url.alt.interword.spacing 2210 | format.editors output 2211 | name.or.dash 2212 | format.book.title "title" output.warn 2213 | format.series output 2214 | format.volume output 2215 | format.number output 2216 | format.organization "organization" bibinfo.check output 2217 | format.date "year" output.warn 2218 | format.note output 2219 | format.url output 2220 | fin.entry 2221 | if.url.std.interword.spacing 2222 | } 2223 | 2224 | FUNCTION {phdthesis} 2225 | { std.status.using.comma 2226 | start.entry 2227 | if.url.alt.interword.spacing 2228 | format.authors "author" output.warn 2229 | name.or.dash 2230 | format.article.title "title" output.warn 2231 | format.phd.thesis.type output.nonnull 2232 | format.school "school" bibinfo.warn output 2233 | format.address "address" bibinfo.check output 2234 | format.date "year" output.warn 2235 | format.note output 2236 | format.url output 2237 | fin.entry 2238 | if.url.std.interword.spacing 2239 | } 2240 | 2241 | FUNCTION {proceedings} 2242 | { std.status.using.comma 2243 | start.entry 2244 | if.url.alt.interword.spacing 2245 | format.editors output 2246 | name.or.dash 2247 | format.book.title "title" output.warn 2248 | format.series output 2249 | format.volume output 2250 | format.number output 2251 | publisher empty$ 2252 | { format.address.organization.date output } 2253 | { format.organization "organization" bibinfo.check output 2254 | format.address.publisher.date output 2255 | } 2256 | if$ 2257 | format.note output 2258 | format.url output 2259 | fin.entry 2260 | if.url.std.interword.spacing 2261 | } 2262 | 2263 | FUNCTION {standard} 2264 | { std.status.using.comma 2265 | start.entry 2266 | if.url.alt.interword.spacing 2267 | format.authors output 2268 | name.or.dash 2269 | format.book.title "title" output.warn 2270 | format.howpublished "howpublished" bibinfo.check output 2271 | format.organization.institution.standard.type.number output 2272 | format.revision output 2273 | format.date output 2274 | format.note output 2275 | format.url output 2276 | fin.entry 2277 | if.url.std.interword.spacing 2278 | } 2279 | 2280 | FUNCTION {techreport} 2281 | { std.status.using.comma 2282 | start.entry 2283 | if.url.alt.interword.spacing 2284 | format.authors "author" output.warn 2285 | name.or.dash 2286 | format.article.title "title" output.warn 2287 | format.howpublished "howpublished" bibinfo.check output 2288 | format.institution "institution" bibinfo.warn output 2289 | format.address "address" bibinfo.check output 2290 | format.tech.report.number output.nonnull 2291 | format.date "year" output.warn 2292 | format.note output 2293 | format.url output 2294 | fin.entry 2295 | if.url.std.interword.spacing 2296 | } 2297 | 2298 | FUNCTION {unpublished} 2299 | { std.status.using.comma 2300 | start.entry 2301 | if.url.alt.interword.spacing 2302 | format.authors "author" output.warn 2303 | name.or.dash 2304 | format.article.title "title" output.warn 2305 | format.date output 2306 | format.note "note" output.warn 2307 | format.url output 2308 | fin.entry 2309 | if.url.std.interword.spacing 2310 | } 2311 | 2312 | 2313 | % The special entry type which provides the user interface to the 2314 | % BST controls 2315 | FUNCTION {IEEEtranBSTCTL} 2316 | { is.print.banners.to.terminal 2317 | { "** IEEEtran BST control entry " quote$ * cite$ * quote$ * " detected." * 2318 | top$ 2319 | } 2320 | { skip$ } 2321 | if$ 2322 | CTLuse_article_number 2323 | empty$ 2324 | { skip$ } 2325 | { CTLuse_article_number 2326 | yes.no.to.int 2327 | 'is.use.number.for.article := 2328 | } 2329 | if$ 2330 | CTLuse_paper 2331 | empty$ 2332 | { skip$ } 2333 | { CTLuse_paper 2334 | yes.no.to.int 2335 | 'is.use.paper := 2336 | } 2337 | if$ 2338 | CTLuse_forced_etal 2339 | empty$ 2340 | { skip$ } 2341 | { CTLuse_forced_etal 2342 | yes.no.to.int 2343 | 'is.forced.et.al := 2344 | } 2345 | if$ 2346 | CTLmax_names_forced_etal 2347 | empty$ 2348 | { skip$ } 2349 | { CTLmax_names_forced_etal 2350 | string.to.integer 2351 | 'max.num.names.before.forced.et.al := 2352 | } 2353 | if$ 2354 | CTLnames_show_etal 2355 | empty$ 2356 | { skip$ } 2357 | { CTLnames_show_etal 2358 | string.to.integer 2359 | 'num.names.shown.with.forced.et.al := 2360 | } 2361 | if$ 2362 | CTLuse_alt_spacing 2363 | empty$ 2364 | { skip$ } 2365 | { CTLuse_alt_spacing 2366 | yes.no.to.int 2367 | 'is.use.alt.interword.spacing := 2368 | } 2369 | if$ 2370 | CTLalt_stretch_factor 2371 | empty$ 2372 | { skip$ } 2373 | { CTLalt_stretch_factor 2374 | 'ALTinterwordstretchfactor := 2375 | "\renewcommand{\BIBentryALTinterwordstretchfactor}{" 2376 | ALTinterwordstretchfactor * "}" * 2377 | write$ newline$ 2378 | } 2379 | if$ 2380 | CTLdash_repeated_names 2381 | empty$ 2382 | { skip$ } 2383 | { CTLdash_repeated_names 2384 | yes.no.to.int 2385 | 'is.dash.repeated.names := 2386 | } 2387 | if$ 2388 | CTLname_format_string 2389 | empty$ 2390 | { skip$ } 2391 | { CTLname_format_string 2392 | 'name.format.string := 2393 | } 2394 | if$ 2395 | CTLname_latex_cmd 2396 | empty$ 2397 | { skip$ } 2398 | { CTLname_latex_cmd 2399 | 'name.latex.cmd := 2400 | } 2401 | if$ 2402 | CTLname_url_prefix 2403 | missing$ 2404 | { skip$ } 2405 | { CTLname_url_prefix 2406 | 'name.url.prefix := 2407 | } 2408 | if$ 2409 | 2410 | 2411 | num.names.shown.with.forced.et.al max.num.names.before.forced.et.al > 2412 | { "CTLnames_show_etal cannot be greater than CTLmax_names_forced_etal in " cite$ * warning$ 2413 | max.num.names.before.forced.et.al 'num.names.shown.with.forced.et.al := 2414 | } 2415 | { skip$ } 2416 | if$ 2417 | } 2418 | 2419 | 2420 | %%%%%%%%%%%%%%%%%%% 2421 | %% ENTRY ALIASES %% 2422 | %%%%%%%%%%%%%%%%%%% 2423 | FUNCTION {conference}{inproceedings} 2424 | FUNCTION {online}{electronic} 2425 | FUNCTION {internet}{electronic} 2426 | FUNCTION {webpage}{electronic} 2427 | FUNCTION {www}{electronic} 2428 | FUNCTION {default.type}{misc} 2429 | 2430 | 2431 | 2432 | %%%%%%%%%%%%%%%%%% 2433 | %% MAIN PROGRAM %% 2434 | %%%%%%%%%%%%%%%%%% 2435 | 2436 | READ 2437 | 2438 | EXECUTE {initialize.controls} 2439 | EXECUTE {initialize.status.constants} 2440 | EXECUTE {banner.message} 2441 | 2442 | 2443 | 2444 | % BEGIN sort code based on unsrtnat.bst 2445 | FUNCTION {sortify} 2446 | { purify$ 2447 | "l" change.case$ 2448 | } 2449 | 2450 | INTEGERS { len } 2451 | 2452 | FUNCTION {chop.word} 2453 | { 's := 2454 | 'len := 2455 | s #1 len substring$ = 2456 | { s len #1 + global.max$ substring$ } 2457 | { s } 2458 | if$ 2459 | } 2460 | 2461 | STRINGS { last.label next.extra } 2462 | 2463 | INTEGERS { last.extra.num } 2464 | 2465 | FUNCTION {format.lab.names} 2466 | { 's := 2467 | s #1 "{vv~}{ll}" format.name$ 2468 | s num.names$ duplicate$ 2469 | #2 > 2470 | { pop$ " et~al." * } 2471 | { #2 < 2472 | 'skip$ 2473 | { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = 2474 | { " et~al." * } 2475 | { " and " * s #2 "{vv~}{ll}" format.name$ * } 2476 | if$ 2477 | } 2478 | if$ 2479 | } 2480 | if$ 2481 | } 2482 | 2483 | FUNCTION {author.key.label} 2484 | { author empty$ 2485 | { key empty$ 2486 | { cite$ #1 #3 substring$ } 2487 | { key } 2488 | if$ 2489 | } 2490 | { author format.lab.names } 2491 | if$ 2492 | } 2493 | 2494 | FUNCTION {author.editor.key.label} 2495 | { author empty$ 2496 | { editor empty$ 2497 | { key empty$ 2498 | { cite$ #1 #3 substring$ } 2499 | { key } 2500 | if$ 2501 | } 2502 | { editor format.lab.names } 2503 | if$ 2504 | } 2505 | { author format.lab.names } 2506 | if$ 2507 | } 2508 | 2509 | FUNCTION {author.key.organization.label} 2510 | { author empty$ 2511 | { key empty$ 2512 | { organization empty$ 2513 | { cite$ #1 #3 substring$ } 2514 | { "The " #4 organization chop.word #3 text.prefix$ } 2515 | if$ 2516 | } 2517 | { key } 2518 | if$ 2519 | } 2520 | { author format.lab.names } 2521 | if$ 2522 | } 2523 | 2524 | FUNCTION {author.key.organization.institution.label} 2525 | { author empty$ 2526 | { key empty$ 2527 | { organization empty$ 2528 | { institution empty$ 2529 | { cite$ #1 #3 substring$ } 2530 | { "The " #4 institution chop.word #3 text.prefix$ } 2531 | if$ 2532 | } 2533 | { "The " #4 organization chop.word #3 text.prefix$ } 2534 | if$ 2535 | } 2536 | { key } 2537 | if$ 2538 | } 2539 | { author format.lab.names } 2540 | if$ 2541 | } 2542 | 2543 | FUNCTION {editor.key.organization.label} 2544 | { editor empty$ 2545 | { key empty$ 2546 | { organization empty$ 2547 | { cite$ #1 #3 substring$ } 2548 | { "The " #4 organization chop.word #3 text.prefix$ } 2549 | if$ 2550 | } 2551 | { key } 2552 | if$ 2553 | } 2554 | { editor format.lab.names } 2555 | if$ 2556 | } 2557 | 2558 | FUNCTION {calc.label} 2559 | { type$ "book" = 2560 | type$ "inbook" = 2561 | or 2562 | { author.editor.key.label } 2563 | { type$ "proceedings" = 2564 | type$ "periodical" = 2565 | or 2566 | { editor.key.organization.label } 2567 | { type$ "manual" = 2568 | type$ "electronic" = 2569 | type$ "misc" = 2570 | or or 2571 | { author.key.organization.label } 2572 | { type$ "standard" = 2573 | { author.key.organization.institution.label } 2574 | { author.key.label } 2575 | if$ 2576 | } 2577 | if$ 2578 | } 2579 | if$ 2580 | } 2581 | if$ 2582 | duplicate$ 2583 | 'short.list := 2584 | "(" 2585 | * 2586 | type$ "patent" = 2587 | { year empty$ 2588 | { yearfiled } 2589 | { year } 2590 | if$ 2591 | } 2592 | { year } 2593 | if$ 2594 | duplicate$ 2595 | empty$ 2596 | short.list key empty.field.to.null.string = or 2597 | { pop$ "" } 2598 | { skip$ } 2599 | if$ 2600 | * 2601 | 'label := 2602 | } 2603 | 2604 | 2605 | INTEGERS { seq.num } 2606 | 2607 | FUNCTION {init.seq} 2608 | { #0 'seq.num :=} 2609 | 2610 | 2611 | FUNCTION {int.to.fix} 2612 | { "000000000" swap$ int.to.str$ * 2613 | #-1 #10 substring$ 2614 | } 2615 | 2616 | 2617 | FUNCTION {presort} 2618 | { type$ "ieeetranbstctl" = 2619 | { key empty$ 2620 | { "_" } 2621 | { key sortify } 2622 | if$ 2623 | " " 2624 | * 2625 | seq.num int.to.fix 2626 | } 2627 | { calc.label 2628 | label sortify 2629 | " " 2630 | * 2631 | seq.num #1 + 'seq.num := 2632 | seq.num int.to.fix 2633 | } 2634 | if$ 2635 | 'sort.label := 2636 | sort.label * 2637 | #1 entry.max$ substring$ 2638 | 'sort.key$ := 2639 | } 2640 | 2641 | 2642 | FUNCTION {initialize.longest.label} 2643 | { "" 'longest.label := 2644 | #0 int.to.chr$ 'last.label := 2645 | "" 'next.extra := 2646 | #0 'longest.label.width := 2647 | #0 'last.extra.num := 2648 | #0 'number.label := 2649 | } 2650 | 2651 | FUNCTION {forward.pass} 2652 | { type$ "ieeetranbstctl" = 2653 | { skip$ } 2654 | { last.label label = 2655 | { last.extra.num #1 + 'last.extra.num := 2656 | last.extra.num int.to.chr$ 'extra.label := 2657 | } 2658 | { "a" chr.to.int$ 'last.extra.num := 2659 | "" 'extra.label := 2660 | label 'last.label := 2661 | } 2662 | if$ 2663 | number.label #1 + 'number.label := 2664 | } 2665 | if$ 2666 | } 2667 | 2668 | FUNCTION {reverse.pass} 2669 | { type$ "ieeetranbstctl" = 2670 | { skip$ } 2671 | { next.extra "b" = 2672 | { "a" 'extra.label := } 2673 | { skip$ } 2674 | if$ 2675 | extra.label 'next.extra := 2676 | extra.label 2677 | duplicate$ empty$ 2678 | { skip$ } 2679 | { "{\natexlab{" swap$ * "}}" * } 2680 | if$ 2681 | 'extra.label := 2682 | label extra.label * 'label := 2683 | } 2684 | if$ 2685 | } 2686 | 2687 | FUNCTION {bib.sort.order} 2688 | { sort.label 'sort.key$ := 2689 | } 2690 | % END sort code based on unsrtnat.bst 2691 | 2692 | 2693 | 2694 | EXECUTE {init.seq} 2695 | 2696 | ITERATE {presort} 2697 | 2698 | SORT 2699 | 2700 | EXECUTE {initialize.longest.label} 2701 | 2702 | ITERATE {forward.pass} 2703 | REVERSE {reverse.pass} 2704 | 2705 | ITERATE {bib.sort.order} 2706 | 2707 | SORT 2708 | 2709 | EXECUTE {begin.bib} 2710 | ITERATE {call.type$} 2711 | EXECUTE {end.bib} 2712 | 2713 | EXECUTE{completed.message} 2714 | 2715 | 2716 | %% That's all folks, mds. 2717 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Christopher Corley 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PAPER = paper 2 | 3 | CLS_FILES = $(shell find . -name '*.cls') 4 | LATEX_FILES = $(shell find . -name '*.latex') 5 | BIB_FILES = $(shell find . -name '*.bib') 6 | FIG_FILES = $(shell find ./figures) 7 | MD_FILES = $(shell find ./sections -name '*.md' | sort) 8 | EXTRA_FILES = $(shell find ./extra -name '*.md' | sort) 9 | 10 | DEP_FILES = Makefile metadata.yaml $(CLS_FILES) $(BIB_FILES) $(LATEX_FILES) $(MD_FILES) $(FIG_FILES) 11 | 12 | all: $(PAPER).pdf 13 | 14 | .ONESHELL edit: 15 | make view &> /dev/null 16 | while true; \ 17 | do inotifywait -r -e modify,attrib,close_write,move,create,delete . && \ 18 | make; done &> /dev/null & 19 | $(EDITOR) $(MD_FILES) && kill %1 20 | 21 | $(PAPER).pdf: $(PAPER).tex 22 | pdflatex $(PAPER) || bibtex $(PAPER) 23 | bibtex $(PAPER) || pdflatex $(PAPER) 24 | pdflatex $(PAPER) || bibtex $(PAPER) 25 | 26 | $(PAPER).tex: $(DEP_FILES) 27 | pandoc \ 28 | --standalone \ 29 | --natbib \ 30 | --smart \ 31 | --listings \ 32 | --template=./template.latex \ 33 | -H custom.latex \ 34 | --from=markdown \ 35 | metadata.yaml $(MD_FILES) -o $(PAPER).tex || (rm $(PAPER).tex && false) 36 | 37 | tidy: 38 | $(RM) *.aux 39 | $(RM) *.log 40 | $(RM) *.out 41 | $(RM) *.toc 42 | $(RM) *.bbl 43 | $(RM) *.blg 44 | $(RM) *.lot 45 | $(RM) *.lof 46 | $(RM) *.nlo 47 | $(RM) *.nls 48 | $(RM) *.ilg 49 | $(RM) *.run.xml 50 | $(RM) *.bcf 51 | 52 | 53 | clean: tidy 54 | $(RM) $(PAPER).pdf 55 | $(RM) $(PAPER).tex 56 | $(RM) $(PAPER).html 57 | $(RM) -r tmp 58 | 59 | 60 | OS = $(shell uname -s) 61 | ifeq ($(strip $(OS)),Linux) 62 | PDF_VIEW = xdg-open 63 | else 64 | PDF_VIEW = open -a /Applications/Preview.app 65 | endif 66 | 67 | view: $(PAPER).pdf 68 | $(PDF_VIEW) $(PAPER).pdf & 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ieee-pandoc-template 2 | 3 | hi, [welcome to heck](https://youtu.be/Im6A_eTF01s?t=745) 4 | 5 | todo: 6 | - journal 7 | - compsoc 8 | 9 | ## quirks with pandoc & IEEEtrans 10 | 11 | for the most part, this only works in `conference` mode. 12 | 13 | ### tables 14 | 15 | Don't, not yet. Pandoc uses `longtable`, which IEEEtrans explodes. 16 | Just put in tables using pure LaTeX. 17 | 18 | ### figures 19 | 20 | They will work fine if your figure is small and fits in one column. otherwise, 21 | use LaTeX. 22 | 23 | ## usage 24 | 25 | ### metadata 26 | 27 | You'll want to change `metadata.yaml` to reflect things about your paper, such 28 | as authors and the title. 29 | 30 | ### editing 31 | 32 | Put all markdown files into `sections/`. I suggest naming them in a sortable 33 | order, e.g., `01_intro.md`, `02_background.md`, etc. Make sure to include 34 | something like `sections/other.md` as the last file to get a References 35 | section. 36 | 37 | ### compiling the pdf 38 | 39 | Just run `make`. Or look at `Makefile` and draw your own conclusions. 40 | 41 | ### customizing 42 | 43 | If you have some extra packages or LaTeX you want to define, throw it into 44 | `custom.latex`. It'll be inserted before the document environment begins. 45 | 46 | 47 | ### arxiv uploading 48 | 49 | You can upload directly to arxiv after compiling. upload the `paper.tex` and 50 | `paper.bbl` files along with any figures. I set `graphicspath` in 51 | `template.latex` to make the figures folder work on arxiv without needing to 52 | edit stuff, but you can put them wherever suits you in `custom.latex`. 53 | 54 | 55 | ## contributing 56 | 57 | 1. Fork 58 | 2. Edits on a feature branch 59 | 3. Pull request 60 | -------------------------------------------------------------------------------- /custom.latex: -------------------------------------------------------------------------------- 1 | \usepackage{color} 2 | 3 | \definecolor{lightred}{RGB}{175,50,50} 4 | \definecolor{lightgreen}{RGB}{0,150,0} 5 | \definecolor{lightblue}{RGB}{50,50,175} 6 | 7 | \lstdefinelanguage{diff}{ 8 | morecomment=[f][\color{lightblue}]{diff }, 9 | morecomment=[f][\color{lightblue}]{index }, 10 | morecomment=[f][\color{lightblue}]{@@}, % group identifier 11 | morecomment=[f][\color{lightred}]-, % deleted lines 12 | morecomment=[f][\color{lightgreen}]+, % added lines 13 | morecomment=[f][\color{lightblue}]{---}, % Diff header lines (must appear after +,-) 14 | morecomment=[f][\color{lightblue}]{+++}, 15 | } 16 | \hyphenation{} 17 | 18 | \newcommand{\attn}[1]{{\color{red}#1}} 19 | \newcommand{\desc}[1]{{\emph{\color{blue}#1}}} 20 | \newcommand{\needcite}{\attn{\tiny{[cite]}}} 21 | \newcommand{\todo}[1]{\colorbox{yellow}{\bf TODO: #1}} 22 | 23 | 24 | \lstset{ % 25 | basicstyle=\ttfamily\footnotesize, % the size of the fonts that are used for the code 26 | breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace 27 | breaklines=true, % sets automatic line breaking 28 | columns=fixed, 29 | keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible) 30 | numbers=left, % where to put the line-numbers; possible values are (none, left, right) 31 | numbersep=10pt, % how far the line-numbers are from the code 32 | numberstyle=\tiny, % the style that is used for the line-numbers 33 | showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces' 34 | showstringspaces=false, % underline spaces within strings only 35 | showtabs=false, % show tabs within strings adding particular underscores 36 | stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered 37 | tabsize=2, % sets default tabsize to 2 spaces 38 | } 39 | 40 | \urlstyle{rm} 41 | -------------------------------------------------------------------------------- /figures/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cscorley/ieee-pandoc-template/82c7bd6ba37e74b03d6556401824e2ce7b033cbd/figures/example.png -------------------------------------------------------------------------------- /metadata.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | biblio-files: papers 3 | biblio-style: IEEEtranN-nourl # custom BST to ignore URLs in papers.bib 4 | 5 | classoption: 6 | - conference 7 | 8 | title: "Hey hey you you I don't like your ti-tle: An empirical study" 9 | 10 | author: 11 | - name: Christop 12 | affiliation: University of Butts 13 | location: Buttville, USA 14 | email: cscorley@ua.edu 15 | - name: Bubbie, Pigpen 16 | affiliation: Cat Institute 17 | email: \{cat1, cat2\}\@cat.cat 18 | 19 | keyword: 20 | - yeah yeah yeah 21 | - no no no 22 | 23 | graphics: yes 24 | numbersections: yes 25 | 26 | abstract: | 27 | lorem buttsum 28 | 29 | # don't delete this line, bud 30 | ... 31 | 32 | 33 | -------------------------------------------------------------------------------- /sections/main.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | butts [@Corley-etal_2011] and beavis[^1]. 4 | 5 | ![Cool figure](example) {.two} 6 | 7 | [^longnote] 8 | 9 | # Conclusion 10 | 11 | yes, @Corley-etal_2012 confirmed butts [^longnote] 12 | 13 | [^1]: Comical partner of butts. 14 | [^longnote]: See buttocks for longer definition. 15 | -------------------------------------------------------------------------------- /sections/other.md: -------------------------------------------------------------------------------- 1 | # Acknowledgments {-} 2 | 3 | thanks everyone 4 | 5 | # References 6 | -------------------------------------------------------------------------------- /template.latex: -------------------------------------------------------------------------------- 1 | \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{IEEEtran} 2 | 3 | 4 | $if(linestretch)$ 5 | \usepackage{setspace} 6 | \setstretch{$linestretch$} 7 | $endif$ 8 | 9 | \usepackage{amssymb,amsmath} 10 | \usepackage{ifxetex,ifluatex} 11 | \usepackage{fixltx2e} % provides \textsubscript 12 | 13 | \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex 14 | \usepackage[T1]{fontenc} 15 | \usepackage[utf8]{inputenc} 16 | $if(euro)$ 17 | \usepackage{eurosym} 18 | $endif$ 19 | \else % if luatex or xelatex 20 | \ifxetex 21 | \usepackage{mathspec} 22 | \usepackage{xltxtra,xunicode} 23 | \else 24 | \usepackage{fontspec} 25 | \fi 26 | \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} 27 | \newcommand{\euro}{€} 28 | 29 | $if(mainfont)$ 30 | \setmainfont{$mainfont$} 31 | $endif$ 32 | $if(sansfont)$ 33 | \setsansfont{$sansfont$} 34 | $endif$ 35 | $if(monofont)$ 36 | \setmonofont[Mapping=tex-ansi]{$monofont$} 37 | $endif$ 38 | $if(mathfont)$ 39 | \setmathfont(Digits,Latin,Greek){$mathfont$} 40 | $endif$ 41 | 42 | \fi 43 | % use upquote if available, for straight quotes in verbatim environments 44 | \IfFileExists{upquote.sty}{\usepackage{upquote}}{} 45 | % use microtype if available 46 | \IfFileExists{microtype.sty}{% 47 | \usepackage{microtype} 48 | \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts 49 | }{} 50 | 51 | $if(geometry)$ 52 | \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} 53 | $endif$ 54 | 55 | \ifxetex 56 | \usepackage[setpagesize=false, % page size defined by xetex 57 | unicode=false, % unicode breaks when used with xetex 58 | xetex]{hyperref} 59 | \else 60 | \usepackage[unicode=true]{hyperref} 61 | \fi 62 | \hypersetup{breaklinks=true, 63 | bookmarks=true, 64 | pdfauthor={$author-meta$}, 65 | pdftitle={$title-meta$}, 66 | colorlinks=true, 67 | citecolor=$if(citecolor)$$citecolor$$else$blue$endif$, 68 | urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$, 69 | linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$, 70 | pdfborder={0 0 0}} 71 | \urlstyle{same} % don't use monospace font for urls 72 | $if(lang)$ 73 | \ifxetex 74 | \usepackage{polyglossia} 75 | \setmainlanguage{$mainlang$} 76 | \setotherlanguages{$for(otherlang)$$otherlang$$sep$,$endfor$} 77 | \else 78 | \usepackage[shorthands=off,$lang$]{babel} 79 | \fi 80 | $endif$ 81 | $if(natbib)$ 82 | \usepackage[numbers,square]{natbib} 83 | \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$} 84 | $endif$ 85 | 86 | $if(biblatex)$ 87 | \usepackage{biblatex} 88 | $if(biblio-files)$ 89 | \bibliography{$biblio-files$} 90 | $endif$ 91 | $endif$ 92 | 93 | $if(listings)$ 94 | \usepackage{listings} 95 | $endif$ 96 | 97 | $if(lhs)$ 98 | \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} 99 | $endif$ 100 | 101 | $if(highlighting-macros)$ 102 | $highlighting-macros$ 103 | $endif$ 104 | 105 | $if(verbatim-in-note)$ 106 | \usepackage{fancyvrb} 107 | \VerbatimFootnotes 108 | $endif$ 109 | 110 | $if(tables)$ 111 | \usepackage{longtable,booktabs} 112 | $endif$ 113 | 114 | $if(graphics)$ 115 | \usepackage{graphicx,grffile} 116 | \makeatletter 117 | \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} 118 | \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} 119 | \makeatother 120 | % Scale images if necessary, so that they will not overflow the page 121 | % margins by default, and it is still possible to overwrite the defaults 122 | % using explicit options in \includegraphics[width, height, ...]{} 123 | \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} 124 | \graphicspath{ {./figures/} } 125 | $endif$ 126 | 127 | $if(links-as-notes)$ 128 | % Make links footnotes instead of hotlinks: 129 | \renewcommand{\href}[2]{#2\footnote{\url{#1}}} 130 | $endif$ 131 | 132 | $if(strikeout)$ 133 | \usepackage[normalem]{ulem} 134 | % avoid problems with \sout in headers with hyperref: 135 | \pdfstringdefDisableCommands{\renewcommand{\sout}{}} 136 | $endif$ 137 | 138 | \setlength{\parindent}{0pt} 139 | \setlength{\parskip}{6pt plus 2pt minus 1pt} 140 | \setlength{\emergencystretch}{3em} % prevent overfull lines 141 | \providecommand{\tightlist}{% 142 | \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} 143 | $if(numbersections)$ 144 | \setcounter{secnumdepth}{5} 145 | $else$ 146 | \setcounter{secnumdepth}{0} 147 | $endif$ 148 | 149 | $if(verbatim-in-note)$ 150 | \VerbatimFootnotes % allows verbatim text in footnotes 151 | $endif$ 152 | 153 | $if(title)$ 154 | \title{$title$$if(subtitle)$\\\vspace{0.5em}{\large $subtitle$}$endif$} 155 | $endif$ 156 | 157 | $if(author)$ 158 | \author{ 159 | $for(author)$ 160 | \IEEEauthorblockN{$author.name$} 161 | \IEEEauthorblockA{% 162 | $author.affiliation$ \\ 163 | $author.location$ \\ 164 | $author.email$} 165 | $sep$ \and 166 | $endfor$ 167 | } 168 | $endif$ 169 | 170 | \date{$date$} 171 | 172 | $for(header-includes)$ 173 | $header-includes$ 174 | $endfor$ 175 | 176 | % Redefines (sub)paragraphs to behave more like sections 177 | \ifx\paragraph\undefined\else 178 | \let\oldparagraph\paragraph 179 | \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}} 180 | \fi 181 | \ifx\subparagraph\undefined\else 182 | \let\oldsubparagraph\subparagraph 183 | \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}} 184 | \fi 185 | 186 | \begin{document} 187 | $if(title)$ 188 | \maketitle 189 | $endif$ 190 | 191 | $if(abstract)$ 192 | \begin{abstract} 193 | $abstract$ 194 | \end{abstract} 195 | $endif$ 196 | 197 | $if(keyword)$ 198 | \begin{IEEEkeywords} 199 | $for(keyword)$ 200 | $keyword$$sep$; 201 | $endfor$ 202 | \end{IEEEkeywords} 203 | $endif$ 204 | 205 | $for(include-before)$ 206 | $include-before$ 207 | 208 | $endfor$ 209 | 210 | $if(toc)$ 211 | { 212 | \hypersetup{linkcolor=black} 213 | \setcounter{tocdepth}{$toc-depth$} 214 | \tableofcontents 215 | } 216 | $endif$ 217 | $if(lot)$ 218 | \listoftables 219 | $endif$ 220 | $if(lof)$ 221 | \listoffigures 222 | $endif$ 223 | 224 | $body$ 225 | 226 | $if(natbib)$ 227 | $if(biblio-files)$ 228 | $if(biblio-title)$ 229 | $if(book-class)$ 230 | \renewcommand\bibname{$biblio-title$} 231 | $else$ 232 | \renewcommand\refname{$biblio-title$} 233 | $endif$ 234 | $endif$ 235 | \bibliography{$biblio-files$} 236 | 237 | $endif$ 238 | $endif$ 239 | 240 | $if(biblatex)$ 241 | \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$ 242 | $endif$ 243 | 244 | $for(include-after)$ 245 | $include-after$ 246 | $endfor$ 247 | \end{document} 248 | --------------------------------------------------------------------------------