Skip to content

Commit

Permalink
Remove "In:" in conference paper reference (close #350)
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed May 11, 2022
1 parent 6b0d40b commit ea3ea7b
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 55 deletions.
80 changes: 55 additions & 25 deletions ustcthesis-authoryear.bst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
%%
%% gbt7714.dtx (with options: `2015,ustc,author-year')
%% -------------------------------------------------------------------
%% GB/T 7714—2015 BibTeX Style
%% GB/T 7714 BibTeX Style
%% https://github.com/zepinglee/gbt7714-bibtex-style
%% Version: 2021/12/08 v2.1.3
%% Version: 2022/03/21 v2.1.4
%% -------------------------------------------------------------------
%% Copyright (C) 2016—2021 by Zeping Lee <zepinglee AT gmail.com>
%% Copyright (C) 2016--2022 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 All @@ -37,8 +37,6 @@ INTEGERS {
show.mark
space.before.mark
show.medium.type
slash.for.extraction
in.booktitle
short.journal
italic.journal
bold.journal.volume
Expand All @@ -60,6 +58,10 @@ INTEGERS {
lang.other.order
}

STRINGS {
component.part.label
}

FUNCTION {load.config}
{
#2 'citation.et.al.min :=
Expand All @@ -78,8 +80,7 @@ FUNCTION {load.config}
#1 'show.mark :=
#0 'space.before.mark :=
#1 'show.medium.type :=
#1 'slash.for.extraction :=
#0 'in.booktitle :=
"slash" 'component.part.label :=
#0 'short.journal :=
#0 'italic.journal :=
#0 'bold.journal.volume :=
Expand Down Expand Up @@ -112,6 +113,7 @@ ENTRY
editor
eprint
eprinttype
entrysubtype
howpublished
institution
journal
Expand Down Expand Up @@ -392,9 +394,22 @@ FUNCTION {new.sentence}
FUNCTION {new.slash}
{ output.state before.all =
'skip$
{ slash.for.extraction
{ component.part.label "slash" =
{ after.slash 'output.state := }
{ after.block 'output.state := }
{ new.block
component.part.label "in" =
{ entry.lang lang.en =
{ "In: " output
write$
""
before.all 'output.state :=
}
'skip$
if$
}
'skip$
if$
}
if$
}
if$
Expand Down Expand Up @@ -872,7 +887,7 @@ FUNCTION {format.volume}
{ volume is.number
{ entry.lang lang.zh =
{ "第 " volume * " 卷" * }
{ "volume" volume tie.or.space.connect }
{ "Vol." volume tie.or.space.connect }
if$
}
{ volume }
Expand All @@ -887,7 +902,7 @@ FUNCTION {format.number}
{ number is.number
{ entry.lang lang.zh =
{ "第 " number * " 册" * }
{ "number" number tie.or.space.connect }
{ "No." number tie.or.space.connect }
if$
}
{ number }
Expand Down Expand Up @@ -987,14 +1002,6 @@ FUNCTION {format.series.vol.num.booktitle}
{ format.booktitle.vol.num }
if$
format.btitle
in.booktitle
{ duplicate$ empty$ not entry.lang lang.en = and
{ "In: " swap$ * }
'skip$
if$
}
'skip$
if$
}

FUNCTION {remove.period}
Expand Down Expand Up @@ -1136,9 +1143,13 @@ FUNCTION {format.edition}
{ edition empty$
{ "" }
{ edition is.number
{ entry.lang lang.zh =
{ edition " 版" * }
{ edition num.to.ordinal " ed." * }
{ edition "1" = not
{ entry.lang lang.zh =
{ edition " 版" * }
{ edition num.to.ordinal " ed." * }
if$
}
'skip$
if$
}
{ entry.lang lang.en =
Expand Down Expand Up @@ -1300,7 +1311,10 @@ FUNCTION {format.year}
{ year extract.before.slash extra.label * }
{ date empty$ not
{ date extract.before.dash extra.label * }
{ "empty year in " cite$ * warning$
{ entry.is.electronic not
{ "empty year in " cite$ * warning$ }
'skip$
if$
urldate empty$ not
{ "[" urldate extract.before.dash * extra.label * "]" * }
{ "" }
Expand Down Expand Up @@ -1338,7 +1352,15 @@ FUNCTION {format.date}
{ date empty$ not
{ type$ "patent" = type$ "newspaper" = or
{ date }
{ format.year }
{ entrysubtype empty$ not
{ type$ "article" = entrysubtype "newspaper" = and
{ date }
{ format.year }
if$
}
{ format.year }
if$
}
if$
}
{ year empty$ not
Expand Down Expand Up @@ -1806,7 +1828,15 @@ FUNCTION {journal.article}
new.block
title.in.journal
{ format.title "title" output.check
"J" set.entry.mark
entrysubtype empty$ not
{
entrysubtype "newspaper" =
{ "N" set.entry.mark }
{ "J" set.entry.mark }
if$
}
{ "J" set.entry.mark }
if$
format.mark "" output.after
new.block
}
Expand Down
18 changes: 13 additions & 5 deletions ustcthesis-bachelor.bst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
%%
%% This is file `gbt7714-numerical.bst',
%% This is file `variants/ustc/ustcthesis-numerical.bst',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% gbt7714.dtx (with options: `2015,numerical')
%% gbt7714.dtx (with options: `2015,ustc,numerical')
%% -------------------------------------------------------------------
%% GB/T 7714 BibTeX Style
%% https://github.com/zepinglee/gbt7714-bibtex-style
Expand Down Expand Up @@ -75,7 +75,7 @@ FUNCTION {load.config}
#0 'show.mark :=
#0 'space.before.mark :=
#1 'show.medium.type :=
"in" 'component.part.label :=
"period" 'component.part.label :=
#0 'short.journal :=
#1 'italic.journal :=
#0 'bold.journal.volume :=
Expand Down Expand Up @@ -963,7 +963,14 @@ FUNCTION {format.series.vol.num.title}
}
{ format.title.vol.num }
if$
format.btitle
type$ "book" =
type$ "inbook" = or
type$ "collection" = or
type$ "proceedings" = or
type$ "thesis" = or
'format.btitle
'skip$
if$
link.title
'add.link
'skip$
Expand Down Expand Up @@ -1386,7 +1393,8 @@ FUNCTION {hyphenate}
""
{ t empty$ not }
{ t #1 #1 substring$ "-" =
{ wave.dash.in.pages entry.lang lang.zh = and
{ wave.dash.in.pages
entry.lang lang.zh = and
{ "~" * }
{ "-" * }
if$
Expand Down
80 changes: 55 additions & 25 deletions ustcthesis-numerical.bst
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
%%
%% gbt7714.dtx (with options: `2015,ustc,numerical')
%% -------------------------------------------------------------------
%% GB/T 7714—2015 BibTeX Style
%% GB/T 7714 BibTeX Style
%% https://github.com/zepinglee/gbt7714-bibtex-style
%% Version: 2021/12/08 v2.1.3
%% Version: 2022/03/21 v2.1.4
%% -------------------------------------------------------------------
%% Copyright (C) 2016—2021 by Zeping Lee <zepinglee AT gmail.com>
%% Copyright (C) 2016--2022 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 All @@ -37,8 +37,6 @@ INTEGERS {
show.mark
space.before.mark
show.medium.type
slash.for.extraction
in.booktitle
short.journal
italic.journal
bold.journal.volume
Expand All @@ -55,6 +53,10 @@ INTEGERS {
end.with.period
}

STRINGS {
component.part.label
}

FUNCTION {load.config}
{
#2 'citation.et.al.min :=
Expand All @@ -73,8 +75,7 @@ FUNCTION {load.config}
#1 'show.mark :=
#0 'space.before.mark :=
#1 'show.medium.type :=
#1 'slash.for.extraction :=
#0 'in.booktitle :=
"slash" 'component.part.label :=
#0 'short.journal :=
#0 'italic.journal :=
#0 'bold.journal.volume :=
Expand Down Expand Up @@ -102,6 +103,7 @@ ENTRY
editor
eprint
eprinttype
entrysubtype
howpublished
institution
journal
Expand Down Expand Up @@ -382,9 +384,22 @@ FUNCTION {new.sentence}
FUNCTION {new.slash}
{ output.state before.all =
'skip$
{ slash.for.extraction
{ component.part.label "slash" =
{ after.slash 'output.state := }
{ after.block 'output.state := }
{ new.block
component.part.label "in" =
{ entry.lang lang.en =
{ "In: " output
write$
""
before.all 'output.state :=
}
'skip$
if$
}
'skip$
if$
}
if$
}
if$
Expand Down Expand Up @@ -862,7 +877,7 @@ FUNCTION {format.volume}
{ volume is.number
{ entry.lang lang.zh =
{ "第 " volume * " 卷" * }
{ "volume" volume tie.or.space.connect }
{ "Vol." volume tie.or.space.connect }
if$
}
{ volume }
Expand All @@ -877,7 +892,7 @@ FUNCTION {format.number}
{ number is.number
{ entry.lang lang.zh =
{ "第 " number * " 册" * }
{ "number" number tie.or.space.connect }
{ "No." number tie.or.space.connect }
if$
}
{ number }
Expand Down Expand Up @@ -977,14 +992,6 @@ FUNCTION {format.series.vol.num.booktitle}
{ format.booktitle.vol.num }
if$
format.btitle
in.booktitle
{ duplicate$ empty$ not entry.lang lang.en = and
{ "In: " swap$ * }
'skip$
if$
}
'skip$
if$
}

FUNCTION {remove.period}
Expand Down Expand Up @@ -1126,9 +1133,13 @@ FUNCTION {format.edition}
{ edition empty$
{ "" }
{ edition is.number
{ entry.lang lang.zh =
{ edition " 版" * }
{ edition num.to.ordinal " ed." * }
{ edition "1" = not
{ entry.lang lang.zh =
{ edition " 版" * }
{ edition num.to.ordinal " ed." * }
if$
}
'skip$
if$
}
{ entry.lang lang.en =
Expand Down Expand Up @@ -1290,7 +1301,10 @@ FUNCTION {format.year}
{ year extract.before.slash extra.label * }
{ date empty$ not
{ date extract.before.dash extra.label * }
{ "empty year in " cite$ * warning$
{ entry.is.electronic not
{ "empty year in " cite$ * warning$ }
'skip$
if$
urldate empty$ not
{ "[" urldate extract.before.dash * extra.label * "]" * }
{ "" }
Expand Down Expand Up @@ -1328,7 +1342,15 @@ FUNCTION {format.date}
{ date empty$ not
{ type$ "patent" = type$ "newspaper" = or
{ date }
{ format.year }
{ entrysubtype empty$ not
{ type$ "article" = entrysubtype "newspaper" = and
{ date }
{ format.year }
if$
}
{ format.year }
if$
}
if$
}
{ year empty$ not
Expand Down Expand Up @@ -1796,7 +1818,15 @@ FUNCTION {journal.article}
new.block
title.in.journal
{ format.title "title" output.check
"J" set.entry.mark
entrysubtype empty$ not
{
entrysubtype "newspaper" =
{ "N" set.entry.mark }
{ "J" set.entry.mark }
if$
}
{ "J" set.entry.mark }
if$
format.mark "" output.after
new.block
}
Expand Down

0 comments on commit ea3ea7b

Please sign in to comment.