% \iffalse meta-comment
%
% File: westlakethesis.dtx
% -----------------------------------------------------------------------
%   Copyright (C) 2026 by Mingyu Xia <myhsia@outlook.com>               *
% -----------------------------------------------------------------------
%   This work may be distributed and/or modified under the conditions   *
%   of the LaTeX Project Public License (LPPL), 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.3c or later is part of all distributions of LaTeX     *
%   version 2008 or later.                                              *
%                                                                       *
%   This work has the LPPL maintenance status `maintained'.             *
%                                                                       *
%   The Current Maintainer of this work is Mingyu Xia.                  *
% -----------------------------------------------------------------------
%   This work consists of the files westlakethesis.dtx,                 *
%                                   westlakethesis.ins,                 *
%                 the derived files westlakethesis.cls,                 *
%                                   wu-depend.code.tex,                 *
%                                   wu-kernel.code.tex,                 *
%                                   wu-params.code.tex,                 *
%                                   wu-thesis.code.tex,                 *
%                                   wu-beamer.code.tex,                 *
%                                   wu-poster.code.tex,                 *
%                                   wu-usrdoc.code.tex,                 *
%                                   westlake-logo.pdf,                  *
%                                   westlake-badge-en.pdf,              *
%                                   westlake-badge-cn.pdf,              *
%                                   westlake-paint-a.pdf,               *
%                                   westlake-paint-b.pdf,               *
%           the documentation files westlakethesis.pdf,                 *
%                               and README.md.                          *
% -----------------------------------------------------------------------
%                                                                       *
%   Any modification of this file should ensure that the copyright and  *
%   license information is placed in the derived files.                 *
%                                                                       *
% -----------------------------------------------------------------------
%
%<*internal>
\iffalse
%</internal>
%
%<*readme>
[![CTAN Version](https://img.shields.io/ctan/v/westlakethesis)](https://ctan.org/pkg/westlakethesis)
[![GitHub Release](https://img.shields.io/github/v/release/myhsia/westlakethesis)](https://github.com/myhsia/westlakethesis/releases/latest)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/myhsia/westlakethesis)](https://github.com/myhsia/westlakethesis/commits)
[![Actions Status](https://github.com/myhsia/westlakethesis/actions/workflows/main.yaml/badge.svg?branch=main)](https://github.com/myhsia/westlakethesis/actions)
[![GitHub Repo stars](https://img.shields.io/github/stars/myhsia/westlakethesis)](https://github.com/myhsia/westlakethesis)

The `WestlakeThesis` LaTeX bundle
=================================

The `WestlakeThesis` is a LaTeX bundle for Westlake University dissertations,
including Ph.D. thesis format, beamer theme, and poster template.

Overview
--------

To load this class, write the line

    \documentclass[<options>]{westlakethesis}

See `westlakethesis.pdf` for more. Happy TeXing!

Issues
------

The issue tracker for `WestlakeThesis` is currently located
[on GitHub](https://github.com/myhsia/westlakethesis/issues).

Build status
------------

This project uses [GitHub Actions](https://github.com/features/actions) as a
hosted continuous integration service. For each commit, the build status is
tested using the current release of TeX Live.

_Current build status:_
![build status](https://github.com/myhsia/westlakethesis/actions/workflows/main.yaml/badge.svg?branch=main)

Copyright and License
---------------------

Copyright (C) 2026 by Mingyu Xia
[`<xiamingyu@westlake.edu.cn>`](mailto:xiamingyu@westlake.edu.cn)

This work may be distributed and/or modified under the conditions
of the LaTeX Project Public License (LPPL), 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.3c or later is part of all distributions of LaTeX
version 2008 or later.

This work has the LPPL maintenance status `maintained`.

The Current Maintainer of this work is **Mingyu Xia**.
%</readme>
%
%<*internal>
\fi
%</internal>
%
%<*class|depend|kernel|params|thesis|beamer|poster|usrdoc>
%<+!driver>\GetIdInfo $Id: westlakethesis.dtx v0.0.1 2026-06-14 myhsia<myhsia@outlook.com>$
% ^^A «Westlake University»  «西湖大学»  高起点 小而精 研究型
% ^^A High Starting Point, Small and Elite, Research-oriented
%<class>  {LaTeX Template Bundle for Westlake University (WESTLAKE)}
%<class>\ProvidesExplClass {\ExplFileName}
%<depend>  {Loading the base class and required packages (WESTLAKE)}
%<depend>\ProvidesExplFile {wu-depend.code.tex}
%<kernel>  {Inner functions for different modes (WESTLAKE)}
%<kernel>\ProvidesExplFile {wu-kernel.code.tex}
%<params>  {Storing the constant variables (WESTLAKE)}
%<params>\ProvidesExplFile {wu-params.code.tex}
%<thesis>  {Formats of Westlake University dissertations (WESTLAKE)}
%<thesis>\ProvidesExplFile {wu-thesis.code.tex}
%<beamer>  {Westlake University Beamer Template (WESTLAKE)}
%<beamer>\ProvidesExplFile {wu-beamer.code.tex}
%<poster>  {Westlake University Poster Template (WESTLAKE)}
%<poster>\ProvidesExplFile {wu-poster.code.tex}
%<usrdoc>  {Documentation (WESTLAKE)}
%<usrdoc>\ProvidesExplFile {wu-usrdoc.code.tex}
%<!driver>  {\ExplFileDate} {\ExplFileVersion} {\ExplFileDescription}
%<class>\edef \WUFileDate        {\ExplFileDate}
%<class>\edef \WUFileVersion     {\ExplFileVersion}
%<class>\edef \WUFileDescription {\ExplFileDescription}
%<class>\tl_greplace_all:Nnn \WUFileDate { / } { - }
%</class|depend|kernel|params|thesis|beamer|poster|usrdoc>
%<*driver>
\PassOptionsToPackage{quiet}{xeCJK}
\documentclass[mode = usrdoc]{westlakethesis}
\usepackage[scheme = plain, linespread = 1.3, fontset = lxgw]{ctex}
\setCJKmonofont [ Extension = .ttf, Scale = .76,
  BoldFont       = MapleMono-CN-Bold,
  ItalicFont     = MapleMono-CN-Italic,
  BoldItalicFont = MapleMono-CN-BoldItalic
] {MapleMono-CN-Regular}
\setmonofont    [ Extension = .ttf, Scale = .76,
  BoldFont       = MapleMono-CN-Bold,
  ItalicFont     = MapleMono-CN-Italic,
  BoldItalicFont = MapleMono-CN-BoldItalic
] {MapleMono-CN-Regular}
\usepackage[osf, mono = false]{libertine}
\usepackage{pdfpages}
\makeindex
\begin{document}
  \DocInput{\jobname.dtx}
  \clearpage
  \PrintIndex
\end{document}
%</driver>
% \fi
%
% \begin{titlepage}
% \pagestyle{empty}
% \title{\bfseries
%   The \hologo{WestlakeThesis} Class\thanks{^^A
%     \url{https://ctan.org/pkg/westlakethesis},\
%     \url{https://github.com/myhsia/westlakethesis}^^A
%   }\\
%   西湖大学学位论文 \LaTeX\ 模板^^A
% }
% \author{Mingyu Xia\thanks{\mail{xiamingyu@westlake.edu.cn}}}
% \date{Released \WUFileDate\quad \texttt{\WUFileVersion}}
% \maketitle
% \vspace{-.5\baselineskip}
% \renewcommand*\abstractname{Abstract \texttt\textbar\ 摘要}
% \begin{abstract}
% The \hologo{westlakethesis} is a \LaTeX\ bundle for Westlake University
% dissertations, including Ph.D. thesis format, \cls{beamer} theme, and poster
% template.
% \setlength \parindent {1.5em}\par
% \hologo{westlakethesis} 是西湖大学学位论文 \LaTeX\ 套装,
% 其中包含博士论文格式, \cls{beamer} 主题与 \pkg{poster} 模板.
% \end{abstract}
%
% \begin{center}
%   \small\bfseries User Agreement \texttt\textbar\ 用户协议
% \end{center}
% \begin{enumerate}[itemsep = 2em, itemsep = 0pt]\small
%   \item This template is open source under the LPPL 1.3c license, and you are
%   free to use the compiled PDF file.\par
%   本模板通过 LPPL 1.3c 协议开放源代码, 您可以随意使用编译出的 PDF 文件.
%   \item This template is built from
%   \href{https://graduateschool.westlake.edu.cn/Download/DegreeApplication/202604/t20260401_65549.html}^^A
%     {Reference Template for Degree Dissertations} distributed by
%   \href{https://graduateschool.westlake.edu.cn/}^^A
%     {Westlake University Graduate School},
%   the maintainer will not be responsible to the trouble of format review.\par
%   本模板根据^^A
%   \href{https://graduateschool.westlake.edu.cn/}^^A
%     {西湖大学研究生院}颁发的^^A
%   \href{https://graduateschool.westlake.edu.cn/Download/DegreeApplication/202604/t20260401_65549.html}^^A
%     {学位论文参考模板}编写而成, 作者不对使用本模板产生的格式审查问题负责.
%   \item This template is highly experimental currently, use at own risk.
%   Welcome to submit issues or PR on
%   \href{https://github.com/myhsia/westlakethesis/issues}{GitHub}
%   to contribute to the standardization of \hologo{westlakethesis}.\par
%   本模板目前处于高度测试阶段, 可能存在格式风险. 欢迎前往
%   \href{https://github.com/myhsia/westlakethesis/}{GitHub}
%   提交反馈意见或拉取请求，为推动规范化 \hologo{westlakethesis} 贡献力量.
% \end{enumerate}
% \end{titlepage}
%
% \begin{documentation}
%
% \section{Loading the template}
%
% Write down the line
% \begin{quote}
%   \cs{documentclass}"[mode = (thesis|beamer|poster)]{westlakethesis}"
% \end{quote}
% to use the interfaces provided by the corresponding \keys{mode} in this
% template.
%
% \section{User's Interfaces}
%
% \begin{function}{\westlakeset}
%   \begin{syntax}
%     \tn{westlakeset} \marg{key-value list}
%   \end{syntax}
% Configure the information of the thesis, and shoulde be used only within the
% preamble. Its mandatory argument accepts the following key-values:
% \begin{keyval}
%   \item [\keys{id}]                         \val{text}:
%   Configure the student ID.
%   \item [\keys{school}]                     \val{key}:
%   Configure the school, only the abbreviation is accepted. The template can
%   map it to the full name automatically then output on the bilingual covers.
%   \begin{multicols}{2}\small
%   \begin{description}
%     \item [|science|, |sci|]:     School of Science
%     \item [|engineering|, |eng|]: School of Engineering
%     \item [|sls|]:                School of Life Sciences
%     \item [|medicine|, |med|]:    School of Medicine
%   \end{description}
%   \end{multicols}
%   \item [\keys{title, subject, author, PI}] \val{text}:
%   Configure the title, subject, author, supervisor,
%   with the bilingual separated with a slash |/|.
%   \item [\keys{master}]                     \val \TFF:
%   Switch the format to Master.
%   \item [\keys{bibsource}]                  \val{string}:
%   Configure the source of the bibliography.
% \end{keyval}
% \end{function}
%
% \begin{function}{\maketitle}
%   Generates the cover page.
% \end{function}
%
% \noindent \DescribeEnv{abstract}^^A
% Inputs the abstract.
% It accepts one optional argument to choose the language.
% \begin{quote}
%   \cs{begin}|{abstract}| \oarg{language} \meta{context} \cs{end}|{abstract}|
% \end{quote}
%
% \begin{function}{\keywords}
%   \begin{syntax}
%     \tn{keywords} \marg{comma list}.
%   \end{syntax}
%   Inputs the keywords, and should not outside the \env{abstract} environment.
% \end{function}
%
% \begin{function}{\printbibliography}
%   Print the bibliography. If the users have not assigned the |bibsource| key
%   in~\tn{westlakeset}, then only a chapter title will be outputted.
% \end{function}
%
% \begin{function}{\commitment}
%   \begin{syntax}
%   \tn{commitment} \oarg{comma list}
%   \end{syntax}
%   This command is used to generate the commitment page.
%   It accepts one optional argument to include the signatures and dates, the
%   signature file and data should be delimited with a half-width comma (|,|).
%   The university requires 3 sets of signature and 3 sets of date on the
%   commitment page. So, as an example, one can write
%   \begin{quote}
%   |\commitment [ example-image-a, June 2025, |\\
%   |              example-image-a, July 2025, |\\
%   |              example-image-b, July 2025 ]|
%   \end{quote}
% \end{function}
%
% \end{documentation}
%
% \clearpage
%
% \begin{documentation}
%
% \section{载入此模板}
%
% 只需写下
% \begin{quote}
%   \cs{documentclass}"[mode = (thesis|beamer|poster)]{westlakethesis}"
% \end{quote}
% 即可使用此模板中对应 \keys{mode} (模式)
% 中提供的接口.
%
% \section{用户接口}
%
% \begin{function}{\westlakeset}
%   \begin{syntax}
%     \tn{westlakeset} \marg{键值列表}
%   \end{syntax}
% 设置论文信息, 仅限在导言区使用.
% 其强制参数接受如下键值对:
% \begin{keyval}
%   \item [\keys{id}]                         \val{text}:
%   设置学号信息.
%   \item [\keys{school}]                     \val{key}:
%   设置所在学院, 仅接受学院简称.
%   模板会自动将简称映射到全称并输出在对应的中英文封面上.
%   \begin{multicols}{2}
%   \begin{description}
%     \item [|science|, |sci|]:     理学院
%     \item [|engineering|, |eng|]: 工学院
%     \item [|sls|]:                生命科学学院
%     \item [|medicine|, |med|]:    医学院
%   \end{description}
%   \end{multicols}
%   \item [\keys{title, subject, author, PI}] \val{text}:
%   设置标题, 所属专业, 作者姓名, 导师姓名,
%   中英文版本之间以斜线 |/| 分割.
%   \item [\keys{master}]                     \val \TFF:
%   切换至硕士学位论文格式.
%   \item [\keys{bibsource}]                  \val{string}:
%   设置参考文献文件源.
% \end{keyval}
% \end{function}
%
% \begin{function}{\maketitle}
%   生成封面页.
% \end{function}
%
% \noindent \DescribeEnv{abstract}^^A
% 输入摘要.
% 其接受一个可选参数用于选择摘要的语言.
% \begin{quote}
%   \cs{begin}|{abstract}| \oarg{language} \meta{context} \cs{end}|{abstract}|
% \end{quote}
%
% \begin{function}{\keywords}
%   \begin{syntax}
%     \tn{keywords} \marg{逗号分隔列表}.
%   \end{syntax}
%   输入关键词, 需在 \env{abstract} 环境中使用.
% \end{function}
%
% \begin{function}{\printbibliography}
%   输出参考文献. 若用户未在 \tn{westlakeset} 中指定 |bibsource|,
%   则只输出章节标题.
% \end{function}
%
% \begin{function}{\commitment}
%   \begin{syntax}
%   \tn{commitment} \oarg{逗号分隔列表}
%   \end{syntax}
%   此命令用于生成承诺书.
%   其接受一个可选参数用于插入签名和日期,
%   签名文件和日期之间需以半角逗号 (|,|) 间隔.
%   根据大学要求, 签名页上共有 3 组签名与日期.
%   例如, 用户可以输入
%   \begin{quote}
%   |\commitment [ example-image-a, June 2025, |\\
%   |              example-image-a, July 2025, |\\
%   |              example-image-b, July 2025 ]|
%   \end{quote}
% \end{function}
%
% \end{documentation}
%
% \StopEventually{\PrintIndex}
% \clearpage \appendix
%
% \begin{implementation}
% \section{The Source Code}
% Using |wu| as the namespace.
%    \begin{macrocode}
%<@@=wu>
%    \end{macrocode}
% \subsection{\texttt{westlakethesis.cls}}
% Start the optionlist |class| for \pkg{l3docstrip}.
%    \begin{macrocode}
%<*class>
%    \end{macrocode}
% \begin{variable}[int]{Knowledge Orange, Exploration Blue}
% Define official colors\footnote{\url{https://en.westlake.edu.cn/about/VIS/}}.
%    \begin{macrocode}
\color_set:nnn { Knowledge Orange } { HTML } { F18B1C }
\color_set:nnn { Exploration Blue } { HTML } { 00498F }
%    \end{macrocode}
% \end{variable}
% \begin{macro}
%   {
%     \@@_msg_new:nn,
%     \@@_msg_error:nn,
%     \@@_msg_warning:nn,
%     \@@_msg_info:nn,
%   }
% Message management: private functions for creating new message and
% broadcasting it as error, warning, or info.
%    \begin{macrocode}
\clist_map_inline:nn { new, error, warning, info }
  {
    \cs_new_protected:cpn { @@_msg_#1:nn }
      { \use:c { msg_#1:nnn } { westlakethesis } }
  }
%    \end{macrocode}
% \end{macro}
% New message: |not found module|, will be used in \cs{@@_load_module:n}.
%    \begin{macrocode}
\@@_msg_new:nn { not ~ found ~ module }
  { The ~ WestlakeThesis ~ module ~ `#1' ~ not ~ found. }
