<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \iffalse meta-comment
% !TeX program  = XeLaTeX
% !TeX encoding = UTF-8
%
% Copyright (C) 2003--2022
% CTEX.ORG and any individual authors listed elsewhere in this file.
% --------------------------------------------------------------------------
%
% This work 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. This version of this license is in
%    http://www.latex-project.org/lppl/lppl-1-3c.txt
% and 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.
%
% This work has the LPPL maintenance status "maintained".
%
% --------------------------------------------------------------------------
%
%&lt;*internal&gt;
\iffalse
%&lt;/internal&gt;
%&lt;*readme&gt;
ctex
====

`ctex` is a collection of macro packages and document classes
for LaTeX Chinese typesetting.

Authors and Contributors
------------------------

* Wu Lingyun &lt;aloft@ctex.org&gt;
* Jiang Jiang &lt;gzjjgod@gmail.com&gt;
* Wang Yue &lt;yuleopen@gmail.com&gt;
* Liu Haiyang &lt;leoliu.pku@gmail.com&gt;
* Li Yanrui &lt;liyanrui.m2@gmail.com&gt;
* Chen Zhichu &lt;zhichu.chen@gmail.com&gt;
* Li Qing &lt;sobenlee@gmail.com&gt;
* Liam Huang &lt;liamhuang0205@gmail.com&gt;
* Zeng Xiangdong &lt;xdzeng96@gmail.com&gt;
* Li Zeping &lt;zepinglee@gmail.com&gt;
* Zhou Yukai &lt;muzimuzhi@gmail.com&gt;
* Zhang Ruixi &lt;ruixizhang42@gmail.com&gt;

Contributing
------------

This package is a part of the [ctex-kit](https://github.com/CTeX-org/ctex-kit) project.

Issues and pull requests are welcome.

Copyright and Licence
---------------------

    Copyright (C) 2003--2022
    CTEX.ORG and any individual authors listed elsewhere in this file.
    ----------------------------------------------------------------------

    This work 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. This version of this license is in
       http://www.latex-project.org/lppl/lppl-1-3c.txt
    and 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.

    This work has the LPPL maintenance status "maintained".

    This package consists of the files ctex.dtx,
                                       ctxdoc.cls,
                                       ctxdocstrip.tex,
                                       ctex-zhconv.lua,
                                       ctex-zhconv-make.lua,
                 and the derived files ctex.pdf,
                                       ctex.ins,
                                       ctex.sty,
                                       ctexsize.sty,
                                       ctexheading.sty,
                                       ctexart.cls,
                                       ctexbook.cls,
                                       ctexrep.cls,
                                       ctexbeamer.cls,
                                       ctexcap.sty,
                                       ctexhook.sty,
                                       ctexpatch.sty,
                                       ctex-c5size.clo,
                                       ctex-cs4size.clo,
                                       ctex-heading-article.def,
                                       ctex-heading-book.def,
                                       ctex-heading-report.def,
                                       ctex-heading-beamer.def,
                                       ctex-scheme-plain.def,
                                       ctex-scheme-plain-article.def,
                                       ctex-scheme-plain-book.def,
                                       ctex-scheme-plain-report.def,
                                       ctex-scheme-plain-beamer.def,
                                       ctex-scheme-chinese.def,
                                       ctex-scheme-chinese-article.def,
                                       ctex-scheme-chinese-book.def,
                                       ctex-scheme-chinese-report.def,
                                       ctex-scheme-chinese-beamer.def,
                                       ctex-name-gbk.cfg,
                                       ctex-name-utf8.cfg,
                                       ctex.cfg,
                                       ctexopts.cfg,
                                       ctexbackend.cfg,
                                       ctex-engine-pdftex.def,
                                       ctex-engine-xetex.def,
                                       ctex-engine-luatex.def,
                                       ctex-engine-aptex.def,
                                       ctex-engine-uptex.def,
                                       c19rm.fd,
                                       c19sf.fd,
                                       c19tt.fd,
                                       c70rm.fd,
                                       c70sf.fd,
                                       c70tt.fd,
                                       jy2zhrm.fd,
                                       jy2zhsf.fd,
                                       jy2zhtt.fd,
                                       jt2zhrm.fd,
                                       jt2zhsf.fd,
                                       jt2zhtt.fd,
                                       ctex-fontset-adobe.def,
                                       ctex-fontset-fandol.def,
                                       ctex-fontset-founder.def,
                                       ctex-fontset-mac.def,
                                       ctex-fontset-macnew.def,
                                       ctex-fontset-macold.def,
                                       ctex-fontset-ubuntu.def,
                                       ctex-fontset-windows.def,
                                       ctexspa.def,
                                       ctexpunct.spa,
                                       ctex-spa-make.tex,
                                       ctex-spa-macro.tex,
                                       ctex-zhmap-adobe.tex,
                                       ctex-zhmap-fandol.tex,
                                       ctex-zhmap-founder.tex,
                                       ctex-zhmap-mac.tex,
                                       ctex-zhmap-ubuntu.tex,
                                       ctex-zhmap-windows.tex,
                                       ctex-zhconv-index.lua,
                                       translator-theorem-dictionary-ChineseGBK.dict,
                                       translator-theorem-dictionary-ChineseUTF8.dict, and
                                       README.md (this file).
%&lt;/readme&gt;
%&lt;*internal&gt;
\fi
\begingroup
  \def\temp{LaTeX2e}
\expandafter\endgroup\ifx\temp\fmtname\else
\csname fi\endcsname
%&lt;/internal&gt;
%&lt;*install&gt;

\input ctxdocstrip %

\preamble

    Copyright (C) 2003--2022
    CTEX.ORG and any individual authors listed in the documentation.
---------------------------------------------------------------------

    This work 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. This version of this license is in
       http://www.latex-project.org/lppl/lppl-1-3c.txt
    and 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.

    This work has the LPPL maintenance status "maintained".

---------------------------------------------------------------------

\endpreamble
\postamble

    This package consists of the files ctex.dtx,
                                       ctxdoc.cls,
                                       ctxdocstrip.tex,
                                       ctex-zhconv.lua,
                                       ctex-zhconv-make.lua,
                 and the derived files ctex.pdf,
                                       ctex.ins,
                                       ctex.sty,
                                       ctexsize.sty,
                                       ctexheading.sty,
                                       ctexart.cls,
                                       ctexbook.cls,
                                       ctexrep.cls,
                                       ctexbeamer.cls,
                                       ctexcap.sty,
                                       ctexhook.sty,
                                       ctexpatch.sty,
                                       ctex-c5size.clo,
                                       ctex-cs4size.clo,
                                       ctex-heading-article.def,
                                       ctex-heading-book.def,
                                       ctex-heading-report.def,
                                       ctex-heading-beamer.def,
                                       ctex-scheme-plain.def,
                                       ctex-scheme-plain-article.def,
                                       ctex-scheme-plain-book.def,
                                       ctex-scheme-plain-report.def,
                                       ctex-scheme-plain-beamer.def,
                                       ctex-scheme-chinese.def,
                                       ctex-scheme-chinese-article.def,
                                       ctex-scheme-chinese-book.def,
                                       ctex-scheme-chinese-report.def,
                                       ctex-scheme-chinese-beamer.def,
                                       ctex-name-gbk.cfg,
                                       ctex-name-utf8.cfg,
                                       ctex.cfg,
                                       ctexopts.cfg,
                                       ctexbackend.cfg,
                                       ctex-engine-pdftex.def,
                                       ctex-engine-xetex.def,
                                       ctex-engine-luatex.def,
                                       ctex-engine-aptex.def,
                                       ctex-engine-uptex.def,
                                       c19rm.fd,
                                       c19sf.fd,
                                       c19tt.fd,
                                       c70rm.fd,
                                       c70sf.fd,
                                       c70tt.fd,
                                       jy2zhrm.fd,
                                       jy2zhsf.fd,
                                       jy2zhtt.fd,
                                       jt2zhrm.fd,
                                       jt2zhsf.fd,
                                       jt2zhtt.fd,
                                       ctex-fontset-adobe.def,
                                       ctex-fontset-fandol.def,
                                       ctex-fontset-founder.def,
                                       ctex-fontset-mac.def,
                                       ctex-fontset-macnew.def,
                                       ctex-fontset-macold.def,
                                       ctex-fontset-ubuntu.def,
                                       ctex-fontset-windows.def,
                                       ctexspa.def,
                                       ctexpunct.spa,
                                       ctex-spa-make.tex,
                                       ctex-spa-macro.tex,
                                       ctex-zhmap-adobe.tex,
                                       ctex-zhmap-fandol.tex,
                                       ctex-zhmap-founder.tex,
                                       ctex-zhmap-mac.tex,
                                       ctex-zhmap-ubuntu.tex,
                                       ctex-zhmap-windows.tex,
                                       ctex-zhconv-index.lua,
                                       translator-theorem-dictionary-ChineseGBK.dict,
                                       translator-theorem-dictionary-ChineseUTF8.dict, and
                                       README.md.
\endpostamble

\generate
  {
    \usedir{tex/latex/ctex}
    \file{ctex.sty}                        {\from{\jobname.dtx}{style,ctex}}
    \file{ctexsize.sty}                    {\from{\jobname.dtx}{style,ctexsize}}
    \file{ctexheading.sty}                 {\from{\jobname.dtx}{style,ctexheading}}
    \file{ctexart.cls}                     {\from{\jobname.dtx}{class,article}}
    \file{ctexbook.cls}                    {\from{\jobname.dtx}{class,book}}
    \file{ctexrep.cls}                     {\from{\jobname.dtx}{class,report}}
    \file{ctexbeamer.cls}                  {\from{\jobname.dtx}{class,beamer}}
    \usepostamble\emptypostamble
    \file{ctexcap.sty}                     {\from{\jobname.dtx}{ctexcap}}
    \file{ctexhook.sty}                    {\from{\jobname.dtx}{ctexhook}}
    \file{ctexpatch.sty}                   {\from{\jobname.dtx}{ctexpatch}}
    \file{ctex-c5size.clo}                 {\from{\jobname.dtx}{c5size}}
    \file{ctex-cs4size.clo}                {\from{\jobname.dtx}{cs4size}}
    \file{ctex-heading-article.def}        {\from{\jobname.dtx}{heading,article}}
    \file{ctex-heading-book.def}           {\from{\jobname.dtx}{heading,book}}
    \file{ctex-heading-report.def}         {\from{\jobname.dtx}{heading,report}}
    \file{ctex-heading-beamer.def}         {\from{\jobname.dtx}{heading,beamer}}
    \file{ctex-scheme-plain.def}           {\from{\jobname.dtx}{scheme,generic,plain}}
    \file{ctex-scheme-plain-article.def}   {\from{\jobname.dtx}{scheme,article,plain}}
    \file{ctex-scheme-plain-book.def}      {\from{\jobname.dtx}{scheme,book,plain}}
    \file{ctex-scheme-plain-report.def}    {\from{\jobname.dtx}{scheme,report,plain}}
    \file{ctex-scheme-plain-beamer.def}    {\from{\jobname.dtx}{scheme,beamer,plain}}
    \file{ctex-scheme-chinese.def}         {\from{\jobname.dtx}{scheme,generic,chinese}}
    \file{ctex-scheme-chinese-article.def} {\from{\jobname.dtx}{scheme,article,chinese}}
    \file{ctex-scheme-chinese-book.def}    {\from{\jobname.dtx}{scheme,book,chinese}}
    \file{ctex-scheme-chinese-report.def}  {\from{\jobname.dtx}{scheme,report,chinese}}
    \file{ctex-scheme-chinese-beamer.def}  {\from{\jobname.dtx}{scheme,beamer,chinese}}
 \ctxfile{GBK}{ctex-name-gbk.cfg}          {\from{\jobname.dtx}{name,GBK}}
    \file{ctex-name-utf8.cfg}              {\from{\jobname.dtx}{name,UTF8}}
    \file{ctex.cfg}                        {\from{\jobname.dtx}{config}}
    \file{ctexopts.cfg}                    {\from{\jobname.dtx}{ctexopts}}
    \file{ctexbackend.cfg}                 {\from{\jobname.dtx}{backend}}
    \file{ctex-engine-pdftex.def}          {\from{\jobname.dtx}{pdftex}}
    \file{ctex-engine-xetex.def}           {\from{\jobname.dtx}{xetex}}
    \file{ctex-engine-luatex.def}          {\from{\jobname.dtx}{luatex}}
    \file{ctex-engine-aptex.def}           {\from{\jobname.dtx}{aptex}}
    \file{ctex-engine-uptex.def}           {\from{\jobname.dtx}{uptex}}
    \file{c19rm.fd}                        {\from{\jobname.dtx}{fd,rm,c19}}
    \file{c19sf.fd}                        {\from{\jobname.dtx}{fd,sf,c19}}
    \file{c19tt.fd}                        {\from{\jobname.dtx}{fd,tt,c19}}
    \file{c70rm.fd}                        {\from{\jobname.dtx}{fd,rm,c70}}
    \file{c70sf.fd}                        {\from{\jobname.dtx}{fd,sf,c70}}
    \file{c70tt.fd}                        {\from{\jobname.dtx}{fd,tt,c70}}
    \file{jy2zhrm.fd}                      {\from{\jobname.dtx}{fd,rm,jy2}}
    \file{jy2zhsf.fd}                      {\from{\jobname.dtx}{fd,sf,jy2}}
    \file{jy2zhtt.fd}                      {\from{\jobname.dtx}{fd,tt,jy2}}
    \file{jt2zhrm.fd}                      {\from{\jobname.dtx}{fd,rm,jt2}}
    \file{jt2zhsf.fd}                      {\from{\jobname.dtx}{fd,sf,jt2}}
    \file{jt2zhtt.fd}                      {\from{\jobname.dtx}{fd,tt,jt2}}
    \file{ctex-fontset-adobe.def}          {\from{\jobname.dtx}{fontset,adobe}}
    \file{ctex-fontset-fandol.def}         {\from{\jobname.dtx}{fontset,fandol}}
    \file{ctex-fontset-founder.def}        {\from{\jobname.dtx}{fontset,founder}}
    \file{ctex-fontset-mac.def}            {\from{\jobname.dtx}{fontset,mac}}
    \file{ctex-fontset-macnew.def}         {\from{\jobname.dtx}{fontset,macnew}}
    \file{ctex-fontset-macold.def}         {\from{\jobname.dtx}{fontset,macold}}
    \file{ctex-fontset-ubuntu.def}         {\from{\jobname.dtx}{fontset,ubuntu}}
    \file{ctex-fontset-windows.def}        {\from{\jobname.dtx}{fontset,windows}}
 \ctxfile{GBK}{translator-theorem-dictionary-ChineseGBK.dict}
                                           {\from{\jobname.dtx}{dict,theorem,GBK}}
    \file{translator-theorem-dictionary-ChineseUTF8.dict}
                                           {\from{\jobname.dtx}{dict,theorem,UTF8}}
    \file{ctexspa.def}                     {\from{\jobname.dtx}{ctexspa}
                                            \from{ctexpunct.spa}{}}
    \usedir{tex/generic/ctex}
    \file{ctex-spa-make.tex}               {\from{\jobname.dtx}{spa,make}}
    \file{ctex-spa-macro.tex}              {\from{\jobname.dtx}{spa,macro}}
    \file{ctex-zhmap-adobe.tex}            {\from{\jobname.dtx}{zhmap,adobe}}
    \file{ctex-zhmap-fandol.tex}           {\from{\jobname.dtx}{zhmap,fandol}}
    \file{ctex-zhmap-founder.tex}          {\from{\jobname.dtx}{zhmap,founder}}
    \file{ctex-zhmap-mac.tex}              {\from{\jobname.dtx}{zhmap,mac}}
    \file{ctex-zhmap-ubuntu.tex}           {\from{\jobname.dtx}{zhmap,ubuntu}}
    \file{ctex-zhmap-windows.tex}          {\from{\jobname.dtx}{zhmap,windows}}
%&lt;/install&gt;
%&lt;*internal&gt;
    \usedir{source/latex/ctex}
    \file{\jobname.ins}                    {\from{\jobname.dtx}{install}}
%&lt;/internal&gt;
%&lt;*install&gt;
    \nopreamble\nopostamble
    \usedir{doc/latex/ctex}
    \file{README.md}                       {\from{\jobname.dtx}{readme}}
  }

\catcode32=12\space

\Msg{*************************************************************}
\Msg{*                                                           *}
\Msg{* To finish the installation you have to move the following *}
\Msg{* file into proper directories searched by TeX:             *}
\Msg{*                                                           *}
\Msg{* The recommended directory is TDS:tex/latex/ctex           *}
\Msg{*                                                           *}
\Msg{*     ctex.sty                                              *}
\Msg{*     ctexsize.sty                                          *}
\Msg{*     ctexheading.sty                                       *}
\Msg{*     ctexart.cls                                           *}
\Msg{*     ctexbook.cls                                          *}
\Msg{*     ctexrep.cls                                           *}
\Msg{*     ctexbeamer.cls                                        *}
\Msg{*     ctexcap.sty                                           *}
\Msg{*     ctexhook.sty                                          *}
\Msg{*     ctexpatch.sty                                         *}
\Msg{*     ctex-c5size.clo                                       *}
\Msg{*     ctex-cs4size.clo                                      *}
\Msg{*     ctex-heading-article.def                              *}
\Msg{*     ctex-heading-book.def                                 *}
\Msg{*     ctex-heading-report.def                               *}
\Msg{*     ctex-heading-beamer.def                               *}
\Msg{*     ctex-scheme-plain.def                                 *}
\Msg{*     ctex-scheme-plain-article.def                         *}
\Msg{*     ctex-scheme-plain-book.def                            *}
\Msg{*     ctex-scheme-plain-report.def                          *}
\Msg{*     ctex-scheme-plain-beamer.def                          *}
\Msg{*     ctex-scheme-chinese.def                               *}
\Msg{*     ctex-scheme-chinese-article.def                       *}
\Msg{*     ctex-scheme-chinese-book.def                          *}
\Msg{*     ctex-scheme-chinese-report.def                        *}
\Msg{*     ctex-scheme-chinese-beamer.def                        *}
\Msg{*     ctex-name-gbk.cfg                                     *}
\Msg{*     ctex-name-utf8.cfg                                    *}
\Msg{*     ctex.cfg                                              *}
\Msg{*     ctexopts.cfg                                          *}
\Msg{*     ctexbackend.cfg                                       *}
\Msg{*     ctex-engine-pdftex.def                                *}
\Msg{*     ctex-engine-xetex.def                                 *}
\Msg{*     ctex-engine-luatex.def                                *}
\Msg{*     ctex-engine-aptex.def                                 *}
\Msg{*     ctex-engine-uptex.def                                 *}
\Msg{*     c19rm.fd                                              *}
\Msg{*     c19sf.fd                                              *}
\Msg{*     c19tt.fd                                              *}
\Msg{*     c70rm.fd                                              *}
\Msg{*     c70sf.fd                                              *}
\Msg{*     c70tt.fd                                              *}
\Msg{*     jy2zhrm.fd                                            *}
\Msg{*     jy2zhsf.fd                                            *}
\Msg{*     jy2zhtt.fd                                            *}
\Msg{*     jt2zhrm.fd                                            *}
\Msg{*     jt2zhsf.fd                                            *}
\Msg{*     jt2zhtt.fd                                            *}
\Msg{*     ctex-fontset-adobe.def                                *}
\Msg{*     ctex-fontset-fandol.def                               *}
\Msg{*     ctex-fontset-founder.def                              *}
\Msg{*     ctex-fontset-mac.def                                  *}
\Msg{*     ctex-fontset-macnew.def                               *}
\Msg{*     ctex-fontset-macold.def                               *}
\Msg{*     ctex-fontset-ubuntu.def                               *}
\Msg{*     ctex-fontset-windows.def                              *}
\Msg{*     ctexspa.def                                           *}
\Msg{*     ctex-spa-make.tex                                     *}
\Msg{*     ctex-spa-macro.tex                                    *}
\Msg{*     ctex-zhmap-adobe.tex                                  *}
\Msg{*     ctex-zhmap-fandol.tex                                 *}
\Msg{*     ctex-zhmap-founder.tex                                *}
\Msg{*     ctex-zhmap-mac.tex                                    *}
\Msg{*     ctex-zhmap-ubuntu.tex                                 *}
\Msg{*     ctex-zhmap-windows.tex                                *}
\Msg{*     translator-theorem-dictionary-ChineseGBK.dict         *}
\Msg{*     translator-theorem-dictionary-ChineseUTF8.dict        *}
\Msg{*                                                           *}
\Msg{* To produce the documentation run the file ctex.dtx        *}
\Msg{* through XeLaTeX.                                          *}
\Msg{*                                                           *}
\Msg{* Happy TeXing!                                             *}
\Msg{*                                                           *}
\Msg{*************************************************************}

\endbatchfile
%&lt;/install&gt;
%&lt;*internal&gt;
\fi
%&lt;/internal&gt;
%&lt;*!(driver|readme|install|zhmap|spa|docstrip)&gt;
%&lt;*!(fd|ctexspa|dict|backend)&gt;
%&lt;class|style|ctexcap|ctexhook|ctexpatch&gt;\NeedsTeXFormat{LaTeX2e}
%&lt;class&gt;\input{ctexbackend.cfg}
%&lt;class|style|ctexcap|ctexhook|ctexpatch&gt;\RequirePackage{expl3}
%&lt;+!driver&gt;\GetIdInfo$Id: ctex.dtx 13a2256 2022-07-14 18:54:09 +0800 Qing Lee &lt;sobenlee@gmail.com&gt; $
%&lt;ctex&gt;  {Chinese adapter in LaTeX (CTEX)}
%&lt;ctex&gt;\ProvidesExplPackage{\ExplFileName}
%&lt;ctexsize&gt;  {Chinese font size definition (CTEX)}
%&lt;ctexsize&gt;\ProvidesExplPackage{ctexsize}
%&lt;ctexheading&gt;  {Heading style modification (CTEX)}
%&lt;ctexheading&gt;\ProvidesExplPackage{ctexheading}
%&lt;class&amp;article&gt;  {Chinese adapter for class article (CTEX)}
%&lt;class&amp;article&gt;\ProvidesExplClass{ctexart}
%&lt;class&amp;book&gt;  {Chinese adapter for class book (CTEX)}
%&lt;class&amp;book&gt;\ProvidesExplClass{ctexbook}
%&lt;class&amp;report&gt;  {Chinese adapter for class report (CTEX)}
%&lt;class&amp;report&gt;\ProvidesExplClass{ctexrep}
%&lt;class&amp;beamer&gt;  {Chinese adapter for class beamer (CTEX)}
%&lt;class&amp;beamer&gt;\ProvidesExplClass{ctexbeamer}
%&lt;ctexcap&gt;  {Chinese adapter in LaTeX (CTEX)}
%&lt;ctexcap&gt;\ProvidesExplPackage{ctexcap}
%&lt;ctexhook&gt;  {Document and package hooks (CTEX)}
%&lt;ctexhook&gt;\ProvidesExplPackage{ctexhook}
%&lt;ctexpatch&gt;  {Patching commands (CTEX)}
%&lt;ctexpatch&gt;\ProvidesExplPackage{ctexpatch}
%&lt;c5size&gt;  {c5size option (CTEX)}
%&lt;c5size&gt;\ProvidesExplFile{ctex-c5size.clo}
%&lt;cs4size&gt;  {cs4size option (CTEX)}
%&lt;cs4size&gt;\ProvidesExplFile{ctex-cs4size.clo}
%&lt;heading&amp;article&gt;  {Heading modification for article (CTEX)}
%&lt;heading&amp;article&gt;\ProvidesExplFile{ctex-article.def}
%&lt;heading&amp;book&gt;  {Heading modification for book (CTEX)}
%&lt;heading&amp;book&gt;\ProvidesExplFile{ctex-book.def}
%&lt;heading&amp;report&gt;  {Heading modification for report (CTEX)}
%&lt;heading&amp;report&gt;\ProvidesExplFile{ctex-report.def}
%&lt;heading&amp;beamer&gt;  {Heading modification for beamer (CTEX)}
%&lt;heading&amp;beamer&gt;\ProvidesExplFile{ctex-beamer.def}
%&lt;scheme&amp;plain&amp;generic&gt;  {Plain scheme for generic (CTEX)}
%&lt;scheme&amp;plain&amp;generic&gt;\ProvidesExplFile{ctex-scheme-plain.def}
%&lt;scheme&amp;plain&amp;article&gt;  {Plain scheme for article (CTEX)}
%&lt;scheme&amp;plain&amp;article&gt;\ProvidesExplFile{ctex-scheme-plain-article.def}
%&lt;scheme&amp;plain&amp;book&gt;  {Plain scheme for book (CTEX)}
%&lt;scheme&amp;plain&amp;book&gt;\ProvidesExplFile{ctex-scheme-plain-book.def}
%&lt;scheme&amp;plain&amp;report&gt;  {Plain scheme for report (CTEX)}
%&lt;scheme&amp;plain&amp;report&gt;\ProvidesExplFile{ctex-scheme-plain-report.def}
%&lt;scheme&amp;plain&amp;beamer&gt;  {Plain scheme for beamer (CTEX)}
%&lt;scheme&amp;plain&amp;beamer&gt;\ProvidesExplFile{ctex-scheme-plain-beamer.def}
%&lt;scheme&amp;chinese&amp;generic&gt;  {Chinese scheme for generic (CTEX)}
%&lt;scheme&amp;chinese&amp;generic&gt;\ProvidesExplFile{ctex-scheme-chinese.def}
%&lt;scheme&amp;chinese&amp;article&gt;  {Chinese scheme for article (CTEX)}
%&lt;scheme&amp;chinese&amp;article&gt;\ProvidesExplFile{ctex-scheme-chinese-article.def}
%&lt;scheme&amp;chinese&amp;book&gt;  {Chinese scheme for book (CTEX)}
%&lt;scheme&amp;chinese&amp;book&gt;\ProvidesExplFile{ctex-scheme-chinese-book.def}
%&lt;scheme&amp;chinese&amp;report&gt;  {Chinese scheme for report (CTEX)}
%&lt;scheme&amp;chinese&amp;report&gt;\ProvidesExplFile{ctex-scheme-chinese-report.def}
%&lt;scheme&amp;chinese&amp;beamer&gt;  {Chinese scheme for beamer (CTEX)}
%&lt;scheme&amp;chinese&amp;beamer&gt;\ProvidesExplFile{ctex-scheme-chinese-beamer.def}
%&lt;name&amp;GBK&gt;  {Caption with encoding GBK (CTEX)}
%&lt;name&amp;GBK&gt;\ProvidesExplFile{ctex-name-gbk.cfg}
%&lt;name&amp;UTF8&gt;  {Caption with encoding UTF-8 (CTEX)}
%&lt;name&amp;UTF8&gt;\ProvidesExplFile{ctex-name-utf8.cfg}
%&lt;config&gt;  {Configuration file (CTEX)}
%&lt;config&gt;\ProvidesExplFile{\ExplFileName.cfg}
%&lt;ctexopts&gt;  {Option configuration file (CTEX)}
%&lt;ctexopts&gt;\ProvidesExplFile{ctexopts.cfg}
%&lt;pdftex&gt;  {(pdf)LaTeX adapter (CTEX)}
%&lt;pdftex&gt;\ProvidesExplFile{ctex-engine-pdftex.def}
%&lt;xetex&gt;  {XeLaTeX adapter (CTEX)}
%&lt;xetex&gt;\ProvidesExplFile{ctex-engine-xetex.def}
%&lt;luatex&gt;  {LuaLaTeX adapter (CTEX)}
%&lt;luatex&gt;\ProvidesExplFile{ctex-engine-luatex.def}
%&lt;aptex&gt;  {Asian pTeX adapter (CTEX)}
%&lt;aptex&gt;\ProvidesExplFile{ctex-engine-aptex.def}
%&lt;uptex&gt;  {upTeX adapter (CTEX)}
%&lt;uptex&gt;\ProvidesExplFile{ctex-engine-uptex.def}
%&lt;windows&gt;  {Windows fonts definition (CTEX)}
%&lt;windows&gt;\ProvidesExplFile{ctex-fontset-windows.def}
%&lt;adobe&gt;  {Adobe fonts definition (CTEX)}
%&lt;adobe&gt;\ProvidesExplFile{ctex-fontset-adobe.def}
%&lt;fandol&gt;  {Fandol fonts definition (CTEX)}
%&lt;fandol&gt;\ProvidesExplFile{ctex-fontset-fandol.def}
%&lt;mac&gt;  {macOS fonts definition (CTEX)}
%&lt;mac&gt;\ProvidesExplFile{ctex-fontset-mac.def}
%&lt;macnew&gt;  {macOS fonts definition for El Capitan or later version (CTEX)}
%&lt;macnew&gt;\ProvidesExplFile{ctex-fontset-macnew.def}
%&lt;macold&gt;  {macOS fonts definition for Yosemite or earlier version (CTEX)}
%&lt;macold&gt;\ProvidesExplFile{ctex-fontset-macold.def}
%&lt;founder&gt;  {Founder fonts definition (CTEX)}
%&lt;founder&gt;\ProvidesExplFile{ctex-fontset-founder.def}
%&lt;ubuntu&gt;  {Ubuntu fonts definition (CTEX)}
%&lt;ubuntu&gt;\ProvidesExplFile{ctex-fontset-ubuntu.def}
%&lt;!driver&gt;  {\ExplFileDate}{2.5.10}{\ExplFileDescription}
%&lt;/!(fd|ctexspa|dict|backend)&gt;
%&lt;c19&amp;rm&gt;\ProvidesFile{c19rm.fd}%
%&lt;c19&amp;sf&gt;\ProvidesFile{c19sf.fd}%
%&lt;c19&amp;tt&gt;\ProvidesFile{c19tt.fd}%
%&lt;c70&amp;rm&gt;\ProvidesFile{c70rm.fd}%
%&lt;c70&amp;sf&gt;\ProvidesFile{c70sf.fd}%
%&lt;c70&amp;tt&gt;\ProvidesFile{c70tt.fd}%
%&lt;jy2&amp;rm&gt;\ProvidesFile{jy2zhrm.fd}%
%&lt;jy2&amp;sf&gt;\ProvidesFile{jy2zhsf.fd}%
%&lt;jy2&amp;tt&gt;\ProvidesFile{jy2zhtt.fd}%
%&lt;jt2&amp;rm&gt;\ProvidesFile{jt2zhrm.fd}%
%&lt;jt2&amp;sf&gt;\ProvidesFile{jt2zhsf.fd}%
%&lt;jt2&amp;tt&gt;\ProvidesFile{jt2zhtt.fd}%
%&lt;ctexspa&gt;\ProvidesFile{ctexspa.def}%
%&lt;backend&gt;\ProvidesFile{ctexbackend.cfg}%
%&lt;dict&amp;theorem&amp;GBK&gt;\ProvidesDictionary{translator-theorem-dictionary}{ChineseGBK}%
%&lt;dict&amp;theorem&amp;UTF8&gt;\ProvidesDictionary{translator-theorem-dictionary}{ChineseUTF8}%
%&lt;fd&gt;  [2022/07/14 v2.5.10 Chinese font definition (CTEX)]
%&lt;ctexspa&gt;  [2022/07/14 v2.5.10 Space info for CJKpunct (CTEX)]
%&lt;backend&gt;  [2022/07/14 v2.5.10 Backend configuration file (CTEX)]
%&lt;dict&amp;theorem&gt;  [2022/07/14 v2.5.10 Chinese translation for theorem name (CTEX)]
%&lt;/!(driver|readme|install|zhmap|spa|docstrip)&gt;
%&lt;*driver&gt;
\documentclass{ctxdoc}
\begin{document}
  \DocInput{\jobname.dtx}
  \IndexLayout
  \PrintChanges
  \PrintIndex
\end{document}
%&lt;/driver&gt;
%
% \fi
%
% \changes{v2.0}{2014/03/06}{åº”ç”¨ \LaTeXiii{} é‡æ–°æ•´ç†ä»£ç&nbsp;ã€‚}
% \changes{v2.0}{2014/03/12}{åˆ&nbsp;é™¤ \file{c19gbsn.fd} å’Œ \file{c19gkai.fd}ã€‚}
% \changes{v2.1}{2015/05/18}{å°†ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜è®¾ç½®åŠŸèƒ½æå–åˆ°å¯ä»¥ç‹¬ç«‹ä½¿ç”¨çš„å®åŒ…
%   \pkg{ctexheading} ä¸­ã€‚}
% \changes{v2.2}{2015/06/24}{ä¸å†ä¾èµ– \pkg{etoolbox} å®åŒ…ã€‚}
% \changes{v2.4}{2015/02/19}{åŠ&nbsp;å¼º \pkg{beamer} å®åŒ…æ”¯æŒã€‚}
% \changes{v2.4.12}{2018/01/13}{åŒæ­¥ \LaTeXiii{} 2017/12/16ã€‚}
% \changes{v2.4.15}{2019/03/23}{åŒæ­¥ \LaTeXiii{} 2019/03/05ã€‚}
% \changes{v2.5.1}{2020/05/02}{\pkg{zhconv} æ›´åä¸º \pkg{ctex-zhconv}ã€‚}
%
% \CheckSum{6630}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&amp;
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \&lt;
%   Equals        \=     Greater than  \&gt;     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \GetFileId{ctex.sty}
%
% \title{\bfseries \CTeX{} å®é›†æ‰‹å†Œ}
% \author{\href{http://www.ctex.org}{CTEX.ORG}}
% \date{\filedate\qquad\fileversion\thanks{\ctexkitrev{\ExplFileVersion}.}}
% \maketitle
%
% \begin{abstract}
% \CTeX{} å®é›†æ˜¯é¢å‘ä¸­æ–‡æŽ’ç‰ˆçš„é€šç”¨ \LaTeX{} æŽ’ç‰ˆæ¡†æž¶ï¼Œä¸ºä¸­æ–‡ \LaTeX{} æ–‡æ¡£
% æä¾›äº†æ±‰å­—è¾“å‡ºæ”¯æŒã€æ&nbsp;‡ç‚¹åŽ‹ç¼©ã€å­—ä½“å­—å·å‘½ä»¤ã€æ&nbsp;‡é¢˜æ–‡å­—æ±‰åŒ–ã€ä¸­æ–‡ç‰ˆå¼è°ƒæ•´ã€æ•°å­—
% æ—¥æœŸè½¬æ¢ç­‰æ”¯æŒåŠŸèƒ½ï¼Œå¯é€‚åº”è®ºæ–‡ã€æŠ¥å‘Šã€ä¹¦ç±ã€å¹»ç¯ç‰‡ç­‰ä¸åŒç±»åž‹çš„ä¸­æ–‡æ–‡æ¡£ã€‚
%
% \CTeX{} å®é›†æ”¯æŒ \LaTeXã€\pdfLaTeXã€\XeLaTeXã€\LuaLaTeXã€\upLaTeX{} ç­‰å¤šç§ä¸åŒ
% çš„ç¼–è¯‘æ–¹å¼ï¼Œå¹¶ä¸ºå®ƒä»¬æä¾›äº†ç»Ÿä¸€çš„ç•Œé¢ã€‚ä¸»è¦åŠŸèƒ½ç”±å®åŒ… \pkg{ctex} ä»¥åŠä¸­æ–‡æ–‡æ¡£ç±»
% \cls{ctexart}ã€\cls{ctexrep}ã€\cls{ctexbook} å’Œ \cls{ctexbeamer} å®žçŽ°ã€‚
% \end{abstract}
%
% \tableofcontents
%
% \bigskip
% \setlength{\parskip}{0.8ex}
%
% \begin{documentation}
%
% \section{ä»‹ç»}
%
% \subsection*{åŽ†å²}
%
% \CTeX{} å®é›†çš„æºå¤´æœ‰ä¸¤ä¸ªï¼šä¸€æ˜¯çŽ‹ç£Šç¼–å†™çš„ \cls{cjkbook} æ–‡æ¡£ç±»ï¼ŒäºŒæ˜¯å´å‡Œäº‘ç¼–å†™çš„
% \file{GB.cap}ã€‚
% è¿™äº›å·¥ä½œæ²¡æœ‰ç»è¿‡è®¤çœŸç³»ç»Ÿçš„è®¾è®¡ï¼Œä¹Ÿæ²¡æœ‰ç”¨æˆ·æ–‡æ¡£ï¼Œä¸åˆ©äºŽç»´æŠ¤å’Œæ”¹è¿›ã€‚
%
% 2003 å¹´ï¼Œå´å‡Œäº‘ä½¿ç”¨ \pkg{doc} å’Œ \pkg{DocStrip} é‡æž„äº†æ•´ä¸ªå·¥ç¨‹ï¼Œå¹¶å¢žåŠ&nbsp;äº†è®¸å¤šæ–°çš„åŠŸèƒ½ï¼Œ
% ç§°ä¸º \pkg{ctex} å®åŒ…ã€‚2007 å¹´ï¼Œoseen å’ŒçŽ‹è¶Šåœ¨ \pkg{ctex} å®åŒ…çš„åŸºç¡€ä¸Šï¼Œ
% å¢žåŠ&nbsp;äº†å¯¹ UTF-8 ç¼–ç&nbsp;çš„æ”¯æŒï¼Œå¼€å‘å‡ºäº† \pkg{ctexutf8} å®åŒ…ã€‚
%
% 2009 å¹´ 5 æœˆï¼Œæˆ‘ä»¬åœ¨ Google Code å»ºç«‹äº† ctex-kit é¡¹ç›®^^A
% \footnote{\nolinkurl{http://code.google.com/p/ctex-kit/}ï¼Œè¯¥é“¾æŽ¥çŽ°å·²å¤±æ•ˆã€‚}ï¼Œ
% å¯¹ \pkg{ctex} å®åŒ…åŠç›¸å…³è„šæœ¬è¿›è¡Œäº†æ•´åˆï¼Œå¹¶åŠ&nbsp;å…¥äº†å¯¹ \XeTeX{} å¼•æ“Žçš„æ”¯æŒã€‚
% åœ¨å¼€å‘æ–°ç‰ˆæœ¬æ—¶ï¼Œè€ƒè™‘åˆ°åˆä½œå¼€å‘å’Œè°ƒè¯•çš„æ–¹ä¾¿ï¼Œæˆ‘ä»¬æ”¾å¼ƒäº† \pkg{doc} å’Œ \pkg{DocStrip}ï¼Œ
% é‡‡å–äº†ç›´æŽ¥ç¼–å†™å®åŒ…ä»£ç&nbsp;çš„æ–¹å¼ã€‚
%
% 2014 å¹´ 3 æœˆï¼Œä¸ºäº†é€‚åº” \LaTeX{} çš„æœ€æ–°å‘å±•ï¼Œç‰¹åˆ«æ˜¯ \LaTeXiii{} çš„é€æ¸æˆç†Ÿï¼ŒæŽæ¸…ç”¨
% \LaTeXiii{} é‡æž„äº†æ•´ä¸ªå®åŒ…çš„ä»£ç&nbsp;ï¼Œå¹¶é‡æ–°ä½¿ç”¨ \pkg{doc} å’Œ \pkg{DocStrip} å·¥å…·è¿›è¡Œä»£ç&nbsp;
% çš„ç®¡ç†ï¼Œå‡çº§ç‰ˆæœ¬å·ä¸º 2.0ï¼Œå¹¶æ”¹ç§° \CTeX{} å®é›†ã€‚
%
% 2015 å¹´ 3 æœˆï¼Œç”±äºŽ Google Code å³å°†åœæ­¢æœåŠ¡ï¼Œctex-kit é¡¹ç›®è¿ç§»è‡³
% \href{https://github.com/CTeX-org/ctex-kit}{GitHub}^^A
% \footnote{\url{https://github.com/CTeX-org/ctex-kit}}ã€‚
%
% æœ€åˆï¼ŒKnuth åœ¨è®¾è®¡å¼€å‘ \TeX{} çš„æ—¶å€™æ²¡æœ‰è€ƒè™‘åˆ°å¤šå›½æ–‡å­—æ”¯æŒï¼Œç‰¹åˆ«æ˜¯å¯¹å¤šå­—èŠ‚çš„ä¸­æ—¥éŸ©
% è¡¨æ„æ–‡å­—çš„æ”¯æŒã€‚è¿™ä½¿å¾— \TeX{} ä»¥è‡³åŽæ¥çš„ \LaTeX{} å¯¹ä¸­æ–‡çš„æ”¯æŒä¸€ç›´ä¸æ˜¯å¾ˆå¥½ã€‚å³ä½¿åœ¨
% \pkg{CJK} å®åŒ…è§£å†³äº†ä¸­æ–‡å­—ç¬¦å¤„ç†çš„é—®é¢˜ä»¥åŽï¼Œä¸­æ–‡ç”¨æˆ·ä½¿ç”¨ \LaTeX{} ä»ç„¶è¦é¢å¯¹è®¸
% å¤šå›°éš¾ã€‚
% è¿™äº›å›°éš¾é‡Œï¼Œä»¥ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜çš„ä¸­æ–‡åŒ–ä¸ºæœ€ã€‚ç”±äºŽä¸­æ–‡å’Œè¥¿æ–‡ä¹¦å†™ä¹&nbsp;æƒ¯çš„å·®å¼‚ï¼Œç”¨æˆ·å¾ˆéš¾ä½¿ç”¨æ&nbsp;‡å‡†
% æ–‡æ¡£ç±»ä¸­çš„ä»£ç&nbsp;ç»“æž„æ¥è¡¨è¾¾ä¸­æ–‡æ&nbsp;‡é¢˜ã€‚äºŽæ˜¯ï¼Œç”¨æˆ·ä¸å¾—ä¸å¯¹æ&nbsp;‡å‡†æ–‡æ¡£ç±»åšè¾ƒå¤§çš„ä¿®æ”¹ã€‚
% é™¤æ­¤ä¹‹å¤–ï¼Œæ—¥æœŸæ&nbsp;¼å¼ã€é¦–è¡Œç¼©è¿›ã€ä¸­æ–‡å­—å·å’Œå­—è·ç­‰ç»†èŠ‚é—®é¢˜ï¼Œä¹Ÿéœ€è¦ç²¾ç»†çš„è°ƒæ&nbsp;¡ã€‚
% æˆ‘ä»¬è®¾è®¡ \CTeX{} å®é›†çš„ç›®çš„ä¹‹ä¸€å°±æ˜¯è§£å†³è¿™äº› \LaTeX{} æ–‡æ¡£çš„æ±‰åŒ–éš¾é¢˜ã€‚
%
% å¦ä¸€æ–¹é¢ï¼Œéšç€ \TeX{} å¼•æ“Žå’Œ \LaTeX{} å®åŒ…çš„ä¸æ–­å‘å±•ï¼Œ\LaTeX{} çš„ä¸­æ–‡æ”¯æŒæ–¹å¼ä»Žæ—©æœŸçš„
% ä¸“ç”¨ç³»ç»Ÿï¼ˆå¦‚ \pkg{CCT}ï¼‰å‘å±•ä¸ºé€‚ç”¨äºŽä¸åŒå¼•æ“Žçš„å¤šç§æ–¹å¼^^A
% \footnote{æ¯”å¦‚ï¼š\pdfTeX{} å¼•æ“Žä¸‹çš„ \pkg{CJK}ã€\pkg{zhmCJK}å®åŒ…ï¼Œ
% \XeTeX{} å¼•æ“Žä¸‹çš„ \pkg{xeCJK} å®åŒ…å’Œ \LuaTeX{} å¼•æ“Žä¸‹çš„ \pkg{LuaTeX-ja} å®åŒ…ã€‚}ã€‚
% è¿™äº›æ–¹å¼çš„é€‚ç”¨æƒ…å†µå’Œä½¿ç”¨æ–¹å¼æœ‰ä¸å°‘ç»†èŠ‚ä¸Šçš„å·®å¼‚ï¼ŒåŒæ—¶æ“ä½œç³»ç»Ÿçš„ä¸åŒã€è¯­è¨€çŽ¯å¢ƒçš„ä¸åŒç­‰
% å®¢è§‚æƒ…å†µåˆè¿›ä¸€æ­¥å¸¦æ¥äº†æ›´å¤šçš„ç»†èŠ‚å·®å¼‚ã€‚æˆ‘ä»¬è®¾è®¡ \CTeX{} å®é›†çš„å¦ä¸€ä¸ªä¸»è¦ç›®çš„å°±æ˜¯
% å°½å¯èƒ½æ¶ˆé™¤è¿™äº›å·®å¼‚å¸¦æ¥çš„å½±å“ï¼Œä½¿ç”¨æˆ·èƒ½å¤Ÿä»¥ä¸€ä¸ªç»Ÿä¸€çš„æŽ¥å£æ¥ä½¿ç”¨ä¸åŒçš„ä¸­æ–‡æ”¯æŒæ–¹å¼ï¼Œ
% ä½¿å¾—åŒä¸€ä»½æ–‡æ¡£èƒ½å¤Ÿåœ¨ä¸åŒçŽ¯å¢ƒä¸‹äº¤æ¢ä½¿ç”¨ã€‚
%
% \CTeX{} å®é›†çš„è®¸å¤šå®žçŽ°ç»†èŠ‚ç¦»ä¸å¼€çƒ­å¿ƒæœ‹å‹ä»¬åœ¨ \nolinkurl{bbs.ctex.org} è®ºå›^^A
% \footnote{2018 å¹´ï¼Œ\CTeX{} è®ºå›å›&nbsp;æ•…æ—&nbsp;é™æœŸå…³é—­ï¼Œæ­¤é“¾æŽ¥çŽ°å·²å¤±æ•ˆã€‚}^^A
% ä¸Šçš„è®¨è®ºï¼Œåœ¨æ­¤å¯¹å‚ä¸Žè®¨è®ºçš„æœ‹å‹ä»¬è¡¨ç¤ºæ„Ÿè°¢ã€‚
%
% \subsection*{å…³äºŽå®é›†åå­—çš„è¯´æ˜Ž}
%
% \CTeX{} ä¹‹åæ˜¯è‹±æ–‡å•è¯ Chinaï¼ˆä¸­å›½ï¼‰æˆ– Chineseï¼ˆä¸­æ–‡ï¼‰çš„é¦–å­—æ¯â€œCâ€ä¸Ž â€œ\TeX{}â€
% ç»“åˆè€Œæˆçš„ã€‚åœ¨çº¯æ–‡æœ¬çŽ¯å¢ƒä¸‹ï¼Œè¯¥åå­—åº”å†™ä½œâ€œCTeXâ€ã€‚
%
% \CTeX{} å®é›†æ˜¯ç”± \href{https://github.com/CTeX-org}{\CTeX{} ç¤¾åŒº}å‘èµ·å¹¶ç»´æŠ¤çš„
% \LaTeX{} \emph{å®åŒ…å’Œæ–‡æ¡£ç±»çš„é›†åˆ}ã€‚
% ç¤¾åŒºå¦æœ‰å‘å¸ƒåä¸º \href{http://www.ctex.org/CTeX}{\CTeX{} å¥—è£…}^^A
% çš„ \TeX{} å‘è¡Œç‰ˆï¼Œä¸Žæœ¬æ–‡æ¡£æ‰€è¿°çš„ \CTeX{} å®é›†å¹¶éžæ˜¯åŒä¸€äº‹ç‰©ã€‚
%
% \pkg{ctex} åˆ™æ˜¯æœ¬å®é›†ä¸­çš„ \pkg{ctex.sty} çš„åå­—ã€‚è¿™ä¸€å®Œå…¨å°å†™çš„åç§°ï¼Œåœ¨è¿‡åŽ»
% ä¹Ÿè¢«ç”¨æ¥æŒ‡ä»£æ•´ä¸ª \CTeX{} å®é›†ï¼Œä¸è¿‡çŽ°åœ¨åˆ™ç‰¹æŒ‡ \pkg{ctex.sty} è¿™ä¸€å®åŒ…ã€‚
% åœ¨ä¸å¼•èµ·æ­§ä¹‰çš„æƒ…å†µä¸‹ï¼Œå®ƒä¹Ÿå¯ä»¥æ²¿ç”¨è¿‡åŽ»çš„ä¹&nbsp;æƒ¯ï¼Œä»£æŒ‡æ•´ä¸ªå®é›†ã€‚
%
% \section{ç®€æ˜Žæ•™ç¨‹}
%
% \subsection{\CTeX{} å®é›†çš„ç»„æˆ}
%
% ä¸ºäº†é€‚åº”ç”¨æˆ·ä¸åŒçš„éœ€æ±‚ï¼Œæˆ‘ä»¬å°† \CTeX{} å®é›†çš„ä¸»è¦åŠŸèƒ½è®¾è®¡å®‰æŽ’åœ¨å››ä¸ªä¸­æ–‡æ–‡æ¡£ç±»å’Œ
% ä¸‰ä¸ªå®åŒ…å½“ä¸­ï¼Œå…·ä½“çš„ç»„æˆè§è¡¨~\ref{tab:ctex}ã€‚
%
% \begin{table}[htbp]
% \centering
% \caption{\CTeX{} å®é›†çš„ç»„æˆ}\label{tab:ctex}
% \begin{tabularx}{\linewidth}{llX}
% \toprule
%   ç±»åˆ«   &amp; æ–‡ä»¶ &amp; è¯´æ˜Ž \\
% \midrule
%   æ–‡æ¡£ç±» &amp; \file{ctexart.cls}    &amp; æ&nbsp;‡å‡†æ–‡æ¡£ç±» \cls{article} çš„æ±‰åŒ–ç‰ˆæœ¬ï¼Œ
%                                    ä¸€èˆ¬é€‚ç”¨äºŽçŸ­ç¯‡å¹…çš„æ–‡ç«&nbsp; \\
%          &amp; \file{ctexrep.cls}    &amp; æ&nbsp;‡å‡†æ–‡æ¡£ç±» \cls{report} çš„æ±‰åŒ–ç‰ˆæœ¬ï¼Œ
%                                    ä¸€èˆ¬é€‚ç”¨äºŽä¸­ç¯‡å¹…çš„æŠ¥å‘Š \\
%          &amp; \file{ctexbook.cls}   &amp; æ&nbsp;‡å‡†æ–‡æ¡£ç±» \cls{book} çš„æ±‰åŒ–ç‰ˆæœ¬ï¼Œ
%                                    ä¸€èˆ¬é€‚ç”¨äºŽé•¿ç¯‡å¹…çš„ä¹¦ç± \\
%          &amp; \file{ctexbeamer.cls} &amp; æ–‡æ¡£ç±» \cls{beamer} çš„æ±‰åŒ–ç‰ˆæœ¬ï¼Œ
%                                    é€‚ç”¨äºŽå¹»ç¯ç‰‡æ¼”ç¤º \\
% \midrule
%   å®åŒ…   &amp; \file{ctex.sty}        &amp; æä¾›å…¨éƒ¨åŠŸèƒ½ï¼Œä½†\emph{é»˜è®¤ä¸å¼€å¯ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜è®¾ç½®åŠŸèƒ½}ï¼Œ
%                                     éœ€è¦ä½¿ç”¨ \opt{heading} é€‰é¡¹æ¥å¼€å¯ \\
%          &amp; \file{ctexsize.sty}    &amp; å®šä¹‰å’Œè°ƒæ•´ä¸­æ–‡å­—å·ï¼Œå¯ä»¥åœ¨ \pkg{ctex} å®åŒ…
%                                     æˆ– \CTeX{} ä¸­æ–‡æ–‡æ¡£ç±»ä¹‹å¤–å•ç‹¬è°ƒç”¨ \\
%          &amp; \file{ctexheading.sty} &amp; æä¾›ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜è®¾ç½®åŠŸèƒ½ï¼ˆè§ \ref{sec:secstyle}
%                                     èŠ‚ï¼‰ï¼Œå¯ä»¥åœ¨ \pkg{ctex} å®åŒ…æˆ– \CTeX{} ä¸­æ–‡
%                                     æ–‡æ¡£ç±»ä¹‹å¤–å•ç‹¬è°ƒç”¨ \\
% \bottomrule
% \end{tabularx}
% \end{table}
%
% \subsection{\CTeX{} å®é›†çš„å®‰è£…å’Œæ›´æ–°}
% \label{subsec:easy-ins}
% æœ€å¸¸è§çš„ \TeX{} å‘è¡Œç‰ˆï¼ˆ\TeXLive{} å’Œ \MiKTeX{}ï¼‰å·²æ”¶å½• \CTeX{} å®é›†åŠå…¶ä¾èµ–çš„å®åŒ…å’Œå®é›†ã€‚
% \footnote{\pkg{zhmCJK} å®åŒ…æ˜¯ä¸ªä¾‹å¤–ã€‚å½“ç”¨æˆ·æ˜¾å¼æŒ‡å®šé€‰é¡¹ \opt{zhmap = zhmCJK} æ—¶ï¼Œ^^A
% \CTeX{} å®é›†ä¾èµ–å®ƒã€‚ç”±äºŽï¼Œå®ƒæ²¡æœ‰è¢« \TeXLive{} å’Œ \MiKTeX{} æ”¶å½•ï¼Œç”¨æˆ·å¯èƒ½éœ€è¦éµç…§å…¶è¯´æ˜Žæ–‡æ¡£
% è‡ªè¡Œå®‰è£…ã€‚}å¦‚æžœæœ¬åœ°å®‰è£… \TeXLive{} æˆ– \MiKTeX{} ä¸æ˜¯å®Œæ•´ç‰ˆæœ¬ï¼Œåˆ™å¯èƒ½éœ€è¦é€šè¿‡è¿™
% ä¸¤ä¸ªå‘è¡Œç‰ˆæä¾›çš„\emph{åŒ…ç®¡ç†å™¨}æ¥å®‰è£…å®åŒ…ã€‚
%
% \TeXLive{} çš„åŒ…ç®¡ç†å™¨æ˜¯ tlmgrï¼ˆ\TeXLive{} Managerï¼‰ã€‚ç”¨æˆ·å¯ä»¥åœ¨ç³»ç»Ÿå‘½ä»¤è¡Œä¸­^^A
% \footnote{Windows ç³»ç»Ÿçš„å‘½ä»¤è¡Œæ˜¯ CMD å‘½ä»¤æç¤ºç¬¦ï¼Œä½&nbsp;å¯ä»¥ä½¿ç”¨ Win + R ç»„åˆé”®
% æ‰“å¼€â€œè¿è¡Œâ€å¯¹è¯æ¡†ï¼Œç„¶åŽè¾“å…¥ cmd ç¡®è®¤æ‰“å¼€å‘½ä»¤æç¤ºç¬¦çª—å£ã€‚}æ‰§è¡Œ
% \begin{frameverb}
%   tlmgr gui
% \end{frameverb}
% å¯åŠ¨ç®¡ç†å™¨çš„å›¾å½¢ç•Œé¢ï¼ˆWindows ç”¨æˆ·ä¹Ÿå¯ä»¥é€šè¿‡å¼€å§‹èœå•çš„ TeX Live 20XXï¼ˆå¹´ä»½ï¼‰
% \ding{212} TeX Live Manager æ‰“å¼€ï¼‰ã€‚è¿žæŽ¥ä¸Šè¿œç¨‹ä»“åº“ä¹‹åŽï¼Œæœç´¢ |ctex| å³å¯å®‰è£…ã€‚
% tlmgr çš„å›¾å½¢ç•Œé¢ä½¿ç”¨ Perl ç¼–å†™ï¼Œåœ¨å®žè·µä¸­å‘çŽ°å®¹æ˜“é€&nbsp;æˆç³»ç»Ÿå‡æ­»ã€‚é‡åˆ°è¿™ç§é—®é¢˜çš„ç”¨æˆ·ï¼Œ
% ä¹Ÿå¯ä»¥ç›´æŽ¥åœ¨ç³»ç»Ÿå‘½ä»¤è¡Œæ‰§è¡Œ
% \begin{frameverb}
%   tlmgr install ctex
% \end{frameverb}
% æ¥å®‰è£… \CTeX{} å®é›†^^A
% \footnote{*nix ç”¨æˆ·å¯èƒ½éœ€è¦è¶…çº§ç”¨æˆ·æƒé™ï¼ˆsudoï¼‰æ‰èƒ½æ­£ç¡®å®‰è£…å®é›†ã€‚}ã€‚
%
% \MiKTeX{} é€šå¸¸ä¼šåœ¨ç¼ºå¤±å®åŒ…æ—¶è‡ªåŠ¨å®Œæˆå®‰è£…ã€‚å¦‚éœ€æ‰‹åŠ¨å®‰è£…ï¼Œå¯ä»¥ä½¿ç”¨å…¶ç®¡ç†ç»´æŠ¤
% å·¥å…· \MiKTeX{} Consoleã€‚ç”¨æˆ·å¯ä»¥æ‰“å¼€ç®¡ç†å™¨ï¼Œè¿žæŽ¥ä¸Šè¿œç¨‹ä»“åº“ä¹‹åŽï¼Œåœ¨â€œPackageâ€
% é€‰é¡¹å¡ä¸­æœç´¢â€œctexâ€å¹¶å®‰è£…å³å¯ã€‚
% ä¹Ÿå¯ä»¥ä½¿ç”¨ mpmï¼ˆ\MiKTeX{} Package Managerï¼‰ï¼Œåœ¨å‘½ä»¤è¡Œæ‰§è¡Œ
% \begin{frameverb}
%   mpm --admin --install=ctex
% \end{frameverb}
% æ¥å®‰è£… \CTeX{} å®é›†ã€‚
%
% è‹¥å¸Œæœ›äº†è§£ \CTeX{} å®é›†å…·ä½“çš„ä¾èµ–æƒ…å†µæˆ–æ‰‹å·¥å®‰è£…å®é›†çš„æ–¹æ³•ï¼Œ
% è¯·å‚é˜…ç¬¬ \ref{sec:dep-ins}~èŠ‚ã€‚
%
% å½“æˆ‘ä»¬å°†å®é›†çš„æ–°ç‰ˆæœ¬å‘å¸ƒäºŽ CTANï¼Œä¸”ä¸ºå‘è¡Œç‰ˆçš„è¿œç¨‹ä»“åº“æ›´æ–°åŽï¼Œç”¨æˆ·å°±å¯ä»¥åœ¨æœ¬åœ°
% é€šè¿‡åŒ…ç®¡ç†å™¨èŽ·å–æ–°ç‰ˆæœ¬ã€‚
%
% å¯¹äºŽ \TeXLive{}ï¼Œå¯ä»¥åœ¨ tlmgr çš„å›¾å½¢ç•Œé¢ç‚¹å‡»â€œæ›´æ–°å…¨éƒ¨å·²å®‰è£…çš„â€æŒ‰é’®æˆ–è€…åœ¨
% å‘½ä»¤è¡Œæ‰§è¡Œ
% \begin{frameverb}
%   tlmgr update --all
% \end{frameverb}
% æ¥å®Œæ•´æ›´æ–°å·²å®‰è£…çš„å®åŒ…ã€‚
%
% å¯¹äºŽ \MiKTeX{}ï¼Œåœ¨ \MiKTeX{} Console ä¸­æ‰¾åˆ°â€œUpdatesâ€é€‰é¡¹å¡ï¼Œæ£€æŸ¥æ›´æ–°åŽå³å¯
% é€‰æ‹©å‡çº§å®åŒ…ã€‚ä¹Ÿå¯ä»¥ä½¿ç”¨ mpmï¼Œåœ¨å‘½ä»¤è¡Œæ‰§è¡Œ
% \begin{frameverb}
%   mpm --admin --update
% \end{frameverb}
% æ¥è¿›è¡Œæ›´æ–°ã€‚
%
% \subsection{ä½¿ç”¨ \CTeX{} æ–‡æ¡£ç±»}
%
% \emph{å¦‚æžœç”¨æˆ·éœ€è¦åœ¨ä¸‰ä¸ªæ&nbsp;‡å‡†æ–‡æ¡£ç±»æˆ– \cls{beamer} çš„åŸºç¡€ä¸Šæ·»åŠ&nbsp;ä¸­æ–‡åŠç‰ˆå¼çš„æ”¯æŒï¼Œ
% æˆ‘ä»¬å»ºè®®ç”¨æˆ·ä½¿ç”¨ \CTeX{} å®é›†æä¾›çš„å››ä¸ªä¸­æ–‡æ–‡æ¡£ç±»ã€‚}
%
% \CTeX{} å®é›†æä¾›äº†å››ä¸ªä¸­æ–‡æ–‡æ¡£ç±»ï¼š\cls{ctexart}ã€\cls{ctexrep}ã€\cls{ctexbook} å’Œ
% \cls{ctexbeamer}ï¼Œåˆ†åˆ«å¯¹åº” \LaTeX{} çš„æ&nbsp;‡å‡†æ–‡æ¡£ç±» \cls{article}ã€\cls{report}ã€
% \cls{book} å’Œ \cls{beamer}ã€‚ä½¿ç”¨å®ƒä»¬çš„æ—¶å€™ï¼Œéœ€è¦å°†æ¶‰åŠåˆ°çš„æ‰€æœ‰æºæ–‡ä»¶ä½¿ç”¨ UTF-8
% ç¼–ç&nbsp;ä¿å­˜\footnote{ä½¿ç”¨ (pdf)\LaTeX{} æ—¶ä¹Ÿèƒ½å¤Ÿä½¿ç”¨ GBK ç¼–ç&nbsp;ï¼Œä½†ä¸æŽ¨èã€‚ï¼ˆè§
% \ref{subs:encoding}~èŠ‚ï¼‰}ã€‚
%
% \begin{ctexexam}
%   \documentclass{ctexart}
%   \begin{document}
%   ä¸­æ–‡æ–‡æ¡£ç±»æµ‹è¯•ã€‚ä½&nbsp;éœ€è¦å°†æ‰€æœ‰æºæ–‡ä»¶ä¿å­˜ä¸º UTF-8 ç¼–ç&nbsp;ã€‚
%
%   ä½&nbsp;å¯ä»¥ä½¿ç”¨ XeLaTeXã€LuaLaTeX æˆ– upLaTeX ç¼–è¯‘ï¼Œä¹Ÿå¯ä»¥ä½¿ç”¨ (pdf)LaTeX ç¼–è¯‘ã€‚
%   æŽ¨èä½¿ç”¨ XeLaTeX æˆ– LuaLaTeX ç¼–è¯‘ã€‚å¯¹é«˜çº§ç”¨æˆ·ï¼Œæˆ‘ä»¬ä¹ŸæŽ¨èä½¿ç”¨ upLaTeX ç¼–è¯‘ã€‚
%   \end{document}
% \end{ctexexam}
%
% ä»¥ä¸‹æ˜¯ä½¿ç”¨ \cls{ctexbeamer} æ–‡æ¡£ç±»ç¼–å†™ä¸­æ–‡æ¼”ç¤ºæ–‡ç¨¿çš„ä¸€ä¸ªç¤ºä¾‹ã€‚
% \begin{ctexexam}
%   \documentclass{ctexbeamer}
%   \begin{document}
%   \begin{frame}{ä¸­æ–‡æ¼”ç¤ºæ–‡æ¡£}
%   \begin{itemize}
%     \item ä½&nbsp;éœ€è¦å°†æ‰€æœ‰æºæ–‡ä»¶ä¿å­˜ä¸º UTF-8 ç¼–ç&nbsp;
%     \item ä½&nbsp;å¯ä»¥ä½¿ç”¨ XeLaTeXã€LuaLaTeX æˆ– upLaTeX ç¼–è¯‘
%     \item ä¹Ÿå¯ä»¥ä½¿ç”¨ (pdf)LaTeX ç¼–è¯‘
%     \item æŽ¨èä½¿ç”¨ XeLaTeX æˆ– LuaLaTeX ç¼–è¯‘
%     \item å¯¹é«˜çº§ç”¨æˆ·ï¼Œæˆ‘ä»¬ä¹ŸæŽ¨èä½¿ç”¨ upLaTeX ç¼–è¯‘
%   \end{itemize}
%   \end{frame}
%   \end{document}
% \end{ctexexam}
%
% \subsection{ä½¿ç”¨ \pkg{ctex} å®åŒ…}
%
% \emph{ç”¨æˆ·åœ¨ä½¿ç”¨éžæ&nbsp;‡å‡†æ–‡æ¡£ç±»åŠ \cls{beamer} æ—¶ï¼Œå¦‚æžœéœ€è¦æ·»åŠ&nbsp;ä¸­æ–‡åŠç‰ˆå¼çš„æ”¯æŒï¼Œ
% åˆ™å¯ä»¥ä½¿ç”¨ \pkg{ctex} å®åŒ…ã€‚}
%
% å¯¹äºŽå»ºç«‹åœ¨ \LaTeX{} æ&nbsp;‡å‡†æ–‡æ¡£ç±»ä¹‹ä¸Šå¼€å‘çš„æ–‡æ¡£ç±»ï¼Œåœ¨ä½¿ç”¨ \pkg{ctex} å®åŒ…æ—¶
% åŠ&nbsp;ä¸Š \opt{heading} é€‰é¡¹ï¼Œå¯ä»¥å°†ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜è®¾ç½®ä¸ºä¸­æ–‡é£Žæ&nbsp;¼ã€‚
% \begin{ctexexam}
%   \documentclass{ltxdoc}
%   \usepackage[heading = true]{ctex}
%   \begin{document}
%   \section{ç®€ä»‹}
%   ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜ä¸­æ–‡åŒ–çš„ \LaTeX{} æ‰‹å†Œã€‚
%   \end{document}
% \end{ctexexam}
%
% \section{å®åŒ…é€‰é¡¹ä¸Ž \tn{ctexset} å‘½ä»¤}
% \label{sec:options}
%
% \CTeX{} å®é›†å·²ç»å°½å¯èƒ½å°±ä¸­æ–‡çš„è¡Œæ–‡å’Œç‰ˆå¼ä¹&nbsp;æƒ¯åšäº†è°ƒæ•´å’Œé…ç½®ï¼Œé€šå¸¸è€Œè¨€ï¼Œè¿™äº›é…ç½®
% å·²ç»å¤Ÿç”¨ã€‚å›&nbsp;æ­¤ï¼Œé™¤éžå¿…è¦ï¼Œæˆ‘ä»¬ä¸å»ºè®®æ™®é€šç”¨æˆ·ä¿®æ”¹è¿™äº›é»˜è®¤é…ç½®ã€‚å¦‚æžœä½&nbsp;è®¤ä¸º \CTeX{} å®é›†
% çš„é»˜è®¤é…ç½®è¿˜å¯ä»¥å®Œå–„ï¼Œå¯ä»¥åœ¨é¡¹ç›®ä¸»é¡µä¸Š^^A
% \href{https://github.com/CTeX-org/ctex-kit/issues}{æäº¤ issue}ï¼Œ
% å‘æˆ‘ä»¬åæ˜&nbsp;ï¼Œæˆ‘ä»¬ä¼šé…Œæƒ…åœ¨åŽç»­ç‰ˆæœ¬ä¸­äºˆä»¥æ”¹è¿›ã€‚
%
% ä¸è¿‡ï¼Œ\CTeX{} å®é›†ä¹Ÿæä¾›äº†ä¸€ç³»åˆ—é€‰é¡¹ã€‚ç”¨æˆ·å¯ä»¥ä½¿ç”¨è¿™äº›é€‰é¡¹æ¥æŽ§åˆ¶ \CTeX{} å®é›†çš„è¡Œä¸ºã€‚
% æŒ‰å½¢å¼åˆ†ç±»ï¼Œè¿™äº›é€‰é¡¹æœ‰çš„ä»¥ä¼&nbsp;ç»Ÿçš„æ–¹å¼æä¾›ï¼Œæœ‰çš„ä»¥ \meta{key}|=|\meta{value} çš„å½¢å¼æä¾›ã€‚
% æŒ‰æŒ‡å®šä½ç½®åˆ†ç±»ï¼Œè¿™äº›é€‰é¡¹åˆå¯ä»¥åˆ†ä¸ºä»¥ä¸‹ä¸‰ç±»ï¼š
% \begin{itemize}
% \item åå­—åŽå¸¦æœ‰ \rexptarget\rexpstar{} å·çš„é€‰é¡¹ï¼Œåªèƒ½ä½œä¸ºå®åŒ…/æ–‡æ¡£ç±»é€‰é¡¹ï¼Œéœ€è¦
%   åœ¨å¼•å…¥å®åŒ…/æ–‡æ¡£ç±»çš„æ—¶å€™æŒ‡å®šï¼›
% \item åå­—åŽå¸¦æœ‰ \exptarget\expstar{} å·çš„é€‰é¡¹ï¼Œåªèƒ½é€šè¿‡ \CTeX{} å®é›†æä¾›çš„
%   ç”¨æˆ·æŽ¥å£ \tn{ctexset} æ¥è®¾å®šï¼›
% \item åå­—åŽä¸å¸¦æœ‰ç‰¹æ®Šç¬¦å·çš„é€‰é¡¹ï¼Œæ—¢å¯ä»¥ä½œä¸ºå®åŒ…/æ–‡æ¡£ç±»é€‰é¡¹ï¼Œä¹Ÿå¯ä»¥é€šè¿‡
%   \tn{ctexset} æ¥è®¾å®šã€‚
% \end{itemize}
% åŽç»­æ–‡æ¡£å°†åœ¨ä½¿ç”¨è¯´æ˜Žä¸­å¯¹æŸäº›ç‰¹æ®Šçš„é€‰é¡¹åŠ&nbsp;ä»¥è¯´æ˜Žã€‚
%
% \begin{function}[added=2014-03-18]{\ctexset}
%   \begin{syntax}
%     \tn{ctexset} \Arg{é”®å€¼åˆ—è¡¨}
%   \end{syntax}
% æ˜¯ \CTeX{} å®é›†çš„é€šç”¨æŽ§åˆ¶å‘½ä»¤ï¼Œç”¨æ¥åœ¨å®åŒ…è½½å…¥åŽæŽ§åˆ¶å®åŒ…çš„å„é¡¹åŠŸèƒ½ã€‚
% \tn{ctexset} çš„å‚æ•°æ˜¯ä¸€ä¸ªé”®å€¼åˆ—è¡¨ï¼Œä»¥é€šç”¨çš„æŽ¥å£å®Œæˆå„é¡¹è®¾ç½®ã€‚
% \end{function}
%
% \tn{ctexset} çš„å‚æ•°æ˜¯ä¸€ç»„ç”±é€—å·åˆ†éš”çš„é€‰é¡¹åˆ—è¡¨ï¼Œåˆ—è¡¨ä¸­çš„é€‰é¡¹é€šå¸¸æ˜¯ä¸€ä¸ª
% \meta{key}|=|\meta{value} æ&nbsp;¼å¼çš„å®šä¹‰ã€‚ä¾‹å¦‚è®¾ç½®æ‘˜è¦ä¸Žå‚è€ƒæ–‡çŒ®æ&nbsp;‡é¢˜åç§°
% ï¼ˆ\ref{subs:capname}~èŠ‚ï¼‰å°±å¯ä»¥ä½¿ç”¨ï¼š
% \begin{ctexexam}[labelref=exam:capname]
%   \ctexset{
%     abstractname = {æœ¬æ–‡æ¦‚è¦},
%     bibname      = {æ–‡\quad çŒ®}
%   }
% \end{ctexexam}
%
% \tn{ctexset} é‡‡ç”¨ \LaTeXiii{} é£Žæ&nbsp;¼çš„é”®å€¼è®¾ç½®ï¼Œæ”¯æŒä¸åŒç±»åž‹çš„é€‰é¡¹ä¸Žå±‚æ¬¡åŒ–çš„é€‰
% é¡¹è®¾ç½®ï¼Œç›¸å…³ç¤ºä¾‹è§ \ref{sec:secstyle}~èŠ‚ã€‚
%
% \section{ç¼–è¯‘æ–¹å¼ã€ç¼–ç&nbsp;ä¸Žä¸­æ–‡å­—åº“}
% \label{sec:chinese}
%
% \subsection{ç¼–è¯‘æ–¹å¼}
% \label{subs:compile}
%
% \CTeX{} å®é›†ä¼šæ&nbsp;¹æ®ç”¨æˆ·ä½¿ç”¨çš„ç¼–è¯‘æ–¹å¼\footnote{\LaTeXã€\pdfLaTeXã€\XeLaTeXã€
% \LuaLaTeX{} åŠ \upLaTeXã€‚}ï¼Œåœ¨åº•å±‚é€‰æ‹©ä¸åŒçš„ä¸­æ–‡æ”¯æŒæ–¹å¼ï¼ˆè§
% è¡¨~\ref{tab:chinese-support}ï¼‰ã€‚
%
% \begin{table}[htbp]
% \centering
% \begin{threeparttable}
% \caption{\CTeX{} å®é›†çš„ä¸­æ–‡æ”¯æŒæ–¹å¼}
% \label{tab:chinese-support}
% \begin{tabular}{*6c}
%   \toprule
%   ç¼–è¯‘æ–¹å¼ &amp; (pdf)\LaTeX &amp; \XeLaTeX &amp; \LuaLaTeX &amp; \upLaTeX\tnote{*} \\
%   \midrule
%   æ”¯æŒå®åŒ… &amp; \pkg{CJK} &amp; \pkg{xeCJK} &amp; \pkg{LuaTeX-ja} &amp; åŽŸç”Ÿ \\
%   \bottomrule
% \end{tabular}
% \begin{tablenotes}
% \item[*] p\LaTeX-ngï¼ˆæˆ–ç§° \ApLaTeXï¼‰ä¸Ž \upLaTeX{} å…¼å®¹ã€‚ä½¿ç”¨ p\LaTeX-ng ç¼–è¯‘
% æ—¶ï¼Œ\pkg{ctex} é‡‡ç”¨ä¸Ž \upLaTeX{} ç›¸åŒçš„è®¾ç½®ã€‚
% \end{tablenotes}
% \end{threeparttable}
% \end{table}
%
% ä¸åŒçš„ç¼–è¯‘æ–¹å¼å’Œä¸­æ–‡æ”¯æŒæ–¹å¼ä¼šåœ¨ä¸€å®šç¨‹åº¦ä¸Šå½±å“ \CTeX{} å®é›†çš„è¡Œä¸ºï¼Œæ¯”å¦‚å®åŒ…å¯¹
% æ–‡æ¡£ç¼–ç&nbsp;ã€å­—ä½“é€‰æ‹©ã€ç©ºæ&nbsp;¼ã€æ&nbsp;‡ç‚¹ç­‰çš„å¤„ç†ã€‚å…·ä½“ç»†èŠ‚å°†åœ¨æœ¬æ–‡æ¡£åŽç»­å†…å®¹ä¸­è¿›è¡Œé˜è¿°ã€‚
%
% \subsection{ä¸­æ–‡ç¼–ç&nbsp;}
% \label{subs:encoding}
%
% \begin{function}[rEXP,updated=2019-11-10]{GBK, UTF8}
%   æŒ‡æ˜Žç¼–å†™æ–‡æ¡£æ—¶ä½¿ç”¨çš„ç¼–ç&nbsp;ã€‚\CTeX{} å®é›†æ—&nbsp;æ³•æ£€æµ‹æ–‡æ¡£æºæ–‡ä»¶çš„å®žé™…ç¼–ç&nbsp;æ&nbsp;¼å¼ï¼Œå›&nbsp;æ­¤éœ€è¦
%   ç”¨æˆ·é€šè¿‡é€‰é¡¹å£°æ˜Žã€‚å¦‚æžœæ²¡æœ‰æ˜¾å¼æŒ‡å®šï¼Œåˆ™é»˜è®¤é‡‡ç”¨ UTF-8 ç¼–ç&nbsp;ã€‚
%
%   ä½¿ç”¨ \XeLaTeX{}ã€\LuaLaTeX{} æˆ– \upLaTeX{} ç¼–è¯‘æ—¶ï¼Œ\CTeX{} å®é›†å¼ºåˆ¶ä½¿ç”¨
%   UTF-8 ç¼–ç&nbsp;ï¼Œæ­¤æ—¶ \opt{GBK} é€‰é¡¹æ—&nbsp;æ•ˆï¼›ä½¿ç”¨ (pdf)\LaTeX{} ç¼–è¯‘æ—¶ï¼Œ
%   \CTeX{} å®é›†é»˜è®¤ä½¿ç”¨ UTF-8 ç¼–ç&nbsp;ï¼Œä½†ç”¨æˆ·ä¹Ÿå¯ä»¥æ˜¾å¼å£°æ˜Ž \opt{GBK} é€‰é¡¹ï¼Œ
%   ä½¿ \CTeX{} å®é›†æŒ‰ GBK ç¼–ç&nbsp;å¤„ç†æ–‡æ¡£ã€‚
%
%   ç”¨æˆ·éœ€è¦\emph{ä¿è¯ç¼–è¯‘æ–¹å¼ã€æºæ–‡ä»¶ç¼–ç&nbsp;ã€å®åŒ…ç¼–ç&nbsp;é€‰é¡¹ä¸‰è€…ä¸€è‡´}ã€‚
%
%   \emph{æˆ‘ä»¬å»ºè®®ç¼–å†™æ–°æ–‡æ¡£æ—¶å§‹ç»ˆä½¿ç”¨ UTF-8 ç¼–ç&nbsp;ï¼Œè€Œä»…æŠŠ GBK ç¼–ç&nbsp;ç•™ç»™
%   åŽ†å²é—ç•™æ–‡æ¡£ã€‚}
% \end{function}
%
% \subsection{ä¸­æ–‡å­—åº“}
% \label{subs:options-CJK-font}
%
% ä»¥å¾€ï¼Œä¸º \LaTeX{} æ–‡æ¡£é…ç½®ä¸­æ–‡æ”¯æŒæ˜¯ä¸€ä»¶ç›¸å½“ç¹ççš„äº‹æƒ…ã€‚é»˜è®¤æƒ…å†µä¸‹ï¼Œ
% \CTeX{} å®é›†èƒ½è‡ªåŠ¨æ£€æµ‹ç”¨æˆ·ä½¿ç”¨çš„ç¼–è¯‘æ–¹å¼ï¼ˆå‚è§ \ref{subs:compile}~èŠ‚ï¼‰å’Œ
% æ“ä½œç³»ç»Ÿ\footnote{\CTeX{} å®é›†çŽ°åœ¨èƒ½å¤Ÿè¯†åˆ« macOS åŠ Windows ç³»ç»Ÿï¼Œ
% å¹¶å°†å…¶ä»–ç³»ç»Ÿç»Ÿä¸€å½’ä¸º Linuxã€‚}ï¼Œé€‰æ‹©åˆé€‚çš„åº•å±‚æ”¯æŒå’Œå­—åº“ï¼Œä»Žè€Œç®€åŒ–é…ç½®è¿‡ç¨‹ã€‚
% è‡ªåŠ¨é…ç½®çš„æƒ…å†µå‚è§è¡¨~\ref{tab:default-font-select}ã€‚
%
% \begin{table}[htbp]
% \centering
% \begin{threeparttable}
% \caption{\CTeX{} å®é›†è‡ªåŠ¨é…ç½®å­—ä½“ç­–ç•¥}
% \label{tab:default-font-select}
% \begin{tabular}{*{5}{c}}
%   \toprule
%              &amp; macOS Old\tnote{1}
%              &amp; macOS New\tnote{2}
%              &amp; Windows\tnote{3}
%              &amp; å…¶ä»– \\
%   \midrule
%   \XeLaTeX   &amp; \makecell{\pkg{xeCJK}\\åŽæ–‡å­—åº“}
%              &amp; \makecell{\pkg{xeCJK}\\åŽæ–‡å­—åº“ + è‹¹æ–¹}
%              &amp; \makecell{\pkg{xeCJK}\\ä¸­æ˜“å­—åº“ + å¾®è½¯é›…é»‘}
%              &amp; \makecell{\pkg{xeCJK}\\Fandol å­—åº“\tnote{4}} \\
%   \cmidrule(lr){1-5}
%   \LuaLaTeX\tnote{5}
%              &amp; \makecell{\pkg{LuaTeX-ja}\\åŽæ–‡å­—åº“}
%              &amp; \makecell{\pkg{LuaTeX-ja}\\åŽæ–‡å­—åº“ + è‹¹æ–¹}
%              &amp; \makecell{\pkg{LuaTeX-ja}\\ä¸­æ˜“å­—åº“ + å¾®è½¯é›…é»‘}
%              &amp; \makecell{\pkg{LuaTeX-ja}\\Fandol å­—åº“} \\
%   \cmidrule(lr){1-5}
%   \pdfLaTeX
%              &amp; ä¸å¯ç”¨
%              &amp; ä¸å¯ç”¨
%              &amp; \makecell{\pkg{CJK} + \pkg{zhmetrics}\\ä¸­æ˜“å­—åº“ + å¾®è½¯é›…é»‘\tnote{6}}
%              &amp; ä¸å¯ç”¨ \\
%   \cmidrule(lr){1-5}
%   \makecell{\LaTeX{} + \\\dvipdfmx}
%              &amp; ä¸å¯ç”¨
%              &amp; \makecell{\pkg{CJK} + \pkg{zhmetrics}\\åŽæ–‡å­—åº“ + è‹¹æ–¹}
%              &amp; \makecell{\pkg{CJK} + \pkg{zhmetrics}\\ä¸­æ˜“å­—åº“ + å¾®è½¯é›…é»‘\tnote{6}}
%              &amp; \makecell{\pkg{CJK} + \pkg{zhmetrics}\\Fandol å­—åº“} \\
%   \cmidrule(lr){1-5}
%   \makecell{\upLaTeX{} + \\\dvipdfmx}
%              &amp; ä¸å¯ç”¨
%              &amp; \makecell{\pkg{zhmetrics-uptex}\\åŽæ–‡å­—åº“ + è‹¹æ–¹}
%              &amp; \makecell{\pkg{zhmetrics-uptex}\\ä¸­æ˜“å­—åº“ + å¾®è½¯é›…é»‘}
%              &amp; \makecell{\pkg{zhmetrics-uptex}\\Fandol å­—åº“} \\
%   \bottomrule
% \end{tabular}
% \begin{tablenotes}
%   \item [1] Yosemite (10.10) åŠä»¥å‰çš„ macOS ç³»ç»Ÿã€‚
%   \item [2] El Capitan (10.11) åŠä»¥åŽçš„ macOS ç³»ç»Ÿã€‚
%   \item [3] ä»…æ”¯æŒ Windows Vista åŠä»¥åŽçš„ Windows æ“ä½œç³»ç»Ÿã€‚
%   \item [4] ç”±é©¬èµ·å›­ã€è‹æ°ã€é»„æ™¨æˆç­‰äººå¼€å‘çš„å¼€æºä¸­æ–‡å­—ä½“ï¼Œ
%     å‚è§ï¼š\url{https://www.ctan.org/pkg/fandol}ã€‚
%   \item [5] \LuaLaTeX{} ç¼–è¯‘æ—¶ä½¿ç”¨ \pkg{LuaTeX-ja} å®åŒ…ã€‚å¯¹æ­¤ï¼Œ
%     ç¬¬ \ref{sec:lualatex-chinese}~èŠ‚æœ‰ç‰¹åˆ«è¯´æ˜Žã€‚
%   \item [6] å¾®è½¯é›…é»‘å­—ä½“å¹¶ä¸æ€»æ˜¯æœ‰æ•ˆï¼Œè¿™å’Œé€‰é¡¹ \opt{zhmap} çš„å–å€¼æœ‰å…³ã€‚
% \end{tablenotes}
% \end{threeparttable}
% \end{table}
%
% é€šå¸¸ï¼Œç”± \CTeX{} å®é›†è¿›è¡Œçš„è‡ªåŠ¨é…ç½®å·²ç»è¶³å¤Ÿä½¿ç”¨ï¼Œæ—&nbsp;éœ€ç”¨æˆ·æ‰‹å·¥å¹²é¢„ï¼›ä½†
% æ˜¯ \CTeX{} ä»ç„¶æä¾›äº†ä¸€ç³»åˆ—é€‰é¡¹ï¼Œä¾›åœ¨ \CTeX{} çš„è‡ªåŠ¨é€‰æ‹©æœºåˆ¶å›&nbsp;ä¸º
% æ„å¤–æƒ…å†µå¤±æ•ˆï¼Œæˆ–è€…åœ¨ç”¨æˆ·æœ‰ç‰¹æ®Šéœ€æ±‚çš„æƒ…å†µä¸‹ä½¿ç”¨ã€‚\emph{é™¤éžå¿…è¦ï¼Œç”¨æˆ·ä¸
% åº”ä½¿ç”¨è¿™äº›é€‰é¡¹ã€‚}
%
% \begin{function}[rEXP,updated=2014-03-08]{zhmap}
%   \begin{syntax}
%     zhmap = &lt;\TTF|zhmCJK&gt;
%   \end{syntax}
%   æŒ‡å®šå­—ä½“æ˜&nbsp;å°„æœºåˆ¶ã€‚æœ¬é€‰é¡¹åªåœ¨ä½¿ç”¨ (pdf)\LaTeX{} ç¼–è¯‘æ—¶æœ‰æ„ä¹‰ã€‚
% \end{function}
% \begin{optdesc}
%   \item[true] è¿™æ˜¯è¯¥é€‰é¡¹çš„é»˜è®¤å€¼ã€‚^^A
%   \footnote{å¯¹äºŽä»¥é”®å€¼å¯¹å½¢å¼æä¾›çš„é€‰é¡¹ï¼Œæ–‡æ¡£ä»¥\textbf{ç²—ä½“}æ¥è¡¨ç¤ºå…¶é»˜è®¤å€¼ã€‚^^A
%   ä¸‹åŒï¼Œä¸å†é¢å¤–è§£é‡Šã€‚}ä½¿ç”¨ \pkg{zhmetrics} å®åŒ…ï¼Œå°† CJK å­—åº“é€šè¿‡ \tn{special}
%   å‘½ä»¤æ˜&nbsp;å°„åˆ° \file{.ttf} æ–‡ä»¶ã€‚
%
%   \item[false] ä½¿ç”¨ä¼&nbsp;ç»Ÿçš„ CJK å­—åº“ï¼ˆType 1ï¼‰^^A
%   \footnote{ä½¿ç”¨ (pdf)\LaTeX{} ç¼–è¯‘æ—¶ï¼Œå¦‚æžœéœ€è¦ä½¿ç”¨è‡ªå®šä¹‰çš„å­—ä½“æ˜&nbsp;å°„æ–‡ä»¶ï¼ˆæ¯”å¦‚éœ€è¦
%     ä½¿ç”¨ \LaTeX{} + Dvips ç¼–è¯‘ï¼‰ï¼Œæˆ–è€…å¸Œæœ›ä½¿ç”¨ Type1 å­—åº“ï¼Œè¯·ç¦ç”¨æœ¬é€‰é¡¹ã€‚ä¸ºæ­¤ï¼Œä½&nbsp;
%     å¯èƒ½éœ€è¦å®‰è£… CJK å­—ä½“ã€‚å‚è€ƒ \pkg{zhmetrics} å®åŒ…æä¾›çš„è„šæœ¬
%     \href{https://github.com/CTeX-org/ctex-kit/blob/master/zhmetrics/CTeXFonts.lua}
%     {\file{CTeXFonts.lua}}ã€‚}ã€‚
%
%   \item[zhmCJK] è½½å…¥ \pkg{zhmCJK} å®åŒ…^^A
%   \footnote{\pkg{zhmCJK} å®åŒ…åŸºäºŽ \pkg{zhmetrics} å’Œ \pkg{CJK} å®åŒ…ï¼Œæä¾›ä¸Ž
%   \pkg{xeCJK} å®åŒ…ç±»ä¼¼çš„ç”¨æˆ·æŽ¥å£ã€‚}^^A
%   ï¼Œç”± \pkg{zhmCJK} å®åŒ…æä¾›ä»Ž CJK å­—åº“åˆ° \file{.ttf} çš„æ˜&nbsp;å°„ã€‚
% \end{optdesc}
%
% \begin{function}[added=2014-03-08]{fontset}
%   \begin{syntax}
%     fontset = &lt;adobe|fandol|founder|mac|macnew|macold|ubuntu|windows|none|...&gt;
%   \end{syntax}
%   æŒ‡å®š \CTeX{} å®é›†åŠ&nbsp;è½½çš„å­—åº“ã€‚
%
%   å¦‚æžœæ²¡æœ‰æŒ‡å®š \opt{fontset} çš„å€¼ï¼Œ\CTeX{} å®é›†å°†è‡ªåŠ¨æ£€æµ‹ç”¨æˆ·ä½¿ç”¨çš„æ“ä½œç³»ç»Ÿï¼Œé…ç½®
%   ç›¸åº”çš„å­—ä½“ï¼ˆå‚è§è¡¨~\ref{tab:default-font-select}ï¼‰ã€‚
% \end{function}
%
% \CTeX{} é¢„å®šä¹‰äº†ä»¥ä¸‹å…­ç§ä¸­æ–‡å­—åº“ã€‚
%
% \begin{optdesc}
%   \item[adobe] ä½¿ç”¨ Adobe å…¬å¸çš„å››æ¬¾ä¸­æ–‡å­—ä½“ï¼Œ\emph{ä¸æ”¯æŒ \pdfLaTeX}ã€‚
%   \item[fandol] ä½¿ç”¨ Fandol ä¸­æ–‡å­—ä½“ï¼Œ\emph{ä¸æ”¯æŒ \pdfLaTeX}ã€‚
%   \item[founder] ä½¿ç”¨æ–¹æ­£å…¬å¸çš„ä¸­æ–‡å­—ä½“ã€‚
%   \item[mac] ä½¿ç”¨ macOS ç³»ç»Ÿä¸‹çš„å­—ä½“ï¼Œ\emph{ä¸æ”¯æŒ \pdfLaTeX}ï¼Œæ&nbsp;¹æ®ç‰ˆæœ¬åˆ†ä¸º
%     |macnew| å’Œ |macold| ä¸¤ç§ã€‚
%   \item[macnew] ä½¿ç”¨ El Capitan æˆ–ä¹‹åŽçš„å¤šå­—é‡åŽæ–‡å­—ä½“å’Œè‹¹æ–¹å­—ä½“ã€‚
%   \item[macold] ä½¿ç”¨ Yosemite æˆ–ä¹‹å‰çš„åŽæ–‡å­—ä½“ã€‚
%   \item[ubuntu] ä½¿ç”¨ Ubuntu ç³»ç»Ÿä¸‹çš„æ€æºå®‹ä½“ã€æ€æºé»‘ä½“å’Œ \TeX{} å‘è¡Œç‰ˆè‡ªå¸¦çš„
%     æ–‡é¼Žæ¥·ä½“ï¼Œ\emph{ä¸æ”¯æŒ \pdfLaTeX}ã€‚
%   \item[windows] ä½¿ç”¨ Windows ç³»ç»Ÿä¸‹çš„ä¸­æ˜“å­—ä½“å’Œå¾®è½¯é›…é»‘å­—ä½“ã€‚
%     å½“ä½¿ç”¨ (pdf)\LaTeX{} ç¼–è¯‘æ—¶ï¼Œå¾®è½¯é›…é»‘ä»…åœ¨ä»¥ä¸‹ä¸¤ç§æƒ…å½¢æœ‰æ•ˆï¼š
%     å®‰è£…æœ‰ \pkg{zhmCJK} å®åŒ…ä¸”é€‰é¡¹ \opt{zhmap=zhmCJK} æ—¶ï¼Œæˆ–è€…
%     å®‰è£…æœ‰å¾®è½¯é›…é»‘çš„ Type1 å­—ä½“ä¸”é€‰é¡¹ \opt{zhmap=false} æ—¶ã€‚
% \end{optdesc}
%
% å¦‚æžœä¸æƒ³ä½¿ç”¨ \CTeX{} é¢„å®šä¹‰çš„ä¸­æ–‡å­—åº“ï¼Œå¯ä»¥è®¾ç½® \opt{fontset} ä¸ºä¸‹è¿°å€¼ä¹‹ä¸€ã€‚
%
% \begin{optdesc}
%   \item[none] ä¸é…ç½®ä¸­æ–‡å­—ä½“ï¼Œéœ€è¦ç”¨æˆ·è‡ªå·±é…ç½®ã€‚
%   \item[\meta{name}] è¿™é‡Œ \meta{name} ä¸ºè‡ªå®šä¹‰çš„åå­—ã€‚
%   \CTeX{} å®é›†å°†è½½å…¥åä¸º |ctex-fontset-|\meta{name}|.def| çš„æ–‡ä»¶ä½œä¸ºå­—ä½“é…ç½®
%   æ–‡ä»¶ã€‚å›&nbsp;æ­¤ï¼Œè¯·å…ˆä¿è¯æ–‡ä»¶çš„å­˜åœ¨ã€‚å¯ä»¥åœ¨å½“å‰å·¥ä½œç›®å½•æˆ–è€…æœ¬åœ° \texttt{TDS} ç›®å½•
%   æ&nbsp;‘ä¸‹åˆé€‚ä½ç½®å»ºç«‹ä¸€ä¸ªåä¸º |ctex-fontset-|\meta{name}|.def| çš„æ–‡ä»¶ï¼Œåœ¨è¿™ä¸ªæ–‡ä»¶
%   é‡Œé¢è‡ªå®šä¹‰ä¸­æ–‡å­—ä½“ã€‚ç„¶åŽé€šè¿‡ä½¿ç”¨ |fontset=|\meta{name} é€‰é¡¹æ¥è°ƒç”¨å®ƒã€‚å­—ä½“é…ç½®
%   æ–‡ä»¶çš„å…·ä½“å†™æ³•å¯ä»¥å‚è€ƒ \CTeX{} å®é›† \texttt{fontset} ç›®å½•ä¸‹çš„å­—ä½“é…ç½®æ–‡ä»¶ã€‚
% \end{optdesc}
%
% æ³¨æ„ï¼š\emph{å¦‚æžœå¸Œæœ›ä½¿ç”¨ \tn{ctexset} åœ¨å¯¼è¨€åŒºæŒ‡å®šå­—åº“ï¼Œåˆ™éœ€è¦å…ˆåœ¨å®åŒ…/æ–‡æ¡£ç±»é€‰é¡¹ä¸­æŒ‡å®š
% \opt{fontset = none}}ï¼ˆè¿™ä¼šç¦ç”¨ \CTeX{} å®é›†çš„æ“ä½œç³»ç»Ÿæ£€æµ‹åŠŸèƒ½å’Œè‡ªåŠ¨è®¾å®šå­—åº“åŠŸèƒ½ï¼‰ã€‚ä¾‹å¦‚ï¼š
% \begin{ctexexam}
%   \documentclass[fontset = none]{ctexart}
%   \ctexset{fontset = founder}
%   \begin{document}
%   åœ¨æ–‡æ¡£ç±»é€‰é¡¹ä¸­å£°æ˜Ž \verb|fontset = none|ï¼ŒéšåŽåœ¨å¯¼è¨€åŒºç”¨ \verb|\ctexset|
%   æŒ‡å®šå­—ä½“ã€‚
%   \end{document}
% \end{ctexexam}
%
% \CTeX{} å®é›†é¢„å®šä¹‰çš„ä¸­æ–‡å­—åº“è¿˜å®šä¹‰äº†ä¸€äº›å­—ä½“å‘½ä»¤ã€‚é™¤äº†åœ¨ \opt{ubuntu} å­—åº“ä¸­æ²¡æœ‰
% \tn{fangsong} çš„å®šä¹‰å¤–ï¼Œæ‰€æœ‰å­—åº“éƒ½æœ‰ä»¥ä¸‹å››ä¸ªå­—ä½“å‘½ä»¤ï¼š
% \begin{optdesc}
%   \item[\tn{songti}] å®‹ä½“ï¼ŒCJK ç­‰ä»·å‘½ä»¤ |\CJKfamily{zhsong}|ã€‚
%   \item[\tn{heiti}] é»‘ä½“ï¼ŒCJK ç­‰ä»·å‘½ä»¤ |\CJKfamily{zhhei}|ã€‚
%   \item[\tn{fangsong}] ä»¿å®‹ï¼ŒCJK ç­‰ä»·å‘½ä»¤ |\CJKfamily{zhfs}|ã€‚
%   \item[\tn{kaishu}] æ¥·ä¹¦ï¼ŒCJK ç­‰ä»·å‘½ä»¤ |\CJKfamily{zhkai}|ã€‚
% \end{optdesc}
% åœ¨ \opt{windows}ã€\opt{founder} å’Œ \opt{macnew} å­—åº“ä¸­ï¼Œé¢å¤–å®šä¹‰äº† \tn{lishu}
% å’Œ \tn{youyuan}ï¼š
% \begin{optdesc}
%   \item[\tn{lishu}] éš¶ä¹¦ï¼ŒCJK ç­‰ä»·å‘½ä»¤ |\CJKfamily{zhli}|ã€‚
%   \item[\tn{youyuan}] åœ†ä½“ï¼ŒCJK ç­‰ä»·å‘½ä»¤ |\CJKfamily{zhyou}|ã€‚
% \end{optdesc}
% åœ¨ \opt{windows} å­—åº“ä¸­è¿˜å®šä¹‰äº† \tn{yahei}ã€‚å‡ºäºŽå…¼å®¹æ€§çš„è€ƒè™‘ï¼Œ\tn{yahei} å‘½ä»¤
% åœ¨ \opt{macnew} å­—åº“ä¸­ä¹Ÿæœ‰å®šä¹‰ï¼Œä½†å®žé™…è°ƒç”¨è‹¹æ–¹é»‘ä½“ï¼š
% \begin{optdesc}
%   \item[\tn{yahei}] å¾®è½¯é›…é»‘ï¼ŒCJK ç­‰ä»·å‘½ä»¤ |\CJKfamily{zhyahei}|ã€‚
% \end{optdesc}
% åœ¨ \opt{macnew} å­—åº“ä¸­ï¼Œè¿˜å®šä¹‰äº† \tn{pingfang}ï¼š
% \begin{optdesc}
%   \item[\tn{pingfang}] è‹¹æ–¹é»‘ä½“ï¼ŒCJK ç­‰ä»·å‘½ä»¤ |\CJKfamily{zhpf}|ã€‚
% \end{optdesc}
%
% \section{æŽ’ç‰ˆæ&nbsp;¼å¼è®¾å®š}
% \label{sec:format-settings}
% \subsection{æ–‡æ¡£é»˜è®¤å­—å·}
% \label{subs:options-class}
%
% \begin{function}[rEXP,added=2015-05-06]{zihao}
%   \begin{syntax}
%     zihao = &lt;-4|5|false&gt;
%   \end{syntax}
%   å°†æ–‡ç«&nbsp;é»˜è®¤å­—å·ï¼ˆ\tn{normalsize}ï¼‰è®¾ç½®ä¸ºå°å››å·å­—æˆ–äº”å·å­—ï¼Œ
%   å…·ä½“æƒ…å†µè§è¡¨ \ref{tab:fontsize}ã€‚\opt{false} ç¦ç”¨æœ¬åŠŸèƒ½ã€‚
%   æœ¬é€‰é¡¹å¯ä»¥ç”¨äºŽå››ä¸ª \CTeX{} æ–‡æ¡£ç±»å’Œ \pkg{ctex} å®åŒ…ï¼Œ
%   ä¹Ÿå¯ä»¥ç”¨äºŽ \pkg{ctexsize} å®åŒ…ã€‚
%
%   è¯¥é€‰é¡¹çš„é»˜è®¤å€¼ä¸Ž \opt{scheme} çš„å–å€¼æœ‰å…³ã€‚
%   å½“ \opt{scheme = chinese} æ—¶ï¼Œå¯¹æ&nbsp;‡å‡†æ–‡æ¡£ç±»é»˜è®¤å€¼ä¸º |5|ï¼Œå³è®¾ç½®
%   \tn{normalsize} ä¸ºäº”å·å­—ï¼›å¯¹ \cls{beamer} åˆ™ä¸º |false|ï¼Œä½¿ç”¨æ–‡æ¡£ç±»åŽŸæœ‰çš„è®¾ç½®ã€‚
%   å½“ \opt{scheme = plain} æ—¶ï¼Œè¯¥é€‰é¡¹ä¸è®¾é»˜è®¤å€¼ï¼Œæ²¿ç”¨æ&nbsp;‡å‡†æ–‡æ¡£ç±»æˆ– \cls{beamer} çš„åŽŸæœ‰è®¾ç½®ã€‚
% \end{function}
%
% \begin{table}[htbp]
% \centering
% \setlength\tabcolsep{1em}
% \caption{æ&nbsp;‡å‡†å­—ä½“å‘½ä»¤ä¸Žå­—å·çš„å¯¹åº”}\label{tab:fontsize}
% \begin{tabular}{l*2{c&gt;{\ttfamily}r}*3{&gt;{\ttfamily}c}}
% \toprule
% &amp; \multicolumn2c{|zihao = 5|} &amp; \multicolumn2c{|zihao = -4|} &amp;
% \multicolumn1c{|10pt|} &amp; \multicolumn1c{|11pt|} &amp; \multicolumn1c{|12pt|} \\
% \cmidrule(lr){2-3} \cmidrule(lr){4-5}
% \cmidrule(lr){6-6} \cmidrule(lr){7-7} \cmidrule(lr){8-8}
% å­—ä½“å‘½ä»¤        &amp; å­—å· &amp; \si{bp} &amp; å­—å· &amp; \si{bp}
%                        &amp; \si{pt} &amp; \si{pt} &amp; \si{pt} \\
% \midrule
% |\tiny|         &amp; ä¸ƒå· &amp; 5.5  &amp; å°å…­ &amp; 6.5  &amp; ~5 &amp; ~6 &amp; ~6 \\
% |\scriptsize|   &amp; å°å…­ &amp; 6.5  &amp; å…­å· &amp; 7.5  &amp; ~7 &amp; ~8 &amp; ~8 \\
% |\footnotesize| &amp; å…­å· &amp; 7.5  &amp; å°äº” &amp; 9~~  &amp; ~8 &amp; ~9 &amp; 10 \\
% |\small|        &amp; å°äº” &amp; 9~~  &amp; äº”å· &amp; 10.5 &amp; ~9 &amp; 10 &amp; 11 \\
% |\normalsize|   &amp; äº”å· &amp; 10.5 &amp; å°å›› &amp; 12~~ &amp; 10 &amp; 11 &amp; 12 \\
% |\large|        &amp; å°å›› &amp; 12~~ &amp; å°ä¸‰ &amp; 15~~ &amp; 12 &amp; 12 &amp; 14 \\
% |\Large|        &amp; å°ä¸‰ &amp; 15~~ &amp; å°äºŒ &amp; 18~~ &amp; 14 &amp; 14 &amp; 17 \\
% |\LARGE|        &amp; å°äºŒ &amp; 18~~ &amp; äºŒå· &amp; 22~~ &amp; 17 &amp; 17 &amp; 20 \\
% |\huge|         &amp; äºŒå· &amp; 22~~ &amp; å°ä¸€ &amp; 24~~ &amp; 20 &amp; 20 &amp; 25 \\
% |\Huge|         &amp; ä¸€å· &amp; 26~~ &amp; ä¸€å· &amp; 26~~ &amp; 25 &amp; 25 &amp; 25 \\
% \bottomrule
% \end{tabular}
%\end{table}
%
% \begin{function}[rEXP]{10pt, 11pt, 12pt}
%   \CTeX{} æ–‡æ¡£ç±»æ˜¯åœ¨ \LaTeX{} æ&nbsp;‡å‡†æ–‡æ¡£ç±»ä¹‹ä¸Šå¼€å‘çš„ã€‚å›&nbsp;æ­¤ï¼Œé™¤äº†å¯ä»¥ä½¿ç”¨ \CTeX{}
%   å®åŒ…å®šä¹‰çš„å­—å·é€‰é¡¹ä¹‹å¤–ï¼Œè¿˜å¯ä»¥ä½¿ç”¨æ&nbsp;‡å‡†æ–‡æ¡£ç±»çš„åŒç±»é€‰é¡¹ï¼ˆ\opt{10pt}ã€\opt{11pt}
%   å’Œ \opt{12pt}ï¼‰ã€‚åœ¨ä½¿ç”¨è¿™äº›æ¥è‡ªæ&nbsp;‡å‡†æ–‡æ¡£ç±»çš„é€‰é¡¹çš„æ—¶å€™ï¼Œ\CTeX{} æ–‡æ¡£ç±»çš„å­—å·
%   é€‰é¡¹ä¼šè¢«æŠ‘åˆ¶ã€‚äº¦å³ï¼Œåœ¨ \opt{zihao} é€‰é¡¹ä¹‹åŽè®¾ç½® \opt{10pt} é€‰é¡¹ï¼Œ
%   \opt{zihao} é€‰é¡¹å°†ä¸å†èµ·ä½œç”¨ã€‚
% \end{function}
%
% æ&nbsp;‡å‡†æ–‡æ¡£ç±»çš„å…¶ä»–é€‰é¡¹åœ¨ \CTeX{} æ–‡æ¡£ç±»ä¸­ä¾æ—§æœ‰æ•ˆã€‚ä¾‹å¦‚ï¼Œè®¾ç½®çº¸å¼&nbsp;å¤§å°å’Œæ–¹å‘çš„
% \opt{a4paper} å’Œ \opt{landscape}ï¼Œè®¾ç½®å•åŒé¢çš„ \opt{oneside} å’Œ
% \opt{twoside} ç­‰ã€‚\CTeX{} ä¼šå°†è¿™äº›é€‰é¡¹ä¼&nbsp;ç»™æ&nbsp;‡å‡†æ–‡æ¡£ç±»^^A
% \footnote{äº‹å®žä¸Šï¼Œ\LaTeX{} åœ¨æ–‡æ¡£ç±»ä¸­çš„é€‰é¡¹æ˜¯å…¨å±€è®¾å®šçš„ï¼Œé™¤äº†å¯¹ä½¿ç”¨çš„æ–‡æ¡£ç±»æœ‰
% å½±å“å¤–ï¼Œä¹Ÿå¯èƒ½ä¼šå½±å“åˆ°éšåŽä½¿ç”¨çš„å®åŒ…ã€‚å¦‚æžœè¿™äº›å®åŒ…ä¸­æœ‰æŸäº›é€‰é¡¹å‡ºçŽ°åœ¨æ–‡æ¡£ç±»çš„
% é€‰é¡¹åˆ—è¡¨ä¸­ï¼Œé‚£ä¹ˆè¯¥é€‰é¡¹å°†ä¼šè¢«è‡ªåŠ¨æ¿€æ´»ã€‚}ã€‚
%
% \subsection{ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜é£Žæ&nbsp;¼}
% \label{subs:options-heading}
%
% \begin{function}[rEXP,added=2014-03-08]{heading}
%   \begin{syntax}
%     heading = &lt;\TFF&gt;
%   \end{syntax}
%   æœ¬é€‰é¡¹åªèƒ½åœ¨è°ƒç”¨ \pkg{ctex.sty} æ—¶ä½œä¸ºå®åŒ…é€‰é¡¹ä½¿ç”¨ã€‚
%
%   \CTeX{} å®é›†æä¾›äº†ä¸€å¥—ç”¨äºŽä¿®æ”¹æ–‡æ¡£ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜æ&nbsp;¼å¼çš„æŽ¥å£ã€‚è¯¥é€‰é¡¹ç”¨äºŽé€‰æ‹©æ˜¯å¦
%   å¯ç”¨è¯¥åŠŸèƒ½ã€‚è¯¦ç»†çš„è®¾ç½®æ–¹æ³•è¯·å‚è§ç¬¬ \ref{subs:pagestyle}~èŠ‚å’Œç¬¬ \ref{sec:secstyle}~èŠ‚ã€‚
% \end{function}
%
% \CTeX{} å®é›†æä¾›çš„å››ä¸ªæ–‡æ¡£ç±»æ€»æ˜¯å¯ç”¨è¯¥åŠŸèƒ½ã€‚å¦‚æžœåœ¨ \pkg{ctex.sty} ä¸‹å¯ç”¨è¯¥é€‰é¡¹ï¼Œ
% å°†ä¼šæ£€æŸ¥å½“å‰æ˜¯å¦ä½¿ç”¨ \LaTeX{} æ&nbsp;‡å‡†æ–‡æ¡£ç±»ã€‚
% è‹¥ç„¶ï¼Œåˆ™è¯¥é€‰é¡¹å°†ä¼šä½¿å¾— \pkg{ctex.sty} å®åŒ…çš„è¡Œä¸ºå’Œ \CTeX{} å®é›†æä¾›çš„
% å››ä¸ªä¸­æ–‡æ–‡æ¡£ç±»\emph{å®Œå…¨}ä¸€è‡´ï¼›è‹¥ä¸ç„¶ï¼Œåˆ™ä¼šæ&nbsp;¹æ® \tn{chapter}
% æ˜¯å¦æœ‰å®šä¹‰æ¥ä½¿ç”¨ \cls{ctexbook} æˆ–è€… \cls{ctexart} çš„æ&nbsp;‡é¢˜è®¾ç½®ã€‚
%
% \begin{function}[rEXP]{sub3section, sub4section}
%   ä¿®æ”¹ \tn{paragraph} å’Œ \tn{subparagraph} çš„æ&nbsp;¼å¼ã€‚
%
%   é»˜è®¤æƒ…å†µä¸‹ï¼Œ\tn{paragraph} å’Œ \tn{subparagraph} ä¼šå°†æ&nbsp;‡é¢˜ä¸ŽéšåŽçš„æ­£æ–‡
%   æŽ’ç‰ˆåœ¨åŒä¸€ä¸ªæ®µè½ã€‚å¯ç”¨ \opt{sub3section} ä¼šå°† \tn{paragraph} çš„æ&nbsp;¼å¼ä¿®æ”¹ä¸º
%   ç±»ä¼¼ \tn{section} çš„æ&nbsp;¼å¼ï¼Œå¹¶å°† \tn{subparagraph} çš„æ&nbsp;¼å¼ä¿®æ”¹ä¸ºåŽŸæœ¬ \tn{paragraph}
%   çš„æ&nbsp;¼å¼ã€‚å¯ç”¨ \opt{sub4section} ä¼šå°† \tn{paragraph} å’Œ \tn{subparagraph} çš„æ&nbsp;¼å¼
%   éƒ½ä¿®æ”¹ä¸ºç±»ä¼¼ \tn{section} çš„æ&nbsp;¼å¼ã€‚
%
%   å¯ç”¨è¯¥é€‰é¡¹é€šå¸¸è¿˜éœ€è¦å°†è®¡æ•°å™¨ |secnumdepth| çš„å€¼ä¸ºè®¾ç½®ä¸º |4| æˆ– |5|ã€‚
%
%   å…·ä½“æ&nbsp;¼å¼å¯å‚è€ƒ \ref{subsec:sec-spacing}~å°èŠ‚ä¸­çš„ \opt{runin} å’Œ \opt{afterskip} é€‰é¡¹ã€‚
%
%   æ³¨æ„ï¼Œä¸Šè¿°ä¸¤ä¸ªé€‰é¡¹åªæœ‰åœ¨éž \cls{beamer} æ–‡æ¡£ç±»ä¸‹ \opt{heading} é€‰é¡¹å¯ç”¨çš„æ—¶å€™
%   æ‰æœ‰æ„ä¹‰ã€‚äº¦å³ï¼Œåªæœ‰åœ¨ä½¿ç”¨é™¤äº† \cls{ctexbeamer} çš„ä¸‰ä¸ª \CTeX{} æ–‡æ¡£ç±»æˆ–å¯ç”¨äº†
%   \opt{heading} çš„ \pkg{ctex.sty} çš„æ—¶å€™æ‰æœ‰æ„ä¹‰ã€‚
% \end{function}
%
% \subsection{æŽ’ç‰ˆæ–¹æ¡ˆé€‰é¡¹}
% \label{subs:options-type-style}
%
% \begin{function}[rEXP,added=2015-04-15]{scheme}
%   \begin{syntax}
%     scheme = &lt;(chinese)|plain&gt;
%   \end{syntax}
%   é€‰æ‹©æ–‡ç«&nbsp;çš„æŽ’ç‰ˆæ–¹æ¡ˆï¼Œé¢„è®¾æœ‰ \opt{chinese} å’Œ \opt{plain} ä¸¤ç§æ–¹æ¡ˆã€‚
% \end{function}
%   \begin{optdesc}[itemsep=\medskipamount]
%     \item[chinese] å¯¹ \cls{beamer} ä»¥å¤–çš„æ–‡æ¡£ç±»ï¼Œè°ƒæ•´é»˜è®¤å­—å·ä¸ºäº”å·å­—ï¼Œå¹¶è°ƒ
%       æ•´è¡Œè·ä¸º |1.3|ï¼›æ±‰åŒ–æ–‡æ¡£ä¸­çš„æ&nbsp;‡é¢˜åå­—ï¼ˆå¦‚â€œå›¾â€ã€â€œè¡¨â€ã€â€œç›®å½•â€å’Œâ€œå‚
%       è€ƒæ–‡çŒ®â€ç­‰ï¼Œè§ \ref{subs:capname}~èŠ‚ï¼‰ï¼›
%       åœ¨ \opt{heading = true} çš„æƒ…å†µä¸‹^^A
%       \footnote{ä½¿ç”¨ \CTeX{} æ–‡æ¡£ç±»ï¼Œæˆ–è€…ä½¿ç”¨ \pkg{ctex} å®åŒ…ä¸”å¼€å¯è¯¥é€‰é¡¹æ—¶ã€‚}^^A
%       ï¼ˆ\ref{subs:options-heading}~èŠ‚ï¼‰ï¼Œè¿˜ä¼šå°†ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜çš„é£Žæ&nbsp;¼ä¿®æ”¹ä¸º
%       ä¸­æ–‡æ&nbsp;·å¼ï¼ˆè§ \ref{sec:secstyle}~èŠ‚ï¼‰ã€‚
%
%       å½“å…³é—­ \opt{heading} é€‰é¡¹çš„ \pkg{ctex} å®åŒ…ä¸Žæ&nbsp;‡å‡†æ–‡æ¡£ç±»æˆ–å…¶è¡ç”Ÿæ–‡æ¡£ç±»
%       è”ç”¨æ—¶ï¼Œä¼šè½½å…¥ \pkg{indentfirst} å®åŒ…ï¼Œä»¥å®žçŽ°ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜åŽçš„æ®µé¦–ç¼©è¿›ã€‚
%     \item[plain] ä¸è°ƒæ•´é»˜è®¤å­—å·å’Œè¡Œè·ï¼Œä¸ä¼šæ±‰åŒ–æ–‡æ¡£ä¸­çš„æ&nbsp;‡é¢˜åå­—ï¼Œä¹Ÿä¸ä¼šå°†ç«&nbsp;èŠ‚
%       æ&nbsp;‡é¢˜é£Žæ&nbsp;¼ä¿®æ”¹ä¸ºä¸­æ–‡æ&nbsp;·å¼ï¼ŒåŒæ—¶ä¸ä¼šè°ƒæ•´ \tn{pagestyle}ï¼Œå¹¶ç¦ç”¨ \opt{autoindent}
%       é€‰é¡¹ã€‚äº‹å®žä¸Šï¼Œæ­¤æ—¶çš„ \CTeX{} å®é›†åªæä¾›äº†ä¸­æ–‡æ”¯æŒåŠŸèƒ½ï¼Œè€Œä¸å¯¹æ–‡ç«&nbsp;ç‰ˆå¼è¿›è¡Œä»»ä½•ä¿®æ”¹ã€‚
%   \end{optdesc}
%
% \begin{function}[updated=2014-04-11]{punct}
%   \begin{syntax}
%     punct = &lt;(quanjiao)|banjiao|kaiming|CCT|plain&gt;
%   \end{syntax}
%   è®¾ç½®æ&nbsp;‡ç‚¹å¤„ç†æ&nbsp;¼å¼ã€‚é¢„å®šä¹‰å¥½çš„æ&nbsp;¼å¼æœ‰ï¼š
% \end{function}
%   \begin{optdesc}
%     \item[quanjiao] å…¨è§’å¼ï¼šæ‰€æœ‰æ&nbsp;‡ç‚¹å&nbsp;ä¸€ä¸ªæ±‰å­—å®½åº¦ï¼Œç›¸é‚»ä¸¤ä¸ªæ&nbsp;‡ç‚¹å&nbsp; 1.5 æ±‰å­—å®½åº¦ï¼›
%     \item[banjiao]  åŠè§’å¼ï¼šæ‰€æœ‰æ&nbsp;‡ç‚¹å&nbsp;åŠä¸ªæ±‰å­—å®½åº¦ï¼›
%     \item[kaiming]  å¼€æ˜Žå¼ï¼šå¥æœ«ç‚¹å·^^A
%       \footnote{æ&nbsp;‡ç‚¹ç¬¦å·åˆ†ä¸ºæ&nbsp;‡å·ä¸Žç‚¹å·ã€‚ç‚¹å·åˆ†ä¸ºä¸¤ç±»ï¼Œä¸€å…±ä¸ƒç§ï¼šå¥æœ«ç‚¹å·æœ‰^^A
%       å¥å·ã€é—®å·å’Œå¹å·ï¼›å¥å†…ç‚¹å·æœ‰é€—å·ã€é¡¿å·ã€å†’å·å’Œåˆ†å·ã€‚}ç”¨å&nbsp;ä¸€ä¸ªæ±‰å­—å®½åº¦ï¼Œæ&nbsp;‡^^A
%       å·å’Œå¥å†…ç‚¹å·å&nbsp;åŠä¸ªæ±‰å­—å®½åº¦ï¼›
%     \item[CCT]   CCT å¼ï¼šæ‰€æœ‰æ&nbsp;‡ç‚¹ç¬¦å·çš„å®½åº¦ç•¥å°äºŽä¸€ä¸ªæ±‰å­—å®½åº¦ï¼›
%     \item[plain] åŽŸæ&nbsp;·ï¼ˆä¸è°ƒæ•´æ&nbsp;‡ç‚¹é—´è·ï¼‰ã€‚
%   \end{optdesc}
%
% \begin{function}[updated=2014-03-08]{space}
%   \begin{syntax}
%     space = &lt;\TF|(auto)&gt;
%   \end{syntax}
%   æ˜¯å¦åœ¨ç”Ÿæˆçš„ PDF ä¸­ä¿ç•™æ±‰å­—åŽé¢çš„ç©ºæ&nbsp;¼ã€‚è¯¥é€‰é¡¹ä»…åœ¨ä½¿ç”¨ \XeLaTeX{}/(pdf)\LaTeX{} ç¼–è¯‘æ—¶æœ‰æ•ˆã€‚
% \end{function}
%
% \begin{optdesc}
%   \item[true] æ€»æ˜¯ä¿ç•™æ±‰å­—åŽçš„ç©ºæ&nbsp;¼ã€‚æ­¤æ—¶ï¼Œç”¨æˆ·éœ€è¦è‡ªè¡Œåœ¨è¡Œå°¾åŠ&nbsp;ä¸Š~|%|~å¤„ç†æ¢è¡Œäº§ç”Ÿ
%     çš„ç©ºæ&nbsp;¼\footnote{\LaTeX{} å°†å•ä¸ªæ¢è¡Œè§†ä½œä¸€ä¸ªç©ºæ&nbsp;¼ã€‚}ã€‚
%   \item[false] ä½¿ç”¨ (pdf)\LaTeX{} ç¼–è¯‘æ—¶ï¼šæ€»æ˜¯å¿½ç•¥æŽ‰æ±‰å­—åŽé¢çš„ç©ºæ&nbsp;¼ï¼Œä¸è®ºæ±‰å­—åŽæ˜¯ä»€ä¹ˆï¼›
%     ä½¿ç”¨ \XeLaTeX{} ç¼–è¯‘æ—¶ï¼Œç­‰åŒäºŽ \opt{auto} çš„æ•ˆæžœã€‚ä¸å»ºè®®ä½¿ç”¨è¯¥é€‰é¡¹ã€‚
%   \item[auto] æ&nbsp;¹æ®ç©ºæ&nbsp;¼åŽé¢çš„æƒ…å†µå†³å®šæ˜¯å¦ä¿ç•™ï¼šå¦‚æžœç©ºæ&nbsp;¼åŽé¢æ˜¯æ±‰å­—ï¼Œåˆ™å¿½ç•¥è¯¥
%   ç©ºæ&nbsp;¼ï¼Œå¦åˆ™ä¿ç•™ã€‚
% \end{optdesc}
%
%   ä¾‹å¦‚ï¼Œä½¿ç”¨
%   \begin{ctexexam}
%   \ctexset{space=true}
%   æ±‰å­— åˆ†è¯
%   æŠ€æœ¯ English
%   \end{ctexexam}
%   å°†å¾—åˆ°â€œ{\ctexset{space=true}æ±‰å­— åˆ†è¯ æŠ€æœ¯ English}â€ï¼›ä½¿ç”¨
%   \begin{ctexexam}
%   \ctexset{space=auto}
%   æ±‰å­— åˆ†è¯
%   æŠ€æœ¯ English
%   \end{ctexexam}
%   åˆ™ä¼šå¾—åˆ°â€œ{\ctexset{space=auto}æ±‰å­— åˆ†è¯ æŠ€æœ¯ English}â€ã€‚
%
% \emph{ä½¿ç”¨ \textup{\LuaLaTeX{} åŠ \upLaTeX} ç¼–è¯‘çš„æ—¶å€™ï¼Œè¯¥é€‰é¡¹æ—&nbsp;æ•ˆï¼šæ±‰å­—é—´çš„
% ç©ºæ&nbsp;¼ä»¥åŠæ±‰å­—ä¸Žè¥¿æ–‡å­—ç¬¦ä¹‹é—´çš„ç©ºæ&nbsp;¼æ€»æ˜¯æœ‰æ•ˆï¼Œä¸ä¼šè¢«å¿½ç•¥ï¼Œä½†å¯ä»¥è‡ªåŠ¨å¿½ç•¥æŽ‰ç”±æ¢è¡Œ
% äº§ç”Ÿçš„ç©ºæ&nbsp;¼ã€‚}
%
% \begin{function}[rEXP,added=2014-04-23]{linespread}
%   \begin{syntax}
%     linespread = &lt;æ•°å€¼&gt;
%   \end{syntax}
%   æŽ¥å—ä¸€ä¸ªæµ®ç‚¹æ•°å€¼ï¼Œè®¾ç½®è¡Œè·å€æ•°ã€‚æœ¬é€‰é¡¹çš„åˆå§‹å€¼ä¸Ž \opt{scheme} æœ‰å…³ã€‚
% \end{function}
% \begin{optdesc}
%   \item[scheme = chinese] å¯¹æ&nbsp;‡å‡†æ–‡æ¡£ç±»åˆå§‹å€¼ä¸º $1.3$ï¼Œå³ $1.3$ å€è¡Œè·ã€‚æ­¤
%   æ—¶ï¼Œç›¸é‚»ä¸¤è¡Œçš„åŸºçº¿ï¼ˆ\tn{baselineskip}ï¼‰è·ç¦»ä¸º $1.3\times 1.2=1.56$ å€å­—ä½“
%   é«˜åº¦ã€‚å¯¹ \cls{beamer} ä¸æ”¹å˜è¡Œè·ï¼Œå³ä½¿ç”¨é»˜è®¤çš„å•å€è¡Œè·ã€‚
%
%   \item[scheme = plain] \CTeX{} å®é›†é»˜è®¤ä¸è°ƒæ•´è¡Œè·å€æ•°ï¼Œæ–‡æ¡£ä¸­çš„è¡Œè·ç”±æ‰€é€‰æ–‡æ¡£ç±»å’Œ
%   å…¶ä»–å®åŒ…æˆ–ç”¨æˆ·è®¾ç½®å†³å®šã€‚
% \end{optdesc}
%
% \begin{function}[added=2014-03-13]{autoindent}
%   \begin{syntax}
%     autoindent = &lt;\TTF|æ•°å€¼|å¸¦å•ä½çš„æ•°å€¼&gt;
%   \end{syntax}
%   åœ¨å­—ä½“å¤§å°å‘ç”Ÿå˜åŒ–æ—¶ï¼Œæ˜¯å¦è‡ªåŠ¨è°ƒæ•´æ®µé¦–ç¼©è¿›ï¼ˆ\tn{parindent}ï¼‰çš„å¤§å°ã€‚
% \end{function}
% \begin{optdesc}
%   \item[\meta{æ•°å€¼æˆ–å¸¦å•ä½çš„æ•°å€¼}] ç”¨äºŽè®¾ç½®æ®µé¦–ç¼©è¿›çš„é•¿åº¦ã€‚å¦‚æžœä¸å¸¦å•ä½ï¼Œåˆ™é»˜è®¤
%   å•ä½æ˜¯å•ä¸ªæ±‰å­—å­—å®½ \tn{ccwd}ï¼›å¦‚æžœå¸¦å•ä½ï¼Œåˆ™ä½¿ç”¨è¯¥å•ä½ã€‚
%   è‹¥è¦æ˜¾å¼ä½¿ç”¨ \tn{ccwd} ä¸ºå•ä½ï¼Œåˆ™å¿…é¡»åœ¨å¯¼è¨€åŒºè¿›è¡Œè®¾ç½®ã€‚
%
%   \item[true] ç­‰ä»·äºŽè®¾ç½® \opt{autoindent = 2} æˆ–
%   åœ¨å¯¼è¨€åŒºè®¾ç½® \opt{autoindent = 2\tn{ccwd}}ã€‚
%
%   \item[false] ç¦ç”¨è‡ªåŠ¨è°ƒæ•´åŠŸèƒ½ï¼Œå¯ä»¥è®¾ç½®å›ºå®šé•¿åº¦çš„æ®µé¦–ç¼©è¿›ã€‚å¦‚è®¾ç½®æ¯æ®µç¼©è¿› 40 ç‚¹ï¼š
%   \begin{ctexexam}
%   \ctexset{autoindent=false}
%   \setlength\parindent{40pt}
%   \end{ctexexam}
% \end{optdesc}
%
% \begin{function}[EXP,added=2014-03-26]{linestretch}
%   \begin{syntax}
%     linestretch = &lt;æ•°å€¼æˆ–é•¿åº¦&gt;
%   \end{syntax}
%   \opt{linestretch} æ˜¯ä¸€ä¸ªæ¯”è¾ƒç‰¹æ®Šçš„é€‰é¡¹ï¼Œå®ƒç”¨æ¥è®¾ç½®æ±‰å­—ä¹‹é—´å¼¹æ€§é—´è·çš„å¼¹æ€§ç¨‹
%   åº¦ã€‚å¦‚æžœæœ‰å•ä½ï¼Œåˆ™å¯ä»¥åœ¨é€‰é¡¹ä¸­ç›´æŽ¥å†™ï¼›å¦‚æžœæ˜¯æ•°å­—ï¼Œå•ä½åˆ™æ˜¯æ±‰å­—å®½åº¦
%   \tn{ccwd} çš„å€æ•°ã€‚
% \end{function}
%
%   å¦‚æžœè¡Œå®½ä¸æ˜¯æ±‰å­—å®½åº¦çš„æ•´æ•°å€ï¼Œä¸ºäº†è®©æ®µè½å·¦å³ä¸¤ç«¯å¯¹é½ï¼Œè‡ªç„¶å°±è¦æ±‚ä¼¸å±•æ±‰å­—ä¹‹
%   é—´çš„é—´è·ï¼Œè€Œ \opt{linestretch} é€‰é¡¹å°±æ˜¯è®¾ç½®æ¯è¡Œæ€»çš„å…è®¸ä¼¸è¡Œé‡ã€‚åˆå§‹å€¼æ˜¯å…
%   è®¸æ¯è¡Œä¼¸è¡Œä¸€ä¸ªæ±‰å­—çš„å®½åº¦ \tn{ccwd}ï¼Œå¹¶ä¸”æ­¤å®½åº¦èƒ½æ&nbsp;¹æ®å­—å·å˜åŒ–åŠ¨æ€è°ƒæ•´ã€‚
%
%   è¿‡å°çš„ \opt{linestretch} å¯èƒ½å¯¼è‡´æ®µè½æ–‡å­—å³ä¾§å¯èƒ½å‚å·®ä¸é½ï¼›è¾ƒå¤§çš„
%   \opt{linestretch} é€‰é¡¹åˆ™å¯ä»¥å¸®åŠ©æ‹¥æœ‰è¾ƒé•¿ä¸å¯æ–­è¡Œå†…å®¹çš„å¤æ‚æ®µè½æ–¹ä¾¿åœ°æ–­è¡Œï¼Œ
%   è€Œä¸ä¼šäº§ç”Ÿå¤§é‡ç¼–è¯‘è­¦å‘Šï¼›ä½†å¾ˆå¤§çš„ \opt{linestretch} åˆ™ä¼šæŽ©ç›–æ®µè½ä¸è‰¯æ–­è¡Œäº§
%   ç”Ÿçš„åç›’å­è­¦å‘Šã€‚
%
%   å¦‚æžœå°† \opt{linestretch} é€‰é¡¹çš„å€¼è®¾ç½®ä¸º \tn{maxdimen}ï¼Œåˆ™å¯ä»¥ç¦æ­¢æŒ‰å­—å·è‡ª
%   åŠ¨ä¿®æ”¹æ¯è¡Œçš„å…è®¸ä¼¸é•¿é‡ã€‚æ­¤æ—¶æ±‰å­—é—´çš„å¼¹æ€§é—´è·åˆ™å›ºå®šä¸º \tn{baselineskip} çš„
%   $0.08$ å€ã€‚
%
% \section{æ–‡æ¡£æ±‰åŒ–}
% \label{sec:chinese-localization}
% \subsection{æ—¥æœŸæ±‰åŒ–}
%
% \CTeX å®åŒ…å¯¹æ˜¾ç¤ºå½“å‰æ—¥æœŸçš„ \tn{today} å‘½ä»¤è¿›è¡Œäº†æ±‰åŒ–ï¼Œä½¿ä¹‹ä»¥ä¸­æ–‡çš„æ–¹å¼æ˜¾ç¤ºä»Š
% å¤©çš„æ—¥æœŸã€‚å¦‚æœ¬æ–‡æ¡£ç¼–è¯‘æ—¶çš„æ—¥æœŸæ˜¯â€œ\todayâ€ã€‚
%
% \begin{function}[EXP]{today}
%   \begin{syntax}
%     today = &lt;(small)|big|old&gt;
%   \end{syntax}
% è¯¥é€‰é¡¹ç”¨æ¥æŽ§åˆ¶ \tn{today} å‘½ä»¤çš„è¾“å‡ºæ&nbsp;¼å¼ï¼š
% \begin{optdesc}
%   \item[small] \ctexset{today=small}
%     æ•ˆæžœä¸ºâ€œ\todayâ€ã€‚ä½¿ç”¨é˜¿æ‹‰ä¼¯æ•°å­—å’Œæ±‰å­—çš„æ—¥æœŸæ&nbsp;¼å¼ã€‚
%   \item[big] \ctexset{today=big}
%     æ•ˆæžœä¸ºâ€œ\todayâ€ã€‚ä½¿ç”¨å…¨æ±‰å­—çš„æ—¥æœŸæ&nbsp;¼å¼ã€‚
%   \item[old] \ctexset{today=old}
%     æ•ˆæžœä¸ºâ€œ\todayâ€ã€‚ä½¿ç”¨æ–‡æ¡£åŽŸæ¥çš„ï¼ˆè‹±æ–‡ï¼‰æ—¥æœŸæ&nbsp;¼å¼ã€‚
%     \ctexset{today=small}  ^^A NOTE(Liam): å¤åŽŸè®¾å®šæ˜¯å¥½ä¹&nbsp;æƒ¯ã€‚
% \end{optdesc}
% \end{function}
%
% è®¾ç½®æ—¥æœŸæ&nbsp;¼å¼ä½¿ç”¨ \tn{ctexset} å‘½ä»¤å®Œæˆï¼Œä¾‹å¦‚è®¾ç½®å…¨æ±‰å­—çš„æ—¥æœŸæ&nbsp;¼å¼ï¼š
% \begin{ctexexam}
%   \ctexset{today=big}
% \end{ctexexam}
%
% \CTeX å®åŒ…çš„ä¸­æ–‡æ—¥æœŸåŠŸèƒ½å®žé™…ä¸Šæ˜¯è°ƒç”¨ \pkg{zhnumber} å®åŒ…å®Œæˆçš„ã€‚å¦‚æžœéœ€è¦æ›´
% å¤šæœ‰å…³æ—¥æœŸã€æ—¶é—´çš„å‘½ä»¤å’Œæ›´å¤æ‚çš„è®¾ç½®ï¼Œå¯ä»¥æŸ¥é˜… \pkg{zhnumber} å®åŒ…çš„æ–‡æ¡£ã€‚
%
% \subsection{æ–‡æ¡£æ&nbsp;‡é¢˜æ±‰åŒ–}
% \label{subs:capname}
%
% è¿™é‡Œä¸»è¦ä»‹ç»ç”± \opt{scheme} é€‰é¡¹ï¼ˆ\ref{subs:options-type-style}~èŠ‚ï¼‰æŽ§åˆ¶
% çš„æ–‡æ¡£æ&nbsp;‡é¢˜æ±‰åŒ–åŠŸèƒ½ã€‚
%
% è®¾ç½®æ–‡æ¡£æ&nbsp;‡é¢˜åçš„ç¤ºä¾‹å¯è§ä¾‹~\ref{exam:capname}ã€‚ä¸‹é¢çš„é€‰é¡¹ï¼ˆå¦‚
% \opt{contentsname}ï¼‰ä¸»è¦ç”¨æ¥é‡æ–°å®šä¹‰ä¸Žé€‰é¡¹åŒåçš„å®ï¼ˆå¦‚ \tn{contentsname}ï¼‰çš„
% å®šä¹‰ã€‚
%
% \begin{defaultcapconfig}
%
% \begin{function}[EXP]{contentsname}
%   \begin{syntax}
%     contentsname = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½®ç›®å½•æ&nbsp;‡é¢˜å \tn{contentsname}ã€‚ä¸­æ–‡é»˜è®¤ä¸ºâ€œ\contentsnameâ€ã€‚
% \end{function}
%
% \begin{function}[EXP]{listfigurename}
%   \begin{syntax}
%     listfigurename = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½®æ’å›¾ç›®å½•æ&nbsp;‡é¢˜å \tn{listfigurename}ã€‚ä¸­æ–‡é»˜è®¤ä¸ºâ€œ\listfigurenameâ€ã€‚
% \end{function}
%
% \begin{function}[EXP]{listtablename}
%   \begin{syntax}
%     listtablename = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½®è¡¨æ&nbsp;¼ç›®å½•æ&nbsp;‡é¢˜å \tn{listtablename}ã€‚ä¸­æ–‡é»˜è®¤ä¸ºâ€œ\listtablenameâ€ã€‚
% \end{function}
%
% \begin{function}[EXP]{figurename}
%   \begin{syntax}
%     figurename = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½®å›¾ç‰‡çŽ¯å¢ƒæ&nbsp;‡é¢˜å \tn{figurename}ã€‚ä¸­æ–‡é»˜è®¤ä¸ºâ€œ\figurenameâ€ã€‚
% \end{function}
%
% \begin{function}[EXP]{tablename}
%   \begin{syntax}
%     tablename = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½®è¡¨æ&nbsp;¼çŽ¯å¢ƒæ&nbsp;‡é¢˜å \tn{tablename}ã€‚ä¸­æ–‡é»˜è®¤ä¸ºâ€œ\tablenameâ€ã€‚
% \end{function}
%
% \begin{function}[EXP]{abstractname}
%   \begin{syntax}
%     abstractname = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½®æ‘˜è¦ \env{abstract} çŽ¯å¢ƒæ&nbsp;‡é¢˜å \tn{abstractname}ã€‚ä¸­æ–‡é»˜è®¤
% ä¸ºâ€œ\abstractnameâ€ã€‚æ³¨æ„ \cls{book} ç±»æ²¡æœ‰æ‘˜è¦ï¼Œè¯¥é€‰é¡¹æ—&nbsp;æ•ˆã€‚
% \end{function}
%
% \begin{function}[EXP]{indexname}
%   \begin{syntax}
%     indexname = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½®ç´¢å¼•æ&nbsp;‡é¢˜å \tn{indexname}ã€‚ä¸­æ–‡é»˜è®¤ä¸ºâ€œ\indexnameâ€ã€‚
% \end{function}
%
% \begin{function}[EXP]{appendixname}
%   \begin{syntax}
%     appendixname = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½®é™„å½•æ&nbsp;‡é¢˜å \tn{appendixname}ã€‚ä¸­æ–‡é»˜è®¤ä¸ºâ€œ\appendixnameâ€ã€‚
% \end{function}
%
% \begin{function}[EXP]{bibname}
%   \begin{syntax}
%     bibname = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½®å‚è€ƒæ–‡çŒ®æ&nbsp;‡é¢˜åã€‚ä¸­æ–‡é»˜è®¤ä¸ºâ€œ\refnameâ€ã€‚
%
% åœ¨æ&nbsp;‡å‡†æ–‡æ¡£ç±»ä¸­ \cls{article} çš„å‚è€ƒæ–‡çŒ®åä½¿ç”¨å® \tn{refname}ï¼Œè€Œ
% \cls{book} å’Œ \cls{report} ä½¿ç”¨å® \tn{bibname}ã€‚æœ¬é€‰é¡¹ä¼šæ&nbsp;¹æ®æ&nbsp;‡å‡†æ–‡æ¡£ç±»çš„ä¸åŒï¼Œè‡ªåŠ¨
% è®¾å®š \tn{refname} æˆ–æ˜¯ \tn{bibname}ã€‚å›&nbsp;æ­¤ï¼Œå¯¹äºŽæ&nbsp;‡å‡†æ–‡æ¡£ç±»åŠå¯¹åº”çš„ \CTeX{} æ–‡æ¡£ç±»
% å¯ä»¥ç»Ÿä¸€åœ°ä½¿ç”¨ \opt{bibname} é€‰é¡¹æ¥æŽ§åˆ¶å‚è€ƒæ–‡çŒ®æ&nbsp;‡é¢˜åã€‚
%
% å¯¹äºŽ \cls{beamer} åŠå¯¹åº”çš„ \cls{ctexbeamer} æ¥è¯´ï¼Œå®ƒä»¬åŒæ—¶å…·æœ‰å® \tn{bibname} å’Œ
% å® \tn{refname}ã€‚æœ¬é€‰é¡¹ä»…æŽ§åˆ¶å…¶ä¸­çš„ \tn{bibname}ï¼›
% \tn{refname} åˆ™äº¤ç”± \opt{refname} é€‰é¡¹æŽ§åˆ¶ã€‚
% \end{function}
%
% \begin{function}[EXP]{proofname}
%   \begin{syntax}
%     proofname = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½®è¯æ˜ŽçŽ¯å¢ƒçš„åç§° \tn{proofname}ã€‚ä¸­æ–‡é»˜è®¤ä¸ºâ€œ\proofnameâ€ã€‚
% \end{function}
%
% å¦‚æžœä½¿ç”¨ \cls{ctexbeamer} æ–‡æ¡£ç±»æˆ–è€…åœ¨ \cls{beamer} æ–‡æ¡£ç±»ä¸‹ä½¿ç”¨ \pkg{ctex} åŒ…ï¼Œ
% è¿˜ä¼šæ±‰åŒ–å¸¸ç”¨å®šç†ç±»çŽ¯å¢ƒçš„è¯¸å¦‚â€œå®šä¹‰â€ã€â€œå®šç†â€å’Œâ€œå¼•ç†â€ç­‰åç§°ã€‚æ­¤æ—¶ï¼Œè¿˜æœ‰ä¸‹åˆ—
% ä¸‰ä¸ªé€‰é¡¹ã€‚
%
% \begin{function}[EXP]{refname}
%   \begin{syntax}
%     refname = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½®å‚è€ƒæ–‡çŒ®æ&nbsp;‡é¢˜å \tn{refname}ã€‚ä¸­æ–‡é»˜è®¤ä¸ºâ€œ\refnameâ€ã€‚
%
% æ³¨æ„ï¼Œä¸‰ä¸ªæ&nbsp;‡å‡†æ–‡æ¡£ç±»ï¼ˆåŠç›¸åº”çš„ \CTeX{} æ–‡æ¡£ç±»ï¼‰çš„å‚è€ƒæ–‡çŒ®æ&nbsp;‡é¢˜åç”± \opt{bibname} é€‰é¡¹
% ç»Ÿä¸€è®¾ç½®ï¼Œæœ¬é€‰é¡¹ä»…é€‚ç”¨äºŽ \cls{beamer} åŠå…¶å¯¹åº”çš„ \cls{ctexbeamer}ã€‚
% åœ¨ä¸‰ä¸ªæ&nbsp;‡å‡†æ–‡æ¡£ç±»ï¼ˆåŠç›¸åº”çš„ \CTeX{} æ–‡æ¡£ç±»ï¼‰ä¸­ä½¿ç”¨ \opt{refname} é€‰é¡¹ä¼šæŠ¥é”™ã€‚
% \end{function}
%
% \begin{function}[EXP]{algorithmname}
%   \begin{syntax}
%     algorithmname = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½®ç®—æ³•çŽ¯å¢ƒæ&nbsp;‡é¢˜å \tn{algorithmname}ã€‚ä¸­æ–‡é»˜è®¤ä¸ºâ€œç®—æ³•â€ã€‚
% \end{function}
%
% \begin{function}[EXP]{continuation}
%   \begin{syntax}
%     continuation = &lt;åå­—&gt;
%   \end{syntax}
% è®¾ç½® \cls{beamer} å¯æ–­é¡µçš„å¸§åœ¨ç»­é¡µæ&nbsp;‡é¢˜ä¸­çš„å»¶ç»­æ&nbsp;‡è¯† \tn{insertcontinuationtext}ã€‚
% ä¸­æ–‡é»˜è®¤ä¸ºâ€œï¼ˆç»­ï¼‰â€ã€‚
% \end{function}
%
% \end{defaultcapconfig}
%
% \subsection{é¡µé¢æ&nbsp;¼å¼è®¾ç½®ä¸Žæ±‰åŒ–}
% \label{subs:pagestyle}
%
% é¡µé¢æ&nbsp;¼å¼è®¾ç½®ä¸Žæ±‰åŒ–çš„åŠŸèƒ½ï¼ˆåŠç«&nbsp;èŠ‚æ&nbsp;‡é¢˜æ&nbsp;·å¼è®¾ç½®åŠŸèƒ½ï¼Œè§ç¬¬ \ref{sec:secstyle} èŠ‚ï¼‰^^A
% ç”± \pkg{ctexheading} å®åŒ…å®Œæˆã€‚åŠ&nbsp;è½½è¯¥å®åŒ…æ—¶ï¼Œæˆ–è€…ä½¿ç”¨ \CTeX{} æ–‡æ¡£ç±»æ—¶ï¼Œ^^A
% æˆ–è€…æ˜¯ä½¿ç”¨ \pkg{ctex} å®åŒ…å¹¶è®¾å®šé€‰é¡¹ \opt{heading = true} æ—¶ï¼Œç›¸å…³åŠŸèƒ½è¢«æ¿€æ´»ã€‚
% æ­¤æ—¶ï¼Œæ•´ä¸ªæ–‡æ¡£çš„é¡µé¢æ&nbsp;¼å¼ï¼ˆpage styleï¼‰è¢«è®¾å®šä¸º |headings|ï¼Œå³ç›¸å½“äºŽè®¾ç½®äº†
% \begin{frameverb}
%   \pagestyle{headings}
% \end{frameverb}
% åœ¨é¡µçœ‰ä¸­æ˜¾ç¤ºå½“å‰ç«&nbsp;èŠ‚çš„ç¼–å·ä¸Žæ&nbsp;‡é¢˜ã€‚
%
% åŒæ—¶ï¼Œ\CTeX å®åŒ…ä¹Ÿä¼šå¯¹é»˜è®¤çš„ |headings| é¡µé¢æ&nbsp;¼å¼è¿›è¡Œä¿®æ”¹ï¼Œä½¿ä¹‹è°ƒç”¨
% \tn{CTEXthechapter}ã€\tn{CTEXthesection} ç­‰å®æ¥æ­£ç¡®æ˜¾ç¤ºä¸­æ–‡çš„ç«&nbsp;èŠ‚ç¼–å·ã€‚
%
% \CTeX å®åŒ…çš„é»˜è®¤é¡µé¢æ&nbsp;¼å¼è®¾ç½®æ˜¯ç»è¿‡æ±‰åŒ–çš„ |headings|ï¼Œå…¶åŸºæœ¬æ•ˆæžœå¦‚æœ¬æ–‡æ¡£æ‰€
% ç¤ºï¼Œåªåœ¨é¡µçœ‰ä¸€ä¾§æ˜¾ç¤ºç«&nbsp;èŠ‚ç¼–å·å’Œæ&nbsp;‡é¢˜ï¼Œå¦ä¸€ä¾§æ˜¾ç¤ºé¡µç&nbsp;ã€‚
%
% æ›´å¤æ‚çš„é¡µé¢æ&nbsp;¼å¼å¯ä»¥é€šè¿‡è°ƒç”¨ \pkg{fancyhdr}ã€\pkg{titleps} ç­‰å®åŒ…æ¥è®¾
% ç½®ã€‚\CTeX å®åŒ…åŒæ—¶ä¹Ÿä¸ºè¿™äº›è‡ªå®šä¹‰é¡µé¢æ&nbsp;¼å¼
% çš„åŒ…æä¾›äº†ä»¥ä¸‹å®ä¾›ä½¿ç”¨ï¼š
% \begin{itemize}
% \item \tn{CTEXthechapter}ã€\tn{CTEXthesection} ç­‰ç«&nbsp;èŠ‚ç¼–å·ï¼ˆè§
% \ref{subsec:sec-commands}~å°èŠ‚ï¼‰ã€‚å®ƒä»¬ç”¨æ¥ä»£æ›¿è‹±æ–‡æ–‡æ¡£ç±»ä¸­çš„
% \tn{thechapter}ã€\tn{thesection} ç­‰å®ã€‚
%
% \item \tn{leftmark}ã€\tn{rightmark}ï¼Œå®ƒä»¬æ˜¯åœ¨ä½¿ç”¨ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜å‘½ä»¤åŽï¼Œè‡ªåŠ¨è®¾ç½®çš„
% å®ã€‚å®ƒä»¬å®žé™…æ˜¯åœ¨ä¸Žç«&nbsp;èŠ‚æ&nbsp;‡é¢˜å‘½ä»¤å¯¹åº”çš„æ&nbsp;‡è®°å‘½ä»¤
% \tn{chaptermark}ã€\tn{sectionmark} ä¸­è°ƒç”¨ \tn{markright} æˆ– \tn{markboth} ç”Ÿ
% æˆçš„ã€‚
% \end{itemize}
% æœ‰å…³ \LaTeX é¡µé¢æ&nbsp;‡è®°çš„å«ä¹‰ä¸Žä½¿ç”¨ç»†èŠ‚ï¼Œå·²ç»è¶…å‡ºäº†æœ¬æ–‡æ¡£è®¨è®ºçš„èŒƒå›´ã€‚å¯ä»¥å‚è€ƒ
% \cite[Chapter~23]{knuthtex1986}ã€\cite[\S4.3, \S4.4]{mittelbach2004} ç­‰ä¹¦ç±ã€‚
%
% è¿™é‡Œä¸¾ä¸€ä¸ªä¾‹å­ï¼Œè¯´æ˜Žé€šè¿‡é‡å®šä¹‰ \tn{sectionmark}ï¼Œåœ¨ \cls{ctexart} æ–‡æ¡£ç±»ä¸­çš„
% æ&nbsp;‡å‡† |headings| é¡µé¢æ&nbsp;¼å¼ä¸‹æŽ§åˆ¶é¡µçœ‰çš„æ–¹å¼ï¼š
% \begin{ctexexam}
%   \documentclass{ctexart}
%   \pagestyle{headings}
%   \ctexset{section={
%       name={ç¬¬,èŠ‚},
%       number=\arabic{section},
%     }
%   }
%   \renewcommand\sectionmark[1]{%
%     \markright{\CTEXifname{\CTEXthesectionâ€”â€”}{}#1}}
%
%   \begin{document}
%
%   \section{å¤©åœ°çŽ„é»„}
%   \newpage
%
%   \section{å®‡å®™æ´ªè’}
%
%   \end{document}
% \end{ctexexam}
% åœ¨ä¸Šä¾‹ä¸­ï¼Œæˆ‘ä»¬è®¾ç½®äº†é¡µçœ‰çš„å½¢å¼æ˜¯ç”¨ç&nbsp;´æŠ˜å·åˆ†å¼€çš„èŠ‚ç¼–å·ä¸ŽèŠ‚æ&nbsp;‡é¢˜ï¼Œå³â€œç¬¬ 1 èŠ‚
% â€”â€”å¤©åœ°çŽ„é»„â€ã€â€œç¬¬ 2 èŠ‚â€”â€”å®‡å®™æ´ªè’â€ã€‚
%
% \CTeX å®åŒ…å·²ç»å¯¹ \pkg{fancyhdr} å®åŒ…è¿›è¡Œäº†è¡¥ä¸ï¼Œè½½å…¥ \pkg{fancyhdr} åŽï¼Œå…¶
% |fancy| é¡µé¢æ&nbsp;¼å¼å°†ä½¿ç”¨ \tn{CTEXthechapter} ç­‰å®æ˜¾ç¤ºä¸­æ–‡ç«&nbsp;èŠ‚ç¼–å·ã€‚
%
% å…³äºŽ \pkg{fancyhdr} çš„å…·ä½“ç”¨æ³•å¯ä»¥å‚è§å…¶å®åŒ…æ‰‹å†Œã€‚é€šå¸¸ä¹Ÿåªè¦åƒåœ¨æ&nbsp;‡å‡†çš„è‹±æ–‡æ–‡
% æ¡£ç±»ä¸­ä½¿ç”¨ \pkg{fancyhdr} ä¸€æ&nbsp;·å®šä¹‰é¡µçœ‰é¡µè„šæ&nbsp;¼å¼å³å¯ï¼Œå¹¶ä¸éœ€è¦é¢å¤–çš„å®šä¹‰ã€‚
%
% ä¸‹é¢æˆ‘åˆ™ç»™å‡ºä¸€ä¸ªä¸Žå‰ä¾‹ç±»ä¼¼è€Œç¨å¤æ‚çš„ä¾‹å­ï¼Œå±•ç¤ºå¦‚ä½•åœ¨æ–‡æ¡£ä¸­è®¾ç½®é¡µçœ‰å†…å®¹ä¸Žé¡µçœ‰
% çš„æ&nbsp;¼å¼ã€‚
% \begin{ctexexam}
%   \documentclass{ctexart}
%   \ctexset{section={
%       name={ç¬¬,èŠ‚},
%       number=\arabic{section},
%     }
%   }
%   \usepackage{fancyhdr}
%   \fancyhf{}
%   \lhead{\textnormal{\kaishu\rightmark}}
%   \rhead{--\ \thepage\ --}
%   \pagestyle{fancy}
%   % \sectionmark çš„é‡å®šä¹‰éœ€è¦åœ¨ \pagestyle ä¹‹åŽç”Ÿæ•ˆ
%   \renewcommand\sectionmark[1]{%
%     \markright{\CTEXifname{\CTEXthesectionâ€”â€”}{}#1}}
%
%   \begin{document}
%
%   \section{å¤©åœ°çŽ„é»„}
%   \newpage
%
%   \section{å®‡å®™æ´ªè’}
%
%   \end{document}
% \end{ctexexam}
% æœ¬ä¾‹çš„é¡µçœ‰æ•ˆæžœå¤§è‡´å¦‚ä¸‹ï¼ˆæœ‰é¡µçœ‰çº¿ï¼‰ï¼š
% \begin{trivlist}\item
% \textnormal{\kaishu ç¬¬ 1 èŠ‚â€”â€”å¤©åœ°çŽ„é»„}\hfill -- 1 --\par
% \smallskip\hrule
% \end{trivlist}
%
% \section{ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜æ&nbsp;·å¼è®¾ç½®}
% \label{sec:secstyle}
%
% \CTeX{} å®é›†å¯¹ \LaTeX{} çš„æ&nbsp;‡å‡†æ–‡æ¡£ç±»ï¼ˆ\cls{article}ã€\cls{report}ã€
% \cls{book}ï¼‰å’Œ \cls{beamer} è¿›è¡Œäº†ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜æ&nbsp;·å¼è®¾ç½®åŠŸèƒ½çš„æ‰©å……ã€‚
% ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜æ&nbsp;·å¼è®¾ç½®åŠŸèƒ½ï¼ˆåŠé¡µé¢æ&nbsp;¼å¼è®¾ç½®ä¸Žæ±‰åŒ–åŠŸèƒ½ï¼Œè§ç¬¬ \ref{subs:pagestyle} èŠ‚ï¼‰^^A
% ç”± \pkg{ctexheading} å®åŒ…å®Œæˆã€‚åŠ&nbsp;è½½è¯¥å®åŒ…æ—¶ï¼Œæˆ–è€…ä½¿ç”¨ \CTeX{} æ–‡æ¡£ç±»æ—¶ï¼Œ^^A
% æˆ–è€…æ˜¯ä½¿ç”¨ \pkg{ctex} å®åŒ…å¹¶è®¾å®šé€‰é¡¹ \opt{heading = true} æ—¶ï¼Œç›¸å…³åŠŸèƒ½è¢«æ¿€æ´»ã€‚
% å…¶ä¸­ï¼Œç‹¬ç«‹ä½¿ç”¨ \pkg{ctexheading} å®åŒ…æ—¶ï¼Œæœ¬èŠ‚ä»‹ç»å„é€‰é¡¹çš„é»˜è®¤å€¼ä¸ŽæŒ‡å®š
% \opt{scheme = plain} æ—¶ç›¸åŒã€‚
%
% æœ¬èŠ‚æ¶‰åŠçš„æ‰€æœ‰é€‰é¡¹å‡éœ€ä½¿ç”¨ \tn{ctexset} å‘½ä»¤è®¾ç½®ã€‚
%
% \changes{v2.0}{2015/03/21}{\tn{CTEXsetup}, \tn{CTEXoptions} æ˜¯è¿‡æ—¶å‘½ä»¤ã€‚}
%
% ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜çš„æ&nbsp;·å¼é€‰é¡¹æ˜¯åˆ†å±‚è®¾ç½®çš„ã€‚é¡¶å±‚çš„é€‰é¡¹æ˜¯ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜åç§°ï¼ˆä¾‹å¦‚ |section|)ï¼Œ
% æ¬¡ä¸€å±‚çš„é€‰é¡¹æ˜¯ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜çš„æ&nbsp;·å¼ï¼ˆä¾‹å¦‚ \opt{nameformat}ï¼‰ã€‚ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜åç§°åŒ…æ‹¬
% |part|, |chapter|, |section|, |subsection|, |subsubsection|, |paragraph|,
% |subparagraph|ã€‚å¯ç”¨çš„æ&nbsp;·å¼é€‰é¡¹åŒ…æ‹¬ï¼š
% \begin{itemize}
%   \item ç¼–å·ç›¸å…³ï¼ˆ\ref{subsec:sec-number}~å°èŠ‚ï¼‰ï¼š
%     \opt{numbering}, \opt{name}, \opt{number}
%   \item æ&nbsp;¼å¼ç›¸å…³ï¼ˆ\ref{subsec:sec-format}~å°èŠ‚ï¼‰ï¼š
%     \opt{format}, \opt{nameformat}, \opt{numberformat}, \opt{titleformat},
%     \opt{aftername}, \opt{aftertitle}, \opt{pagestyle}
%   \item é—´è·ã€ç¼©è¿›ç›¸å…³ï¼ˆ\ref{subsec:sec-spacing}~å°èŠ‚ï¼‰ï¼š
%     \opt{runin}, \opt{hang}, \opt{indent}, \opt{beforeskip}, \opt{afterskip},
%     \opt{fixskip}, \opt{break}, \opt{afterindent}
%   \item ç›®å½•ã€é™„å½•ç›¸å…³ï¼ˆ\ref{subsec:sec-toc-appendix}~å°èŠ‚ï¼‰ï¼š
%     \opt{tocline}, \opt{lofskip}, \opt{lotskip}, \opt{appendix/numbering},
%     \opt{appendix/name}, \opt{appendix/number}
% \end{itemize}
%
% æ³¨æ„ï¼Œå¯¹ \cls{article} åŠå…¶è¡ç”Ÿçš„ \cls{ctexart} ç­‰æ–‡æ¡£ç±»ï¼Œæ²¡æœ‰ |chapter|
% çº§åˆ«çš„æ&nbsp;‡é¢˜ï¼›è€Œå¯¹äºŽ \cls{beamer} æ–‡æ¡£ç±»ï¼Œè¿™äº›é€‰é¡¹æŽ§åˆ¶çš„æ˜¯ç”± \tn{partpage},
% \tn{sectionpage} å’Œ \tn{subsectionpage} äº§ç”Ÿçš„æ&nbsp;‡é¢˜æ&nbsp;·å¼ï¼Œæ­¤æ—¶åªæœ‰ |part|,
% |section| å’Œ |subsection| è¿™ä¸‰å±‚çº§åˆ«ï¼Œå¹¶ä¸” \opt{runin}, \opt{afterindent},
% \opt{fixskip}, \opt{hang}, \opt{break} å’Œ \opt{tocline} è¿™å…­ä¸ªé€‰é¡¹æ—&nbsp;æ•ˆã€‚
%
% å¤šå±‚é€‰é¡¹ä¹‹é—´ç”¨æ–œçº¿åˆ†å¼€ï¼Œä¾‹å¦‚ï¼Œ\opt{part/name} é€‰é¡¹è®¾ç½® \tn{part} æ&nbsp;‡é¢˜çš„åœ¨æ•°
% å­—å‰åŽçš„åç§°ï¼Œè€Œ \opt{section/number} é€‰é¡¹è®¾ç½® \tn{section} æ&nbsp;‡é¢˜çš„æ•°å­—ç±»åž‹ã€‚
%
% ä½¿ç”¨ \tn{ctexset} è®¾ç½®å¤šçº§é€‰é¡¹æ—¶ï¼Œè¿˜å¯ä»¥åœ¨åŒä¸€ä¸ªä¸Šçº§é€‰é¡¹ä¸‹è®¾ç½®å¤šä¸ªä¸‹çº§é€‰é¡¹ã€‚
% ä¾‹å¦‚ï¼ŒåŒæ—¶è®¾ç½® |part| ä¸€çº§æ&nbsp;‡é¢˜çš„ \opt{pagestyle} é€‰é¡¹ï¼Œ|chapter| ä¸€çº§æ&nbsp;‡é¢˜çš„
% \opt{format} ä¸Ž \opt{pagestyle} é€‰é¡¹å’Œ |section| ä¸€çº§æ&nbsp;‡é¢˜çš„ \opt{name} ä¸Ž
% \opt{number} é€‰é¡¹ï¼š
% \begin{ctexexam}
%   \ctexset {
%     part/pagestyle = empty,
%     chapter = {
%       format    = \raggedright,
%       pagestyle = empty,
%     },
%     section = {
%       name   = {ç¬¬,èŠ‚},
%       number = \chinese{section},
%     }
%   }
% \end{ctexexam}
%
% \subsection{ç¼–å·ç›¸å…³}
% \label{subsec:sec-number}
%
% \begin{function}[EXP,added=2015-06-21]{part/numbering, chapter/numbering,
%   section/numbering, subsection/numbering, subsubsection/numbering,
%   paragraph/numbering, subparagraph/numbering}
%   \begin{syntax}
%     numbering = \TTF
%   \end{syntax}
%   æŽ§åˆ¶æ˜¯å¦å¯¹\emph{ä¸å¸¦æ˜Ÿå·}çš„ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜è¿›è¡Œç¼–å·ã€‚
%   å„çº§æ&nbsp;‡é¢˜çš„é»˜è®¤å€¼å‡ä¸º \opt{true}ã€‚
%
%   \LaTeX{} æ&nbsp;‡å‡†çš„ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜å‘½ä»¤ï¼ˆå¦‚ \tn{section}ï¼‰å¤§ä½“ä¸Šå®Œæˆå››é¡¹å·¥ä½œï¼š
%   è¾“å‡ºæ&nbsp;‡é¢˜å†…å®¹ã€å¯¹æ&nbsp;‡é¢˜ç¼–å·ï¼ˆè®¡æ•°å™¨å¢žåŠ&nbsp; 1ï¼‰ã€å°†æ&nbsp;‡é¢˜åˆ—å…¥ç›®å½•ï¼ˆè‹¥è°ƒç”¨äº†
%   \pkg{hyperref} å®åŒ…è¿˜ä¼šæ·»åŠ&nbsp; PDF ä¹¦ç­¾ï¼‰ã€æ›´æ–°é¡µçœ‰é¡µè„šæ&nbsp;‡è®°ã€‚å¸¦æ˜Ÿå·çš„
%   ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜å‘½ä»¤ï¼ˆå¦‚ \tn{section*}ï¼‰åªç®€å•åœ°è¾“å‡ºç«&nbsp;èŠ‚æ&nbsp;‡é¢˜å†…å®¹ï¼Œä½†ä¸å¯¹æ&nbsp;‡é¢˜ç¼–å·ï¼Œ
%   ä¸å°†æ&nbsp;‡é¢˜åˆ—å…¥ç›®å½•æˆ– PDF ä¹¦ç­¾ï¼Œä¹Ÿä¸å†™å…¥é¡µçœ‰é¡µè„šæ&nbsp;‡è®°ã€‚ä¸Žä¹‹ä¸åŒçš„æ˜¯ï¼Œ
%   æœ¬é€‰é¡¹ä»…ä»…æ˜¯å¦å¯¹\emph{ä¸å¸¦æ˜Ÿå·}çš„ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜è¿›è¡Œç¼–å·ã€‚å›&nbsp;æ­¤ï¼Œå½“è®¾ç½®æœ¬é€‰é¡¹ä¸º
%   \opt{false} æ—¶ï¼Œé™¤äº†ä¸å¯¹æ&nbsp;‡é¢˜ç¼–å·ä»¥å¤–ï¼Œå…¶ä½™åŠŸèƒ½ä¸Žæ­£å¸¸æ&nbsp;‡é¢˜ä¸€è‡´ï¼šå¯ä»¥
%   ç¼–å…¥ç›®å½•ï¼Œå¹¶ç”Ÿæˆæ­£ç¡®çš„ \pkg{hyperref} ç›®å½•è¶…é“¾æŽ¥ä½ç½®å’Œé¡µçœ‰é¡µè„šæ&nbsp;‡è®°ã€‚ä¾‹å¦‚ï¼š
%   \begin{ctexexam}
%   \documentclass{ctexbook}
%   \begin{document}
%   \tableofcontents
%   \chapter{A}
%   \chapter*{B}
%   \ctexset{chapter/numbering=false}
%   \chapter{C}
%   \end{document}
%   \end{ctexexam}
%   ä¸‰ç«&nbsp;çš„æ&nbsp;‡é¢˜åˆ†åˆ«ä¸ºâ€œç¬¬ä¸€ç«&nbsp;\quad Aâ€ã€â€œBâ€å’Œâ€œCâ€ï¼Œä½†åœ¨ç›®å½•ä¸­åˆ™åªå‡ºçŽ°
%   â€œç¬¬ä¸€ç«&nbsp;\quad Aâ€å’Œâ€œCâ€ã€‚
%
%   æ³¨æ„ï¼Œç«&nbsp;èŠ‚æ&nbsp;‡é¢˜æ˜¯å¦ç¼–å·è¿˜è¦å—åˆ° \LaTeX{} è®¡æ•°å™¨ |secnumdepth| çš„æŽ§åˆ¶^^A
%   ï¼ˆå¯é€šè¿‡ä»¥ä¸‹ä»‹ç»çš„ \opt{secnumdepth} é€‰é¡¹è®¾ç½®ï¼‰ã€‚
%   ä¾‹å¦‚ï¼Œå¯¹äºŽ |section| è€Œè¨€ï¼Œå…¶æ·±åº¦ä¸º 1ã€‚å›&nbsp;æ­¤ï¼Œ|section| ä¼šè¢«ç¼–å·ï¼Œå½“ä¸”ä»…å½“
%   |secnumdepth| ä¸å°äºŽ 1ï¼Œå¹¶ä¸” \opt{section/numbering} ä¸º \opt{true}ï¼Œ
%   å¹¶ä¸”ä½¿ç”¨ä¸å¸¦æ˜Ÿå·çš„ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜å‘½ä»¤ï¼ˆå³ \tn{section}ï¼‰ã€‚
% \end{function}
%
% \begin{function}[EXP,added=2020-05-06]{secnumdepth}
%   \begin{syntax}
%     secnumdepth = &lt;æ•´æ•°æˆ–ç«&nbsp;èŠ‚åç§°&gt;
%   \end{syntax}
%   è®¾ç½®å¯¹ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜è¿›è¡Œç¼–å·çš„å±‚æ¬¡æ•°ã€‚\opt{secnumdepth} çš„å€¼å¯ä»¥æ˜¯ä¸€ä¸ªæ•´æ•°ï¼Œä¹Ÿå¯ä»¥æ˜¯
%   |part|, |chapter| ç­‰åç§°ã€‚
%   å±‚æ¬¡æ•°ä¸Žåç§°çš„å¯¹åº”å…³ç³»è§è¡¨~\ref{tab:heading-level}ã€‚
%   ç«&nbsp;èŠ‚å±‚æ¬¡çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:heading-level-default}ã€‚
%
%   æœ¬é€‰é¡¹å¯¹ \cls{beamer}/\cls{ctexbeamer} æ–‡æ¡£ç±»æ—&nbsp;æ•ˆã€‚
% \end{function}
%
% \begin{table}[htbp]
% \begin{minipage}[t]{.43\linewidth}
%   \small\centering
%   \caption{ç«&nbsp;èŠ‚å±‚æ¬¡}
%   \label{tab:heading-level}
%   \begin{tabular}{rll}
%   \toprule
%   å±‚æ¬¡ &amp; åç§° &amp; æ³¨ \\
%   \midrule
%   |-1| &amp; part    &amp; \cls{book}/\cls{report} ç±» \\
%    |0| &amp; chapter &amp; \cls{book}/\cls{report} ç±» \\
%    |0| &amp; part    &amp; \cls{article} ç±»   \\
%    |1| &amp; section \\
%    |2| &amp; subsection \\
%    |3| &amp; subsubsection \\
%    |4| &amp; paragraph \\
%    |5| &amp; subparagraph \\
%   \bottomrule
%   \end{tabular}
% \end{minipage}^^A
% \begin{minipage}[t]{.57\linewidth}
%   \small\centering
%   \caption{ç«&nbsp;èŠ‚å±‚æ¬¡çš„é»˜è®¤è®¾ç½®}
%   \label{tab:heading-level-default}
%   \begin{tabular}{lll}
%   \toprule
%   æ–‡æ¡£ç±» &amp; \opt{secnumdepth} &amp; \opt{tocdepth} \\
%   \midrule
%   \cls{article}           &amp; |3| (subsubsection) &amp; |3| (subsubsection) \\
%   \cls{book}/\cls{report} &amp; |2| (subsection)    &amp; |2| (subsection) \\
%   \cls{beamer}            &amp; æ—&nbsp;æ•ˆ &amp; |3| (subsubsection) \\
%   \bottomrule
%   \end{tabular}
% \end{minipage}
% \end{table}
%
%   å¦‚æžœæ²¡æœ‰ç‰¹åˆ«è¯´æ˜Žï¼Œä»¥ä¸‹å°†ç”¨ â€œ|...|â€ ä»£è¡¨å„çº§ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜åã€‚
%
% \begin{function}[EXP,updated=2014-03-08]{.../name}
%   \begin{syntax}
%     name = \{&lt;å‰åå­—&gt;,&lt;åŽåå­—&gt;\}
%     name = \Arg{å‰åå­—}
%   \end{syntax}
%   è®¾ç½®ç«&nbsp;èŠ‚çš„åå­—ã€‚æ‰€è°“â€œç«&nbsp;èŠ‚çš„åå­—â€ï¼Œå¯ä»¥åˆ†ä¸ºå‰åŽä¸¤éƒ¨åˆ†ï¼Œå³ç«&nbsp;èŠ‚ç¼–å·å‰åŽçš„
%   è¯è¯­ï¼Œä¸¤ä¸ªè¯ä¹‹é—´ç”¨ä¸€ä¸ªåŠè§’é€—å·åˆ†å¼€ï¼›ä¹Ÿå¯ä»¥åªæœ‰ä¸€éƒ¨åˆ†ï¼Œè¡¨ç¤ºåªæœ‰ç«&nbsp;èŠ‚ç¼–å·ä¹‹å‰
%   çš„åå­—ã€‚ä¾‹å¦‚ï¼š
%   \begin{ctexexam}
%   \ctexset{
%     chapter/name = {ç¬¬,ç«&nbsp;},
%     section/name = {\S},
%   }
%   \end{ctexexam}
%   ä¼šä½¿å¾— \tn{chapter} æ&nbsp;‡é¢˜ä½¿ç”¨å½¢å¦‚â€œç¬¬ä¸€ç«&nbsp;â€çš„åå­—ï¼Œè€Œ \tn{section} æ&nbsp;‡é¢˜åˆ™ä½¿
%   ç”¨å½¢å¦‚â€œ\S1â€çš„åå­—ã€‚è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:name-default}ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \small\centering
%   \setlength\leftskip{0pt plus 1 fil minus \marginparwidth}
%   \caption{\opt{name} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%   \label{tab:name-default}
%   \begin{tabular}{llll}
%   \toprule
%   æ&nbsp;‡é¢˜å &amp; \opt{scheme = chinese} &amp; \opt{scheme = plain} &amp; æ³¨ \\
%   \midrule
%   part &amp; |{ç¬¬,éƒ¨åˆ†}| &amp; |{\partname\space}| &amp; åŽŸ \tn{partname} ä¸º Part \\
%   chapter &amp; |{ç¬¬,ç«&nbsp;}| &amp; |{\chaptername\space}|
%     &amp; åŽŸ \tn{chaptername} ä¸º Chapter \\
%   section (beamer) &amp; |{}| &amp; |{\sectionname\space}|
%     &amp; \BSTACK åŽŸ \tn{sectionname} ä¸º\\ |\translate{Section}| \ESTACK \\
%   section &amp; åŒå³ &amp; |{}| &amp; \\
%   subsection (beamer) &amp; |{}| &amp; |{\subsectionname\space}|
%     &amp; \BSTACK åŽŸ \tn{subsectionname} ä¸º\\ |\translate{Subsection}| \ESTACK \\
%   subsection &amp; åŒå³ &amp; |{}| &amp; \\
%   subsubsection &amp; åŒå³ &amp; |{}| &amp; \\
%   paragraph &amp; åŒå³ &amp; |{}| &amp; \\
%   subparagraph &amp; åŒå³ &amp; |{}| &amp; \\
%   \bottomrule
%   \end{tabular}
% \end{table}
%
% \begin{function}[EXP]{.../number}
%   \begin{syntax}
%     number = \Arg{æ•°å­—è¾“å‡ºå‘½ä»¤}
%   \end{syntax}
%   è®¾ç½®ç«&nbsp;èŠ‚ç¼–å·çš„æ•°å­—è¾“å‡ºæ&nbsp;¼å¼ã€‚\meta{æ•°å­—è¾“å‡ºå‘½ä»¤} é€šå¸¸æ˜¯å¯¹åº”ç«&nbsp;èŠ‚ç¼–å·è®¡æ•°å™¨çš„
%   è¾“å‡ºå‘½ä»¤ï¼Œå¦‚ \tn{thesection} æˆ– |\chinese{chapter}| ä¹‹ç±»ã€‚ä¾‹å¦‚ï¼š
%   \begin{ctexexam}
%   \ctexset{
%     section/number = \Roman{section}
%   }
%   \end{ctexexam}
%   å°†ä¼šä½¿ \tn{section} çš„ç¼–å·å˜ä¸ºå¤§å†™ç½—é©¬æ•°å­—ï¼ˆå¦‚ Iã€II ç­‰ï¼‰ã€‚
%
%   \opt{number} é€‰é¡¹å®šä¹‰çš„åŒæ—¶å°†æŽ§åˆ¶å¯¹ç«&nbsp;èŠ‚è®¡æ•°å™¨çš„äº¤å‰å¼•ç”¨ã€‚åœ¨å¼•ç”¨è®¡æ•°å™¨æ—¶ï¼Œ
%   è®°å½•åœ¨ \LaTeX{} è¾…åŠ©æ–‡ä»¶ä¸­çš„æ˜¯ \opt{number} é€‰é¡¹çš„å®šä¹‰ã€‚
%
%   ä½†æ˜¯ï¼Œ\opt{number} é€‰é¡¹ä¸ä¼šå½±å“è®¡æ•°å™¨æœ¬èº«çš„è¾“å‡ºã€‚å³è®¾ç½® |section/number|
%   ä¸ä¼šå½±å“ \tn{thesection} çš„å®šä¹‰ï¼ˆä½†è¯¥é€‰é¡¹ä¼šå½±å“ \tn{CTEXthesection} çš„å®š
%   ä¹‰ï¼Œè§åŽï¼‰ã€‚è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:number-default}ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \small\centering
%   \caption{\opt{number} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%   \label{tab:number-default}
%   \setlength\leftskip{0pt plus 1 fil minus \marginparwidth}
%   \begin{tabular}{llll}
%   \toprule
%   æ&nbsp;‡é¢˜å &amp; \opt{scheme = chinese} &amp; \opt{scheme = plain}
%     &amp; åŽŸ |\the|\meta{æ&nbsp;‡é¢˜} ç­‰ä»·å®šä¹‰ \\
%   \midrule
%   part (beamer) &amp; |\chinese{part}| &amp; |\insertromanpartnumber| &amp; æ„ä¹‰ä¸º |\Roman{part}| \\
%   part &amp; |\chinese{part}| &amp; |\thepart| &amp; |\Roman{part}| \\
%   chapter &amp; |\chinese{chapter}| &amp; |\thechapter| &amp; |\arabic{chapter}| \\
%   section (beamer) &amp; åŒå³ &amp; |\insertsectionnumber| &amp; æ„ä¹‰ä¸º |\arabic{section}| \\
%   section &amp; åŒå³ &amp; |\thesection| &amp; |\arabic{section}| \\
%   subsection (beamer)
%     &amp; \BSTACK |\arabic{section}.|\\ |\arabic{subsection}| \ESTACK
%     &amp; |\insertsubsectionnumber| &amp; æ„ä¹‰ä¸º |\arabic{subsection}| \\
%   subsection &amp; åŒå³ &amp; |\thesubsection| &amp; |\thesection.\arabic{subsection}| \\
%   subsubsection &amp; åŒå³ &amp; |\thesubsubsection|
%     &amp; |\thesubsection.\arabic{subsubsection}| \\
%   paragraph &amp; åŒå³ &amp; |\theparagraph|
%     &amp; |\thesubsubsection.\arabic{paragraph}| \\
%   subparagraph &amp; åŒå³ &amp; |\thesubparagraph|
%     &amp; |\theparagraph.\arabic{subparagraph}| \\
%   \bottomrule
%   \end{tabular}
% \end{table}
%
% \subsection{æ&nbsp;¼å¼ç›¸å…³}
% \label{subsec:sec-format}
%
% \CTeX{} å®é›†æä¾›äº† \opt{numberformat}, \opt{nameformat}, \opt{titleformat},
% \opt{format} è¿™å‡&nbsp;ä¸ªé€‰é¡¹ç”¨æ¥æŽ§åˆ¶ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜çš„æ&nbsp;¼å¼ã€‚
% å®ƒä»¬çš„ä½œç”¨èŒƒå›´å¦‚å›¾~\ref{fig:heading-format} æ‰€ç¤ºã€‚å…·ä½“ç”¨æ³•è§ä¸‹æ–‡ã€‚
%
% \begin{figure}[htbp]
%   \centering
%   \[
%     \underbrace{
%       \overbrace{
%         \text{\huge\bfseries ç¬¬}
%         \mspace{-25mu}
%         \underbrace{\text{\huge\bfseries 1}}_{\text{\small\opt{numberformat}}}
%         \mspace{-25mu}
%         \text{\huge\bfseries ç«&nbsp;}
%       }^{\text{\small\opt{nameformat}}} \quad
%       \overbrace{\text{\huge\bfseries ç†Ÿæ‚‰ \LaTeX}}^{\text{\small\opt{titleformat}}}
%     }_{\text{\small\opt{format}}}
%   \]
%   \caption{\opt{numberformat}, \opt{nameformat}, \opt{titleformat},
%     \opt{format} å‡&nbsp;ä¸ªé€‰é¡¹çš„ä½œç”¨èŒƒå›´ç¤ºæ„}
%   \label{fig:heading-format}
% \end{figure}
%
% \begin{function}[EXP,updated=2020-04-22]{.../format, .../format+}
%   \begin{syntax}
%     format = \Arg{æ&nbsp;¼å¼å‘½ä»¤}
%     format+= \Arg{æ&nbsp;¼å¼å‘½ä»¤}
%   \end{syntax}
%   \opt{format} é€‰é¡¹ç”¨äºŽæŽ§åˆ¶ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜çš„å…¨å±€æ&nbsp;¼å¼ï¼Œä½œç”¨åŸŸä¸ºç«&nbsp;èŠ‚åå­—å’ŒéšåŽçš„æ&nbsp;‡é¢˜
%   å†…å®¹ã€‚å¯ä»¥ç”¨äºŽæŽ§åˆ¶ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜çš„å¯¹é½æ–¹å¼ã€æ•´ä½“å­—ä½“å­—å·ç­‰æ&nbsp;¼å¼ã€‚
%   å¸¦åŠ&nbsp;å·çš„ \opt{format+} é€‰é¡¹ç”¨äºŽåœ¨å·²æœ‰çš„æ&nbsp;¼å¼å‘½ä»¤åŽé™„åŠ&nbsp;å†…å®¹ã€‚
%
%   \opt{format} é€‰é¡¹çš„æœ€åŽä¸€ä¸ªæ&nbsp;¼å¼å‘½ä»¤å¯ä»¥å¸¦æœ‰ä¸€ä¸ªå‚æ•°ã€‚
%   è¿™ä¸€å‚æ•°ç”¨äºŽæŽ¥å—ç«&nbsp;èŠ‚åå­—ã€ç¼–å·å’Œæ&nbsp;‡é¢˜å†…å®¹ï¼ˆä»¥åŠç”± \opt{nameformat}, \opt{numberformat},
%   \opt{aftername}, \opt{titleformat}, \opt{aftertitle}, \opt{indent}
%   åŠ \opt{hang} é€‰é¡¹è®¾å®šçš„ï¼Œåº”ç”¨äºŽè¿™äº›å†…å®¹ä¹‹ä¸Šçš„æ&nbsp;¼å¼ï¼‰ï¼Œä»¥å®žçŽ°ç‰¹æ®Šæ•ˆæžœã€‚
%
%   ä¾‹å¦‚ï¼Œè®¾ç½®ç«&nbsp;æ&nbsp;‡é¢˜ä¸ºæ—&nbsp;è¡¬çº¿å­—ä½“å·¦å¯¹é½ã€ä¸ºèŠ‚æ&nbsp;‡é¢˜å¢žåŠ&nbsp;æ—&nbsp;è¡¬çº¿å­—ä½“è®¾ç½®ã€
%   ä¸ºå°èŠ‚æ&nbsp;‡é¢˜åŠ&nbsp;æ¡†ï¼ˆ\tn{fbox} å‘½ä»¤æœ¬èº«éœ€å¸¦ä¸€ä¸ªå‚æ•°ï¼‰ï¼š
%   \begin{ctexexam}
%   \ctexset{
%     chapter/format     = \sffamily\raggedright,
%     section/format    += \sffamily,
%     subsection/format += \fbox,
%   }
%   \end{ctexexam}
%
%   \opt{format} é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:format-default}ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \small\centering
%   \begin{threeparttable}
%     \caption{\opt{format} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%     \label{tab:format-default}
%     \begin{tabular}{lll}
%     \toprule
%     æ&nbsp;‡é¢˜å &amp; \opt{scheme = chinese} &amp; \opt{scheme = plain} \\
%     \midrule
%     part (article) &amp; |\Large\bfseries\centering| &amp; |\raggedright|\tnote{*} \\
%     part (beamer) &amp; åŒå³ &amp; |\centering| \\
%     part &amp; |\huge\bfseries\centering| &amp; |\centering| \\
%     chapter &amp; |\huge\bfseries\centering| &amp; |\raggedright| \\
%     section (beamer) &amp; åŒå³ &amp; |\centering| \\
%     section &amp; |\Large\bfseries\centering| &amp; |\Large\bfseries| \\
%     subsection (beamer) &amp; åŒå³ &amp; |\centering| \\
%     subsection &amp; åŒå³ &amp; |\large\bfseries| \\
%     subsubsection &amp; åŒå³ &amp; |\normalsize\bfseries| \\
%     paragraph &amp; åŒå³ &amp; |\normalsize\bfseries| \\
%     subparagraph &amp; åŒå³ &amp; |\normalsize\bfseries| \\
%     \bottomrule
%     \end{tabular}
%     \begin{tablenotes}
%       \item[*] ä¸ºäº†ä¸Ž \LaTeXe{} çš„é»˜è®¤æ•ˆæžœä¿æŒä¸€è‡´ï¼Œåœ¨ \opt{scheme = plain}
%           æ—¶ï¼Œpart å’Œ chapter çš„ \opt{nameformat} å’Œ \opt{titleformat}
%           å¹¶ä¸ä¸€æ&nbsp;·ï¼Œå›&nbsp;æ­¤æ²¡æœ‰ä½¿ç”¨ \opt{format} é€‰é¡¹ç»Ÿä¸€è®¾ç½®åå­—å’Œæ&nbsp;‡é¢˜çš„æ&nbsp;¼å¼ã€‚
%     \end{tablenotes}
%   \end{threeparttable}
% \end{table}
%
% \begin{function}[EXP,updated=2015-06-30]{.../nameformat, .../nameformat+}
%   \begin{syntax}
%     nameformat = \Arg{æ&nbsp;¼å¼å‘½ä»¤}
%     nameformat+= \Arg{æ&nbsp;¼å¼å‘½ä»¤}
%   \end{syntax}
%   \opt{nameformat} ç”¨äºŽæŽ§åˆ¶ç«&nbsp;èŠ‚åå­—çš„æ&nbsp;¼å¼ï¼Œä½œç”¨åŸŸä¸ºç«&nbsp;èŠ‚åå­—ï¼ŒåŒ…æ‹¬ç¼–å·ã€‚å®ƒä¸€
%   èˆ¬ç”¨äºŽç«&nbsp;èŠ‚åï¼ˆåŒ…æ‹¬ç¼–å·ï¼‰ä¸Žç«&nbsp;èŠ‚æ&nbsp;‡é¢˜çš„å­—ä½“ã€å­—å·ç­‰è®¾ç½®ä¸ä¸€è‡´çš„æƒ…å½¢ã€‚å‚è§
%   ä¸‹é¢çš„ \opt{titleformat} é€‰é¡¹ã€‚\opt{nameformat+} ç”¨äºŽåœ¨å·²æœ‰çš„ç«&nbsp;èŠ‚åå­—
%   æ&nbsp;¼å¼å‘½ä»¤åŽé™„åŠ&nbsp;å†…å®¹ã€‚
%
%   \opt{nameformat} é€‰é¡¹çš„æœ€åŽä¸€ä¸ªæ&nbsp;¼å¼å‘½ä»¤å¯ä»¥å¸¦æœ‰ä¸€ä¸ªå‚æ•°ã€‚
%   è¿™ä¸€å‚æ•°ç”¨äºŽæŽ¥å—ç«&nbsp;èŠ‚åå­—å’Œç¼–å·ï¼Œä»¥å®žçŽ°ç‰¹æ®Šæ•ˆæžœï¼ˆè§ä¾‹~\ref{exam:miscopt}ï¼‰ã€‚
%
%   \opt{nameformat} é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:nameformat-default}ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \small\centering
%   \caption{\opt{nameformat} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%   \label{tab:nameformat-default}
%   \begin{tabular}{lll}
%   \toprule
%   æ&nbsp;‡é¢˜å &amp; \opt{scheme = chinese} &amp; \opt{scheme = plain} \\
%   \midrule
%   part (article) &amp; |{}| &amp; |\Large\bfseries| \\
%   part (beamer) &amp; åŒå³
%     &amp; \BSTACK |\usebeamerfont{part name}| \\
%               |\usebeamercolor[fg]{part name}| \ESTACK \\
%   part &amp; |{}| &amp; |\huge\bfseries| \\
%   chapter &amp; |{}| &amp; |\huge\bfseries| \\
%   section (beamer) &amp; åŒå³
%     &amp; \BSTACK |\usebeamerfont{section name}| \\
%               |\usebeamercolor[fg]{section name}| \ESTACK \\
%   section &amp; åŒå³ &amp; |{}| \\
%   subsection (beamer) &amp; åŒå³
%     &amp; \BSTACK |\usebeamerfont{subsection name}| \\
%               |\usebeamercolor[fg]{subsection name}| \ESTACK \\
%   subsection &amp; åŒå³ &amp; |{}| \\
%   subsubsection &amp; åŒå³ &amp; |{}| \\
%   paragraph &amp; åŒå³ &amp; |{}| \\
%   subparagraph &amp; åŒå³ &amp; |{}| \\
%   \bottomrule
%   \end{tabular}
% \end{table}
%
% \begin{function}[EXP,updated=2015-06-19]{.../numberformat, .../numberformat+}
%   \begin{syntax}
%     numberformat = \Arg{æ&nbsp;¼å¼å‘½ä»¤}
%     numberformat+= \Arg{æ&nbsp;¼å¼å‘½ä»¤}
%   \end{syntax}
%   \opt{numberformat} é€‰é¡¹ç”¨äºŽæŽ§åˆ¶ç«&nbsp;èŠ‚ç¼–å·çš„æ&nbsp;¼å¼ï¼Œä½œç”¨åŸŸä»…ä¸ºç¼–å·æ•°å­—æœ¬èº«ã€‚å¯¹
%   å„çº§æ&nbsp;‡é¢˜é»˜è®¤å‡ä¸ºç©ºï¼Œå½“éœ€è¦ç¼–å·çš„æ&nbsp;¼å¼å’Œå‰åŽçš„ç«&nbsp;èŠ‚åå­—ä¸ä¸€æ&nbsp;·æ—¶å¯ä»¥ä½¿ç”¨ã€‚
%   \opt{numberformat+} ç”¨äºŽåœ¨å·²æœ‰çš„ç¼–å·æ&nbsp;¼å¼å‘½ä»¤åŽé™„åŠ&nbsp;å†…å®¹ã€‚
%
%   \opt{numberformat} é€‰é¡¹çš„æœ€åŽä¸€ä¸ªæ&nbsp;¼å¼å‘½ä»¤å¯ä»¥å¸¦æœ‰ä¸€ä¸ªå‚æ•°ã€‚è¿™ä¸€å‚æ•°ç”¨äºŽæŽ¥å—
%   ç¼–å·æ•°å­—ã€‚ä¾‹å¦‚ï¼Œæˆ‘ä»¬å¯ä»¥ä½¿ç”¨ \opt{numberformat} ç‰¹åˆ«å¼ºè°ƒç«&nbsp;æ&nbsp;‡é¢˜ä¸­çš„æ•°å­—ï¼š
%   \begin{ctexexam}
%   \ctexset{
%     chapter/number = \arabic{chapter},
%     chapter/numberformat = \color{blue}\zihao{0}\emph,
%   }
%   \end{ctexexam}
%   ä¸Šé¢çš„ä»£ç&nbsp;åœ¨ \opt{scheme = chinese} æ—¶å¯ä»¥åšå‡ºç±»ä¼¼è¿™æ&nbsp;·çš„ç«&nbsp;æ&nbsp;‡é¢˜æ•ˆæžœï¼š
%   \begin{center}
%     \huge\bfseries ç¬¬ \emph{\color{blue}\zihao{0}4} ç«&nbsp;
%   \end{center}
%
%   \opt{numberformat} é€‰é¡¹é»˜è®¤å‡è®¾ç½®ä¸ºç©ºï¼Œæ•…ç«&nbsp;èŠ‚ç¼–å·é»˜è®¤ä¸Žç«&nbsp;èŠ‚åå­—ä½¿ç”¨
%   ç›¸åŒçš„æ&nbsp;¼å¼ã€‚
% \end{function}
%
% \begin{function}[EXP,updated=2015-06-30]{.../titleformat, .../titleformat+}
%   \begin{syntax}
%     titleformat = \Arg{æ&nbsp;¼å¼å‘½ä»¤}
%     titleformat+= \Arg{æ&nbsp;¼å¼å‘½ä»¤}
%   \end{syntax}
%   \opt{titleformat} é€‰é¡¹ç”¨äºŽæŽ§åˆ¶æ&nbsp;‡é¢˜å†…å®¹çš„æ&nbsp;¼å¼ï¼Œä½œç”¨åŸŸä¸ºç«&nbsp;èŠ‚æ&nbsp;‡é¢˜å†…å®¹ã€‚
%   \opt{titleformat+} é€‰é¡¹ç”¨äºŽåœ¨å·²æœ‰çš„æ&nbsp;‡é¢˜æ&nbsp;¼å¼å‘½ä»¤åŽé™„åŠ&nbsp;å†…å®¹ã€‚
%
%   \opt{titleformat} é€‰é¡¹çš„æœ€åŽä¸€ä¸ªæ&nbsp;¼å¼å‘½ä»¤å¯ä»¥å¸¦æœ‰ä¸€ä¸ªå‚æ•°ã€‚è¿™ä¸€å‚æ•°ç”¨äºŽæŽ¥å—
%   æ&nbsp;‡é¢˜å†…å®¹ã€‚ä¾‹å¦‚ï¼Œå®žçŽ°å¤šè¡Œæ&nbsp;‡é¢˜çš„å±…ä¸­æ‚¬æŒ‚å¯¹é½ï¼š
%   \begin{ctexexam}
%   \usepackage{varwidth} %% æä¾› varwidth çŽ¯å¢ƒ
%   \ctexset{
%     chapter/name = {ç¬¬,å›ž},
%     chapter/titleformat = \chaptertitleformat
%   }
%   \newcommand\chaptertitleformat[1]{%% ä»¥æ&nbsp;‡é¢˜å†…å®¹ä¸ºå‚æ•°
%     \begin{varwidth}[t]{.7\linewidth}#1\end{varwidth}}
%   ......
%   \chapter{æƒ…ä¸­æƒ…å›&nbsp;æƒ…æ„Ÿå¦¹å¦¹\\é”™é‡Œé”™ä»¥é”™åŠå“¥å“¥}
%   \end{ctexexam}
%   ä¸Šé¢çš„ä»£ç&nbsp;å¯ä»¥åšå‡ºç±»ä¼¼è¿™æ&nbsp;·çš„ç«&nbsp;æ&nbsp;‡é¢˜æ•ˆæžœï¼š
%   \begin{center}\Large\bfseries
%   ç¬¬ä¸‰åå››å›ž\quad
%   \begin{tabular}[t]{l}
%     æƒ…ä¸­æƒ…å›&nbsp;æƒ…æ„Ÿå¦¹å¦¹\\
%     é”™é‡Œé”™ä»¥é”™åŠå“¥å“¥
%   \end{tabular}
%   \end{center}
%
%   \opt{titleformat} é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:titleformat-default}ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \small\centering
%   \caption{\opt{titleformat} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%   \label{tab:titleformat-default}
%   \begin{tabular}{lll}
%   \toprule
%   æ&nbsp;‡é¢˜å &amp; \opt{scheme = chinese} &amp; \opt{scheme = plain} \\
%   \midrule
%   part (article) &amp; |{}| &amp; |\huge\bfseries| \\
%   part (beamer) &amp; åŒå³ &amp; |\usebeamerfont{part title}| \\
%   part &amp; |{}| &amp; |\Huge\bfseries| \\
%   chapter &amp; |{}| &amp; |\Huge\bfseries| \\
%   section (beamer) &amp; åŒå³ &amp; |\usebeamerfont{section title}| \\
%   section &amp; åŒå³ &amp; |{}| \\
%   subsection (beamer) &amp; åŒå³ &amp; |\usebeamerfont{subsection title}| \\
%   subsection &amp; åŒå³ &amp; |{}| \\
%   subsubsection &amp; åŒå³ &amp; |{}| \\
%   paragraph &amp; åŒå³ &amp; |{}| \\
%   subparagraph &amp; åŒå³ &amp; |{}| \\
%   \bottomrule
%   \end{tabular}
% \end{table}
%
% \begin{function}[EXP,updated=2014-03-08]{.../aftername, .../aftername+}
%   \begin{syntax}
%   aftername = \Arg{ä»£ç&nbsp;}
%   aftername+= \Arg{ä»£ç&nbsp;}
%   \end{syntax}
%   \opt{aftername} é€‰é¡¹çš„å‚æ•° \meta{ä»£ç&nbsp;} å°†è¢«æ’å…¥åˆ°ç«&nbsp;èŠ‚ç¼–å·ä¸Žå…¶åŽçš„æ&nbsp;‡é¢˜å†…å®¹ä¹‹
%   é—´ï¼Œç”¨äºŽæŽ§åˆ¶æ&nbsp;¼å¼å˜æ¢ã€‚å¸¸ç”¨äºŽæŽ§åˆ¶ç«&nbsp;èŠ‚ç¼–å·ä¸Žæ&nbsp;‡é¢˜å†…å®¹ä¹‹é—´çš„è·ç¦»ï¼Œæˆ–è€…æŽ§åˆ¶æ&nbsp;‡é¢˜
%   æ˜¯å¦å¦èµ·ä¸€è¡Œã€‚\opt{aftername+} ç”¨äºŽåœ¨å·²æœ‰çš„ä»£ç&nbsp;åŽé™„åŠ&nbsp;å†…å®¹ã€‚è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®
%   è§è¡¨~\ref{tab:aftername-default}ã€‚
% \end{function}
%
% \begin{function}[EXP,added=2015-06-19]{.../aftertitle, .../aftertitle+}
%   \begin{syntax}
%   aftertitle = \Arg{ä»£ç&nbsp;}
%   aftertitle+= \Arg{ä»£ç&nbsp;}
%   \end{syntax}
%   \opt{aftertitle} é€‰é¡¹çš„å‚æ•° \meta{ä»£ç&nbsp;} å°†è¢«æ’å…¥åˆ°ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜å†…å®¹ä¹‹åŽã€‚
%   \opt{aftertitle+} ç”¨äºŽåœ¨å·²æœ‰çš„ä»£ç&nbsp;åŽé™„åŠ&nbsp;å†…å®¹ã€‚è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®
%   è§è¡¨~\ref{tab:aftertitle-default}ã€‚éœ€æ³¨æ„ï¼Œ\opt{sub3section} æˆ–
%   \opt{sub4section} å®åŒ…é€‰é¡¹ï¼ˆè§ \ref{subs:options-heading}~èŠ‚ï¼‰ä¼šå½±å“
%   \opt{aftertitle} é€‰é¡¹çš„é»˜è®¤å€¼ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \setlength\leftskip{0pt plus 1 fil minus \marginparwidth}
%   \begin{minipage}[t]{.75\linewidth}
%     \small\centering
%     \caption{\opt{aftername} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%     \label{tab:aftername-default}
%     \begin{tabular}{lll}
%     \toprule
%     æ&nbsp;‡é¢˜å &amp; \opt{scheme = chinese} &amp; \opt{scheme = plain} \\
%     \midrule
%     part (article) &amp; |\quad| &amp; |\par\nobreak| \\
%     part (beamer) &amp; åŒå³ &amp; |\vskip 1em \par| \\
%     part &amp; åŒå³ &amp; |\par\vskip 20pt| \\
%     chapter &amp; |\quad| &amp; |\par\nobreak\vskip 20pt| \\
%     section (beamer) &amp; åŒå³ &amp; |\vskip 1em \par| \\
%     section &amp; åŒå³ &amp; |\quad| \\
%     subsection (beamer) &amp; åŒå³ &amp; |\vskip 1em \par| \\
%     subsection &amp; åŒå³ &amp; |\quad| \\
%     subsubsection &amp; åŒå³ &amp; |\quad| \\
%     paragraph &amp; åŒå³ &amp; |\quad| \\
%     subparagraph &amp; åŒå³ &amp; |\quad| \\
%     \bottomrule
%     \end{tabular}
%   \end{minipage}\nobreak\quad
%   \begin{minipage}[t]{.42\linewidth}
%     \small\centering
%     \caption{\opt{aftertitle} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%     \label{tab:aftertitle-default}
%     \begin{tabular}{p{\dimexpr .58\linewidth - 2\tabcolsep\relax}p{\dimexpr .4\linewidth - 2\tabcolsep\relax}}
%     \toprule
%     æ&nbsp;‡é¢˜å &amp; é»˜è®¤å€¼ \\
%     \midrule
%     part &amp; |\par| \\
%     chapter &amp; |\par| \\
%     section &amp; |\@@par| \\
%     subsection &amp; |\@@par| \\
%     subsubsection &amp; |\@@par| \\
%     paragraph &amp; |{}| \\
%     \qquad(sub3section) &amp; |\@@par| \\
%     \qquad(sub4section) &amp; åŒä¸Š \\
%     subparagraph &amp; |{}| \\
%     \qquad(sub4section) &amp; |\@@par| \\
%     \bottomrule
%     \end{tabular}
%   \end{minipage}
% \end{table}
%
% \begin{function}[EXP,added=2014-03-21]{part/pagestyle, chapter/pagestyle}
%   \begin{syntax}
%     pagestyle = \Arg{é¡µé¢æ&nbsp;¼å¼}
%   \end{syntax}
%   è®¾ç½® \cls{book}/\cls{ctexbook} æˆ– \cls{report}/\cls{ctexrep} æ–‡æ¡£ç±»
%   ä¸­ï¼Œ\tn{part} ä¸Ž \tn{chapter} æ&nbsp;‡é¢˜æ‰€åœ¨é¡µçš„é¡µé¢æ&nbsp;¼å¼ï¼ˆpage styleï¼‰ã€‚
%   è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:pagestyle-default}ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \small\centering
%   \caption{\opt{pagestyle} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%   \label{tab:pagestyle-default}
%   \begin{tabular}{ll}
%   \toprule
%   æ&nbsp;‡é¢˜å &amp; é»˜è®¤å€¼ \\
%   \midrule
%   part (article) &amp; æ—&nbsp;æ•ˆ \\
%   part &amp; |plain| \\
%   chapter &amp; |plain| \\
%   \bottomrule
%   \end{tabular}
% \end{table}
%
% \subsection{é—´è·ã€ç¼©è¿›ç›¸å…³}
% \label{subsec:sec-spacing}
%
% \begin{function}[EXP,added=2015-06-27]{section/runin, subsection/runin,
%   subsubsection/runin, paragraph/runin, subparagraph/runin}
%   \begin{syntax}
%   runin = \TF
%   \end{syntax}
%   \opt{runin} é€‰é¡¹åªå¯¹ \tn{section} çº§ä»¥ä¸‹æ&nbsp;‡é¢˜æœ‰æ„ä¹‰ï¼Œç”¨äºŽç¡®å®šæ&nbsp;‡é¢˜ä¸ŽéšåŽçš„
%   æ­£æ–‡æ˜¯å¦æŽ’åœ¨åŒä¸€æ®µä¹‹ä¸Šã€‚è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:runin-default}ã€‚
%
%   é»˜è®¤æƒ…å†µä¸‹ï¼Œ\tn{paragraph}ã€\tn{subparagraph} ä¸¤çº§æ&nbsp;‡é¢˜æ˜¯ä¸ŽåŽé¢æ­£æ–‡æŽ’åœ¨åŒä¸€
%   æ®µçš„ï¼Œ\opt{runin} é€‰é¡¹ä¸º \opt{true}ï¼›ä½†ä½¿ç”¨ \opt{sub3section} æˆ–
%   \opt{sub4section} å®åŒ…é€‰é¡¹ï¼ˆè§ \ref{subs:options-heading}~èŠ‚ï¼‰åŽï¼Œå°†å¯¹
%   è¿™ä¸¤çº§æ&nbsp;‡é¢˜è®¾ \opt{runin} é€‰é¡¹ä¸º \opt{false}ï¼Œè¿™ä¸¤çº§æ&nbsp;‡é¢˜ä¼šæ”¹ä¸ºæŽ’åœ¨ä¸åŒæ®µã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \small\centering
%   \caption{\opt{runin} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%   \label{tab:runin-default}
%   \begin{tabular}{ll}
%   \toprule
%   æ&nbsp;‡é¢˜å &amp; é»˜è®¤å€¼ \\
%   \midrule
%   part &amp; æ—&nbsp;æ•ˆ \\
%   chapter &amp; æ—&nbsp;æ•ˆ \\
%   section &amp; |false| \\
%   subsection &amp; |false| \\
%   subsubsection &amp; |false| \\
%   paragraph &amp; |true| \\
%   \qquad(sub3section) &amp; |false| \\
%   \qquad(sub4section) &amp; åŒä¸Š \\
%   subparagraph &amp; |true| \\
%   \qquad(sub4section) &amp; |false| \\
%   \bottomrule
%   \end{tabular}
% \end{table}
%
% \begin{function}[EXP,updated=2020-04-23]{.../hang}
%   \begin{syntax}
%   hang = \TF
%   \end{syntax}
%   \opt{hang} é€‰é¡¹ç”¨äºŽè®¾ç½®æ˜¯å¦å¯¹ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜å®žæ–½æ‚¬æŒ‚ç¼©è¿›ï¼ˆç¼©è¿›çš„å®½åº¦ä¸ºåå­—å®½åº¦
%   å’Œ \opt{indent} é€‰é¡¹è®¾ç½®çš„å®½åº¦ä¹‹å’Œï¼‰ã€‚
%
%   æ³¨æ„ï¼Œå½“ \opt{hang = true} æ—¶ï¼Œä¸æ°å½“åœ°è®¾ç½®é€‰é¡¹ \opt{aftername} çš„å€¼ï¼Œå¯èƒ½ä¼šå¼•å‘
%   é”™è¯¯ã€‚è¿™æ˜¯å›&nbsp;ä¸ºå½“ \opt{hang = true} æ—¶ï¼Œ\LaTeX{} å†…éƒ¨ä¼šæž„é€&nbsp;ä¸€ä¸ª \tn{hbox} è€Œ
%   è¿›å…¥å—é™æ°´å¹³æ¨¡å¼ï¼ˆrestricted horizontal modeï¼‰ã€‚è‹¥åœ¨ \opt{aftername} ä¸­åŠ&nbsp;å…¥
%   åŒ…å« \tn{vskip} ç­‰ä¼šå¯¼è‡´ä»Žå—é™æ°´å¹³æ¨¡å¼åˆ‡å‡ºçš„åž‚ç›´å‘½ä»¤ï¼ˆvertical commandï¼‰æ—¶ï¼Œå°±ä¼šæŠ¥é”™ã€‚
%   ç‰¹åˆ«åœ°ï¼Œ\opt{aftername} çš„é»˜è®¤å€¼ä¹Ÿå¯èƒ½å¯¼è‡´è¿™ç§æƒ…å½¢ï¼ˆè§è¡¨~\ref{tab:aftername-default}ï¼‰ã€‚
%   å›&nbsp;æ­¤ï¼Œå½“è®¾ç½® \opt{hang = true} æ—¶ï¼Œç”¨æˆ·å¿…é¡»æ°å½“åœ°è®¾ç½®é€‰é¡¹ \opt{aftername} çš„å€¼ã€‚
%
%   æœ¬é€‰é¡¹å¯¹ \cls{beamer}/\cls{ctexbeamer} æ–‡æ¡£ç±»æ—&nbsp;æ•ˆã€‚
%   å¯¹äºŽ \tn{section} çº§ä»¥ä¸‹æ&nbsp;‡é¢˜ï¼Œè‹¥è®¾ç½®äº† \opt{runin} é€‰é¡¹ä¸º \opt{true}ï¼Œ
%   å³æ&nbsp;‡é¢˜ä¸ŽéšåŽæ­£æ–‡æŽ’åœ¨åŒä¸€æ®µï¼Œ\opt{hang} é€‰é¡¹æ²¡æœ‰æ„ä¹‰ã€‚
%   è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:hang-default}ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \begin{minipage}[t]{.5\linewidth}
%     \small\centering
%     \caption{\opt{hang} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%     \label{tab:hang-default}
%     \begin{tabular}{ll}
%     \toprule
%     æ&nbsp;‡é¢˜å &amp; é»˜è®¤å€¼ \\
%     \midrule
%     part &amp; |false| \\
%     chapter &amp; |false| \\
%     section &amp; |true| \\
%     subsection &amp; |true| \\
%     subsubsection &amp; |true| \\
%     paragraph &amp; æ—&nbsp;æ„ä¹‰ \\
%     \qquad(sub3section) &amp; |true| \\
%     \qquad(sub4section) &amp; |true| \\
%     subparagraph &amp; æ—&nbsp;æ„ä¹‰ \\
%     \qquad(sub4section) &amp; |true| \\
%     \bottomrule
%     \end{tabular}
%   \end{minipage}^^A
%   \begin{minipage}[t]{.5\linewidth}
%     \small\centering
%     \caption{\opt{indent} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%     \label{tab:indent-default}
%     \begin{tabular}{ll}
%     \toprule
%     æ&nbsp;‡é¢˜å &amp; é»˜è®¤å€¼ \\
%     \midrule
%     part &amp; |0pt| \\
%     chapter &amp; |0pt| \\
%     section &amp; |0pt| \\
%     subsection &amp; |0pt| \\
%     subsubsection &amp; |0pt| \\
%     paragraph &amp; |0pt| \\
%     subparagraph &amp; |\parindent| \\
%     \qquad(sub3section) &amp; |0pt| \\
%     \qquad(sub4section) &amp; åŒä¸Š \\
%     \bottomrule
%     \end{tabular}
%   \end{minipage}
% \end{table}
%
% \begin{function}[EXP,updated=2020-04-23]{.../indent}
%   \begin{syntax}
%   indent = \Arg{ç¼©è¿›é—´è·}
%   \end{syntax}
%   \opt{indent} é€‰é¡¹ç”¨äºŽè®¾ç½®ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜æœ¬èº«çš„é¦–è¡Œç¼©è¿›ã€‚
%   è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:indent-default}ã€‚
%
%   å¦‚æžœ \opt{indent} çš„å€¼æ˜¯ä»¥ \texttt{em}ã€\texttt{ex} æˆ– \cs{ccwd} ä¸ºå•ä½ï¼Œ
%   é‚£ä¹ˆç¼©è¿›é—´è·çš„å¤§å°æ˜¯ç›¸å¯¹äºŽ \opt{format} ä¸­æŒ‡å®šçš„å­—å·å¤§å°ã€‚
%   ä¾‹å¦‚ï¼Œè®¾ç½® \tn{part} æ&nbsp;‡é¢˜ç¼©è¿›ä¸‰ä¸ªå­—ã€\tn{section} æ&nbsp;‡é¢˜ç¼©è¿› \SI{20}{pt}ï¼š
%   \begin{ctexexam}
%   \ctexset{
%     part = {
%       format += \raggedright,
%       indent  = 3\ccwd,
%     },
%     section = {
%       format  = \Large\bfseries,
%       indent  = 20pt,
%     }
%   }
%   \part{é¦–è¡Œç¼©è¿›çš„æ&nbsp;‡é¢˜}
%   \noindent æ—&nbsp;ç¼©è¿›çš„æ­£æ–‡ã€‚
%   \section{é¦–è¡Œç¼©è¿›çš„æ&nbsp;‡é¢˜}
%   \noindent æ—&nbsp;ç¼©è¿›çš„æ­£æ–‡ã€‚
%   \end{ctexexam}
% \end{function}
%
% \begin{function}[EXP,updated=2016-05-10]{.../beforeskip}
%   \begin{syntax}
%   beforeskip = \Arg{å¼¹æ€§é—´è·}
%   \end{syntax}
%   \opt{beforeskip} é€‰é¡¹ç”¨äºŽè®¾ç½®ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜å‰çš„åž‚ç›´é—´è·ã€‚
%   è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:beforeskip-default}ã€‚
% \end{function}
%
% \begin{function}[EXP,updated=2015-06-27]{.../afterskip}
%   \begin{syntax}
%   afterskip = \Arg{å¼¹æ€§é—´è·}
%   \end{syntax}
%   \opt{afterskip} é€‰é¡¹æŽ§åˆ¶ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜ä¸ŽåŽé¢ä¸‹æ–¹ä¹‹é—´çš„è·ç¦»ã€‚
%
%   å¯¹äºŽ \tn{section} çº§ä»¥ä¸‹æ&nbsp;‡é¢˜ï¼Œ\opt{runin} é€‰é¡¹ä¼šå½±å“ \opt{afterskip} é€‰é¡¹çš„æ„ä¹‰ï¼š
%   è‹¥ \opt{runin} ä¸º \opt{true}ï¼Œæ&nbsp;‡é¢˜ä¸ŽéšåŽæ­£æ–‡æŽ’åœ¨åŒä¸€æ®µï¼Œ\meta{å¼¹æ€§é—´è·} ç»™å‡ºæ°´å¹³é—´è·ã€‚
%   å¦åˆ™ï¼Œæ­£æ–‡å¦èµ·ä¸€æ®µï¼Œ\meta{å¼¹æ€§é—´è·} ç»™å‡ºçš„æ˜¯åž‚ç›´é—´è·ã€‚
%
%   è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:afterskip-default}ã€‚
%   æ³¨æ„ \opt{sub3section} æˆ– \opt{sub4section} å®åŒ…é€‰é¡¹ï¼ˆè§
%   \ref{subs:options-heading}~èŠ‚ï¼‰ä¼šå½±å“ \opt{aftertitle} é€‰é¡¹çš„é»˜è®¤å€¼ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \setlength\leftskip{0pt plus 1 fil minus \marginparwidth}
%   \begin{minipage}[t]{.6\linewidth}
%     \small\centering
%     \caption{\opt{beforeskip} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%     \label{tab:beforeskip-default}
%     \begin{tabular}{ll}
%     \toprule
%     æ&nbsp;‡é¢˜å &amp; é»˜è®¤å€¼ \\
%     \midrule
%     part (article) &amp; |4ex| \\
%     part (beamer) &amp; |0pt| \\
%     part &amp; |0pt plus 1fil| \\
%     chapter &amp; |50pt| \\
%     section (beamer) &amp; |0pt| \\
%     section &amp; |3.5ex plus 1ex minus .2ex| \\
%     subsection (beamer) &amp; |0pt| \\
%     subsection &amp; |3.25ex plus 1ex minus .2ex| \\
%     subsubsection &amp; |3.25ex plus 1ex minus .2ex| \\
%     paragraph &amp; |3.25ex plus 1ex minus .2ex| \\
%     subparagraph &amp; |3.25ex plus 1ex minus .2ex| \\
%     \bottomrule
%     \end{tabular}
%   \end{minipage}\nobreak\quad
%   \begin{minipage}[t]{.5\linewidth}
%     \small\centering
%     \caption{\opt{afterskip} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%     \label{tab:afterskip-default}
%     \begin{tabular}{ll}
%     \toprule
%     æ&nbsp;‡é¢˜å &amp; é»˜è®¤å€¼ \\
%     \midrule
%     part (article) &amp; |3ex| \\
%     part (beamer) &amp; |0pt| \\
%     part &amp; |0pt plus 1fil| \\
%     chapter &amp; |40pt| \\
%     section (beamer) &amp; |0pt| \\
%     section &amp; |2.3ex plus .2ex| \\
%     subsection (beamer) &amp; |0pt| \\
%     subsection &amp; |1.5ex plus .2ex| \\
%     subsubsection &amp; |1.5ex plus .2ex| \\
%     paragraph &amp; |1em| \\
%     \qquad(sub3section) &amp; |1ex plus .2ex| \\
%     \qquad(sub4section) &amp; åŒä¸Š \\
%     subparagraph &amp; |1em| \\
%     \qquad(sub4section) &amp; |1ex plus .2ex| \\
%     \bottomrule
%     \end{tabular}
%   \end{minipage}
% \end{table}
%
% \begin{function}[EXP,added=2016-06-03]{.../fixskip}
%   \begin{syntax}
%   fixskip = \TFF
%   \end{syntax}
%   é»˜è®¤æƒ…å†µä¸‹ï¼Œ\cls{article}ã€\cls{book} å’Œ \cls{report} ç±»çš„æ&nbsp;‡é¢˜ä¸Žæ­£æ–‡çš„è·ç¦»
%   é™¤äº†ç”± \opt{beforeskip} å’Œ \opt{afterskip} é€‰é¡¹è®¾ç½®çš„åž‚ç›´é—´è·å¤–ï¼Œè¿˜ä¼šæœ‰
%   ä¸€äº›å¤šä½™çš„é—´è·ã€‚\opt{fixskip} é€‰é¡¹ç”¨äºŽæŠ‘åˆ¶è¿™äº›å¤šä½™é—´è·ã€‚è¯¥é€‰é¡¹é»˜è®¤ä¸å¼€å¯ã€‚
% \end{function}
%
% \begin{function}[EXP,added=2016-09-19]{.../break, .../break+}
%   \begin{syntax}
%     break = \Arg{æ&nbsp;¼å¼å‘½ä»¤}
%     break+= \Arg{æ&nbsp;¼å¼å‘½ä»¤}
%   \end{syntax}
%   \opt{break} é€‰é¡¹ç”¨äºŽæŽ§åˆ¶ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜ä¸Ž\emph{ä¹‹å‰}æ­£æ–‡çš„åˆ†éš”å…³ç³»ã€‚
%   ä¸€èˆ¬ç”¨äºŽè®¾ç½®æ˜¯å¦åœ¨æ&nbsp;‡é¢˜ä¹‹å‰åˆ†é¡µæˆ–è€…è®¾ç½®è¡Œé—´ç½šç‚¹ã€‚
%   \opt{break+} ç”¨äºŽåœ¨å·²æœ‰çš„æ&nbsp;¼å¼å‘½ä»¤åŽé™„åŠ&nbsp;å†…å®¹ã€‚
%
%   ä¾‹å¦‚ï¼Œè‹¥å½“å‰é¡µå‰©ä½™é«˜åº¦å°äºŽæ­£æ–‡é«˜åº¦çš„ä¸€åŠæ—¶ï¼Œåˆ™å¦èµ·ä¸€é¡µè¾“å‡º
%   \tn{section} æ&nbsp;‡é¢˜ï¼š
%   \begin{ctexexam}
%   \usepackage{needspace}
%   \ctexset{section/break = \Needspace{.5\textheight}}
%   \end{ctexexam}
%
%   è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:break-default}ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \small\centering
%   \caption{\opt{break} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%   \label{tab:break-default}
%   \begin{tabular}{ll}
%   \toprule
%   æ&nbsp;‡é¢˜å &amp; é»˜è®¤å€¼ \\
%   \midrule
%   part (article) &amp; |{}| \\
%   part &amp; |\if@openright\cleardoublepage\else\clearpage\fi| \\
%   chapter &amp; åŒä¸Š \\
%   section &amp; |\addpenalty{\@secpenalty}| \\
%   subsection &amp; åŒä¸Š \\
%   subsubsection &amp; åŒä¸Š \\
%   paragraph &amp; åŒä¸Š \\
%   subparagraph &amp; åŒä¸Š \\
%   \bottomrule
%   \end{tabular}
% \end{table}
%
% \begin{function}[EXP,added=2015-06-27]{.../afterindent}
%   \begin{syntax}
%   afterindent = \TF
%   \end{syntax}
%   \opt{afterindent} é€‰é¡¹ç”¨äºŽè®¾ç½®ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜åŽé¦–æ®µçš„ç¼©è¿›ã€‚
%
%   \cls{book} å’Œ \cls{report} ç±»çš„ \tn{part} æ&nbsp;‡é¢˜è¢«å•ç‹¬æŽ’åœ¨ä¸€é¡µä¹‹ä¸Šï¼Œ
%   \opt{afterindent} é€‰é¡¹æ²¡æœ‰æ„ä¹‰ã€‚
%   å¯¹äºŽ \tn{section} çº§ä»¥ä¸‹æ&nbsp;‡é¢˜ï¼Œè‹¥è®¾ç½®äº† \opt{runin} é€‰é¡¹ä¸º \opt{true}ï¼Œ
%   å³æ&nbsp;‡é¢˜ä¸ŽéšåŽæ­£æ–‡æŽ’åœ¨åŒä¸€æ®µï¼Œ\opt{afterindent} é€‰é¡¹ä¹Ÿå°±æ²¡æœ‰äº†æ„ä¹‰ã€‚
%
%   è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:afterindent-default}ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \small\centering
%   \caption{\opt{afterindent} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%   \label{tab:afterindent-default}
%   \begin{tabular}{lll}
%   \toprule
%   æ&nbsp;‡é¢˜å &amp; \opt{scheme = chinese} &amp; \opt{scheme = plain} \\
%   \midrule
%   part (article) &amp; |true| &amp; |false| \\
%   part &amp; æ—&nbsp;æ•ˆ &amp; æ—&nbsp;æ•ˆ \\
%   chapter &amp; |true| &amp; |false| \\
%   section &amp; |true| &amp; |false| \\
%   subsection &amp; |true| &amp; |false| \\
%   subsubsection &amp; |true| &amp; |false| \\
%   paragraph &amp; |true| &amp; |false| \\
%   subparagraph &amp; |true| &amp; |false| \\
%   \bottomrule
%   \end{tabular}
% \end{table}
%
% \subsection{ç›®å½•ã€é™„å½•ç›¸å…³}
% \label{subsec:sec-toc-appendix}
%
% \begin{function}[EXP,added=2020-05-06]{tocdepth}
%   \begin{syntax}
%     tocdepth = &lt;æ•´æ•°æˆ–ç«&nbsp;èŠ‚åç§°&gt;
%   \end{syntax}
%   è®¾ç½®å¯¹ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜ç¼–å…¥ç›®å½•çš„å±‚æ¬¡æ•°ã€‚\opt{tocdepth} çš„å€¼å¯ä»¥æ˜¯ä¸€ä¸ªæ•´æ•°ï¼Œä¹Ÿå¯ä»¥æ˜¯
%   |part|, |chapter| ç­‰åç§°ã€‚
%   å±‚æ¬¡æ•°ä¸Žåç§°çš„å¯¹åº”å…³ç³»è§è¡¨~\ref{tab:heading-level}ã€‚
%   ç«&nbsp;èŠ‚å±‚æ¬¡çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:heading-level-default}ã€‚
% \end{function}
%
% \begin{function}[EXP,added=2016-10-25]{.../tocline}
%   \begin{syntax}
%     tocline = \Arg{æ&nbsp;¼å¼å®šä¹‰}
%   \end{syntax}
%   \opt{tocline} é€‰é¡¹ç”¨äºŽå®šä¹‰ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜åœ¨ç›®å½•æ–‡ä»¶ï¼ˆ\file{.toc}ï¼‰ä¸­çš„æ&nbsp;¼å¼ã€‚
%   \meta{æ&nbsp;¼å¼å®šä¹‰}æœ‰ä¸¤ä¸ªå‚æ•°ï¼šå‚æ•° |#1| æ˜¯ |part|ã€|chapter| ç­‰åå­—ï¼Œ
%   å‚æ•° |#2| æ˜¯æ&nbsp;‡é¢˜å†…å®¹ã€‚è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:tocline-default}ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \small\centering
%   \caption{\opt{tocline} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%   \label{tab:tocline-default}
%   \begin{tabular}{ll}
%   \toprule
%   æ&nbsp;‡é¢˜å &amp; é»˜è®¤å€¼ \\
%   \midrule
%   part &amp; |\CTEXifname{\CTEXthepart\hspace{1em}}{}#2| \\
%   chapter (\opt{chinese})
%     &amp; |\CTEXifname{\protect\numberline{\CTEXthechapter\hspace{.3em}}}{}#2| \\
%   chapter (\opt{plain})
%     &amp; |\CTEXnumberline{#1}#2| \\
%   section &amp; |\CTEXnumberline{#1}#2| \\
%   subsection &amp; åŒä¸Š \\
%   subsubsection &amp; åŒä¸Š \\
%   paragraph &amp; åŒä¸Š \\
%   subparagraph &amp; åŒä¸Š \\
%   \bottomrule
%   \end{tabular}
%
%   \medskip
%   \raggedright
%   è¿™é‡Œ \tn{CTEXnumberline} çš„æ„ä¹‰æ˜¯ï¼Œè‹¥æ&nbsp;‡é¢˜ |#1| æ²¡æœ‰åå­—ï¼Œåˆ™ä¸è¾“å‡º
%   |\numberline{\CTEXthe#1}| ç­‰ç¼–å·ï¼š
%   \begin{verbatim}
%     \CTEXifname{\protect\numberline{\csname CTEXthe#1\endcsname}}{}
%   \end{verbatim}
%   å…¶ä¸­ï¼Œ\tn{CTEXifname} çš„å®šä¹‰è§ \ref{subsec:sec-commands}~å°èŠ‚ã€‚
% \end{table}
%
% \begin{function}[EXP,added=2016-10-01]{chapter/lofskip, chapter/lotskip}
%   \begin{syntax}
%   lofskip = \Arg{å¼¹æ€§é—´è·}
%   lotskip = \Arg{å¼¹æ€§é—´è·}
%   \end{syntax}
%   \opt{lofskip} é€‰é¡¹æŽ§åˆ¶æ’å›¾ç›®å½•ï¼ˆ\file{.lof}ï¼‰ä¸­ï¼Œç«&nbsp;ä¹‹é—´çš„æ’å›¾æ&nbsp;‡é¢˜çš„è·ç¦»ã€‚
%   åŒæ&nbsp;·ï¼Œ\opt{lotskip} é€‰é¡¹æŽ§åˆ¶è¡¨æ&nbsp;¼ç›®å½•ï¼ˆ\file{.lot}ï¼‰ä¸­ï¼Œç«&nbsp;ä¹‹é—´çš„è¡¨æ&nbsp;¼æ&nbsp;‡é¢˜
%   çš„è·ç¦»ã€‚
%
%   ç›®å‰ï¼Œè¿™ä¸¤ä¸ªé€‰é¡¹åªåœ¨ \opt{chapter} æ&nbsp;‡é¢˜ä¸‹æœ‰å®šä¹‰ã€‚
%   å®ƒä»¬çš„é»˜è®¤å€¼ï¼Œåœ¨ \opt{scheme} é€‰é¡¹çš„ä¸åŒå–å€¼ä¸‹éƒ½ä¸º \SI{10}{pt}ã€‚
% \end{function}
%
% \begin{function}[EXP,added=2015-06-21]{appendix/numbering}
%   \begin{syntax}
%     numbering = \TTF
%   \end{syntax}
%   æŽ§åˆ¶æ˜¯å¦å¯¹é™„å½•ç«&nbsp;ï¼ˆå¯¹åº” \cls{book} ä¸Ž \cls{report}ï¼‰æˆ–é™„å½•èŠ‚
%   ï¼ˆå¯¹åº” \cls{article}ï¼‰è¿›è¡Œç¼–å·ï¼Œç”¨æ³•ä¸Žæ™®é€šç«&nbsp;èŠ‚å¯¹åº”çš„ \opt{numbering}
%   é€‰é¡¹ç›¸åŒã€‚è¯¥é€‰é¡¹é»˜è®¤å€¼ä¸º \opt{true}ã€‚
% \end{function}
%
% \begin{function}[EXP,updated=2014-03-08]{appendix/name}
%   \begin{syntax}
%     name = \{&lt;å‰åå­—&gt;,&lt;åŽåå­—&gt;\}
%     name = \Arg{å‰åå­—}
%   \end{syntax}
%   è®¾ç½®é™„å½•ç«&nbsp;ï¼ˆå¯¹åº” \cls{book} ä¸Ž \cls{report}ï¼‰æˆ–é™„å½•èŠ‚ï¼ˆå¯¹åº” \cls{article}ï¼‰
%   çš„åå­—ï¼Œç”¨æ³•ä¸Žæ™®é€šç«&nbsp;èŠ‚å¯¹åº”çš„ \opt{name} é€‰é¡¹ç›¸åŒã€‚
%
%   æ³¨æ„è¯¥é€‰é¡¹ä¸Ž \opt{appendixname} é€‰é¡¹ï¼ˆ\ref{subs:capname}~èŠ‚ï¼‰åœ¨æ„ä¹‰ä¸Šæœ‰
%   äº›é‡å&nbsp;ï¼Œä½†ä¸å®Œå…¨ç›¸åŒã€‚\opt{appendixname} é€‰é¡¹åªç”¨æ¥é‡å®šä¹‰
%   \tn{appendixname}ï¼Œè€Œä¸ç®¡ \tn{appendixname} å¦‚ä½•ä½¿ç”¨ï¼›è¯¥é€‰é¡¹åˆ™å†³å®šåœ¨ç«&nbsp;èŠ‚
%   æ&nbsp;‡é¢˜ä¸­è¾“å‡ºçš„åå­—ï¼Œå¯ä»¥è°ƒç”¨ \tn{appendixname} è®¾ç½®ã€‚
%
%   è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:appendix-name-default}ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \small\centering
%   \caption{\opt{appendix/name} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%   \label{tab:appendix-name-default}
%   \begin{tabular}{llllll}
%   \toprule
%   æ–‡æ¡£ç±» &amp; å½±å“å‘½ä»¤ &amp; \opt{scheme = chinese} &amp; å®žé™…å®šä¹‰
%     &amp; \opt{scheme = plain} &amp; å®žé™…å®šä¹‰ \\
%   \midrule
%   \cls{article} &amp; \tn{section} &amp; |{}| &amp; &amp; |{}| &amp; \\
%   \cls{book}, \cls{report}
%       &amp; \tn{chapter} &amp; |\appendixname\space| &amp; \verb*|é™„å½• |
%       &amp; |\appendixname\space| &amp; \verb*|Appendix | \\
%   \bottomrule
%   \end{tabular}
% \end{table}
%
% \begin{function}[EXP]{appendix/number}
%   \begin{syntax}
%     number = \Arg{æ•°å­—è¾“å‡ºå‘½ä»¤}
%   \end{syntax}
%   è®¾ç½®é™„å½•ç«&nbsp;ï¼ˆå¯¹ \cls{book} ä¸Ž \cls{report}ï¼‰æˆ–é™„å½•èŠ‚ï¼ˆå¯¹ \cls{article}ï¼‰
%   ç¼–å·çš„æ•°å­—è¾“å‡ºæ&nbsp;¼å¼ï¼Œç”¨æ³•ä¸Žæ™®é€šç«&nbsp;èŠ‚å¯¹åº”çš„ \opt{number} é€‰é¡¹ç›¸åŒã€‚
%
%   \opt{appendix/number} é€‰é¡¹åŒæ—¶ä¹Ÿä¼šæŽ§åˆ¶é™„å½•ç«&nbsp;èŠ‚è®¡æ•°å™¨çš„äº¤å‰å¼•ç”¨ã€‚
%   ä¸Žæ™®é€šç«&nbsp;èŠ‚çš„ \opt{number} é€‰é¡¹ç±»ä¼¼ï¼ŒåŒæ&nbsp;·éœ€è¦æ³¨æ„ï¼Œè¯¥é€‰é¡¹ä¸ä¼šå½±å“è®¡æ•°å™¨æœ¬èº«
%   çš„è¾“å‡ºï¼Œå³ä¸å½±å“ \tn{thesection} æˆ– \tn{thechapter} çš„å®šä¹‰ã€‚
%
%   è¯¥é€‰é¡¹çš„é»˜è®¤è®¾ç½®è§è¡¨~\ref{tab:appendix-number-default}ã€‚
% \end{function}
%
% \begin{table}[htbp]
%   \small\centering
%   \caption{\opt{appendix/number} é€‰é¡¹çš„é»˜è®¤è®¾ç½®}
%   \label{tab:appendix-number-default}
%   \begin{tabular}{llllll}
%   \toprule
%   æ–‡æ¡£ç±» &amp; å½±å“å‘½ä»¤ &amp; é»˜è®¤å€¼ \\
%   \midrule
%   \cls{article} &amp; \tn{section} &amp; |\Alph{section}| \\
%   \cls{book}, \cls{report} &amp; \tn{chapter} &amp; |\Alph{chapter}| \\
%   \bottomrule
%   \end{tabular}
% \end{table}
%
% \subsection{è¾…åŠ©å‘½ä»¤}
% \label{subsec:sec-commands}
%
% \CTeX{} å®é›†è¿˜æä¾›äº†ä¸€äº›è¾…åŠ©å‘½ä»¤ï¼ˆå®ï¼‰ï¼Œç”¨äºŽå­˜å‚¨ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜æ&nbsp;¼å¼ï¼Œæˆ–è¿›è¡Œä¸€äº›æ¡ä»¶åˆ¤æ–­ã€‚
%
% \begin{function}{\CTEXthepart, \CTEXthechapter, \CTEXthesection,
%   \CTEXthesubsection, \CTEXthesubsubsection, \CTEXtheparagraph,
%   \CTEXthesubparagraph}
%   ä»¥ |\CTEXthe| å¼€å¤´çš„è¿™ç»„å®ç»™å‡ºç»“åˆäº† \opt{name} ä¸Ž \opt{number} é€‰é¡¹çš„ç«&nbsp;èŠ‚
%   ç¼–å·è¾“å‡ºæ&nbsp;¼å¼ã€‚ä¾‹å¦‚åœ¨ \opt{scheme = chinese} æ—¶ï¼Œé»˜è®¤ç«&nbsp;ç¼–å·è¾“å‡ºæ&nbsp;¼å¼å°±æ˜¯
%   \tn{CTEXthechapter}ï¼Œå½¢å¦‚â€œç¬¬ä¸€ç«&nbsp;â€ã€‚
%
%   è¿™ç»„å®åœ¨ \CTeX æ–‡æ¡£ç±»ä¸­å°†ä»£æ›¿ \tn{thechapter} ç­‰å®çš„ä½œç”¨ï¼Œåœ¨ç«&nbsp;èŠ‚ä¸­å¼•ç”¨æœ¬ç«&nbsp;
%   èŠ‚çš„å®Œæ•´ç¼–å·ã€‚ä¾‹å¦‚ç”¨äºŽå¸®åŠ©å®šä¹‰è‡ªå®šä¹‰çš„ç›®å½•æ&nbsp;¼å¼ã€é¡µçœ‰æ&nbsp;¼å¼ç­‰ã€‚
% \end{function}
%
% \begin{function}[added=2016-09-18]{\CTEXifname}
%   \begin{syntax}
%     \tn{CTEXifname} \Arg{æœ‰åå­—æ—¶çš„å†…å®¹} \Arg{æ—&nbsp;åå­—æ—¶çš„å†…å®¹}
%   \end{syntax}
%   \tn{CTEXifname} ä¼šæ&nbsp;¹æ®å½“å‰ç«&nbsp;èŠ‚æœ‰æ—&nbsp;åå­—å±•å¼€å¾—åˆ°ä¸åŒå†…å®¹ï¼ˆé€šå¸¸æ˜¯æ&nbsp;¼å¼å‘½ä»¤ï¼‰ã€‚
%   ç”±äºŽç«&nbsp;èŠ‚åå­—æ€»æ˜¯ä¸Žç¼–å·ä¸€èµ·å‡ºçŽ°ï¼Œç«&nbsp;èŠ‚æœ‰æ—&nbsp;åå­—é€šå¸¸ä¹Ÿè¡¨è¾¾ä¸ºâ€œç«&nbsp;èŠ‚æ˜¯å¦ç¼–å·â€ã€‚
%   åœ¨ \LaTeX{} ä¸­ï¼ŒåŽè€…å–å†³äºŽä»¥ä¸‹å‡&nbsp;ä¸ªæ–¹é¢ï¼šç«&nbsp;èŠ‚æ·±åº¦æ˜¯å¦ä¸å¤§äºŽè®¡æ•°å™¨
%   |secnumdepth| çš„å€¼ï¼Œç«&nbsp;èŠ‚æ&nbsp;‡é¢˜æ˜¯å¦ä½¿ç”¨ä¸å¸¦æ˜Ÿå·çš„å‘½ä»¤ã€‚åœ¨ \CTeX{} å®é›†ä¸­ï¼Œ
%   åŽè€…è¿˜å–å†³äºŽ \opt{.../numbering} æ˜¯å¦ä¸º \opt{true}ã€‚
%
%   \tn{CTEXifname} å¯ç”¨äºŽ \opt{format}, \opt{titleformat}, \opt{aftertitle},
%   \opt{afterskip}, \opt{indent} è¿™äº”ä¸ªé€‰é¡¹å’Œ \tn{chapter} æ&nbsp;‡é¢˜
%   \opt{beforeskip} é€‰é¡¹çš„æ&nbsp;¼å¼è®¾ç½®ä¹‹ä¸­ã€‚ä¹Ÿå¯ç”¨äºŽå¸®åŠ©å®šä¹‰è‡ªå®šä¹‰çš„ç›®å½•æ&nbsp;¼å¼ã€
%   é¡µçœ‰æ&nbsp;¼å¼ç­‰ã€‚
%
%   ä¾‹å¦‚ï¼Œè®¾ç½®ç«&nbsp;çš„æ&nbsp;‡é¢˜æœ‰åå­—æ—¶å·¦å¯¹é½ï¼Œæ—&nbsp;åå­—æ—¶å±…ä¸­å¯¹é½ï¼Œå¹¶ä¸”åœ¨æ&nbsp;‡é¢˜åŽç”»ä¸€æ¡æ¨ªçº¿ã€‚
%   \begin{ctexexam}
%   \ctexset{
%     chapter/format     = \CTEXifname{\raggedright}{\centering},
%     chapter/aftertitle = \par\CTEXifname{}{\hrule},
%   }
%   \end{ctexexam}
% \end{function}
%
% \subsection{ç¤ºä¾‹}
%
% æˆ‘ä»¬æœ€åŽä¸¾ä¸€ä¸ªç¨å¾®å¤æ‚çš„ä¾‹å­ï¼Œæ¥çœ‹çœ‹ä¸Šè¿°é€‰é¡¹çš„ç»¼åˆåº”ç”¨ã€‚
%
% \begin{ctexexam}[labelref=exam:miscopt]
%   \ctexset {
%     chapter = {
%       beforeskip = 0pt,
%       fixskip    = true,
%       format     = \Huge\bfseries,
%       nameformat = \rule{\linewidth}{1bp}\par\bigskip\hfill\chapternamebox,
%       number     = \arabic{chapter},
%       aftername  = \par\medskip,
%       aftertitle = \par\bigskip\nointerlineskip\rule{\linewidth}{2bp}\par
%     }
%   }
%   \newcommand\chapternamebox[1]{%
%     \parbox{\ccwd}{\linespread{1}\selectfont\centering #1}}
%   ......
%   \chapter{ç†Ÿæ‚‰ \LaTeX}
% \end{ctexexam}
% æœ¬ä¾‹çš„è®¾ç½®æ•ˆæžœå¤§è‡´å¦‚ä¸‹ï¼š
% \begin{center}
% \begin{minipage}{.75\linewidth}\Large\bfseries
% \hrule height .5bp \relax
% \medskip
% \hfill\parbox{\ccwd}{\linespread{1}\selectfont\centering ç¬¬ 1 ç«&nbsp;}
% \par\smallskip
% \noindent ç†Ÿæ‚‰ \LaTeX
% \medskip\hrule height 1bp \relax
% \end{minipage}
% \end{center}
%
% \section{å®žç”¨å‘½ä»¤}
% \label{sec:useful-commands}
% \subsection{å­—å·ä¸Žé—´è·}
%
% \begin{function}[updated = 2014-03-08, label = ]{\zihao}
%   \begin{syntax}
%     \tn{zihao} \Arg{å­—å·}
%   \end{syntax}
%   ç”¨äºŽè°ƒæ•´å­—å·å¤§å°ã€‚å…¶ä¸­ \meta{å­—å·} çš„æœ‰æ•ˆå€¼å…±æœ‰ 16 ä¸ªï¼Œå¦‚è¡¨ \ref{tab:zihao}
%   æ‰€ç¤ºã€‚ä½¿ç”¨ \tn{zihao} å‘½ä»¤è°ƒæ•´å­—ä½“å¤§å°æ—¶ï¼Œè¥¿æ–‡å­—å·å¤§å°ä¼šå§‹ç»ˆå’Œä¸­æ–‡å­—å·ä¿æŒä¸€è‡´ã€‚
% \end{function}
%
% \begin{table}[!htbp]
% \centering
% \def\ZH#1{\zihaopt{#1} &amp; \zihao{#1}}
% \tabcolsep=1em
% \caption{ä¸­æ–‡å­—å·}\label{tab:zihao}
% \begin{tabular}{&gt;{\ttfamily}S[mode=text,detect-family,table-format=-1]
%                             S[table-format=2.1]S[table-format=2.5]l}
% \toprule
% {\meta{å­—å·}} &amp; {å¤§å°(bp)} &amp; {å¤§å°(pt)} &amp; æ„ä¹‰ \\
% \midrule
%  0   &amp; 42   &amp; \ZH{0}    åˆå·    \\
% {âˆ’0} &amp; 36   &amp; \ZH{-0}   å°åˆå·  \\
%  1   &amp; 26   &amp; \ZH{1}    ä¸€å·    \\
% -1   &amp; 24   &amp; \ZH{-1}   å°ä¸€å·  \\
%  2   &amp; 22   &amp; \ZH{2}    äºŒå·    \\
% -2   &amp; 18   &amp; \ZH{-2}   å°äºŒå·  \\
%  3   &amp; 16   &amp; \ZH{3}    ä¸‰å·    \\
% -3   &amp; 15   &amp; \ZH{-3}   å°ä¸‰å·  \\
%  4   &amp; 14   &amp; \ZH{4}    å››å·    \\
% -4   &amp; 12   &amp; \ZH{-4}   å°å››å·  \\
%  5   &amp; 10.5 &amp; \ZH{5}    äº”å·    \\
% -5   &amp;  9   &amp; \ZH{-5}   å°äº”å·  \\
%  6   &amp;  7.5 &amp; \ZH{6}    å…­å·    \\
% -6   &amp;  6.5 &amp; \ZH{-6}   å°å…­å·  \\
%  7   &amp;  5.5 &amp; \ZH{7}    ä¸ƒå·    \\
%  8   &amp;  5   &amp; \ZH{8}    å…«å·    \\
% \bottomrule
% \end{tabular}
% \end{table}
%
% \begin{function}[updated=2014-03-28]{\ziju}
%   \begin{syntax}
%     \tn{ziju} \Arg{ä¸­æ–‡å­—ç¬¦å®½åº¦çš„å€æ•°}
%   \end{syntax}
%   ç”¨äºŽè°ƒæ•´ç›¸é‚»æ±‰å­—ä¹‹é—´çš„é—´è·ï¼Œå³ï¼ˆåœ¨æ­£å¸¸ä¸­æ–‡è¡Œæ–‡ä¸­ï¼‰å‰ä¸€ä¸ªæ±‰å­—çš„å³è¾¹ç¼˜ä¸ŽåŽä¸€ä¸ªæ±‰å­—
%   çš„å·¦è¾¹ç¼˜ä¹‹é—´çš„è·ç¦»ã€‚å…¶ä¸­å‚æ•°å¯ä»¥æ˜¯ä»»æ„æµ®ç‚¹æ•°å€¼ï¼›è€Œä¸­æ–‡å­—ç¬¦å®½åº¦æŒ‡çš„æ˜¯å®žé™…æ±‰å­—çš„
%   å®½åº¦ï¼Œä¸åŒ…å«å½“å‰å­—è·ã€‚
%
%   è¿™ä¸ªå‘½ä»¤ä¼šå½±å“ \tn{ccwd} çš„å€¼ï¼Œä½†ä¸ä¼šå½±å“è‹±æ–‡å­—è·ã€‚
% \end{function}
%
% \begin{function}[updated=2014-03-27]{\ccwd}
%   å½“å‰æ±‰å­—çš„å­—å®½ä¿å­˜åœ¨é•¿åº¦å¯„å­˜å™¨ \tn{ccwd} ä¹‹ä¸­ã€‚æ±‰å­—å­—å®½æ˜¯ç›¸é‚»ä¸¤ä¸ªæ±‰å­—ä¸­å¿ƒ
%   ä¹‹é—´çš„è·ç¦»ï¼ŒåŒ…å«å­—è·åœ¨å†…ã€‚å›&nbsp;æ­¤ä¿®æ”¹å­—è·ä¼šé—´æŽ¥ä¿®æ”¹å­—å®½ã€‚
% \end{function}
%
% \subsection{ä¸­æ–‡æ•°å­—è½¬æ¢}
%
% \CTeX{} å®é›†çš„ä¸­æ–‡æ•°å­—è½¬æ¢åŠŸèƒ½å®žé™…ä¸Šæ˜¯è°ƒç”¨ \pkg{zhnumber} å®åŒ…æ¥å®Œæˆã€‚ä¸‹é¢åª
% ä»‹ç»ä¸€äº›åŸºæœ¬çš„ç”¨æ³•ï¼Œæ›´é«˜çº§çš„ç”¨æ³•å¯ä»¥æŸ¥é˜… \pkg{zhnumber} å®åŒ…çš„æ–‡æ¡£ã€‚
%
% \begin{function}[updated=2016-05-01]{\chinese}
%   \begin{syntax}
%     \tn{chinese} \Arg{counter}
%     \tn{pagenumbering} \{chinese\}
%   \end{syntax}
%   \tn{chinese} å‘½ä»¤ä¸Ž \tn{roman} ç­‰å‘½ä»¤çš„ç”¨æ³•ç±»ä¼¼ï¼Œä½œç”¨åœ¨ä¸€ä¸ª \LaTeX{}
%   è®¡æ•°å™¨ä¸Šï¼Œå°†è®¡æ•°å™¨çš„å€¼ä»¥ä¸­æ–‡æ•°å­—çš„å½¢å¼è¾“å‡ºã€‚
% \end{function}
%
% \begin{function}[added=2014-03-08]{\zhnumber}
%   \begin{syntax}
%     \tn{zhnumber} \Arg{number}
%   \end{syntax}
%   ä»¥ä¸­æ–‡æ&nbsp;¼å¼è¾“å‡ºæ•°å­—ã€‚è¿™é‡Œçš„æ•°å­—å¯ä»¥æ˜¯æ•´æ•°ã€å°æ•°å’Œåˆ†æ•°ã€‚
% \end{function}
%
% \begin{function}[added=2014-03-08]{\zhdigits}
%   \begin{syntax}
%     \tn{zhdigits} \Arg{number}
%   \end{syntax}
%   å°†é˜¿æ‹‰ä¼¯æ•°å­—è½¬æ¢ä¸ºä¸­æ–‡æ•°å­—ä¸²ã€‚
% \end{function}
%
% \begin{function}{\CTEXnumber}
%   \begin{syntax}
%     \tn{CTEXnumber} "\"&lt;macro&gt; \Arg{number}
%   \end{syntax}
%   |\|&lt;macro&gt; å¿…é¡»æ˜¯ä¸€ä¸ª \TeX{} å®ï¼Œä¸éœ€é¢„å…ˆå®šä¹‰ã€‚\tn{CTEXnumber} é€šè¿‡
%   \tn{zhnumber} å°† \meta{number} è½¬ä¸ºä¸­æ–‡æ•°å­—ï¼Œæœ€åŽå°†ç»“æžœå­˜å‚¨åœ¨ |\|&lt;macro&gt;
%   é‡Œã€‚å¯¹ |\|&lt;macro&gt; çš„å®šä¹‰æ˜¯å±€éƒ¨çš„ï¼Œå°†å®ƒå±•å¼€ä¸€æ¬¡å°±å¯ä»¥å¾—åˆ°è½¬æ¢ç»“æžœã€‚
% \end{function}
%
% ä¸€èˆ¬æ¥è¯´ï¼Œå¹¶ä¸éœ€è¦ä½¿ç”¨ \tn{CTEXnumber}ï¼Œç›´æŽ¥ä½¿ç”¨ \tn{zhnumber} å³å¯ã€‚ä½†æ˜¯ï¼Œå¦‚æžœ
% åœ¨æ–‡æ¡£ä¸­éœ€è¦å¤šæ¬¡ä½¿ç”¨åŒä¸€ä¸ªæ•°å­— \meta{number} çš„ä¸­æ–‡å½¢å¼ï¼Œå°±å¯ä»¥å…ˆç”¨
% \tn{CTEXnumber} å°†ç»“æžœä¿å­˜èµ·æ¥å¤‡ç”¨ï¼Œè€Œä¸æ˜¯æ¯æ¬¡ä½¿ç”¨æ—¶éƒ½ç”¨ \tn{zhnumber} çŽ°åœº
% è½¬æ¢ä¸€æ¬¡ã€‚
%
% \begin{function}{\CTEXdigits}
%   \begin{syntax}
%     \tn{CTEXdigits} "\"&lt;macro&gt; \Arg{number}
%   \end{syntax}
%   \tn{CTEXdigits} ä¸Ž \tn{CTEXnumber} ç±»ä¼¼ï¼Œä½†å…¶è½¬æ¢çš„ç»“æžœæ˜¯ä¸­æ–‡æ•°å­—ä¸²ï¼Œè€Œä¸æ˜¯
%   ä¸­æ–‡æ•°å­—ã€‚
% \end{function}
%
% \subsection{æ‚é¡¹}
%
% \begin{function}{\CTeX}
% ç”¨äºŽæ˜¾ç¤º \CTeX æ&nbsp;‡å¿—ã€‚
% \end{function}
%
% \section{\LuaLaTeX{} ä¸‹çš„ä¸­æ–‡æ”¯æŒæ–¹å¼}
% \label{sec:lualatex-chinese}
%
% åœ¨ \LuaLaTeX{} ä¸‹ï¼Œ\CTeX{} å®é›†ä¾èµ– \pkg{LuaTeX-ja} å®åŒ…æ¥å®Œæˆä¸­æ–‡æ”¯æŒã€‚
% è¯¥å®åŒ…æ˜¯æ—¥æœ¬ \TeX{} ç¤¾åŒºçš„åŒ—å·å¼˜å…¸ã€å‰ç”°ä¸€è´µã€å…«ç™»å´‡ä¹‹ç­‰äººå¼€å‘çš„ï¼Œè®¾è®¡ç›®çš„ä¸»è¦
% æ˜¯åœ¨ \LuaTeX{} å¼•æ“Žä¸‹å®žçŽ°æ—¥æœ¬ p\TeX{} å¼•æ“Žçš„ï¼ˆå¤§éƒ¨åˆ†ï¼‰åŠŸèƒ½ã€‚å®ƒä¸ºäº†å…¼å®¹ p\LaTeX
% çš„ä½¿ç”¨ä¹&nbsp;æƒ¯ï¼Œå¯¹ \LaTeXe çš„ \pkg{NFSS} ä½œäº†ä¸å°‘ä¿®æ”¹å’Œæ‰©å……ã€‚è¿™å¯¹äºŽç®€ä½“ä¸­æ–‡ç”¨æˆ·æ¥è¯´
% ä¸æ˜¯å¿…è¦çš„ï¼Œå›&nbsp;è€Œ \CTeX{} ç¦ç”¨äº†å®ƒåœ¨ \LaTeX{} æ&nbsp;¼å¼ä¸‹çš„å¤§éƒ¨åˆ†è®¾ç½®ï¼Œåªä¿ç•™äº†å¿…è¦çš„
% éƒ¨åˆ†ã€‚åŒæ—¶ä¿®æ”¹äº†å®ƒçš„å­—ä½“è®¾ç½®æ–¹å¼ï¼Œä½¿å¾—ç›¸å…³å‘½ä»¤ä¸Ž \pkg{xeCJK} å®åŒ…å¤§è‡´ç›¸åŒã€‚
%
% 20150420 ç‰ˆä»¥åŽçš„ \pkg{LuaTeX-ja} å®åŒ…å¼€å§‹æ”¯æŒç«–æŽ’ï¼Œä½† \CTeX{} æš‚ä¸æ”¯æŒç«–æŽ’ã€‚
%
% \subsection{\LuaLaTeX{} ä¸‹æ›¿ä»£å­—ä½“çš„è®¾ç½®}
%
% \begin{function}[updated=2020-04-30]{AlternateFont}
%   \begin{syntax}
%     \tn{setCJKfamilyfont} \Arg{family} \Arg{base font name}
%     \  [
%     \    &lt;base font features&gt; ,
%     \    AlternateFont =
%     \      \{
%     \        \Arg{character range_1} \Arg{alternate font name_1} ,
%     \        \Arg{character range_2} \Arg{alternate font name_2} \Arg{alternate font features_2} ,
%     \        ......
%     \      \}
%     \  ]
%   \end{syntax}
%   åœ¨è®¾ç½®å­—ä½“æ— \meta{family} çš„æ—¶å€™ï¼ŒåŒæ—¶è®¾ç½®è¯¥å­—ä½“æ—åœ¨å­—ç¬¦èŒƒå›´
%   \meta{character range_n} å†…ï¼Œå¯¹åº”å­—å½¢çš„æ›¿ä»£å­—ä½“ã€‚
% \end{function}
%
% \begin{function}[added=2014-04-14]{CharRange}
%   \begin{syntax}
%     \tn{setCJKfamilyfont} \Arg{family} \Arg{alternate font name}
%     \  [
%     \    CharRange = \Arg{character range} ,
%     \    &lt;alternate font features&gt;
%     \  ]
%   \end{syntax}
%   åªè®¾ç½®å­—ä½“æ— \meta{family} åœ¨å­—ç¬¦èŒƒå›´ \meta{character range} å†…ï¼Œå¯¹åº”å­—å½¢çš„
%   æ›¿ä»£å­—ä½“ã€‚
% \end{function}
%
% ä¸€ä¸ª \tn{setCJKfamilyfont} é‡Œåªèƒ½ä½¿ç”¨ä¸€æ¬¡ \opt{CharRange} æˆ–è€…
% \opt{AlternateFont}ï¼Œä½†å¯ä»¥å°†å®ƒä»¬åˆ†å¼€é‡å&nbsp;ä½¿ç”¨ã€‚ä¾‹å¦‚ä¸‹é¢çš„æ–¹å¼æ˜¯æœ‰æ•ˆçš„ã€‚
%
% \begin{ctexexam}
%   \setCJKmainfont[AlternateFont={...}{...}, ...]{...}
%   \setCJKmainfont[CharRange={"4E00-&gt;"67FF,-2}, ...]{...}
%   \setCJKmainfont[CharRange={"6800-&gt;"9FFF}, ...]{...}
% \end{ctexexam}
%
% \begin{function}[EXP,added=2020-04-30]{declarecharrange}
%   \begin{syntax}
%     \tn{ctexset}
%     \  \{
%     \    declarecharrange =
%     \      \{
%     \        \Arg{name_1} \Arg{character range_1} ,
%     \        \Arg{name_2} \Arg{character range_2} ,
%     \        ...
%     \      \}
%     \  \}
%   \end{syntax}
%   é¢„å…ˆå£°æ˜Žå­—ç¬¦èŒƒå›´ã€‚å£°æ˜Žå­—ç¬¦èŒƒå›´ \meta{name} ä¹‹åŽï¼Œå®ƒçš„åå­— \meta{name} å¯ä»¥
%   ç”¨åœ¨ \opt{AlternateFont} å’Œ \opt{CharRange} é€‰é¡¹çš„ \meta{character range}
%   ä¹‹ä¸­ï¼Œè¡¨ç¤ºå¯¹åº”çš„å­—ç¬¦èŒƒå›´ã€‚
% \end{function}
%
% åœ¨å£°æ˜Žå­—ç¬¦èŒƒå›´ \meta{name} çš„åŒæ—¶ï¼Œè¿˜ä¸º \tn{setCJKmainfont} ç­‰å­—ä½“è®¾ç½®å‘½ä»¤å®šä¹‰
% äº†é€‰é¡¹ \meta{name}ï¼Œç”¨äºŽè®¾ç½®å¯¹åº”å­—ç¬¦çš„æ›¿ä»£å­—ä½“ï¼š
% \begin{syntax}
%   \meta{name} = \Arg{alternate font name}
%   \meta{name} = \Arg{alternate font name} \Arg{alternate font features}
% \end{syntax}
% \meta{name} é€‰é¡¹å¯ä»¥ä¸Ž \opt{AlternateFont} å…±åŒä½¿ç”¨ï¼Œä½†ä¸èƒ½ä¸Ž \opt{CharRange}
% ä¸€èµ·ä½¿ç”¨ã€‚å¦‚æžœæ²¡æœ‰ç»™ \meta{name} è®¾ç½®å€¼ï¼Œåˆ™ç­‰ä»·äºŽè®¾ç½® \opt{CharRange=\meta{name}}ï¼Œ
% å³åªè®¾ç½® \meta{name} å¯¹åº”çš„å­—ç¬¦èŒƒå›´çš„æ›¿ä»£å­—ä½“ã€‚
%
% \begin{function}[EXP,added=2014-04-15]{clearalternatefont,resetalternatefont}
%   \begin{syntax}
%     \tn{ctexset}
%     \  \{
%     \    clearalternatefont = \Arg{family_1, family_2, ...} ,
%     \    resetalternatefont = \Arg{family_1, family_2, ...} ,
%     \    clearalternatefont ,
%     \    resetalternatefont
%     \  \}
%   \end{syntax}
%   æ¸…é™¤ä¸Žé‡ç½® CJK å­—ä½“æ— \meta{family} çš„æ›¿æ¢å­—ä½“è®¾ç½®ã€‚å¦‚æžœæ²¡æœ‰ç»™å®šå€¼ï¼Œåˆ™ä½œç”¨äºŽ
%   å½“å‰ CJK å­—ä½“æ—ã€‚æ¸…é™¤ä¸Žé‡ç½®æ“ä½œæ€»æ˜¯å…¨å±€çš„ã€‚
% \end{function}
%
% \section{\CTeX{} å®é›†çš„é…ç½®æ–‡ä»¶}
%
% \CTeX{} å®é›†æä¾›äº†ä¸åŒçš„é…ç½®æ–‡ä»¶ï¼Œå¯ä»¥é€šè¿‡ä¿®æ”¹é…ç½®æ–‡ä»¶æ¥æ”¹å˜ \CTeX{} å®é›†çš„
% é»˜è®¤è¡Œä¸ºã€‚
%
% åœ¨å¤šæ•°æƒ…å†µä¸‹ï¼Œå¹¶ä¸éœ€è¦ä¿®æ”¹é…ç½®æ–‡ä»¶ï¼Œ\CTeX{} å®é›†çš„é»˜è®¤è®¾ç½®å·²ç»èƒ½æ»¡è¶³å¤§å¤šæ•°ç”¨
% æˆ·çš„éœ€è¦ã€‚ä¸æ°å½“åœ°ä¿®æ”¹ \CTeX{} å®é›†çš„é»˜è®¤è¡Œä¸ºä¹Ÿå¯èƒ½å¯¼è‡´åŒä¸€æ–‡ä»¶åœ¨åˆ«å¤„æ—&nbsp;æ³•æ­£
% å¸¸ç¼–è¯‘æˆ–æŽ’ç‰ˆæ•ˆæžœå®Œå…¨ä¸åŒï¼Œå›&nbsp;æ­¤ä¿®æ”¹åº”è¯¥æ…Žé‡ã€‚
%
% ä½†åœ¨ä¸€äº›æƒ…å†µä¸‹ï¼Œç›´æŽ¥ä¿®æ”¹é…ç½®æ–‡ä»¶ä»æ˜¯å¿…è¦çš„ï¼Œä¾‹å¦‚ï¼š
% \begin{itemize}
% \item ç³»ç»Ÿæ²¡æœ‰å®‰è£…é»˜è®¤è®¾ç½®çš„å­—ä½“æ–‡ä»¶ï¼Œæ—&nbsp;æ³•ç¼–è¯‘ã€‚
% \item éœ€è¦ç»å¸¸ç¼–è¯‘æ¥è‡ªå…¶ä»–ç³»ç»Ÿçš„ä¸­æ–‡ \TeX{} æ–‡ä»¶ï¼Œä½†å¯¹æ–¹çš„æ“ä½œç³»ç»Ÿæˆ–é»˜è®¤è®¾ç½®
% ä¸Žæœ¬æœºä¸åŒã€‚
% \end{itemize}
%
% ä¸Ž \CTeX{} å®é›†çš„æºä»£ç&nbsp;ä¸€æ&nbsp;·ï¼Œé…ç½®æ–‡ä»¶é‡‡ç”¨ \LaTeXiii{} çš„è¯­æ³•ç¼–å†™ã€‚
%
% \CTeX{} å®é›†çš„é…ç½®æ–‡ä»¶éšå®åŒ…å…¶ä»–æ–‡ä»¶ä¸€èµ·å®‰è£…åœ¨ \TeX{} ç³»ç»Ÿ TDS ç›®å½•æ&nbsp;‘ä¸­ï¼Œæ–‡
% ä»¶åŽç¼€æ˜¯ \file{.cfg}ã€‚ä¸ºäº†é¿å…æœ¬åœ°é…ç½®æ–‡ä»¶å†…å®¹å›&nbsp; \CTeX{} å®é›†çš„æ›´æ–°è€Œä¸¢å¤±ï¼Œ
% ä¸è¦ç›´æŽ¥ä¿®æ”¹ç³»ç»Ÿ TDS ç›®å½•æ&nbsp;‘ä¸­çš„é…ç½®æ–‡ä»¶ï¼Œè€Œåº”è¯¥å°†ç³»ç»Ÿè‡ªå¸¦çš„é…ç½®æ–‡ä»¶å¤åˆ¶åˆ°æœ¬
% åœ°çš„æˆ–ç”¨æˆ·ç§æœ‰çš„ TDS ç›®å½•æ&nbsp;‘ä¸­ä¿®æ”¹ï¼Œå¹¶è¿è¡Œ \bashcmd{texhash} å‘½ä»¤åˆ·æ–°æ–‡ä»¶åæ•°æ®åº“ã€‚
%
% ä¾‹å¦‚å¯¹äºŽ \TeX{} Liveï¼Œç³»ç»Ÿè‡ªå¸¦çš„é…ç½®æ–‡ä»¶å°±åœ¨ \TeX{} Live å®‰è£…ç›®å½•ä¸‹çš„
% \path{texmf-dist/tex/latex/ctex/config/} å­ç›®å½•ä¸‹ï¼Œå¯ä»¥ä¿®æ”¹å®ƒçš„å‰¯æœ¬ï¼Œä¿å­˜åœ¨
% æœ¬åœ° TDS æ&nbsp;‘çš„ \path{texmf-local/tex/latex/ctex/} ç›®å½•ä¸‹ï¼Œæˆ–è€…ç”¨æˆ· TDS æ&nbsp;‘çš„
% \path{~/texmf/tex/latex/ctex/} ç›®å½•ä¸‹ï¼Œä½œä¸ºæœ¬åœ°/ç”¨æˆ·ä¸“æœ‰çš„
% é…ç½®æ–‡ä»¶ã€‚å¤åˆ¶é…ç½®æ–‡ä»¶åŽéœ€è¦è¿è¡Œ |texhash| å‘½ä»¤ä½¿æœ¬åœ°é…ç½®æ–‡ä»¶ç”Ÿæ•ˆã€‚
%
% \MiKTeX{} çš„é…ç½®æ–‡ä»¶ä¹Ÿä¿å­˜åœ¨ç±»ä¼¼çš„ç›®å½•ç»“æž„ä¸­ï¼Œ\MiKTeX{} ç®¡ç†çš„
% å‡&nbsp;ä¸ª TDS æ&nbsp;¹ç›®å½•å¯ä»¥åœ¨ \MiKTeX{} Options è®¾ç½®é¡¹ä¸­æŸ¥çœ‹åˆ°ï¼Œè¿™é‡Œä¸å†èµ˜è¿°ã€‚
%
% é™¤äº†ä¿®æ”¹æœ¬åœ° \TeX{} ç³»ç»Ÿä¸­çš„é…ç½®æ–‡ä»¶ï¼Œå¯¹äºŽç‰¹å®šæ–‡æ¡£ï¼Œä¹Ÿå¯ä»¥å°†ä¿®æ”¹è¿‡çš„é…ç½®æ–‡ä»¶
% ä¿å­˜åœ¨æ–‡æ¡£çš„å·¥ä½œç›®å½•ä¸‹ã€‚æ­¤æ—¶é…ç½®æ–‡ä»¶å°±åªå¯¹å·¥ä½œç›®å½•ä¸‹çš„æ‰€æœ‰æ–‡æ¡£ç”Ÿæ•ˆã€‚
%
% \subsection{ä¿®æ”¹å®åŒ…é»˜è®¤é€‰é¡¹}
%
% é…ç½®æ–‡ä»¶ \file{ctexopts.cfg} å¯ä»¥ç”¨æ¥ä¿®æ”¹å®åŒ…çš„é»˜è®¤é€‰é¡¹ã€‚éšç³»ç»Ÿå®‰è£…çš„é…ç½®æ–‡
% ä»¶é™¤äº†æ–‡ä»¶ä¿¡æ¯å£°æ˜Žå¤–æ²¡æœ‰å®žé™…çš„å†…å®¹ï¼Œä½†åœ¨æ³¨é‡Šä¸­ç»™å‡ºäº†ä¸€ä¸ªç®€å•çš„ç¤ºä¾‹ï¼Œåªè¦å–æ¶ˆ
% æ³¨é‡Šå°±å¯ä»¥ç”Ÿæ•ˆã€‚
%
% \begin{ctexexam}
%   % ç³»ç»Ÿè‡ªå¸¦ ctexopts.cfg æ³¨é‡Šä¸­çš„ç¤ºä¾‹è¯­å¥ï¼Œå›ºå®šé»˜è®¤å­—ä½“é›†ä¸º windowsã€‚
%   % è¯¥è®¾ç½®å¯ä»¥ç”¨åœ¨å®‰è£…äº† Windows å­—ä½“çš„éž Windows ç³»ç»Ÿä¸­ã€‚
%   \ctex_set:nn { option } { fontset = windows }
% \end{ctexexam}
% å¦‚ä¸Šä¾‹æ‰€ç¤ºï¼Œå®åŒ…é€‰é¡¹é€šå¸¸ä½¿ç”¨ \LaTeXiii{} çš„ \cs{ctex_set:nn} å‘½ä»¤å®Œæˆé”®å€¼è®¾ç½®ï¼Œ
% ç¬¬ä¸€ä¸ªå‚æ•°æ˜¯å›ºå®šçš„å­æ¨¡å— |option|ï¼Œç¬¬äºŒä¸ªå‚æ•°ä¸­æ˜¯ç”¨æˆ·å®šä¹‰çš„æ–°çš„é»˜è®¤å®åŒ…é€‰é¡¹ã€‚
%
% \file{ctexopts.cfg} ä¸­çš„è®¾ç½®å°†åœ¨ \CTeX{} å®é›†çš„å¼€å§‹å¤„ï¼Œå®šä¹‰è¿‡å®åŒ…é€‰é¡¹ä¹‹åŽï¼Œ
% \tn{ProcessKeysOptions} å‘½ä»¤ä¹‹å‰ç”Ÿæ•ˆã€‚æœ€å¥½åªä½¿ç”¨æ­¤é…ç½®æ–‡ä»¶ä¿®æ”¹å®åŒ…é»˜è®¤é€‰é¡¹ã€‚
%
% \subsection{å®åŒ…è½½å…¥åŽçš„é…ç½®}
%
% é…ç½®æ–‡ä»¶ \file{ctex.cfg} å°†åœ¨å®åŒ…çš„æœ«å°¾è¢«è½½å…¥ç”Ÿæ•ˆã€‚å¯ä»¥ç”¨å®ƒå®Œæˆä»»æ„çš„è®¾ç½®ï¼Œ
% æˆ–æ˜¯è¦†ç›–å·²æœ‰çš„å®šä¹‰ã€‚éšç³»ç»Ÿå®‰è£…çš„é…ç½®æ–‡ä»¶é™¤ç‰ˆæœ¬ä¿¡æ¯å¤–æ²¡æœ‰å®žé™…å†…å®¹ï¼Œæ³¨æ„é…ç½®æ–‡
% ä»¶ä¸­ä¹Ÿä½¿ç”¨ \LaTeXiii{} è¯­æ³•ã€‚
%
% \begin{ctexexam}
%   % ç®€å•çš„ ctex.cfg å†…å®¹ç¤ºä¾‹ã€‚
%   % ä¿®æ”¹é»˜è®¤çš„é¡µé¢æ&nbsp;¼å¼è®¾ç½®ã€‚
%   \pagestyle{plain}
% \end{ctexexam}
%
% \begin{ctexexam}
%   % ç•¥å¤æ‚çš„ ctex.cfg å†…å®¹ç¤ºä¾‹ï¼šç¦æ­¢æ®µæœ«å­¤å­—æˆè¡Œã€‚
%   % åœ¨ä½¿ç”¨ XeTeX ç¼–è¯‘æ—¶ï¼Œæ‰“å¼€ xeCJK çš„ CheckSingle é€‰é¡¹ã€‚
%   \sys_if_engine_xetex:T
%     {
%       \xeCJKsetup { CheckSingle }
%     }
%   % åœ¨ä½¿ç”¨ LuaTeX ç¼–è¯‘æ—¶ï¼Œè®¾ç½® LuaTeX-ja çš„ jcharwidowpenalty å‚æ•°ã€‚
%   \sys_if_engine_luatex:T
%     {
%       \ltjsetparameter { jcharwidowpenalty = 10000 }
%     }
% \end{ctexexam}
%
% \subsection{é…ç½®æ&nbsp;‡é¢˜ä¸­æ–‡ç¿»è¯‘}
%
% ç”±äºŽ \CTeX{} å®é›†éœ€è¦åŒæ—¶æ”¯æŒ GBK å’Œ UTF-8 ä¸¤ç§ç¼–ç&nbsp;ï¼Œå›&nbsp;æ­¤å¯¹æ&nbsp;‡é¢˜çš„ä¸­æ–‡ç¿»è¯‘å†™
% åœ¨ä¸¤ä¸ªé…ç½®æ–‡ä»¶å½“ä¸­ï¼š\file{ctex-name-gbk.cfg} å’Œ \file{ctex-name-utf8.cfg}ã€‚
% ä¸¤ä¸ªæ–‡ä»¶çš„è®¾ç½®ç›¸åŒï¼Œåªæ˜¯ç¼–ç&nbsp;ä¸åŒã€‚
%
% ä¸ºäº†åŒä¸€æ–‡æ¡£åœ¨ä¸åŒç”µè„‘ä¸Šç¼–è¯‘æ•ˆæžœçš„ä¸€è‡´æ€§ï¼Œé€šå¸¸ä¸å»ºè®®ä¿®æ”¹é»˜è®¤çš„ä¸­æ–‡ç¿»è¯‘ã€‚
%
% \subsection{è‡ªå®šä¹‰å­—ä½“é›†}
%
% \ref{subs:options-CJK-font}~èŠ‚ä»‹ç»çš„ç”¨äºŽ |fontset| é€‰é¡¹çš„è‡ªå®šä¹‰å­—åº“æ–‡ä»¶ï¼Œ
% ç±»ä¼¼äºŽ \CTeX{} å®é›†çš„é…ç½®æ–‡ä»¶ï¼Œä¹Ÿåº”è¯¥ä¸Žå…¶ä»–æœ¬åœ°é…ç½®æ–‡ä»¶ä¸€èµ·ä¿å­˜åœ¨æœ¬åœ°
% \texttt{TDS} ç›®å½•æ&nbsp;‘ä¸‹ï¼Œå¹¶å¯ä»¥é…åˆ \file{ctexopts.cfg} ç­‰é…ç½®æ–‡ä»¶ä½¿ç”¨ã€‚
%
% \section{å¯¹æ—§ç‰ˆæœ¬çš„å…¼å®¹æ€§}
%
% \subsection{\CTeX\ 0.8a åŠä»¥å‰çš„ç‰ˆæœ¬}
%
% åœ¨ ctex-kit é¡¹ç›®æˆç«‹ä¹‹å‰ï¼Œ\CTeX å®åŒ…çš„æœ€åŽä¸€ä¸ªç‰ˆæœ¬æ˜¯ \CTeX\
% 0.8aï¼ˆ2007/05/06ï¼‰ã€‚
%
% ç¬¬ 2 ç‰ˆæœªè€ƒè™‘å¯¹è¿™äº›å¾ˆæ—©ç‰ˆæœ¬çš„å…¼å®¹æ€§ã€‚
%
% \subsection{\CTeX\ 0.9--\CTeX\ 1.0d}
%
% åœ¨ 2009 å¹´åœ¨ ctex-kit é¡¹ç›®æˆç«‹åŽï¼Œæ–°å¢žäº† \XeTeX{} å¼•æ“Žçš„æ”¯æŒï¼Œå¹¶å¢žåŠ&nbsp;äº†ä¸å°‘æŽ§
% åˆ¶å­—ä½“çš„å‘½ä»¤å’Œé€‰é¡¹ã€‚
%
% è¿™é‡Œä¸»è¦ä»‹ç»æ–°ç‰ˆæœ¬ \CTeX å®åŒ…ç›¸å¯¹ 1.02d ç‰ˆæœ¬ï¼ˆ2014/06/09ï¼‰çš„å…¼å®¹æ€§ã€‚
%
% ç¬¬ 2 ç‰ˆçš„ \CTeX å®åŒ…å·²å°½åŠ›ä¿è¯å¯¹ 1.0x ç‰ˆæœ¬çš„å…¼å®¹æ€§ï¼ŒåŽŸæœ‰ä¸º 1.0x ç¼–å†™çš„ä»£ç&nbsp;ï¼Œ
% åœ¨ç¬¬ 2 ç‰ˆçš„ \CTeX å®åŒ…ä¸‹ä¿è¯ä»èƒ½ç¼–è¯‘ï¼Œå¹¶ä¸”åœ¨å¤§å¤šæ•°æƒ…å†µä¸‹ä¿æŒç¼–è¯‘æ•ˆæžœä¸å˜ã€‚
%
% \CTeX å®åŒ…åœ¨ 0.8a ä»¥å‰çš„ç‰ˆæœ¬æ”¯æŒä»¥ \pkg{CCT} ä½œä¸ºåº•å±‚ä¸­æ–‡æ”¯æŒæ–¹å¼ï¼Œä»Ž 0.9 ç‰ˆ
% ä¹‹åŽå³ä¸å†æŽ¨èä½¿ç”¨ï¼Œåªä¿ç•™å‘åŽå…¼å®¹ã€‚åœ¨ \CTeX å®åŒ…ç¬¬ 2 ç‰ˆä¸­åˆ™å®Œå…¨ä¸å†æ”¯æŒ
% \pkg{CCT}ã€‚
%
% ä¸‹é¢è¿™äº›æ˜¯åœ¨æ—§ç‰ˆæœ¬ \CTeX å®åŒ…ä¸­å­˜åœ¨ï¼Œè€Œåœ¨æ–°ç‰ˆæœ¬ä¸­å·²ä¸å»ºè®®ä½¿ç”¨çš„é€‰é¡¹å’Œå‘½ä»¤ï¼Œ
% åœ¨æœªæ¥ç‰ˆæœ¬ä¸­å¯èƒ½ä¼šåˆ&nbsp;åŽ»å®ƒä»¬çš„æ”¯æŒã€‚
%
% åœ¨å¤šæ•°æƒ…å†µä¸‹å®ƒä»¬çš„åŠŸèƒ½ä»å°†ä¿ç•™ï¼Œä½†ä¹Ÿæœ‰éƒ¨åˆ†é€‰é¡¹å‘½ä»¤åŠŸèƒ½å·²å¤±æ•ˆã€‚
%
% \begin{function}{cs4size, c5size}
%   åˆ†åˆ«ç›¸å½“äºŽ |zihao=-4| å’Œ |zihao=5|ï¼Œè¿‡æ—¶é€‰é¡¹ã€‚
% \end{function}
%
% \begin{function}{CCT, CCTfont}
% ç›¸å…³é€‰é¡¹å·²åˆ&nbsp;é™¤ã€‚
% \end{function}
%
% \begin{function}{indent, noindent}
% \opt{indent} å’Œ \opt{noindent} ä»€ä¹ˆä¹Ÿä¸åšï¼Œè¿‡æ—¶é€‰é¡¹ã€‚
%
% åœ¨ä¸­æ–‡ç‰ˆå¼ä¸‹ï¼Œ\pkg{ctex} å®åŒ…çš„ç›¸å…³åŠŸèƒ½åœ¨ä¸Žæ&nbsp;‡å‡†æ–‡æ¡£ç±»åŠå…¶è¡ç”Ÿæ–‡æ¡£ç±»è”ç”¨æ—¶
% é»˜è®¤æ‰“å¼€ã€‚\CTeX{} æ–‡æ¡£ç±»çš„ç›¸å…³åŠŸèƒ½ç”±ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜çš„ \opt{afterindent} é€‰é¡¹çš„å€¼
% æ¥ç¡®å®šã€‚
% \end{function}
%
% \begin{function}[label = ]{zhmap, nozhmap}
% \opt{zhmap} å®åŒ…é€‰é¡¹å¢žåŠ&nbsp;äº†å‚æ•°ï¼Œæ‰©å……äº†åŠŸèƒ½ï¼Œé™¤äº†æ”¯æŒçœŸå‡å€¼å‚æ•°å¤–ï¼Œè¿˜æ”¯æŒé€‰æ‹©
% \pkg{zhmCJK} ä½œä¸ºåº•å±‚ä¸­æ–‡å¤„ç†å®åŒ…ã€‚ï¼ˆ\ref{subs:options-CJK-font}~èŠ‚ï¼‰
%
% \opt{nozhmap} é€‰é¡¹ç›¸å½“äºŽ |zhmap=false|ã€‚è¿‡æ—¶é€‰é¡¹ã€‚
% \end{function}
%
% \begin{function}{winfonts, adobefonts, nofonts}
% å®åŒ…é€‰é¡¹ \opt{winfonts} ç›¸å½“äºŽ |fontset=windows|ï¼Œ\opt{adobefonts} ç›¸å½“äºŽ
% |fontset=adobe|ï¼Œ\opt{nofonts} ç›¸å½“äºŽ |fontset=none|ã€‚è¿™å‡&nbsp;ä¸ªé€‰é¡¹æ˜¯è¿‡æ—¶é€‰é¡¹ï¼Œ
% å¯¹äºŽæ–°æ–‡æ¡£ï¼Œåº”ä½¿ç”¨ \opt{fontset} é€‰é¡¹è®¾ç½®ä¸åŒå­—ä½“é›†ã€‚
%
% å¦å¤–ï¼Œç¬¬ 2 ç‰ˆ \CTeX å®åŒ…çš„é»˜è®¤å­—ä½“ä¸å†æ˜¯ Windows ç³»ç»Ÿå­—ä½“ï¼Œè€Œæ˜¯æ&nbsp;¹æ®æ£€æµ‹åˆ°çš„
% æ“ä½œç³»ç»Ÿé€‰æ‹©ä½¿ç”¨ Windowsã€Mac çš„ç³»ç»Ÿå­—ä½“è¿˜æ˜¯ Fandol å­—ä½“
% ï¼ˆ\ref{subs:options-CJK-font}~èŠ‚ï¼‰ã€‚
% \end{function}
%
% \begin{function}[label = ]{punct, nopunct}
% æ—§ç‰ˆæœ¬ä¸­å®åŒ… \opt{punct} é€‰é¡¹æ²¡æœ‰å‚æ•°ï¼ŒçŽ°åœ¨å¯ä»¥ç”¨å‚æ•°è®¾å®šæ&nbsp;‡ç‚¹é£Žæ&nbsp;¼
% ï¼ˆ\ref{subs:options-type-style}~èŠ‚ï¼‰ã€‚åŽŸæœ‰æ—&nbsp;å‚å½¢å¼çš„ \opt{punct} é€‰é¡¹ç›¸å½“
% äºŽ |punct=quanjiao|ã€‚
%
% æ—§ç‰ˆå®åŒ…ä¸­ \opt{nopunct} é€‰é¡¹çš„æ•ˆæžœå¤§è‡´ç›¸å½“äºŽ |punct=plain|ã€‚è¿‡æ—¶é€‰é¡¹ï¼Œä¸æŽ¨èä½¿ç”¨ã€‚
% \end{function}
%
% \begin{function}{cap, nocap}
% åŽŸæœ‰çš„ \opt{cap} å’Œ \opt{nocap} é€‰é¡¹ç”±æ–°çš„ \opt{scheme} é€‰é¡¹ä»£æ›¿ã€‚
% ï¼ˆ\ref{subs:options-type-style}~èŠ‚ï¼‰
%
% \opt{cap} é€‰é¡¹ç›¸å½“äºŽ |scheme = chinese|ï¼Œ\opt{nocap} é€‰é¡¹ç›¸å½“
% äºŽ |scheme = plain|ã€‚å®ƒä»¬å‡å·²è¿‡æ—¶ï¼Œä»…å›&nbsp;å…¼å®¹æ€§è€Œä¿ç•™ã€‚
% \end{function}
%
% \begin{function}[label = ]{space, nospace}
% æ–°ç‰ˆæœ¬å®åŒ… \opt{space} é€‰é¡¹å¢žåŠ&nbsp;çœŸå‡å€¼å‚æ•°ã€‚
% ï¼ˆ\ref{subs:options-type-style}~èŠ‚ï¼‰
%
% \opt{nospace} é€‰é¡¹ç›¸å½“äºŽ |space=false|ï¼Œæˆä¸ºè¿‡æ—¶é€‰é¡¹ã€‚
% \end{function}
%
% \begin{function}{fancyhdr}
% æ–°ç‰ˆæœ¬å®åŒ…ä¸­æ€»æ˜¯è‡ªåŠ¨å¤„ç†å¯¹ \pkg{fancyhdr} å®åŒ…çš„å…¼å®¹æ€§ï¼Œè€Œç”±ç”¨æˆ·è‡ªå·±ä½¿ç”¨
% \tn{usepackage} è½½å…¥ \pkg{fancyhdr} å®åŒ…ã€‚
%
% \opt{fancyhdr} é€‰é¡¹è¿‡æ—¶ï¼Œå›&nbsp;å…¼å®¹æ€§ä¿ç•™ï¼ŒåŠŸèƒ½æ˜¯è½½å…¥ \pkg{fancyhdr} å®åŒ…ã€‚
% \end{function}
%
% \begin{function}{hyperref}
% æ–°ç‰ˆæœ¬å®åŒ…ä¸­æ€»æ˜¯è‡ªåŠ¨å¤„ç†å¯¹ \pkg{hyperref} å®åŒ…çš„å…¼å®¹æ€§ï¼Œè€Œç”±ç”¨æˆ·è‡ªå·±ä½¿ç”¨
% \tn{usepackage} è½½å…¥ \pkg{hyperref} å®åŒ…ã€‚
%
% \opt{hyperref} é€‰é¡¹è¿‡æ—¶ï¼Œå›&nbsp;å…¼å®¹æ€§ä¿ç•™ï¼ŒåŠŸèƒ½æ˜¯åœ¨å¯¼è¨€åŒºæœ«å°¾è½½å…¥ \pkg{hyperref}
% å®åŒ…ã€‚
% \end{function}
%
% \begin{function}{fntef}
% æ—§ç‰ˆæœ¬çš„ \opt{fntef} é€‰é¡¹ç”¨äºŽç»Ÿä¸€ \pkg{CCTfntef} ä¸Ž \pkg{CJKfntef} çš„ç•Œé¢ï¼Œ
% æ–°ç‰ˆæœ¬ \CTeX{} å®é›†ä¸å†æ”¯æŒ \pkg{CCT}ï¼Œä¹Ÿä¸å†è‡ªåŠ¨è½½å…¥ \pkg{CJKfntef} æˆ–
% \pkg{xeCJKfntef} å®åŒ…ï¼Œè€Œä»…åœ¨å…¶æœ«å°¾åšé€‚å½“æ&nbsp;¼å¼è°ƒæ•´ã€‚
%
% \opt{fntef} é€‰é¡¹è¿‡æ—¶ï¼Œå›&nbsp;å…¼å®¹æ€§ä¿ç•™ï¼ŒåŠŸèƒ½æ˜¯æ&nbsp;¹æ®å¼•æ“Žè½½å…¥ \pkg{CJKfntef}
% (\pdfTeX{}) æˆ– \pkg{xeCJKfntef} (\XeTeX{}) å®åŒ…ã€‚
% \end{function}
%
% \begin{function}{\CTEXunderdot, \CTEXunderline, \CTEXunderdblline,
%   \CTEXunderwave, \CTEXsout, \CTEXxout, CTEXfilltwosides}
% åœ¨è°ƒç”¨ \opt{fntef} å®åŒ…é€‰é¡¹çš„åŒæ—¶ï¼Œæ—§ç‰ˆæœ¬ \CTeX{} å®åŒ…ç”±äºŽéœ€è¦æ”¯æŒ \pkg{CCT}
% ç³»ç»Ÿï¼Œä¼šå°†ä»¥ |\CJK| å¼€å¤´çš„ \tn{CJKunderline} ç­‰å®æ¢åä¸ºä»¥ |\CTEX| å¼€å¤´çš„
% \tn{CTEXunderline} ç­‰å®ã€‚æ­¤åŠŸèƒ½åœ¨æ–°ç‰ˆæœ¬çš„ \CTeX{} å®é›†ä¸­å·²å¤±åŽ»æ„ä¹‰ã€‚æ­¤å¤–ï¼Œ
% åœ¨ \pdfTeX{} å¼•æ“Žä¸‹ï¼Œç”¨äºŽè®¾ç½®æ&nbsp;¼å¼çš„ \tn{CJKunderdotbasesep} ç­‰å®ä¹Ÿè¢«æ›´åä¸º
% \tn{CTEXunderdotbasesep} ç­‰å®ã€‚
%
% åœ¨æ–°ç‰ˆæœ¬ä¸­ï¼Œä¸Šè¿°ç”± \opt{fntef} è¡ç”Ÿçš„ç›¸å…³å‘½ä»¤å’ŒçŽ¯å¢ƒå‡è¢«ç§»é™¤ã€‚
% \end{function}
%
% \begin{function}{\CTEXsetfont}
% æ›´æ–°å½“å‰çš„ä¸­æ–‡å­—ä½“ä¿¡æ¯ï¼ŒåŒ…æ‹¬å½“å‰å­—è·ï¼ˆ\tn{ccwd}ï¼‰å’Œæ®µé¦–ç¼©è¿›ï¼ˆ\tn{parindent}ï¼‰ã€‚
% ä¸€èˆ¬æ¥è¯´ï¼Œç”¨æˆ·æ—&nbsp;éœ€ä½¿ç”¨è¿™ä¸ªå‘½ä»¤ã€‚
% \end{function}
%
% \begin{function}{\CTEXindent}
% æ›´æ–° \tn{ccwd} å®½åº¦åŽè®¾ç½® |\parindent=2\ccwd|ã€‚è¿‡æ—¶å‘½ä»¤ã€‚
% \end{function}
%
% \begin{function}{\CTEXnoindent}
% è®¾ç½® |\parindent=0pt|ã€‚è¿‡æ—¶å‘½ä»¤ã€‚
% \end{function}
%
% \begin{function}{\CTEXsetup}
% \begin{syntax}
%   \tn{CTEXsetup}\oarg{é€‰é¡¹}\Arg{æ&nbsp;‡é¢˜}
% \end{syntax}
% ç›¸å½“äºŽè®¾ç½®äº†
% \texttt{\tn{ctexset}\{ \meta{æ&nbsp;‡é¢˜} = \Arg{é€‰é¡¹} \}}ã€‚
% è¿‡æ—¶å‘½ä»¤ã€‚
% \end{function}
%
% \begin{function}{\CTEXoptions}
% \begin{syntax}
%   \tn{CTEXoptions}\oarg{é€‰é¡¹}
% \end{syntax}
% ç›¸å½“äºŽè®¾ç½®äº†
% \texttt{\tn{ctexset}\Arg{é€‰é¡¹}}ã€‚
% è¿‡æ—¶å‘½ä»¤ã€‚
% \end{function}
%
% \begin{function}{\Chinese}
% \begin{syntax}
%   \tn{Chinese}\Arg{counter}
% \end{syntax}
% æ–°ç‰ˆå®é›†ä¸­ \tn{chinese} ç»Ÿä¸€äº†æ—§ç‰ˆæœ¬ä¸­ \tn{chinese} å’Œ \tn{Chinese} çš„åŠŸèƒ½ã€‚å›&nbsp;æ­¤ï¼Œ
% è¯¥å‘½ä»¤å·²è¿‡æ—¶ã€‚
% \end{function}
%
% \begin{function}{captiondelimiter}
% åŽŸä¸º \tn{CTEXoptions} å‘½ä»¤çš„é€‰é¡¹ï¼Œç”¨äºŽæŽ§åˆ¶ \tn{caption} ç¼–å·åŽé¢çš„æ&nbsp;‡ç‚¹ã€‚æ­¤é€‰
% é¡¹å·²è¿‡æ—¶ï¼Œå¹¶åœ¨æ–°ç‰ˆæœ¬çš„ \CTeX å®åŒ…ä¸­å¤±æ•ˆã€‚
%
% å¯ä»¥ä½¿ç”¨ \pkg{caption} å®åŒ…çš„ \opt{labelsep} é€‰é¡¹æ¥å®ŒæˆåŒæ&nbsp;·çš„åŠŸèƒ½ã€‚
% \begin{ctexexam}
%   % ä»£æ›¿ \CTEXoptions[captiondelimiter={:}]
%   \usepackage{caption}
%   \captionsetup{labelsep=colon}
% \end{ctexexam}
% \end{function}
%
% \subsection{\CTeX\ 1.02c ä»¥åŽçš„ SVN å¼€å‘ç‰ˆ}
%
% \CTeX å®åŒ…åœ¨ 1.02c ç‰ˆæœ¬ï¼ˆ2011/03/11ï¼‰ä¹‹åŽåœ¨ Google code ä¸Šçš„ SVN å¼€å‘ç‰ˆæœ¬ï¼Œ
% å†…éƒ¨ç‰ˆæœ¬å·ä¸€ç›´å‡åˆ° 1.11 ç‰ˆï¼Œä½†ä»Žæœªæ­£å¼å‘å¸ƒã€‚SVN å¼€å‘ç‰ˆåœ¨ 1.02c ç‰ˆæœ¬çš„åŸºç¡€ä¸Š
% æ–°å¢žçš„åŠŸèƒ½åœ¨ç¬¬ 2 ç‰ˆä¸­å¤§å¤šç»§æ‰¿äº†è¿‡æ¥ï¼Œä½†æ–°å¢žçš„å‘½ä»¤ä¸Žé€‰é¡¹éƒ½ä¸å†ä¿æŒå…¼å®¹ã€‚
%
% \CTeX å®åŒ…ç¬¬ 2 ç‰ˆä¸ä¿è¯å¯¹æœªå‘å¸ƒçš„ SVN å¼€å‘ç‰ˆå…¼å®¹ã€‚
%
% \subsection{\CTeX\ 2.2 ä¹‹å‰çš„ç‰ˆæœ¬}
%
% \begin{function}{part/beforeskip, chapter/beforeskip, section/beforeskip,
%   subsection/beforeskip, subsubsection/beforeskip, paragraph/beforeskip,
%   subparagraph/beforeskip}
%   åœ¨ \CTeX\ 2.2 ä¹‹å‰çš„ç‰ˆæœ¬ä¸­ï¼Œ\opt{beforeskip} é€‰é¡¹çš„ç¬¦å·è¿˜ç”¨äºŽç¡®å®šç«&nbsp;èŠ‚æ&nbsp;‡é¢˜åŽ
%   é¦–æ®µçš„ç¼©è¿›ã€‚å½“ \opt{beforeskip} æ˜¯è´Ÿå€¼æ—¶ï¼Œç«&nbsp;èŠ‚æ&nbsp;‡é¢˜åŽçš„ç¬¬ä¸€æ®µæŒ‰è‹±æ–‡æ–‡æ¡£çš„æŽ’ç‰ˆ
%   ä¹&nbsp;æƒ¯ï¼Œæ²¡æœ‰é¦–è¡Œç¼©è¿›ï¼Œå¦åˆ™ä¿ç•™é¦–è¡Œç¼©è¿›ã€‚
%
%   è¿™ä¸€ç‰¹æ€§åœ¨ 2.2 ç‰ˆå’ŒåŽç»­ç‰ˆæœ¬ä¸­ä¸å†ä¿ç•™ï¼Œç›¸åº”çš„åŠŸèƒ½é€šè¿‡æ–°çš„ \opt{afterindent}
%   é€‰é¡¹æ¥è®¾ç½®ã€‚å¦‚æžœåŽŸå…ˆè®¾ç½® \opt{beforeskip} ä¸ºè´Ÿå€¼ï¼Œåœ¨æ–°ç‰ˆæœ¬ä¸­éœ€è¦æ”¹ä¸ºæ­£å€¼ï¼Œ
%   å¹¶è®¾ç½®ç›¸åº”çš„ \opt{afterindent} é€‰é¡¹ä¸º \opt{false}ã€‚
% \end{function}
%
% \begin{function}{section/afterskip, subsection/afterskip,
%   subsubsection/afterskip, paragraph/afterskip, subparagraph/afterskip}
%   åœ¨ \CTeX\ 2.2 ä¹‹å‰çš„ç‰ˆæœ¬ä¸­ï¼Œå¯¹äºŽ \tn{section} çº§ä»¥ä¸‹æ&nbsp;‡é¢˜ï¼Œ\opt{afterskip}
%   é€‰é¡¹çš„ç¬¦å·ç”¨äºŽç¡®å®šæ&nbsp;‡é¢˜ä¸ŽéšåŽæ­£æ–‡æ˜¯å¦æŽ’åœ¨åŒä¸€æ®µã€‚
%   å¦‚æžœæ˜¯æ­£å€¼ï¼Œåˆ™æ­£æ–‡å¦èµ·ä¸€æ®µï¼Œå¦åˆ™æ&nbsp;‡é¢˜ä¸ŽéšåŽæ­£æ–‡æŽ’åœ¨åŒä¸€æ®µï¼Œ
%   \opt{afterskip} çš„ç»å¯¹å€¼ç»™å‡ºæ°´å¹³é—´è·ã€‚
%
%   è¿™ä¸€ç‰¹æ€§åœ¨ 2.2 ç‰ˆå’ŒåŽç»­ç‰ˆæœ¬ä¸­ä¸å†ä¿ç•™ï¼Œç›¸åº”çš„åŠŸèƒ½é€šè¿‡æ–°çš„ \opt{runin}
%   é€‰é¡¹æ¥è®¾ç½®ã€‚å¦‚æžœåŽŸå…ˆè®¾ç½® \opt{afterskip} ä¸ºè´Ÿå€¼ï¼Œåœ¨æ–°ç‰ˆæœ¬ä¸­éœ€è¦æ”¹ä¸ºæ­£å€¼ï¼Œ
%   å¹¶è®¾ç½®ç›¸åº”çš„ \opt{runin} é€‰é¡¹ä¸º \opt{true}ã€‚
% \end{function}
%
% \subsection{\CTeX\ 2.4.1 å’Œ 2.4.2}
%
% \begin{function}{part/fixbeforeskip, chapter/fixbeforeskip}
%   è¿™ä¸¤ä¸ªé€‰é¡¹å·²ç»è¢«åˆ&nbsp;é™¤ï¼Œç›¸åº”åŠŸèƒ½ç”±æ–°çš„é€‰é¡¹ \opt{fixskip} æä¾›ã€‚
% \end{function}
%
% \subsection{\CTeX\ 2.5 ä¹‹å‰çš„ç‰ˆæœ¬}
%
% \CTeX\ 2.5 æœ‰ä¸€äº›æ¯”è¾ƒå¤§çš„å˜åŠ¨ã€‚
%
% \begin{function}[label =]{UTF8, GBK}
%   (pdf)\LaTeX{} æ&nbsp;¼å¼ä¸‹ï¼Œæ–‡æ¡£ç¼–ç&nbsp;åˆå§‹å€¼ç»Ÿä¸€è®¾ç½®æˆ UTF-8ã€‚å›&nbsp;æ­¤ï¼Œä»æ—§ä½¿ç”¨ GBK
%   ç¼–ç&nbsp;çš„æ–‡æ¡£ï¼Œéœ€è¦åœ¨æ–‡æ¡£ç±»æˆ–å®åŒ…é€‰é¡¹ä¸­æ˜¾å¼æŒ‡å®š \opt{GBK}ã€‚
% \end{function}
%
% \begin{function}[label =]{\CTEXunderdot, \CTEXunderline, \CTEXunderdblline,
%   \CTEXunderwave, \CTEXsout, \CTEXxout, CTEXfilltwosides}
%   ä¸å†é»˜è®¤è½½å…¥ \pkg{CJKfntef} æˆ– \pkg{xeCJKfntef} å®åŒ…ï¼ŒåŒæ­¥ç§»é™¤æœ‰å…³å‘½ä»¤
%   å’ŒçŽ¯å¢ƒã€‚è‹¥éœ€ä½¿ç”¨ç›¸å…³å®åŒ…ï¼Œå»ºè®®ç”¨æˆ·ä½¿ç”¨ \tn{usepackage} å‘½ä»¤ä¸»åŠ¨è½½å…¥ã€‚
% \end{function}
%
% \begin{function}[label =]{fntef}
%   ä½œä¸ºå…¼å®¹æ€§ä¿ç•™ï¼Œä¼šè§†ç¼–è¯‘å¼•æ“Žè½½å…¥ç›¸åº”å®åŒ…ã€‚
% \end{function}
%
% \begin{function}{windows}
%   ä¸å†æ”¯æŒ Windows XP ç³»ç»Ÿï¼Œé»˜è®¤è¦æ±‚ Windows ç³»ç»Ÿæœ‰å¾®è½¯é›…é»‘å­—ä½“ã€‚
%   å»ºè®® Windows XP ç³»ç»Ÿçš„ç”¨æˆ·åŠæ—¶æ›´æ–°æ“ä½œç³»ç»Ÿã€‚è‹¥ä¸€å®šè¦åœ¨ Windows XP ä¸­ä½¿ç”¨ï¼Œ
%   è¯·ä½¿ç”¨ 2.5 ä»¥å‰çš„ç‰ˆæœ¬ã€‚
% \end{function}
%
% \begin{function}{windowsold, windowsnew}
%   è¿‡æ—¶å­—åº“é€‰é¡¹ï¼Œä½œä¸ºå…¼å®¹æ€§ä¿ç•™ï¼ŒåŠŸèƒ½æ˜¯è½½å…¥ \opt{windows} å­—åº“ã€‚
% \end{function}
%
% \begin{function}{ubuntu}
%   æ”¹ç”¨æ€æºï¼ˆNoto CJKï¼‰å’Œæ–‡é¼Žå­—åº“ã€‚è¯¥å­—åº“ä¸å†æ”¯æŒ \pdfLaTeX ç¼–è¯‘ã€‚
% \end{function}
%
% \begin{function}[label =]{AlternateFont}
%   ä¸å†æ”¯æŒå°†æ›¿ä»£å­—ä½“çš„å¯é€‰é¡¹æ”¾åœ¨å­—ä½“åä¹‹å‰çš„æ–¹æ‹¬å·ä¸­ï¼Œ
%   æ–°çš„è¯­æ³•æ˜¯å°†å¯é€‰é¡¹æ”¾åœ¨å­—ä½“åä¹‹åŽçš„èŠ±æ‹¬å·ä¹‹å†…ã€‚
% \end{function}
%
% é™¤äº†ä»¥ä¸Šåˆ—å‡ºçš„é€‰é¡¹ä»¥å¤–ï¼Œå½“ç”¨æˆ·ä½¿ç”¨ \CTeX{} ç³»åˆ—æ–‡æ¡£ç±»ï¼Œä¸”ä½¿ç”¨ \LaTeX æˆ–
% \upLaTeX ç¼–è¯‘æ—¶ï¼Œè‹¥ç”¨æˆ·æ²¡æœ‰åœ¨æ–‡æ¡£ç±»é€‰é¡¹ä¸­æ˜¾å¼æŒ‡å®š |dvips|/|dvipdfmx|/|dvisvgm|
% ç­‰é©±åŠ¨é€‰é¡¹ï¼Œåˆ™æ–‡æ¡£ç±»æŒ‡å®šé»˜è®¤é©±åŠ¨ä¸º \dvipdfmxã€‚
%
% \section{å®é›†ä¾èµ–æƒ…å†µä¸Žæ‰‹å·¥å®‰è£…æ–¹æ³•}
% \label{sec:dep-ins}
%
% æœ¬èŠ‚ä»‹ç» \CTeX{} å®é›†çš„ä¾èµ–æƒ…å†µï¼Œå¹¶ä»‹ç»æ‰‹å·¥ç¼–è¯‘å®‰è£…çš„å…·ä½“æ–¹æ³•ã€‚
% é€šå¸¸ç”¨æˆ·åªéœ€å‚ç…§ç¬¬ \ref{subsec:easy-ins}~èŠ‚ä»‹ç»çš„æ–¹æ³•ï¼Œä½¿ç”¨å‘è¡Œç‰ˆè‡ªå¸¦çš„åŒ…ç®¡ç†å™¨å®‰è£…
% æœ¬å®é›†ã€‚
%
% \CTeX{} å®é›†æœ‰ä¸¤ä¸ªæºæ–‡ä»¶ï¼š\file{ctex.dtx}ã€\file{ctexpunct.spa}ã€‚
% ä½¿ç”¨ä¸åŒçš„ç¼–è¯‘æ–¹å¼æ—¶ï¼Œ\CTeX{} ä¾èµ–çš„å®åŒ…ç•¥æœ‰ä¸åŒã€‚åœ¨æ‰‹å·¥å®‰è£… \CTeX{} å®é›†ä¹‹å‰ï¼Œè¯·ç¡®ä¿
% ä½&nbsp;çš„ \TeX{} å‘è¡Œç‰ˆä¸­å·²ç»æ­£ç¡®å®‰è£…äº†è¿™äº›å®åŒ…ã€‚\CTeX{} ä¾èµ–å®åŒ…çš„è¯¦æƒ…å™è¿°å¦‚ä¸‹ï¼š
%
% \begin{itemize}
%   \item \pkg{expl3}ã€\pkg{xparse} å’Œ \pkg{l3keys2e} å®åŒ…ã€‚å®ƒä»¬å±žäºŽ \pkg{l3kernel}
%   å’Œ \pkg{l3packages} å®é›†ã€‚
%   \item \pkg{indentfirst} å®åŒ…ï¼Œå±žäºŽ \pkg{tools} å®é›†ã€‚
%   \item \pkg{zhnumber} å®åŒ…ã€‚
%   \item[\ding{229}] ä»¥ä¸Šæ˜¯å„ç§ç¼–è¯‘æ–¹å¼éƒ½å¿…éœ€çš„ä¾èµ–é¡¹ã€‚
%   \item \pkg{CJK} å®é›†ã€‚
%   \item \pkg{CJKpunct} å®åŒ…ã€‚
%   \item \pkg{xCJK2uni} å®åŒ…ã€‚
%   \item \pkg{zhmetrics} å®åŒ…ã€‚
%   \item \pkg{zhmCJK} å®åŒ…ï¼Œå®ƒè¿˜ä¾èµ–
%   \begin{itemize}
%     \item \pkg{iftex} å®åŒ…ã€‚
%     \item \pkg{ltxcmds} å®åŒ…ã€‚
%     \item \pkg{kvoptions} å®åŒ…ã€‚
%     \item \pkg{kvsetkeys} å®åŒ…ã€‚
%     \item \pkg{keyval} å®åŒ…ï¼Œ\pkg{graphics} å®é›†ã€‚
%   \end{itemize}
%   \item[\ding{229}] ä»¥ä¸Šæ˜¯ä½¿ç”¨ \pdfLaTeX{} æˆ– \LaTeX{} + \dvipdfmx{} çš„ç¼–è¯‘æ–¹å¼æ‰€éœ€è¦
%   çš„ä¾èµ–é¡¹ï¼Œå…¶ä¸­ \pkg{zhmCJK} æ˜¯å¯é€‰çš„ã€‚
%   \item \pkg{xeCJK} å®é›†ï¼Œå®ƒè¿˜ä¾èµ–
%   \begin{itemize}
%     \item \pkg{xtemplate} å®åŒ…ï¼Œå®ƒå±žäºŽ \pkg{l3packages} å®é›†ã€‚
%     \item \pkg{fontspec} å®åŒ…ã€‚
%   \end{itemize}
%   \item[\ding{229}] ä»¥ä¸Šæ˜¯ä½¿ç”¨ \XeLaTeX{} ç¼–è¯‘æ—¶çš„ä¾èµ–é¡¹ã€‚
%   \item \pkg{luatexja} å®åŒ…ï¼Œå®ƒè¿˜ä¾èµ–
%   \begin{itemize}
%     \item \pkg{adobemapping} å®åŒ…ã€‚
%     \item \pkg{luaotfload} å®åŒ…ï¼Œå®ƒè¿˜ä¾èµ– \pkg{lualibs} å®åŒ…ã€‚
%     \item \pkg{luatexbase} å®åŒ…ï¼Œå®ƒè¿˜ä¾èµ– \pkg{ctablestack} å®åŒ…ã€‚
%     \item \pkg{atbegshi} å®åŒ…ã€‚
%     \item \pkg{etoolbox} å®åŒ…ã€‚
%     \item \pkg{iftex} å®åŒ…ã€‚
%     \item \pkg{infwarerr} å®åŒ…ã€‚
%     \item \pkg{ltxcmds} å®åŒ…ã€‚
%     \item \pkg{pdftexcmds} å®åŒ…ã€‚
%     \item \pkg{xkeyval} å®åŒ…ã€‚
%     \item \pkg{chinese-jfm} å®åŒ…ã€‚
%   \end{itemize}
%   \item \pkg{fontspec} å®åŒ…ã€‚
%   \item[\ding{229}] ä»¥ä¸Šæ˜¯ä½¿ç”¨ \LuaLaTeX{} ç¼–è¯‘æ—¶çš„ä¾èµ–é¡¹ã€‚
%   \item \pkg{zhmetrics-uptex} å®åŒ…ã€‚
%   \item[\ding{229}] ä»¥ä¸Šæ˜¯ä½¿ç”¨ \upLaTeX{} ç¼–è¯‘æ—¶çš„ä¾èµ–é¡¹ã€‚
% \end{itemize}
%
% å‡ºäºŽä¸€äº›åŽŸå›&nbsp;ï¼Œ\pkg{zhmCJK} å°šæœªè¢«æ”¶å…¥ \TeXLive{} å’Œ \MiKTeXã€‚å›&nbsp;æ­¤ï¼Œè‹¥
% ä½&nbsp;å¸Œæœ›ä½¿ç”¨ \pkg{zhmCJK} ä½œä¸º \CTeX{} å®é›†çš„åº•å±‚ä¸­æ–‡æ”¯æŒæ–¹å¼ï¼Œé‚£ä¹ˆä½&nbsp;éœ€è¦è‡ªè¡Œå®‰è£…è¯¥å®åŒ…ã€‚
% \pkg{zhmCJK} çš„å®‰è£…è¾ƒä¸ºå¤æ‚ã€‚æˆ‘ä»¬å»ºè®®ä½&nbsp;
% \begin{enumerate}
%   \item ä»Ž CTAN ä¸‹è½½ \pkg{zhmCJK} å®åŒ…çš„
%   \href{http://mirrors.ctan.org/install/language/chinese/zhmcjk.tds.zip}
%   {TDS å®‰è£…åŒ…}ï¼Œ
%   \item æŒ‰ç›®å½•ç»“æž„å°†æ–‡ä»¶å¤åˆ¶åˆ° \TeX{} å‘è¡Œç‰ˆçš„æœ¬åœ° TDS æ&nbsp;¹ç›®å½•ï¼Œ
%   \item æœ€åŽæ‰§è¡Œ \bashcmd{texhash} åˆ·æ–° \TeX{} å‘è¡Œç‰ˆçš„ ls-R æ•°æ®åº“ä»¥å®Œæˆå®‰è£…ã€‚
% \end{enumerate}
% å…¶ä»–ç»†èŠ‚ï¼Œå¯å‚ç…§å…¶
% \href{http://mirrors.ctan.org/language/chinese/zhmcjk/zhmCJK.pdf}{å®åŒ…æ‰‹å†Œ}
% ä¸­ç¬¬ 3 èŠ‚çš„æŒ‡å¯¼ã€‚
%
% \emph{\CTeX{} å®é›†å·²è¢« \TeXLive{} å’Œ \MiKTeX{} æ”¶å½•ï¼Œè‹¥æ—&nbsp;ç‰¹åˆ«ç†ç”±ï¼Œ
% æˆ‘ä»¬å¼ºçƒˆå»ºè®®ç”¨æˆ·ä½¿ç”¨åŒ…ç®¡ç†å™¨å®‰è£…æœ¬å®é›†ã€‚}
%
% è‹¥è¦æ‰‹å·¥å®‰è£…ï¼Œè¯·éµå¾ªå¦‚ä¸‹æ­¥éª¤ï¼š
% \begin{enumerate}
%   \item ä»Ž CTAN ä¸‹è½½ \CTeX{} å®é›†çš„
%   \href{http://mirrors.ctan.org/install/language/chinese/ctex.tds.zip}
%   {TDS å®‰è£…åŒ…}ï¼Œ
%   \item æŒ‰ç›®å½•ç»“æž„å°†æ–‡ä»¶å¤åˆ¶åˆ° \TeX{} å‘è¡Œç‰ˆçš„æœ¬åœ° TDS æ&nbsp;¹ç›®å½•ï¼Œ
%   \item æœ€åŽæ‰§è¡Œ \bashcmd{texhash} åˆ·æ–° \TeX{} å‘è¡Œç‰ˆçš„ ls-R æ•°æ®åº“ä»¥å®Œæˆå®‰è£…ã€‚
% \end{enumerate}
%
% \section{å¼€å‘äººå‘˜}
%
% \begin{itemize}
% \item å´å‡Œäº‘ (\email{aloft@ctex.org})
% \item æ±Ÿç–† (\email{gzjjgod@gmail.com})
% \item çŽ‹è¶Š (\email{yuleopen@gmail.com})
% \item åˆ˜æµ·æ´‹ (\email{LeoLiu.PKU@gmail.com})
% \item æŽå»¶ç‘ž (\email{LiYanrui.m2@gmail.com})
% \item é™ˆä¹‹åˆ (\email{zhichu.chen@gmail.com})
% \item æŽæ¸… (\email{sobenlee@gmail.com})
% \item é»„æ™¨æˆ (\email{liamhuang0205@gmail.com})
% \item æ›¾ç¥¥ä¸œ (\email{xdzeng96@gmail.com})
% \item æŽæ³½å¹³ (\email{zepinglee@gmail.com})
% \item å‘¨å®‡æº (\email{muzimuzhi@gmail.com})
% \item å¼&nbsp;ç‘žç†¹ (\email{ruixizhang42@gmail.com})
% \end{itemize}
%
%
%
% \begin{thebibliography}{9}
% \bibitem{knuthtex1986}
% \textsc{Donald~Ervin Knuth}.
% \newblock \textit{The {{\TeX{}book}}}, \textit{Computers \&amp; Typesetting},
%   volume~A.
% \newblock Addison-Wesley, 1986
%
% \bibitem{mittelbach2004}
% \textsc{Frank Mittelbach} and \textsc{Michel Goossens}.
% \newblock \textit{The {{\LaTeX}} Companion}.
% \newblock Tools and Techniques for Computer Typesetting. Boston:
%   Addison-Wesley, second edition, 2004
%
% \end{thebibliography}
%
% \end{documentation}
%
%
% \StopEventually{}
%
%
%\begin{implementation}
% \clearpage
% \section{ä»£ç&nbsp;å®žçŽ°}
%
%    \begin{macrocode}
%&lt;@@=ctex&gt;
%    \end{macrocode}
%
% \changes{v2.5.9}{2022/05/27}{è®¾ç½®æ¶ˆæ¯æ¨¡å—çš„åå­—å’Œç±»åž‹ã€‚}
% \changes{v2.5.10}{2022/06/10}{æ›´æ–°ä¸€äº›å†…éƒ¨å‡½æ•°ã€‚}
% \changes{v2.5.10}{2022/07/08}{ä¸ç›´æŽ¥ä¾èµ– \pkg{xparse} å’Œ \pkg{l3keys2e}ã€‚}
%
%    \begin{macrocode}
%&lt;*class|style&gt;
\cs_if_exist:NF \NewDocumentCommand
  { \RequirePackage { xparse } }
%&lt;class&gt;\prop_gput:Nnn \g_msg_module_type_prop { ctex } { Class }
%&lt;article&gt;\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexart }
%&lt;book&gt;\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexbook }
%&lt;report&gt;\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexrep }
%&lt;beamer&gt;\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexbeamer }
%&lt;ctexsize&gt;\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexsize }
%&lt;ctexheading&gt;\prop_gput:Nnn \g_msg_module_name_prop { ctex } { ctexheading }
%&lt;/class|style&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;*class|ctex&gt;
%    \end{macrocode}
%
% \changes{v2.3}{2015/12/20}{ä¸Ž \LaTeXiii{} (2015/12/20) åŒæ­¥ã€‚}
% \changes{v2.4.10}{2017/07/19}{å¸¸æ•° \cs{c_minus_one} å·²è¿‡æ—¶ã€‚}
% \changes{v2.4.10}{2017/07/22}{ä½¿ç”¨ \texttt{lazy} å‡½æ•°å¯¹ Boolean è¡¨è¾¾å¼
% è¿›è¡Œæœ€å°åŒ–è¿ç®—ï¼ˆ\LaTeXiii{} 2017/07/19ï¼‰ã€‚}
%
% æ£€æŸ¥ \pkg{expl3} çš„ç‰ˆæœ¬ã€‚
%    \begin{macrocode}
\msg_new:nnnn { ctex } { l3-too-old }
  { Support~package~`#1'~too~old. }
  {
    Please~update~an~up-to-date~version~of~the~bundles\\\\
    `l3kernel'~and~`l3packages'\\\\
    using~your~TeX~package~manager~or~from~CTAN.
  }
\@ifpackagelater { expl3 } { 2021/02/10 } { }
  { \msg_error:nnn { ctex } { l3-too-old } { expl3 } }
%    \end{macrocode}
%
% \begin{variable}{\c_@@_engine_str,\c_@@_engine_file_str}
% å¼•æ“Žæ£€æŸ¥ã€‚ç›®å‰ \LaTeXiii{} å°† \ApTeX{} è¯†åˆ«ä¸º \upTeXã€‚
%    \begin{macrocode}
\str_const:Nx \c_@@_engine_str
  { \cs_if_exist:NTF \ngostype { aptex } { \c_sys_engine_str } }
\msg_new:nnnn { ctex } { engine-not-supported }
  { Engine~`#1'~is~not~yet~supported,~ctex~will~abort! }
  { You~can~switch~to~xelatex,~lualatex,~pdflatex,~uplatex,~or~aplatex. }
\file_if_exist:nTF { ctex-engine- \c_@@_engine_str .def }
  {
    \str_const:Nx \c_@@_engine_file_str
      { ctex-engine- \c_@@_engine_str .def }
  }
  { \msg_critical:nnx { ctex } { engine-not-supported } { \c_@@_engine_str } }
%    \end{macrocode}
% \end{variable}
%
%    \begin{macrocode}
%&lt;/class|ctex&gt;
%    \end{macrocode}
%
% \changes{v2.5}{2020/04/19}
%   {å¤„ç† \cs{ctex_file_input:n} åœ¨ \pkg{ctexsize} ä¸­æœªå®šä¹‰çš„é”™è¯¯ã€‚}
% \changes{v2.5}{2020/04/21}{åœ¨ \pkg{ctexsize} ä¹Ÿè½½å…¥ \pkg{fix-cm}ã€‚}
%
%    \begin{macrocode}
%&lt;*class|ctex|ctexheading|ctexsize&gt;
%    \end{macrocode}
%
% \pkg{ctexsize} ä¹Ÿè¦è½½å…¥ \pkg{fix-cm} åŒ…è§£å†³ä¼&nbsp;ç»Ÿ cm å­—ä½“å­—å·ç¼ºå¤±çš„é—®é¢˜ã€‚
%    \begin{macrocode}
%&lt;!ctexsize&gt;\RequirePackage { ctexhook , ctexpatch }
%&lt;!ctexheading&gt;\RequirePackage { fix-cm }
%    \end{macrocode}
%
% å®åŒ…è½½å…¥æ£€æŸ¥ã€‚
%    \begin{macrocode}
%&lt;*class|ctex&gt;
%&lt;*class&gt;
\ctex_disable_package:n { ctex }
\ctex_disable_package:n { ctexcap }
%&lt;/class&gt;
\ctex_disable_package:n { ctexsize }
\ctex_disable_package:n { ctexheading }
%&lt;/class|ctex&gt;
%    \end{macrocode}
%
% \changes{v2.5.7}{2021/06/04}{å…¼å®¹ \LaTeX \ 2021/06/01 çš„å­—ä½“é’©å­ã€‚}
%
% \begin{variable}{\c_@@_everysel_loaded_bool}
% \LaTeX \ 2021-06-01 ä»¥åŽçš„ç‰ˆæœ¬å†…å»ºäº† \pkg{everysel} åŒ…çš„åŠŸèƒ½ã€‚
%    \begin{macrocode}
%&lt;*!ctexsize&gt;
%&lt;*!ctexheading&gt;
\ctex_if_format_at_least:nTF { 2021/06/01 }
  { \bool_const:Nn \c_@@_everysel_loaded_bool { \c_false_bool } }
  {
    \RequirePackage { everysel }
    \bool_const:Nn \c_@@_everysel_loaded_bool { \c_true_bool }
  }
%&lt;/!ctexheading&gt;
%    \end{macrocode}
% \end{variable}
%
% \subsection{å†…éƒ¨å‡½æ•°ä¸Žå˜é‡}
%
% \begin{variable}{\l_@@_tmp_tl,\l_@@_tmp_int,\l_@@_tmp_box,\l_@@_tmp_dim}
% ä¸´æ—¶å˜é‡ã€‚
%    \begin{macrocode}
\tl_clear_new:N \l_@@_tmp_tl
\int_new:N \l_@@_tmp_int
\box_new:N \l_@@_tmp_box
%&lt;!ctexheading&gt;\dim_new:N \l_@@_tmp_dim
%    \end{macrocode}
% \end{variable}
%
% \begin{macro}[int]{\ctex_define_option:n,
% \ctex_define:n,\ctex_set:n,\ctex_set:nn}
% åœ¨å®åŒ…å†…éƒ¨ä½¿ç”¨çš„é”®å€¼é€‰é¡¹å®šä¹‰ã€è®¾ç½®å‘½ä»¤ã€‚
%    \begin{macrocode}
%&lt;/!ctexsize&gt;
\cs_new_protected:Npn \ctex_define_option:n
  { \keys_define:nn { ctex / option } }
%&lt;*!ctexsize&gt;
\cs_new_protected:Npn \ctex_define:n
  { \keys_define:nn { ctex } }
\cs_new_protected:Npn \ctex_set:n
  { \keys_set:nn { ctex } }
\cs_new_protected:Npn \ctex_set:nn #1
  { \keys_set:nn { ctex / #1 } }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5.3}{2020/06/06}{æ­£ç¡®å…³é—­å’Œæ¢å¤ \LaTeXiii è¯­æ³•çŽ¯å¢ƒã€‚}
% \changes{v2.5.4}{2020/08/02}{åº”ç”¨ \pkg{l3cctab}ã€‚}
% \changes{v2.5.5}{2020/10/17}{æ”¾å¼ƒåº”ç”¨ \pkg{l3cctab}ã€‚}
%
% \begin{macro}[int]{\ctex_scheme_input:n}
% è¾“å…¥ \opt{scheme} æ–‡ä»¶ã€‚å…ˆæŸ¥æ‰¾å½“å‰æ–‡æ¡£ç±»ä¸‹çš„ \meta{scheme}ï¼Œæ‰¾ä¸åˆ°å†æŸ¥æ‰¾ä¸€èˆ¬çš„æ–‡ä»¶ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_scheme_input:n #1
  {
    \ctex_push_file:
      \tl_if_exist:NTF \c_@@_class_tl
        {
          \file_if_exist_input:nF { ctex-scheme- #1 - \c_@@_class_tl .def }
            { \file_input:n  { ctex-scheme- #1 .def } }
        }
        { \file_input:n  { ctex-scheme- #1 .def } }
    \ctex_pop_file:
  }
\cs_generate_variant:Nn \ctex_scheme_input:n { o }
%    \end{macrocode}
% \end{macro}
%
% \begin{variable}{\g_@@_section_depth_int}
% è‹¥å¤§äºŽ |3|ï¼Œåˆ™ \tn{paragraph} å’Œ \tn{subparagraph} æ&nbsp;‡é¢˜å•ç‹¬å&nbsp;ä¸€è¡Œï¼›è‹¥ä¸º |3|ï¼Œåˆ™
% \tn{paragraph} å•ç‹¬å&nbsp;ä¸€è¡Œã€‚
%    \begin{macrocode}
%&lt;*!beamer&gt;
\int_new:N \g_@@_section_depth_int
\int_gset:Nn \g_@@_section_depth_int { 2 }
%&lt;/!beamer&gt;
%    \end{macrocode}
% \end{variable}
%
%    \begin{macrocode}
%&lt;/!ctexsize&gt;
%&lt;/class|ctex|ctexheading|ctexsize&gt;
%&lt;*class|ctex&gt;
%    \end{macrocode}
%
% å¯¹æ—§ç‰ˆæœ¬çš„å®åŒ…ç»™å‡ºé”™è¯¯ä¿¡æ¯ã€‚
%    \begin{macrocode}
\msg_new:nnnn { ctex } { package-too-old }
  { Support~package~`#1'~too~old. }
  {
    Please~update~an~up-to-date~version~of~the~package~`#1'\\
    using~your~TeX~package~manager~or~from~CTAN.
  }
%    \end{macrocode}
%
% \changes{v2.1}{2015/05/25}{ä¸ä¾èµ– \pkg{ifpdf} å®åŒ…ã€‚}
%
% \begin{macro}[int]{\ifctexpdf}
% åœ¨ \pkg{zhmetrics} æ˜&nbsp;å°„æ–‡ä»¶ä¸­ä½¿ç”¨ã€‚
%    \begin{macrocode}
\sys_if_output_pdf:TF
  { \cs_new_eq:NN \ifctexpdf \if_true: }
  { \cs_new_eq:NN \ifctexpdf \if_false: }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_if_preamble:TF}
% æµ‹è¯•æ˜¯å¦åœ¨ \LaTeXe{} çš„å¯¼è¨€åŒºã€‚åœ¨å®åŒ…å†…éƒ¨åˆå§‹ä¸ºçœŸï¼Œæ–‡æ¡£æœ€å¼€å§‹ä½ç½®å†è®¾ç½®ä¸ºå‡ã€‚
% æ³¨æ„ï¼Œé’©å­ \cs{ctex_after_end_preamble:n} åœ¨ \tn{AtBeginDocument} ä¹‹åŽæ‰§è¡Œï¼Œ
% å¯ä»¥ä¸Ž \tn{@onlypreamble} çš„è¡Œä¸ºä¸€è‡´ã€‚
%    \begin{macrocode}
\cs_new_eq:NN \ctex_if_preamble:TF \use_i:nn
\ctex_after_end_preamble:n { \cs_set_eq:NN \ctex_if_preamble:TF \use_ii:nn }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.3}{2015/09/17}{ä»£ç&nbsp;å®žçŽ°é¿å…ä½¿ç”¨ \tn{lowercase} æŠ€å·§ï¼ˆJoseph Wrightï¼‰ã€‚}
%
% \changes{v2.4.16}{2019/05/11}{å…è®¸è®¾ç½® \texttt{autoindent} ä¸º $0$ã€‚}
%
% \begin{macro}[int]{\ctex_set_default_ccwd:Nn}
% è‹¥å‚æ•° |#2| å¸¦é•¿åº¦å•ä½ï¼Œåˆ™è®¾ç½®å®ƒä¸º |tl| å˜é‡ |#1| çš„å€¼ï¼Œå¦åˆ™ä»¥ \tn{ccwd} ä¸ºå•ä½ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_set_default_ccwd:Nn #1#2
  { \tl_set:Nx #1 { \@@_default_ccwd_aux:n {#2} } }
\cs_new:Npn \@@_default_ccwd_aux:n #1
  {
    \exp_not:n {#1}
    \exp_after:wN \@@_default_ccwd_aux:w
      \dim_use:N \tex_dimexpr:D #1 pt \scan_stop: \q_stop
  }
\exp_last_unbraced:NNNNo
  \cs_new:Npn \@@_default_ccwd_aux:w #1 { \tl_to_str:n { pt } } #2 \q_stop
    { \tl_if_empty:nT {#2} { \ccwd } }
%    \end{macrocode}
% \end{macro}
%
% \begin{variable}{\g_@@_encoding_tl}
% æ‰€æœ‰å¼•æ“Žä¸‹é»˜è®¤ç¼–ç&nbsp;å‡è®¾ä¸º UTF-8ï¼Œåˆå§‹å€¼ä¸ºç©ºï¼Œ\tn{ProcessKeysOptions} å†åˆ¤æ–­ã€‚
%    \begin{macrocode}
\tl_new:N \g_@@_encoding_tl
%    \end{macrocode}
% \end{variable}
%
% \begin{variable}{\g_@@_zhmCJK_bool}
% æ˜¯å¦ä½¿ç”¨ \pkg{zhmCJK} å®åŒ…ã€‚
%    \begin{macrocode}
\bool_new:N \g_@@_zhmCJK_bool
%    \end{macrocode}
% \end{variable}
%
% \begin{variable}{\l_@@_autoindent_tl}
% ä¿å­˜ \opt{autoindent} é€‰é¡¹çš„å€¼ï¼Œç©ºå€¼è¡¨ç¤ºä¸è‡ªåŠ¨è°ƒæ•´é¦–è¡Œç¼©è¿›ã€‚
%    \begin{macrocode}
\tl_new:N \l_@@_autoindent_tl
%    \end{macrocode}
% \end{variable}
%
% \begin{macro}[int]{\ctex_if_autoindent_touched:F}
% æ£€æŸ¥ \opt{autoindent} é€‰é¡¹æ˜¯å¦è¢«ç”¨æˆ·è®¾ç½®ã€‚
%    \begin{macrocode}
\cs_new_eq:NN \ctex_if_autoindent_touched:F \use:n
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_zhmap_case:nnn}
% å‚æ•° |#1| æ˜¯ \pkg{zhmCJK} çš„å†…å®¹ï¼Œ|#2| æ˜¯ \pkg{zhmetrics}ã€‚
%    \begin{macrocode}
\cs_new_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_at_end:n}
% åŒºåˆ† \tn{AtEndOfClass} å’Œ \tn{AtEndOfPackage}ï¼Œè™½ç„¶å®ƒä»¬çš„æ„æ€éƒ½æ˜¯ä¸€æ&nbsp;·çš„ã€‚
%    \begin{macrocode}
%&lt;class&gt;\cs_new_protected:Npn \ctex_at_end:n { \AtEndOfClass }
%&lt;ctex&gt;\cs_new_protected:Npn \ctex_at_end:n { \AtEndOfPackage }
%    \end{macrocode}
% \end{macro}
%
% \begin{variable}{\ctex_load_std_class:n,\g_@@_std_options_clist}
% ä¿å­˜ä¼&nbsp;é€’ç»™æ&nbsp;‡å‡†æ–‡æ¡£ç±»çš„é€‰é¡¹ã€‚
% ä½¿ç”¨ \tn{PassOptionsToClass} æ˜¯ä¸ºäº†é¢„é˜²å¯èƒ½å­˜åœ¨çš„é€‰é¡¹å†²çªï¼Œé€‰é¡¹åˆ—è¡¨å±•å¼€åŽå†ä¼&nbsp;é€’ã€‚
%    \begin{macrocode}
%&lt;*class&gt;
\cs_new_protected:Npn \ctex_load_std_class:n #1
  {
    \tl_const:Nn \c_@@_class_tl {#1}
    \exp_args:No \PassOptionsToClass
      { \g_@@_std_options_clist }
      {#1}
    \LoadClass {#1}
  }
\clist_new:N \g_@@_std_options_clist
%&lt;/class&gt;
%    \end{macrocode}
% \end{variable}
%
% å¯¹æ—&nbsp;æ•ˆé€‰é¡¹ç»™å‡ºè­¦å‘Šã€‚
%    \begin{macrocode}
\msg_new:nnn { ctex } { invalid-option }
  { Option~`\l_keys_key_tl'~is~invalid~in~current~mode. }
\msg_new:nnn { ctex } { invalid-value }
  { Value~`#1'~is~invalid~for~the~key~`\l_keys_key_tl'. }
%    \end{macrocode}
%
% \begin{macro}[int]{\ctex_deprecated_option:nn,
% \ctex_set_deprecated_option:n,\ctex_deprecated_command:Nn}
% å¯¹è¿‡æ—¶é€‰é¡¹æˆ–å‘½ä»¤ç»™å‡ºè­¦å‘Šã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_deprecated_option:n
  { \msg_warning:nnn { ctex } { deprecated-option } }
\cs_new_protected:Npn \ctex_set_deprecated_option:n #1
  {
    \ctex_deprecated_option:n { Option~`#1'~is~set. }
    \ctex_set:nn { option } {#1}
  }
\cs_new_protected:Npn \ctex_deprecated_command:Nn #1#2
  {
    \msg_warning:nnxx { ctex } { deprecated-command }
      { \token_to_str:N #1 } { \exp_not:n {#2} }
  }
\msg_new:nnn { ctex } { deprecated-option }
  { Option~`\l_keys_key_tl'~is~deprecated.\\ #1 }
\msg_new:nnn { ctex } { deprecated-command }
  { Command~`#1'~is~deprecated.\\ #2 }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/class|ctex&gt;
%    \end{macrocode}
%
% \begin{variable}{\g_@@_font_size_int}
% |0| è¡¨ç¤ºä¿®æ”¹é»˜è®¤å­—ä½“å¤§å°ä¸ºäº”å·ï¼Œ|1| ä¸ºå°å››å·ï¼Œå¤§äºŽ 1 åˆ™ä¸ä½œä¿®æ”¹ã€‚åˆå§‹å€¼ |-1|
% è¡¨ç¤º \opt{zihao} é€‰é¡¹æœªåˆå§‹åŒ–ï¼Œä¼šåœ¨å°†æ¥æ&nbsp;¹æ®æ–‡æ¡£ç±»å†³å®šåˆå€¼ã€‚
%    \begin{macrocode}
%&lt;*class|ctex|ctexsize&gt;
\int_new:N \g_@@_font_size_int
\int_gset:Nn \g_@@_font_size_int { -1 }
%&lt;/class|ctex|ctexsize&gt;
%    \end{macrocode}
% \end{variable}
%
% \subsection{å®åŒ…é€‰é¡¹}
%
% \changes{v2.3}{2015/09/25}
%   {\texttt{.value_required:} å’Œ \texttt{.value_forbidden:} å·²è¿‡æ—¶ã€‚}
%
%   \begin{macrocode}
%&lt;*class|style&gt;
\ctex_define_option:n
  {
%&lt;/class|style&gt;
%    \end{macrocode}
%
% \changes{v2.0}{2015/05/06}{æ–°å¢ž \opt{zihao} é€‰é¡¹ã€‚}
% \changes{v2.0}{2015/05/06}{\opt{c5size}, \opt{cs4size} æ˜¯è¿‡æ—¶é€‰é¡¹ã€‚}
%
% \begin{macro}{zihao}
% \changes{v2.4.1}{2016/05/13}{ä¸å…è®¸æ—&nbsp;å‚ \opt{zihao} é€‰é¡¹ã€‚}
%    \begin{macrocode}
%&lt;*class|ctex|ctexsize&gt;
    zihao .choice: ,
    zihao .value_required:n = true ,
    zihao /     5  .code:n = { \int_gset:Nn \g_@@_font_size_int { 0 } } ,
    zihao /    -4  .code:n = { \int_gset:Nn \g_@@_font_size_int { 1 } } ,
    zihao / false  .code:n = { \int_gset:Nn \g_@@_font_size_int { 2 } } ,
%&lt;ctexsize&gt;  }
%&lt;/class|ctex|ctexsize&gt;
%&lt;*class|ctex&gt;
    c5size  .code:n = { \ctex_set_deprecated_option:n { zihao =  5 } } ,
    cs4size .code:n = { \ctex_set_deprecated_option:n { zihao = -4 } } ,
    c5size  .value_forbidden:n = true ,
    cs4size .value_forbidden:n = true ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2014/04/23}{æ–°å¢ž \opt{linespread} é€‰é¡¹ã€‚}
%
% \begin{macro}{linespread}
% è¡Œè·åˆå§‹å€¼ä¸ºæ&nbsp;‡å¿— \texttt{nan}ï¼Œç”¨äºŽæ£€æŸ¥ç”¨æˆ·æ˜¯å¦è®¾ç½®äº† \opt{linespread} é€‰é¡¹ã€‚
%    \begin{macrocode}
    linespread  .fp_set:N = \l_@@_line_spread_fp ,
    linespread .initial:n = { \c_nan_fp } ,
    linespread .value_required:n = true ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2014/03/13}{æ–°å¢ž \opt{autoindent} é€‰é¡¹ã€‚}
%
% \begin{macro}{autoindent}
% è‡ªåŠ¨è°ƒæ•´æ®µè½çš„é¦–è¡Œç¼©è¿›åŠŸèƒ½ã€‚
%    \begin{macrocode}
    autoindent .choice: ,
    autoindent .default:n = { true } ,
    autoindent / true    .code:n =
      {
        \tl_set:Nn \l_@@_autoindent_tl { 2 \ccwd }
        \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
      } ,
    autoindent / false   .code:n =
      {
        \tl_clear:N \l_@@_autoindent_tl
        \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
      } ,
    autoindent / unknown .code:n =
      {
        \ctex_set_default_ccwd:Nn \l_@@_autoindent_tl {#1}
        \cs_set_eq:NN \ctex_if_autoindent_touched:F \use_none:n
      } ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2015/03/21}{\opt{indent}, \opt{noindent} æ˜¯è¿‡æ—¶é€‰é¡¹ã€‚}
% \begin{macro}{indent}
% ä»…ä¸ºå…¼å®¹æ€§ä¿ç•™ï¼Œå·²è¿‡æ—¶ã€‚
%    \begin{macrocode}
    indent .code:n =
      {
        \ctex_deprecated_option:n
          {
            The~functionality~has~been~removed.\\
            It's~better~to~set~the~heading~styles~via~`afterindent'~option.
          }
      } ,
    indent .value_forbidden:n = true ,
    noindent .code:n =
      {
        \ctex_deprecated_option:n
          {
            The~functionality~has~been~removed.\\
            It's~better~to~set~the~heading~styles~via~`afterindent'~option.
          }
      } ,
    noindent .value_forbidden:n = true ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5}{2019/11/10}{æ‰€æœ‰å¼•æ“Žä¸‹é»˜è®¤ç¼–ç&nbsp;å‡è®¾ä¸º UTF-8ã€‚}
%
% \begin{macro}{GBK,UTF8}
% æ–‡æ¡£ç¼–ç&nbsp;ï¼Œé»˜è®¤ä¸º UTF-8ã€‚
%   \begin{macrocode}
    GBK  .code:n =
      {
        \sys_if_engine_pdftex:TF
          { \tl_gset:Nn \g_@@_encoding_tl { GBK } }
          {
            \msg_warning:nn { ctex } { invalid-option }
            \tl_gset:Nn \g_@@_encoding_tl { UTF8 }
          }
      } ,
    UTF8 .code:n = { \tl_gset:Nn \g_@@_encoding_tl { UTF8 } } ,
    GBK  .value_forbidden:n = true ,
    UTF8 .value_forbidden:n = true ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2014/03/08}{æ–°å¢ž \opt{fontset} é€‰é¡¹ã€‚}
% \changes{v2.0}{2015/03/21}{\opt{nofonts}, \opt{adobefonts}, \opt{winfonts}
% æ˜¯è¿‡æ—¶é€‰é¡¹ã€‚}
%
% \begin{macro}{fontset}
% åˆå§‹å€¼ä¸ºç©ºã€‚è‹¥ç”¨æˆ·æœªæŒ‡å®šï¼Œåˆ™æ&nbsp;¹æ®æ“ä½œç³»ç»Ÿè½½å…¥å¯¹åº”å­—ä½“é…ç½®ï¼Œå¯ä»¥åŒºåˆ† Windowsã€
% macOS å’Œå…¶ä»–ã€‚
%   \begin{macrocode}
    fontset    .tl_gset:N = \g_@@_fontset_tl ,
    nofonts    .code:n = { \ctex_set_deprecated_option:n { fontset = none } } ,
    adobefonts .code:n = { \ctex_set_deprecated_option:n { fontset = adobe } } ,
    winfonts   .code:n = { \ctex_set_deprecated_option:n { fontset = windows } } ,
    nofonts    .value_forbidden:n = true ,
    winfonts   .value_forbidden:n = true ,
    adobefonts .value_forbidden:n = true ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2014/03/08}{æ–°å¢ž \opt{zhmCJK} æ”¯æŒé€‰é¡¹ã€‚}
% \changes{v2.0}{2015/03/22}{\opt{nozhmap} æ˜¯è¿‡æ—¶é€‰é¡¹ã€‚}
%
% \begin{macro}{zhmap}
%   \begin{macrocode}
    zhmap .choice: ,
    zhmap .default:n = { true } ,
    zhmap / zhmCJK .code:n =
      {
        \bool_gset_true:N \g_@@_zhmCJK_bool
        \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_i:nnn
      } ,
    zhmap / true   .code:n =
      {
        \bool_gset_false:N \g_@@_zhmCJK_bool
        \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_ii:nnn
      } ,
    zhmap / false  .code:n =
      {
        \bool_gset_false:N \g_@@_zhmCJK_bool
        \cs_gset_eq:NN \ctex_zhmap_case:nnn \use_iii:nnn
      } ,
    nozhmap   .code:n =
      { \ctex_set_deprecated_option:n { zhmap = false } } ,
    nozhmap   .value_forbidden:n = true ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2014/04/11}{\opt{punct} é€‰é¡¹å¯ä»¥è®¾ç½®æ&nbsp;‡ç‚¹æ&nbsp;¼å¼ã€‚}
% \changes{v2.0}{2015/03/21}{\opt{nopunct} æ˜¯è¿‡æ—¶é€‰é¡¹ã€‚}
%
% \begin{macro}{punct}
% è®¾ç½®æ&nbsp;‡ç‚¹ç¬¦å·è¾“å‡ºæ&nbsp;¼å¼ã€‚
%   \begin{macrocode}
    punct   .tl_set:N = \l_@@_punct_tl ,
    punct  .default:n = { quanjiao } ,
    punct  .initial:n = { quanjiao } ,
    nopunct   .code:n = \ctex_set_deprecated_option:n { punct = plain } ,
    nopunct   .value_forbidden:n = true ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2015/03/22}{\opt{nospace} æ˜¯è¿‡æ—¶é€‰é¡¹ã€‚}
% \begin{macro}{space}
%   \begin{macrocode}
    space .choices:nn =
      { true , auto , false }
      {
        \exp_args:Ne \ctex_at_end:n
          { \ctex_set:n { space = \l_keys_choice_tl } }
      } ,
    space  .default:n = { true } ,
    nospace   .code:n = { \ctex_deprecated_option:nn { space = false } } ,
    nospace   .value_forbidden:n = true ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2014/03/08}{\pkg{ctex} å®åŒ…æ–°å¢ž \opt{heading} é€‰é¡¹ã€‚}
%
% \begin{macro}{heading}
%   \begin{macrocode}
    heading .bool_set:N = \l_@@_heading_bool ,
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/class|ctex&gt;
%&lt;*class|ctex|ctexheading&gt;
%    \end{macrocode}
%
% \begin{macro}{sub3section,sub4section}
% \begin{macrocode}
%&lt;*!beamer&gt;
    sub3section .code:n =
      { \int_gset:Nn \g_@@_section_depth_int { 3 } } ,
    sub4section .code:n =
      { \int_gset:Nn \g_@@_section_depth_int { 4 } } ,
    sub3section .value_forbidden:n = true ,
    sub4section .value_forbidden:n = true ,
%&lt;/!beamer&gt;
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2015/04/15}{æ–°å¢ž \opt{scheme} é€‰é¡¹ï¼Œå¹¶å°† \opt{cap} å’Œ \opt{nocap}
% åˆ—ä¸ºè¿‡æ—¶é€‰é¡¹ã€‚}
%
% \begin{macro}{scheme}
%    \begin{macrocode}
    scheme .tl_set:N  = \l_@@_scheme_tl ,
%&lt;*ctexheading&gt;
    scheme .default:n = { plain } ,
    scheme .initial:n = { plain }
  }
%&lt;/ctexheading&gt;
%&lt;*!ctexheading&gt;
    scheme .default:n = { chinese } ,
    scheme .initial:n = { chinese } ,
%&lt;/!ctexheading&gt;
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/class|ctex|ctexheading&gt;
%&lt;*class|ctex&gt;
%    \end{macrocode}
%
% \begin{macro}{cap,nocap}
% \opt{cap} å’Œ \opt{nocap} æ˜¯è¿‡æ—¶é€‰é¡¹ã€‚
% \begin{macrocode}
    cap    .code:n = { \ctex_set_deprecated_option:n { scheme = chinese } } ,
    nocap  .code:n = { \ctex_set_deprecated_option:n { scheme = plain } } ,
    cap    .value_forbidden:n = true ,
    nocap  .value_forbidden:n = true ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2015/04/20}{\opt{hyperref} æˆä¸ºè¿‡æ—¶é€‰é¡¹ï¼ŒåŽŸé€‰é¡¹åŠŸèƒ½æ€»æ˜¯æ‰“å¼€ã€‚}
% \changes{v2.0}{2015/04/20}{\opt{fancyhdr} æˆä¸ºè¿‡æ—¶é€‰é¡¹ï¼ŒåŽŸé€‰é¡¹åŠŸèƒ½æ€»æ˜¯æ‰“å¼€ã€‚}
% \changes{v2.0}{2015/04/20}{\opt{fntef} æˆä¸ºè¿‡æ—¶é€‰é¡¹ï¼ŒåŽŸé€‰é¡¹åŠŸèƒ½æ€»æ˜¯æ‰“å¼€ã€‚}
%
% ä»¥ä¸‹ä¸‰é¡¹éƒ½æ˜¯è¿‡æ—¶çš„å…¼å®¹é€‰é¡¹ï¼Œå®ƒä»¬ä¼šè½½å…¥æœ‰å…³å®åŒ…ã€‚
%
% \begin{macro}{fntef}
% \changes{v2.5}{2019/11/10}{ä»…åœ¨è¯¥é€‰é¡¹å¯ç”¨æ—¶ä¼šè½½å…¥ \pkg{CJKfntef} æˆ–
% \pkg{xeCJKfntef} å®åŒ…ã€‚}
%   \begin{macrocode}
    fntef .code:n =
      {
        \sys_if_engine_xetex:TF
          {
            \ctex_deprecated_option:n { `xeCJKfntef'~package~is~loaded. }
            \ctex_at_end:n { \RequirePackage { xeCJKfntef } }
          }
          {
            \sys_if_engine_pdftex:TF
              {
                \ctex_deprecated_option:n { `CJKfntef'~package~is~loaded. }
                \ctex_at_end:n { \RequirePackage { CJKfntef } }
              }
              {
                \ctex_deprecated_option:n
                  { Furthermore,~option~`fntef'~is~invalid~in~current~mode. }
              }
          }
      } ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{fancyhdr}
%   \begin{macrocode}
    fancyhdr .code:n =
      {
        \ctex_deprecated_option:n { `fancyhdr'~package~is~loaded. }
        \ctex_at_end:n { \RequirePackage { fancyhdr } }
      } ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{hyperref}
% \changes{v2.1}{2015/06/03}{è¡¥å……å®šä¹‰ \tn{hypersetup}ã€‚}
%   \begin{macrocode}
    hyperref .code:n =
      {
        \ctex_deprecated_option:n { `hyperref'~package~will~be~loaded. }
        \ctex_at_end:n
          {
            \cs_if_exist:NF \hypersetup
              { \cs_new_eq:NN \hypersetup \ctex_hypersetup:n }
          }
        \ctex_at_end_preamble:n { \RequirePackage { hyperref } }
      } ,
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/class|ctex&gt;
%&lt;*class|ctex|ctexsize&gt;
%    \end{macrocode}
%
% \changes{v2.0}{2015/05/06}{å…¼å®¹ \pkg{extsizes} å®åŒ…ã€\cls{beamer}ã€\pkg{memoir}
% ç­‰æä¾›çš„æ›´å¤šå­—å·é€‰é¡¹ã€‚}
% \changes{v2.0.1}{2015/05/15}{ä¿®å¤ \opt{10pt}ã€\opt{11pt} ç­‰é€‰é¡¹æ—&nbsp;æ•ˆçš„é—®é¢˜ã€‚}
% \begin{macro}{10pt,11pt,12pt}
% ä½¿ \pkg{ctex} å’Œ \pkg{ctexsize} å¯ä»¥æŽ¥å—æ–‡æ¡£ç±»çš„å…¨å±€é€‰é¡¹ï¼Œä¸ä¿®æ”¹é»˜è®¤å­—ä½“å¤§å°ã€‚
% åœ¨æ–‡æ¡£ç±»ä¸‹è¿˜å°†å‚æ•°ä¼&nbsp;ç»™æ&nbsp;‡å‡†æ–‡æ¡£ç±»ã€‚
%    \begin{macrocode}
\tl_clear_new:N \l_@@_tmp_tl
\clist_map_inline:nn
  {
    10pt , 11pt , 12pt ,
     8pt ,  9pt , 14pt , 17pt , 20pt , 25pt , 30pt , 36pt , 48pt , 60pt
  }
  {
    \tl_put_right:Nn \l_@@_tmp_tl
      {
        #1 .code:n =
%&lt;*!class&gt;
          { \int_gset:Nn \g_@@_font_size_int { 2 } } ,
%&lt;/!class&gt;
%&lt;*class&gt;
          {
            \int_gset:Nn \g_@@_font_size_int { 2 }
            \clist_gput_right:Nn \g_@@_std_options_clist {#1}
          } ,
%&lt;/class&gt;
        #1 .value_forbidden:n = true ,
      }
  }
\exp_args:No \ctex_define_option:n { \l_@@_tmp_tl }
\tl_clear:N \l_@@_tmp_tl
%    \end{macrocode}
% \end{macro}
%
% å°†æœªçŸ¥é€‰é¡¹ä¼&nbsp;ç»™æ&nbsp;‡å‡†æ–‡æ¡£ç±»ã€‚
%    \begin{macrocode}
%&lt;*class&gt;
\ctex_define_option:n
  {
    unknown .code:n =
      { \clist_gput_right:No \g_@@_std_options_clist { \CurrentOption } }
  }
%&lt;/class&gt;
%    \end{macrocode}
%
% è½½å…¥é€‰é¡¹é…ç½®æ–‡ä»¶ã€‚
%    \begin{macrocode}
%&lt;!ctexsize&gt;\ctex_file_input:n { ctexopts.cfg }
%&lt;/class|ctex|ctexsize&gt;
%    \end{macrocode}
%
% å¤„ç†å®åŒ…é€‰é¡¹ã€‚
%    \begin{macrocode}
%&lt;*class|style&gt;
\cs_if_exist:NTF \ProcessKeyOptions
  { \ProcessKeyOptions [ ctex / option ] }
  {
    \RequirePackage { l3keys2e }
    \ProcessKeysOptions { ctex / option }
  }
%&lt;/class|style&gt;
%    \end{macrocode}
%
% \pdfLaTeX{} ä¸‹ï¼Œå¦‚æžœæ²¡æœ‰æ˜¾å¼æŒ‡å®šç¼–ç&nbsp;ä¸º |UTF8|ï¼Œåˆ™ç»™å‡ºè­¦å‘Šä¿¡æ¯ã€‚
%    \begin{macrocode}
%&lt;*class|ctex&gt;
\msg_new:nnn { ctex } { pdftex-utf8 }
  { UTF8~will~be~used~as~the~default~encoding. }
\tl_if_empty:NT \g_@@_encoding_tl
  {
    \sys_if_engine_pdftex:T
      { \msg_warning:nn { ctex } { pdftex-utf8 } }
    \tl_gset:Nn \g_@@_encoding_tl { UTF8 }
  }
%&lt;/class|ctex&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;*class&gt;
%    \end{macrocode}
%
% äº”å·å­—ä½¿ç”¨æ&nbsp;‡å‡†æ–‡æ¡£ç±»çš„ |10pt| å­—ä½“å¤§å°è®¾ç½®ï¼Œå°å››å·å­—åˆ™ä½¿ç”¨ |12pt|ã€‚
%    \begin{macrocode}
\int_case:nn { \g_@@_font_size_int }
  {
    { 0 } { \clist_gput_right:Nn \g_@@_std_options_clist { 10pt } }
    { 1 } { \clist_gput_right:Nn \g_@@_std_options_clist { 12pt } }
  }
%    \end{macrocode}
%
% è½½å…¥æ&nbsp;‡å‡†æ–‡æ¡£ç±»ã€‚
%    \begin{macrocode}
%&lt;*article&gt;
\ctex_load_std_class:n { article }
%&lt;/article&gt;
%&lt;*book&gt;
\ctex_load_std_class:n { book }
%&lt;/book&gt;
%&lt;*report&gt;
\ctex_load_std_class:n { report }
%&lt;/report&gt;
%&lt;*beamer&gt;
\ctex_load_std_class:n { beamer }
%&lt;/beamer&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/class&gt;
%    \end{macrocode}
%
% \subsection{ç‰¹å®šå¼•æ“Žæ”¯æŒä¸Žè®¾ç½®}
%
% \changes{v2.5}{2020/04/22}{ç»™ \LaTeX å’Œ \upLaTeX ä¸‹çš„æ–‡æ¡£ç±»æŒ‡å®šé©±åŠ¨ä¸º \dvipdfmxã€‚}
%
% \subsubsection{\pkg{ctexbackend.cfg}}
%
% å¯¹äºŽ \XeLaTeX{}/\pdfLaTeX{}/\LuaLaTeX{} ç­‰é»˜è®¤ç›´æŽ¥è¾“å‡º PDF çš„ç¼–è¯‘æ–¹å¼ï¼Œç”¨æˆ·
% æ—&nbsp;éœ€ä¸ºæ¶‰åŠé©±åŠ¨çš„å®åŒ…æŒ‡å®šé©±åŠ¨é€‰é¡¹ã€‚å¯¹äºŽ \LaTeX å’Œ \upLaTeX{} ç­‰é»˜è®¤ä¸ç›´æŽ¥è¾“å‡º PDF çš„ç¼–è¯‘æ–¹å¼ï¼Œ
% ç”¨æˆ·åˆ™éœ€è¦æŒ‡å®šé©±åŠ¨é€‰é¡¹ã€‚
%
% ç”±äºŽåŽ†å²é—ç•™é—®é¢˜ï¼Œåœ¨ä½¿ç”¨ \LaTeX{} æˆ– \upLaTeX{} ç­‰ç¼–è¯‘æ—¶ï¼Œ
% å¤§å¤šæ•°æ¶‰åŠé©±åŠ¨çš„å®åŒ…é€‰å®šçš„é»˜è®¤è¾“å‡ºé©±åŠ¨éƒ½æ˜¯ Dvipsã€‚
% è€ƒè™‘å½“å‰å®žé™…ä½¿ç”¨é¢‘çŽ‡ï¼Œä»¥åŠè€ƒè™‘åˆ° \CTeX{} å®é›†å¯¹ä¸­æ–‡æ”¯æŒçš„é»˜è®¤æ–¹å¼ï¼Œ
% æˆ‘ä»¬åœ¨ç”¨æˆ·ä½¿ç”¨ \CTeX{} ç³»åˆ—æ–‡æ¡£ç±»æ—¶ï¼Œå°†é»˜è®¤çš„è¾“å‡ºé©±åŠ¨æ”¹ä¸º \dvipdfmxã€‚
%
% å…·ä½“æ¥è¯´ï¼Œå¦‚æžœ |dvips|ï¼Œ|dvipdfmx|ï¼Œ|dvisvgm| ç­‰é©±åŠ¨æ²¡æœ‰åœ¨æ–‡æ¡£ç±»çš„å…¨å±€é€‰é¡¹ä¸­è¢«æ˜Žç¡®æŒ‡å®šï¼Œ
% æˆ‘ä»¬å°±åœ¨ \tn{@classoptionslist} å¼€å¤´åŠ&nbsp;å…¥ |dvipdfmx|ã€‚
%
% æœ¬æ®µä»£ç&nbsp;åªåœ¨ \cls{ctexart} ç­‰æ–‡æ¡£ç±»å¼€å¤´è½½å…¥ï¼Œä¸åœ¨ \pkg{ctex} ä¸­ä½¿ç”¨ã€‚
% å¹¶ä¸”éœ€è¦æ”¾åœ¨ \pkg{expl3} ä¹‹å‰è½½å…¥ï¼Œä¿è¯å®ƒè½½å…¥æ­£ç¡®çš„ backend æ–‡ä»¶ã€‚
%    \begin{macrocode}
%&lt;*backend&gt;
\begingroup
\expandafter\ifx\csname Umathchardef\endcsname\relax
\else\expandafter\endgroup\expandafter\endinput\fi
  \ifodd
    \expandafter\ifx\csname      pdfoutput\endcsname\relax
    \expandafter\ifx\csname enablecjktoken\endcsname\relax 0\else 1\fi
                                   \else\ifnum\pdfoutput&gt;0 0\else 1\fi\fi\space
    \def\x#1{%
      \if\relax\detokenize{#1}\relax
        \gdef\@classoptionslist{dvipdfmx}%
      \else
        \let\CTEX@add\@ne
        \@tfor\x:={dvips}{dvipdfmx}{dvisvgm}\do{%
          \expandafter\in@\expandafter{\expandafter,\x,}{,#1,}%
          \ifin@ \let\CTEX@add\tw@ \@break@tfor \fi}%
        \ifodd\CTEX@add \gdef\@classoptionslist{dvipdfmx,#1}\fi
      \fi}
    \expandafter\x\expandafter{\@classoptionslist}
  \fi
\endgroup
%&lt;/backend&gt;
%    \end{macrocode}
%
% \subsubsection{\pkg{ctex-engine-pdftex.def}}
%
% \begin{macro}[int]{\ctex_set_zhmap:n}
% è®¾ç½® \upTeX{} å­—ä½“æ˜&nbsp;å°„ï¼ŒåŒæ—¶ä½œç”¨äºŽ \tn{AtBeginDvi} ä¸Ž
% \tn{AtBeginShipoutFirst}ã€‚è¯¥å®å¯¹ \pdfTeX{} å’Œ \upTeX{} å‡æœ‰ç”¨ã€‚
% \tn{AtBeginDvi} ç›´æŽ¥å°† \tn{special} ä¿å­˜åˆ°ç›’å­ä¸­ï¼Œ
% \tn{AtBeginShipoutFirst} æ˜¯ä¿å­˜åˆ°åˆ°å®ä¸­ï¼Œå¹¶ä¸”ä¸å±•å¼€å‚æ•°ã€‚
%
% å¯ä»¥ä½¿ç”¨ \LaTeX\ 2020/10/01 çš„é’©å­æœºåˆ¶æ¥ç»Ÿä¸€è®¾ç½®ã€‚
%     \begin{macrocode}
%&lt;*pdftex|uptex|aptex&gt;
\cs_new_protected:Npn \ctex_set_zhmap:n
  { \tl_gput_right:Nx \g_@@_zhmap_tl }
\cs_new_protected:Npn \ctex_use_zhmap:
  { \tl_use:N \g_@@_zhmap_tl }
\cs_if_exist:NTF \ctex_gadd_ltxhook:nn
  {
    \cs_new_protected:Npn \ctex_at_shipout_first:n
      { \ctex_gadd_ltxhook:nn { shipout/firstpage } }
    \ctex_at_shipout_first:n { \ctex_use_zhmap: }
  }
  {
    \cs_new_protected:Npn \ctex_add_dvi_zhmap:
      { \AtBeginDvi { \ctex_use_zhmap: } }
    \ctex_after_end_preamble:n { \ctex_add_dvi_zhmap: }
    \ctex_at_end_package:nn { atbegshi }
      {
        \cs_new_protected:Npn \ctex_at_shipout_first:n
          { \AtBeginShipoutFirst }
        \ctex_at_shipout_first:n { \ctex_use_zhmap: }
        \cs_gset_eq:NN \ctex_add_dvi_zhmap: \prg_do_nothing:
      }
  }
\tl_new:N \g_@@_zhmap_tl
\@onlypreamble \ctex_set_zhmap:n
%&lt;/pdftex|uptex|aptex&gt;
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;*pdftex&gt;
%    \end{macrocode}
%
% \changes{v2.1}{2015/05/18}{ç»™ \pdfLaTeX{} ä¸‹çš„éž UTF-8 ç¼–ç&nbsp; CJK å­—ä½“æ—åŠ&nbsp;ä¸Š CMapã€‚}
%
% \begin{variable}{\c_@@_cmap_encoding_seq}
% éœ€è¦åŠ&nbsp;ä¸Š CMap çš„ CJK å­—ä½“ç¼–ç&nbsp;ã€‚
%    \begin{macrocode}
\seq_const_from_clist:Nn \c_@@_cmap_encoding_seq
  { C19 , C10 , C00 , C09 , C40 , C60 }
%    \end{macrocode}
% \end{variable}
%
% \begin{macro}[int]{\ctex_family_cmap:nn}
% åœ¨ \tn{DeclareFontFamily} çš„ \meta{loading-settings} ä¸­ç»™ CJK å­—ä½“æ—åŠ&nbsp;ä¸Š CMapã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_family_cmap:nn #1#2
  {
    \cs_if_free:cF { #1 + #2 }
      {
        \seq_if_in:NnT \c_@@_cmap_encoding_seq {#1}
          { \tl_gput_right:cn { #1 + #2 } { \ctex_add_cmap:n {#1} } }
      }
  }
\cs_generate_variant:Nn \ctex_family_cmap:nn { ee }
\cs_new_eq:NN \CTEX@Family@CMap \ctex_family_cmap:ee
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5.7}{2021/06/06}{æ›´å¥½åœ°å…¼å®¹ \pkg{cmap} åŒ…ã€‚}
%
% \begin{macro}[int]{\ctex_add_cmap:n}
% \changes{v2.5.7}{2021/06/06}{ç¡®ä¿ cmap æ–‡ä»¶å­˜åœ¨ã€‚}
% \changes{v2.5.10}{2022/07/11}{ä½¿ç”¨å°è£…å¥½çš„å‡½æ•°ã€‚}
% ç»™ |#1| ç¼–ç&nbsp;çš„ CJK å­—ä½“åŠ&nbsp;ä¸Š CMapã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_add_cmap:n #1
  {
    \cs_if_free:NF \CJK@plane
      { \exp_args:Ne \@@_add_cmap_auxi:n { #1 \CJK@plane } }
  }
\cs_new_protected:Npn \@@_add_cmap_auxi:n #1
  { \exp_args:Nc \@@_add_cmap_auxii:Nn { @@_add_cmap_ #1 : } {#1} }
\cs_new_protected:Npn \@@_add_cmap_auxii:Nn #1#2
  {
    \cs_if_exist:NF #1 { \@@_save_cmap:Nn #1 {#2} }
    #1
  }
\cs_new_protected:Npn \@@_save_cmap:Nn #1#2
  {
    \exp_args:Ne \file_get_full_name:nNTF
      { \str_lowercase:n {#2} .cmap } \l_@@_cmap_file_tl
      {
        \pdf_object_unnamed_write:nx
          { fstream }
          { { } { \l_@@_cmap_file_tl } }
        \cs_new_protected:Npx #1
          {
            \pdfnobuiltintounicode \tex_font:D
            \tex_pdffontattr:D \tex_font:D
              { /ToUnicode ~ \pdf_object_ref_last: }
          }
      }
      { \cs_new_eq:NN #1 \prg_do_nothing: }
  }
\tl_new:N \l_@@_cmap_file_tl
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\DeclareFontFamily}
% åªåœ¨ \pdfLaTeX{} ä¸‹åŠ&nbsp; CMapã€‚å¦‚ \pkg{cmap} å®åŒ…è¢«å¼•å…¥ï¼Œåˆ™ä¸é‡å¤è®¾ç½®ã€‚
%    \begin{macrocode}
\sys_if_output_pdf:T
  {
    \exp_args:Nno \use:n
      { \cs_gset_protected:Npn \DeclareFontFamily #1#2#3 }
      {
        \DeclareFontFamily {#1} {#2} {#3}
        \CTEX@Family@CMap  {#1} {#2}
      }
    \ctex_at_end_package:nn { cmap }
      {
        \cs_gset_eq:NN \ctex_add_cmap:n \use_none:n
        \cs_gset_eq:NN \CTEX@Family@CMap \use_none:nn
      }
  }
%    \end{macrocode}
% \end{macro}
%
% é¦–å…ˆæ£€æŸ¥é€‰é¡¹ï¼Œå†³å®šæ˜¯å¦è½½å…¥ \pkg{zhmCJK} å®åŒ…ã€‚
%    \begin{macrocode}
\bool_if:NTF \g_@@_zhmCJK_bool
  {
    \exp_args:Ne \PassOptionsToPackage
      { encoding = \g_@@_encoding_tl }
      { zhmCJK }
    \RequirePackage { zhmCJK }
  }
%    \end{macrocode}
% ä¸è½½å…¥ \pkg{zhmCJK} å®åŒ…æ—¶ç›´æŽ¥è°ƒç”¨ \pkg{CJK} åŠç›¸å…³å®åŒ…ã€‚
%    \begin{macrocode}
  {
    \str_if_eq:onTF { \g_@@_encoding_tl } { GBK }
      { \RequirePackage { CJK } }
      { \RequirePackage { CJKutf8 } }
    \RequirePackage { CJKpunct , CJKspace }
%    \end{macrocode}
%
% \changes{v2.4.4}{2016/09/09}{è§£å†³ \opt{zhmap} æ–‡ä»¶çš„ \tn{catcode} é—®é¢˜ã€‚}
%
% \begin{macro}[int]{\ctex_load_zhmap:nnnn}
% è½½å…¥ \pkg{zhmetrics} çš„å­—ä½“æ˜&nbsp;å°„æ–‡ä»¶ï¼ŒåŒæ—¶è®¾ç½® \tn{CJKrmdefault} ç­‰ã€‚
%    \begin{macrocode}
    \cs_new_protected:Npn \ctex_load_zhmap:nnnn #1#2#3#4
      {
        \tl_set:Nn \CJKrmdefault {#1}
        \tl_set:Nn \CJKsfdefault {#2}
        \tl_set:Nn \CJKttdefault {#3}
        \ctex_set_zhmap:n { \ctex_file_input:n { ctex-zhmap- #4 .tex } }
      }
    \@onlypreamble \ctex_load_zhmap:nnnn
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5.10}{2022/06/10}{å–æ¶ˆ \LaTeX\ 2022-06-01 å¯¹ä¹¦åå·çš„å®šä¹‰ã€‚}
%
% \begin{macro}{\ctex_undeclare_unicode_character:n,\ctex_utfviii_char:n}
% \LaTeX\ 2022-06-01 å°†é€šå¸¸ç”¨ä½œä¸­æ–‡ä¹¦åå·çš„ U+3008 å’Œ U+3009 åˆ†åˆ«å®šä¹‰ä¸º
% \tn{textlangle} å’Œ \tn{textrangle}ï¼Œè¿™ä¸ªå®šä¹‰ä¼šè¢« \pkg{CJKutf8} åŒ…ä¼šä¼˜å…ˆä½¿ç”¨ã€‚
% æˆ‘ä»¬æ€»æ˜¯ä½¿ç”¨ä¸­æ–‡ä¹¦åå·ï¼Œéœ€è¦å–æ¶ˆ \LaTeX\ çš„å®šä¹‰ï¼Œä½œç”¨æ˜¯å±€éƒ¨çš„ï¼Œä¸ä½¿ç”¨ \cs{cs_undefine:N}ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_undeclare_unicode_character:n #1
  { \cs_set_eq:cN { u8 : \ctex_utfviii_char:n {#1} } \tex_undefined:D }
\cs_new:Npn \ctex_utfviii_char:n #1
  {
    \exp_last_unbraced:Ne \@@_utfviii_char_aux:nnnn
      { \char_to_utfviii_bytes:n {#1} }
  }
\cs_new:Npn \@@_utfviii_char_aux:nnnn #1#2#3#4
  {
    \char_generate:nn {#1} { 12 }
    \tl_if_empty:nF {#2} { \char_generate:nn {#2} { 12 } }
    \tl_if_empty:nF {#3} { \char_generate:nn {#3} { 12 } }
    \tl_if_empty:nF {#4} { \char_generate:nn {#4} { 12 } }
  }
\CJKaddEncHook { UTF8 }
  {
    \ctex_undeclare_unicode_character:n { "3008 }
    \ctex_undeclare_unicode_character:n { "3009 }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_CJK_input:n,\CJK@input}
% è½½å…¥ \pkg{CJK} åŒ…çš„ \file{.enc} å’Œ \file{.bdg} ç­‰æ–‡ä»¶æ—¶ï¼Œéœ€è¦è®¾ç½® \tn{endlinechar} ä¸º $-1$ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_CJK_input:n #1
  {
    \ctex_push_file:
      \int_set:Nn \tex_endlinechar:D { -1 }
      \file_input:n {#1}
    \ctex_pop_file:
  }
\cs_set_eq:NN \CJK@input \ctex_CJK_input:n
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_plane_to_utfxvibe:Nn,\CJK@surr}
% \changes{v2.0}{2014/04/08}{è§£å†³ä¸Ž \tn{nouppercase} çš„å†²çªã€‚}
% \pkg{fancyhdr} å®åŒ…çš„ \tn{nouppercase} ä¼šå°† \tn{uppercase} å®šä¹‰ä¸º \tn{relax}ï¼Œè€Œ
% \tn{CJK@surr} éœ€è¦ç”¨å®ƒå°† \tn{CJK@plane} è½¬åŒ–æˆå¤§å†™å­—æ¯ï¼Œè¿™å°±é€&nbsp;æˆäº†å†²çª^^A
% \footnote{\url{https://github.com/CTeX-org/ctex-kit/issues/146}}ã€‚
% æˆ‘ä»¬åœ¨è¿™é‡Œç»™å‡º \tn{CJK@surr} çš„ä¸€ä¸ªä¸ä¾èµ– \tn{uppercase} çš„å®žçŽ°ã€‚
%    \begin{macrocode}
\cs_if_free:NF \CJK@surr
  {
    \cs_new_protected:Npn \ctex_plane_to_utfxvibe:Nn #1#2
      {
        \int_set:Nn \l_@@_tmp_int
          { \exp_args:Ne \int_from_hex:n {#2} }
        \int_compare:nNnTF \l_@@_tmp_int &lt; { 256 }
          { \tl_gset:Nx #1 { \int_to_Hex:n { \l_@@_tmp_int } } }
          {
            \int_sub:Nn \l_@@_tmp_int { 256 }
            \tl_gset:Nx #1
              {
                \int_to_Hex:n
                  { \int_div_truncate:nn { \l_@@_tmp_int } { 4 } + "D800 }
                \int_to_Hex:n
                  { \int_mod:nn { \l_@@_tmp_int } { 4 } + "DC }
              }
          }
      }
    \cs_set_eq:NN \CJK@surr \ctex_plane_to_utfxvibe:Nn
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\CJK@addcmap}
% \changes{v2.5.7}{2021/06/06}{åº”ç”¨ \tn{pdfnobuiltintounicode}ã€‚}
% \LaTeX \ 2021-06-01 é»˜è®¤è½½å…¥ \file{glyphtounicode.tex}ï¼Œæˆ‘ä»¬å¯¹ CJK å­—ä½“ç¦ç”¨è¿™ä¸€å†…å»ºè®¾ç½®ã€‚
%    \begin{macrocode}
\cs_if_free:NF \CJK@addcmap
  {
    \ctex_patch_cmd:Nnn \CJK@addcmap
      { \pdffontattr \font@name }
      {
        \pdfnobuiltintounicode \font@name
        \pdffontattr \font@name
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \pkg{CJKpunct} å®åŒ…ä¼šåœ¨ \tn{AtBeginDocument} çš„é‡Œè®¾ç½®æ&nbsp;‡ç‚¹æ&nbsp;¼å¼ä¸º \opt{quanjiao}ã€‚
%    \begin{macrocode}
\AtBeginDocument
  {
    \use:e
      {
        \str_if_eq:nnF { \l_@@_punct_tl } { quanjiao }
          { \exp_not:N \punctstyle { \l_@@_punct_tl } }
      }
  }
%    \end{macrocode}
%
% åœ¨å¯¼è¨€åŒºæœ«å°¾æ›´æ–° \tn{CJKfamilydefault}ï¼Œæ³¨æ„è¦åœ¨ \tn{CJK@envStart} ä¹‹å‰ä½¿ç”¨ã€‚
%    \begin{macrocode}
\ctex_at_end_preamble:n { \ctex_update_default_family: }
%    \end{macrocode}
%
% ä»Ž \LaTeX\ 2018-04-01 å¼€å§‹ï¼Œä¼&nbsp;ç»Ÿå¼•æ“Žçš„é»˜è®¤ç¼–ç&nbsp;è¢«è®¾ç½®æˆ UTF-8ï¼Œ
% æ±‰å­—çš„é¦–å­—èŠ‚å·²ç»è¢«è®¾ç½®æˆæ´»åŠ¨å­—ç¬¦ï¼Œæˆ‘ä»¬æ—&nbsp;éœ€å†ä½¿ç”¨ \tn{CJK@makeActive} è®¾ç½®ã€‚
% \tn{CJK@envStart} çš„å®šä¹‰æ˜¯
% \begin{verbatim}
%   \def\CJK@envStart#1#2#3{
%     \CJK@upperReset
%     \ifCJK@lowercase@
%       \CJK@lowerReset
%     \fi%
%     \CJK@makeActive%
%     \CJK@global\let\CJK@selectFamily \CJK@selFam
%     \CJK@global\let\CJK@selectEnc \CJK@selEnc%
%     \def\CJK@@@enc{#2}
%     \ifx\CJK@@@enc \@empty
%       \PackageInfo{CJK}{
%         no encoding parameter given,\MessageBreak
%         waiting for \protect\CJKenc\space commands}
%     \else
%       \CJKenc{#2}
%     \fi
%     \CJKfontenc{#2}{#1}
%     \CJKfamily{#3}
%     \def\CJK@series{\f@series}
%     \def\CJK@shape{\f@shape}%
%     \csname CJKhook\endcsname}
% \end{verbatim}
% \tn{CJK@upperReset} å¯èƒ½ä¼šæœ‰ä¸€å®šé£Žé™©ï¼Œå›&nbsp;æ­¤æˆ‘ä»¬ç›´åˆ°å¯¼è¨€åŒºæœ«å°¾æ‰ä½¿ç”¨
% \tn{CJK@envStart}ã€‚è¿™æ&nbsp;·å¯ä»¥é¿å…å°† \env{CJK} çŽ¯å¢ƒå†…ç½®å…¥ \env{document} çŽ¯å¢ƒçš„
% æœ€é‡Œå±‚ï¼Œæœ€åŽä¹Ÿå°±ä¸éœ€è¦ \tn{clearpage}ã€‚\pkg{zhmCJK} å·²ç»æä¾›ç±»ä¼¼åŠŸèƒ½ã€‚
% æ³¨æ„å…ˆä½¿ç”¨ \cs{ctex_update_default_family:} æ›´æ–° \tn{CJKfamilydefault}ã€‚
%    \begin{macrocode}
\bool_if:NF \g_@@_zhmCJK_bool
  {
    \str_if_eq:onTF { \g_@@_encoding_tl } { UTF8 }
      { \CJK@loadBinding { UTF8 } }
      { \CJK@loadBinding { standard } }
    \exp_args:Ne \ctex_at_end_preamble:n
      {
        \exp_not:N \CJK@envStart
          { } { \g_@@_encoding_tl } { \exp_not:N \CJKfamilydefault }
        \exp_not:N \CJKtilde
      }
  }
%    \end{macrocode}
%
% \begin{macro}[int]{\ctex_auto_ignorespaces:}
% ä¿å­˜ \tn{CJK@@ignorespaces} çš„å®šä¹‰ï¼Œæ–¹ä¾¿ä½¿ç”¨ã€‚
%    \begin{macrocode}
\cs_new_eq:NN \ctex_auto_ignorespaces: \CJK@@@@ignorespaces
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5.10}{2022/07/08}{è§£å†³ \pkg{CJK} åŒ…ä¸Ž \cs{text_uppercase:n} ç­‰è½¬åŒ–å‡½æ•°çš„å†²çªã€‚}
%
% \begin{macro}{\CJK@X,\CJK@XX,\CJK@XXX,\CJK@XXXX}
% æœ€æ–° \LaTeX\ ä¸­çš„ \tn{MakeUppercase} ç­‰å¤§å°å†™è½¬åŒ–å‘½ä»¤è¢«å®šä¹‰ä¸º \LaTeXiii\ ä¸­å¯¹åº”çš„
% \cs{text_uppercase:n} ç­‰å‡½æ•°ã€‚
% å®ƒä¼šå…ˆå°†å‚æ•°ç”¨ \cs{text_expand:n} é€æ­¥å±•å¼€ï¼Œè¿™ä¸Ž \pkg{CJK} åŒ…çš„å®šä¹‰ä¸å…¼å®¹ã€‚
% å¯ä»¥æœ‰å¤šç§æ–¹æ³•è§£å†³è¿™ä¸ªå†²çªï¼Œæœ€ç®€å•ç›´æŽ¥çš„æ–¹æ³•æ˜¯å°†é¦–å­—èŠ‚çš„æ´»åŠ¨å­—ç¬¦ç”¨ \tn{protected} æ¥å®šä¹‰ï¼Œ
% ä½†å¯èƒ½æœ‰ä¸€å®šçš„å…¼å®¹æ€§é—®é¢˜ã€‚ä¿é™©èµ·è§ï¼Œæˆ‘ä»¬é‡‡ç”¨å°† \tn{CJK@X} ç­‰å†…éƒ¨å®è½¬åŒ–ä¸º \tn{protected}
% å®çš„æ–¹å¼ï¼Œå¹¶å°†å‚æ•°æå‰ç”±å­—ç¬¦è½¬åŒ–ä¸ºæ•°å­—ï¼Œé¿å…åœ¨ç§»åŠ¨å‚æ•°ä¸­è¢«è¿›ä¸€æ­¥å±•å¼€ã€‚
%    \begin{macrocode}
\cs_new:Npn \@@_char:N #1
  { \exp_args:Ne \CTEX@char@n { \int_value:w `#1 } }
\cs_new:Npn \@@_char:NN #1#2
  {
    \token_if_eq_meaning:NNTF #2 \protect
      { \@@_char_aux:NN #1 }
      { \@@_char_aux:NN #1#2 }
  }
\cs_new:Npn \@@_char_aux:NN #1#2
  {
    \exp_last_unbraced:Ne \CTEX@char@nn
      {
        { \int_value:w `#1 }
        { \int_value:w `#2 }
      }
  }
\cs_new:Npn \@@_char:NNN #1#2#3
  {
    \token_if_eq_meaning:NNTF #2 \protect
      { \@@_char_auxi:NNNN #1#3 }
      { \@@_char_auxii:NNN #1#2#3 }
  }
\cs_new:Npn \@@_char_auxi:NNN #1#2#3#4
  { \@@_char_auxii:NNN #1#2#4 }
\cs_new:Npn \@@_char_auxii:NNN #1#2#3
  {
    \exp_last_unbraced:Ne \CTEX@char@nnn
      {
        { \int_value:w `#1 }
        { \int_value:w `#2 }
        { \int_value:w `#3 }
      }
  }
\cs_new:Npn \@@_char:NNNN #1#2#3#4
  {
    \token_if_eq_meaning:NNTF #2 \protect
      { \@@_char_auxi:NNNNN #1#3 }
      { \@@_char_auxii:NNNN #1#2#3#4 }
  }
\cs_new:Npn \@@_char_auxi:NNNNN #1#2#3#4#5
  { \@@_char_auxii:NNNN #1#2#3#5 }
\cs_new:Npn \@@_char_auxii:NNNN #1#2#3#4
  {
    \exp_last_unbraced:Ne \CTEX@char@nnnn
      {
        { \int_value:w `#1 }
        { \int_value:w `#2 }
        { \int_value:w `#3 }
        { \int_value:w `#4 }
      }
  }
\cs_gset_eq:NN \CJK@X    \@@_char:N
\cs_gset_eq:NN \CJK@XX   \@@_char:NN
\cs_gset_eq:NN \CJK@XXX  \@@_char:NNN
\cs_gset_eq:NN \CJK@XXXX \@@_char:NNNN
%    \end{macrocode}
% \pkg{CJKutf8} åŒ…ä¼˜å…ˆä½¿ç”¨ |\u8:xxx| çš„ \LaTeX\ å®šä¹‰ã€‚
%    \begin{macrocode}
\str_if_eq:onF { \g_@@_encoding_tl } { GBK }
  {
    \exp_args:Nne \use:n
      { \cs_gset:Npn \@@_char_aux:NN #1#2 }
      {
        \exp_not:N \cs_if_exist_use:cF
          { u8: \exp_not:N \tl_to_str:n { #1#2 } }
          { \exp_not:o { \@@_char_aux:NN {#1} {#2} } }
      }
    \exp_args:Nne \use:n
      { \cs_gset:Npn \@@_char_auxii:NNN #1#2#3 }
      {
        \exp_not:N \cs_if_exist_use:cF
          { u8: \exp_not:N \tl_to_str:n { #1#2#3 } }
          { \exp_not:o { \@@_char_auxii:NNN {#1} {#2} {#3} } }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mule@arg}
% å¤„ç†æ–‡æ¡£è¢« |extconv| ç­‰å·¥å…·é¢„å¤„ç†è¿‡çš„æƒ…å†µï¼Œåªè€ƒè™‘æœ€ç®€å•çš„æƒ…å½¢ã€‚
%    \begin{macrocode}
\group_begin:
\char_set_catcode_active:n { "7F }
\cs_new:Npn \@@_char_preproc:w #1 ^^7f #2 ^^7f
  { \exp_args:No \CTEX@char@nn { \int_value:w `#1 } {#2} }
\cs_gset_eq:NN \mule@arg \@@_char_preproc:w
\group_end:
\exp_args:Ne \ctex_at_end:n
  {
    \char_set_catcode:nn
      { \int_value:w "7F }
      { \char_value_catcode:n { "7F } }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\CTEX@char@n,\CTEX@char@nn,\CTEX@char@nnn,\CTEX@char@nnnn}
% é¢å¤–åŠ&nbsp;å…¥ \cs{mode_leave_vertical:} æ˜¯ä¸ºäº†è§£å†³æŸäº›åŽ†å²é—ç•™é—®é¢˜ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@char@n #1
  {
    \mode_leave_vertical:
    \use:c { CJK@ #1 }
    \CJK@ignorespaces
  }
\cs_new_protected:Npn \CTEX@char@nn #1#2
  {
    \mode_leave_vertical:
    \use:c { CJK@ #1 } {#2}
    \CJK@ignorespaces
  }
\cs_new_protected:Npn \CTEX@char@nnn  #1#2#3
  {
    \mode_leave_vertical:
    \use:c { CJK@ #1 } {#2} {#3}
    \CJK@ignorespaces
  }
\cs_new_protected:Npn \CTEX@char@nnnn #1#2#3#4
  {
    \mode_leave_vertical:
    \use:c { CJK@ #1 } {#2} {#3} {#4}
    \CJK@ignorespaces
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\CTEX@char@nn@n,\CTEX@char@nnn@n,\CTEX@char@nnnn@n}
% ä»¥ä¸‹ç»™ \tn{CTEX@char@nn} ç­‰å®šä¹‰åœ¨ \cs{text_expand:n} ä¸­çš„ç­‰ä»·å½¢å¼ï¼Œ
% å°†å®ƒä»¬çš„å‚æ•°ç”¨åªæœ‰ä¸€ä¸ªå‚æ•°çš„ \tn{CTEX@char@nn@n} ç­‰åŒ…è£…èµ·æ¥ï¼Œ
% å¹¶å°† \tn{CTEX@char@nn@n} ç­‰æ”¾å…¥æŽ’é™¤åˆ—è¡¨ä¸­ï¼Œé¿å…å¯èƒ½çš„å¤§å°å†™è½¬åŒ–ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@char@nn@n   #1 { \CTEX@char@nn   #1 }
\cs_new_protected:Npn \CTEX@char@nnn@n  #1 { \CTEX@char@nnn  #1 }
\cs_new_protected:Npn \CTEX@char@nnnn@n #1 { \CTEX@char@nnnn #1 }
\cs_new:Npn \@@_char_wrap:nn #1#2
  { \CTEX@char@nn@n   { {#1} {#2} } }
\cs_new:Npn \@@_char_wrap:nnn #1#2#3
  { \CTEX@char@nnn@n  { {#1} {#2} {#3} } }
\cs_new:Npn \@@_char_wrap:nnnn #1#2#3#4
  { \CTEX@char@nnnn@n { {#1} {#2} {#3} {#4} } }
\tl_put_right:Nn \l_text_case_exclude_arg_tl
  {
    \CTEX@char@n
    \CTEX@char@nn@n
    \CTEX@char@nnn@n
    \CTEX@char@nnnn@n
  }
\text_declare_expand_equivalent:Nn \CTEX@char@nn   { \@@_char_wrap:nn }
\text_declare_expand_equivalent:Nn \CTEX@char@nnn  { \@@_char_wrap:nnn }
\text_declare_expand_equivalent:Nn \CTEX@char@nnnn { \@@_char_wrap:nnnn }
%    \end{macrocode}
% ä»¥ä¸‹ç»™ \tn{CTEX@char@nn@n} ç­‰å®šä¹‰åœ¨ \cs{text_purify:n} ä¸­çš„ç­‰ä»·å½¢å¼ï¼Œ
% å°†å‚æ•°ä¸­çš„æ•°å­—è½¬åŒ–å›žå­—ç¬¦ã€‚
%    \begin{macrocode}
\cs_new:Npn \@@_char_raw:n #1
  { \char_generate:nn {#1} { 12 } }
\cs_new:Npn \@@_char_raw:nn #1#2
  {
    \char_generate:nn {#1} { 12 }
    \char_generate:nn {#2} { 12 }
  }
\cs_new:Npn \@@_char_raw:nnn #1#2#3
  {
    \char_generate:nn {#1} { 12 }
    \char_generate:nn {#2} { 12 }
    \char_generate:nn {#3} { 12 }
  }
\cs_new:Npn \@@_char_raw:nnnn #1#2#3#4
  {
    \char_generate:nn {#1} { 12 }
    \char_generate:nn {#2} { 12 }
    \char_generate:nn {#3} { 12 }
    \char_generate:nn {#4} { 12 }
  }
\cs_new:Npn \@@_char_raw_nn:n   #1 { \use:e { \@@_char_raw:nn   #1 } }
\cs_new:Npn \@@_char_raw_nnn:n  #1 { \use:e { \@@_char_raw:nnn  #1 } }
\cs_new:Npn \@@_char_raw_nnnn:n #1 { \use:e { \@@_char_raw:nnnn #1 } }
\text_declare_purify_equivalent:Nn \CTEX@char@n      { \@@_char_raw:n }
\text_declare_purify_equivalent:Nn \CTEX@char@nn@n   { \@@_char_raw_nn:n }
\text_declare_purify_equivalent:Nn \CTEX@char@nnn@n  { \@@_char_raw_nnn:n }
\text_declare_purify_equivalent:Nn \CTEX@char@nnnn@n { \@@_char_raw_nnnn:n }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ignorespaces_case:N,\ctex_set_ignorespaces:}
% è®¾ç½®å¿½ç•¥ç©ºæ&nbsp;¼çš„çš„æ–¹å¼ã€‚æ&nbsp;¹æ® \opt{space} é€‰é¡¹çš„å€¼é‡å®šä¹‰ \tn{CJK@ignorespaces}ï¼Œ
% å¹¶ä¿å­˜èµ·æ¥ä¾› \tn{CJKhook} å¤‡ç”¨ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ignorespaces_case:N #1
  {
    \cs_set_protected:Npn \ctex_set_ignorespaces:
      { \cs_set_eq:NN \CJK@ignorespaces #1 }
    \ctex_set_ignorespaces:
  }
\cs_new_protected:Npn \ctex_set_ignorespaces:
  { \cs_set_eq:NN \CJK@ignorespaces \ctex_auto_ignorespaces: }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\CJKhook}
% \changes{v2.5.5}{2020/10/06}{ä¸å†é€šè¿‡æ—§çš„é’©å­å‘½ä»¤æ¥å®šä¹‰ã€‚}
% \env{CJK} å’Œ \env{CJK*} çŽ¯å¢ƒéƒ½ä¼šé‡æ–°å®šä¹‰ \tn{CJK@ignorespaces}ã€‚æˆ‘ä»¬åœ¨ \pkg{CJK}
% å®åŒ…æä¾›çš„ \tn{CJKhook} é‡Œé‡æ–°è®¾ç½®å®ƒï¼Œè®©è¿™ä¸¤ä¸ªçŽ¯å¢ƒå¿½ç•¥ç©ºæ&nbsp;¼çš„æ–¹å¼éƒ½å— \opt{space}
% é€‰é¡¹çš„æŽ§åˆ¶ã€‚è¿™å¯¹ \pkg{zhmCJK} æ˜¯å¿…è¦çš„ã€‚
%    \begin{macrocode}
\tl_if_exist:NF \CJKhook { \tl_new:N \CJKhook }
\tl_gput_right:Nn \CJKhook { \ctex_set_ignorespaces: }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_punct_set:n}
% è®¾ç½® CJK æ—å¯¹åº”åˆ°å®žé™…çš„å­—ä½“ã€‚|#1| æ˜¯ \opt{fontset} çš„åå­—ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_punct_set:n #1
  {
    \clist_map_inline:Nn \c_@@_punct_family_clist
      {
        \cs_if_free:cF { c_@@_ #1 ##1 _punct_spaces_tl }
          {
            \cs_set_eq:cc
              { CJKpunct@ ##1 @spaces }
              { c_@@_ #1 ##1 _punct_spaces_tl }
          }
      }
  }
\clist_const:Nn \c_@@_punct_family_clist
  {
    zhsong , zhhei , zhfs , zhkai , zhli , zhyou ,
    zhsongb , zhheil , zhheib , zhyoub ,
    zhyahei , zhyaheib , zhpf , zhpfb
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_punct_map_family:nn}
% CJK æ— |#1| ä½¿ç”¨æ— |#2| çš„è¾¹ç•Œä¿¡æ¯ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_punct_map_family:nn #1#2
  {
    \cs_if_free:cF { CJKpunct@ #2 @spaces }
      { \cs_set_eq:cc { CJKpunct@ #1 @spaces } { CJKpunct@ #2 @spaces } }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_punct_map_bfseries:nn}
% CJK æ— |#1| çš„ \tn{bfseries} ä½¿ç”¨æ— |#2| çš„è¾¹ç•Œä¿¡æ¯ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_punct_map_bfseries:nn #1#2
  {
    \clist_map_inline:nn {#1}
      {
        \ctex_punct_map_series:nnn { ##1 } { b } {#2}
        \ctex_punct_map_series:nnn { ##1 } { bx } {#2}
      }
  }
\cs_new_protected:Npn \ctex_punct_map_series:nnn #1#2#3
  {
    \CJKpunctmapfamily { C19 } {#1} {#2} { m }  {#3}
    \CJKpunctmapfamily { C19 } {#1} {#2} { it } {#3}
    \CJKpunctmapfamily { C19 } {#1} {#2} { sl } {#3}
    \CJKpunctmapfamily { C70 } {#1} {#2} { m }  {#3}
    \CJKpunctmapfamily { C70 } {#1} {#2} { it } {#3}
    \CJKpunctmapfamily { C70 } {#1} {#2} { sl } {#3}
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_punct_map_itshape:nn}
% CJK æ— |#1| çš„ \tn{itshape} ä½¿ç”¨æ— |#2| çš„è¾¹ç•Œä¿¡æ¯ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_punct_map_itshape:nn #1#2
  {
    \CJKpunctmapfamily { C19 } {#1} { m }  { it } {#2}
    \CJKpunctmapfamily { C19 } {#1} { b }  { it } {#2}
    \CJKpunctmapfamily { C19 } {#1} { bx } { it } {#2}
    \CJKpunctmapfamily { C70 } {#1} { m }  { it } {#2}
    \CJKpunctmapfamily { C70 } {#1} { b }  { it } {#2}
    \CJKpunctmapfamily { C70 } {#1} { bx } { it } {#2}
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_punct_space:nn,\ctexspadef}
% å®šä¹‰æ&nbsp;‡ç‚¹çš„è¾¹ç•Œä¿¡æ¯ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_punct_space:nn #1#2
  { \tl_const:cn { c_@@_ #1 _punct_spaces_tl } {#2} }
\cs_new_eq:NN \ctexspadef \ctex_punct_space:nn
%    \end{macrocode}
% \end{macro}
%
% è½½å…¥è¾¹ç•Œä¿¡æ¯æ–‡ä»¶ã€‚
%     \begin{macrocode}
\ctex_file_input:n { ctexspa.def }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/pdftex&gt;
%    \end{macrocode}
%
% \subsubsection{\pkg{ctex-engine-xetex.def}}
%
%    \begin{macrocode}
%&lt;*xetex&gt;
%    \end{macrocode}
%
% \changes{v2.4.4}{2016/09/12}{ä¸å†é»˜è®¤è®¾ç½® \pkg{xeCJK} çš„ä¼ªç²—ä½“ã€‚}
%    \begin{macrocode}
\RequirePackage { xeCJK }
\exp_args:Ne \xeCJKsetup
  {
    LoadFandol   = false ,
    PunctStyle   = \l_@@_punct_tl
  }
%    \end{macrocode}
%
% æœ€æ–°ç‰ˆæœ¬çš„ \pkg{fontspec} é»˜è®¤å¯¹ \tn{rmfamily} å’Œ \tn{sffamily} è®¾ç½®
% |Ligatures=TeX|ï¼Œå¯¹ \tn{ttfamily} è®¾ç½® |WordSpace={1,0,0}| å’Œ
% |PunctuationSpace=WordSpace|ã€‚
%    \begin{macrocode}
\@ifpackagelater { fontspec } { 2014/05/25 } { }
  { \msg_error:nnn { ctex } { package-too-old } { fontspec } }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/xetex&gt;
%    \end{macrocode}
%
% \subsubsection{\pkg{ctex-engine-luatex.def}}
%
%    \begin{macrocode}
%&lt;*luatex&gt;
%    \end{macrocode}
%
% \changes{v2.0}{2014/03/08}{é€šè¿‡ \pkg{LuaTeX-ja} å®åŒ…æ”¯æŒ \LuaLaTeXã€‚}
% \changes{v2.3}{2015/09/25}{æ›´æ–° \pkg{LuaTeX-ja} æ”¯æŒï¼ˆ20150922.0ï¼‰ã€‚}
% \changes{v2.5}{2020/04/18}{æ›´æ–° \pkg{LuaTeX-ja} æ”¯æŒï¼ˆ20200412.0ï¼‰ã€‚}
% \changes{v2.5.4}{2020/08/16}{æ›´æ–° \pkg{LuaTeX-ja} æ”¯æŒï¼ˆ20200808.0ï¼‰ã€‚}
%
% \pkg{LuaTeX-ja} ä¸ºäº†å…¼å®¹ p\LaTeX çš„ä½¿ç”¨ä¹&nbsp;æƒ¯ï¼Œå¯¹ \LaTeXe çš„ \pkg{NFSS} ä½œäº†ä¸å°‘
% ä¿®æ”¹å’Œæ‰©å……ï¼Œè¿™å¯¹äºŽç®€ä½“ä¸­æ–‡ç”¨æˆ·æ¥è¯´ä¸æ˜¯å¿…è¦çš„ã€‚æˆ‘ä»¬åœ¨è¿™é‡Œç¦ç”¨å®ƒã€‚
%    \begin{macrocode}
\msg_new:nnn { ctex } { luatexja-loaded }
  {
    Package~`luatexja'~can~not~be~loaded~before~`ctex'.\\
    Loading~file~`#1'~will~abort!
  }
\@ifpackageloaded { luatexja }
  { \msg_critical:nnx { ctex } { luatexja-loaded } { \g_file_curr_name_str } }
  {
    \ctex_at_begin_package:nn { luatexja }
      { \msg_redirect_name:nnn { ctexhook } { disable-package } { info } }
    \ctex_at_end_package:nn { luatexja }
      { \msg_redirect_name:nnn { ctexhook } { disable-package } { } }
    \ctex_disable_package:n { ltj-latex }
  }
%    \end{macrocode}
%
%    \begin{macrocode}
\RequirePackage { luatexja }
\@ifpackagelater { luatexja } { 2020/04/12 } { }
  { \msg_error:nnn { ctex } { package-too-old } { luatexja } }
%    \end{macrocode}
%
%    \begin{macrocode}
\RequirePackage { fontspec }
\@ifpackagelater { fontspec } { 2020/02/21 } { }
  { \msg_error:nnn { ctex } { package-too-old } { fontspec } }
%    \end{macrocode}
%
% å¼•æ“Žæ–‡ä»¶æ˜¯é€šè¿‡ \cs{ctex_file_input:n} è½½å…¥çš„ï¼Œå…¶ä¸­çš„ \tn{catcodetable} æœºåˆ¶ä¼šå®Œæ•´æ¢å¤
% æ–‡ä»¶è½½å…¥ä¹‹å‰çš„ \tn{catcode} çŠ¶æ€ï¼Œåœ¨å¼•æ“Žæ–‡ä»¶ä¸­çš„ \tn{catcode} è®¾ç½®éƒ½æ—&nbsp;æ•ˆã€‚
% å›&nbsp;æ­¤ï¼Œå¯¹ \tn{ltjlineendcomment} çš„è®¾ç½®è¦æ”¾åˆ°æ–‡ä»¶ä¹‹å¤–è¿›è¡Œã€‚
%    \begin{macrocode}
\ctex_at_end:n { \char_set_catcode_comment:n { \ltjlineendcomment } }
%    \end{macrocode}
%
% \paragraph{\pkg{LuaTeX-ja} çš„é»˜è®¤è®¾ç½®}
%
%    \begin{macrocode}
\ExplSyntaxOff
%    \end{macrocode}
%
% ä»¥ä¸‹è®¾ç½®æŠ„å½•è‡ª \file{lltjdefs.sty}ï¼Œç•¥æœ‰æ”¹åŠ¨ã€‚
%
% \changes{v2.4.11}{2017/08/17}{ä¸æŠŠ Enclosed Alphanumerics è®¾ç½®ä¸º JAcharã€‚}
% U+2460--U+24FF (Enclosed Alphanumerics) åŽŸå±žäºŽå­—ç¬¦èŒƒå›´ 6ï¼Œæ˜¯ JAcharï¼Œ
% æˆ‘ä»¬æŠŠå®ƒä»¬å½’å…¥å­—ç¬¦èŒƒå›´ 3ï¼Œæ”¹æˆ  ALcharã€‚
%    \begin{macrocode}
\ltjdefcharrange{1}{"80-"36F, "1E00-"1EFF}
\ltjdefcharrange{2}{"370-"4FF, "1F00-"1FFF}
\ltjdefcharrange{3}{%
  "2000-"243F, "2460-"24FF, "2500-"27BF, "2900-"29FF, "2B00-"2BFF}
\ltjdefcharrange{4}{%
   "500-"10FF, "1200-"1DFF, "2440-"245F, "27C0-"28FF, "2A00-"2AFF,
  "2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A95F, "A980-"ABFF, "E000-"F8FF,
  "FB00-"FE0F, "FE20-"FE2F, "FE70-"FEFF, "10000-"1AFFF, "1B170-"1F0FF,
  "1F300-"1FFFF, "2000-"206F}
\ltjdefcharrange{5}{"D800-"DFFF, "E0000-"E00FF, "E01F0-"10FFFF}
\ltjdefcharrange{6}{%
  "2E80-"2EFF, "3000-"30FF, "3190-"319F, "31F0-"4DBF,
  "4E00-"9FFF, "F900-"FAFF, "FE10-"FE1F, "FE30-"FE6F, "FF00-"FFEF,
  "1B000-"1B16F, "1F100-"1F2FF, "20000-"3FFFF, "E0100-"E01EF}
\ltjdefcharrange{7}{%
  "1100-"11FF, "2F00-"2FFF, "3100-"318F, "31A0-"31EF, "A000-"A4CF,
  "A960-"A97F, "AC00-"D7FF}
\ltjdefcharrange{8}{"A7, "A8, "B0, "B1, "B4, "B6, "D7, "F7}
%    \end{macrocode}
% å°†é—´éš”å·ã€å¼•å·ã€ç&nbsp;´æŠ˜å·ç­‰ä¸­è¥¿æ–‡å…¬ç”¨çš„æ&nbsp;‡ç‚¹ç¬¦å·å½’å…¥å­—ç¬¦èŒƒå›´ 9ï¼Œå°†ä»–ä»¬è®¾ç½®ä¸º JAcharã€‚
%    \begin{macrocode}
\ltjdefcharrange{9}{%
  "00B7, "2018, "2019, "201C, "201D, "2013, "2014, "2025, "2026, "2027, "2E3A}
%    \end{macrocode}
% \changes{v2.4.11}{2017/08/17}{ä¸æŠŠå¸Œè…Šå’Œè¥¿é‡Œå°”å­—æ¯è®¾ç½®ä¸º JAcharã€‚}
% \pkg{LuaTeX-ja} é»˜è®¤æŠŠå­—ç¬¦èŒƒå›´ 2 å’Œ 3 è®¾ç½®ä¸º JAcharï¼Œæˆ‘ä»¬è¿™é‡ŒæŠŠå®ƒä»¬éƒ½æ”¹æˆ ALcharã€‚
%    \begin{macrocode}
\ltjsetparameter{jacharrange={-1, -2, -3, -4, -5, +6, +7, -8, +9}}
\directlua{for x=128,255 do luatexja.math.is_math_letters[x] = true end}
%    \end{macrocode}
%
% ä»¥ä¸‹è®¾ç½®æŠ„å½•è‡ª 2020/08/08 ä¹‹å‰çš„ \file{ltj-latex.sty}ã€‚
% è‡ª 2020/08/08 å¼€å§‹ï¼Œ\pkg{LuaTeX-ja} å¼•å…¥æ–°çš„ç¼“å­˜æœºåˆ¶ï¼Œæ­¤æ®µè®¾ç½®è¢«æ•´åˆè¿› \file{luatexja.lua}ã€‚
%    \begin{macrocode}
\@ifpackagelater{luatexja}{2020/08/08}
  { \ltjsetparameter { autospacing, autoxspacing, differentjfm = paverage } }
  {
    \directlua{
      local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
      luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {}
    }
    \ltjsetparameter{kanjiskip=\z@ plus .4pt minus .5pt,
      xkanjiskip=.25\zw plus 1pt minus 1pt,
      autospacing, autoxspacing, jacharrange={-1},
      yalbaselineshift=\z@, yjabaselineshift=\z@,
      jcharwidowpenalty=500, differentjfm=paverage
    }
  }
%    \end{macrocode}
%
%    \begin{macrocode}
\ExplSyntaxOn
%    \end{macrocode}
%
% \paragraph{\pkg{LuaTeX-ja} çš„è¡¥ä¸}
%
%    \begin{macrocode}
%&lt;@@=ctex_ltj&gt;
%    \end{macrocode}
%
% \changes{v2.5.3}{2020/05/31}{ä¸å†ä¾èµ– \pkg{xunicode}ï¼Œå•ç‹¬è¡¥ä¸ \file{tuenc.def}ã€‚}
%
% \begin{macro}{\CTEX@alchar, \CTEX@beginallalchar, \CTEX@endallalchar}
% åˆ†ç»„ä¸­çš„å­—ç¬¦éƒ½æ˜¯ ALchar ç±»ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@alchar #1
  { \CTEX@beginallalchar #1 \CTEX@endallalchar }
\cs_new_protected:Npn \CTEX@beginallalchar
  {
    \group_begin:
      \ctex_ltj_zero_globaldefs:
      \ltj@allalchar
  }
\cs_new_protected:Npn \CTEX@endallalchar
  { \group_end: }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\CTEX@chardef@text@cmd}
% è¡¥ä¸ \tn{chardef@text@cmd}ï¼Œåº”ç”¨äºŽ \tn{DeclareTextSymbol}ï¼Œä½¿å…¶å®šä¹‰çš„ç¬¦å·éƒ½æ˜¯ ALcharã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@chardef@text@cmd #1
  {
    \cs_set_eq:NN \@ifdefinable \@@@@ifdefinable
    \tl_set:Nn \l_@@_cmd_tl {#1}
    \tex_afterassignment:D \@@_chardef_text_cmd:
    \tex_chardef:D #1
  }
\tl_new:N \l_@@_cmd_tl
\cs_new_protected:Npn \@@_chardef_text_cmd:
  { \exp_after:wN \@@_chardef_text_cmd_aux:N \l_@@_cmd_tl }
\cs_new_protected:Npn \@@_chardef_text_cmd_aux:N #1
  {
    \int_compare:nNnF {#1} &lt; { "80 }
      { \cs_set_protected:Npx #1 { \CTEX@alchar { \tex_Uchar:D #1 } } }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\CTEX@text@composite@x}
% \tn{@text@composite@x} çš„é‡å®šä¹‰ï¼Œåº”ç”¨äºŽ \tn{DeclareUnicodeComposite} ç­‰ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@text@composite@x #1#2
  {
    \CTEX@beginallalchar
      \cs_if_exist_use:NF #1 {#2}
    \CTEX@endallalchar
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\CTEX@add@unicode@accent}
% \tn{add@unicode@accent} çš„é‡å®šä¹‰ï¼Œåº”ç”¨äºŽ \tn{DeclareUnicodeAccent}ã€‚
%    \begin{macrocode}
\cs_new_protected:Npx \CTEX@add@unicode@accent #1#2
  {
    \CTEX@beginallalchar
      \exp_not:N \tl_if_blank:nTF {#2} { \tex_Uchar:D "A0 ~ } {#2}
      \exp_not:N \tex_Uchar:D \tex_numexpr:D #1 \scan_stop:
    \CTEX@endallalchar
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\CTEX@patch@text@cmd}
% å•ç‹¬è¡¥ä¸ç”± \tn{DeclareTextCommand} å®šä¹‰çš„å‘½ä»¤ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@patch@text@cmd #1
  {
    \exp_args:NNc \@@_patch_text_cmd:NN #1
      { \UnicodeEncodingName \token_to_str:N #1 }
  }
\cs_new_protected:Npn \@@_patch_text_cmd:NN #1#2
  {
    \cs_set_eq:NN \CTEX@textcmd #2
    \ctex_preto_cmd:NnnTF \CTEX@textcmd
      { \ExplSyntaxOff \makeatletter }
      { \CTEX@beginallalchar }
      {
        \ctex_appto_cmd:NnnTF \CTEX@textcmd
          { \ExplSyntaxOff \makeatletter }
          { \CTEX@endallalchar }
          { \cs_set_eq:NN #2 \CTEX@textcmd }
          { \ctex_patch_failure:N #1 }
      }
      { \ctex_patch_failure:N #1 }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\CTEX@patch@tunec}
% é‡æ–°è½½å…¥ \tn{tunec.def}ï¼Œä½¿è¡¥ä¸ç”Ÿæ•ˆã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@patch@tunec
  {
    \cs_set_eq:NN \chardef@text@cmd   \CTEX@chardef@text@cmd
    \ctex_file_input:n { tuenc.def }
    \cs_set_eq:NN \@text@composite@x  \CTEX@text@composite@x
    \cs_set_eq:NN \add@unicode@accent \CTEX@add@unicode@accent
    \CTEX@patch@text@cmd \textasteriskcentered
  }
\@ifpackageloaded { xunicode }
  { }
  { \CTEX@patch@tunec }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.3}{2015/09/26}{æ›´æ–° \pkg{unicode-math} å®åŒ…è¡¥ä¸ã€‚}
%
% åœ¨ \LaTeX{} ä¸‹ï¼Œ\pkg{LuaTeX-ja} å¯¹ \pkg{fontspec}ã€\pkg{xunicode}ã€\pkg{unicode-math}
% å’Œ \pkg{listings} æ‰“äº†è¡¥ä¸ã€‚å…¶ä¸­å‰ä¸‰ä¸ªæ˜¯æŠŠ \tn{char} æ¢æˆ \tn{ltjalchar}ï¼Œç¡®ä¿
% å­—ç¬¦æ˜¯ ALchar ç±»ã€‚æˆ‘ä»¬è¿™é‡Œç”¨ \pkg{xunicode-addon} æ¥å¤„ç† \pkg{xunicode}ã€‚
%    \begin{macrocode}
\ctex_at_end_package:nn { xunicode }
  {
    \RequirePackage { xunicode-addon }
    \AtBeginUTFCommand { \CTEX@beginallalchar }
    \AtEndUTFCommand   { \CTEX@endallalchar }
  }
%    \end{macrocode}
%
% \changes{v2.4.2}{2016/05/15}{æ¢å¤ \pkg{luatexja} å¯¹ \tn{emshape} å’Œ
% \tn{eminnershape} çš„é‡å®šä¹‰ã€‚}
% \changes{v2.4.3}{2016/08/26}{ç®€åŒ– \pkg{fontspec} è¡¥ä¸ã€‚}
% \changes{v2.5}{2020/04/18}{åˆ&nbsp;é™¤ \pkg{fontspec} è¡¥ä¸ã€‚}
%
% å¯¹ \pkg{listings} çš„è¡¥ä¸æ˜¯è®©ä»£ç&nbsp;çŽ¯å¢ƒæ”¯æŒ JAchar ç±»ã€‚
%    \begin{macrocode}
\ctex_at_end_package:nn { listings }
  { \RequirePackage { lltjp-listings } }
%    \end{macrocode}
%
% \paragraph{\pkg{Lua} å‡½æ•°}
%
% \changes{v2.5.8}{2021/11/29}{ç®€åŒ–éƒ¨åˆ† \pkg{Lua} å‡½æ•°ã€‚}
%
% ç›´æŽ¥ç”¨ |token.set_lua| å®šä¹‰ï¼Œä¸æ˜¯ä¼&nbsp;ç»Ÿæ„ä¹‰ä¸Šçš„ \TeX \ å®ã€‚
%    \begin{macrocode}
\group_begin:
\char_set_catcode_space:n { 32 }
\lua_now:e
  {
%    \end{macrocode}
% \begin{macro}{ctex.newluacmd}
% å®šä¹‰æ–°çš„ \pkg{Lua} å‡½æ•°ã€‚
%    \begin{macrocode}
    ctex = ctex or { }
    local ctex = ctex
    local functions = lua.get_functions_table()
    local new_luafunction = luatexbase.new_luafunction
    local create, set_lua = token.create, token.set_lua
    local lua_cmds = {
      lua_call            = true ,
      lua_expandable_call = true ,
    }
    local newluacmd = function (name, func, ...)
      local tok = create(name)
      local id = lua_cmds[tok.cmdname] and tok.index
      local id = id or new_luafunction(name)
      set_lua(name, id, ...)
      functions[id] = func
    end
    ctex.newluacmd = newluacmd
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
    local ltjfont = luatexja.jfont
    local getattribute = tex.getattribute
    local tex_set, sprint = tex.set, tex.sprint
    local scan_int, scan_arg = token.scan_int, token.scan_argument
%    \end{macrocode}
% \begin{macro}{\ctex_ltj_add_kyenc:n}
% ä¿å­˜ jfont çš„ç¼–ç&nbsp;ï¼Œç”¨äºŽåˆ¤æ–­ã€‚
%    \begin{macrocode}
    newluacmd("ctex_ltj_add_kyenc:n", ltjfont.add_kyenc_list, "global", "protected")
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ctex_ltj_is_kenc:n}
% åˆ¤æ–­ç¼–ç&nbsp;æ˜¯å¦å±žäºŽ jfontã€‚
%    \begin{macrocode}
    newluacmd("ctex_ltj_is_kenc:n", ltjfont.is_kenc, "global")
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ctex_ltj_patch_external_font:n}
% è‹¥å¯¹å­—ä½“çš„å®šä¹‰å®Œå…¨ç›¸åŒï¼Œåˆ™å®ƒä»¬æœ‰ç›¸åŒçš„ \texttt{font.id}ã€‚å›&nbsp;æ­¤å¦‚æžœå­—å½¢æ˜¯ç”±
% \textsf{NFSS} çš„æ›¿æ¢æœºåˆ¶å®šä¹‰çš„ï¼Œå®ƒä»¬å°±æœ‰ç›¸åŒçš„ \texttt{font.id}ã€‚
% |print_aftl_address| å‡½æ•°çš„å®šä¹‰æ˜¯
% \begin{verbatim}
%   function luatexja.jfont.print_aftl_address()
%     return ';ltjaltfont' .. tostring(aftl_base):sub(8)
%   end
% \end{verbatim}
% ä¸»è¦ç›®çš„æ˜¯ï¼Œå¦‚æžœå½“å‰å­—å½¢æœ‰æ›¿ä»£å­—ä½“ï¼Œåˆ™å¾€å­—å½¢çš„å®šä¹‰ä¸­åŠ&nbsp;å…¥ä¸€äº›æ&nbsp;‡å¿—ï¼Œç¡®ä¿
% \texttt{font.id} å”¯ä¸€ã€‚
%    \begin{macrocode}
    newluacmd("ctex_ltj_patch_external_font:n", function ()
      local s = scan_arg()
      local is_braced, is_quoted
      if s:sub(1,1) == '{' and s:sub(-1)=='}' then
        is_braced = true; s = s:sub(2,-2)
      end
      if s:sub(1,1) == '"' and s:sub(-1) == '"' then
        is_quoted = true; s = s:sub(2,-2)
      end
      s = s .. ltjfont.print_aftl_address()
      if     is_braced then s = '{'..s..'}'
      elseif is_quoted then s = '"'..s..'"'
      end
      sprint(-2, s)
    end, "global")
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ctex_ltj_set_alt_font:nnnn}
% |#1| å’Œ |#2| åˆ†åˆ«æ˜¯å­—ç¬¦åŒºé—´çš„é¦–æœ«ï¼Œ|#3| æ˜¯åŸºç¡€å­—ä½“ï¼Œ|#4| æ˜¯æ›¿ä»£å­—ä½“ã€‚
%    \begin{macrocode}
    newluacmd("ctex_ltj_set_alt_font:nnnn", function ()
      local b = tonumber(scan_arg())
      local e = tonumber(scan_arg())
      local alt  = scan_arg()
      local base = scan_arg()
      ltjfont.set_alt_font_latex(b, e, alt, base)
    end, "global", "protected")
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ctex_ltj_clear_alt_font:n}
% æ¸…é™¤ |#1| çš„æ›¿ä»£å­—ä½“ã€‚
%    \begin{macrocode}
    newluacmd("ctex_ltj_clear_alt_font:n", function ()
      local base = scan_arg()
      ltjfont.clear_alt_font_latex(base)
    end, "global", "protected")
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ctex_ltj_pickup_alt_font:nn}
% å®šä¹‰ |#1| çš„æ›¿ä»£å­—ä½“ï¼Œ|#2| æ˜¯å­—ä½“å¤§å°ã€‚\\
% ä¼šåœ¨å†…éƒ¨æ‰§è¡Œ \tn{ltj@pickup@altfont@auxy} å’Œ \tn{ltj@pickup@altfont@copy}ã€‚
%    \begin{macrocode}
    newluacmd("ctex_ltj_pickup_alt_font:nn", function ()
      local base = scan_arg()
      local size = scan_arg()
      ltjfont.output_alt_font_cmd("y", base)
      ltjfont.pickup_alt_font_a(size)
    end, "global", "protected")
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@@_pickup_alt_font:Nn}
% |#1| æ˜¯ \texttt{font.id}ï¼Œ|#2| æ˜¯å­—ä½“åç§°ã€‚
% åœ¨ \tn{ltj@pickup@altfont@copy} ä¹‹ä¸­ä½¿ç”¨ã€‚
%    \begin{macrocode}
    newluacmd("@@_pickup_alt_font:Nn", function ()
      local num  = scan_int()
      local base = scan_arg()
      ltjfont.pickup_alt_font_b(num, base)
    end, "global", "protected")
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\@@_if_alt_set:nT}
% åˆ¤æ–­æ˜¯å¦å­˜åœ¨æ›¿ä»£å­—ä½“ã€‚ä¼šè®¾ç½®å˜é‡ |aftl_base| å’Œè¿”å›ž \tn{@firstofone} æˆ– \tn{@gobble}ã€‚
%    \begin{macrocode}
    newluacmd("@@_if_alt_set:nT", ltjfont.does_alt_set, "global")
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\ctex_ltj_zero_globaldefs:}
% è®¾ç½® \tn{globaldefs} ä¸º $0$ï¼Œé¿å…å…¨å±€è®¾ç½®ï¼Œåº”å½“åœ¨åˆ†ç»„ä¸­ä½¿ç”¨ã€‚
% è¿™é‡Œé€šè¿‡ Lua è®¾ç½®ï¼Œå¯ä»¥ä¸å—å¤–éƒ¨ \TeX\ çŽ¯å¢ƒä¸­çš„ \tn{globaldefs} çš„å½±å“ã€‚
%    \begin{macrocode}
    newluacmd("ctex_ltj_zero_globaldefs:", function ()
      tex_set("globaldefs", 0)
    end, "global", "protected")
  }
\group_end:
%    \end{macrocode}
% \end{macro}
%
% \paragraph{å­—ä½“åˆ‡æ¢æ–¹å¼}
%
% \begin{macro}[int]{\ctex_ltj_select_font:,\CJK@family}
% \tn{CJK@family} ä¿å­˜çš„æ˜¯å½“å‰ CJK å®žé™…çš„å­—ä½“æ—åï¼Œå¦‚æžœä¸ºç©ºè¡¨ç¤ºæ²¡æœ‰è®¾ç½®è¿‡å­—ä½“ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_select_font:
  {
    \group_begin: \exp_args:NNc \group_end:
    \cs_if_exist_use:NF { \l_@@_current_font_tl }
      { \tl_if_empty:NF \CJK@family { \@@_select_font_aux: } }
  }
\tl_new:N \CJK@family
\tl_new:N \l_@@_current_font_tl
\tl_set:Nn \l_@@_current_font_tl
  { \CJK@encoding / \CJK@family / \f@series / \f@shape / \f@size }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5.8}{2021/11/18}{å…¼å®¹ \pkg{microtype}ã€‚}
%
% \begin{macro}{\@@_select_font_aux:}
% ä½¿ç”¨ \tn{pickup@font} å–å¾—å­—ä½“åç§°å‰ï¼Œæ€»éœ€è¦å…ˆè®¾ç½® \tn{font@name}ã€‚åœ¨è¿™é‡Œå°†
% \tn{f@family} æ¢æˆ CJK å­—ä½“æ—ï¼Œå¹¶ç¡®ä¿ç¼–ç&nbsp;æ­£ç¡®ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_select_font_aux:
  {
    \group_begin:
      \tl_set_eq:NN \f@encoding \CJK@encoding
      \tl_set_eq:NN \f@family \CJK@family
      \cs_set_eq:NN \pickup@font \ctex_ltj_pickup_font:
      \@@_push_fontname:n { \curr@fontshape / \f@size }
      \ctex_ltj_pickup_font:
    \group_end:
    \font@name
    \@@_pop_fontname:
%    \end{macrocode}
% å½“å­—å½¢æœªå®šä¹‰çš„æ—¶å€™ï¼Œ\textsf{NFSS} å°±ä¼šå¯åŠ¨æ›¿æ¢æœºåˆ¶ï¼ˆ\tn{wrong@fontshape}ï¼‰ã€‚
% ç¬¬ä¸€æ¬¡å¯åŠ¨åŽï¼Œ\cs{l_@@_current_font_tl} è¿˜æ˜¯æ²¡æœ‰å®šä¹‰ã€‚ä¸ºæ­¤ï¼Œæˆ‘ä»¬å†æ¬¡é€‰æ‹©å­—ä½“ï¼Œ
% ç¡®ä¿å®ƒæœ‰å®šä¹‰å’ŒæŒ‡å‘æ­£ç¡®çš„ \texttt{font.id}ã€‚è¿™å¯¹ \opt{AlternateFont} çš„è®¾ç½®
% ç‰¹åˆ«é‡è¦ã€‚
%    \begin{macrocode}
    \cs_if_exist:cF { \l_@@_current_font_tl }
      { \@@_select_font_aux: }
  }
\cs_new_protected:Npn \@@_push_fontname:n #1
  {
    \seq_gpush:No \g_@@_fontname_seq { \font@name }
    \tl_gset:Nx \font@name { \exp_not:c {#1} }
  }
\cs_new_protected:Npn \@@_pop_fontname:
  {
    \seq_gpop:NNT \g_@@_fontname_seq \l_@@_tmp_tl
      { \tl_gset_eq:NN \font@name \l_@@_tmp_tl }
  }
\seq_new:N \g_@@_fontname_seq
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_pickup_font:}
% æ›¿æ¢ \tn{define@newfont} å†…éƒ¨è°ƒç”¨çš„ \tn{extract@font} å’Œ \tn{do@subst@correction}ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_pickup_font:
  {
    \exp_after:wN \cs_if_exist:NF \font@name
      {
        \group_begin:
          \cs_set_eq:NN \extract@font \ctex_ltj_extract_font:
          \cs_set_eq:NN \do@subst@correction \ctex_ltj_subst_font:
          \define@newfont
        \group_end:
      }
  }
\cs_new_eq:NN \pickup@jfont \ctex_ltj_pickup_font:
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_extract_font:}
% \pkg{LuaTeX-ja} çš„ \tn{globaljfont} åœ¨ \pkg{luatexja-core} ä¸­å®šä¹‰ï¼š
% \begin{verbatim}
%   %%%%%%%% \jfont\CS={...:...;jfm=metric;...}, \globaljfont
%   \protected\def\jfont#1{%
%     \afterassignment\ltj@@jfont
%     \directlua{luatexja.jfont.jfontdefX
%       (false, 'yoko','\luatexluaescapestring{\noexpand#1}')}}
%   \protected\def\globaljfont#1{%
%     \afterassignment\ltj@@jfont
%     \directlua{luatexja.jfont.jfontdefX
%       (true,  'yoko','\luatexluaescapestring{\noexpand#1}')}}
%   \newluafunction\ltj@@jfont@inner
%   \directlua{
%     local t = lua.get_functions_table()
%     t[\the\ltj@@jfont@inner] = luatexja.jfont.jfontdefY
%   }
%   \def\ltj@@jfont{\luafunction\ltj@@jfont@inner}
% \end{verbatim}
% \texttt{jfontdefX} å‡½æ•°çš„ä½œç”¨æ˜¯æŠŠ \tn{CS} å®šä¹‰ä¸ºå…¶åŽçš„å­—ä½“ï¼Œ\texttt{jfontdefY}
% çš„ä½œç”¨æ˜¯æ›´æ–° \texttt{JFM} å’Œè®°å½•ç›¸å…³å­—ä½“ä¿¡æ¯ã€‚æœ€åŽçš„å·¥ä½œæ˜¯ï¼š
% \begin{verbatim}
%   tex.sprint(cat_lp, global_flag, '\\protected\\expandafter\\def\\csname ',
%     (cstemp==' ') and '\\space' or cstemp, '\\endcsname{\\ltj@cur'..
%     (jfm_dir == 'yoko' and 'j' or 't') .. 'fnt', fn, '\\relax}')
% \end{verbatim}
% \tn{CS} çš„ä½œç”¨å°±æ˜¯æŠŠ \tn{ltj@curjfnt} è®¾ç½®ä¸ºåˆšæ‰å®šä¹‰çš„å­—ä½“çš„ \texttt{font.id}ã€‚
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_extract_font:
  {
    \get@external@font
    \ctex_ltj_if_alternate_shape_exist:nT { \curr@fontshape }
      {
        \tl_set:Nx \external@font
          { \exp_after:wN \@@_patch_external_font:w \external@font }
      }
    \exp_after:wN \globaljfont \font@name \external@font \scan_stop:
%    \end{macrocode}
% è¿™é‡Œ \tn{font@name} ä¸ä¼šç›´æŽ¥æ”¹å˜å½“å‰å­—ä½“ï¼Œè€Œ \tn{DeclareFontFamily} å’Œ
% \tn{DeclareFontShape} çš„æœ€åŽä¸€ä¸ªå‚æ•°é€šå¸¸è¦ä½¿ç”¨ \tn{font} æ¥å¼•ç”¨å½“å‰å­—ä½“ã€‚
% ä¸ºæ­¤ï¼Œæˆ‘ä»¬åœ¨åˆ†ç»„å†…å¯ç”¨ä¹‹å‰å®šä¹‰çš„å­—ä½“ï¼Œä»¥ä¾¿èƒ½å¾—åˆ°æ­£ç¡®çš„ \tn{font}ã€‚å¯¹å­—ä½“å‚æ•°çš„
% èµ‹å€¼æ€»æ˜¯å…¨å±€çš„ï¼Œä¸ä¼šå—åˆ°åˆ†ç»„çš„å½±å“ã€‚
%    \begin{macrocode}
    \font@name
    \ctex_ltj_use_jfont:
    \use:c { \f@encoding + \f@family }
    \use:c { \curr@fontshape }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ctex_ltj_use_jfont:}
% ä½¿ç”¨ jfontï¼Œç¡®ä¿å½“å‰çš„ \tn{font} æ˜¯ jfontã€‚
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_use_jfont:
  { \tex_setfontid:D \ltj@curjfnt }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_subst_font:}
% \tn{do@subst@correction} åœ¨è®¾ç½®é€šè¿‡ \texttt{sub} æˆ–è€… \texttt{ssub} å‡½æ•°å®šä¹‰çš„
% å­—ä½“æ—¶ä¼šç”¨åˆ°ã€‚å¦‚æžœæ²¡æœ‰è®¾ç½® \opt{SlantedFont}ï¼Œ\pkg{fontspec} ä¼šè®¾ç½®
% \tn{itdefault} ä½œä¸º \tn{sldefault} çš„æ›¿ä»£å­—å½¢ï¼Œå›&nbsp;è€Œä¼šç”¨åˆ°è¿™ä¸ªå‡½æ•°ã€‚å®ƒçš„æœ¬æ¥å®šä¹‰æ˜¯ï¼š
% \begin{verbatim}
%   \def\do@subst@correction{%
%       \xdef\subst@correction{%
%          \font@name
%          \global\expandafter\font
%            \csname \curr@fontshape/\f@size\endcsname
%            \noexpand\fontname\font
%           \relax}%
%       \aftergroup\subst@correction
%   }
% \end{verbatim}
% æˆ‘ä»¬åœ¨è¿™é‡Œä¸éœ€è¦å®šä¹‰æ–°å­—ä½“ï¼Œè€Œæ˜¯è®¾ç½®å¯¹åº”å­—ä½“çš„å‘½ä»¤ã€‚
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \ctex_ltj_subst_font:
  {
    \ctex_ltj_if_alternate_shape_exist:nF { \curr@fontshape }
      {
        \group_begin:
        \tl_set_eq:NN \CJK@family \f@family
        \cs_if_exist:cF { \l_@@_current_font_tl  }
          {
            \cs_gset_protected_nopar:Npx \subst@correction
              {
                \cs_new_eq:NN
                  \exp_not:c { \l_@@_current_font_tl }
                  \font@name
              }
            \group_insert_after:N \group_insert_after:N
            \group_insert_after:N \subst@correction
          }
        \group_end:
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int,TF]{\ctex_ltj_if_alternate_shape_exist:n}
% å³ \pkg{LuaTeX-ja} ä¸­çš„ \tn{ltj@@does@alt@set}ï¼Œåˆ¤æ–­æ˜¯å¦å­˜åœ¨æ›¿ä»£å­—ä½“ã€‚
%    \begin{macrocode}
\prg_new_conditional:Npnn \ctex_ltj_if_alternate_shape_exist:n #1 { T , F , TF }
  {
    \@@_if_alt_set:nT {#1} { \prg_return_true: \use_none:n }
    \prg_return_false:
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_patch_external_font:w}
%    \begin{macrocode}
\cs_new:Npn \@@_patch_external_font:w #1 ~ at
  { \ctex_ltj_patch_external_font:n {#1} ~ at }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_select_alternate_font:}
% åœ¨ \tn{selectfont} ä¸­æ›´æ–°æ›¿ä»£å­—ä½“ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_select_alternate_font:
  {
    \ctex_ltj_if_alternate_shape_exist:nT { \l_@@_current_shape_tl }
      {
        \ctex_ltj_pickup_alt_font:nn
          { \l_@@_current_shape_tl } { \f@size }
      }
  }
\tl_new:N \l_@@_current_shape_tl
\tl_set:Nn \l_@@_current_shape_tl
  { \CJK@encoding / \CJK@family / \f@series / \f@shape }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ltj@pickup@altfont@auxy}
% è¢«ç”¨åœ¨å‡½æ•° |output_alt_font_cmd| ä¸­ï¼Œä½œç”¨æ˜¯å®šä¹‰æ›¿ä»£å­—ä½“ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ltj@pickup@altfont@auxy #1
  {
    \cs_if_exist:cF { #1/\f@size }
      {
        \group_begin:
          \use:e { \exp_not:N \split@name #1 / \f@size } \@nil
          \@@_push_fontname:n { \curr@fontshape / \f@size }
          \ctex_ltj_pickup_font:
        \group_end:
        \@@_pop_fontname:
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ltj@pickup@altfont@copy}
% è¢«ç”¨åœ¨å‡½æ•° |pickup_alt_font_a| ä¸­ã€‚\tn{ltj@@getjfontnumber} çš„ä½œç”¨æ˜¯å°†å­—ä½“å‘½ä»¤
% |#1| å¯¹åº”çš„ \texttt{font.id} ä¿å­˜åˆ° \tn{ltj@tempcntc} ä¸­ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ltj@pickup@altfont@copy #1#2
  {
    \ltj@@@@getjfontnumber #1
    \@@_pickup_alt_font:Nn \ltj@tempcntc {#2}
  }
%    \end{macrocode}
% \end{macro}
%
% \paragraph{æ•°å­¦å­—ä½“æ—}
%
% ä»¥ä¸‹å†…å®¹æ¥è‡ª \file{lltjfont.sty}ï¼Œç›®çš„æ˜¯è®©æ±‰å­—å¯ä»¥åœ¨æ•°å­¦çŽ¯å¢ƒä¸­ç›´æŽ¥ä½¿ç”¨ã€‚
%
% \begin{macro}[int]{\ctex_ltj_if_jfont:nTF}
% å‚æ•° |#1| æ˜¯ä¸€ä¸ª \LaTeXe{} ç¼–ç&nbsp;åç§°æˆ–è€…å­—ä½“å‘½ä»¤ã€‚\LaTeXe{} å­—ä½“å‘½ä»¤çš„ä¸€èˆ¬å½¢å¼æ˜¯ï¼š
% \begin{quote}\ttfamily\small
%   \textbackslash\meta{encoding}/\meta{family}/\meta{series}/\meta{shape}
% \end{quote}
% é€šè¿‡æˆªå–åå­—ä¸­çš„ \meta{encoding} æ¥åˆ¤æ–­æ˜¯å¦æ˜¯ jfontã€‚
% æœ€åŽä¼šè®¾ç½® \tn{ifin@} ä¸ºå¯¹åº”çš„ \tn{iftrue} æˆ–è€… \tn{iffalse}ã€‚
%    \begin{macrocode}
\cs_new:Npn \ctex_ltj_if_jfont:nTF #1
  {
    \ctex_ltj_is_kenc:n { \@@_ltj_if_jfont:w #1 / \q_stop }
    \legacy_if:nTF { in@ }
  }
\cs_new:Npn \@@_ltj_if_jfont:w #1 / #2 \q_stop
  {#1}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_if_jfont_math:NTF}
% |#1| æ˜¯ä¸€ä¸ªå½¢å¼ä¸º |\M@|\meta{encoding} çš„å‘½ä»¤ï¼Œå®ƒç”± \tn{DeclareFontEncoding} çš„
% ç¬¬ä¸‰ä¸ªå‚æ•°æ¥å®šä¹‰ã€‚
%    \begin{macrocode}
\cs_new:Npn \ctex_ltj_if_jfont_math:NTF #1
  { \exp_after:wN \@@_if_jfont_math:w \token_to_str:N #1 \q_stop }
\group_begin:
  \char_set_catcode_other:N M
  \cs_new:Npn \@@_if_jfont_math:w #1 M #2#3 \q_stop
    { \ctex_ltj_if_jfont:nTF {#3} }
\group_end:
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\getanddefine@fonts,\ctex_ltj_get_and_define_fonts:nN}
% åœ¨ä½¿ç”¨çš„åœºåˆï¼Œ\tn{escapechar} å·²ç»è¢«è®¾ç½®æˆ $-1$ï¼Œä½¿ç”¨ \cs{token_to_str:N} å°±
% å¯ä»¥å¾—åˆ°åå­—ï¼Œä¸å¿…ä½¿ç”¨ \cs{cs_to_str:N}ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_get_and_define_fonts:nN #1#2
  {
    \exp_args:No \ctex_ltj_if_jfont:nTF { \token_to_str:N #2 }
      { \ctex_ltj_get_and_define_fonts_ja:nN }
      { \ctex_ltj_get_and_define_fonts_al:nN }
      {#1} #2
  }
\cs_new_eq:NN \ctex_ltj_get_and_define_fonts_al:nN \getanddefine@fonts
\cs_set_eq:NN \getanddefine@fonts \ctex_ltj_get_and_define_fonts:nN
\cs_new_protected:Npn \ctex_ltj_get_and_define_fonts_ja:nN #1#2
  {
    \tl_gset:Nx \font@name { \use:c { \token_to_str:N #2 / \tf@size } }
    \ctex_ltj_pickup_font: \tl_set_eq:NN \textfont@name \font@name
    \tl_gset:Nx \font@name { \use:c { \token_to_str:N #2 / \sf@size } }
    \ctex_ltj_pickup_font: \tl_set_eq:NN \scriptfont@name \font@name
    \tl_gset:Nx \font@name { \use:c { \token_to_str:N #2 / \ssf@size } }
    \ctex_ltj_pickup_font:
    \tl_put_right:Nx \math@fonts
      {
        \ltj@setpar@global
        \ltj@@@@set@stackfont #1 , \textfont@name   \c_colon_str { MJT }
        \ltj@@@@set@stackfont #1 , \scriptfont@name \c_colon_str { MJS }
        \ltj@@@@set@stackfont #1 , \font@name       \c_colon_str { MJSS }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\use@mathgroup,\ctex_ltj_use_math_group:Nn}
% åœ¨ä½¿ç”¨ \pkg{unicode-math} å®åŒ…æ—¶ï¼Œ\cs{ctex_ltj_math_group_hook:} å°†è¢«é‡å®šä¹‰ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_use_math_group:Nn #1#2
  {
    \mode_if_math:T
      {
        \math@bgroup
          \cs_if_eq:cNF { M@ \f@encoding } #1 {#1}
          \ctex_ltj_math_group_hook:
          \ctex_ltj_if_jfont_math:NTF #1
            { \jfam } { \mathgroup } #2 \scan_stop:
        \math@egroup
      }
  }
\cs_new_eq:NN \ctex_ltj_math_group_hook: \prg_do_nothing:
\cs_set_eq:NN \use@mathgroup \ctex_ltj_use_math_group:Nn
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.4.3}{2016/08/25}{æ›´æ–° \pkg{unicode-math} è¡¥ä¸ã€‚}
% \changes{v2.4.9}{2017/02/27}{è°ƒæ•´ \pkg{unicode-math} è¡¥ä¸çš„ä»£ç&nbsp;é¡ºåºã€‚}
% å¯¹ \pkg{unicode-math} çš„è¡¥ä¸ä¸»è¦æ˜¯å°† \file{unicode-math-table.tex} ä¸­çš„æ•°å­¦ç¬¦å·è®¾ç½®ä¸º
% \pkg{luatexja} ä¸­çš„æ•°å­¦å­—æ¯ã€‚
% æœ¬æ®µä»£ç&nbsp;åº”æ”¾åœ¨ \cs{ctex_ltj_math_group_hook:} çš„å®šä¹‰ä¹‹åŽï¼Œé¿å…å›&nbsp;å®åŒ…è½½å…¥é¡ºåºè€Œé€&nbsp;æˆçš„ç¼–è¯‘é”™è¯¯ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_set_math_letter:NN #1#2
  {
    \group_begin:
      \cs_set_protected:Npn #1 ##1##2##3
        { \ltjsetmathletter { ##1 } }
      #2
    \group_end:
  }
\ctex_at_end_package:nn { unicode-math }
  {
    \cs_if_exist:NTF \um_input_math_symbol_table:
      {
        \ctex_ltj_set_math_letter:NN
          \um_sym:nnn
          \um_input_math_symbol_table:
      }
      {
        \cs_set_eq:NN \use@mathgroup \ctex_ltj_use_math_group:Nn
        \cs_set_protected:Npn \ctex_ltj_math_group_hook:
          { \__um_switchto_literal: }
        \ctex_ltj_set_math_letter:NN
          \__um_sym:nnn
          \__um_input_math_symbol_table:
      }
  }
%    \end{macrocode}
%
% \paragraph{å­—ä½“æ—çš„å®šä¹‰ä¸Žä½¿ç”¨}
%
% \changes{v2.5.9}{2022/05/26}{ä¾èµ– \pkg{chinese-jfm} å®åŒ…ã€‚}
%
% \begin{macro}[int]{\ctex_set_jfm:n}
% \begin{variable}{\l_@@_jfm_tl, \l_@@_redirect_jfm_prop}
% è®¾ç½® \texttt{JFM}ï¼Œéœ€è¦è¿›è¡Œä¸€äº›é‡å®šå‘æ“ä½œã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_set_jfm:n #1
  {
    \prop_get:NnNF \l_@@_redirect_jfm_prop {#1} \l_@@_jfm_tl
      { \tl_set:Nn \l_@@_jfm_tl {#1} }
  }
\cs_generate_variant:Nn \ctex_set_jfm:n { o }
\prop_new:N \l_@@_redirect_jfm_prop
\prop_set_from_keyval:Nn \l_@@_redirect_jfm_prop
  {
    plain    = mono ,
    quanjiao = zh_CN / quanjiao ,
    banjiao  = zh_CN / banjiao ,
    kaiming  = zh_CN / kaiming
  }
\keys_define:nn { ctex_ltj / fontspec }
  {
    JFM           .code:n = \ctex_set_jfm:n {#1} ,
    JFM .value_required:n = true
  }
\tl_new:N \l_@@_jfm_tl
\ctex_set_jfm:o { \l__ctex_punct_tl }
%    \end{macrocode}
% \end{variable}
% \end{macro}
%
% \begin{macro}[int]{\CJK@encoding}
% åœ¨ \LaTeX ä¸‹ï¼Œ\pkg{LuaTeX-ja} ä¾èµ–å­—ä½“ç¼–ç&nbsp;æ¥å®žçŽ°ç‰¹æ®Šè®¾ç½®ã€‚ä¾‹å¦‚ä¸Šè¿°çš„
% \cs{ctex_ltj_if_jfont:nTF} å°±æ˜¯é€šè¿‡åˆ¤æ–­ç¼–ç&nbsp;æ¥å®žçŽ°çš„ï¼Œå®ƒåœ¨è®¾ç½®æ•°å­¦å­—ä½“æ—¶ä¼šç”¨åˆ°ã€‚æ‰€ä»¥
% ä¸åº”è¯¥ä¸Žè¥¿æ–‡å…±ç”¨ \texttt{EU2}ã€‚å®šä¹‰å­—ä½“æ— song ä¸º \tn{CJK@encoding} çš„é»˜è®¤æ›¿æ¢
% å­—ä½“ã€‚ä¸‹åˆ’çº¿ |_| ä¸åœ¨ \tn{nfss@catcodes} é‡Œï¼Œå¯ä»¥æ”¾å¿ƒä½¿ç”¨ã€‚
%    \begin{macrocode}
\tl_const:Nn \CJK@encoding { LTJY3 }
\DeclareFontEncoding { \CJK@encoding } { } { }
\use:e
  {
    \exp_not:N \DeclareFontSubstitution
      { \CJK@encoding } { song } { \mddefault } { \shapedefault }
  }
\ctex_ltj_add_kyenc:n { \CJK@encoding }
\DeclareFontFamily { \CJK@encoding } { song } { }
\DeclareFontShape { \CJK@encoding } { song } { \mddefault } { \shapedefault }
  { &lt;-&gt; psft:SimSun:cid=Adobe-GB1-5;jfm=\l_@@_jfm_tl } { }
\DeclareFontShape { \CJK@encoding } { song } { \bfdefault } { \shapedefault }
  { &lt;-&gt; psft:SimHei:cid=Adobe-GB1-5;jfm=\l_@@_jfm_tl } { }
\tl_const:Nn \c_@@_math_tl { CJKmath }
\DeclareSymbolFont { \c_@@_math_tl }
  { \CJK@encoding } { song } { \mddefault } { \shapedefault }
\SetSymbolFont { \c_@@_math_tl } { bold }
  { \CJK@encoding } { song } { \bfdefault } { \shapedefault }
\int_const:Nn \c_@@_math_fam_int { \use:c { sym \c_@@_math_tl } }
\jfam \c_@@_math_fam_int
%    \end{macrocode}
% \end{macro}
%
% è¿™æ˜¯ \pkg{luatexja-fontspec} ä¸­æ–°å¢žçš„ä¸€äº›å­—ä½“é€‰é¡¹ã€‚
%    \begin{macrocode}
\newfontfeature { CID }     {    cid = #1 }
\newfontfeature { JFM }     {    jfm = #1 }
\newfontfeature { JFM-var } { jfmvar = #1 }
%    \end{macrocode}
%
% åœ¨æ–°ç‰ˆæœ¬çš„ \pkg{fontspec} ä¸­ï¼Œ\cs{__fontspec_fontname_wrap:n} å˜æˆäº†ç§æœ‰å‡½æ•°ã€‚
%    \begin{macrocode}
\keys_define:nn { fontspec-preparse-external }
  {
    NoEmbed .code:n =
      { \cs_set_eq:NN \__fontspec_fontname_wrap:n \@@_noembed_wrap:n }
  }
\cs_new:Npn \@@_noembed_wrap:n #1 { psft: #1 }
%    \end{macrocode}
%
% \begin{macro}[int]{\ctex_ltj_set_family:nnn}
% å°†è‡ªå®šä¹‰çš„å­—ä½“æ—åä¸Ž \pkg{fontspec} å®žé™…è®¾ç½®çš„åå­—å¯¹åº”èµ·æ¥ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_set_family:nnn #1#2#3
  {
    \group_begin:
    \clist_clear:N \l_@@_char_range_clist
    \prop_clear:N \l_@@_alternate_prop
    \tl_set:Nn \l_@@_base_CJKfamily_tl {#1}
    \keys_set_known:nnN { ctex_ltj / fontspec } {#2} \l_@@_tmp_tl
    \clist_set:No \l_@@_font_options_clist { \l_@@_tmp_tl }
    \ctex_ltj_set_alternate_family:nnF {#1} {#3}
      {
        \prop_gput:Nnn \g_@@_family_font_name_prop {#1} {#3}
        \prop_gput:Nno \g_@@_family_font_options_prop
          {#1} { \l_@@_font_options_clist }
        \@@_update_family_uid:N \l_@@_font_options_clist
        \@@_use_global_options:N \l_@@_font_options_clist
        \@@_gset_family_cs:nn {#1} {#3}
      }
    \group_end:
  }
\tl_new:N \l_@@_base_CJKfamily_tl
\clist_new:N \l_@@_font_options_clist
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_use_global_options:N}
% åº”ç”¨é»˜è®¤å­—ä½“é€‰é¡¹ï¼Œå¹¶æ€»æ˜¯è®¾ç½® \opt{JFM} å’Œ \opt{NFSSEncoding} ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_use_global_options:N #1
  {
    \clist_concat:NNN #1 \g_@@_default_features_clist #1
    \clist_put_left:Nx #1
      { NFSSEncoding = \CJK@encoding , JFM = \l_@@_jfm_tl }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{variable}
%  {\g_@@_family_name_prop,\g_@@_family_font_name_prop,\g_@@_family_font_options_prop}
% åˆ†åˆ«ä¿å­˜ \pkg{fontspec} è®¾ç½®çš„å­—ä½“æ—åã€å­—ä½“åç§°å’Œå­—ä½“é€‰é¡¹ã€‚
%    \begin{macrocode}
\prop_new:N \g_@@_family_name_prop
\prop_new:N \g_@@_family_font_name_prop
\prop_new:N \g_@@_family_font_options_prop
%    \end{macrocode}
% \end{variable}
%
% \begin{macro}{\@@_check_family:n}
% åˆ&nbsp;é™¤é‡å¤çš„å®šä¹‰ï¼Œæ¸…é™¤æ›¿ä»£å­—ä½“çš„å…ˆå‰è®¾ç½®ã€‚
%   \begin{macrocode}
\cs_new_protected:Npn \@@_check_family:n #1
  {
    \prop_gpop:NnNT \g_@@_family_font_name_prop {#1} \l_@@_tmp_tl
      {
        \cs_undefine:c { \@@_family_csname:n {#1} }
        \cs_undefine:c { \@@_alternate_cs:n {#1} }
        \prop_gpop:NnNT \g_@@_family_name_prop {#1} \l_@@_base_family_tl
          {
            \use:c { \@@_alternate_cs:n { clear / #1 } }
            \cs_undefine:c { \@@_alternate_cs:n { clear / #1 } }
            \cs_undefine:c { \@@_alternate_cs:n { reset / #1 } }
            \prop_gremove:Nn \g_@@_reset_alternate_prop {#1}
          }
        \msg_warning:nnxx { ctex } { redefine-family } {#1} { \l_@@_tmp_tl }
      }
  }
\tl_new:N \l_@@_tmp_tl
\msg_new:nnn { ctex } { redefine-family }
  { Redefining~CJKfamily~`\@@_msg_family_map:n {#1}'~(#2). }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_gset_family_cs:nn}
% åœ¨è®¾ç½®å­—ä½“æ—¶ï¼Œå®žé™…ä¸Šå¹¶ä¸æ˜¯é©¬ä¸Šå°±å®šä¹‰ã€‚è€Œæ˜¯åªä¿å­˜ç›¸å…³å‚æ•°ï¼Œåœ¨é€šè¿‡ \tn{CJKfamily}
% ç¬¬ä¸€æ¬¡ä½¿ç”¨æ—¶æ‰å®šä¹‰ã€‚éœ€è¦æ³¨æ„å°†ç¼–ç&nbsp;æ”¹ä¸º \tn{CJK@encoding}ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_gset_family_cs:nn #1#2
  {
    \cs_gset_protected:cpx { \@@_family_csname:n {#1} }
      {
        \group_begin:
        \exp_not:n { \cs_set_eq:NN \CJKfamily \use_none:n }
        \exp_not:n { \fontspec_gset_family:Nnn \g_@@_fontspec_family_tl }
          { \exp_not:o { \l_@@_font_options_clist } } {#2}
        \prop_gput:Nno \exp_not:N \g_@@_family_name_prop {#1}
          { \exp_not:N \g_@@_fontspec_family_tl }
        \@@_set_alternate_family:n {#1}
        \group_end:
      }
  }
\tl_new:N \l_@@_base_family_tl
\tl_new:N \g_@@_fontspec_family_tl
\cs_new:Npn \@@_family_csname:n #1 { ctex_ltj/family/#1 }
\cs_new_protected:Npn \@@_set_alternate_family:n #1
  {
    \tl_set:Nn \l_@@_base_CJKfamily_tl {#1}
    \tl_set_eq:NN \l_@@_base_family_tl \g_@@_fontspec_family_tl
    \cs_if_exist_use:c { \@@_alternate_cs:n { reset / #1 } }
    \cs_if_exist_use:c { \@@_alternate_cs:n {#1} }
  }
\cs_new:Npn \@@_alternate_cs:n #1 { ctex_ltj/alternate_family/#1 }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\CJKfamily}
% åˆ‡æ¢å­—ä½“ã€‚
%    \begin{macrocode}
\NewDocumentCommand \CJKfamily { m }
  { \ctex_ltj_switch_family:x {#1} \tex_ignorespaces:D }
\cs_new_protected:Npn \ctex_ltj_switch_family:n #1
  {
    \ctex_ltj_family_if_exist:nNTF {#1} \CJK@family
      {
        \tl_set:Nn \l_ctex_ltj_family_tl {#1}
        \selectfont
      }
      { \@@_family_unknown_warning:n {#1} }
  }
\tl_new:N \l_ctex_ltj_family_tl
\cs_generate_variant:Nn \ctex_ltj_switch_family:n { x }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int,TF]{\ctex_ltj_family_if_exist:nN}
% åˆ¤æ–­ CJK å­—ä½“æ— |#1| æ˜¯å¦å­˜åœ¨ï¼Œè‹¥å­˜åœ¨åˆ™æŠŠå®žé™…æ—åä¿å­˜åˆ° |#2| ä¸­ã€‚
%    \begin{macrocode}
\prg_new_protected_conditional:Npnn \ctex_ltj_family_if_exist:nN #1#2 { T , F , TF }
  {
    \prop_get:NnNTF \g_@@_family_name_prop {#1} #2
      { \prg_return_true: }
      {
        \cs_if_exist_use:cTF { \@@_family_csname:n {#1} }
          {
            \tl_set_eq:NN #2 \g_@@_fontspec_family_tl
            \prg_return_true:
          }
          { \prg_return_false: }
      }
  }
\prg_generate_conditional_variant:Nnn \ctex_ltj_family_if_exist:nN { x } { T , F , TF }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_family_unknown_warning:n}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_family_unknown_warning:n #1
  {
    \prop_if_empty:NF \g_@@_family_font_name_prop
      {
        \seq_if_in:NnF \g_@@_unknown_family_seq {#1}
          {
            \seq_gput_right:Nn \g_@@_unknown_family_seq {#1}
            \msg_warning:nnn { ctex } { family-unknown } {#1}
          }
      }
  }
\seq_new:N \g_@@_unknown_family_seq
\msg_new:nnn { ctex } { family-unknown }
  {
    Unknown~CJK~family~`\@@_msg_family_map:n {#1}'~is~being~ignored.\\
    Try~to~use~`\@@_msg_def_family_map:n {#1}'~to~define~it.
  }
\cs_new:Npn \@@_msg_def_family_map:n #1
  {
    \str_case_e:nnF {#1}
      {
        \CJKrmdefault { \token_to_str:N \setCJKmainfont }
        \CJKsfdefault { \token_to_str:N \setCJKsansfont }
        \CJKttdefault { \token_to_str:N \setCJKmonofont }
      }
      { \token_to_str:N \setCJKfamilyfont \{ #1 \} }
    [...]\{...\}
  }
\cs_new:Npn \@@_msg_family_map:n #1
  {
    \str_case_e:nnF {#1}
      {
        \CJKrmdefault { \token_to_str:N \CJKrmdefault }
        \CJKsfdefault { \token_to_str:N \CJKsfdefault }
        \CJKttdefault { \token_to_str:N \CJKttdefault }
      }
      {#1}
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_fontspec:nn}
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_fontspec:nn #1#2
  {
    \prop_get:NnNTF \g_@@_fontspec_prop
      { CJKfontspec/#1/#2/id } \l_ctex_ltj_family_tl
      { \ctex_ltj_switch_family:x { \l_ctex_ltj_family_tl } }
      {
        \int_gincr:N \g_@@_family_int
        \@@_fontspec:enn
          { CJKfontspec ( \int_use:N \g_@@_family_int ) }
          {#1} {#2}
      }
  }
\cs_new_protected:Npn \ctex_ltj_fontspec:ee #1#2
  { \use:e { \ctex_ltj_fontspec:nn {#1} {#2} } }
\cs_new_protected:Npn \@@_fontspec:nnn #1#2#3
  {
    \bool_if:NT \l_@@_add_alternate_bool
      {
        \cs_if_free:cF
          { \@@_alternate_cs:n { reset / \l_ctex_ltj_family_tl } }
          {
            \cs_gset_eq:cc
              { \@@_alternate_cs:n { reset / #1 } }
              { \@@_alternate_cs:n { reset / \l_ctex_ltj_family_tl } }
            \cs_gset_eq:cc
              { \@@_alternate_cs:n { clear / #1 } }
              { \@@_alternate_cs:n { clear / \l_ctex_ltj_family_tl } }
          }
        \bool_set_false:N \l_@@_add_alternate_bool
      }
    \prop_gput:Nnn \g_@@_fontspec_prop { CJKfontspec/#2/#3/id } {#1}
    \ctex_ltj_set_family:nnn {#1} {#2} {#3}
    \ctex_ltj_switch_family:n {#1}
  }
\cs_generate_variant:Nn \@@_fontspec:nnn { e }
\prop_new:N \g_@@_fontspec_prop
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]
% {\ctex_ltj_add_font_features:n,\ctex_ltj_add_font_features:nn}
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_add_font_features:n #1
  { \ctex_ltj_add_font_features:xn { \l_ctex_ltj_family_tl } {#1} }
\cs_new_protected:Npn \ctex_ltj_add_font_features:nn #1#2
  {
    \prop_get:NnNTF \g_@@_family_font_name_prop
      {#1} \l_@@_tmp_tl
      {
        \prop_get:NnN \g_@@_family_font_options_prop
          {#1} \l_@@_font_options_clist
        \clist_put_right:Nn \l_@@_font_options_clist {#2}
        \bool_set_true:N \l_@@_add_alternate_bool
        \ctex_ltj_fontspec:ee
          { \exp_not:o { \l_@@_font_options_clist } }
          { \exp_not:o { \l_@@_tmp_tl } }
      }
      { \msg_warning:nn { ctex } { addCJKfontfeature-ignored } }
  }
\bool_new:N \l_@@_add_alternate_bool
\cs_generate_variant:Nn \ctex_ltj_add_font_features:n  { x }
\cs_generate_variant:Nn \ctex_ltj_add_font_features:nn { x }
\msg_new:nnn { ctex } { addCJKfontfeature-ignored }
  {
    \token_to_str:N \addCJKfontfeature (s)~ignored.\\
    It~cannot~be~used~with~a~font~that~wasn't~selected~by~ctex.
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_pass_args:nnnn}
% ä¸ºäº†æ”¯æŒå­—ä½“å±žæ€§å¯é€‰é¡¹åœ¨å‰åœ¨åŽä¸¤ç§è¯­æ³•ï¼Œç»™å‡ºä¸¤ä¸ªè¾…åŠ©å·¥å…·ï¼Œè‡ªå¸¦å±•å¼€åŠŸèƒ½ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_pass_args:nnnn #1#2#3#4
  {
    \tl_if_novalue:nTF {#2}
      { \@@_post_arg:w {#1} {#3} {#4} }
      {
        \use:e { #1 {#2} {#3} }
        #4
      }
  }
\NewDocumentCommand \@@_post_arg:w { m m m O { } }
  {
    \use:e { #1 {#4} {#2} }
    #3
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.4.6}{2016/11/20}{æ”¯æŒå­—ä½“å±žæ€§å¯é€‰é¡¹åœ¨åŽçš„æ–°è¯­æ³•ã€‚}
%
% \begin{macro}[int]
% {\setCJKfamilyfont,\newCJKfontfamily,\CJKfontspec,\addCJKfontfeatures}
%    \begin{macrocode}
\NewDocumentCommand \setCJKfamilyfont { m o m }
  {
    \@@_pass_args:nnnn
      { \ctex_ltj_set_family:nnn {#1} } {#2} {#3}
      { }
  }
\NewDocumentCommand \newCJKfontfamily { o m o m }
  {
    \tl_set:Nx \l_@@_tmp_tl
      { \tl_if_novalue:nTF {#1} { \cs_to_str:N #2 } {#1} }
    \cs_new_protected:Npx #2
      { \ctex_ltj_switch_family:n { \l_@@_tmp_tl } }
    \@@_pass_args:nnnn
      { \ctex_ltj_set_family:nnn { \l_@@_tmp_tl } } {#3} {#4}
      { }
  }
\NewDocumentCommand \CJKfontspec { o m }
  {
    \@@_pass_args:nnnn
      { \ctex_ltj_fontspec:nn } {#1} {#2}
      { \tex_ignorespaces:D }
  }
\NewDocumentCommand \addCJKfontfeatures { m }
  {
    \ctex_ltj_add_font_features:x {#1}
    \tex_ignorespaces:D
  }
\cs_new_eq:NN \addCJKfontfeature \addCJKfontfeatures
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]
% {\setCJKmainfont,\setCJKsansfont,\setCJKmonofont,
%  \setCJKmathfont,\defaultCJKfontfeatures}
%    \begin{macrocode}
\NewDocumentCommand \setCJKmainfont { o m }
  {
    \@@_pass_args:nnnn
      { \ctex_ltj_set_family:nnn { \CJKrmdefault } } {#1} {#2}
      { \normalfont }
  }
\cs_new_eq:NN \setCJKromanfont \setCJKmainfont
\NewDocumentCommand \setCJKsansfont { o m }
  {
    \@@_pass_args:nnnn
      { \ctex_ltj_set_family:nnn { \CJKsfdefault } } {#1} {#2}
      { \normalfont }
  }
\NewDocumentCommand \setCJKmonofont { o m }
  {
    \@@_pass_args:nnnn
      { \ctex_ltj_set_family:nnn { \CJKttdefault } } {#1} {#2}
      { \normalfont }
  }
\NewDocumentCommand \setCJKmathfont { o m }
  {
    \@@_pass_args:nnnn
      { \ctex_ltj_set_family:nnn { \c_@@_math_tl } } {#1} {#2}
      { }
  }
\NewDocumentCommand \defaultCJKfontfeatures { m }
  { \clist_gset:Nn \g_@@_default_features_clist {#1} }
\clist_new:N \g_@@_default_features_clist
\@onlypreamble \setCJKmainfont
\@onlypreamble \setCJKsansfont
\@onlypreamble \setCJKmonofont
\@onlypreamble \setCJKmathfont
\@onlypreamble \setCJKromanfont
\@onlypreamble \defaultCJKfontfeatures
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.4.8}{2017/02/23}
%   {è§£å†³ä¸Ž \pkg{fontspec} 2017/01/24 v2.5d çš„å­—ä½“æ—åŒ¹é…å…¼å®¹é—®é¢˜ã€‚}
%
% \begin{macro}[int]{\ctex_ltj_ensure_default_family:}
% åœ¨å¯¼è¨€åŒºç»“æŸç¡®è®¤ \tn{CJKfamilydefault} ç¡®å®žå­˜åœ¨ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_ensure_default_family:
  {
    \prop_if_empty:NF \g_@@_family_font_name_prop
      {
        \ctex_ltj_family_if_exist:xNF { \CJKfamilydefault } \l_@@_tmp_tl
          {
            \str_if_eq:eeTF { \CJKfamilydefault } { \CJKrmdefault }
              { \use:n }
              {
                \ctex_ltj_family_if_exist:xNTF { \CJKrmdefault } \l_@@_tmp_tl
                  { \tl_gset:Nn \CJKfamilydefault { \CJKrmdefault } \use_none:n }
                  { \use:n }
              }
              {
                \prop_map_inline:Nn \g_@@_family_font_name_prop
                  {
                    \prop_map_break:n
                      { \tl_gset_rescan:Nnn \CJKfamilydefault { } { ##1 } }
                  }
              }
          }
        \normalfont
        \ctex_ltj_update_mathfont:
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_update_mathfont:}
% æ›´æ–°æ•°å­¦å­—ä½“ä¸ºå®žé™…çš„å­—ä½“ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_update_mathfont:
  {
    \ctex_ltj_family_if_exist:xNTF { \c_@@_math_tl } \l_@@_tmp_tl
      { \ctex_ltj_update_mathfont:n { \l_@@_tmp_tl } }
      {
        \ctex_ltj_family_if_exist:xNT { \CJKfamilydefault } \l_@@_tmp_tl
          { \ctex_ltj_update_mathfont:n { \l_@@_tmp_tl } }
      }
  }
\cs_new_protected:Npn \ctex_ltj_update_mathfont:n #1
  {
    \tl_const:Nx \c_@@_math_family_tl {#1}
    \DeclareSymbolFont { \c_@@_math_tl } { \CJK@encoding }
      { \c_@@_math_family_tl } { \mddefault } { \shapedefault }
    \cs_if_free:cTF
      { \CJK@encoding/\c_@@_math_family_tl/\bfdefault/\shapedefault }
      {
        \SetSymbolFont { \c_@@_math_tl } { bold } { \CJK@encoding }
          { \c_@@_math_family_tl } { \mddefault } { \shapedefault }
      }
      {
        \SetSymbolFont { \c_@@_math_tl } { bold } { \CJK@encoding }
          { \c_@@_math_family_tl } { \bfdefault } { \shapedefault }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \paragraph{æ›¿ä»£å­—ä½“çš„è®¾ç½®}
%
% \changes{v2.5}{2020/04/30}{é‡æž„å­—ä½“é€‰é¡¹ \opt{AlternateFont}ã€‚}
%
% \begin{macro}{AlternateFont,CharRange}
% è®¾ç½®æ›¿ä»£å­—ä½“çš„é€‰é¡¹ã€‚
%    \begin{macrocode}
\keys_define:nn { ctex_ltj / fontspec }
  {
    AlternateFont  .code:n = \ctex_ltj_set_alternate_prop:n {#1} ,
    AlternateFont  .value_required:n = true ,
    CharRange .clist_set:N = \l_@@_char_range_clist ,
    CharRange .value_required:n = true
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_set_alternate_prop:n}
% ä¿å­˜æ›¿ä»£å­—ä½“åºåˆ—ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_set_alternate_prop:n #1
  { \clist_map_function:nN {#1} \@@_push_alternate_prop:n }
\cs_new_protected:Npn \@@_push_alternate_prop:n #1
  {
    \clist_set:Nx \l_@@_tmp_clist { \tl_head:n {#1} }
    \tl_remove_all:Nn \l_@@_tmp_clist { ~ }
    \exp_args:No \@@_push_alternate_prop:nn
      { \l_@@_tmp_clist } {#1}
  }
\cs_new_protected:Npn \@@_push_alternate_prop:nn #1
  {
    \prop_remove:Nn \l_@@_alternate_prop {#1}
    \prop_put:Nnn \l_@@_alternate_prop {#1}
  }
\clist_new:N \l_@@_tmp_clist
\prop_new:N \l_@@_alternate_prop
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_set_alternate_family:nnF}
% å¦‚æžœåœ¨å­—ä½“çš„é€‰é¡¹ä¸­è®¾ç½®äº† \opt{CharRange}ï¼Œåˆ™åªè®¾ç½®æ›¿ä»£å­—ä½“ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_set_alternate_family:nnF
  {
    \clist_if_empty:NTF \l_@@_char_range_clist
      { \@@_set_family_aux:nnn }
      { \@@_set_alternate_family_aux:nnn }
  }
\cs_new_protected:Npn \@@_set_family_aux:nnn #1#2#3
  {
    \@@_check_family:n {#1}
    \prop_if_empty:NF \l_@@_alternate_prop
      { \ctex_ltj_save_alternate_seq:cn { \@@_alternate_cs:n {#1} } {#2} }
    #3
  }
\cs_new_protected:Npn \@@_set_alternate_family_aux:nnn #1#2#3
  { \ctex_ltj_set_alternate_family:nn {#1} {#2} }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_save_alternate_seq:Nn}
% ä¿å­˜ç”± \opt{AlternateFont} è®¾ç½®çš„æ›¿ä»£å­—ä½“åºåˆ—ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_save_alternate_seq:Nn #1#2
  {
    \prop_map_inline:Nn \l_@@_alternate_prop
      { \@@_save_alternate_auxi:w ##2 { } \q_mark #1 {#2} }
  }
\cs_new_protected:Npn \@@_save_alternate_auxi:w #1#2#
  {
    \tl_if_blank:nTF {#2}
      { \@@_save_alternate_auxii:w {#1} }
      { \@@_save_alternate_auxii:w {#1} {#2} }
  }
\cs_new_protected:Npn \@@_save_alternate_auxii:w #1#2#3 #4 \q_mark #5#6
  {
    \clist_set:Nn \l_@@_char_range_clist {#1}
    \clist_set:Nn \l_@@_alternate_options_clist {#3}
    \@@_use_global_options:N \l_@@_alternate_options_clist
    \tl_if_blank:nTF {#2}
      { \tl_set:Nn \l_@@_tmp_tl {#6} }
      {
        \tl_set:Nx \l_@@_tmp_tl { \tl_trim_spaces:n {#2} }
        \tl_replace_all:Nnn \l_@@_tmp_tl { * } {#6}
      }
    \use:e
      {
        \ctex_ltj_save_alternate_family:Nnnn \exp_not:N #5
          { \exp_not:o { \l_@@_char_range_clist } }
          { \exp_not:o { \l_@@_alternate_options_clist } }
          { \exp_not:o { \l_@@_tmp_tl } }
      }
  }
\clist_new:N \l_@@_alternate_options_clist
\cs_generate_variant:Nn \ctex_ltj_save_alternate_seq:Nn { c }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_set_alternate_family:nn}
% è®¾ç½®é€‰é¡¹ \opt{CharRange} èŒƒå›´å†…çš„æ›¿ä»£å­—ä½“ã€‚å¦‚æžœå·²ç»å®šä¹‰äº†ä¸»å­—ä½“ï¼Œæˆ‘ä»¬ä¹Ÿé©¬ä¸Š
% å®šä¹‰æ›¿ä»£å­—ä½“ï¼Œå¦åˆ™åªä¿å­˜èµ·æ¥å¤‡ç”¨ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_set_alternate_family:nn #1#2
  {
    \@@_update_family_uid:N \l_@@_font_options_clist
    \@@_use_global_options:N \l_@@_font_options_clist
    \ctex_ltj_set_alternate_family:coonn
      { \@@_alternate_cs:n {#1} }
      { \l_@@_char_range_clist }
      { \l_@@_font_options_clist } {#2} {#1}
  }
\cs_new_protected:Npn \ctex_ltj_set_alternate_family:Nnnnn #1#2#3#4#5
  {
    \prop_get:NnNT \g_@@_family_name_prop {#5} \l_@@_base_family_tl
      { \ctex_ltj_set_alternate_family:nnn {#2} {#3} {#4} }
    \ctex_ltj_save_alternate_family:Nnnn #1 {#2} {#3} {#4}
  }
\cs_generate_variant:Nn \ctex_ltj_set_alternate_family:Nnnnn { coo }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_save_alternate_family:Nnnn}
% ä¿å­˜æ›¿ä»£å­—ä½“åºåˆ—çš„å®šä¹‰ï¼Œä»¥å¤‡å®šä¹‰ä¸»å­—ä½“æ—¶ä½¿ç”¨ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_save_alternate_family:Nnnn #1#2#3#4
  {
    \cs_if_exist:NF #1 { \cs_set_eq:NN #1 \prg_do_nothing: }
    \cs_gset_protected:Npx #1
      { \exp_not:o { #1 \ctex_ltj_set_alternate_family:nnn {#2} {#3} {#4} } }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_set_alternate_family:nnn}
% å®žé™…å®šä¹‰æ›¿ä»£å­—ä½“æ—ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_set_alternate_family:nnn #1#2#3
  {
    \group_begin:
    \cs_set_eq:NN \CJKfamily \use_none:n
    \ctex_ltj_swap_cs:NN
      \DeclareFontShape@ \ctex_ltj_declare_alternate_shape:nnnnnn
    \tl_set:Nn \l_@@_char_range_clist {#1}
    \fontspec_set_family:Nnn \l_@@_alternate_family_tl {#2} {#3}
    \group_end:
  }
\tl_new:N \l_@@_alternate_family_tl
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_swap_cs:NN}
% äº¤æ¢ä¸¤ä¸ªæŽ§åˆ¶åºåˆ—çš„æ„ä¹‰ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_swap_cs:NN #1#2
  {
    \cs_set_eq:NN \@@_tmp:w #1
    \cs_set_eq:NN #1 #2
    \cs_set_eq:NN #2 \@@_tmp:w
    \cs_undefine:N \@@_tmp:w
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{LTJFONTUID}
% \begin{macro}{\@@_update_family_uid:N}
% \pkg{fontspec} åœ¨ä¸€ä¸ªå­—ä½“æ—çš„é€‰é¡¹å’Œå­—ä½“åç§°ç›¸åŒçš„æ—¶å€™ï¼Œå°±ä¸å®šä¹‰æ–°å­—ä½“ã€‚ä¸ºäº†
% é¿å…æ··æ·†æ›¿ä»£å­—ä½“çš„è®¾ç½®ï¼Œæˆ‘ä»¬æ–°å®šä¹‰ä¸€ä¸ªè™šæ‹Ÿçš„é€‰é¡¹ \opt{LTJFONTUID}ï¼Œç¡®ä¿
% \pkg{fontspec} å¯¹ CJK å­—ä½“æ—æ€»æ˜¯å®šä¹‰æ–°å­—ä½“ã€‚
%    \begin{macrocode}
\keys_define:nn { fontspec } { LTJFONTUID .code:n = }
\cs_new_protected:Npn \@@_update_family_uid:N #1
  {
    \int_gincr:N \g_@@_family_int
    \clist_put_right:Nx #1 { LTJFONTUID = \int_use:N \g_@@_family_int }
  }
\int_new:N \g_@@_family_int
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_declare_alternate_shape:nnnnnn}
% åœ¨å®šä¹‰æ›¿ä»£å­—ä½“çš„å­—å½¢æ—¶ï¼Œé€šè¿‡å­—ç¬¦èŒƒå›´ä¸Žä¸»å­—ä½“çš„å¯¹åº”å­—å½¢å…³è”èµ·æ¥ã€‚
% \tn{DeclareFontShape@} ä¸€ä¸ªæœ‰å…­ä¸ªå‚æ•°ï¼Œæˆ‘ä»¬åªéœ€è¦ä½¿ç”¨å®ƒçš„ç¬¬ä¸‰ä¸ªå‚æ•° \meta{series}
% å’Œç¬¬å››ä¸ªå‚æ•° \meta{shape}ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_declare_alternate_shape:nnnnnn #1#2#3#4#5#6
  {
    \ctex_ltj_declare_alternate_shape:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6}
    \ctex_ltj_set_alternate_shape:Nnnnnnn \l_@@_char_range_clist
      { \l_@@_base_family_tl } {#3} {#4} {#2} {#3} {#4}
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_set_alternate_shape:Nnnnnnn}
% ä¸Ž \pkg{LuaTeX-ja} çš„ \tn{DeclareAlternateKanjiFont} çš„åŠŸèƒ½ç±»ä¼¼ï¼ŒåŒºåˆ«æ˜¯å›ºå®šç¼–ç&nbsp;
% ä¸º \tn{CJK@encoding}ã€‚è¿™ä¸ªè®¾ç½®æ€»æ˜¯å…¨å±€çš„ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_set_alternate_shape:Nnnnnnn #1#2#3#4#5#6#7
  {
    \clist_map_inline:Nn #1
      {
        \prop_get:NnNTF \g_@@_char_range_prop { ##1 } \l_@@_char_range_tl
          {
            \ctex_ltj_set_alternate_shape:nnN { #2/#3/#4 } { #5/#6/#7 }
              \l_@@_char_range_tl
          }
          { \ctex_ltj_set_alternate_shape:nnn { #2/#3/#4 } { #5/#6/#7 } { ##1 } }
      }
    \@@_save_alternate_shape:cn
      { \@@_alternate_cs:n { clear / \l_@@_base_CJKfamily_tl } }
      { \ctex_ltj_clear_alt_font:n { \CJK@encoding/#2/#3/#4 } }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_set_alternate_shape:nnn}
% æˆ‘ä»¬ä½¿ç”¨ \texttt{-&gt;} è€Œä¸æ˜¯åƒ \pkg{LuaTeX-ja} ä¸€æ&nbsp;·ä½¿ç”¨ \texttt{-} ä½œä¸ºåŒºé—´çš„
% åˆ†éš”ç¬¦ã€‚\pkg{LuaTeX-ja} æ”¯æŒä½¿ç”¨è´Ÿæ•°æ¥å¼•ç”¨ç”± \texttt{JFM} è®¾ç½®çš„å­—ç¬¦ç±»ã€‚å¦‚æžœ
% ä½¿ç”¨ \texttt{-} ä½œä¸ºåˆ†éš”ç¬¦ï¼Œé‚£ä¹ˆè´Ÿæ•°å•ç‹¬ä½¿ç”¨æ—¶ï¼Œå°±éœ€è¦æŠŠå®ƒæ”¾åœ¨ä¸¤å±‚èŠ±æ‹¬å·ä¹‹å†…
% ï¼ˆä¾‹å¦‚ |{{-1}}|ï¼‰ï¼Œæˆ–è€…ä½¿ç”¨ç±»ä¼¼ |{-1}-{-1}| çš„å½¢å¼æ‰ä¸ä¼šè§£é‡Šé”™è¯¯ã€‚
%    \begin{macrocode}
\NewDocumentCommand \ctex_ltj_set_alternate_shape:nnn
  { m m &gt; { \SplitArgument { 1 } { -&gt; } } m }
  { \ctex_ltj_set_alternate_shape:nnnn {#1} {#2} #3 }
\cs_new_protected:Npn \ctex_ltj_set_alternate_shape:nnnn #1#2#3#4
  {
    \ctex_ltj_set_alternate_shape:e
      {
        \@@_range_normalization:nn {#3} {#4}
        { \CJK@encoding / \exp_not:n {#2} }
        { \CJK@encoding / \exp_not:n {#1} }
      }
  }
\cs_new_protected:Npn \ctex_ltj_set_alternate_shape:n #1
  {
    \ctex_ltj_set_alt_font:nnnn #1
    \@@_save_alternate_shape:cn
      { \@@_alternate_cs:n { reset / \l_@@_base_CJKfamily_tl } }
      { \ctex_ltj_set_alt_font:nnnn #1 }
  }
\cs_generate_variant:Nn \ctex_ltj_set_alternate_shape:n { e }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_set_alternate_shape:nnN}
% è‹¥å­—ç¬¦èŒƒå›´é¢„å…ˆç”± \texttt{declarecharrange} å£°æ˜Žï¼Œåˆ™å¯ä»¥ç›´æŽ¥ä½¿ç”¨ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_set_alternate_shape:nnN #1#2#3
  {
    \tl_map_inline:Nn #3
      {
        \ctex_ltj_set_alternate_shape:n
          {
            ##1
            { \CJK@encoding/#2 }
            { \CJK@encoding/#1 }
          }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_save_alternate_shape:Nn}
% å°†å®žé™…è®¾ç½®çš„æ›¿æ¢å­—å½¢ä¿å­˜èµ·æ¥ç”¨äºŽæ¸…é™¤æˆ–æ¢å¤ã€‚
% æš‚æ—¶ä»¤ \cs{l_@@_base_family_tl} ä¸º \cs{scan_stop:} æ˜¯è®©å®ƒä¸è¢«å±•å¼€ï¼Œä½¿å¾—æ›¿æ¢
% å­—ä½“çš„è®¾ç½®å¯ä»¥åœ¨ \tn{addCJKfontfeature} ä¸­ç›´æŽ¥ä½¿ç”¨ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_save_alternate_shape:Nn #1#2
  {
    \group_begin:
      \cs_if_exist:NF #1 { \cs_set_eq:NN #1 \prg_do_nothing: }
      \cs_set_eq:NN \l_@@_base_family_tl \scan_stop:
      \cs_gset_protected:Npx #1 { \exp_not:o {#1} #2 }
    \group_end:
  }
\cs_generate_variant:Nn \@@_save_alternate_shape:Nn { c }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{clearalternatefont,resetalternatefont}
% æ¸…é™¤å’Œé‡ç½®æ“ä½œæ€»æ˜¯å…¨å±€çš„ã€‚
%    \begin{macrocode}
\ctex_define:n
  {
    clearalternatefont    .code:n =
      { \clist_map_function:eN {#1} \ctex_ltj_clear_alternate_font:n } ,
    resetalternatefont    .code:n =
      { \clist_map_function:eN {#1} \ctex_ltj_reset_alternate_font:n } ,
    clearalternatefont .default:n = \l_ctex_ltj_family_tl ,
    resetalternatefont .default:n = \l_ctex_ltj_family_tl
  }
\cs_new_protected:Npn \ctex_ltj_clear_alternate_font:n #1
  {
    \group_begin:
      \ctex_ltj_family_if_exist:xNTF {#1} \l_@@_base_family_tl
        {
          \cs_if_exist_use:cT
            { \@@_alternate_cs:n { clear / #1 } }
            {
              \prop_gput:Nno \g_@@_reset_alternate_prop
                {#1} { \l_@@_base_family_tl }
              \tl_set_eq:NN \CJK@family \l_@@_base_family_tl
              \selectfont
            }
        }
        { \@@_family_unknown_warning:n {#1} }
    \group_end:
  }
\cs_new_protected:Npn \ctex_ltj_reset_alternate_font:n #1
  {
    \group_begin:
      \prop_gpop:NnNT \g_@@_reset_alternate_prop {#1} \CJK@family
        {
          \tl_set_eq:NN \l_@@_base_family_tl \CJK@family
          \use:c { \@@_alternate_cs:n { reset / #1 } }
          \selectfont
        }
    \group_end:
  }
\prop_new:N \g_@@_reset_alternate_prop
\cs_generate_variant:Nn \clist_map_function:nN { e }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{declarecharrange}
% é¢„å…ˆå£°æ˜Žå­—ç¬¦èŒƒå›´ã€‚
%    \begin{macrocode}
\ctex_define:n
  {
    declarecharrange .code:n = \ctex_ltj_declare_char_range:e {#1} ,
    declarecharrange .value_required:n = true
  }
\cs_new_protected:Npn \ctex_ltj_declare_char_range:n #1
  { \clist_map_inline:nn {#1} { \@@_declare_char_range:nn ##1 } }
\cs_generate_variant:Nn \ctex_ltj_declare_char_range:n { e }
\cs_new_protected:Npn \@@_declare_char_range:nn #1
  { \tl_trim_spaces_apply:nN {#1} \ctex_ltj_declare_char_range:nn }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_declare_char_range:nn}
% \begin{variable}{\g_@@_char_range_prop}
% |#1| æ˜¯åå­—ï¼Œ|#2| æ˜¯èŒƒå›´ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_declare_char_range:nn #1#2
  {
    \tl_clear:N \l_@@_char_range_tl
    \clist_map_function:nN {#2} \ctex_ltj_save_char_range:n
    \prop_gput:Nno \g_@@_char_range_prop {#1} { \l_@@_char_range_tl }
    \ctex_ltj_def_char_range_key:n {#1}
    \tl_clear:N \l_@@_char_range_tl
  }
\tl_new:N \l_@@_char_range_tl
\prop_new:N \g_@@_char_range_prop
%    \end{macrocode}
% \end{variable}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_save_char_range:n}
% é¢„å…ˆè§£é‡Šå­—ç¬¦åŒºé—´çš„æ„ä¹‰ã€‚
%    \begin{macrocode}
\NewDocumentCommand \ctex_ltj_save_char_range:n
  { &gt; { \SplitArgument { 1 } { -&gt; } } m }
  { \ctex_ltj_save_char_range:nn #1 }
\cs_new_protected:Npn \ctex_ltj_save_char_range:nn #1#2
  {
    \tl_put_right:Nx \l_@@_char_range_tl
      { { \@@_range_normalization:nn {#1} {#2} } }
  }
\cs_new:Npn \@@_range_normalization:nn #1#2
  {
    \tl_if_novalue:nTF {#2}
      {
        { \int_eval:n {#1} }
        { \int_eval:n {#1} }
      }
      {
        { \int_eval:n { \tl_if_blank:nTF {#1} { \c_@@_range_min_int } {#1} } }
        { \int_eval:n { \tl_if_blank:nTF {#2} { \c_@@_range_max_int } {#2} } }
      }
  }
\int_const:Nn \c_@@_range_min_int { "80 }
\int_const:Nn \c_@@_range_max_int { \c_max_char_int }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_def_char_range_key:n}
% åœ¨å­—ä½“è®¾ç½®é€‰é¡¹ä¸­å®šä¹‰å­—ç¬¦èŒƒå›´é”®ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_def_char_range_key:n #1
  {
    \keys_if_exist:nnF { ctex_ltj / fontspec } {#1}
      {
        \keys_define:nn { ctex_ltj / fontspec }
          { #1 .code:n = \ctex_ltj_char_range_key:nn {#1} { ##1 } }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_ltj_char_range_key:nn}
% å¦‚æžœå­—ç¬¦èŒƒå›´é”®æ²¡æœ‰å€¼ï¼Œåˆ™åªè®¾ç½®çš„è¿™ä¸ªå­—ç¬¦èŒƒå›´å†…çš„æ›¿ä»£å­—ä½“ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_char_range_key:nn #1#2
  {
    \tl_if_blank:nTF {#2}
      { \clist_set:Nn \l_@@_char_range_clist {#1} }
      { \@@_push_alternate_prop:nn {#1} { {#1} #2 } }
  }
%    \end{macrocode}
% \end{macro}
%
% \paragraph{å…¶ä»–è®¾ç½®}
%
% åœ¨æŠ„å½•çŽ¯å¢ƒä¸­ç¦ç”¨ \opt{autospacing} å’Œ \opt{autoxspacing}ã€‚ç„¶è€Œï¼Œ\pkg{LuaTeX-ja}
% è¿˜æ˜¯ä¼šä½¿ JAchar è‡ªåŠ¨æŠ˜è¡Œã€‚æ²¡æœ‰çœ‹åˆ°æœ‰ç®€å•çš„ç¦ç”¨æŠ˜è¡Œçš„åŠžæ³•ï¼Œå¯èƒ½éœ€è¦è®¾ç½®æ‰€æœ‰çš„
% JAchar çš„ \opt{prebreakpenalty} æˆ– \opt{postbreakpenalty} ä¸º \texttt{10000}ï¼š
% \begin{verbatim}
%   \directlua
%     {
%       luatexja.isglobal = tex.globaldefs &gt; 0 and "global" or ""
%       for i = 0x80, 0x10FFFF do
%         if luatexja.charrange.jcr_table_main[i] &gt; 0 and
%            luatexja.charrange.jcr_table_main[i] &lt; 218 and
%            luatexja.charrange.is_japanese_char_curlist(i) then
%           luatexja.stack.set_stack_table(luatexja.stack_table_index.PRE + i, 10000)
%         end
%       end
%     }
% \end{verbatim}
%    \begin{macrocode}
\AtBeginDocument
  {
    \ctex_appto_cmd:NnnTF \verbatim@font
      { \char_set_catcode_letter:n { 64 } }
      { \CTEX@verbatim@font@hook }
      { }
      { \ctex_patch_failure:N \verbatim@font }
  }
\cs_new_protected:Npn \CTEX@verbatim@font@hook
  { \ltjsetparameter { autospacing = false , autoxspacing = false } }
%    \end{macrocode}
%
% \begin{macro}{\@@@@italiccorr}
% \LaTeX{} çš„å€¾æ–œæ&nbsp;¡æ­£ä¹Ÿè¦é‡æ–°å®šä¹‰ã€‚
%    \begin{macrocode}
\cs_set_eq:NN \@@@@italiccorr \/
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.4.12}{2018/01/27}{æ­£ç¡®ä½¿ç”¨ \tn{ltjsetkanjiskip} å’Œ \tn{ltjsetxkanjiskip}ã€‚}
%
% \begin{macro}[int]{\ctex_ltj_set_kanjiskip:N,\ctex_ltj_set_xkanjiskip:N}
% \tn{ltjsetkanjiskip} å’Œ \tn{ltjsetxkanjiskip} æ˜¯ç›¸åº”çš„ \tn{ltjsetparameter}
% çš„å¿«æ·æ–¹å¼ï¼Œåœ¨ä½¿ç”¨ä»–ä»¬æ—¶ï¼Œè¦æ³¨æ„å…ˆä½¿ç”¨ \tn{ltj@setpar@global}ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_ltj_set_kanjiskip:N
  { \ltj@setpar@global \ltjsetkanjiskip }
\cs_new_protected:Npn \ctex_ltj_set_xkanjiskip:N
  { \ltj@setpar@global \ltjsetxkanjiskip }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;@@=ctex&gt;
%&lt;/luatex&gt;
%    \end{macrocode}
%
% \subsubsection{\pkg{ctex-engine-uptex.def}}
%
%    \begin{macrocode}
%&lt;*uptex|aptex&gt;
%    \end{macrocode}
%
% \changes{v2.4}{2016/02/28}{åˆæ­¥æ”¯æŒ \upLaTeXã€‚}
% \changes{v2.4.15}{2019/04/05}{æ˜¾å¼è¡¥ä¸ \upLaTeX çš„ \tn{rmfamily} ç­‰å­—ä½“å‘½ä»¤ã€‚}
%
% æŒ‰ \pkg{CJK} çš„å‘½åä¹&nbsp;æƒ¯æ¨¡æ‹Ÿ \tn{CJKfamily}ã€‚
%    \begin{macrocode}
\NewDocumentCommand \CJKfamily { m }
  { \kanjifamily {#1} \selectfont }
%    \end{macrocode}
%
% \changes{v2.4.15}{2019/04/05}{å°† \upLaTeX çš„é»˜è®¤å­—ä½“ç”± \texttt{mc} æ”¹ä¸º
%   \texttt{zhrm}ï¼Œå¹¶å¯ç”¨ \tn{jfam}ã€‚}
%
% å°† \upLaTeX çš„é»˜è®¤å­—ä½“ç”± |mc| æ”¹ä¸º |zhrm|ï¼Œå¹¶å¯ç”¨ \tn{jfam}ã€‚
%    \begin{macrocode}
\DeclareErrorKanjiFont    {JY2}{zhrm}{m}{n}{10}
\DeclareKanjiSubstitution {JY2}{zhrm}{m}{n}
\DeclareKanjiSubstitution {JT2}{zhrm}{m}{n}
\DeclareSymbolFont{mincho}{JY2}{zhrm}{m}{n}
\SetSymbolFont{mincho}{bold}{JY2}{zhrm}{bx}{n}
\jfam \symmincho
%    \end{macrocode}
%
% \begin{macro}[int]{\em}
% \changes{v2.4.2}{2016/05/15}{å…¼å®¹ \upLaTeX{} 2016/05/07u00 çš„å®šä¹‰ã€‚}
% å–æ¶ˆ \upLaTeX{} å¯¹ \tn{em} ä½¿ç”¨ |\mcfamily|ã€|\gtfamily| å‘½ä»¤çš„é‡å®šä¹‰ï¼Œæ¢å¤
% \LaTeXe{} å¯¹ \tn{em} çš„åŽŸå§‹å®šä¹‰ã€‚å¦‚æžœç”¨æˆ·å·²ç»é‡å®šä¹‰äº† \tn{em}ï¼Œåˆ™æ–°å®šä¹‰ä¿æŒ
% ä¸å˜ã€‚\upLaTeX{} 2016/05/07u00 çš„å®šä¹‰æœ‰æ‰€å˜åŒ–ï¼Œè¿™ä¸€è¡Œä¸ºå¯ä»¥ç”±ç”¨æˆ·é€šè¿‡ \pkg{platexrelease}
% åŒ…æ”¹å˜ï¼Œéœ€è¦åˆ†æ”¯å¤„ç†ã€‚
%    \begin{macrocode}
\ctex_patch_cmd_once:NnnnTF \em
  { \ExplSyntaxOff }
  { \eminnershape \else \gtfamily \itshape }
  { \eminnershape \else \itshape }
  { }
  {
    \ctex_patch_cmd:Nnn \em
      { \mcfamily \upshape \else \gtfamily \itshape }
      { \eminnershape \else \itshape }
  }
\cs_set_nopar:Npn \eminnershape { \upshape }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.4}{2016/04/24}{æ­£ç¡®è®¾ç½® \upTeX{} ä¸‹å­—ä½“å‘½ä»¤ã€‚}
% \begin{macro}[int]{\ctex_set_upfamily:nnn}
% å°† NFSS å­—ä½“æ— |#1| è®¾ç½®ä¸º JFM å­—ä½“å |#2|ï¼Œç²—ä½“å½¢å¼å­—ä½“å |#3|ã€‚å…¶ä¸­å­—ä½“å
% å½¢å¦‚ |upzhserif|ï¼Œä¸åŒ…æ‹¬è¡¨ç¤ºæ–¹å‘çš„åŽç¼€ |-h| ä¸Ž |-v|ã€‚ç²—ä½“å­—ä½“åä¸ºç©ºæ—¶ä¸è®¾ç½®è¯¥
% å­—å½¢ã€‚æœ¬å‘½ä»¤ä¸è®¾ç½®å­—ä½“æ˜&nbsp;å°„ï¼Œéœ€è¦å¤ç”¨å·²æœ‰çš„å­—ä½“æ˜&nbsp;å°„æˆ–å¦è¡Œè®¾ç½®ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_set_upfamily:nnn #1#2#3
  {
    \DeclareKanjiFamily{JY2}{#1}{}
    \DeclareKanjiFamily{JT2}{#1}{}
    \DeclareFontShape{JY2}{#1}{m}{n}{&lt;-&gt;~ #2-h}{}
    \DeclareFontShape{JT2}{#1}{m}{n}{&lt;-&gt;~ #2-v}{}
    \tl_if_empty:nF {#3}
      {
        \DeclareFontShape{JY2}{#1}{b}{n}{&lt;-&gt;~ #3-h}{}
        \DeclareFontShape{JT2}{#1}{b}{n}{&lt;-&gt;~ #3-v}{}
        \DeclareFontShape{JY2}{#1}{bx}{n}{&lt;-&gt;~ #3-h}{}
        \DeclareFontShape{JT2}{#1}{bx}{n}{&lt;-&gt;~ #3-v}{}
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_set_upmap:nnn}
% è®¾ç½® \upTeX{} å­—ä½“æ˜&nbsp;å°„ã€‚|#1| æ˜¯å½¢å¦‚ |upserif| çš„ PS TFM å­—ä½“åï¼Œä¸å¸¦è¡¨ç¤ºç²—ä½“
% çš„åŽç¼€ |b| ä¸Žè¡¨ç¤ºæŽ’ç‰ˆæ–¹å‘çš„åŽç¼€ |-h| ä¸Ž |-v|ã€‚|#2| ä¸Ž |#3| æ˜¯æ™®é€šä¸Žç²—ä½“çš„å®žé™…
% å­—ä½“åã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_set_upmap:nnn #1#2#3
  {
    \ctex_set_zhmap:n
      {
        \special { pdf:mapline~#1-h~UniGB-UTF16-H~#2 }
        \special { pdf:mapline~#1-v~UniGB-UTF16-V~#2 }
        \tl_if_empty:nF {#3}
          {
            \special { pdf:mapline~#1b-h~UniGB-UTF16-H~#3 }
            \special { pdf:mapline~#1b-v~UniGB-UTF16-V~#3 }
          }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_set_upmap_unicode:nnn}
% è®¾ç½® \upTeX{} å­—ä½“æ˜&nbsp;å°„ï¼Œä½¿ç”¨ |unicode| CMapã€‚å‚æ•°åŒä¸Šã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_set_upmap_unicode:nnn #1#2#3
  {
    \ctex_set_zhmap:n
      {
        \special { pdf:mapline~#1-h~unicode~#2 }
        \special { pdf:mapline~#1-v~unicode~#2 }
        \tl_if_empty:nF {#3}
          {
            \special { pdf:mapline~#1b-h~unicode~#3 }
            \special { pdf:mapline~#1b-v~unicode~#3 }
          }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_set_upfonts:nnnnnn}
% è®¾ç½® \upTeX{} åŸºæœ¬å­—ä½“æ˜&nbsp;å°„ï¼ŒæŒ‰ \pkg{zhmetrics-uptex} çš„å®šä¹‰ï¼Œä¾æ¬¡è®¾ç½®è¡¬çº¿ä½“
% æ­£ã€ç²—ã€æ„å¤§åˆ©ï¼Œæ—&nbsp;è¡¬çº¿ä½“æ­£ã€ç²—ï¼Œç­‰å®½ä½“æ­£â€”â€”å…± 6 ç§å­—ä½“ï¼Œå¹¶åˆ†æ¨ªæŽ’åŠç›´æŽ’ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_set_upfonts:nnnnnn #1#2#3#4#5#6
  {
    \ctex_set_upmap:nnn { upserif   } {#1} {#2}
    \ctex_set_upmap:nnn { upserifit } {#3} {}
    \ctex_set_upmap:nnn { upsans    } {#4} {#5}
    \ctex_set_upmap:nnn { upmono    } {#6} {}
  }
%    \end{macrocode}
% \end{macro}
%
% ä»¥ä¸‹å‘½ä»¤åªèƒ½åœ¨å¯¼è¨€åŒºä½¿ç”¨ã€‚
%    \begin{macrocode}
\@onlypreamble \ctex_set_upfamily:nnn
\@onlypreamble \ctex_set_upmap:nnn
\@onlypreamble \ctex_set_upmap_unicode:nnn
\@onlypreamble \ctex_set_upfonts:nnnnnn
%    \end{macrocode}
%
% \changes{v2.4.7}{2016/12/27}{ä¾èµ– \pkg{pxeverysel} å®åŒ…ã€‚}
%
% \pkg{everysel} å®åŒ…ï¼ˆ2011/10/28ï¼‰æœªè€ƒè™‘ \upLaTeX{} å¯¹ \tn{selectfont} çš„ä¿®
% æ”¹ï¼Œéœ€è¦å¼•å…¥ \pkg{pxeverysel} å®åŒ…ã€‚
%    \begin{macrocode}
\bool_if:NT \c_@@_everysel_loaded_bool
  { \RequirePackage { pxeverysel } }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/uptex|aptex&gt;
%    \end{macrocode}
%
% \subsubsection{ä¿®æ”¹ä¸»è¦å­—ä½“å‘½ä»¤}
%
% \changes{v2.5.2}{2020/05/06}{å…¼å®¹ \LaTeX\ 2020-02-02 ä¹‹å‰çš„ç‰ˆæœ¬ã€‚}
% \changes{v2.5.4}{2020/06/07}{ä¿®æ­£ä¸»è¦å­—ä½“å‘½ä»¤è¡¥ä¸ã€‚}
%
% ä¿®æ”¹ \tn{rmfamily} ç­‰ä¸»è¦å­—ä½“å‘½ä»¤ï¼Œä½¿å¾—ä¸­æ–‡å­—ä½“èƒ½éšè¥¿æ–‡ä¸»è¦å­—ä½“æ›´æ–°ã€‚
% \LaTeX\ 2020-02-02 ä»¥åŽçš„ç‰ˆæœ¬å¯ä»¥ç›´æŽ¥ä½¿ç”¨ \tn{@rmfamilyhook} ç­‰é’©å­ã€‚
% æˆ‘ä»¬æš‚æ—¶éœ€è¦å¤„ç†æ—§å†…æ&nbsp;¸çš„æƒ…å†µï¼Œä»¥ä¿æŒå…¼å®¹æ€§ã€‚
%
% \pkg{xeCJK} å’Œ \pkg{zhmCJK} å·²ç»æœ‰ç›¸åŒçš„å·¥ä½œï¼Œæœ¬æ®µä»£ç&nbsp;ä¸éœ€è¦å¯¹ä»–ä»¬ä½¿ç”¨ã€‚
%    \begin{macrocode}
%&lt;*pdftex|luatex|uptex|aptex&gt;
%&lt;pdftex&gt;\reverse_if:N \if_bool:N \g_@@_zhmCJK_bool
%    \end{macrocode}
%
% \changes{v2.5.5}{2020/10/17}{è¿›ä¸€æ­¥åº”ç”¨ \LaTeX\ 2020/10/01 çš„æ–°é’©å­ã€‚}
%
% \begin{macro}[int]{\ctex_provide_font_hook:NNN,\CTEX@rmfamilyhook}
% ç»™ \tn{rmfamily} ç­‰å­—ä½“å‘½ä»¤åŠ&nbsp;é’©å­ï¼Œé’©å­åå­—ç»Ÿä¸€ä¸º \tn{CTEX@rmfamilyhook} ç­‰ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_provide_font_hook:NNN #1#2
  {
    \exp_args:Nc \@@_provide_font_hook_aux:NNNN
      { CTEX \cs_to_str:N #2 } #1#2
  }
\cs_if_exist:NTF \ctex_gadd_ltxhook:nn
  {
    \cs_new_protected:Npn \@@_provide_font_hook_aux:NNNN #1#2#3#4
      {
        \tl_new:N #1
        \exp_args:Nx \ctex_gadd_ltxhook:nn { \cs_to_str:N #2 } {#1}
      }
  }
  {
    \cs_new_protected:Npn \@@_provide_font_hook_aux:NNNN #1#2#3#4
      {
        \tl_new:N #1
        \cs_if_exist:NTF #3
          { \tl_gput_right:Nn #3 {#1} }
%    \end{macrocode}
% æ³¨æ„æ­¤å¤„ä¸èƒ½ç”¨ \cs{ctex_patch_cmd:Nnn} æ¥æ‰“è¡¥ä¸ï¼Œå›&nbsp;å…¶ä¼šå…³é—­ \LaTeXiii è¯­æ³•ï¼Œ
% ä½† \pkg{fontspec} ä¼šåœ¨ \tn{rmfamily} çš„å‘½ä»¤ä¸­ç›¸åº”åŠ&nbsp;å…¥
% \cs{l__fontspec_rmfamily_encoding_tl} ç­‰ï¼Œå¯¼è‡´è¡¥ä¸å¤±è´¥ã€‚
%    \begin{macrocode}
          { \ctex_parse_name:NN \tl_replace_once:Nnn #2 {#4} { #1#4 } }
      }
  }
\ctex_provide_font_hook:NNN \rmfamily \@rmfamilyhook \selectfont
\ctex_provide_font_hook:NNN \sffamily \@sffamilyhook \selectfont
\ctex_provide_font_hook:NNN \ttfamily \@ttfamilyhook \selectfont
%&lt;pdftex|luatex&gt;\ctex_provide_font_hook:NNN \normalfont \@defaultfamilyhook \usefont
%    \end{macrocode}
% \end{macro}
%
% æŒ‰ \pkg{CJK} çš„å‘½åä¹&nbsp;æƒ¯æ¨¡æ‹Ÿéƒ¨åˆ†å‘½ä»¤ï¼Œå¹¶è®¾ç½®é»˜è®¤å­—ä½“ã€‚
%    \begin{macrocode}
\tl_if_exist:NF \CJKfamilydefault
  { \tl_const:Nn \CJKfamilydefault { \CJKrmdefault } }
%&lt;*pdftex|luatex&gt;
\tl_if_exist:NF \CJKrmdefault { \tl_const:Nn \CJKrmdefault { rm } }
\tl_if_exist:NF \CJKsfdefault { \tl_const:Nn \CJKsfdefault { sf } }
\tl_if_exist:NF \CJKttdefault { \tl_const:Nn \CJKttdefault { tt } }
\tl_gput_right:Nn \CTEX@rmfamilyhook { \CJKfamily { \CJKrmdefault } }
\tl_gput_right:Nn \CTEX@sffamilyhook { \CJKfamily { \CJKsfdefault } }
\tl_gput_right:Nn \CTEX@ttfamilyhook { \CJKfamily { \CJKttdefault } }
\tl_gput_right:Nn \CTEX@defaultfamilyhook { \CJKfamily { \CJKfamilydefault } }
%&lt;/pdftex|luatex&gt;
%    \end{macrocode}
% \upLaTeX ä¸éœ€è¦è¡¥ä¸ \tn{normalfont}ï¼Œåªéœ€è¦ä¿®æ”¹ \tn{kanjifamilydefault}ã€‚
%    \begin{macrocode}
%&lt;*uptex|aptex&gt;
\tl_if_exist:NF \CJKrmdefault { \tl_const:Nn \CJKrmdefault { zhrm } }
\tl_if_exist:NF \CJKsfdefault { \tl_const:Nn \CJKsfdefault { zhsf } }
\tl_if_exist:NF \CJKttdefault { \tl_const:Nn \CJKttdefault { zhtt } }
\tl_gput_right:Nn \CTEX@rmfamilyhook { \kanjifamily { \CJKrmdefault } }
\tl_gput_right:Nn \CTEX@sffamilyhook { \kanjifamily { \CJKsfdefault } }
\tl_gput_right:Nn \CTEX@ttfamilyhook { \kanjifamily { \CJKttdefault } }
\tl_gset:Nn \kanjifamilydefault { \CJKfamilydefault }
%&lt;/uptex|aptex&gt;
%    \end{macrocode}
%
% \pkg{zhmCJK} åˆ¤æ–­ç»“æŸã€‚
%    \begin{macrocode}
%&lt;pdftex&gt;\fi:
%    \end{macrocode}
%
% ä½¿ä¿®æ”¹ç«‹åˆ»ç”Ÿæ•ˆï¼Œä¿è¯å¯¼è¨€åŒºå­—ä½“æ—æ­£ç¡®ã€‚
%    \begin{macrocode}
\normalfont
%    \end{macrocode}
%
% åœ¨å¯¼è¨€åŒºæœ«å°¾æ›´æ–° \tn{CJKfamilydefault}ï¼Œ\pdfTeX å·²ç»åœ¨ä¹‹å‰ä½¿ç”¨è¿‡æ­¤å¤„ä»£ç&nbsp;ã€‚
%    \begin{macrocode}
%&lt;!pdftex&gt;\ctex_at_end_preamble:n { \ctex_update_default_family: }
%    \end{macrocode}
%
% \changes{v2.4}{2016/02/15}{æ­£ç¡®æ›´æ–° \pkg{CJK} åŒ…çš„ \tn{CJKfamilydefault}ã€‚}
% \changes{v2.4.1}{2016/04/26}{æ­£ç¡®æ›´æ–° \upLaTeX{} çš„ \tn{CJKfamilydefault}ã€‚}
%
% \begin{macro}[int]{\ctex_update_default_family:}
% åœ¨å¯¼è¨€åŒºç»“æŸï¼Œå¦‚æžœ \tn{CJKfamilydefault} æ²¡æœ‰è¢«æ›´æ”¹ï¼Œåˆ™åœ¨æ­¤æ—¶æ&nbsp;¹æ®è¥¿æ–‡å­—ä½“çš„æƒ…å†µ
% æ›´æ–° \tn{CJKfamilydefault}ã€‚\pkg{xeCJK} å·²ç»æœ‰è¿™ä¸ªåŠŸèƒ½ï¼Œä¸éœ€è¦å†è°ƒæ•´ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_update_default_family:
  {
    \tl_if_eq:NNT \CJKfamilydefault \l_@@_family_default_init_tl
      {
        \group_begin:
          \cs_set_eq:NN \@@_family_default_wrap:n \exp_not:n
          \tl_gset:Nx \CJKfamilydefault
            {
              \str_case:onF { \familydefault }
                {
                  { \rmdefault } { \exp_not:N \CJKrmdefault }
                  { \sfdefault } { \exp_not:N \CJKsfdefault }
                  { \ttdefault } { \exp_not:N \CJKttdefault }
                }
                { \CJKfamilydefault }
            }
        \group_end:
      }
%    \end{macrocode}
% ä½¿ç”¨ \LuaLaTeX{} æ—¶ï¼Œè‡ªåŠ¨è°ƒæ•´å¾—åˆ°çš„ \tn{CJKfamilydefault} å¯èƒ½æ²¡æœ‰å®šä¹‰ï¼Œéœ€è¦
% ç¡®è®¤å®ƒçš„å­˜åœ¨æ€§ã€‚ä½¿ç”¨ \pkg{CJK} å®åŒ…æˆ– \upLaTeX{}
% æ—¶ï¼Œ\texttt{C19rm}ã€\texttt{JY2rm} ç­‰æ€»æ˜¯æœ‰å®šä¹‰çš„ï¼Œä¸éœ€è¦ç¡®è®¤ã€‚
%    \begin{macrocode}
%&lt;luatex&gt;    \ctex_ltj_ensure_default_family:
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{variable}{\l_@@_family_default_init_tl}
% å¾€ \tn{CJKfamilydefault} ä¸­åŠ&nbsp;å…¥æ&nbsp;‡å¿—ï¼Œç”¨äºŽåˆ¤æ–­å®ƒæ˜¯å¦è¢«æ›´æ”¹ã€‚
%    \begin{macrocode}
\tl_new:N \l_@@_family_default_init_tl
\cs_new_eq:NN \@@_family_default_wrap:n \use:n
\tl_set:Nx \l_@@_family_default_init_tl
  {
    \exp_not:N \@@_family_default_wrap:n
      { \exp_not:o { \CJKfamilydefault } }
  }
\tl_gset_eq:NN \CJKfamilydefault \l_@@_family_default_init_tl
%    \end{macrocode}
% \end{variable}
%
%    \begin{macrocode}
%&lt;/pdftex|luatex|uptex|aptex&gt;
%    \end{macrocode}
%
% \changes{v2.0}{2014/04/16}{è‡ªåŠ¨æ£€æµ‹æ“ä½œç³»ç»Ÿï¼Œè½½å…¥å¯¹åº”çš„å­—ä½“é…ç½®ã€‚}
% \changes{v2.5}{2019/10/25}{æ“ä½œç³»ç»Ÿæ£€æµ‹ç§»åŠ¨è‡³è½½å…¥ä¸­æ–‡å­—åº“å¤„ï¼Œä¸”ä¸å†éœ€è¦
%   ä¾èµ–ç‰¹å®šå¼•æ“Žã€‚}
%
% \subsubsection{\pkg{hyperref} å…¼å®¹æ€§å¤„ç†}
%
% \changes{v2.1}{2015/06/16}{ä¸å†è®¾ç½® \pkg{hyperref} å®åŒ…çš„ \opt{colorlinks} é€‰é¡¹ã€‚}
%
% çŽ°åœ¨å¤„ç†å„ä¸ªå¼•æ“Žä¸‹çš„ PDF ä¸­æ–‡ä¹¦ç­¾é—®é¢˜ã€‚æ&nbsp;¹æ®ç¼–è¯‘å¼•æ“Žä¸Žæ–‡ä»¶ç¼–ç&nbsp;çš„ä¸
% åŒï¼Œ\pkg{ctex} å‘ \pkg{hyperref} ä¼&nbsp;é€’é€‚å½“çš„å‚æ•°ï¼Œå®Œæˆä¸­æ–‡ä¹¦ç­¾çš„æ­£ç¡®è®¾ç½®ã€‚ç”¨
% æˆ·ä»éœ€è¦è‡ªå·±è½½å…¥ \pkg{hyperref} å®åŒ…ã€‚
%
% \begin{macro}[int]{\ctex_hypersetup:n}
% å¦‚æžœå·²ç»è½½å…¥ \pkg{hyperref} å®åŒ…ï¼Œåˆ™ç›´æŽ¥ä½¿ç”¨å…¶å®šä¹‰è®¾ç½®é€‰é¡¹ï¼›å¦åˆ™
% \cs{ctex_hypersetup:n} çš„æ•ˆæžœä¸Ž \tn{PassOptionsToPackage} ä¸€è‡´ï¼Œåªä¼&nbsp;é€’å®åŒ…å‚
% æ•°ã€‚å¦‚æžœç”¨æˆ·ä¸è½½å…¥ \pkg{hyperref} å®åŒ…ï¼Œç›¸å…³å‚æ•°å³è¢«ä¸¢å¼ƒã€‚
%    \begin{macrocode}
%&lt;*class|ctex&gt;
\@ifpackageloaded { hyperref }
  {
    \cs_new_protected:Npn \ctex_hypersetup:n #1
      { \hypersetup {#1} }
  }
  {
    \cs_new_protected:Npn \ctex_hypersetup:n #1
      { \PassOptionsToPackage {#1} { hyperref } }
  }
%&lt;/class|ctex&gt;
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5.7}{2021/06/06}{ç¦ç”¨ \dvipdfmx\ é©±åŠ¨çš„ \opt{unicode} ä¹¦ç­¾è®¾ç½®ã€‚}
%
% åœ¨ \pdfTeX{} ä¸‹ä½¿ç”¨ \texttt{GBK} ç¼–ç&nbsp;ï¼Œ\dvipdfmx{} é©±åŠ¨å¯ä»¥ç›´æŽ¥ç”¨å®ƒçš„
% \tn{special} å‘½ä»¤ï¼Œå…¶ä»–æ¨¡å¼ç”¨ \pkg{xCJK2uni} å®åŒ…å¤„ç†ã€‚ä½¿ç”¨ \texttt{UTF-8} ç¼–
% ç&nbsp;æ—¶ï¼Œ\pkg{CJKutf8} å·²ç»å¤„ç†äº†ä¹¦ç­¾é—®é¢˜ï¼Œä½†ä»éœ€è¦è®¾ç½® \opt{pdfencoding} ä¸º
% \opt{unicode}ï¼Œç›®çš„æ˜¯åœ¨ä¹¦ç­¾çš„å¼€å¤´å†™å…¥ BOM (|\376\377|)ï¼Œæç¤ºè¿™æ˜¯
% \texttt{UTF-16BE} å­—èŠ‚æµã€‚
% \pkg{hyperref} 2021-02-04 ç‰ˆå¼€å§‹é»˜è®¤è®¾ç½® \opt{unicode} ä¸º \opt{true}ï¼Œ
% å¯¹äºŽ \dvipdfmx\ é©±åŠ¨ï¼Œæˆ‘ä»¬éœ€è¦ç¦ç”¨è¿™ä¸ªè®¾ç½®ï¼Œä¸ºæ­¤è®¾ç½® \opt{pdfencoding} ä¸º \opt{pdfdoc}ã€‚
%    \begin{macrocode}
%&lt;*pdftex&gt;
\ctex_hypersetup:n { driverfallback = dvipdfmx }
\str_if_eq:onTF { \g_@@_encoding_tl } { GBK }
  {
    \ctex_hypersetup:n { CJKbookmarks = true }
    \sys_if_output_pdf:TF
      { \ctex_at_end_package:nn { hyperref } { \RequirePackage { xCJK2uni } } }
      {
        \ctex_hypersetup:n { pdfencoding = pdfdoc }
        \ctex_at_end_package:nn { hyperref }
          {
            \str_if_eq:onTF { \Hy@driver } { hdvipdfm }
              {
                \ctex_at_shipout_first:n
                  { \special { pdf:tounicode~GBK-EUC-UCS2 } }
              }
              { \RequirePackage { xCJK2uni } }
          }
      }
  }
  { \ctex_hypersetup:n { pdfencoding = unicode } }
%&lt;/pdftex&gt;
%    \end{macrocode}
% \XeTeX å’Œ \LuaTeX ç»Ÿä¸€è®¾ç½® \opt{pdfencoding} ä¸º \opt{unicode}ã€‚
%    \begin{macrocode}
%&lt;*xetex|luatex&gt;
\ctex_hypersetup:n { pdfencoding = unicode }
%&lt;/xetex|luatex&gt;
%    \end{macrocode}
%
% æˆ‘ä»¬å‡å®š \upTeX{} ä½¿ç”¨ \dvipdfmx{} é©±åŠ¨è¾“å‡ºï¼ŒäºŽæ˜¯ä½¿ç”¨ä¸Ž \pdfTeX{} ç±»ä¼¼çš„è®¾
% ç½®ã€‚æ³¨æ„ \upTeX{} éœ€è¦ä½¿ç”¨ UTF8-UTF16 çš„ç¼–ç&nbsp;è½¬æ¢ã€‚
%    \begin{macrocode}
%&lt;*uptex|aptex&gt;
\ctex_hypersetup:n
  {
    driverfallback = dvipdfmx ,
    pdfencoding    = pdfdoc
  }
\ctex_at_end_package:nn { hyperref }
  {
    \ctex_at_shipout_first:n
      { \special { pdf:tounicode~UTF8-UTF16 } }
  }
%&lt;/uptex|aptex&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;*pdftex|xetex|luatex|uptex|aptex&gt;
%    \end{macrocode}
%
% \subsubsection{\pkg{CJKfntef}ã€\pkg{xeCJKfntef} ç›¸å…³è®¾ç½®}
%
% \changes{v2.0}{2015/03/25}{é»˜è®¤å…³é—­ \pkg{CJKfntef} æˆ– \pkg{xeCJKfntef} çš„å½©
% è‰²è®¾ç½®ã€‚}
% \changes{v2.0}{2015/03/25}{\tn{CTEXunderdot}ã€\tn{CTEXunderline}ã€
% \tn{CTEXunderdblline}ã€\tn{CTEXunderwave}ã€\tn{CTEXsout}ã€\tn{CTEXxout} æ˜¯è¿‡
% æ—¶å‘½ä»¤ï¼›\env{CTEXfilltwosides} æ˜¯è¿‡æ—¶çŽ¯å¢ƒã€‚}
% \changes{v2.5}{2019/11/10}{ä¸å†è‡ªåŠ¨è½½å…¥ \pkg{CJKfntef} æˆ– \pkg{xeCJKfntef} å®åŒ…ã€‚}
% \changes{v2.5}{2019/11/10}{ç§»é™¤ \tn{CTEXunderdot}ã€\tn{CTEXunderline}ã€
% \tn{CTEXunderdblline}ã€\tn{CTEXunderwave}ã€\tn{CTEXsout}ã€\tn{CTEXxout}ã€
% \env{CTEXfilltwosides} ç­‰å‘½ä»¤å’ŒçŽ¯å¢ƒã€‚}
%
% å¯¹ \pdfTeX{} ä¸Ž \XeTeX{} å¼•æ“Žï¼Œåˆ†åˆ«åœ¨ \pkg{CJKfntef}ã€\pkg{xeCJKfntef} å®åŒ…
% çš„æœ«å°¾å…³é—­å½©è‰²æ˜¾å¼ç­‰å¤šä½™æ&nbsp;¼å¼ã€‚
%
%    \begin{macrocode}
%&lt;*pdftex&gt;
\ctex_at_end_package:nn { CJKfntef }
  {
    \normalem
    \cs_new_protected:Npn \@@_clear_fntef_color:n #1
      { \tl_clear:c { CJK#1color } }
%&lt;/pdftex&gt;
%&lt;*xetex&gt;
\ctex_at_end_package:nn { xeCJKfntef }
  {
    \@ifpackagelater { xeCJKfntef } { 2014/11/04 }
      {
        \cs_new_protected:Npn \@@_clear_fntef_color:n #1
          { \xeCJKsetup { #1 / format = { } } }
      }
      {
        \cs_new_protected:Npn \@@_clear_fntef_color:n #1
          { \tl_clear:c { CJK#1color } }
      }
%&lt;/xetex&gt;
%&lt;*pdftex|xetex&gt;
    \clist_map_inline:nn
      { underdot , underline , underdblline , underwave , sout , xout }
      { \@@_clear_fntef_color:n {#1} }
  }
%&lt;/pdftex|xetex&gt;
%    \end{macrocode}
%
% \subsubsection{\tn{ccwd} çš„æ›´æ–°}
%
% \begin{macro}[int]{\ctex_update_ccwd:,\ccwd}
% \changes{v2.4.1}{2016/04/29}{æ­£ç¡®è®¾ç½® \upTeX{} ä¸‹çš„ \tn{ccwd}ã€‚}
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_update_ccwd:
%&lt;*pdftex|xetex&gt;
  {
    \hbox_set:Nn \l_@@_tmp_box { \CJKglue }
    \dim_set:Nn \ccwd { \box_wd:N \l_@@_tmp_box + \f@size \p@ }
  }
%&lt;/pdftex|xetex&gt;
%&lt;*luatex&gt;
  { \skip_set:Nn \ccwd { \ltjgetparameter { kanjiskip } + \zw } }
%&lt;/luatex&gt;
%&lt;*uptex|aptex&gt;
  { \skip_set:Nn \ccwd { 1zw + \tex_kanjiskip:D } }
%&lt;/uptex|aptex&gt;
\dim_new:N \ccwd
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_update_ccglue:}
% æ›´æ–°å­—é—´è·ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_update_ccglue:
%&lt;*pdftex|xetex&gt;
  {
    \cs_set_protected:Npn \CJKglue
      { \skip_horizontal:N \l_@@_ccglue_skip }
  }
%&lt;/pdftex|xetex&gt;
%&lt;*luatex&gt;
  { \ctex_ltj_set_kanjiskip:N \l_@@_ccglue_skip }
%&lt;/luatex&gt;
%&lt;*uptex|aptex&gt;
  { \skip_set_eq:NN \tex_kanjiskip:D \l_@@_ccglue_skip }
%&lt;/uptex|aptex&gt;
\skip_new:N \l_@@_ccglue_skip
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int,pTF]{\ctex_if_ccglue_touched:}
% æ£€æŸ¥ç”¨æˆ·æ˜¯å¦ä¿®æ”¹è¿‡æ±‰å­—é—´è·ã€‚
%    \begin{macrocode}
\prg_new_conditional:Npnn \ctex_if_ccglue_touched: { TF }
  {
%&lt;*pdftex|xetex&gt;
    \if_meaning:w \CJKglue \@@_ccglue:
      \prg_return_false: \else: \prg_return_true: \fi:
%&lt;/pdftex|xetex&gt;
%&lt;*luatex&gt;
    \skip_if_eq:nnTF { \l_@@_ccglue_skip } { \ltjgetparameter { kanjiskip } }
      { \prg_return_false: } { \prg_return_true: }
%&lt;/luatex&gt;
%&lt;*uptex|aptex&gt;
    \skip_if_eq:nnTF { \l_@@_ccglue_skip } { \tex_kanjiskip:D }
      { \prg_return_false: } { \prg_return_true: }
%&lt;/uptex|aptex&gt;
  }
%&lt;pdftex|xetex&gt;\ctex_at_end:n { \cs_new_eq:NN \@@_ccglue: \CJKglue }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_update_em_unit:}
% å°†å½“å‰æ±‰å­—çš„å®½åº¦ä¿å­˜åˆ° \tn{ccwd} ä¸­å¤‡ç”¨ã€‚ä¸é‡‡ç”¨ \texttt{1em}ï¼Œå›&nbsp;ä¸ºè¿™æ—¶çš„
% \texttt{1em} å®žé™…ä¸Šæ¥è‡ªè¥¿æ–‡å­—ä½“çš„ä¿¡æ¯ï¼Œæœªå¿…ç­‰äºŽæ±‰å­—çš„å®½åº¦ï¼Œè¿™ä¼¼ä¹Žåœ¨ä¼&nbsp;ç»Ÿçš„
% \file{.tfm} å­—ä½“ä¸Šè¡¨çŽ°æ›´æ˜Žæ˜¾ã€‚åœ¨ \pdfTeX{} å’Œ \XeTeX{} ä¸‹ï¼Œç›´æŽ¥ä½¿ç”¨ |\f@size\p@|
% ä½œä¸ºæ±‰å­—çš„å®½åº¦ï¼Œè¿™åº”è¯¥å¯¹å¤§å¤šæ•°æ±‰å­—å­—ä½“éƒ½æˆç«‹ï¼Œä½†ä¸é€‚ç”¨äºŽè¯¸å¦‚â€œæ–¹æ­£å…°äº­é»‘é•¿â€ä¹‹ç±»
% çš„ç‰¹æ®Šå­—ä½“ã€‚åœ¨ \XeTeX{} å¯ä»¥ç”¨ \tn{fontcharwd} æ¥æ”¹è¿›ã€‚è€Œåœ¨ \pdfTeX{} ä¸‹ï¼Œè‹¥ä½¿ç”¨
% \pkg{zhmetrics} æŠ€æœ¯ï¼Œæ‰€æœ‰çš„æ±‰å­—å…±äº«åŒä¸€ä¸ª \file{.tfm}ï¼Œ\tn{fontcharwd} ä¹Ÿå°±æ²¡æœ‰
% æ„ä¹‰ã€‚åœ¨ \LuaTeX{} ä¸‹ï¼Œ\pkg{LuaTeX-ja} æ€»æ˜¯æŒ‰ç…§ JFM ä¸­çš„è®¾ç½®è¾“å‡ºæ±‰å­—çš„å®½åº¦ï¼Œå¯ä»¥
% ç›´æŽ¥ç”¨ \tn{zw} ä½œä¸ºæ±‰å­—å®½åº¦ã€‚\upTeX{} å¯ä»¥ç›´æŽ¥ä½¿ç”¨åŽŸç”Ÿçš„é•¿åº¦å•ä½ |zw|ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_update_em_unit:
%&lt;pdftex|xetex&gt;  { \dim_set:Nn \ccwd { \f@size \p@ } }
%&lt;luatex&gt;  { \dim_set:Nn \ccwd { \zw } }
%&lt;uptex|aptex&gt;  { \dim_set:Nn \ccwd { 1zw } }
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{å…¶ä»–}
%
% \begin{macro}[int]{\ctex_add_to_selectfont:n,\CTEX@selectfont@hook}
% \changes{v2.4.13}{2018/03/23}{ä¿®æ­£å¯¼è¨€åŒº \tn{selectfont} é’©å­ä½ç½®ã€‚}
% \changes{v2.5}{2020/04/19}{å…¼å®¹ \pkg{KOMA-Script} çš„ \tn{selectfont} è¡¥ä¸ã€‚}
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_add_to_selectfont:n #1
  {
    \cs_set_protected:Npx \CTEX@selectfont@hook
      { \exp_not:o { \CTEX@selectfont@hook #1 } }
  }
\cs_new_eq:NN \CTEX@selectfont@hook \prg_do_nothing:
%    \end{macrocode}
% ä½¿ç”¨ \pkg{everysel} åŒ…çš„æƒ…å†µã€‚
% \tn{EverySelectfont} ç›´åˆ°æ–‡æ¡£å¼€å§‹æ—¶æ‰æœ‰æ•ˆã€‚ä¸ºäº† \tn{ccwd} å’Œ \pkg{LuaTeX-ja} çš„
% å­—ä½“è®¾ç½®åœ¨å¯¼è¨€åŒºä¹Ÿå¯ç”¨ï¼Œæˆ‘ä»¬è¿˜éœ€è¦åœ¨è¿™é‡Œæ‰‹å·¥ä¿®æ”¹ \tn{selectfont}ã€‚\pkg{everysel}
% å®åŒ…ä¼šç”¨ \tn{CheckCommand} æ¥æ£€æŸ¥ \tn{selectfont} æ˜¯å¦ä¸ºæ&nbsp;‡å‡†å®šä¹‰ã€‚æˆ‘ä»¬ä¿®æ”¹äº†
% \tn{selectfont}ï¼Œæ‰€ä»¥ä¼šç»™å‡ºä¸€ä¸ªè­¦å‘Šã€‚ä¸ºäº†æ¶ˆé™¤è¿™ä¸ªè­¦å‘Šï¼Œåœ¨å®ƒæ£€æŸ¥ä¹‹å‰ï¼Œè¿˜åŽŸæœ¬æ¥
% å®šä¹‰ã€‚\pkg{pxeverysel} å®åŒ…å–æ¶ˆäº†æ£€æŸ¥ï¼Œä½†ä¹Ÿéœ€è¦æ¢å¤å®šä¹‰ï¼Œé¿å…é‡å¤ä½¿ç”¨é’©å­ã€‚
% \pkg{KOMA-Script} å®åŒ…ä¹Ÿä¼šè¿›è¡Œæ£€æŸ¥ï¼Œæˆ‘ä»¬éœ€è¦å°å¿ƒå¤„ç†ã€‚
%    \begin{macrocode}
\bool_if:NTF \c_@@_everysel_loaded_bool
  {
    \cs_if_free:NF \@EverySelectfont@Init
      {
        \group_begin:
        \cs_set:Npn \@@_tmp:N #1
          {
            \tl_set:Nn \l_@@_tmp_tl {#1}
            \cs_new_eq:NN \CTEX@selectfont@save #1
            \cs_new_protected:Npn \@@_restore_selectfont:
              {
                \cs_if_free:NF \scr@new@selectfont
                  {
%    \end{macrocode}
% \pkg{CJK} ç›´æŽ¥ä¿®æ”¹ \tn{selectfont} å’Œ \pkg{pxeverysel} çš„è¡¥ä¸ï¼Œ
% ä¼šä½¿ \pkg{KOMA-Script} çš„ \tn{par@update} å¤±æ•ˆã€‚
%    \begin{macrocode}
%&lt;*pdftex|uptex|aptex&gt;
                    \cs_if_free:NF \par@update
%&lt;*uptex|aptex&gt;
                      {
                        \tl_put_right:Nn \@EverySelectfont@Init
                          { \tl_put_right:Nn #1 { \par@update } }
                      }
%&lt;/uptex|aptex&gt;
%&lt;*pdftex&gt;
                      { \tl_put_right:Nn #1 { \par@update } }
                    \cs_set_eq:NN \scr@selectfont \CTEX@selectfont@save
%&lt;/pdftex&gt;
%&lt;/pdftex|uptex|aptex&gt;
                    \cs_set_eq:NN \scr@new@selectfont #1
%&lt;!pdftex&gt;                    \cs_set_eq:NN \CTEX@selectfont@save \scr@selectfont
                  }
                \tl_put_left:Nn \@EverySelectfont@Init
                  { \cs_set_eq:NN #1 \CTEX@selectfont@save }
                \cs_undefine:N \@@_restore_selectfont:
              }
          }
        \ctex_parse_name:NN \@@_tmp:N \selectfont
      \exp_last_unbraced:NNo \group_end:
      \ctex_patch_cmd_once:NnnnTF { \l_@@_tmp_tl }
        { \ExplSyntaxOff }
        { \size@update }
        { \CTEX@selectfont@hook \size@update }
        { \@@_restore_selectfont: }
        { \ctex_patch_failure:N \selectfont }
      }
    \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n
      { \EverySelectfont }
  }
%    \end{macrocode}
% ä½¿ç”¨ \LaTeX \ 2021-06-01 çš„æ–°é’©å­ï¼Œä¸ä½¿ç”¨ \pkg{everysel} åŒ…çš„æƒ…å†µã€‚
%    \begin{macrocode}
  {
    \cs_new_protected:Npn \ctex_gadd_selectfont_hook:n
      { \ctex_gadd_ltxhook:nn { selectfont } }
  }
%    \end{macrocode}
% \end{macro}
%
% \tn{CJK@plane} æœ‰å®šä¹‰ï¼Œè¯´æ˜Žå¤„äºŽ \pkg{CJK} å®åŒ…çš„ \tn{CJKsymbol} ä¹‹å†…ï¼Œä¸å¿…ä½¿ç”¨é’©å­ã€‚
%    \begin{macrocode}
%&lt;*pdftex&gt;
\ctex_gadd_selectfont_hook:n
  { \cs_if_exist:NF \CJK@plane { \CTEX@selectfont@hook } }
%&lt;/pdftex&gt;
%&lt;*xetex|luatex|uptex|aptex&gt;
\ctex_gadd_selectfont_hook:n { \CTEX@selectfont@hook }
%&lt;/xetex|luatex|uptex|aptex&gt;
%    \end{macrocode}
%
% Attribute å¯„å­˜å™¨ \tn{ltj@curjfnt} çš„åˆå§‹å€¼æ˜¯ $-1$ï¼Œå¿…é¡»æŠŠå®ƒè®¾ç½®ä¸ºä¸€ä¸ªæœ‰æ•ˆçš„
% \texttt{font.id}ï¼Œå¦åˆ™ç¼–è¯‘æ—¶ä¼šç›´æŽ¥é€€å‡ºã€‚
%    \begin{macrocode}
%&lt;*luatex&gt;
\ctex_add_to_selectfont:n
  {
    \ctex_ltj_select_font:
    \ctex_ltj_select_alternate_font:
  }
\tl_set:Nn \CJK@family { song } \selectfont
\tl_clear:N \CJK@family
%&lt;/luatex&gt;
%    \end{macrocode}
%
% \changes{v2.4.1}{2016/05/01}{éšå­—ä½“æ›´æ–° \upTeX{} çš„ \tn{xkanjiskip}ã€‚}
%
% \begin{macro}[int]{\ctex_update_xkanjiskip:}
% \begin{variable}{\l_@@_xkanjiskip_skip}
% \upTeX{} å’Œ \pkg{LuaTeX-ja} å¯¹ \tn{xkanjiskip} éƒ½æ˜¯å³æ—¶èµ‹å€¼ã€‚å•ä½ \opt{zw} ä¸Žå­—ä½“ç›¸å…³ï¼Œå›&nbsp;æ­¤
% éœ€è¦æ¯æ¬¡ \tn{selectfont} çš„æ—¶å€™æ›´æ–°ä¸€æ¬¡ \tn{xkanjiskip}ã€‚å¦‚æžœç”¨æˆ·è®¾ç½®è¿‡
% \tn{xkanjiskip}ï¼Œå°±ä¸æ›´æ–°ã€‚æ³¨æ„ï¼ŒåŒ \TeX{} çš„ \tn{baselineskip} ä¸€æ&nbsp;·ï¼Œå¦‚æžœåœ¨
% ä¸€ä¸ªæ®µè½å†…å¤šæ¬¡è®¾ç½®äº† \tn{kanjiskip} æˆ– \tn{xkanjiskip}ï¼Œåªæœ‰æœ€åŽçš„è®¾ç½®ä¼šå½±å“
% å…¨æ®µã€‚
%    \begin{macrocode}
%&lt;*luatex|uptex|aptex&gt;
\cs_new_protected:Npn \ctex_update_xkanjiskip:
  {
    \skip_if_eq:nnT
%&lt;luatex&gt;      { \ltjgetparameter { xkanjiskip } } { \l_@@_xkanjiskip_skip }
%&lt;uptex|aptex&gt;      { \tex_xkanjiskip:D } { \l_@@_xkanjiskip_skip }
      {
        \skip_set:Nn \l_@@_xkanjiskip_skip { \l_@@_xkanjiskip_tl }
%&lt;luatex&gt;        \ctex_ltj_set_xkanjiskip:N \l_@@_xkanjiskip_skip
%&lt;uptex|aptex&gt;        \skip_set_eq:NN \tex_xkanjiskip:D \l_@@_xkanjiskip_skip
      }
  }
\tl_new:N \l_@@_xkanjiskip_tl
\tl_set:Nn \l_@@_xkanjiskip_tl
%&lt;luatex&gt;  { .25\zw plus 1pt minus 1pt }
%&lt;uptex|aptex&gt;  { .25zw plus 1pt minus 1pt }
\skip_new:N \l_@@_xkanjiskip_skip
\skip_set:Nn \l_@@_xkanjiskip_skip
%&lt;luatex&gt;  { \ltjgetparameter { xkanjiskip } }
%&lt;uptex|aptex&gt;  { \tex_xkanjiskip:D }
%    \end{macrocode}
% \end{variable}
% \end{macro}
%
%    \begin{macrocode}
\ctex_add_to_selectfont:n { \ctex_update_xkanjiskip: }
%&lt;/luatex|uptex|aptex&gt;
%    \end{macrocode}
%
% \changes{v2.4.10}{2017/07/23}{å®šä¹‰ \tn{cht}ï¼Œ\tn{cdp} å’Œ \tn{cwd}ã€‚}
%
% \begin{macro}[int]{\cht,\cdp,\cwd,\ctex_update_kanjisize:}
% åˆ†åˆ«ä»Ž \file{.jfm} ä¸­è¯»å–å­—ç¬¦é«˜åº¦ã€æ·±åº¦å’Œå®½åº¦ï¼Œç›®å‰ä»…è€ƒè™‘æ¨ªæŽ’çš„æƒ…å†µã€‚
%    \begin{macrocode}
%&lt;*luatex&gt;
\dim_new:N \cht
\dim_new:N \cdp
\dim_new:N \cwd
\group_begin:
\char_set_catcode_space:n { 32 }
\lua_now:e
  {
    local nulltable = { }
    local fmt = luatexja.jfont.font_metric_table
    local getattribute = tex.getattribute
    local setdimen = tex.setdimen
    ctex.newluacmd("ctex_update_kanjisize:", function ()
      local ft = fmt[getattribute("ltj@curjfnt")] or nulltable
      local ft = ft and ft.char_type or nulltable
      local fk = ft and ft[0] or nulltable
      setdimen("cht", fk.height or 0)
      setdimen("cdp", fk.depth or 0)
      setdimen("cwd", fk.width or ft.zw or 0)
    end, "global", "protected")
  }
\group_end:
\ctex_add_to_selectfont:n { \ctex_update_kanjisize: }
%&lt;/luatex&gt;
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{space}
% åœ¨å¯¼è¨€åŒºæˆ–æ­£æ–‡ä¸­è®¾ç½®å¿½ç•¥ç©ºæ&nbsp;¼æ–¹å¼ã€‚
% \pdfTeX{} å’Œ \XeTeX{} ä¸‹åˆå§‹è®¾ç½®ä¸º \opt{auto}ï¼Œ\LuaTeX{}ã€\upTeX{} ä¸‹æ˜¯æ—&nbsp;æ•ˆ
% é€‰é¡¹ã€‚
%    \begin{macrocode}
\ctex_define:n
  {
%&lt;*pdftex|xetex&gt;
    space .choice: ,
    space / true  .code:n =
%&lt;pdftex&gt;      { \ctex_ignorespaces_case:N \prg_do_nothing: } ,
%&lt;xetex&gt;      { \xeCJKsetup { CJKspace = true } } ,
    space / auto  .code:n =
%&lt;pdftex&gt;      { \ctex_ignorespaces_case:N \ctex_auto_ignorespaces: } ,
%&lt;xetex&gt;      { \xeCJKsetup { CJKspace = false } } ,
    space / false .code:n =
%&lt;pdftex&gt;      { \ctex_ignorespaces_case:N \tex_ignorespaces:D } ,
%&lt;xetex&gt;      { \xeCJKsetup { CJKspace = false } } ,
    space .default:n = { true } ,
    space .initial:n = { auto }
%&lt;/pdftex|xetex&gt;
%&lt;*luatex|uptex|aptex&gt;
    space .code:n =
      { \msg_warning:nn { ctex } { invalid-option } }
%&lt;/luatex|uptex|aptex&gt;
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{punct}
% åœ¨å¯¼è¨€åŒºæˆ–æ­£æ–‡ä¸­è®¾ç½®æ&nbsp;‡ç‚¹ç¬¦å·è¾“å‡ºæ&nbsp;¼å¼ã€‚\pkg{LuaTeX-ja} è®¾ç½®çš„æ˜¯å­—ä½“çš„é»˜è®¤ \texttt{JFM}ï¼Œ
% åªä¼šå½±å“åˆ°ä¹‹åŽè®¾ç½®çš„å­—ä½“ã€‚\upTeX{} æš‚æ—¶æ—&nbsp;æ•ˆã€‚
%    \begin{macrocode}
\ctex_define:n
  {
    punct .code:n =
      {
        \tl_set:Nx \l_@@_punct_tl {#1}
%&lt;pdftex&gt;        \punctstyle { \l_@@_punct_tl }
%&lt;xetex&gt;        \xeCJKsetup { PunctStyle = \l_@@_punct_tl }
%&lt;luatex&gt;        \ctex_set_jfm:o { \l_@@_punct_tl }
%&lt;uptex|aptex&gt;        \msg_warning:nn { ctex } { invalid-option }
      } ,
    punct .default:n = { quanjiao } ,
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/pdftex|xetex|luatex|uptex|aptex&gt;
%    \end{macrocode}
%
% \subsubsection{è½½å…¥å¼•æ“Žå®šä¹‰æ–‡ä»¶}
%
% æœ€åŽè½½å…¥å„ä¸ªç¼–è¯‘å¼•æ“Žçš„å®šä¹‰æ–‡ä»¶ã€‚
%    \begin{macrocode}
%&lt;class|ctex&gt;\ctex_file_input:n { \c_@@_engine_file_str }
%    \end{macrocode}
%
% \subsection{ç”¨æˆ·è®¾ç½®æŽ¥å£}
%
% \changes{v2.0}{2014/03/18}{æ–°å¢žç»Ÿä¸€è®¾ç½®æŽ¥å£ \tn{ctexset}ã€‚}
% \changes{v2.4.12}{2018/01/14}
%   {ä¿®æ­£ \tn{ctexset} åœ¨ \pkg{ctexheading} åŒ…ä¸­æ—&nbsp;å®šä¹‰çš„é”™è¯¯ï¼ˆæ›¾ç¥¥ä¸œï¼‰ã€‚ }
%
% \begin{macro}{\ctexset}
%    \begin{macrocode}
%&lt;*class|ctex|ctexheading&gt;
\NewDocumentCommand \ctexset { } { \ctex_set:n }
%&lt;/class|ctex|ctexheading&gt;
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2015/03/21}{\tn{CTEXsetup}, \tn{CTEXoptions} æ˜¯è¿‡æ—¶å‘½ä»¤ã€‚}
% \begin{macro}{\CTEXsetup,\CTEXoptions}
% è¿‡æ—¶å‘½ä»¤ã€‚
%    \begin{macrocode}
%&lt;*class|ctex&gt;
\NewDocumentCommand \CTEXsetup { +O { } &gt; { \TrimSpaces } m }
  {
    \tl_if_blank:nTF {#1}
      { \ctex_deprecated_command:Nn \CTEXsetup { } }
      {
        \ctex_deprecated_command:Nn \CTEXsetup
          { \ctexset {~#2~=~{~#1~}~}~is~set. }
        \ctex_set:nn {#2} {#1}
      }
  }
\NewDocumentCommand \CTEXoptions { +O { } }
  {
    \tl_if_blank:nTF {#1}
      { \ctex_deprecated_command:Nn \CTEXoptions { } }
      {
        \ctex_deprecated_command:Nn \CTEXoptions
          { \ctexset {~#1~}~is~set. }
        \ctex_set:n {#1}
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \subsection{å­—è·ä¸Žç¼©è¿›}
%
% \begin{macro}{autoindent}
% \opt{autoindent} ä¹Ÿæ˜¯å¯ä»¥ç”¨åœ¨æ­£æ–‡ä¸­çš„é€‰é¡¹ï¼Œæ„ä¹‰ä¸Žå®åŒ…é€‰é¡¹ |option/autoindent| ç›¸åŒã€‚
%    \begin{macrocode}
\ctex_define:n
  {
    autoindent .choice: ,
    autoindent .default:n = { true } ,
    autoindent / true    .code:n =
      {
        \tl_set:Nn \l_@@_autoindent_tl { 2 \ccwd }
        \ctex_select_size:
      } ,
    autoindent / false   .code:n =
      { \tl_clear:N \l_@@_autoindent_tl } ,
    autoindent / unknown .code:n =
      {
        \ctex_set_default_ccwd:Nn \l_@@_autoindent_tl {#1}
        \ctex_select_size:
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\CTEXsetfont}
% æ—&nbsp;è®ºå­—ä½“å¤§å°æ˜¯å¦å˜åŒ–éƒ½æ›´æ–°ç›¸å…³ä¿¡æ¯ã€‚
%    \begin{macrocode}
\NewDocumentCommand \CTEXsetfont { } { \ctex_select_size: }
\cs_new_protected:Npn \ctex_select_size:
  { \cs_if_free:NTF \size@update { \ctex_update_size: } { \selectfont } }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_update_size:}
% åœ¨å­—å·å˜åŒ–æ—¶æ›´æ–° \tn{ccwd}ã€\tn{parindent} å’Œæ±‰å­—é—´è·ã€‚å­—è·ä¸ºé›¶åˆ™æ¢å¤æ­£å¸¸è®¾ç½®ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_update_size:
  {
    \tl_if_eq:NNTF \l_@@_ziju_tl \c_@@_zero_tl
      {
        \ctex_update_stretch:
        \ctex_update_parindent:
      }
      { \ctex_update_ziju: }
  }
\tl_const:Nx \c_@@_zero_tl { \fp_use:N \c_zero_fp }
\tl_new:N \l_@@_ziju_tl
\tl_set_eq:NN \l_@@_ziju_tl \c_@@_zero_tl
%    \end{macrocode}
% åœ¨ \tn{selectfont} ä¸­ï¼Œè‹¥ \tn{size@update} ä¸º \tn{relax}ï¼Œè¯´æ˜Žå­—ä½“å¤§å°æ²¡æœ‰å˜åŒ–ï¼Œ
% æˆ‘ä»¬ä¹Ÿå°±ä¸ç”¨æ›´æ–°ç›¸å…³å‚æ•°ã€‚
%    \begin{macrocode}
\ctex_add_to_selectfont:n
  { \cs_if_free:NF \size@update { \ctex_update_size: } }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2014/03/26}{æ–°å¢ž \opt{linestretch} é€‰é¡¹ã€‚}
%
% \begin{macro}{linestretch}
% è‹¥è¡Œå®½ä¸æ˜¯æ±‰å­—å®½åº¦çš„æ•´æ•°å€ï¼Œè‡ªç„¶è¦æ±‚ä¼¸å±•å®ƒä»¬ä¹‹é—´çš„å·®ã€‚è¿™é‡Œè®¾ç½®çš„æ˜¯åœ¨æ­¤åŸºç¡€ä¸Šçš„
% é¢å¤–ä¼¸å±•é‡ã€‚åˆå§‹åŒ–ä¸ºä¸€ä¸ªæ±‰å­—çš„å®½åº¦ã€‚è‹¥è®¾ç½®ä¸º \tn{maxdimen}ï¼Œåˆ™ç¦ç”¨æ­¤åŠŸèƒ½ã€‚
% å‚æ•°çš„é»˜è®¤å•ä½æ˜¯æ±‰å­—çš„å®½åº¦ \tn{ccwd}ã€‚
%    \begin{macrocode}
\ctex_define:n
  {
    linestretch .code:n =
      {
        \ctex_set_default_ccwd:Nn \l_@@_line_stretch_tl {#1}
        \ctex_select_size:
      } ,
    linestretch .value_required:n = true
  }
\tl_new:N \l_@@_line_stretch_tl
\tl_set:Nn \l_@@_line_stretch_tl { \ccwd }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_update_stretch:}
% é¦–å…ˆè®¡ç®—ä¸€è¡Œä¸Šæ±‰å­—çš„å­—æ•°ï¼Œ\tn{CJKglue} ç›¸å½“äºŽå°† \tn{linewidth} ä¸Žæ±‰å­—æ€»å®½åº¦ä¹‹å·®
% å‡åŒ€åœ°å¡«å……åˆ°æ±‰å­—ä¹‹é—´ã€‚\hologo{eTeX} çš„é™¤æ³•æ˜¯å››èˆäº”å…¥ï¼Œè€Œæˆ‘ä»¬è¿™é‡Œåº”è¯¥ç”¨æˆªæ–­ã€‚ç”±äºŽ
% æ²¡æœ‰å¯å±•æ€§çš„è¦æ±‚ï¼Œç›´æŽ¥ç”¨åŽŸè¯­ \cs{tex_divide:D} è¦æ¯” \cs{int_div_truncate:nn}
% å¿«ä¸€äº›ã€‚ä¸‹é¢çš„ç®—æ³•è¿˜å…¼é¡¾åˆ°äº† \tn{linewidth} ä¸ä¸ºæ±‰å­—å­—å®½çš„æ•´æ•°å€çš„æƒ…å†µã€‚
% è‹¥ç”¨æˆ·ç¦ç”¨ \opt{linestretch} å¹¶ä¸”ä¿®æ”¹è¿‡ \tn{CJKglue}ï¼Œåˆ™åªæ›´æ–°
% \tn{ccwd}ï¼Œå¦åˆ™è®¾ç½®ä¼¸å±•é‡ä¸º $0.08$ å€ \tn{baselineskip}ã€‚æ³¨æ„ \pkg{everysel} çš„
% é’©å­ä½äºŽ \tn{size@update} ä¹‹å‰ï¼Œ\tn{baselineskip} è¿˜æœªæ›´æ–°ï¼Œä¸èƒ½ç›´æŽ¥ä½¿ç”¨å®ƒã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_update_stretch:
  {
    \ctex_update_em_unit:
    \dim_set:Nn \l_@@_tmp_dim { \l_@@_line_stretch_tl }
    \dim_compare:nNnTF \l_@@_tmp_dim = \c_max_dim
      { \@@_update_stretch_auxi: }
      { \@@_update_stretch_auxii: }
  }
\cs_new_protected:Npn \@@_update_stretch_auxi:
  {
    \ctex_if_ccglue_touched:TF
      { \ctex_update_ccwd: }
      {
        \dim_set:Nn \l_@@_tmp_dim
          { \baselinestretch \tex_glueexpr:D \f@baselineskip \scan_stop: }
        \skip_set:Nn \l_@@_ccglue_skip
          { \c_zero_dim plus .08 \l_@@_tmp_dim }
        \ctex_update_ccglue:
      }
  }
\cs_new_protected:Npn \@@_update_stretch_auxii:
  {
    \int_set:Nn \l_@@_tmp_int
      { \tex_dimexpr:D \linewidth - \ccwd - \l_@@_tmp_dim \scan_stop: }
    \tex_divide:D \l_@@_tmp_int \ccwd
    \int_compare:nNnTF \l_@@_tmp_int &gt; \c_zero_int
      {
        \skip_set:Nn \l_@@_ccglue_skip
          {
            \c_zero_dim plus \dim_eval:n
              {
                ( \linewidth - \ccwd - \l_@@_tmp_int \ccwd ) /
                \l_@@_tmp_int
              }
          }
      }
      { \skip_zero:N \l_@@_ccglue_skip }
    \ctex_update_ccglue:
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_update_parindent:}
% æ›´æ–°æ®µè½é¦–è¡Œç¼©è¿›ã€‚æ­¤å‡½æ•°åœ¨å­—å·å˜åŒ–æ—¶è°ƒç”¨ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_update_parindent:
  {
    \tl_if_empty:NF \l_@@_autoindent_tl
      {
        \dim_compare:nNnF \parindent = \c_zero_dim
          { \dim_set:Nn \parindent { \l_@@_autoindent_tl } }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ziju}
% è‹¥å‚æ•°ä¸º $0$ï¼Œåˆ™æ¢å¤æ­£å¸¸é—´è·ã€‚
%    \begin{macrocode}
\NewDocumentCommand \ziju { m }
  { \exp_args:Nx \ctex_ziju:n {#1} \tex_ignorespaces:D }
\cs_new_protected:Npn \ctex_ziju:n #1
  {
    \tl_set:Nx \l_@@_ziju_tl { \fp_eval:n {#1} }
    \ctex_select_size:
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_update_ziju:}
% æ›´æ–°å­—è·ã€‚è‹¥å­—è·ä¸å¤§äºŽ $-1$ï¼Œå³ \tn{ccwd} ä¸ºéžæ­£å€¼ï¼Œåˆ™ä¸è®¡ç®—ä¼¸ç¼©å€¼ã€‚
% å¦åˆ™ï¼Œé¦–å…ˆå‡å®šæ±‰å­—çš„å®½åº¦ä¸ºæ­£å¸¸å®½åº¦åŠ&nbsp;ä¸Šå­—è·ï¼Œçœ‹ä¸€è¡Œä¸Šèƒ½æ­£å¸¸æ”¾ä¸‹å¤šå°‘ä¸ªæ±‰å­—ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_update_ziju:
  {
    \ctex_update_em_unit:
    \dim_set:Nn \l_@@_ziju_dim { \l_@@_ziju_tl \ccwd }
    \dim_add:Nn \ccwd { \l_@@_ziju_dim }
    \dim_compare:nNnTF \ccwd &gt; \c_zero_dim
%    \end{macrocode}
% ä¼¸å±•é‡ä¿è¯è¡Œå†…çš„å‰©ä½™ç©ºç™½èƒ½å¤Ÿè¢«å‡åŒ€åœ°å¡«å……åˆ°æ±‰å­—ä¹‹é—´ï¼Œæ”¶ç¼©çš„æœ€å¤§é™åº¦æ˜¯è®©å½“å‰è¡Œ
% è¿˜èƒ½å¤Ÿå†æŒ¤ä¸‹ä¸€ä¸ªæ±‰å­—å¹¶ä¸”ä¸ä¼šå‡ºçŽ°è´Ÿé—´è·ã€‚ç”± \TeX{} å†³å®šä¼¸å±•è¿˜æ˜¯æ”¶ç¼©ã€‚
%    \begin{macrocode}
      {
        \dim_set:Nn \l_@@_tmp_dim
          { \linewidth - \ccwd + \l_@@_ziju_dim }
        \int_set:Nn \l_@@_tmp_int { \l_@@_tmp_dim }
        \tex_divide:D \l_@@_tmp_int \ccwd
        \dim_sub:Nn \l_@@_tmp_dim { \l_@@_tmp_int \ccwd }
%    \end{macrocode}
% ç”±äºŽ \tn{parindent} æ˜¯ä¸€ä¸ªå›ºå®šå€¼ï¼Œå¹¶ä¸å‚ä¸Žä¼¸ç¼©ï¼Œå®¹æ˜“å¯¼è‡´ç¬¬ä¸€è¡Œå‡ºçŽ°åç›’å­ã€‚
% æˆ‘ä»¬åœ¨è¿™é‡Œå°†å­—æ•°å‡åŽ» $2$ï¼Œä»¥æ­¤æ”¾å¤§ä¼¸ç¼©å€¼ã€‚
%    \begin{macrocode}
        \dim_compare:nNnF \parindent = \c_zero_dim
          {
            \int_compare:nNnF \l_@@_tmp_int &lt; 3
              { \int_sub:Nn \l_@@_tmp_int { 2 } }
          }
        \skip_set:Nn \l_@@_ccglue_skip
          {
            \l_@@_ziju_dim
            plus  \dim_eval:n { \l_@@_tmp_dim / \l_@@_tmp_int }
            minus \dim_min:nn { \dim_abs:n { \l_@@_ziju_dim } }
              { ( \ccwd - \l_@@_tmp_dim ) / ( \l_@@_tmp_int + 1 ) }
          }
      }
      { \skip_set:Nn \l_@@_ccglue_skip { \l_@@_ziju_dim } }
    \ctex_update_ccglue:
%    \end{macrocode}
% å­—è·è®¾ç½®å¾—æ¯”è¾ƒå¤§æ—¶ï¼Œä¸ºäº†å°½é‡ä¿è¯æ®µé¦–ç¼©è¿›èƒ½å¤Ÿä¸Žä¸‹ä¸€è¡Œå¯¹é½ï¼Œåº”è¯¥éœ€è¦ç›¸åº”åœ°åŠ&nbsp;ä¸Š
% æˆ–è€…å‡åŽ»ä¼¸ç¼©å€¼ã€‚ä½†æ˜¯è¿™é‡Œå¹¶ä¸æ¸…æ¥š \TeX{} æ˜¯ä¼¸å±•è¿˜æ˜¯æ”¶ç¼©ï¼Œä¹‹å‰ä»¥â€œå½“å‰è¡Œæ˜¯å¦è¿˜
% æ”¾å¾—ä¸‹ä¸€ä¸ªæ±‰å­—â€ä¸ºæ&nbsp;‡å‡†åŠ&nbsp;ä¸Šæˆ–å‡åŽ»ä¼¸ç¼©å€¼çš„åšæ³•ä¹Ÿæœªå¿…ä¸Žå®žé™…ç»“æžœä¸€è‡´ï¼Œæ‰€ä»¥åªå¥½è¿˜
% æ˜¯è®¾ç½®ä¸º |2\ccwd|ã€‚
%    \begin{macrocode}
    \ctex_update_parindent:
  }
\dim_new:N \l_@@_ziju_dim
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2015/03/21}{\tn{CTEXindent}, \tn{CTEXnoindent} æ˜¯è¿‡æ—¶å‘½ä»¤ã€‚}
% \begin{macro}{\CTEXindent,\CTEXnoindent}
% è¿‡æ—¶å‘½ä»¤ã€‚
%    \begin{macrocode}
\NewDocumentCommand \CTEXindent { }
  {
    \ctex_deprecated_command:Nn \CTEXindent
      { \parindent is~set~to~2\ccwd. }
    \ctex_update_ccwd:
    \dim_set:Nn \parindent { 2 \ccwd }
  }
\NewDocumentCommand \CTEXnoindent { }
  {
    \ctex_deprecated_command:Nn \CTEXnoindent
      { \parindent is~set~to~0pt. }
    \dim_zero:N \parindent
  }
%    \end{macrocode}
% \end{macro}
%
% \subsection{ä¸­æ–‡æ•°å­—ä¸Žæ—¥æœŸ}
%
% éœ€è¦æ³¨æ„çš„æ˜¯ï¼Œ\pkg{ltkeys} è®¾ç½®çš„é€‰é¡¹åˆ—è¡¨æ˜¯
% |\@raw@opt@|\meta{\textbackslash @currname}|.|\meta{\textbackslash @currext}ï¼Œ
% è¯¥åˆ—è¡¨ä¸ä¼šå°† \tn{PassOptionsToPackage} ä¼&nbsp;é€’çš„é€‰é¡¹å®Œå…¨å±•å¼€ã€‚
%    \begin{macrocode}
\exp_args:Ne \PassOptionsToPackage
  { encoding = \g_@@_encoding_tl }
  { zhnumber }
\RequirePackage { zhnumber }
%    \end{macrocode}
%
% \begin{macro}{\chinese}
% \changes{v2.4.1}{2016/05/01}{æ”¯æŒ \tn{pagenumbering}ã€‚}
%    \begin{macrocode}
\cs_new:Npn \chinese { \zhnum_counter:n }
\cs_new_eq:NN \@chinese \@zhnum
\cs_new_eq:NN \Chinese \chinese
\cs_new_eq:NN \CTEXcounter \use_none:n
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2}{2015/06/29}{ç»™ \pkg{enumitem} å®åŒ…æ³¨å†Œ \tn{chinese} å’Œ
%   \tn{zhnum}ã€‚}
%
% ç»™ \pkg{enumitem} å®åŒ…æ³¨å†Œ \tn{chinese}ã€\tn{zhnum} å’Œ \tn{zhdig}ã€‚
%    \begin{macrocode}
\ctex_at_end_package:nn { enumitem }
  {
    \cs_if_free:NF \AddEnumerateCounter
      {
        \AddEnumerateCounter * { \zhnum }   { \@zhnum } { 1 }
        \AddEnumerateCounter * { \zhdig }   { \@zhdig } { 1 }
        \AddEnumerateCounter * { \chinese } { \@chinese } { 1 }
      }
  }
%    \end{macrocode}
%
% \begin{macro}{\CTEXnumber,\CTEXdigits}
%    \begin{macrocode}
\NewDocumentCommand \CTEXnumber { m m }
  { \protected@edef #1 { \zhnumber {#2} } }
\NewDocumentCommand \CTEXdigits { m m }
  { \protected@edef #1 { \zhdigits {#2} } }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{today}
%    \begin{macrocode}
\cs_set_eq:NN \CTEX@todayold \today
\ctex_define:n
  {
    today .choice: ,
    today / old     .code:n =
      { \cs_set_eq:NN \today \CTEX@todayold } ,
    today / small   .code:n =
      {
        \cs_set_eq:NN \today \zhtoday
        \zhnumsetup { time = Arabic }
      } ,
    today / big     .code:n =
      {
        \cs_set_eq:NN \today \zhtoday
        \zhnumsetup { time = Chinese }
      } ,
    today / unknown .code:n =
      { \msg_error:nnx { ctex } { today-undef } {#1} }
  }
\msg_new:nnnn { ctex } { today-undef }
  { Today~format~`#1'~is~undefined. }
  { Available~today~formats~are~`old',~`small',~and~`big'. }
%    \end{macrocode}
% \end{macro}
%
% \subsection{å…¶ä»–ä¸­æ–‡æ&nbsp;‡é¢˜å®šä¹‰}
%
% \changes{v2.0}{2014/03/08}{å°†æ&nbsp;‡é¢˜æ±‰åŒ–åŠŸèƒ½åŠ&nbsp;å…¥ \pkg{ctex.sty}ã€‚}
% \changes{v2.4.3}{2016/08/18}{ç¡®ä¿ \tn{proofname} éžç©ºã€‚}
%
% \begin{macro}[int]{\proofname}
% \tn{proofname} æœªåœ¨æ&nbsp;‡å‡†æ–‡æ¡£ç±»ä¸­å®šä¹‰ï¼Œéœ€è¦ç¡®ä¿å®ƒéžç©ºã€‚
%    \begin{macrocode}
\tl_if_exist:NF \proofname
  {
    \tl_new:N \proofname
    \tl_set:Nn \proofname { Proof }
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\ctex_define:n
  {
    contentsname   .tl_set:N = \contentsname ,
    listfigurename .tl_set:N = \listfigurename ,
    listtablename  .tl_set:N = \listtablename ,
    figurename     .tl_set:N = \figurename ,
    tablename      .tl_set:N = \tablename ,
    abstractname   .tl_set:N = \abstractname ,
    indexname      .tl_set:N = \indexname ,
    appendixname   .tl_set:N = \appendixname ,
    proofname      .tl_set:N = \proofname ,
%&lt;article&gt;    bibname        .tl_set:N = \refname
%&lt;book|report&gt;    bibname        .tl_set:N = \bibname
%&lt;*beamer&gt;
    algorithmname  .tl_set:N = \algorithmname ,
    bibname        .tl_set:N = \bibname ,
    refname        .tl_set:N = \refname ,
    continuation   .tl_set:N = \insertcontinuationtext
%&lt;/beamer&gt;
  }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;*ctex&gt;
\msg_new:nnn { ctex } { ctexbibname }
  {
    Neither~`\token_to_str:N \bibname'~nor~`\token_to_str:N \refname'~can~be~found.\\
    The~key~`bibname'~will~set~`\token_to_str:N \ctexbibname'~to~the~given~value.
  }
\tl_if_exist:NTF \insertcontinuationtext
  {
    \ctex_define:n
      {
        algorithmname .tl_set:N = \algorithmname ,
        bibname       .tl_set:N = \bibname ,
        refname       .tl_set:N = \refname ,
        continuation  .tl_set:N = \insertcontinuationtext
      }
  }
  {
    \tl_if_exist:NTF \bibname
      { \ctex_define:n { bibname .tl_set:N = \bibname } }
      {
        \tl_if_exist:NTF \refname
          { \ctex_define:n { bibname .tl_set:N = \refname } }
          {
            \msg_warning:nn { ctex } { ctexbibname }
            \ctex_define:n { bibname .tl_set:N = \ctexbibname }
          }
      }
  }
%&lt;/ctex&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/class|ctex&gt;
%    \end{macrocode}
%
% \subsection{ä¸­æ–‡åŒ–çš„æ&nbsp;‡é¢˜ç»“æž„}
%
% æœ¬èŠ‚å†…å®¹åœ¨ \CTeX{} æ–‡æ¡£ç±»æˆ–æ‰“å¼€ \opt{heading} é€‰é¡¹ä¸‹ç”Ÿæ•ˆã€‚
%    \begin{macrocode}
%&lt;*class|heading&gt;
%    \end{macrocode}
%
% \subsubsection{å®šä¹‰æ&nbsp;‡é¢˜æ&nbsp;¼å¼é€‰é¡¹}
%
% \begin{variable}{\c_@@_section_headings_seq}
% ä¿å­˜ \tn{section} çº§ä»¥ä¸‹æ&nbsp;‡é¢˜åå­—ã€‚
%    \begin{macrocode}
%&lt;*article|book|report&gt;
\seq_const_from_clist:Nn \c_@@_section_headings_seq
  { section , subsection , subsubsection , paragraph , subparagraph }
%&lt;/article|book|report&gt;
%    \end{macrocode}
% \end{variable}
%
% \begin{variable}{\c_@@_headings_seq}
%    \begin{macrocode}
%&lt;*article|book|report&gt;
\seq_new:N \c_@@_headings_seq
\seq_gset_eq:NN \c_@@_headings_seq \c_@@_section_headings_seq
%&lt;book|report&gt;\seq_gput_left:Nn \c_@@_headings_seq { chapter }
\seq_gput_left:Nn \c_@@_headings_seq { part }
%&lt;/article|book|report&gt;
%&lt;*beamer&gt;
\seq_const_from_clist:Nn \c_@@_headings_seq
  { part , section , subsection }
%&lt;/beamer&gt;
%    \end{macrocode}
% \end{variable}
%
% \changes{v2.1}{2015/06/19}{\opt{nameformat} å¯ä»¥æŽ¥å—ç«&nbsp;èŠ‚åå­—ä¸ºå‚æ•°ã€‚}
% \changes{v2.3}{2016/01/05}{ä¿®å¤ \opt{nameformat} ä½œç”¨åŸŸé—®é¢˜ã€‚}
%
% \begin{macro}{\@@_initial_heading:n}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_initial_heading:n #1
  {
    \tl_new:c { CTEX@pre#1 }
    \tl_new:c { CTEX@post#1 }
    \tl_const:cx { CTEXthe#1 }
      {
        \exp_not:c { CTEX@pre#1 }
        \exp_not:c { CTEX@the#1 }
        \exp_not:c { CTEX@post#1 }
      }
    \tl_const:cx { CTEX@#1name }
      {
        \group_begin:
          \exp_not:c { CTEX@#1@nameformat }
            {
              \exp_not:c { CTEX@pre#1 }
              \exp_not:N \tl_if_empty:NTF
              \exp_not:c { CTEX@#1@numberformat }
                { \exp_not:c { CTEX@the#1 } }
                {
                  \group_begin:
                    \exp_not:c { CTEX@#1@numberformat }
                    \exp_not:c { CTEX@the#1 }
                  \group_end:
                }
              \exp_not:c { CTEX@post#1 }
            }
        \group_end:
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.1}{2015/05/22}{\opt{format+}, \opt{nameformat+} ç­‰å¸¦åŠ&nbsp;å·çš„é€‰é¡¹ï¼Œ
%   åŠ&nbsp;å·ä¸Žå‰é¢çš„æ–‡å­—ä¹‹é—´å¯ä»¥æœ‰å¯é€‰çš„ç©ºæ&nbsp;¼ã€‚}
% \changes{v2.1}{2015/06/19}{æ–°çš„æ&nbsp;‡é¢˜æ&nbsp;¼å¼é€‰é¡¹ \opt{aftertitle}ã€‚}
% \changes{v2.2}{2015/06/21}{æ–°çš„æ&nbsp;‡é¢˜æ&nbsp;¼å¼é€‰é¡¹ \opt{numbering}ã€‚}
% \changes{v2.2}{2015/06/27}{\opt{beforeskip} å’Œ \opt{afterskip} é€‰é¡¹çš„ç¬¦å·
%   ä¸å†æœ‰ç‰¹æ®Šæ„ä¹‰ã€‚}
% \changes{v2.2}{2015/06/27}{æ–°çš„æ&nbsp;‡é¢˜æ&nbsp;¼å¼é€‰é¡¹ \opt{afterindent}ã€‚}
% \changes{v2.2}{2015/06/27}{æ–°çš„æ&nbsp;‡é¢˜æ&nbsp;¼å¼é€‰é¡¹ \opt{runin}ã€‚}
% \changes{v2.4.3}{2016/06/03}{æ–°çš„æ&nbsp;‡é¢˜æ&nbsp;¼å¼é€‰é¡¹ \opt{fixskip}ã€‚}
% \changes{v2.4.4}{2016/09/19}{æ–°çš„æ&nbsp;‡é¢˜æ&nbsp;¼å¼é€‰é¡¹ \opt{break}ã€‚}
% \changes{v2.4.5}{2016/10/22}{æ–°çš„æ&nbsp;‡é¢˜æ&nbsp;¼å¼é€‰é¡¹ \opt{hang}ã€‚}
% \changes{v2.4.5}{2016/10/25}{æ–°çš„æ&nbsp;‡é¢˜æ&nbsp;¼å¼é€‰é¡¹ \opt{tocline}ã€‚}
% \changes{v2.4.11}{2017/11/21}{å›&nbsp;ä¸Šæ¸¸ \pkg{l3keys} å˜åŒ–ï¼Œé‡æ–°å®šä¹‰
%   \opt{format\textvisiblespace+} ç­‰å¸¦ç©ºæ&nbsp;¼åŠ&nbsp;å·çš„é€‰é¡¹ã€‚}
%
% \begin{macro}{\@@_def_heading_keys:n}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_def_heading_keys:n #1
  {
    \exp_args:NNe \tl_put_right:Nn \l_@@_tmp_tl
      {
        #1                  .meta:nn = { ctex / #1 } { ##1 } ,
        #1 / name            .code:n =
          { \ctex_assign_heading_name:nn {#1} { ##1 } } ,
        #1 / number        .tl_set:N = \exp_not:c { CTEX@the#1 } ,
        #1 / beforeskip    .tl_set:N = \exp_not:c { CTEX@#1@beforeskip } ,
        #1 / afterskip     .tl_set:N = \exp_not:c { CTEX@#1@afterskip} ,
        #1 / indent        .tl_set:N = \exp_not:c { CTEX@#1@indent } ,
        #1 / numbering   .bool_set:N = \exp_not:c { CTEX@#1@numbering } ,
        #1 / numbering    .initial:n = true ,
        #1 / beforeskip   .initial:n = \c_zero_skip ,
        #1 / afterskip    .initial:n = \c_zero_skip ,
        #1 / indent       .initial:n = \c_zero_dim ,
        #1 / beforeskip   .value_required:n = true ,
        #1 / afterskip    .value_required:n = true ,
        #1 / indent       .value_required:n = true ,
%&lt;*article|book|report&gt;
        #1 / afterindent .bool_set:N = \exp_not:c { CTEX@#1@afterindent } ,
        #1 / fixskip     .bool_set:N = \exp_not:c { CTEX@#1@fixskip } ,
        #1 / hang        .bool_set:N = \exp_not:c { CTEX@#1@hang } ,
        #1 / hang         .initial:n = true ,
        #1 / runin       .bool_set:N = \exp_not:c { CTEX@#1@runin } ,
        #1 / tocline      .cs_set:Np = \exp_not:c { CTEX@#1@tocline } ##1##2 ,
        \@@_plus_key_aux:nn {#1} { break } ,
%&lt;/article|book|report&gt;
        \@@_plus_key_aux:nn {#1} { format } ,
        \@@_plus_key_aux:nn {#1} { nameformat } ,
        \@@_plus_key_aux:nn {#1} { numberformat } ,
        \@@_plus_key_aux:nn {#1} { titleformat } ,
        \@@_plus_key_aux:nn {#1} { aftername } ,
        \@@_plus_key_aux:nn {#1} { aftertitle } ,
      }
  }
\cs_new:Npn \@@_plus_key_aux:nn #1#2
  {
    #1 / #2   .tl_set:N = \exp_not:c { CTEX@#1@#2 } ,
    #1 / #2 +   .code:n =
      { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } } ,
    #1 / #2 ~ + .code:n =
      { \tl_put_right:Nn \exp_not:c { CTEX@#1@#2 } { ##1 } }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_assign_heading_name:nn}
% \begin{macro}{\@@_assign_heading_name:nnn}
% \opt{name} çš„å€¼æ˜¯ä¸€ä¸ªè‡³å¤šä¸¤ä¸ªå…ƒç´&nbsp;çš„é€—å·åˆ†éš”åˆ—è¡¨ã€‚ç”±äºŽ \LaTeXiii{} çš„
% \texttt{clist} æ€»æ˜¯ä¼šè‡ªåŠ¨å¿½ç•¥ç©ºå…ƒç´&nbsp;ï¼Œæ‰€ä»¥è®¾ç½® |name={,ç«&nbsp;}| åŽï¼Œç¬¬ä¸€ä¸ªå…ƒç´&nbsp;å°†ä¼š
% æ˜¯â€œç«&nbsp;â€ï¼Œå¿…é¡»ç”¨ç©ºçš„åˆ†ç»„ä¿æŠ¤ç©ºå…ƒç´&nbsp;ï¼š|name={{},ç«&nbsp;}|ï¼Œè¿™åœ¨ä½¿ç”¨ä¸­æœ‰äº›è®¸ä¸ä¾¿ã€‚æˆ‘ä»¬
% å¯ä»¥æ”¹ç”¨ \texttt{seq} æˆ–è€…æ‰‹å†™å‡½æ•°è§£æžå‚æ•°æ¥åŠ&nbsp;ä»¥æ”¹è¿›ã€‚ä¸ºå®žçŽ°çš„ç®€å•èµ·è§ï¼Œè¿™é‡Œç”¨
% äº† \pkg{xparse} çš„ \tn{SplitArgument}ï¼Œå®ƒå¸¦æœ‰å‚æ•°çš„é•¿åº¦æ£€æŸ¥ã€‚
%    \begin{macrocode}
\NewDocumentCommand \ctex_assign_heading_name:nn
  { m &gt; { \SplitArgument { 1 } { , } } +m }
  { \@@_assign_heading_name:nnn {#1} #2 }
\cs_new_protected:Npn \@@_assign_heading_name:nnn #1#2#3
  {
    \tl_set:cn { CTEX@pre#1 } {#2}
    \tl_if_novalue:nTF {#3}
      { \tl_clear:c { CTEX@post#1 } }
      { \tl_set:cn { CTEX@post#1 } {#3} }
  }
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \changes{v2.0}{2014/03/21}{æ&nbsp;‡é¢˜è®¾ç½®æ–°å¢ž \opt{pagestyle} é€‰é¡¹ã€‚}
% \changes{v2.4.1}{2016/05/10}{æ–°çš„æ&nbsp;‡é¢˜æ&nbsp;¼å¼é€‰é¡¹ \opt{part/fixbeforeskip} å’Œ
%   \opt{chapter/fixbeforeskip}ã€‚}
% \changes{v2.4.3}{2016/06/03}{åˆ&nbsp;é™¤é€‰é¡¹ \opt{part/fixbeforeskip} å’Œ
%   \opt{chapter/fixbeforeskip}ã€‚}
% \changes{v2.4.5}{2016/10/01}{æ–°çš„æ&nbsp;‡é¢˜æ&nbsp;¼å¼é€‰é¡¹ \opt{chapter/lofskip} å’Œ
%   \opt{chapter/lotskip}ã€‚}
%
% \begin{macro}{part/pagestyle,chapter/pagestyle,chapter/lofskip,chapter/lotskip}
% åªåœ¨ \cls{ctexbook} å’Œ \cls{ctexrep} ä¸‹æœ‰å®šä¹‰ã€‚
%    \begin{macrocode}
\group_begin:
%&lt;*book|report&gt;
\tl_set:Nn \l_@@_tmp_tl
  {
    part    / pagestyle .tl_set:N = \CTEX@part@pagestyle ,
    chapter / pagestyle .tl_set:N = \CTEX@chapter@pagestyle ,
    chapter / lofskip   .tl_set:N = \CTEX@chapter@lofskip ,
    chapter / lotskip   .tl_set:N = \CTEX@chapter@lotskip ,
    chapter / lofskip  .initial:n = \c_zero_skip ,
    chapter / lotskip  .initial:n = \c_zero_skip ,
    chapter / lofskip  .value_required:n = true ,
    chapter / lotskip  .value_required:n = true ,
  }
%&lt;/book|report&gt;
%&lt;*article|beamer&gt;
\tl_clear:N \l_@@_tmp_tl
%&lt;/article|beamer&gt;
%    \end{macrocode}
% \end{macro}
%
% å®šä¹‰æ&nbsp;‡é¢˜é”®å€¼é€‰é¡¹ã€‚
%    \begin{macrocode}
\seq_map_inline:Nn \c_@@_headings_seq
  {
    \@@_initial_heading:n {#1}
    \@@_def_heading_keys:n {#1}
  }
\exp_args:NNo \group_end: \ctex_define:n { \l_@@_tmp_tl }
%    \end{macrocode}
%
% \changes{v2.5}{2020/04/23}{é‡æž„æ&nbsp;‡é¢˜é€‰é¡¹ \opt{indent} å’Œ \opt{hang}ã€‚}
%
% \begin{macro}[int]{\CTEX@heading@format@initial}
% æ&nbsp;‡é¢˜æ&nbsp;¼å¼çš„ä¸€äº›åˆå§‹è®¾ç½®ï¼ŒåŒ…æ‹¬æ¢å¤é»˜è®¤å­—ä½“ï¼Œå¹¶ç¦ç”¨è‡ªåŠ¨è°ƒæ•´é¦–è¡Œç¼©è¿›ï¼Œç¦æ­¢åœ¨æ&nbsp;‡é¢˜ä¸­åˆ†é¡µã€‚
% åŒæ—¶ç”¨ \tn{noindent} æŠ‘åˆ¶é¦–è¡Œç¼©è¿›å¹¶è¿›å…¥æ°´å¹³æ¨¡å¼ã€‚
% ç»Ÿä¸€åœ¨å„çº§æ&nbsp;‡é¢˜çš„ \opt{format} é€‰é¡¹ä¹‹å‰ä½¿ç”¨ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@heading@format@initial
  {
    \normalfont
    \tl_clear:N \l_@@_autoindent_tl
    \int_set:Nn \tex_interlinepenalty:D { 10 000 }
    \tex_noindent:D
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_indent_box:n}
% è®¾ç½® \tn{parindent}ï¼Œå¹¶æ’å…¥ç”¨äºŽäº§ç”Ÿç¼©è¿›çš„ç›’å­ï¼Œå¦‚æžœç¼©è¿›ä¸º |0|ï¼Œå°±ä¸æ’å…¥ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_indent_box:n #1
  {
    \dim_set:Nn \tex_parindent:D {#1}
    \@@_insert_indent:
  }
\cs_new_protected:Npn \@@_insert_indent:
  {
    \dim_compare:nNnF \tex_parindent:D = \c_zero_dim
      { \tex_indent:D }
  }
\cs_new_eq:NN \CTEX@indentbox \ctex_indent_box:n
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{æ&nbsp;‡å‡†æ&nbsp;‡é¢˜å‘½ä»¤çš„ä¿®æ”¹}
%
%    \begin{macrocode}
%&lt;*article|book|report&gt;
%    \end{macrocode}
%
% \begin{macro}[int]{\CTEX@fixtopskip}
% ä¿®æ­£ \cls{book} å’Œ \cls{report} ç±»çš„ \tn{part} å’Œ \tn{chapter} æ&nbsp;‡é¢˜ä¹‹å‰çš„å¤šä½™ç©ºè¡Œã€‚
%    \begin{macrocode}
%&lt;*book|report&gt;
\cs_new_protected:Npn \CTEX@fixtopskip
  {
    \CTEX@fixheadingskip
    \dim_compare:nNnF \tex_pagegoal:D &lt; \c_max_dim
      { \skip_sub:Nn \l_@@_heading_skip { \tex_topskip:D } }
  }
%&lt;/book|report&gt;
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\CTEX@fixheadingskip}
% æŠ‘åˆ¶è¡Œé—´ç²˜è¿žï¼Œä¿®æ­£æ&nbsp;‡é¢˜å‰åŽçš„å¤šä½™é—´è·ã€‚äº‹å®žä¸Šï¼Œå‡æŽ‰ \tn{parskip}ï¼Œæœ‰ä¸€å®šçš„é£Žé™©ã€‚
% å¦‚æžœæŽ¥ä¸‹æ¥çš„å†…å®¹ä¸ä¼šè¿›å…¥æ°´å¹³æ¨¡å¼ï¼ˆä¾‹å¦‚åœ¨ \opt{format} é€‰é¡¹ä¸­ä½¿ç”¨ \tn{hrule} æˆ–è€… \tn{hbox}ï¼‰ï¼Œ
% \TeX{} å°±ä¸ä¼šåŠ&nbsp;ä¸Š \tn{parskip}ã€‚è¿™æ—¶å€™å°±éœ€è¦ç”¨æˆ·æŠŠ \tn{parskip} åŠ&nbsp;åˆ° \opt{beforeskip}
% æˆ–è€… \opt{afterskip} ä½œä¸ºä¿®æ­£ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@fixheadingskip
  {
    \par
    \dim_set:Nn \tex_prevdepth:D { -1000pt }
    \skip_sub:Nn \l_@@_heading_skip { \tex_parskip:D }
  }
\skip_new:N \l_@@_heading_skip
\cs_new_protected:Npn \CTEX@setheadingskip
  { \skip_set:Nn \l_@@_heading_skip }
\cs_new_eq:NN \CTEX@headingskip \l_@@_heading_skip
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5.10}{2022/06/23}{å±•å¼€ä¼&nbsp;é€’ \opt{pagestyle} çš„å€¼ã€‚}
%
% \begin{macro}[int]{\CTEX@setthispagestyle}
% å°† \verb"\CTEX@(part|chapter)@pagestyle" å±•å¼€åŽå†ä¼&nbsp;ç»™ \tn{thispagestyle}ã€‚
%    \begin{macrocode}
%&lt;*book|report&gt;
\cs_new_protected:Npn \CTEX@setthispagestyle #1
  { \exp_args:Ne \thispagestyle { \use:c { CTEX@#1@pagestyle } } }
%&lt;/book|report&gt;
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.4.4}{2016/09/18}{æä¾› \tn{partmark}ã€‚}
% \begin{macro}[int]{\partmark}
% æä¾› \tn{partmark}ã€‚
%    \begin{macrocode}
\ProvideDocumentCommand \partmark { m }
  { \markboth { } { } }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.4.4}{2016/09/19}{æä¾› \tn{CTEXifname}ã€‚}
% \changes{v2.4.6}{2016/10/31}{\tn{CTEXifname} åˆå§‹ä¸ºå‡ã€‚}
% \begin{macro}{\CTEXifname}
% \begin{macro}[int]{\CTEX@ifnametrue,\CTEX@ifnamefalse}
% ç”¨äºŽåˆ¤æ–­å½“å‰æ&nbsp;‡é¢˜æ˜¯å¦æœ‰ç¼–å·ã€‚
%    \begin{macrocode}
\cs_new_eq:NN \CTEXifname \use_ii:nn
\cs_new_protected:Npn \CTEX@ifnametrue
  { \cs_set_eq:NN \CTEXifname \use_i:nn }
\cs_new_protected:Npn \CTEX@ifnamefalse
  { \cs_set_eq:NN \CTEXifname \use_ii:nn }
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}[int]{\CTEX@addloflotskip}
% å¾€æ’å›¾å’Œè¡¨æ&nbsp;¼ç›®å½•ä¸­åŠ&nbsp;å…¥é¢å¤–é—´è·ã€‚å¦‚æžœé—´è·ä¸ºé›¶ï¼Œåˆ™ä¸åŠ&nbsp;å…¥ã€‚
%    \begin{macrocode}
%&lt;*book|report&gt;
\cs_new_protected:Npn \CTEX@addloflotskip #1
  {
    \skip_set:Nn \l_@@_heading_skip { \use:c { CTEX@#1@lofskip } }
    \skip_if_eq:nnF { \l_@@_heading_skip } { \c_zero_skip }
      {
        \addtocontents { lof }
          { \protect \addvspace { \skip_use:N \l_@@_heading_skip } }
      }
    \skip_set:Nn \l_@@_heading_skip { \use:c { CTEX@#1@lotskip } }
    \skip_if_eq:nnF { \l_@@_heading_skip } { \c_zero_skip }
      {
        \addtocontents { lot }
          { \protect \addvspace { \skip_use:N \l_@@_heading_skip } }
      }
  }
%&lt;/book|report&gt;
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\CTEX@addtocline}
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@addtocline #1#2
  { \addcontentsline { toc } {#1} { \use:c { CTEX@#1@tocline } {#1} {#2} } }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2}{2015/06/27}{\opt{beforeskip}ã€\opt{afterskip} å’Œ \opt{indent}
%   é€‰é¡¹æ”¯æŒè¡¨è¾¾å¼ã€‚}
% \changes{v2.4.15}{2019/03/31}{ä¿®æ­£ \opt{part/indent} å’Œ \opt{chapter/indent} çš„å®žçŽ°æ–¹æ³•ã€‚}
% \changes{v2.4.15}{2019/03/31}{å®šä¹‰ \opt{part/hang} å’Œ \opt{chapter/hang}ã€‚}
% \changes{v2.4.16}{2019/05/11}{ä¿®æ­£ \opt{part/indent} å’Œ \opt{chapter/indent}
%   çš„å®žçŽ°æ–¹æ³•ï¼Œåœ¨å…¶æ&nbsp;‡é¢˜å†…éƒ¨ç¦ç”¨ \opt{autoindent}ã€‚}
%
% \changes{v2.5}{2020/04/22}{æ&nbsp;‡é¢˜é€‰é¡¹ \opt{format} ä¹Ÿå¯ä»¥æŽ¥å—å‚æ•°ã€‚}
%
% \paragraph{part çš„æ&nbsp;‡é¢˜}
%
% \changes{v2.2}{2015/06/27}{éž \cls{ctexart} ç±»çš„ \opt{part/beforeskip} å’Œ
%   \opt{part/afterskip} é€‰é¡¹æœ‰æ„ä¹‰ã€‚}
%
% \begin{macro}[int]{\part}
%    \begin{macrocode}
%&lt;*article&gt;
\renewcommand\part{%
  \if@noskipsec \leavevmode \fi
  \par
  \CTEX@part@break
% \addvspace{4ex}%
  \CTEX@setheadingskip \CTEX@part@beforeskip
  \ifodd \CTEX@part@fixskip \CTEX@fixheadingskip \fi
  \addvspace \CTEX@headingskip
  \ifodd \CTEX@part@afterindent
   \@afterindenttrue
  \else
   \@afterindentfalse
  \fi
  \secdef\@part\@spart}
%&lt;/article&gt;
%&lt;*book|report&gt;
\renewcommand\part{%
% \if@openright
%   \cleardoublepage
% \else
%   \clearpage
% \fi
  \CTEX@part@break
% \thispagestyle{plain}%
  \CTEX@setthispagestyle{part}%
  \if@twocolumn
    \onecolumn
    \@tempswatrue
  \else
    \@tempswafalse
  \fi
% \null\vfil
  \CTEX@setheadingskip \CTEX@part@beforeskip
  \ifodd \CTEX@part@fixskip \CTEX@fixtopskip \fi
  \vspace*{\CTEX@headingskip}%
  \secdef\@part\@spart}
%&lt;/book|report&gt;
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@part}
%    \begin{macrocode}
%&lt;*article&gt;
\def\@part[#1]#2{%
  \ifnum \c@secnumdepth &gt;\m@ne
    \ifodd \CTEX@part@numbering
      \CTEX@ifnametrue
      \refstepcounter{part}%
%     \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \CTEX@ifnamefalse
      \CTEX@makeanchor{part*}%
%     \addcontentsline{toc}{part}{#1}%
    \fi
  \else
    \CTEX@ifnamefalse
    \CTEX@makeanchor{part*}%
%   \addcontentsline{toc}{part}{#1}%
  \fi
  \CTEX@gettitle{#1}%
  \CTEX@addtocline{part}{#1}%
  \partmark{#1}%
  \begingroup
%   \parindent \z@ \raggedright \interlinepenalty \@M \normalfont
    \CTEX@heading@format@initial
    \CTEX@part@format{%
%   \ifnum \c@secnumdepth &gt;\m@ne
%     \Large\bfseries\partname\nobreakspace\thepart\par\nobreak
%   \fi
      \CTEX@headinghang{part}%
        {\CTEXifname{\CTEX@partname\CTEX@part@aftername}{}}%
%   \huge\bfseries #2%
        \CTEX@part@titleformat{#2}%
%   \markboth{}{}\par
        \CTEX@part@aftertitle}\par
  \endgroup
  \nobreak
% \vskip 3ex
  \CTEX@setheadingskip \CTEX@part@afterskip
  \ifodd \CTEX@part@fixskip \CTEX@fixheadingskip \fi
  \vskip \CTEX@headingskip
  \@afterheading}
%&lt;/article&gt;
%&lt;*book|report&gt;
\def\@part[#1]#2{%
  \ifnum \c@secnumdepth &gt;-2\relax
    \ifodd \CTEX@part@numbering
      \CTEX@ifnametrue
      \refstepcounter{part}%
%     \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \CTEX@ifnamefalse
      \CTEX@makeanchor{part*}%
%     \addcontentsline{toc}{part}{#1}%
    \fi
  \else
    \CTEX@ifnamefalse
    \CTEX@makeanchor{part*}%
%   \addcontentsline{toc}{part}{#1}%
  \fi
  \CTEX@gettitle{#1}%
  \CTEX@addtocline{part}{#1}%
%  \markboth{}{}%
  \partmark{#1}%
  \begingroup
%   \centering \interlinepenalty \@M \normalfont
    \CTEX@heading@format@initial
    \CTEX@part@format{%
%   \ifnum \c@secnumdepth &gt;-2\relax
%     \huge\bfseries\partname\nobreakspace\thepart\par\vskip 20\p@
%   \fi
      \CTEX@headinghang{part}%
        {\CTEXifname{\CTEX@partname\CTEX@part@aftername}{}}%
%   \Huge\bfseries #2\par
      \CTEX@part@titleformat{#2}%
      \CTEX@part@aftertitle}\par
  \endgroup
  \@endpart}
%&lt;/book|report&gt;
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@spart}
%    \begin{macrocode}
%&lt;*article&gt;
\def\@spart#1{%
  \CTEX@ifnamefalse
  \CTEX@makeanchor@spart{part*}%
  \CTEX@gettitle{#1}%
  \begingroup
%   \parindent \z@ \raggedright \interlinepenalty \@M \normalfont
    \CTEX@heading@format@initial
    \CTEX@part@format{%
      \CTEX@headinghang{part}{}%
%   \huge \bfseries #1\par
      \CTEX@part@titleformat{#1}%
      \CTEX@part@aftertitle}\par
  \endgroup
  \nobreak
% \vskip 3ex
  \CTEX@setheadingskip \CTEX@part@afterskip
  \ifodd \CTEX@part@fixskip \CTEX@fixheadingskip \fi
  \vskip \CTEX@headingskip
  \@afterheading}
%&lt;/article&gt;
%&lt;*book|report&gt;
\def\@spart#1{%
  \CTEX@ifnamefalse
  \CTEX@makeanchor@spart{part*}%
  \CTEX@gettitle{#1}%
  \begingroup
%   \centering \interlinepenalty \@M \normalfont
    \CTEX@heading@format@initial
    \CTEX@part@format{%
      \CTEX@headinghang{part}{}%
%    \Huge \bfseries #1\par%
      \CTEX@part@titleformat{#1}%
      \CTEX@part@aftertitle}\par
  \endgroup
  \@endpart}
%&lt;/book|report&gt;
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@endpart}
%    \begin{macrocode}
%&lt;*book|report&gt;
\def\@endpart{%
% \vfil
  \CTEX@setheadingskip \CTEX@part@afterskip
  \ifodd \CTEX@part@fixskip \CTEX@fixheadingskip \fi
  \vskip \CTEX@headingskip
  \newpage
  \if@twoside
    \if@openright
      \null
      \thispagestyle{empty}%
      \newpage
    \fi
  \fi
  \if@tempswa
    \twocolumn
  \fi}
%&lt;/book|report&gt;
%    \end{macrocode}
% \end{macro}
%
% \paragraph{chapter çš„æ&nbsp;‡é¢˜}
%
%    \begin{macrocode}
%&lt;*book|report&gt;
%    \end{macrocode}
%
% \begin{macro}[int]{\chapter}
%    \begin{macrocode}
\renewcommand\chapter{%
% \if@openright\cleardoublepage\else\clearpage\fi
% \thispagestyle{plain}%
  \CTEX@chapter@break
  \CTEX@setthispagestyle{chapter}%
  \global\@topnum\z@
% \@afterindentfalse
  \ifodd \CTEX@chapter@afterindent
    \@afterindenttrue
  \else
    \@afterindentfalse
  \fi
  \secdef\@chapter\@schapter}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@chapter}
%    \begin{macrocode}
\def\@chapter[#1]#2{%
  \ifnum \c@secnumdepth &gt;\m@ne
%&lt;*book&gt;
    \if@mainmatter
%&lt;/book&gt;
      \ifodd \CTEX@chapter@numbering
        \CTEX@ifnametrue
        \refstepcounter{chapter}%
%       \typeout{\@chapapp\space\thechapter.}%
        \typeout{\CTEXthechapter}%
%       \addcontentsline{toc}{chapter}
%         {\protect\numberline{\thechapter}#1}%
      \else
        \CTEX@ifnamefalse
        \CTEX@makeanchor{\Hy@chapapp*}%
%       \addcontentsline{toc}{chapter}{#1}%
      \fi
%&lt;*book&gt;
    \else
      \CTEX@ifnamefalse
      \CTEX@makeanchor@chapter{\Hy@chapapp*}%
%     \addcontentsline{toc}{chapter}{#1}%
    \fi
%&lt;/book&gt;
  \else
    \CTEX@ifnamefalse
    \CTEX@makeanchor@chapter{\Hy@chapapp*}%
%   \addcontentsline{toc}{chapter}{#1}%
  \fi
  \CTEX@gettitle{#1}%
  \CTEX@addtocline{chapter}{#1}%
  \chaptermark{#1}%
% \addtocontents{lof}{\protect\addvspace{10\p@}}%
% \addtocontents{lot}{\protect\addvspace{10\p@}}%
  \CTEX@addloflotskip{chapter}%
  \if@twocolumn
    \@topnewpage[\@makechapterhead{#2}]%
  \else
    \@makechapterhead{#2}%
  \@afterheading
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@schapter}
%    \begin{macrocode}
\def\@schapter#1{%
  \CTEX@ifnamefalse
  \CTEX@makeanchor@schapter{\Hy@chapapp*}%
  \CTEX@gettitle{#1}%
  \if@twocolumn
    \@topnewpage[\@makeschapterhead{#1}]%
  \else
    \@makeschapterhead{#1}%
    \@afterheading
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@makechapterhead}
%    \begin{macrocode}
\def\@makechapterhead#1{%
% \vspace*{50\p@}%
  \CTEX@setheadingskip \CTEX@chapter@beforeskip
  \ifodd \CTEX@chapter@fixskip \CTEX@fixtopskip \fi
  \vspace*{\CTEX@headingskip}%
  \begingroup
%   \parindent \z@ \raggedright \normalfont
    \CTEX@heading@format@initial
    \CTEX@chapter@format{%
%   \ifnum \c@secnumdepth &gt;\m@ne
%     \if@mainmatter
%       \huge\bfseries\@chapapp\space\thechapter\par\nobreak\vskip 20\p@
%     \fi
%   \fi
      \CTEX@headinghang{chapter}%
        {\CTEXifname{\CTEX@chaptername\CTEX@chapter@aftername}{}}%
%   \Huge \bfseries #1\par\nobreak
      \CTEX@chapter@titleformat{#1}%
      \CTEX@chapter@aftertitle}\par
  \endgroup
  \nobreak
%  \vskip 40\p@
  \CTEX@setheadingskip \CTEX@chapter@afterskip
  \ifodd \CTEX@chapter@fixskip \CTEX@fixheadingskip \fi
  \vskip \CTEX@headingskip}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@makeschapterhead}
%    \begin{macrocode}
\def\@makeschapterhead#1{%
% \vspace*{50\p@}%
  \CTEX@setheadingskip \CTEX@chapter@beforeskip
  \ifodd \CTEX@chapter@fixskip \CTEX@fixtopskip \fi
  \vspace*{\CTEX@headingskip}%
  \begingroup
% \parindent \z@ \raggedright \normalfont \interlinepenalty\@M
    \CTEX@heading@format@initial
    \CTEX@chapter@format{%
      \CTEX@headinghang{chapter}{}%
%     \Huge \bfseries  #1\par\nobreak
      \CTEX@chapter@titleformat{#1}%
      \CTEX@chapter@aftertitle}\par
  \endgroup
  \nobreak
% \vskip 40\p@
  \CTEX@setheadingskip \CTEX@chapter@afterskip
  \ifodd \CTEX@chapter@fixskip \CTEX@fixheadingskip \fi
  \vskip \CTEX@headingskip}
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/book|report&gt;
%    \end{macrocode}
%
% \paragraph{section ç±»çš„æ&nbsp;‡é¢˜}
%
% \begin{macro}[int]{\@startsection}
% \LaTeX çš„æ&nbsp;‡å‡†å‚æ•°æ˜¯ï¼š
% \begin{quote}\small
%   \Arg{name}\Arg{level}\Arg{indent}\Arg{beforeskip}\Arg{afterskip}^^A
%   \Arg{style}|*|\oarg{altheading}\Arg{heading}
% \end{quote}
%    \begin{macrocode}
\def\@startsection#1#2#3#4#5#6{%
  \if@noskipsec \leavevmode \fi
  \par
% \@tempskipa #4\relax
% \@afterindenttrue
% \ifdim \@tempskipa &lt;\z@
%   \@tempskipa -\@tempskipa \@afterindentfalse
% \fi
  \CTEX@update@sectionformat@n{#1}%
  \ifodd \CTEX@afterindent
    \@afterindenttrue
  \else
    \@afterindentfalse
  \fi
  \if@nobreak
    \everypar{}%
  \else
%   \addpenalty\@secpenalty\addvspace\@tempskipa
    \csname CTEX@#1@break\endcsname
    \CTEX@setheadingskip{#4}%
    \ifodd \CTEX@fixskip \CTEX@fixheadingskip \fi
    \addvspace \CTEX@headingskip
  \fi
  \@ifstar
    {\CTEX@makeanchor@ssect{#1*}\@ssect{#3}{#4}{#5}{#6}}%
    {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@seccntformat}
%    \begin{macrocode}
\def\@seccntformat#1{%
% \csname the#1\endcsname\quad}%
  \csname CTEX@#1name\endcsname
  \csname CTEX@#1@aftername\endcsname}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@sect}
%    \begin{macrocode}
\def\@sect#1#2#3#4#5#6[#7]#8{%
  \ifnum #2&gt;\c@secnumdepth
    \CTEX@ifnamefalse
    \CTEX@makeanchor@sect{#1*}%
    \let\@svsec\@empty
  \else
    \ifodd \csname CTEX@#1@numbering\endcsname
      \CTEX@ifnametrue
      \refstepcounter{#1}%
      \protected@edef\@svsec{\@seccntformat{#1}\relax}%
    \else
      \CTEX@ifnamefalse
      \CTEX@makeanchor{#1*}%
      \let\@svsec\@empty
    \fi
  \fi
  \CTEX@gettitle{#7}%
% \@tempskipa #5\relax
% \ifdim \@tempskipa&gt;\z@
  \unless \ifodd \CTEX@runin
    \begingroup
      \CTEX@heading@format@initial
      #6{%
%       \@hangfrom{\hskip #3\relax\@svsec}%
%       \interlinepenalty \@M #8\@@@@par
        \CTEX@sectionhang{#3}{\@svsec}%
        \csname CTEX@#1@titleformat\endcsname{#8}%
        \csname CTEX@#1@aftertitle\endcsname}\par
    \endgroup
    \csname #1mark\endcsname{#7}%
%   \addcontentsline{toc}{#1}{%
%     \ifnum #2&gt;\c@secnumdepth \else
%       \protect\numberline{\csname the#1\endcsname}%
%     \fi
%     #7}%
    \CTEX@addtocline{#1}{#7}%
  \else
    \def\@svsechd{%
      #6{%
%       \hskip #3\relax \@svsec #8
        {\CTEX@indentbox{#3}}\@svsec
        \csname CTEX@#1@titleformat\endcsname{#8}%
        \csname CTEX@#1@aftertitle\endcsname}%
      \csname #1mark\endcsname{#7}%
%     \addcontentsline{toc}{#1}{%
%       \ifnum #2&gt;\c@secnumdepth \else
%         \protect\numberline{\csname the#1\endcsname}%
%       \fi
%       #7}%
      \CTEX@addtocline{#1}{#7}}%
  \fi
  \@xsect{#5}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@ssect}
%    \begin{macrocode}
\def\@ssect#1#2#3#4#5{%
  \CTEX@ifnamefalse
  \CTEX@gettitle{#5}%
% \@tempskipa #3\relax
% \ifdim \@tempskipa&gt;\z@
  \unless \ifodd \CTEX@runin
    \begingroup
      \CTEX@heading@format@initial
      #4{%
%       \@hangfrom{\hskip #1}%
%       \interlinepenalty \@M #5\@@par
        \CTEX@sectionhang{#1}{}%
          \CTEX@titleformat@n{#5}%
          \CTEX@aftertitle}\par
    \endgroup
  \else
%   \def\@svsechd{#4{\hskip #1\relax #5}}%
    \def\@svsechd{#4{{\CTEX@indentbox{#1}}%
      \CTEX@titleformat@n{#5}\CTEX@aftertitle}}%
  \fi
  \@xsect{#3}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@xsect}
%    \begin{macrocode}
\def\@xsect#1{%
% \@tempskipa #1\relax
% \ifdim \@tempskipa&gt;\z@
  \unless \ifodd \CTEX@runin
    \par \nobreak
%   \vskip \@tempskipa
    \CTEX@setheadingskip{#1}%
    \ifodd \CTEX@fixskip \CTEX@fixheadingskip \fi
    \vskip \CTEX@headingskip
    \@afterheading
  \else
    \@nobreakfalse
    \global\@noskipsectrue
    \everypar{%
      \if@noskipsec
        \global\@noskipsecfalse
       {\setbox\z@\lastbox}%
        \clubpenalty\@M
        \begingroup \@svsechd \endgroup
        \unskip
%       \@tempskipa #1\relax
%       \hskip -\@tempskipa
        \CTEX@heading@glue{#1}%
      \else
        \clubpenalty \@clubpenalty
        \everypar{}%
      \fi}%
  \fi
  \ignorespaces}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\CTEX@headinghang,\CTEX@sectionhang}
% åˆ†åˆ«ç”¨äºŽç”¨äºŽå®žçŽ° \tn{part}/\tn{chapter} å’Œ \tn{section} ç±»æ&nbsp;‡é¢˜çš„
% \opt{indent} å’Œ \opt{hang} é€‰é¡¹ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@headinghang #1
  {
    \ctex_heading_hang:cnn
      { CTEX@#1@hang }
      { \use:c { CTEX@#1@indent } }
  }
\cs_new_protected:Npn \CTEX@sectionhang
  { \ctex_heading_hang:Nnn \CTEX@hang }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_heading_hang:Nnn,\ctex_hang_from:n}
% \opt{hang} é€‰é¡¹æŽ§åˆ¶æ˜¯å¦é‡‡ç”¨æ‚¬æŒ‚ç¼©è¿›ï¼ŒåŒæ—¶è®¾ç½® \tn{parindent}ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_heading_hang:Nnn #1#2#3
  {
    \dim_set:Nn \tex_parindent:D {#2}
    \bool_if:NTF #1
      { \ctex_hang_from:n }
      { \use:n }
      { \@@_insert_indent: #3 }
  }
\cs_new_protected:Npn \ctex_hang_from:n #1
  {
    \tex_noindent:D
    \hbox_set:Nn \l_@@_tmp_box {#1}
    \tex_hangindent:D = \box_wd:N \l_@@_tmp_box
    \box_use_drop:N \l_@@_tmp_box
  }
\cs_generate_variant:Nn \ctex_heading_hang:Nnn { c }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_heading_glue:n,\CTEX@heading@glue}
% å¦‚æžœç¼©è¿› |#1| é•¿åº¦ä¸ºé›¶ï¼Œå°±ä¸æ’å…¥æ°´å¹³é—´è·ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_heading_glue:n #1
  {
    \group_begin:
      \skip_set:Nn \l_@@_heading_skip {#1}
      \dim_compare:nNnF \l_@@_heading_skip = \c_zero_dim
        { \skip_horizontal:N \l_@@_heading_skip }
    \group_end:
  }
\cs_new_eq:NN \CTEX@heading@glue \ctex_heading_glue:n
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\CTEX@update@sectionformat@n}
% åœ¨ \tn{@startsection} ä¸­è®¾ç½® \tn{CTEX@titleformat@n} ç­‰ä¸ºç›¸åº”å‡½æ•°ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@update@sectionformat@n #1
  {
    \cs_set_eq:Nc \CTEX@titleformat@n { CTEX@#1@titleformat }
    \cs_set_eq:Nc \CTEX@aftertitle    { CTEX@#1@aftertitle }
    \cs_set_eq:Nc \CTEX@afterindent   { CTEX@#1@afterindent }
    \cs_set_eq:Nc \CTEX@fixskip       { CTEX@#1@fixskip }
    \cs_set_eq:Nc \CTEX@hang          { CTEX@#1@hang }
    \cs_set_eq:Nc \CTEX@runin         { CTEX@#1@runin }
  }
\cs_new_eq:NN \CTEX@titleformat@n \use:n
\cs_new_eq:NN \CTEX@aftertitle \prg_do_nothing:
\cs_new_eq:NN \CTEX@afterindent \c_true_bool
\cs_new_eq:NN \CTEX@fixskip \c_false_bool
\cs_new_eq:NN \CTEX@hang \c_true_bool
\cs_new_eq:NN \CTEX@runin \c_false_bool
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\CTEX@part@tocline, \CTEX@chapter@tocline}
%    \begin{macrocode}
\cs_new:Npn \CTEX@part@tocline #1#2
  {
    \CTEXifname
      { \CTEXthepart \hspace { 1em } }
      { }
    #2
  }
%&lt;*book|report&gt;
\cs_new:Npn \CTEX@chapter@tocline #1#2
  {
    \CTEXifname
      { \protect \numberline { \CTEXthechapter \hspace { .3em } } }
      { }
    #2
  }
%&lt;/book|report&gt;
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\CTEXnumberline}
%    \begin{macrocode}
\cs_new:Npn \CTEXnumberline #1
  {
    \CTEXifname
      { \protect \numberline { \use:c { CTEXthe #1 } } }
      { }
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\int_zero:N \l_@@_tmp_int
\seq_map_inline:Nn \c_@@_section_headings_seq
  {
    \int_incr:N \l_@@_tmp_int
    \cs_gset_protected:cpx  {#1}
      {
        \exp_not:N \@startsection {#1}
          { \int_use:N \l_@@_tmp_int }
          { \exp_not:c { CTEX@#1@indent } }
          { \exp_not:c { CTEX@#1@beforeskip } }
          { \exp_not:c { CTEX@#1@afterskip } }
          { \exp_not:N \normalfont \exp_not:c { CTEX@#1@format } }
      }
    \cs_new:cpn { CTEX@#1@tocline } ##1##2
      { \CTEXnumberline { ##1 } ##2 }
  }
%    \end{macrocode}
%
% \paragraph{é™„å½•æ&nbsp;‡é¢˜}
%
% \begin{macro}[int]{appendix/name,appendix/number,appendix/numbering}
%    \begin{macrocode}
\ctex_define:n
  {
    appendix                .meta:nn = { ctex / appendix } {#1} ,
    appendix / name          .code:n =
      { \ctex_assign_heading_name:nn { appendix } {#1} } ,
    appendix / number      .tl_set:N = \CTEX@appendix@number ,
    appendix / numbering .bool_set:N = \CTEX@appendix@numbering ,
    appendix / numbering  .initial:n = true
  }
\tl_new:N \CTEX@preappendix
\tl_new:N \CTEX@postappendix
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\appendix}
%    \begin{macrocode}
\cs_new_eq:NN \CTEX@save@appendix \appendix
\cs_gset_protected:Npn \appendix
  {
    \CTEX@save@appendix
%&lt;*article&gt;
    \gdef \CTEX@presection { \CTEX@preappendix }
    \gdef \CTEX@thesection { \CTEX@appendix@number }
    \gdef \CTEX@postsection { \CTEX@postappendix }
    \gdef \CTEX@section@numbering { \CTEX@appendix@numbering }
%&lt;/article&gt;
%&lt;*book|report&gt;
    \gdef \CTEX@prechapter { \CTEX@preappendix }
    \gdef \CTEX@thechapter { \CTEX@appendix@number }
    \gdef \CTEX@postchapter { \CTEX@postappendix }
    \gdef \CTEX@chapter@numbering { \CTEX@appendix@numbering }
%&lt;/book|report&gt;
  }
%    \end{macrocode}
% \end{macro}
%
% \paragraph{è®¾ç½® \pkg{hyperref} å®åŒ…çš„æ&nbsp;‡é¢˜é”šç‚¹}
%
% \changes{v2.4.4}{2016/09/12}{æ”¹è¿› \pkg{hyperref} å®åŒ…çš„æ&nbsp;‡é¢˜é”šç‚¹è®¾ç½®ã€‚}
%
% \begin{macro}[int]{\CTEX@makeanchor}
% è®¾ç½®è¶…é“¾æŽ¥è·³è½¬é”šç‚¹ï¼Œåœ¨ \pkg{hyperref} è½½å…¥åŽæ‰æœ‰æ„ä¹‰ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@makeanchor #1
  { }
%    \end{macrocode}
% \end{macro}
%
% \begin{variable}{\c_@@_headings_cs_seq}
% ä¿å­˜å†…éƒ¨æ&nbsp;‡é¢˜å‘½ä»¤çš„ \CTeX{} å®šä¹‰ï¼Œç”¨äºŽéšåŽæ¯”è¾ƒã€‚
%    \begin{macrocode}
\seq_const_from_clist:Nn \c_@@_headings_cs_seq
%&lt;article&gt;  { part , spart , sect , ssect }
%&lt;book|report&gt;  { part , spart , chapter , schapter , sect , ssect }
\seq_map_inline:Nn \c_@@_headings_cs_seq
  {
    \cs_new_eq:cc { CTEX@ #1 } { @ #1 }
    \cs_new_eq:cN { CTEX@makeanchor@ #1 } \CTEX@makeanchor
  }
%    \end{macrocode}
% \end{variable}
%
% \begin{macro}[int]{\CTEX@hyperheadinghook}
% \pkg{hyperref} ä¼šé‡å®šä¹‰å†…éƒ¨æ&nbsp;‡é¢˜å‘½ä»¤ï¼Œç›®çš„åœ¨äºŽä¸ºæ²¡æœ‰ç¼–å·çš„æ&nbsp;‡é¢˜è®¾ç½®é”šç‚¹ï¼ˆè¿™ä¸€åŠŸèƒ½å—ä»–çš„
% \opt{implicit} é€‰é¡¹çš„æŽ§åˆ¶ï¼‰ã€‚æˆ‘ä»¬åœ¨ä¸Šé¢å¯¹æ&nbsp;‡é¢˜å‘½ä»¤çš„ä¿®æ”¹å·²ç»åŒ…å«è¿™ä¸€åŠŸèƒ½ï¼Œå¦‚æžœè¿™äº›æ&nbsp;‡é¢˜å‘½ä»¤åœ¨
% \pkg{hyperref} è½½å…¥ä¹‹å‰æ²¡æœ‰è¢«ä¿®æ”¹è¿‡ï¼Œåˆ™æ¢å¤ \CTeX{} çš„å®šä¹‰ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@hyperheadinghook
  {
    \group_begin:
      \legacy_if:nTF { Hy@implicit }
        {
          \cs_set_eq:NN \H@old@chapter \Hy@org@chapter
          \seq_map_inline:Nn \c_@@_headings_cs_seq
            {
              \cs_if_eq:ccT { H@old@ ##1 } { CTEX@ ##1 }
                {
                  \cs_gset_eq:cc { @ ##1 } { CTEX@ ##1 }
                  \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor
                }
            }
        }
        {
          \seq_map_inline:Nn \c_@@_headings_cs_seq
            { \cs_gset_eq:cN { CTEX@makeanchor@ ##1 } \CTEX@makeanchor }
        }
    \group_end:
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\ctex_at_end_package:nn { hyperref }
  {
    \cs_gset_protected:Npn \CTEX@makeanchor #1
      {
        \Hy@MakeCurrentHrefAuto {#1}
        \Hy@raisedlink
          {
            \hyper@anchorstart { \@currentHref }
            \hyper@anchorend
          }
      }
    \CTEX@hyperheadinghook
  }
%    \end{macrocode}
%
% \paragraph{å…¼å®¹ \pkg{nameref} å®åŒ…}
%
% \changes{v2.4.16}{2019/05/29}{æ›´å¥½åœ°å…¼å®¹ \pkg{nameref} å®åŒ…ã€‚}
%
% \begin{macro}[int]{\CTEX@gettitle}
% åœ¨ \pkg{nameref} è½½å…¥åŽæ‰æœ‰æ„ä¹‰ï¼Œä¸Žä¸Šè¿° \pkg{hyperref} çš„å¤„ç†ç±»ä¼¼ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@gettitle #1
  { }
\ctex_at_end_package:nn { nameref }
  {
    \cs_gset_protected:Npn \CTEX@gettitle { \NR@gettitle }
    \seq_map_inline:Nn \c_@@_headings_cs_seq
      {
        \cs_if_eq:ccT { NR@ #1 } { CTEX@ #1 }
          { \cs_gset_eq:cc { @ #1 } { CTEX@ #1 } }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \paragraph{å…¼å®¹ \pkg{titlesec} å®åŒ…}
%
% æˆ‘ä»¬ä¿®æ”¹äº† \tn{@startsection} çš„å®šä¹‰ï¼Œå®ƒçš„ç¬¬å››ä¸ªï¼ˆ\meta{beforeskip}ï¼‰å’Œ
% ç¬¬äº”ä¸ªï¼ˆ\meta{afterskip}ï¼‰å‚æ•°çš„ç¬¦å·ä¸å†æœ‰ç‰¹æ®Šæ„ä¹‰ï¼Œæ”¹ç”±ç›¸åº”çš„é€‰é¡¹
% \opt{afterindent} å’Œ \opt{runin} æ¥æŽ§åˆ¶ã€‚
%
% å¼•å…¥ \pkg{titlesec} å®åŒ…ï¼Œå¹¶ä¸”æœªè®¾ç½®å®ƒçš„ \opt{loadonly} é€‰é¡¹æ—¶ï¼Œ\pkg{titlesec}
% ä¼šå±•å¼€ section ç±»æ&nbsp;‡é¢˜èŽ·å–å®ƒä»¬çš„å‚æ•°ï¼Œè¿›è¡Œåˆå§‹è®¾ç½®ã€‚æˆ‘ä»¬éœ€è¦è¿›è¡Œä¸€äº›è°ƒæ•´ã€‚
%
% \begin{macro}[int]{\ctex_titlesec_hook:}
% \tn{titleformat} çš„è®¾ç½®ä¿å­˜åœ¨åä¸º |\ttlf@|\meta{section} çš„å®ä¸­å¤‡ç”¨ï¼Œå®ƒçš„å†…å®¹æ˜¯
% \begin{quote}\small
%   |\ttlh@|\meta{shape}\Arg{format}\Arg{label}\Arg{sep}\Arg{before}\Arg{after}
% \end{quote}
% æˆ‘ä»¬è¿™é‡Œçš„ \meta{shape} ä¸º |hang| æˆ–è€… |runin|ã€‚\tn{titlespacing} çš„è®¾ç½®ä¿å­˜åœ¨
% |\ttls@|\meta{section} ä¹‹ä¸­ï¼Œå®ƒçš„å†…å®¹æ˜¯
% \begin{quote}\small
%   \Arg{left}\Arg{right}\Arg{before}\Arg{after}\Arg{afterindent}
% \end{quote}
% å…¶ä¸­ \meta{afterindent} ä¸º |1| æˆ– |0|ï¼Œåˆ†åˆ«å¯¹åº”æ˜¯å¦ä¿ç•™æ®µé¦–ç¼©è¿›ã€‚
% æˆ‘ä»¬éœ€è¦æ&nbsp;¹æ® \CTeX{} çš„ \opt{runin} å’Œ \opt{afterindent} é€‰é¡¹è°ƒæ•´
% |\ttlh@|\meta{shape} å’Œ \meta{afterindent}ã€‚æ³¨æ„ï¼Œç”± \tn{ttl@extract} å¾—çš„
% \meta{before} å’Œ \meta{after} çš„å€¼æ€»æ˜¯éžè´Ÿçš„ï¼Œè€Œ \CTeX{} çš„ \opt{beforeskip}
% å’Œ \opt{afterskip} æ˜¯å¯ä»¥å–è´Ÿå€¼çš„ï¼Œä½†æˆ‘ä»¬ä¸æ‰“ç®—è°ƒæ•´å®ƒä»¬äº†ã€‚
% å¦‚æžœä½¿ç”¨äº† \pkg{titlesec} çš„ \opt{indentafter} ç­‰é€‰é¡¹ï¼Œä¹Ÿä¸éœ€è¦è°ƒæ•´
% |\ttls@|\meta{section}ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_titlesec_hook:
  {
    \@ifpackagewith { titlesec } { explicit }
      {
        \cs_set_eq:NN \@@_titlesec_format:Nn
                      \@@_titlesec_format_explicit:Nn
      }
      { }
    \clist_map_inline:nn
      { indentafter , noindentafter , indentfirst , nonindentfirst }
      {
        \@ifpackagewith { titlesec } { ##1 }
          {
            \clist_map_break:n
              { \cs_set_eq:NN \@@_titlesec_hook:n \@@_titlesec_format:n }
          }
          { }
      }
    \seq_map_function:NN \c_@@_section_headings_seq \@@_titlesec_hook:n
  }
\cs_new_protected:Npn \@@_titlesec_hook:n #1
  {
    \@@_titlesec_format:n {#1}
    \exp_args:Nc \@@_titlesec_spacing:Nn { ttls@#1 } {#1}
  }
\cs_new_protected:Npn \@@_titlesec_format:n #1
  {
    \cs_if_free:cF { ttlf@#1 }
      { \exp_args:Nc \@@_titlesec_format:Nn { ttlf@#1 } {#1} }
  }
\cs_new_protected:Npn \@@_titlesec_format:Nn #1#2
  {
    \tl_set:Nx #1
      {
        \bool_if:cTF { CTEX@#2@runin }
          { \exp_not:N \ttlh@runin }
          { \exp_not:N \ttlh@hang }
        \tl_tail:N #1
      }
  }
\cs_new_protected:Npn \@@_titlesec_format_explicit:Nn #1#2
  {
    \cs_set_nopar:Npx #1 ##1
      {
        \bool_if:cTF { CTEX@#2@runin }
          { \exp_not:N \ttlh@runin }
          { \exp_not:N \ttlh@hang }
        \exp_args:No \tl_tail:n { #1 { } }
      }
  }
\cs_new_protected:Npn \@@_titlesec_spacing:Nn #1#2
  { \tl_set:Nx #1 { \exp_after:wN \@@_titlesec_spacing:nnnnnn #1 {#2} } }
\cs_new:Npn \@@_titlesec_spacing:nnnnnn #1#2#3#4#5#6
  {
    \exp_not:n { {#1} {#2} {#3} {#4} }
    { \bool_if:cTF { CTEX@#6@afterindent } { \@ne } { \z@ } }
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\@ifpackageloaded { titlesec }
  { }
  {
    \ctex_at_end_package:nn { titlesec }
      {
        \@ifpackagewith { titlesec } { loadonly }
          { }
          { \ctex_titlesec_hook: }
      }
  }
%    \end{macrocode}
%
% \changes{v2.4.4}{2016/09/13}{ä½¿ç”¨ \pkg{titlesec} æ—¶ï¼Œç«&nbsp;èŠ‚ç›®å½•ä¹Ÿä½¿ç”¨ \CTeX{} çš„ç¼–å·ã€‚}
% è®©ç¼–è¯‘æ—¶ç»ˆç«¯æ˜¾ç¤º  \tn{CTEXthechapter}ï¼Œç›®å½•ä½¿ç”¨ |\CTEXtheXXX| ç¼–å·ã€‚
%    \begin{macrocode}
\ctex_at_end_package:nn { titlesec }
  {
%&lt;*book|report&gt;
    \tl_set:Nn \ttl@chapterout { \typeout { \CTEXthechapter } }
%&lt;/book|report&gt;
    \cs_if_free:NF \ttl@tocpart
      {
        \cs_set_protected:Npn \ttl@tocpart
          { \tl_set:Nn \ttl@a { \CTEXthepart \hspace { 1em } } }
      }
    \seq_map_inline:Nn \c_@@_headings_seq
      {
        \cs_if_exist:cF { ttl@toc #1 }
          {
            \cs_new_protected:cpx { ttl@toc #1 }
              {
                \tl_set:Nn \exp_not:N \ttl@a
                  {
                    \exp_not:N \protect
                    \exp_not:N \numberline { \exp_not:c { CTEXthe #1 } }
                  }
              }
          }
      }
  }
%    \end{macrocode}
%
% \changes{v2.5.8}{2021/12/04}{å…¼å®¹ \pkg{titlesec} åŒ…å’Œ \tn{CTEXifname}ã€‚}
% åœ¨ \pkg{titlesec} åŒ…å®šä¹‰çš„æ&nbsp;‡é¢˜ä¸­æ›´æ–° \tn{CTEXifname}ã€‚
%    \begin{macrocode}
\ctex_at_end_package:nn { titlesec }
  {
    \ctex_patch_cmd:Nnn \ttl@labelling
      { \let \ifttl@toclabel \ifttl@label }
      {
        \let \ifttl@toclabel \ifttl@label
        \CTEX@updatettlifname
      }
    \cs_new_protected:Npn \CTEX@updatettlifname
      { \legacy_if:nTF { ttl@label } { \CTEX@ifnametrue } { \CTEX@ifnamefalse } }
  }
%    \end{macrocode}
%
% \paragraph{å…¼å®¹ \pkg{titleps} å®åŒ…}
%
% \changes{v2.3}{2015/12/25}{å…¼å®¹ \pkg{titleps} å®åŒ…ã€‚}
%
% æŒ‰ç…§ \pkg{titleps} å®åŒ…çš„å®žçŽ°æœºåˆ¶ï¼Œ|\CTEXtheXXX| ç­‰å®ç›´åˆ°é¡µçœ‰æŽ’ç‰ˆæ—¶æ‰ä¼šè¢«å±•å¼€ï¼Œ
% è¿™å¯èƒ½ä¼šé€&nbsp;æˆé—®é¢˜\footnote{\url{https://github.com/CTeX-org/ctex-kit/issues/217}}ã€‚
%
% \begin{macro}[int]{\ctex_titleps_hook:}
% æˆ‘ä»¬ä¿®æ”¹ \pkg{titleps} åŒ…çš„å†…éƒ¨å‘½ä»¤ \tn{ttl@settopmark} å’Œ \tn{ttl@setsubmark}ï¼Œ
% å°† |\CTEXtheXXX| ç­‰åŠ&nbsp;å…¥æ›´æ–°é˜Ÿåˆ—ä¸­ã€‚
%    \begin{macrocode}
\group_begin:
\char_set_catcode_other:N \#
\cs_new_protected:Npn \ctex_titleps_hook:
  {
    \ctex_patch_cmd:Nnn \ttl@settopmark
      { \protect \@namedef { the#1 } { \@nameuse { the#1 } } }
      {
        \protect \@namedef { the#1 } { \@nameuse { the#1 } }
        \CTEX@titlepslabel@set {#1}
      }
    \ctex_patch_cmd:Nnn \ttl@setsubmark
      { \protect \@namedef { the#1 } { } }
      {
        \protect \@namedef { the#1 } { }
        \CTEX@titlepslabel@clear {#1}
      }
    \ctex_patch_cmd:Nnn \ttl@setsubmark
      { \protect \@namedef { the#2 } { \@nameuse { the#2 } } }
      {
        \protect \@namedef { the#2 } { \@nameuse { the#2 } }
        \CTEX@titlepslabel@set {#2}
      }
  }
\group_end:
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\CTEX@titlepslabel@set,\CTEX@titlepslabel@clear}
% è¿™ä¸¤ä¸ªå‡½æ•°è¦åœ¨éšåŽè¢« \tn{xdef} å±•å¼€æ¥èŽ·å¾— |\CTEXtheXXX| çš„å†…å®¹ï¼Œä¸åº”è¯¥ç”¨
% \tn{protected} æ¥å®šä¹‰ã€‚
%    \begin{macrocode}
\cs_new:Npn \CTEX@titlepslabel@set #1
  {
    \cs_if_free:cF { CTEXthe#1 }
      { \protect \@namedef { CTEXthe#1 } { \@nameuse { CTEXthe#1 } } }
  }
\cs_new:Npn \CTEX@titlepslabel@clear #1
  {
    \cs_if_free:cF { CTEXthe#1 }
      { \protect \@namedef { CTEXthe#1 } { } }
  }
%    \end{macrocode}
% \end{macro}
%
% \pkg{titleps} å®åŒ…çš„åŠŸèƒ½å¯ä»¥ç”± \pkg{titlesec} çš„é€‰é¡¹ \opt{pagestyles} å¼•å…¥ã€‚
%    \begin{macrocode}
\ctex_at_end_package:nn { titlesec }
  { \cs_if_free:NF \ttl@settopmark { \ctex_titleps_hook: } }
\ctex_at_end_package:nn { titleps } { \ctex_titleps_hook: }
%    \end{macrocode}
%
% é™¤æ­¤ä¹‹å¤–ï¼Œä¹Ÿå¯ä»¥ä½¿ç”¨ \pkg{titleps} æä¾›çš„å‘½ä»¤ \tn{newtitlemark} æ¥å®Œæˆï¼š
% \begin{verbatim}
%   \newtitlemark { \CTEXthechapter }
%   \newtitlemark { \CTEXthesection }
% \end{verbatim}
% ä½† \tn{newtitlemark} ä¸åŒ…å«ç«&nbsp;èŠ‚é—´çš„å±‚æ¬¡ä¿¡æ¯ï¼ŒåŠŸèƒ½ä¸Šä¸åŠä¿®æ”¹å†…éƒ¨å‘½ä»¤å®Œæ•´ã€‚
%
% \changes{v2.4.6}{2016/10/31}{é‡æ–°åˆå§‹åŒ– \tn{ifthechapter} ç­‰ã€‚}
% \begin{macro}[int]{\ttl@setifthe}
% ä½¿ |\iftheXXX| ç­‰å‘½ä»¤åœ¨é¡µçœ‰è®¾ç½®ä¸­å¯ç”¨ã€‚
%    \begin{macrocode}
\ctex_at_end_package:nn { titleps }
  {
    \cs_set_protected:Npn \ttl@setifthe #1
      {
        \exp_args:Nco \cs_set:Npn { ifthe #1 }
          {
            \CTEXifname
              { \protect \@firstoftwo }
              { \protect \@secondoftwo }
          }
      }
    \seq_map_function:NN \c_@@_headings_seq \ttl@setifthe
  }
%    \end{macrocode}
% \end{macro}
%
%
% \subsubsection{ç›®å½•æ&nbsp;‡ç­¾çš„å®½åº¦}
%
% \begin{macro}{\CTEX@toc@width@n}
%   \begin{macrocode}
\cs_new_protected:Npn \CTEX@toc@width@n #1
  {
    \hbox_set:Nn \l_@@_tmp_box {#1}
    \dim_set:Nn \@tempdima
      {
        \dim_max:nn { \@tempdima }
          { \box_wd:N \l_@@_tmp_box + \f@size \p@ / 2 }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5}{2020/01/11}{å…¼å®¹ \pkg{titletoc} å®åŒ…ã€‚}
%
% \begin{macro}{\numberline,\@@_patch_toc_width:n}
% ä¸º \tn{numberline} å‘½ä»¤æ‰“è¡¥ä¸ï¼Œå¹¶å…¼å®¹ \pkg{tocloft} å’Œ \pkg{titletoc} å®åŒ…ã€‚
%
% è¿™é‡Œéœ€è¦æ›¿æ¢ |#| æœ¬èº«ï¼Œå›&nbsp;æ­¤éœ€è¦å…ˆåˆ‡æ¢ä¸º other ç±»ã€‚è¡¨ç¤ºå‚æ•°çš„ |#| ç”¨
% \cs{c_parameter_token} ä»£æ›¿ã€‚
%   \begin{macrocode}
\group_begin:
\char_set_catcode_other:N \#
\use:n
  {
    \group_end:
    \ctex_preto_cmd:NnnTF \numberline { \ExplSyntaxOff }
      { \CTEX@toc@width@n {#1} }
      { }
      { \ctex_patch_failure:N \numberline }
    \cs_new_protected:Npn \@@_patch_toc_width:n \c_parameter_token 1
      {
        \@ifpackageloaded { \c_parameter_token 1 }
          { }
          {
            \ctex_at_end_package:nn { \c_parameter_token 1 }
              {
                \ctex_preto_cmd:NnnTF \numberline
                  { \char_set_catcode_letter:n { 64 } }
                  { \CTEX@toc@width@n {#1} }
                  { }
                  { \ctex_patch_failure:N \numberline }
              }
          }
      }
  }
\@@_patch_toc_width:n { tocloft  }
\@@_patch_toc_width:n { titletoc }
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{é¡µçœ‰ä¿¡æ¯çš„ä¿®æ”¹}
%
% \begin{macro}[int]{\ps@headings}
% \changes{v2.4.5}{2016/10/01}{ä¿®å¤è¡¥ä¸å¤±è´¥ã€‚}
% \changes{v2.4.7}{2016/12/23}{ä¿®å¤ \cls{ctexrep} ç±»çš„ \tn{chaptermark} æ±‰åŒ–é”™è¯¯ã€‚}
% \changes{v2.4.11}{2017/09/13}{è¡¥å……é¡µçœ‰ç©ºæ&nbsp;¼ã€‚}
%    \begin{macrocode}
%&lt;*article&gt;
\legacy_if:nTF { @twoside }
  {
    \ctex_patch_cmd:Nnn \ps@headings
      { \ifnum \c@secnumdepth &gt; \z@ \thesection \quad \fi }
      { \CTEXifname { \CTEXthesection \quad } { } }
    \ctex_patch_cmd:Nnn \ps@headings
      { \ifnum \c@secnumdepth &gt; \@ne \thesubsection \quad \fi }
      { \CTEXifname { \CTEXthesubsection \quad } { } }
  }
%    \end{macrocode}
% ä¸çŸ¥ä¸ºä½•ï¼Œæ&nbsp;‡å‡†æ–‡æ¡£ç±»æ­¤å¤„å¯¹ \texttt{secnumdepth} çš„åˆ¤æ–­ä¸º $0$ï¼Œä¸Ž \tn{section} çš„å±‚æ¬¡ $1$ ä¸ç¬¦ã€‚
%    \begin{macrocode}
  {
    \ctex_patch_cmd:Nnn \ps@headings
      { \ifnum \c@secnumdepth &gt; \m@ne \thesection \quad \fi }
      { \CTEXifname { \CTEXthesection \quad } { } }
  }
%&lt;/article&gt;
%&lt;*book|report&gt;
\ctex_patch_cmd:Nnn \ps@headings
  {
%&lt;book&gt;    \ifnum \c@secnumdepth &gt; \m@ne \if@mainmatter
%&lt;report&gt;    \ifnum \c@secnumdepth &gt; \m@ne
      \@chapapp \ \thechapter . ~ \ %
%&lt;report&gt;    \fi
%&lt;book&gt;    \fi \fi
  }
  { \CTEXifname { \CTEXthechapter \quad } { } }
\legacy_if:nT { @twoside }
  {
    \ctex_patch_cmd:Nnn \ps@headings
      { \ifnum \c@secnumdepth &gt; \z@ \thesection . ~ \ \fi }
      { \CTEXifname { \CTEXthesection \quad } { } }
  }
%&lt;/book|report&gt;
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}[int]{\f@nch@initialise}
% è¿™é‡Œå¯¹ \pkg{fancyhdr} å®åŒ…æ‰“è¡¥ä¸ã€‚åŽŸæ¥ \pkg{fancyhdr} å®åŒ…ä¸­ä½¿ç”¨
% \tn{thesection} ç­‰å®è¡¨ç¤ºé¡µçœ‰ä¸­çš„ç«&nbsp;èŠ‚ç¼–å·ï¼Œè¿™é‡Œæ”¹ç”¨ \pkg{ctex} åŒ…æ‰€ç”¨çš„
% \tn{CTEXthesection} ç³»åˆ—å®ã€‚
% \changes{v2.5.6}{2021/01/11}{æ›´æ–° \pkg{fancyhdr} å®åŒ…çš„è¡¥ä¸ã€‚}
%    \begin{macrocode}
\ctex_at_end_package:nn { fancyhdr }
  {
    \ctex_patch_cmd:Nnn \f@nch@initialise
      { \ifnum \c@secnumdepth &gt; \z@ \thesection \hskip 1em \relax \fi }
      { \CTEXifname { \CTEXthesection \quad } { } }
    \ctex_patch_cmd:Nnn \f@nch@initialise
      { \ifnum \c@secnumdepth &gt; \@ne \thesubsection \hskip 1em \relax \fi }
      { \CTEXifname { \CTEXthesubsection \quad } { } }
    \ctex_patch_cmd:Nnn \f@nch@initialise
      { \ifnum \c@secnumdepth &gt; \m@ne \@chapapp\ \thechapter . ~ \ \fi }
      { \CTEXifname { \CTEXthechapter \quad } { } }
    \ctex_patch_cmd:Nnn \f@nch@initialise
      { \ifnum \c@secnumdepth &gt; \z@ \thesection . ~ \ \fi }
      { \CTEXifname { \CTEXthesection \quad } { } }
    \f@nch@initialise
%    \end{macrocode}
% \pkg{fancyhdr} çš„ \opt{headings} é€‰é¡¹ä¼šé‡å®šä¹‰ \cs{ps@headings}ï¼Œ
% è¿™é‡Œä¹Ÿè¦æ‰“è¡¥ä¸ã€‚
%    \begin{macrocode}
    \@ifpackagewith { fancyhdr } { headings }
      {
%&lt;*article&gt;
        \legacy_if:nTF { @twoside }
          {
            \ctex_patch_cmd:Nnn \ps@headings
              { \ifnum \c@secnumdepth &gt; \z@ \thesection \quad \fi }
              { \CTEXifname { \CTEXthesection \quad } { } }
            \ctex_patch_cmd:Nnn \ps@headings
              { \ifnum \c@secnumdepth &gt; \@ne \thesubsection \quad \fi }
              { \CTEXifname { \CTEXthesubsection \quad } { } }
          }
          {
            \ctex_patch_cmd:Nnn \ps@headings
              { \ifnum \c@secnumdepth &gt; \z@ \thesection \quad \fi }
              { \CTEXifname { \CTEXthesection \quad } { } }
          }
%&lt;/article&gt;
%&lt;*book|report&gt;
        \ctex_patch_cmd:Nnn \ps@headings
          {
%&lt;book&gt;            \ifnum \c@secnumdepth &gt; \m@ne \if@mainmatter
%&lt;report&gt;            \ifnum \c@secnumdepth &gt; \m@ne
              \@chapapp \ \thechapter . ~ \ %
%&lt;report&gt;            \fi
%&lt;book&gt;            \fi \fi
          }
          { \CTEXifname { \CTEXthechapter \quad } { } }
        \legacy_if:nT { @twoside }
          {
            \ctex_patch_cmd:Nnn \ps@headings
              { \ifnum \c@secnumdepth &gt; \z@ \thesection . ~ \ \fi }
              { \CTEXifname { \CTEXthesection \quad } { } }
          }
%&lt;/book|report&gt;
      }
      { }
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/article|book|report&gt;
%    \end{macrocode}
%
% \subsubsection{\cls{beamer} æ&nbsp;‡é¢˜é¡µæ¨¡æ¿çš„ä¿®æ”¹}
%
%    \begin{macrocode}
%&lt;*beamer&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
\ExplSyntaxOff
%    \end{macrocode}
%
% \changes{v2.4.15}{2019/01/29}{å±€éƒ¨æŒ‡å®š \opt{autoindent} ä¸º \opt{false}ï¼Œå¹¶äº¤æ¢
%   \tn{CTEX@XXX@indent} ä¸Ž \tn{CTEX@XXX@format} çš„é¡ºåºã€‚}
%
% å¯¹åº” \tn{partpage}ã€‚
%    \begin{macrocode}
\defbeamertemplate*{part page}{CTEX}[1][]{%
  \begingroup
%    \centering
%    {\usebeamerfont{part name}%
%     \usebeamercolor[fg]{part name}\partname~\insertromanpartnumber}
%    \vskip1em\par
    \par \addvspace{\glueexpr\CTEX@part@beforeskip\relax}%
    \CTEX@heading@format@initial
    \CTEX@part@format{%
      \CTEX@indentbox{\CTEX@part@indent}%
      \ifodd \CTEX@part@numbering
        \CTEX@partname \CTEX@part@aftername
      \fi
      \begin{beamercolorbox}[sep=16pt,center,#1]{part title}
%       \usebeamerfont{part title}\insertpart\par
        \CTEX@part@titleformat \insertpart \CTEX@part@aftertitle
      \end{beamercolorbox}}%
    \par \addvspace{\glueexpr\CTEX@part@afterskip\relax}%
  \endgroup}
%    \end{macrocode}
%
% å¯¹åº” \tn{sectionpage}ã€‚
%    \begin{macrocode}
\defbeamertemplate*{section page}{CTEX}[1][]{%
  \begingroup
%    \centering
%    {\usebeamerfont{section name}%
%     \usebeamercolor[fg]{section name}\sectionname~\insertsectionnumber}
%    \vskip1em\par
    \par \addvspace{\glueexpr\CTEX@section@beforeskip\relax}%
    \CTEX@heading@format@initial
    \CTEX@section@format{%
      \CTEX@indentbox{\CTEX@section@indent}%
      \ifodd \CTEX@section@numbering
        \CTEX@sectionname \CTEX@section@aftername
      \fi
      \begin{beamercolorbox}[sep=12pt,center,#1]{part title}
%       \usebeamerfont{section title}\insertsection\par
        \CTEX@section@titleformat \insertsection \CTEX@section@aftertitle
      \end{beamercolorbox}}%
    \par \addvspace{\glueexpr\CTEX@section@afterskip\relax}%
  \endgroup}
%    \end{macrocode}
%
% å¯¹åº” \tn{subsectionpage}ã€‚
%    \begin{macrocode}
\defbeamertemplate*{subsection page}{CTEX}[1][]{%
  \begingroup
%    \centering
%    {\usebeamerfont{subsection name}%
%     \usebeamercolor[fg]{subsection name}\subsectionname~\insertsubsectionnumber}
%    \vskip1em\par
    \par \addvspace{\glueexpr\CTEX@subsection@beforeskip\relax}%
    \CTEX@heading@format@initial
    \CTEX@subsection@format{%
      \CTEX@indentbox{\CTEX@subsection@indent}%
      \ifodd \CTEX@subsection@numbering
        \CTEX@subsectionname \CTEX@subsection@aftername
      \fi
      \begin{beamercolorbox}[sep=8pt,center,#1]{part title}
%       \usebeamerfont{subsection title}\insertsubsection\par
        \CTEX@subsection@titleformat \insertsubsection \CTEX@subsection@aftertitle
      \end{beamercolorbox}}%
    \par \addvspace{\glueexpr\CTEX@subsection@afterskip\relax}%
  \endgroup}
%    \end{macrocode}
%
% å°† \cls{beamer} çš„é»˜è®¤æ¨¡æ¿é‡å®šå‘ä¸º \texttt{CTEX} æ¨¡æ¿ã€‚
%    \begin{macrocode}
\defbeamertemplatealias{part page}{default}{CTEX}
\defbeamertemplatealias{section page}{default}{CTEX}
\defbeamertemplatealias{subsection page}{default}{CTEX}
%    \end{macrocode}
%
%    \begin{macrocode}
\ExplSyntaxOn
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/beamer&gt;
%    \end{macrocode}
%
% \subsubsection{æ&nbsp;‡é¢˜ç¼–å·å’Œç›®å½•çš„å±‚æ¬¡è®¾ç½®}
%
% \changes{v2.5.2}{2020/05/06}{æ–°å¢žæ&nbsp;‡é¢˜é€‰é¡¹ \opt{secnumdepth} å’Œ \opt{tocdepth}ã€‚}
%
% \begin{macro}{secnumdepth, tocdepth}
% \opt{secnumdepth} åœ¨ \cls{beamer} ä¸‹æ—&nbsp;æ„ä¹‰ã€‚
%    \begin{macrocode}
\ctex_define:n
  {
%&lt;*!beamer&gt;
    secnumdepth           .code:n = \ctex_heading_depth:ne { secnumdepth } {#1} ,
    secnumdepth .value_required:n = true ,
%&lt;/!beamer&gt;
    tocdepth              .code:n = \ctex_heading_depth:ne { tocdepth } {#1} ,
    tocdepth    .value_required:n = true
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_heading_depth:nn}
% æ³¨æ„æ­¤å¤„ \tn{setcounter} çš„èµ‹å€¼æ˜¯å…¨å±€çš„ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_heading_depth:nn #1#2
  {
    \prop_get:NnNTF \c_@@_heading_level_prop {#2} \l_@@_tmp_tl
      { \setcounter {#1} { \l_@@_tmp_tl } }
      { \setcounter {#1} { \int_eval:n {#2} } }
  }
\cs_generate_variant:Nn \ctex_heading_depth:nn { ne }
%    \end{macrocode}
% \end{macro}
%
% \begin{variable}[int]{\c_@@_heading_level_prop}
% ç«&nbsp;èŠ‚å±‚æ¬¡ä¸Žåç§°çš„å¯¹åº”è¡¨ã€‚
%    \begin{macrocode}
\prop_const_from_keyval:Nn \c_@@_heading_level_prop
  {
%&lt;*article|beamer&gt;
    part          =  0 ,
%&lt;/article|beamer&gt;
%&lt;*book|report&gt;
    part          = -1 ,
    chapter       =  0 ,
%&lt;/book|report&gt;
    section       =  1 ,
    subsection    =  2 ,
    subsubsection =  3 ,
    paragraph     =  4 ,
    subparagraph  =  5
  }
%    \end{macrocode}
% \end{variable}
%
% \subsubsection{æ&nbsp;‡ç­¾å¼•ç”¨æ•°å­—çš„æ±‰åŒ–}
%
% \begin{macro}[int]{\refstepcounter}
% å¯¹æ&nbsp;‡é¢˜è¿›è¡Œå¼•ç”¨æ—¶ï¼Œè®¾ç½®æ&nbsp;‡ç­¾ä¸ºé€šè¿‡ \opt{number} é€‰é¡¹è®¾ç½®çš„å½¢å¼ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \CTEX@setcurrentlabel@n #1
  {
    \protected@edef \@currentlabel
      {
        \cs_if_exist:cTF { CTEX@the#1 }
          { \exp_args:cc { p@#1 } { CTEX@the#1 } }
          { \exp_not:o { \@currentlabel } }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_varioref_hook:}
% å…³äºŽæ&nbsp;‡ç­¾å¼•ç”¨çš„å®åŒ…å¯èƒ½ä¼šä¿®æ”¹ \tn{refstepcounter}ã€‚å…¶ä¸­ \pkg{cleveref} å’Œ
% \pkg{hyperref} å®åŒ…éƒ½ä¼šä¿å­˜ä¹‹å‰çš„å®šä¹‰ï¼Œå¹¶ä¸”å®ƒä»¬éƒ½è¦æ±‚å°½å¯èƒ½æ™šçš„è¢«è½½å…¥ï¼Œæ‰€ä»¥
% å¯¹æˆ‘ä»¬ä¸Šè¿°çš„ä¿®æ”¹å½±å“ä¸å¤§ã€‚éœ€è¦æ³¨æ„çš„æ˜¯ \pkg{varioref} å®åŒ…ï¼Œå¦‚æžœå®ƒåœ¨
% \CTeX{} ä¹‹åŽè¢«è½½å…¥ï¼Œæˆ‘ä»¬ä¹‹å‰çš„ä¿®æ”¹å°†ä¼šè¢«è¦†ç›–ã€‚
% è¾ƒæ–°ç‰ˆ \LaTeX \ å†…æ&nbsp;¸å·²ç»åŒ…å« \tn{labelformat}ï¼Œå¯ä»¥ç›´æŽ¥ä½¿ç”¨ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_varioref_hook:
  {
    \seq_map_inline:Nn \c_@@_headings_seq
      { \ctex_fix_varioref_label:n { ##1 } }
    \ctex_at_end_package:nn { cleveref } { \ctex_cleveref_hook: }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ctex_fix_varioref_label:n}
% \pkg{varioref} å®åŒ…çš„ \tn{labelformat} å®žé™…ä¸Šæ˜¯å®šä¹‰ä¸€ä¸ªä»¥ |\the&lt;#1&gt;| ä¸ºå‚æ•°çš„å®
% |\p@&lt;#1&gt;|ã€‚\LaTeX{} åœ¨å®šä¹‰è®¡æ•°å™¨ |&lt;#1&gt;| æ—¶ï¼Œéƒ½ä¼šå°† |\p@&lt;#1&gt;| åˆå§‹åŒ–ä¸º \tn{@empty}ã€‚
% å¦‚æžœè¿™ä¸ªå®éžç©ºï¼Œè¯´æ˜Žç”¨æˆ·è‡ªå®šä¹‰äº†æ&nbsp;‡ç­¾æ&nbsp;¼å¼ï¼Œæˆ‘ä»¬å°±ä¸å†ä¿®æ”¹ã€‚è¿™é‡Œä¸èƒ½ä½¿ç”¨
% \cs{exp_args:Nnc}ï¼Œå›&nbsp;ä¸º \texttt{c} è¿™ç§å±•å¼€æ&nbsp;¼å¼ä¸ä¼šå°†å‚æ•°æ”¾åœ¨èŠ±æ‹¬å·å†…ã€‚è€Œ
% \tn{labelformat} çš„å®šä¹‰æ˜¯
% \begin{verbatim}
%   \def\labelformat#1{\expandafter\def\csname p@#1\endcsname##1}
% \end{verbatim}
% å®ƒçš„ç¬¬äºŒä¸ªå‚æ•°å¿…é¡»æ”¾åœ¨èŠ±æ‹¬å·å†…ï¼Œå¦åˆ™å°†ä¼šè¢«ä½œä¸ºå®çš„å®šç•Œç¬¦å·ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_fix_varioref_label:n #1
  {
    \tl_if_empty:cT { p@#1 }
      { \exp_args:Nnx \labelformat {#1} { \exp_not:c { CTEX@the#1 } } }
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5.3}{2020/06/04}{å…¼å®¹ \pkg{cleveref}ã€‚}
% \changes{v2.5.4}{2020/06/17}{åŒæ—¶å…¼å®¹ \pkg{cleveref} å’Œ \pkg{hyperref}ã€‚}
% \changes{v2.5.7}{2021/06/04}{åŒæ—¶å…¼å®¹ \pkg{cleveref} å’Œ \cls{beamer}ã€‚}
% \begin{macro}{\ctex_cleveref_hook:,\@@_cleveref_hook_aux:N}
% éœ€è¦å°†\pkg{cleveref} åŒ…å¯¹åº”å‘½ä»¤ä¸­ |\p@|\meta{counter} çš„å‚æ•°åŠæ—¶å±•å¼€ï¼Œä»¥å…¼å®¹ \tn{labelformat}ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_cleveref_hook:
  {
    \@ifpackageloaded { hyperref }
      {
        \@ifpackagewith { hyperref } { implicit = false }
          { }
          { \@@_cleveref_hook_aux:N \H@refstepcounter }
      }
      {
        \@@_cleveref_hook_aux:N \refstepcounter@noarg
        \@@_cleveref_hook_aux:N \refstepcounter@optarg
      }
    \@@_cleveref_hook_aux:N \appendix
  }
\cs_new_protected:Npn \@@_cleveref_hook_aux:N #1
  {
    \ctex_patch_cmd_all:NnnnTF #1
      {
        \ExplSyntaxOff
        \char_set_catcode_letter:n { 64 }
      }
      { \endcsname \csname the }
      { \expandafter \endcsname \csname the }
      { }
      { \ctex_patch_failure:N #1 }
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5}{2020/04/19}{åº”ç”¨æ–°å†…æ&nbsp;¸ä¸­çš„ \tn{labelformat}ã€‚}
%
% å¦‚æžœ \pkg{varioref} å·²ç»è¢«è½½å…¥ï¼Œåˆ™ä½¿ç”¨å®ƒæ¥è®¾ç½®ã€‚
%    \begin{macrocode}
\cs_if_exist:NTF \labelformat
  { \ctex_varioref_hook: }
  {
    \cs_new_eq:NN \CTEX@save@refstepcounter \refstepcounter
    \RenewDocumentCommand \refstepcounter { m }
      {
        \CTEX@save@refstepcounter {#1}
        \CTEX@setcurrentlabel@n {#1}
      }
    \ctex_at_end_package:nn { varioref } { \ctex_varioref_hook: }
  }
%    \end{macrocode}
%
% \subsubsection{è½½å…¥ \meta{scheme} æ–‡ä»¶}
%
%    \begin{macrocode}
\ctex_scheme_input:o { \l_@@_scheme_tl }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/class|heading&gt;
%    \end{macrocode}
%
% \subsubsection{æ&nbsp;‡é¢˜æ&nbsp;¼å¼çš„ \opt{scheme} å®šä¹‰}
%
% ä¸‹é¢ä½¿ç”¨ \CTeX æ–‡æ¡£ç±»çš„è®¾ç½®æ–¹å¼ï¼Œ\opt{plain} æ¨¡æ‹Ÿæ&nbsp;‡å‡†æ–‡æ¡£ç±»ç›´æŽ¥å®šä¹‰æˆ–ä»¥
% \tn{@startsection} è®¾å®šçš„ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜æ&nbsp;¼å¼ï¼Œ\opt{chinese} æ±‰åŒ–çš„æ&nbsp;‡é¢˜æ&nbsp;¼å¼ã€‚
%
%    \begin{macrocode}
%&lt;*scheme&amp;(article|book|report|beamer)&gt;
%    \end{macrocode}
%
% \changes{v2.1}{2015/05/30}{ä¿®å¤ \cls{ctexbook} å’Œ \cls{ctexrep} ç±»çš„ä¸­æ–‡
% \opt{part/number} é€‰é¡¹åˆå€¼ä¸ºç©ºçš„é”™è¯¯ã€‚}
% \changes{v2.2}{2015/06/30}{å°†ä¸­æ–‡ç‰ˆå¼ä¸‹çš„ \texttt{part} å’Œ \texttt{chapter}
% æ&nbsp;‡é¢˜çš„ \opt{nameformat} å’Œ \opt{titleformat} é€‰é¡¹çš„åˆå€¼åˆå¹¶åˆ° \opt{format} ä¸­ã€‚}
%
%    \begin{macrocode}
\ctex_set:nn { part }
  {
    aftertitle  = \par ,
%&lt;*article|book|report&gt;
    hang        = false ,
%&lt;/article|book|report&gt;
%&lt;*plain&gt;
    name        = \partname \space ,
%&lt;*article|book|report&gt;
    number      = \thepart ,
%&lt;/article|book|report&gt;
%&lt;*beamer&gt;
    number      = \insertromanpartnumber ,
%&lt;/beamer&gt;
%&lt;/plain&gt;
%&lt;*chinese&gt;
    number      = \chinese { part } ,
%&lt;/chinese&gt;
%&lt;*article&gt;
    beforeskip  = 4ex ,
    afterskip   = 3ex ,
%&lt;*plain&gt;
    format      = \raggedright ,
    nameformat  = \Large \bfseries ,
    aftername   = \par \nobreak ,
    titleformat = \huge \bfseries ,
    afterindent = false
%&lt;/plain&gt;
%&lt;*chinese&gt;
    format      = \Large \bfseries \centering ,
    aftername   = \quad ,
    afterindent = true
%&lt;/chinese&gt;
%&lt;/article&gt;
%&lt;*book|report&gt;
    aftername   = \par \vskip 20 \p@ ,
    beforeskip  = 0pt \@plus 1fil ,
    afterskip   = 0pt \@plus 1fil ,
    pagestyle   = plain ,
    break       = \if@openright \cleardoublepage \else \clearpage \fi ,
%&lt;*plain&gt;
    format      = \centering ,
    nameformat  = \huge \bfseries ,
    titleformat = \Huge \bfseries
%&lt;/plain&gt;
%&lt;*chinese&gt;
    format      = \huge \bfseries \centering
%&lt;/chinese&gt;
%&lt;/book|report&gt;
%&lt;*beamer&gt;
    format      = \centering ,
    nameformat  = \usebeamerfont { part ~ name }
                  \usebeamercolor [fg] { part ~ name } ,
    aftername   = \vskip 1em \par ,
    titleformat = \usebeamerfont { part ~ title }
%&lt;/beamer&gt;
  }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;*book|report&gt;
\ctex_set:nn { chapter }
  {
    pagestyle   = plain ,
    aftertitle  = \par ,
    hang        = false ,
    beforeskip  = 50 \p@ ,
    afterskip   = 40 \p@ ,
    lofskip     = 10 \p@ ,
    lotskip     = 10 \p@ ,
    break       = \if@openright \cleardoublepage \else \clearpage \fi ,
%&lt;*plain&gt;
    name        = \chaptername \space ,
    number      = \thechapter ,
    format      = \raggedright ,
    nameformat  = \huge \bfseries ,
    aftername   = \par \nobreak \vskip 20 \p@ ,
    titleformat = \Huge \bfseries ,
    afterindent = false ,
    tocline     = \CTEXnumberline {#1} #2
%&lt;/plain&gt;
%&lt;*chinese&gt;
    number      = \chinese { chapter } ,
    format      = \huge \bfseries \centering ,
    aftername   = \quad ,
    afterindent = true
%&lt;/chinese&gt;
  }
%&lt;/book|report&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
\ctex_set:nn { section }
  {
%&lt;*article|book|report&gt;
    number      = \thesection ,
    aftername   = \quad ,
    aftertitle  = \@@@@par ,
    beforeskip  = 3.5ex \@plus 1ex \@minus .2ex ,
    afterskip   = 2.3ex \@plus .2ex ,
    runin       = false ,
    break       = \addpenalty \@secpenalty ,
%&lt;*plain&gt;
    format      = \Large \bfseries ,
    afterindent = false
%&lt;/plain&gt;
%&lt;*chinese&gt;
    format      = \Large \bfseries \centering ,
    afterindent = true
%&lt;/chinese&gt;
%&lt;/article|book|report&gt;
%&lt;*beamer&gt;
%&lt;*plain&gt;
    name        = \sectionname \space ,
%&lt;/plain&gt;
    format      = \centering ,
    number      = \insertsectionnumber ,
    nameformat  = \usebeamerfont { section ~ name }
                  \usebeamercolor [fg] { section ~ name } ,
    aftername   = \vskip 1em \par ,
    titleformat = \usebeamerfont { section ~ title } ,
    aftertitle  = \par
%&lt;/beamer&gt;
  }
%    \end{macrocode}
%
%    \begin{macrocode}
\ctex_set:nn { subsection }
  {
%&lt;*article|book|report&gt;
    number      = \thesubsection ,
    format      = \large \bfseries ,
    aftername   = \quad ,
    aftertitle  = \@@@@par ,
    beforeskip  = 3.25ex \@plus 1ex \@minus .2ex ,
    afterskip   = 1.5ex  \@plus .2ex ,
    runin       = false ,
    break       = \addpenalty \@secpenalty ,
%&lt;*plain&gt;
    afterindent = false
%&lt;/plain&gt;
%&lt;*chinese&gt;
    afterindent = true
%&lt;/chinese&gt;
%&lt;/article|book|report&gt;
%&lt;*beamer&gt;
%&lt;*plain&gt;
    name        = \subsectionname \space ,
    number      = \insertsubsectionnumber ,
%&lt;/plain&gt;
%&lt;*chinese&gt;
    number      = \arabic { section } . \arabic { subsection } ,
%&lt;/chinese&gt;
    format      = \centering ,
    nameformat  = \usebeamerfont { subsection ~ name }
                  \usebeamercolor [fg] { subsection ~ name } ,
    aftername   = \vskip 1em \par ,
    titleformat = \usebeamerfont { subsection ~ title } ,
    aftertitle  = \par
%&lt;/beamer&gt;
  }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;*article|book|report&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
\ctex_set:nn { subsubsection }
  {
    number      = \thesubsubsection ,
    format      = \normalsize \bfseries ,
    aftername   = \quad ,
    aftertitle  = \@@@@par ,
    beforeskip  = 3.25ex \@plus 1ex \@minus .2ex ,
    afterskip   = 1.5ex \@plus .2ex ,
    runin       = false ,
    break       = \addpenalty \@secpenalty ,
%&lt;*plain&gt;
    afterindent = false
%&lt;/plain&gt;
%&lt;*chinese&gt;
    afterindent = true
%&lt;/chinese&gt;
  }
%    \end{macrocode}
%
%    \begin{macrocode}
\ctex_set:nn { paragraph }
  {
    number      = \theparagraph ,
    format      = \normalsize \bfseries ,
    aftername   = \quad ,
    beforeskip  = 3.25ex \@plus 1ex \@minus .2ex ,
    break       = \addpenalty \@secpenalty ,
%&lt;*plain&gt;
    afterindent = false
%&lt;/plain&gt;
%&lt;*chinese&gt;
    afterindent = true
%&lt;/chinese&gt;
  }
%    \end{macrocode}
%
%    \begin{macrocode}
\ctex_set:nn { subparagraph }
  {
    number      = \thesubparagraph ,
    format      = \normalsize \bfseries ,
    aftername   = \quad ,
    beforeskip  = 3.25ex \@plus 1ex \@minus .2ex ,
    break       = \addpenalty \@secpenalty ,
%&lt;*plain&gt;
    afterindent = false
%&lt;/plain&gt;
%&lt;*chinese&gt;
    afterindent = true
%&lt;/chinese&gt;
  }
%    \end{macrocode}
%
% å¤„ç† \opt{sub3section} ä¸Ž \opt{sub4section} çš„æ&nbsp;¼å¼ã€‚
%    \begin{macrocode}
\int_compare:nNnTF \g_@@_section_depth_int &gt; 2
  {
    \ctex_set:nn { paragraph }
      {
        aftertitle  = \@@@@par ,
        afterskip   = 1ex \@plus .2ex ,
        runin       = false
      }
  }
  {
    \ctex_set:nn { paragraph }
      {
        afterskip   = 1em ,
        runin       = true
      }
  }
\int_compare:nNnTF \g_@@_section_depth_int &gt; 3
  {
    \ctex_set:nn { subparagraph }
      {
        aftertitle  = \@@@@par ,
        afterskip   = 1ex \@plus .2ex ,
        runin       = false
      }
  }
  {
    \ctex_set:nn { subparagraph }
      {
        afterskip   = 1em ,
        runin       = true
      }
  }
\int_compare:nNnTF \g_@@_section_depth_int &gt; 2
  { \ctex_set:nn { subparagraph } { indent = \c_zero_dim } }
  { \ctex_set:nn { subparagraph } { indent = \parindent } }
%    \end{macrocode}
%
% å¤„ç†é™„å½•çš„æ&nbsp;¼å¼ã€‚
%    \begin{macrocode}
\ctex_set:nn { appendix }
%&lt;*article&gt;
  { number      = \@Alph \c@section }
%&lt;/article&gt;
%&lt;*book|report&gt;
  {
    name        = \appendixname \space ,
    number      = \@Alph \c@chapter
  }
%&lt;/book|report&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/article|book|report&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/scheme&amp;(article|book|report|beamer)&gt;
%    \end{macrocode}
%
% \subsubsection{\pkg{ctex.sty} çš„ \opt{heading} é€‰é¡¹}
%
%    \begin{macrocode}
%&lt;*ctex|ctexheading&gt;
%    \end{macrocode}
%
% \begin{variable}{\c_@@_std_class_tl}
% ç”¨äºŽè®°å½•è¢«å¼•å…¥çš„æ&nbsp;‡å‡†æ–‡æ¡£ç±»ã€‚
%    \begin{macrocode}
\clist_map_inline:nn { article , book , report , beamer }
  {
    \@ifclassloaded {#1}
      { \clist_map_break:n { \tl_const:Nn \c_@@_std_class_tl {#1} } }
      { }
  }
%    \end{macrocode}
% \end{variable}
%
% è‹¥æ&nbsp;‡å‡†æ–‡æ¡£ç±»è¢«å¼•å…¥ï¼Œåˆ™è½½å…¥å¯¹åº”çš„æ&nbsp;‡é¢˜å®šä¹‰æ–‡ä»¶ã€‚å¦åˆ™è§† \tn{chapter} æ˜¯å¦æœ‰å®šä¹‰æ¥
% å¼•å…¥ \cls{book} æˆ–è€… \cls{article}ã€‚
%    \begin{macrocode}
\msg_new:nnn { ctex } { not-standard-class }
  {
    None~of~the~standard~document~classes~was~loaded.\\
    Heading~`#1'~is~selected.\\
    ctex~may~not~work~as~expected.
  }
%&lt;ctex&gt;\bool_if:NTF \l_@@_heading_bool
%&lt;ctexheading&gt;\use:n
  {
    \tl_if_exist:NTF \c_@@_std_class_tl
      { \cs_new_eq:NN \c_@@_class_tl \c_@@_std_class_tl }
      {
        \cs_if_exist:NTF \chapter
          {
            \cs_if_exist:NF \if@mainmatter
              { \cs_new_eq:NN \if@mainmatter \tex_iftrue:D }
            \tl_const:Nn \c_@@_class_tl { book }
          }
          { \tl_const:Nn \c_@@_class_tl { article } }
        \msg_warning:nnx { ctex } { not-standard-class } { \c_@@_class_tl }
      }
    \ctex_file_input:n { ctex-heading- \c_@@_class_tl .def }
  }
%&lt;ctex&gt;  { \ctex_scheme_input:o { \l_@@_scheme_tl } }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/ctex|ctexheading&gt;
%    \end{macrocode}
%
% \subsubsection{æ&nbsp;‡é¢˜é…ç½®æ–‡ä»¶}
%
%    \begin{macrocode}
%&lt;*name&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
\keys_set_known:nn { ctex }
  {
    contentsname   = ç›®å½• ,
    listfigurename = æ’å›¾ ,
    listtablename  = è¡¨æ&nbsp;¼ ,
    figurename     = å›¾ ,
    tablename      = è¡¨ ,
    abstractname   = æ‘˜è¦ ,
    indexname      = ç´¢å¼• ,
    bibname        = å‚è€ƒæ–‡çŒ® ,
    appendixname   = é™„å½• ,
    proofname      = è¯æ˜Ž ,
    algorithmname  = ç®—æ³• ,
    refname        = å‚è€ƒæ–‡çŒ® ,
    continuation   = ï¼ˆç»­ï¼‰ ,
    part    / name = { ç¬¬ , éƒ¨åˆ† } ,
    chapter / name = { ç¬¬ , ç«&nbsp; }
  }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/name&gt;
%    \end{macrocode}
%
% \subsection{\opt{chinese} æ–¹æ¡ˆçš„å…¶ä»–è®¾ç½®}
%
%    \begin{macrocode}
%&lt;*scheme&amp;chinese&gt;
%    \end{macrocode}
%
% \opt{chinese} åœ¨æ&nbsp;‡å‡†æ–‡æ¡£ç±»ä¸‹çš„é¡µé¢æ&nbsp;¼å¼æ€»é‡‡ç”¨ \texttt{headings}ã€‚
%    \begin{macrocode}
%&lt;article|book|report&gt;\pagestyle { headings }
%    \end{macrocode}
%
% æ—¥æœŸæ&nbsp;¼å¼ã€‚
%    \begin{macrocode}
\ctex_set:n { today = small }
%    \end{macrocode}
%
% è‹¥ç”¨æˆ·æœªè®¾ç½®å®åŒ…é€‰é¡¹ \opt{autoindent}ï¼Œåˆ™è‡ªåŠ¨è°ƒæ•´é¦–è¡Œç¼©è¿›ã€‚
%    \begin{macrocode}
\ctex_if_autoindent_touched:F
  { \ctex_set:n { autoindent = true } }
%    \end{macrocode}
%
% ä½¿ç”¨æ&nbsp;‡é¢˜å®šä¹‰æ—¶çš„è®¾ç½®ã€‚é¦–å…ˆæ˜¯å‘½é¢˜åå­—æ±‰åŒ–ã€‚\cls{beamer} éœ€è¦æ±‰åŒ–å®šç†åç§°ã€‚
%    \begin{macrocode}
%&lt;*!generic&gt;
\str_if_eq:onTF { \g_@@_encoding_tl } { GBK }
%&lt;*beamer&gt;
  {
    \uselanguage { ChineseGBK }
    \languagealias { chinese } { ChineseGBK }
    \ctex_file_input:n { ctex-name-gbk.cfg }
  }
  {
    \uselanguage { ChineseUTF8 }
    \languagealias { chinese } { ChineseUTF8 }
    \ctex_file_input:n { ctex-name-utf8.cfg }
  }
%    \end{macrocode}
% è®© \pkg{translator} åŒ…ä¼˜å…ˆæŸ¥æ‰¾ä¸­æ–‡ç¿»è¯‘ã€‚
%    \begin{macrocode}
\clist_put_left:Nn \trans@languagepath { chinese }
%&lt;/beamer&gt;
%&lt;*!beamer&gt;
  { \ctex_file_input:n { ctex-name-gbk.cfg } }
  { \ctex_file_input:n { ctex-name-utf8.cfg } }
%    \end{macrocode}
%
% \changes{v2.4.1}{2016/05/09}{\cls{beamer} ä¸è°ƒæ•´é»˜è®¤å­—ä½“å¤§å°ã€‚}
% å¯¹ \cls{beamer} ä»¥å¤–çš„æ–‡æ¡£ç±»ï¼Œè‹¥ç”¨æˆ·æœªè®¾ç½®å®åŒ…é€‰é¡¹ \opt{zihao}ï¼Œåˆ™è®¾ç½® \tn{normalsize}
% ä¸ºäº”å·å­—ã€‚\cls{beamer} ä¸è°ƒæ•´é»˜è®¤å­—ä½“å¤§å°ã€‚
%    \begin{macrocode}
\int_compare:nNnF \g_@@_font_size_int &gt; { -1 }
  { \int_gset:Nn \g_@@_font_size_int { 0 } }
%    \end{macrocode}
%
% \changes{v2.4.1}{2016/05/09}{\cls{beamer} ä¸è°ƒæ•´é»˜è®¤è¡Œè·ã€‚}
% å¯¹ \cls{beamer} ä»¥å¤–çš„æ–‡æ¡£ç±»ï¼Œè‹¥ç”¨æˆ·æœªè®¾ç½®å®åŒ…é€‰é¡¹ \opt{linespread}ï¼Œåˆ™è®¾ç½®è¡Œ
% è·åˆå§‹å€¼ä¸º $1.3\times 1.2=1.56$ å€å­—ä½“å¤§å°ã€‚\cls{beamer} ä¸è°ƒæ•´è¡Œè·ã€‚
%    \begin{macrocode}
\fp_if_nan:nT { \l_@@_line_spread_fp }
  { \fp_set:Nn \l_@@_line_spread_fp { 1.3 } }
%&lt;/!beamer&gt;
%&lt;/!generic&gt;
%    \end{macrocode}
%
% ä¸ä½¿ç”¨æ&nbsp;‡é¢˜å®šä¹‰æ—¶çš„é€šç”¨è®¾ç½®ï¼Œæ³¨æ„æ­¤å¤„ \cs{c_@@_std_class_tl} å¯èƒ½æ²¡æœ‰å®šä¹‰ã€‚
%    \begin{macrocode}
%&lt;*generic&gt;
\tl_if_eq:NnTF \c_@@_std_class_tl { beamer }
  {
    \str_if_eq:onTF { \g_@@_encoding_tl } { GBK }
      {
        \uselanguage { ChineseGBK }
        \languagealias { chinese } { ChineseGBK }
        \ctex_file_input:n { ctex-name-gbk.cfg }
      }
      {
        \uselanguage { ChineseUTF8 }
        \languagealias { chinese } { ChineseUTF8 }
        \ctex_file_input:n { ctex-name-utf8.cfg }
      }
    \clist_put_left:Nn \trans@languagepath { chinese }
  }
  {
    \str_if_eq:onTF { \g_@@_encoding_tl } { GBK }
      { \ctex_file_input:n { ctex-name-gbk.cfg } }
      { \ctex_file_input:n { ctex-name-utf8.cfg } }
    \int_compare:nNnF \g_@@_font_size_int &gt; { -1 }
      { \int_gset:Nn \g_@@_font_size_int { 0 } }
    \fp_if_nan:nT { \l_@@_line_spread_fp }
      { \fp_set:Nn \l_@@_line_spread_fp { 1.3 } }
%    \end{macrocode}
% \changes{v2.0.2}{2015/05/16}{ä¿®å¤åŠ&nbsp;è½½ \pkg{ctex} å®åŒ…åŽç«&nbsp;èŠ‚æ&nbsp;‡é¢˜åŽç¬¬ä¸€æ®µ
% æ—&nbsp;æ®µé¦–ç¼©è¿›çš„é—®é¢˜ã€‚}
% è‹¥ \pkg{ctex} å®åŒ…ä¸Žæ&nbsp;‡å‡†æ–‡æ¡£ç±»åŠå…¶è¡ç”Ÿæ–‡æ¡£ç±»è”ç”¨ï¼Œåˆ™å°†è½½å…¥ \pkg{indentfirst} å®åŒ…ï¼Œ
% å®žçŽ°ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜åŽé¦–ä¸ªæ®µè½çš„æ®µé¦–ç¼©è¿›ã€‚
%    \begin{macrocode}
    \tl_if_exist:NT \c_@@_std_class_tl
      { \RequirePackage { indentfirst } }
  }
%&lt;/generic&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/scheme&amp;chinese&gt;
%    \end{macrocode}
%
% \subsection{ä¸­æ–‡å­—å·}
%
%    \begin{macrocode}
%&lt;*class|ctex|ctexsize&gt;
%    \end{macrocode}
%
% \changes{v2.0}{2014/03/08}{å°†ä¸­æ–‡å­—å·åŠŸèƒ½æå–åˆ°å¯ä»¥ç‹¬ç«‹ä½¿ç”¨çš„ \pkg{ctexsize}ã€‚}
%
% \begin{macro}{\zihao}
%    \begin{macrocode}
\NewDocumentCommand \zihao { m }
  { \exp_args:Nx \ctex_zihao:n {#1} \tex_ignorespaces:D }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_zihao:n}
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_zihao:n #1
  {
    \prop_get:NnNTF \c_@@_font_size_prop {#1} \l_@@_font_size_tl
      { \exp_after:wN \fontsize \l_@@_font_size_tl \selectfont }
      { \msg_error:nnn { ctex } { fontsize } {#1} }
  }
\msg_new:nnnn { ctex } { fontsize }
  { Undefined~Chinese~font~size~`#1'~in~command~\token_to_str:N \zihao.}
  {
    The~old~font~size~is~used~if~you~continue.\\
    The~available~font~sizes~are~listed~as~follow.\\
    \seq_use:Nnnn \c_@@_font_size_seq { ~and~ } { ,~ } { ,~and~ }.
  }
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{å®šä¹‰ä¸­æ–‡å­—å·}
%
% \changes{v2.0}{2014/03/08}{ä¸­æ–‡å­—å·ä¸å†é‡‡ç”¨è¿‘ä¼¼å€¼ã€‚}
%
% \begin{variable}{\c_@@_font_size_prop}
% \begin{macro}{\@@_save_font_size:nn}
% åŸºç¡€è¡Œè·æ˜¯å­—å·çš„ $1.2$ å€ï¼Œé‡‡ç”¨ \hologo{eTeX} çš„ scaling è¿ç®—å¾—åˆ°çš„ç»“æžœ
% è¦æ¯”ç®€å•çš„ |1.2\dimexpr| ç²¾ç¡®^^A
% \footnote{\url{http://thread.gmane.org/gmane.comp.tex.latex.latex3/3190}}ã€‚
%    \begin{macrocode}
\prop_new:N \c_@@_font_size_prop
\seq_new:N \c_@@_font_size_seq
\cs_new_protected:Npn \@@_save_font_size:nn #1#2
  {
    \use:e
      {
        \prop_gput:Nnn \exp_not:N \c_@@_font_size_prop {#1}
          {
            { \dim_to_decimal:n {#2} }
            { \dim_to_decimal:n { (#2) * 6 / 5 } }
          }
      }
    \seq_gput_right:Nn \c_@@_font_size_seq {#1}
  }
\clist_map_inline:nn
  {
    {  8 } { 5    bp } ,
    {  7 } { 5.5  bp } ,
    { -6 } { 6.5  bp } ,
    {  6 } { 7.5  bp } ,
    { -5 } { 9    bp } ,
    {  5 } { 10.5 bp } ,
    { -4 } { 12   bp } ,
    {  4 } { 14   bp } ,
    { -3 } { 15   bp } ,
    {  3 } { 16   bp } ,
    { -2 } { 18   bp } ,
    {  2 } { 22   bp } ,
    { -1 } { 24   bp } ,
    {  1 } { 26   bp } ,
    { -0 } { 36   bp } ,
    {  0 } { 42   bp }
  }
  { \@@_save_font_size:nn #1 }
%    \end{macrocode}
% \end{macro}
% \end{variable}
%
% \begin{macro}[int]{\ctex_declare_math_sizes:nnnn}
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_declare_math_sizes:nnnn #1#2#3#4
  {
    \@@_get_font_sizes:Nn \l_@@_font_size_tl { {#1} {#2} {#3} {#4} }
    \exp_after:wN \DeclareMathSizes \l_@@_font_size_tl
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_get_font_sizes:Nn}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_get_font_sizes:Nn #1#2
  {
    \tl_clear:N #1
    \tl_map_inline:nn {#2}
      {
        \prop_get:NnNTF \c_@@_font_size_prop {##1} \l_@@_tmp_tl
          { \tl_put_right:Nx #1 { { \tl_head:N \l_@@_tmp_tl } } }
          { \tl_put_right:Nx #1 { { \dim_to_decimal:n { ##1 } } } }
      }
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\clist_map_inline:nn
  {
    {  8 }{  8 }{ 5pt }{ 5pt } ,
    {  7 }{  7 }{ 5pt }{ 5pt } ,
    { -6 }{ -6 }{ 5pt }{ 5pt } ,
    {  6 }{  6 }{ 5pt }{ 5pt } ,
    { -5 }{ -5 }{ 6pt }{ 5pt } ,
    {  5 }{  5 }{ 7pt }{ 5pt } ,
    { -4 }{ -4 }{ 8pt }{ 6pt } ,
    {  4 }{  4 }{  5 }{  6 } ,
    { -3 }{ -3 }{ -4 }{ -5 } ,
    {  3 }{  3 }{  4 }{  5 } ,
    { -2 }{ -2 }{ -3 }{ -4 } ,
    {  2 }{  2 }{  3 }{  4 } ,
    { -1 }{ -1 }{ -2 }{ -3 } ,
    {  1 }{  1 }{  2 }{  3 } ,
    { -0 }{ -0 }{ -1 }{ -2 } ,
    {  0 }{  0 }{  1 }{  2 }
  }
  { \ctex_declare_math_sizes:nnnn #1 }
%    \end{macrocode}
%
% \subsubsection{ä¿®æ”¹é»˜è®¤å­—å·å¤§å°}
%
% \begin{macro}[int]{\ctex_set_font_size:Nnn}
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_set_font_size:Nnn #1#2#3
  {
    \prop_get:NnNTF \c_@@_font_size_prop {#2} \l_@@_font_size_tl
      { \exp_after:wN \@@_set_font_size:nnNn \l_@@_font_size_tl #1 {#3} }
      { \msg_error:nnn { ctex } { fontsize } {#2} }
  }
\cs_new_protected:Npn \@@_set_font_size:nnNn #1#2#3#4
  { \cs_set_protected:Npn #3 { \@setfontsize #3 {#1} {#2} #4 } }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\int_case:nn { \g_@@_font_size_int }
  {
    { 0 } { \file_input:n { ctex-c5size.clo } }
    { 1 } { \file_input:n { ctex-cs4size.clo } }
  }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/class|ctex|ctexsize&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;*c5size&gt;
\ctex_set_font_size:Nnn \normalsize { 5 }
  {
    \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
    \abovedisplayshortskip \z@ \@plus3\p@
    \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
    \belowdisplayskip \abovedisplayskip
    \let\@listi\@listI
  }
\ctex_set_font_size:Nnn \small { -5 }
  {
    \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
    \abovedisplayshortskip \z@ \@plus2\p@
    \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
    \def\@listi{\leftmargin\leftmargini
                \topsep 4\p@ \@plus2\p@ \@minus2\p@
                \parsep 2\p@ \@plus\p@ \@minus\p@
                \itemsep \parsep}
    \belowdisplayskip \abovedisplayskip
  }
\ctex_set_font_size:Nnn \footnotesize { 6 }
  {
    \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
    \abovedisplayshortskip \z@ \@plus\p@
    \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
    \def\@listi{\leftmargin\leftmargini
                \topsep 3\p@ \@plus\p@ \@minus\p@
                \parsep 2\p@ \@plus\p@ \@minus\p@
                \itemsep \parsep}
    \belowdisplayskip \abovedisplayskip
  }
\ctex_set_font_size:Nnn \scriptsize { -6 } { }
\ctex_set_font_size:Nnn \tiny  {  7 } { }
\ctex_set_font_size:Nnn \large { -4 } { }
\ctex_set_font_size:Nnn \Large { -3 } { }
\ctex_set_font_size:Nnn \LARGE { -2 } { }
\ctex_set_font_size:Nnn \huge  {  2 } { }
\ctex_set_font_size:Nnn \Huge  {  1 } { }
%&lt;/c5size&gt;
%&lt;*cs4size&gt;
\ctex_set_font_size:Nnn \normalsize { -4 }
  {
    \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
    \abovedisplayshortskip \z@ \@plus3\p@
    \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
    \belowdisplayskip \abovedisplayskip
    \let\@listi\@listI
  }
\ctex_set_font_size:Nnn \small { 5 }
  {
    \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
    \abovedisplayshortskip \z@ \@plus3\p@
    \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
    \def\@listi{\leftmargin\leftmargini
                \topsep 9\p@ \@plus3\p@ \@minus5\p@
                \parsep 4.5\p@ \@plus2\p@ \@minus\p@
                \itemsep \parsep}
    \belowdisplayskip \abovedisplayskip
  }
\ctex_set_font_size:Nnn \footnotesize { -5 }
  {
    \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
    \abovedisplayshortskip \z@ \@plus3\p@
    \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
    \def\@listi{\leftmargin\leftmargini
                \topsep 6\p@ \@plus2\p@ \@minus2\p@
                \parsep 3\p@ \@plus2\p@ \@minus\p@
                \itemsep \parsep}
    \belowdisplayskip \abovedisplayskip
  }
\ctex_set_font_size:Nnn \scriptsize { 6 } { }
\ctex_set_font_size:Nnn \tiny  { -6 } { }
\ctex_set_font_size:Nnn \large { -3 } { }
\ctex_set_font_size:Nnn \Large { -2 } { }
\ctex_set_font_size:Nnn \LARGE {  2 } { }
\ctex_set_font_size:Nnn \huge  { -1 } { }
\ctex_set_font_size:Nnn \Huge  {  1 } { }
%&lt;/cs4size&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;ctexsize&gt;\normalsize
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;*class|ctex&gt;
%    \end{macrocode}
%
% \subsection{æ›´æ–°è¡Œè·}
%
% \cs{l_@@_line_spread_fp} è¢«è®¾ç½®äº†æ‰æœ‰å¿…è¦æ›´æ–°è¡Œè·å’Œ \tn{footnotesep}ã€‚
%    \begin{macrocode}
\fp_if_nan:nF { \l_@@_line_spread_fp }
  {
    \exp_args:Nx \linespread { \fp_use:N \l_@@_line_spread_fp }
%    \end{macrocode}
%
% \changes{v2.0}{2014/04/23}{è°ƒæ•´ \tn{footnotesep} çš„å¤§å°ï¼Œä»¥é€‚åˆè¡Œè·çš„å˜åŒ–ã€‚}
%
% \begin{variable}[int]{\footnotesep}
% æˆ‘ä»¬è°ƒæ•´äº†è¡Œè·ï¼Œå¯èƒ½å¯¼è‡´è„šæ³¨çš„é—´è·ä¸Žè¡Œè·ä¸åè°ƒï¼Œéœ€è¦è°ƒæ•´ \tn{footnotesep}ã€‚æ&nbsp;‡å‡†
% æ–‡æ¡£ç±»å¯¹ \tn{footnotesep} çš„è®¾ç½®æ˜¯ï¼Œå­—ä½“å¤§å°ä¸º \tn{footnotesize} æ—¶ \tn{strutbox}
% çš„é«˜åº¦ï¼ˆé»˜è®¤å€¼æ˜¯ |.7\baselineskip|ï¼‰ã€‚æˆ‘ä»¬æ²¿ç”¨è¿™ä¸ªè®¾ç½®æ–¹æ³•ï¼Œåªéœ€è¦æ›´æ–°å…·ä½“çš„å¤§å°ã€‚
%    \begin{macrocode}
    \group_begin: \footnotesize \exp_args:NNNo \group_end:
    \dim_set:Nn \footnotesep { \dim_use:N \box_ht:N \strutbox }
  }
%    \end{macrocode}
% \end{variable}
%
% æ¿€æ´»é»˜è®¤å­—ä½“å¤§å°ï¼Œæ›´æ–°è¡Œè·ã€\tn{parindent} å’Œ \tn{CJKglue}ã€‚
%    \begin{macrocode}
\normalsize
%    \end{macrocode}
%
% \subsection{å…¶ä»–åŠŸèƒ½}
%
% \begin{macro}{\CTeX}
% \changes{v2.4.12}{2017/12/05}{ä¸ä¾èµ– \tn{ifincsname}ã€‚}
% \file{ctex-faq.sty} ä¸­çš„å®šä¹‰æ˜¯
% \begin{verbatim}
%   \DeclareRobustCommand\CTeX{$\mathbb{C}$\kern-.05em\TeX}
% \end{verbatim}
% ç„¶è€Œ \tn{mathbb} æœªå¿…æœ‰å®šä¹‰ï¼Œè¿™é‡Œå°±ä¸é‡‡ç”¨å®ƒäº†ï¼Œåªå®šä¹‰æœ€ç®€å•çš„å½¢å¼ã€‚
% \CTeX{} å¯ä»¥ç›´æŽ¥ç”¨åœ¨ PDF ä¹¦ç­¾ä¸­ã€‚
%    \begin{macrocode}
\NewDocumentCommand \CTeX { }
  { C \TeX }
\ctex_at_end_package:nn { hyperref }
  { \pdfstringdefDisableCommands { \tl_set:Nn \CTeX { CTeX } } }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0}{2014/03/28}{\opt{captiondelimiter} æ˜¯è¿‡æ—¶é€‰é¡¹ã€‚}
% \begin{macro}{captiondelimiter}
% è¿‡æ—¶é€‰é¡¹ã€‚
%    \begin{macrocode}
\ctex_define:n
  {
    captiondelimiter .code:n =
      {
        \ctex_deprecated_option:n
          { You~can~load~the~package~`caption'~to~get~its~functionality. }
      }
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/class|ctex&gt;
%    \end{macrocode}
%
% \subsubsection{åˆ—è¡¨çŽ¯å¢ƒçš„ç¼©è¿›}
%
% \begin{macro}[int]{\verse,\quotation}
% åªåœ¨ä½¿ç”¨æ–‡æ¡£ç±»çš„æ—¶å€™ä¿®æ”¹è¯—æ­Œå’Œå¼•ç”¨çŽ¯å¢ƒçš„ç¼©è¿›ã€‚
%    \begin{macrocode}
%&lt;*scheme&amp;chinese&amp;(article|book|report)&gt;
\ctex_patch_cmd:Nnn \verse { -1.5em } { -2 \ccwd }
\ctex_patch_cmd:Nnn \verse {  1.5em } {  2 \ccwd }
\ctex_patch_cmd:Nnn \quotation { 1.5em } { 2 \ccwd }
%&lt;/scheme&amp;chinese&amp;(article|book|report)&gt;
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;*class|ctex&gt;
%    \end{macrocode}
%
% \changes{v2.0}{2014/03/09}
% {è§£å†³ \pkg{etoolbox} ä¸Ž \pkg{breqn} å…³äºŽ \tn{end} çš„å†²çªã€‚}
% \changes{v2.2}{2015/06/23}{åˆ&nbsp;åŽ» \pkg{etoolbox} ä¸Ž \pkg{breqn} çš„å…¼å®¹è¡¥ä¸ã€‚}
%
% \subsection{è½½å…¥ä¸­æ–‡å­—åº“}
%
% \begin{macro}[int]{\ctex_fontset_error:n}
% å­—åº“ä¸å¯ç”¨æ—¶ç»™å‡ºç´§æ€¥é”™è¯¯ä¿¡æ¯ï¼Œåœæ­¢è¯»å–å®šä¹‰æ–‡ä»¶ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_fontset_error:n #1
  { \msg_critical:nnn { ctex } { fontset-unavailable } {#1} }
\msg_new:nnn { ctex } { fontset-unavailable }
  { CTeX~fontset~`#1'~is~unavailable~in~current~mode. }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_fontset_case:nnn}
% $3$ ä¸ªå‚æ•°ä¾æ¬¡ä¸º \pdfTeXã€\upTeX\ å’Œ \XeTeX/\LuaTeXã€‚
%    \begin{macrocode}
\cs_new:Npx \ctex_fontset_case:nnn #1#2#3
  {
    \sys_if_engine_pdftex:TF
      {#1}
      { \sys_if_engine_uptex:TF {#2} {#3} }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_fontset_case:nnnn}
% $4$ ä¸ªå‚æ•°ä¾æ¬¡ä¸º \pdfTeXï¼ˆç”Ÿæˆ PDFï¼‰ã€\pdfTeXï¼ˆç”Ÿæˆ DVIï¼‰ã€\upTeX å’Œ
% \XeTeX/\LuaTeXã€‚
%    \begin{macrocode}
\cs_new:Npx \ctex_fontset_case:nnnn #1#2#3#4
  {
    \sys_if_engine_pdftex:TF
      { \sys_if_output_pdf:TF   {#1} {#2} }
      { \sys_if_engine_uptex:TF {#3} {#4} }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_detect_platform:}
% æ&nbsp;¹æ®æ“ä½œç³»ç»Ÿåˆ¤æ–­é»˜è®¤å­—ä½“é…ç½®ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_detect_platform:
  {
    \sys_if_platform_windows:TF
      { \tl_gset:Nn \g_@@_fontset_tl { windows } }
      {
        \ctex_if_platform_macos:TF
          { \tl_gset:Nn \g_@@_fontset_tl { mac    } }
          { \tl_gset:Nn \g_@@_fontset_tl { fandol } }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_if_platform_macos:TF}
% \changes{v2.1}{2015/06/17}{æ”¹ç”¨ \file{/Library/Fonts/Songti.ttc} ä¸ºç‰¹å¾æ–‡ä»¶ã€‚}
% \changes{v2.5}{2019/10/25}{æ”¹ç”¨ \file{/System/Library/Fonts/Menlo.ttc}
%   ä¸ºç‰¹å¾æ–‡ä»¶ã€‚}
% ä»¥ç‰¹å®šå­—ä½“åˆ¤æ–­ macOS ç³»ç»Ÿã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_if_platform_macos:TF
  { \file_if_exist:nTF { /System/Library/Fonts/Menlo.ttc } }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_load_fontset:}
% å¦‚æžœç”¨æˆ·æ²¡æœ‰æŒ‡å®šå­—ä½“ï¼Œåˆ™æŽ¢æµ‹æ“ä½œç³»ç»Ÿï¼Œè½½å…¥ç›¸åº”çš„å­—ä½“é…ç½®ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_load_fontset:
  {
    \tl_if_empty:NTF \g_@@_fontset_tl
      { \ctex_detect_platform: }
      {
        \bool_lazy_or:nnTF
          { \str_if_eq_p:on { \g_@@_fontset_tl } { windowsnew } }
          { \str_if_eq_p:on { \g_@@_fontset_tl } { windowsold } }
          {
            \msg_warning:nnxx { ctex } { deprecated-fontset }
              { \g_@@_fontset_tl } { windows }
            \tl_gset:Nn \g_@@_fontset_tl { windows }
          }
          {
            \file_if_exist:nF { ctex-fontset- \g_@@_fontset_tl .def }
              {
                \use:e
                  {
                    \ctex_detect_platform:
                    \msg_error:nnxx { ctex } { fontset-not-found }
                      { \g_@@_fontset_tl } { \exp_not:N \g_@@_fontset_tl }
                  }
              }
          }
      }
    \ctex_file_input:n { ctex-fontset- \g_@@_fontset_tl .def }
  }
\msg_new:nnn { ctex } { deprecated-fontset }
  { CTeX~fontset~`#1'~is~deprecated.\\ Fontset~`#2'~will~be~used~instead. }
\msg_new:nnnn { ctex } { fontset-not-found }
  { CTeX~fontset~`#1'~could~not~be~found.\\ Fontset~`#2'~will~be~used~instead. }
  { You~may~run~`mktexlsr'~firstly. }
\@onlypreamble \ctex_load_fontset:
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{fontset}
% åœ¨å¯¼è¨€åŒºé€šè¿‡ \tn{ctexset} è½½å…¥ä¸­æ–‡å­—åº“çš„é€‰é¡¹ã€‚
%    \begin{macrocode}
\ctex_define:n
  {
    fontset .code:n =
      {
        \ctex_if_preamble:TF
          {
            \str_if_eq:eeTF {#1} { none }
              { \msg_warning:nnn { ctex } { invalid-value } {#1} }
              {
                \str_if_eq:onTF { \g_@@_fontset_tl } { none }
                  {
                    \tl_gset:Nx \g_@@_fontset_tl {#1}
                    \ctex_load_fontset:
                  }
                  {
                    \msg_error:nnxx { ctex } { fontset-loaded }
                      { \g_@@_fontset_tl } {#1}
                  }
              }
          }
          { \msg_error:nn { ctex } { fontset-only-preamble } }
      }
  }
\msg_new:nnnn { ctex } { fontset-loaded }
  {
    CTeX~fontset~`#1'~has~been~loaded.
    \str_if_eq:nnF {#1} {#2} { \\ Fontset~`#2'~will~be~ignored. }
  }
  { Only~one~fontset~can~be~loaded~in~the~preamble. }
\msg_new:nnn { ctex } { fontset-only-preamble }
  { The~`fontset'~option~can~be~used~only~in~preamble. }
%    \end{macrocode}
% \end{macro}
%
% è½½å…¥ä¸­æ–‡å­—åº“ã€‚
%    \begin{macrocode}
\str_if_eq:onF { \g_@@_fontset_tl } { none }
  { \ctex_load_fontset: }
%    \end{macrocode}
%
% \subsection{å®åŒ…é…ç½®æ–‡ä»¶}
%
% \subsubsection{\pkg{ctex.cfg}}
%
%    \begin{macrocode}
\ctex_at_end:n { \ctex_file_input:n { ctex.cfg } }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/class|ctex&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;*config&gt;
%%
%&lt;/config&gt;
%    \end{macrocode}
%
% \subsubsection{\pkg{ctexopts.cfg}}
%
% è¿™é‡Œä»…ä¸ºé…ç½®æ–‡ä»¶ç¤ºä¾‹ï¼šä½¿ç”¨ Windows ä¸‹çš„å­—ä½“è®¾ç½®ã€‚
%    \begin{macrocode}
%&lt;*ctexopts&gt;
%%
%% \ctex_set:nn { option } { fontset = windows }
%&lt;/ctexopts&gt;
%    \end{macrocode}
%
% \subsection{å­—ä½“å®šä¹‰æ–‡ä»¶}
%
% \subsubsection{ä¼&nbsp;ç»Ÿå®šä¹‰æ–¹å¼}
%
% \changes{v2.4.15}{2019/04/05}{å°† \texttt{JY2} å’Œ \texttt{JT2} ç¼–ç&nbsp;çš„å­—ä½“å®šä¹‰æå–åˆ°å•ç‹¬çš„æ–‡ä»¶ä¸­ã€‚}
%
%    \begin{macrocode}
%&lt;*c19|c70&gt;
%%
%% Chinese characters
%%
%&lt;c19&gt;%% character set: GBK (extension of GB 2312)
%&lt;c70&gt;%% character set: Unicode
%% font encoding: Unicode
%%
%&lt;/c19|c70&gt;
%    \end{macrocode}
%
% \pkg{CJK} å®åŒ…ä½¿ç”¨çš„å­—ä½“æ—ã€‚
%    \begin{macrocode}
%&lt;rm&amp;c19&gt;\DeclareFontFamily{C19}{rm}{\hyphenchar\font\m@ne}
%&lt;rm&amp;c70&gt;\DeclareFontFamily{C70}{rm}{\hyphenchar\font\m@ne}
%&lt;sf&amp;c19&gt;\DeclareFontFamily{C19}{sf}{\hyphenchar\font\m@ne}
%&lt;sf&amp;c70&gt;\DeclareFontFamily{C70}{sf}{\hyphenchar\font\m@ne}
%&lt;tt&amp;c19&gt;\DeclareFontFamily{C19}{tt}{\hyphenchar\font\m@ne}
%&lt;tt&amp;c70&gt;\DeclareFontFamily{C70}{tt}{\hyphenchar\font\m@ne}
%    \end{macrocode}
%
% \changes{v2.4}{2016/04/25}{æä¾› \upLaTeX{} çš„ NFSS å­—ä½“å®šä¹‰ã€‚}
% \upLaTeX{} ä½¿ç”¨çš„å­—ä½“æ—ã€‚\upLaTeX åœ¨ NFSS ä¸‹ä½¿ç”¨å­—ä½“ç¼–ç&nbsp; |JY2| å’Œ |JT2| æ¥åˆ†åˆ«
% è¡¨ç¤ºæ¨ªæŽ’ä¸Žç›´æŽ’çš„æ—¥æ–‡ã€‚
%    \begin{macrocode}
%&lt;rm&amp;jy2&gt;\DeclareKanjiFamily{JY2}{zhrm}{}
%&lt;rm&amp;jt2&gt;\DeclareKanjiFamily{JT2}{zhrm}{}
%&lt;sf&amp;jy2&gt;\DeclareKanjiFamily{JY2}{zhsf}{}
%&lt;sf&amp;jt2&gt;\DeclareKanjiFamily{JT2}{zhsf}{}
%&lt;tt&amp;jy2&gt;\DeclareKanjiFamily{JY2}{zhtt}{}
%&lt;tt&amp;jt2&gt;\DeclareKanjiFamily{JT2}{zhtt}{}
%    \end{macrocode}
%
%
%    \begin{macrocode}
%&lt;*rm&gt;
%&lt;*c19&gt;
\DeclareFontShape{C19}{rm}{m}{n}{&lt;-&gt; CJK * gbksong}{\CJKnormal}
\DeclareFontShape{C19}{rm}{b}{n}{&lt;-&gt; CJK * gbkhei}{\CJKnormal}
\DeclareFontShape{C19}{rm}{bx}{n}{&lt;-&gt; CJK * gbkhei}{\CJKnormal}
\DeclareFontShape{C19}{rm}{m}{sl}{&lt;-&gt; CJK * gbksongsl}{\CJKnormal}
\DeclareFontShape{C19}{rm}{b}{sl}{&lt;-&gt; CJK * gbkheisl}{\CJKnormal}
\DeclareFontShape{C19}{rm}{bx}{sl}{&lt;-&gt; CJK * gbkheisl}{\CJKnormal}
\DeclareFontShape{C19}{rm}{m}{it}{&lt;-&gt; CJK * gbkkai}{\CJKnormal}
\DeclareFontShape{C19}{rm}{b}{it}{&lt;-&gt; CJKb * gbkkai}{\CJKbold}
\DeclareFontShape{C19}{rm}{bx}{it}{&lt;-&gt; CJKb * gbkkai}{\CJKbold}
%&lt;/c19&gt;
%&lt;*c70&gt;
\DeclareFontShape{C70}{rm}{m}{n}{&lt;-&gt; CJK * unisong}{\CJKnormal}
\DeclareFontShape{C70}{rm}{b}{n}{&lt;-&gt; CJK * unihei}{\CJKnormal}
\DeclareFontShape{C70}{rm}{bx}{n}{&lt;-&gt; CJK * unihei}{\CJKnormal}
\DeclareFontShape{C70}{rm}{m}{sl}{&lt;-&gt; CJK * unisongsl}{\CJKnormal}
\DeclareFontShape{C70}{rm}{b}{sl}{&lt;-&gt; CJK * uniheisl}{\CJKnormal}
\DeclareFontShape{C70}{rm}{bx}{sl}{&lt;-&gt; CJK * uniheisl}{\CJKnormal}
\DeclareFontShape{C70}{rm}{m}{it}{&lt;-&gt; CJK * unikai}{\CJKnormal}
\DeclareFontShape{C70}{rm}{b}{it}{&lt;-&gt; CJKb * unikai}{\CJKbold}
\DeclareFontShape{C70}{rm}{bx}{it}{&lt;-&gt; CJKb * unikai}{\CJKbold}
%&lt;/c70&gt;
%&lt;*jy2&gt;
\DeclareFontShape{JY2}{zhrm}{m}{n}{&lt;-&gt; upzhserif-h}{}
\DeclareFontShape{JY2}{zhrm}{m}{it}{&lt;-&gt; upzhserifit-h}{}
\DeclareFontShape{JY2}{zhrm}{b}{n}{&lt;-&gt; upzhserifb-h}{}
\DeclareFontShape{JY2}{zhrm}{bx}{n}{&lt;-&gt; upzhserifb-h}{}
%&lt;/jy2&gt;
%&lt;*jt2&gt;
\DeclareFontShape{JT2}{zhrm}{m}{n}{&lt;-&gt; upzhserif-v}{}
\DeclareFontShape{JT2}{zhrm}{m}{it}{&lt;-&gt; upzhserifit-v}{}
\DeclareFontShape{JT2}{zhrm}{b}{n}{&lt;-&gt; upzhserifb-v}{}
\DeclareFontShape{JT2}{zhrm}{bx}{n}{&lt;-&gt; upzhserifb-v}{}
%&lt;/jt2&gt;
%&lt;/rm&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;*sf&gt;
%&lt;*c19&gt;
\DeclareFontShape{C19}{sf}{m}{n}{&lt;-&gt; CJK * gbkyou}{\CJKnormal}
\DeclareFontShape{C19}{sf}{b}{n}{&lt;-&gt; CJKb * gbkyou}{\CJKbold}
\DeclareFontShape{C19}{sf}{bx}{n}{&lt;-&gt; CJKb * gbkyou}{\CJKbold}
\DeclareFontShape{C19}{sf}{m}{sl}{&lt;-&gt; CJK * gbkyousl}{\CJKnormal}
\DeclareFontShape{C19}{sf}{b}{sl}{&lt;-&gt; CJKb * gbkyousl}{\CJKbold}
\DeclareFontShape{C19}{sf}{bx}{sl}{&lt;-&gt; CJKb * gbkyousl}{\CJKbold}
\DeclareFontShape{C19}{sf}{m}{it}{&lt;-&gt; CJK * gbkyou}{\CJKnormal}
\DeclareFontShape{C19}{sf}{b}{it}{&lt;-&gt; CJKb * gbkyou}{\CJKbold}
\DeclareFontShape{C19}{sf}{bx}{it}{&lt;-&gt; CJKb * gbkyou}{\CJKbold}
%&lt;/c19&gt;
%&lt;*c70&gt;
\DeclareFontShape{C70}{sf}{m}{n}{&lt;-&gt; CJK * uniyou}{\CJKnormal}
\DeclareFontShape{C70}{sf}{b}{n}{&lt;-&gt; CJKb * uniyou}{\CJKbold}
\DeclareFontShape{C70}{sf}{bx}{n}{&lt;-&gt; CJKb * uniyou}{\CJKbold}
\DeclareFontShape{C70}{sf}{m}{sl}{&lt;-&gt; CJK * uniyousl}{\CJKnormal}
\DeclareFontShape{C70}{sf}{b}{sl}{&lt;-&gt; CJKb * uniyousl}{\CJKbold}
\DeclareFontShape{C70}{sf}{bx}{sl}{&lt;-&gt; CJKb * uniyousl}{\CJKbold}
\DeclareFontShape{C70}{sf}{m}{it}{&lt;-&gt; CJK * uniyou}{\CJKnormal}
\DeclareFontShape{C70}{sf}{b}{it}{&lt;-&gt; CJKb * uniyou}{\CJKbold}
\DeclareFontShape{C70}{sf}{bx}{it}{&lt;-&gt; CJKb * uniyou}{\CJKbold}
%&lt;/c70&gt;
%&lt;*jy2&gt;
\DeclareFontShape{JY2}{zhsf}{m}{n}{&lt;-&gt; upzhsans-h}{}
\DeclareFontShape{JY2}{zhsf}{b}{n}{&lt;-&gt; upzhsansb-h}{}
\DeclareFontShape{JY2}{zhsf}{bx}{n}{&lt;-&gt; upzhsansb-h}{}
%&lt;/jy2&gt;
%&lt;*jt2&gt;
\DeclareFontShape{JT2}{zhsf}{m}{n}{&lt;-&gt; upzhsans-v}{}
\DeclareFontShape{JT2}{zhsf}{b}{n}{&lt;-&gt; upzhsansb-v}{}
\DeclareFontShape{JT2}{zhsf}{bx}{n}{&lt;-&gt; upzhsansb-v}{}
%&lt;/jt2&gt;
%&lt;/sf&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;*tt&gt;
%&lt;*c19&gt;
\DeclareFontShape{C19}{tt}{m}{n}{&lt;-&gt; CJK * gbkfs}{\CJKnormal}
\DeclareFontShape{C19}{tt}{b}{n}{&lt;-&gt; CJKb * gbkfs}{\CJKbold}
\DeclareFontShape{C19}{tt}{bx}{n}{&lt;-&gt; CJKb * gbkfs}{\CJKbold}
\DeclareFontShape{C19}{tt}{m}{sl}{&lt;-&gt; CJK * gbkfssl}{\CJKnormal}
\DeclareFontShape{C19}{tt}{b}{sl}{&lt;-&gt; CJKb * gbkfssl}{\CJKbold}
\DeclareFontShape{C19}{tt}{bx}{sl}{&lt;-&gt; CJKb * gbkfssl}{\CJKbold}
\DeclareFontShape{C19}{tt}{m}{it}{&lt;-&gt; CJK * gbkfs}{\CJKnormal}
\DeclareFontShape{C19}{tt}{b}{it}{&lt;-&gt; CJKb * gbkfs}{\CJKbold}
\DeclareFontShape{C19}{tt}{bx}{it}{&lt;-&gt; CJKb * gbkfs}{\CJKbold}
%&lt;/c19&gt;
%&lt;*c70&gt;
\DeclareFontShape{C70}{tt}{m}{n}{&lt;-&gt; CJK * unifs}{\CJKnormal}
\DeclareFontShape{C70}{tt}{b}{n}{&lt;-&gt; CJKb * unifs}{\CJKbold}
\DeclareFontShape{C70}{tt}{bx}{n}{&lt;-&gt; CJKb * unifs}{\CJKbold}
\DeclareFontShape{C70}{tt}{m}{sl}{&lt;-&gt; CJK * unifssl}{\CJKnormal}
\DeclareFontShape{C70}{tt}{b}{sl}{&lt;-&gt; CJKb * unifssl}{\CJKbold}
\DeclareFontShape{C70}{tt}{bx}{sl}{&lt;-&gt; CJKb * unifssl}{\CJKbold}
\DeclareFontShape{C70}{tt}{m}{it}{&lt;-&gt; CJK * unifs}{\CJKnormal}
\DeclareFontShape{C70}{tt}{b}{it}{&lt;-&gt; CJKb * unifs}{\CJKbold}
\DeclareFontShape{C70}{tt}{bx}{it}{&lt;-&gt; CJKb * unifs}{\CJKbold}
%&lt;/c70&gt;
%&lt;*jy2&gt;
\DeclareFontShape{JY2}{zhtt}{m}{n}{&lt;-&gt; upzhmono-h}{}
%&lt;/jy2&gt;
%&lt;*jt2&gt;
\DeclareFontShape{JT2}{zhtt}{m}{n}{&lt;-&gt; upzhmono-v}{}
%&lt;/jt2&gt;
%&lt;/tt&gt;
%    \end{macrocode}
%
% \subsubsection{é¢„å®šä¹‰å­—åº“}
%
%    \begin{macrocode}
%&lt;*fontset&gt;
%    \end{macrocode}
%
% \paragraph{\opt{adobe}}
%
% \tn{pdfmapline} ä¸æ”¯æŒ OpenType å­—ä½“ï¼Œå›&nbsp;è€Œ \opt{adobe} å­—ä½“é›†åœ¨ pdf æ¨¡å¼ä¸‹
% å°±æ²¡æœ‰å®šä¹‰ã€‚\opt{fandol} çš„æƒ…å†µç±»ä¼¼ã€‚
%    \begin{macrocode}
%&lt;*adobe&gt;
\ctex_fontset_case:nnnn
  { \ctex_fontset_error:n { adobe } }
  {
    \ctex_zhmap_case:nnn
      {
        \setCJKmainfont  { AdobeSongStd-Light.otf }
          [
            cmap       = UniGB-UTF16-H,
            BoldFont   = AdobeHeitiStd-Regular.otf,
            ItalicFont = AdobeKaitiStd-Regular.otf
          ]
        \setCJKsansfont { AdobeHeitiStd-Regular.otf }
          [ cmap = UniGB-UTF16-H ]
        \setCJKmonofont { AdobeFangsongStd-Regular.otf }
          [ cmap = UniGB-UTF16-H ]
        \setCJKfamilyfont { zhsong } { AdobeSongStd-Light.otf       }
          [ cmap = UniGB-UTF16-H ]
        \setCJKfamilyfont { zhhei  } { AdobeHeitiStd-Regular.otf    }
          [ cmap = UniGB-UTF16-H ]
        \setCJKfamilyfont { zhkai  } { AdobeKaitiStd-Regular.otf    }
          [ cmap = UniGB-UTF16-H ]
        \setCJKfamilyfont { zhfs   } { AdobeFangsongStd-Regular.otf }
          [ cmap = UniGB-UTF16-H ]
        \ctex_punct_set:n { adobe }
        \ctex_punct_map_family:nn   { \CJKrmdefault } { zhsong }
        \ctex_punct_map_family:nn   { \CJKsfdefault } { zhhei  }
        \ctex_punct_map_family:nn   { \CJKttdefault } { zhfs   }
        \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei  }
        \ctex_punct_map_itshape:nn  { \CJKrmdefault } { zhkai  }
      }
      {
        \ctex_load_zhmap:nnnn { rm } { zhhei } { zhfs } { adobe }
        \ctex_punct_set:n { adobe }
        \ctex_punct_map_family:nn   { \CJKrmdefault } { zhsong }
        \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei  }
        \ctex_punct_map_itshape:nn  { \CJKrmdefault } { zhkai  }
      }
      { \ctex_fontset_error:n { adobe } }
  }
  {
    \ctex_set_upfonts:nnnnnn
      { AdobeSongStd-Light.otf       }
      { AdobeHeitiStd-Regular.otf    }
      { AdobeKaitiStd-Regular.otf    }
      { AdobeHeitiStd-Regular.otf    }
      { AdobeHeitiStd-Regular.otf    }
      { AdobeFangsongStd-Regular.otf }
    \ctex_set_upfamily:nnn { zhsong } { upzhserif   } {}
    \ctex_set_upfamily:nnn { zhhei  } { upzhsans    } {}
    \ctex_set_upfamily:nnn { zhfs   } { upzhmono    } {}
    \ctex_set_upfamily:nnn { zhkai  } { upzhserifit } {}
  }
  {
    \setCJKmainfont { AdobeSongStd-Light       }
      [ BoldFont = AdobeHeitiStd-Regular, ItalicFont = AdobeKaitiStd-Regular ]
    \setCJKsansfont { AdobeHeitiStd-Regular    }
    \setCJKmonofont { AdobeFangsongStd-Regular }
    \setCJKfamilyfont { zhsong } { AdobeSongStd-Light       }
    \setCJKfamilyfont { zhhei  } { AdobeHeitiStd-Regular    }
    \setCJKfamilyfont { zhfs   } { AdobeFangsongStd-Regular }
    \setCJKfamilyfont { zhkai  } { AdobeKaitiStd-Regular    }
  }
%&lt;/adobe&gt;
%    \end{macrocode}
%
% \paragraph{\opt{fandol}}
%
%    \begin{macrocode}
%&lt;*fandol&gt;
\ctex_fontset_case:nnnn
  { \ctex_fontset_error:n { fandol } }
  {
    \ctex_zhmap_case:nnn
      {
        \setCJKmainfont { FandolSong-Regular.otf }
          [
            cmap       = UniGB-UTF16-H,
            BoldFont   = FandolSong-Bold.otf,
            ItalicFont = FandolKai-Regular.otf
          ]
        \setCJKsansfont { FandolHei-Regular.otf }
          [ cmap = UniGB-UTF16-H, BoldFont = FandolHei-Bold.otf ]
        \setCJKmonofont { FandolFang-Regular.otf }
          [ cmap = UniGB-UTF16-H ]
        \setCJKfamilyfont { zhsong } { FandolSong-Regular.otf }
          [ cmap = UniGB-UTF16-H, BoldFont = FandolSong-Bold.otf ]
        \setCJKfamilyfont { zhhei  } { FandolHei-Regular.otf  }
          [ cmap = UniGB-UTF16-H, BoldFont = FandolHei-Bold.otf  ]
        \setCJKfamilyfont { zhfs   } { FandolFang-Regular.otf }
          [ cmap = UniGB-UTF16-H ]
        \setCJKfamilyfont { zhkai  } { FandolKai-Regular.otf  }
          [ cmap = UniGB-UTF16-H ]
        \ctex_punct_set:n { fandol }
        \ctex_punct_map_family:nn   { \CJKrmdefault         } { zhsong  }
        \ctex_punct_map_family:nn   { \CJKsfdefault         } { zhhei   }
        \ctex_punct_map_family:nn   { \CJKttdefault         } { zhfs    }
        \ctex_punct_map_bfseries:nn { \CJKrmdefault, zhsong } { zhsongb }
        \ctex_punct_map_bfseries:nn { \CJKsfdefault, zhhei  } { zhheib  }
        \ctex_punct_map_itshape:nn  { \CJKrmdefault         } { zhkai   }
      }
      {
        \ctex_load_zhmap:nnnn { rm } { zhhei } { zhfs } { fandol }
        \ctex_punct_set:n { fandol }
        \ctex_punct_map_family:nn   { \CJKrmdefault } { zhsong }
        \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei  }
        \ctex_punct_map_itshape:nn  { \CJKrmdefault } { zhkai  }
      }
      { \ctex_fontset_error:n { fandol } }
  }
  {
    \ctex_set_upfonts:nnnnnn
      { FandolSong-Regular.otf }
      { FandolSong-Bold.otf    }
      { FandolKai-Regular.otf  }
      { FandolHei-Regular.otf  }
      { FandolHei-Bold.otf     }
      { FandolFang-Regular.otf }
    \ctex_set_upfamily:nnn { zhsong } { upzhserif   } { upzhserifb }
    \ctex_set_upfamily:nnn { zhhei  } { upzhsans    } { upzhsansb  }
    \ctex_set_upfamily:nnn { zhfs   } { upzhmono    } {}
    \ctex_set_upfamily:nnn { zhkai  } { upzhserifit } {}
  }
  {
    \setCJKmainfont { FandolSong-Regular }
      [
        Extension  = .otf,
        BoldFont   = FandolSong-Bold,
        ItalicFont = FandolKai-Regular
      ]
    \setCJKsansfont { FandolHei-Regular  }
      [ Extension = .otf, BoldFont = FandolHei-Bold ]
    \setCJKmonofont { FandolFang-Regular }
      [ Extension = .otf ]
    \setCJKfamilyfont { zhsong } { FandolSong-Regular }
      [ Extension = .otf, BoldFont = FandolSong-Bold ]
    \setCJKfamilyfont { zhhei  } { FandolHei-Regular  }
      [ Extension = .otf, BoldFont = FandolHei-Bold  ]
    \setCJKfamilyfont { zhfs   } { FandolFang-Regular }
      [ Extension = .otf ]
    \setCJKfamilyfont { zhkai  } { FandolKai-Regular  }
      [ Extension = .otf ]
  }
%&lt;/fandol&gt;
%    \end{macrocode}
%
% \paragraph{\opt{founder}}
%
% \changes{v2.4.15}{2019/03/28}{ç»Ÿä¸€â€œæ–¹æ­£ç»†é»‘ä¸€\_GBKâ€çš„åç§°ä¸º \texttt{FZXiHeiI-Z08}ã€‚}
%
%    \begin{macrocode}
%&lt;*founder&gt;
\ctex_fontset_case:nnn
  {
    \ctex_zhmap_case:nnn
      {
        \setCJKmainfont { FZSSK.TTF }
          [ BoldFont = FZXBSK.TTF, ItalicFont = FZKTK.TTF ]
        \setCJKsansfont { FZXH1K.TTF } [ BoldFont = FZHTK.TTF ]
        \setCJKmonofont { FZFSK.TTF }
        \setCJKfamilyfont { zhsong } { FZSSK.TTF } [ BoldFont = FZXBSK.TTF ]
        \setCJKfamilyfont { zhhei  } { FZHTK.TTF }
        \setCJKfamilyfont { zhkai  } { FZKTK.TTF }
        \setCJKfamilyfont { zhfs   } { FZFSK.TTF }
        \setCJKfamilyfont { zhli   } { FZLSK.TTF }
        \setCJKfamilyfont { zhyou  } { FZY1K.TTF } [ BoldFont = FZY3K.TTF ]
        \ctex_punct_set:n { founder }
        \ctex_punct_map_family:nn   { \CJKrmdefault         } { zhsong  }
        \ctex_punct_map_family:nn   { \CJKsfdefault         } { zhheil  }
        \ctex_punct_map_family:nn   { \CJKttdefault         } { zhfs    }
        \ctex_punct_map_itshape:nn  { \CJKrmdefault         } { zhkai   }
        \ctex_punct_map_bfseries:nn { \CJKrmdefault, zhsong } { zhsongb }
        \ctex_punct_map_bfseries:nn { \CJKsfdefault         } { zhhei   }
        \ctex_punct_map_bfseries:nn { zhyou                 } { zhyoub  }
      }
      {
        \ctex_load_zhmap:nnnn { rm } { zhhei } { zhfs } { founder }
        \ctex_punct_set:n { founder }
        \ctex_punct_map_family:nn   { \CJKrmdefault } { zhsong }
        \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei  }
        \ctex_punct_map_itshape:nn  { \CJKrmdefault } { zhkai  }
      }
      { \ctex_fontset_error:n { founder } }
  }
  {
    \ctex_set_upfonts:nnnnnn
      { FZSSK.TTF  }
      { FZXBSK.TTF }
      { FZKTK.TTF  }
      { FZXH1K.TTF }
      { FZHTK.TTF  }
      { FZFSK.TTF  }
    \ctex_set_upfamily:nnn { zhsong } { upzhserif   } { upzhserifb }
    \ctex_set_upfamily:nnn { zhhei  } { upzhsans    } { upzhsansb  }
    \ctex_set_upfamily:nnn { zhfs   } { upzhmono    } {}
    \ctex_set_upfamily:nnn { zhkai  } { upzhserifit } {}
    \ctex_set_upfamily:nnn { zhli   } { upschrm     } {}
    \ctex_set_upfamily:nnn { zhyou  } { upschgt     } {}
    \ctex_set_upmap:nnn    { upstsl } { FZLSK.TTF } {}
    \ctex_set_upmap:nnn    { upstht } { FZY1K.TTF } {}
  }
  {
    \setCJKmainfont { FZShuSong-Z01 }
      [ BoldFont = FZXiaoBiaoSong-B05, ItalicFont = FZKai-Z03 ]
    \setCJKsansfont { FZXiHeiI-Z08 } [ BoldFont = FZHei-B01 ]
    \setCJKmonofont { FZFangSong-Z02 }
    \setCJKfamilyfont { zhsong } { FZShuSong-Z01  }
      [ BoldFont = FZXiaoBiaoSong-B05 ]
    \setCJKfamilyfont { zhhei  } { FZHei-B01      }
    \setCJKfamilyfont { zhkai  } { FZKai-Z03      }
    \setCJKfamilyfont { zhfs   } { FZFangSong-Z02 }
    \setCJKfamilyfont { zhli   } { FZLiShu-S01    }
    \setCJKfamilyfont { zhyou  } { FZXiYuan-M01   }
      [ BoldFont = FZZhunYuan-M02 ]
  }
%&lt;/founder&gt;
%    \end{macrocode}
%
% \changes{v2.5.2}{2020/05/06}
%   {ä¿®æ­£ \opt{macnew} å’Œ \opt{ubuntu} å­—åº“çš„ \pkg{CJKpunct} æ&nbsp;‡ç‚¹ä¿¡æ¯ã€‚}
%
% \paragraph{\opt{mac} ç›¸å…³}
%
% \changes{v2.4.14}{2018/05/01}{åŒºåˆ† \opt{macold} åŠ \opt{macnew}ã€‚}
%
% æŒ‰ \href{https://github.com/CTeX-org/ctex-kit/issues/351}{Issue 351}
% çš„è®¨è®ºï¼Œä»¥ El Capitan ä¸ºåˆ†ç•Œï¼Œåˆ†åˆ«è®¾ç½® |macold|ï¼ˆEl Capitan ä¹‹å‰ï¼‰
% å’Œ |macnew|ï¼ˆEl Capitan åŠä¹‹åŽï¼‰ã€‚æ£€æµ‹æ–¹å¼åˆ™ä»¥ El Capitan åŠä¹‹åŽ
% çš„è‹¹æ–¹å­—ä½“ä¸ºå‡†ã€‚
%
%    \begin{macrocode}
%&lt;*mac&gt;
\file_if_exist:nTF { /System/Library/Fonts/PingFang.ttc }
  { \ctex_file_input:n { ctex-fontset-macnew.def } }
  { \ctex_file_input:n { ctex-fontset-macold.def } }
%&lt;/mac&gt;
%    \end{macrocode}
%
% \changes{v2.4.14}{2018/05/01}{é…ç½® \opt{macnew} çš„é»˜è®¤å­—ä½“è®¾ç½®ã€‚}
% \changes{v2.5}{2019/11/05}{ä¸º \opt{macnew} å¢žåŠ&nbsp;ç²—æ¥·ä½“ã€éš¶ä¹¦å’Œåœ†ä½“çš„å®šä¹‰ã€‚}
% \changes{v2.5}{2019/11/07}{å…è®¸ \opt{macnew} åœ¨ \LaTeX{} å’Œ \upLaTeX{} ä¸‹ä½¿ç”¨ã€‚}
%
% |macold| çš„è®¾ç½®å‚è€ƒäº†
% \href{https://github.com/CTeX-org/ctex-kit/wiki/OS-X-Mavericks-(10.9)-é¢„è£…çš„ä¸»è¦ç®€ä½“ä¸­æ–‡å­—ä½“}^^A
% {OS X Mavericks (10.9) é¢„è£…çš„ä¸»è¦ç®€ä½“ä¸­æ–‡å­—ä½“åˆ—è¡¨}ã€‚
%
% |macnew| åœ¨é»˜è®¤å­—ä½“è®¾ç½®æ–¹é¢ï¼Œå¼•å…¥äº†å¤šå­—é‡çš„å®‹ä½“ä½œä¸ºç½—é©¬å­—æ—ï¼Œ
% ä»¥åŠå¼•å…¥äº†è‹¹æ–¹é»‘ä½“ä½œä¸ºæ—&nbsp;è¡¬çº¿å­—æ—ã€‚
% ç”±äºŽ Songti SC Light çš„å­—é‡ä¸Ž STSong åŠ Windows ä¸Šçš„ SimSun æ›´æŽ¥è¿‘ï¼Œæ•…é»˜è®¤å­—é‡
% ä½¿ç”¨ Songti SC Lightï¼Œè€Œä¸å¸¦åŽç¼€çš„æ­£å¸¸å­—é‡äº‹å®žä¸Šæ²¡æœ‰ä½¿ç”¨ã€‚é»‘ä½“ã€åœ†ä½“ç­‰è®¾ç½®
% ä¹Ÿæœ‰ç±»ä¼¼çš„æƒ…å†µã€‚
%
%    \begin{macrocode}
%&lt;*macold|macnew&gt;
\ctex_fontset_case:nnnn
  { \ctex_fontset_error:n { mac } }
%&lt;*macold&gt;
  { \ctex_fontset_error:n { macold } }
  { \ctex_fontset_error:n { macold } }
%&lt;/macold&gt;
%&lt;*macnew&gt;
  {
    \ctex_zhmap_case:nnn
      {
        \setCJKmainfont { :3:Songti.ttc }
          [
            BoldFont       = :1:Songti.ttc,
            ItalicFont     = :0:Kaiti.ttc,
            BoldItalicFont = :3:Kaiti.ttc,
          ]
        \setCJKsansfont { :2:PingFang.ttc } [ BoldFont = :8:PingFang.ttc ]
        \setCJKmonofont { STFANGSO.ttf    }
        \setCJKfamilyfont { zhsong } { :3:Songti.ttc   } [ BoldFont = :1:Songti.ttc   ]
        \setCJKfamilyfont { zhhei  } { :2:PingFang.ttc } [ BoldFont = :8:PingFang.ttc ]
        \setCJKfamilyfont { zhkai  } { :0:Kaiti.ttc    } [ BoldFont = :3:Kaiti.ttc    ]
        \setCJKfamilyfont { zhfs   } { STFANGSO.ttf    }
        \setCJKfamilyfont { zhli   } { :0:Baoli.ttc    }
        \setCJKfamilyfont { zhyou  } { :4:Yuanti.ttc   } [ BoldFont = :0:Yuanti.ttc   ]
        \ctex_punct_set:n { mac }
        \ctex_punct_map_family:nn   { \CJKrmdefault         } { zhsong  }
        \ctex_punct_map_family:nn   { \CJKsfdefault         } { zhpf    }
        \ctex_punct_map_family:nn   { \CJKttdefault         } { zhfs    }
        \ctex_punct_map_itshape:nn  { \CJKrmdefault         } { zhkai   }
        \ctex_punct_map_bfseries:nn { \CJKrmdefault, zhsong } { zhsongb }
        \ctex_punct_map_bfseries:nn { \CJKsfdefault, zhhei  } { zhpfb   }
        \ctex_punct_map_bfseries:nn { zhyou                 } { zhyoub  }
      }
      {
        \ctex_load_zhmap:nnnn { rm } { zhhei } { zhfs } { mac }
        \ctex_punct_set:n { mac }
        \ctex_punct_map_family:nn   { \CJKrmdefault } { zhsong }
        \ctex_punct_map_family:nn   { \CJKsfdefault } { zhpf   }
        \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhpf   }
        \ctex_punct_map_itshape:nn  { \CJKrmdefault } { zhkai  }
      }
      { \ctex_fontset_error:n { macnew } }
  }
  {
    \ctex_set_upmap:nnn { upserif   } { :3:Songti.ttc } { :1:Songti.ttc }
    \ctex_set_upmap:nnn { upserifit } { :0:Kaiti.ttc  } { }
    \ctex_set_upmap:nnn { upstsl    } { :0:Baoli.ttc  } { }
    \ctex_set_upmap:nnn { upstht    } { :4:Yuanti.ttc } { }
    \ctex_set_upmap_unicode:nnn { upsans } { :2:PingFang.ttc } { :8:PingFang.ttc }
    \ctex_set_upmap_unicode:nnn { upmono } { STFANGSO.ttf    } { }
    \ctex_set_upfamily:nnn { zhsong } { upzhserif   } { upzhserifb }
    \ctex_set_upfamily:nnn { zhhei  } { upzhsans    } { upzhsansb  }
    \ctex_set_upfamily:nnn { zhfs   } { upzhmono    } { }
    \ctex_set_upfamily:nnn { zhkai  } { upzhserifit } { }
    \ctex_set_upfamily:nnn { zhli   } { upschrm     } { }
    \ctex_set_upfamily:nnn { zhyou  } { upschgt     } { }
  }
%&lt;/macnew&gt;
  {
%&lt;*macold&gt;
    \setCJKmainfont { STSong     }
      [ BoldFont = STHeiti, ItalicFont = STKaiti ]
    \setCJKsansfont { STXihei    } [ BoldFont = STHeiti ]
    \setCJKmonofont { STFangsong }
    \setCJKfamilyfont { zhsong } { STSong     }
    \setCJKfamilyfont { zhhei  } { STHeiti    }
    \setCJKfamilyfont { zhfs   } { STFangsong }
    \setCJKfamilyfont { zhkai  } { STKaiti    }
%&lt;/macold&gt;
%&lt;*macnew&gt;
    \setCJKmainfont { Songti~SC~Light }
      [
        BoldFont       = Songti~SC~Bold,
        ItalicFont     = Kaiti~SC,
        BoldItalicFont = Kaiti~SC~Bold
      ]
    \setCJKsansfont { PingFang~SC }
    \setCJKmonofont { STFangsong  }
    \setCJKfamilyfont { zhsong } { Songti~SC~Light } [ BoldFont = Songti~SC~Bold ]
    \setCJKfamilyfont { zhhei  } { Heiti~SC~Light  } [ BoldFont = Heiti~SC~Medium ]
    \setCJKfamilyfont { zhpf   } { PingFang~SC     }
    \setCJKfamilyfont { zhfs   } { STFangsong      }
    \setCJKfamilyfont { zhkai  } { Kaiti~SC        } [ BoldFont = Kaiti~SC~Bold ]
    \setCJKfamilyfont { zhli   } { Baoli~SC        }
    \setCJKfamilyfont { zhyou  } { Yuanti~SC~Light } [ BoldFont = Yuanti~SC~Regular ]
%&lt;/macnew&gt;
  }
%&lt;/macold|macnew&gt;
%    \end{macrocode}
%
% \paragraph{\opt{ubuntu}}
%
% \changes{v2.5}{2019/11/07}{\opt{ubuntu} æ”¹ç”¨æ€æºï¼ˆNoto CJKï¼‰å’Œæ–‡é¼Žå­—åº“ï¼Œä¸å†
% æ”¯æŒä½¿ç”¨ \pdfLaTeX{} ç¼–è¯‘ã€‚}
%
%    \begin{macrocode}
%&lt;*ubuntu&gt;
\ctex_fontset_case:nnnn
  { \ctex_fontset_error:n { ubuntu } }
  {
    \ctex_zhmap_case:nnn
      {
        \setCJKmainfont { :2:NotoSerifCJK-Regular.ttc }
          [ BoldFont = :2:NotoSerifCJK-Bold.ttc, ItalicFont = gkai00mp.ttf ]
        \setCJKsansfont { :2:NotoSansCJK-Regular.ttc  }
          [ BoldFont = :2:NotoSansCJK-Bold.ttc  ]
        \setCJKmonofont { :2:NotoSerifCJK-Regular.ttc }
          [ BoldFont = :2:NotoSerifCJK-Bold.ttc ]
        \setCJKfamilyfont { zhsong } { :2:NotoSerifCJK-Regular.ttc }
          [ BoldFont = :2:NotoSerifCJK-Bold.ttc ]
        \setCJKfamilyfont { zhhei  } { :2:NotoSansCJK-Regular.ttc  }
          [ BoldFont = :2:NotoSansCJK-Bold.ttc  ]
        \setCJKfamilyfont { zhkai  } { gkai00mp.ttf  }
        \ctex_punct_set:n { ubuntu }
        \ctex_punct_map_family:nn   { \CJKrmdefault        } { zhsong  }
        \ctex_punct_map_family:nn   { \CJKsfdefault        } { zhhei   }
        \ctex_punct_map_family:nn   { \CJKttdefault        } { zhsong  }
        \ctex_punct_map_itshape:nn  { \CJKrmdefault        } { zhkai   }
        \ctex_punct_map_bfseries:nn { \CJKsfdefault, zhhei } { zhheib  }
        \ctex_punct_map_bfseries:nn
          { \CJKrmdefault, \CJKttdefault, zhsong }
          { zhsongb }
      }
      {
        \ctex_load_zhmap:nnnn { rm } { zhhei } { zhsong } { ubuntu }
        \ctex_punct_set:n { ubuntu }
        \ctex_punct_map_family:nn   { \CJKrmdefault } { zhsong }
        \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei  }
        \ctex_punct_map_itshape:nn  { \CJKrmdefault } { zhkai  }
      }
      { \ctex_fontset_error:n { ubuntu } }
  }
  {
    \ctex_set_upmap_unicode:nnn { upserif }
      { :2:NotoSerifCJK-Regular.ttc } { :2:NotoSerifCJK-Bold.ttc }
    \ctex_set_upmap_unicode:nnn { upsans  }
      { :2:NotoSansCJK-Regular.ttc  } { :2:NotoSansCJK-Bold.ttc  }
    \ctex_set_upmap_unicode:nnn { upmono  }
      { :2:NotoSerifCJK-Regular.ttc } { }
    \ctex_set_upmap:nnn { upserifit } { gkai00mp.ttf  } { }
    \ctex_set_upfamily:nnn { zhsong } { upzhserif   } { upzhserifb }
    \ctex_set_upfamily:nnn { zhhei  } { upzhsans    } { upzhsansb  }
    \ctex_set_upfamily:nnn { zhkai  } { upzhserifit } { }
  }
  {
    \setCJKmainfont { Noto~Serif~CJK~SC } [ ItalicFont = AR~PL~KaitiM~GB ]
    \setCJKsansfont { Noto~Sans~CJK~SC  }
    \setCJKmonofont { Noto~Serif~CJK~SC }
    \setCJKfamilyfont { zhsong } { Noto~Serif~CJK~SC }
    \setCJKfamilyfont { zhhei  } { Noto~Sans~CJK~SC  }
    \setCJKfamilyfont { zhkai  } { AR~PL~KaitiM~GB   }
  }
%&lt;/ubuntu&gt;
%    \end{macrocode}
%
% \paragraph{\opt{windows}}
%
% \changes{v2.4.1}{2016/05/14}{ä½¿ç”¨ \file{bootfont.bin} åˆ¤æ–­ Windows XP ä»¥é¿å…
%   æƒé™é—®é¢˜ã€‚}
% \changes{v2.5}{2019/11/04}{ä½¿ç”¨çŽ¯å¢ƒå˜é‡ä»£æ›¿ç»å¯¹è·¯å¾„æŸ¥æ‰¾å­—ä½“ã€‚}
% \changes{v2.5}{2019/11/05}{ä¸å†æ”¯æŒ Windows XP ç³»ç»Ÿï¼Œ\opt{windowsold} å’Œ
%   \opt{windowsnew} æˆä¸ºè¿‡æ—¶å­—åº“é€‰é¡¹ã€‚}
%
% \begin{variable}{ \c_@@_msyh_suffix_tl}
% Windows 8 ä»¥åŽï¼Œå¾®è½¯é›…é»‘ç”±åŽŸæ¥çš„ \file{.ttf} åŽç¼€æ”¹ä¸º \file{.ttc} åŽç¼€ï¼Œéœ€è¦
% åŠ&nbsp;ä»¥åŒºåˆ†ã€‚
%    \begin{macrocode}
%&lt;*windows&gt;
\file_if_exist:nTF { \c_dollar_str WINDIR/Fonts/msyh.ttc }
  { \tl_const:Nn \c_@@_msyh_suffix_tl { ttc } }
  {
    \file_if_exist:nTF { msyh.ttc }
      { \tl_const:Nn \c_@@_msyh_suffix_tl { ttc } }
      { \tl_const:Nn \c_@@_msyh_suffix_tl { ttf } }
  }
%    \end{macrocode}
% \end{variable}
%
%    \begin{macrocode}
\ctex_fontset_case:nnn
  {
    \ctex_zhmap_case:nnn
      {
        \ctex_punct_set:n { windows }
        \setCJKmainfont { simsun.ttc }
          [ BoldFont = simhei.ttf, ItalicFont = simkai.ttf ]
        \setCJKsansfont { msyh.\c_@@_msyh_suffix_tl }
          [ BoldFont = msyhbd.\c_@@_msyh_suffix_tl ]
        \setCJKmonofont { simfang.ttf }
        \setCJKfamilyfont { zhsong  } { simsun.ttc  }
        \setCJKfamilyfont { zhhei   } { simhei.ttf  }
        \setCJKfamilyfont { zhfs    } { simfang.ttf }
        \setCJKfamilyfont { zhkai   } { simkai.ttf  }
        \setCJKfamilyfont { zhyahei } { msyh.\c_@@_msyh_suffix_tl }
          [ BoldFont = msyhbd.\c_@@_msyh_suffix_tl ]
        \setCJKfamilyfont { zhli    } { simli.ttf   }
        \setCJKfamilyfont { zhyou   } { simyou.ttf  }
        \ctex_punct_map_family:nn   { \CJKrmdefault          } { zhsong   }
        \ctex_punct_map_bfseries:nn { \CJKrmdefault          } { zhhei    }
        \ctex_punct_map_itshape:nn  { \CJKrmdefault          } { zhkai    }
        \ctex_punct_map_family:nn   { \CJKsfdefault          } { zhyahei  }
        \ctex_punct_map_bfseries:nn { \CJKsfdefault, zhyahei } { zhyaheib }
        \ctex_punct_map_family:nn   { \CJKttdefault          } { zhfs     }
      }
      {
        \ctex_load_zhmap:nnnn { rm } { zhhei } { zhfs } { windows }
        \ctex_punct_set:n { windows }
        \ctex_punct_map_family:nn   { \CJKrmdefault } { zhsong }
        \ctex_punct_map_bfseries:nn { \CJKrmdefault } { zhhei  }
        \ctex_punct_map_itshape:nn  { \CJKrmdefault } { zhkai  }
      }
      { }
  }
  {
    \ctex_set_upfonts:nnnnnn
      { simsun.ttc                   }
      { simhei.ttf                   }
      { simkai.ttf                   }
      { msyh.\c_@@_msyh_suffix_tl    }
      { msyhbd.\c_@@_msyh_suffix_tl  }
      { simfang.ttf                  }
    \ctex_set_upfamily:nnn { zhsong  } { upzhserif   } {}
    \ctex_set_upfamily:nnn { zhhei   } { upzhserifb  } {}
    \ctex_set_upfamily:nnn { zhfs    } { upzhmono    } {}
    \ctex_set_upfamily:nnn { zhkai   } { upzhserifit } {}
    \ctex_set_upfamily:nnn { zhyahei } { upzhsans    } { upzhsansb }
    \ctex_set_upfamily:nnn { zhli    } { upschrm     } {}
    \ctex_set_upfamily:nnn { zhyou   } { upschgt     } {}
    \ctex_set_upmap:nnn { upstsl } { simli.ttf  } {}
    \ctex_set_upmap:nnn { upstht } { simyou.ttf } {}
  }
  {
    \setCJKmainfont   { SimSun } [ BoldFont = SimHei , ItalicFont = KaiTi ]
    \setCJKsansfont   { Microsoft~YaHei } [ BoldFont = *~Bold ]
    \setCJKmonofont   { FangSong }
    \setCJKfamilyfont { zhsong  } { SimSun          }
    \setCJKfamilyfont { zhhei   } { SimHei          }
    \setCJKfamilyfont { zhfs    } { FangSong        }
    \setCJKfamilyfont { zhkai   } { KaiTi           }
    \setCJKfamilyfont { zhyahei } { Microsoft~YaHei } [ BoldFont = *~Bold ]
    \setCJKfamilyfont { zhli    } { LiSu            }
    \setCJKfamilyfont { zhyou   } { YouYuan         }
  }
%&lt;/windows&gt;
%    \end{macrocode}
%
% \subsubsection{ä¸­æ–‡å­—ä½“å‘½ä»¤}
% \changes{v2.4.14}{2018/05/01}{ä¸º \opt{macnew} é…ç½®å­—ä½“å‘½ä»¤ã€‚}
%
% \begin{macro}{\songti,\heiti,\fangsong,\kaishu,\lishu,\youyuan,\yahei,\pingfang}
% ä½¿ç”¨ \upLaTeX{} ç¼–è¯‘æ—¶ï¼Œ\opt{macnew} å­—åº“ä¸­ç”±äºŽä¼&nbsp;ç»Ÿé»‘ä½“ï¼ˆé»‘ä½“-ç®€ï¼‰æ—&nbsp;æ³•ä½¿ç”¨ï¼Œ
% æˆ‘ä»¬ç”¨è‹¹æ–¹æ¥ä»£æ›¿ã€‚åŒæ—¶ \tn{yahei}ã€\tn{pingfang} å‘½ä»¤è¢«è®¾ç½®ä¸ºä¸Ž \tn{heiti} ç›¸åŒã€‚
%    \begin{macrocode}
%&lt;*!mac&gt;
\NewDocumentCommand \songti   { } { \CJKfamily { zhsong  } }
\NewDocumentCommand \heiti    { } { \CJKfamily { zhhei   } }
%&lt;!ubuntu&gt;\NewDocumentCommand \fangsong { } { \CJKfamily { zhfs    } }
\NewDocumentCommand \kaishu   { } { \CJKfamily { zhkai   } }
%&lt;*windows|founder|macnew&gt;
\NewDocumentCommand \lishu    { } { \CJKfamily { zhli    } }
\NewDocumentCommand \youyuan  { } { \CJKfamily { zhyou   } }
%&lt;/windows|founder|macnew&gt;
%&lt;windows&gt;\NewDocumentCommand \yahei    { } { \CJKfamily { zhyahei } }
%&lt;*macnew&gt;
\bool_lazy_or:nnTF
  { \sys_if_engine_pdftex_p: }
  { \sys_if_engine_uptex_p:  }
  {
    \cs_new_eq:NN \yahei    \heiti
    \cs_new_eq:NN \pingfang \heiti
  }
  {
    \NewDocumentCommand \yahei    { } { \CJKfamily { zhpf } }
    \NewDocumentCommand \pingfang { } { \CJKfamily { zhpf } }
  }
%&lt;/macnew&gt;
%&lt;/!mac&gt;
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/fontset&gt;
%    \end{macrocode}
%
% \subsubsection{\pkg{zhmetrics} çš„å­—ä½“æ˜&nbsp;å°„}
%
% \changes{v2.5.2}{2020/05/05}{\file{zhadobefonts.tex} ç­‰å­—ä½“æ˜&nbsp;å°„æ–‡ä»¶æ›´åä¸º
%   \file{ctex-zhmap-*.tex}ã€‚}
%
% ç¡®è®¤ \tn{catcode}ï¼Œæ²¡æœ‰é‡å¤è½½å…¥æ£€æŸ¥ã€‚
%    \begin{macrocode}
%&lt;*zhmap&gt;
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode 35=6  % #
  \catcode 45=12 % -
  \catcode123=1  % {
  \catcode125=2  % }
  \toks0{\endlinechar=\the\endlinechar\relax}%
  \toks2{\endlinechar=-1 }%
  \def\x#1 #2 {%
    \toks0\expandafter{\the\toks0 \catcode#1=\the\catcode#1\relax}%
    \toks2\expandafter{\the\toks2 \catcode#1=#2 }}%
  \x  13  5 % carriage return
  \x  32 10 % space
  \x  35  6 % #
  \x  40 12 % (
  \x  41 12 % )
  \x  45 12 % -
  \x  46 12 % .
  \x  47 12 % /
  \x  58 12 % :
  \x  60 12 % &lt;
  \x  61 12 % =
  \x  64 11 % @
  \x  91 12 % [
  \x  93 12 % ]
  \x 123  1 % {
  \x 125  2 % }
  \edef\x#1{\endgroup%
    \edef\noexpand#1{%
      \the\toks0 %
      \let\noexpand\noexpand\noexpand#1%
          \noexpand\noexpand\noexpand\undefined%
      \noexpand\noexpand\noexpand\endinput}%
    \the\toks2}%
\expandafter\x\csname ctex@zhmap@endinput\endcsname
%    \end{macrocode}
%
% \begin{macro}[int]{\ifzhmappdf}
%    \begin{macrocode}
\begingroup\expandafter\endgroup
\expandafter\let\csname ifzhmappdf\expandafter\endcsname\csname
  \expandafter\ifx\csname ifctexpdf\endcsname\relax
    \expandafter\ifx\csname pdfoutput\endcsname\relax
      iffalse\else\ifnum\pdfoutput &lt; 1 iffalse\else iftrue\fi\fi
  \else ifctexpdf\fi
\endcsname
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ProvidesFile}
% æä¾›éž \LaTeX{} æ&nbsp;¼å¼ä¸‹çš„ \tn{ProvidesFile}ã€‚
%    \begin{macrocode}
\begingroup
\expandafter\ifx\csname ProvidesFile\endcsname\relax
  \long\def\x#1\ProvidesFile#2[#3]{%
    #1%
    \immediate\write-1{File: #2 #3}%
    \expandafter\xdef\csname ver@#2\endcsname{#3}}
  \expandafter\x%
\fi
\endgroup
%    \end{macrocode}
% \end{macro}
%
% æ–‡ä»¶æ&nbsp;‡è¯†ä¿¡æ¯ã€‚
%    \begin{macrocode}
%&lt;adobe&gt;\ProvidesFile{ctex-zhmap-adobe.tex}%
%&lt;adobe&gt;  [2022/07/14 v2.5.10 Adobe font map loader for DVIPDFMx (CTEX)]
%&lt;fandol&gt;\ProvidesFile{ctex-zhmap-fandol.tex}%
%&lt;fandol&gt;  [2022/07/14 v2.5.10 Fandol font map loader for DVIPDFMx (CTEX)]
%&lt;founder&gt;\ProvidesFile{ctex-zhmap-founder.tex}%
%&lt;founder&gt;  [2022/07/14 v2.5.10 Founder font map loader for pdfTeX and DVIPDFMx (CTEX)]
%&lt;mac&gt;\ProvidesFile{ctex-zhmap-mac.tex}%
%&lt;mac&gt;  [2022/07/14 v2.5.10 Mac font map loader for DVIPDFMx (CTEX)]
%&lt;ubuntu&gt;\ProvidesFile{ctex-zhmap-ubuntu.tex}%
%&lt;ubuntu&gt;  [2022/07/14 v2.5.10 Ubuntu font map loader for DVIPDFMx (CTEX)]
%&lt;windows&gt;\ProvidesFile{ctex-zhmap-windows.tex}%
%&lt;windows&gt;  [2022/07/14 v2.5.10 Windows font map loader for pdfTeX and DVIPDFMx (CTEX)]
%    \end{macrocode}
%
% \paragraph{\pkg{ctex-zhmap-adobe.tex}}
%
%    \begin{macrocode}
%&lt;*adobe&gt;
\ifzhmappdf
%% pdfTeX does not support OTF fonts
\else
  \special{pdf:mapline gbk@UGBK@          UniGB-UTF16-H AdobeSongStd-Light.otf}
  \special{pdf:mapline gbksong@UGBK@      UniGB-UTF16-H AdobeSongStd-Light.otf}
  \special{pdf:mapline gbkkai@UGBK@       UniGB-UTF16-H AdobeKaitiStd-Regular.otf}
  \special{pdf:mapline gbkhei@UGBK@       UniGB-UTF16-H AdobeHeitiStd-Regular.otf}
  \special{pdf:mapline gbkfs@UGBK@        UniGB-UTF16-H AdobeFangsongStd-Regular.otf}
  \special{pdf:mapline cyberb@Unicode@    UniGB-UTF16-H AdobeSongStd-Light.otf}
  \special{pdf:mapline unisong@Unicode@   UniGB-UTF16-H AdobeSongStd-Light.otf}
  \special{pdf:mapline unikai@Unicode@    UniGB-UTF16-H AdobeKaitiStd-Regular.otf}
  \special{pdf:mapline unihei@Unicode@    UniGB-UTF16-H AdobeHeitiStd-Regular.otf}
  \special{pdf:mapline unifs@Unicode@     UniGB-UTF16-H AdobeFangsongStd-Regular.otf}
  \special{pdf:mapline gbksongsl@UGBK@    UniGB-UTF16-H AdobeSongStd-Light.otf       -s .167}
  \special{pdf:mapline gbkkaisl@UGBK@     UniGB-UTF16-H AdobeKaitiStd-Regular.otf    -s .167}
  \special{pdf:mapline gbkheisl@UGBK@     UniGB-UTF16-H AdobeHeitiStd-Regular.otf    -s .167}
  \special{pdf:mapline gbkfssl@UGBK@      UniGB-UTF16-H AdobeFangsongStd-Regular.otf -s .167}
  \special{pdf:mapline unisongsl@Unicode@ UniGB-UTF16-H AdobeSongStd-Light.otf       -s .167}
  \special{pdf:mapline unikaisl@Unicode@  UniGB-UTF16-H AdobeKaitiStd-Regular.otf    -s .167}
  \special{pdf:mapline uniheisl@Unicode@  UniGB-UTF16-H AdobeHeitiStd-Regular.otf    -s .167}
  \special{pdf:mapline unifssl@Unicode@   UniGB-UTF16-H AdobeFangsongStd-Regular.otf -s .167}
\fi
%&lt;/adobe&gt;
%    \end{macrocode}
%
% \paragraph{\pkg{ctex-zhmap-fandol.tex}}
%
%    \begin{macrocode}
%&lt;*fandol&gt;
\ifzhmappdf
%% pdfTeX does not support OTF fonts
\else
  \special{pdf:mapline gbk@UGBK@          UniGB-UTF16-H FandolSong-Regular.otf}
  \special{pdf:mapline gbksong@UGBK@      UniGB-UTF16-H FandolSong-Regular.otf}
  \special{pdf:mapline gbkkai@UGBK@       UniGB-UTF16-H FandolKai-Regular.otf}
  \special{pdf:mapline gbkhei@UGBK@       UniGB-UTF16-H FandolHei-Regular.otf}
  \special{pdf:mapline gbkfs@UGBK@        UniGB-UTF16-H FandolFang-Regular.otf}
  \special{pdf:mapline cyberb@Unicode@    UniGB-UTF16-H FandolSong-Regular.otf}
  \special{pdf:mapline unisong@Unicode@   UniGB-UTF16-H FandolSong-Regular.otf}
  \special{pdf:mapline unikai@Unicode@    UniGB-UTF16-H FandolKai-Regular.otf}
  \special{pdf:mapline unihei@Unicode@    UniGB-UTF16-H FandolHei-Regular.otf}
  \special{pdf:mapline unifs@Unicode@     UniGB-UTF16-H FandolFang-Regular.otf}
  \special{pdf:mapline gbksongsl@UGBK@    UniGB-UTF16-H FandolSong-Regular.otf -s .167}
  \special{pdf:mapline gbkkaisl@UGBK@     UniGB-UTF16-H FandolKai-Regular.otf  -s .167}
  \special{pdf:mapline gbkheisl@UGBK@     UniGB-UTF16-H FandolHei-Regular.otf  -s .167}
  \special{pdf:mapline gbkfssl@UGBK@      UniGB-UTF16-H FandolFang-Regular.otf -s .167}
  \special{pdf:mapline unisongsl@Unicode@ UniGB-UTF16-H FandolSong-Regular.otf -s .167}
  \special{pdf:mapline unikaisl@Unicode@  UniGB-UTF16-H FandolKai-Regular.otf  -s .167}
  \special{pdf:mapline uniheisl@Unicode@  UniGB-UTF16-H FandolHei-Regular.otf  -s .167}
  \special{pdf:mapline unifssl@Unicode@   UniGB-UTF16-H FandolFang-Regular.otf -s .167}
\fi
%&lt;/fandol&gt;
%    \end{macrocode}
%
% \paragraph{\pkg{ctex-zhmap-founder.tex}}
%
%    \begin{macrocode}
%&lt;*founder&gt;
\ifzhmappdf
  \pdfmapline{=gbk@UGBK@          &lt;FZSSK.TTF}
  \pdfmapline{=gbksong@UGBK@      &lt;FZSSK.TTF}
  \pdfmapline{=gbkkai@UGBK@       &lt;FZKTK.TTF}
  \pdfmapline{=gbkhei@UGBK@       &lt;FZHTK.TTF}
  \pdfmapline{=gbkfs@UGBK@        &lt;FZFSK.TTF}
  \pdfmapline{=gbkli@UGBK@        &lt;FZLSK.TTF}
  \pdfmapline{=gbkyou@UGBK@       &lt;FZY1K.TTF}
  \pdfmapline{=cyberb@Unicode@    &lt;FZSSK.TTF}
  \pdfmapline{=unisong@Unicode@   &lt;FZSSK.TTF}
  \pdfmapline{=unikai@Unicode@    &lt;FZKTK.TTF}
  \pdfmapline{=unihei@Unicode@    &lt;FZHTK.TTF}
  \pdfmapline{=unifs@Unicode@     &lt;FZFSK.TTF}
  \pdfmapline{=unili@Unicode@     &lt;FZLSK.TTF}
  \pdfmapline{=uniyou@Unicode@    &lt;FZY1K.TTF}
  \pdfmapline{=gbksongsl@UGBK@    &lt;FZSSK.TTF}
  \pdfmapline{=gbkkaisl@UGBK@     &lt;FZKTK.TTF}
  \pdfmapline{=gbkheisl@UGBK@     &lt;FZHTK.TTF}
  \pdfmapline{=gbkfssl@UGBK@      &lt;FZFSK.TTF}
  \pdfmapline{=gbklisl@UGBK@      &lt;FZLSK.TTF}
  \pdfmapline{=gbkyousl@UGBK@     &lt;FZY1K.TTF}
  \pdfmapline{=unisongsl@Unicode@ &lt;FZSSK.TTF}
  \pdfmapline{=unikaisl@Unicode@  &lt;FZKTK.TTF}
  \pdfmapline{=uniheisl@Unicode@  &lt;FZHTK.TTF}
  \pdfmapline{=unifssl@Unicode@   &lt;FZFSK.TTF}
  \pdfmapline{=unilisl@Unicode@   &lt;FZLSK.TTF}
  \pdfmapline{=uniyousl@Unicode@  &lt;FZY1K.TTF}
\else
  \special{pdf:mapline gbk@UGBK@          unicode FZSSK.TTF}
  \special{pdf:mapline gbksong@UGBK@      unicode FZSSK.TTF}
  \special{pdf:mapline gbkkai@UGBK@       unicode FZKTK.TTF}
  \special{pdf:mapline gbkhei@UGBK@       unicode FZHTK.TTF}
  \special{pdf:mapline gbkfs@UGBK@        unicode FZFSK.TTF}
  \special{pdf:mapline gbkli@UGBK@        unicode FZLSK.TTF}
  \special{pdf:mapline gbkyou@UGBK@       unicode FZY1K.TTF}
  \special{pdf:mapline cyberb@Unicode@    unicode FZSSK.TTF}
  \special{pdf:mapline unisong@Unicode@   unicode FZSSK.TTF}
  \special{pdf:mapline unikai@Unicode@    unicode FZKTK.TTF}
  \special{pdf:mapline unihei@Unicode@    unicode FZHTK.TTF}
  \special{pdf:mapline unifs@Unicode@     unicode FZFSK.TTF}
  \special{pdf:mapline unili@Unicode@     unicode FZLSK.TTF}
  \special{pdf:mapline uniyou@Unicode@    unicode FZY1K.TTF}
  \special{pdf:mapline gbksongsl@UGBK@    unicode FZSSK.TTF -s .167}
  \special{pdf:mapline gbkkaisl@UGBK@     unicode FZKTK.TTF -s .167}
  \special{pdf:mapline gbkheisl@UGBK@     unicode FZHTK.TTF -s .167}
  \special{pdf:mapline gbkfssl@UGBK@      unicode FZFSK.TTF -s .167}
  \special{pdf:mapline gbklisl@UGBK@      unicode FZLSK.TTF -s .167}
  \special{pdf:mapline gbkyousl@UGBK@     unicode FZY1K.TTF -s .167}
  \special{pdf:mapline unisongsl@Unicode@ unicode FZSSK.TTF -s .167}
  \special{pdf:mapline unikaisl@Unicode@  unicode FZKTK.TTF -s .167}
  \special{pdf:mapline uniheisl@Unicode@  unicode FZHTK.TTF -s .167}
  \special{pdf:mapline unifssl@Unicode@   unicode FZFSK.TTF -s .167}
  \special{pdf:mapline unilisl@Unicode@   unicode FZLSK.TTF -s .167}
  \special{pdf:mapline uniyousl@Unicode@  unicode FZY1K.TTF -s .167}
\fi
%&lt;/founder&gt;
%    \end{macrocode}
%
% \paragraph{\pkg{ctex-zhmap-mac.tex}}
%
% \changes{v2.5}{2020/01/15}{å¢žåŠ&nbsp;å­—ä½“æ˜&nbsp;å°„æ–‡ä»¶ \file{zhmacfonts.tex}ã€‚}
%
%    \begin{macrocode}
%&lt;*mac&gt;
\ifzhmappdf
%% pdfTeX does not support OTF fonts
\else
  \special{pdf:mapline gbk@UGBK@          UniGB-UTF16-H :3:Songti.ttc}
  \special{pdf:mapline gbksong@UGBK@      UniGB-UTF16-H :3:Songti.ttc}
  \special{pdf:mapline gbkkai@UGBK@       UniGB-UTF16-H :0:Kaiti.ttc}
  \special{pdf:mapline gbkhei@UGBK@       unicode       :2:PingFang.ttc}
  \special{pdf:mapline gbkfs@UGBK@        unicode       STFANGSO.ttf}
  \special{pdf:mapline gbkli@UGBK@        UniGB-UTF16-H :0:Baoli.ttc}
  \special{pdf:mapline gbkyou@UGBK@       UniGB-UTF16-H :4:Yuanti.ttc}
  \special{pdf:mapline cyberb@Unicode@    UniGB-UTF16-H :3:Songti.ttc}
  \special{pdf:mapline unisong@Unicode@   UniGB-UTF16-H :3:Songti.ttc}
  \special{pdf:mapline unikai@Unicode@    UniGB-UTF16-H :0:Kaiti.ttc}
  \special{pdf:mapline unihei@Unicode@    unicode       :2:PingFang.ttc}
  \special{pdf:mapline unifs@Unicode@     unicode       STFANGSO.ttf}
  \special{pdf:mapline unili@Unicode@     UniGB-UTF16-H :0:Baoli.ttc}
  \special{pdf:mapline uniyou@Unicode@    UniGB-UTF16-H :4:Yuanti.ttc}
  \special{pdf:mapline gbksongsl@UGBK@    UniGB-UTF16-H :3:Songti.ttc   -s .167}
  \special{pdf:mapline gbkkaisl@UGBK@     UniGB-UTF16-H :0:Kaiti.ttc    -s .167}
  \special{pdf:mapline gbkheisl@UGBK@     unicode       :2:PingFang.ttc -s .167}
  \special{pdf:mapline gbkfssl@UGBK@      unicode       STFANGSO.ttf    -s .167}
  \special{pdf:mapline gbklisl@UGBK@      UniGB-UTF16-H :0:Baoli.ttc    -s .167}
  \special{pdf:mapline gbkyousl@UGBK@     UniGB-UTF16-H :4:Yuanti.ttc   -s .167}
  \special{pdf:mapline unisongsl@Unicode@ UniGB-UTF16-H :3:Songti.ttc   -s .167}
  \special{pdf:mapline unikaisl@Unicode@  UniGB-UTF16-H :0:Kaiti.ttc    -s .167}
  \special{pdf:mapline uniheisl@Unicode@  unicode       :2:PingFang.ttc -s .167}
  \special{pdf:mapline unifssl@Unicode@   unicode       STFANGSO.ttf    -s .167}
  \special{pdf:mapline unilisl@Unicode@   UniGB-UTF16-H :0:Baoli.ttc    -s .167}
  \special{pdf:mapline uniyousl@Unicode@  UniGB-UTF16-H :4:Yuanti.ttc   -s .167}
\fi
%&lt;/mac&gt;
%    \end{macrocode}
%
% \paragraph{\pkg{ctex-zhmap-ubuntu.tex}}
%
%    \begin{macrocode}
%&lt;*ubuntu&gt;
\ifzhmappdf
%% pdfTeX does not support OTF fonts
\else
  \special{pdf:mapline gbk@UGBK@          unicode :2:NotoSerifCJK-Regular.ttc}
  \special{pdf:mapline gbksong@UGBK@      unicode :2:NotoSerifCJK-Regular.ttc}
  \special{pdf:mapline gbkkai@UGBK@       unicode gkai00mp.ttf}
  \special{pdf:mapline gbkhei@UGBK@       unicode :2:NotoSansCJK-Regular.ttc}
  \special{pdf:mapline gbkfs@UGBK@        unicode :2:NotoSerifCJK-Regular.ttc}
  \special{pdf:mapline cyberb@Unicode@    unicode :2:NotoSerifCJK-Regular.ttc}
  \special{pdf:mapline unisong@Unicode@   unicode :2:NotoSerifCJK-Regular.ttc}
  \special{pdf:mapline unikai@Unicode@    unicode gkai00mp.ttf}
  \special{pdf:mapline unihei@Unicode@    unicode :2:NotoSansCJK-Regular.ttc}
  \special{pdf:mapline unifs@Unicode@     unicode :2:NotoSerifCJK-Regular.ttc}
  \special{pdf:mapline gbksongsl@UGBK@    unicode :2:NotoSerifCJK-Regular.ttc -s .167}
  \special{pdf:mapline gbkkaisl@UGBK@     unicode gkai00mp.ttf                -s .167}
  \special{pdf:mapline gbkheisl@UGBK@     unicode :2:NotoSansCJK-Regular.ttc  -s .167}
  \special{pdf:mapline gbkfssl@UGBK@      unicode :2:NotoSerifCJK-Regular.ttc -s .167}
  \special{pdf:mapline unisongsl@Unicode@ unicode :2:NotoSerifCJK-Regular.ttc -s .167}
  \special{pdf:mapline unikaisl@Unicode@  unicode gkai00mp.ttf                -s .167}
  \special{pdf:mapline uniheisl@Unicode@  unicode :2:NotoSansCJK-Regular.ttc  -s .167}
  \special{pdf:mapline unifssl@Unicode@   unicode :2:NotoSerifCJK-Regular.ttc -s .167}
\fi
%&lt;/ubuntu&gt;
%    \end{macrocode}
%
% \paragraph{\pkg{ctex-zhmap-windows.tex}}
%
%    \begin{macrocode}
%&lt;*windows&gt;
\ifzhmappdf
  \pdfmapline{=gbk@UGBK@          &lt;simsun.ttc}
  \pdfmapline{=gbksong@UGBK@      &lt;simsun.ttc}
  \pdfmapline{=gbkkai@UGBK@       &lt;simkai.ttf}
  \pdfmapline{=gbkhei@UGBK@       &lt;simhei.ttf}
  \pdfmapline{=gbkfs@UGBK@        &lt;simfang.ttf}
  \pdfmapline{=gbkli@UGBK@        &lt;simli.ttf}
  \pdfmapline{=gbkyou@UGBK@       &lt;simyou.ttf}
  \pdfmapline{=cyberb@Unicode@    &lt;simsun.ttc}
  \pdfmapline{=unisong@Unicode@   &lt;simsun.ttc}
  \pdfmapline{=unikai@Unicode@    &lt;simkai.ttf}
  \pdfmapline{=unihei@Unicode@    &lt;simhei.ttf}
  \pdfmapline{=unifs@Unicode@     &lt;simfang.ttf}
  \pdfmapline{=unili@Unicode@     &lt;simli.ttf}
  \pdfmapline{=uniyou@Unicode@    &lt;simyou.ttf}
  \pdfmapline{=gbksongsl@UGBK@    &lt;simsun.ttc}
  \pdfmapline{=gbkkaisl@UGBK@     &lt;simkai.ttf}
  \pdfmapline{=gbkheisl@UGBK@     &lt;simhei.ttf}
  \pdfmapline{=gbkfssl@UGBK@      &lt;simfang.ttf}
  \pdfmapline{=gbklisl@UGBK@      &lt;simli.ttf}
  \pdfmapline{=gbkyousl@UGBK@     &lt;simyou.ttf}
  \pdfmapline{=unisongsl@Unicode@ &lt;simsun.ttc}
  \pdfmapline{=unikaisl@Unicode@  &lt;simkai.ttf}
  \pdfmapline{=uniheisl@Unicode@  &lt;simhei.ttf}
  \pdfmapline{=unifssl@Unicode@   &lt;simfang.ttf}
  \pdfmapline{=unilisl@Unicode@   &lt;simli.ttf}
  \pdfmapline{=uniyousl@Unicode@  &lt;simyou.ttf}
\else
  \special{pdf:mapline gbk@UGBK@          unicode :0:simsun.ttc -v 50}
  \special{pdf:mapline gbksong@UGBK@      unicode :0:simsun.ttc -v 50}
  \special{pdf:mapline gbkkai@UGBK@       unicode simkai.ttf    -v 70}
  \special{pdf:mapline gbkhei@UGBK@       unicode simhei.ttf    -v 150}
  \special{pdf:mapline gbkfs@UGBK@        unicode simfang.ttf   -v 50}
  \special{pdf:mapline gbkli@UGBK@        unicode simli.ttf     -v 150}
  \special{pdf:mapline gbkyou@UGBK@       unicode simyou.ttf    -v 60}
  \special{pdf:mapline cyberb@Unicode@    unicode :0:simsun.ttc -v 50}
  \special{pdf:mapline unisong@Unicode@   unicode :0:simsun.ttc -v 50}
  \special{pdf:mapline unikai@Unicode@    unicode simkai.ttf    -v 70}
  \special{pdf:mapline unihei@Unicode@    unicode simhei.ttf    -v 150}
  \special{pdf:mapline unifs@Unicode@     unicode simfang.ttf   -v 50}
  \special{pdf:mapline unili@Unicode@     unicode simli.ttf     -v 150}
  \special{pdf:mapline uniyou@Unicode@    unicode simyou.ttf    -v 60}
  \special{pdf:mapline gbksongsl@UGBK@    unicode :0:simsun.ttc -v 50  -s .167}
  \special{pdf:mapline gbkkaisl@UGBK@     unicode simkai.ttf    -v 70  -s .167}
  \special{pdf:mapline gbkheisl@UGBK@     unicode simhei.ttf    -v 150 -s .167}
  \special{pdf:mapline gbkfssl@UGBK@      unicode simfang.ttf   -v 50  -s .167}
  \special{pdf:mapline gbklisl@UGBK@      unicode simli.ttf     -v 150 -s .167}
  \special{pdf:mapline gbkyousl@UGBK@     unicode simyou.ttf    -v 60  -s .167}
  \special{pdf:mapline unisongsl@Unicode@ unicode :0:simsun.ttc -v 50  -s .167}
  \special{pdf:mapline unikaisl@Unicode@  unicode simkai.ttf    -v 70  -s .167}
  \special{pdf:mapline uniheisl@Unicode@  unicode simhei.ttf    -v 150 -s .167}
  \special{pdf:mapline unifssl@Unicode@   unicode simfang.ttf   -v 50  -s .167}
  \special{pdf:mapline unilisl@Unicode@   unicode simli.ttf     -v 150 -s .167}
  \special{pdf:mapline uniyousl@Unicode@  unicode simyou.ttf    -v 60  -s .167}
\fi
%&lt;/windows&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
\ctex@zhmap@endinput
%&lt;/zhmap&gt;
%    \end{macrocode}
%
% \subsubsection{åˆ¶ä½œ \texttt{spa} æ–‡ä»¶}
%
% \changes{v2.5.2}{2020/05/05}{\file{ctexmakespa.tex} æ›´åä¸º \file{ctex-spa-make.tex}ã€‚}
% \changes{v2.5.2}{2020/05/05}{\file{ctexspamacro.tex} æ›´åä¸º \file{ctex-spa-macro.tex}ã€‚}
%
% æˆ‘ä»¬é€šè¿‡ \XeTeX{} çš„ \tn{XeTeXglyphbounds} å–å¾—å­—ä½“ä¸­æ&nbsp;‡ç‚¹ç¬¦å·çš„è¾¹ç•Œä¿¡æ¯ï¼Œä¸º
% \pkg{CJKpunct} å®åŒ…åˆ¶ä½œ \file{spa}ã€‚
%
%    \begin{macrocode}
%&lt;*spa&gt;
%&lt;*macro&gt;
\input expl3-generic %
\ExplSyntaxOn
\sys_if_engine_xetex:F
  {
    \msg_new:nnn { ctex } { xetex }
      { XeTeX~is~required~to~compile~this~document! }
    \msg_fatal:nn { ctex } { xetex }
  }
%    \end{macrocode}
%
% \pkg{CJKpunct} å®šä¹‰çš„æ&nbsp;‡ç‚¹ç¬¦å·æ˜¯ï¼š
% \begin{verbatim}
%   â€˜â€œã€Œã€Žã€”ï¼ˆï¼»ï½›ã€ˆã€Šã€–ã€
%   â€”â€¦ã€ã€‚ï¼Œï¼Žï¼šï¼›ï¼ï¼Ÿï¼…ã€•ï¼‰ï¼½ï½ã€‰ã€‹ã€—ã€‘â€™â€ã€ã€
% \end{verbatim}
% æ³¨æ„é¡ºåºä¸èƒ½æ”¹å˜ã€‚
%    \begin{macrocode}
\seq_const_from_clist:Nn \c_@@_punct_seq
  {
    "2018 , "201C , "300C , "300E , "3014 , "FF08 , "FF3B , "FF5B ,
    "3008 , "300A , "3016 , "3010 ,
    "2014 , "2026 , "3001 , "3002 , "FF0C , "FF0E , "FF1A , "FF1B ,
    "FF01 , "FF1F , "FF05 , "3015 , "FF09 , "FF3D , "FF5D , "3009 ,
    "300B , "3017 , "3011 , "2019 , "201D , "300D , "300F
  }
%    \end{macrocode}
%
% \begin{macro}[int]{\ctex_make_spa:nn}
% |#1| æ˜¯ \file{spa} æ–‡ä»¶åï¼Œ|#2| æ˜¯ç”± CJK æ—åä¸Žå­—ä½“æž„æˆçš„é€—å·åˆ—è¡¨ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_make_spa:nn #1#2
  {
    \iow_open:Nn \g_@@_spa_iow {#1}
    \clist_map_inline:nn {#2}
      { \@@_write_family:nn ##1 }
    \iow_close:N \g_@@_spa_iow
  }
\iow_new:N \g_@@_spa_iow
\cs_new_eq:NN \MAKESPA \ctex_make_spa:nn
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\cs_new_protected:Npn \@@_write_family:nn #1#2
  {
    \group_begin:
      \tex_font:D \l_@@_punct_font = "#2" ~ at ~ 100 pt \scan_stop:
      \l_@@_punct_font
      \clist_clear:N \l_@@_punct_bounds_clist
      \seq_map_inline:Nn \c_@@_punct_seq
        { \exp_args:No \@@_save_bounds:n { \int_use:N \tex_XeTeXcharglyph:D ##1 } }
      \iow_now:Nx \g_@@_spa_iow
        {
          \token_to_str:N \ctexspadef {#1}
%    \end{macrocode}
% æœ€åŽè¿™ä¸‰ä¸ªé€—å·å¯¹ \pkg{CJKpunct} æ¥è¯´æ˜¯å¿…è¦çš„ã€‚
%    \begin{macrocode}
            { \l_@@_punct_bounds_clist , , , }
        }
    \group_end:
  }
\cs_new_protected:Npn \@@_save_bounds:n #1
  {
    \clist_put_right:Nx \l_@@_punct_bounds_clist
      {
        \@@_calc_bounds:nn { 1 } {#1} ,
        \@@_calc_bounds:nn { 3 } {#1}
      }
  }
\clist_new:N \l_@@_punct_bounds_clist
%    \end{macrocode}
%
% \pkg{CJKpunct} è¦æ±‚çš„æ&nbsp;¼å¼æ˜¯è¾¹ç•Œç©ºç™½å®½åº¦ä¸Ž 1\,em çš„æ¯”å€¼çš„ä¸€ç™¾å€ã€‚
%    \begin{macrocode}
\cs_new:Npn \@@_calc_bounds:nn #1#2
  {
    \fp_eval:n
      {
        round
          (
            \dim_to_decimal_in_unit:nn
              { 100 \tex_XeTeXglyphbounds:D #1 ~ #2 }
              { 1 em }
          )
      }
  }
\ExplSyntaxOff
%&lt;/macro&gt;
%    \end{macrocode}
%
% ä¸‹é¢æ˜¯ \CTeX{} å®šä¹‰çš„ä¸€äº›å­—ä½“ã€‚
%    \begin{macrocode}
%&lt;*make&gt;
\input ctex-spa-macro %
\MAKESPA {ctexpunct.spa}
  {
    {adobezhsong}     {AdobeSongStd-Light} ,
    {adobezhhei}      {AdobeHeitiStd-Regular} ,
    {adobezhkai}      {AdobeKaitiStd-Regular} ,
    {adobezhfs}       {AdobeFangsongStd-Regular} ,
%
    {fandolzhsong}    {FandolSong} ,
    {fandolzhsongb}   {FandolSong-Bold} ,
    {fandolzhhei}     {FandolHei} ,
    {fandolzhheib}    {FandolHei-Bold} ,
    {fandolzhkai}     {FandolKai} ,
    {fandolzhfs}      {FandolFang} ,
%
    {founderzhsong}   {FZShuSong-Z01} ,
    {founderzhsongb}  {FZXiaoBiaoSong-B05} ,
    {founderzhhei}    {FZHei-B01} ,
    {founderzhheil}   {FZXiHeiI-Z08} ,
    {founderzhkai}    {FZKai-Z03} ,
    {founderzhfs}     {FZFangSong-Z02} ,
    {founderzhli}     {FZLiShu-S01} ,
    {founderzhyou}    {FZXiYuan-M01} ,
    {founderzhyoub}   {FZZhunYuan-M02} ,
%
    {maczhsong}       {Songti SC Light} ,
    {maczhsongb}      {Songti SC Bold} ,
    {maczhhei}        {Heiti SC Medium} ,
    {maczhheil}       {Heiti SC Light} ,
    {maczhkai}        {Kaiti SC} ,
    {maczhkaib}       {Kaiti SC Bold} ,
    {maczhfs}         {STFangsong} ,
    {maczhli}         {Baoli SC} ,
    {maczhyou}        {Yuanti SC Light} ,
    {maczhyoub}       {Yuanti SC Regular} ,
    {maczhpf}         {PingFang SC} ,
    {maczhpfb}        {PingFang SC Semibold} ,
%
    {ubuntuzhsong}    {Noto Serif CJK SC} ,
    {ubuntuzhsongb}   {Noto Serif CJK SC Bold} ,
    {ubuntuzhhei}     {Noto Sans CJK SC} ,
    {ubuntuzhheib}    {Noto Sans CJK SC Bold} ,
    {ubuntuzhkai}     {AR PL KaitiM GB} ,
%
    {windowszhsong}   {SimSun} ,
    {windowszhhei}    {SimHei} ,
    {windowszhkai}    {KaiTi} ,
    {windowszhfs}     {FangSong} ,
    {windowszhli}     {LiSu} ,
    {windowszhyou}    {YouYuan} ,
    {windowszhyahei}  {Microsoft YaHei} ,
    {windowszhyaheib} {Microsoft YaHei Bold}
  }
\primitive\end
%&lt;/make&gt;
%&lt;/spa&gt;
%    \end{macrocode}
%
% \subsection{\pkg{translator} å®åŒ…çš„ä¸­æ–‡å­—å…¸}
%
%    \begin{macrocode}
%&lt;*dict&gt;
%    \end{macrocode}
%
% \changes{v2.4}{2016/02/19}{æä¾› \pkg{translator} å®åŒ…çš„ä¸­æ–‡å®šç†åç§°ç¿»è¯‘ã€‚}
%
% åŒ…æ‹¬ \pkg{ChineseGBK} å’Œ \pkg{ChineseUTF8} ä¸¤ç§å½¢å¼ï¼Œç›®å‰åªç¿»è¯‘ \pkg{beamer}
% å®åŒ…éœ€è¦çš„å®šç†çŽ¯å¢ƒåç§°ã€‚
%
%    \begin{macrocode}
%&lt;*theorem&gt;
\providetranslation{Comments}{è¯„è®º}
\providetranslation{comments}{è¯„è®º}
\providetranslation{Comment}{è¯„è®º}
\providetranslation{comment}{è¯„è®º}
\providetranslation{Corollaries}{æŽ¨è®º}
\providetranslation{corollaries}{æŽ¨è®º}
\providetranslation{Corollary}{æŽ¨è®º}
\providetranslation{corollary}{æŽ¨è®º}
\providetranslation{Definitions}{å®šä¹‰}
\providetranslation{definitions}{å®šä¹‰}
\providetranslation{Definition}{å®šä¹‰}
\providetranslation{definition}{å®šä¹‰}
\providetranslation{Examples}{ä¾‹}
\providetranslation{examples}{ä¾‹}
\providetranslation{Example}{ä¾‹}
\providetranslation{example}{ä¾‹}
\providetranslation{Exercises}{ç»ƒä¹&nbsp;}
\providetranslation{exercises}{ç»ƒä¹&nbsp;}
\providetranslation{Exercise}{ç»ƒä¹&nbsp;}
\providetranslation{exercise}{ç»ƒä¹&nbsp;}
\providetranslation{Facts}{äº‹å®ž}
\providetranslation{facts}{äº‹å®ž}
\providetranslation{Fact}{äº‹å®ž}
\providetranslation{fact}{äº‹å®ž}
\providetranslation{Key Lemmas}{å…³é”®å¼•ç†}
\providetranslation{key lemmas}{å…³é”®å¼•ç†}
\providetranslation{Key Lemma}{å…³é”®å¼•ç†}
\providetranslation{key lemma}{å…³é”®å¼•ç†}
\providetranslation{Key Observations}{å…³é”®è§‚å¯Ÿ}
\providetranslation{key observations}{å…³é”®è§‚å¯Ÿ}
\providetranslation{Key Observation}{å…³é”®è§‚å¯Ÿ}
\providetranslation{key observation}{å…³é”®è§‚å¯Ÿ}
\providetranslation{Lemmas}{å¼•ç†}
\providetranslation{lemmas}{å¼•ç†}
\providetranslation{Lemma}{å¼•ç†}
\providetranslation{lemma}{å¼•ç†}
\providetranslation{Main Theorems}{ä¸»è¦å®šç†}
\providetranslation{main theorems}{ä¸»è¦å®šç†}
\providetranslation{Main Theorem}{ä¸»è¦å®šç†}
\providetranslation{main theorem}{ä¸»è¦å®šç†}
\providetranslation{Observations}{è§‚å¯Ÿ}
\providetranslation{observations}{è§‚å¯Ÿ}
\providetranslation{Observation}{è§‚å¯Ÿ}
\providetranslation{observation}{è§‚å¯Ÿ}
\providetranslation{Problems}{é—®é¢˜}
\providetranslation{problems}{é—®é¢˜}
\providetranslation{Problem}{é—®é¢˜}
\providetranslation{problem}{é—®é¢˜}
\providetranslation{Proofs}{è¯æ˜Ž}
\providetranslation{proofs}{è¯æ˜Ž}
\providetranslation{Proof}{è¯æ˜Ž}
\providetranslation{proof}{è¯æ˜Ž}
\providetranslation{Proof Sketch}{è¯æ˜Žæè¦}
\providetranslation{Proof sketch}{è¯æ˜Žæè¦}
\providetranslation{proof sketch}{è¯æ˜Žæè¦}
\providetranslation{Proof Sketches}{è¯æ˜Žæè¦}
\providetranslation{Proof sketches}{è¯æ˜Žæè¦}
\providetranslation{proof sketches}{è¯æ˜Žæè¦}
\providetranslation{Sketch of Proof}{è¯æ˜Žæè¦}
\providetranslation{Sketch of Proofs}{è¯æ˜Žæè¦}
\providetranslation{Sketch of proof}{è¯æ˜Žæè¦}
\providetranslation{Sketch of proofs}{è¯æ˜Žæè¦}
\providetranslation{sketch of proof}{è¯æ˜Žæè¦}
\providetranslation{sketch of proofs}{è¯æ˜Žæè¦}
\providetranslation{Propositions}{å‘½é¢˜}
\providetranslation{propositions}{å‘½é¢˜}
\providetranslation{Proposition}{å‘½é¢˜}
\providetranslation{proposition}{å‘½é¢˜}
\providetranslation{Remarks}{æ³¨}
\providetranslation{remarks}{æ³¨}
\providetranslation{Remark}{æ³¨}
\providetranslation{remark}{æ³¨}
\providetranslation{Solutions}{è§£}
\providetranslation{solutions}{è§£}
\providetranslation{Solution}{è§£}
\providetranslation{solution}{è§£}
\providetranslation{Theorems}{å®šç†}
\providetranslation{theorems}{å®šç†}
\providetranslation{Theorem}{å®šç†}
\providetranslation{theorem}{å®šç†}
%&lt;/theorem&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/dict&gt;
%    \end{macrocode}
%
% \subsection{\pkg{ctexcap} å®åŒ…}
%
%    \begin{macrocode}
%&lt;*ctexcap&gt;
%    \end{macrocode}
%
% \pkg{ctexcap} æ˜¯è¿‡æ—¶å®åŒ…ã€‚
%    \begin{macrocode}
\clist_new:N \l_@@_ctexcap_options_clist
\clist_set:Nx \l_@@_ctexcap_options_clist
  { \exp_not:v { opt@ \@currname . \@currext } , heading }
\msg_new:nnn { ctexcap } { deprecated }
  {
    Package~`ctexcap'~is~deprecated.\\
    Please~use~package~`ctex'~with~option~`#1'~instead: \\\\
    \iow_indent:n { \token_to_str:N \usepackage [#1] \{ ctex \} } \\
  }
\msg_warning:nnx { ctexcap } { deprecated }
  { \clist_use:Nn \l_@@_ctexcap_options_clist { , ~ } }
%    \end{macrocode}
%
% \pkg{ctexcap} æ˜¯é»˜è®¤æ‰“å¼€ \opt{heading} é€‰é¡¹çš„ \pkg{ctex}ã€‚
%    \begin{macrocode}
\PassOptionsToPackage { heading = true } { ctexcap }
\RequirePackageWithOptions { ctex }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/ctexcap&gt;
%    \end{macrocode}
%
%
% \subsection{\pkg{ctexhook} å®åŒ…}
%
% \changes{v2.2}{2015/06/26}{å°†æ–‡æ¡£å¼€å¤´å’Œå®åŒ…æœ«å°¾é’©å­æå–åˆ° \pkg{ctexhook} å®åŒ…ä¸­ã€‚}
% \changes{v2.5}{2020/04/21}{å¢žåŠ&nbsp;å®åŒ…å¼€å¤´é’©å­ã€‚}
% \changes{v2.5.4}{2020/08/02}{å…¼å®¹ \LaTeX \ 2020/10/01 çš„é’©å­æœºåˆ¶ã€‚}
%
%    \begin{macrocode}
%&lt;*ctexhook&gt;
%    \end{macrocode}
%
% \begin{macro}[int]{\ctex_if_format_at_least:nTF}
%  ä¸Ž \tn{IfFormatAtLeastTF} åŒä¹‰ã€‚
%    \begin{macrocode}
\cs_new:Npn \ctex_if_format_at_least:nTF
  { \@ifl@t@r \fmtversion }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5.7}{2021/06/12}{é‡æ–°åº”ç”¨ \pkg{l3cctab}ã€‚}
%
% \begin{macro}[int]{\ctex_file_input:n,\ctex_push_file:,\ctex_pop_file:}
% è¾“å…¥æ–‡ä»¶ï¼Œå…³é—­ \LaTeXiii è¯­æ³•çŽ¯å¢ƒï¼Œå¹¶è®¾ç½® |@| ä¸ºå­—æ¯ç±»ï¼Œåˆ©ç”¨ \pkg{l3cctab} å®žçŽ°ã€‚
% æˆ‘ä»¬ä½¿ç”¨ \cs{file_input:n} è€Œä¸æ˜¯ \LaTeXe \ çš„ \tn{input} æˆ–è€… \tn{InputIfFileExists}
% è½½å…¥æ–‡ä»¶ï¼Œå›&nbsp;æ­¤ \LaTeXe \ çš„æ–‡ä»¶é’©å­éƒ½\emph{æ—&nbsp;æ•ˆ}ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_file_input:n #1
  {
    \ctex_push_file:
      \file_input:n {#1}
    \ctex_pop_file:
  }
\bool_if_exist:NTF \l__kernel_expl_bool
  {
    \cs_new_protected:Npn \ctex_push_file:
      {
        \seq_gpush:Nx \g_@@_expl_status_seq
          { \bool_if:NTF \l__kernel_expl_bool { 1 } { 0 } }
        \bool_set_false:N \l__kernel_expl_bool
        \cctab_begin:N \c_@@_package_cctab
      }
    \cs_new_protected:Npn \ctex_pop_file:
      {
        \cctab_end:
        \seq_gpop:NN \g_@@_expl_status_seq \l_@@_expl_status_tl
        \int_if_odd:nTF { \l_@@_expl_status_tl }
          { \bool_set_true:N  \l__kernel_expl_bool }
          { \bool_set_false:N \l__kernel_expl_bool }
      }
    \tl_new:N \l_@@_expl_status_tl
    \seq_new:N \g_@@_expl_status_seq
  }
  {
    \cs_new_protected:Npn \ctex_push_file:
      { \cctab_begin:N \c_@@_package_cctab }
    \cs_new_protected:Npn \ctex_pop_file:
      { \cctab_end: }
  }
\cctab_const:Nn \c_@@_package_cctab
  {
    \cctab_select:N \c_document_cctab
    \char_set_catcode_letter:n { 64 }
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5.7}{2021/06/09}{ä½¿ç”¨ \tn{disable@package@load} ç¦æ­¢å®åŒ…è½½å…¥ã€‚}
%
% \begin{macro}[int]{\ctex_disable_package:n}
% ç¦æ­¢å®åŒ…è½½å…¥ã€‚é‡‡ç”¨ \LaTeX \ 2020-10-01 æä¾›çš„ \tn{disable@package@load} å®žçŽ°ï¼Œ
% å¦åˆ™é‡‡ç”¨ä¼&nbsp;ç»Ÿæ–¹å¼ï¼šé¢„å®šä¹‰ |\ver@|\meta{package}|.sty| æ&nbsp;‡è¯†ç¬¦ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_disable_package:n #1
  {
    \@ifpackageloaded {#1}
      { \msg_error:nnxx }
      { \@@_disable_package_aux:nnnn }
      { ctexhook } { disable-package } {#1} { \@currname }
  }
\cs_new_protected:Npx \@@_disable_package_aux:nnnn #1#2#3#4
  {
    \cs_if_exist:NTF \disable@package@load
      {
        \exp_args:Nnx \exp_not:N \disable@package@load {#3}
          { \msg_warning:nnnn {#1} {#2} {#3} {#4} }
      }
      { \tl_const:cn { ver@ #3 . \exp_not:N \@pkgextension } { 9999/99/99 } }
  }
\msg_new:nnn { ctexhook } { disable-package }
  { Package~`#1'~can~not~be~loaded~with~`#2'. }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_replace_package:nn}
% æ›¿æ¢å®åŒ…ã€‚é‡‡ç”¨ \LaTeX \ 2020-10-01 æä¾›çš„ \tn{declare@file@substitution} å®žçŽ°ï¼Œ
% å¦åˆ™ç»™å‡ºæ—&nbsp;æ•ˆè­¦å‘Šã€‚
%    \begin{macrocode}
\ctex_if_format_at_least:nTF { 2020/10/01 }
  {
    \cs_new_protected:Npn \ctex_replace_package:nn #1#2
      {
        \declare@file@substitution
          { #1 . \@pkgextension }
          { #2 . \@pkgextension }
      }
  }
  {
    \cs_new_protected:Npn \ctex_replace_package:nn
      { \msg_warning:nnnn { ctexhook } { replace-package-invalid } }
    \msg_new:nnn { ctexhook } { replace-package-invalid }
      {
        \token_to_str:N \ctex_replace_package:nn \{#1\}\{#2\}~is~invalid~
        before~LaTeX~2020-10-01.
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_at_begin_package:nn}
% å¦‚æžœå®åŒ…å·²ç»è¢«è½½å…¥ï¼Œåˆ™é’©å­æ—&nbsp;æ•ˆï¼Œç»™å‡ºè­¦å‘Šã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_at_begin_package:nn #1
  {
    \@ifpackageloaded {#1}
      { \@@_package_loaded_warning:nn {#1} }
      { \ctex_gadd_package_hook:nnn { before } {#1} }
  }
\cs_new_protected:Npn \@@_package_loaded_warning:nn #1#2
  { \msg_warning:nnx { ctexhook } { invalid-hook } {#1} }
\msg_new:nnn { ctexhook } { invalid-hook }
  {
    Package~`#1'~is~loaded. \\
    \token_to_str:N \ctex_at_begin_package:nn \{#1\}\{...\}~is~invalid.
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_at_end_package:nn}
% ä¸Ž \pkg{filehook} çš„ \tn{AtEndOfPackageFile*} ç±»ä¼¼ï¼Œå¦‚æžœåŽŸæ¥æ²¡æœ‰åœ¨è½½å…¥å®åŒ…åˆ™
% åœ¨å®åŒ…æœ«å°¾æ‰§è¡Œè¯­å¥ï¼Œå¦åˆ™ç«‹å³æ‰§è¡Œã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_at_end_package:nn #1
  {
    \@ifpackageloaded {#1}
      { \use:n }
      { \ctex_gadd_package_hook:nnn { after } {#1} }
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.5.6}{2021/02/16}{ä½¿ç”¨æ­£ç¡®çš„å¯¼è¨€åŒºæœ«å°¾é’©å­ã€‚}
% \changes{v2.5.8}{2021/11/18}{å…¼å®¹ \LaTeX \ 2021/11/15ã€‚}
%
% \LaTeX \ 2020/10/01 å¼€å§‹æä¾›å¸¸ç”¨é’©å­ç®¡ç†æœºåˆ¶ã€‚åœ¨æ–°æœºåˆ¶ä¸‹ï¼Œæˆ‘ä»¬åªéœ€è¦åšç®€å•çš„åŒ…è£…ã€‚
%    \begin{macrocode}
\ctex_if_format_at_least:nTF { 2020/10/01 }
  {
    \cs_new_protected:Npx \ctex_gadd_ltxhook:nn #1
      { \hook_gput_code:nnn {#1} { \c_novalue_tl } }
    \cs_new_protected:Npn \ctex_at_end_preamble:n
      { \ctex_gadd_ltxhook:nn { begindocument/before } }
    \cs_new_protected:Npn \ctex_after_end_preamble:n
      { \ctex_gadd_ltxhook:nn { begindocument/end } }
    \cs_new_protected:Npx \ctex_gadd_package_hook:nnn #1#2
      {
        \ctex_if_format_at_least:nTF { 2021/11/15 }
          { \ctex_gadd_ltxhook:nn { package/#2/#1 } }
          { \ctex_gadd_ltxhook:nn { package/#1/#2 } }
      }
    \file_input_stop:
  }
  { }
%    \end{macrocode}
%
% å¯¹äºŽ \LaTeX \ 2020/10/01 ä¹‹å‰çš„ç‰ˆæœ¬ï¼Œéœ€è¦è‡ªè¡Œè¡¥ä¸ã€‚
%
% \begin{macro}[int]{\ctex_at_end_preamble:n,\ctex_after_end_preamble:n}
% å®žçŽ° \pkg{etoolbox} å®åŒ…çš„ \tn{AtEndPreamble} å’Œ \tn{AfterEndPreamble}ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_at_end_preamble:n
  { \tl_gput_right:Nn \g_@@_end_preamble_hook_tl }
\cs_new_protected:Npn \ctex_after_end_preamble:n
  { \tl_gput_right:Nn \g_@@_after_end_preamble_hook_tl }
\cs_new_protected:Npn \CTEX@document@left@hook
  { \group_end: \g_@@_end_preamble_hook_tl \group_begin: }
\cs_new_protected:Npn \CTEX@document@right@hook
  { \scan_stop: \g_@@_after_end_preamble_hook_tl \tex_ignorespaces:D }
\cs_set_nopar:Npx \document
  {
    \CTEX@document@left@hook
    \exp_not:o { \document }
    \CTEX@document@right@hook
  }
\tl_new:N \g_@@_end_preamble_hook_tl
\tl_new:N \g_@@_after_end_preamble_hook_tl
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_gadd_package_hook:nnn,
% \ctex_gadd_hook:Nn, \ctex_gadd_hook:cn}
% ç»™é’©å­é™„åŠ&nbsp;å†…å®¹ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_gadd_package_hook:nnn #1#2
  { \ctex_gadd_hook:cn { g_@@_at_ #1 _ #2 _hook_tl } }
\cs_new_protected:Npn \ctex_gadd_hook:Nn #1
  {
    \tl_if_exist:NF #1 { \tl_new:N #1 }
    \tl_gput_right:Nn #1
  }
\cs_generate_variant:Nn \ctex_gadd_hook:Nn { c }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_use_package_hook:nn}
% å®åŒ…é’©å­ï¼Œåªæ‰§è¡Œä¸€æ¬¡ï¼Œç”¨åŽæ¸…é™¤ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_use_package_hook:nn #1#2
  {
    \group_begin: \exp_args:NNc \group_end:
    \@@_use_package_hook_aux:N { g_@@_at_ #1 _ #2 _hook_tl }
  }
\cs_new_protected:Npn \@@_use_package_hook_aux:N #1
  { \cs_if_exist_use:NT #1 { \cs_undefine:N #1 } }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@reset@ptions,\CTEX@reset@ptions@hook}
% \tn{@pushfilename} å†…éƒ¨çš„ \tn{@currname} å’Œ \tn{@currext} ä¿å­˜çš„æ˜¯
% å‰ä¸€ä¸ªå®åŒ…çš„çŠ¶æ€ï¼Œä¸èƒ½ä½¿ç”¨ã€‚éœ€è¦å¯¹å…¶åŽçš„ \tn{@reset@ptions} åšè¡¥ä¸æ¥å®žçŽ°
% \cs{ctex_at_begin_package:nn} çš„åŠŸèƒ½ã€‚
%    \begin{macrocode}
\tl_put_right:Nn \@reset@ptions { \CTEX@reset@ptions@hook }
\cs_new_protected:Npn \CTEX@reset@ptions@hook
  {
    \cs_if_eq:NNT \@currext \@pkgextension
      { \ctex_use_package_hook:nn { before } { \@currname } }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\@popfilename,\CTEX@popfilename@hook}
% å¯¹ \tn{@popfilename} åšè¡¥ä¸æ¥å®žçŽ° \cs{ctex_at_end_package:nn} çš„åŠŸèƒ½ã€‚
%    \begin{macrocode}
\tl_put_left:Nn \@popfilename { \CTEX@popfilename@hook }
\cs_new_protected:Npn \CTEX@popfilename@hook
  {
    \cs_if_eq:NNT \@currext \@pkgextension
      { \ctex_use_package_hook:nn { after } { \@currname } }
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/ctexhook&gt;
%    \end{macrocode}
%
%
% \subsection{\pkg{ctexpatch} å®åŒ…}
%
% \changes{v2.2}{2015/06/23}{æ–°å¢žå­å®åŒ… \pkg{ctexpatch} å®žçŽ°ç»™å®æ‰“è¡¥ä¸åŠŸèƒ½ã€‚}
%
%    \begin{macrocode}
%&lt;*ctexpatch&gt;
%    \end{macrocode}
%
% \begin{macro}[int]{\ctex_patch_cmd_once:NnnnTF}
% åªè¿›è¡Œç¬¬ä¸€æ¬¡åŒ¹é…è¿›è¡Œæ›¿æ¢ã€‚å‚æ•° |#2| æ˜¯å®é‡å»ºæ—¶çš„ \tn{catcode} è®¾ç½®ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_patch_cmd_once:NnnnTF #1#2
  {
    \ctex_patch_boot:NNnnTF \@@_patch_cmd:Nnnnnw #1
      { once } {#2} { \use_i:nn } { \use_ii:nn }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_patch_cmd_all:NnnnTF}
% æ›¿æ¢æ‰€æœ‰åŒ¹é…åˆ°çš„æ–‡æœ¬ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_patch_cmd_all:NnnnTF #1#2
  {
    \ctex_patch_boot:NNnnTF \@@_patch_cmd:Nnnnnw #1
      { all } {#2} { \use_i:nn } { \use_ii:nn }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_patch_cmd:Nnn}
% å¿«æ·æ–¹å¼ï¼Œåœ¨è¡¥ä¸çš„æ—¶å€™å…³é—­ \LaTeXiii{} è¯­æ³•å’Œè®¾ç½® |@| ä¸ºå­—æ¯ç±»ï¼Œè¡¥ä¸å¤±è´¥æ—¶ç»™å‡ºè­¦å‘Šã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_patch_cmd:Nnn #1
  {
    \ctex_patch_boot:NNnnTF \@@_patch_cmd:Nnnnnw #1
      { once }
      {
        \ExplSyntaxOff
        \char_set_catcode_letter:n { 64 }
      }
      { }
      { \ctex_patch_failure:N #1 }
  }
\cs_new_protected:Npn \ctex_patch_failure:N #1
  { \msg_warning:nnx { ctexpatch } { patch-failure } { \token_to_str:N #1 } }
\msg_new:nnn { ctexpatch } { patch-failure }
  { Oops!~Command~`#1'~is~NOT~patchable.\\ }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_preto_cmd:NnnTF}
% åœ¨å®çš„åŽŸæœ¬å®šä¹‰å‰é¢å¢žåŠ&nbsp;é’©å­ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_preto_cmd:NnnTF #1#2
  {
    \ctex_patch_boot:NNnnTF \@@_hookto_cmd:Nnnnw #1
      { left } {#2} { \use_i:nn } { \use_ii:nn }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_appto_cmd:NnnTF}
% åœ¨å®çš„åŽŸæœ¬å®šä¹‰åŽé¢è¿½åŠ&nbsp;é’©å­ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_appto_cmd:NnnTF #1#2
  {
    \ctex_patch_boot:NNnnTF \@@_hookto_cmd:Nnnnw #1
      { right } {#2} { \use_i:nn } { \use_ii:nn }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_patch_boot:NNnnTF}
% å‚æ•°è®°å· |#| ä½œä¸ºå®çš„å‚æ•°è¢«è¯»å…¥æ—¶ï¼Œæ€»æ˜¯ä¼šåŒå†™ï¼Œä¼šå½±å“éšåŽçš„å­—ç¬¦ä¸²æ›¿æ¢ã€‚éœ€è¦å…ˆ
% å°†å®ƒè½¬æ¢ä¸ºæ™®é€šç¬¦å·ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_patch_boot:NNnnTF #1#2#3#4#5#6
  {
    \cs_set_protected:Npx \@@_patch_true:w  { \exp_not:n {#5} }
    \cs_set_protected:Npx \@@_patch_false:w { \exp_not:n {#6} }
    \group_begin:
      \char_set_catcode_other:n { 35 }
      \ctex_parse_name:NN #1 #2 {#3} {#4}
  }
\cs_new_eq:NN \@@_patch_true:w  \use_i:nn
\cs_new_eq:NN \@@_patch_false:w \use_ii:nn
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\ctex_parse_name:NN}
% \changes{v2.4}{2016/04/11}{ä¿®å¤å®åè§£æžé”™è¯¯ã€‚}
% ç”¨ \tn{DeclareRobustCommand} å®šä¹‰çš„å®æˆ–è€…ç”± \tn{newcommand} æˆ– \tn{newrobustcmd}
% å®šä¹‰çš„å¸¦ä¸€ä¸ªå¯é€‰å‚æ•°çš„å®ç¬¬ä¸€æ¬¡å±•å¼€çš„ç»“æžœéƒ½ä¸æ˜¯å…¶å®žé™…å®šä¹‰ï¼Œå®žé™…å®šä¹‰è¢«ä¿å­˜åœ¨å¦å¤–çš„
% å®ä¸­ã€‚ç”±è¿™äº›å‘½ä»¤å®šä¹‰çš„å®çš„ç¬¬ä¸€æ¬¡å±•å¼€ç»“æžœå¯ä»¥æœ‰ä¸‹é¢çš„å½¢å¼ï¼ˆç»†èŠ‚å¯æŸ¥é˜… \pkg{xpatch}
% çš„æ–‡æ¡£ï¼‰ï¼š
% \begin{verbatim}[numbers=left,gobble=4]
%   \protectâ£\xaaâ£â£                    % \DeclareRobustCommand\xaa[1]{...}
%   \protectâ£\xabâ£â£                    % \DeclareRobustCommand\xab[1][]{...}
%   \@protected@testoptâ£\xacâ£\\xacâ£{}  % \newcommand\xac[1][]{...}
%   \@testoptâ£\\xadâ£{}                 % \newrobustcmd\xad[1][]{...}
%   \x@protectâ£\1\protectâ£\1â£â£         % \DeclareRobustCommand\1[1]{...}
%   \x@protectâ£\2\protectâ£\2â£â£         % \DeclareRobustCommand\2[1][]{...}
%   \@protected@testoptâ£\3\\3â£{}       % \newcommand\3[1][]{...}
%   \@testoptâ£\\4â£{}                   % \newrobustcmd\4[1][]{...}
% \end{verbatim}
% \pkg{ctexpatch} çš„ä¸»è¦åŽŸç†æ˜¯å…ˆå¯¹å®çš„ \tn{meaning} ä½œå­—ç¬¦ä¸²æ›¿æ¢ï¼Œç„¶åŽå†ç”¨
% \tn{scantokens} æ¥é‡å»ºå®ƒã€‚æˆ‘ä»¬å¸Œæœ›å¯¹å®çš„å®žé™…å®šä¹‰æ‰“è¡¥ä¸ï¼Œä¸ºæ­¤éœ€è¦å…ˆå¾—åˆ°
% å¯¹åº”çš„åå­—ã€‚\pkg{letltxmacro}ã€\pkg{show2e} å’Œ \pkg{xpatch} å®åŒ…ä¸­éƒ½æœ‰
% ç±»ä¼¼çš„å·¥ä½œã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_parse_name:NN #1#2
  { \ctex_parse_name:NNx #1#2 { \cs_to_str:N #2 } }
\group_begin:
\cs_set_protected:Npn \@@_tmp:w #1#2#3
  {
    \cs_new_protected:Npn \ctex_parse_name:NNn ##1##2##3
      {
        \bool_lazy_or:nnTF
          { \cs_if_exist_p:c { ##3 ~ } }
          { \cs_if_exist_p:c { #1##3 } }
          {
            \group_begin:
            \use:e
              {
                \group_end:
                \@@_parse_name:nNNNnN
                  { \cs_replacement_spec:N ##2 }
                  \exp_not:N ##2
                  \exp_not:c { ##3 ~ }
                  \exp_not:c { #1##3 }
              } { ##3 } ##1
          }
          { ##1##2 }
      }
    \cs_new_protected:Npn \@@_parse_name:nNNNnN ##1##2##3##4##5##6
      {
        \exp_args:Nc ##6
          {
            \str_case:nnTF {##1}
              {
                { \protect ##3 } { }
                { \x@protect ##2 \protect ##3 } { }
              }
              {
                \str_if_eq:eeTF
                  { \exp_not:n { #1@protected@ ##3 #1##3 } }
                  {
                    \exp_last_unbraced:Ne \@@_parse_name:w
                      { \cs_replacement_spec:N ##3 } #3 ~ #2 \q_stop
                  }
                  { #1##5 ~ } { ##5 ~ }
              }
              {
                \str_case:onTF { \@@_parse_name:w ##1 #3 ~ #2 \q_stop }
                  {
                    { #1@protected@ ##2 ##4 } { }
                    { #1@ ##4 } { }
                  }
                  { #1##5 } {##5}
              }
          }
      }
    \cs_new:Npn \@@_parse_name:w ##1 #3 ~ ##2 #2 ##3 \q_stop { ##1##2 }
  }
\use:e
  {
    \@@_tmp:w
      { \c_backslash_str }
      { \c_left_brace_str }
      { \tl_to_str:n { testopt } }
  }
\group_end:
\cs_generate_variant:Nn \ctex_parse_name:NNn { NNx }
%    \end{macrocode}
% \end{macro}
%
% \begin{variable}{\l_@@_prefix_str,\l_@@_parameter_str,\l_@@_replacement_str}
% åˆ†åˆ«ä¿å­˜å®çš„ \tn{meaning} ä¸­çš„å‰ç¼€ã€å‚æ•°æ–‡æœ¬å’Œæ›¿æ¢æ–‡æœ¬ã€‚
%    \begin{macrocode}
\str_new:N \l_@@_prefix_str
\str_new:N \l_@@_parameter_str
\str_new:N \l_@@_replacement_str
%    \end{macrocode}
% \end{variable}
%
% \begin{macro}[int]{\ctex_get_macro_meaning:NTF}
% \begin{macro}{\@@_get_macro_meaning:w}
% è§£æž„å¾…è¡¥ä¸å®çš„ \tn{meaning}ã€‚è‹¥å‘½ä»¤ä¸æ˜¯å®ï¼Œåˆ™èµ°å‘ |false| åˆ†æ”¯ã€‚
%    \begin{macrocode}
\group_begin:
  \cs_set_protected:Npn \@@_tmp:w #1
    {
      \prg_new_protected_conditional:Npnn
        \ctex_get_macro_meaning:N ##1 { TF }
        {
          \exp_after:wN \@@_get_macro_meaning:w
            \token_to_meaning:N ##1 \q_mark #1 -&gt; \q_mark \q_stop
        }
      \cs_new_protected:Npn \@@_get_macro_meaning:w
          ##1 #1 ##2 -&gt; ##3 \q_mark ##4 \q_stop
        {
          \tl_if_empty:nTF { ##4 }
            { \prg_return_false: }
            {
              \str_set:Nn \l_@@_prefix_str      { ##1 }
              \str_set:Nn \l_@@_parameter_str   { ##2 }
              \str_set:Nn \l_@@_replacement_str { ##3 }
              \prg_return_true:
            }
        }
    }
  \exp_args:No \@@_tmp:w { \tl_to_str:n { macro: } }
\group_end:
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}[int]{\ctex_if_rescanable:NnTF}
% æ£€æŸ¥å®æ˜¯å¦å¯ä»¥é‡å»ºã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \ctex_if_rescanable:NnTF #1#2#3#4
  {
    \ctex_get_macro_meaning:NTF #1
      {
        \@@_patch_rebuild:Nn \@@_rebuild_cmd:w {#2}
        \cs_if_eq:NNTF #1 \@@_rebuild_cmd:w {#3} {#4}
      }
      {#4}
  }
\cs_new_eq:NN \@@_rebuild_cmd:w \prg_do_nothing:
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_patch_rebuild:Nn}
% ä½¿ç”¨ \cs{tl_rescan:nn} æ¥é‡æ–°è®°å·åŒ– \tn{meaning} å­—ç¬¦ä¸²ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_patch_rebuild:Nn #1#2
  {
    \@@_patch_rescan:NNn \l_@@_prefix_tl      \l_@@_prefix_str      {#2}
    \@@_patch_rescan:NNn \l_@@_parameter_tl   \l_@@_parameter_str   {#2}
    \@@_patch_rescan:NNn \l_@@_replacement_tl \l_@@_replacement_str {#2}
    \use:e
      {
        \exp_not:o { \l_@@_prefix_tl } \tex_def:D \exp_not:N #1
          \exp_not:o { \l_@@_parameter_tl }
            { \exp_not:o { \l_@@_replacement_tl } }
      }
  }
\cs_new_protected:Npn \@@_patch_rescan:NNn #1#2#3
  {
    \str_if_empty:NTF #2
      { \tl_clear:N #1 }
      { \tl_set_rescan:Nno #1 {#3} {#2} }
  }
\tl_new:N \l_@@_prefix_tl
\tl_new:N \l_@@_parameter_tl
\tl_new:N \l_@@_replacement_tl
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_patch_cmd:Nnnnnw}
% å¯¹å®çš„æ›¿æ¢æ–‡æœ¬è¿›è¡Œå­—ç¬¦ä¸²æ›¿æ¢ï¼Œç„¶åŽé‡å»ºã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_patch_cmd:Nnnnnw #1#2#3#4#5
  {
    \group_end:
    \ctex_if_rescanable:NnTF #1 {#3}
      {
        \use:e
          {
            \@@_patch_replace:nnnTF {#2}
              { \tl_to_str:n {#4} }
              { \tl_to_str:n {#5} }
          }
          {
            \@@_patch_rebuild:Nn #1 {#3}
            \@@_patch_true:w
          }
          { \@@_patch_false:w }
      }
      { \@@_patch_false:w }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_patch_replace:nnnTF}
% æ›¿æ¢å‰å…ˆæ£€æŸ¥åŽŸæ–‡æœ¬æ˜¯å¦å­˜åœ¨ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_patch_replace:nnnTF #1#2#3#4
  {
    \tl_if_in:NnTF \l_@@_replacement_str {#2}
      { \use:c { tl_replace_ #1 :Nnn } \l_@@_replacement_str {#2} {#3} #4 }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_hookto_cmd:Nnnnw}
% åœ¨å®çš„å‰/åŽé™„åŠ&nbsp;é’©å­ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_hookto_cmd:Nnnnw #1#2#3#4
  {
    \group_end:
    \ctex_get_macro_meaning:NTF #1
      {
        \str_if_empty:NTF \l_@@_parameter_str
          { \@@_hookto_cmd_parameterless:Nnnnw }
          { \@@_hookto_cmd_parameter:Nnnnw }
          #1 {#2} {#3} {#4}
      }
      { \@@_patch_false:w }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_hookto_cmd_parameterless:Nnnnw}
% å¦‚æžœå®æ²¡æœ‰å‚æ•°ï¼Œå¯ä»¥ç›´æŽ¥è¿›è¡Œé™„åŠ&nbsp;æ“ä½œã€‚æ³¨æ„ä¿æŒå®çš„å‰ç¼€ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_hookto_cmd_parameterless:Nnnnw #1#2#3#4
  {
    \str_if_empty:NF \l_@@_prefix_str
      { \tl_rescan:no {#3} { \l_@@_prefix_str } }
    \tex_edef:D #1
      {
        \use:c { @@_ #2 _hook_aux:nn }
          { \exp_not:o {#1} }
          { \exp_not:n {#4} }
      }
    \@@_patch_true:w
  }
\cs_generate_variant:Nn \tl_rescan:nn { no }
\cs_new:Npn \@@_left_hook_aux:nn #1#2 { #2#1 }
\cs_new_eq:NN \@@_right_hook_aux:nn \use:nn
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_hookto_cmd_parameter:Nnnnw}
% å¦‚æžœå®æœ‰å‚æ•°ï¼Œéœ€è¦åœ¨å­—ç¬¦ä¸²ä¸­è¿›è¡Œé™„åŠ&nbsp;ï¼Œç„¶åŽå†é‡å»ºã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_hookto_cmd_parameter:Nnnnw #1#2#3#4
  {
    \@@_patch_rebuild:Nn \@@_rebuild_cmd:w {#3}
    \cs_if_eq:NNTF #1 \@@_rebuild_cmd:w
      {
        \use:c { str_put_ #2 :Nn } \l_@@_replacement_str {#4}
        \@@_patch_rebuild:Nn #1 {#3}
        \@@_patch_true:w
      }
      { \@@_patch_false:w }
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/ctexpatch&gt;
%    \end{macrocode}
%
% \end{implementation}
%
% \Finale
%
\endinput
</pre></body></html>