Skip to content

Commit

Permalink
feat: add overridable option for \Author.
Browse files Browse the repository at this point in the history
  • Loading branch information
fky2015 committed Oct 23, 2022
1 parent 1e57b6c commit fac3a86
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 21 deletions.
16 changes: 12 additions & 4 deletions bithesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand All @@ -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} {
Expand Down
16 changes: 12 additions & 4 deletions templates/graduate-thesis/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand All @@ -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} {
Expand Down
2 changes: 1 addition & 1 deletion templates/graduate-thesis/reference/pub.bib
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
16 changes: 12 additions & 4 deletions templates/paper-translation/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand All @@ -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} {
Expand Down
16 changes: 12 additions & 4 deletions templates/undergraduate-thesis-en/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand All @@ -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} {
Expand Down
16 changes: 12 additions & 4 deletions templates/undergraduate-thesis/bithesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand All @@ -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} {
Expand Down

0 comments on commit fac3a86

Please sign in to comment.