Skip to content

Commit

Permalink
Fix 'others' in names
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Mar 16, 2018
1 parent f62f998 commit bb5ef69
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 62 deletions.
37 changes: 17 additions & 20 deletions gbt7714-plain.bst
Original file line number Diff line number Diff line change
Expand Up @@ -346,38 +346,35 @@ FUNCTION {format.anonymous}
if$
}

INTEGERS { nameptr namesleft numnames name.lang}
INTEGERS { nameptr namesleft numnames name.lang }

FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > nameptr #4 < and }
{ namesleft #0 > }
{ s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't :=
t get.str.lang 'name.lang :=
name.lang lang.en =
{ t #1 "{vv~}{ll}{ f{~}}" format.name$ "u" change.case$
t #1 "{, jj}" format.name$ *
't :=
nameptr #4 =
{ format.et.al
#1 'namesleft :=
}
{ t #1 "{ll}{ff}" format.name$ 't := }
if$
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ t "others" =
{ ", " * format.et.al * }
{ ", " * t * }
{ t "others" =
{ format.et.al }
{ t get.str.lang 'name.lang :=
name.lang lang.en =
{ t #1 "{vv~}{ll}{ f{~}}" format.name$ "u" change.case$
t #1 "{, jj}" format.name$ *
}
{ t #1 "{ll}{ff}" format.name$ }
if$
}
if$
nameptr #3 = namesleft #1 > and
{ ", " * format.et.al * }
'skip$
if$
}
't
if$
nameptr #1 >
{ ", " swap$ * * }
'skip$
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
Expand Down
37 changes: 17 additions & 20 deletions gbt7714-unsrt.bst
Original file line number Diff line number Diff line change
Expand Up @@ -346,38 +346,35 @@ FUNCTION {format.anonymous}
if$
}

INTEGERS { nameptr namesleft numnames name.lang}
INTEGERS { nameptr namesleft numnames name.lang }

FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > nameptr #4 < and }
{ namesleft #0 > }
{ s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't :=
t get.str.lang 'name.lang :=
name.lang lang.en =
{ t #1 "{vv~}{ll}{ f{~}}" format.name$ "u" change.case$
t #1 "{, jj}" format.name$ *
't :=
nameptr #4 =
{ format.et.al
#1 'namesleft :=
}
{ t #1 "{ll}{ff}" format.name$ 't := }
if$
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ t "others" =
{ ", " * format.et.al * }
{ ", " * t * }
{ t "others" =
{ format.et.al }
{ t get.str.lang 'name.lang :=
name.lang lang.en =
{ t #1 "{vv~}{ll}{ f{~}}" format.name$ "u" change.case$
t #1 "{, jj}" format.name$ *
}
{ t #1 "{ll}{ff}" format.name$ }
if$
}
if$
nameptr #3 = namesleft #1 > and
{ ", " * format.et.al * }
'skip$
if$
}
't
if$
nameptr #1 >
{ ", " swap$ * * }
'skip$
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
Expand Down
44 changes: 23 additions & 21 deletions gbt7714.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ which was designed for use with the `natbib.sty' package.
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{gbt7714}
%<*package>
[2018/03/09 v1.0.1 GB/T 7714-2015 BibTeX Style]
[2018/03/16 v1.0.2 GB/T 7714-2015 BibTeX Style]
%</package>
%
%<*driver>
Expand Down Expand Up @@ -1074,38 +1074,40 @@ FUNCTION {format.anonymous}
if$
}
INTEGERS { nameptr namesleft numnames name.lang}
INTEGERS { nameptr namesleft numnames name.lang }
% \end{macrocode}
%
% \changes{v1.0.2}{2017/03/16}{修正参考文献姓名的“others”}
%
% \begin{macrocode}
FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > nameptr #4 < and }
{ namesleft #0 > }
{ s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't :=
t get.str.lang 'name.lang :=
name.lang lang.en =
{ t #1 "{vv~}{ll}{ f{~}}" format.name$ "u" change.case$
t #1 "{, jj}" format.name$ *
't :=
nameptr #4 =
{ format.et.al
#1 'namesleft :=
}
{ t #1 "{ll}{ff}" format.name$ 't := }
if$
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ t "others" =
{ ", " * format.et.al * }
{ ", " * t * }
{ t "others" =
{ format.et.al }
{ t get.str.lang 'name.lang :=
name.lang lang.en =
{ t #1 "{vv~}{ll}{ f{~}}" format.name$ "u" change.case$
t #1 "{, jj}" format.name$ *
}
{ t #1 "{ll}{ff}" format.name$ }
if$
}
if$
nameptr #3 = namesleft #1 > and
{ ", " * format.et.al * }
'skip$
if$
}
't
if$
nameptr #1 >
{ ", " swap$ * * }
'skip$
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
Expand Down
2 changes: 1 addition & 1 deletion gbt7714.sty
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{gbt7714}
[2018/03/09 v1.0.1 GB/T 7714-2015 BibTeX Style]
[2018/03/16 v1.0.2 GB/T 7714-2015 BibTeX Style]
\newif\if@gbt@numerical
\newif\if@gbt@super
\DeclareOption{super}{\@gbt@numericaltrue\@gbt@supertrue}
Expand Down

0 comments on commit bb5ef69

Please sign in to comment.