X-Git-Url: http://git.tpope.net/?p=latex-mlastyle.git;a=blobdiff_plain;f=mlastyle.bst;h=15e90d09fa889752d02adc566cd8eedd151b3330;hp=f74f8fd7f2c5931097fb5d5d23c6b0e1a72f1225;hb=83bae224ee37b9f4c40f596dac6a9bb3ba962a5c;hpb=3c18124ab4dde0a032ba1fabb4721b8cf6eb6033 diff --git a/mlastyle.bst b/mlastyle.bst index f74f8fd..15e90d0 100644 --- a/mlastyle.bst +++ b/mlastyle.bst @@ -1,4 +1,5 @@ -% BibTeX standard bibliography style `plain' +% 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. % Copying of this file is authorized only if either @@ -40,7 +41,7 @@ ENTRY { author.duplicate author.shared } { label } -INTEGERS { output.state before.all mid.sentence after.sentence after.block after.title author.different author.last author.flast } +INTEGERS { output.state before.all mid.sentence after.sentence after.block after.title author.different author.last author.flast citealt.used url.used } % Rearranged such that true values require capital letters FUNCTION {init.consts} @@ -54,6 +55,9 @@ FUNCTION {init.consts} #1 'author.last := #2 'author.flast := %#3 'author.firstlast := + + #0 'citealt.used := + #0 'url.used := } STRINGS { s t u } % Added u @@ -616,7 +620,7 @@ FUNCTION {format.url} { "There's a url but no accessdate in " cite$ * warning$ "" } { accessdate " " * } if$ - "$<$" * url * "$>$" * + "$<$\url{" * url * "}$>$" * urlpath empty$ 'skip$ { do.period " Path: " * urlpath * } @@ -637,7 +641,7 @@ FUNCTION {format.article.crossref} %} %{ "In " key * } %if$ - pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$ + pages empty$ { " \citealt" } { " \citealt[" format.chapter.pages * "]" * } if$ "{" * crossref * "}" * } @@ -683,8 +687,7 @@ FUNCTION {format.book.crossref} % } % { format.crossref.editor * } % if$ - %" \citeN{" * crossref * "}" * - pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$ + pages empty$ { " \citealt" } { " \citealt[" format.chapter.pages * "]" * } if$ "{" * crossref * "}" * } @@ -706,8 +709,7 @@ FUNCTION {format.incoll.inproc.crossref} % } % { "In " format.crossref.editor * } % if$ -% " \citeN{" * crossref * "}" * - pages empty$ { " \citeN" } { " \citeN[" format.chapter.pages * "]" * } if$ + pages empty$ { " \citealt" } { " \citealt[" format.chapter.pages * "]" * } if$ "{" * crossref * "}" * } @@ -1364,6 +1366,8 @@ FUNCTION {init.vars} FUNCTION {forward.author.dup.check} { + url empty$ 'skip$ { url.used #1 + 'url.used := } if$ + crossref empty$ 'skip$ { citealt.used #1 + 'citealt.used := } if$ author empty$ { editor empty$ { organization field.or.null 'a := }{ editor 'a :=} if$} { author 'a := } @@ -1456,12 +1460,20 @@ REVERSE {reverse.author} %ITERATE {longest.label.pass} FUNCTION {begin.bib} -{ preamble$ empty$ +{ + citealt.used + { "\ifx\undefined\citealt\let\citealt\cite\fi" write$ newline$ } + 'skip$ + if$ + url.used + { "\ifx\undefined\url\let\url\relax\fi" write$ newline$ } + 'skip$ + if$ + preamble$ empty$ 'skip$ { preamble$ write$ newline$ } if$ "\begin{thebibliography}{\rule{.5in}{0pt}}" write$ newline$ - "\ifx\undefined\citeN\let\citeN\cite\fi" write$ newline$ } EXECUTE {begin.bib}