From d67c61decb0633f5b270262922a9aa015d3bced9 Mon Sep 17 00:00:00 2001 From: Zeping Lee Date: Fri, 8 Mar 2024 17:34:00 +0800 Subject: [PATCH] Bib: Select inbook format based on booktitle field (#930) --- thuthesis-author-year.bst | 33 ++++++++++++++++++++++++--------- thuthesis-bachelor.bst | 31 +++++++++++++++++++++++-------- thuthesis-numeric.bst | 31 +++++++++++++++++++++++-------- 3 files changed, 70 insertions(+), 25 deletions(-) diff --git a/thuthesis-author-year.bst b/thuthesis-author-year.bst index fe7e0d20..f110ed43 100644 --- a/thuthesis-author-year.bst +++ b/thuthesis-author-year.bst @@ -8,9 +8,9 @@ %% ------------------------------------------------------------------- %% GB/T 7714 BibTeX Style %% https://github.com/zepinglee/gbt7714-bibtex-style -%% Version: 2022/03/21 v2.1.4 +%% Version: 2024/03/08 v2.1.6 %% ------------------------------------------------------------------- -%% Copyright (C) 2016--2022 by Zeping Lee +%% Copyright (C) 2016--2024 by Zeping Lee %% ------------------------------------------------------------------- %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -39,6 +39,7 @@ INTEGERS { show.medium.type short.journal italic.journal + link.journal bold.journal.volume show.missing.address.publisher space.before.pages @@ -83,6 +84,7 @@ FUNCTION {load.config} "slash" 'component.part.label := #0 'short.journal := #0 'italic.journal := + #0 'link.journal := #0 'bold.journal.volume := #0 'show.missing.address.publisher := #1 'space.before.pages := @@ -745,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" = @@ -887,7 +889,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 } @@ -902,7 +904,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 } @@ -1067,7 +1069,7 @@ FUNCTION {get.journal.title} } FUNCTION {check.arxiv.preprint} -{ #1 #5 substring$ "l" change.case$ "arxiv" = +{ #1 #5 substring$ purify$ "l" change.case$ "arxiv" = { #1 } { #0 } if$ @@ -1080,6 +1082,10 @@ FUNCTION {format.journal} 'emphasize 'skip$ if$ + link.journal + 'add.link + 'skip$ + if$ } 'skip$ if$ @@ -1976,6 +1982,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 @@ -2040,7 +2050,12 @@ FUNCTION {dataset} electronic } -FUNCTION {inbook} { book } +FUNCTION {inbook} { + booktitle empty$ + 'book + 'incollection + if$ +} FUNCTION {inproceedings} { "C" set.entry.mark @@ -2281,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" = @@ -2483,7 +2498,7 @@ FUNCTION {presort} " " * type$ "book" = - type$ "inbook" = + type$ "inbook" = booktitle empty$ not and or 'author.editor.sort { type$ "collection" = diff --git a/thuthesis-bachelor.bst b/thuthesis-bachelor.bst index e7d7b7d8..802b0087 100644 --- a/thuthesis-bachelor.bst +++ b/thuthesis-bachelor.bst @@ -8,9 +8,9 @@ %% ------------------------------------------------------------------- %% GB/T 7714 BibTeX Style %% https://github.com/zepinglee/gbt7714-bibtex-style -%% Version: 2022/03/21 v2.1.4 +%% Version: 2024/03/08 v2.1.6 %% ------------------------------------------------------------------- -%% Copyright (C) 2016--2022 by Zeping Lee +%% Copyright (C) 2016--2024 by Zeping Lee %% ------------------------------------------------------------------- %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -39,6 +39,7 @@ INTEGERS { show.medium.type short.journal italic.journal + link.journal bold.journal.volume show.missing.address.publisher space.before.pages @@ -78,6 +79,7 @@ FUNCTION {load.config} "slash" 'component.part.label := #0 'short.journal := #0 'italic.journal := + #0 'link.journal := #0 'bold.journal.volume := #0 'show.missing.address.publisher := #1 'space.before.pages := @@ -735,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" = @@ -877,7 +879,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 } @@ -892,7 +894,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 } @@ -1057,7 +1059,7 @@ FUNCTION {get.journal.title} } FUNCTION {check.arxiv.preprint} -{ #1 #5 substring$ "l" change.case$ "arxiv" = +{ #1 #5 substring$ purify$ "l" change.case$ "arxiv" = { #1 } { #0 } if$ @@ -1070,6 +1072,10 @@ FUNCTION {format.journal} 'emphasize 'skip$ if$ + link.journal + 'add.link + 'skip$ + if$ } 'skip$ if$ @@ -1966,6 +1972,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 @@ -2030,7 +2040,12 @@ FUNCTION {dataset} electronic } -FUNCTION {inbook} { book } +FUNCTION {inbook} { + booktitle empty$ + 'book + 'incollection + if$ +} FUNCTION {inproceedings} { "C" set.entry.mark @@ -2271,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" = diff --git a/thuthesis-numeric.bst b/thuthesis-numeric.bst index f6679070..9a36f224 100644 --- a/thuthesis-numeric.bst +++ b/thuthesis-numeric.bst @@ -8,9 +8,9 @@ %% ------------------------------------------------------------------- %% GB/T 7714 BibTeX Style %% https://github.com/zepinglee/gbt7714-bibtex-style -%% Version: 2022/03/21 v2.1.4 +%% Version: 2024/03/08 v2.1.6 %% ------------------------------------------------------------------- -%% Copyright (C) 2016--2022 by Zeping Lee +%% Copyright (C) 2016--2024 by Zeping Lee %% ------------------------------------------------------------------- %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -39,6 +39,7 @@ INTEGERS { show.medium.type short.journal italic.journal + link.journal bold.journal.volume show.missing.address.publisher space.before.pages @@ -78,6 +79,7 @@ FUNCTION {load.config} "slash" 'component.part.label := #0 'short.journal := #0 'italic.journal := + #0 'link.journal := #0 'bold.journal.volume := #0 'show.missing.address.publisher := #1 'space.before.pages := @@ -735,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" = @@ -877,7 +879,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 } @@ -892,7 +894,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 } @@ -1057,7 +1059,7 @@ FUNCTION {get.journal.title} } FUNCTION {check.arxiv.preprint} -{ #1 #5 substring$ "l" change.case$ "arxiv" = +{ #1 #5 substring$ purify$ "l" change.case$ "arxiv" = { #1 } { #0 } if$ @@ -1070,6 +1072,10 @@ FUNCTION {format.journal} 'emphasize 'skip$ if$ + link.journal + 'add.link + 'skip$ + if$ } 'skip$ if$ @@ -1966,6 +1972,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 @@ -2030,7 +2040,12 @@ FUNCTION {dataset} electronic } -FUNCTION {inbook} { book } +FUNCTION {inbook} { + booktitle empty$ + 'book + 'incollection + if$ +} FUNCTION {inproceedings} { "C" set.entry.mark @@ -2271,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" =