Skip to content

Commit ab081ba

Browse files
committed
Update bib format of preprint (#488)
1 parent a1f0aa5 commit ab081ba

File tree

4 files changed

+154
-123
lines changed

4 files changed

+154
-123
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Changed
1111

1212
- 移除图表清单中章之间的空行([#486](https://github.com/ustctug/ustcthesis/issues/486))。
13+
- 更新参考文献表的预印本格式([#488](https://github.com/ustctug/ustcthesis/issues/488))。
1314

1415
### Fixed
1516

ustcthesis-authoryear.bst

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ INTEGERS {
4747
show.urldate
4848
show.url
4949
show.doi
50-
show.preprint
5150
show.note
5251
show.english.translation
5352
end.with.period
@@ -94,7 +93,6 @@ FUNCTION {load.config}
9493
#1 'show.urldate :=
9594
#0 'show.url :=
9695
#0 'show.doi :=
97-
#1 'show.preprint :=
9896
#0 'show.note :=
9997
#0 'show.english.translation :=
10098
#1 'end.with.period :=
@@ -1692,7 +1690,40 @@ FUNCTION {get.journal.title}
16921690
}
16931691

16941692
FUNCTION {check.arxiv.preprint}
1695-
{ #1 #5 substring$ purify$ "l" change.case$ "arxiv" =
1693+
{ "l" change.case$
1694+
duplicate$
1695+
"arxiv:" 'y :=
1696+
'x :=
1697+
y text.length$ 'len :=
1698+
x text.length$ len - #1 + 'charptr :=
1699+
{ charptr #0 >
1700+
x charptr len substring$ y = not
1701+
and
1702+
}
1703+
{ charptr #1 - 'charptr := }
1704+
while$
1705+
charptr #0 >
1706+
{ x charptr #6 + global.max$ substring$ 'x :=
1707+
x text.length$ #1 + 'len :=
1708+
#1 'charptr :=
1709+
{ charptr len <
1710+
x charptr #1 substring$ " " = not and
1711+
x charptr #1 substring$ "[" = not and
1712+
}
1713+
{ charptr #1 + 'charptr := }
1714+
while$
1715+
x #1 charptr substring$
1716+
duplicate$ empty$
1717+
{ pop$ }
1718+
{ "https://arxiv.org/abs/" swap$ * 'entry.url :=
1719+
#1 'entry.is.electronic :=
1720+
#1 'is.pure.electronic :=
1721+
}
1722+
if$
1723+
}
1724+
'skip$
1725+
if$
1726+
purify$ #1 #5 substring$ "arxiv" =
16961727
{ #1 }
16971728
{ #0 }
16981729
if$
@@ -2245,35 +2276,18 @@ FUNCTION {check.electronic}
22452276
if$
22462277
}
22472278

2248-
FUNCTION {format.eprint}
2279+
FUNCTION {format.eprinttype}
22492280
{ archivePrefix empty$ not
22502281
{ archivePrefix }
22512282
{ eprinttype empty$ not
2252-
{ archivePrefix }
2253-
{ "" }
2254-
if$
2255-
}
2256-
if$
2257-
's :=
2258-
s empty$ not
2259-
{ s ": \eprint{" *
2260-
url empty$ not
2261-
{ url }
2262-
{ "https://" s "l" change.case$ * ".org/abs/" * eprint * }
2283+
{ eprinttype }
2284+
{ type$ "article" = get.journal.title check.arxiv.preprint and
2285+
{ "arXiv" }
2286+
{ "" }
2287+
if$
2288+
}
22632289
if$
2264-
* "}{" *
2265-
eprint * "}" *
22662290
}
2267-
{ eprint }
2268-
if$
2269-
}
2270-
2271-
FUNCTION {output.eprint}
2272-
{ show.preprint eprint empty$ not and
2273-
{ new.block
2274-
format.eprint output
2275-
}
2276-
'skip$
22772291
if$
22782292
}
22792293

@@ -2587,27 +2601,21 @@ FUNCTION {preprint}
25872601
}
25882602
'skip$
25892603
if$
2590-
format.translators output
2591-
new.sentence
25922604
format.edition output
25932605
new.block
2594-
year.after.author not
2595-
{ date empty$
2596-
{ format.date output }
2597-
'skip$
2606+
format.eprinttype output
2607+
date empty$ not
2608+
{ "(" date * ")" * }
2609+
{ year empty$ not
2610+
{ "(" year * ")" * }
2611+
{ "" }
25982612
if$
25992613
}
2600-
'skip$
26012614
if$
2602-
format.pages bbl.pages.colon output.after
2603-
format.editdate "" output.after
2615+
" " output.after
26042616
format.urldate "" output.after
2605-
output.eprint
26062617
output.url
2607-
show.preprint not eprint empty$ or
2608-
'output.doi
2609-
'skip$
2610-
if$
2618+
output.doi
26112619
new.block
26122620
format.note output
26132621
fin.entry
@@ -2712,6 +2720,8 @@ FUNCTION {online}
27122720

27132721
FUNCTION {phdthesis} { mastersthesis }
27142722

2723+
FUNCTION {thesis} { mastersthesis }
2724+
27152725
FUNCTION {proceedings}
27162726
{ "C" set.entry.mark
27172727
monograph

ustcthesis-bachelor.bst

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ INTEGERS {
4747
show.urldate
4848
show.url
4949
show.doi
50-
show.preprint
5150
show.note
5251
show.english.translation
5352
end.with.period
@@ -89,7 +88,6 @@ FUNCTION {load.config}
8988
#1 'show.urldate :=
9089
#0 'show.url :=
9190
#0 'show.doi :=
92-
#1 'show.preprint :=
9391
#0 'show.note :=
9492
#0 'show.english.translation :=
9593
#1 'end.with.period :=
@@ -1682,7 +1680,40 @@ FUNCTION {get.journal.title}
16821680
}
16831681

16841682
FUNCTION {check.arxiv.preprint}
1685-
{ #1 #5 substring$ purify$ "l" change.case$ "arxiv" =
1683+
{ "l" change.case$
1684+
duplicate$
1685+
"arxiv:" 'y :=
1686+
'x :=
1687+
y text.length$ 'len :=
1688+
x text.length$ len - #1 + 'charptr :=
1689+
{ charptr #0 >
1690+
x charptr len substring$ y = not
1691+
and
1692+
}
1693+
{ charptr #1 - 'charptr := }
1694+
while$
1695+
charptr #0 >
1696+
{ x charptr #6 + global.max$ substring$ 'x :=
1697+
x text.length$ #1 + 'len :=
1698+
#1 'charptr :=
1699+
{ charptr len <
1700+
x charptr #1 substring$ " " = not and
1701+
x charptr #1 substring$ "[" = not and
1702+
}
1703+
{ charptr #1 + 'charptr := }
1704+
while$
1705+
x #1 charptr substring$
1706+
duplicate$ empty$
1707+
{ pop$ }
1708+
{ "https://arxiv.org/abs/" swap$ * 'entry.url :=
1709+
#1 'entry.is.electronic :=
1710+
#1 'is.pure.electronic :=
1711+
}
1712+
if$
1713+
}
1714+
'skip$
1715+
if$
1716+
purify$ #1 #5 substring$ "arxiv" =
16861717
{ #1 }
16871718
{ #0 }
16881719
if$
@@ -2235,35 +2266,18 @@ FUNCTION {check.electronic}
22352266
if$
22362267
}
22372268

2238-
FUNCTION {format.eprint}
2269+
FUNCTION {format.eprinttype}
22392270
{ archivePrefix empty$ not
22402271
{ archivePrefix }
22412272
{ eprinttype empty$ not
2242-
{ archivePrefix }
2243-
{ "" }
2244-
if$
2245-
}
2246-
if$
2247-
's :=
2248-
s empty$ not
2249-
{ s ": \eprint{" *
2250-
url empty$ not
2251-
{ url }
2252-
{ "https://" s "l" change.case$ * ".org/abs/" * eprint * }
2273+
{ eprinttype }
2274+
{ type$ "article" = get.journal.title check.arxiv.preprint and
2275+
{ "arXiv" }
2276+
{ "" }
2277+
if$
2278+
}
22532279
if$
2254-
* "}{" *
2255-
eprint * "}" *
22562280
}
2257-
{ eprint }
2258-
if$
2259-
}
2260-
2261-
FUNCTION {output.eprint}
2262-
{ show.preprint eprint empty$ not and
2263-
{ new.block
2264-
format.eprint output
2265-
}
2266-
'skip$
22672281
if$
22682282
}
22692283

@@ -2577,27 +2591,21 @@ FUNCTION {preprint}
25772591
}
25782592
'skip$
25792593
if$
2580-
format.translators output
2581-
new.sentence
25822594
format.edition output
25832595
new.block
2584-
year.after.author not
2585-
{ date empty$
2586-
{ format.date output }
2587-
'skip$
2596+
format.eprinttype output
2597+
date empty$ not
2598+
{ "(" date * ")" * }
2599+
{ year empty$ not
2600+
{ "(" year * ")" * }
2601+
{ "" }
25882602
if$
25892603
}
2590-
'skip$
25912604
if$
2592-
format.pages bbl.pages.colon output.after
2593-
format.editdate "" output.after
2605+
" " output.after
25942606
format.urldate "" output.after
2595-
output.eprint
25962607
output.url
2597-
show.preprint not eprint empty$ or
2598-
'output.doi
2599-
'skip$
2600-
if$
2608+
output.doi
26012609
new.block
26022610
format.note output
26032611
fin.entry
@@ -2702,6 +2710,8 @@ FUNCTION {online}
27022710

27032711
FUNCTION {phdthesis} { mastersthesis }
27042712

2713+
FUNCTION {thesis} { mastersthesis }
2714+
27052715
FUNCTION {proceedings}
27062716
{ "C" set.entry.mark
27072717
monograph

0 commit comments

Comments
 (0)