-% $Id: mlastyle.bst,v 1.12 2003-11-22 05:54:34 tpope Exp $
+% $Id: mlastyle.bst,v 1.13 2003-11-22 19:15:11 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.
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 't :=
+ ""
+ { t empty$ not }
+ { t #1 #2 substring$ "--" =
+ { 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$ *
+ t #2 global.max$ substring$ 't :=
+ }
+ if$
+ }
+ while$
+ }
+ if$
+}
+
+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$ #8 #2 substring$ * }
+ {}
+ if$
+ }
+ {}
+ if$
}
if$
}