<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;
Create code box and viewer based on tcolorbox and minted/listings
=======

`codebox` is a LaTeX3 package developed based on tcolorbox and minted/listings, which provides environments `codebox` and `codeview` to typset with environment body, and macros `\codefile` and `\cvfile` to typeset programming source code from a file in a fancy box.

The starred version of all environments and macros are provided at the same time, such as `codebox*`, `codeview*`, `\codefile*` and `\cvfile*` which adds comment at bottom of the fancy box.

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

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

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

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

åŸºäºŽtcolorboxçš„ç»ˆç«¯æ¨¡æ‹Ÿå®åŒ…
=======

`codebox`æ˜¯ä¸€ä¸ªåŸºäºŽtcolorboxçš„ç”¨LaTeX3å¼€å‘çš„ç»ˆç«¯æ¨¡æ‹ŸLaTeXå®åŒ…ï¼Œå®ƒæä¾›äº†ç”¨äºŽæŽ’ç‰ˆç¨‹åºæºä»£ç&nbsp;ç›’å­çš„çŽ¯å¢ƒå’Œå‘½ä»¤ã€‚

å…¶ä¸­`codebox`å’Œ`codeview`çŽ¯å¢ƒç”¨äºŽæ&nbsp;¹æ®çŽ¯å¢ƒå†…å®¹æŽ’ç‰ˆä»£ç&nbsp;ï¼Œ`\codefile`å’Œ`\cvfile`å‘½ä»¤ç”¨äºŽæ&nbsp;¹æ®æ–‡ä»¶å†…å®¹æŽ’ç‰ˆä»£ç&nbsp;ã€‚

`codebox`åŒæ—¶æä¾›äº†å„çŽ¯å¢ƒå’Œå‘½ä»¤çš„æ˜Ÿå·ç‰ˆæœ¬ï¼Œå¦‚`codebox*`å’Œ`codeview*`ï¼Œ`\codefile*`å’Œ`\cvfile*`ï¼Œç”¨äºŽä¸ºä»£ç&nbsp;ç›’å­æ·»åŠ&nbsp;åº•çº¿æ³¨é‡Šã€‚

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

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

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

