├── ACM-Reference-Format.bst ├── Makefile ├── README.md ├── acmart.cls ├── body.tex ├── figures └── mouse.pdf ├── paper.tex └── reference.bib /ACM-Reference-Format.bst: -------------------------------------------------------------------------------- 1 | %%% -*-BibTeX-*- 2 | %%% ==================================================================== 3 | %%% @BibTeX-style-file{ 4 | %%% author = "Nelson H. F. Beebe, Boris Veytsman and Gerald Murray", 5 | %%% version = "2.1", 6 | %%% date = "14 June 2017", 7 | %%% filename = "ACM-Reference-Format.bst", 8 | %%% email = "borisv@lk.net, boris@varphi.com", 9 | %%% codetable = "ISO/ASCII", 10 | %%% keywords = "ACM Transactions bibliography style; BibTeX", 11 | %%% license = "public domain", 12 | %%% supported = "yes", 13 | %%% abstract = "", 14 | %%% } 15 | %%% ==================================================================== 16 | 17 | %%% Revision history: see source in git 18 | 19 | ENTRY 20 | { address 21 | advisor 22 | archiveprefix 23 | author 24 | booktitle 25 | chapter 26 | city 27 | date 28 | edition 29 | editor 30 | eprint 31 | howpublished 32 | institution 33 | journal 34 | key 35 | month 36 | note 37 | number 38 | organization 39 | pages 40 | primaryclass 41 | publisher 42 | school 43 | series 44 | title 45 | type 46 | volume 47 | year 48 | % New keys recognized 49 | issue % UTAH: used in, e.g., ACM SIGSAM Bulletin and ACM Communications in Computer Algebra 50 | articleno 51 | eid 52 | day % UTAH: needed for newspapers, weeklies, bi-weeklies 53 | doi % UTAH 54 | url % UTAH 55 | bookpages % UTAH 56 | numpages 57 | lastaccessed % UTAH: used only for @Misc{...} 58 | coden % UTAH 59 | isbn % UTAH 60 | isbn-13 % UTAH 61 | issn % UTAH 62 | lccn % UTAH 63 | } 64 | {} 65 | { label.year extra.label sort.year sort.label basic.label.year} 66 | 67 | INTEGERS { output.state before.all mid.sentence after.sentence after.block } 68 | 69 | INTEGERS { show-isbn-10-and-13 } % initialized below in begin.bib 70 | 71 | INTEGERS { nameptr namesleft numnames } 72 | 73 | INTEGERS { multiresult } 74 | 75 | INTEGERS { len } 76 | 77 | INTEGERS { last.extra.num } 78 | 79 | STRINGS { s t t.org u } 80 | 81 | STRINGS { last.label next.extra } 82 | 83 | STRINGS { p1 p2 p3 page.count } 84 | 85 | 86 | FUNCTION { not } 87 | { 88 | { #0 } 89 | { #1 } 90 | if$ 91 | } 92 | 93 | FUNCTION { and } 94 | { 95 | 'skip$ 96 | { pop$ #0 } 97 | if$ 98 | } 99 | 100 | FUNCTION { or } 101 | { 102 | { pop$ #1 } 103 | 'skip$ 104 | if$ 105 | } 106 | 107 | 108 | FUNCTION { dump.stack.1 } 109 | { 110 | duplicate$ "STACK[top] = [" swap$ * "]" * warning$ 111 | } 112 | 113 | FUNCTION { dump.stack.2 } 114 | { 115 | duplicate$ "STACK[top ] = [" swap$ * "]" * warning$ 116 | swap$ 117 | duplicate$ "STACK[top-1] = [" swap$ * "]" * warning$ 118 | swap$ 119 | } 120 | 121 | FUNCTION { empty.or.unknown } 122 | { 123 | %% Examine the top stack entry, and push 1 if it is empty, or 124 | %% consists only of whitespace, or is a string beginning with two 125 | %% queries (??), and otherwise, push 0. 126 | %% 127 | %% This function provides a replacement for empty$, with the 128 | %% convenient feature that unknown values marked by two leading 129 | %% queries are treated the same as missing values, and thus, do not 130 | %% appear in the output .bbl file, and yet, their presence in .bib 131 | %% file(s) serves to mark values which are temporarily missing, but 132 | %% are expected to be filled in eventually once more data is 133 | %% obtained. The TeX User Group and BibNet bibliography archives 134 | %% make extensive use of this practice. 135 | %% 136 | %% An empty string cannot serve the same purpose, because just as in 137 | %% statistics data processing, an unknown value is not the same as an 138 | %% empty value. 139 | %% 140 | %% At entry: stack = ... top:[string] 141 | %% At exit: stack = ... top:[0 or 1] 142 | 143 | duplicate$ empty$ 144 | { pop$ #1 } 145 | { #1 #2 substring$ "??" = } 146 | if$ 147 | } 148 | 149 | FUNCTION { writeln } 150 | { 151 | %% In BibTeX style files, the sequences 152 | %% 153 | %% ... "one" "two" output 154 | %% ... "one" "two" output.xxx 155 | %% 156 | %% ship "one" to the output file, possibly following by punctuation, 157 | %% leaving the stack with 158 | %% 159 | %% ... "two" 160 | %% 161 | %% There is thus a one-string lag in output processing that must be 162 | %% carefully handled to avoid duplicating a string in the output 163 | %% file. Unless otherwise noted, all output.xxx functions leave 164 | %% just one new string on the stack, and that model should be born 165 | %% in mind when reading or writing function code. 166 | %% 167 | %% BibTeX's asynchronous buffering of output from strings from the 168 | %% stack is confusing because newline$ bypasses the buffer. It 169 | %% would have been so much easier for newline to be a character 170 | %% rather than a state of the output-in-progress. 171 | %% 172 | %% The documentation in btxhak.dvi is WRONG: it says 173 | %% 174 | %% newline$ Writes onto the bbl file what's accumulated in the 175 | %% output buffer. It writes a blank line if and only 176 | %% if the output buffer is empty. Since write$ does 177 | %% reasonable line breaking, you should use this 178 | %% function only when you want a blank line or an 179 | %% explicit line break. 180 | %% 181 | %% write$ Pops the top (string) literal and writes it on the 182 | %% output buffer (which will result in stuff being 183 | %% written onto the bbl file when the buffer fills 184 | %% up). 185 | %% 186 | %% Examination of the BibTeX source code shows that write$ does 187 | %% indeed behave as claimed, but newline$ sends a newline character 188 | %% directly to the output file, leaving the stack unchanged. The 189 | %% first line "Writes onto ... buffer." is therefore wrong. 190 | %% 191 | %% The original BibTeX style files almost always use "write$ newline$" 192 | %% in that order, so it makes sense to hide that pair in a private 193 | %% function like this one, named after a statement in Pascal, 194 | %% the programming language embedded in the BibTeX Web program. 195 | 196 | write$ % output top-of-stack string 197 | newline$ % immediate write of newline (not via stack) 198 | } 199 | 200 | FUNCTION { init.state.consts } 201 | { 202 | #0 'before.all := 203 | #1 'mid.sentence := 204 | #2 'after.sentence := 205 | #3 'after.block := 206 | } 207 | 208 | FUNCTION { output.nonnull } 209 | { % Stack in: ... R S T Stack out: ... R T File out: S 210 | 's := 211 | output.state mid.sentence = 212 | { 213 | ", " * write$ 214 | } 215 | { 216 | output.state after.block = 217 | { 218 | add.period$ writeln 219 | "\newblock " write$ 220 | } 221 | { 222 | output.state before.all = 223 | { 224 | write$ 225 | } 226 | { 227 | add.period$ " " * write$ 228 | } 229 | if$ 230 | } 231 | if$ 232 | mid.sentence 'output.state := 233 | } 234 | if$ 235 | s 236 | } 237 | 238 | FUNCTION { output.nonnull.dot.space } 239 | { % Stack in: ... R S T Stack out: ... R T File out: S 240 | 's := 241 | output.state mid.sentence = % { ". " * write$ } 242 | { 243 | ". " * write$ 244 | } 245 | { 246 | output.state after.block = 247 | { 248 | add.period$ writeln "\newblock " write$ 249 | } 250 | { 251 | output.state before.all = 252 | { 253 | write$ 254 | } 255 | { 256 | add.period$ " " * write$ 257 | } 258 | if$ 259 | } 260 | if$ 261 | mid.sentence 'output.state := 262 | } 263 | if$ 264 | s 265 | } 266 | 267 | FUNCTION { output.nonnull.remove } 268 | { % Stack in: ... R S T Stack out: ... R T File out: S 269 | 's := 270 | output.state mid.sentence = 271 | { 272 | " " * write$ 273 | } 274 | { 275 | output.state after.block = 276 | { 277 | add.period$ writeln "\newblock " write$ 278 | } 279 | { 280 | output.state before.all = 281 | { 282 | write$ 283 | } 284 | { 285 | add.period$ " " * write$ 286 | } 287 | if$ 288 | } 289 | if$ 290 | mid.sentence 'output.state := 291 | } 292 | if$ 293 | s 294 | } 295 | 296 | FUNCTION { output.nonnull.removenospace } 297 | { % Stack in: ... R S T Stack out: ... R T File out: S 298 | 's := 299 | output.state mid.sentence = 300 | { 301 | "" * write$ 302 | } 303 | { 304 | output.state after.block = 305 | { 306 | add.period$ writeln "\newblock " write$ 307 | } 308 | { 309 | output.state before.all = 310 | { 311 | write$ 312 | } 313 | { 314 | add.period$ " " * write$ 315 | } 316 | if$ 317 | } 318 | if$ 319 | mid.sentence 'output.state := 320 | } 321 | if$ 322 | s 323 | } 324 | 325 | FUNCTION { output } 326 | { % discard top token if empty, else like output.nonnull 327 | duplicate$ empty.or.unknown 328 | 'pop$ 329 | 'output.nonnull 330 | if$ 331 | } 332 | 333 | FUNCTION { output.dot.space } 334 | { % discard top token if empty, else like output.nonnull.dot.space 335 | duplicate$ empty.or.unknown 336 | 'pop$ 337 | 'output.nonnull.dot.space 338 | if$ 339 | } 340 | 341 | FUNCTION { output.removenospace } 342 | { % discard top token if empty, else like output.nonnull.removenospace 343 | duplicate$ empty.or.unknown 344 | 'pop$ 345 | 'output.nonnull.removenospace 346 | if$ 347 | } 348 | 349 | FUNCTION { output.check } 350 | { % like output, but warn if key name on top-of-stack is not set 351 | 't := 352 | duplicate$ empty.or.unknown 353 | { pop$ "empty " t * " in " * cite$ * warning$ } 354 | 'output.nonnull 355 | if$ 356 | } 357 | 358 | FUNCTION { bibinfo.output.check } 359 | { % like output.check, adding bibinfo field 360 | 't := 361 | duplicate$ empty.or.unknown 362 | { pop$ "empty " t * " in " * cite$ * warning$ } 363 | { "\bibinfo{" t "}{" * * swap$ * "}" * 364 | output.nonnull } 365 | if$ 366 | } 367 | 368 | FUNCTION { output.check.dot.space } 369 | { % like output.dot.space, but warn if key name on top-of-stack is not set 370 | 't := 371 | duplicate$ empty.or.unknown 372 | { pop$ "empty " t * " in " * cite$ * warning$ } 373 | 'output.nonnull.dot.space 374 | if$ 375 | } 376 | 377 | FUNCTION { fin.block } 378 | { % functionally, but not logically, identical to fin.entry 379 | add.period$ 380 | writeln 381 | } 382 | 383 | FUNCTION { fin.entry } 384 | { 385 | add.period$ 386 | writeln 387 | } 388 | 389 | FUNCTION { new.sentence } 390 | { % update sentence state, with neither output nor stack change 391 | output.state after.block = 392 | 'skip$ 393 | { 394 | output.state before.all = 395 | 'skip$ 396 | { after.sentence 'output.state := } 397 | if$ 398 | } 399 | if$ 400 | } 401 | 402 | FUNCTION { fin.sentence } 403 | { 404 | add.period$ 405 | write$ 406 | new.sentence 407 | "" 408 | } 409 | 410 | FUNCTION { new.block } 411 | { 412 | output.state before.all = 413 | 'skip$ 414 | { after.block 'output.state := } 415 | if$ 416 | } 417 | 418 | FUNCTION { output.coden } % UTAH 419 | { % output non-empty CODEN as one-line sentence (stack untouched) 420 | coden empty.or.unknown 421 | { } 422 | { "\showCODEN{" coden * "}" * writeln } 423 | if$ 424 | } 425 | 426 | FUNCTION { format.articleno } 427 | { 428 | articleno empty.or.unknown not eid empty.or.unknown not and 429 | { "Both articleno and eid are defined for " cite$ * warning$ } 430 | 'skip$ 431 | if$ 432 | articleno empty.or.unknown eid empty.or.unknown and 433 | { "" } 434 | { 435 | numpages empty.or.unknown 436 | { "articleno or eid field, but no numpages field, in " 437 | cite$ * warning$ } 438 | { } 439 | if$ 440 | eid empty.or.unknown 441 | { "Article \bibinfo{articleno}{" articleno * "}" * } 442 | { "Article \bibinfo{articleno}{" eid * "}" * } 443 | if$ 444 | } 445 | if$ 446 | } 447 | 448 | FUNCTION { format.year } 449 | { % push year string or "[n. d.]" onto output stack 450 | %% Because year is a mandatory field, we always force SOMETHING 451 | %% to be output 452 | "\bibinfo{year}{" 453 | year empty.or.unknown 454 | { "[n. d.]" } 455 | { year } 456 | if$ 457 | * "}" * 458 | } 459 | 460 | FUNCTION { format.day.month } 461 | { % push "day month " or "month " or "" onto output stack 462 | day empty.or.unknown 463 | { 464 | month empty.or.unknown 465 | { "" } 466 | { "\bibinfo{date}{" month * "} " *} 467 | if$ 468 | } 469 | { 470 | month empty.or.unknown 471 | { "" } 472 | { "\bibinfo{date}{" day * " " * month * "} " *} 473 | if$ 474 | } 475 | if$ 476 | } 477 | 478 | FUNCTION { format.day.month.year } % UTAH 479 | { % if month is empty, push "" else push "(MON.)" or "(DD MON.)" 480 | % Needed for frequent periodicals: 2008. ... New York Times C-1, C-2, C-17 (23 Oct.) 481 | % acm-*.bst addition: prefix parenthesized date string with 482 | % ", Article nnn " 483 | articleno empty.or.unknown eid empty.or.unknown and 484 | { "" } 485 | { output.state after.block = 486 | {", " format.articleno * } 487 | { format.articleno } 488 | if$ 489 | } 490 | if$ 491 | " (" * format.day.month * format.year * ")" * 492 | } 493 | 494 | FUNCTION { output.day.month.year } % UTAH 495 | { % if month is empty value, do nothing; else output stack top and 496 | % leave with new top string "(MON.)" or "(DD MON.)" 497 | % Needed for frequent periodicals: 2008. ... New York Times C-1, C-2, C-17 (23 Oct.) 498 | format.day.month.year 499 | output.nonnull.remove 500 | } 501 | 502 | FUNCTION { strip.doi } % UTAH 503 | { % Strip any Web address prefix to recover the bare DOI, leaving the 504 | % result on the output stack, as recommended by CrossRef DOI 505 | % documentation. 506 | % For example, reduce "http://doi.acm.org/10.1145/1534530.1534545" to 507 | % "10.1145/1534530.1534545". That is later typeset and displayed as 508 | % doi:10.1145/1534530.1534545 as the LAST item in the reference list 509 | % entry. Publisher Web sites wrap this with a suitable link to a real 510 | % URL to resolve the DOI, and the master https://doi.org/ address is 511 | % preferred, since publisher-specific URLs can disappear in response 512 | % to economic events. All journals are encouraged by the DOI 513 | % authorities to use that typeset format and link procedures for 514 | % uniformity across all publications that include DOIs in reference 515 | % lists. 516 | % The numeric prefix is guaranteed to start with "10.", so we use 517 | % that as a test. 518 | % 2017-02-04 Added stripping of https:// (Boris) 519 | doi #1 #3 substring$ "10." = 520 | { doi } 521 | { 522 | doi 't := % get modifiable copy of DOI 523 | 524 | % Change https:// to http:// to strip both prefixes (BV) 525 | 526 | t #1 #8 substring$ "https://" = 527 | { "http://" t #9 t text.length$ #8 - substring$ * 't := } 528 | { } 529 | if$ 530 | 531 | t #1 #7 substring$ "http://" = 532 | { 533 | t #8 t text.length$ #7 - substring$ 't := 534 | 535 | "INTERNAL STYLE-FILE ERROR" 's := 536 | 537 | % search for next "/" and assign its suffix to s 538 | 539 | { t text.length$ } 540 | { 541 | t #1 #1 substring$ "/" = 542 | { 543 | % save rest of string as true DOI (should be 10.xxxx/yyyy) 544 | t #2 t text.length$ #1 - substring$ 's := 545 | "" 't := % empty string t terminates the loop 546 | } 547 | { 548 | % discard first character and continue loop: t <= substring(t,2,last) 549 | t #2 t text.length$ #1 - substring$ 't := 550 | } 551 | if$ 552 | } 553 | while$ 554 | 555 | % check for valid DOI (should be 10.xxxx/yyyy) 556 | s #1 #3 substring$ "10." = 557 | { } 558 | { "unrecognized DOI substring " s * " in DOI value [" * doi * "]" * warning$ } 559 | if$ 560 | 561 | s % push the stripped DOI on the output stack 562 | 563 | } 564 | { 565 | "unrecognized DOI value [" doi * "]" * warning$ 566 | doi % push the unrecognized original DOI on the output stack 567 | } 568 | if$ 569 | } 570 | if$ 571 | } 572 | 573 | % 574 | % Change by BV: added standard prefix to URL 575 | % 576 | FUNCTION { output.doi } % UTAH 577 | { % output non-empty DOI as one-line sentence (stack untouched) 578 | doi empty.or.unknown 579 | { } 580 | { 581 | %% NB: We want URLs at beginning of line to reduce likelihood of 582 | %% BibTeX's nasty line wrapping after column 79, which then requires 583 | %% manual (or automated) editing of the .bbl file to repair. 584 | %% The \url{} macro strips percent-newlines, and is thus safe in 585 | %% the presence of the line wrapping, but \path|...| and 586 | %% \verb|...| do not. 587 | "\showDOI{%" writeln 588 | "\url{https://doi.org/" strip.doi * "}}" * writeln 589 | } 590 | if$ 591 | } 592 | 593 | FUNCTION { output.isbn } % UTAH 594 | { % output non-empty ISBN-10 and/or ISBN-13 as one-line sentences (stack untouched) 595 | show-isbn-10-and-13 596 | { 597 | %% show both 10- and 13-digit ISBNs 598 | isbn empty.or.unknown 599 | { } 600 | { 601 | "\showISBNx{" isbn * "}" * writeln 602 | } 603 | if$ 604 | isbn-13 empty.or.unknown 605 | { } 606 | { 607 | "\showISBNxiii{" isbn-13 * "}" * writeln 608 | } 609 | if$ 610 | } 611 | { 612 | %% show 10-digit ISBNs only if 13-digit ISBNs not available 613 | isbn-13 empty.or.unknown 614 | { 615 | isbn empty.or.unknown 616 | { } 617 | { 618 | "\showISBNx{" isbn * "}" * writeln 619 | } 620 | if$ 621 | } 622 | { 623 | "\showISBNxiii{" isbn-13 * "}" * writeln 624 | } 625 | if$ 626 | } 627 | if$ 628 | } 629 | 630 | FUNCTION { output.issn } % UTAH 631 | { % output non-empty ISSN as one-line sentence (stack untouched) 632 | issn empty.or.unknown 633 | { } 634 | { "\showISSN{" issn * "}" * writeln } 635 | if$ 636 | } 637 | 638 | FUNCTION { output.issue } 639 | { % output non-empty issue number as a one-line sentence (stack untouched) 640 | issue empty.or.unknown 641 | { } 642 | { "Issue " issue * "." * writeln } 643 | if$ 644 | } 645 | 646 | FUNCTION { output.lccn } % UTAH 647 | { % return with stack untouched 648 | lccn empty.or.unknown 649 | { } 650 | { "\showLCCN{" lccn * "}" * writeln } 651 | if$ 652 | } 653 | 654 | FUNCTION { output.note } % UTAH 655 | { % return with stack empty 656 | note empty.or.unknown 657 | { } 658 | { "\shownote{" note add.period$ * "}" * writeln } 659 | if$ 660 | } 661 | 662 | FUNCTION { output.note.check } % UTAH 663 | { % return with stack empty 664 | note empty.or.unknown 665 | { "empty note in " cite$ * warning$ } 666 | { "\shownote{" note add.period$ * "}" * writeln } 667 | if$ 668 | } 669 | 670 | FUNCTION { output.eprint } % 671 | { % return with stack empty 672 | eprint empty.or.unknown 673 | { } 674 | { "\showeprint" 675 | archiveprefix empty.or.unknown 676 | { } 677 | { "[" archiveprefix "l" change.case$ "]" * * * } 678 | if$ 679 | "{" * 680 | primaryclass empty.or.unknown 681 | { } 682 | { primaryclass "/" * *} 683 | if$ 684 | eprint "}" * * 685 | writeln 686 | } 687 | if$ 688 | } 689 | 690 | 691 | % 692 | % Changes by BV 2011/04/15. Do not output 693 | % url if doi is defined 694 | % 695 | FUNCTION { output.url } % UTAH 696 | { % return with stack untouched 697 | % output URL and associated lastaccessed fields 698 | doi empty.or.unknown 699 | { 700 | url empty.or.unknown 701 | { } 702 | { 703 | %% NB: We want URLs at beginning of line to reduce likelihood of 704 | %% BibTeX's nasty line wrapping after column 79, which would require 705 | %% manual (or automated) editing of the .bbl file to repair. However, 706 | %% the \url{} macro handles the unwrapping job automatically. 707 | "\showURL{%" writeln 708 | lastaccessed empty.or.unknown 709 | { "" } 710 | { "Retrieved " lastaccessed * " from " * } 711 | if$ 712 | 713 | %% The URL field may contain a semicolon-separated list of Web 714 | %% addresses, and we locate and wrap each of them in \url{...}. 715 | %% The simplistic approach of putting the entire list into the 716 | %% macro argument is that the semicolons are typeset in a 717 | %% typewriter font, and no space follows them. 718 | %% 719 | %% We therefore replace the original code 720 | %% "\url{" * url * "}}" * writeln 721 | %% with this character-at-a-time loop: 722 | 723 | "\url{" * 724 | 725 | url 't := % get modifiable copy of URL list 726 | 727 | { t text.length$ } 728 | { 729 | t #1 #1 substring$ ";" = 730 | { % then split argument at separator 731 | "};" * writeln 732 | "\url{" 733 | } 734 | { % else concatenate nonblank character to argument 735 | t #1 #1 substring$ " " = 736 | { } 737 | { t #1 #1 substring$ * } 738 | if$ 739 | } 740 | if$ 741 | 742 | t #2 t text.length$ #1 - substring$ 't := 743 | } 744 | while$ 745 | 746 | "}}" * writeln 747 | } 748 | if$ 749 | } 750 | { } 751 | if$ 752 | } 753 | 754 | FUNCTION { output.year.check } 755 | { % warn if year empty, output top string and leave " YEAR