From f1aa3bd76bdb0260efc8e730b92f864255d7fee1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 29 May 2022 20:36:57 +0000 Subject: nwafuthesis (29may22) git-svn-id: svn://tug.org/texlive/trunk@63438 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/nwafuthesis/nwafuthesis.dtx | 254 ++++++++++++++------- 1 file changed, 169 insertions(+), 85 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/nwafuthesis/nwafuthesis.dtx b/Master/texmf-dist/source/latex/nwafuthesis/nwafuthesis.dtx index 9ece7e75afc..720524e68b4 100644 --- a/Master/texmf-dist/source/latex/nwafuthesis/nwafuthesis.dtx +++ b/Master/texmf-dist/source/latex/nwafuthesis/nwafuthesis.dtx @@ -110,7 +110,7 @@ %\NeedsTeXFormat{LaTeX2e} %\RequirePackage{expl3} %<*!(driver|install)> -%\GetIdInfo $Id: nwafuthesis.dtx 1.14 2022-05-28 Nan Geng $ +%\GetIdInfo $Id: nwafuthesis.dtx 1.15 2022-05-29 Nan Geng $ % {Thesis template for Northwest A\&F University} %\ProvidesExplClass{\ExplFileName} % {Definition file for nwafuthesis} @@ -143,12 +143,12 @@ \textbf{\nwafuthesis: 西北农林科技大学学位论文 \xpinyin[font=\sffamily,format=\color{MaterialIndigo800}]{模}{mu2}板}}} \author{耿楠} -\date{\today\quad v1.14% +\date{\today\quad v1.15% \thanks{\url{https://gitee.com/nwafu_nan/nwafuthesis-l3}.}} \begin{document} % \DisableImplementation - \EnableImplementation +\EnableImplementation % \def\nwafuCODEDOC{} \DocInput{nwafuthesis.dtx} \DocInput{nwafuthesis-doc.dtx} @@ -375,7 +375,6 @@ % \textbf{文件} & \textbf{功能说明} \\ % \midrule % \file{nwafuthesis.cls} & 模板文档类 \\ -% \file{nwafudoc.cls} & 编译该用户手册时需要的文档类 \\ % \file{nwafuthesis.pdf} & 用户手册 \\ % \bottomrule % \end{tabular} @@ -806,6 +805,13 @@ % 选择论文章标题格式为章格式(如:第1章 绪论)还是报告格式(如:1 绪论),默认为章格式。 % \end{function} % +% \begin{function}[added=2022-05-29]{style/withsig} +% \begin{nwafusyntax}[emph={[1]withsig}] +% withsig = (*<\TFF>*) +% \end{nwafusyntax} +% 题名页是否需要签名。 +% \end{function} +% % \begin{function}[added=2022-05-24]{style/chapnum} % \begin{nwafusyntax}[emph={[1]chapnum}] % chapnum = (**) @@ -1800,6 +1806,15 @@ % \end{macrocode} % \end{variable} % +% \changes{v1.15}{2022/05/29}{添加研究生题名页签字判断变量。} +% +% \begin{variable}{\l_@@_withsignature_bool} +% 研究生题名页中的作者、指导教师和答辩委员会姓名是否需要签名。 +% \begin{macrocode} +\bool_new:N \l_@@_withsignature_bool +% \end{macrocode} +% \end{variable} +% % \changes{v1.12}{2022/05/24}{添加本科生中文章编号处理。} % % \begin{variable}{\g_@@_chapnum_int} @@ -3879,6 +3894,10 @@ withchapter .default:n = true, withchapter .initial:n = true, + withsig .bool_set:N = \l_@@_withsignature_bool, + withsig .default:n = true, + withsig .initial:n = false, + chapnum .choice:, chapnum .value_required:n = true, chapnum .choices:nn = @@ -5639,9 +5658,10 @@ % \end{macrocode} % \end{macro} % +% \changes{v1.15}{2022/05/29}{为研究生题名页签字位置留空位。} +% % \begin{macro}{\@@_cover_instructors:} -% 标题内页作者、指导教师、指导小组签名,仅对研究生有效。 -% 此处应该是签名,在此直接设计为打印出姓名。 +% 题名页作者、指导教师、指导小组签名,仅对研究生有效。 % \begin{macrocode} \cs_new_protected:Npn \@@_cover_instructors: { @@ -5666,52 +5686,62 @@ % \begin{macrocode} \tl_set:Nn \l_@@_tmpa_tl {\clist_use:Nn \l_@@_info_instructors_clist {\@@_quad: }} % \end{macrocode} -% 作者、导师、指导小组信息变量值,并取得最宽宽度。 +% 判断是否需要签名。 +% \begin{macrocode} + \bool_if:NTF \l_@@_withsignature_bool +% \end{macrocode} +% 不输出姓名,输出下划线,留作签名空间。 % \begin{macrocode} - \clist_set:Nx \l_@@_tmpb_clist { - {\l_@@_info_author_tl }, - {\l_@@_info_supervisor_tl }, - {\l_@@_tmpa_tl }, - } - \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist + \begin{minipage} [ c ] { 17em } + \flushleft + \c_@@_name_author_tl + \c_@@_fwid_colon_tl + \@@_blank_underline:n{ 12em } + \skip_vertical:n { 1.6 ex } + \c_@@_name_supervisor_tl + \c_@@_fwid_colon_tl + \@@_blank_underline:n{ 12em } + \skip_vertical:n { 1.6 ex } + \c_@@_name_instructors_tl + \c_@@_fwid_colon_tl + \@@_blank_underline:n{ 12em } + \skip_vertical:n { 1 ex } + \end{minipage} + }{ % \end{macrocode} -% 计算小页环境宽度。 +% 作者、导师、指导小组信息变量值,并取得最宽宽度。 % \begin{macrocode} - \dim_set_eq:NN \l_@@_tmpt_dim \l_@@_tmpa_dim - \dim_add:Nn \l_@@_tmpt_dim { \l_@@_tmpb_dim } - \dim_add:Nn \l_@@_tmpt_dim {2.5em} - \begin{minipage} [ c ] { \l_@@_tmpt_dim } - \centering + \clist_set:Nx \l_@@_tmpb_clist + { + {\l_@@_info_author_tl }, + {\l_@@_info_supervisor_tl }, + {\l_@@_tmpa_tl }, + } + \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist % \end{macrocode} -% 用循环输出各字段。 +% 计算小页宽度。 % \begin{macrocode} - \bool_until_do:nn - { \clist_if_empty_p:N \l_@@_tmpa_clist } - { - \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl - \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl - \l_@@_tmpa_tl - \c_@@_fwid_colon_tl - \@@_center_box:Vn \l_@@_tmpb_dim { \l_@@_tmpb_tl } - \skip_vertical:n { 1 ex } - } + \dim_set_eq:NN \l_@@_tmpt_dim \l_@@_tmpa_dim + \dim_add:Nn \l_@@_tmpt_dim { \l_@@_tmpb_dim } + \dim_add:Nn \l_@@_tmpt_dim {2.5em} % \end{macrocode} -% 不输出姓名,输出下划线,留作签名空间(暂未启用)。 +% 循环输出作者、导师、指导小组姓名。 % \begin{macrocode} - % \c_@@_name_author_tl - % \c_@@_fwid_colon_tl - % \@@_blank_underline:n{ 12em } - % \skip_vertical:n { 1 ex } - % \c_@@_name_supervisor_tl - % \c_@@_fwid_colon_tl - % \@@_blank_underline:n{ 12em } - % \skip_vertical:n { 1 ex } - % \c_@@_name_instructors_tl - % \c_@@_fwid_colon_tl - % \@@_blank_underline:n{ 12em } - % \skip_vertical:n { 1 ex } - \end{minipage} + \begin{minipage} [ c ] { \l_@@_tmpt_dim } + \centering + \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpa_clist } + { + \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl + \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl + \l_@@_tmpa_tl + \c_@@_fwid_colon_tl + \@@_center_box:Vn \l_@@_tmpb_dim { \l_@@_tmpb_tl } + \skip_vertical:n { 1.6 ex } + } + \skip_vertical:n { -0.6 ex } + \end{minipage} + } } % \end{macrocode} % 硕士生,仅需作者和导师。 @@ -5727,50 +5757,55 @@ } \@@_get_max_text_width:NN \l_@@_tmpa_dim \l_@@_tmpa_clist % \end{macrocode} -% 作者、导师信息,并取得最宽宽度。 -% \begin{macrocode} - \clist_set:Nx \l_@@_tmpb_clist - { - {\l_@@_info_author_tl }, - {\l_@@_info_supervisor_tl }, - } - \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist - \dim_add:Nn \l_@@_tmpb_dim { \l_@@_tmpb_dim } -% \end{macrocode} -% 计算小页环境宽度。 +% 判断是否需要签名。 % \begin{macrocode} - \dim_set_eq:NN \l_@@_tmpt_dim \l_@@_tmpa_dim - \dim_add:Nn \l_@@_tmpt_dim { \l_@@_tmpb_dim } - \dim_add:Nn \l_@@_tmpt_dim {2.5em} - \begin{minipage} [ c ] { \l_@@_tmpt_dim } - \centering + \bool_if:NTF \l_@@_withsignature_bool % \end{macrocode} -% 用循环输出各字段。 +% 不输出姓名,输出下划线,留作签名空间(暂未启用)。 % \begin{macrocode} - \bool_until_do:nn - { \clist_if_empty_p:N \l_@@_tmpa_clist } - { - \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl - \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl - \l_@@_tmpa_tl + { + \begin{minipage} [ c ] { 17em } + \flushleft + \c_@@_name_author_tl + \c_@@_fwid_colon_tl + \@@_blank_underline:n{ 12em } + \skip_vertical:n { 1.6 ex } + \c_@@_name_supervisor_tl \c_@@_fwid_colon_tl - \@@_center_box:Vn \l_@@_tmpb_dim { \l_@@_tmpb_tl } + \@@_blank_underline:n{ 12em } \skip_vertical:n { 1 ex } - } + \end{minipage} + }{ % \end{macrocode} -% 不输出姓名,输出下划线,留作签名空间(暂未启用)。 +% 作者、导师信息,并取得最宽宽度。 % \begin{macrocode} - % \begin{minipage} [ c ] { 17em } - % \flushleft - % \c_@@_name_author_tl - % \c_@@_fwid_colon_tl - % \@@_blank_underline:n{ 12em } - % \skip_vertical:n { 1 ex } - % \c_@@_name_supervisor_tl - % \c_@@_fwid_colon_tl - % \@@_blank_underline:n{ 12em } - % \skip_vertical:n { 1 ex } - \end{minipage} + \clist_set:Nx \l_@@_tmpb_clist + { + {\l_@@_info_author_tl }, + {\l_@@_info_supervisor_tl }, + } + \@@_get_max_text_width:NN \l_@@_tmpb_dim \l_@@_tmpb_clist + \dim_add:Nn \l_@@_tmpb_dim { \l_@@_tmpb_dim } +% \end{macrocode} +% 计算小页环境宽度后,用循环输出各姓名字段。 +% \begin{macrocode} + \dim_set_eq:NN \l_@@_tmpt_dim \l_@@_tmpa_dim + \dim_add:Nn \l_@@_tmpt_dim { \l_@@_tmpb_dim } + \dim_add:Nn \l_@@_tmpt_dim {2.5em} + \begin{minipage} [ c ] { \l_@@_tmpt_dim } + \centering + \bool_until_do:nn { \clist_if_empty_p:N \l_@@_tmpa_clist } + { + \clist_pop:NN \l_@@_tmpa_clist \l_@@_tmpa_tl + \clist_pop:NN \l_@@_tmpb_clist \l_@@_tmpb_tl + \l_@@_tmpa_tl + \c_@@_fwid_colon_tl + \@@_center_box:Vn \l_@@_tmpb_dim { \l_@@_tmpb_tl } + \skip_vertical:n { 1.6 ex } + } + \skip_vertical:n { -0.6 ex } + \end{minipage} + } } } } @@ -7522,6 +7557,7 @@ % % \changes{v1.10}{2022/03/17}{直接使用胡振震制定的gb7714-NWAFU实现参考文献样式控制。} % \changes{v1.14}{2022/05/26}{调整作者姓在前名在后,缩写不加点。} +% \changes{v1.15}{2022/05/28}{调整姓在前名在后缩写标点符号。} % % \subsection{参考文献著录与引用} % @@ -7570,16 +7606,16 @@ % \end{macrocode} % 其它参数。 % \begin{macrocode} - \@@_pass_options_to_biblatex:n - { + % \@@_pass_options_to_biblatex:n + % { % backend = biber, % sortlocale=zh__pinyin, gbtype=false, % maxbibnames=99, maxcitenames=2, mincitenames=1, % gbpub=false, uniquename=false, uniquelist=false, - gbnamefmt=lowercase, + % gbnamefmt=lowercase, % doi=false, isbn=false, % gbfieldtype=true, gbpunctin=false, - } + % } } \cs_new_protected:Npn \@@_biblatex_post_setup: { @@ -7608,6 +7644,54 @@ } } } +% \end{macrocode} +% 修订姓名之间及名缩写后的标点符号。 +% \begin{macrocode} + \def\gbcaselocalset{% + \renewrobustcmd*{\bibinitperiod}{}% + \renewcommand*{\revsdnamepunct}{}% + %\renewrobustcmd*{\bibinitdelim}{}% + } + + \renewbibmacro*{name:family-given}[4]{% + \gbcaselocalset% + \ifuseprefix{% + \usebibmacro{name:delim}{##3##1}% + \usebibmacro{name:hook}{##3##1}% + \mkbibcompletenamefamilygiven{% + \ifdefvoid{##3}{} + {% + \ifcapital + {\mkbibnameprefix{\MakeCapital{##3}}\isdot} + {\mkbibnameprefix{##3}\isdot}% + \ifprefchar{}{\bibnamedelimc} + }% + \mkbibnamefamily{##1}\isdot + \ifdefvoid{##4}{} + {\bibnamedelimd\mkbibnamesuffix{##4}\isdot}% + \ifdefvoid{##2}{} + {\revsdnamepunct\bibnamedelimd\mkbibnamegiven{##2}\isdot} + } + }{% + \usebibmacro{name:delim}{##1}% + \usebibmacro{name:hook}{##1}% + \mkbibcompletenamefamilygiven{% + \mkbibnamefamily{##1}\isdot + \ifdefvoid{##4}{} + {\bibnamedelimd\mkbibnamesuffix{##4}\isdot}% + \ifboolexpe{% + test {\ifdefvoid{##2}} + and + test {\ifdefvoid{##3}} + }{} + {\revsdnamepunct}% + \ifdefvoid{##2}{} + {\bibnamedelimd\mkbibnamegiven{##2}\isdot}% + \ifdefvoid{##3}{} + {\bibnamedelimd\mkbibnameprefix{##3}\isdot} + } + } + } } \cs_new_protected:Npn \@@_pass_options_to_biblatex:n #1 { \PassOptionsToPackage {#1} { biblatex } } -- cgit v1.2.3