The ACM Transactions (acmtrans) bibliography style Glenn Paulley Andrew W. Appel David M. Jones Rebecca L. Davies 30 October 1997 Version 1.5 β Contents 1 Introduction 1 2 Further features of acmtrans 2 3 Modifications and bug fixes from newapa.bst 3 4 To-do list 3 5 The docstrip modules 4 6 The macros 6.1 The field names and useful utilities 6.2 The entry types . . . . . . . . . . . 6.2.1 The article type . . . . . 6.2.2 The book type . . . . . . . 6.2.3 The booklet type . . . . . 6.2.4 The inbook type . . . . . . 6.2.5 The incollection type . . 6.2.6 The inproceedings type . 6.2.7 The conference type . . . 6.2.8 The manual type . . . . . . 6.2.9 The mastersthesis type . 6.2.10 The misc type . . . . . . . 6.2.11 The phdthesis type . . . . 6.2.12 The proceedings type . . . 6.2.13 The techreport type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 22 22 22 23 23 24 25 27 27 27 28 28 28 29 c 1995, all rights reserved. Copying of this file is authorized only if either (1) you make absolutely no changes to your copy, including name, or (2) if you do make changes, you name it something other than “acmtrans.bst”. There are undoubtably bugs in this style. Please send any bug reports, suggestions for improvements, etc., to [email protected]. 1 6.3 6.4 1 6.2.14 The unpublished type . 6.2.15 The default.type type Standard abbreviations . . . . Sorting the entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 29 30 31 Introduction This is the acmtrans BibTEX style, which is based Glenn Paulley’s chicago bibliography style (for further information about the history of this code, please see the comments in chicago.bst). The acmtrans style was hacked by Andrew W. Appel and Rebecca L. Davies of Princeton University, and further modified and reworked by David M. Jones. This style implements an “author-year” bibliography format, where in-text citations have the general form “[author name(s) year]” and the Reference list is sorted alphabetically by the author or whatever passes for author in the absence of one. The style also supports abbreviated author lists in citations. This style must be supplemented by some TEX macros to process the citation information generated by acmtrans. The citation information deposited in the bibliography has the following format: \citeauthoryear{hfull-author-infoi}{habbrev-author-infoi}{hyear i} The LATEX style should define something like the following: \let\@internalcite\cite \def\fullcite{\def\citeauthoryear##1##2##3{##1 ##3}\@internalcite} \def\fullciteA{\def\citeauthoryear##1##2##3{##1}\@internalcite} \def\shortcite{\def\citeauthoryear##1##2##3{##2 ##3}\@internalcite} \def\shortciteA{\def\citeauthoryear##1##2##3{##2}\@internalcite} \def\citeyear{\def\citeauthoryear##1##2##3{##3}\@internalcite} Additional commands to manipulate different components of a citation can be defined so that, for example, you can list author’s names without parentheses if using a citation as a noun or object in a sentence. See the acmart document class for a more complete example. In order to provide more flexibility for use with both LATEX 2.09 and LATEX 2ε , acmtrans uses the following macros for all font changes: \bibsc for small caps \bibemph for italics without an italic correction \bibemphic for italics with an italic correction at the end. For LATEX 2ε , the following is appropriate: \let\bibsc\textsc \let\bibemph\emph \let\bibemphic\emph For LATEX 2.09, the following should do: \newcommand{\bibsc}[1]{{\sc#1}} \newcommand{\bibemph}[1]{{\em#1}} \newcommand{\bibemphic}[1]{{\em#1\/}} 2 One further macro, \bibyear, is needed, to format the year. The following definition is used in the acmart class. See the comments before output.year.check below and before \bibyear in acmart for more information. \newcommand{\bibyear}[2]{% \unskip\quad\ignorespaces#1\unskip \if#2. .\quad \else \quad#2 \fi } These TEX macro definitions are found in the acmart document class. 2 Further features of acmtrans • full names used in citations, but abbreviated citations are available (see above) • if an entry has a “month”, then the month and year are also printed as part of that bibitem. • all conjunctions use “and” instead of “&” • major modification from Chicago Manual of Style (13th ed.) is that only the first author in a reference appears last name first- additional authors appear as J. Q. Public. • pages are listed as “pp. xx-xx” in all entry types except article entries. • book, inbook, and manual use “location: publisher” (or organization) for address and publisher. All other types list publishers separately. • “pp.” are used to identify page numbers for all entry types except articles. • organization is used as a citation label if neither author nor editor is present (for manuals). • “et al.” is used for long author and editor lists, or when “others” is used. 3 Modifications and bug fixes from newapa.bst • added month, year to bib entries if month is present • fixed bug with In proceedings, added necessary comma after title • all conjunctions changed to “and” from “&” • fixed bug with author labels in my.full.label: “et al.” now is generated when “others” is an author name • major modification from Chicago Manual of Style (13th ed.) is that only the first author in a reference appears last name first—additional authors appear as J. Q. Public. • pages are listed as “pp. xx-xx” in all entry types except article entries. Unnecessary (IMHO) “()” around page numbers were removed, and page numbers now don’t end with a period. 3 • created chicago.sty for use with this bibstyle (required). • fixed bugs in format.vol.num.pages for missing volume, number, and/or pages. Renamed to format.jour.vol. • fixed bug in formatting booktitles: additional period an error if book has a volume. • fixed bug: editors usually given redundant period before next clause (format.editors.dot) removed. • added label support for organizations, if both author and editor are missing (from alpha.bst). If organization is too long, then the key field is used for abbreviated citations. • In proceedings or books of several volumes, no comma was written between the “Volume x” and the page numbers (this was intentional in newapa.bst). Fixed. • Some journals may not have volumes/numbers, only month/year (eg. IEEE Computer). Fixed bug in article style that assumed volume/number was always present. 4 To-do list Here are a few of the many things that need to be done to finish this style file. • Figure out what, if any, copyright notice should cover this file. • Decide what parts of the above documentation to keep. Sort out credit issues. • Get style rules from ACM and implement them. • Implement format.proc.publisher and sort out other issues mentioned in connection with inproceedings. • Sort out format.key business. • Munge month to standardize month abbreviations when authors fail to use the standard strings. • Sort out journal abbreviations. • Make .bbl file look more like what the ACM wants for its automatic conversion programs. (In fact, we could output SGML code directly for them, if they’d tell us what they want.) • Rewrite macrocode to index BST macros. 5 The docstrip modules This code uses the following modules: xref driver use crossrefs in the bibliography generate a driver file for the documentation 4 6 The macros 6.1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 The field names and useful utilities ENTRY { address author booktitle chapter edition editor howpublished institution journal key month note number organization pages publisher In addition to the standard fields, we introduce three new fields, pub-year, pub-month and pub-address. These are for use in proceedings, where the year, month and address fields normally refer to the date and location of the conference rather than the publisher. For compatibility with the standard BibTEX styles, we introduce new fields for the publisher information rather than the conference information, although it would probably be more logical for the existing fields always to refer to the publisher and to introduce new fields for the conference information. 18 19 20 21 22 23 24 25 26 27 28 29 pub-year pub-month pub-address school series title type volume year } {} { label.year extra.label sort.year sort.label } 30 31 32 33 34 35 36 37 INTEGERS { output.state before.all mid.sentence after.sentence after.block } init.state.consts 38 39 40 41 FUNCTION {init.state.consts} { #0 ’before.all := #1 ’mid.sentence := #2 ’after.sentence := 5 #3 ’after.block := 42 43 } 44 STRINGS { s t u } output.nonnull 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 output.nonnull.colon FUNCTION {output.nonnull} { ’s := output.state mid.sentence = { ", " * write$ } { output.state after.block = { add.period$ write$ newline$ "\newblock " write$ } { output.state before.all = ’write$ { add.period$ " " * write$ } if$ } if$ mid.sentence ’output.state := } if$ s } Use a colon to separate output. Used only for address/publisher combination in book/inbook types, address/institution for manuals, and organization:publisher for proceedings (inproceedings). 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 FUNCTION {output.nonnull.colon} { ’s := output.state mid.sentence = { ": " * write$ } { output.state after.block = { add.period$ write$ newline$ "\newblock " write$ } { output.state before.all = ’write$ { add.period$ " " * write$ } if$ } if$ mid.sentence ’output.state := } if$ s } output 86 87 FUNCTION {output} { duplicate$ empty$ 6 ’pop$ ’output.nonnull if$ 88 89 90 91 } 92 FUNCTION {output.colon} { duplicate$ empty$ ’pop$ ’output.nonnull.colon if$ } output.colon 93 94 95 96 97 warn.null Issue a warning message if a field is empty. 98 99 100 101 FUNCTION {warn.null} { "empty " swap$ * " in " * cite$ * warning$ } output.check 102 103 104 105 106 107 108 109 110 field.or.null.check FUNCTION {output.check} { ’t := duplicate$ empty$ { pop$ t warn.null } ’output.nonnull if$ } field.or.null.check is similar to field.or.null, but it also issues a warning if the field is null. 111 112 113 114 115 116 117 118 119 FUNCTION {field.or.null.check} { ’t := duplicate$ empty$ { pop$ "" t warn.null } ’skip$ if$ } output.check.colon 126 FUNCTION {output.check.colon} { ’t := duplicate$ empty$ { pop$ t warn.null } ’output.nonnull.colon if$ } 127 FUNCTION {new.block} 120 121 122 123 124 125 new.block 7 128 129 130 131 132 { output.state before.all = ’skip$ { after.block ’output.state := } if$ } new.sentence 133 134 135 136 137 138 139 140 141 142 143 output.year.check FUNCTION {new.sentence} { output.state after.block = ’skip$ { output.state before.all = ’skip$ { after.sentence ’output.state := } if$ } if$ } This is somewhat nasty. We need to put a quad space around the year. Unfortunately, the obvious thing (i.e., putting out “\quadhyear i\quad”) won’t work because the next call to output will add a period after the second \quad. Because of the way BibTEX writes things, it would be difficult to get the \quad in the right place, so instead we cheat by wrapping the year in the macro \bibyear, which is defined in acmart to look ahead one character and, if necessary, move the period before the second quad space. This should be thought about some more. 144 145 146 147 148 149 150 151 152 FUNCTION {output.year.check} { year empty$ { "year" warn.null } { add.period$ write$ " \bibyear{" year * extra.label * "}" * mid.sentence ’output.state := } if$ } fin.entry 153 154 155 156 157 FUNCTION {fin.entry} { add.period$ write$ newline$ } not 162 FUNCTION {not} { { #0 } { #1 } if$ } 163 FUNCTION {and} 158 159 160 161 and 8 164 { 165 166 ’skip$ { pop$ #0 } if$ 167 } 168 FUNCTION {or} { { pop$ #1 } ’skip$ if$ } or 169 170 171 172 new.block.checka 173 174 175 176 177 178 FUNCTION {new.block.checka} { empty$ ’skip$ ’new.block if$ } new.block.checkb 179 180 181 182 183 184 185 186 FUNCTION {new.block.checkb} { empty$ swap$ empty$ and ’skip$ ’new.block if$ } new.sentence.checka 187 188 189 190 191 192 FUNCTION {new.sentence.checka} { empty$ ’skip$ ’new.sentence if$ } new.sentence.checkb 193 194 195 196 197 198 199 200 FUNCTION {new.sentence.checkb} { empty$ swap$ empty$ and ’skip$ ’new.sentence if$ } field.or.null 201 202 203 204 205 206 FUNCTION {field.or.null} { duplicate$ empty$ { pop$ "" } ’skip$ if$ } 9 parenthesize Put parentheses around the top string on the stack. 207 208 209 210 211 212 emphasize Emphasize the top string on the stack. It’s a shame that we can’t assume people are using LATEX 2ε , since the \emph command would be much more convenient here. As it is, we have to try to guess whether or not we will need an italic correction, and use either emphasize or emphasize.ic as appropriate. As a partial solution, we use the macros \bibemph and \bibemphic, which should be defined by the style file. For LATEX 2ε , these can both be equivalent to \emph; for LATEX 2.09, \bibemphic should add an italic correction and \bibemph should not. 213 214 215 216 217 218 219 emphasize.ic 221 222 223 224 225 226 FUNCTION {emphasize.ic} { duplicate$ empty$ { pop$ "" } { "\bibemphic{" swap$ * "}" * } if$ } Put the top string on the stack in small caps. 227 228 229 230 231 232 format.names FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } { "\bibemph{" swap$ * "}" * } if$ } Emphasize the top string on the stack, and add an italic correction. 220 smallcaps FUNCTION {parenthesize} { duplicate$ empty$ { pop$ "" } { " (" swap$ * ")" * } if$ } FUNCTION {smallcaps} { duplicate$ empty$ { pop$ "" } { "\bibsc{" swap$ * "}" * } if$ } Format bibliographical entries with the last name first. All names are formatted in this routine. Also moved “Junior” part to the very end, so that it appears after the first initial instead of before. This function no longer automatically puts its output in smallcaps; that’s left to the functions that call format.names, so we can use format.names to format “internal” editor names. – dmj, 4/28/96 233 INTEGERS { nameptr namesleft numnames } 234 235 236 FUNCTION {format.names} { ’s := 10 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 #1 ’nameptr := % nameptr = 1; s num.names$ ’numnames := % numnames = num.name$(s); numnames ’namesleft := { namesleft #0 > } { % nameptr #1 = % {s nameptr "{vv~}{ll}{, f.}{, jj}" format.name$ ’t := } { s nameptr "{vv~}{ll}{, f.}{, jj}" format.name$ ’t := % } if$ nameptr #1 > { namesleft #1 > { ", " * t * } { numnames #2 > { "," * } ’skip$ if$ t "others" = { " et~al." * } { " and " * t * } % from Chicago Manual of Style if$ } if$ } ’t if$ nameptr #1 + ’nameptr := % nameptr += 1; namesleft #1 - ’namesleft := % namesleft =- 1; } while$ } my.full.label 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 FUNCTION {my.full.label} { ’s := #1 ’nameptr := % nameptr = 1; s num.names$ ’numnames := % numnames = num.name$(s); numnames ’namesleft := { namesleft #0 > } { s nameptr "{vv~}{ll}" format.name$ ’t := % get the next name nameptr #1 > { namesleft #1 > { ", " * t * } { numnames #2 > { "," * } ’skip$ if$ t "others" = { " et~al." * } { " and " * t * } % from Chicago Manual of Style if$ } if$ } ’t 11 if$ nameptr #1 + ’nameptr := namesleft #1 - ’namesleft := 289 290 291 } while$ 292 293 294 format.names.fml } Format names in “familiar” format, with first initial followed by last name. Like format.names, ALL names are formatted. Removed small caps from format.names.fml since it’s used for “internal” editor names, which should be in ordinary text. – dmj, 4/28/96 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 format.authors % nameptr += 1; % namesleft =- 1; FUNCTION {format.names.fml} { ’s := #1 ’nameptr := % nameptr = 1; s num.names$ ’numnames := % numnames = num.name$(s); numnames ’namesleft := { namesleft #0 > } { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ ’t := nameptr #1 > { namesleft #1 > { ", " * t * } { numnames #2 > { "," * } ’skip$ if$ t "others" = { " et~al." * } { " and " * t * } if$ } if$ } ’t if$ nameptr #1 + ’nameptr := % nameptr += 1; namesleft #1 - ’namesleft := % namesleft =- 1; } while$ } Added smallcaps, which used to be inside format.names. – dmj, 4/28/96 323 324 325 326 327 328 FUNCTION {format.authors} { author empty$ { "" } { author format.names smallcaps } if$ } format.key 329 330 331 332 333 FUNCTION {format.key} { empty$ { key field.or.null } { "" } if$ 12 334 format.editors.fml Format editor names for use in the “in” types: inbook, incollection, inproceedings: first initial, then last names. When editors are the LABEL for an entry, then format.editor is used which lists editors by last name first. Removed parens around “Ed.” since that seems to be desired by the ACM. [8/18/95—dmj] 335 336 337 338 339 340 341 342 343 344 345 format.editors } FUNCTION {format.editors.fml} { editor empty$ { "" } { editor format.names.fml editor num.names$ #1 > { ", Eds." * } { ", Ed." * } if$ } if$ } Format editor names for use in labels, last names first. Removed parens around “Ed.” since that seems to be desired by the ACM. [8/18/95—dmj] 346 347 348 349 350 351 352 353 354 355 356 FUNCTION {format.editors} { editor empty$ { "" } { editor format.names smallcaps editor num.names$ #1 > { ", Eds." * } { ", Ed." * } if$ } if$ } format.title 357 358 359 360 361 362 FUNCTION {format.title} { title empty$ { "" } { title "t" change.case$ } if$ } n.dashify 363 364 365 366 367 368 369 370 371 372 FUNCTION {n.dashify} { ’t := "" { t empty$ not } { t #1 #1 substring$ "-" = { t #1 #2 substring$ "--" = not { "--" * t #2 global.max$ substring$ ’t := } { { t #1 #1 substring$ "-" = } 13 { "-" * t #2 global.max$ substring$ ’t := } while$ } if$ 373 374 375 376 377 378 } { t #1 #1 substring$ * t #2 global.max$ substring$ ’t := } if$ } while$ 379 380 381 382 383 384 385 386 } 387 FUNCTION {format.edition} { edition empty$ { "" } { edition " ed." * } if$ } format.edition 388 389 390 391 392 393 format.btitle 394 395 396 397 398 399 400 FUNCTION {format.btitle} { title emphasize "title" output.check new.sentence format.edition output new.sentence } format.emphasize.booktitle 401 402 403 404 405 FUNCTION {format.emphasize.booktitle} { edition empty$ { booktitle emphasize.ic } { booktitle empty$ See above. { booktitle emphasize } { booktitle emphasize.ic edition " ed." * parenthesize * } 406 407 if$ } 408 409 if$ 410 411 tie.or.space.connect } Enhanced so that if the first string is empty, no extra space is put in. It’s not clear that this is really useful, but it shouldn’t hurt. – dmj, 4/28/96 412 413 414 415 FUNCTION {tie.or.space.connect} { swap$ duplicate$ 14 empty$ ’pop$ { swap$ duplicate$ text.length$ #3 < { "~" } { " " } if$ swap$ * * } if$ 416 417 418 419 420 421 422 423 424 425 426 427 428 } 429 FUNCTION {either.or.check} { empty$ ’pop$ { "can’t use both " swap$ * " fields in " * cite$ * warning$ } if$ } either.or.check 430 431 432 433 434 format.bvolume What should be done if there is both a volume and a number in a book? Currently, the number is silently ignored, and only the volume is used. Surely there should at least be some sort of warning message. Besides, if there’s both a number and a series, the series gets printed twice. Must sort this out. 435 436 437 438 439 440 441 format.number.series FUNCTION {format.bvolume} { volume empty$ { "" } { series emphasize " vol." volume tie.or.space.connect * } if$ } Should this be “Series no. 5”? If so, we should be able to merge this with format.bvolume. 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 FUNCTION {format.number.series} { volume empty$ { number empty$ { series field.or.null } { series empty$ { "there’s a number but no series in " cite$ * warning$ } { series " no." number tie.or.space.connect * } if$ } if$ } { "" } if$ } multi.page.check 15 457 INTEGERS { multiresult } 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 format.pages gnp - removed () Removed “pp.” since as far as I can tell, it’s not wanted. – dmj, 4/28/96 478 479 480 481 482 483 484 format.jour.vol FUNCTION {multi.page.check} { ’t := #0 ’multiresult := { multiresult not t empty$ not and } { t #1 #1 substring$ duplicate$ "-" = swap$ duplicate$ "," = swap$ "+" = or or { #1 ’multiresult := } { t #2 global.max$ substring$ ’t := } if$ } while$ multiresult } FUNCTION {format.pages} { pages empty$ { "" } { " " pages n.dashify * } if$ } By Young (and Spencer) GNP - fixed bugs with missing volume, number, and/or pages Format journal, volume, number, pages for article types. 485 486 487 488 489 490 491 492 493 494 495 496 497 498 FUNCTION {format.jour.vol} { journal "journal" field.or.null.check volume empty$ { "volume" warn.null } { volume tie.or.space.connect } if$ emphasize.ic output number field.or.null month parenthesize * output format.pages "pages" output.check } format.chapter.pages 499 500 FUNCTION {format.chapter.pages} { chapter empty$ 16 ’format.pages { type empty$ { "Chapter" } % gnp - changed to mixed case { type "t" change.case$ } if$ chapter tie.or.space.connect pages empty$ {"page numbers missing in " cite$ * warning$}%gnp - added check { ", " * format.pages * } if$ } if$ 501 502 503 504 505 506 507 508 509 510 511 512 513 format.in.ed.booktitle } I think this is backwards; editors should come after booktitle. 514 515 516 517 518 519 520 521 522 523 524 525 526 FUNCTION {format.in.ed.booktitle} { booktitle empty$ { "" } { "In " format.emphasize.booktitle * editor empty$ ’skip$ { ", " * format.editors.fml * } if$ } if$ } format.thesis.type 527 528 529 530 531 532 533 534 FUNCTION {format.thesis.type} { type empty$ ’skip$ { pop$ type "t" change.case$ } if$ } format.thesis.title 535 536 537 538 %% %% %% %% FUNCTION {format.thesis.title} { title field.or.null "t" change.case$ } format.tr.number 539 540 541 542 543 544 545 546 FUNCTION {format.tr.number} { type empty$ { "Technical Report" } ’type if$ number empty$ { "t" change.case$ } { number tie.or.space.connect } 17 if$ 547 548 format.crossref } Merged format.article.crossref and format.incoll.inproc.crossref into a single macro, format.crossref, which has proper spacing. 549 550 551 552 553 554 h∗xrefi FUNCTION {format.crossref} { "See \citeN{" crossref * "}" * } h/xrefi format.crossref.editor 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 h∗xrefi FUNCTION {format.crossref.editor} { editor #1 "{vv~}{ll}" format.name$ editor num.names$ duplicate$ #2 > { pop$ " et~al." * } { #2 < ’skip$ { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = { " et~al." * } { " and " * editor #2 "{vv~}{ll}" format.name$ * } if$ } if$ } if$ } h/xrefi format.book.crossref 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 h∗xrefi FUNCTION {format.book.crossref} { volume empty$ { "empty volume in " cite$ * "’s crossref of " * crossref * warning$ "In " } { "Volume" volume tie.or.space.connect % gnp - changed to mixed case " of " * } if$ editor empty$ editor field.or.null author field.or.null = or { key empty$ { series empty$ { "need editor, key, or series for " cite$ * " to crossref " * crossref * warning$ "" * } { series emphasize.ic } if$ 18 594 595 596 597 598 599 600 601 602 format.lab.names } { key * } if$ } { format.crossref.editor * } if$ " \citeN{" * crossref * "}" * } h/xrefi Determines “short” names for the abbreviated author information. “Long” labels are created in calc.label, using the routine my.full.label to format author and editor fields. There are 4 cases for labels (n = 3 in the example): 1. one author: Foo 2. one to n: Foo, Bar and Baz 3. use of “and others”: Foo, Bar et al. 4. more than n: Foo et al. 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 FUNCTION {format.lab.names} { ’s := s num.names$ ’numnames := numnames #2 > % change number to number of others allowed before % forcing "et al". { s #1 "{vv~}{ll}" format.name$ " et~al." * } { numnames #1 - ’namesleft := #2 ’nameptr := s #1 "{vv~}{ll}" format.name$ { namesleft #0 > } { nameptr numnames = { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" = { " et~al." * } { " and " * s nameptr "{vv~}{ll}" format.name$ * } if$ } { ", " * s nameptr "{vv~}{ll}" format.name$ * } if$ nameptr #1 + ’nameptr := namesleft #1 - ’namesleft := } while$ } if$ } author.key.label 629 630 631 632 FUNCTION {author.key.label} { author empty$ { key empty$ { "no key, author in " cite$ * warning$ 19 cite$ #1 #3 substring$ } ’key 633 634 if$ } { author format.lab.names } if$ 635 636 637 638 639 } 640 FUNCTION {editor.key.label} { editor empty$ { key empty$ { "no key, editor in " cite$ * warning$ cite$ #1 #3 substring$ } ’key if$ } { editor format.lab.names } if$ } editor.key.label 641 642 643 644 645 646 647 648 649 650 author.key.org.label added - gnp. Provide label formatting by organization if author is null. 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 editor.key.org.label FUNCTION {author.key.org.label} { author empty$ { organization empty$ { key empty$ { "no key, author or organization in " cite$ * warning$ cite$ #1 #3 substring$ } ’key if$ } ’organization if$ } { author format.lab.names } if$ } added - gnp. Provide label formatting by organization if editor is null. 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 FUNCTION {editor.key.org.label} { editor empty$ { organization empty$ { key empty$ { "no key, editor or organization in " cite$ * warning$ cite$ #1 #3 substring$ } ’key if$ } ’organization if$ } { editor format.lab.names } if$ } 20 author.editor.key.label 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 calc.label FUNCTION {author.editor.key.label} { author empty$ { editor empty$ { key empty$ { "no key, author, or editor in " cite$ * warning$ cite$ #1 #3 substring$ } ’key if$ } { editor format.lab.names } if$ } { author format.lab.names } if$ } GNP: changed. Form label for BibTEX entry. The classification of which fields are used for which type of entry (book, inbook, etc.) are taken from alpha.bst. The change here from newapa is to also include organization as a citation label if author or editor is missing. See also author.organization.sort, editor.organization.sort. 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 FUNCTION {calc.label} { type$ "book" = type$ "inbook" = or ’author.editor.key.label { type$ "proceedings" = ’editor.key.org.label { type$ "manual" = ’author.key.org.label ’author.key.label if$ } if$ } if$ author empty$ % generate the full label citation information. { editor empty$ { organization empty$ { "no author, editor, or organization in " cite$ * warning$ "??" } ’organization if$ } { editor my.full.label } if$ } { author my.full.label } if$ leave label on the stack, to be popped when required. 724 725 % "}{" * swap$ * "}{" * year field.or.null purify$ #-1 #4 substring$ * 21 save the year for sort processing afterwards (adding a, b, c, etc.) year field.or.null purify$ #-1 #4 substring$ ’label.year := 726 727 728 } 729 FUNCTION {output.bibitem} { newline$ "\bibitem[\protect\citeauthoryear{" write$ calc.label write$ sort.year write$ "}]{" write$ cite$ write$ "}" write$ newline$ "" before.all ’output.state := } output.bibitem 730 731 732 733 734 735 736 737 738 739 740 6.2 6.2.1 The entry types The article type article 741 742 743 744 FUNCTION {article} { output.bibitem format.authors "author" output.check Some but not all types contain the following line. It’s questionable whether it belongs there at all, but if it does, shouldn’t it be in all the types? 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 author format.key output % added output.year.check % added new.block format.title "title" output.check new.block h∗xrefi crossref missing$ { h/xrefi format.jour.vol h∗xrefi } { format.crossref output.nonnull format.pages output } if$ h/xrefi new.block note output fin.entry } 22 6.2.2 The book type book 767 768 769 770 771 772 773 774 775 776 777 FUNCTION {book} { output.bibitem author empty$ { format.editors "author and editor" output.check } { format.authors output.nonnull h∗xrefi crossref missing$ { h/xrefi But what if there really is both an author and an editor, e.g., an edited version of someone else’s book? "author and editor" editor either.or.check 778 779 h∗xrefi } ’skip$ 780 781 if$ 782 783 h/xrefi 784 } if$ output.year.check % added new.block format.btitle % "title" output.check h∗xrefi crossref missing$ { h/xrefi format.bvolume output new.block format.number.series output new.sentence publisher "publisher" output.check address output h∗xrefi } { new.block format.book.crossref output.nonnull } if$ h/xrefi new.block note output fin.entry } 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 6.2.3 The booklet type booklet 23 811 812 813 814 815 816 817 818 819 820 821 822 823 824 FUNCTION {booklet} { output.bibitem format.authors output author format.key output % added output.year.check % added new.block format.title "title" output.check new.block howpublished output address output new.block note output fin.entry } 6.2.4 The inbook type inbook 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 FUNCTION {inbook} { output.bibitem author empty$ { format.editors "author and editor" output.check } { format.authors output.nonnull crossref missing$ { "author and editor" editor either.or.check } ’skip$ if$ } if$ output.year.check % added new.block format.btitle % "title" output.check h∗xrefi crossref missing$ { h/xrefi format.bvolume output format.chapter.pages "chapter and pages" output.check new.block format.number.series output new.sentence publisher "publisher" output.check.colon address output h∗xrefi } { format.chapter.pages "chapter and pages" output.check new.block format.book.crossref output.nonnull } if$ h/xrefi new.block 24 note output fin.entry 861 862 863 } 6.2.5 The incollection type incollection 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 FUNCTION {incollection} { output.bibitem format.authors "author" output.check author format.key output % added output.year.check % added new.block format.title "title" output.check new.block h∗xrefi crossref missing$ { h/xrefi format.in.ed.booktitle "booktitle" output.check format.bvolume output format.number.series output format.chapter.pages output % gnp - was special.output.nonnull % left out comma before page numbers new.sentence address output publisher "publisher" output.check.colon h∗xrefi } { format.crossref output.nonnull format.chapter.pages output } if$ h/xrefi new.block note output fin.entry } 6.2.6 The inproceedings type format.date 896 897 898 899 900 901 902 903 904 905 FUNCTION {format.date} { year empty$ { month empty$ { "" } { "there’s a month but no year in " cite$ * warning$ month } if$ } { month empty$ 25 ’year { month " " * year * } if$ 906 907 908 } if$ 909 910 911 } 912 FUNCTION {format.proc.loc.date} { address field.or.null format.date duplicate$ empty$ ’pop$ { swap$ duplicate$ empty$ ’pop$ { ", " * swap$ * } if$ } if$ parenthesize * } format.proc.loc.date 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 inproceedings Added format.proc.loc.date to format proceedings location and date. Should also add something like format.proc.publisher to handle the pub-year, pub-month and pub-address fields, but should first find out from ACM how such things should be handled. In particular, if year of publication is different from year of conference, which should be used in citation (presumably the year of publication). A related problem is to decide exactly what the year refers to. In the standard styles, if there is a year but no address, the year is assumed to refer to the date of publication, while if there is an address, the address and date are assumed to refer to the conference. For true compatibility with the standard styles, we should probably preserve this distinction. 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 FUNCTION {inproceedings} { output.bibitem format.authors "author" output.check author format.key output % added output.year.check % added new.block format.title "title" output.check new.block h∗xrefi crossref missing$ { h/xrefi format.in.ed.booktitle "booktitle" output.check format.bvolume output format.number.series output % address output format.proc.loc.date %output 26 946 % format.pages output new.sentence organization output publisher output %.colon format.pages output 947 948 949 950 951 952 953 h∗xrefi } { format.crossref output.nonnull format.pages output 954 955 956 957 958 959 960 961 962 } if$ h/xrefi new.block note output fin.entry } 6.2.7 The conference type conference 963 FUNCTION {conference} { inproceedings } 6.2.8 The manual type manual 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 FUNCTION {manual} { output.bibitem author empty$ { editor empty$ { organization "organization" output.check organization format.key output } % if all else fails, use key { format.editors "author and editor" output.check } if$ } { format.authors output.nonnull } if$ output.year.check % added new.block format.btitle % "title" output.check organization address new.block.checkb Reversed the order of “address” and “organization”, added the “:”. 979 980 981 982 983 984 985 986 987 address output organization "organization" output.check.colon % address output % ":" output % organization output new.block note output fin.entry } 27 6.2.9 The mastersthesis type mastersthesis 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 FUNCTION {mastersthesis} { output.bibitem format.authors "author" output.check author format.key output % added output.year.check % added new.block format.title "title" output.check new.block "Master’s thesis" format.thesis.type output.nonnull school "school" output.check address output new.block note output fin.entry } 6.2.10 The misc type misc 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 FUNCTION {misc} { output.bibitem format.authors output author format.key output % added output.year.check % added title howpublished new.block.checkb format.title output new.block howpublished output new.block note output fin.entry } 6.2.11 The phdthesis type phdthesis 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 FUNCTION {phdthesis} { output.bibitem format.authors "author" output.check author format.key output % added output.year.check % added new.block format.btitle % "title" output.check new.block "Ph.\ D. thesis" format.thesis.type output.nonnull school "school" output.check address output new.block note output fin.entry } 28 6.2.12 The proceedings type proceedings 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 FUNCTION {proceedings} { output.bibitem editor empty$ { organization output organization format.key output } { format.editors output.nonnull } if$ % author format.key output % output.year.check new.block format.btitle % "title" output.check format.bvolume output format.number.series output % address output format.proc.loc.date % output new.sentence organization output publisher output.colon new.block note output fin.entry } 6.2.13 % gnp - changed from % author format.key % gnp - removed (should be either editor or organization % added (newapa) The techreport type techreport 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 FUNCTION {techreport} { output.bibitem format.authors "author" output.check author format.key output % added output.year.check % added new.block format.title "title" output.check new.block format.tr.number month empty$ ’skip$ { month parenthesize * } if$ output.nonnull institution "institution" output.check address output new.block note output fin.entry } 29 6.2.14 The unpublished type unpublished 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 FUNCTION {unpublished} { output.bibitem format.authors "author" output.check author format.key output output.year.check new.block format.title "title" output.check new.block note "note" output.check fin.entry } 6.2.15 % added % added The default.type type default.type 1085 FUNCTION {default.type} { misc } 6.3 Standard abbreviations The following abbreviations should all be checked to make sure they correspond to what the ACM wants. 1086 MACRO {jan} {"Jan."} 1087 1088 MACRO {feb} {"Feb."} 1089 1090 MACRO {mar} {"Mar."} 1091 1092 MACRO {apr} {"Apr."} 1093 1094 MACRO {may} {"May"} 1095 1096 MACRO {jun} {"June"} 1097 1098 MACRO {jul} {"July"} 1099 1100 MACRO {aug} {"Aug."} 1101 1102 MACRO {sep} {"Sept."} 1103 1104 MACRO {oct} {"Oct."} 1105 1106 MACRO {nov} {"Nov."} 1107 1108 MACRO {dec} {"Dec."} 1109 1110 MACRO {acmcs} {"ACM Comput. Surv."} MACRO {acta} {"Acta Inf."} MACRO {ai} {"Artif. Intell."} 1111 1112 1113 1114 30 1115 1116 MACRO {cacm} {"Commun. ACM"} MACRO {ibmjrd} {"IBM J. Res. Devel."} MACRO {ibmsj} {"IBM Syst. J."} MACRO {ieeese} {"IEEE Trans. Softw. Eng."} MACRO {ieeetc} {"IEEE Trans. Comput."} 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 MACRO {ieeetcad} {"IEEE Trans. Comput. Aided Des. Integr. Circuits"} 1127 1128 MACRO {ipl} {"Inf. Process. Lett."} MACRO {ic} {"Inf. Comput."} MACRO {jacm} {"J. ACM"} MACRO {jcss} {"J. Comput. Syst. Sci."} MACRO {scp} {"Sci. Comput. Program."} MACRO {sicomp} {"SIAM J. Comput."} MACRO {tocs} {"ACM Trans. Comput. Syst."} MACRO {tods} {"ACM Trans. Database Syst."} MACRO {tog} {"ACM Trans. Graph."} MACRO {toms} {"ACM Trans. Math. Softw."} MACRO {toois} {"ACM Trans. Off. Inf. Syst"} MACRO {tois} {"ACM Trans. Inf. Syst."} MACRO {toplas} {"ACM Trans. Program. Lang. Syst."} MACRO {tcs} {"Theor. Comput. Sci."} 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 READ 6.4 Sorting the entries sortify 1157 1158 1159 1160 1161 FUNCTION {sortify} { purify$ "l" change.case$ } chop.word 31 1162 INTEGERS { len } 1163 1164 1165 1166 1167 1168 1169 1170 1171 FUNCTION {chop.word} { ’s := ’len := s #1 len substring$ = { s len #1 + global.max$ substring$ } ’s if$ } sort.format.names 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 FUNCTION {sort.format.names} { ’s := #1 ’nameptr := "" s num.names$ ’numnames := numnames ’namesleft := { namesleft #0 > } { nameptr #1 > { " " * } ’skip$ if$ s nameptr "{vv{ } }{ll{ }}{ f{ }}{ nameptr numnames = t "others" = and { " et~al" * } { t sortify * } if$ nameptr #1 + ’nameptr := namesleft #1 - ’namesleft := } while$ } jj{ }}" format.name$ ’t := sort.format.title 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 FUNCTION {sort.format.title} { ’t := "A " #2 "An " #3 "The " #4 t chop.word chop.word chop.word sortify #1 global.max$ substring$ } author.sort 1203 1204 1205 1206 1207 1208 1209 FUNCTION {author.sort} { author empty$ { key empty$ { "to sort, need author or key in " cite$ * warning$ "" } { key sortify } if$ 32 } { author sort.format.names } if$ 1210 1211 1212 1213 } 1214 FUNCTION {editor.sort} { editor empty$ { key empty$ { "to sort, need editor or key in " cite$ * warning$ "" } { key sortify } if$ } { editor sort.format.names } if$ } editor.sort 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 author.editor.sort 1226 1227 1228 FUNCTION {author.editor.sort} { author empty$ Removed warning generated by lack of author since there’s nothing wrong with having an editor and no author. – dmj, 4/26/96 { % "missing author in " cite$ * warning$ editor empty$ { key empty$ { "to sort, need author, editor, or key in " cite$ * warning$ "" } { key sortify } if$ } { editor sort.format.names } if$ } { author sort.format.names } 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 if$ 1249 1250 author.organization.sort } added - GNP. Stack author or organization for sorting (from alpha.bst). Unlike alpha.bst, we need entire names, not abbreviations 1251 1252 1253 FUNCTION {author.organization.sort} { author empty$ { organization empty$ 33 { key empty$ { "to sort, need author, organization, or key in " cite$ * warning$ "" } { key sortify } if$ } { organization sortify } if$ 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 } { author sort.format.names } if$ 1264 1265 1266 1267 editor.organization.sort added - GNP. Stack editor or organization for sorting (from alpha.bst). Unlike alpha.bst, we need entire names, not abbreviations 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 presort } FUNCTION {editor.organization.sort} { editor empty$ { organization empty$ { key empty$ { "to sort, need editor, organization, or key in " cite$ * warning$ "" } { key sortify } if$ } { organization sortify } if$ } { editor sort.format.names } if$ } Presort creates the bibentry’s label via a call to calc.label, and then sorts the entries based on entry type. Chicago.bst adds support for including organizations as the sort key; the following is stolen from alpha.bst. 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 FUNCTION {presort} { calc.label sortify % recalculate bibitem label year field.or.null purify$ #-1 #4 substring$ * % add year " " * type$ "book" = type$ "inbook" = or ’author.editor.sort { type$ "proceedings" = ’editor.organization.sort { type$ "manual" = ’author.organization.sort ’author.sort if$ 34 } if$ 1300 1301 } if$ #1 entry.max$ substring$ ’sort.label := sort.label * " " * title field.or.null sort.format.title * #1 entry.max$ substring$ ’sort.key$ := 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 } 1316 ITERATE {presort} % added for newapa % added for newapa % added for newapa 1317 1318 SORT % by label, year, author/editor, title 1319 init.extra.label.stuff 1320 STRINGS { last.label next.extra } 1321 1322 INTEGERS { last.extra.num } 1323 1324 1325 1326 1327 1328 forward.pass FUNCTION {init.extra.label.stuff} { #0 int.to.chr$ ’last.label := "" ’next.extra := #0 ’last.extra.num := } Pass through all entries, comparing current entry to last one. Need to concatenate year to the stack (done by calc.label) to determine if two entries are the same (see presort) 1343 FUNCTION {forward.pass} { last.label calc.label year field.or.null purify$ #-1 #4 substring$ * % add year #1 entry.max$ substring$ = % are they equal? { last.extra.num #1 + ’last.extra.num := last.extra.num int.to.chr$ ’extra.label := } { "a" chr.to.int$ ’last.extra.num := "" ’extra.label := calc.label year field.or.null purify$ #-1 #4 substring$ * % add year #1 entry.max$ substring$ ’last.label := % assign to last.label } if$ } 1344 FUNCTION {reverse.pass} 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 reverse.pass 35 1351 { next.extra "b" = { "a" ’extra.label := } ’skip$ if$ label.year extra.label * ’sort.year := extra.label ’next.extra := } 1352 EXECUTE {init.extra.label.stuff} 1345 1346 1347 1348 1349 1350 1353 1354 ITERATE {forward.pass} 1355 1356 REVERSE {reverse.pass} 1357 1370 FUNCTION {bib.sort.order} { sort.label " " * year field.or.null sortify * " " * title field.or.null sort.format.title * #1 entry.max$ substring$ ’sort.key$ := } 1371 ITERATE {bib.sort.order} bib.sort.order 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1372 1373 SORT % by sort.label, year, title --- giving final bib. order. 1374 1380 FUNCTION {begin.bib} { preamble$ empty$ ’skip$ { preamble$ write$ newline$ } if$ "\begin{thebibliography}{}" write$ newline$ } 1381 EXECUTE {begin.bib} begin.bib 1375 1376 1377 1378 1379 1382 1383 EXECUTE {init.state.consts} 1384 1385 ITERATE {call.type$} 1386 1389 FUNCTION {end.bib} { newline$ "\end{thebibliography}" write$ newline$ } 1390 EXECUTE {end.bib} end.bib 1387 1388 36
© Copyright 2025 Paperzz