X-Git-Url: http://git.tpope.net/?p=latex-mlastyle.git;a=blobdiff_plain;f=mlastyle.bst;h=637853d441a18e3d1d8557c10213d37f9147b0f2;hp=6055ac2adb4d23e2b4e34bec686741b614f01f43;hb=94e66ed8027650d5105bb5435537564567d032d2;hpb=c0f88d764bb0a9b3c2e030210c51bdf2b9f136fa diff --git a/mlastyle.bst b/mlastyle.bst index 6055ac2..637853d 100644 --- a/mlastyle.bst +++ b/mlastyle.bst @@ -1,12 +1,14 @@ -% BibTeX standard bibliography style `plain' +% $Id: mlastyle.bst,v 1.16 2003-11-23 07:08:18 tpope Exp $ +% BibTeX bibliography style `mlastyle' +% Based on BibTeX standard bibliography style `plain' % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09. - % Copyright (C) 1985, all rights reserved. + % Copyright (C) 2003 Tim Pope, 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 % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst. % This restriction helps ensure that all standard styles are identical. - % The file btxbst.doc has the documentation for this style. + % The file mlastyle.dvi has the documentation for this style. ENTRY { address @@ -33,18 +35,22 @@ ENTRY year % New fields url + urldate accessdate urlpath version + % eid isbn issn doi } { author.duplicate author.shared } { label } -INTEGERS { output.state before.all mid.sentence after.sentence after.block after.title author.different author.last author.flast citen.used url.used } +INTEGERS { output.state before.all mid.phrase mid.sentence after.sentence after.block author.different author.last author.flast citealp.used url.used } + +STRINGS { s t u empty.title } % Rearranged such that true values require capital letters FUNCTION {init.consts} -{ #-1 'after.title := +{ #-1 'mid.phrase := #0 'mid.sentence := #1 'before.all := #2 'after.sentence := @@ -55,31 +61,88 @@ FUNCTION {init.consts} #2 'author.flast := %#3 'author.firstlast := - #0 'citen.used := + #0 'citealp.used := #0 'url.used := + " \ \ \ \ \unskip\unskip\unskip\unskip\unskip " 'empty.title := + "" 'empty.title := +} + +% I do this a lot +FUNCTION {duplicate} +{ + duplicate$ + "duplicate should be duplicate$" warning$ +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ } -STRINGS { s t u } % Added u +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +INTEGERS {chars i j} + +% text.length$ does not include braces +% This function is probably a bad idea +FUNCTION {num.chars} +{ + #0 'chars := + { duplicate$ duplicate$ #1 chars substring$ = not } + { duplicate$ duplicate$ text.length$ swap$ #1 chars + substring$ text.length$ - chars + #1 + 'chars := } + while$ + { duplicate$ duplicate$ #1 chars #1 - substring$ = } + { chars #1 - 'chars := } + while$ + pop$ chars +} % Puts the period inside any quotes FUNCTION {do.period} -{ - duplicate$ #-1 #3 substring$ "'''" = - { duplicate$ text.length$ #3 - text.prefix$ add.period$ "'\thinspace''" * } - { duplicate$ #-1 #3 substring$ "''}" = - { #2 global.max$ substring$ duplicate$ - text.length$ #2 - text.prefix$ add.period$ "{" swap$ * "''}" * } - { duplicate$ #-1 #2 substring$ "''" = - { duplicate$ text.length$ #2 - text.prefix$ add.period$ "''" * } - { add.period$ } - if$ +{ + duplicate$ #-1 #2 substring$ "''" = + { #2 'i := + { duplicate$ #-1 i - #11 substring$ "'\thinspace" = } + { i #11 + 'i := } + while$ + duplicate$ #-1 i - global.max$ substring$ + add.period$ swap$ #-1 i substring$ * + } + { + duplicate$ #-1 #3 substring$ "''}" = + { #3 'i := + { duplicate$ #-1 i - #11 substring$ "'\thinspace" = } + { i #11 + 'i := } + while$ + duplicate$ #-1 i - global.max$ substring$ + add.period$ swap$ #-1 i substring$ * } + { add.period$ } if$ } if$ } -% Switched to do.period and added after.title +FUNCTION {do.space} +{ duplicate$ duplicate$ do.period = + { "\ " * } + { " " * } + if$ +} + +% Switched to do.period and added mid.phrase FUNCTION {output.nonnull} { 's := output.state mid.sentence = @@ -91,8 +154,8 @@ FUNCTION {output.nonnull} } { output.state before.all = 'write$ - { output.state after.title = - { " " * write$ } + { output.state mid.phrase = + { do.space write$ } { do.period " " * write$ } if$ } @@ -145,32 +208,14 @@ FUNCTION {new.sentence} if$ } -%FUNCTION {no.comma} -%{ output.state after.block = -% 'skip$ -% { output.state before.all = -% 'skip$ -% { after.title 'output.state := } -% if$ -% } -% if$ -%} - -FUNCTION {not} -{ { #0 } - { #1 } - if$ -} - -FUNCTION {and} -{ 'skip$ - { pop$ #0 } - if$ -} - -FUNCTION {or} -{ { pop$ #1 } +FUNCTION {continue.sentence} +{ output.state after.block = 'skip$ + { output.state before.all = + 'skip$ + { mid.phrase 'output.state := } + if$ + } if$ } @@ -213,10 +258,88 @@ FUNCTION {field.or.null} if$ } +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} + FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } - { "{\em " swap$ * "}" * } + { "\emph{" swap$ * "}" * } + if$ +} + +FUNCTION {enquote} +{ duplicate$ empty$ + { pop$ "" } + { + #1 'i := + #0 'j := + { duplicate$ i #1 substring$ "" = not } + { duplicate$ duplicate$ i #1 substring$ quote$ = + swap$ i #1 - #1 substring$ "\" = not and %" + { duplicate$ #1 i #1 - substring$ swap$ + i #1 + global.max$ substring$ + j + { swap$ duplicate$ #-1 #1 substring$ "'" = + { swap$ "\thinspace'" } + { swap$ "'" } + if$ + #0 'j := + } + { duplicate$ #1 #1 substring$ "`" = + { "`\thinspace" } + { "`" } + if$ + #1 'j := + } + if$ + swap$ * * + } + 'skip$ + if$ + i #1 + 'i := + } + while$ + j #1 = + { "odd number of quotation marks in " cite$ * warning$ } + 'skip$ + if$ + duplicate$ #1 #1 substring$ "`" = + { "``\thinspace" swap$ * } + { "``" swap$ *} + if$ + duplicate$ #-1 #1 substring$ "'" = + { "\thinspace''" * } + { "''" *} + if$ + } + if$ +} + +FUNCTION {selective.emphasize} +{ field.or.null duplicate$ sortify 's := + s #1 #8 substring$ duplicate$ "rev. of " = swap$ "rev.~of " = or + s #1 #9 substring$ "rev.\ of " = or + s "home page" = or + s "america online" = or + 'skip$ + 'emphasize + if$ +} + +FUNCTION {selective.enquote} +{ field.or.null duplicate$ sortify 's := + s #1 #8 substring$ duplicate$ "rev. of " = swap$ "rev.~of " = or + s #1 #9 substring$ "rev.\ of " = or + s "introduction" = or + s "preface" = or + s "forward" = or + s "afterward" = or + s "home page" = or + 'skip$ + 'enquote if$ } @@ -264,8 +387,12 @@ FUNCTION {format.names.beginning} { namesleft #0 > } { nameptr #1 = { s nameptr "{vv~}{ll}{, ff}{, jj}" format.name$ - duplicate$ #1 #1 substring$ "u" change.case$ swap$ - duplicate$ #-1 swap$ text.length$ #1 - substring$ * 't := } + duplicate$ #1 #1 substring$ duplicate$ "{" = + 'skip$ + { "u" change.case$ } + if$ + swap$ #2 global.max$ substring$ * 't := + } { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := } if$ nameptr #1 > @@ -342,14 +469,7 @@ FUNCTION {format.publisher} % Changed to preserve case and use quotes FUNCTION {format.title} -{ title empty$ - { "" } - { title #1 text.prefix$ "`" = - { "``\thinspace" title * "''" * } - { "``" title * "''" *} - if$ - } - if$ +{ title selective.enquote } FUNCTION {n.dashify} @@ -377,6 +497,23 @@ FUNCTION {n.dashify} while$ } +FUNCTION {format.year} +{ year empty$ + { "" } + { year n.dashify + duplicate$ duplicate$ num.chars #10 = + swap$ #5 #2 substring$ "--" = and + { duplicate$ duplicate$ #1 #2 substring$ swap$ #7 #2 substring$ = + { duplicate$ #1 #6 substring$ swap$ #9 #2 substring$ * } + {} + if$ + } + {} + if$ + } + if$ +} + FUNCTION {format.date} { year empty$ { month empty$ @@ -387,21 +524,22 @@ FUNCTION {format.date} if$ } { month empty$ - 'year - { month "~" * year * } + 'format.year + { month do.space format.year * } if$ } if$ } +%INTEGERS {xx} FUNCTION {format.btitle} -{ title emphasize +{ title selective.emphasize } FUNCTION {tie.or.space.connect} { duplicate$ text.length$ #3 < { "~" } - { "\ " } + { do.space } if$ swap$ * * } @@ -413,6 +551,17 @@ FUNCTION {either.or.check} if$ } +FUNCTION {abbreviate} +{ duplicate$ sortify 's := 't := + "" + "10th" "tenth" "9th" "ninth" "8th" "eighth" "7th" "seventh" "6th" "sixth" + "5th" "fifth" "4th" "fourth" "3rd" "third" "2nd" "second" "1st" "first" + "Rev." "revised" "Abr." "abridged" + {duplicate$ empty$ { pop$ #0 }{ #1 } if$ }{ s = { 't := }{ pop$ } if$ } + while$ + t +} + FUNCTION {format.bvolume.or.num.series} { volume empty$ { number empty$ @@ -434,7 +583,7 @@ FUNCTION {format.bvolume.or.num.series} { "Vol." volume tie.or.space.connect series empty$ 'skip$ - { " of " * series emphasize * add.period$ } + { " of " * series selective.emphasize * add.period$ } if$ number empty$ 'skip$ @@ -445,13 +594,6 @@ FUNCTION {format.bvolume.or.num.series} if$ } -FUNCTION {format.number.series} -{ volume empty$ - { "" } - { "" } - if$ -} - % Changed edition to MLA abbreviation FUNCTION {format.edition} { edition empty$ @@ -460,13 +602,16 @@ FUNCTION {format.edition} { "Vers.~" version *} if$ } - { edition "l" change.case$ 's := edition 't := - "" - "10th" "tenth" "9th" "ninth" "8th" "eighth" "7th" "seventh" "6th" "sixth" - "5th" "fifth" "4th" "fourth" "3rd" "third" "2nd" "second" "1st" "first" - {duplicate$ empty$ { pop$ #0 }{ #1 } if$ }{ s = { 't := }{ pop$ } if$ } - while$ - t " ed." * + { edition abbreviate + duplicate$ sortify "revised" = + { pop$ "Rev." } + 'skip$ + if$ + duplicate$ sortify "abridged" = + { pop$ "Abr." } + 'skip$ + if$ + do.space "ed." * "edition and version" version either.or.check } if$ @@ -497,11 +642,57 @@ FUNCTION {multi.page.check} FUNCTION {format.pages} { pages empty$ { "" } - { %pages multi.page.check -% { "pages" pages n.dashify tie.or.space.connect } -% { "page" pages tie.or.space.connect } -% if$ - pages n.dashify + { +% j is positive if pages contains a comma +% (not fully implemented) + #0 'j := + pages n.dashify duplicate$ 't := + { duplicate$ empty$ not } + { + duplicate$ #1 #1 substring$ duplicate$ + "{" = + { j #1 + 'j := } + 'skip$ + if$ + "}" = + { j #1 - 'j := } + 'skip$ + if$ + duplicate$ #1 #2 substring$ ", " = + { j j #0 = + 'j := } + 'skip$ + if$ + #2 global.max$ substring$ + } + while$ + { t empty$ not } + { t #1 #2 substring$ "--" = j not and + { t #3 global.max$ substring$ 't := + duplicate$ num.chars 'i := + "--" * + i t num.chars = + { { i #2 > } + { duplicate$ #1 i #2 - substring$ + t #1 i #2 - substring$ = + { t i #1 - global.max$ substring$ * "" 't := #2 'i := } + { i #1 - 'i := } + if$ + } + while$ + } + 'skip$ + if$ + } + { t #1 #1 substring$ duplicate$ "," = swap$ "-" = or j and + { "+" * "" 't := } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + if$ + } + while$ } if$ } @@ -510,14 +701,15 @@ FUNCTION {format.vol.num.year.pages} { volume empty$ { number empty$ 'skip$ - { "there's a number but no volume in " cite$ * warning$ } + { number n.dashify + "there's a number but no volume in " cite$ * warning$ } if$ format.date } { volume number empty$ 'skip$ - { "." * number * } + { "." * number n.dashify * } if$ " (" * format.date * ")" * } @@ -526,58 +718,41 @@ FUNCTION {format.vol.num.year.pages} 'skip$ { ", " * format.edition * } if$ - pages empty$ + type field.or.null sortify duplicate$ "sec." = swap$ "section" = or + { chapter empty$ + { "section type requires chapter in " cite$ warning$ } + { ", sec." chapter n.dashify tie.or.space.connect } + if$ + } 'skip$ - { ": " * pages n.dashify * } if$ -} - - -FUNCTION {format.vol.num.pages} -{ volume field.or.null - number empty$ + type field.or.null sortify "review" = chapter empty$ not and + { ", sec." chapter n.dashify tie.or.space.connect } 'skip$ - { "(" number * ")" * * - volume empty$ - { "there's a number but no volume in " cite$ * warning$ } - 'skip$ - if$ - } if$ pages empty$ 'skip$ - { duplicate$ empty$ - { pop$ format.pages } - { ":" * pages n.dashify * } - if$ - } + { ": " * format.pages * } if$ } % chapter might be useful if type is set to "pars." FUNCTION {format.chapter.pages} { chapter empty$ + type field.or.null sortify duplicate$ "def." = swap$ "definition" = or + or 'format.pages { type empty$ - { "Chapter" } - { type "t" change.case$ } - if$ - chapter n.dashify tie.or.space.connect - pages empty$ - 'skip$ - { ", " * format.pages * } - if$ - } - if$ -} - -FUNCTION {format.in.ed.booktitle} -{ booktitle empty$ - { "" } - { editor empty$ - { "In " booktitle emphasize * } - { booktitle emphasize add.period$ format.editors.mid * } + { "chapter ignored in " cite$ * warning$ } + { type "t" change.case$ + chapter n.dashify tie.or.space.connect + pages empty$ + 'skip$ + { ", " * } + if$ + } if$ + format.pages * } if$ } @@ -612,122 +787,60 @@ FUNCTION {format.tr.number} if$ } -FUNCTION {format.url} -{ url empty$ - { "" } - { accessdate empty$ - { "There's a url but no accessdate in " cite$ * warning$ "" } - { accessdate " " * } - if$ - "$<$\url{" * url * "}$>$" * - urlpath empty$ - 'skip$ - { do.period " Path: " * urlpath * } - if$ - } +FUNCTION {format.urldate} +{ urldate missing$ + { accessdate empty$ + { cite$ " has no urldate field" * warning$ + "\theurldate" + } + { "accessdate in " cite$ * " is depreciated; use urldate instead" * + warning$ accessdate + } + if$ + } + { urldate } if$ } - -FUNCTION {format.article.crossref} -{ %key empty$ - %{ journal empty$ - %{ "need key or journal for " cite$ * " to crossref " * crossref * - % warning$ - % "" - %} - %{ "In {\em " journal * "\/}" * } - %if$ - %} - %{ "In " key * } - %if$ - pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$ - "{" * crossref * "}" * - citen.used #1 + 'citen.used := -} - -FUNCTION {format.crossref.editor} -{ editor #1 "{vv~}{ll}" format.name$ - editor num.names$ duplicate$ - #2 > - { pop$ " et~al." * } - { #2 < +FUNCTION {output.url} +{ + url empty$ + { urlpath empty$ 'skip$ - { editor #2 "{ff }{vv }{ll}{, jj}" format.name$ "others" = - { " et~al." * } - { " and " * editor #2 "{vv~}{ll}" format.name$ * } - if$ - } + { format.urldate output } if$ } + { format.urldate + " $<$\url{" * url * "}$>$" * + output.nonnull + } + if$ + urlpath empty$ + 'skip$ + { "Path: " urlpath * output.nonnull } if$ } -FUNCTION {format.book.crossref} -{% volume empty$ -% { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ -% "In " -% } -% { "Vol." volume tie.or.space.connect add.period$ -% } -% 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$ - % "" * - %} - %{ "{\em " * series * "\/}" * } - %if$ -% } -% { key * } -% if$ -% } -% { format.crossref.editor * } -% if$ - pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$ - "{" * crossref * "}" * - citen.used #1 + 'citen.used := -} - -FUNCTION {format.incoll.inproc.crossref} -{% editor empty$ -% editor field.or.null author field.or.null = -% or -% { key empty$ -% { booktitle empty$ -% { "need editor, key, or booktitle for " cite$ * " to crossref " * -% crossref * warning$ -% "" -% } -% { "In {\em " booktitle * "\/}" * } -% if$ -% } -% { "In " key * } -% if$ -% } -% { "In " format.crossref.editor * } -% if$ - pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$ +FUNCTION {format.crossref} +{ + pages empty$ { "\citealp" } { "\citealp[" format.chapter.pages * "]" * } if$ "{" * crossref * "}" * - citen.used #1 + 'citen.used := } + FUNCTION {cite.title} { title empty$ journal empty$ not and - { key empty$ { journal }{ key } if$ emphasize } + { key empty$ { journal }{ key } if$ selective.emphasize } { title empty$ key empty$ and { "empty title and key in " cite$ * warning$ "" } { key empty$ {title}{key} if$ type$ "book" = + type$ "booklet" = type$ "inbook" = type$ "manual" = type$ "phdthesis" = type$ "proceedings" = - or or or or - { emphasize } + or or or or or + { selective.emphasize } { type$ "article" = %type$ "booklet" = type$ "incollection" = @@ -737,7 +850,7 @@ FUNCTION {cite.title} type$ "techreport" = type$ "unpublished" = or or or or or or - {"``" swap$ * "''" * } + { selective.enquote } {} if$ } @@ -764,21 +877,26 @@ FUNCTION {cite.label} { author } if$ duplicate$ empty$ - { pop$ cite.title } - { + { cite.title * + "(" * empty.title * ")" * } + { duplicate$ author.shared author.different = - { "{vv~}{ll}" format.names.custom } + { "{vv~}{ll}" format.names.custom 's := } { author.shared author.last = - { "{f.~}{vv~}{ll}{, jj}" format.names.custom } + { "{f.~}{vv~}{ll}{, jj}" format.names.custom 's := } { author.shared author.flast = - { "{ff~}{vv~}{ll}{, jj}" format.names.custom } - { "{vv~}{ll}" format.names.custom ", " * cite.title * } + { "{ff~}{vv~}{ll}{, jj}" format.names.custom 's := } + { "{vv~}{ll}" format.names.custom ", " * + cite.title * 's := "WTF" warning$ } if$ } if$ } if$ - author.duplicate { ", " * cite.title * }{} if$ + s + "(" * empty.title * + author.duplicate { cite.title * }{} if$ + "){" * swap$ "{ff~}{vv~}{ll}{, jj}" format.names.custom * "}" * } if$ %} @@ -808,17 +926,47 @@ FUNCTION {article} format.title "title" output.check new.block crossref missing$ - { journal emphasize "journal" output.check after.title 'output.state := - %format.date "year" output.check - %edition output + { type empty$ + 'skip$ + { type sortify "review" = + { "Rev.\ of " booktitle selective.emphasize * + "booktitle" output.check new.block + } + { "Ignoring invalid type in " cite$ warning$ } + if$ + } + if$ + journal selective.emphasize "journal" output.check + continue.sentence + address empty$ + 'skip$ + { "[" address * "]" * output + continue.sentence + } + if$ + series empty$ + 'skip$ + { series sortify + duplicate$ "new" = + { "ns" } + { duplicate$ "old" = + { "os" } + { series abbreviate do.space "ser." * "l" change.case$ } + if$ + } + if$ + output.nonnull + continue.sentence + } + if$ format.vol.num.year.pages output } - { format.article.crossref output.nonnull + { format.crossref output.nonnull %format.pages output } if$ new.block - format.url output + output.url new.block note output fin.entry @@ -832,9 +980,9 @@ FUNCTION {book} if$ new.block format.btitle "title" output.check - new.sentence + new.block crossref missing$ - { author empty$ 'skip$ { format.editors.mid output new.sentence } if$ + { author empty$ 'skip$ { format.editors.mid output new.block } if$ format.edition output new.sentence format.bvolume.or.num.series output @@ -844,11 +992,11 @@ FUNCTION {book} } {% format.date "year" output new.block - format.book.crossref output.nonnull + format.crossref output.nonnull } if$ new.block - format.url output + output.url new.block note output fin.entry @@ -858,7 +1006,7 @@ FUNCTION {booklet} { output.bibitem format.authors output new.block - format.title "title" output.check + format.btitle "title" output.check howpublished address new.block.checkb howpublished output address output @@ -878,7 +1026,7 @@ FUNCTION {inbook} format.btitle "title" output.check new.block crossref missing$ - { author empty$ 'skip$ { format.editors.mid output new.sentence } if$ + { author empty$ 'skip$ { format.editors.mid output new.block } if$ format.edition output new.sentence format.bvolume.or.num.series output @@ -889,13 +1037,13 @@ FUNCTION {inbook} format.chapter.pages "chapter and pages" output.check %address output } - {% format.chapter.pages "chapter and pages" output.check + { new.block - format.book.crossref output.nonnull + format.crossref output.nonnull } if$ new.block - format.url output + output.url note output fin.entry } @@ -905,15 +1053,19 @@ FUNCTION {incollection} format.authors "author" output.check chapter empty$ { new.block type output } - {} + 'skip$ if$ new.block format.title "title" output.check + type field.or.null sortify duplicate$ "definition" = swap$ "def." = or + { new.block "Def.~" chapter field.or.null * "chapter" output.check } + 'skip$ + if$ new.block crossref missing$ { - booktitle emphasize "booktitle" output.check - new.sentence + booktitle selective.emphasize "booktitle" output.check + new.block format.editors.mid "editor" output.check new.block format.edition output @@ -923,15 +1075,15 @@ FUNCTION {incollection} format.publisher "publisher" output.check %address output format.date "year" output.check - new.sentence + new.block format.chapter.pages output } - { format.incoll.inproc.crossref output.nonnull + { format.crossref output.nonnull %format.chapter.pages output } if$ new.block - format.url output + output.url new.block note output fin.entry @@ -944,11 +1096,11 @@ FUNCTION {inproceedings} format.title "title" output.check new.block crossref missing$ - { %format.in.ed.booktitle "booktitle" output.check + { booktitle "booktitle" output.check new.sentence format.editors.mid output - new.sentence + new.block format.edition output new.sentence format.bvolume.or.num.series output @@ -973,12 +1125,11 @@ FUNCTION {inproceedings} new.sentence format.pages output } - { format.incoll.inproc.crossref output.nonnull - %format.pages output + { format.crossref output.nonnull } if$ new.block - format.url output + output.url new.block note output fin.entry @@ -1000,7 +1151,7 @@ FUNCTION {manual} if$ new.block format.btitle "title" output.check - new.sentence + new.block format.edition output new.sentence author empty$ @@ -1018,7 +1169,7 @@ FUNCTION {manual} if$ format.date output new.block - format.url output + output.url new.block note output fin.entry @@ -1031,12 +1182,12 @@ FUNCTION {mastersthesis} format.title "title" output.check new.block "Diss." format.thesis.type output.nonnull - after.title 'output.state := + new.block school "school" output.check address output format.date "year" output.check new.block - format.url output + output.url new.block note output fin.entry @@ -1052,7 +1203,7 @@ FUNCTION {misc} howpublished output format.date output new.block - format.url output + output.url new.block note output fin.entry @@ -1066,12 +1217,12 @@ FUNCTION {phdthesis} format.btitle "title" output.check new.block "Diss." format.thesis.type output.nonnull - after.title 'output.state := + new.block school "school" output.check address output format.date "year" output.check new.block - format.url output + output.url new.block note output fin.entry @@ -1085,7 +1236,7 @@ FUNCTION {proceedings} if$ new.block format.btitle "title" output.check - new.sentence + new.block format.bvolume.or.num.series output address empty$ { editor empty$ @@ -1108,7 +1259,7 @@ FUNCTION {proceedings} } if$ new.block - format.url output + output.url new.block note output fin.entry @@ -1121,6 +1272,7 @@ FUNCTION {techreport} format.title "title" output.check new.block format.tr.number output.nonnull + new.block institution "institution" output.check address output format.date "year" output.check @@ -1135,7 +1287,7 @@ FUNCTION {unpublished} new.block format.title "title" output.check new.block - format.url output + output.url new.block note "note" output.check format.date output @@ -1168,6 +1320,8 @@ MACRO {nov} {"Nov."} MACRO {dec} {"Dec."} +% Currently left in to help with compatibility + MACRO {acmcs} {"ACM Computing Surveys"} MACRO {acta} {"Acta Informatica"} @@ -1211,11 +1365,6 @@ MACRO {tcs} {"Theoretical Computer Science"} READ -FUNCTION {sortify} -{ purify$ - "l" change.case$ -} - INTEGERS { len } FUNCTION {chop.word} @@ -1253,7 +1402,14 @@ FUNCTION {sort.format.title} { 't := "A " #2 "An " #3 - "The " #4 t chop.word + "The " #4 + "Rev. of " #8 + "Rev.~of " #8 + "Rev.\ of " #9 + t chop.word + chop.word + chop.word + chop.word chop.word chop.word sortify @@ -1357,7 +1513,6 @@ ITERATE {presort} SORT STRINGS {a b} -INTEGERS {i j} FUNCTION {init.vars} { #0 int.to.chr$ 'a := @@ -1366,10 +1521,14 @@ FUNCTION {init.vars} #0 'j := } +% Function name is not strictly accurate FUNCTION {forward.author.dup.check} { - url empty$ 'skip$ { url.used #1 + 'url.used := } if$ - crossref empty$ 'skip$ { citen.used #1 + 'citen.used := } if$ + url empty$ urlpath empty$ urldate empty$ and and + 'skip$ + { url.used #1 + 'url.used := } + if$ + crossref empty$ 'skip$ { citealp.used #1 + 'citealp.used := } if$ author empty$ { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$} { author 'a := } @@ -1463,12 +1622,18 @@ REVERSE {reverse.author} FUNCTION {begin.bib} { - citen.used - { "\ifx\undefined\citeN\let\citeN\cite\fi" write$ newline$ } + citealp.used + { "\expandafter\ifx\csname citealp\endcsname\relax\let\citealp\cite\fi" + write$ newline$ + } 'skip$ if$ url.used - { "\ifx\undefined\url\let\url\relax\fi" write$ newline$ } + { "\providecommand\url[1]{\texttt{#1}}" + write$ newline$ + "\providecommand\theurldate{\today}" + write$ newline$ + } 'skip$ if$ preamble$ empty$