From 9f330a618669009499851c3f36f444df2e210821 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 9 Feb 2020 22:06:29 +0000 Subject: acmart (9feb20) git-svn-id: svn://tug.org/texlive/trunk@53734 c570f23f-e606-0410-a88d-b1316a301751 --- .../bibtex/bst/acmart/ACM-Reference-Format.bst | 42 ++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'Master/texmf-dist/bibtex') diff --git a/Master/texmf-dist/bibtex/bst/acmart/ACM-Reference-Format.bst b/Master/texmf-dist/bibtex/bst/acmart/ACM-Reference-Format.bst index fa5273282a1..8b97b188124 100644 --- a/Master/texmf-dist/bibtex/bst/acmart/ACM-Reference-Format.bst +++ b/Master/texmf-dist/bibtex/bst/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$ -- cgit v1.2.3