From 5f0c5924c5dd800f6daf5c825becada3edea76a8 Mon Sep 17 00:00:00 2001 From: Zeping Lee Date: Mon, 13 May 2024 16:47:41 +0800 Subject: [PATCH] Ignore case when check DOI in URL (discussion#952) --- thuthesis-author-year.bst | 30 ++++++++++++++++-------------- thuthesis-bachelor.bst | 30 ++++++++++++++++-------------- thuthesis-numeric.bst | 30 ++++++++++++++++-------------- 3 files changed, 48 insertions(+), 42 deletions(-) diff --git a/thuthesis-author-year.bst b/thuthesis-author-year.bst index 9a46a4e4..93540a2e 100644 --- a/thuthesis-author-year.bst +++ b/thuthesis-author-year.bst @@ -602,12 +602,17 @@ FUNCTION {format.name} { bbl.et.al } { t get.str.lang 'name.lang := name.lang lang.en = - { t #1 "{vv~}{ll}{ f{~}}" format.name$ + { t #1 "{vv~}{ll}" format.name$ uppercase.name - { "u" change.case$ } + { t #1 #1 substring$ "{" = + t #1 "{ff}" format.name$ empty$ not and + { "\MakeUppercase{" swap$ * "}" * } + { "u" change.case$ } + if$ + } 'skip$ if$ - t #1 "{, jj}" format.name$ * + t #1 "{ f{~}}{, jj}" format.name$ * } { t #1 "{ll}{ff}" format.name$ } if$ @@ -1314,7 +1319,7 @@ FUNCTION {extract.after.slash} FUNCTION {format.year} { year empty$ not - { year extract.before.slash extra.label * } + { year extra.label * } { date empty$ not { date extract.before.dash extra.label * } { entry.is.electronic not @@ -1544,9 +1549,10 @@ FUNCTION {is.in.url} { #1 } { entry.url empty$ { #0 } - { s text.length$ 'len := - entry.url text.length$ 'charptr := - { entry.url charptr len substring$ s = not + { s "l" change.case$ 's := + s text.length$ 'len := + entry.url "l" change.case$ text.length$ 'charptr := + { entry.url "l" change.case$ charptr len substring$ s = not charptr #0 > and } @@ -2073,7 +2079,7 @@ FUNCTION {map} FUNCTION {manual} { monograph } -FUNCTION {thesis} +FUNCTION {mastersthesis} { "D" set.entry.mark monograph } @@ -2088,9 +2094,7 @@ FUNCTION {online} electronic } -FUNCTION {mastersthesis} { thesis } - -FUNCTION {phdthesis} { thesis } +FUNCTION {phdthesis} { mastersthesis } FUNCTION {proceedings} { "C" set.entry.mark @@ -2107,13 +2111,11 @@ FUNCTION {standard} misc } -FUNCTION {report} +FUNCTION {techreport} { "R" set.entry.mark misc } -FUNCTION {techreport} { report } - FUNCTION {unpublished} { misc } FUNCTION {default.type} { misc } diff --git a/thuthesis-bachelor.bst b/thuthesis-bachelor.bst index 67e1f7ee..7a3dd617 100644 --- a/thuthesis-bachelor.bst +++ b/thuthesis-bachelor.bst @@ -592,12 +592,17 @@ FUNCTION {format.name} { bbl.et.al } { t get.str.lang 'name.lang := name.lang lang.en = - { t #1 "{vv~}{ll}{ f{~}}" format.name$ + { t #1 "{vv~}{ll}" format.name$ uppercase.name - { "u" change.case$ } + { t #1 #1 substring$ "{" = + t #1 "{ff}" format.name$ empty$ not and + { "\MakeUppercase{" swap$ * "}" * } + { "u" change.case$ } + if$ + } 'skip$ if$ - t #1 "{, jj}" format.name$ * + t #1 "{ f{~}}{, jj}" format.name$ * } { t #1 "{ll}{ff}" format.name$ } if$ @@ -1304,7 +1309,7 @@ FUNCTION {extract.after.slash} FUNCTION {format.year} { year empty$ not - { year extract.before.slash extra.label * } + { year extra.label * } { date empty$ not { date extract.before.dash extra.label * } { entry.is.electronic not @@ -1534,9 +1539,10 @@ FUNCTION {is.in.url} { #1 } { entry.url empty$ { #0 } - { s text.length$ 'len := - entry.url text.length$ 'charptr := - { entry.url charptr len substring$ s = not + { s "l" change.case$ 's := + s text.length$ 'len := + entry.url "l" change.case$ text.length$ 'charptr := + { entry.url "l" change.case$ charptr len substring$ s = not charptr #0 > and } @@ -2063,7 +2069,7 @@ FUNCTION {map} FUNCTION {manual} { monograph } -FUNCTION {thesis} +FUNCTION {mastersthesis} { "D" set.entry.mark monograph } @@ -2078,9 +2084,7 @@ FUNCTION {online} electronic } -FUNCTION {mastersthesis} { thesis } - -FUNCTION {phdthesis} { thesis } +FUNCTION {phdthesis} { mastersthesis } FUNCTION {proceedings} { "C" set.entry.mark @@ -2097,13 +2101,11 @@ FUNCTION {standard} misc } -FUNCTION {report} +FUNCTION {techreport} { "R" set.entry.mark misc } -FUNCTION {techreport} { report } - FUNCTION {unpublished} { misc } FUNCTION {default.type} { misc } diff --git a/thuthesis-numeric.bst b/thuthesis-numeric.bst index b27da61e..81f7a5f3 100644 --- a/thuthesis-numeric.bst +++ b/thuthesis-numeric.bst @@ -592,12 +592,17 @@ FUNCTION {format.name} { bbl.et.al } { t get.str.lang 'name.lang := name.lang lang.en = - { t #1 "{vv~}{ll}{ f{~}}" format.name$ + { t #1 "{vv~}{ll}" format.name$ uppercase.name - { "u" change.case$ } + { t #1 #1 substring$ "{" = + t #1 "{ff}" format.name$ empty$ not and + { "\MakeUppercase{" swap$ * "}" * } + { "u" change.case$ } + if$ + } 'skip$ if$ - t #1 "{, jj}" format.name$ * + t #1 "{ f{~}}{, jj}" format.name$ * } { t #1 "{ll}{ff}" format.name$ } if$ @@ -1304,7 +1309,7 @@ FUNCTION {extract.after.slash} FUNCTION {format.year} { year empty$ not - { year extract.before.slash extra.label * } + { year extra.label * } { date empty$ not { date extract.before.dash extra.label * } { entry.is.electronic not @@ -1534,9 +1539,10 @@ FUNCTION {is.in.url} { #1 } { entry.url empty$ { #0 } - { s text.length$ 'len := - entry.url text.length$ 'charptr := - { entry.url charptr len substring$ s = not + { s "l" change.case$ 's := + s text.length$ 'len := + entry.url "l" change.case$ text.length$ 'charptr := + { entry.url "l" change.case$ charptr len substring$ s = not charptr #0 > and } @@ -2063,7 +2069,7 @@ FUNCTION {map} FUNCTION {manual} { monograph } -FUNCTION {thesis} +FUNCTION {mastersthesis} { "D" set.entry.mark monograph } @@ -2078,9 +2084,7 @@ FUNCTION {online} electronic } -FUNCTION {mastersthesis} { thesis } - -FUNCTION {phdthesis} { thesis } +FUNCTION {phdthesis} { mastersthesis } FUNCTION {proceedings} { "C" set.entry.mark @@ -2097,13 +2101,11 @@ FUNCTION {standard} misc } -FUNCTION {report} +FUNCTION {techreport} { "R" set.entry.mark misc } -FUNCTION {techreport} { report } - FUNCTION {unpublished} { misc } FUNCTION {default.type} { misc }