2. giteeä»“åº“:
    (1). ä»“åº“åœ°å€: [codebox](https://gitee.com/nwafu_nan/codebox)
    (2). Issues and PR: [issue](https://gitee.com/nwafu_nan/codebox/issues) or [pull request](https://gitee.com/nwafu_nan/codebox/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  codebox.dtx,
                 and the derived files codebox.sty,
                                       codebox.pdf,
                                       codebox.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  codebox.dtx,
                 and the derived files codebox.sty,
                                       codebox.pdf,
                                       codebox.ins,
                                       README.md.
\endpostamble

\declarepostamble\emptypostamble
\endpostamble

\def\MetaPrefix{-- }


\let\MetaPrefix\DoubleperCent

\generate
  {
%&lt;/install&gt;
%&lt;*internal&gt;
    \usedir{source/xelatex/codebox}
    \file{codebox.ins} {\from{\jobname.dtx}{install}}
%&lt;/internal&gt;
%&lt;*install&gt;
    \usedir{xetex/xelatex/codebox}
    \file{codebox.sty} {\from{\jobname.dtx}{package}}
    \nopreamble\nopostamble
    \usedir{doc/xelatex/codebox}
    \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: codebox.dtx 1.0.4 2022-01-28 08:00:00 +0800 Nan Geng &lt;nangeng@nwafu.edu.cn&gt; $
%&lt;package&gt;  {Code Box with tcolorbox and minted/listings.}
%&lt;package&gt;\ProvidesExplPackage{\ExplFileName}
%&lt;package&gt;  {\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
%&lt;*driver&gt;
\documentclass{ctxdoc}
\usepackage{minted}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{xcolor-material}
\usepackage{codebox}
\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/12/25}{å¼€å§‹ç¼–å†™æ¨¡æ¿}
%
% \CheckSum{313}
% \GetFileId{codebox.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{codebox}ï¼šä»£ç&nbsp;ç›’å­æŽ’ç‰ˆå®åŒ…\\ \bfseries\pkg{codebox}ï¼šprogrmming source code box}
% \author{è€¿æ¥&nbsp;\\ \path{nangeng@nwafu.edu.cn}}
% \date{\filedate\qquad\fileversion\thanks{\url{https://github.com/registor/codebox}}\thanks{\url{https://gitee.com/nwafu_nan/codebox}}}
% \maketitle
%
% \begin{documentation}
%
% \begin{abstract}
%
% \pkg{codebox} æ˜¯ä¸€ä¸ªåŸºäºŽ\pkg{tcolorbox}ç”¨\LaTeX3 å¼€å‘çš„ \LaTeX å®åŒ…ï¼Œå®ƒæä¾›ç”¨äºŽ
% æŽ’ç‰ˆæºä»£ç&nbsp;ç›’å­çš„çŽ¯å¢ƒå’Œå‘½ä»¤ã€‚
% å…¶ä¸­ï¼Œ\env{codebox}å’Œ\env{codeview}çŽ¯å¢ƒç”¨äºŽæ&nbsp;¹æ®çŽ¯å¢ƒå†…å®¹æŽ’ç‰ˆä»£ç&nbsp;ï¼Œ
% \tn{codefile}å’Œ\tn{cvfile}å‘½ä»¤ç”¨äºŽæ&nbsp;¹æ®æ–‡ä»¶å†…å®¹æŽ’ç‰ˆä»£ç&nbsp;ã€‚
% åŒæ—¶ï¼Œ\pkg{codebox}è¿˜æä¾›äº†å„çŽ¯å¢ƒå’Œå‘½ä»¤çš„æ˜Ÿå·ç‰ˆæœ¬ï¼Œ
% å¦‚\env{codebox*}å’Œ\env{codeview*}ï¼Œ\tn{codefile*}å’Œ\tn{cvfile*}ï¼Œ
% ç”¨äºŽä¸ºä»£ç&nbsp;ç›’å­æ·»åŠ&nbsp;åº•çº¿æ³¨é‡Šã€‚
%
% \end{abstract}
%
% \tableofcontents
%
% \section{ç®€ä»‹}
%
% \pkg{codebox} æ˜¯ä¸€ä¸ªåŸºäºŽ\pkg{tcolorbox}ç”¨\LaTeX3 å¼€å‘çš„ \LaTeX å®åŒ…ï¼Œ
% å®ƒå¯ä»¥æ&nbsp;¹æ®ç”¨æˆ·è®¾ç½®ä½¿ç”¨\pkg{minted}æˆ–\pkg{listings}å®åŒ…å®žçŽ°ä»£ç&nbsp;ç›’å­æŽ’ç‰ˆã€‚
%
% è¯¥å®åŒ…æä¾›äº†\env{codebox}å’Œ\env{codeview}ä¸¤ä¸ªçŽ¯å¢ƒå’Œ
% \tn{codefile}å’Œ\tn{cvfile}ä¸¤ä¸ªå‘½ä»¤ä»¥æŽ’ç‰ˆä»£ç&nbsp;ç›’å­ã€‚
%
% åŒæ—¶ï¼Œ\pkg{codebox}å®åŒ…è¿˜æä¾›çŽ¯å¢ƒå’Œå‘½ä»¤çš„æ˜Ÿå·ç‰ˆæœ¬ï¼Œ
% ç”¨äºŽä¸ºä»£ç&nbsp;ç›’å­æ·»åŠ&nbsp;åº•çº¿æ³¨é‡Šã€‚
%
% \section{ç”¨æˆ·æŽ¥å£}
%
% \subsection{\env{codebox}å’Œ\env{codebox*}çŽ¯å¢ƒ}
%
% \begin{function}[added=2021-12-25,updated=2021-12-25]{codebox,codebox*}
%   \begin{syntax}
%     \tn{begin}\{codebox\}\oarg{å¤–è§‚é€‰é¡¹}\Arg{ç›’å­æ&nbsp;‡é¢˜}
%     .....
%     \tn{end}\{codebox\}
%     \tn{begin}\{codebox*\}\oarg{å¤–è§‚é€‰é¡¹}\Arg{ç›’å­æ&nbsp;‡é¢˜}
%     .....
%     \tn{end}\{codebox*\}
%   \end{syntax}
%   ä½¿ç”¨çŽ¯å¢ƒå†…å®¹æŽ’ç‰ˆä»£ç&nbsp;ç›’å­ã€‚
%   å¯ä»¥é€šè¿‡\Arg{ç›’å­æ&nbsp;‡é¢˜}ä¸ºä»£ç&nbsp;ç›’å­è®¾ç½®æ&nbsp;‡é¢˜ã€‚
%
%   \oarg{å¤–è§‚é€‰é¡¹}ä¸­é€šè¿‡key-valueæ–¹å¼è®¾ç½®ä»£ç&nbsp;ç›’å­å¤–è§‚ã€‚
%
%   æ˜Ÿå·çŽ¯å¢ƒ\texttt{codebox*}ç”¨äºŽä¸ºä»£ç&nbsp;ç›’å­æ·»åŠ&nbsp;åº•çº¿æ³¨é‡Šï¼Œ
%   æ­¤æ—¶ï¼Œéœ€è¦åœ¨\oarg{å¤–è§‚é€‰é¡¹}ä¸­ç”¨
%   \kvopt{\meta{comments}}{\meta{åº•çº¿æ³¨é‡Š}}é€‰é¡¹æä¾›\textbf{åº•çº¿æ³¨é‡Š}å†…å®¹ã€‚
%
%   ä»£ç&nbsp;ç›’å­çš„å¤–è§‚ä¹Ÿå¯ä»¥é€šè¿‡\tn{codeset}å‘½ä»¤çš„é€—å·åˆ†éš”
%   key-valueåˆ—è¡¨è¿›è¡Œè®¾ç½®ã€‚
%
% \end{function}
%   \begin{Verbatim}[frame=none,numbers=left,gobble=5]
%     \centering
%     \begin{codebox}{ä»£ç&nbsp;æ&nbsp;‡é¢˜}
%       #include &lt;stdio.h&gt;
%       #include &lt;stdlib.h&gt;
%
%       int main(void)
%       {
%           printf("Hello World!\n");
%
%           return 0;
%       }
%     \end{codebox}
%   \end{Verbatim}
%
%   \begin{center}
%     \begin{minipage}{0.85\textwidth}
%       \codefile{ä»£ç&nbsp;ç›’å­æ&nbsp;‡é¢˜}{test.c}
%     \end{minipage}
%   \end{center}
%
% \subsection{\tn{codefile}å’Œ\tn{codefile*}å‘½ä»¤}
%
% \begin{function}[added=2021-12-25,updated=2021-12-25]{\codefile,\codefile*}
%   \begin{syntax}
%     \tn{codefile}  \oarg{å¤–è§‚é€‰é¡¹} \Arg{ç›’å­æ&nbsp;‡é¢˜} \Arg{ä»£ç&nbsp;æ–‡ä»¶}
%     \tn{codefile*} \oarg{å¤–è§‚é€‰é¡¹} \Arg{ç›’å­æ&nbsp;‡é¢˜} \Arg{ä»£ç&nbsp;æ–‡ä»¶}
%   \end{syntax}
%
%   ç”¨äºŽæŽ’ç‰ˆä»£ç&nbsp;ç›’å­ï¼Œæºä»£ç&nbsp;æ¥è‡ªäºŽ\Arg{ä»£ç&nbsp;æ–‡ä»¶}ï¼Œ
%   å¯ä»¥é€šè¿‡\Arg{ç›’å­æ&nbsp;‡é¢˜}ä¸ºä»£ç&nbsp;ç›’å­è®¾ç½®æ&nbsp;‡é¢˜ã€‚
%
%   \oarg{å¤–è§‚é€‰é¡¹}ä¸­é€šè¿‡key-valueæ–¹å¼è®¾ç½®ä»£ç&nbsp;ç›’å­å¤–è§‚ã€‚
%
%   æ˜Ÿå·å‘½ä»¤\texttt{codefile*}ç”¨äºŽä¸ºä»£ç&nbsp;ç›’å­æ·»åŠ&nbsp;åº•çº¿æ³¨é‡Šï¼Œ
%   æ­¤æ—¶ï¼Œéœ€è¦åœ¨\oarg{å¤–è§‚é€‰é¡¹}ä¸­ç”¨
%   \kvopt{\meta{comments}}{\meta{åº•çº¿æ³¨é‡Š}}é€‰é¡¹æä¾›\textbf{åº•çº¿æ³¨é‡Š}å†…å®¹ã€‚
%
%   ä»£ç&nbsp;ç›’å­çš„å¤–è§‚ä¹Ÿå¯ä»¥é€šè¿‡\tn{codeset}å‘½ä»¤çš„é€—å·åˆ†éš”
%   key-valueåˆ—è¡¨è¿›è¡Œè®¾ç½®ã€‚
% \end{function}
%
% \newpage
%   \begin{Verbatim}[frame=none,numbers=left,gobble=5]
%     \centering
%     \codefile{ä»£ç&nbsp;ç›’å­æ&nbsp;‡é¢˜}{test.c}
%   \end{Verbatim}
%
%   \begin{center}
%     \begin{minipage}{0.85\textwidth}
%       \codefile{ä»£ç&nbsp;ç›’å­æ&nbsp;‡é¢˜}{test.c}
%     \end{minipage}
%   \end{center}
%
% \subsection{\env{codeview}å’Œ\env{codeview*}çŽ¯å¢ƒ}
%
% \begin{function}[added=2021-12-26,updated=2021-12-26]{codeview,codeview*}
%   \begin{syntax}
%     \tn{begin}\{codeview\}\oarg{å¤–è§‚é€‰é¡¹}\Arg{ç›’å­æ&nbsp;‡é¢˜}
%     .....
%     \tn{end}\{codeview\}
%     \tn{begin}\{codeview*\}\oarg{å¤–è§‚é€‰é¡¹}\Arg{ç›’å­æ&nbsp;‡é¢˜}
%     .....
%     \tn{end}\{codeview*\}
%   \end{syntax}
%   ä½¿ç”¨çŽ¯å¢ƒå†…å®¹æŽ’ç‰ˆå¸¦ç¼–å·ä»£ç&nbsp;ç›’å­ã€‚
%   å¯ä»¥é€šè¿‡\Arg{ç›’å­æ&nbsp;‡é¢˜}ä¸ºä»£ç&nbsp;ç›’å­è®¾ç½®æ&nbsp;‡é¢˜ã€‚
%
%   \oarg{å¤–è§‚é€‰é¡¹}ä¸­é€šè¿‡key-valueæ–¹å¼è®¾ç½®ä»£ç&nbsp;ç›’å­å¤–è§‚ã€‚
%
%   æ˜Ÿå·çŽ¯å¢ƒ\texttt{codeview*}ç”¨äºŽä¸ºä»£ç&nbsp;ç›’å­æ·»åŠ&nbsp;åº•çº¿æ³¨é‡Šï¼Œ
%   æ­¤æ—¶ï¼Œéœ€è¦åœ¨\oarg{å¤–è§‚é€‰é¡¹}ä¸­ç”¨
%   \kvopt{\meta{comments}}{\meta{åº•çº¿æ³¨é‡Š}}é€‰é¡¹æä¾›\textbf{åº•çº¿æ³¨é‡Š}å†…å®¹ã€‚
%
%   ä»£ç&nbsp;ç›’å­çš„å¤–è§‚ä¹Ÿå¯ä»¥é€šè¿‡\tn{codeset}å‘½ä»¤çš„é€—å·åˆ†éš”
%   key-valueåˆ—è¡¨è¿›è¡Œè®¾ç½®ã€‚
% \end{function}
%
%   \begin{Verbatim}[frame=none,numbers=left,gobble=5]
%     \centering
%     \begin{codeview}{ä»£ç&nbsp;æ&nbsp;‡é¢˜}
%       #include &lt;stdio.h&gt;
%       #include &lt;stdlib.h&gt;
%
%       int main(void)
%       {
%           printf("Hello World!\n");
%
%           return 0;
%       }
%     \end{codeview}
%   \end{Verbatim}
%
%   \codeset{pretitle=ä»£ç&nbsp;}
%   \begin{center}
%     \begin{minipage}{0.85\textwidth}
%       \cvfile{ä»£ç&nbsp;æ&nbsp;‡é¢˜}{test.c}
%     \end{minipage}
%   \end{center}
%
% \subsection{\tn{cvfile}å’Œ\tn{cvfile*}å‘½ä»¤}
%
% \begin{function}[added=2021-12-26,updated=2021-12-26]{\cvfile,\cvfile*}
%   \begin{syntax}
%     \tn{cvfile}  \oarg{å¤–è§‚é€‰é¡¹} \Arg{ç›’å­æ&nbsp;‡é¢˜} \Arg{ä»£ç&nbsp;æ–‡ä»¶}
%     \tn{cvfile*} \oarg{å¤–è§‚é€‰é¡¹} \Arg{ç›’å­æ&nbsp;‡é¢˜} \Arg{ä»£ç&nbsp;æ–‡ä»¶}
%   \end{syntax}
%
%   ç”¨äºŽæŽ’ç‰ˆå¸¦ç¼–å·ä»£ç&nbsp;ç›’å­ï¼Œæºä»£ç&nbsp;æ¥è‡ªäºŽ\Arg{ä»£ç&nbsp;æ–‡ä»¶}ï¼Œ
%   å¯ä»¥é€šè¿‡\Arg{ç›’å­æ&nbsp;‡é¢˜}ä¸ºä»£ç&nbsp;ç›’å­è®¾ç½®æ&nbsp;‡é¢˜ã€‚
%
%   \oarg{å¤–è§‚é€‰é¡¹}ä¸­é€šè¿‡key-valueæ–¹å¼è®¾ç½®ä»£ç&nbsp;ç›’å­å¤–è§‚ã€‚
%
%   æ˜Ÿå·å‘½ä»¤\texttt{cvfile*}ç”¨äºŽä¸ºä»£ç&nbsp;ç›’å­æ·»åŠ&nbsp;åº•çº¿æ³¨é‡Šï¼Œ
%   æ­¤æ—¶ï¼Œéœ€è¦åœ¨\oarg{å¤–è§‚é€‰é¡¹}ä¸­ç”¨
%   \kvopt{\meta{comments}}{\meta{åº•çº¿æ³¨é‡Š}}é€‰é¡¹æä¾›\textbf{åº•çº¿æ³¨é‡Š}å†…å®¹ã€‚
%
%   ä»£ç&nbsp;ç›’å­çš„å¤–è§‚ä¹Ÿå¯ä»¥é€šè¿‡\tn{codeset}å‘½ä»¤çš„é€—å·åˆ†éš”
%   key-valueåˆ—è¡¨è¿›è¡Œè®¾ç½®ã€‚
% \end{function}
%
%   \begin{Verbatim}[frame=none,numbers=left,gobble=5]
%     \centering
%     \cvfile*[comments=è¿™æ˜¯ä¸€ä¸ªç®€å•çš„Cè¯­è¨€ä»£ç&nbsp;]{ä»£ç&nbsp;æ&nbsp;‡é¢˜}{test.c}
%   \end{Verbatim}
%
%   \begin{center}
%     \begin{minipage}{0.85\textwidth}
%       \cvfile*[comments=è¿™æ˜¯ä¸€ä¸ªç®€å•çš„Cè¯­è¨€ä»£ç&nbsp;]{ä»£ç&nbsp;æ&nbsp;‡é¢˜}{test.c}
%     \end{minipage}
%   \end{center}
%
% \section{é€‰é¡¹è¯´æ˜Ž}
%
%   \pkg{codebox}å®åŒ…æä¾›äº†ä¸€ç³»åˆ—é€‰é¡¹ï¼Œä»¥è®¾ç½®ä»£ç&nbsp;ç›’å­çš„å¤–è§‚æ&nbsp;·å¼ã€‚
%   è½½å…¥\pkg{codebox}å®åŒ…åŽï¼Œä»¥ä¸‹é€‰é¡¹å‡å¯é€šè¿‡ç”¨æˆ·æŽ¥å£å‘½ä»¤\tn{codeset}è¿›è¡Œè®¾ç½®ã€‚
%   å½“ç„¶ï¼Œè¿™äº›é€‰é¡¹ä¹Ÿå¯ä»¥é€šè¿‡å„ä¸ªçŽ¯å¢ƒæˆ–å‘½ä»¤çš„\oarg{å¤–è§‚é€‰é¡¹}è¿›è¡Œè®¾ç½®ã€‚
%
% \subsection{ä»£ç&nbsp;å¼•æ“Ž}
%
% \begin{function}[added=2021-12-26,updated=2021-12-26]{minted}
%   \begin{syntax}
%     minted = &lt;\TTF&gt; \init{true}
%   \end{syntax}
%   \opt{minted} ç”¨äºŽè®¾ç½®ä»£ç&nbsp;æŽ’ç‰ˆå¼•æ“Žï¼Œå¦‚ä¸º\textbf{true}åˆ™ä½¿ç”¨\pkg{minted}å®åŒ…
%   æŽ’ç‰ˆä»£ç&nbsp;ç›’å­ä¸­çš„å†…å®¹ï¼Œå¦‚ä¸º\textbf{false}åˆ™ä½¿ç”¨\pkg{listings}å®åŒ…æŽ’ç‰ˆ
%   ä»£ç&nbsp;ç›’å­ä¸­çš„å†…å®¹ã€‚é»˜è®¤å€¼ä¸º\textbf{true}ã€‚
% \end{function}
%
% \subsection{ä»£ç&nbsp;è¯­è¨€}
%
% \begin{function}[added=2021-12-26,updated=2021-12-26]{lang}
%   \begin{syntax}
%     lang = \Arg{ä»£ç&nbsp;è¯­è¨€} \init{c}
%   \end{syntax}
%   \opt{lang} ç”¨äºŽè®¾ç½®ä»£ç&nbsp;è¯­è¨€ï¼Œé»˜è®¤å€¼ä¸º\textbf{cè¯­è¨€}ã€‚
% \end{function}
%
% \subsection{ä»£ç&nbsp;åç§°}
%
% \begin{function}[added=2021-12-26,updated=2021-12-26]{pretitle}
%   \begin{syntax}
%     pretitle = \Arg{ä»£ç&nbsp;åç§°} \init{Code}
%   \end{syntax}
%   \opt{pretitle} ç”¨äºŽä»£ç&nbsp;ç¼–å·å‰çš„ä»£ç&nbsp;åç§°å‰ç¼€ï¼Œé»˜è®¤å€¼ä¸º\textbf{Code}ã€‚
% \end{function}
%
% \subsection{ä»£ç&nbsp;æ&nbsp;·å¼}
%
% \begin{function}[added=2021-12-26,updated=2021-12-26]{codestyle}
%   \begin{syntax}
%     codestyle = \Arg{ä»£ç&nbsp;æ&nbsp;·å¼} \init{codeblocks}
%   \end{syntax}
%   \opt{codestyle} ç”¨äºŽè®¾ç½®ä»£ç&nbsp;ç›’å­ä¸­ä»£ç&nbsp;çš„æ&nbsp;·å¼ï¼Œä»…å¯¹\textbf{minted}
%   å¼•æ“Žæœ‰æ•ˆï¼Œé»˜è®¤å€¼ä¸º\textbf{codeblocks}ã€‚
% \end{function}
%
% \subsection{ä»£ç&nbsp;å­—å·}
%
% \begin{function}[added=2021-12-26,updated=2021-12-26]{codesize}
%   \begin{syntax}
%     codesize = \Arg{å­—å·å‘½ä»¤} \init{\small}
%   \end{syntax}
%   \opt{codesize} ç”¨äºŽè®¾ç½®ä»£ç&nbsp;ç›’å­ä¸­ä»£ç&nbsp;çš„å­—å·ï¼Œä»…å¯¹\textbf{minted}
%   å¼•æ“Žæœ‰æ•ˆï¼Œé»˜è®¤å€¼ä¸º\textbf{\tn{small}}ã€‚
% \end{function}
%
% \subsection{åº•çº¿æ³¨é‡Šå†…å®¹}
%
% \begin{function}[added=2021-12-26,updated=2021-12-26]{comments}
%   \begin{syntax}
%     comments = \Arg{æ³¨é‡Šå†…å®¹} \init{æ—&nbsp;}
%   \end{syntax}
%   \opt{commentf} ç”¨äºŽè®¾ç½®ä»£ç&nbsp;ç›’å­åº•çº¿æ³¨é‡Šçš„å†…å®¹ï¼Œ
%   é»˜è®¤å€¼ä¸º\textbf{æ—&nbsp;}ã€‚
% \end{function}
%
% \subsection{åº•çº¿æ³¨é‡Šæ&nbsp;¼å¼}
%
% \begin{function}[added=2021-12-26,updated=2021-12-26]{commentf}
%   \begin{syntax}
%     commentf = \Arg{æ&nbsp;¼å¼å‘½ä»¤ç»„} \init{\small\sffamily}
%   \end{syntax}
%   \opt{commentf} ç”¨äºŽè®¾ç½®ä»£ç&nbsp;ç›’å­åº•çº¿æ³¨é‡Šçš„æ&nbsp;¼å¼ï¼Œ
%   é»˜è®¤å€¼ä¸º\textbf{\tn{small}\tn{sffamily}}ã€‚
% \end{function}
%
% \subsection{ä»£ç&nbsp;è¡Œè·}
%
% \begin{function}[added=2021-12-26,updated=2021-12-26]{codestretch}
%   \begin{syntax}
%     codestretch = \Arg{æµ®ç‚¹æ•°} \init{1.0}
%   \end{syntax}
%   \opt{codestretch} ç”¨äºŽè®¾ç½®ä»£ç&nbsp;ç›’å­å†…å®¹(ä»£ç&nbsp;)çš„è¡Œè·ï¼Œä»…å¯¹\textbf{minted}
%   å¼•æ“Žæœ‰æ•ˆï¼Œå–æµ®ç‚¹æ•°ã€‚é»˜è®¤å€¼ä¸º\textbf{1.0}ã€‚
% \end{function}
%
% \subsection{è¡Œå·é—´è·}
%
% \begin{function}[added=2021-12-26,updated=2022-1-28]{linenumsep}
%   \begin{syntax}
%     linenumsep = \Arg{æµ®ç‚¹æ•°} \init{1.80}
%   \end{syntax}
%   \opt{linenumsep} ç”¨äºŽè®¾ç½®ä»£ç&nbsp;ç›’å­è¡Œå·ä¸Žä»£ç&nbsp;çš„é—´è·ï¼Œä»…å¯¹\textbf{minted}
%   å¼•æ“Žæœ‰æ•ˆï¼Œå–æµ®ç‚¹æ•°ï¼Œå•ä½æ˜¯mmã€‚é»˜è®¤å€¼ä¸º\textbf{3.0}ã€‚
% \end{function}
%
% \changes{v1.0.3}{2022/1/4}{æ·»åŠ&nbsp;labelå¼•ç”¨æ&nbsp;‡ç­¾é€‰é¡¹çš„ä½¿ç”¨è¯´æ˜Ž}
%
% \subsection{å¼•ç”¨æ&nbsp;‡ç­¾}
%
% \begin{function}[added=2022-1-4,updated=2022-1-4]{label}
%   \begin{syntax}
%     label = \Arg{å¼•ç”¨æ&nbsp;‡ç­¾åç§°} \init{ç©º}
%   \end{syntax}
%   \opt{label} ç”¨äºŽè®¾ç½®å¸¦ç¼–å·ä»£ç&nbsp;ç›’å­çš„å¼•ç”¨æ&nbsp;‡ç­¾ï¼Œ
%   è¯¥é€‰é¡¹ä»…å¯¹\env{codeview}/\env{codeview*}çŽ¯å¢ƒ
%   æˆ–\tn{cvfile}/\tn{cvfile*}å‘½ä»¤æœ‰æ•ˆã€‚
%   é»˜è®¤å€¼ä¸º\textbf{ç©º}ã€‚
% \end{function}
%
% \changes{v1.0.2}{2021/12/28}{æ·»åŠ&nbsp;cvcounterä½¿ç”¨è¯´æ˜Ž}
%
% \section{è®¡æ•°å™¨}
%
% \begin{function}[added=2021-12-28,updated=2021-12-28]{cvcounter}
%   \pkg{codebox}å®åŒ…æä¾›äº†ä¸€ä¸ªè®¡æ•°å™¨\texttt{cvcounter}ï¼Œ
%   å½“ä½¿ç”¨å¸¦ç¼–å·çŽ¯å¢ƒ\env{codeview}/\env{codeview*}å’Œ
%   å‘½ä»¤\tn{cvfile}/\tn{cvfile*}æŽ’ç‰ˆä»£ç&nbsp;æ—¶ï¼Œå¯ä»¥ç”¨äºŽå¯¹ä»£ç&nbsp;ç›’å­è¿›è¡Œè®¡æ•°ã€‚
%   é»˜è®¤æƒ…å†µä¸‹ï¼Œå¦‚æžœå­˜åœ¨\texttt{thechapter}è®¡æ•°å™¨ï¼Œåˆ™å…¶çˆ¶è®¡æ•°å™¨è®¾ç½®ä¸º\texttt{chapter}
%   å¦åˆ™å°†æŒ‰å…¨æ–‡ç»Ÿä¸€è®¡æ•°ã€‚
%
%   å¯ä»¥ä½¿ç”¨ç±»ä¼¼\tn{renewcommand\{\tn{thecvcounter}\}\{\tn{thechapter.\tn{arabic\{cvcounter\}}}\}}
%   çš„å½¢å¼æ›´æ”¹ç¼–å·è¾“å‡ºå†…å®¹ã€‚
% \end{function}
%
% \newpage
% \section{æŽ’ç‰ˆæ&nbsp;·ä¾‹}
%
% \pkg{codebox}å®åŒ…å¯ç”¨äºŽéœ€è¦è¯­æ³•é«˜äº®ä»£ç&nbsp;æŽ’ç‰ˆåœºåˆï¼Œ
% ä»¥é¿å…ä½¿ç”¨ä»£ç&nbsp;æˆªå›¾ã€‚ä»£ç&nbsp;ç›’å­å¯ä»¥å¸¦/ä¸å¸¦åº•çº¿æ³¨é‡Šã€‚
%
% \subsection{Javaä»£ç&nbsp;}
% å¯ä»¥ä½¿ç”¨\tn{codeset}å‘½ä»¤è®¾ç½®ä»£ç&nbsp;è¯­è¨€ã€‚
%
%   \begin{Verbatim}[frame=none,numbers=left,gobble=5]
%     \centering
%     \codeset{lang=java}
%     \codefile{Javaä»£ç&nbsp;ç›’å­}{hellojava.java}
%   \end{Verbatim}
%
%   \begin{center}
%     \begin{minipage}{0.85\textwidth}
%       \codeset{lang=java}
%       \codefile{Javaä»£ç&nbsp;ç›’å­}{hellojava.java}
%     \end{minipage}
%   \end{center}
%
% \subsection{Pythonä»£ç&nbsp;}
% è¿˜å¯ä»¥ä½¿ç”¨çŽ¯å¢ƒæˆ–å‘½ä»¤çš„\oarg{å¤–è§‚é€‰é¡¹}è®¾ç½®ä»£ç&nbsp;è¯­è¨€ã€‚
% å½“ç„¶ï¼Œä¹Ÿå¯ä»¥é€šè¿‡ä½¿ç”¨\opt{label}é€‰é¡¹ä¸ºç¼–å·ä»£ç&nbsp;æ·»åŠ&nbsp;å¼•ç”¨æ&nbsp;‡ç­¾ï¼Œ
% å¹¶é€šè¿‡\tn{ref}å‘½ä»¤å¼•ç”¨è¯¥æ&nbsp;‡ç­¾ï¼Œå¦‚ä»£ç&nbsp;\ref{code-test}æ‰€ç¤ºã€‚
%
%   \begin{Verbatim}[frame=none,numbers=left,gobble=5]
%     \centering
%     \cvfile[lang=python,label=code-test]{Pythonä»£ç&nbsp;ç¤ºä¾‹}{hellopy.py}
%   \end{Verbatim}
%
%   \begin{center}
% %     \begin{minipage}{0.85\textwidth}
%       \cvfile[lang=python,label=code-test]{Pythonä»£ç&nbsp;ç¤ºä¾‹}{hellopy.py}
%     \end{minipage}
%   \end{center}
%
% \subsection{listingså¼•æ“Ž}
% åœ¨é€‰é¡¹ä¸­ä½¿ç”¨\kvopt{\meta{minted}}{\meta{false}}
% ä»¥ä½¿ç”¨\pkg{listings}å®åŒ…æŽ’ç‰ˆä»£ç&nbsp;ã€‚
%
%   \begin{Verbatim}[frame=none,numbers=left,gobble=5]
%     \centering
%     \cvfile[minted=false,lang=c]{Cè¯­è¨€ä»£ç&nbsp;ç¤ºä¾‹}{test.c}
%   \end{Verbatim}
%
%   \begin{center}
%     \begin{minipage}{0.85\textwidth}
%       \cvfile[minted=false,lang=c]{Cè¯­è¨€ä»£ç&nbsp;ç¤ºä¾‹}{test.c}
%     \end{minipage}
%   \end{center}
%
%
% \end{documentation}
%
% \StopEventually{}
%
% \begin{implementation}
%
% \section{ä»£ç&nbsp;å®žçŽ°}
%
% è¯¥å®åŒ…ä½¿ç”¨ \LaTeX3 è¯­æ³•ç¼–å†™ï¼Œä¾èµ– \pkg{expl3} çŽ¯å¢ƒï¼Œ
% å¹¶éœ€è°ƒç”¨ \pkg{l3packages}ã€\pkg{tcolorbox}ã€\pkg{minted}
% \pkg{listings}ã€\pkg{fontawesome5}ç­‰å®åŒ…ã€‚
%
% æŒ‰ç…§ \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;@@=codebox&gt;}} çš„ guardï¼Œ
% å®ƒä»¬ç”± \pkg{l3docstrip} å®šä¹‰ï¼Œç”¨æ¥æ&nbsp;‡è¯†åå­—ç©ºé—´ï¼ˆæ¨¡å—ï¼‰ã€‚
%
% \subsection{çŽ¯å¢ƒæ£€æµ‹ä¸Žå‡†å¤‡}
%
%    \begin{macrocode}
%&lt;*package&gt;
%&lt;@@=codebox&gt;
%    \end{macrocode}
%
% è½½å…¥å¿…è¦çš„\LaTeX3 å®åŒ…
%
%    \begin{macrocode}
\RequirePackage { xtemplate, l3keys2e, xparse }
%    \end{macrocode}
%
% \changes{v1.0.1}{2021/12/26}{åˆ&nbsp;é™¤åŽŸ\LaTeX3 ç‰ˆæœ¬æ£€æµ‹ä»£ç&nbsp;}
%
% \subsection{è½½å…¥å…¶å®ƒå®åŒ…}
%
% è½½å…¥\pkg{fontawesome5}ã€\pkg{tcolorbox}ã€\pkg{amssymb}ã€
% \pkg{xcolor}å®åŒ…
%
%    \begin{macrocode}
\RequirePackage {fontawesome5, tcolorbox, varwidth, xcolor, etoolbox}
%    \end{macrocode}
%
% è§£å†³Expl3ä¸­\pkg{tcolorbox}å’Œ\pkg{tikz}é™„åŠ&nbsp;åº“æ—&nbsp;æ³•åŠ&nbsp;è½½çš„
% çš„è¡¥ä¸(éœ€è¦\pkg{etoolbox}å®åŒ…æ”¯æŒ)
%
% \url{https://tex.stackexchange.com/questions/57424/using-of-usetikzlibrary-in-an-expl3-package-fails}
%
%    \begin{macrocode}
\ExplSyntaxOff
\patchcmd
{\tcb@input@library@in}
  {%
   \input\tcbpkgprefix#1\relax%
  }
  {%
    \@pushfilename
    \input\tcbpkgprefix#1\relax%
    \@popfilename
  }
  {}{}

\patchcmd
{\pgfutil@InputIfFileExists}
  {\input #1}
  {%
    \@pushfilename
    \xdef\@currname{#1}%
    \input #1 %
    \@popfilename
  }
  {}{}
\ExplSyntaxOn
%    \end{macrocode}
%
% \changes{v1.0.1}{2021/12/26}{minted2.6å‘å¸ƒï¼Œåˆ&nbsp;é™¤åŽŸè¡¥ä¸ä»£ç&nbsp;}
%
% è½½å…¥\pkg{tcolorbox}å’Œ\pkg{tikz}é™„åŠ&nbsp;åº“
%
%    \begin{macrocode}
\tcbuselibrary{skins, xparse, breakable}
\tcbuselibrary{minted,listings}
\usetikzlibrary{shapes.geometric}
%    \end{macrocode}
%
% \subsection{å®šä¹‰é¢œè‰²}
%
%    \begin{macrocode}
\definecolor{cvgrayc}{RGB}{247,247,247}
\definecolor{cvgray}{RGB}{220,220,220}
\definecolor{cvgrayb}{RGB}{153,153,153}
\definecolor{cvblue}{RGB}{223,238,255}
\definecolor{chengse}{RGB}{250,140,53}
%    \end{macrocode}
%
% \subsection{ä»£ç&nbsp;ç›’å­æ&nbsp;·å¼è®¾è®¡}
%
% ä»£ç&nbsp;ç›’å­langæ&nbsp;·å¼
%
%    \begin{macrocode}
\tcbset{%
  skin=enhanced,
  lang/.style={%
    breakable,%
    drop~shadow,%
    colframe=gray!75!black,%
    left=4.5mm,
    enhanced,%
    colframe=tcbcolback!60!black,%
    colback=white,%
    colbacktitle=tcbcolback!5!gray!10!white,%
    fonttitle=\bfseries,%
    coltitle=black,%
    attach~boxed~title~to~top~center={%
      yshift=-0.25mm-\tcboxedtitleheight/2,%
      yshifttext=2mm-\tcboxedtitleheight/2%
    },%
    attach~boxed~title~to~top~left={%
      xshift=1cm,%
      yshift*=1mm-\tcboxedtitleheight%
    },%
    varwidth~boxed~title*=-3cm,%
    boxed~title~style={%
      frame~code={%
        \path[fill=tcbcolback!30!black]([yshift=-1mm,xshift=-1mm]frame.north~west)%
          arc[start~angle=0,end~angle=180,radius=1mm]([yshift=-1mm,xshift=1mm]frame.north~east)%
          arc[start~angle=180,end~angle=0,radius=1mm];%
        \path[left~color=tcbcolback!60!black,right~color=tcbcolback!60!black,
          middle~color=tcbcolback!80!black]([xshift=-2mm]frame.north~west)%
          --([xshift=2mm]frame.north~east)[rounded~corners=1mm]%
          --([xshift=1mm,yshift=-1mm]frame.north~east)%
          --(frame.south~east)%
          --(frame.south~west)%
          --([xshift=-1mm,yshift=-1mm]frame.north~west)[sharp~corners]%
          --cycle;%
      },%
      interior~engine=empty%
    },%
    overlay={%
      \begin{tcbclipinterior}
        \fill[tcbcolback!80!black] (frame.south~west) rectangle
         ([xshift=5mm]frame.north~west);
      \end{tcbclipinterior}%
    },
  }%
}%
%    \end{macrocode}
%
% \changes{v1.0.4}{2022/1/28}{ä¿®è®¢åˆ†é¡µä»£ç&nbsp;ç›’å­æ—&nbsp;è¡Œå·åº•è‰²é—®é¢˜}
%
% ä»£ç&nbsp;ç›’å­cvæ&nbsp;·å¼
%
%    \begin{macrocode}
\tcbset{%
  skin=enhanced,
  cv/.style={
    boxrule=0.4mm,
    breakable,
    top=0mm,
    boxsep=1mm,
    drop~shadow,
    attach~boxed~title~to~top,
    colframe=blue!75!black,
    left=4.5mm,
    right=0mm,
    enhanced,
    colframe=tcbcolback!60!black,
    colback=white,
    colbacktitle=cvgray,
    fonttitle=\ttfamily,
    coltitle=black,
    underlay~boxed~title = {
      \begin{tcbclipinterior}
        \fill[cvblue] (frame.south~west) rectangle ([xshift=5.0mm,yshift=0mm]frame.north~west);
      \end{tcbclipinterior}
    },
    underlay~middle = {
      \begin{tcbclipinterior}
        \fill[cvblue] (frame.south~west) rectangle
          ([xshift=5.0mm,yshift=0mm]frame.north~west);
      \end{tcbclipinterior}
    },
    underlay~last = {
      \begin{tcbclipinterior}
        \fill[cvblue] (frame.south~west) rectangle
          ([xshift=5.0mm,yshift=0mm]frame.north~west);
      \end{tcbclipinterior}
    },
  }
}%
%    \end{macrocode}
%
% \subsection{å†…éƒ¨å˜é‡å£°æ˜Ž}
%
% \begin{variable}{\l_@@_minted_bool,
% \l_@@_comment_bool,
% \l_@@_language_tl,
% \l_@@_code_style_tl,
% \l_@@_code_fontsize_tl,
% \l_@@_code_name_tl,
% \l_@@_comment_contents_tl,
% \l_@@_comment_format_tl,
% \l_@@_label_name_tl,
% \l_@@_baseline_stretch_fp,
% \l_@@_linenumber_sep_fp
%  }
% å®šä¹‰å˜é‡ã€‚
%
% \changes{v1.0.3}{2022/1/4}{å¢žåŠ&nbsp;\tn{\_@@_label_name_tl}å˜é‡}
%
%    \begin{macrocode}
\bool_new:N   \l_@@_minted_bool
\bool_new:N   \l_@@_comment_bool

\tl_new:N     \l_@@_language_tl
\tl_new:N     \l_@@_code_style_tl
\tl_new:N     \l_@@_code_fontsize_tl
\tl_new:N     \l_@@_code_name_tl
\tl_new:N     \l_@@_comment_contents_tl
\tl_new:N     \l_@@_comment_format_tl
\tl_new:N     \l_@@_label_name_tl
\fp_new:N     \l_@@_baseline_stretch_fp
\fp_new:N     \l_@@_linenumber_sep_fp
%    \end{macrocode}
% \end{variable}
%
% \changes{v1.0.4}{2022/1/28}{ä¿®æ­£linenumsepä¸ºé»˜è®¤å€¼1.80ä»¥é¿å…3ä½è¡Œå·æº¢å‡ºè¾¹ç•Œ}
%
% \subsection{é€‰é¡¹å¤„ç†}
%
% å®šä¹‰ |codebox| é”®å€¼ç±»ã€‚
%    \begin{macrocode}
\keys_define:nn { codebox }
  {
%    \end{macrocode}
%
% \begin{macro}{minted}
% æ˜¯å¦ä½¿ç”¨mintedå®åŒ…æŽ’ç‰ˆä»£ç&nbsp;ï¼Œé»˜è®¤ä¸ºtrueã€‚
%    \begin{macrocode}
    minted .bool_set:N = \l_@@_minted_bool,
    minted .default:n = true,
    minted .initial:n = true,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{lang}
% è®¾ç½®æŽ’ç‰ˆä»£ç&nbsp;è¯­è¨€ï¼Œé»˜è®¤ä¸ºcã€‚
%    \begin{macrocode}
    lang .tl_set:N = \l_@@_language_tl,
    lang .initial:n = c,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{pretitle}
% ä»£ç&nbsp;åç§°å‰ç¼€
%    \begin{macrocode}
    pretitle .tl_set:N = \l_@@_code_name_tl,
    pretitle .initial:n = Code,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{codestyle}
% ä»£ç&nbsp;æ&nbsp;·å¼
%    \begin{macrocode}
    codestyle .tl_set:N = \l_@@_code_style_tl,
    codestyle .initial:n = default,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{codesize}
% ä»£ç&nbsp;å­—å·
%    \begin{macrocode}
    codesize .tl_set:N = \l_@@_code_fontsize_tl,
    codesize .initial:n = \small,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{comments}
% æ³¨é‡Šæ&nbsp;¼å¼
%    \begin{macrocode}
    comments .tl_set:N = \l_@@_comment_contents_tl,
    comments .initial:n = {},
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{commentf}
% æ³¨é‡Šæ&nbsp;¼å¼
%    \begin{macrocode}
    commentf .tl_set:N = \l_@@_comment_format_tl,
    commentf .initial:n = \small\sffamily,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{codestretch}
% åŸºçº¿ä¼¸å±•ç³»æ•°
%    \begin{macrocode}
    codestretch .code:n = { \fp_set:Nn \l_@@_baseline_stretch_fp { #1 }
                         },
    codestretch .initial:n = 1.0,
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{linenumsep}
% è¡Œå·ä¸Žæ–‡æœ¬ä¹‹é—´çš„è·ç¦»(å•ä½ï¼šmm)
%    \begin{macrocode}
    linenumsep .fp_set:N  = \l_@@_linenumber_sep_fp,
    linenumsep .initial:n = 1.80,
%    \end{macrocode}
% \end{macro}
%
% \changes{v1.0.3}{2022/1/4}{å¢žåŠ&nbsp;å¼•ç”¨æ&nbsp;‡ç­¾labelé€‰é¡¹}
%
% \begin{macro}{label}
% æ³¨é‡Šæ&nbsp;¼å¼
%    \begin{macrocode}
    label .tl_set:N = \l_@@_label_name_tl,
    label .initial:n = {},
%    \end{macrocode}
% \end{macro}
%
% å¤„ç†æœªçŸ¥é€‰é¡¹ã€‚
%    \begin{macrocode}
    unknown .code:n = { \@@_error:n { unknown-option } }
  }
\msg_new:nnn { codebox } { unknown-option }
  { package~ option~ "\l_keys_key_tl"~ is~ unknown. }
%    \end{macrocode}
%
% \subsection{é€‰é¡¹è®¾ç½®ç”¨æˆ·æŽ¥å£}
%
% \begin{macro}{\codeset}
%
% é€‰é¡¹è®¾ç½®ç”¨æˆ·æŽ¥å£ã€‚
%
%    \begin{macrocode}
\NewDocumentCommand \codeset { m }
  { \keys_set:nn { codebox } {#1} }
%    \end{macrocode}
% \end{macro}
%
% \subsection{å†…éƒ¨å‡½æ•°}
%
% \changes{v1.0.2}{2022/1/2}{ä¿®æ”¹æŒ‰ç«&nbsp;ç¼–å·æ—¶cvcounterçš„ç¼–å·æ–¹å¼}
%
% \begin{macro}{\@@_set_counter_parent:}
%
% è®¾ç½®ä»£ç&nbsp;ç¼–å·è®¡æ•°å™¨çš„çˆ¶è®¡æ•°å™¨ã€‚
%
%    \begin{macrocode}
\cs_new:Npn \@@_set_counter_parent:
  {
    \ifdef{\thechapter}
      {
        \newcounter{cvcounter}[chapter]%
        \renewcommand{\thecvcounter}{\thechapter.\arabic{cvcounter}}
      }{
        \newcounter{cvcounter}%[section]%
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v1.0.1}{2021/12/26}{è°ƒæ•´minted styleé€‰é¡¹ä¸ºå‚æ•°å®žçŽ°}
% \changes{v1.0.2}{2021/12/28}{å°†minted/listingsçš„å‚æ•°è®¾ç½®ç‹¬ç«‹ä¸ºå‡½æ•°}
%
% \begin{macro}{\@@_minted_engine_tcbset:n #1}
% è®¾ç½®ä»£ç&nbsp;ç›’å­mintedå®åŒ…å‚æ•°ã€‚
%
%    \begin{macrocode}
\cs_new:Npn \@@_minted_engine_tcbset:n #1
  {
    \tcbset{
      listing~engine=minted,%
      minted~style=#1,
      minted~options={%
        autogobble,
        breaklines,%
        fontsize=\tl_use:N \l_@@_code_fontsize_tl,%
        baselinestretch=\fp_eval:n { \l_@@_baseline_stretch_fp },
        breaksymbolleft={},%
        linenos,%
        numbersep=\fp_eval:n { \l_@@_linenumber_sep_fp }~mm,
      },%
      minted~language=\tl_use:N \l_@@_language_tl%
    }
  }
\cs_generate_variant:Nn \@@_minted_engine_tcbset:n {V}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_listings_engine_tcbset:}
% è®¾ç½®ä»£ç&nbsp;ç›’å­listingså®åŒ…å‚æ•°ã€‚
%
%    \begin{macrocode}
\cs_new:Npn \@@_listings_engine_tcbset:
  {
    \lstset{% general command to set parameter(s)
      basicstyle=\ttfamily\tl_use:N \l_@@_code_fontsize_tl, % print whole listing small
      keywordstyle=\color{chengse}\bfseries,%
      identifierstyle=, % nothing happens
      breaklines=true,
      commentstyle=\itshape\color{gray},
      stringstyle=\ttfamily, % typewriter type for strings
      numbers=left,%
      numberstyle=\tl_use:N \l_@@_code_fontsize_tl\sffamily\color[rgb]{0.5,0.5,1.0},%
    }%
    \tcbset{
      overlay={%
        \begin{tcbclipinterior}
          \fill[tcbcolback!80!black] (frame.south~west) rectangle
                                     ([xshift=5mm]frame.north~west);
        \end{tcbclipinterior}%
      },%
      listing~options={
        language=\tl_use:N \l_@@_language_tl,
        numbersep=\fp_eval:n { \l_@@_linenumber_sep_fp }~mm,
        %linebackgroundcolor={\ifodd\value{lstnumber}\color{cvgray}\fi}
      }
    }%
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_code_engine_tcbset:}
% è®¾ç½®ä»£ç&nbsp;ç›’å­å¼•æ“Žå®åŒ…å‚æ•°ã€‚
%
%    \begin{macrocode}
\cs_new:Npn \@@_code_engine_tcbset:
  {
    \bool_if:NTF \l_@@_minted_bool
      {
        \@@_minted_engine_tcbset:V \l_@@_code_style_tl
      }{
        \@@_listings_engine_tcbset:
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_comment_tcbset:}
% è®¾ç½®ä»£ç&nbsp;ç›’å­åº•çº¿æ³¨é‡Šã€‚
%
%    \begin{macrocode}
\cs_new:Npn \@@_comment_tcbset:
  {
    \bool_if:NTF { \l_@@_comment_bool }
    {
      \tcbset{%
        listing~and~comment,%
        colbacklower=tcbcolback!5!yellow!10!white,%
        collower=tcbcolback!60!black,%
        comment={\tl_use:N \l_@@_comment_format_tl~
                 \tl_use:N \l_@@_comment_contents_tl},%
      }
    }{
      \tcbset{ listing~only,}
    }
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v1.0.1}{2021/12/27}{ä¿®è®¢ä»£ç&nbsp;ç›’å­å‰å¤šä¸€ä¸ªé€—å·çš„é—®é¢˜}
% \changes{v1.0.4}{2022/1/28}{ä¿®æ”¹ç”¨æˆ·æŽ¥å£çš„{group_begin}åˆ°å¼€å§‹ä½ç½®}
%
% \subsection{ä¸è®¡æ•°ä»£ç&nbsp;ç›’å­ç”¨æˆ·æŽ¥å£}
%
%  å®šä¹‰ä¸å¸¦åº•çº¿æ³¨é‡Šçš„ä»£ç&nbsp;ç›’å­çŽ¯å¢ƒ\env{codebox}
%
%    \begin{macrocode}
\NewDocumentEnvironment{ codebox }{O{} m }
  {
    \group_begin:
    \bool_set_false:N  \l_@@_comment_bool
    \keys_set:nn { codebox } { #1 }
    \@@_code_engine_tcbset:
    \@@_comment_tcbset:
    \tcbset{lang, title={#2} }%
    \tcblisting{}
  }{
    \endtcblisting
    \group_end:
  }
%    \end{macrocode}
%
%  å®šä¹‰å¸¦åº•çº¿æ³¨é‡Šçš„ä»£ç&nbsp;ç›’å­çŽ¯å¢ƒ\env{codebox*}
%
%    \begin{macrocode}
\NewDocumentEnvironment{ codebox* }{O{} m }
  {
    \group_begin:
    \bool_set_false:N  \l_@@_comment_bool
    \keys_set:nn { codebox } { #1 }
    \@@_code_engine_tcbset:
    \@@_comment_tcbset:
    \tcbset{lang, title={#2} }%
    \tcblisting{}
  }{
    \endtcblisting
    \group_end:
  }
%    \end{macrocode}
%
%  å®šä¹‰å¸¦/ä¸å¸¦åº•çº¿æ³¨é‡Šçš„ä»Žæ–‡ä»¶è¯»å–å†…å®¹çš„å‘½ä»¤\tn{codefile}/\tn{codefile*}
%
%    \begin{macrocode}
\NewDocumentCommand \codefile { s O{} m m }
  {
    \group_begin:
    \IfBooleanTF{#1}
      {
        \bool_set_true:N  \l_@@_comment_bool
      }{
        \bool_set_false:N \l_@@_comment_bool
      }
    \keys_set:nn { codebox } { #2 }
    \@@_code_engine_tcbset:
    \@@_comment_tcbset:
    \tcbset{
      lang,
      title={#3},
      listing~file={#4},
    }%
    \tcbinputlisting{  }
    \group_end:
  }
%    \end{macrocode}
%
% \subsection{è®¡æ•°ä»£ç&nbsp;ç›’å­ç”¨æˆ·æŽ¥å£}
%
%  è®¾ç½®ä»£ç&nbsp;ç›’å­è®¡ç®—å™¨
%
%    \begin{macrocode}
\@@_set_counter_parent:
%    \end{macrocode}
%
% \changes{v1.0.2}{2021/12/28}{ä¸ºè®¡æ•°å™¨ä¸¤ç«¯æ·»åŠ&nbsp;\tn{nobreakspace}}
% \changes{v1.0.3}{2022/1/4}{ä¸ºå¸¦ç¼–å·ä»£ç&nbsp;ç›’å­æ·»åŠ&nbsp;å¼•ç”¨æ&nbsp;‡ç­¾é€‰é¡¹}
%
%  å®šä¹‰ä¸å¸¦åº•çº¿æ³¨é‡Šçš„ä»£ç&nbsp;ç›’å­çŽ¯å¢ƒ\env{codeview}
%
%    \begin{macrocode}
\DeclareTCBListing[use~counter=cvcounter]{codeviewaux}{m}
  {
    title={\tl_use:N \l_@@_code_name_tl\nobreakspace\thecvcounter\nobreakspace~#1},
  }
\NewDocumentEnvironment{ codeview }{O{} m }
  {
    \group_begin:
    \bool_set_false:N  \l_@@_comment_bool
    \keys_set:nn { codebox } { #1 }
    \@@_code_engine_tcbset:
    \@@_comment_tcbset:
    \tl_if_empty:NF \l_@@_label_name_tl
    {
      \tcbset{
        label=\tl_use:N \l_@@_label_name_tl,
      }
    }
    \tcbset{
      cv,
      overlay~unbroken~and~first ={
        \begin{tcbclipinterior}
          \node[inner~sep=0pt,anchor=north~east,yshift=-3pt,xshift=-5pt,text=cvgrayb]
            at (frame.north~east){
              \ttfamily\faFile*\ \faCode\ \faCodeBranch\ \faCopy\ \faExternalLink*\
              \MakeUppercase{\tl_use:N \l_@@_language_tl}
            };
        \end{tcbclipinterior}
      }
    }%
    \codeviewaux{#2}
  }{
    \endcodeviewaux
    \group_end:
  }
%    \end{macrocode}
%
%
%  å®šä¹‰å¸¦åº•çº¿æ³¨é‡Šçš„ä»£ç&nbsp;ç›’å­çŽ¯å¢ƒ\env{codeview*}
%
%    \begin{macrocode}
\NewDocumentEnvironment{ codeview* }{O{} m }
  {
    \group_begin:
    \bool_set_true:N  \l_@@_comment_bool
    \keys_set:nn { codebox } { #1 }
    \@@_code_engine_tcbset:
    \@@_comment_tcbset:
    \tl_if_empty:NF \l_@@_label_name_tl
    {
      \tcbset{
        label=\tl_use:N \l_@@_label_name_tl,
      }
    }
    \tcbset{
      cv,
      overlay~unbroken~and~first ={
        \begin{tcbclipinterior}
          \node[inner~sep=0pt,anchor=north~east,yshift=-3pt,xshift=-5pt,text=cvgrayb]
            at (frame.north~east){
              \ttfamily\faFile*\ \faCode\ \faCodeBranch\ \faCopy\ \faExternalLink*\ 
              \MakeUppercase{\tl_use:N \l_@@_language_tl}
            };
        \end{tcbclipinterior}
      }
    }%
    \codeviewaux{#2}
  }{
    \endcodeviewaux
    \group_end:
  }
%    \end{macrocode}
%
%  å®šä¹‰å¸¦/ä¸å¸¦åº•çº¿æ³¨é‡Šçš„ä»Žæ–‡ä»¶è¯»å–å†…å®¹çš„å‘½ä»¤\tn{cvfile}/\tn{cvfile*}
%
%    \begin{macrocode}
\DeclareTCBInputListing[use~counter=cvcounter]{\langfileaux}{m}
  {
    title={\tl_use:N \l_@@_code_name_tl\nobreakspace\thecvcounter\nobreakspace~#1},
  }
\NewDocumentCommand \cvfile { s O{} m m }
  {
    \group_begin:
    \IfBooleanTF{#1}
      {
        \bool_set_true:N  \l_@@_comment_bool
      }{
        \bool_set_false:N \l_@@_comment_bool
      }
    \keys_set:nn { codebox } { #2 }
    \@@_code_engine_tcbset:
    \@@_comment_tcbset:
    \tl_if_empty:NF \l_@@_label_name_tl
    {
      \tcbset{
        label=\tl_use:N \l_@@_label_name_tl,
      }
    }
    \tcbset{
      cv,
      listing~file={#4},
      overlay~unbroken~and~first ={
        \begin{tcbclipinterior}
          \node[inner~sep=0pt,anchor=north~east,yshift=-3pt,xshift=-5pt,text=cvgrayb]
            at (frame.north~east){
              \ttfamily\faFile*\ \faCode\ \faCodeBranch\ \faCopy\ \faExternalLink*\ 
              \MakeUppercase{\tl_use:N \l_@@_language_tl}
            };
        \end{tcbclipinterior}
      }
    }%
    \langfileaux{#3}
    \group_end:
  }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/package&gt;
%    \end{macrocode}
%
% \end{implementation}
%
% \Finale
%
\endinput
</pre></body></html>