%    \end{macrocode}
% New message: |not recommended fontset|, will be used in the |thesis| mode.
%    \begin{macrocode}
\@@_msg_new:nn { not ~ recommended ~ fontset }
  {
    The ~ fontset ~ `#1' ~ is ~ not ~ recommended, ~ using ~ `windows' ~
    fontset ~ to ~ achieve ~ a ~ maximum ~ compliance ~ of ~ the ~ official ~
    requirement.
  }
%    \end{macrocode}
% New message: |unknown mode| for global option |mode| key.
%    \begin{macrocode}
\@@_msg_new:nn { unknown ~ mode }
  { Couldn't ~ load ~ the ~ `#1' ~ mode ~ of ~ WestlakeThesis. }
%    \end{macrocode}
% \begin{macro}{\@@_unknown_option:n}
% Function for passing unknown options to the basic class.
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_unknown_option:n #1
  {
    \tl_if_empty:nTF {#1}
      {
        \clist_gput_right:NV \g_@@_base_cls_opt_clist \l_keys_key_str
      }
      {
        \exp_args:NNx \clist_gput_right:Nn \g_@@_base_cls_opt_clist
          { \l_keys_key_str = \exp_not:n {#1} }
      }
  }
%    \end{macrocode}
% \begin{variable}{\g_@@_base_cls_opt_clist}
% Variable for storing basic class options.
%    \begin{macrocode}
\clist_clear_new:N \g_@@_base_cls_opt_clist
%    \end{macrocode}
% \end{variable}
% \end{macro}
% \begin{macro}{\@@_load_module:N}
% Functions for loading module in \file{westlakethesis.cls}.
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_load_module:N #1
  {
    \clist_map_inline:Nn #1
      {
        \file_if_exist_input:nF { wu-##1.code.tex }
          { \@@_msg_error:nn { not ~ found ~ module } { ##1 } }
      }
  }
%    \end{macrocode}
% \end{macro}
% Under different modes, the required modules will be loaded.
% \begin{itemize}
%   \item |depend|: Loading the dependencies: class and packages.
%   \item |kernel|: Inner functions for the |thesis| module.
%   \item |params|: Storing the constant variables.
%   \item |thesis|: Formats of Westlake University dissertations.
%   \item |beamer|: Westlake University \cls{beamer} template.
%   \item |poster|: Westlake University \cls{poster} template.
%   \item |usrdoc|: \hologo{WestlakeThesis} documentation.
% \end{itemize}
% \begin{variable}{\g_@@_clsoption_mode_str, \g_@@_module_usage_clist}
% Loading the |thesis| mode by default.
%    \begin{macrocode}
\str_new:N \g_@@_clsoption_mode_str
\clist_new:N \g_@@_module_usage_clist
\keys_define:nn { @@ / clsoption }
  {
    mode          .choices:nn =
      { thesis, beamer, poster, usrdoc }
      { \str_gset:Nn \g_@@_clsoption_mode_str {#1} },
    mode          .initial:n  = { thesis },
    mode          .usage:n    = { load   },
    unknown       .code:n     = \@@_unknown_option:n {#1},
  }
%    \end{macrocode}
% Process the class options and loading the corresponding modules.
%    \begin{macrocode}
\ProcessKeyOptions [ @@ / clsoption ]
\str_case:NnF \g_@@_clsoption_mode_str
  {
    { thesis }
    {
      \clist_gset:Nn \g_@@_module_usage_clist
        { depend, kernel, params, thesis }
    }
    { usrdoc }
    {
      \clist_gset:Nn \g_@@_module_usage_clist
        { depend, kernel, usrdoc }
    }
    { beamer }
    {
      \clist_gset:Nn \g_@@_module_usage_clist
        { depend, kernel, params, beamer }
    }
    { poster }
    {
      \clist_gset:Nn \g_@@_module_usage_clist
        { poster }
    }
  } { \__wu_msg_error:nn { unknown mode } { \g__wu_clsoption_mode_str } }
\@@_load_module:N \g_@@_module_usage_clist
%    \end{macrocode}
% \end{variable}
% \begin{macro}{\westlakeset}
% \hologo{LaTeX2e} user's interface for filling information,
% only valid in preamble. The keys it accepts will be different under
% different modes. Then load the auxiliary function if it has been defined in
% current mode.
%    \begin{macrocode}
\@onlypreamble \westlakeset
\NewDocumentCommand \westlakeset { m }
  {
    \exp_args:No \keys_set:nn { \g_@@_clsoption_mode_str / set } {#1}
    \cs_if_exist_use:N \@@_westlakeset_aux:
  }
%    \end{macrocode}
% \end{macro}
% End the optionlist |class| for \pkg{l3docstrip}.
%    \begin{macrocode}
%</class>
%    \end{macrocode}
% \begin{variable}
%   {
%     \l_@@_set_title_tl,
%     \l_@@_set_author_tl,
%     \l_@@_set_date_tl,
%     \l_@@_set_bib_str,
%     \l_@@_set_subject_tl,
%     \l_@@_set_school_tl,
%     \l_@@_set_PI_tl,
%     \l_@@_set_id_tl,
%     \l_@@_set_master_bool,
%   }
% Key–value definitions for different modes. Using the namespace for filtering.
%    \begin{macrocode}
%<*thesis|beamer|poster|usrdoc>
%    \end{macrocode}
%    \begin{macrocode}
%<thesis>\keys_define:nn { thesis / set }
%<beamer>\keys_define:nn { beamer / set }
%<poster>\keys_define:nn { poster / set }
%<usrdoc>\keys_define:nn { usrdoc / set }
  {
    title     .tl_set:N   = \l_@@_set_title_tl,
    author    .tl_set:N   = \l_@@_set_author_tl,
    date      .tl_set:N   = \l_@@_set_date_tl,
%<!usrdoc>    bibsource .str_set:N  = \l_@@_set_bib_str,
%<!usrdoc>    subject   .tl_set:N   = \l_@@_set_subject_tl,
%<thesis>    school    .tl_set:N   = \l_@@_set_school_tl,
%<thesis>    PI        .tl_set:N   = \l_@@_set_PI_tl,
%<thesis>    id        .tl_set:N   = \l_@@_set_id_tl,
%<thesis>    master    .bool_set:N = \l_@@_set_master_bool,
%<thesis>      master  .initial:n  = false,
%<thesis>      master  .default:n  = true,
  }
%    \end{macrocode}
% The auxiliary function of \cs{westlakeset} for different modes.
% Parsing the bilingualism of the items |title|, |school|, |subject|, |author|,
% and |PI| after filling information, then decide
% \hyperlink{bool:gbt7714_load}{whether to load the \pkg{gbt7714} package} by
% \hypertarget{bool:gbt7714_set}{setting the boolean \cs{l_@@_load_bib_bool}}.
%    \begin{macrocode}
\cs_new_protected:Npn \@@_westlakeset_aux:
  {
%<thesis>    \clist_map_inline:nn { title, author, subject, school, PI }
%<beamer|poster>    \clist_map_inline:nn { title, author, subject }
%<!usrdoc>      { \@@_parse_slash_ab:c { l_@@_set_##1_tl } }
%<beamer>    \title  [ \l_@@_set_title_tl_b  ] { \l_@@_set_title_tl_a  }
%<beamer>    \author [ \l_@@_set_author_tl_b ] { \l_@@_set_author_tl_a }
%<beamer>    \date   { \l_@@_set_date_tl    }
%<!usrdoc>    \str_if_empty:NF \l_@@_set_bib_str
%<!usrdoc>      { \bool_gset_true:N \l_@@_load_bib_bool }
  }
%    \end{macrocode}
% Configure the metadata of the document via \pkg{hyperref}.
%    \begin{macrocode}
\hypersetup
  {
    hidelinks,
%<usrdoc>    colorlinks,
  }
%    \end{macrocode}
%    \begin{macrocode}
%</thesis|beamer|poster|usrdoc>
%    \end{macrocode}
% \end{variable}
% \subsection{\texttt{wu-depend.code.tex}}
% Start the optionlist |depend| for \pkg{l3docstrip}.
%    \begin{macrocode}
%<*depend>
%    \end{macrocode}
% Prevent the warnings raised by \pkg{xeCJK} (valid for \hologo{XeTeX})
% when redefining fonts.
%    \begin{macrocode}
\sys_if_engine_xetex:T
  { \PassOptionsToPackage { quiet } { xeCJK } }
%    \end{macrocode}
% Load the base classes and required packages under different modes:
% The \pkg{zhlineskip}, \pkg{geometry}, \pkg{tocloft}, \pkg{lmodern},
% \pkg{newtxtext}, and~\pkg{microtype} (only valid under the \hologo{pdfTeX},
% \hologo{XeTeX}, and~\hologo{LuaTeX} engines) packages are only required in
% the |thesis| mode.
%    \begin{macrocode}
\str_case:en { \g_@@_clsoption_mode_str }
  {
    { thesis }
    {
      \clist_gput_right:Nn \g_@@_base_cls_opt_clist { a4paper, zihao = -4 }
      \exp_args:NNV \LoadClass [ \g_@@_base_cls_opt_clist ] { ctexrep }
      \RequirePackage [ bodytextleadingratio = 1.5 ] { zhlineskip }
      \RequirePackage { geometry, lmodern, newtxtext }
      \RequirePackage [ titles ] { tocloft }
      \bool_lazy_or:nnT { \sys_if_engine_pdftex_p:      }
                        { \sys_if_engine_opentype_p:    }
                        { \RequirePackage { microtype } }
    }
    { beamer }
    {
      \clist_gput_right:Nn \g_@@_base_cls_opt_clist
        { aspectratio = 1610 }
      \exp_args:NNV \LoadClass [ \g_@@_base_cls_opt_clist ] { beamer }
    }
    { usrdoc }
    {
      \clist_gput_right:Nn \g_@@_base_cls_opt_clist
        { 11pt, letterpaper, cs-break = true }
      \exp_args:NNV \LoadClass [ \g_@@_base_cls_opt_clist ] { l3doc  }
    }
    { poster }
    {
      \clist_gput_right:Nn \g_@@_base_cls_opt_clist
        { }
      \exp_args:NNV \LoadClass [ \g_@@_base_cls_opt_clist ] { beamer }
    }
  }
%    \end{macrocode}
% Load the required packages for all of the modes.
%    \begin{macrocode}
\RequirePackage { graphicx, hyperref, lipsum, zhlipsum, array }
%    \end{macrocode}
% Configure the possible paths for searching figures.
%    \begin{macrocode}
\graphicspath
  {
    {./fig/}  {./pic/}  {./figure/}  {./picture/}  {./media/}
    {./figs/} {./pics/} {./figures/} {./pictures/}
  }
%    \end{macrocode}
% \hypertarget{bool:gbt7714_load}{Determine whether to load the \pkg{gbt7714}
%   package according to \cs{l_@@_load_bib_bool}}, which has been set via
% \tn{westlakeset} \hyperlink{bool:gbt7714_set}{here}.
%    \begin{macrocode}
\hook_gput_code:nnn { begindocument / before } { . }
  {
    \bool_if_exist:NT \l_@@_load_bib_bool
      {
        \bool_if:NT \l_@@_load_bib_bool
          {
            \RequirePackage [ sort, uppercasefamily = false ] { gbt7714 }
            \bibliographystyle { gbt7714-numeric }
          }
      }
  }
%    \end{macrocode}
% End the optionlist |depend| for \pkg{l3docstrip}.
%    \begin{macrocode}
%</depend>
%    \end{macrocode}
% \subsection{\texttt{wu-kernel.code.tex}}
% Start the optionlist |kernel| for \pkg{l3docstrip}.
%    \begin{macrocode}
%<*kernel>
%    \end{macrocode}
% \begin{macro}{\@@_parse_slash_ab:c}
% This function is used for parsing the binary sequence variable \cs{\#1}
% (delimited with |/|): store the first element in \cs{\#1_a},
% store the second element in \cs{\#1_b}.
%    \begin{macrocode}
\cs_new:Npn \@@_parse_slash_ab:c #1
  {
    \exp_args:Nc \tl_if_blank:VF {#1}
      {
        \tl_clear_new:c { #1_a }
        \tl_clear_new:c { #1_b }
        \seq_clear:N \l_@@_set_tmpa_seq
        \seq_set_split:Nne \l_@@_set_tmpa_seq { / } { \use:c {#1} }
        \seq_get_left:Nc  \l_@@_set_tmpa_seq { #1_a }
        \seq_get_right:Nc \l_@@_set_tmpa_seq { #1_b }
      }
  }
\cs_generate_variant:Nn \seq_get_left:NN  { Nc }
\cs_generate_variant:Nn \seq_get_right:NN { Nc }
%    \end{macrocode}
% \begin{variable}{\l_@@_set_tmpa_seq}
% Temporary variable used in \cs{@@_parse_slash_ab:c}.
%    \begin{macrocode}
\seq_clear_new:N \l_@@_set_tmpa_seq
%    \end{macrocode}
% \end{variable}
% \end{macro}
% \begin{macro}{\@@_spread_box:nn}
% This function is used for typesetting the content |#2| in a horizontal box to
% the width |#1| by stretching the glue.
%    \begin{macrocode}
\cs_new_protected:Npn \@@_spread_box:nn #1#2
  {
    \mode_leave_vertical:
    \hbox_to_wd:nn {#1}
      { \exp_args:Nee \tl_map_inline:nn {#2} { ##1 \hfil } \unskip }
  }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@@_center_box:nnn}
% This function is used for typesetting the content |#2| centering within
% several horizontal boxes with width |#1|, then underline every line with
% thickness |#3|.
%    \begin{macrocode}
\cs_new_protected:Npn \@@_center_box:nnn #1#2#3
  {
    \mode_leave_vertical:
    \dim_set:Nn \l_tmpa_dim {#1}
    \box_gset_eq_drop:NN 1 \voidb@x
    \group_begin:
    \vbox_set:Nn 0
      {
        \dim_set:Nn  \parindent   { 0pt            }
        \skip_set:Nn \leftskip    { 0pt plus 1fil  }
        \skip_set:Nn \rightskip   { 0pt plus -1fil }
        \skip_set:Nn \parfillskip { 0pt plus 2fil  }
        #3 \par
        \loop
        \box_set_to_last:N 2
        \reverse_if:N \if_box_empty:N 2
        \vbox_gset_top:Nn 1
          {
            \hbox_to_wd:nn {#1} { \strut \hbox_unpack_drop:N 2 }
            \skip_vertical:n {#2}
            \__box_rule_horizontal:nn { .5pt } { \c_zero_dim }
            \skip_vertical:n { 9.6pt } \vbox_unpack_drop:N 1
          }
        \unskip \unpenalty
        \repeat
      }
    \group_end:
    \tex_box:D 1
  }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@@_signature_inline:n}
% This function is used to include the signature image file inline, i.e.,
% centering align to the text with a height equal to 2.4 times the current
% font size.
%    \begin{macrocode}
\cs_new:Npn \@@_signature_inline:n #1
  {
    \box_move_down:nn { \fp_eval:n { .9 * \f@size } \p@ }
      {
        \hbox:n
          {
            \includegraphics
              [height = \fp_eval:n { 2.4 * \f@size } \p@] {#1}
          }
      }
  }
\cs_new_nopar:Npn \@@_fontsize:nn #1#2
  {
    \@@_kernel_bilingual:nnn {#1}
      {
        \fontsize
          { \dim_to_decimal:n {  #2 bp          } }
          { \dim_to_decimal:n { (#2 bp) * 6 / 5 } } \selectfont
      } { \ctex_zihao:n {#2} }
  }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@@_kernel_month:n, \@@_kernel_year:n}
% These functions are used to typeset month and year in English or Chinese.
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_kernel_month:n #1
  {
    \@@_kernel_bilingual:nnn {#1}
      {
        \if_case:w \int_value:w \c_sys_month_int
          \or: January \or: February \or: March
          \or: April   \or: May      \or: June
          \or: July    \or: August   \or: September
          \or: October \or: November \or: December
        \fi:
      }
      { \zhnum_digits:Nn \c_false_bool { \int_value:w \c_sys_month_int } 月 }
  }
\cs_new_protected_nopar:Npn \@@_kernel_year:n #1
  {
    \@@_kernel_bilingual:nnn {#1}
      { \int_value:w \c_sys_year_int }
      { \zhnum_digits:Nn \c_false_bool { \int_value:w \c_sys_year_int  } 年 }
  }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@@_kernel_bilingual:nnn}
% This function will output |#2| when |#1| equals to |en|, output |#3|
% when |#1| equals to |cn|.
%    \begin{macrocode}
\cs_new_nopar:Npn \@@_kernel_bilingual:nnn #1#2#3
  { \str_case:on {#1} { { en } {#2} { cn } {#3} } }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\printbibliography}
% \hologo{LaTeX2e} user's interface for printing the bibliography.
% When the |bibsource| key is assigned in \tn{westlakeset},
% it will output the complex bibliography;
% when the |bibsource| key is not assigned,
% it will output only a chapter title.
%    \begin{macrocode}
\hook_gput_code:nnn { begindocument / before } { . }
  {
    \bool_if_exist:NT \l_@@_load_bib_bool
      {
        \bool_if:NTF \l_@@_load_bib_bool
          {
            \DeclareDocumentCommand \printbibliography {}
              {
                \addcontentsline{toc}{chapter}{参考文献}
                \group_begin:
                  \dim_set:Nn \bibsep {1pt}
                  \linespread{1.85} \@@_fontsize:nn { cn } { 5 }
                  \bibliography { \l_@@_set_bib_str }
                \group_end:
              }
          } { \newcommand \printbibliography { \chapter* { 参考文献 } } }
      }
  }
%    \end{macrocode}
% \end{macro}
% End the optionlist |kernel| for \pkg{l3docstrip}.
%    \begin{macrocode}
%</kernel>
%    \end{macrocode}
% \subsection{\texttt{wu-params.code.tex}}
% Start the optionlist |params| for \pkg{l3docstrip}.
%    \begin{macrocode}
%<*params>
%    \end{macrocode}
% \begin{variable}{\l_@@_school_en_prop, \l_@@_school_cn_prop}
% Storing the aliases of the English and Chinese names of schools into
% two property lists.
%    \begin{macrocode}
\prop_new:N \l_@@_school_en_prop
\prop_new:N \l_@@_school_cn_prop
\prop_set_from_keyval:Nn \l_@@_school_en_prop
  {
    science     = Science,
    sci         = Science,
    engineering = Engineering,
    eng         = Engineering,
    sls         = Life ~ Sciences,
    medicine    = Medicine,
    med         = Medicine,
  }
\prop_set_from_keyval:Nn \l_@@_school_cn_prop
  {
    science     = 理学院,
    sci         = 理学院,
    engineering = 工学院,
    eng         = 工学院,
    sls         = 生命科学学院,
    medicine    = 医学院,
    med         = 医学院,
  }
%    \end{macrocode}
% \end{variable}
% \begin{variable}
%   {
%     \l_@@_cover_id_box,
%     \l_@@_cover_code_box,
%     \l_@@_cover_en_table_box,
%   }
% \begin{variable}
%   {
%     \l_@@_cover_id_dim,
%     \l_@@_cover_code_dim,
%     \l_@@_cover_en_table_dim
%   }
% Storing the dimension variables by setting the content of boxes:
% The length of student ID, the length of university code,
% the length of English cover items.
%    \begin{macrocode}
\box_new:N \l_@@_cover_id_box
\box_new:N \l_@@_cover_code_box
\box_new:N \l_@@_cover_en_table_box
\hbox_gset:Nn \l_@@_cover_id_box { 0 }
\hbox_gset:Nn \l_@@_cover_code_box { School ~ Code: }
\hbox_gset:Nn \l_@@_cover_en_table_box
  { \@@_fontsize:nn { en } { 16 } \sffamily Supervisor: }
\dim_const:Nn \l_@@_cover_id_dim
  { 13 \box_wd:N \l_@@_cover_id_box }
\dim_const:Nn \l_@@_cover_code_dim
  { \box_wd:N \l_@@_cover_code_box }
\dim_const:Nn \l_@@_cover_en_table_dim
  { \box_wd:N \l_@@_cover_en_table_box }
%    \end{macrocode}
% \end{variable}
% \end{variable}
% \begin{variable}{\l_@@_cover_affilid_tl}
% \begin{variable}
%   {
%     \l_@@_commitment_a_title_tl,
%     \l_@@_commitment_b_title_tl,
%     \l_@@_commitment_a_body_tl,
%     \l_@@_commitment_b_body_tl
%   }
% Store the text contents: The school code, the titles and context of the
% commitment page.
%    \begin{macrocode}
\tl_const:Nn \l_@@_cover_affilid_tl { 14626 }
\tl_const:Nn \l_@@_commitment_a_title_tl
  { 西湖大学研究生学位论文独创性声明 }
\tl_const:Nn \l_@@_commitment_b_title_tl
  { 西湖大学研究生学位论文版权使用授权书 }
\tl_const:Nn \l_@@_commitment_a_body_tl
  {
    本人声明：所呈交的学位论文是本人在导师指导下进行的研究工作及取得的研究成果。
    除了文中特别加以标注和致谢的地方外，论文中不包含其他人已经发表或撰写过的研究
    成果。与本人一同参与本研究工作的合作者所做的任何贡献均已在论文中作了明确的说
    明并表示谢意。本声明的法律结果由本人承担。
  }
\tl_const:Nn \l_@@_commitment_b_body_tl
  {
    本学位论文作者完全了解\ \underline{\kaishu 西湖大学}\ 有关收藏和利用博士、硕
    士学位论文的规定，即：学校有权收藏、使用并向国家有关部门或机构送交论文的印刷
    本和电子版本；允许论文被查阅和借阅；学校可以公布论文的全部或部分内容，可以采
    用影印、缩印或其它复制手段保存论文。
  }
%    \end{macrocode}
% \end{variable}
% \end{variable}
% \begin{variable}{\l_@@_load_bib_bool}
% Boolean for judging whether to load the \pkg{gbt7714} package.
%    \begin{macrocode}
\bool_new:N \l_@@_load_bib_bool
%    \end{macrocode}
% \end{variable}
% End the optionlist |params| for \pkg{l3docstrip}.
%    \begin{macrocode}
%</params>
%    \end{macrocode}
% \subsection{\texttt{wu-thesis.code.tex}}
% Start the optionlist |thesis| for \pkg{l3docstrip}.
%    \begin{macrocode}
%<*thesis>
%    \end{macrocode}
% Check if current fontset is the officially recommended one.
%    \begin{macrocode}
\tl_if_eq:nVF { windows } \g__ctex_fontset_tl
  {
    \exp_args:Nno \@@_msg_warning:nn
      { not ~ recommended ~ fontset } { \g__ctex_fontset_tl }
  }
%    \end{macrocode}
% Configure the geometry.
%    \begin{macrocode}
\geometry { a4paper, hmargin = 1.25in, vmargin = 1in }
%    \end{macrocode}
% \begin{macro}{\maketitle}
% \begin{macro}{\@@_maketitle_cn:, \@@_maketitle_en:}
% \hologo{LaTeX2e} user's interface for generating cover page.
%    \begin{macrocode}
\RenewDocumentCommand \maketitle {}
  {
    \@@_maketitle_cn:
    \@@_maketitle_en:
  }
%    \end{macrocode}
% Auxiliary commands of the \tn{maketitle} macro.
%    \begin{macrocode}
\cs_new_protected:Nn \@@_maketitle_cn:
  {
    \begin{titlepage}
      \group_begin:
        \raggedleft \noindent
        \fangsong
        \linespread{1.0}\selectfont
        \begin{tabular}
          {
            p { 4\ccwd } @{：}
            p \l_@@_cover_id_dim
          }
          \@@_spread_box:nn  { 4\ccwd } { 单位代码 } &
          \@@_center_box:nnn { \l_@@_cover_id_dim } { -1.5pt }
            { \l_@@_cover_affilid_tl  } \\
          \@@_spread_box:nn  { 4\ccwd } { 学号     } &
          \@@_center_box:nnn { \l_@@_cover_id_dim } { -1.5pt }
            { \l_@@_set_id_tl         } \\
        \end{tabular}
        \par \vspace{1.2\baselineskip}
      \group_end:
      \begin{center}
        \includegraphics[height = 1.63cm]{westlake-badge-cn.pdf}
        \par \vspace{.65\baselineskip}
        \LARGE
        \bool_if:NTF \l_@@_set_master_bool { 硕士 } { 博士 }
        学位论文
        \par \vspace{1.15\baselineskip}
        \group_begin:
          \linespread{1.5}\selectfont \Huge \sffamily
          \parbox { 10\ccwd } { \centering \l_@@_set_title_tl_a }
        \group_end:
      \end{center}
      \vfill
      \begin{center}
        \linespread{1.35} \@@_fontsize:nn { cn } { 3 }
        \begin{tabular} { p { 4\ccwd } @{：} p { 15ex } }
          \@@_spread_box:nn  { 4\ccwd } { 培养单位 } &
          \@@_center_box:nnn {  15ex  } { -4.5pt   }
            {
              \prop_item:No \l_@@_school_cn_prop
                { \l_@@_set_school_tl }
            } \\
          \@@_spread_box:nn  { 4\ccwd } { 学科     } &
          \@@_center_box:nnn {  15ex  } { -4.5pt   }
            { \l_@@_set_subject_tl_a  } \\
          \@@_spread_box:nn  { 4\ccwd } { 研究生   } &
          \@@_center_box:nnn {  15ex  } { -4.5pt   }
            { \l_@@_set_author_tl_a   } \\
          \@@_spread_box:nn  { 4\ccwd } { 指导教师 } &
          \@@_center_box:nnn {  15ex  } { -4.5pt   }
            { \l_@@_set_PI_tl_a       } \\
        \end{tabular}
        \par \vspace{3.5\baselineskip}
        \@@_fontsize:nn { cn } { 3 }
        \@@_kernel_year:n { cn } \@@_kernel_month:n { cn }
      \end{center}
      \vspace*{1.25\baselineskip}
    \end{titlepage}
  }
\cs_new_protected:Nn \@@_maketitle_en:
  {
    \begin{titlepage}
      \group_begin:
        \raggedleft \noindent
        \fangsong
        \linespread{1.0}\selectfont
        \begin{tabular}
          {
            p \l_@@_cover_code_dim @{~}
            p \l_@@_cover_id_dim
          }
          School ~ Code: &
          \@@_center_box:nnn { \l_@@_cover_id_dim } { -1.5pt }
            { \l_@@_cover_affilid_tl    } \\
          Student ~ ID:  &
          \@@_center_box:nnn { \l_@@_cover_id_dim } { -1.5pt }
            { \l_@@_set_id_tl           } \\
        \end{tabular}
        \par \vspace{1.2\baselineskip}
      \group_end:
      \begin{center}
        \includegraphics[height = 1.63cm]{westlake-badge-cn.pdf}
        \par \vspace{2.5\baselineskip}
        \group_begin:
          \linespread{1.3}\selectfont \Huge \sffamily
          \parbox { .9\linewidth }
            {
              \centering
              \@@_fontsize:nn { en } { 20 } \selectfont \bfseries \sffamily
              \l_@@_set_title_tl_b
            }
            \par \vspace{1.1\baselineskip}
        \group_end:
        \group_begin:
          \@@_fontsize:nn { cn } { 4 } \sffamily \bfseries
            (
              Degree ~ of ~
              \bool_if:NTF \l_@@_set_master_bool { Master } { Doctor }
            )
        \group_end:
      \end{center}
      \vfill
      \begin{center}
        \linespread{1.35} \@@_fontsize:nn { cn } { 3 } \sffamily \selectfont
        \begin{tabular}
          {
            p \l_@@_cover_en_table_dim @{~}
            p { 15ex }
          }
          School:     &
          \@@_center_box:nnn {  15ex  } { -4.8pt   }
            {
              \prop_item:No \l_@@_school_en_prop
                { \l_@@_set_school_tl }
            } \\
          Discipline: &
          \@@_center_box:nnn {  15ex  } { -4.8pt   }
            { \l_@@_set_subject_tl_b   } \\
          Candidate:  &
          \@@_center_box:nnn {  15ex  } { -4.8pt   }
            { \l_@@_set_author_tl_b    } \\
          Supervisor: &
          \@@_center_box:nnn {  15ex  } { -4.8pt   }
            { \l_@@_set_PI_tl_b        } \\
        \end{tabular}
        \par \vspace{3.5\baselineskip}
        \@@_fontsize:nn { cn } { 3 }
        \@@_kernel_month:n { en }, \space \@@_kernel_year:n  { en }
      \end{center}
      \vspace*{1.25\baselineskip}
    \end{titlepage}
  }
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \noindent \DescribeEnv{abstract}^^A
% Generate the abstract in English and Chinese, and the command \tn{keywords}
% inside this environment will appear as English or Chinese version due to |#1|.
%    \begin{macrocode}
\RenewDocumentEnvironment {abstract} { O { en } }
  {
    \cleardoublepage
    \tl_set:Nn \l_@@_abstract_language_tl {#1}
    \null \vspace{1.8\baselineskip}
    \@beginparpenalty\@lowpenalty
    \noindent
    \@@_kernel_bilingual:nnn {#1}
      {
        \textbf { Abstract:~ }
        \addcontentsline { toc } { chapter } { Abstract }
      }
      {
        \textbf { 摘要： }
        \addcontentsline { toc } { chapter } { 摘要     }
      }
    \ignorespaces
  } { \@endparpenalty\@M }
\hook_gput_code:nnn { env / abstract / before } { . }
  { \linespread{1.63}\selectfont }
%    \end{macrocode}
% \begin{macro}{\keywords}
% \hologo{LaTeX2e} user's interface for typesetting keywords.
% Language will be chosen automatically inside the \env{abstract} environment.
%    \begin{macrocode}
\NewDocumentCommand \keywords { m }
  {
    \par \noindent
    \@@_kernel_bilingual:nnn { \l_@@_abstract_language_tl }
      { \textbf { Keywords: ~ } \clist_use:nn {#1} { ;~ } }
      { \textbf { 关键词：    } \clist_use:nn {#1} { ； } }
  }
%    \end{macrocode}
% \end{macro}
% \begin{macro}[int]{\if@mainmatter, \frontmatter, \mainmatter}
% Copy the commands from the \cls{book} class.
% \end{macro}
%    \begin{macrocode}
\newif \if@mainmatter \@mainmattertrue
\newcommand \frontmatter
  { \cleardoublepage \@mainmatterfalse \pagenumbering {roman} }
\newcommand \mainmatter
  { \cleardoublepage \@mainmattertrue \pagenumbering {arabic} }
% \hook_gput_code:nnn { cmd / @schapter / after } { . }
%   { \addcontentsline{toc}{chapter}{\CTEX@chaptername} }
%    \end{macrocode}
% \begin{macro}{\commitment}
% \hologo{LaTeX2e} user's interface for typesetting the commitment page,
% with signature image attached.
%    \begin{macrocode}
\NewDocumentCommand \commitment { O{} }
  {
    \begin{titlepage}
      \null \vspace{1.2\baselineskip}
      \begin{center}
        \@@_fontsize:nn { cn } { 3 } \sffamily
        \l_@@_commitment_a_title_tl
      \end{center}
      \par \vspace{.5\baselineskip}
      \l_@@_commitment_a_body_tl
      \par \vspace{2\baselineskip} \smallskip
      \begin{minipage} { \dim_eval:n { .5\linewidth - 3\ccwd } }
        学位论文作者签名：
        \@@_signature_inline:n { \clist_item:nn {#1} { 1 } }
      \end{minipage} \hfill
      \begin{minipage} { \dim_eval:n { .5\linewidth - 3\ccwd } }
        签字日期：
        \exp_args:Ne \tl_map_inline:nn { \clist_item:nn {#1} { 2 } } { ##1 }
      \end{minipage}
      \hspace*{2\ccwd}
      \par \vspace{3.25\baselineskip}
      \begin{center}
        \@@_fontsize:nn { cn } { 3 } \sffamily
        \l_@@_commitment_b_title_tl
      \end{center}
      \par \vspace{.5\baselineskip}
      \l_@@_commitment_b_body_tl
      \par \vspace{2\baselineskip} \smallskip
      \begin{minipage} { \dim_eval:n { .5\linewidth - 3\ccwd } }
        学位论文作者签名：
        \@@_signature_inline:n { \clist_item:nn {#1} { 3 } }
        \par \vspace{\baselineskip}
        签字日期：
        \exp_args:Ne \tl_map_inline:nn { \clist_item:nn {#1} { 4 } } { ##1 }
      \end{minipage}\hfill
      \begin{minipage} { \dim_eval:n { .5\linewidth - 3\ccwd }}
        导师签名：
        \@@_signature_inline:n { \clist_item:nn {#1} { 5 } }
        \par \vspace{\baselineskip}
        签字日期：
        \exp_args:Ne \tl_map_inline:nn { \clist_item:nn {#1} { 6 } } { ##1 }
      \end{minipage}
      \hspace*{2\ccwd}
    \end{titlepage}
  }
%    \end{macrocode}
% \end{macro}
% Chapter (|Heading 1|) format.
%    \begin{macrocode}
\ctex_set:nn { chapter }
  {
    format+    = \@@_fontsize:nn { cn } { 3 } \sffamily \mdseries,
    number     = \arabic{chapter},
    beforeskip = 40pt,     afterskip = 30pt,
    aftername  = \enspace, fixskip,
    tocline    = \CTEXnumberline{#1}#2
  }
%    \end{macrocode}
% Section (|Heading 2|) format.
%    \begin{macrocode}
\ctex_set:nn { section }
  {
    format+    = \@@_fontsize:nn { cn } { 4 } \sffamily \mdseries \raggedright,
    beforeskip = 18pt,     afterskip = 15pt,
    aftername  = \enspace, fixskip
  }
%    \end{macrocode}
% Subsection (|Heading 3|) format.
%    \begin{macrocode}
\ctex_set:nn { subsection }
  {
    format+    = \@@_fontsize:nn { en } { 13 } \sffamily \mdseries \raggedright,
    beforeskip = 15.5pt,   afterskip = 13.5pt,
    aftername  = \quad,    fixskip
  }
%    \end{macrocode}
% Susubsection (|Heading 4|) format.
%    \begin{macrocode}
\ctex_set:nn { subsubsection }
  {
    format+    = \@@_fontsize:nn { cn } { -4 } \sffamily \mdseries \raggedright,
    beforeskip = 13pt,     afterskip = 12pt,
    aftername  = \quad,    fixskip
  }
%    \end{macrocode}
% Table of contents format.
%    \begin{macrocode}
\ctex_set:n { contentsname = 目\quad 录, secnumdepth = 3 }
\renewcommand \cftchapfont     { \sffamily                  }
\renewcommand \cftchappagefont { \mdseries                  }
\renewcommand \cftchapleader   { \cftdotfill { \cftdotsep } }
\dim_set:Nn \cftbeforechapskip { \c_zero_dim                }
\dim_set:Nn \cftbeforesecskip  { \c_zero_dim                }
\dim_set:Nn \cftsecindent      { \ccwd                      }
\dim_set:Nn \cftsubsecindent   { 2\ccwd                     }
\dim_set:Nn \cftsecnumwidth    { \ccwd                      }
\dim_set:Nn \cftsubsecnumwidth { 2\ccwd                     }
\renewcommand \cftdotsep       { .5                         }
\renewcommand \@pnumwidth      { 2ex                        }
%    \end{macrocode}
% End the optionlist |thesis| for \pkg{l3docstrip}.
%    \begin{macrocode}
%</thesis>
%    \end{macrocode}
% \subsection{\texttt{wu-beamer.code.tex}}
% Start the optionlist |beamer| for \pkg{l3docstrip}.
%    \begin{macrocode}
%<*beamer>
%    \end{macrocode}
% Loading the \pkg{westlake} beamer theme.
%    \begin{macrocode}
\RequirePackage [ mono = false ] { libertine }
\RequirePackage { anyfontsize }
\usetheme [ logobg = westlake-logo.pdf,    lbadge = westlake-badge-cn.pdf,
            mainbg = westlake-paint-a.png, basebg = westlake-paint-b.png  ]
          { westlake }
%    \end{macrocode}
% End the optionlist |beamer| for \pkg{l3docstrip}.
%    \begin{macrocode}
%</beamer>
%    \end{macrocode}
% \subsection{\texttt{wu-usrdoc.code.tex}}
% Start the optionlist |usrdoc| for \pkg{l3docstrip}.
%    \begin{macrocode}
%<*usrdoc>
%    \end{macrocode}
% Loading the \pkg{l3draw} package.
%    \begin{macrocode}
\RequirePackage { l3draw }
%    \end{macrocode}
% \begin{macro}[int]
%   {
%     \draw_lineto_tikz_w:,
%     \draw_moveto_tikz_w:,
%     \draw_curveto_tikz_w:
%   }
% Auxiliary functions for parsing Ti\textit k\/Z B\'ezier coordinates.
%    \begin{macrocode}
\cs_new_protected:Npn \draw_lineto_tikz_w: (#1, #2)
  { \draw_path_lineto:n { (#1 cm, #2 cm) } }
\cs_new:Npn \draw_moveto_tikz_w:  (#1, #2)
  { \draw_path_moveto:n { (#1 cm, #2 cm) } }
\cs_new_protected:Npn \draw_curveto_tikz_w:
  controls (#1, #2) and (#3, #4) .. (#5, #6)
  {
    \draw_path_curveto:nnn
      { (#1 cm, #2 cm) } { (#3 cm, #4 cm) } {(#5 cm, #6cm)}
  }
%    \end{macrocode}
% \end{macro}
% \begin{variable}
%   {
%     \l_WESTLAKE_hologo_box,
%     \l_UNIVERSITY_hologo_box,
%   }
% \begin{variable}
%   {
%     \l_@@_WESTLAKE_hologo_box,
%     \l_@@_UNIVERSITY_hologo_box
%   }
% Boxes for saving \hologo{WESTLAKE} and \hologo{UNIVERSITY}.
%    \begin{macrocode}
%    \begin{macrocode}
\box_new:N \l_WESTLAKE_hologo_box
\box_new:N \l_UNIVERSITY_hologo_box
\box_new:N \l_@@_WESTLAKE_hologo_box
\box_new:N \l_@@_UNIVERSITY_hologo_box
\hbox_gset:Nn \l_WESTLAKE_hologo_box
  {
    \draw_begin:
    \draw_transform_xscale:n { 1.3333  }
    \draw_transform_yscale:n { -1.3333 }
    % W
    \draw_transform_xshift:n { 3.1946  cm/+1.3333 }
    \draw_transform_yshift:n { 35.0833 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.3361) \scan_stop:
    \clist_map_inline:nn
      {
        {(.0413, 7.4108)},  {(.0706, 7.4108)},  {(.0706, 7.2769)},
        {(.0437, 7.2769)},  {(.0437, 7.3593)},  {(.0098, 7.298)},
        {(-.0098, 7.298)},  {(-.0436, 7.3593)}, {(-.0436, 7.2769)},
        {(-.0706, 7.2769)}, {(-.0706, 7.4108)}, {(-.0413, 7.4108)},
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_path_close:
    \draw_transform_shift_reset:
    % E
    \draw_transform_xshift:n { 3.441   cm/+1.3333 }
    \draw_transform_yshift:n { 35.1468 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.3361)
    \clist_map_inline:nn
      {
        {(-.0615, 7.3361)}, {(-.0615, 7.3067)}, {(-.005, 7.3067)},
        {(-.005, 7.2823)},  {(-.0615, 7.2823)}, {(-.0615, 7.2547)},
        {(0, 7.2547)},      {(0, 7.2291)},      {(-.0912, 7.2291)},
        {(-.0912, 7.363)},  {(0, 7.363)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_path_close:
    \draw_transform_shift_reset:
    % S
    \draw_transform_xshift:n { 3.5962  cm/+1.3333 }
    \draw_transform_yshift:n { 35.1327 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.3361) \scan_stop:
    \clist_map_inline:nn
      {
        {controls (0, 7.3031)      and (-.0258, 7.2965) .. (-.0447, 7.2916)},
        {controls (-.0619, 7.2872) and (-.0689, 7.2845) .. (-.0689, 7.2755)},
        {controls (-.0689, 7.2672) and (-.0621, 7.2623) .. (-.0506, 7.2623)},
        {controls (-.0353, 7.2623) and (-.0315, 7.2703) .. (-.0313, 7.2774)},
      } { \draw_curveto_tikz_w: #1 \scan_stop: }
    \draw_lineto_tikz_w: (-.0027, 7.2774) \scan_stop:
    \clist_map_inline:nn
      {
        {controls (-.0032, 7.2485) and (-.0277, 7.2354) .. (-.0504, 7.2354)},
        {controls (-.0811, 7.2354) and (-.0971, 7.2556) .. (-.0971, 7.2755)},
        {controls (-.0971, 7.3073) and (-.0724, 7.3133) .. (-.0543, 7.3177)},
        {controls (-.0359, 7.3223) and (-.0284, 7.3253) .. (-.0284, 7.3369)},
        {controls (-.0284, 7.3473) and (-.0398, 7.351)  .. (-.0495, 7.351)},
        {controls (-.0633, 7.351)  and (-.0726, 7.3438) .. (-.0732, 7.333)},
      } { \draw_curveto_tikz_w: #1 \scan_stop: }
    \draw_lineto_tikz_w: (-.1014, 7.333) \scan_stop:
    \clist_map_inline:nn
      {
        {controls (-.1008, 7.3588) and (-.079, 7.3781)  .. (-.0501, 7.3781)},
        {controls (-.0206, 7.3781) and (0, 7.3608)      .. (0, 7.3361)},
      } { \draw_curveto_tikz_w: #1 \scan_stop: }
    \draw_path_close:
    \draw_transform_shift_reset:
    % T
    \draw_transform_xshift:n { 3.6639  cm/+1.3333 }
    \draw_transform_yshift:n { 35.1821 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.3361) \scan_stop:
    \clist_map_inline:nn
      {
        {(.0309, 7.3361)},  {(.0309, 7.2291)},  {(.0693, 7.2291)},
        {(.0693, 7.2021)},  {(-.0384, 7.2021)}, {(-.0384, 7.2291)},
        {(0, 7.2291)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_path_close:
    \draw_transform_shift_reset:
    % L
    \draw_transform_xshift:n { 3.8971  cm/+1.3333 }
    \draw_transform_yshift:n { 35.1468 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.3361) \scan_stop:
    \clist_map_inline:nn
      {
        {(-.0597, 7.3361)}, {(-.0597, 7.2291)}, {(-.0905, 7.2291)},
        {(-.0905, 7.363)},  {(0, 7.363)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_path_close:
    \draw_transform_shift_reset:
    % A
    \draw_transform_xshift:n { 3.9755  cm/+1.3333 }
    \draw_transform_yshift:n { 35.1151 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.3361) \scan_stop:
    \clist_map_inline:nn
      {
        {(.019, 7.2887)},   {(.038, 7.3361)},     {(0, 7.3361)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_moveto_tikz_w: (.0341, 7.2531)
    \clist_map_inline:nn
      {
        {(.0341, 7.2531)},  {(.0039, 7.2531)},    {(-.0499, 7.387)},
        {(-.0205, 7.387)},  {(-.0098, 7.3604)},   {(.0478, 7.3604)},
        {(.0585, 7.387)},   {(.0879, 7.387)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_path_close:
    \draw_transform_shift_reset:
    % K
    \draw_transform_xshift:n { 4.1547  cm/+1.3333 }
    \draw_transform_yshift:n { 35.108  cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.3361) \scan_stop:
    \clist_map_inline:nn
      {
        {(.0527, 7.3926)},    {(.0896, 7.3926)},  {(.0271, 7.3256)},
        {(.0896, 7.2587)},    {(.0527, 7.2587)},  {(0, 7.3152)},
        {(0, 7.2587)},        {(-.0309, 7.2587)}, {(-.0309, 7.3926)},
        {(0, 7.3926)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_path_close:
    \draw_transform_shift_reset:
    % E
    \draw_transform_xshift:n { 4.4178  cm/+1.3333 }
    \draw_transform_yshift:n { 35.1468 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.3361) \scan_stop:
    \clist_map_inline:nn
      {
        {(-.0615, 7.3361)},   {(-.0615, 7.3067)}, {(-.005, 7.3067)},
        {(-.005, 7.2823)},    {(-.0615, 7.2823)}, {(-.0615, 7.2547)},
        {(0, 7.2547)},        {(0, 7.2291)},      {(-.0912, 7.2291)},
        {(-.0912, 7.363)},    {(0, 7.363)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_path_close:
    \draw_transform_shift_reset:
    \color_fill:n { Exploration Blue }
    \draw_path_use_clear:n { fill }
    \draw_end:
  }
\hbox_gset:Nn \l_UNIVERSITY_hologo_box
  {
    \draw_begin:
    \draw_transform_xscale:n { 1.3333  }
    \draw_transform_yscale:n { -1.3333 }
    % U
    \draw_transform_xshift:n { 4.6517  cm/+1.3333 }
    \draw_transform_yshift:n { 34.578  cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.5677) \scan_stop:
    \clist_map_inline:nn
      {
        {controls (0, 7.5806)      and (-.0119, 7.591) .. (-.0265, 7.591)},
        {controls (-.0411, 7.591)  and (-.053, 7.5806) .. (-.053, 7.5677)}
      } { \draw_curveto_tikz_w: #1 \scan_stop: }
    \clist_map_inline:nn
      {
        {(-.053, 7.4835)},  {(-.0839, 7.4835)}, {(-.0839, 7.5677)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \clist_map_inline:nn
      {
        {controls (-.0839, 7.5976) and (-.0581, 7.6219).. (-.0265, 7.6219)},
        {controls (0.0052, 7.6219) and (0.0309, 7.5976).. (0.0309, 7.5677)}
      } { \draw_curveto_tikz_w: #1 \scan_stop: }
    \clist_map_inline:nn
      {
        {(0.0309, 7.4835)}, {(0, 7.4835)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_path_close:
    \draw_transform_shift_reset:
    % N
    \draw_transform_xshift:n { 4.8461  cm/+1.3333 }
    \draw_transform_yshift:n { 34.5816 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.5677) \scan_stop:
    \clist_map_inline:nn
      {
        {(-.0586, 7.4812)}, {(-.092, 7.4812)},  {(-.092, 7.6151)},
        {(-.0623, 7.6151)}, {(-.0623, 7.5285)}, {(-.0037, 7.6151)},
        {(0.0297, 7.6151)}, {(0.0297, 7.4812)}, {(0, 7.4812)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_path_close:
    \draw_transform_shift_reset:
    % I
    \draw_transform_xshift:n { 0       cm/+1.3333 }
    \draw_transform_yshift:n { 36.8923 cm/+1.3333 }
    \draw_moveto_tikz_w: (3.6872, 5.8818) \scan_stop:
    \clist_map_inline:nn
      {
        {(3.7181, 5.8818)}, {(3.7181, 5.7479)}, {(3.6872, 5.7479)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_path_close:
    \draw_transform_shift_reset:
    % V
    \draw_transform_xshift:n { 5.0659  cm/+1.3333 }
    \draw_transform_yshift:n { 34.5921 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.5677) \scan_stop:
    \clist_map_inline:nn
      {
        {(-.0361, 7.4719)}, {(-.0655, 7.4719)}, {(-.0151, 7.6059)},
        {(0.0151, 7.6059)}, {(0.0655, 7.4719)}, {(0.0361, 7.4719)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_path_close:
    \draw_transform_shift_reset:
    % E
    \draw_transform_xshift:n { 5.1738  cm/+1.3333 }
    \draw_transform_yshift:n { 34.6415 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.5677) \scan_stop:
    \clist_map_inline:nn
      {
        {(0.0912, 7.5677)}, {(0.0912, 7.5408)}, {(0.0297, 7.5408)},
        {(0.0297, 7.5114)}, {(0.0861, 7.5114)}, {(0.0861, 7.487)},
        {(0.0297, 7.487)},  {(0.0297, 7.4595)}, {(0.0912, 7.4595)},
        {(0.0912, 7.4338)}, {(0, 7.4338)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_transform_shift_reset:
    % R
    \draw_transform_xshift:n { 5.4049  cm/+1.3333 }
    \draw_transform_yshift:n { 34.5392 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.5677) \scan_stop:
    \clist_map_inline:nn
      {
        {(-.0295, 7.5677)}, {(-.0295, 7.5364)}, {(0, 7.5364)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \clist_map_inline:nn
      {
        {controls (0.0085, 7.5364) and (0.0157, 7.5436) ..  (0.0157, 7.5521)},
        {controls (0.0157, 7.5606) and (0.0085, 7.5677) ..  (0, 7.5677)}
      } { \draw_curveto_tikz_w: #1 \scan_stop: }
    \draw_moveto_tikz_w: (0.0182, 7.5889) \scan_stop:
    \draw_lineto_tikz_w: (0.0191, 7.5885) \scan_stop:
    \clist_map_inline:nn
      {
        {controls (0.0334, 7.5819) and (0.0427, 7.5677) ..  (0.0427, 7.5521)},
        {controls (0.0427, 7.53)   and (0.0247, 7.5121) ..  (0.0027, 7.5121)}
      } { \draw_curveto_tikz_w: #1 \scan_stop: }
    \clist_map_inline:nn
      {
        {(-.0592, 7.5121)}, {(-.0592, 7.646)},  {(-.0295, 7.646)},
        {(-.0295, 7.5921)}, {(-.0114, 7.5921)}, {(0.0149, 7.646)},
        {(0.0461, 7.646)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_transform_shift_reset:
    % S
    \draw_transform_xshift:n { 5.5541  cm/+1.3333 }
    \draw_transform_yshift:n { 34.5322 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.5677) \scan_stop:
    \clist_map_inline:nn
      {
        {controls (-.0172, 7.5633) and (-.0242, 7.5606) .. (-.0242, 7.5516)},
        {controls (-.0242, 7.5433) and (-.0174, 7.5384) .. (-.0059, 7.5384)},
        {controls (0.0094, 7.5384) and (0.0132, 7.5463) .. (0.0135, 7.5534)}
      } { \draw_curveto_tikz_w: #1 \scan_stop: }
    \draw_lineto_tikz_w: (0.042, 7.5534) \scan_stop:
    \clist_map_inline:nn
      {
        {controls (0.0415, 7.5246) and (0.017, 7.5114)  .. (-.0057, 7.5114)},
        {controls (-.0364, 7.5114) and (-.0524, 7.5316) .. (-.0524, 7.5516)},
        {controls (-.0524, 7.5834) and (-.0277, 7.5895) .. (-.0096, 7.5938)},
        {controls (0.0088, 7.5983) and (0.0163, 7.6013) .. (0.0163, 7.613)},
        {controls (0.0163, 7.6234) and (0.0049, 7.6271) .. (-.0048, 7.6271)},
        {controls (-.0186, 7.6271) and (-.0279, 7.6199) .. (-.0285, 7.609)}
      } { \draw_curveto_tikz_w: #1 \scan_stop: }
    \draw_lineto_tikz_w: (-.0567, 7.609) \scan_stop:
    \clist_map_inline:nn
      {
        {controls (-.0561, 7.6349) and (-.0343, 7.6542) .. (-.0054, 7.6542)},
        {controls (0.0241, 7.6542) and (0.0447, 7.6369) .. (0.0447, 7.6121)},
        {controls (0.0447, 7.5792) and (0.0189, 7.5726) .. (0, 7.5677)}
      } { \draw_curveto_tikz_w: #1 \scan_stop: }
    \draw_transform_shift_reset:
    % I
    \draw_transform_xshift:n { 0.0     cm/+1.3333 }
    \draw_transform_yshift:n { 36.8923 cm/+1.3333 }
    \draw_moveto_tikz_w: (4.2252, 5.8818) \scan_stop:
    \clist_map_inline:nn
      {
        {(4.2561, 5.8818)}, {(4.2561, 5.7479)}, {(4.2252, 5.7479)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_transform_shift_reset:
    % T
    \draw_transform_xshift:n { 5.6949  cm/+1.3333 }
    \draw_transform_yshift:n { 34.5004 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.5677) \scan_stop:
    \clist_map_inline:nn
      {
        {(0.0384, 7.5677)}, {(0.0384, 7.6747)}, {(0.0693, 7.6747)},
        {(0.0693, 7.5677)}, {(0.1076, 7.5677)}, {(0.1076, 7.5407)},
        {(0, 7.5407)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_transform_shift_reset:
    % Y
    \draw_transform_xshift:n { 5.9796  cm/+1.3333 }
    \draw_transform_yshift:n { 34.4651 cm/+1.3333 }
    \draw_moveto_tikz_w: (0, 7.5677) \scan_stop:
    \clist_map_inline:nn
      {
        {(-.0332, 7.6208)}, {(-.0663, 7.5677)}, {(-.0968, 7.5677)},
        {(-.0486, 7.6449)}, {(-.0486, 7.7017)}, {(-.0178, 7.7017)},
        {(-.0178, 7.6449)}, {(-.0176, 7.6447)}, {(0.0304, 7.5677)}
      } { \draw_lineto_tikz_w: #1 \scan_stop: }
    \draw_transform_shift_reset:
    \color_fill:n { Exploration Blue }
    \draw_path_use_clear:n { fill }
    \draw_end:
  }
%    \end{macrocode}
% \end{variable}
% \end{variable}
% \begin{macro}[int]
%   {
%     \HoLogo@WESTLAKE,       \HoLogo@UNIVERSITY,
%     \HoLogo@thesis,
%     \HoLogo@westlakethesis, \HoLogo@WestlakeThesis
%   }
% Define \pkg{hologo}s for \hologo{WestlakeThesis}.
%    \begin{macrocode}
\def \HoLogo@WESTLAKE #1
  {
    \box_gset_eq:NN \l_@@_WESTLAKE_hologo_box \l_WESTLAKE_hologo_box
    \box_scale:Nnn \l_@@_WESTLAKE_hologo_box { \f@size / 10 } { \f@size / 10 }
    \mode_leave_vertical:
    \box_move_down:nn { \fp_eval:n { \f@size * .015 } \p@ }
      { \box_use_drop:N \l_@@_WESTLAKE_hologo_box }
  }
\def \HoLogo@UNIVERSITY #1
  {
    \box_gset_eq:NN \l_@@_UNIVERSITY_hologo_box \l_UNIVERSITY_hologo_box
    \box_scale:Nnn \l_@@_UNIVERSITY_hologo_box { \f@size / 10 } { \f@size / 10 }
    \mode_leave_vertical:
    \box_move_down:nn { \fp_eval:n { \f@size * .015 } \p@ }
      { \box_use_drop:N \l_@@_UNIVERSITY_hologo_box }
  }
\def \HoLogo@thesis #1
  {
    \hbox_set:Nn \l_tmpa_box
      {
        \normalfont \scshape \fontencoding{T1}\fontfamily {LinuxBiolinumT-TLF}
        \selectfont \tl_map_inline:nn { th\scan_stop: esis } { ##1\kern-.05em }
      }
    \box_scale:Nnn \l_tmpa_box { 1 } { 1.1 }
    \color_select:n { Knowledge Orange }
    \box_use_drop:N \l_tmpa_box
  }
\def \HoLogo@westlakethesis #1
  {
    \scshape
    \tl_map_inline:nn { westlak{e\kern-.1em}{T\kern-.05em}hesis } {##1\kern-.05em}
  }
\def \HoLogo@WestlakeThesis #1
  {
    \draw_begin:
    \hbox_set:Nn \l_tmpb_box
      {
        \hologo{WESTLAKE}
        \HOLOGO@discretionary
        \hologo{thesis}
      }
    \draw_path_moveto:n
      { \f@size * .15pt/2,                         1.3\box_ht:N \l_tmpb_box }
    \draw_path_curveto:nnn
      {  \box_wd:N \l_tmpb_box/3,                  1.9\box_ht:N \l_tmpb_box }
      { 2\box_wd:N \l_tmpb_box/3,                  1.9\box_ht:N \l_tmpb_box }
      { \box_wd:N \l_tmpb_box - \f@size * .15pt/2, 1.3\box_ht:N \l_tmpb_box }
    \color_select:n { Knowledge Orange }
    \draw_set_cap_round:
    \draw_set_linewidth:n  { \f@size * .15pt }
    \draw_path_use_clear:n { stroke }
    \draw_box_use:N \l_tmpb_box
    \draw_end:
  }
%    \end{macrocode}
% \end{macro}
% Load the \pkg{docext} package.
%    \begin{macrocode}
\RequirePackage [ color = Exploration Blue ] { docext }
\DeclareDocumentCommand \mail { m } { \href{mailto:#1}{\ttfamily #1} }
%    \end{macrocode}
% End the optionlist |usrdoc| for \pkg{l3docstrip}.
%    \begin{macrocode}
%</usrdoc>
%    \end{macrocode}
% Restore the namespace.
%    \begin{macrocode}
%<@@=>
%    \end{macrocode}
% \iffalse
%<*class|depend|kernel|params|thesis|beamer|poster|usrdoc>
%<!driver>\file_input_stop:
%</class|depend|kernel|params|thesis|beamer|poster|usrdoc>
% \fi
% \end{implementation}
