<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% --------------------------
% qyxf-book é’±é™¢å­¦è¾…ä¹¦ç±æ¨¡æ¿
% å¦‚ä¸æ¸…æ¥šå«ä¹‰ï¼Œè¯·å‹¿éšæ„æ›´æ”¹
% --------------------------

\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\newcommand{\styversion}{3.1.0}
\newcommand{\styname}{qyxf-book}
\ProvidesClass{qyxf-book}
  [2020/09/11 v3.1.0 Qian Yuan Xue Fu book template]
\typeout{The book template provided by Qian Yuan Xue Fu}

% è®¾å®š key-val é€‰é¡¹
\RequirePackage{kvoptions}
\SetupKeyvalOptions{family = QYXF, prefix = QYXF@}

% é€‰é¡¹å®šåˆ¶ä¸Žå¤„ç†
\DeclareStringOption[basic]{colorscheme}[basic]
\DeclareStringOption{primary}
\DeclareStringOption{secondary}
\DeclareBoolOption[true]{xits}
\DeclareVoidOption{noCJKfont}{\PassOptionsToClass{fontset=none}{ctexbook}}

% å·²åºŸå¼ƒé€‰é¡¹æç¤º
\DeclareVoidOption{color}{\ClassWarning{\styname}{The option `color' is deprecated. Use `colorscheme' instead}}
\DeclareVoidOption{parskip}{\ClassWarning{\styname}{The option `parskip' is deprecated}}
\DeclareVoidOption{decoration}{\ClassWarning{\styname}{The option `decoration' is deprecated, due to the lack of `pgfornament' package in TeX Live 2020}}
\DeclareVoidOption{sourcefont}{\ClassWarning{\styname}{The option `sourcefont' is deprecated. Please customize your fonts by commands of `fontspec' and `xeCJK' package}}
\DeclareVoidOption{plain}{\ClassWarning{\styname}{The option `sourcefont' is deprecated}}
\DeclareVoidOption{opensource}{\ClassWarning{\styname}{The option `opensource' is deprecated}}

% å¤„ç†é€‰é¡¹
\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}}
\ProcessKeyvalOptions*

% è½½å…¥æ–‡ç±»
\PassOptionsToPackage{no-math}{fontspec}
\PassOptionsToPackage{CJKmath = true}{xeCJK}
\LoadClass{ctexbook}

% è¥¿æ–‡å­—ä½“å¤„ç†
\RequirePackage{amsmath}
\ifQYXF@xits
  \setmainfont{XITS}
  \setsansfont{TeX Gyre Heros}[Scale=0.93]
  \RequirePackage{unicode-math}
  \setmathfont{XITS Math}
\fi
\RequirePackage{hologo}

% æ­£æ–‡æ&nbsp;·å¼è®¾ç½®
\RequirePackage[normalem]{ulem}

% è„šæ³¨æ&nbsp;·å¼è°ƒæ•´
\renewcommand{\thefootnote}{\textbf{(\arabic{footnote})}}

% æµ®åŠ¨ä½“ï¼ˆå›¾è¡¨ï¼‰å¤„ç†
\RequirePackage{graphicx}
\graphicspath{{./figure/}{./pic/}{./image}}
\setlength{\textfloatsep}{6pt plus 2pt minus 4pt}
\setlength{\intextsep}{6pt plus 2pt minus 2pt}
\RequirePackage{longtable,booktabs}
\RequirePackage{tikz}
\usetikzlibrary{calc,backgrounds,shadows}
\RequirePackage[many]{tcolorbox}

% caption æ&nbsp;·å¼è®¾å®š
\RequirePackage{caption}
\DeclareCaptionFormat{colored}{\small{\bfseries\color{\CaptionColor}#1} #3}
\captionsetup{
  format = colored,
  skip = 1ex
}

% å¤„ç†é…è‰²æ–¹æ¡ˆ
\RequirePackage{etoolbox}
\ifdefempty{\QYXF@primary}{\relax}{\newcommand{\PrimaryColor}{\QYXF@primary}}
\ifdefempty{\QYXF@secondary}{\relax}{\newcommand{\SecondaryColor}{\QYXF@secondary}}

% color scheme é»˜è®¤å€¼

% for titles amd text
\newcommand{\TitleColor}{black}
\newcommand{\ListColor}{black}
\newcommand{\CaptionColor}{black}
\newcommand{\LinkColor}{black}
\newcommand{\MiscColor}{black}
% for boxes
\newcommand{\BoxBackground}{white}
\newcommand{\BoxFrame}{black!75}
\newcommand{\BoxTitleColor}{white}
\newcommand{\BoxTitleBackground}{black!50}
\newcommand{\BoxColor}{black}
\newcommand{\AlertBackground}{white}
\newcommand{\AlertColor}{black}
\newcommand{\AlertFrame}{black}
\newcommand{\AlertTitleBackground}{black}
\newcommand{\AlertTitleColor}{white}
% for theorems
\newcommand{\DefineBackground}{white}
\newcommand{\DefineFrame}{black!40}
\newcommand{\DefineColor}{black}
\newcommand{\TheoremBackground}{black!10}
\newcommand{\TheoremFrame}{black!80}
\newcommand{\TheoremColor}{black}

% è¯»å– color scheme
\RequirePackage{xstring}
\IfEqCase{\QYXF@colorscheme}{%
  {basic}{\relax}% Basic theme
  {black}{% BLack theme (bicolor)
    % main colors
    \providecommand\PrimaryColor{black}
    % for titles amd text
    \renewcommand\TitleColor{\PrimaryColor}
    \renewcommand\ListColor{\PrimaryColor}
    \renewcommand\CaptionColor{\PrimaryColor}
    \renewcommand\LinkColor{\PrimaryColor}
    \renewcommand\MiscColor{\PrimaryColor}
    % for boxes
    \renewcommand\BoxBackground{white}
    \renewcommand\BoxTitleColor{\PrimaryColor}
    \renewcommand\BoxTitleBackground{white}
    \renewcommand\BoxFrame{\PrimaryColor}
    \renewcommand\AlertTitleColor{white}
    \renewcommand\AlertTitleBackground{\PrimaryColor}
    % for theorems
    \renewcommand\DefineFrame{\PrimaryColor}
    \renewcommand\TheoremBackground{white}
    \renewcommand\TheoremFrame{\PrimaryColor}
  }%
  {rbb}{% Red-Blue-Black theme (tricolor)
    % main colors
    \providecommand\PrimaryColor{blue}
    \providecommand\SecondaryColor{red}
    % for titles amd text
    \renewcommand\TitleColor{\PrimaryColor}
    \renewcommand\ListColor{\PrimaryColor}
    \renewcommand\CaptionColor{\PrimaryColor}
    \renewcommand\LinkColor{\SecondaryColor}
    \renewcommand\MiscColor{\PrimaryColor}
    % for boxes
    \renewcommand\BoxBackground{white}
    \renewcommand\BoxFrame{\PrimaryColor}
    \renewcommand\BoxTitleBackground{\PrimaryColor}
    \renewcommand\AlertColor{\SecondaryColor}
    \renewcommand\AlertFrame{\SecondaryColor}
    \renewcommand\AlertTitleBackground{\SecondaryColor}
    % for theorems
    \renewcommand\DefineFrame{black}
    \renewcommand\TheoremBackground{white}
    \renewcommand\TheoremFrame{\PrimaryColor}
  }%
  {bootstrap-v4}{% Bootstrap V4 theme
    % for titles amd text
    \renewcommand\TitleColor{black!85}
    \renewcommand\ListColor{blue!50!cyan}
    \renewcommand\CaptionColor{cyan!80!olive}
    \renewcommand\LinkColor{blue!67!green!}
    \renewcommand\MiscColor{blue!50!cyan}
    % for boxes
    \renewcommand\BoxBackground{cyan!20!white}
    \renewcommand\BoxFrame{blue!30!teal}
    \renewcommand\BoxTitleBackground{blue!55!cyan}
    \renewcommand\BoxColor{blue!45!teal!80!black}
    \renewcommand\AlertBackground{red!10!white}
    \renewcommand\AlertColor{red!40!black!90!white}
    \renewcommand\AlertFrame{red!75!teal}
    \renewcommand\AlertTitleBackground{red!80!cyan}
    % for theorems
    \renewcommand\DefineBackground{green!8!white!94!black}
    \renewcommand\DefineFrame{green!10!white!90!black}
    \renewcommand\DefineColor{green!40!black!90!white}
    \renewcommand\TheoremBackground{-blue!20!black!96!green}
    \renewcommand\TheoremFrame{-blue!30!black!90!green}
    \renewcommand\TheoremColor{red!57!green!90!black}
  }%
}[\ClassWarning{\styname}{Color scheme `\QYXF@colorscheme' not found, `basic' theme is used then.}]

% tcolorbox æ&nbsp;·å¼è®¾å®š
\tcbset{
  enhanced,
  noparskip,
  after = \noindent,
  colback = \BoxBackground,
  title filled,
  colbacktitle = \BoxTitleBackground,
  colframe = \BoxFrame,
  coltitle = \BoxTitleColor,
  coltext = \BoxColor,
  fonttitle = \bfseries,
  arc = 0.25em,
  boxrule = 0.5pt,
  toptitle = 0.75em,
  bottomtitle = 0.75em,
  boxsep = 0pt,
  left = 1.25em,
  right = 1.25em,
  top = 1.25em,
  bottom = 1.25em,
  drop fuzzy shadow,
  breakable
}

% å¼•å¯¼å‘½ä»¤
\newcommand{\exercise}[1]{\noindent\textbf{\color{\MiscColor}ç»ƒä¹&nbsp; #1}\ }
\newcommand{\solve}[1][è§£]{\noindent\textbf{\color{\MiscColor}#1}\ }
\newcommand{\analysis}[1][åˆ†æž]{\noindent\emph{\color{\MiscColor}#1}\ }

% å®šç†çŽ¯å¢ƒåŠæ&nbsp;·å¼è®¾å®š
\newtheorem{theorem}{å®šç†}
\newtheorem{lemma}[theorem]{å¼•ç†}
\newtheorem{define}{å®šä¹‰}
\BeforeBeginEnvironment{theorem}{\begin{tcolorbox}[colback=\TheoremBackground,colframe=\TheoremFrame,coltext=\TheoremColor]}
\AfterEndEnvironment{theorem}{\end{tcolorbox}}
\BeforeBeginEnvironment{lemma}{\begin{tcolorbox}[colback=\TheoremBackground,colframe=\TheoremFrame,coltext=\TheoremColor]}
\AfterEndEnvironment{lemma}{\end{tcolorbox}}
\BeforeBeginEnvironment{define}{\begin{tcolorbox}[colback=\DefineBackground,colframe=\DefineFrame,coltext=\DefineColor]}
\AfterEndEnvironment{define}{\end{tcolorbox}}
\newtcolorbox{note}{title={æ³¨è®°}}
\newtcolorbox{alert}{
  title = {è­¦å‘Š},
  colback = \AlertBackground,
  colframe = \AlertFrame,
  colbacktitle = \AlertTitleBackground,
  coltitle = \AlertTitleColor,
  coltext = \AlertColor
}

% é¡µé¢è®¾ç½®
\RequirePackage{geometry}
\geometry{margin = 1in}
\setlength{\footskip}{30pt}
\setlength{\headheight}{15pt}

% é“¾æŽ¥è®¾ç½®
\RequirePackage[unicode]{hyperref}
\hypersetup{
  breaklinks,
  unicode,
  linktoc = all,
  bookmarksnumbered = true,
  bookmarksopen = true,
  pdfborder = {0 0 0},
  linktocpage,
  pageanchor = true
}
\hypersetup{
  colorlinks = true,
  linkcolor = \LinkColor,
  anchorcolor = \MiscColor,
  urlcolor = \LinkColor,
  citecolor = \MiscColor
}

% ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜ä¸Žç›®å½•æ&nbsp;·å¼
\RequirePackage{titlesec,titletoc}
\ctexset{section={name={\S,}}}
\titleformat{\chapter}[block]{\color{\TitleColor}\centering\bfseries\fontsize{2.25em}{1.2ex}}{\CTEXthechapter}{1em}{}
\titleformat*{\section}{\color{\TitleColor}\fontsize{1.75em}{1.225ex}\bfseries\centering}
\titleformat*{\subsection}{\color{\TitleColor}\fontsize{1.5em}{1.43ex}\bfseries}
\titleformat*{\subsubsection}{\color{\TitleColor}\fontsize{1.25em}{1.4ex}\bfseries}
\titleformat*{\paragraph}{\color{\TitleColor}\bfseries}
\titleformat*{\subparagraph}{\color{\TitleColor}}
\titlespacing{\chapter}{0pt}{*1}{*4}
\titlecontents{chapter}[24pt]{\hspace{-2pc}\filright}
              {\normalsize\bfseries\contentspush{\thecontentslabel\ }}
              {}{\bfseries\titlerule*[8pt]{.}\contentspage}
\titlecontents{section}[20pt]{\filright}
              {\contentspush{\thecontentslabel\ }}
              {}{\titlerule*[8pt]{.}\contentspage}
\titlecontents{subsection}[18pt]{\hspace{2pc}\filright}
              {\contentspush{\thecontentslabel\ }\itshape}
              {}{\titlerule*[8pt]{}\contentspage}
\setcounter{tocdepth}{2}

% é¡µçœ‰é¡µè„šè®¾ç½®
\newcommand{\footerbox}{%
  {\color{\MiscColor}\bfseries\thepage}\\[-\baselineskip]
  \uline{\hphantom{\@footorginfo}}\\
  \@footorginfo}
\RequirePackage{fancyhdr}
\fancyhead[EC]{\itshape\nouppercase\leftmark}
\fancyhead[OC]{\itshape\nouppercase\rightmark}
\fancyhead[EL,OR]{}
\fancyhead[ER,OL]{}
\fancyfoot[C]{\footerbox}
\fancypagestyle{plain}{%
  \fancyhf{}
  \fancyfoot[C]{\footerbox}
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}}

% åˆ—è¡¨æ&nbsp;·å¼è®¾ç½®
\RequirePackage[shortlabels]{enumitem}
\RequirePackage{pifont}
\setlist{nosep, partopsep=0.5ex}
\setlist[itemize,1]{label={\color{\ListColor}\ding{228}}, left=0.8em}
\setlist[itemize,2]{label={\color{\ListColor}\ding{111}}, left=2.8em}
\setlist[itemize,3]{label={\color{\ListColor}\ding{109}}, left=4.8em}
\setlist[enumerate,1]{label={\color{\ListColor}\textbf{\arabic*}.}, left=0.8em}
\setlist[enumerate,2]{label={\color{\ListColor}{\arabic*}.}, left=2.8em}
\setlist[enumerate,3]{label={\color{\ListColor}({\arabic*})}, left=4.8em}
\setlist[description]{style=nextline, font=\color{\ListColor}\bfseries}

% å‚è€ƒæ–‡çŒ®å®šåˆ¶
\RequirePackage[square,numbers]{natbib}
\renewcommand{\citenumfont}[1]{{\color{\LinkColor}#1}}
\renewcommand{\bibnumfmt}[1]{{\color{\ListColor}[#1]}}
\AtBeginEnvironment{thebibliography}{\addcontentsline{toc}{chapter}{\bibname}}

% æ‚é¡¹
\RequirePackage{lastpage}
\RequirePackage{appendix}
\ctexset{appendix={number={\Roman{chapter}}}}

% è‹¥å¹² metadata
\newcommand{\@subtitle}{}
\newcommand{\subtitle}[1]{\gdef\@subtitle{#1}}
\newcommand{\@typo}{}
\newcommand{\typo}[1]{\gdef\@typo{#1}}
\newcommand{\@cover}{}
\newcommand{\cover}[1]{\gdef\@cover{#1}}
\newcommand{\@orginfo}{%
  \textit{é’±å­¦æ£®ä¹¦é™¢å­¦ä¸šè¾…å¯¼ä¸­å¿ƒ}\\[1ex]
  \textsc{Xi'an Jiaotong University}}
\newcommand{\org}[1]{\gdef\@orginfo{#1}}
\newcommand{\@footorginfo}{\textsc{Qian Yuan Xue Fu}}
\newcommand{\footorg}[1]{\gdef\@footorginfo{#1}}
\newcommand{\@licenseinfo}{%
æœ¬ä½œå“é‡‡ç”¨%
\href{https://creativecommons.org/licenses/by-nc-nd/4.0/}%
{\bfseries CC BY-NC-ND 4.0 åè®®}è¿›è¡Œè®¸å¯ã€‚
ä½¿ç”¨è€…å¯ä»¥åœ¨ç»™å‡ºä½œè€…ç½²ååŠèµ„æ–™æ¥æºçš„å‰æä¸‹å¯¹æœ¬ä½œå“è¿›è¡Œè½¬è½½ï¼Œ%
ä½†ä¸å¾—å¯¹æœ¬ä½œå“è¿›è¡Œä¿®æ”¹ï¼Œäº¦ä¸å¾—åŸºäºŽæœ¬ä½œå“è¿›è¡ŒäºŒæ¬¡åˆ›ä½œï¼Œ%
ä¸å¾—å°†æœ¬ä½œå“è¿ç”¨äºŽå•†ä¸šç”¨é€”ã€‚}
\newcommand{\license}[1]{\gdef\@licenseinfo{#1}}

% å·²åºŸå¼ƒçš„ metadata
\newcommand{\version}[1]{\ClassWarning{\styname}{The metadata item `version' is deprecated}}
\newcommand{\sourcepage}[1]{\ClassWarning{\styname}{The metadata item `sourcepage' is deprecated}}

% å°é¢æ&nbsp;·å¼é‡å®šä¹‰
\newcommand{\titlefont}{\Huge\bfseries}
\newcommand{\subtitlefont}{\huge\itshape}
\newcommand{\authorfont}{\LARGE\itshape}
\newcommand{\datefont}{\Large}
\renewcommand*{\maketitle}{%
  \begin{titlepage}
  \null
  \begin{center}\large
  \begin{tcolorbox}[blanker,borderline west={1mm}{0pt}{\BoxFrame},%
  left=20pt,top=1ex,bottom=1ex,after skip=0pt,no shadow]
  {\color{\TitleColor}\titlefont\@title}
  \ifdefempty\@subtitle{}{\\[1ex]{\color{\TitleColor}\subtitlefont\@subtitle}}
  \end{tcolorbox}
  \begin{tcolorbox}[blanker,borderline west={1mm}{0pt}{\TitleColor},%
  left=20pt,top=2ex,bottom=1ex,before skip=0pt,after skip=0pt,no shadow]
  {\authorfont\@author}\\\datefont\@date
  \end{tcolorbox}
  \vfil\@cover\vfil
  \vbox{\@orginfo}
  \end{center}
  \vfilneg
  \end{titlepage}
  \thispagestyle{empty}
  \newpage
  \hypersetup{pageanchor=true}
  \null\vfill
  \begin{tcolorbox}[title={\bfseries ä½œå“ä¿¡æ¯}]
  \begin{itemize}
    \item \textbf{æ&nbsp;‡é¢˜ï¼š}\@title{}\ifdefempty\@subtitle{}{: \textit{\@subtitle}}
    \item \textbf{ä½œè€…ï¼š}\@author%
    \ifdefempty{\@typo}{}{\item \textbf{æ&nbsp;¡å¯¹æŽ’ç‰ˆï¼š}\@typo}
    \item \textbf{å‡ºå“æ—¶é—´ï¼š}\@date
    \item \textbf{æ€»é¡µæ•°ï¼š}\pageref{LastPage}
  \end{itemize}
  \end{tcolorbox}
  \ifdefempty\@licenseinfo{}{%
    \begin{tcolorbox}[title={\bfseries è®¸å¯è¯è¯´æ˜Ž}]
    \@licenseinfo
    \end{tcolorbox}}
  \newpage
  \pagestyle{fancy}}
\AtBeginDocument{%
  \hypersetup{
    pageanchor=false,
    pdfauthor=\@author,
    pdftitle=\@title,
    pdfsubject={\@author: \@title\ifdefempty{\@subtitle}{}{ - \textit{\@subtitle}}},
    pdfkeywords={qyxf, book},
    pdfcreator={XeLaTeX with \styname\ v\styversion\ \ifdefempty{\@typo}{}{(by \@typo)}}
  }}

% ç›®å½•æ&nbsp;·å¼é‡å®šä¹‰
\renewcommand\tableofcontents{%
\pagestyle{empty}
\begin{center}%
\normalfont\LARGE\bfseries\contentsname%
\@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}
\end{center}
\vskip 3ex%
{\setlength\parskip{0pt}\@starttoc{toc}}
\cleardoublepage
\pagestyle{fancy}
\setcounter{page}{1}
}

% ä¿®æ­£é…è‰²æ–¹æ¡ˆé‡å®šä¹‰é—®é¢˜
\newcommand{\selectcolor}{
  \hypersetup{
    linkcolor = \LinkColor,
    anchorcolor = \MiscColor,
    urlcolor = \LinkColor,
    citecolor = \MiscColor
  }
  \tcbset{
    colback = \BoxBackground,
    colbacktitle = \BoxTitleBackground,
    colframe = \BoxFrame,
    coltitle = \BoxTitleColor,
    coltext = \BoxColor
  }
}

\endinput
</pre></body></html>