%%
%% This is file `njuthesis-undergraduate.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% njuthesis.dtx  (with options: `definition-ug')
%% 
%% Copyright (C) 2021 - 2022
%% by Nanjing University Linux User Group
%% <git+nju-lug-email-3104-issue-@yaoge123.cn>
%% 
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.3c of this license
%% or (at your option) any later version.  The latest version of this
%% license is in:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3 or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 
%% To produce the documentation run the original source files ending with
%% `.dtx' through XeTeX.
%% 
\GetIdInfo $Id: njuthesis.dtx 0.17.0 2022-04-09 16:30:00 +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
  {Undergraduate definition file for njuthesis}
\ProvidesExplFile{njuthesis-undergraduate.def}
  {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
\tl_const:Nn \c__nju_pagestyle_tl { plain    }
\__nju_declare_element:nn { cover / ug / emblem-img }
  {
    content = \njuemblem [ black ] { ! } { 3.35 cm },
    bottom-skip = 1 cm,
    align   = l
  }
\__nju_declare_element:nn { cover / ug / name-img }
  {
    content     = \njuname [ black ] { ! } { 3 cm },
    bottom-skip = 1 cm
  }
\__nju_declare_element:nn { cover / ug / title }
  {
    content  =
      \__nju_spread_box:nnV { 9 em } { \bf } \g__nju_info_type_tl,
    format   = \zihao { -1 },
    bottom-skip = 0 pt plus 1.5 fill
  }
\__nju_declare_element:nn { cover / ug / info }
  {
    content  =
      \__nju_cover_info_ug:NN \g__nju_coverlabel_dim \g__nju_coveruline_dim,
    format   = \zihao { 3 }
  }
\cs_new_protected:Npn \__nju_cover_info_ug:NN #1#2
  {
    \begin{minipage} { #1 + #2 + \g__nju_smallhskip_dim }
      \dim_set_eq:NN \baselineskip \g__nju_coverlineskip_dim
      \dim_set:Nn \l__nju_tmpb_dim { .5 #2 - .5 #1 - \g__nju_smallhskip_dim }
      \__nju_cover_entry:nnn { dept     } { #1 } { #2 }
      \__nju_cover_entry:nnn { major    } { #1 } { #2 }
      \__nju_cover_entry_title:nnn  { \bf } { #1 } { #2 }
      \__nju_cover_bientry:nnnn { grade } { id } { #1 } { \l__nju_tmpb_dim }
      \__nju_cover_entry:nnn { author   } { #1 } { #2 }
      \__nju_cover_entry_supv:nnn { supv } { #1 } { \l__nju_tmpb_dim }
      \bool_if:NT \l__nju_second_supv_bool
        { \__nju_cover_entry_supv:nnn { supv_ii } { #1 } { \l__nju_tmpb_dim } }
      \__nju_cover_entry:nnn { submitdate  } { #1 } { #2 }
    \end{minipage}
  }
\__nju_declare_page:nn { cover-ug-default }
  {
    element     = { emblem-img, name-img, title, info },
    prefix      = cover / ug /,
    bottom-skip = 0.5 cm plus 1.5 fill
  }
\cs_new_protected:Npn \__nju_make_cover:
  {
    \UseInstance { nju } { cover-ug-default }
  }
\cs_new_protected:Npn \__nju_make_origdecl:
  {
    \chapter* { \g__nju_name_origdecl_tl }
    \thispagestyle { empty }
    \g__nju_text_origdecl_tl
    \vfil
    \begin{flushright}
      \clist_map_inline:nn { origsign, id, origdate }
        { \__nju_vskip: \__nju_name:n { ##1 } ： \__nju_uline:n { 7 em } }
    \end{flushright}
    \vfil
  }
\cs_new_protected:Npn \__nju_make_authdecl:
  {
      \prg_do_nothing:
  }
\__nju_declare_element:nn { abstract / title }
  {
    content     = \__nju_abs_title:V \g__nju_name_abstracttitle_tl,
    format      = \bfseries \kaishu \zihao { -2 },
    bottom-skip = 1.2 cm
  }
\__nju_declare_element:nn { abstract / info }
  {
    content     = \__nju_abs_info_ug:nn { } { ： },
    format      = \zihao { -4 } \kaishu,
    bottom-skip = 1 cm,
    align       = l
  }
\__nju_declare_element:nn { abstract / en / title }
  {
    content     = \__nju_abs_title:V \g__nju_name_abstracttitle_en_tl,
    format      = \bfseries \kaishu \zihao { -2 },
    bottom-skip = 1.2 cm
  }
\__nju_declare_element:nn { abstract / en / info }
  {
    content     = \__nju_abs_info_ug:nn { _en } { :~ },
    format      = \zihao { -4 },
    bottom-skip = 1 cm,
    align       = l
  }
\cs_new_protected:Npn \__nju_abs_info_ug:nn #1#2
  {
    \tl_if_blank:eTF { #1 }
      { \g__nju_name_title_tl }
      { \clist_item:Nn \g__nju_name_type_en_clist { \g__nju_info_type_int } }
    #2 \tl_use:c { g__nju_info_title #1 _tl } \\
    \tl_set_eq:NN \g__nju_name_author_tl \g__nju_name_author_a_tl
    \clist_map_inline:nn { dept, major, author, supvfull }
      { \__nju_name:n { ##1 #1 } #2 \__nju_info:n { ##1 #1 } \\ }
    \__nju_name:n { abstract #1 } #2
  }
\__nju_declare_element:nn { abstract / mark }
  {
    content     = \g__nju_name_abstract_b_tl,
    format      = \sffamily \zihao { -3 },
    bottom-skip = 1 cm
  }
\__nju_declare_element:nn { abstract / en / mark }
  {
    content     = \g__nju_name_abstract_b_en_tl,
    format      = \sffamily \zihao { -3 },
    bottom-skip = 1 cm
  }
\cs_new_protected:Npn \__nju_make_abstract:
  {
    \UseInstance { nju } { abstract / title }
    \UseInstance { nju } { abstract / info  }
  }
\cs_new_protected:Npn \__nju_make_abstract_en:
  {
    \UseInstance { nju } { abstract / en / title }
    \UseInstance { nju } { abstract / en / info  }
  }
\clist_map_inline:nn
  {
    { acknowledgement } { 致 \qquad{} 谢                },
    { tableofcontents } { 目 \qquad{} 录                },
    { id              } { 学号                          },
    { listoffigures   } { 插图目录                      },
    { listoftables    } { 表格目录                      },
    { notation        } { 符号表                        },
    { origdate        } { 日期                          },
    { paperlist       } { 发表文章目录                  },
    { pdfcreator      } { LaTeX~ with~ njuthesis~ class },
    { preface         } { 前 \qquad{} 言                },
    { supv_ii         } { 第二导师                      },
    { supv_ttl        } { 职称                          }
  }
  { \__nju_define_name:nn #1 }
\clist_map_inline:nn
  {
    { abstract   } { 摘要       } { ABSTRACT            },
    % 用于书签的摘要名称字样
    { abstract_a } { 中文摘要   } { ABSTRACT            },
    % 用于小标题的摘要名称字样
    { abstract_b } { 摘\qquad{}要 } { ABSTRACT          },
    { appendix   } { 附录       } { appendix            },
    { dept       } { 院系       } { DEPARTMENT          },
    { figure     } { 图         } { figure              },
    { keywords   } { 关键词：   } { Keywords:~          },
    { lang       } { 中文       } { 英文                },
    { nju        } { 南京大学   } { Nanjing~ University },
    { table      } { 表         } { table               }
  }
  { \__nju_define_name:nnn #1 }
\clist_map_inline:nn
  {
    % 用于摘要的作者名称字样
    { author_a    } { 本科生姓名                         },
    { grade       } { 年级                               },
    { origdecl    }
      { \g__nju_name_nju_tl 本科毕业论文（设计）诚信承诺书 },
    { origsign    } { 作者签名                           },
    { submitdate  } { 提交日期                           },
    { supv        } { 导师                               },
    { title       } { 题目                               },
    { type        } { 本科生毕业论文（设计、作品）       },
    { ug          } { 本科生                             }
  }
  { \__nju_define_name:nn #1 }
\clist_map_inline:nn
  {
    { abstracttitle }
      {
        \g__nju_name_nju_tl  \g__nju_name_type_tl
        \g__nju_name_lang_tl \g__nju_name_abstract_tl
      }
      {
        \g__nju_name_nju_tl     \g__nju_name_type_tl
        \g__nju_name_lang_en_tl \g__nju_name_abstract_tl
      },
    { author    } { 学生姓名               } { UNDERGRADUATE  },
    { major     } { 专业                   } { SPECIALIZATION },
    { supvfull  } { 指导教师（姓名、职称） } { MENTOR         }
  }
  { \__nju_define_name:nnn #1 }
\tl_const:Nn \g__nju_text_origdecl_tl
  {
    本人郑重承诺：所呈交的毕业论文（设计）（题目： \g__nju_info_title_tl ）
    是在指导教师的指导下严格按照学校和院系有关规定由本人独立完成的。
    本毕业论文（设计）中引用他人观点及参考资源的内容均已标注引用，
    如出现侵犯他人知识产权的行为，由本人承担相应法律责任。
    本人承诺不存在抄袭、伪造、篡改、代写、买卖毕业论文（设计）等违纪行为。
  }
\clist_map_inline:nn
  {
    { axiom      } { 公理 } { Axiom      },
    { corollary  } { 推论 } { Corollary  },
    { definition } { 定义 } { Definition },
    { example    } { 例   } { Example    },
    { lemma      } { 引理 } { Lemma      },
    { proof      } { 证明 } { Proof      },
    { theorem    } { 定理 } { Theorem    }
  }
  { \__nju_add_theorem_type:nnn #1 }
\clist_map_inline:nn
  {
    { coverlabel    } { 68  pt },
    { coverlineskip } { 40  pt },
    { coveruline    } { 270 pt },
    { smallhskip    } { 5   pt },
    { smallvskip    } { 1   ex }
  }
  { \__nju_define_dim:nn #1 }
\clist_map_inline:nn
  {
    { chapterintoc  } { \large \normalfont \sffamily            },
    { chapter       } { \large \normalfont \sffamily \centering },
    { section       } { \large \normalfont \sffamily            },
    { subsection    } { \large \normalfont \sffamily            },
    { subsubsection } { \large \normalfont \sffamily            },
    { toctitle      } { \centering \zihao { 3 } \bfseries       }
  }
  { \__nju_define_fmt:nn #1 }
\endinput
%%
%% End of file `njuthesis-undergraduate.def'.
