From 6a7aa628fac83636b2b227231f5c35aff61aad50 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 22 Nov 2003 19:15:11 +0000 Subject: [PATCH] Shortened page ranges Created format.year --- mlastyle.bst | 54 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/mlastyle.bst b/mlastyle.bst index fb0778a..83f4b76 100644 --- a/mlastyle.bst +++ b/mlastyle.bst @@ -1,4 +1,4 @@ -% $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. @@ -589,11 +589,53 @@ 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 '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$ } -- 2.30.2