<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
%&lt;*internal&gt;
\iffalse
%&lt;/internal&gt;
%&lt;*readme&gt;
Boxed Chinese characters with Pinyin above and translation below based LaTeX3
=======

`hanzibox` is a LaTeX package developed in LaTeX3, which provides `\hanzibox`, `\hanzidialog` and `\writegrid` macros. These macros are used for typesetting Chinese character with or without a background grid such as a cross grid or star grid for Chinese character writting learning.

And you can display the Hanyu Pinyin above the Chinese character and the translation below them as needed.

The `\hanzibox` macro can automatically invoke the `\xpinyin*` macro of the `xpinyin` package to get Hanyu Pinyin according to the Chinese characters.  And the `\hanzibox` macro provides an asterisk version of `\hanzibox*`, whose function is achieved by automatically invoking the `xpinyin` package's `\pinyin` macro to get Hanyu Pinyin. The `\hanzidialog` macro is implemented by manually inserting the `\pinyin` macro of the `xpinyin` package in it's pinyin option. The `\writegrid` macro is for write a composition anwser grid.


`hanzibox` is a utility for learning to write and pronounce Chinese characters, and can be used for Chinese character learning plans, presentations, exercise booklets and other documentation work.

The development of this package was inspired by [Jan Vorisek's hanzibox package](https://github.com/janvorisek/chinese-latex-utilities).

However, the new package redesigned the `\hanzibox` and `\hanzidialog` macros and the background grid is redesigned with the `l3draw` package by reference to [zitie package](https://www.ctan.org/pkg/zitie).  Also, the new package provides more options and arguments in order to get better results.

The `hanzibox.sty` package currently only supports the XeTeX engine and only supports UTF-8 encoded LaTeX source files.

You can read the manual (in Chinese) for more details and examples.

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

1. github repository:
    1. repository: [hanzibox-l3](https://github.com/registor/hanzibox-l3)
    2. Issues and pull requests are welcome. [issue](https://github.com/registor/hanzibox-l3/issues) or [pull request](https://github.com/registor/hanzibox-l3/pulls).

2. gitee repository:
    1. repository: [hanzibox-l3](https://gitee.com/nwafu_nan/hanzibox-l3)
    2. Issues and pull requests are welcome. [issue](https://gitee.com/nwafu_nan/hanzibox-l3/issues) or [pull request](https://gitee.com/nwafu_nan/hanzibox-l3/pulls).

åŸºäºŽLaTeX3çš„å¸¦æ³¨éŸ³å’Œè¯‘æ–‡çš„æ±‰å­—ç»ƒä¹&nbsp;å®åŒ…
=======

`hanzibox`æ˜¯ä¸€ä¸ªç”¨LaTeX3å¼€å‘çš„LaTeXå®åŒ…ï¼Œå®ƒæä¾›äº†`\hanzibox`ã€`\hanzidialog` å’Œ`\writegrid`ä¸‰ä¸ªä¸ªå‘½ä»¤ã€‚è¿™ä¸‰ä¸ªå‘½ä»¤åˆ†åˆ«ç”¨äºŽæŽ’ç‰ˆæ±‰å­—å­¦ä¹&nbsp;ä¸­å¸¦æœ‰æˆ–ä¸å¸¦ç”°å­—æ&nbsp;¼ã€ç±³å­—æ&nbsp;¼ç­‰èƒŒæ™¯æ&nbsp;¼å­çš„æ±‰å­—ï¼Œå¹¶å¯ä»¥æ&nbsp;¹æ®éœ€è¦åœ¨æ±‰å­—æ­£ä¸Šæ–¹æ˜¾ç¤ºæ‹¼éŸ³ï¼Œåœ¨æ­£ä¸‹æ–¹æ˜¾ç¤ºè¯‘æ–‡ã€‚å…¶ä¸­ï¼Œ`\hanzibox`å‘½ä»¤èƒ½å¤Ÿæ&nbsp;¹æ®æ±‰å­—è‡ªåŠ¨è°ƒç”¨`xpinyin`å®åŒ…çš„`\xpinyin*`å‘½ä»¤å®žçŽ°æ±‰å­—æ³¨éŸ³ã€‚å¹¶ä¸”`\hanzibox`å‘½ä»¤æä¾›äº†`\hanzibox*`æ˜Ÿå·ç‰ˆæœ¬ï¼Œå…¶æ³¨éŸ³åŠŸèƒ½æ˜¯é€šè¿‡è‡ªåŠ¨è°ƒç”¨`xpinyin`å®åŒ…çš„`\pinyin`å‘½ä»¤å®žçŽ°çš„ã€‚`\hanzidialog`å‘½ä»¤çš„æ³¨éŸ³åŠŸèƒ½æ˜¯é€šè¿‡åœ¨æ‹¼éŸ³é€‰é¡¹ä¸­æ‰‹åŠ¨æ’å…¥`xpinyin`å®åŒ…`\pinyin`å‘½ä»¤å®žçŽ°çš„ã€‚`\writegrid`å‘½ä»¤ç”¨äºŽæŽ’ç‰ˆä½œæ–‡é¢˜ç›®çš„ç­”é¢˜æ&nbsp;¼å­çº¸ã€‚

`hanzibox` æ˜¯ä¸€ä¸ªç”¨äºŽå­¦ä¹&nbsp;æ±‰å­—ä¹¦å†™ä¸Žå‘éŸ³çš„å·¥å…·ï¼Œå¯ä»¥ç”¨äºŽæ±‰å­—å­¦ä¹&nbsp;æ•™æ¡ˆã€æ¼”ç¤ºæ–‡ç¨¿ã€ä¹&nbsp;é¢˜å†Œç­‰æ–‡æ¡£å·¥ä½œã€‚

è¯¥å®åŒ…çš„å¼€å‘çµæ„Ÿæºè‡ª[Jan Vorisekçš„hanziboxå®åŒ…](https://github.com/janvorisek/chinese-latex-utilities)ã€‚ä½†å¯¹`\hanzibox`å’Œ`\hanzidialog`å‘½ä»¤é‡æ–°è¿›è¡Œäº†è®¾è®¡ï¼Œå¹¶å‚è€ƒ[zitieå­—è´´å®åŒ…](https://www.ctan.org/pkg/zitie)é‡æ–°ç”¨`l3draw`å®åŒ…è®¾è®¡äº†èƒŒæ™¯æ&nbsp;¼å­ã€‚åŒæ—¶ï¼Œæ–°çš„å®åŒ…ä¹Ÿæä¾›äº†æ›´å¤šå‘½ä»¤é€‰é¡¹å’Œå‚æ•°ï¼Œä»¥æœŸæ›´å¥½åœ°æŽ§åˆ¶æŽ’ç‰ˆç»“æžœã€‚

ç›®å‰ï¼Œ`hanzibox.sty`å®åŒ…ä»…æ”¯æŒXeTeXç¼–è¯‘å¼•æ“Žï¼Œå¹¶ä¸”åªæ”¯æŒUTF-8ç¼–ç&nbsp;çš„LaTeXæºæ–‡ä»¶ã€‚

å¯ä»¥é€šè¿‡é˜…è¯»å®åŒ…æ‰‹å†Œ(ä¸­æ–‡)ä»¥ä¹Ÿè§£è¯¥å®åŒ…æ›´å¤šçš„ä½¿ç”¨ç»†èŠ‚å’Œä½¿ç”¨æ&nbsp;·ä¾‹ã€‚

###  å‚ä¸Žè´¡çŒ®
---------------------

1. githubä»“åº“:
    (1). ä»“åº“åœ°å€: [hanzibox-l3](https://github.com/registor/hanzibox-l3)
    (2). Issueså’ŒPR: [issue](https://github.com/registor/hanzibox-l3/issues) or [pull request](https://github.com/registor/hanzibox-l3/pulls).

2. giteeä»“åº“:
    (1). ä»“åº“åœ°å€: [hanzibox-l3](https://gitee.com/nwafu_nan/hanzibox-l3)
    (2). Issues and PR: [issue](https://gitee.com/nwafu_nan/hanzibox-l3/issues) or [pull request](https://gitee.com/nwafu_nan/hanzibox-l3/pulls).

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

    Copyright (C) 2020-2022 by Nan Geng &lt;nangeng@nwafu.edu.cn&gt;
    ----------------------------------------------------------------------

    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".

    The Current Maintainer of this work is Nan Geng.

    This package consists of the file  hanzibox.dtx,
                 and the derived files hanzibox.sty,
                                       hanzibox.pdf,
                                       hanzibox.ins,
                                       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 %

\let\MetaPrefix\relax

\preamble

    Copyright (C) 2020-2022 by Nan Geng &lt;nangeng@nwafu.edu.cn&gt;
--------------------------------------------------------------------------

    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".

    The Current Maintainer of this work is Nan Geng.

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

\endpreamble

\postamble

    This package consists of the file  hanzibox.dtx,
                 and the derived files hanzibox.sty,
                                       hanzibox.pdf,
                                       hanzibox.ins,
                                       README.md.
\endpostamble

\declarepostamble\emptypostamble
\endpostamble

\def\MetaPrefix{-- }


\let\MetaPrefix\DoubleperCent

\generate
  {
%&lt;/install&gt;
%&lt;*internal&gt;
    \usedir{source/xelatex/hanzibox}
    \file{hanzibox.ins} {\from{\jobname.dtx}{install}}
%&lt;/internal&gt;
%&lt;*install&gt;
    \usedir{xetex/xelatex/hanzibox}
    \file{hanzibox.sty} {\from{\jobname.dtx}{package}}
    \nopreamble\nopostamble
    \usedir{doc/xelatex/hanzibox}
    \file{README.md}   {\from{\jobname.dtx}{readme}}
  }

\endbatchfile
%&lt;/install&gt;
%&lt;*internal&gt;
\fi
%&lt;/internal&gt;
%&lt;package&gt;\NeedsTeXFormat{LaTeX2e}[2020/10/01]
%&lt;package&gt;\RequirePackage{expl3}
%&lt;+package&gt;\GetIdInfo$Id: hanzibox.dtx 2.3.0 2022-04-17 08:00:00 +0800 Nan Geng &lt;nangeng@nwafu.edu.cn&gt; $
%&lt;package&gt;  {Boxed Chinese characters with Pinyin above and translation below.}
%&lt;package&gt;\ProvidesExplPackage{\ExplFileName}
%&lt;package&gt;  {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
%&lt;*driver&gt;
\documentclass{ctxdoc}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{xcolor-material}
\usepackage{hanzibox}
\renewcommand*\marg[1]{\{\meta{#1}\}}
\renewcommand*\oarg[1]{[\meta{#1}]}
\renewcommand*\parg[1]{(\meta{#1})}
\NewDocumentCommand{\init}{+v}{\hspace{\fill}åˆå§‹å€¼~=~\textcolor{blue}{\bfseries#1}}
\DeclareDocumentCommand\opt{m}{\texttt{#1}}
\DeclareDocumentCommand\kvopt{mm}
  {\texttt{#1\breakablethinspace=\breakablethinspace#2}}
\def\breakablethinspace{\hskip 0.16667em\relax}
\begin{document}
%&lt;!--CODEDOC--&gt;  \DisableImplementation
  \EnableImplementation
  \DocInput{\jobname.dtx}
  \IndexLayout
  \PrintChanges
  \PrintIndex
\end{document}
%&lt;/driver&gt;
% \fi
%
% \changes{v1.0.0}{2021/09/18}{å¼€å§‹ç¼–å†™æ¨¡æ¿}
% \changes{v2.0.0}{2021/09/25}{åŸºäºŽl3drawé‡æ–°è®¾è®¡}
% \changes{v2.0.0}{2021/09/28}{é‡æ–°ç¼–å†™README.mdå†…å®¹}
%
% \CheckSum{0}
% \GetFileId{hanzibox.sty}
%
% \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         \~}
%
%
% \title{\bfseries\pkg{hanzibox}ï¼šç”°å­—æ&nbsp;¼-ç±³å­—æ&nbsp;¼æ±‰å­—ç»ƒä¹&nbsp;å®åŒ…}
% \author{è€¿æ¥&nbsp;\\ \path{nangeng@nwafu.edu.cn}}
% \date{\filedate\qquad\fileversion\thanks{\url{https://github.com/registor/hanzibox-l3}}\thanks{\url{https://gitee.com/nwafu_nan/hanzibox-l3}}}
% \maketitle
%
% \changes{v2.0.0}{2021/09/28}{ä¿®è®¢è¯´æ˜Žæ–‡æ¡£}
% \changes{v2.1.2}{2021/10/07}{ä¸ºè¯´æ˜Žæ–‡æ¡£æ·»åŠ&nbsp;ç›®å½•}
%
% \begin{documentation}
%
% \begin{abstract}
%
% \pkg{hanzibox} æ˜¯ä¸€ä¸ªç”¨\LaTeX3å¼€å‘çš„ \LaTeX å®åŒ…ï¼Œå®ƒæä¾›
% äº†\tn{hanzibox}ã€\tn{hanzidialog}å’Œ\tn{writegrid}ä¸‰
% ä¸ªå‘½ä»¤ã€‚è¿™ä¸‰ä¸ªå‘½ä»¤ç”¨äºŽè¾“å‡ºæ±‰å­—å­¦ä¹&nbsp;ä¸­å¸¦æœ‰æˆ–ä¸å¸¦ç”°å­—æ&nbsp;¼ã€ç±³å­—æ&nbsp;¼ç­‰èƒŒæ™¯æ&nbsp;¼å­çš„æ±‰å­—ï¼Œ
% å¹¶å¯ä»¥æ&nbsp;¹æ®éœ€è¦åœ¨æ±‰å­—æ­£ä¸Šæ–¹æ˜¾ç¤ºæ‹¼éŸ³ï¼Œåœ¨æ­£ä¸‹æ–¹æ˜¾ç¤ºè¯‘æ–‡ã€‚
% å…¶ä¸­ï¼Œ\tn{hanzibox}å‘½ä»¤èƒ½å¤Ÿæ&nbsp;¹æ®æ±‰å­—åˆ©ç”¨\pkg{xpinyin}å®åŒ…è‡ªåŠ¨å®žçŽ°æ±‰å­—æ³¨éŸ³ã€‚
% åŒæ—¶ï¼Œ\tn{hanzibox}å‘½ä»¤è¿˜æä¾›äº†\tn{hanzibox*}æ˜Ÿå·ç‰ˆæœ¬ï¼Œä»¥å®žçŽ°æ±‰å­—çš„æ‰‹åŠ¨æ³¨éŸ³åŠŸèƒ½ã€‚
% \tn{hanzidialog}å‘½ä»¤çš„æ³¨éŸ³åŠŸèƒ½åˆ™æ˜¯é€šè¿‡åœ¨å…¶æ‹¼éŸ³é€‰é¡¹ä¸­æ‰‹åŠ¨æ’å…¥
% \pkg{xpinyin}å®åŒ…çš„\tn{pinyin}å‘½ä»¤å®žçŽ°ã€‚\tn{writegrid}å‘½ä»¤ç”¨äºŽæŽ’ç‰ˆ
% ä½œæ–‡é¢˜ç›®çš„ç­”é¢˜æ&nbsp;¼å­çº¸ã€‚
%
% \end{abstract}
%
% \tableofcontents
%
% \section{ç®€è¦è¯´æ˜Ž}
%
% \pkg{hanzibox} æ˜¯ä¸€ä¸ªç”¨äºŽè¾“å‡ºæ±‰å­—å­¦ä¹&nbsp;ä¸­çš„ç”°å­—æ&nbsp;¼ã€ç±³å­—æ&nbsp;¼ç­‰èƒŒæ™¯ï¼Œå¹¶åœ¨æ±‰å­—æ­£ä¸Šæ–¹æ˜¾ç¤ºæ‹¼éŸ³ï¼Œ
% åœ¨æ­£ä¸‹æ–¹æ˜¾ç¤ºè¯‘æ–‡ã€‚å½“ç„¶ï¼Œä¹Ÿå¯ä»¥æ&nbsp;¹æ®éœ€è¦éšè—æ‹¼éŸ³ã€æ±‰å­—æˆ–è¯‘æ–‡ï¼Œè¿˜å¯ä»¥é€‰æ‹©æ€§åœ°éšè—æ‹¼éŸ³ä¸­çš„
% å£°æ¯ã€éŸµæ¯æˆ–éŸ³è°ƒï¼Œä»Žè€Œæœ‰æ•ˆå®žçŽ°æ±‰å­—å­¦ä¹&nbsp;ä¸­çš„ç´&nbsp;æå‡†å¤‡ã€‚
%
% ä½¿ç”¨\pkg{hanzibox}å®åŒ…çš„\LaTeX æºæ–‡ä»¶éœ€é‡‡ç”¨ \texttt{UTF-8}ç¼–ç&nbsp;ï¼Œå¹¶ä¸”éœ€ä½¿ç”¨\XeLaTeX è¿›è¡Œç¼–è¯‘ã€‚
%
% \pkg{hanzibox} ä¾èµ– \package{l3kernel} ã€\package{l3packages}ã€\package{l3draw}å’Œ\package{xpinyin}å®åŒ…ã€‚
%
% \section{ç”¨æˆ·æŽ¥å£}
%
% \subsection{\tn{hanzibox}å‘½ä»¤}
%
% \begin{function}[added=2021-09-18,updated=2021-10-07]{\hanzibox,\hanzibox*}
%   \begin{syntax}
%     \tn{hanzibox}  \oarg{å¤–è§‚é€‰é¡¹} \Arg{æ±‰å­—} \oarg{æ‹¼éŸ³é€‰é¡¹} \oarg{è¯‘æ–‡é€‰é¡¹}
%     \tn{hanzibox*} \oarg{å¤–è§‚é€‰é¡¹} \Arg{æ±‰å­—} \oarg{æ‹¼éŸ³é€‰é¡¹} \oarg{è¯‘æ–‡é€‰é¡¹}
%   \end{syntax}
%   æŽ’ç‰ˆæ±‰å­—ï¼Œå¹¶æ&nbsp;¹æ®é€‰é¡¹å†…å®¹åœ¨é¡¶éƒ¨æŽ’ç‰ˆæ‹¼éŸ³ï¼Œåœ¨åº•éƒ¨æŽ’ç‰ˆè¯‘æ–‡ã€‚\\
%   å…¶ä¸­ï¼Œ\Arg{æ±‰å­—}å¯ä»¥ç•™ç©ºï¼Œ\oarg{å¤–è§‚é€‰é¡¹}ç”¨äºŽè®¾ç½®ç›’å­å¤–è§‚ï¼›
%   \tn{hanzibox}å‘½ä»¤ä¸­çš„\oarg{æ‹¼éŸ³é€‰é¡¹}æ—&nbsp;æ•ˆï¼Œå¯ä»¥çœç•¥ï¼Œä¹Ÿå¯ä»¥ç•™ç©ºï¼›
%   \oarg{è¯‘æ–‡é€‰é¡¹}å¯ä»¥æ˜¯ä»»æ„æ–‡æœ¬ï¼Œéœ€è¦æ³¨æ„çš„æ˜¯ï¼Œå½“éœ€è¦\oarg{è¯‘æ–‡é€‰é¡¹}æ—¶ï¼Œ
%   \oarg{æ‹¼éŸ³é€‰é¡¹}å¯ä»¥ç•™ç©ºï¼Œä½†ä¸èƒ½çœç•¥ã€‚
%   æ³¨éŸ³ç”±\pkg{xpinyin}å®åŒ…è‡ªåŠ¨æ&nbsp;¹æ®æ±‰å­—èŽ·å¾—ï¼Œæ­¤æ—¶ï¼Œå¯èƒ½ä¼šå­˜åœ¨å¤šéŸ³å­—ç­‰é—®é¢˜ï¼Œ
%   å…¶è°ƒæ•´è¯¦æƒ…è¯·å‚é˜…\pkg{xpinyin}å®åŒ…è¯´æ˜Žã€‚æ˜Ÿå·å‘½ä»¤\tn{hanzibox*}ç”¨äºŽæ‰‹åŠ¨æ·»åŠ&nbsp;æ³¨éŸ³ã€‚
%
%   æŽ’ç‰ˆæ&nbsp;·å¼å¯é€šè¿‡\tn{hanziboxset}å‘½ä»¤æˆ–\tn{hanzibox}\oarg{å¤–è§‚é€‰é¡¹}çš„key-valueè¿›è¡Œè®¾ç½®ã€‚
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.35\linewidth,gobble=5]
%     \centering
%     \hanziboxset{fillcolor=yellow!30, charcolor=red,
%       xscale=1.5,yscale=1.5,resize=real,framecolor=red}
%     \hanzibox[frametype=none]{æˆ‘}\\[1ex]
%     \hanzibox[frametype=å  ]{æˆ‘}[wo3][ä¿º]
%     \hanzibox[frametype=Ã—   ]{æˆ‘}[wo2][çˆ·]
%     \hanzibox[frametype=ç±³  ]{æˆ‘}[ni3][å¥´]\\[1ex]
%     \hanzibox[frametype=å£,pinyinline=true]{æˆ‘}[][å¾]
%     \hanzibox[frametype=ç”°,pinyinline=true]{æˆ‘}[wo1][æ„š]
%     \hanzibox[frametype=å’ª,pinyinline=true]{æˆ‘}[ta1][å±±äºº]
%   \end{SideBySideExample}
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.35\linewidth,gobble=5]
%     \centering
%     \hanziboxset{xscale=1.5,yscale=1.5,resize=real}
%     \hanzibox*[frametype=none]{æˆ‘}[wo3][me]\\[1ex]
%     \hanzibox*[frametype=å  ]{æˆ‘}[wo3][ä¿º]
%     \hanzibox*[frametype=Ã—   ]{æˆ‘}[wo3][çˆ·]
%     \hanzibox*[frametype=ç±³  ]{æˆ‘}[ni3][å¥´]\\[1ex]
%     \hanzibox*[frametype=å£,pinyinline=true]{æˆ‘}[wo3][å¾]
%     \hanzibox*[frametype=ç”°,pinyinline=true]{æˆ‘}[wo2][æ„š]
%     \hanzibox*[frametype=å’ª,pinyinline=true]{æˆ‘}[ta5][å±±äºº]
%   \end{SideBySideExample}
% \end{function}
%
% \subsection{\tn{hanzidialog}å‘½ä»¤}
%
% \begin{function}[added=2021-09-18,updated=2021-10-07]{\hanzidialog}
%   \begin{syntax}
%     \tn{hanzidialog} \oarg{å¤–è§‚é€‰é¡¹} \Arg{æ±‰å­—} \oarg{æ‹¼éŸ³é€‰é¡¹} \oarg{è¯‘æ–‡é€‰é¡¹}
%   \end{syntax}
%   æŽ’ç‰ˆæ±‰å­—ï¼Œå¹¶æ&nbsp;¹æ®é€‰é¡¹å†…å®¹åœ¨é¡¶éƒ¨æŽ’ç‰ˆæ‹¼éŸ³ï¼Œåœ¨åº•éƒ¨æŽ’ç‰ˆè¯‘æ–‡ã€‚\\
%   å…¶ä¸­ï¼Œ\Arg{æ±‰å­—}å¯ä»¥ç•™ç©ºï¼Œ\oarg{æ‹¼éŸ³é€‰é¡¹}å¯ä»¥æ˜¯ä»»æ„æ–‡æœ¬ï¼›\oarg{è¯‘æ–‡é€‰é¡¹}å¯ä»¥æ˜¯ä»»æ„æ–‡æœ¬ã€‚
%   \oarg{æ‹¼éŸ³é€‰é¡¹}å’Œ\oarg{è¯‘æ–‡é€‰é¡¹}éƒ½å¯ä»¥ç•™ç©ºï¼Œä¹Ÿå¯ä»¥çœç•¥ï¼Œ
%   ä½†å½“éœ€è¦\oarg{è¯‘æ–‡é€‰é¡¹}æ—¶ï¼Œ\oarg{æ‹¼éŸ³é€‰é¡¹}å¯ä»¥ç•™ç©ºï¼Œä½†ä¸èƒ½çœç•¥ã€‚
%   å¦‚æžœæ˜¯æ±‰è¯­æ‹¼éŸ³åˆ™éœ€è¦æ‰‹åŠ¨ä½¿ç”¨\pkg{xpinyin}å®åŒ…çš„\tn{pinyin}å‘½ä»¤æ·»åŠ&nbsp;æ³¨éŸ³ï¼Œ
%   æŽ’ç‰ˆæ&nbsp;·å¼å¯é€šè¿‡\tn{hanziboxset}å‘½ä»¤æˆ–\tn{hanzidialog}\oarg{å¤–è§‚é€‰é¡¹}è®¾ç½®ã€‚
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.25\linewidth,gobble=5]
%     \centering
%     \hanzidialog{çŽ‹è€å¸ˆ}[Wang \pinyin{lao3shi1}][teacher wang]
%
%     \hanzidialog[frametype=ç”°]{çŽ‹è€å¸ˆ}[Wang \pinyin{lao3shi1}]
%                 [çŽ‹å…ˆç”Ÿ]
%
%     \hanzidialog[frametype=å’ª,framecolor=red,pinyinline=true,
%                  height=1cm,resize=real,pinyincolor=blue]
%                 {çŽ‹è€å¸ˆ}[Wang \pinyin{lao3shi1}][çŽ‹å…ˆç”Ÿ]
%   \end{SideBySideExample}
% \end{function}
%
% \subsection{\tn{writegrid}å‘½ä»¤}
%
% \begin{function}[added=2022-04-17,updated=2022-04-17]{\writegrid}
%   \begin{syntax}
%     \tn{writegrid} \oarg{å¤–è§‚é€‰é¡¹} \Arg{è¡Œæ•°}
%   \end{syntax}
%   æ&nbsp;¹æ®æŒ‡å®šçš„\Arg{è¡Œæ•°}ï¼Œç”¨\oarg{å¤–è§‚é€‰é¡¹}æŒ‡å®šçš„å¤–è§‚å‚æ•°å’Œè¡Œé—´è·åŠ
%   åˆ—æ•°æŽ’ç‰ˆä½œæ–‡é¢˜ç›®ä¸­çš„å†™ä½œæ&nbsp;¼å­çº¸ã€‚\\
%   å…¶ä¸­ï¼Œ\oarg{å¤–è§‚é€‰é¡¹}ç”¨äºŽå•ä¸ªæ&nbsp;¼å­ç›’å­å¤–è§‚ï¼Œä½†è¦æ³¨æ„æ­¤æ—¶ï¼Œ
%   \oarg{æ‹¼éŸ³é€‰é¡¹}ã€\oarg{è¯‘æ–‡é€‰é¡¹}åŠå…¶ç›¸å…³é€‰é¡¹æ—&nbsp;æ•ˆã€‚ä¸Žä½œæ–‡
%   ç›´æŽ¥ç›¸å…³çš„é€‰é¡¹æœ‰\oarg{gridsepv}ç”¨äºŽè®¾ç½®ä¸åŒæ&nbsp;¼å­è¡Œçš„é—´è·ï¼Œ
%   \oarg{gridcols}ç”¨äºŽè®¾ç½®æ¯è¡Œçš„æ&nbsp;¼å­æ•°
%
%   æŽ’ç‰ˆæ&nbsp;·å¼å¯é€šè¿‡\tn{hanziboxset}å‘½ä»¤æˆ–\tn{writegrid}\oarg{å¤–è§‚é€‰é¡¹}çš„key-valueè¿›è¡Œè®¾ç½®ã€‚
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.65\linewidth,gobble=5]
%     \centering
%     \hanziboxset{framecolor=red,
%             fillcolor=yellow!30}
%     \writegrid{5}
%   \end{SideBySideExample}
% \end{function}
%
% \subsection{\tn{hanziboxset}å‘½ä»¤}
%
% \begin{function}[added=2021-09-20,updated=2021-09-24]{\hanziboxset}
%   \begin{syntax}
%     \tn{hanziboxset} \marg{é”®å€¼åˆ—è¡¨}
%   \end{syntax}
%   \tn{hanziboxset} çš„å‚æ•°æ˜¯ä¸€ç»„ç”±(è‹±æ–‡)é€—å·éš”å¼€çš„é€‰é¡¹åˆ—è¡¨ï¼Œ
%   åˆ—è¡¨ä¸­çš„é€‰é¡¹é€šå¸¸æ˜¯ \kvopt{\meta{key}}{\meta{value}} å½¢å¼ã€‚
%   éƒ¨åˆ†é€‰é¡¹çš„\meta{value} å¯ä»¥çœç•¥ã€‚å¯¹äºŽåŒä¸€é€‰é¡¹ï¼ŒåŽç»­è®¾ç½®ä¼šè¦†ç›–ä»¥å‰çš„è®¾ç½®ã€‚
%   å¤šæ•°é€‰é¡¹éƒ½è®¾æœ‰é»˜è®¤å€¼ã€‚
%
%   \tn{hanziboxset} é‡‡ç”¨ \LaTeX3 é£Žæ&nbsp;¼çš„é”®å€¼è®¾ç½®ï¼Œæ”¯æŒä¸åŒç±»åž‹ä»¥åŠå¤šç§
%   å±‚æ¬¡çš„é€‰é¡¹è®¾å®šã€‚é”®å€¼åˆ—è¡¨ä¸­ï¼Œâ€œ|=|â€å·¦å³çš„ç©ºæ&nbsp;¼ä¸å½±å“è®¾ç½®ï¼›ä½†éœ€æ³¨æ„ï¼Œ
%   å‚æ•°åˆ—è¡¨ä¸­\textbf{ä¸å¯ä»¥å‡ºçŽ°ç©ºè¡Œ}ã€‚
%
%   å¸ƒå°”åž‹çš„å‚æ•° \kvopt{\meta{é€‰é¡¹}}{true} ä¸­çš„â€œ|= true|â€å¯ä»¥çœç•¥ã€‚
% \end{function}
%
% \section{é€‰é¡¹è¯´æ˜Ž}
%
%   æœ¬å®åŒ…æä¾›äº†ä¸€ç³»åˆ—é€‰é¡¹ï¼Œä»¥å®žçŽ°æ±‰å­—ç›’å­å¤–è§‚æ&nbsp;·å¼è®¾ç½®ã€‚
%   è½½å…¥\pkg{hanzibox}å®åŒ…åŽï¼Œä»¥ä¸‹é€‰é¡¹å‡å¯é€šè¿‡ç”¨æˆ·æŽ¥å£å‘½ä»¤\tn{hanziboxset}è¿›è¡Œè®¾ç½®ã€‚
%   åŒæ—¶ï¼Œè¿™äº›é€‰é¡¹ä¹Ÿå¯ä»¥é€šè¿‡\tn{hanzibox}æˆ–\tn{hanzidialog}å‘½ä»¤çš„\oarg{å¤–è§‚é€‰é¡¹}è¿›è¡Œè®¾ç½®ã€‚
%
% \subsection{åŸºç¡€å­—ç¬¦å’Œå­—å·}
%
% \begin{function}[added=2021-09-24,updated=2021-09-24]{basechar,zihao}
%   \begin{syntax}
%     basechar = \meta{CJK char} \init{å¥½}
%     zihao    = \meta{å­—å·}     \init{4}
%   \end{syntax}
%   \opt{basechar} è®¾ç½®åŸºå­—ç¬¦ï¼Œç”¨äºŽè®¡ç®—ç¼©æ”¾æ¯”ä¾‹åŠç•™ç©ºæ±‰å­—å&nbsp;ä½å¤„ç†ï¼Œ
%   åŸºå­—ç¬¦ä¸åŒæ—¶ï¼Œå³ä½¿ç»™å®šç›¸åŒçš„ç¼©æ”¾æ¯”ä¾‹ï¼Œå…¶å®žé™…ç¼©æ”¾æ¯”ä¾‹ä¹Ÿå¯èƒ½ä¸åŒã€‚
%
%   \opt{zihao} è®¾ç½®åŸºå­—ç¬¦çš„å­—å·ã€‚
% \end{function}
%
% \subsection{æ‹¼éŸ³ã€æ±‰å­—å’Œè¯‘æ–‡æ&nbsp;¼å¼}
%
% \begin{function}[added=2021-09-27,updated=2021-10-08]{pinyinf,charf,tranf}
%   \begin{syntax}
%     pinyinf = \meta{æ&nbsp;¼å¼å‘½ä»¤}   \init{\normalsize}
%     charf   = \meta{æ&nbsp;¼å¼å‘½ä»¤}   \init{\tiny}
%     tranf   = \meta{æ&nbsp;¼å¼å‘½ä»¤}   \init{\tiny}
%   \end{syntax}
%   åˆ†åˆ«ç”¨äºŽè®¾ç½®æ‹¼éŸ³ã€æ±‰å­—ã€è¯‘æ–‡çš„æŽ’ç‰ˆæ&nbsp;¼å¼ï¼Œä¸»è¦ç”¨äºŽè®¾ç½®å­—ä½“ã€å­—å·ã€ç²—ç»†ç­‰æ&nbsp;¼å¼ã€‚
%
%   ä¸ºäº†åˆ†è§£æ‹¼éŸ³ï¼Œæœ¬å®åŒ…æˆªèŽ·äº†åŽŸ\pkg{xpinyin}å®åŒ…ä¸­çš„æ‹¼éŸ³è¾“å‡ºï¼Œå›&nbsp;æ­¤è‹¥éœ€è¦ä¿®æ”¹æ‹¼éŸ³å­—ä½“ï¼Œ
%   è¯·åœ¨\verb!pinyinf!é€‰é¡¹ä¸­è¿›è¡Œè®¾ç½®ã€‚
%
%   \textcolor[HTML]{AD1457}{å¼ºçƒˆå»ºè®®å°†å•ä¸ªæ±‰å­—å®½åº¦è®¾ç½®ä¸ºå¤§äºŽå…¶æ‹¼éŸ³æˆ–è¯‘æ–‡æ€»å®½åº¦ï¼Œ
%   ä»¥å…åœ¨æ±‰å­—é—´å½¢æˆç¼éš™}ã€‚
% \end{function}
%
% \subsection{å¤–æ¡†ç±»åž‹å’Œç¼©æ”¾æ–¹å¼}
%
% \begin{function}[added=2021-09-24,updated=2021-10-08]{frametype,resize}
%  \begin{syntax}
%    frametype = &lt;none|å|Ã—|ç±³|å£|ç”°|å’ª&gt; \init{none}
%    resize    = &lt;none|real|base&gt; \init{none}
%  \end{syntax}
%  \opt{frametype} è®¾ç½®æ±‰å­—ç›’å­æ&nbsp;·å¼ã€‚å¯ç”¨å€¼çš„æ•ˆæžœä¸Žé€‰é¡¹å€¼æ–‡å­—å½¢çŠ¶ç±»ä¼¼ï¼š
%  \verb|å|--ä»…ä¸­é—´çš„æ¨ªçº¿å’Œç«–çº¿ï¼Œ\verb|Ã—|--ä»…ä¸­é—´çš„ä¸¤æ¡å¯¹è§’çº¿ï¼Œ
%  \verb|ç±³|--åå­—æ&nbsp;¼å†åŠ&nbsp;ä¸Šæ–œçš„ä¸¤æ¡å¯¹è§’çº¿ï¼Œ
%  \verb|å£|--ä»…æ–¹æ¡†ï¼Œ\verb|ç”°|--å¸¸è§çš„ç”°å­—æ&nbsp;¼ï¼Œ\verb|å’ª|--å¸¸è§çš„ç±³å­—æ&nbsp;¼ã€‚
% \end{function}
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.50\linewidth,gobble=5]
%     \centering
%     \hanzibox[frametype=none]{æ—&nbsp;}\\[1ex]
%     \hanzibox[frametype=å  ]{å}
%     \hanzibox[frametype=Ã—   ]{ä¹‰}
%     \hanzibox[frametype=ç±³  ]{ç±³}\\[1ex]
%     \hanzibox[frametype=å£  ]{å£}
%     \hanzibox[frametype=ç”°  ]{ç”°}
%     \hanzibox[frametype=å’ª  ]{å’ª}
%   \end{SideBySideExample}
%
%  \opt{resize} è®¾ç½®ç¼©æ”¾æ–¹å¼ï¼Œ\opt{real}--ä½¿ç”¨å­—ç¬¦å®žé™…å®½é«˜ç¼©æ”¾ï¼Œ
%  \opt{base}--ä½¿ç”¨ \opt{basechar} å­—ç¬¦çš„å®½é«˜ç¼©æ”¾ï¼Œ
%
%  ä»¥ä¸‹ä¸ºå®½åº¦è®¾ç½®ä¸º 1cm æ—¶çš„ç¼©æ”¾æƒ…å†µã€‚
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth,gobble=5]
%     \centering
%     \hanziboxset{width=1cm,frametype=å’ª,
%                  framecolor=black}
%     \hanzibox[resize=none  ]{æ—&nbsp;}
%     \hanzibox[resize=real  ]{å®ž}
%     \hanzibox[resize=base  ]{åŸº}
%   \end{SideBySideExample}
%
% \subsection{ç¼©æ”¾æ¯”ä¾‹åŠå°ºå¯¸}
%
% \begin{function}[added=2021-09-24,updated=2021-09-24]{
%   xscale,yscale,scale,
%   width,height}
%   \begin{syntax}
%     xscale = \meta{scale ratio} \init{1}
%     yscale = \meta{scale ratio} \init{1}
%     scale  = \meta{scale ratio}
%     width  = \meta{dim}
%     height = \meta{dim}
%   \end{syntax}
%   è®¾ç½®ç¼©æ”¾æ¯”ä¾‹å’Œç›’å­å®½é«˜ã€‚
%
%   å®½é«˜å…·æœ‰æ›´é«˜çš„ä¼˜å…ˆçº§ï¼Œå³è‹¥æ¯”ä¾‹å’Œå®½é«˜éƒ½è®¾ç½®äº†ï¼Œåˆ™ä½¿ç”¨å®½é«˜æ¥è®¡ç®—ã€‚
%   å®½é«˜éƒ½ä¸º0cmè§†ä¸ºæœªè®¾ç½®ï¼ŒäºŒè€…æœ‰ä¸€å¤§äºŽ0cmï¼Œè§†ä¸ºè®¾ç½®äº†å®½é«˜ã€‚
% \end{function}
%
% \subsection{ç›’å­æ&nbsp;·å¼}
%
% \begin{function}[added=2021-09-24,updated=2021-09-24]{
%   linewidth,
%   dashpattern,
%   framearc,
%   framearc*,
%   framelinewidth,
%   pinyinlinewidth,
%   crosslinewidth
%   }
%   \begin{syntax}
%     linewidth       = \meta{dim} \init{0.4pt}
%     dashpattern     = \meta{ dim1, dim2, ... }
%     framearc        = \meta{dim}
%     framearc*       = \{ \marg{dim1} \marg{dim2} \}
%     framelinewidth  = \meta{dim} \init{0.4pt}
%     pinyinlinewidth = \meta{dim} \init{0.4pt}
%     crosslinewidth  = \meta{dim} \init{0.4pt}
%   \end{syntax}
%   è®¾ç½®è¾¹æ¡†çº¿å®½ã€çº¿åž‹ã€è½¬è§’æ&nbsp;·å¼åŠæ‹¼éŸ³å››çº¿æ&nbsp;¼å’Œå†…æ&nbsp;¼çº¿çº¿å®½ã€‚
%
%   \textcolor[HTML]{AD1457}{æ³¨ï¼šç›®å‰\textbf{linewidth}ä¸Ž
%     \textbf{framelinewidth}é€‰é¡¹çš„ä½œç”¨ç›¸åŒï¼Œéƒ½æ˜¯è®¾ç½®è¾¹æ¡†çº¿å®½ï¼Œ
%     åœ¨ä¸‹ä¸€ä¸ªç‰ˆæœ¬ä¸­ï¼Œä¼šåˆ&nbsp;é™¤\textbf{linewidth}é€‰é¡¹}ã€‚
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.28\linewidth,gobble=5]
%     \centering
%     \hanziboxset{width=1.0cm,resize=real,framecolor=red}
%     \hanzibox[linewidth=1pt,frametype=å£]{å¥½}
%     \hanzibox[dashpattern={1.5mm,1mm,2mm,1.5mm},frametype=ç”°]{å¥½}
%     \hanzibox[framelinewidth=1pt,frametype=å’ª]{å¥½} \\
%     \hanzibox[pinyinline,framearc=1mm,frametype=å£]{å¥½}
%     \hanzibox[framearc*={1mm}{2mm},frametype=ç”°]{å¥½}
%     \hanzibox[framearc*={2mm}{1mm},frametype=å’ª]{å¥½}\\
%     \hanzibox[pinyinline,pinyinlinewidth=0.8pt,frametype=å£]{å¥½}
%     \hanzibox[crosslinewidth=1pt,frametype=ç”°]{å¥½}
%     \hanzibox[crosslinewidth=1pt,frametype=å’ª]{å¥½}
%   \end{SideBySideExample}
% \end{function}
%
% \subsection{é¢œè‰²è®¾ç½®}
%
%
% \begin{function}[added=2021-10-07,updated=2021-10-07]{crosscolorratio}
%   \begin{syntax}
%     crosscolorratio  = \meta{integer} \init{20}
%   \end{syntax}
%   æ&nbsp;¼å­å†…éƒ¨åå­—çº¿æˆ–ç±³å­—çº¿é¢œè‰²å&nbsp;è¾¹æ¡†é¢œè‰²çš„æ¯”ä¾‹(0$\sim$100\%)ã€‚
%
%   \textcolor[HTML]{AD1457}{æ³¨ï¼š\textbf{crosscolorratio}é€‰é¡¹é¡»åœ¨è®¾ç½®äº†\textbf{framecolor}é€‰é¡¹åŽæ‰èƒ½ç”Ÿæ•ˆ}ã€‚
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.25\linewidth,gobble=5]
%     \centering
%     \hanzibox[frametype=å’ª,framecolor=red]{å}
%     \hanzibox[frametype=å’ª,crosscolorratio=30,framecolor=red]{ç”°}
%     \hanzibox[frametype=å’ª,crosscolorratio=50,framecolor=red]{ç±³}
%     \hanzibox[frametype=å’ª,crosscolorratio=80,framecolor=red]{å’ª}
%   \end{SideBySideExample}
% \end{function}
%
% \begin{function}[added=2021-09-24,updated=2021-10-07]{
%   framecolor,
%   framecolor*,
%   charcolor,
%   charcolor*,
%   pinyincolor,
%   pinyincolor*,
%   trancolor,
%   trancolor*,
%   fillcolor,
%   fillcolor*
%   }
%   \begin{syntax}
%     framecolor   = \meta{color expr} \init{black}
%     framecolor*  = \meta{model(s)} \meta{value(s)}
%     charcolor    = \meta{color expr} \init{black}
%     charcolor*   = \meta{model(s)} \meta{value(s)}
%     pinyincolor  = \meta{color expr} \init{black}
%     pinyincolor* = \meta{model(s)} \meta{value(s)}
%     trancolor    = \meta{color expr} \init{black}
%     trancolor*   = \meta{model(s)} \meta{value(s)}
%     fillcolor    = \meta{color expr}
%     fillcolor*   = \meta{model(s)} \meta{value(s)}
%   \end{syntax}
%   åˆ†åˆ«è®¾ç½®æ&nbsp;¼å­å¤–æ¡†ã€å­—ç¬¦ã€æ‹¼éŸ³ã€è¯‘æ–‡å’Œå¡«å……é¢œè‰²ã€‚
%   é¢œè‰²åç§°ä»…æ”¯æŒ \LaTeX3 å®šä¹‰çš„ black, white, red, green, blue, cyan, magenta å’Œ yellowã€‚
%   é¢œè‰²æ¨¡åž‹å’Œè¡¨è¾¾å¼ä¹Ÿåº”ä½¿ç”¨ \LaTeX3 æ”¯æŒçš„æ¨¡åž‹å’Œè¡¨è¾¾å¼ï¼Œè¯¦è§ \pkg{interface3.pdf} æ–‡æ¡£ã€‚
%
%   è‹¥è¦åŽ»æŽ‰ \opt{fillcolor}ï¼Œåº”å°†å…¶ç½®ä¸ºç©º(\verb|fillcolor={}|)ï¼Œè€Œä¸æ˜¯å°†å…¶è®¾ç½®ä¸ºwhite(ç™½è‰²)ã€‚
% \end{function}
%
% \subsection{å­—ç¬¦è½®å»“ç±»åž‹}
%
% \begin{function}[added=2021-10-08,updated=2021-10-08]{charstroke}
%   \begin{syntax}
%     charstroke = &lt;none|solid|dashed|invisible&gt; \init{none}
%   \end{syntax}
%   è®¾ç½®å­—ç¬¦å¤–è½®å»“æ&nbsp;·å¼ã€‚
%
%   åˆå§‹å€¼ \opt{none} æŒ‰åŽŸæ&nbsp;·è¾“å‡ºã€‚\opt{solid} è®¾ç½®å¤–è½®å»“ä¸º 0.10bp çš„å®žçº¿ï¼Œ
%   \opt{dashed} è®¾ç½®å¤–è½®å»“ä¸º 0.10bp çš„è™šçº¿ã€‚åŒæ—¶ï¼Œä¸å¡«å……è½®å»“å†…éƒ¨ï¼Œæ˜¾ç¤ºä¸ºèƒŒæ™¯é¢œè‰²ã€‚
%   \opt{invisible} å°†å­—ç¬¦è®¾ç½®ä¸ºä¸å¯è§ï¼Œä½†ä¸å½±å“èƒŒæ™¯å’Œç½‘æ&nbsp;¼çš„æ˜¾ç¤ºï¼Œéšè—çš„å­—ä»ç„¶å¯è¢«å¤åˆ¶ã€‚
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.30\linewidth,gobble=5]
%     \centering
%     \hanziboxset{width=1.0cm,resize=real,frametype=å’ª,
%                  framecolor=red}
%     \hanzibox[charstroke=none                           ]{æˆ‘}
%     \hanzibox[charstroke=solid,charcolor=red            ]{æˆ‘}\\
%     \hanzibox[charstroke=dashed,charcolor=green!40!black]{æˆ‘}
%     \hanzibox[charstroke=invisible                      ]{æˆ‘}
%   \end{SideBySideExample}
% \end{function}
%
% \subsection{å£°æ¯ã€éŸµæ¯å’Œå£°è°ƒå¼€å…³}
%
% \begin{function}[added=2021-09-24,updated=2021-09-24]{initial,vowel,tone}
%   \begin{syntax}
%     initial = &lt;\TTF&gt; \init{true}
%     vowel   = &lt;\TTF&gt; \init{true}
%     tone    = &lt;\TTF&gt; \init{true}
%   \end{syntax}
%   åˆ†åˆ«ç”¨äºŽè®¾ç½®æ˜¯å¦è¾“å‡ºæ‹¼éŸ³çš„å£°æ¯ã€éŸµæ¯å’Œå£°è°ƒï¼Œé»˜è®¤å€¼ä¸º\textbf{true}ã€‚
%
%   è¯¥é€‰é¡¹å¯¹\tn{hanzidialog}å‘½ä»¤æ—&nbsp;æ•ˆã€‚
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.28\linewidth,gobble=5]
%
%     \centering
%     \hanziboxset{frametype=å’ª,framecolor=red,
%                  fillcolor=yellow!40,resize=real}
%     \hanzibox{æ˜Žæœˆå‡&nbsp;æ—¶æœ‰}[]
%       [How long will the full moon appear?]\\[0.5ex]
%     \hanzibox[initial=false]{æ˜Žæœˆå‡&nbsp;æ—¶æœ‰}[]
%       [How long will the full moon appear?]\\[0.5ex]
%     \hanzibox[vowel=false]{æ˜Žæœˆå‡&nbsp;æ—¶æœ‰}[]
%       [How long will the full moon appear?]\\[0.5ex]
%     \hanzibox[tone=false]{æ˜Žæœˆå‡&nbsp;æ—¶æœ‰}[]
%       [How long will the full moon appear?]\\[0.5ex]
%     \hanzibox[initial=false,vowel=false]{æ˜Žæœ‰å‡&nbsp;æ—¶æœ‰}
%       [][How long will the full moon appear?]
%
%   \end{SideBySideExample}
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.28\linewidth,gobble=5]
%     \centering
%     \hanziboxset{frametype=å’ª,framecolor=red,fillcolor=yellow!40,
%       charf=\Huge,pinyinf=\small,tranf=\small,resize=real}
%     \hanzibox*[tone=false]{æˆ‘}[wo3][å¾]
%     \hanzibox*[vowel=false]{æˆ‘}[wo3][å¾]
%     \hanzibox*[initial=false]{æˆ‘}[wo3][ä¸æ‰]
%   \end{SideBySideExample}
% \end{function}
%
% \subsection{æ‹¼éŸ³å››çº¿æ&nbsp;¼å¼€å…³}
%
% \begin{function}[added=2021-10-07,updated=2021-10-08]{pinyinline}
%   \begin{syntax}
%     pinyinline = &lt;\TFF&gt; \init{false}
%   \end{syntax}
%   ç”¨äºŽè®¾ç½®æ˜¯å¦è¾“å‡ºæ‹¼éŸ³å››çº¿æ&nbsp;¼ï¼Œé»˜è®¤å€¼ä¸º\textbf{false}ã€‚
%   ä¸ºä¿æŒæ‹¼éŸ³å¯¹é½ä¸€è‡´æ€§ï¼Œ\verb!pinyinline=false!æ—¶ï¼Œ
%   ä»…ä¸è¾“å‡ºæ‹¼éŸ³å››çº¿æ&nbsp;¼ï¼Œä½†æ‹¼éŸ³å››çº¿æ&nbsp;¼çš„ç©ºé—´å&nbsp;ä½ä»ç„¶å­˜åœ¨ã€‚
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.33\linewidth,gobble=5]
%     \centering
%     \hanziboxset{frametype=å’ª,framecolor=red,charf=\large,
%                  fillcolor=yellow!40}
%     \hanzibox[pinyinline=false]{æ˜Žæœˆå‡&nbsp;æ—¶æœ‰}[]
%       [How long will the full moon appear?]\\[0.5ex]
%     \hanzibox[pinyinline=true]{æ˜Žæœˆå‡&nbsp;æ—¶æœ‰}[]
%   \end{SideBySideExample}
% \end{function}
%
% \subsection{æ‹¼éŸ³ã€æ±‰å­—å’Œè¯‘æ–‡å¼€å…³}
%
% \begin{function}[added=2021-09-21,updated=2021-09-26]{pinyin,hanzi,tran}
%   \begin{syntax}
%     pinyin = &lt;\TTF&gt; \init{true}
%     hanzi  = &lt;\TTF&gt;  \init{true}
%     tran   = &lt;\TTF&gt;   \init{true}
%   \end{syntax}
%   åˆ†åˆ«ç”¨äºŽè®¾ç½®æ˜¯å¦è¾“å‡ºæ‹¼éŸ³ã€æ±‰å­—å’Œè¯‘æ–‡ï¼Œé»˜è®¤å€¼ä¸º\textbf{true}ã€‚
%   è¯¥é€‰é¡¹å¯¹\tn{hanzidialog}å‘½ä»¤æ—&nbsp;æ•ˆã€‚
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.33\linewidth,gobble=5]
%     \centering
%     \hanziboxset{frametype=å’ª,framecolor=red,charf=\large,
%                  fillcolor=yellow!40}
%     \hanzibox[pinyin=false]{æ˜Žæœˆå‡&nbsp;æ—¶æœ‰}[]
%       [How long will the full moon appear?]\\[0.5ex]
%     \hanzibox[hanzi=false]{æ˜Žæœˆå‡&nbsp;æ—¶æœ‰}[]
%       [How long will the full moon appear?]\\[0.5ex]
%     \hanzibox[tran=false]{æ˜Žæœˆå‡&nbsp;æ—¶æœ‰}[]
%       [How long will the full moon appear?]\\[0.5ex]
%   \end{SideBySideExample}
% \end{function}
%
% \subsection{ä½œæ–‡æ&nbsp;¼å¼é€‰é¡¹}
%
% \begin{function}[added=2022-04-17,updated=2022-04-17]{gridsepv,gridcols}
%   \begin{syntax}
%     gridsepv  = \meta{number} \init{4}
%     gridcols  = \meta{integer} \init{20}
%   \end{syntax}
%   \oarg{gridsepv}ç”¨äºŽè®¾ç½®ä½œæ–‡æ&nbsp;¼å­è¡Œé—´é—´è·ï¼Œ
%   $\text{è¡Œé—´è·}=\text{å•ä¸ªç›’å­é«˜åº¦}\times\frac{1}{number}$ï¼Œ
%   é»˜è®¤å€¼å–4ã€‚
%
%   \oarg{gridcols}ç”¨äºŽè®¾ç½®æ&nbsp;¼å­æ¯è¡Œçš„åˆ—æ•°ï¼Œé»˜è®¤å€¼å–20ã€‚
%
%   è¿™ä¸¤ä¸ªé€‰é¡¹å¯¹\tn{hanzibox}å’Œ\tn{hanzidialog}å‘½ä»¤æ—&nbsp;æ•ˆã€‚
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.50\linewidth,gobble=5]
%     \centering
%     \hanziboxset{frametype=å’ª,framecolor=red,
%        charf=\large,fillcolor=yellow!40}
%     \writegrid{3}\\
%     \writegrid[gridsepv=0.5,gridcols=10]{3}\\
%     \writegrid[gridsepv=1.0,gridcols=15]{3}
%   \end{SideBySideExample}
% \end{function}
%
% \changes{v2.0.0}{2021/09/28}{åœ¨è¯´æ˜Žæ–‡æ¡£ä¸­æ·»åŠ&nbsp;åº”ç”¨å®žä¾‹}
% \changes{v2.2.0}{2021/10/07}{ä¸ºéƒ¨åˆ†å®žä¾‹æ·»åŠ&nbsp;æ‹¼éŸ³å››çº¿æ&nbsp;¼}
%
% \section{åº”ç”¨å®žä¾‹}
%
% \pkg{hanzibox}å®åŒ…å¯ä»¥å¹¿æ³›ç”¨äºŽæ±‰å­—å­¦ä¹&nbsp;çš„ç»ƒä¹&nbsp;ä¸­ã€‚
%
% \subsection{æ‹¼ä¸€æ‹¼---å†™ä¸€å†™ç»ƒä¹&nbsp;}
% åˆ©ç”¨å„ç§é€‰é¡¹çš„æœ‰æ•ˆç»„åˆï¼Œå¯ä»¥å®žçŽ°æ±‰å­—æ‹¼ä¸€æ‹¼---å†™ä¸€å†™ç»ƒä¹&nbsp;ã€‚
%
% \textcolor[HTML]{AD1457}{æ³¨æ„ï¼š\tn{hspace*}å‘½ä»¤ä¸­çš„
% å‚æ•°\textbf{0.4pt}æ˜¯è¾¹æ¡†çº¿æ¡å®½åº¦ï¼Œè¯·æ&nbsp;¹æ®å®žé™…æƒ…å†µè°ƒæ•´}ã€‚
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.32\linewidth,gobble=5]
%     \centering
%     \hanziboxset{frametype=ç”°,framecolor=blue,
%                  charf=\Huge,pinyinf=\small}
%     \hanzibox{é—¨}\hspace*{-0.4pt}\hanzibox[hanzi=false]{å£}
%     \hfill
%     \hanzibox{ç”Ÿ}\hspace*{-0.4pt}\hanzibox[hanzi=false]{æ—¥}\\
%     \hanzibox{é¢˜}\hspace*{-0.4pt}\hanzibox[hanzi=false]{ç›®}
%     \hfill
%     \hanzibox[hanzi=false]{ç”°}\hspace*{-0.4pt}\hanzibox{é‡Ž}
%   \end{SideBySideExample}
%
% \subsection{æ&nbsp;‡æ³¨å£°æ¯ç»ƒä¹&nbsp;}
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.32\linewidth,gobble=5]
%     \centering
%     \hanziboxset{frametype=å’ª,framecolor=red,charcolor=red,
%      pinyinline=true,charf=\Huge,pinyinf=\small,initial=false}
%     \hanzibox{é—¨å£}\hfill
%     \hanzibox{ç”Ÿæ—¥}\\
%     \hanzibox{é¢˜ç›®}\hfill
%     \hanzibox{ç”°é‡Ž}
%   \end{SideBySideExample}
%
% \subsection{æ&nbsp;‡æ³¨éŸµæ¯ç»ƒä¹&nbsp;}
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.32\linewidth,gobble=5]
%     \centering
%     \hanziboxset{frametype=å’ª,framecolor=red,charcolor=red,
%       pinyinline=true,charf=\Huge,pinyinf=\small,vowel=false}
%     \hanzibox{é—¨å£}\hfill
%     \hanzibox{ç”Ÿæ—¥}\\
%     \hanzibox{é¢˜ç›®}\hfill
%     \hanzibox{ç”°é‡Ž}
%   \end{SideBySideExample}
%
% \subsection{æ&nbsp;‡æ³¨å£°è°ƒç»ƒä¹&nbsp;}
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.32\linewidth,gobble=5]
%     \centering
%     \hanziboxset{frametype=å’ª,framecolor=red,charcolor=red,
%       pinyinline=true,charf=\Huge,pinyinf=\small,tone=false}
%     \hanzibox{é—¨å£}\hfill
%     \hanzibox{ç”Ÿæ—¥}\\
%     \hanzibox{é¢˜ç›®}\hfill
%     \hanzibox{ç”°é‡Ž}
%   \end{SideBySideExample}
%
% \subsection{éšæœºç”Ÿæˆç”Ÿè¯ç»ƒä¹&nbsp;}
%
% å‡è®¾æå‰å‡†å¤‡äº†ç”Ÿè¯è¡¨\verb!\clist_set:Nn \l__words_clist!ï¼Œåˆ™å¯ä»¥ä½¿ç”¨
% \LaTeX3çš„éšæœºå‡½æ•°éšæœºç”Ÿæˆç”Ÿè¯ç»ƒä¹&nbsp;é¢˜(æ¯æ¬¡ç¼–è¯‘å¯ä»¥å¾—åˆ°ä¸åŒçš„ç»“æžœ)ã€‚
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.30\linewidth,gobble=5]
%     \ExplSyntaxOn
%     \clist_set:Nn \l__words_clist
%       {
%         {é“…ç¬”} , {æ©¡çš®} , {æŠ¥çº¸} ,
%         {å¤´å‘} , {è€³æœµ} , {çœ¼ç›} ,
%         {å¤§è±¡} , {èš‚èš} , {æ¾é¼&nbsp;} ,
%         {ç”·å­©} , {åŒå­¦} , {å…„å¼Ÿ} ,
%         {å­¦ç”Ÿ} , {åŒ»ç”Ÿ} , {æŠ¤å£«} ,
%         {è€å¸ˆ} , {è­¦å¯Ÿ} , {ç¾Šè‚‰} ,
%         {çª—æˆ·} , {é•œå­} , {æ²™å‘}
%       }
%     \hanziboxset{frametype=å’ª,framecolor=red,charcolor=red,
%                  charf=\huge,pinyinf=\footnotesize,hanzi=false}
%     \centering
%     \int_step_inline:nn {6}
%       {
%         \hanzibox{\clist_rand_item:N \l__words_clist}\\
%       }
%     \ExplSyntaxOff
%   \end{SideBySideExample}
%
% \subsection{éšæœºç”Ÿæˆæ‹¼éŸ³ç»ƒä¹&nbsp;}
%
% å‡è®¾æå‰å‡†å¤‡äº†å£°æ¯å’ŒéŸµæ¯è¡¨ï¼Œåˆ™å¯ä»¥ä½¿ç”¨
% \LaTeX3çš„éšæœºå‡½æ•°éšæœºç”Ÿæˆæ‹¼éŸ³ç»ƒä¹&nbsp;é¢˜(æ¯æ¬¡ç¼–è¯‘å¯ä»¥å¾—åˆ°ä¸åŒçš„ç»“æžœ)ã€‚
% æ­¤æ—¶ï¼Œè‹¥ç”Ÿæˆçš„æ‹¼éŸ³ä¸æ­£ç¡®ï¼Œå¯è®©å­¦ç”Ÿå¡«å†™â€œæ—&nbsp;â€ã€‚
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.25\linewidth,gobble=5]
%     \ExplSyntaxOn
%     \int_new:N \l__tone_int
%     \clist_set:Nn \l__initials_clist
%       {
%         {zh} , {ch} , {sh} , {b} , {p} , {m} , {f} ,
%         {d}  , {t}  , {n}  , {l} , {g} , {k} , {h} ,
%         {j}  , {q}  , {x}  , {r} , {z} , {c} , {s} ,
%         {y}  , {w}
%       }
%     \clist_set:Nn \l__vowel_clist
%       {
%         {iang} , {iong} , {uang} , {ueng} , {ang} , {eng} , {ing} ,
%         {ong}  , {uai}  , {uan}  , {uai}  , {uei} , {iao} , {iou} ,
%         {ian}  , {van}  , {uen}  , {ai}   , {ei}  , {ua}  , {uo}  ,
%         {ui}   , {ao}   , {ou}   , {iu}   , {ie}  , {ve}  , {er}  ,
%         {an}   , {en}   , {in}   , {un}   , {vn}  , {a}   , {e}   ,
%         {i}    , {o}    , {u}    , {v}
%       }
%     \hanziboxset{frametype=å’ª,framecolor=red,charcolor=red,
%                  charf=\huge,pinyinf=\footnotesize,hanzi=false}
%     \centering
%     \int_step_inline:nn {10}
%       {
%         \int_zero:N \l__tone_int
%         \int_set:Nn \l__tone_int {\int_rand:n {5}}
%         \hanzibox*{å¥½}[
%           \clist_rand_item:N \l__initials_clist
%           \clist_rand_item:N \l__vowel_clist
%           \int_use:N \l__tone_int
%          ]\\
%       }
%     \ExplSyntaxOff
%   \end{SideBySideExample}
%
% \changes{v2.1.1}{2021/10/07}{åœ¨æ&nbsp;¼å­çº¸ç¤ºä¾‹ä¸­ç”¨coffinå®žçŽ°æ¯è¡Œæ&nbsp;¼å­ä»¥æå‡ç¼–è¯‘é€Ÿåº¦}
%
% \subsection{ç”Ÿæˆæ±‰å­—å­—å¸–æ&nbsp;¼å­çº¸}
%
% å¯ä»¥é€šè¿‡å°†\tn{hanzibox}å‘½ä»¤çš„\Arg{æ±‰å­—}å‚æ•°ç•™ç©ºï¼Œå¹¶è®¾ç½®\verb!tran=false!ï¼Œ
% æˆ–å°†\tn{hanzibox}ã€\tn{hanzibox*}å‘½ä»¤çš„\verb!hanzi!é€‰é¡¹ç½®ä¸º
% \verb!false!(\verb!hanzi=false!)ï¼Œä»Žè€Œç”Ÿæˆç©ºç™½èƒŒæ™¯æ&nbsp;¼å­ï¼Œ
% å†æ&nbsp;¹æ®éœ€è¦é€šè¿‡å¾ªçŽ¯çš„æ–¹å¼ç”ŸæˆæŒ‡å®šè¡Œæ•°å’Œåˆ—æ•°çš„
% æ±‰å­—ä¹¦å†™ç»ƒä¹&nbsp;ç”¨æ&nbsp;¼å­çº¸ã€‚
%
% \textcolor[HTML]{AD1457}{æ³¨æ„ï¼šå‚æ•°ä¸­çš„\textbf{0.4pt}æ˜¯è¾¹æ¡†çº¿æ¡å®½åº¦ï¼Œ
% è¯·æ&nbsp;¹æ®å®žé™…æƒ…å†µè°ƒæ•´}ã€‚
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.37\linewidth,gobble=5]
%     \hanziboxset{frametype=å’ª,framecolor=red,
%          tran=false,charcolor=red,charf=\huge}
%     \centering
%     \ExplSyntaxOn
%     \hcoffin_set:Nn \l_tmpa_coffin
%       {
%         \int_step_inline:nn {6}
%           {
%             \hanzibox{}
%             \hspace*{-0.40pt}
%           }
%       }
%     \hcoffin_set:Nn \l_tmpb_coffin
%       {}
%     \int_step_inline:nn {8}
%       {
%         \coffin_join:NnnNnnnn \l_tmpb_coffin { hc } { b }
%           \l_tmpa_coffin { hc } { t } { 0pt } { 0.4pt }
%       }
%     \coffin_typeset:Nnnnn
%       \l_tmpb_coffin { l } { b } { 0pt } { 0pt }
%     \ExplSyntaxOff
%   \end{SideBySideExample}
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.37\linewidth,gobble=5]
%     \hanziboxset{frametype=å’ª,framecolor=red,
%       pinyinline=true,charf=\huge,hanzi=false}
%     \centering
%     \ExplSyntaxOn
%     \hcoffin_set:Nn \l_tmpa_coffin
%       {
%         \int_step_inline:nn {6}
%           {
%             \hanzibox*{å›½}
%             \hspace*{-0.40pt}
%           }
%       }
%     \int_step_inline:nn {8}
%       {
%         \coffin_typeset:Nnnnn
%           \l_tmpa_coffin { l } { b } { 0pt } { 0pt }
%         \par\nointerlineskip
%      }
%     \ExplSyntaxOff
%   \end{SideBySideExample}
%
% \subsection{ç”Ÿæˆä½œæ–‡é¢˜ç›®æ&nbsp;¼å­çº¸}
%
% å¯ä»¥ä½¿ç”¨æœ¬å®åŒ…æä¾›çš„\tn{writegrid}å‘½ä»¤ç”Ÿæˆä½œæ–‡é¢˜ç›®ä¸­ç”¨äºŽç­”é¢˜çš„
% æ&nbsp;¼å¼çº¸ã€‚
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.48\linewidth,gobble=5]
%     \hanziboxset{frametype=å£,framecolor=black,
%                  charcolor=red,charf=\huge}
%     \centering
%     \writegrid[gridcols=8]{10}
%   \end{SideBySideExample}
%
% \subsection{ç”Ÿæˆè¯—è¯æ³¨éŸ³}
%
% å¯ä»¥é€šè¿‡è‡ªåŠ¨æ³¨éŸ³ç”Ÿæˆå¸¦æœ‰æ³¨éŸ³çš„è¯—è¯æŽ’ç‰ˆï¼Œ
% ä½†å½“æœ‰å¤šéŸ³å­—æ—¶ï¼Œéœ€è¦ä½¿ç”¨\pkg{xpinyin}å®åŒ…çš„\tn{setpinyin}å‘½ä»¤
% ä¸ºå¤šéŸ³å­—è®¾ç½®æ­£ç¡®çš„è¯»éŸ³ã€‚
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.50\linewidth,gobble=5]
%     \setpinyin{é•¿}{chang2}
%     \setpinyin{å°½}{jin4}
%     \hanziboxset{frametype=å’ª,framecolor=red,
%       charf=\huge,pinyinf=\footnotesize,
%       charcolor=green!40!black,
%       pinyincolor=green!40!black,
%       trancolor=green!40!black}
%     \centering
%     \hanzibox{æ•…äººè¥¿è¾žé»„é¹¤æ¥¼}
%     \hanzibox{çƒŸèŠ±ä¸‰æœˆä¸‹æ‰¬å·ž}
%     \hanzibox{å­¤å¸†è¿œå½±ç¢§ç©ºå°½}
%     \hanzibox{å”¯è§é•¿æ±Ÿå¤©é™…æµ}
%   \end{SideBySideExample}
%
% \subsection{è¯—è¯æ‰‹åŠ¨æ³¨éŸ³}
%
% ä¹Ÿå¯ä»¥ä½¿ç”¨\tn{hanzibox*}å‘½ä»¤å®žçŽ°è¯—è¯æ‰‹åŠ¨æ³¨éŸ³ï¼Œ
% æ­¤æ—¶ï¼Œå¯ä»¥é€šè¿‡ç•™ç©ºæ‹¼éŸ³æˆ–æ–‡å­—æž„æˆæ³¨éŸ³æˆ–æ&nbsp;¹æ®æ‹¼éŸ³å†™æ±‰å­—ç»ƒä¹&nbsp;ã€‚
% ä½†éœ€è¦æ³¨æ„ï¼Œç›®å‰åªèƒ½åœ¨ä¸€è¡Œæ–‡æœ¬çš„å°¾éƒ¨å®žçŽ°ç•™ç©ºç»ƒä¹&nbsp;ã€‚
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.33\linewidth,gobble=5]
%     \hanziboxset{frametype=å’ª,framecolor=red,charf=\Large,
%       pinyinline=true,charcolor=green!40!black,
%       pinyincolor=red!20!black,trancolor=blue!40!black}
%     \centering
%     \hanzibox*{æ•…äººè¥¿è¾žé»„é¹¤æ¥¼}[gu4ren2xi1ci2huang2he2lou2]
%     \hanzibox*{çƒŸèŠ±ä¸‰æœˆä¸‹æ‰¬å·ž}[yan1hua1san1yue4]
%     \hanzibox*{å­¤å¸†è¿œå½±      }[gu1fan1yuan3ying3bi4kong1jin4]
%     \hanzibox*{}[wei2jian4chang2jiang1tian1ji4liu2]
%   \end{SideBySideExample}
%
% \subsection{ç”Ÿæˆæçº¢ç»ƒä¹&nbsp;}
%
% åˆç†çš„è®¾ç½®æ±‰å­—çš„é¢œè‰²æµ“æ·¡æˆ–é€šè¿‡\verb!charstroke!é€‰é¡¹è®¾ç½®
% æ±‰å­—è½®å»“é€‰é¡¹ï¼Œå¯ä»¥ç”Ÿæˆç”¨äºŽæçº¢ç»ƒä¹&nbsp;çš„æ&nbsp;¼å­çº¸ã€‚
%
% è‹¥è®¾ç½®\verb!charstroke=invisible!ï¼Œåˆ™ä¼šä½¿æ±‰å­—éšè—ä¸å¯è§ï¼Œ
% ä½†éšè—çš„æ±‰å­—ä»ç„¶å¯è¢«å¤åˆ¶ã€‚
%
%   \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.25\linewidth,gobble=5]
%     \hanziboxset{frametype=å’ª,framecolor=red,pinyinline=true,
%       pinyincolor=green!30!black,charf=\Large,pinyinf=\footnotesize}
%     \centering
%     \hanzibox[charcolor=red!30,pinyincolor=red]{è®²æ™®é€šè¯}
%     \hanzibox[charcolor=black!30,pinyinline=false]{å†™è§„èŒƒå­—}
%     \hanzibox[charcolor=red,charstroke=solid]{è®²æ™®é€šè¯}
%     \hanzibox[charcolor=black,charstroke=dashed]{å†™è§„èŒƒå­—}
%     \hanzibox[charcolor=red,charstroke=invisible]{è®²æ™®é€šè¯}
%   \end{SideBySideExample}
%
% \end{documentation}
%
% \StopEventually{}
%
% \begin{implementation}
%
% \section{ä»£ç&nbsp;å®žçŽ°}
%
% æœ¬å®åŒ…ä½¿ç”¨ \LaTeX3 è¯­æ³•ç¼–å†™ï¼Œä¾èµ– \pkg{expl3} çŽ¯å¢ƒï¼Œ
% å¹¶éœ€è°ƒç”¨ \pkg{l3packages}ã€\pkg{l3draw}ã€\pkg{xpinyin}ç­‰å®åŒ…ã€‚
%
% æŒ‰ç…§ \LaTeX3 è¯­æ³•ï¼Œä»£ç&nbsp;ä¸­çš„ç©ºæ&nbsp;¼ã€æ¢è¡Œã€å›žè½¦ä¸Žåˆ¶è¡¨ç¬¦ä¼šå®Œå…¨è¢«å¿½ç•¥ï¼Œ
% è€Œä¸‹åˆ’çº¿â€œ|_|â€å’Œå†’å·â€œ|:|â€åˆ™å¯ä½œä¸ºä¸€èˆ¬å­—æ¯ä½¿ç”¨ã€‚
% æ­£å¸¸çš„ç©ºæ&nbsp;¼å¯ä»¥ä½¿ç”¨â€œ|~|â€ä»£æ›¿ï¼›è‡³äºŽ |~| åŽŸæ¥æ‰€è¡¨ç¤ºçš„â€œå¸¦å­â€ï¼Œ
% åˆ™è¦ç”¨ \LaTeXe{} çš„åŽŸå§‹å‘½ä»¤ \tn{nobreakspace} ä»£æ›¿ã€‚
%
% ä»¥ä¸‹ä»£ç&nbsp;ä¸­æœ‰ä¸€äº›å½¢å¦‚ \textcolor[HTML]{2E3191}{\textsf{&lt;*package&gt;}}
% çš„æ&nbsp;‡è®°ï¼Œè¿™æ˜¯ \pkg{DocStrip} ä¸­çš„â€œguardâ€ï¼Œç”¨æ¥é€‰æ‹©æ€§åœ°æå–æ–‡ä»¶ã€‚
% â€œ\textsf{*}â€å’Œâ€œ\textsf{/}â€åˆ†åˆ«è¡¨ç¤ºè¯¥éƒ¨åˆ†çš„å¼€å§‹å’Œç»“æŸã€‚ä¸å«
% â€œ\textsf{*}â€å’Œâ€œ\textsf{/}â€çš„ guard å‡ºçŽ°åœ¨è¡Œå·å³ä¾§ï¼Œå®ƒä»¬ç”¨æ¥ç¡®å®š
% å•ç‹¬ä¸€è¡Œä»£ç&nbsp;çš„å½’å±žã€‚è¿™äº› guard çš„é¢œè‰²æ·±æµ…ä¸ä¸€ï¼Œç”¨ä»¥æ˜Žç¡®åµŒå¥—å…³ç³»ã€‚
%
% å¦æœ‰è‹¥å¹²å½¢å¦‚ \textcolor[HTML]{AD1457}{\textsf{&lt;@@=hanzibox&gt;}} çš„ guardï¼Œ
% å®ƒä»¬ç”± \pkg{l3docstrip} å®šä¹‰ï¼Œç”¨æ¥æ&nbsp;‡è¯†åå­—ç©ºé—´ï¼ˆæ¨¡å—ï¼‰ã€‚
%
% \subsection{çŽ¯å¢ƒæ£€æµ‹ä¸Žå‡†å¤‡}
%
%    \begin{macrocode}
%&lt;*package&gt;
%&lt;@@=hanzibox&gt;
%    \end{macrocode}
%
% è½½å…¥å¿…è¦çš„å®åŒ…
%
%    \begin{macrocode}

\RequirePackage { xtemplate, l3keys2e, l3draw, xparse }

%    \end{macrocode}
%
% æ£€æŸ¥LaTeX3å®åŒ…ç‰ˆæœ¬
%
%    \begin{macrocode}
% \clist_map_inline:nn { xtemplate, l3keys2e }
%   {
%     \@ifpackagelater {#1} { 2020/07/17 }
%       { } { \msg_error:nnn { hanzibox } { l3-too-old } {#1} }
%   }
% \msg_new:nnn { hanzibox } { l3-too-old }
%   {
%     Package~ "#1"~ is~ too~ old. \\\\
%     Please~ update~ an~ up-to-date~ version~ of~ the~ bundles \\
%     "l3kernel"~ and~ "l3packages"~ using~ your~ TeX~ package \\
%     manager~ or~ from~ CTAN.
%   }
%
%    \end{macrocode}
%
% \changes{v2.1.1}{2021/10/03}{è§£å†³ç›’å­é«˜åº¦è®¡ç®—å‡½æ•°çš„expl3ç‰ˆæœ¬å…¼å®¹é—®é¢˜}
%
% åˆ¤æ–­\tn{box_ht_plus_dp:N}å‡½æ•°æ˜¯å¦å­˜åœ¨ï¼Œè‹¥ä¸å­˜åœ¨ï¼Œåˆ™å®šä¹‰è¯¥å‡½æ•°ã€‚
% ä¸ºäº†è§£å†³ä¸Žexpl3çš„æ—§ç‰ˆæœ¬å…¼å®¹é—®é¢˜(
% æ‘˜å½•äºŽ\url{https://ask.latexstudio.net/ask/question/3773.html})ã€‚
%
%    \begin{macrocode}
\cs_if_free:NT \box_ht_plus_dp:N
  {
    \cs_new_protected:Npn \box_ht_plus_dp:N #1
      { \tex_dimexpr:D \box_ht:N #1 + \box_dp:N #1 \scan_stop: }
  }
%    \end{macrocode}
%
% æ£€æŸ¥ç¼–è¯‘å¼•æ“Žï¼Œç›®å‰ä»…æ”¯æŒxetexå¼•æ“Žã€‚
%
%    \begin{macrocode}
\sys_if_engine_xetex:F
  {
    \msg_fatal:nnx { hanzibox } { unsupported-engine }
      { \c_sys_engine_str }
  }
\msg_new:nnn { hanzibox } { unsupported-engine }
  {
    The~ hanzibox~ packages~ requires~ XeTeX. \\\\
    "#1"~ is~ not~ supported~ at~ present.~ You~ must~ change \\
    your~ typesetting~ engine~ to~ "xelatex"~ or~ "lualatex".
  }

%    \end{macrocode}
%
% è½½å…¥xpinyinå®åŒ…
%
%    \begin{macrocode}
\RequirePackage { xpinyin }

%    \end{macrocode}
%
% \subsection{ç”¨æˆ·æŽ¥å£}
%
% \changes{v1.1.0}{2021/09/22}{ä¸ºç”¨æˆ·å‘½ä»¤æ·»åŠ&nbsp;ç»„é™åˆ¶}
% \changes{v2.0.0}{2021/09/26}{è°ƒæ•´æ˜Ÿå·å‘½ä»¤ä¸ºæ‰‹åŠ¨æ‹¼éŸ³æ³¨éŸ³}
% èƒŒæ™¯ç›’å­ç”±l3drawå®žçŽ°ï¼Œ
% å…¶è®¾è®¡æ€è·¯å’Œéƒ¨åˆ†æºç&nbsp;æ¥è‡ª\LaTeX çš„\pkg{zitie}å®åŒ…(\url{https://www.ctan.org/pkg/zitie})ã€‚
%
% \begin{macro}{\hanzibox}
% è‡ªåŠ¨æ³¨éŸ³æ±‰å­—ç›’å­å‘½ä»¤ã€‚
%    \begin{macrocode}
\NewDocumentCommand{\hanzibox}{ s O{} m O{} O{} }
  {
    \IfBooleanTF{#1}
      {
        \bool_set_false:N \l_@@_autopinyin_bool
      }{
        \bool_set_true:N  \l_@@_autopinyin_bool
      }
      \group_begin:
        \@@_handle:nnnn { #2 } { #3 } { #4 } { #5 }
      \group_end:
  }

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hanzidialog}
% æ‰‹åŠ¨æ³¨éŸ³æ±‰å­—ç›’å­å‘½ä»¤ã€‚
%    \begin{macrocode}
\NewDocumentCommand{\hanzidialog}{O{} m O{} O{} }
  {
    \group_begin:
      \bool_set_false:N \l_@@_autopinyin_bool
      \@@_dialog:nnnn { #1 } { #2 } { #3 } { #4 }
    \group_end:
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.3.0}{2022/04/17}{æ·»åŠ&nbsp;\tn{writegrid}ä½œæ–‡æ&nbsp;¼å­è¾“å‡ºå‘½ä»¤ã€‚}
%
% \begin{macro}{\writegrid}
% è‡ªåŠ¨æ³¨éŸ³æ±‰å­—ç›’å­å‘½ä»¤ã€‚
%    \begin{macrocode}
\NewDocumentCommand{\writegrid}{ O{} m }
  {
    \group_begin:
      \@@_writegrid:nn { #1 } { #2 }
    \group_end:
  }
%    \end{macrocode}
% \end{macro}
%
% \subsection{å†…éƒ¨å˜é‡å£°æ˜Ž}
%
% \changes{v1.1.0}{2021/09/21}{æ·»åŠ&nbsp;ç¼©æ”¾æ¯”ä¾‹ï¼Œå‰æ™¯/èƒŒæ™¯è‰²ï¼Œéšè—æŽ§åˆ¶å˜é‡ã€‚}
% \changes{v2.0.0}{2021/09/24}{æ&nbsp;¹æ®l3drawçš„éœ€è¦é‡æ–°è®¾è®¡å„ä¸ªå˜é‡ã€‚}
% \changes{v2.1.0}{2021/09/30}{æ·»åŠ&nbsp;è®°å½•æ‹¼éŸ³è¿”å›žç»“æžœçš„clistå˜é‡ã€‚}
% \changes{v2.2.0}{2021/10/07}{æ·»åŠ&nbsp;æ‹¼éŸ³çº¿å¼€å…³åŠæ‹¼éŸ³å’Œè¯‘æ–‡é¢œè‰²å˜é‡}
% \changes{v2.2.0}{2021/10/08}{æ·»åŠ&nbsp;å­—ç¬¦è½®å»“ç±»åž‹é€‰æ‹©å˜é‡}
% \changes{v2.2.0}{2021/10/09}{æ·»åŠ&nbsp;æ‹¼éŸ³æ±‰å­—coffinå˜é‡}
% \changes{v2.3.0}{2022/04/17}{æ·»åŠ&nbsp;ä½œæ–‡æ&nbsp;¼å­åž‚ç›´é—´è·ç³»æ•°å˜é‡åŠcoffinå˜é‡ã€‚}
%
% \begin{variable}{\l_@@_autopinyin_bool,
% \l_@@_withinitial_bool,
% \l_@@_withvowel_bool,
% \l_@@_withtone_bool,
% \l_@@_withpinyin_bool,
% \l_@@_withpinyinlines_bool,
% \l_@@_withhanzi_bool,
% \l_@@_withtran_bool,
% \l_@@_basebox_box,
% \l_@@_frame_type_tl,
% \g_@@_frame_list_clist,
% \l_@@_resize_method_tl,
% \g_@@_resize_method_clist,
% \l_@@_frame_size_dim,
% \l_@@_char_width_dim,
% \l_@@_char_height_dim,
% \l_@@_pinyin_height_i_dim,
% \l_@@_pinyin_height_ii_dim,
% \l_@@_pinyin_height_iii_dim,
% \l_@@_box_width_dim,
% \l_@@_box_height_dim,
% \l_@@_frame_linewidth_dim,
% \l_@@_pinyin_linewidth_dim,
% \l_@@_cross_linewidth_dim,
% \l_@@_tone_pinyin_clist,
% \l_@@_str_box_coffin,
% \l_@@_box_coffin,
% \l_@@_pinyin_box_coffin,
% \l_@@_tran_box_coffin,
% \l_@@_pinyin_hanzi_coffin,
% \l_@@_tmpa_coffin,
% \l_@@_tmpb_coffin,
% \l_@@_grid_coffin,
% \l_@@_grid_tmpa_coffin,
% \l_@@_grid_tmpb_coffin,
% \hanziboxwidth,
% \hanziboxheight,
% \l_@@_pinyin_tl,
% \l_@@_character_tl,
% \l_@@_translation_tl,
% \l_@@_pinyin_format_tl,
% \l_@@_character_format_tl,
% \l_@@_translation_format_tl,
% \l_@@_cross_color_ratio_int,
% \l_@@_pinyin_int,
% \l_@@_character_int,
% \l_@@_translation_int,
% \l_@@_charstroke_type_int,
% \l_@@_grid_cols_int,
% \l_@@_tone_int,
% \l_@@_pinyin_str,
% \l_@@_initial_tl,
% \l_@@_vowel_tl,
% \l_@@_grid_sep_v_tl,
%  }
% å®šä¹‰å˜é‡ã€‚
%
%    \begin{macrocode}
\bool_new:N   \l_@@_autopinyin_bool
\bool_new:N   \l_@@_withinitial_bool
\bool_new:N   \l_@@_withvowel_bool
\bool_new:N   \l_@@_withtone_bool
\bool_new:N   \l_@@_withpinyin_bool
\bool_new:N   \l_@@_withpinyinlines_bool
\bool_new:N   \l_@@_withhanzi_bool
\bool_new:N   \l_@@_withtran_bool

\box_new:N    \l_@@_basebox_box
\tl_new:N     \l_@@_frame_type_tl
\clist_new:N  \g_@@_frame_list_clist
\tl_new:N     \l_@@_resize_method_tl
\clist_new:N  \g_@@_resize_method_clist
\dim_new:N    \l_@@_frame_size_dim
\dim_new:N    \l_@@_char_width_dim
\dim_new:N    \l_@@_char_height_dim
\dim_new:N    \l_@@_pinyin_height_i_dim
\dim_new:N    \l_@@_pinyin_height_ii_dim
\dim_new:N    \l_@@_pinyin_height_iii_dim
\dim_new:N    \l_@@_box_width_dim
\dim_new:N    \l_@@_box_height_dim
\dim_new:N    \l_@@_frame_linewidth_dim
\dim_new:N    \l_@@_pinyin_linewidth_dim
\dim_new:N    \l_@@_cross_linewidth_dim

\clist_new:N  \l_@@_tone_pinyin_clist

\coffin_new:N \l_@@_str_box_coffin
\coffin_new:N \l_@@_box_coffin
\coffin_new:N \l_@@_pinyin_box_coffin
\coffin_new:N \l_@@_tran_box_coffin
\coffin_new:N \l_@@_pinyin_hanzi_coffin
\coffin_new:N \l_@@_tmpa_coffin
\coffin_new:N \l_@@_tmpb_coffin
\coffin_new:N \l_@@_grid_coffin
\coffin_new:N \l_@@_grid_tmpa_coffin
\coffin_new:N \l_@@_grid_tmpb_coffin

\dim_new:N    \hanziboxwidth
\dim_new:N    \hanziboxheight

\tl_new:N     \l_@@_pinyin_tl
\tl_new:N     \l_@@_character_tl
\tl_new:N     \l_@@_translation_tl
\tl_new:N     \l_@@_pinyin_format_tl
\tl_new:N     \l_@@_character_format_tl
\tl_new:N     \l_@@_translation_format_tl
\int_new:N    \l_@@_cross_color_ratio_int
\int_new:N    \l_@@_pinyin_int
\int_new:N    \l_@@_character_int
\int_new:N    \l_@@_translation_int
\int_new:N    \l_@@_charstroke_type_int
\int_new:N    \l_@@_grid_cols_int

\int_new:N    \l_@@_tone_int
\str_new:N    \l_@@_pinyin_str
\tl_new:N     \l_@@_initial_tl
\tl_new:N     \l_@@_vowel_tl
\tl_new:N     \l_@@_grid_sep_v_tl

%    \end{macrocode}
% \end{variable}
%
% \subsection{è¾…åŠ©å‡½æ•°}
%
% \subsubsection{è®¾ç½®å¡«å……è‰²}
%
% \begin{macro}{\@@_aux_color_fill:}
% è®¾ç½®ç©ºç™½å¡«å……è‰²
%    \begin{macrocode}
\cs_new_nopar:Nn \@@_aux_color_fill:
  { }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/07}{æ·»åŠ&nbsp;æ‹¼éŸ³é«˜åº¦è®¡ç®—å‡½æ•°}
%
% \subsubsection{è®¡ç®—æ‹¼éŸ³é«˜åº¦}
%
% \begin{macro}{\@@_calc_pinyin_h:}
% è®¡ç®—æ‹¼éŸ³çº¿åŸºç¡€è°ƒè¯•(é€šè¿‡å­—æ¯"a"çš„é«˜åº¦è®¡ç®—)
%    \begin{macrocode}
\cs_new:Npn \@@_calc_pinyin_h:
  {
    \hbox_set:Nn \l_tmpa_box
      {
        \tl_use:N \l_@@_pinyin_format_tl
        a
      }
    \dim_set:Nn \l_@@_pinyin_height_i_dim
      {
        \box_ht:N \l_tmpa_box
      }
    \dim_set:Nn \l_@@_pinyin_height_ii_dim
      {
        \l_@@_pinyin_height_i_dim + \l_@@_pinyin_height_i_dim
      }
    \dim_set:Nn \l_@@_pinyin_height_iii_dim
      {
        \l_@@_pinyin_height_i_dim + \l_@@_pinyin_height_i_dim + \l_@@_pinyin_height_i_dim
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{è®¡ç®—ç›’å­å°ºå¯¸}
%
% \begin{macro}{\@@_calc_basechar_w_h:}
% è®¡ç®—åŸºå­—ç¬¦ç›’å­å®½å’Œé«˜
%    \begin{macrocode}
\cs_new:Npn \@@_calc_basechar_w_h:
  {
    \dim_set:Nn \l_@@_char_width_dim
      {
        \box_wd:N \l_@@_basebox_box
      }
    \dim_set:Nn \l_@@_char_height_dim
      {
        \box_ht_plus_dp:N \l_@@_basebox_box
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_coffin_ht_plus_dp:N}
% èŽ·å–coffinç›’å­æ€»é«˜åº¦
%    \begin{macrocode}
\cs_new_nopar:Npn \@@_coffin_ht_plus_dp:N #1
  {
    \coffin_ht:N #1 + \coffin_dp:N #1
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0.0}{2021/09/28}{æ·»åŠ&nbsp;æ&nbsp;¹æ®åŸºå­—ç¬¦æ&nbsp;¼å¼è®¡ç®—ç›’å­å°ºå¯¸å‡½æ•°}
%
% \begin{macro}{\@@_calc_frame_size:}
% è®¡ç®—å¤–æ¡†é•¿åº¦(æ­£æ–¹å½¢ï¼Œç”±åŸºå­—ç¬¦æŒ‰charfé€‰é¡¹è®¾å®šçš„æ&nbsp;¼å¼æž„é€&nbsp;çš„ç›’å­ç¡®å®š)
%    \begin{macrocode}
\cs_new:Npn \@@_calc_frame_size:
  {
    \hbox_set:Nn \l_tmpa_box
      {
        \tl_use:N \l_@@_character_format_tl
        \tl_use:N \c_@@_basechar_tl
      }

    \dim_set:Nn \l_tmpa_dim
      {
        \box_wd:N \l_tmpa_box
      }
    \dim_set:Nn \l_tmpb_dim
      {
        \box_ht_plus_dp:N \l_tmpa_box
      }

    \dim_compare:nNnTF \l_tmpa_dim &gt; \l_tmpb_dim
      {
        \dim_gset_eq:NN \l_@@_frame_size_dim \l_tmpa_dim
      }
      {
        \dim_gset_eq:NN \l_@@_frame_size_dim \l_tmpb_dim
      }

    \dim_gadd:Nn \l_@@_frame_size_dim { 1pt }

    \dim_gset_eq:NN \hanziboxwidth \l_@@_frame_size_dim
    \dim_gset_eq:NN \hanziboxheight \l_@@_frame_size_dim

  }
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{å®šä¹‰è¾¹æ¡†æ&nbsp;·å¼}
%
% \begin{macro}{\@@_frame_type:n,\@@_frame_type_c:n}
% ç”Ÿæˆè¾¹æ¡†æ&nbsp;·å¼å‡½æ•°åç§°
%    \begin{macrocode}
\cs_new_nopar:Npn \@@_frame_type:n #1
  {
    @@_frame_construct_type_ #1 :nnnnnn
  }
\cs_new_nopar:Npn \@@_frame_type_c:n #1
  {
    \use:c
      {
        @@_frame_construct_type_ #1 :nnnnnn
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_new_frame_construct:nn}
% è¾¹æ¡†æ&nbsp;·å¼å‡½æ•°çš„å®šä¹‰å‡½æ•°ã€‚
%    \begin{macrocode}
\cs_new:Npn \@@_new_frame_construct:nn #1
  {
    \clist_put_right:Nn \g_@@_frame_list_clist {#1}
    \cs_new:cn { \@@_frame_type:n {#1} }
  }
\@@_new_frame_construct:nn { none } { }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/07}{æ·»åŠ&nbsp;æ‹¼éŸ³å››çº¿æ&nbsp;¼ç»˜åˆ¶å‡½æ•°}
%
%    \begin{macrocode}
\@@_new_frame_construct:nn { pinyinlines }
  {
    \bool_if:NTF \l_@@_withpinyinlines_bool
      {
        \draw_scope_begin:
          \draw_path_moveto:n { #1, 0 }
          \draw_path_lineto:n { #3, 0 }
          \draw_path_moveto:n { #1, \l_@@_pinyin_height_i_dim }
          \draw_path_lineto:n { #3, \l_@@_pinyin_height_i_dim }
          \draw_path_moveto:n { #1, \l_@@_pinyin_height_ii_dim }
          \draw_path_lineto:n { #3, \l_@@_pinyin_height_ii_dim }
          \draw_path_moveto:n { #1, \l_@@_pinyin_height_iii_dim }
          \draw_path_lineto:n { #3, \l_@@_pinyin_height_iii_dim }
          \draw_path_use_clear:n { stroke }
        \draw_scope_end:
      }
      {
        \draw_scope_begin:
          \hcoffin_set:Nn \l_tmpa_coffin
            {
              \tl_use:N \l_@@_pinyin_format_tl
              \phantom{a}
            }

          \coffin_resize:Nnn \l_tmpa_coffin
            { #3 } { \l_@@_pinyin_height_iii_dim }

          \draw_coffin_use:Nnn \l_tmpa_coffin { l } { b }
        \draw_scope_end:
      }
  }
%    \end{macrocode}
%
% \changes{v2.1.2}{2021/10/07}{åˆ†ç¦»æ±‰å­—å¤–æ¡†ä¸Žå¡«å……ç»˜åˆ¶å‡½æ•°}
%
%    \begin{macrocode}
\@@_new_frame_construct:nn { filledbox }
  {
    \cs_if_eq:NNF \@@_aux_color_fill: \c_empty_tl
      {
        \color_stroke:n { hanziboxframecolor }
        \draw_path_rectangle_corners:nn { #1, #2} { #3, #4}

        \draw_path_use_clear:n { stroke, fill }
      }
  }
%    \end{macrocode}
%
%    \begin{macrocode}
\@@_new_frame_construct:nn { framebox }
  {
    \draw_scope_begin:
      \color_stroke:n { hanziboxframecolor }
      \draw_path_rectangle_corners:nn { #1, #2} { #3, #4}
      \draw_path_use_clear:n { stroke }
    \draw_scope_end:
  }
%    \end{macrocode}
%
% \changes{v2.1.1}{2021/10/07}{å†…æ&nbsp;¼å­çº¿é¢œè‰²ç‹¬ç«‹è®¾ç½®}
%
%    \begin{macrocode}
\@@_new_frame_construct:nn { å }
  {
    \draw_scope_begin:
      \tl_if_empty:NF \l_@@_dash_pattern_tl
        {
          \exp_args:No \draw_dash_pattern:nn { \l_@@_dash_pattern_tl } { 0pt }
        }
      \draw_linewidth:n{ \l_@@_cross_linewidth_dim }
      \color_stroke:n { hanziboxcrosscolor }
      \draw_path_moveto:n { (#3)/2, #2 }
      \draw_path_lineto:n { #3/2, #4 }
      \draw_path_moveto:n { #1, (#4)/2 }
      \draw_path_lineto:n { #3, (#4)/2 }
      \draw_path_use_clear:n { stroke }
    \draw_scope_end:
  }

\@@_new_frame_construct:nn { Ã— }
  {
    \draw_scope_begin:
      \tl_if_empty:NF \l_@@_dash_pattern_tl
        {
          \exp_args:No \draw_dash_pattern:nn { \l_@@_dash_pattern_tl } { 0pt }
        }
      \draw_linewidth:n{ \l_@@_cross_linewidth_dim }
      \color_stroke:n { hanziboxcrosscolor }
      \draw_path_moveto:n { #1, #2 }
      \draw_path_lineto:n { #3, #4 }
      \draw_path_moveto:n { #1, #4 }
      \draw_path_lineto:n { #3, #2 }
      \draw_path_use_clear:n { stroke }
    \draw_scope_end:
  }

\@@_new_frame_construct:nn { ç±³ }
  {
    \@@_frame_type_c:n { Ã— } {#1} {#2} {#3} {#4} {#5} {#6}
    \@@_frame_type_c:n { å } {#1} {#2} {#3} {#4} {#5} {#6}
  }

\@@_new_frame_construct:nn { å£ }
  {
    \@@_frame_type_c:n { filledbox } {#1} {#2} {#3} {#4} {#5} {#6}
    \@@_frame_type_c:n { framebox } {#1} {#2} {#3} {#4} {#5} {#6}
  }

\@@_new_frame_construct:nn { ç”° }
  {
    \@@_frame_type_c:n { filledbox } {#1} {#2} {#3} {#4} {#5} {#6}
    \@@_frame_type_c:n { å } {#1} {#2} {#3} {#4} {#5} {#6}
    \@@_frame_type_c:n { framebox } {#1} {#2} {#3} {#4} {#5} {#6}
  }

\@@_new_frame_construct:nn { å’ª }
  {
    \@@_frame_type_c:n { filledbox } {#1} {#2} {#3} {#4} {#5} {#6}
    \@@_frame_type_c:n { Ã— } {#1} {#2} {#3} {#4} {#5} {#6}
    \@@_frame_type_c:n { å } {#1} {#2} {#3} {#4} {#5} {#6}
    \@@_frame_type_c:n { framebox } {#1} {#2} {#3} {#4} {#5} {#6}
  }
%    \end{macrocode}
%
% \subsubsection{å®šä¹‰è¾¹æ¡†ç±»åž‹é”™è¯¯æç¤ºä¿¡æ¯}
%
%    \begin{macrocode}
\msg_new:nnn { hanzibox } { frame-exists } { The~ frame~ type~ `#1~ not~ exists. }
%    \end{macrocode}
%
% \subsubsection{å®šä¹‰ç¼©æ”¾æ–¹å¼}
%
% \begin{macro}{\@@_resize:n,\@@_resize_c:n}
% ç”Ÿæˆç¼©æ”¾æ–¹å¼å‡½æ•°åç§°
%    \begin{macrocode}
\cs_new_nopar:Npn \@@_resize:n #1
  {
    @@_processor_resize_ #1 :w
  }
\cs_new_nopar:Npn \@@_resize_c:n #1
  {
    \use:c
      {
        @@_processor_resize_ #1 :w
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_dim_gezero_dispatch:NNnnn,\@@_dim_gezero_dispatch:NNnnn,
%               \@@_force_size_dispatch:nnn,\@@_force_size_dispatch:nnnn}
% å®šä¹‰ç¼©æ”¾æ–¹å¼å‡½æ•°éœ€è¦çš„è¾…åŠ©å‡½æ•°ã€‚
%    \begin{macrocode}
\cs_new:Npn \@@_dim_gezero_dispatch:NNnnn #1#2 #3#4#5
  {
    \dim_compare:nNnTF #1 &gt; \c_zero_dim
      { #3 }
      {
        \dim_compare:nNnTF #2 &gt; \c_zero_dim
          { #4 } { #5 }
      }
  }
\cs_new:Npn \@@_dim_gezero_dispatch:NNnnnn #1#2 #3#4#5#6
  {
    \dim_compare:nNnTF #1 &gt; \c_zero_dim
      {
        \dim_compare:nNnTF #2 &gt; \c_zero_dim
          { #3 } { #4 }
      }
      {
        \dim_compare:nNnTF #2 &gt; \c_zero_dim
          { #5 } { #6 }
      }
  }
\cs_new:Npn \@@_force_size_dispatch:nnn % height, width, none
  {
    \@@_dim_gezero_dispatch:NNnnn \l_@@_height_dim \l_@@_width_dim
  }
\cs_new:Npn \@@_force_size_dispatch:nnnn % both, height, width, none
  {
    \@@_dim_gezero_dispatch:NNnnnn \l_@@_box_height_dim \l_@@_box_width_dim
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_new_resize_method:nn}
% æž„å»ºç¼©æ”¾æ–¹å¼åˆ—è¡¨åŠå‡½æ•°ã€‚
%    \begin{macrocode}
\cs_new:Npn \@@_new_resize_method:nn #1
  {
    \clist_put_right:Nn \g_@@_resize_method_clist {#1}
    \cs_new:cpn { \@@_resize:n {#1} }
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0.0}{2021/09/28}{åˆ&nbsp;é™¤squareç¼©æ”¾æ&nbsp;·å¼}
%
% å®šä¹‰ç¼©æ”¾æ–¹å¼å‡½æ•°ã€‚
%    \begin{macrocode}
\@@_new_resize_method:nn { none } { }

\@@_new_resize_method:nn { real }
  {
    \@@_force_size_dispatch:nnnn
      {
        \coffin_resize:Nnn \l_@@_box_coffin
                           \l_@@_box_width_dim
                           \l_@@_box_height_dim
      }
      {
        \coffin_scale:Nnn \l_@@_box_coffin
          {
            \dim_ratio:nn { \l_@@_box_height_dim }
                          { \@@_coffin_ht_plus_dp:N \l_@@_box_coffin }
          }
          {
            \dim_ratio:nn { \l_@@_box_height_dim }
                          { \@@_coffin_ht_plus_dp:N \l_@@_box_coffin }
          }
      }
      {
        \coffin_scale:Nnn \l_@@_box_coffin
          {
            \dim_ratio:nn { \l_@@_box_width_dim }
                          { \coffin_wd:N \l_@@_box_coffin }
          }
          {
            \dim_ratio:nn { \l_@@_box_width_dim }
                          { \coffin_wd:N \l_@@_box_coffin }
          }
      }
      {
        \coffin_scale:Nnn \l_@@_box_coffin
                          { \l_@@_x_scale_tl }
                          { \l_@@_y_scale_tl }
      }
  }

\@@_new_resize_method:nn { base }
  {
    \@@_force_size_dispatch:nnnn
      {
        \coffin_resize:Nnn \l_@@_box_coffin
                           \l_@@_box_width_dim
                           \l_@@_box_height_dim
      }
      {
        \coffin_resize:Nnn \l_@@_box_coffin
           {
             \l_@@_char_width_dim * \dim_ratio:nn { \l_@@_box_height_dim }
               { \@@_coffin_ht_plus_dp:N \l_@@_box_coffin }
           }
           {
             \l_@@_box_height_dim
           }
      }
      {
        \coffin_resize:Nnn \l_@@_box_coffin
           {
             \l_@@_box_width_dim
           }
           {
             \l_@@_char_height_dim * \dim_ratio:nn { \l_@@_box_width_dim }
               { \coffin_wd:N \l_@@_box_coffin }
           }
      }
      {
        \coffin_resize:Nnn \l_@@_box_coffin
           {
             \l_@@_x_scale_tl \l_@@_char_width_dim
           }
           {
             \l_@@_y_scale_tl \l_@@_char_height_dim
           }
      }
  }

\msg_new:nnn { hanzibox } { frame-type } { using~ `#1'~ frame. }
%    \end{macrocode}
%
% \subsubsection{è®¾ç½®å­—å·}
%
% \begin{macro}{\@@_zihao:n}
% è®¾ç½®å­—å·
%    \begin{macrocode}
\cs_new_nopar:Npn \@@_zihao:n #1 { \zihao {#1} }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/08}{æ·»åŠ&nbsp;å­—ç¬¦è½®å»“å¤„ç†å‡½æ•°}
%
% \subsubsection{å­—ç¬¦è½®å»“å¤„ç†å‡½æ•°}
% æºç&nbsp;æ”¹è‡ª\LaTeX çš„\pkg{zitie}å®åŒ…(\url{https://www.ctan.org/pkg/zitie})ã€‚
%
% \begin{macro}{\@@_chars_stroke:nn}
% è®¾ç½®å­—ç¬¦è½®å»“å‡½æ•°
%    \begin{macrocode}
\cs_new:Npn \@@_chars_stroke:nn #1#2
  {
    \special { pdf:code ~ q ~ #1 } #2 \special { pdf:code ~ Q }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_chars_stroke:nn}
% å­—ç¬¦è½®å»“é€‰æ‹©å‡½æ•°
%    \begin{macrocode}
\cs_new_protected:Npn \@@_chars_stroke_construct:n #1
  {
    \int_case:nn {\l_@@_charstroke_type_int}
      {
        {1}{ #1 }
        {2}{
          \@@_chars_stroke:nn { 1 ~ Tr ~ 0.10 ~ w ~ [] ~ 0 ~ d ~ 1 ~ J } {#1}
        }
        {3}{
          \@@_chars_stroke:nn { 1 ~ Tr ~ 0.10 ~ w ~ [1~1] ~ 0 ~ d ~ 1 ~ J } {#1}
        }
        {4}{
          \@@_chars_stroke:nn { 3 ~ Tr } {#1}
        }

      }
  }
\cs_generate_variant:Nn  \@@_chars_stroke_construct:n { V }
\cs_generate_variant:Nn  \@@_chars_stroke_construct:n { x }
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{å‘½åé¢œè‰²}
%
% \begin{macro}{\@@_color_select:nn,\@@_color_select:nnn}
% é¢œè‰²å‘½åå‡½æ•°(ä½¿ç”¨l3è¯­æ³•)
%    \begin{macrocode}
\cs_set_nopar:Npn \@@_color_select:nn #1#2
  {
    \color_set:nn {#1} {#2}
  }
\cs_generate_variant:Nn \@@_color_select:nn {nx}
\cs_set_nopar:Npn \@@_color_select:nnn #1#2#3
  {
    \color_set:nnn {#1} {#2} {#3}
  }
\cs_generate_variant:Nn \@@_color_select:nnn {nnx}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{è®¾ç½®DebugçŠ¶æ€}
%
% \begin{macro}{\@@_debug:n}
% è®¾ç½®debugçŠ¶æ€
%    \begin{macrocode}
\cs_new:Npn \@@_debug:n
  {
    \bool_if:NTF \l_@@_debug_bool
      { \use:n } { \use_none:n }
  }
%    \end{macrocode}
% \end{macro}
%
% \subsection{é€‰é¡¹å¤„ç†}
%
% \changes{v2.0.0}{2021/09/25}{å‚è€ƒzitieå®åŒ…ï¼Œé‡æ–°è®¾è®¡é€‰é¡¹ï¼Œ
%                              ä»…ä¿ç•™1.1.0ç‰ˆæœ¬ä¸­çš„æ‹¼éŸ³ã€æ±‰å­—ã€è¯‘æ–‡æ˜¾ç¤ºæŽ§åˆ¶é€‰é¡¹ã€‚}
%
% å®šä¹‰ |hanzibox| é”®å€¼ç±»ã€‚
%    \begin{macrocode}
\keys_define:nn { hanzibox }
  {
%    \end{macrocode}
%
% \begin{macro}{basechar}
% è®¾ç½®åŸºå­—ç¬¦ã€‚
%    \begin{macrocode}
    basechar  .code:n = { \tl_gset:Nx \c_@@_basechar_tl {#1}
                          \@@_calc_basechar_w_h:
                        },
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{zihao}
% è®¾ç½®å­—å·ã€‚
%    \begin{macrocode}
    zihao     .code:n = { \hbox_gset:Nn \l_@@_basebox_box
                            {
                              \@@_zihao:n {#1} \c_@@_basechar_tl
                            }
                          \@@_calc_basechar_w_h:
                        },
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/07}{ä¸ºpinyinfé€‰é¡¹å¢žåŠ&nbsp;è®¡ç®—æ‹¼éŸ³é«˜åº¦åŠŸèƒ½}
%
% \begin{macro}{pinyinf}
% æ‹¼éŸ³æ&nbsp;¼å¼
%    \begin{macrocode}
    pinyinf .code:n = { \tl_set:Nn \l_@@_pinyin_format_tl { #1 }
                        \@@_calc_pinyin_h:
                      },
    pinyinf .initial:n = \tiny ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{charf}
% æ±‰å­—æ&nbsp;¼å¼
%    \begin{macrocode}
    charf .code:n = { \tl_gset:Nn \l_@@_character_format_tl {#1}
                      \@@_calc_frame_size:
                    },
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{tranf}
% è¯‘æ–‡æ&nbsp;¼å¼
%    \begin{macrocode}
    tranf .tl_set:N = \l_@@_translation_format_tl ,
    tranf .initial:n = \tiny ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{frametype}
% è¾¹æ¡†ç±»åž‹
%    \begin{macrocode}
    frametype .code:n = { \exp_args:NNx \clist_if_in:NnTF \g_@@_frame_list_clist {#1}
                            { \tl_set:Nx \l_@@_frame_type_tl {#1} }
                            { \msg_error:nnx { hanzibox } { frame-exists } {#1} }
                        },
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{resize}
% ç¼©æ”¾æ–¹å¼
%    \begin{macrocode}
    resize    .code:n = { \exp_args:NNx \clist_if_in:NnTF \g_@@_resize_method_clist {#1}
                            { \tl_set:Nx \l_@@_resize_method_tl {#1} }
                            { \msg_error:nnx { hanzibox } { resize-method } {#1} }
                        },
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{xscale}
% xæ–¹å‘ç¼©æ”¾æ¯”ä¾‹
%    \begin{macrocode}
    xscale .tl_set:N = \l_@@_x_scale_tl ,
    xscale .initial:n = 1 ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{yscale}
% yæ–¹å‘ç¼©æ”¾æ¯”ä¾‹
%    \begin{macrocode}
    yscale .tl_set:N = \l_@@_y_scale_tl ,
    yscale .initial:n = 1 ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{scale}
% x,yæ–¹å‘ç¼©æ”¾æ¯”ä¾‹
%    \begin{macrocode}
    scale  .meta:n = { xscale = #1 , yscale = #1 } ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{width}
% ç›’å­å®½åº¦
%    \begin{macrocode}
    width  .dim_set:N = \l_@@_box_width_dim ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{height}
% ç›’å­é«˜åº¦
%    \begin{macrocode}
    height .dim_set:N = \l_@@_box_height_dim ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{linewidth}
% å¤–æ¡†çº¿æ¡å®½åº¦
%    \begin{macrocode}
    linewidth .dim_set:N = \l_@@_frame_linewidth_dim ,
    linewidth .initial:n = 0.4pt ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/10}{æ·»åŠ&nbsp;è¾¹æ¡†çº¿çº¿å®½\opt{framelinewidth}é€‰é¡¹}
%
% \begin{macro}{framelinewidth}
% å¤–æ¡†çº¿æ¡å®½åº¦
%    \begin{macrocode}
    framelinewidth .dim_set:N = \l_@@_frame_linewidth_dim ,
    framelinewidth .initial:n = 0.4pt ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/10}{æ·»åŠ&nbsp;æ‹¼éŸ³å››çº¿æ&nbsp;¼çº¿å®½pinyinlinewidthé€‰é¡¹}
%
% \begin{macro}{pinyinlinewidth}
% æ‹¼éŸ³å››çº¿æ&nbsp;¼çº¿æ¡å®½åº¦
%    \begin{macrocode}
    pinyinlinewidth .dim_set:N = \l_@@_pinyin_linewidth_dim ,
    pinyinlinewidth .initial:n = 0.4pt ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/10}{æ·»åŠ&nbsp;å†…æ&nbsp;¼åå­—å’Œç±³å­—çº¿çº¿å®½crosslinewidthé€‰é¡¹}
%
% \begin{macro}{crosslinewidth}
% å†…æ&nbsp;¼åå­—å’Œç±³å­—çº¿çº¿æ¡å®½åº¦
%    \begin{macrocode}
    crosslinewidth .dim_set:N = \l_@@_cross_linewidth_dim ,
    crosslinewidth .initial:n = 0.3pt ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.1.1}{2021/10/07}{æ·»åŠ&nbsp;é¢œè‰²æ¯”ä¾‹é€‰é¡¹corsscolorratio}
%
% \begin{macro}{crosscolorratio}
% ç›’å­å†…éƒ¨çº¿æ¡é¢œè‰²å&nbsp;è¾¹æ¡†é¢œè‰²çš„ç™¾åˆ†æ¯”
%    \begin{macrocode}
    crosscolorratio  .int_set:N = \l_@@_cross_color_ratio_int,
    crosscolorratio  .initial:n = 20,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{framecolor}
% è¾¹æ¡†é¢œè‰²
%    \begin{macrocode}
    framecolor  .code:n = { \tl_set:Nx \l_tmpa_tl { #1 ! \int_use:N \l_@@_cross_color_ratio_int }
                            \@@_color_select:nn { hanziboxframecolor } {#1}
                            \@@_color_select:nx{ hanziboxcrosscolor } { \l_tmpa_tl } } ,
    framecolor  .initial:n = black ,
    framecolor* .code:n = { \tl_set:Nx \l_tmpa_tl { #1 ! \int_use:N \l_@@_cross_color_ratio_int }
                            \@@_color_select:nnn { hanziboxframecolor } #1
                            \@@_color_select:nnx { hanziboxcrosscolor } \l_tmpa_tl } ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{charcolor}
% å­—ç¬¦é¢œè‰²
%    \begin{macrocode}
    charcolor  .code:n = { \@@_color_select:nn { hanziboxcharcolor } {#1} } ,
    charcolor  .initial:n = black ,
    charcolor* .code:n = { \@@_color_select:nnn { hanziboxcharcolor } #1 } ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/07}{æ·»åŠ&nbsp;æ‹¼éŸ³é¢œè‰²\opt{pinyincolor}é€‰é¡¹}
%
% \begin{macro}{pinyincolor}
% æ‹¼éŸ³é¢œè‰²
%    \begin{macrocode}
    pinyincolor  .code:n = { \@@_color_select:nn { hanziboxpinyincolor } {#1} } ,
    pinyincolor  .initial:n = black ,
    pinyincolor* .code:n = { \@@_color_select:nnn { hanziboxpinyincolor } #1 } ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/07}{æ·»åŠ&nbsp;è¯‘æ–‡é¢œè‰²\opt{trancolor}é€‰é¡¹}
%
% \begin{macro}{trancolor}
% è¯‘æ–‡é¢œè‰²
%    \begin{macrocode}
    trancolor  .code:n = { \@@_color_select:nn { hanziboxtrancolor } {#1} } ,
    trancolor  .initial:n = black ,
    trancolor* .code:n = { \@@_color_select:nnn { hanziboxtrancolor } #1 } ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{color}
% åŒæ—¶è®¾ç½®è¾¹æ¡†ã€å­—ç¬¦ã€æ‹¼éŸ³å’Œè¯‘æ–‡é¢œè‰²
%    \begin{macrocode}
    color  .meta:n = { framecolor = #1, crosscolor = #1,  charcolor = #1,
                       pinyincolor = #1, trancolor = #1 } ,
    color* .meta:n = { framecolor* = #1, crosscolor = #1,  charcolor* = #1,
                       pinyincolor* = #1, trancolor* = #1 } ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{fillcolor}
% å¡«å……è‰²
%    \begin{macrocode}
    fillcolor  .code:n = { \exp_args:Nx \tl_if_empty:nTF {#1}
                            {  \@@_color_select:nn { hanziboxfillcolor } { white }
                               \cs_set_nopar:Npn \@@_aux_color_fill: { }
                            }{ \@@_color_select:nn { hanziboxfillcolor } {#1}
                               \cs_set_nopar:Npn \@@_aux_color_fill: { \color_fill:n {#1} }
                            }
                        } ,
    fillcolor* .code:n = { \@@_color_select:nnn { hanziboxfillcolor } #1
                           \cs_set_nopar:Npn \@@_aux_color_fill: { \color_fill:nn #1 }
                         } ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/08}{æ·»åŠ&nbsp;å­—ç¬¦è½®å»“ç±»åž‹charstrokeé€‰é¡¹}
%
% \begin{macro}{charstroke}
% è®¾ç½®æ±‰å­—è½®å»“ç±»åž‹
%    \begin{macrocode}
    charstroke .choice:,
    charstroke .value_required:n = true,
    charstroke .choices:nn =
      { none, solid, dashed, invisible }
      { \int_set_eq:NN \l_@@_charstroke_type_int \l_keys_choice_int },
    charstroke .initial:n = none,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{dashpattern}
% è™šçº¿æ&nbsp;·å¼
%    \begin{macrocode}
    dashpattern .tl_set:N = \l_@@_dash_pattern_tl ,
    dashpattern .initial:n = { } ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{framearc}
% çŸ©å½¢å¤–æ¡†è½¬è§’åŠå¾„
%    \begin{macrocode}
    framearc  .code:n = { \tl_set:Nn \l_@@_frame_arc_tl { {#1}{#1} } } ,
    framearc* .tl_set:N = \l_@@_frame_arc_tl ,
    framearc* .initial:n = { { 0cm }{ 0cm } } ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{debug}
% DebugçŠ¶æ€
%    \begin{macrocode}
    debug .bool_set:N = \l_@@_debug_bool ,
    debug .initial:n = false ,
    debug .default:n = true ,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{autopinyin}
% æ˜¯å¦é€šè¿‡æ±‰å­—è‡ªåŠ¨èŽ·å–æ‹¼éŸ³ï¼Œé»˜è®¤ä¸ºtrueã€‚
%    \begin{macrocode}
    autopinyin .bool_set:N = \l_@@_autopinyin_bool,
    autopinyin .default:n = true,
    autopinyin .initial:n = true,

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{initial}
% æ˜¯å¦è¾“å‡ºå£°æ¯ï¼Œé»˜è®¤ä¸ºtrueã€‚
%    \begin{macrocode}
    initial .bool_set:N = \l_@@_withinitial_bool,
    initial .default:n = true,
    initial .initial:n = true,

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{vowel}
% æ˜¯å¦è¾“å‡ºéŸµæ¯ï¼Œé»˜è®¤ä¸ºtrueã€‚
%    \begin{macrocode}
    vowel .bool_set:N = \l_@@_withvowel_bool,
    vowel .default:n = true,
    vowel .initial:n = true,

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{tone}
% æ˜¯å¦è¾“å‡ºå£°è°ƒï¼Œé»˜è®¤ä¸ºtrueã€‚
%    \begin{macrocode}
    tone .bool_set:N = \l_@@_withtone_bool,
    tone .default:n = true,
    tone .initial:n = true,

%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/07}{æ·»åŠ&nbsp;æ˜¯å¦æ˜¾ç¤ºæ‹¼éŸ³çº¿\opt{pinyinline}é€‰é¡¹}
%
% \begin{macro}{pinyinline}
% æ˜¯å¦ç»˜åˆ¶æ‹¼éŸ³å››çº¿æ&nbsp;¼ï¼Œé»˜è®¤ä¸ºtrueã€‚
%    \begin{macrocode}
    pinyinline .bool_set:N = \l_@@_withpinyinlines_bool,
    pinyinline .default:n = true,
    pinyinline .initial:n = false,

%    \end{macrocode}
% \end{macro}
%
% \changes{v1.1.0}{2021/09/21}{æ·»åŠ&nbsp;éšè—æ‹¼éŸ³ã€æ±‰å­—å’Œè¯‘æ–‡é€‰é¡¹}
%
% \begin{macro}{pinyin}
% æ˜¯å¦æ˜¾ç¤ºæ‹¼éŸ³ï¼Œé»˜è®¤ä¸ºtrueã€‚
%    \begin{macrocode}
    pinyin .bool_set:N = \l_@@_withpinyin_bool,
    pinyin .default:n = true,
    pinyin .initial:n = true,

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{hanzi}
% æ˜¯å¦æ˜¾ç¤ºæ±‰å­—ï¼Œé»˜è®¤ä¸ºtrueã€‚
%    \begin{macrocode}
    hanzi .bool_set:N = \l_@@_withhanzi_bool,
    hanzi .default:n = true,
    hanzi .initial:n = true,

%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{tran}
% æ˜¯å¦æ˜¾ç¤ºè¯‘æ–‡ï¼Œé»˜è®¤ä¸ºtrueã€‚
%    \begin{macrocode}
    tran .bool_set:N = \l_@@_withtran_bool,
    tran .default:n = true,
    tran .initial:n = true,

%    \end{macrocode}
% \end{macro}
%
% \changes{v2.3.0}{2022/04/17}{æ·»åŠ&nbsp;ä½œæ–‡æ&nbsp;¼å­åž‚ç›´é—´è·gridsepvé€‰é¡¹}
%
% \begin{macro}{gridsepv}
% ä½œæ–‡æ&nbsp;¼å­åž‚ç›´é—´è·
%    \begin{macrocode}
    gridsepv .tl_set:N  = \l_@@_grid_sep_v_tl ,
    gridsepv .initial:n = 4.0 ,
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.3.0}{2022/04/17}{æ·»åŠ&nbsp;ä½œæ–‡æ&nbsp;¼å­åˆ—æ•°gridcolsé€‰é¡¹}
%
% \begin{macro}{gridsepv}
% ä½œæ–‡æ&nbsp;¼å­æ¯è¡Œåˆ—æ•°
%    \begin{macrocode}
    gridcols .int_set:N  = \l_@@_grid_cols_int ,
    gridcols .initial:n = 20 ,
%    \end{macrocode}
% \end{macro}
%
% å¤„ç†æœªçŸ¥é€‰é¡¹ã€‚
%    \begin{macrocode}
    unknown .code:n = { \@@_error:n { unknown-option } }
  }
\msg_new:nnn { hanzibox } { unknown-option }
  { package~ option~ "\l_keys_key_tl"~ is~ unknown. }

%    \end{macrocode}
%
% å‚æ•°é»˜è®¤å€¼
%    \begin{macrocode}
\keys_set:nn { hanzibox }
  {
    basechar = å¥½ ,
    zihao = 4 ,
    pinyinf = \tiny ,
    charf = \normalsize ,
    tranf = \tiny ,
    frametype = none ,
    resize = none ,
  }

%    \end{macrocode}
%
% \subsection{é€‰é¡¹ç”¨æˆ·æŽ¥å£}
%
% \begin{macro}{\hanziboxset}
% é€‰é¡¹è®¾ç½®ç”¨æˆ·æŽ¥å£ã€‚
%    \begin{macrocode}
\NewDocumentCommand \hanziboxset { m }
  { \keys_set:nn { hanzibox } {#1} }
%    \end{macrocode}
% \end{macro}
%
% \subsection{å†…éƒ¨å‡½æ•°}
%
% \begin{macro}{\@@_dialog:nnnn}
% æ‰‹åŠ¨æ±‰å­—ç›’å­æŽ’ç‰ˆå‘½ä»¤ã€‚
%    \begin{macrocode}
\cs_new:Npn \@@_dialog:nnnn #1#2#3#4
  {
    \group_begin:
      \keys_set:nn { hanzibox } { #1 }

      \tl_set:Nx \l_@@_character_tl {#2}
      \tl_set:Nx \l_@@_pinyin_tl {#3}
      \tl_set:Nx \l_@@_translation_tl {#4}

      \hcoffin_set:Nn \l_@@_str_box_coffin
        {
          \tl_map_inline:Nn \l_@@_character_tl
            {
              \@@_single_handle:N ##1
            }
        }
      \hcoffin_set:Nn \l_tmpa_coffin
        {
          \hcoffin_set:Nn \l_@@_pinyin_box_coffin
            {
              \color_select:n { hanziboxpinyincolor }
              \tl_use:N \l_@@_pinyin_format_tl
              \tl_use:N \l_@@_pinyin_tl
            }
          \dim_set:Nn \l_tmpa_dim { \coffin_wd:N \l_@@_pinyin_box_coffin }
          \draw_begin:
            \draw_linewidth:n { \l_@@_frame_linewidth_dim }
            \color_stroke:n { hanziboxframecolor!50 }

            \draw_path_scope_begin:
              \@@_frame_type_c:n { pinyinlines }
                { 0 } { 0 } { \l_tmpa_dim } { \hanziboxheight } { 1.0 } { 1.0 }
              \draw_transform_shift:n {\l_tmpa_dim / 2.0, \l_@@_pinyin_height_i_dim }
              \draw_coffin_use:Nnn \l_@@_pinyin_box_coffin { hc } { H }
            \draw_path_scope_end:
          \draw_end:
        }
      \hcoffin_set:Nn \l_@@_tran_box_coffin
        {
          \tl_use:N \l_@@_translation_format_tl
          \tl_use:N \l_@@_translation_tl
        }
      \coffin_join:NnnNnnnn \l_tmpa_coffin { hc } { b }
        \l_@@_str_box_coffin { hc } { t } { 0pt } { \l_@@_frame_linewidth_dim }
      \coffin_join:NnnNnnnn \l_tmpa_coffin
        { hc } { b } \l_@@_tran_box_coffin { hc } { t } { 0pt } { -2pt }

      \coffin_set_eq:NN \l_@@_box_coffin \l_tmpa_coffin

      \@@_resize_c:n { \l_@@_resize_method_tl }

      \coffin_typeset:Nnnnn \l_@@_box_coffin
        { l } { b } { 0pt } { 0pt }
      \allowbreak
    \group_end:
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0.1}{2021/09/28}{åˆ†ç¦»å¤šå­—ã€å•å­—ã€0ä¸ªå­—çš„ç›’å­æž„é€&nbsp;ä»£ç&nbsp;}
% \changes{v2.1.0}{2021/09/30}{æ›´æ–°æ‹¼éŸ³èŽ·å–æ–¹å¼}
% \changes{v2.2.0}{2021/10/09}{åˆ†ç¦»æ±‰å­—æ‹¼éŸ³coffinæž„é€&nbsp;å‡½æ•°}
%
% \begin{macro}{\@@_single_pinyin_hanzi_construct:NN}
% æž„é€&nbsp;å•ä¸ªæ‹¼éŸ³+æ±‰å­—coffinã€‚
%    \begin{macrocode}
\cs_new:Npn \@@_single_pinyin_hanzi_construct:NN #1#2
  {
    \tl_if_empty:NTF #1
      {
        \hcoffin_set:Nn \l_tmpa_coffin
          {
            \@@_single_handle:N \c_@@_basechar_tl
          }
      }
      {
        \hcoffin_set:Nn \l_tmpa_coffin
          {
            \@@_single_handle:N #1
          }
      }

    \tl_if_empty:NTF #2
      {
        \hcoffin_set:Nn \l_@@_pinyin_hanzi_coffin
          {
            \@@_single_pinyin_lines:
          }

        \coffin_join:NnnNnnnn \l_@@_pinyin_hanzi_coffin
          { hc } { b } \l_tmpa_coffin { hc } { t } { 0pt } { \l_@@_pinyin_linewidth_dim }
      }
      {
        \bool_if:NTF \l_@@_withpinyin_bool
          {
            \hcoffin_set:Nn \l_@@_pinyin_hanzi_coffin
              {
                \@@_single_pinyin:V #2
              }

            \coffin_join:NnnNnnnn \l_@@_pinyin_hanzi_coffin
              { hc } { b } \l_tmpa_coffin { hc } { t } { 0pt } { \l_@@_pinyin_linewidth_dim }
          }
          {
            \coffin_set_eq:NN \l_@@_pinyin_hanzi_coffin \l_tmpa_coffin
          }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_multi_str_coffin_construct:}
% æž„é€&nbsp;å¤šæ±‰å­—å¸¦æ‹¼éŸ³å­—ç¬¦ä¸²ç›’å­ã€‚
%    \begin{macrocode}
\cs_new:Npn \@@_multi_str_coffin_construct:
  {
    \hcoffin_set:Nn \l_@@_str_box_coffin
      {
      }
    \bool_if:NTF \l_@@_autopinyin_bool
      {
        \tl_map_inline:Nn \l_@@_character_tl
          {
            \@@_get_hanzi_pinyin:n { ##1 }

            \@@_single_pinyin_hanzi_construct:NN ##1 \l_@@_hanzi_pinyin_tl

            \coffin_join:NnnNnnnn \l_@@_str_box_coffin { r } { b }
              \l_@@_pinyin_hanzi_coffin { l } { b }
                { -\l_@@_frame_linewidth_dim } { 0pt }
          }
      }
      {
        \@@_get_tone_pinyin:V \l_@@_pinyin_tl
        \clist_clear:N \l_@@_tone_pinyin_clist
        \clist_set:NV \l_@@_tone_pinyin_clist \l_@@_tone_pinyin_tl
        \int_set:Nn \l_tmpa_int {\clist_count:N \l_@@_tone_pinyin_clist}
       \int_compare:nNnTF { \l_@@_character_int } = { \l_tmpa_int }
         {
           \tl_map_inline:Nn \l_@@_character_tl
             {
               \clist_pop:NN \l_@@_tone_pinyin_clist \l_tmpb_tl
               \@@_single_pinyin_hanzi_construct:NN ##1 \l_tmpb_tl

               \coffin_join:NnnNnnnn \l_@@_str_box_coffin { r } { b }
                 \l_@@_pinyin_hanzi_coffin { l } { b }
                   { -\l_@@_frame_linewidth_dim } { 0pt }
             }
         }
         {
           \int_compare:nNnTF { \l_@@_character_int } &gt; { \l_tmpa_int }
             {
               \int_step_inline:nn { \l_tmpa_int }
                 {
                   \tl_set:Nx \l_tmpa_tl {\tl_item:Nn \l_@@_character_tl { ##1 }}
                   \clist_pop:NN \l_@@_tone_pinyin_clist \l_tmpb_tl

                   \@@_single_pinyin_hanzi_construct:NN \l_tmpa_tl \l_tmpb_tl
                   \coffin_join:NnnNnnnn \l_@@_str_box_coffin { r } { b }
                     \l_@@_pinyin_hanzi_coffin { l } { b }
                       { -\l_@@_frame_linewidth_dim } { 0pt }
                 }
               \int_step_inline:nnn { \l_tmpa_int + 1 } { \l_@@_character_int }
                 {
                   \tl_set:Nx \l_tmpa_tl {\tl_item:Nn \l_@@_character_tl { ##1 }}
                   \tl_clear:N \l_tmpb_tl

                   \@@_single_pinyin_hanzi_construct:NN \l_tmpa_tl \l_tmpb_tl
                   \coffin_join:NnnNnnnn \l_@@_str_box_coffin { r } { b }
                     \l_@@_pinyin_hanzi_coffin { l } { b }
                       { -\l_@@_frame_linewidth_dim } { 0pt }
                 }
             }
             {
               \int_step_inline:nn { \l_@@_character_int }
                 {
                   \tl_set:Nx \l_tmpa_tl {\tl_item:Nn \l_@@_character_tl { ##1 }}
                   \clist_pop:NN \l_@@_tone_pinyin_clist \l_tmpb_tl

                   \@@_single_pinyin_hanzi_construct:NN \l_tmpa_tl \l_tmpb_tl
                   \coffin_join:NnnNnnnn \l_@@_str_box_coffin { r } { b }
                     \l_@@_pinyin_hanzi_coffin { l } { b }
                       { -\l_@@_frame_linewidth_dim } { 0pt }
                 }

               \bool_set_eq:NN \l_tmpa_bool \l_@@_withhanzi_bool
               \bool_set_false:N \l_@@_withhanzi_bool
               \int_step_inline:nnn { \l_@@_character_int + 1 } { \l_tmpa_int }
                 {
                   \tl_clear:N \l_tmpa_tl
                   \clist_pop:NN \l_@@_tone_pinyin_clist \l_tmpb_tl

                   \@@_single_pinyin_hanzi_construct:NN \l_tmpa_tl \l_tmpb_tl
                   \coffin_join:NnnNnnnn \l_@@_str_box_coffin { r } { b }
                     \l_@@_pinyin_hanzi_coffin { l } { b }
                       { -\l_@@_frame_linewidth_dim } { 0pt }
                 }
               \bool_set_eq:NN \l_@@_withhanzi_bool \l_tmpa_bool
             }
         }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_single_str_coffin_construct:}
% æž„é€&nbsp;å•ä¸ªæ±‰å­—å¸¦æ‹¼éŸ³å­—ç¬¦ä¸²ç›’å­ã€‚
%    \begin{macrocode}
\cs_new:Npn \@@_single_str_coffin_construct:
  {
    \bool_if:NTF \l_@@_autopinyin_bool
      {
        \hcoffin_set:Nn \l_@@_str_box_coffin
          {
            \@@_get_hanzi_pinyin:V \l_@@_character_tl

            \@@_single_pinyin_hanzi_construct:NN
              \l_@@_character_tl \l_@@_hanzi_pinyin_tl
            \coffin_typeset:Nnnnn \l_@@_pinyin_hanzi_coffin
              { l } { b } { 0pt } { 0pt }
          }
      }
      {
        \hcoffin_set:Nn \l_@@_str_box_coffin
          {
            \@@_get_tone_pinyin:V \l_@@_pinyin_tl
            \clist_clear:N \l_@@_tone_pinyin_clist
            \clist_set:NV \l_@@_tone_pinyin_clist \l_@@_tone_pinyin_tl
            \tl_set:Nx \l_tmpb_tl { \clist_use:Nn \l_@@_tone_pinyin_clist { } }

            \@@_single_pinyin_hanzi_construct:NN \l_@@_character_tl \l_tmpb_tl
            \coffin_typeset:Nnnnn \l_@@_pinyin_hanzi_coffin
              { l } { b } { 0pt } { 0pt }
          }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.1.1}{2021/10/02}{ä¿®å¤æ—&nbsp;æ±‰å­—æ‰‹åŠ¨æ‹¼éŸ³åˆ†å‰²é—®é¢˜}
%
% \begin{macro}{\@@_null_str_coffin_construct:}
% æž„é€&nbsp;ç©ºç™½æ±‰å­—(0ä¸ªæ±‰å­—)å¸¦æ‹¼éŸ³å­—ç¬¦ä¸²ç›’å­ã€‚
%    \begin{macrocode}
\cs_new:Npn \@@_null_str_coffin_construct:
  {
    \bool_set_eq:NN \l_tmpa_bool \l_@@_withhanzi_bool
    \bool_set_false:N \l_@@_withhanzi_bool
    \bool_if:NTF \l_@@_autopinyin_bool
      {
        \hcoffin_set:Nn \l_@@_str_box_coffin
          {
            \@@_single_handle:N \c_@@_basechar_tl
          }
      }
      {
        \hcoffin_set:Nn \l_@@_str_box_coffin
          {
          }
        \bool_if:NTF \l_@@_withpinyin_bool
          {
            \@@_get_tone_pinyin:V \l_@@_pinyin_tl
            \clist_clear:N \l_@@_tone_pinyin_clist
            \clist_set:NV \l_@@_tone_pinyin_clist \l_@@_tone_pinyin_tl
            \int_set:Nn \l_tmpa_int {\clist_count:N \l_@@_tone_pinyin_clist}

            \int_step_inline:nn { \l_tmpa_int }
              {
                \tl_clear:N \l_tmpa_tl
                \clist_pop:NN \l_@@_tone_pinyin_clist \l_tmpb_tl

                \@@_single_pinyin_hanzi_construct:NN \l_tmpa_tl \l_tmpb_tl
                \coffin_join:NnnNnnnn \l_@@_str_box_coffin { r } { b }
                  \l_@@_pinyin_hanzi_coffin { l } { b }
                    { -\l_@@_frame_linewidth_dim } { 0pt }
              }
          }
          {
            \bool_set_false:N \l_@@_withhanzi_bool
            \@@_single_handle:N \c_@@_basechar_tl
          }
      }
    \bool_set_eq:NN \l_@@_withhanzi_bool \l_tmpa_bool
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0.0}{2021/09/28}{å°†æ‹¼éŸ³å¤„ç†è°ƒæ•´ä¸ºåœ¨handleå‡½æ•°ä¸­ç›´æŽ¥å®žçŽ°}
% \changes{v2.0.0}{2021/09/28}{åŒºåˆ†äº†å•ä¸ªæ±‰å­—å’Œç©ºç™½æ±‰å­—çš„å¤„ç†}
% \changes{v2.0.1}{2021/09/29}{å°†æ±‰å­—ç›’å­å¤„ç†è¿‡ç¨‹æ‹†è§£ä¸ºå‡½æ•°å®žçŽ°}
%
% \begin{macro}{\@@_handle:nnnn}
% æž„é€&nbsp;æ±‰å­—ç›’å­å…¥å£
%    \begin{macrocode}
\cs_new:Npn \@@_handle:nnnn #1#2#3#4
  {
    \group_begin:
      \keys_set:nn { hanzibox } { #1 }

      \tl_gset:Nx \l_@@_character_tl {#2}
      \tl_gset:Nx \l_@@_pinyin_tl {#3}
      \tl_gset:Nx \l_@@_translation_tl {#4}

      \int_set:Nn \l_@@_character_int
        {
          \tl_count:V \l_@@_character_tl
        }
      \int_set:Nn \l_@@_translation_int
        {
          \tl_count:V \l_@@_translation_tl
        }
      \int_set:Nn \l_@@_pinyin_int
        {
          \tl_count:V \l_@@_pinyin_tl
        }

      \int_compare:nNnTF { \l_@@_character_int } &gt; { 1 }
        {
          \@@_multi_str_coffin_construct:
        }
        {
          \int_compare:nNnTF { \l_@@_character_int } = { 1 }
            {
              \@@_single_str_coffin_construct:
            }
            {
              \@@_null_str_coffin_construct:
            }
        }
      \bool_if:NT \l_@@_withtran_bool
        {
          \hcoffin_set:Nn \l_@@_tran_box_coffin
            {
              \color_select:n { hanziboxtrancolor }
              \tl_use:N \l_@@_translation_format_tl
              \tl_use:N \l_@@_translation_tl
            }
        }
      \coffin_join:NnnNnnnn \l_@@_str_box_coffin
        { hc } { b } \l_@@_tran_box_coffin { hc } { t } { 0pt } { -3pt }

      \coffin_set_eq:NN \l_@@_box_coffin \l_@@_str_box_coffin

      \@@_resize_c:n { \l_@@_resize_method_tl }

      \coffin_typeset:Nnnnn \l_@@_box_coffin
        { l } { b } { 0pt } { 0pt }
      \allowbreak
    \group_end:
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.3.0}{2022/04/17}{æ·»åŠ&nbsp;ä½œæ–‡æ&nbsp;¼å­å†…éƒ¨å‘½ä»¤ã€‚}
%
% \begin{macro}{\@@_writegrid:nnn}
% æž„é€&nbsp;ä½œæ–‡æ&nbsp;¼å­å…¥å£
%    \begin{macrocode}
\cs_new:Npn \@@_writegrid:nn #1#2
  {
    \group_begin:
      \keys_set:nn { hanzibox } { #1 }

      \tl_if_eq:NnT \l_@@_frame_type_tl { none }
        { \tl_set:Nn \l_@@_frame_type_tl { å£ } }

      \hcoffin_set:Nn \l_@@_grid_tmpa_coffin
        {
          \draw_begin:
            \draw_linewidth:n { \l_@@_frame_linewidth_dim }
            \@@_aux_color_fill:
            \color_stroke:n { hanziboxframecolor }

            \draw_path_scope_begin:
              \@@_frame_type_c:n { \l_@@_frame_type_tl }
                { 0 } { 0 } { \hanziboxwidth } { \hanziboxheight } { 1.0 } { 1.0 }
              \int_decr:N \l_@@_grid_cols_int
              \int_step_inline:nn  { \l_@@_grid_cols_int }
                {
                  \draw_transform_shift:n {\hanziboxwidth, 0.0 }
                  \@@_frame_type_c:n { \l_@@_frame_type_tl }
                    { 0 } { 0 } { \hanziboxwidth } { \hanziboxheight } { 1.0 } { 1.0 }
                }
            \draw_path_scope_end:
          \draw_end:
        }

      \hcoffin_set:Nn \l_@@_grid_tmpb_coffin
        {
          \coffin_typeset:Nnnnn \l_@@_grid_tmpa_coffin
            { l } { b } { 0pt } { 0pt }
        }

      \int_step_inline:nn { #2 - 1 }
        {
          \coffin_join:NnnNnnnn \l_@@_grid_tmpb_coffin { hc } { b }
            \l_@@_grid_tmpa_coffin { hc } { t } { 0pt }
            { -\hanziboxheight * \dim_ratio:nn { 1 pt }{ \l_@@_grid_sep_v_tl pt } }
        }

      \dim_set:Nn \l_tmpa_dim
        {
          \coffin_wd:N \l_@@_grid_tmpb_coffin
        }
      \dim_set:Nn \l_tmpb_dim
        {
          \tex_dimexpr:D \coffin_ht:N \l_@@_grid_tmpb_coffin +
                          \coffin_dp:N \l_@@_grid_tmpb_coffin \scan_stop:
        }

      \draw_begin:
        \draw_linewidth:n { \l_@@_frame_linewidth_dim * 4 }
        \@@_aux_color_fill:
        \color_stroke:n { hanziboxframecolor }

        \draw_path_scope_begin:
          \draw_path_rectangle_corners:nn { 0cm , 0cm } { \l_tmpa_dim, \l_tmpb_dim }
          \draw_path_use_clear:n { draw }
          \draw_transform_shift:n {\l_tmpa_dim / 2.0, \l_tmpb_dim / 2.0 }
          \draw_coffin_use:Nnn \l_@@_grid_tmpb_coffin { hc } { vc }
        \draw_path_scope_end:
      \draw_end:

    \group_end:
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0.0}{2021/09/27}{å¯¹äºŽæ—&nbsp;éœ€åˆ†è§£å£°éŸµæ¯çš„æƒ…å†µï¼Œ
%     ç›´æŽ¥ä½¿ç”¨xpinyinå®åŒ…çš„ç»“æžœæŽ’ç‰ˆæ‹¼éŸ³ã€‚}
%
% \begin{macro}{\@@_single_pinyin:n}
% æž„é€&nbsp;å•ä¸ªæ±‰å­—çš„æ‹¼éŸ³ç›’å­
%    \begin{macrocode}
\cs_new:Npn \@@_single_pinyin:n #1
  {
    \bool_if:NTF \l_@@_withtone_bool
      {
        \bool_if:nTF { !(\l_@@_withinitial_bool) || !(\l_@@_withvowel_bool) }
          {
            \@@_split_pinyin_withtone:n { #1 }
            \hcoffin_set:Nn \l_@@_pinyin_box_coffin
              {
                \color_select:n { hanziboxpinyincolor }
                \tl_use:N \l_@@_pinyin_format_tl

                \bool_if:NTF \l_@@_withinitial_bool
                  {
                    \bool_if:NTF \l_@@_withvowel_bool
                    {
                      \tl_use:N \l_@@_initial_tl
                      \tl_use:N \l_@@_vowel_tl
                    }
                    {
                      \tl_use:N \l_@@_initial_tl
                      \phantom{ \tl_use:N \l_@@_vowel_tl }
                    }
                  }
                  {
                    \bool_if:NTF \l_@@_withvowel_bool
                    {
                      \phantom{ \tl_use:N \l_@@_initial_tl }
                      \tl_use:N \l_@@_vowel_tl
                    }
                    {
                      \phantom{ \tl_use:N \l_@@_initial_tl }
                      \phantom{ \tl_use:N \l_@@_vowel_tl }
                    }
                  }
              }
          }
          {
            \hcoffin_set:Nn \l_@@_pinyin_box_coffin
              {
                \color_select:n { hanziboxpinyincolor }
                \tl_use:N \l_@@_pinyin_format_tl
                #1
              }
          }
      }
      {
        \@@_split_pinyin_withouttone:n { #1 }
        \hcoffin_set:Nn \l_@@_pinyin_box_coffin
        {
          \color_select:n { hanziboxtrancolor }
          \tl_use:N \l_@@_pinyin_format_tl

          \tl_use:N \l_@@_pinyin_tl
        }
      }
      \@@_single_pinyin_lines_construct:
  }
\cs_generate_variant:Nn  \@@_single_pinyin:n { V }
\cs_generate_variant:Nn  \@@_single_pinyin:n { x }
\cs_set:Npn \@@_single_pinyin_o:n
  { \exp_after:wN \@@_single_pinyin:n }
\cs_set:Npn \@@_single_pinyin_f:n
  { \exp_args:Nf \@@_single_pinyin:n }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_single_handle:nN,\@@_single_handle:N}
% æž„é€&nbsp;å•ä¸ªæ±‰å­—ç›’å­å…¥å£
%    \begin{macrocode}
\cs_new:Npn \@@_single_handle:nN #1#2
  {
    \group_begin:
      \tl_if_empty:nF {#1} { \keys_set:nn { hanzibox } {#1} }

      \tl_set:Nf \l_@@_curr_char_tl {#2}

      \@@_single_construct_o:N \l_@@_curr_char_tl
    \group_end:
  }
\cs_new:Npn \@@_single_handle:N #1
  {
    \group_begin:
      \tl_set:Nf \l_@@_curr_char_tl {#1}
      \@@_single_construct_o:N \l_@@_curr_char_tl
    \group_end:
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0.0}{2021/09/27}{åˆ&nbsp;é™¤å•ä¸ªæ±‰å­—æž„é€&nbsp;ä¸­æ·»åŠ&nbsp;æ‹¼éŸ³çš„åŠŸèƒ½}
% \changes{v2.2.0}{2021/10/08}{ä¸ºæ±‰å­—æ·»åŠ&nbsp;å­—ç¬¦è½®å»“å¤„ç†}
%
% \begin{macro}{\@@_single_construct:N}
% æž„é€&nbsp;å•ä¸ªæ±‰å­—ç›’å­
%    \begin{macrocode}
\cs_new:Npn \@@_single_construct:N #1
  {
    \bool_if:NTF \l_@@_withhanzi_bool
      {
        \hcoffin_set:Nn \l_@@_box_coffin
          {
            \color_select:n { hanziboxcharcolor }
            \tl_use:N \l_@@_character_format_tl
            \@@_chars_stroke_construct:n { #1 }
          }
      }
      {
        \hcoffin_set:Nn \l_@@_box_coffin
          {
            \color_select:n { hanziboxcharcolor }
            \tl_use:N \l_@@_character_format_tl
            \phantom{#1}
          }
      }

    \@@_single_frame_construct:
  }
\cs_set:Npn \@@_single_construct_o:N
  { \exp_after:wN \@@_single_construct:N }
\cs_set:Npn \@@_single_construct_f:N
  { \exp_args:Nf \@@_single_construct:N }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0.0}{2021/09/28}{å°†æ±‰å­—ç›’å­ä¸Žè¾¹æ¡†æŒ‰ä¸­å¿ƒå¯¹é½ï¼Œä»¥ä½¿æ±‰å­—å±…ä¸­}
%
% \begin{macro}{\@@_single_frame_construct:}
% æž„é€&nbsp;å•ä¸ªæ±‰å­—ç›’å­è¾¹æ¡†
%    \begin{macrocode}
\cs_new:Npn \@@_single_frame_construct:
  {
    \draw_begin:
      \draw_linewidth:n { \l_@@_frame_linewidth_dim }
      \@@_aux_color_fill:
      \color_stroke:n { hanziboxframecolor }

      \exp_after:wN \draw_path_corner_arc:nn \l_@@_frame_arc_tl

      \draw_path_scope_begin:
        \@@_frame_type_c:n { \l_@@_frame_type_tl }
          { 0 } { 0 } { \hanziboxwidth } { \hanziboxheight } { 1.0 } { 1.0 }
        \draw_transform_shift:n {\hanziboxwidth / 2.0, \hanziboxheight / 2.0 }
        \draw_coffin_use:Nnn \l_@@_box_coffin { hc } { vc }
      \draw_path_scope_end:
    \draw_end:
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/07}{æ·»åŠ&nbsp;æž„é€&nbsp;å•ä¸ªæ‹¼éŸ³ç›’å­å‡½æ•°}
%
% \begin{macro}{\@@_single_pinyin_lines_construct:}
% æž„é€&nbsp;å•ä¸ªæ‹¼éŸ³ç›’å­
%    \begin{macrocode}
\cs_new:Npn \@@_single_pinyin_lines_construct:
  {
    \draw_begin:
      \draw_linewidth:n { \l_@@_pinyin_linewidth_dim }
      \color_stroke:n { hanziboxframecolor!50 }

      \draw_path_scope_begin:
        \@@_frame_type_c:n { pinyinlines }
          { 0 } { 0 } { \hanziboxwidth } { \hanziboxheight } { 1.0 } { 1.0 }
        \draw_transform_shift:n {\hanziboxwidth / 2.0, \l_@@_pinyin_height_i_dim }
        \draw_coffin_use:Nnn \l_@@_pinyin_box_coffin { hc } { H }
      \draw_path_scope_end:
    \draw_end:
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.2.0}{2021/10/07}{æ·»åŠ&nbsp;æž„é€&nbsp;å•ä¸ªæ‹¼éŸ³çº¿å‡½æ•°}
%
% \begin{macro}{\@@_single_pinyin_lines:}
% æž„é€&nbsp;å•ä¸ªæ‹¼éŸ³çº¿
%    \begin{macrocode}
\cs_new:Npn \@@_single_pinyin_lines:
  {
    \draw_begin:
      \draw_linewidth:n { \l_@@_pinyin_linewidth_dim }
      \color_stroke:n { hanziboxframecolor!50 }

      \@@_frame_type_c:n { pinyinlines }
        { 0 } { 0 } { \hanziboxwidth } { \hanziboxheight } { 1.0 } { 1.0 }
    \draw_end:
  }
%    \end{macrocode}
% \end{macro}
%
% \subsection{\pkg{xpinyin}å®åŒ…æ‹¼éŸ³åŽå¤„ç†å‡½æ•°}
%
% \changes{v2.1.0}{2021/09/30}{æ·»åŠ&nbsp;ä»Žxpinyinå®åŒ…ä¸­æå–æ‹¼éŸ³ä¸²å‡½æ•°ã€‚}
% æ‘˜å½•è‡ªLaTeXå·¥ä½œå®¤é—®ç­”ï¼šå¦‚ä½•å¾—åˆ°xpinyinæ‹¼éŸ³å®åŒ…å¾—åˆ°çš„æ‹¼éŸ³æ–‡æœ¬ï¼Ÿ
% (\url{https://ask.latexstudio.net/ask/question/3768.html})
%
% å˜é‡å®šä¹‰
%    \begin{macrocode}
\tl_new:N \l_@@_save_tl
\tl_new:N \l_@@_hanzi_pinyin_tl
\tl_new:N \l_@@_tone_pinyin_tl
%    \end{macrocode}
%
% æž„é€&nbsp;å£°è°ƒè¡¨
%    \begin{macrocode}
\clist_const:Nn \c_@@_tone_a_clist { Ä,Ã¡,ÇŽ,Ã&nbsp;,a }
\clist_const:Nn \c_@@_tone_o_clist { Å,Ã³,Ç’,Ã²,o }
\clist_const:Nn \c_@@_tone_e_clist { Ä“,Ã©,Ä›,Ã¨,e }
\clist_const:Nn \c_@@_tone_u_clist { Å«,Ãº,Ç”,Ã¹,u }
\clist_const:Nn \c_@@_tone_i_clist { Ä«,Ã­,Ç,Ã¬,i }
\clist_const:Nn \c_@@_tone_v_clist { Ç–,Ç˜,Çš,Çœ,Ã¼ }
%    \end{macrocode}
%
% \begin{macro}{\@@_pinyin_aux:n}
% æ‹¼éŸ³ç”Ÿæˆè¾…åŠ©å‡½æ•°(æ”¹è‡ªxpinyinå®åŒ…çš„\verb!\__xpinyin_pinyin_aux:n #1!å‡½æ•°)
%    \begin{macrocode}
\cs_new_protected:Npn \@@_pinyin_aux:n #1
  {
    \quark_if_recursion_tail_stop_do:nn {#1}
      {
        \bool_if:NT \l__xpinyin_first_bool
          { \tl_set:NV \l_@@_tone_pinyin_tl \l__xpinyin_item_tl }
      }
    \__xpinyin_if_number:nTF {#1}
      {
        \bool_if:NT \l__xpinyin_first_bool
          { \bool_set_false:N \l__xpinyin_first_bool }
        \tl_put_right:NV \l_@@_tone_pinyin_tl \l__xpinyin_pre_tl
        \tl_put_right:Nx \l_@@_tone_pinyin_tl
          { \clist_item:cn { c_@@_tone_ \l__xpinyin_tone_tl _clist } {#1} }
        \tl_put_right:NV \l_@@_tone_pinyin_tl \l__xpinyin_post_tl
        \bool_if:NF \l_@@_autopinyin_bool
          {
            \tl_put_right:Nn \l_@@_tone_pinyin_tl {,}
          }
        \__xpinyin_pinyin_init:
      }
      {
        \int_compare:nNnTF
          { 0 \cs_if_exist_use:c { c__xpinyin_ \tl_to_str:N \l__xpinyin_tone_tl _tl } } &gt;
          { 0 \cs_if_exist_use:c { c__xpinyin_ \tl_to_str:n {#1} _tl } }
          { \tl_put_right:Nn \l__xpinyin_post_tl {#1} }
          {
            \tl_set:Nn \l__xpinyin_tone_tl {#1}
            \tl_set_eq:NN \l__xpinyin_pre_tl \l__xpinyin_item_tl
            \tl_clear:N \l__xpinyin_post_tl
          }
        \tl_put_right:Nx \l__xpinyin_item_tl { \__xpinyin_replace_v:n {#1} }
      }
    \@@_pinyin_aux:n
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_get_tone_pinyin:n}
% æ&nbsp;¹æ®æ‰‹åŠ¨æ‹¼éŸ³å¾—åˆ°æ‹¼éŸ³
%    \begin{macrocode}
\cs_new:Npn \@@_get_tone_pinyin:n #1
  {
    \tl_clear:N \l_@@_tone_pinyin_tl
    \__xpinyin_pinyin_init:
    \tl_set:Nn \l_@@_save_tl {#1}
    \bool_set_true:N \l__xpinyin_first_bool
    \@@_pinyin_aux:n #1 \q_recursion_tail \q_recursion_stop
  }
\cs_generate_variant:Nn  \@@_get_tone_pinyin:n { V }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_get_hanzi_pinyin:n}
% è‡ªåŠ¨æ‹¼éŸ³
%    \begin{macrocode}
\cs_new:Npn \@@_get_hanzi_pinyin:n #1
  {
    \tl_set_eq:Nc \l_tmpa_tl { c__xpinyin_ \__xpinyin_char_to_unicode:n {#1} _tl }
    \exp_args:No \tl_if_head_eq_meaning:nNTF { \l_tmpa_tl } \__xpinyin_pinyin:n
      {
        \exp_args:Nf \@@_get_tone_pinyin:n { \exp_after:wN \use_ii:nn \l_tmpa_tl }
        \tl_set_eq:NN \l_@@_hanzi_pinyin_tl \l_@@_tone_pinyin_tl
      }
      { \tl_set_eq:NN \l_@@_hanzi_pinyin_tl \l_tmpa_tl }
  }
\cs_generate_variant:Nn  \@@_get_hanzi_pinyin:n { V }
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.0.0}{2021/09/24}{æ·»åŠ&nbsp;ä»Žxpinyinå®åŒ…ä¸­æå–æ‹¼éŸ³å‡½æ•°ã€‚}
% ä»£ç&nbsp;æ‘˜å½•è‡ªLaTeXå·¥ä½œå®¤ï¼šåŸºäºŽxpinyinå®åŒ…èŽ·å–æ±‰å­—çš„å£°æ¯ï¼ŒéŸµæ¯ï¼Œå£°è°ƒ
% (\url{https://www.latexstudio.net/index/details/index/mid/1994.html})
%
% ä»Žéœ€è¦çš„å£°æ¯ã€éŸµæ¯ã€è¯»éŸ³è¡¨ã€‚
%
% å£°æ¯è¡¨
%    \begin{macrocode}
\clist_set:Nn \l_@@_initials_clist
  {
    {zh} , {ch} , {sh} , {b} , {p} , {m} , {f} ,
    {d}  , {t}  , {l}  , {k} , {h} , {j} , {q} ,
    {x}  , {r}  , {z}  , {c} , {s} , {y} , {w} ,
    {g}  , {n}
  }
%    \end{macrocode}
%
% \changes{v2.0.0}{2021/09/27}{ä¿®è®¢éƒ¨åˆ†é”™è¯¯å¸¦éŸ³è°ƒéŸµæ¯è¡¨}
%
% å¸¦å£°éŸ³è°ƒéŸµæ¯è¡¨
%    \begin{macrocode}
\clist_set:Nn \l_@@_vowel_tone_clist
  {
    {iÄng} , {iÃ¡ng} , {iÇŽng} , {iÃ&nbsp;ng} , {iang} ,
    {iÅng} , {iÃ³ng} , {iÇ’ng} , {iÃ²ng} , {iong} ,
    {uÄng} , {uÃ¡ng} , {uÇŽng} , {uÃ&nbsp;ng} , {uang} ,
    {uÄ“ng} , {uÃ©ng} , {uÄ›ng} , {uÃ¨ng} , {ueng} ,
    {Äng}  , {Ã¡ng}  , {ÇŽng}  , {Ã&nbsp;ng}  , {ang}  ,
    {Ä“ng}  , {Ã©ng}  , {Ä›ng}  , {Ã¨ng}  , {eng}  ,
    {Ä«ng}  , {Ã­ng}  , {Çng}  , {Ã¬ng}  , {ing}  ,
    {Ång}  , {Ã³ng}  , {Ç’ng}  , {Ã²ng}  , {ong}  ,
    {uÄi}  , {uÃ¡i}  , {uÇŽi}  , {uÃ&nbsp;i}  , {uai}  ,
    {uÄn}  , {uÃ¡n}  , {uÇŽn}  , {uÃ&nbsp;n}  , {uan}  ,
    {uÄ“i}  , {uÃ©i}  , {uÄ›i}  , {uÃ¨i}  , {uei}  ,
    {uÄo}  , {uÃ¡o}  , {uÇŽo}  , {uÃ&nbsp;o}  , {uao}  ,
    {iÅu}  , {iÃ³u}  , {iÇ’u}  , {iÃ²u}  , {iou}  ,
    {iÄn}  , {iÃ¡n}  , {iÇŽn}  , {iÃ&nbsp;n}  , {ian}  ,
    {Ã¼Än}  , {Ã¼Ã¡n}  , {Ã¼ÇŽn}  , {Ã¼Ã&nbsp;n}  , {Ã¼an}  ,
    {uÄ“n}  , {uÃ©n}  , {uÄ›n}  , {uÃ¨n}  , {uen}  ,
    {Äi}   , {Ã¡i}   , {ÇŽi}   , {Ã&nbsp;i}   , {ai}   ,
    {Ä“i}   , {Ã©i}   , {Ä›i}   , {Ã¨i}   , {ei}   ,
    {uÄ}   , {uÃ¡}   , {uÇŽ}   , {uÃ&nbsp;}   , {ua}   ,
    {uÅ}   , {uÃ³}   , {uÇ’}   , {uÃ²}   , {uo}   ,
    {uÄ«}   , {uÃ­}   , {uÇ}   , {uÃ¬}   , {ui}   ,
    {Äo}   , {Ã¡o}   , {ÇŽo}   , {Ã&nbsp;o}   , {ao}   ,
    {Åu}   , {Ã³u}   , {Ç’u}   , {Ã²u}   , {ou}   ,
    {iÅ«}   , {iÃº}   , {iÇ”}   , {iÃ¹}   , {iu}   ,
    {iÄ}   , {iÃ¡}   , {iÇŽ}   , {iÃ&nbsp;}   , {ia}   ,
    {iÄ“}   , {iÃ©}   , {iÄ›}   , {iÃ¨}   , {ie}   ,
    {uÄ“}   , {uÃ©}   , {uÄ›}   , {uÃ¨}   , {ue}   ,
    {Ã¼Ä“}   , {Ã¼Ã©}   , {Ã¼Ä›}   , {Ã¼Ã¨}   , {Ã¼e}   ,
    {Ä“r}   , {Ã©r}   , {Ä›r}   , {Ã¨r}   , {er}   ,
    {Än}   , {Ã¡n}   , {ÇŽn}   , {Ã&nbsp;n}   , {an}   ,
    {Ä“n}   , {Ã©n}   , {Ä›n}   , {Ã¨n}   , {en}   ,
    {Ä«n}   , {Ã­n}   , {Çn}   , {Ã¬n}   , {in}   ,
    {Å«n}   , {Ãºn}   , {Ç”n}   , {Ã¹n}   , {un}   ,
    {Ç–n}   , {Ç˜n}   , {Çšn}   , {Çœn}   , {Ã¼n}   ,
    {Ä}    , {Ã¡}    , {ÇŽ}    , {Ã&nbsp;}    , {a}    ,
    {Ä“}    , {Ã©}    , {Ä›}    , {Ã¨}    , {e}    ,
    {Ä«}    , {Ã­}    , {Ç}    , {Ã¬}    , {i}    ,
    {Å}    , {Ã³}    , {Ç’}    , {Ã²}    , {o}    ,
    {Å«}    , {Ãº}    , {Ç”}    , {Ã¹}    , {u}    ,
    {Ç–}    , {Ç˜}    , {Çš}    , {Çœ}    , {Ã¼}
  }
%    \end{macrocode}
%
% éŸµæ¯è¡¨
%    \begin{macrocode}
\clist_set:Nn \l_@@_vowel_clist
  {
    {iang} , {iong} , {uang} , {ueng} , {ang} , {eng} , {ing} ,
    {ong}  , {uai}  , {uan}  , {uai}  , {uei} , {iao} , {iou} ,
    {ian}  , {Ã¼an}  , {uen}  , {ai}   , {ei}  , {ua}  , {uo}  ,
    {ui}   , {ao}   , {ou}   , {iu}   , {ie}  , {Ã¼e}  , {er}  ,
    {an}   , {en}   , {in}   , {un}   , {Ã¼n}  , {a}   , {e}   ,
    {i}    , {o}    , {Ã¼}    , {u}
  }
%    \end{macrocode}
%
% å£°è°ƒè¡¨
%    \begin{macrocode}
\clist_set:Nn \l_@@_tone_num_clist
  {
    {Ä} {a1} , {Ã¡} {a2} , {ÇŽ} {a3} , {Ã&nbsp;} {a4} ,
    {Å} {o1} , {Ã³} {o2} , {Ç’} {o3} , {Ã²} {o4} ,
    {Ä“} {e1} , {Ã©} {e2} , {Ä›} {e3} , {Ã¨} {e4} ,
    {Å«} {u1} , {Ãº} {u2} , {Ç”} {u3} , {Ã¹} {u4} ,
    {á¸¿} {m2} ,
    {Å„} {n2} , {Åˆ} {n3} , {Ç¹} {n4} ,
    {Ä«} {i1} , {Ã­} {i2} , {Ç} {i3} , {Ã¬} {i4} ,
    {Ç–} {v1} , {Ç˜} {v2} , {Çš} {v3} , {Çœ} {v4}
  }
%    \end{macrocode}
%
% åŽ»å£°è°ƒè¡¨
%    \begin{macrocode}
\clist_set:Nn \l_@@_nonetone_clist
  {
    {Ä} {a} , {Ã¡} {a} , {ÇŽ} {a} , {Ã&nbsp;} {a} ,
    {Å} {o} , {Ã³} {o} , {Ç’} {o} , {Ã²} {o} ,
    {Ä“} {e} , {Ã©} {e} , {Ä›} {e} , {Ã¨} {e} ,
    {Å«} {u} , {Ãº} {u} , {Ç”} {u} , {Ã¹} {u} ,
    {á¸¿} {m} ,
    {Å„} {n} , {Åˆ} {n} , {Ç¹} {n} ,
    {Ä«} {i} , {Ã­} {i} , {Ç} {i} , {Ã¬} {i} ,
    {Ç–} {Ã¼} , {Ç˜} {Ã¼} , {Çš} {Ã¼} , {Çœ} {Ã¼}
  }
%    \end{macrocode}
%
% \begin{macro}{\@@_split_pinyin_withtone:n}
% åˆ†ç¦»æ‹¼éŸ³ä¸­çš„å£°æ¯å’Œå¸¦å£°è°ƒçš„éŸµæ¯ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_split_pinyin_withtone:n #1
  {
    \int_zero:N  \l_@@_tone_int
    \str_clear:N \l_@@_pinyin_str
    \tl_clear:N  \l_@@_pinyin_tl
    \tl_clear:N  \l_@@_initial_tl
    \tl_clear:N  \l_@@_vowel_tl

    \tl_set:Nn \l_@@_pinyin_tl {#1}

    \tl_map_inline:Nn \l_@@_pinyin_tl
      {
        \str_put_right:Nn \l_@@_pinyin_str {##1}
      }

    \clist_map_inline:Nn \l_@@_initials_clist
      {
        \str_if_in:NnT { \l_@@_pinyin_str } {##1}
          {
            \tl_set:Nn \l_@@_initial_tl {##1}
            \clist_map_break:
          }
      }

    \clist_map_inline:Nn \l_@@_vowel_tone_clist
      {
        \str_if_in:NnT { \l_@@_pinyin_str } { ##1 }
          {
            \tl_set:Nn \l_@@_vowel_tl {##1}
            \clist_map_break:
          }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_split_pinyin_withouttone:n}
% åˆ†ç¦»æ‹¼éŸ³ä¸­çš„å£°æ¯å’Œä¸å¸¦å£°è°ƒçš„éŸµæ¯ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_split_pinyin_withouttone:n #1
  {
    \int_zero:N  \l_@@_tone_int
    \str_clear:N \l_@@_pinyin_str
    \tl_clear:N  \l_@@_pinyin_tl
    \tl_clear:N  \l_@@_initial_tl
    \tl_clear:N  \l_@@_vowel_tl

    \tl_set:Nn \l_@@_pinyin_tl {#1}

    \clist_map_inline:Nn \l_@@_nonetone_clist
      {
        \tl_replace_all:Nnn \l_@@_pinyin_tl ##1
      }

    \tl_map_inline:Nn \l_@@_pinyin_tl
      {
        \str_put_right:Nn \l_@@_pinyin_str {##1}
      }

    \clist_map_inline:Nn \l_@@_initials_clist
      {
        \str_if_in:NnT {\l_@@_pinyin_str} {##1}
          {
            \tl_set:Nn \l_@@_initial_tl {##1}
            \clist_map_break:
          }
      }

    \clist_map_inline:Nn \l_@@_vowel_clist
      {
        \str_if_in:NnT { \l_@@_pinyin_str } { ##1 }
          {
            \tl_set:Nn \l_@@_vowel_tl {##1}
            \clist_map_break:
          }
      }
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%&lt;/package&gt;
%    \end{macrocode}
%
% \end{implementation}
%
% \Finale
%
\endinput
</pre></body></html>