From fac3a86e95ce9468c6a43b8210245a88b8a20352 Mon Sep 17 00:00:00 2001 From: Feng Kaiyu Date: Sun, 23 Oct 2022 12:15:10 +0800 Subject: [PATCH] feat: add overridable option for \Author. --- bithesis.dtx | 16 ++++++++++++---- templates/graduate-thesis/bithesis.cls | 16 ++++++++++++---- templates/graduate-thesis/reference/pub.bib | 2 +- templates/paper-translation/bithesis.cls | 16 ++++++++++++---- templates/undergraduate-thesis-en/bithesis.cls | 16 ++++++++++++---- templates/undergraduate-thesis/bithesis.cls | 16 ++++++++++++---- 6 files changed, 61 insertions(+), 21 deletions(-) diff --git a/bithesis.dtx b/bithesis.dtx index 09f85d54..0ce2e975 100644 --- a/bithesis.dtx +++ b/bithesis.dtx @@ -3711,11 +3711,15 @@ % 在普通模式下,输出作者姓名。 % 在盲审模式下,输出「第 n 作者」。 % \begin{macrocode} -\NewDocumentCommand \Author {O{1} o} +\NewDocumentCommand \Author {O{1} o o} { \bool_if:NTF \g_@@_blind_mode_bool { % 盲审模式 - 第\zhnumber{#1}作者 + \IfValueTF {#3} { + #3 + } { + 第\zhnumber{#1}作者 + } } { % 普通模式 \IfValueTF {#2} { @@ -3729,11 +3733,15 @@ } % 英文姓名 -\NewDocumentCommand \AuthorEn {O{1} o} +\NewDocumentCommand \AuthorEn {O{1} o o} { \bool_if:NTF \g_@@_blind_mode_bool { % 盲审模式 - \Ordinalstringnum{#1}~Author + \IfValueTF {#3} { + #3 + } { + \Ordinalstringnum{#1}~Author + } } { % 普通模式 \IfValueTF {#2} { diff --git a/templates/graduate-thesis/bithesis.cls b/templates/graduate-thesis/bithesis.cls index 952298f4..69710bfc 100644 --- a/templates/graduate-thesis/bithesis.cls +++ b/templates/graduate-thesis/bithesis.cls @@ -1670,11 +1670,15 @@ #1 \end{blindPeerReview} } {} -\NewDocumentCommand \Author {O{1} o} +\NewDocumentCommand \Author {O{1} o o} { \bool_if:NTF \g__bithesis_blind_mode_bool { % 盲审模式 - 第\zhnumber{#1}作者 + \IfValueTF {#3} { + #3 + } { + 第\zhnumber{#1}作者 + } } { % 普通模式 \IfValueTF {#2} { @@ -1687,11 +1691,15 @@ } } -\NewDocumentCommand \AuthorEn {O{1} o} +\NewDocumentCommand \AuthorEn {O{1} o o} { \bool_if:NTF \g__bithesis_blind_mode_bool { % 盲审模式 - \Ordinalstringnum{#1}~Author + \IfValueTF {#3} { + #3 + } { + \Ordinalstringnum{#1}~Author + } } { % 普通模式 \IfValueTF {#2} { diff --git a/templates/graduate-thesis/reference/pub.bib b/templates/graduate-thesis/reference/pub.bib index d6c1f40b..6ba51270 100644 --- a/templates/graduate-thesis/reference/pub.bib +++ b/templates/graduate-thesis/reference/pub.bib @@ -40,7 +40,7 @@ @article{myCiteKey @article{myCiteKey2, title = {交联型与线形水性聚氨酯的形状记忆性能比较}, author = {李杰 and 张三 and 罗运军}, - author+an = {2:myself="\Author[2]"}, + author+an = {2:myself="\Author[][][共同二作]"}, journal = {化工进展}, year = {2007}, number = {01}, diff --git a/templates/paper-translation/bithesis.cls b/templates/paper-translation/bithesis.cls index 952298f4..69710bfc 100644 --- a/templates/paper-translation/bithesis.cls +++ b/templates/paper-translation/bithesis.cls @@ -1670,11 +1670,15 @@ #1 \end{blindPeerReview} } {} -\NewDocumentCommand \Author {O{1} o} +\NewDocumentCommand \Author {O{1} o o} { \bool_if:NTF \g__bithesis_blind_mode_bool { % 盲审模式 - 第\zhnumber{#1}作者 + \IfValueTF {#3} { + #3 + } { + 第\zhnumber{#1}作者 + } } { % 普通模式 \IfValueTF {#2} { @@ -1687,11 +1691,15 @@ } } -\NewDocumentCommand \AuthorEn {O{1} o} +\NewDocumentCommand \AuthorEn {O{1} o o} { \bool_if:NTF \g__bithesis_blind_mode_bool { % 盲审模式 - \Ordinalstringnum{#1}~Author + \IfValueTF {#3} { + #3 + } { + \Ordinalstringnum{#1}~Author + } } { % 普通模式 \IfValueTF {#2} { diff --git a/templates/undergraduate-thesis-en/bithesis.cls b/templates/undergraduate-thesis-en/bithesis.cls index 952298f4..69710bfc 100644 --- a/templates/undergraduate-thesis-en/bithesis.cls +++ b/templates/undergraduate-thesis-en/bithesis.cls @@ -1670,11 +1670,15 @@ #1 \end{blindPeerReview} } {} -\NewDocumentCommand \Author {O{1} o} +\NewDocumentCommand \Author {O{1} o o} { \bool_if:NTF \g__bithesis_blind_mode_bool { % 盲审模式 - 第\zhnumber{#1}作者 + \IfValueTF {#3} { + #3 + } { + 第\zhnumber{#1}作者 + } } { % 普通模式 \IfValueTF {#2} { @@ -1687,11 +1691,15 @@ } } -\NewDocumentCommand \AuthorEn {O{1} o} +\NewDocumentCommand \AuthorEn {O{1} o o} { \bool_if:NTF \g__bithesis_blind_mode_bool { % 盲审模式 - \Ordinalstringnum{#1}~Author + \IfValueTF {#3} { + #3 + } { + \Ordinalstringnum{#1}~Author + } } { % 普通模式 \IfValueTF {#2} { diff --git a/templates/undergraduate-thesis/bithesis.cls b/templates/undergraduate-thesis/bithesis.cls index 952298f4..69710bfc 100644 --- a/templates/undergraduate-thesis/bithesis.cls +++ b/templates/undergraduate-thesis/bithesis.cls @@ -1670,11 +1670,15 @@ #1 \end{blindPeerReview} } {} -\NewDocumentCommand \Author {O{1} o} +\NewDocumentCommand \Author {O{1} o o} { \bool_if:NTF \g__bithesis_blind_mode_bool { % 盲审模式 - 第\zhnumber{#1}作者 + \IfValueTF {#3} { + #3 + } { + 第\zhnumber{#1}作者 + } } { % 普通模式 \IfValueTF {#2} { @@ -1687,11 +1691,15 @@ } } -\NewDocumentCommand \AuthorEn {O{1} o} +\NewDocumentCommand \AuthorEn {O{1} o o} { \bool_if:NTF \g__bithesis_blind_mode_bool { % 盲审模式 - \Ordinalstringnum{#1}~Author + \IfValueTF {#3} { + #3 + } { + \Ordinalstringnum{#1}~Author + } } { % 普通模式 \IfValueTF {#2} {