Skip to content

Commit

Permalink
Enhance @inBook format (tuna/thuthesis#930)
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Mar 8, 2024
1 parent 89c45ee commit ce45084
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 56 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

新增选项 `link.journal` 允许在期刊题名添加超链接([#144](https://github.com/zepinglee/gbt7714-bibtex-style/issues/144))。

### Changed

`@inbook` 改为按照是否有 `booktitle` 选择“专著”或“专著的吸出文献”格式([tuna/thuthesis#930](https://github.com/tuna/thuthesis/issues/930))。

## Fixed

修复 `not brace-balanced` 的警告([#113](https://github.com/zepinglee/gbt7714-bibtex-style/issues/113))。
Expand Down
15 changes: 10 additions & 5 deletions gbt7714-2005-author-year.bst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%% https://github.com/zepinglee/gbt7714-bibtex-style
%% Version: 2022/10/03 v2.1.5
%% -------------------------------------------------------------------
%% 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 @@ -747,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 @@ -2050,7 +2050,12 @@ FUNCTION {dataset}
electronic
}

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

FUNCTION {inproceedings}
{ "C" set.entry.mark
Expand Down Expand Up @@ -2291,7 +2296,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 @@ -2493,7 +2498,7 @@ FUNCTION {presort}
" "
*
type$ "book" =
type$ "inbook" =
type$ "inbook" = booktitle empty$ not and
or
'author.editor.sort
{ type$ "collection" =
Expand Down
13 changes: 9 additions & 4 deletions gbt7714-2005-numerical.bst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%% https://github.com/zepinglee/gbt7714-bibtex-style
%% Version: 2022/10/03 v2.1.5
%% -------------------------------------------------------------------
%% 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 @@ -737,7 +737,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 @@ -2040,7 +2040,12 @@ FUNCTION {dataset}
electronic
}

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

FUNCTION {inproceedings}
{ "C" set.entry.mark
Expand Down Expand Up @@ -2281,7 +2286,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
15 changes: 10 additions & 5 deletions gbt7714-author-year.bst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%% https://github.com/zepinglee/gbt7714-bibtex-style
%% Version: 2022/10/03 v2.1.5
%% -------------------------------------------------------------------
%% 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 @@ -747,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 @@ -2050,7 +2050,12 @@ FUNCTION {dataset}
electronic
}

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

FUNCTION {inproceedings}
{ "C" set.entry.mark
Expand Down Expand Up @@ -2291,7 +2296,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 @@ -2493,7 +2498,7 @@ FUNCTION {presort}
" "
*
type$ "book" =
type$ "inbook" =
type$ "inbook" = booktitle empty$ not and
or
'author.editor.sort
{ type$ "collection" =
Expand Down
13 changes: 9 additions & 4 deletions gbt7714-numerical.bst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%% https://github.com/zepinglee/gbt7714-bibtex-style
%% Version: 2022/10/03 v2.1.5
%% -------------------------------------------------------------------
%% 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 @@ -737,7 +737,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 @@ -2040,7 +2040,12 @@ FUNCTION {dataset}
electronic
}

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

FUNCTION {inproceedings}
{ "C" set.entry.mark
Expand Down Expand Up @@ -2281,7 +2286,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
18 changes: 12 additions & 6 deletions gbt7714.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,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 @@ -3844,10 +3844,16 @@ FUNCTION {dataset}
%
% Optional: volume or number, series, type, address, edition, month, note
%
% inbook 类是不含 booktitle 域的,所以不应该适用于“专著中的析出文献”,而应该是专
% 著,即 book 类。
% 原生 BibTeX 的数据模型中 \texttt{@inbook} 不含 \texttt{booktitle} ,
% 按照“专著”处理。而 biblatex 的 \texttt{@inbook} 跟 \texttt{incollection} 一样。
% 按照“专著的析出文献”处理。
% \begin{macrocode}
FUNCTION {inbook} { book }
FUNCTION {inbook} {
booktitle empty$
'book
'incollection
if$
}

% \end{macrocode}
%
Expand Down Expand Up @@ -4297,7 +4303,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 @@ -4571,7 +4577,7 @@ FUNCTION {presort}
" "
*
type$ "book" =
type$ "inbook" =
type$ "inbook" = booktitle empty$ not and
or
'author.editor.sort
{ type$ "collection" =
Expand Down
2 changes: 1 addition & 1 deletion gbt7714.sty
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%% https://github.com/zepinglee/gbt7714-bibtex-style
%% Version: 2022/10/03 v2.1.5
%% -------------------------------------------------------------------
%% 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
15 changes: 10 additions & 5 deletions variants/thu/thuthesis-author-year.bst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%% https://github.com/zepinglee/gbt7714-bibtex-style
%% Version: 2022/10/03 v2.1.5
%% -------------------------------------------------------------------
%% 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 @@ -747,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 @@ -2050,7 +2050,12 @@ FUNCTION {dataset}
electronic
}

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

FUNCTION {inproceedings}
{ "C" set.entry.mark
Expand Down Expand Up @@ -2291,7 +2296,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 @@ -2493,7 +2498,7 @@ FUNCTION {presort}
" "
*
type$ "book" =
type$ "inbook" =
type$ "inbook" = booktitle empty$ not and
or
'author.editor.sort
{ type$ "collection" =
Expand Down
13 changes: 9 additions & 4 deletions variants/thu/thuthesis-bachelor.bst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%% https://github.com/zepinglee/gbt7714-bibtex-style
%% Version: 2022/10/03 v2.1.5
%% -------------------------------------------------------------------
%% 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 @@ -737,7 +737,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 @@ -2040,7 +2040,12 @@ FUNCTION {dataset}
electronic
}

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

FUNCTION {inproceedings}
{ "C" set.entry.mark
Expand Down Expand Up @@ -2281,7 +2286,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
13 changes: 9 additions & 4 deletions variants/thu/thuthesis-numeric.bst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
%% https://github.com/zepinglee/gbt7714-bibtex-style
%% Version: 2022/10/03 v2.1.5
%% -------------------------------------------------------------------
%% 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 @@ -737,7 +737,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 @@ -2040,7 +2040,12 @@ FUNCTION {dataset}
electronic
}

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

FUNCTION {inproceedings}
{ "C" set.entry.mark
Expand Down Expand Up @@ -2281,7 +2286,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
Loading

0 comments on commit ce45084

Please sign in to comment.