Skip to content

Commit

Permalink
Use GB/T 7714 bib style for bachelor
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Jun 6, 2024
1 parent 4e5dad9 commit bfcf9ca
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 87 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- 本科生参考文献改用 GB/T 7714 格式([zepinglee/gbt7714-bibtex-style#169](https://github.com/zepinglee/gbt7714-bibtex-style/issues/169))。

## [3.3.5] - 2024-05-09

### Changed
Expand Down
66 changes: 39 additions & 27 deletions ustcthesis-authoryear.bst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
%% -------------------------------------------------------------------
%% GB/T 7714 BibTeX Style
%% https://github.com/zepinglee/gbt7714-bibtex-style
%% Version: 2022/10/03 v2.1.5
%% Version: 2024/03/08 v2.1.6
%% -------------------------------------------------------------------
%% Copyright (C) 2016--2023 by Zeping Lee <zepinglee AT gmail.com>
%% Copyright (C) 2016--2024 by Zeping Lee <zepinglee AT gmail.com>
%% -------------------------------------------------------------------
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
Expand Down Expand Up @@ -38,12 +38,13 @@ INTEGERS {
space.before.mark
show.medium.type
short.journal
journal.strip.periods
italic.journal
link.journal
bold.journal.volume
show.missing.address.publisher
space.before.pages
only.start.page
wave.dash.in.pages
show.urldate
show.url
show.doi
Expand All @@ -60,8 +61,6 @@ INTEGERS {

STRINGS {
component.part.label
page.range.delimiter.zh
page.range.delimiter.en
}

FUNCTION {load.config}
Expand All @@ -84,14 +83,13 @@ FUNCTION {load.config}
#1 'show.medium.type :=
"slash" 'component.part.label :=
#0 'short.journal :=
#1 'journal.strip.periods :=
#0 'italic.journal :=
#0 'link.journal :=
#0 'bold.journal.volume :=
#0 'show.missing.address.publisher :=
#1 'space.before.pages :=
#0 'only.start.page :=
"-" 'page.range.delimiter.zh :=
"-" 'page.range.delimiter.en :=
#0 'wave.dash.in.pages :=
#1 'show.urldate :=
#1 'show.url :=
#1 'show.doi :=
Expand Down Expand Up @@ -749,7 +747,7 @@ FUNCTION {editor.full}

FUNCTION {make.full.names}
{ type$ "book" =
type$ "inbook" =
type$ "inbook" = booktitle empty$ not and
or
'author.editor.full
{ type$ "collection" =
Expand Down Expand Up @@ -1008,7 +1006,7 @@ FUNCTION {format.series.vol.num.booktitle}
format.btitle
}

FUNCTION {strip.periods}
FUNCTION {remove.period}
{ 't :=
"" 's :=
{ t empty$ not }
Expand All @@ -1024,7 +1022,8 @@ FUNCTION {strip.periods}
}

FUNCTION {abbreviate}
{ 't :=
{ remove.period
't :=
t "l" change.case$ 's :=
""
s "physical review letters" =
Expand Down Expand Up @@ -1067,10 +1066,6 @@ FUNCTION {get.journal.title}
if$
}
if$
journal.strip.periods
'strip.periods
'skip$
if$
}

FUNCTION {check.arxiv.preprint}
Expand All @@ -1087,6 +1082,10 @@ FUNCTION {format.journal}
'emphasize
'skip$
if$
link.journal
'add.link
'skip$
if$
}
'skip$
if$
Expand Down Expand Up @@ -1315,7 +1314,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
Expand Down Expand Up @@ -1399,9 +1398,9 @@ FUNCTION {hyphenate}
""
{ t empty$ not }
{ t #1 #1 substring$ "-" =
{ entry.lang lang.zh =
{ page.range.delimiter.zh * }
{ page.range.delimiter.en * }
{ wave.dash.in.pages
{ "~" * }
{ "-" * }
if$
{ t #1 #1 substring$ "-" = }
{ t #2 global.max$ substring$ 't := }
Expand Down Expand Up @@ -1495,7 +1494,7 @@ FUNCTION {format.periodical.year.volume.number}

FUNCTION {check.url}
{ url empty$ not
{ "\url{" url * "}" * 'entry.url :=
{ url 'entry.url :=
#1 'entry.is.electronic :=
}
{ howpublished empty$ not
Expand Down Expand Up @@ -1526,7 +1525,11 @@ FUNCTION {output.url}
{ show.url is.pure.electronic or
entry.url empty$ not and
{ new.block
entry.url output
entry.url #1 #5 substring$ "\url{" =
{ entry.url }
{ "\url{" entry.url * "}" * }
if$
output
}
'skip$
if$
Expand All @@ -1546,8 +1549,8 @@ FUNCTION {is.in.url}
{ entry.url empty$
{ #0 }
{ s text.length$ 'len :=
entry.url text.length$ 'charptr :=
{ entry.url charptr len substring$ s = not
entry.url "l" change.case$ text.length$ 'charptr :=
{ entry.url "l" change.case$ charptr len substring$ s "l" change.case$ = not
charptr #0 >
and
}
Expand Down Expand Up @@ -1667,7 +1670,7 @@ FUNCTION {output.translation}
{ show.english.translation entry.lang lang.zh = and
{ translation empty$ not
{ translation }
{ "" }
{ "[English translation missing!]" }
if$
" (in Chinese)" * output
write$
Expand Down Expand Up @@ -1983,6 +1986,10 @@ FUNCTION {preprint}
format.urldate "" output.after
output.eprint
output.url
show.preprint not eprint empty$ or
'output.doi
'skip$
if$
new.block
format.note output
fin.entry
Expand Down Expand Up @@ -2047,7 +2054,12 @@ FUNCTION {dataset}
electronic
}

FUNCTION {inbook} { book }
FUNCTION {inbook} {
booktitle empty$
'book
'incollection
if$
}

FUNCTION {inproceedings}
{ "C" set.entry.mark
Expand Down Expand Up @@ -2288,7 +2300,7 @@ FUNCTION {editor.key.organization.label}
FUNCTION {calc.short.authors}
{ "" 'short.label :=
type$ "book" =
type$ "inbook" =
type$ "inbook" = booktitle empty$ not and
or
'author.editor.key.label
{ type$ "collection" =
Expand Down Expand Up @@ -2490,7 +2502,7 @@ FUNCTION {presort}
" "
*
type$ "book" =
type$ "inbook" =
type$ "inbook" = booktitle empty$ not and
or
'author.editor.sort
{ type$ "collection" =
Expand Down
Loading

0 comments on commit bfcf9ca

Please sign in to comment.