summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/acmart/ACM-Reference-Format.bst
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-02-09 03:01:29 +0000
committerNorbert Preining <norbert@preining.info>2020-02-09 03:01:29 +0000
commitce124d96f4bfa21c13a9803a0c4c9eecdf11c130 (patch)
tree6c33bd2b021ad3fd95a009b3bfe4300e51435c10 /macros/latex/contrib/acmart/ACM-Reference-Format.bst
parent9fe464819ed0a8c536f116bb55dbd39dd32cd904 (diff)
CTAN sync 202002090301
Diffstat (limited to 'macros/latex/contrib/acmart/ACM-Reference-Format.bst')
-rw-r--r--macros/latex/contrib/acmart/ACM-Reference-Format.bst42
1 files changed, 40 insertions, 2 deletions
diff --git a/macros/latex/contrib/acmart/ACM-Reference-Format.bst b/macros/latex/contrib/acmart/ACM-Reference-Format.bst
index fa5273282a..8b97b18812 100644
--- a/macros/latex/contrib/acmart/ACM-Reference-Format.bst
+++ b/macros/latex/contrib/acmart/ACM-Reference-Format.bst
@@ -426,6 +426,44 @@ FUNCTION { output.coden } % UTAH
if$
}
+%
+% Sometimes articleno starts with the word 'Article' or 'Paper.
+% (this is a bug of acmdl, sigh)
+% We strip them. We assume eid or articleno is already on stack
+%
+
+FUNCTION { strip.articleno.or.eid }
+{
+ 't :=
+ t #1 #7 substring$ "Article" =
+ {t #8 t text.length$ substring$ 't :=}
+ { }
+ if$
+ t #1 #7 substring$ "article" =
+ {t #8 t text.length$ substring$ 't :=}
+ { }
+ if$
+ t #1 #5 substring$ "Paper" =
+ {t #6 t text.length$ substring$ 't :=}
+ { }
+ if$
+ t #1 #5 substring$ "paper" =
+ {t #6 t text.length$ substring$ 't :=}
+ { }
+ if$
+ % Strip any left trailing space or ~
+ t #1 #1 substring$ " " =
+ {t #2 t text.length$ substring$ 't :=}
+ { }
+ if$
+ t #1 #1 substring$ "~" =
+ {t #2 t text.length$ substring$ 't :=}
+ { }
+ if$
+ t
+}
+
+
FUNCTION { format.articleno }
{
articleno empty.or.unknown not eid empty.or.unknown not and
@@ -441,8 +479,8 @@ FUNCTION { format.articleno }
{ }
if$
eid empty.or.unknown
- { "Article \bibinfo{articleno}{" articleno * "}" * }
- { "Article \bibinfo{articleno}{" eid * "}" * }
+ { "Article \bibinfo{articleno}{" articleno strip.articleno.or.eid * "}" * }
+ { "Article \bibinfo{articleno}{" eid strip.articleno.or.eid * "}" * }
if$
}
if$