\hduthesis_provide_module:n {hdu.l3doc}

\keys_define:nn { hdu.l3doc / docinfo }
  {
    title .tl_set:N         = \l__docinfo_title_clist,
    author .tl_set:N        = \l__docinfo_author_tl,
    CJKmain-font .tl_set:N  = \g__docinfo_main_CJK_font,
    CJKsans-font .tl_set:N  = \g__docinfo_sans_CJK_font,
    CJKmono-font .tl_set:N  = \g__docinfo_mono_CJK_font
  }

\NewDocumentCommand \DocInfo { m }
  {
    \keys_set:nn { hdu.l3doc / docinfo } {#1}
    \title { \bfseries \l__docinfo_title_clist }
    \author { \l__docinfo_author_tl }
    \date
      {
        v\hduthesis@version
        \footnote{\url{https://github.com/xiamyphys/hduthesis}}~
        (\hduthesis@date)
      }
    \tl_if_empty:NF \g__docinfo_main_CJK_font
      { \exp_last_unbraced:No \setCJKmainfont \g__docinfo_main_CJK_font }
    \tl_if_empty:NF \g__docinfo_sans_CJK_font
      { \exp_last_unbraced:No \setCJKsansfont \g__docinfo_sans_CJK_font }
    \tl_if_empty:NF \g__docinfo_mono_CJK_font
      { \exp_last_unbraced:No \setCJKmonofont \g__docinfo_mono_CJK_font }
  }

\hypersetup{urlcolor = teal, filecolor = violet}
\hologoFontSetup{general = \sffamily}
\RequirePackage[mono = false]{libertine}
\RequirePackage{geometry,framed,xeCJKfntef,tikz,pdfpages,subcaption}
\setlength{\oddsidemargin}{.9in} \setlength{\evensidemargin}{.1in}
\FrameSep = 0pt 
\RequirePackage[os = mac]{menukeys}
\RequirePackage{datetime} \yyyymmdddate
\RequirePackage[fontset = none, scheme = plain]{ctex}\linespread{1.5}
\renewcommand \emph[1]
  {\CJKsout*[thickness = 2.5ex, format = \color{blue!15}]{#1}}
\hook_gput_code:nnn { env/function/before } { . } { \vspace{-2ex} }

\def\HoLogo@hduthesis#1
  {
    \raisebox{-.5pt}
      {
        \HOLOGO@mbox
          {
            \tikz[baseline = (hduthesis.base)]
              {
                \node [ inner~sep = 0pt ] (hduthesis)
                  {\textsc{\cls{hduThesi\scalebox{1.2}[1.2]{S}}}};
                \draw let \p1 = (hduthesis.west), \p2 = (hduthesis.east)
                  in (\x1,\y1) (\x2,\y2) [ line~width = {.028pt * (\x2 - \x1)} ]
                  ([yshift = -.5ex]hduthesis.north~west) to[ bend~right = 5 ]
                  ([yshift = .25ex]hduthesis.north~east);
              }
          }
      }
  }

\let \legacy@maketitle \maketitle
\RenewDocumentCommand \maketitle {}
  {
    \titlepage
    \newgeometry{margin = 1in}
    \legacy@maketitle
    \begin{center}
      \tikz
        {
          \node [ opacity = .8 ] 
            { \includegraphics[width = .15\paperwidth]{hdumotto.pdf} };
          \node [ opacity = .3 ]
            { \includegraphics[width = .21\paperwidth]{hdulogo.pdf} };
      }
    \end{center}
    \thispagestyle{empty}
  }

\NewDocumentCommand \mailto {m}
  { \texttt{<\href{mailto:#1}{#1}>} }
\pdfstringdefDisableCommands
  { \def\mailto#1{<#1>} }

\endinput
