<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \iffalse meta-comment
% !TeX program  = XeLaTeX
% !TeX encoding = UTF-8
%&lt;*internal&gt;
\iffalse
%&lt;/internal&gt;
%&lt;*readme&gt;
wrapstuff
=========

The `wrapstuff` package provides another implementation of text wrapping.
Its implementation benefits from the paragraph hooks available since
LaTeX 2021-06-01.

Basic Usage
-----------
The package only provides a user environment `wrapstuff`.

    \begin{wrapstuff}[&lt;options&gt;]
      &lt;wrapping stuff&gt;
    \end{wrapstuff}
    &lt;main text&gt;

You can read the package manual (in Chinese) for some explanations.

Contributing
------------
The package is still highly experimental and not fully tested.
[Issues](https://github.com/qinglee/wrapstuff/issues) and
[pull requests](https://github.com/qinglee/wrapstuff/pulls)
are always welcome.

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

    Copyright (C) 2022 by Qing Lee &lt;sobenlee@gmail.com&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 Qing Lee.

    This package consists of the file  wrapstuff.dtx,
                 and the derived files wrapstuff.pdf,
                                       wrapstuff.sty,
                                       wrapstuff.ins and
                                       README.md (this file).
%&lt;/readme&gt;
%&lt;*internal&gt;
\fi
\begingroup
  \def\temp{LaTeX2e}
\expandafter\endgroup\ifx\temp\fmtname\else
\csname fi\endcsname
%&lt;/internal&gt;
%&lt;*install&gt;

\input ctxdocstrip %

\preamble

    Copyright (C) 2022 by Qing Lee &lt;sobenlee@gmail.com&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 Qing Lee.

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

\endpreamble

\postamble

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

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

\endbatchfile
%&lt;/install&gt;
%&lt;*internal&gt;
\fi
%&lt;/internal&gt;
%&lt;package&gt;\NeedsTeXFormat{LaTeX2e}[2021-06-01]
%&lt;package&gt;\@ifundefined{ExplLoaderFileDate}{\RequirePackage{expl3}}{}
%&lt;+package&gt;\GetIdInfo$Id: wrapstuff.dtx 3be38c0 2022-08-05 21:01:02 +0800 Qing Lee &lt;sobenlee@gmail.com&gt; $
%&lt;package&gt;  {Wrapping text around stuff}
%&lt;package&gt;\ProvidesExplPackage{\ExplFileName}
%&lt;package&gt;  {\ExplFileDate}{0.3}{\ExplFileDescription}
%&lt;*driver&gt;
\documentclass{ctxdoc}
\usepackage{wrapstuff}
\usepackage{graphicx}
\usepackage{zhlipsum}
\ExplSyntaxOn
\makeatletter
\DeclareDocumentCommand \gitsha { m }
  {
    \href { https \c_colon_str //github.com/qinglee/wrapstuff/commit/#1 }
          { rev. ~ \texttt{#1} }
  }
\DeclareDocumentCommand \QIANZIWEN { }
  {
    å¤©åœ°çŽ„é»„å®‡å®™æ´ªè’æ—¥æœˆç›ˆæ˜ƒè¾°å®¿åˆ—å¼&nbsp;
    å¯’æ¥æš‘å¾€ç§‹æ”¶å†¬è—é—°é¦€æˆå²å¾‹å¬è°ƒé˜³ \par
    äº‘è…¾è‡´é›¨éœ²ç»“ä¸ºéœœé‡‘ç”Ÿä¸½æ°´çŽ‰å‡ºæ˜†å†ˆ \par
  }
\DeclareDocumentCommand \ADDSPECEIALKEY { m }
  {
    \cs_gset_eq:NN \@@_codedoc_names_typeset_save:
                   \__codedoc_names_typeset:
    \cs_gset_protected:Npn \__codedoc_names_typeset:
      {
        \cs_gset_eq:NN \__codedoc_names_typeset:
                       \@@_codedoc_names_typeset_save:
        \__codedoc_names_typeset:
        #1 \\
      }
  }
\DeclareDocumentCommand \IMAGE { m m }
  { \includegraphics [ width = \dim_eval:n {#1} ] { example-image-#2.pdf } }
\tl_put_left:Nn \Example
  { \trivlist \item \relax }
\tl_put_right:Nn \endExample
  { \endtrivlist }
\SideBySideExampleSet { numbers = none }
\makeatother
\ExplSyntaxOff
\begin{document}
  \DocInput{\jobname.dtx}
  \IndexLayout
  \PrintChanges
  \PrintIndex
\end{document}
%&lt;/driver&gt;
% \fi
%
% \CheckSum{3127}
%
% \changes{v0.1}{2022/07/05}{åˆå§‹ç‰ˆæœ¬ã€‚}
% \changes{v0.1}{2022/07/20}{é¦–æ¬¡æäº¤åˆ° CTAN å‘å¸ƒã€‚}
% \changes{v0.2}{2022/07/21}{æ”¹è¿›æ”¾ç½®æ–¹å¼ã€‚}
%
% \GetFileId{wrapstuff.sty}
%
% \title{\bfseries\pkg{wrapstuff} å®åŒ…}
% \author{æŽæ¸…}
% \date{\filedate\qquad\fileversion\thanks{\gitsha{\ExplFileVersion}.}}
% \maketitle
%
% \begin{documentation}
%
% \section{åŸºæœ¬ç”¨æ³•}
%
% \pkg{wrapstuff} å®åŒ…æä¾›äº†å›¾æ–‡ç»•æŽ’çš„å¦ä¸€ç§å®žçŽ°ã€‚
% \pkg{wrapstuff} å°è¯•æ•´åˆå’Œæ‰©å±• \pkg{picinpar}ã€\pkg{floatflt}ã€\pkg{wrapfig}ã€
% \pkg{cutwin} å’Œ \pkg{wrapfig2} ç­‰åŒç±»å®åŒ…çš„åŠŸèƒ½ã€‚
% æœ¬å®åŒ…å…¼å®¹ \pkg{caption}ã€\pkg{float} å’Œ \pkg{floatrow} ç­‰å®åŒ…ï¼Œ
% å¹¶è¯•å›¾å…¼å®¹æ˜¾ç¤ºï¼ˆdisplayï¼‰æ•°å­¦å…¬å¼å’Œå„ç§ \LaTeX\ åˆ—è¡¨çŽ¯å¢ƒï¼Œå¯ä»¥è®©ä»–ä»¬æ­£ç¡®ç»•æŽ’ã€‚
%
% \pkg{wrapstuff} çš„å®žçŽ°ä¾èµ– \LaTeX\ 2021-06-01 å¼€å§‹æä¾›çš„æ®µè½é’©å­ï¼Œ
% å¹¶ä¾èµ– \LaTeXiii\ 2022-04-10 ä¹‹åŽçš„ç‰ˆæœ¬ã€‚
%
% \begin{function}{wrapstuff}
%   \begin{syntax}
%     \tn{begin}\{wrapstuff\}\oarg{é€‰é¡¹}
%       &lt;ç»•æŽ’å†…å®¹&gt;
%     \tn{end}\{wrapstuff\}
%     &lt;æ­£æ–‡&gt;
%   \end{syntax}
%   \pkg{wrapstuff} åªæä¾›äº†ä¸€ä¸ªç”¨æˆ·çŽ¯å¢ƒ \env{wrapstuff}ï¼Œ
%   ä¼šåœ¨çŽ¯å¢ƒä¹‹åŽçš„æ®µè½å¼€å§‹ç»•æŽ’ã€‚ä¾‹å¦‚
%   \begin{Example}[frame=single,numbers=none,gobble=5]
%     \begin{wrapstuff}[c,top=1]
%       \includegraphics[width=\dimeval{\linewidth/3}]{example-image.pdf}
%     \end{wrapstuff}
%     \zhlipsum[1][name=zhufu]
%   \end{Example}
% \end{function}
%
% \begin{function}{\wrapstuffset}
%   \begin{syntax}
%     \tn{wrapstuffset} \Arg{é€‰é¡¹åˆ—è¡¨}
%   \end{syntax}
%   \pkg{wrapstuff} çš„é€‰é¡¹å¯ä»¥åœ¨è°ƒç”¨å®åŒ…æ—¶è®¾ç½®ï¼Œä¹Ÿå¯ä»¥é€šè¿‡ \tn{wrapstuffset} è®¾ç½®ã€‚
%   é€‰é¡¹å°†åœ¨ä¸‹é¢æè¿°ã€‚
% \end{function}
%
% \ADDSPECEIALKEY{\textrm{\meta{n}}}
% \begin{function}{top}
%   \begin{syntax}
%     top = &lt;éžè´Ÿæ•´æ•°&gt;
%   \end{syntax}
%   è®¾ç½®åœ¨æ­£æ–‡æ®µè½çš„ç¬¬å‡&nbsp;è¡Œä¹‹åŽå¼€å§‹ç»•æŽ’ï¼Œå¯ä»¥è®¾ç½®ä¸ºéžè´Ÿæ•´æ•°ã€‚
%   éžè´Ÿæ•´æ•°é€‰é¡¹ \meta{n} æ˜¯è®¾ç½®é€‰é¡¹ \opt{top} ä¸º \meta{n} çš„ç¼©å†™å½¢å¼ã€‚
%   åˆå§‹å€¼æ˜¯ \num{0}ã€‚
% \end{function}
%
% \begin{function}{width}
%   \begin{syntax}
%     width = &lt;å®½åº¦&gt;
%   \end{syntax}
%   è®¾ç½®ç»•æŽ’å†…å®¹çš„å®½åº¦ï¼Œåˆå§‹å€¼ä¸º \qty{0}{pt}ï¼Œä»£è¡¨è‡ªç„¶å®½åº¦ã€‚
%   æ­¤æ—¶ï¼Œ\env{wrapstuff} çŽ¯å¢ƒå†…çš„å†…å®¹åªèƒ½æœ‰ä¸€è¡Œï¼Œä¸èƒ½ä½¿ç”¨ |\\| æ¢è¡Œæˆ–è€… \tn{par} åˆ†æ®µã€‚
%   å¦‚æžœéœ€è¦åœ¨çŽ¯å¢ƒå†…æ¢è¡Œæˆ–è€…åˆ†æ®µï¼Œå°±éœ€è¦å°† \opt{width} è®¾ç½®æˆåˆé€‚çš„å®½åº¦ã€‚
% \end{function}
%
% \begin{function}{height}
%   \begin{syntax}
%     height = &lt;é«˜åº¦&gt;
%   \end{syntax}
%   è®¾ç½®ç»•æŽ’å†…å®¹çš„é«˜åº¦ï¼Œåˆå§‹å€¼ä¸º \qty{0}{pt}ï¼Œä»£è¡¨è‡ªç„¶é«˜åº¦ã€‚
% \end{function}
%
% \begin{function}{lines}
%   \begin{syntax}
%     lines = &lt;æ­£æ•´æ•°&gt;
%   \end{syntax}
%   è®¾ç½®ç»•æŽ’å†…å®¹å&nbsp;æ®æ­£æ–‡çš„è¡Œæ•°ï¼Œå¯ä»¥è®¾ç½®æ­£æ•´æ•°ã€‚
%   åˆå§‹å€¼ä¸ºç©ºï¼Œæ&nbsp;¹æ®ç»•æŽ’å†…å®¹çš„é«˜åº¦è‡ªåŠ¨è®¡ç®—è¡Œæ•°ã€‚
% \end{function}
%
% \begin{function}{linewidth}
%   \begin{syntax}
%     linewidth = &lt;å®½åº¦&gt;
%   \end{syntax}
%   è®¾ç½®æ­£æ–‡æ®µè½çš„è¡Œå®½ï¼Œåˆå§‹è®¾ç½®ä¸º |\linewidth|ï¼Œä¸€èˆ¬ä¸éœ€è¦è°ƒæ•´ã€‚
% \end{function}
%
% \begin{function}{l,r,c,i,o,ratio}
%   \begin{syntax}
%     l/r/c/i/o
%     ratio = &lt;å®žæ•°&gt;
%   \end{syntax}
%   è¿™äº›é€‰é¡¹ç”¨äºŽè®¾ç½®ç»•æŽ’å†…å®¹ä½äºŽæ­£æ–‡ä¸­çš„ä½ç½®ã€‚
%   é€‰é¡¹ \opt{l/r/c/i/o} åˆ†åˆ«è®¾ç½®ç»•æŽ’å†…å®¹ä½äºŽæ­£æ–‡çš„å·¦ä¾§ã€å³ä¾§ã€ä¸­é—´ã€å†…ä¾§ã€å¤–ä¾§ã€‚
%   é€‰é¡¹ \opt{ratio} è®¾ç½®ç»•æŽ’å†…å®¹å·¦ä¾§çš„æ­£æ–‡å&nbsp;æ®è¡Œå®½çš„æ¯”ä¾‹ï¼Œå¯ä»¥è®¾ç½®ä¸º $[0,1]$ åŒºé—´ä¸­çš„åˆç†å®žæ•°ã€‚
%   é€‰é¡¹ \opt{i/o} å¯ä»¥ä¸Ž \opt{ratio} ä¸€èµ·ä½¿ç”¨ï¼Œè¿™æ—¶è®¾ç½®çš„æ˜¯å†…/å¤–ä¾§æ­£æ–‡çš„è¡Œå®½æ¯”ä¾‹ã€‚
%   åˆå§‹è®¾ç½®ä¸º |r|ï¼Œå³ä½äºŽæ­£æ–‡çš„å³ä¾§ã€‚
% \end{function}
%
% \begin{function}{column}
%   \begin{syntax}
%     column = &lt;(true)|false|par&gt;
%   \end{syntax}
%   æŽ§åˆ¶æ˜¯å¦å°†ç»•æŽ’å†…å®¹ä¸¤ä¾§çš„æ­£æ–‡åˆ†æ&nbsp;æ˜¾ç¤ºï¼Œåªæœ‰è®¾ç½® |c| é€‰é¡¹æˆ–è€…
%   è®¾ç½® \opt{ratio} ä¸ç­‰äºŽ $0$ æˆ–è€… $1$ æ—¶æ‰æœ‰æ•ˆã€‚
%   \opt{false} è¡¨ç¤ºä¸åˆ†æ&nbsp;ï¼Œæ­£æ–‡æ–‡å­—æ–¹å‘å§‹ç»ˆä¿æŒä»Žå·¦åˆ°å³çš„é¡ºåºï¼›
%   \opt{par} è¡¨ç¤ºä»¥æ®µè½ä¸ºå•ä½è¿›è¡Œåˆ†æ&nbsp;ï¼Œå¦‚ä¸‹ç¤ºä¾‹ã€‚
%   \begin{SideBySideExample}[xrightmargin=\dimeval{20em+5mm}]
%     \begin{wrapstuff}[c,1]
%       \IMAGE{2em}{a}
%     \end{wrapstuff}
%     \QIANZIWEN
%     \begin{wrapstuff}[c,1,column=par]
%       \IMAGE{2em}{b}
%     \end{wrapstuff}
%     \QIANZIWEN
%     \begin{wrapstuff}[c,0,column=false]
%       \IMAGE{2em}{c}
%     \end{wrapstuff}
%     \QIANZIWEN
%   \end{SideBySideExample}
% \end{function}
%
% \begin{function}{leftsep,rightsep,hsep}
%   \begin{syntax}
%     leftsep  = &lt;é•¿åº¦&gt;
%     rightsep = &lt;é•¿åº¦&gt;
%     hsep     = &lt;é•¿åº¦&gt;
%   \end{syntax}
%   è®¾ç½®ç»•æŽ’å†…å®¹ä¸Žæ­£æ–‡çš„å·¦/å³é—´è·ï¼Œé€‰é¡¹ \opt{hsep} åŒæ—¶è®¾ç½® \opt{leftsep} å’Œ \opt{rightsep}ã€‚
%   åˆå§‹å€¼æ˜¯ \qty{1}{em}ã€‚
% \end{function}
%
% \begin{function}{abovesep,belowsep,vsep}
%   \begin{syntax}
%     abovesep = &lt;é•¿åº¦&gt;
%     belowsep = &lt;é•¿åº¦&gt;
%     vsep     = &lt;é•¿åº¦&gt;
%   \end{syntax}
%   è®¾ç½®ç»•æŽ’å†…å®¹ä¸Žæ­£æ–‡çš„ä¸Š/ä¸‹é—´è·ï¼Œé€‰é¡¹ \opt{vsep} åŒæ—¶è®¾ç½® \opt{abovesep} å’Œ \opt{belowsep}ã€‚
%   åˆå§‹å€¼æ˜¯ \qty{0}{pt}ã€‚
% \end{function}
%
% \begin{function}{hoffset}
%   \begin{syntax}
%     hoffset = &lt;é•¿åº¦&gt;
%   \end{syntax}
%   è®¾ç½®ç»•æŽ’å†…å®¹ä¼¸å‡ºæ­£æ–‡ç‰ˆå¿ƒçš„é•¿åº¦ã€‚
%   å½“è®¾ç½®äº†é€‰é¡¹ \opt{c} æˆ–è€…é€‰é¡¹ \opt{ratio} çš„å€¼ä½äºŽ $(0,1)$ æ—¶ï¼Œæœ¬é€‰é¡¹æ—&nbsp;æ•ˆã€‚
%   ä¸€ä¸ªç‰¹æ®Šå€¼ \tn{width} ç”¨äºŽè¡¨ç¤ºç»•æŽ’å†…å®¹å’Œç›¸åº”é—´è·çš„æ€»å®½åº¦ï¼Œ
%   å¯ä»¥å°† \opt{hoffset} è®¾ç½®ä¸º \tn{width}ï¼Œå®Œå…¨ä¼¸å‡ºç‰ˆå¿ƒã€‚
%   åˆå§‹å€¼ä¸º \qty{0}{pt}ã€‚
% \end{function}
%
% \begin{function}{voffset}
%   \begin{syntax}
%     voffset = &lt;é•¿åº¦&gt;
%   \end{syntax}
%   ç”¨äºŽè°ƒæ•´ç»•æŽ’å†…å®¹çš„ç«–ç›´ä½ç½®ï¼Œåˆå§‹å€¼ä¸º \qty{0}{pt}ã€‚
% \end{function}
%
% \begin{function}{type}
%   \begin{syntax}
%     type = &lt;æµ®åŠ¨ä½“ç±»åž‹&gt;
%   \end{syntax}
%   è®¾ç½®ç»•æŽ’å†…å®¹çš„æµ®åŠ¨ä½“ç±»åž‹ï¼Œåˆå§‹å€¼ä¸ºç©ºã€‚
%   å¦‚æžœéœ€è¦åœ¨ \env{wrapstuff} çŽ¯å¢ƒä¸­ä½¿ç”¨ \tn{caption} å‘½ä»¤ï¼Œ
%   åˆ™éœ€è¦è®¾ç½® \opt{type} ä¸º \opt{figure} æˆ– \opt{table} ç­‰ç±»åž‹ï¼Œ
%   å¹¶éœ€è¦åŒæ—¶è®¾ç½® \opt{width} æŒ‡å®šå®½åº¦ã€‚
%   \begin{SideBySideExample}[xrightmargin=\dimeval{18em+5mm}]
%     \begin{wrapstuff}[type=figure,width=5em]
%       \centering
%       \IMAGE{4em}{plain}
%       \caption{ç¤ºä¾‹}
%     \end{wrapstuff}
%     \QIANZIWEN
%   \end{SideBySideExample}
% \end{function}
%
% \begin{function}{\wrapstuffclear}
%   å¦‚æžœå½“å‰æ­£æ–‡æ®µè½çš„è¡Œæ•°ä¸å¤Ÿï¼Œ\pkg{wrapstuff} çš„ä½œç”¨ä¼šå»¶ç»­åˆ°ä¸‹ä¸€æ®µã€‚
%   è¿™å¯èƒ½ä¼šå¯¼è‡´æŸäº›æ„å¤–ç»“æžœï¼Œå¯ä»¥åœ¨ä¸‹ä¸€æ®µä¹‹å‰å¯ç”¨å‘½ä»¤ \tn{wrapstuffclear} æ¶ˆé™¤å½±å“ã€‚
% \end{function}
%
% \end{documentation}
%
%
% \StopEventually{}
%
%
%\begin{implementation}
%
% \section{ä»£ç&nbsp;å®žçŽ°}
%
%    \begin{macrocode}
%&lt;*package&gt;
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;@@=wstf&gt;
%    \end{macrocode}
%
% \pkg{wrapstuff} çš„å®žçŽ°ä¾èµ– \LaTeX\ 2021-06-01 å¼€å§‹æä¾›çš„æ®µè½é’©å­ã€‚
%    \begin{macrocode}
\@ifl@t@r \fmtversion { 2021-06-01 }
  { }
  {
    \msg_new:nnn { wrapstuff } { latex-too-old }
      {
        You~need~to~update~your~LaTeX~to~the~latest~release. \\
        Loading~wrapstuff~will~abort!
      }
    \msg_critical:nn { wrapstuff } { latex-too-old }
  }
%    \end{macrocode}
%
% ç”±äºŽä½¿ç”¨äº† \cs{keys_precompile:nnN}ï¼Œéœ€è¦æ¯”è¾ƒæ–°çš„ \LaTeXiiiã€‚
%    \begin{macrocode}
\@ifl@t@r \ExplLoaderFileDate { 2022-04-10 }
  { }
  {
    \msg_new:nnn { wrapstuff } { latex3-too-old }
      {
        You~need~to~update~your~installation~of~the~bundles~
        "l3kernel"~and~"l3packages". \\
        Loading~wrapstuff~will~abort!
      }
    \msg_critical:nn { wrapstuff } { latex3-too-old }
  }
%    \end{macrocode}
%
%    \begin{macrocode}
\prop_gput:Nnn \g_msg_module_name_prop { wstf } { wrapstuff }
%    \end{macrocode}
%
% \begin{macro}[var]{
%   \c_@@_global_tl_tl,
%   \c_@@_global_dim_tl,
%   \c_@@_global_int_tl,
%   \c_@@_global_bool_tl}
% ä¸€äº›éœ€è¦å…¨å±€è®¾ç½®çš„å˜é‡ã€‚
%    \begin{macrocode}
\tl_const:Nn \c_@@_global_tl_tl
  { \g_@@_main_setting_tl }
\tl_const:Nn \c_@@_global_dim_tl
  {
    \g_@@_hang_ht_dim
    \g_@@_total_ht_dim
    \g_@@_stuff_ht_dim
    \g_@@_stuff_wd_dim
    \g_@@_first_dp_dim
    \g_@@_first_sep_dim
    \g_@@_prevdepth_dim
    \g_@@_column_ht_dim
    \g_@@_window_ht_dim
    \g_@@_remaining_dim
    \g_@@_column_room_dim
    \g_@@_parshape_indent_dim
    \g_@@_parshape_length_dim
  }
\tl_const:Nn \c_@@_global_int_tl
  {
    \g_@@_top_int
    \g_@@_column_int
    \g_@@_window_int
  }
\tl_const:Nn \c_@@_global_bool_tl
  {
    \g_@@_next_bool
    \g_@@_leqno_bool
    \g_@@_column_bool
    \g_@@_entire_bool
    \g_@@_display_bool
    \g_@@_move_hang_bool
    \g_@@_next_hang_bool
    \g_@@_first_set_bool
    \g_@@_first_save_bool
    \g_@@_right_move_bool
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{
%   \@@_tl_init:N,
%   \@@_dim_init:N,
%   \@@_int_init:N,
%   \@@_bool_init:N}
% å…¨å±€å˜é‡çš„åˆå§‹åŒ–ï¼Œæ³¨æ„ä¿å­˜å¥½æ¸…é™¤å’Œæ¢å¤çš„è®¾ç½®ã€‚
%    \begin{macrocode}
\cs_new_protected:Npn \@@_tl_init:N #1
  {
    \tl_new:N #1
    \tl_gput_right:Nn \g_@@_var_clear_tl
      { \tl_gclear:N #1 }
    \tl_gput_right:Nn \g_@@_var_push_tl
      { \tl_gset:Nn \exp_not:N #1 { \exp_not:o {#1} } }
  }
\cs_new_protected:Npn \@@_dim_init:N #1
  {
    \dim_new:N #1
    \tl_gput_right:Nn \g_@@_var_clear_tl
      { \dim_gzero:N #1 }
    \tl_gput_right:Nn \g_@@_var_push_tl
      { \dim_gset:Nn #1 { \dim_use:N #1 } }
  }
\cs_new_protected:Npn \@@_int_init:N #1
  {
    \int_new:N #1
    \tl_gput_right:Nn \g_@@_var_clear_tl
      { \int_gzero:N #1 }
    \tl_gput_right:Nn \g_@@_var_push_tl
      { \int_gset:Nn #1 { \int_use:N #1 } }
  }
\cs_new_protected:Npn \@@_bool_init:N #1
  {
    \bool_new:N #1
    \tl_gput_right:Nn \g_@@_var_clear_tl
      { \bool_gset_false:N #1 }
    \tl_gput_right:Nn \g_@@_var_push_tl
      {
        \bool_if:NTF #1
          { \bool_gset_true:N  #1 }
          { \bool_gset_false:N #1 }
      }
  }
\tl_new:N \g_@@_var_clear_tl
\tl_new:N \g_@@_var_push_tl
\tl_map_function:NN \c_@@_global_tl_tl   \@@_tl_init:N
\tl_map_function:NN \c_@@_global_dim_tl  \@@_dim_init:N
\tl_map_function:NN \c_@@_global_int_tl  \@@_int_init:N
\tl_map_function:NN \c_@@_global_bool_tl \@@_bool_init:N
%    \end{macrocode}
% \cs{g_@@_top_int} çš„åˆå§‹å€¼æ˜¯ $-1$ã€‚
%    \begin{macrocode}
\int_gdecr:N \g_@@_top_int
\tl_gput_right:Nn \g_@@_var_clear_tl
  { \int_gdecr:N \g_@@_top_int }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{
%   \@@_clear:,
%   \@@_clear_variable:,
%   \@@_clear_kludge:,
%   \@@_clear_stuff_box:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_clear:
  {
    \@@_clear_para_hook:
    \@@_clear_kludge:
    \@@_clear_variable:
  }
\cs_new_protected_nopar:Npn \@@_clear_variable:
  {
    \tl_use:N \g_@@_var_clear_tl
    \box_gclear:N \g_@@_stuff_box
  }
\cs_new_protected_nopar:Npn \@@_clear_kludge:
  {
    \bool_if:NTF \g_@@_next_bool
      {
        \skip_vertical:n
          { \tex_baselineskip:D * \g_@@_window_int }
      }
      {
        \box_if_empty:NF \g_@@_stuff_box
          { \@@_clear_stuff_box: }
      }
  }
\cs_new_protected_nopar:Npn \@@_clear_stuff_box:
  {
    \@@_ignore_depth:
    \skip_set:Nn \l_@@_last_skip
      { \box_dp:N \strutbox }
    \skip_vertical:N \l_@@_last_skip
    \box_use_drop:N \g_@@_stuff_box
    \skip_vertical:N \l_@@_last_skip
    \@@_ignore_depth:
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{
%   \@@_status_push:,
%   \@@_status_pop:,
%   \@@_status_restore:,
%   \@@_status_clear:}
% å…¨å±€å˜é‡çš„ä¿å­˜ä¸Žæ¢å¤ã€‚
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_status_push:
  {
    \tl_clear:N \l_@@_status_tl
    \int_gincr:N \g_@@_status_int
    \exp_args:Ne \@@_status_push_aux:n
      { \int_use:N \g_@@_status_int }
    \seq_gpush:No \g_@@_status_seq { \l_@@_status_tl }
  }
\cs_new_protected:Npn \@@_status_push_aux:n #1
  {
    \@@_push_cs:nN {#1} \@@_para_before:
    \@@_push_cs:nN {#1} \@@_para_begin:
    \@@_push_cs:nN {#1} \@@_para_end:
    \@@_push_cs:nN {#1} \@@_display_hook:
    \@@_push_box:N \g_@@_stuff_box
    \@@_push_var:
  }
\cs_new_protected:Npn \@@_push_cs:nN #1#2
  {
    \exp_args:NNc \@@_push_cs_aux:NN #2
      { @@_ #1 _ \token_to_str:N #2 }
  }
\cs_new_protected:Npn \@@_push_cs_aux:NN #1#2
  {
    \cs_gset_eq:NN #2#1
    \tl_put_right:Nn \l_@@_status_tl
      {
        \cs_gset_eq:NN #1#2
        \cs_undefine:N #2
      }
  }
\cs_new_protected:Npn \@@_push_box:N #1
  {
    \hbox_gset:Nn \g_@@_stauts_box
      {
        \hbox_unpack_drop:N \g_@@_stauts_box
        \box_use:N #1
      }
    \tl_put_right:Nn \l_@@_status_tl
      { \@@_pop_box:N #1 }
  }
\cs_new_protected:Npn \@@_pop_box:N #1
  {
    \hbox_gset:Nw \g_@@_stauts_box
      \hbox_unpack_drop:N \g_@@_stauts_box
      \box_gset_to_last:N #1
    \@@_if_last_hlist:TF
      { \hbox_gset_end: }
      {
        \hbox_gset_end:
        \box_gclear:N \g_@@_stauts_box
      }
  }
\cs_new_protected_nopar:Npn \@@_push_var:
  {
    \tl_put_right:Nx \l_@@_status_tl
      { \g_@@_var_push_tl }
  }
\cs_new_protected_nopar:Npn \@@_status_pop:
  {
    \seq_gpop:NNT \g_@@_status_seq \l_@@_status_tl
      {
        \int_gdecr:N \g_@@_status_int
        \tl_use:N \l_@@_status_tl
      }
  }
\cs_new_protected_nopar:Npn \@@_status_restore:
  {
    \@@_status_push:
    \@@_clear_para_hook:
    \@@_clear_display_hook:
    \@@_clear_variable:
    \group_insert_after:N \@@_status_pop:
  }
\cs_new_protected_nopar:Npn \@@_status_clear:
  {
    \bool_if:NT \g_@@_next_bool
      {
        \@@_clear_para_hook:
        \@@_clear_variable:
      }
  }
\tl_new:N \l_@@_status_tl
\box_new:N \g_@@_stauts_box
\int_new:N \g_@@_status_int
\seq_new:N \g_@@_status_seq
%    \end{macrocode}
% \end{macro}
%
% \changes{v0.2}{2022/07/21}{å…¼å®¹ \tn{parbox} ä¸Ž \env{minipage} ç­‰ä½¿ç”¨çŽ¯å¢ƒã€‚}
%
% \begin{macro}{\wrapstuff@parboxrestore,\@arrayparboxrestore}
% åœ¨ \LaTeX\ çš„ \cs{parbox} å’Œ \env{minipage} ç­‰çŽ¯å¢ƒä¸­æ¢å¤æ­£å¸¸çš„æ®µè½çŠ¶æ€ã€‚
% \tn{wrapstuff@parboxrestore} çš„åˆå§‹å€¼æ˜¯åœ¨åˆ†ç»„åŽæ¸…é™¤æ´»åŠ¨çš„æ®µè½é’©å­å’Œç›¸å…³å…¨å±€å˜é‡ï¼Œ
% åªæœ‰åœ¨ \env{wrapstuff@par} çŽ¯å¢ƒå†…éƒ¨æ‰ç­‰äºŽ \cs{@@_status_restore:}ï¼Œ
% ä¿å­˜å’Œæ¢å¤ç›¸å…³çŠ¶æ€ã€‚
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \wrapstuff@parboxrestore
  { \group_insert_after:N \@@_status_clear: }
\cs_new_protected_nopar:Npn \@@_parbox_restore:
  {
    \cs_set_eq:NN
      \wrapstuff@parboxrestore
      \@@_status_restore:
  }
\g@addto@macro \@arrayparboxrestore
  { \wrapstuff@parboxrestore }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[TF]{
%   \@@_if_last_none:,
%   \@@_if_last_hlist:,
%   \@@_if_last_whatsit:,
%   \@@_if_last_glue:,
%   \@@_if_last_kern:,
%   \@@_if_last_penalty:}
% ä¸€äº› \hologo{eTeX} ç»“ç‚¹åˆ¤å®šå‡½æ•°ã€‚
%    \begin{macrocode}
\group_begin:
\cs_set:Npn \@@_tmp:nn #1
  {
    \exp_args:Ncc \@@_tmp_aux:NNn
      { @@_if_last_ #1 : }
      { c_@@_ #1 _node }
  }
\cs_set:Npn \@@_tmp_aux:NNn #1#2#3
  {
    \int_const:Nn #2 {#3}
    \prg_new_conditional:Npnn #1 { T , F , TF }
      {
        \if_int_compare:w \tex_lastnodetype:D = #2
          \prg_return_true: \else: \prg_return_false: \fi:
      }
  }
\@@_tmp:nn { none }    { -1 }
\@@_tmp:nn { hlist }   {  1 }
\@@_tmp:nn { whatsit } {  9 }
\@@_tmp:nn { glue }    { 11 }
\@@_tmp:nn { kern }    { 12 }
\@@_tmp:nn { penalty } { 13 }
\group_end:
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_gadd_hook:nn, \@@_package_hook:nn}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_gadd_hook:nn #1
  { \hook_gput_code:nnn {#1} { wrapstuff } }
\cs_new_protected:Npn \@@_package_hook:nn #1
  { \hook_gput_code:nnn { package/#1/after } { wrapstuff } }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_para_raw_end:}
% å°† \cs{para_raw_end:} æ”¾åœ¨åˆ†ç»„ä¸­æ˜¯ä¸ºäº†ä¿æŒ \tn{parshape}ã€‚
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_para_raw_end:
  { \group_begin: \para_raw_end: \group_end: }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_gadd_ht:Nn}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_gadd_ht:Nn #1#2
  { \box_gset_ht:Nn #1 { \box_ht:N #1 + \dim_eval:n {#2} } }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{wrapstuff}
% ä¸»è¦åŠŸèƒ½çŽ¯å¢ƒæŽ¥å£ã€‚
%    \begin{macrocode}
\NewDocumentEnvironment { wrapstuff } { O { } }
  {
    \@@_clear:
    \int_set:Nn \l_@@_top_int { -1 }
    \tl_if_blank:nTF {#1}
      { \tl_clear:N \l_@@_main_kv_tl }
      {
        \keys_set_filter:nnnN { wrapstuff }
          { main , ratio }
          {#1} \l_@@_main_kv_tl
      }
    \tl_set:Nx \l_@@_type_tl { \l_@@_type_tl }
    \dim_set:Nn \l_@@_width_dim { \l_@@_width_tl }
    \dim_set:Nn \l_@@_height_dim { \l_@@_height_tl }
    \hbox_gset:Nw \g_@@_stuff_box
      \dim_compare:nNnTF \l_@@_width_dim &gt; \c_zero_dim
        { \@@_minipage_begin: }
        { \@@_hbox_begin: }
  }
  {
    \dim_compare:nNnTF \l_@@_width_dim &gt; \c_zero_dim
      { \@@_minipage_end: }
      { \@@_hbox_end: }
    \@@_set_vsep:
    \@@_attach_label:
    \tl_if_empty:NTF \l_@@_main_kv_tl
      { \tl_gclear:N \g_@@_main_setting_tl }
      { \@@_save_main_setting: }
    \@@_set_top_line:
    \dim_gset:Nn \g_@@_stuff_wd_dim
      { \box_wd:N \g_@@_stuff_box }
    \dim_gset:Nn \g_@@_stuff_ht_dim
      { \box_ht_plus_dp:N \g_@@_stuff_box }
    \dim_gset_eq:NN
      \g_@@_remaining_dim
      \g_@@_stuff_ht_dim
    \@@_next_para:
  }
\@@_gadd_hook:nn { env/wrapstuff/before } { \par }
\cs_new_protected_nopar:Npn \@@_minipage_begin:
  {
    \@@_floatrow_hook:
    \dim_compare:nNnTF \l_@@_height_dim &gt; \c_zero_dim
      { \begin { minipage } [b] [ \l_@@_height_dim ] [c] { \l_@@_width_dim } }
      { \begin { minipage } [b] { \l_@@_width_dim } }
    \tl_if_empty:NF \l_@@_type_tl
      { \@@_set_float: }
  }
\cs_new_protected_nopar:Npn \@@_minipage_end:
  {
      \end { minipage }
    \hbox_gset_end:
    \@@_float_pos_hook:
  }
\cs_new_protected_nopar:Npn \@@_hbox_begin:
  { \tex_ignorespaces:D }
\cs_new_protected_nopar:Npn \@@_hbox_end:
  {
      \tex_unskip:D
    \hbox_gset_end:
    \dim_compare:nNnT \l_@@_height_dim &gt; \c_zero_dim
      { \@@_gset_height: }
  }
\cs_new_protected_nopar:Npn \@@_gset_height:
  {
    \hbox_gset:Nn \g_@@_stuff_box
      {
        \box_move_up:nn
          {
            (   \l_@@_height_dim
              - \box_ht:N \g_@@_stuff_box
              + \box_dp:N \g_@@_stuff_box
            ) / 2
          }
          { \box_use_drop:N \g_@@_stuff_box }
      }
    \box_gset_ht:Nn \g_@@_stuff_box { \l_@@_height_dim }
    \box_gset_dp:Nn \g_@@_stuff_box { \c_zero_dim }
  }
\cs_new_protected_nopar:Npn \@@_set_vsep:
  {
    \@@_gadd_ht:Nn \g_@@_stuff_box { \l_@@_abovesep_tl }
    \dim_set:Nn \l_@@_shift_dim { \l_@@_belowsep_tl }
    \dim_compare:nNnF \l_@@_shift_dim = \c_zero_dim
      { \@@_set_belowsep: }
  }
\cs_new_protected_nopar:Npn \@@_set_belowsep:
  {
    \hbox_gset:Nn \g_@@_stuff_box
      {
        \box_move_up:nn
          { \l_@@_shift_dim + \box_dp:N \g_@@_stuff_box }
          { \box_use_drop:N \g_@@_stuff_box }
      }
    \box_gset_dp:Nn \g_@@_stuff_box { \c_zero_dim }
  }
\tl_new:N \l_@@_main_kv_tl
\box_new:N \g_@@_stuff_box
\dim_new:N \l_@@_shift_dim
\dim_new:N \l_@@_width_dim
\dim_new:N \l_@@_height_dim
%    \end{macrocode}
% \end{macro}
%
% \changes{v0.2}{2022/07/26}{ä¼˜åŒ–é‡æ–°ç¼–è¯‘è­¦å‘Šã€‚}
%
% \begin{macro}{\@@_attach_label:, \@@_write_label:,\@@_rerun_check:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_attach_label:
  {
    \stepcounter { wrapstuff }
    \hbox_gset:Nn \g_@@_stuff_box
      {
        \@@_write_label:
        \box_use_drop:N \g_@@_stuff_box
      }
  }
\cs_new_protected_nopar:Npn \@@_write_label:
  {
    \exp_args:Nee \@@_write_label_aux:nn
      { \@@_counter:n { wrapstuff } }
      { \@@_counter:n { page } }
  }
\cs_new_protected:Npx \@@_write_label_aux:nn #1#2
  {
    \prop_gput_if_new:Nnn \exp_not:N \g_@@_page_prop {#1} {#2}
    \iow_shipout_x:Nn \exp_not:N \@auxout
      {
        \c_backslash_str wrapstuff@label
          {#1}
          { \exp_not:N \wrapstuff@counter { page } }
      }
  }
\newcounter { wrapstuff }
\cs_new:Npn \@@_counter:n #1
  { \int_value:w \value {#1} }
\cs_new_eq:NN \wrapstuff@counter \@@_counter:n
\cs_new_protected_nopar:Npn \wrapstuff@label
  { \prop_gput:Nnn \g_@@_page_prop }
\@@_gadd_hook:nn { begindocument }
  {
    \legacy_if:nTF { @filesw }
      {
        \iow_now:Nx \@mainaux
          {
            \c_backslash_str providecommand
            \c_backslash_str wrapstuff@label [2] { }
          }
      }
      { \cs_gset_eq:NN \@@_write_label: \@@_empty: }
  }
\@@_gadd_hook:nn { enddocument/afterlastpage }
  {
    \legacy_if:nT { @filesw }
      { \prop_gclear:N \g_@@_page_prop }
  }
\@@_gadd_hook:nn { enddocument/info }
  {
    \prop_if_empty:NF \g_@@_rerun_prop
      { \@@_rerun_check: }
  }
\cs_new_protected_nopar:Npn \@@_rerun_check:
  {
    \prop_map_inline:Nn \g_@@_rerun_prop
      {
        \prop_get:NnN \g_@@_page_prop { ##1 } \l_@@_page_tl
        \int_if_even:nF { \l_@@_page_tl - ##2 }
          { \prop_map_break:n { \@@_rerun_warning: } }
      }
  }
\cs_new_protected_nopar:Npn \@@_rerun_warning:
  { \msg_warning:nn { wstf } { rerun-required } }
\msg_new:nnn { wstf } { rerun-required }
  {
    Page(s)~may~have~changed.\\
    Rerun~to~get~i/o~setting~right.
  }
\tl_new:N \l_@@_page_tl
\prop_new:N \g_@@_page_prop
\prop_new:N \g_@@_rerun_prop
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_save_main_setting:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_save_main_setting:
  {
    \exp_args:Nnno
    \keys_set_filter:nnnN { wrapstuff }
      { main }
      { \l_@@_main_kv_tl } \l_@@_main_kv_tl
    \bool_if:NTF \l_@@_swap_bool
      { \@@_swap_ratio: }
      { \@@_set_ratio:N \l_@@_ratio_fp }
    \tl_if_empty:NF \l_@@_main_kv_tl
      { \@@_save_main_setting_aux: }
  }
\cs_new_protected:Npn \@@_set_ratio:N #1
  {
    \tl_gset:Nx \g_@@_main_setting_tl
      { \fp_set:Nn \exp_not:N \l_@@_ratio_fp { \fp_use:N #1 } }
  }
\cs_new_protected:Npn \@@_set_ratio:n #1
  {
    \tl_gset:Nx \g_@@_main_setting_tl
      { \fp_set:Nn \exp_not:N \l_@@_ratio_fp { \fp_eval:n {#1} } }
  }
\cs_new_protected_nopar:Npn \@@_save_main_setting_aux:
  {
    \exp_args:Nno
    \keys_precompile:nnN
      { wrapstuff }
      { \l_@@_main_kv_tl } \l_@@_main_kv_tl
    \tl_gconcat:NNN
      \g_@@_main_setting_tl
      \g_@@_main_setting_tl
      \l_@@_main_kv_tl
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_set_top_line:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_set_top_line:
  {
    \int_compare:nNnF \l_@@_top_int &lt; \c_zero_int
      {
        \tl_gput_right:Nx \g_@@_main_setting_tl
          {
            \int_set:Nn \l_@@_top_int
              { \int_use:N \l_@@_top_int }
          }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_swap_ratio:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_swap_ratio:
  {
    \exp_args:Ne \@@_swap_ratio_aux:n
      { \@@_counter:n { wrapstuff } }
  }
\cs_new_protected:Npn \@@_swap_ratio_aux:n #1
  {
    \fp_compare:nF
      { \c_zero_fp &lt; \l_@@_ratio_fp &lt; \c_one_fp }
      { \fp_zero:N \l_@@_ratio_fp }
    \prop_get:NnNF \g_@@_page_prop {#1} \l_@@_page_tl
      { \tl_set:Nx \l_@@_page_tl { \@@_counter:n { page } } }
    \int_if_odd:nTF { \l_@@_page_tl }
      { \bool_if:NTF \l_@@_inner_bool }
      { \bool_if:NTF \l_@@_outer_bool }
      { \@@_set_ratio:N \l_@@_ratio_fp }
      { \@@_set_ratio:n { \c_one_fp - \l_@@_ratio_fp } }
    \prop_gput:Nno \g_@@_rerun_prop {#1} { \l_@@_page_tl }
  }
\bool_new:N \l_@@_swap_bool
\bool_new:N \l_@@_inner_bool
\bool_new:N \l_@@_outer_bool
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_next_para:}
% å°† \env{wrapstuff} çŽ¯å¢ƒä¹‹åŽçš„æ®µè½æ”¾å…¥å†…éƒ¨çŽ¯å¢ƒ \env{wrapstuff@par} ä¸­ã€‚
% ä¸ºäº†æŽ§åˆ¶é’©å­æ‰§è¡Œé¡ºåºï¼Œéœ€è¦ä½¿ç”¨ |wrapstuff| æ&nbsp;‡ç­¾ï¼Œ
% è€Œä¸ç”¨æ›´ä¸ºæ–¹ä¾¿çš„ \cs{hook_gput_next_code:nn} å®žçŽ°ã€‚
%    \begin{macrocode}
\@@_gadd_hook:nn { para/before } { \@@_para_before: }
\@@_gadd_hook:nn { para/after }  { \@@_para_after: }
\@@_gadd_hook:nn { para/begin }  { \@@_para_begin: }
\@@_gadd_hook:nn { para/end }    { \@@_para_end: }
\cs_new_protected_nopar:Npn \@@_next_para:
  {
    \cs_gset_eq:NN \@@_para_before: \@@_env_before:
    \cs_gset_eq:NN \@@_para_begin:  \@@_env_begin:
    \cs_gset_eq:NN \@@_para_end:    \@@_env_end:
  }
\cs_new_protected_nopar:Npn \@@_env_before:
  { \dim_gset_eq:NN \g_@@_prevdepth_dim \tex_prevdepth:D }
\cs_new_protected_nopar:Npn \@@_env_begin:
  { \begin { wrapstuff@par } }
\cs_new_protected_nopar:Npn \@@_env_end:
  { \end { wrapstuff@par } }
\cs_new_protected_nopar:Npn \@@_clear_para_hook:
  {
    \cs_gset_eq:NN \@@_para_before: \@@_empty:
    \cs_gset_eq:NN \@@_para_after:  \@@_empty:
    \cs_gset_eq:NN \@@_para_begin:  \@@_empty:
    \cs_gset_eq:NN \@@_para_end:    \@@_empty:
  }
\cs_new_protected_nopar:Npn \@@_empty:
  { }
\cs_new_eq:NN \@@_para_before: \@@_empty:
\cs_new_eq:NN \@@_para_after:  \@@_empty:
\cs_new_eq:NN \@@_para_begin:  \@@_empty:
\cs_new_eq:NN \@@_para_end:    \@@_empty:
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{wrapstuff@par}
% å†…éƒ¨çŽ¯å¢ƒï¼Œå®žçŽ°ä¸»è¦åŠŸèƒ½ã€‚
%    \begin{macrocode}
\NewDocumentEnvironment { wrapstuff@par } { }
  {
    \tl_use:N \g_@@_main_setting_tl
    \dim_set:Nn \l_@@_leftsep_dim { \l_@@_leftsep_tl }
    \dim_set:Nn \l_@@_rightsep_dim { \l_@@_rightsep_tl }
    \dim_set:Nn \l_@@_voffset_dim { \l_@@_voffset_tl }
    \dim_set:Nn \l_@@_line_dim { \l_@@_linewidth_tl }
    \dim_set:Nn \l_@@_min_dim { \box_dp:N \strutbox }
    \dim_set_eq:NN \l_@@_main_width_dim \l_@@_line_dim
    \dim_sub:Nn \l_@@_line_dim
      { \tex_leftskip:D + \tex_rightskip:D }
    \dim_set:Nn \l_@@_window_dim
      { \l_@@_line_dim - \g_@@_stuff_wd_dim }
    \fp_compare:nNnTF \l_@@_ratio_fp &gt; \c_zero_fp
      {
        \fp_compare:nNnTF \l_@@_ratio_fp &lt; \c_one_fp
          { \@@_set_window: }
          { \@@_set_hang_right: }
      }
      { \@@_set_hang_left: }
    \int_compare:nNnTF \g_@@_window_int &gt; \c_zero_int
      {
        \int_set_eq:NN \l_@@_window_int \g_@@_window_int
        \int_zero:N \l_@@_top_int
      }
      { \@@_set_lines: }
    \bool_if:NTF \l_@@_hang_bool
      {
        \dim_set_eq:NN \l_@@_display_dim \l_@@_window_dim
        \int_set_eq:NN \l_@@_window_line_int \l_@@_window_int
      }
      {
        \dim_set_eq:NN \l_@@_display_dim \l_@@_l_dim
        \int_set:Nn \l_@@_window_int { \l_@@_window_int * 2 }
        \int_set:Nn \l_@@_window_line_int
          {
            \bool_if:NTF \g_@@_column_bool
              { \l_@@_window_int / 2 + \g_@@_column_int }
              { \l_@@_window_int }
          }
      }
    \cs_gset_eq:NN \@@_para_before: \@@_empty:
    \cs_gset_eq:NN \@@_para_begin:  \@@_empty:
    \@@_save_parshape:
    \@@_parbox_restore:
    \vbox_set:Nw \l_@@_body_box
      \@@_set_prevdepth:N \g_@@_prevdepth_dim
      \@@_save_tex_skip:
      \@@_tex_parameter:
      \@@_restore_parshape:
      \@@_display_parameter:
      \@@_make_main_parshape:
      \para_raw_noindent:
  }
  {
      \@@_save_hangfrom:
      \@@_save_tex_skip:
      \@@_group_kludge:
      \@@_tex_parameter:
      \@@_make_main_parshape:
      \para_raw_end:
      \int_gset_eq:NN \g_@@_line_int \tex_prevgraf:D
    \vbox_set_end:
    \@@_adjust_tex_skip:
    \cs_gset_eq:NN \@@_para_end:   \@@_empty:
    \cs_gset_eq:NN \@@_para_after: \@@_empty:
    \int_compare:nNnTF \g_@@_line_int &gt; \l_@@_top_int
      { \@@_build_par: }
      { \@@_put_par: }
  }
\box_new:N \l_@@_body_box
\box_new:N \l_@@_window_box
\int_new:N \l_@@_window_int
\int_new:N \g_@@_line_int
\int_new:N \l_@@_window_line_int
\dim_new:N \l_@@_l_dim
\dim_new:N \l_@@_r_dim
\dim_new:N \l_@@_min_dim
\dim_new:N \l_@@_line_dim
\dim_new:N \l_@@_window_dim
\dim_new:N \l_@@_display_dim
\dim_new:N \l_@@_voffset_dim
\dim_new:N \l_@@_leftsep_dim
\dim_new:N \l_@@_rightsep_dim
\dim_new:N \l_@@_main_width_dim
\bool_new:N \l_@@_hang_bool
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_set_hang_left:, \@@_set_hang_right:, \@@_set_window:,}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_set_hang_left:
  {
    \bool_set_true:N \l_@@_hang_bool
    \@@_set_hoffset:N \l_@@_rightsep_dim
    \dim_zero:N \l_@@_l_dim
    \dim_set_eq:NN \l_@@_r_dim \l_@@_window_dim
    \cs_set_eq:NN \@@_build_box: \@@_build_hang:
  }
\cs_new_protected_nopar:Npn \@@_set_hang_right:
  {
    \bool_set_true:N \l_@@_hang_bool
    \@@_set_hoffset:N \l_@@_leftsep_dim
    \dim_zero:N \l_@@_r_dim
    \dim_set_eq:NN \l_@@_l_dim \l_@@_window_dim
    \cs_set_eq:NN \@@_build_box: \@@_build_hang:
  }
\cs_new_protected_nopar:Npn \@@_set_window:
  {
    \bool_set_false:N \l_@@_hang_bool
    \dim_sub:Nn \l_@@_window_dim
      { \l_@@_leftsep_dim + \l_@@_rightsep_dim }
    \dim_set:Nn \l_@@_l_dim
      { \@@_ratio:Nn \l_@@_ratio_fp { \l_@@_window_dim } }
    \dim_set:Nn \l_@@_r_dim
      { \l_@@_window_dim - \l_@@_l_dim }
    \bool_if:NTF \l_@@_column_bool
      { \cs_set_eq:NN \@@_build_box: \@@_build_column: }
      { \cs_set_eq:NN \@@_build_box: \@@_build_block: }
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v0.2}{2022/07/24}{ä¿®å¤ \opt{hoffset} é€‰é¡¹ã€‚}
%
% \begin{macro}{\@@_set_hoffset:N}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_set_hoffset:N #1
  {
    \dim_sub:Nn \l_@@_window_dim {#1}
    \group_begin:
      \dim_set:Nn \l_@@_width_dim { #1 + \g_@@_stuff_wd_dim }
      \cs_set_eq:NN \width \l_@@_width_dim
    \exp_args:NNNx \group_end:
    \dim_add:Nn \l_@@_window_dim
      { \dim_eval:n { \l_@@_hoffset_tl } }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_set_lines:, \@@_window_init:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_set_lines:
  {
    \bool_if:NTF \g_@@_next_bool
      { \tl_clear:N \l_@@_lines_tl }
      { \tl_set:Nx \l_@@_lines_tl { \l_@@_lines_tl } }
    \int_set:Nn \l_@@_window_int
      {
        \tl_if_empty:NTF \l_@@_lines_tl
          { \@@_unit:n { \g_@@_remaining_dim + \l_@@_min_dim } }
          { \l_@@_lines_tl }
      }
    \bool_if:NF \g_@@_next_bool
      { \@@_window_init: }
    \int_compare:nNnTF \g_@@_top_int &lt; \c_zero_int
      {
        \int_compare:nNnT \l_@@_top_int &lt; \c_zero_int
          { \int_zero:N \l_@@_top_int }
      }
      { \int_set_eq:NN \l_@@_top_int \g_@@_top_int }
  }
\cs_new_protected_nopar:Npn \@@_window_init:
  {
    \int_gset_eq:NN \g_@@_column_int \l_@@_window_int
    \dim_gset:Nn \g_@@_window_ht_dim
      { \tex_baselineskip:D * \g_@@_column_int }
    \tl_if_empty:NF \l_@@_lines_tl
      {
        \dim_gset:Nn \g_@@_remaining_dim
          { \g_@@_window_ht_dim - \box_ht:N \strutbox }
        \dim_gset_eq:NN \g_@@_stuff_ht_dim \g_@@_remaining_dim
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_make_main_parshape:}
% ä¸»è¦å¤„ç†ç”¨äºŽæ&nbsp;‡é¢˜æ‚¬æŒ‚çš„ \tn{@hangfrom} å’Œç”¨äºŽåˆ—è¡¨çŽ¯å¢ƒçš„ \tn{parshape}ã€‚
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_make_main_parshape:
  {
    \dim_compare:nNnTF \g_@@_hangindent_dim &gt; \c_zero_dim
      {
        \int_compare:nNnTF \g_@@_hangafter_int = \c_one_int
          { \@@_make_hangfrom: }
          { \@@_make_main_parshape_aux: }
      }
      { \@@_make_main_parshape_aux: }
  }
\cs_new_protected_nopar:Npn \@@_make_main_parshape_aux:
  {
    \bool_gset_false:N \g_@@_hangfrom_bool
    \tex_parshape:D
      \int_eval:n { \l_@@_top_int + 1 } ~
      \prg_replicate:nn
        { \l_@@_top_int }
        { \g_@@_parshape_indent_dim \g_@@_parshape_length_dim }
      \c_zero_dim \c_max_dim
  }
\cs_new_protected_nopar:Npn \@@_save_parshape:
  {
    \int_gset_eq:NN \g_@@_parshape_int \tex_parshape:D
    \int_compare:nNnTF \g_@@_parshape_int = \c_one_int
      {
        \dim_gset:Nn \g_@@_parshape_indent_dim
          { \tex_parshapeindent:D \c_one_int }
        \dim_gset:Nn \g_@@_parshape_length_dim
          { \tex_parshapelength:D \c_one_int }
      }
      {
        \int_gzero:N \g_@@_parshape_int
        \dim_gzero:N \g_@@_parshape_indent_dim
        \dim_gset_eq:NN \g_@@_parshape_length_dim \l_@@_main_width_dim
        \int_gset_eq:NN \g_@@_hangafter_int  \tex_hangafter:D
        \dim_gset_eq:NN \g_@@_hangindent_dim \tex_hangindent:D
      }
  }
\cs_new_protected_nopar:Npn \@@_restore_parshape:
  {
    \int_compare:nNnTF \g_@@_parshape_int = \c_one_int
      {
        \tex_parshape:D \g_@@_parshape_int
          \g_@@_parshape_indent_dim
          \g_@@_parshape_length_dim
      }
      { \@@_restore_hangfrom: }
  }
\cs_new_protected_nopar:Npn \@@_parshape_kern:
  {
    \dim_compare:nNnT \l_@@_l_dim = \c_zero_dim
      {
        \dim_compare:nNnF \g_@@_parshape_indent_dim = \c_zero_dim
          { \tex_kern:D - \g_@@_parshape_indent_dim }
      }
  }
\cs_new_protected_nopar:Npn \@@_make_hangfrom:
  {
    \bool_if:NTF \l_@@_hang_bool
      { \@@_make_hangfrom_aux: }
      { \@@_make_main_parshape_aux: }
  }
\cs_new_protected_nopar:Npn \@@_make_hangfrom_aux:
  {
    \@@_restore_hangfrom:
    \int_zero:N \tex_parshape:D
    \bool_gset_true:N \g_@@_hangfrom_bool
    \dim_set_eq:NN \tex_hsize:D \l_@@_window_dim
  }
\cs_new_protected_nopar:Npn \@@_save_hangfrom:
  {
    \int_gset_eq:NN \g_@@_hangafter_int  \tex_hangafter:D
    \dim_gset_eq:NN \g_@@_hangindent_dim \tex_hangindent:D
  }
\cs_new_protected_nopar:Npn \@@_restore_hangfrom:
  {
    \int_set_eq:NN \tex_hangafter:D  \g_@@_hangafter_int
    \dim_set_eq:NN \tex_hangindent:D \g_@@_hangindent_dim
  }
\bool_new:N \g_@@_hangfrom_bool
\int_new:N \g_@@_parshape_int
\int_new:N \g_@@_hangafter_int
\dim_new:N \g_@@_hangindent_dim
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_group_kludge:}
% \LaTeX\ çš„ \tn{list} çŽ¯å¢ƒä¸­ï¼Œä¸ºäº†ä¿æŒ \tn{parshape}ï¼Œ\tn{par} è¢«é‡å®šä¹‰ä¸º |{\@@par}|ã€‚
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_group_kludge:
  {
    \scan_stop:
    \int_compare:nNnTF \tex_currentgrouptype:D = \c_one_int
      {
        \c_group_end_token
        \cs_gset_eq:NN \@@_group_begin: \c_group_begin_token
      }
      { \cs_gset_eq:NN \@@_group_begin: \@@_empty: }
    \legacy_if:nTF { @noitemarg }
      { \cs_gset_eq:NN \@@_set_itemarg: \@noitemargtrue }
      { \cs_gset_eq:NN \@@_set_itemarg: \@@_empty: }
  }
\cs_new_eq:NN \@@_set_itemarg: \@@_empty:
\cs_new_eq:NN \@@_group_begin: \@@_empty:
\@@_gadd_hook:nn { env/wrapstuff@par/after }
  {
    \@@_set_itemarg:
    \@@_group_begin:
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_ratio:Nn, \@@_unit:n}
%    \begin{macrocode}
\cs_new:Npn \@@_ratio:Nn #1#2
  { \fp_to_dim:n { #1 \dim_to_fp:n {#2} } }
\cs_new:Npn \@@_unit:n #1
  {
    \int_eval:n
      {
        \exp_last_unbraced:Ne \@@_unit_aux:w
          { \dim_to_decimal_in_unit:nn {#1} { \tex_baselineskip:D } }
        \s_stop
      }
  }
\cs_new:Npn \@@_unit_aux:w #1 . #2 \s_stop
  { #1 + 1 }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_save_tex_skip:,\@@_tex_parameter:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_save_tex_skip:
  {
    \skip_gset_eq:NN \g_@@_left_skip \tex_leftskip:D
    \skip_gset_eq:NN \g_@@_right_skip \tex_rightskip:D
    \skip_gset_eq:NN \g_@@_parfill_skip \tex_parfillskip:D
    \skip_gset_eq:NN \g_@@_baseline_skip \tex_baselineskip:D
    \skip_gset:Nn \g_@@_main_left_skip { - \tex_leftskip:D }
  }
\cs_new_protected_nopar:Npn \@@_adjust_tex_skip:
  {
    \@@_adjust_skip:N \g_@@_left_skip
    \@@_adjust_skip:N \g_@@_right_skip
    \@@_adjust_skip:N \g_@@_parfill_skip
  }
\cs_new_protected:Npn \@@_adjust_skip:N #1
  { \skip_gsub:Nn #1 { \dim_eval:n {#1} } }
\cs_new_protected_nopar:Npn \@@_tex_parameter:
  {
    \int_zero:N \tex_clubpenalty:D
    \int_zero:N \tex_widowpenalty:D
    \int_zero:N \tex_interlinepenalty:D
    \int_zero:N \tex_displaywidowpenalty:D
    \int_zero:N \tex_clubpenalties:D
    \int_zero:N \tex_widowpenalties:D
    \int_zero:N \tex_interlinepenalties:D
    \int_zero:N \tex_displaywidowpenalties:D
    \skip_set_eq:NN \tex_leftskip:D \g_@@_left_skip
    \skip_set_eq:NN \tex_rightskip:D \g_@@_right_skip
    \skip_set_eq:NN \tex_parfillskip:D \g_@@_parfill_skip
    \skip_set_eq:NN \tex_baselineskip:D \g_@@_baseline_skip
  }
\skip_new:N \g_@@_left_skip
\skip_new:N \g_@@_right_skip
\skip_new:N \g_@@_parfill_skip
\skip_new:N \g_@@_baseline_skip
\skip_new:N \g_@@_main_left_skip
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_display_parameter:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_display_parameter:
  {
    \bool_gset_false:N \g_@@_display_bool
    \tex_everydisplay:D \exp_after:wN
      {
        \tex_the:D \tex_everydisplay:D
        \@@_display_hook:
      }
  }
\cs_new_protected_nopar:Npn \@@_display_hook:
  {
    \@@_test_leqno:
    \dim_compare:nNnF \tex_displaywidth:D &lt; \c_max_dim
      {
        \bool_gset_true:N \g_@@_display_bool
        \dim_set_eq:NN \tex_displaywidth:D \l_@@_display_dim
      }
  }
\cs_new_eq:NN \@@_test_leqno: \@@_empty:
\cs_new_protected_nopar:Npn \@@_clear_display_hook:
  { \cs_gset_eq:NN \@@_display_hook: \@@_empty: }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_split_parameter:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_split_parameter:
  {
    \skip_zero:N \tex_splittopskip:D
    \dim_set_eq:NN \tex_vfuzz:D \c_max_dim
    \int_set_eq:NN \tex_vbadness:D \c_max_int
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_build_par:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_build_par:
  {
    \bool_if:NTF \g_@@_hangfrom_bool
      { \@@_build_box: }
      { \@@_build_par_aux: }
    \box_if_empty:NTF \l_@@_window_box
      { \@@_put_next_par: }
      { \@@_put_box: }
  }
\cs_new_protected_nopar:Npn \@@_build_par_aux:
  {
    \@@_extract_display_hbox:NN \l_@@_body_box \l_@@_bottom_box
    \int_compare:nNnT \l_@@_top_int &gt; \c_zero_int
      { \@@_put_body_box: }
    \box_if_empty:NTF \l_@@_bottom_box
      {
        \box_if_empty:NF \g_@@_display_box
          { \@@_build_display_box: }
      }
      { \@@_build_body_box: }
  }
\box_new:N \l_@@_bottom_box
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_put_par:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_put_par:
  {
    \int_gset:Nn \g_@@_top_int
      { \l_@@_top_int - \g_@@_line_int }
    \int_gzero:N \g_@@_window_int
    \@@_put_body_box:
    \skip_zero:N \tex_parskip:D
    \para_raw_noindent:
    \@@_next_para:
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_put_body_box:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_put_body_box:
  {
    \@@_para_raw_end:
    \dim_compare:nNnTF { \box_wd:N \l_@@_body_box } &lt; \c_max_dim
      { \@@_put_body_aux:N \l_@@_body_box }
      {
        \@@_extract_hbox:NN \l_@@_body_box \l_@@_bottom_box
        \@@_put_body_aux:N \l_@@_body_box
        \box_set_eq_drop:NN \l_@@_body_box \l_@@_bottom_box
      }
    \@@_para_raw_end:
  }
\cs_new_protected_nopar:Npn \@@_put_body_aux:N #1
  {
    \dim_gset:Nn \g_@@_prevdepth_dim { \box_dp:N #1 }
    \dim_compare:nNnT \g_@@_prevdepth_dim = \c_zero_dim
      { \@@_extract_depth:N #1 }
    \vbox_unpack_drop:N #1
    \@@_set_prevdepth:N \g_@@_prevdepth_dim
  }
\cs_new_protected_nopar:Npn \@@_extract_depth:N #1
  {
    \vbox_set:Nn \l_@@_last_box
      {
        \vbox_unpack:N #1
        \@@_if_last_hlist:F
          {
            \tex_unskip:D \tex_unpenalty:D
            \tex_unskip:D \tex_unpenalty:D
          }
        \@@_if_last_hlist:T
          {
            \box_set_to_last:N \l_@@_last_box
            \dim_gset:Nn \g_@@_prevdepth_dim
              { \box_dp:N \l_@@_last_box }
          }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_put_next_par:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_put_next_par:
  {
    \int_gzero:N \g_@@_top_int
    \int_gzero:N \g_@@_window_int
    \skip_zero:N \tex_parskip:D
    \para_raw_noindent:
    \@@_next_para:
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_build_display_box:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_build_display_box:
  {
    \bool_set_true:N \l_@@_display_bool
    \bool_if:NTF \g_@@_amsmath_bool
      { \@@_build_display_amsmath: }
      { \@@_build_display_normal: }
    \box_if_empty:NTF \l_@@_body_box
      { \@@_build_display_auxi: }
      { \@@_build_display_auxii: }
  }
\cs_new_protected_nopar:Npn \@@_build_display_amsmath:
  {
    \group_begin:
      \vbox_gset:Nn \g_@@_equation_box
        {
          \@@_break:
          \vbox_unpack_drop:N \g_@@_display_box
          \skip_gset_eq:NN \g_@@_pos_skip \tex_lastskip:D
          \tex_unskip:D
          \int_gset_eq:NN \g_@@_pos_int \tex_lastpenalty:D
          \tex_unpenalty:D
          \skip_gadd:Nn \g_@@_pos_skip { \tex_lastskip:D }
          \tex_unskip:D
          \tex_unpenalty:D
        }
      \@@_split_parameter:
      \vbox_set_split_to_ht:NNn \l_@@_last_box \g_@@_equation_box
        { \c_zero_dim }
    \group_end:
    \box_gset_wd:Nn \g_@@_equation_box { \l_@@_display_dim }
    \vbox_gset:Nn \g_@@_display_box
      {
        \tex_penalty:D \g_@@_display_pre_int
        \skip_vertical:N \g_@@_display_pre_skip
      }
    \skip_gset_eq:NN \g_@@_pre_skip \g_@@_display_pre_skip
  }
\cs_new_protected_nopar:Npn \@@_build_display_normal:
  {
    \vbox_gset:Nn \g_@@_display_box
      {
        \vbox_unpack_drop:N \g_@@_display_box
        \skip_gset_eq:NN \g_@@_pos_skip \tex_lastskip:D
        \tex_unskip:D
        \int_gset_eq:NN \g_@@_pos_int \tex_lastpenalty:D
        \tex_unpenalty:D
        \box_gset_to_last:N \g_@@_equation_box
        \skip_gset_eq:NN \g_@@_pre_skip \tex_lastskip:D
        \tex_unskip:D
        \skip_gadd:Nn \g_@@_pre_skip { \tex_lastskip:D }
        \tex_unskip:D
        \skip_vertical:N \g_@@_pre_skip
      }
  }
\cs_new_protected_nopar:Npn \@@_build_display_auxi:
  {
    \bool_if:NTF \g_@@_amsmath_bool
      { \box_set_eq_drop:NN \l_@@_window_box \g_@@_equation_box }
      {
        \hbox_set_to_wd:Nnn \l_@@_window_box
          { \l_@@_display_dim }
          {
            \tex_hss:D
              \@@_adjust_equation:
              \box_use_drop:N \g_@@_equation_box
            \tex_hss:D
          }
      }
    \dim_gset:Nn \g_@@_ht_dim { \box_ht:N \l_@@_window_box }
    \dim_add:Nn \l_@@_voffset_dim
      { \box_ht:N \g_@@_display_box / 2 }
  }
\cs_new_protected_nopar:Npn \@@_build_display_auxii:
  {
    \box_if_horizontal:NTF \l_@@_body_box
      {
        \box_set_eq:NN \l_@@_bottom_box \l_@@_body_box
        \@@_build_display_auxiii:
      }
      {
        \@@_extract_hbox:NN \l_@@_body_box \l_@@_bottom_box
        \str_if_eq:eeTF
          {
            \dim_eval:n { \box_ht:N \l_@@_body_box }
            \dim_eval:n { \box_dp:N \l_@@_body_box }
            \dim_eval:n { \box_ht:N \l_@@_bottom_box }
            \dim_eval:n { \box_dp:N \l_@@_bottom_box }
          }
          { \c_@@_zero_pt_str }
          {
            \vbox_unpack_drop:N \l_@@_body_box
            \box_clear:N \l_@@_bottom_box
            \@@_build_display_auxi:
          }
          { \@@_build_display_auxiii: }
      }
  }
\str_const:Nx \c_@@_zero_pt_str
  {
    \dim_use:N \c_zero_dim
    \dim_use:N \c_zero_dim
    \dim_use:N \c_zero_dim
    \dim_use:N \c_zero_dim
  }
\cs_new_protected_nopar:Npn \@@_build_display_auxiii:
  {
    \bool_set_true:N \l_@@_attach_equation_bool
    \box_gclear:N \g_@@_display_box
    \bool_if:NF \g_@@_amsmath_bool
      { \@@_adjust_equation: }
    \@@_build_body_box:
  }
\bool_new:N \l_@@_display_bool
\bool_new:N \l_@@_attach_equation_bool
%    \end{macrocode}
% \end{macro}
%
% \changes{v0.2}{2022/07/23}{æ”¹è¿›å¯¹æ˜¾ç¤ºæ•°å­¦å…¬å¼çš„å¤„ç†ã€‚}
%
% \begin{macro}{\@@_attach_left:N,\@@_attach_right:N}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_attach_left:N #1
  {
    \@@_attach_equation:Nn #1
      { \g_@@_parshape_indent_dim }
  }
\cs_new_protected:Npn \@@_attach_right:N #1
  {
    \@@_attach_equation:Nn #1
      {
          \l_@@_line_dim
        - \l_@@_display_dim
        + \g_@@_parshape_indent_dim
      }
  }
\cs_new_protected:Npn \@@_attach_equation:Nn #1#2
  {
    \vbox_set:Nn \l_@@_last_box
      {
        \vbox_unpack:N #1
        \box_set_to_last:N \l_@@_last_box
        \bool_if:NTF \g_@@_amsmath_bool
          { \@@_attach_equation_amsmath:Nn }
          { \@@_attach_equation_normal:Nn }
        \l_@@_last_box {#2}
      }
  }
\cs_new_protected:Npn \@@_attach_equation_amsmath:Nn #1#2
  {
    \vbox_gset:Nn \g_@@_equation_box
      {
        \@@_nobreak:
        \skip_vertical:n
          {
              \g_@@_display_pre_skip
            + \g_@@_display_pre_dim
            - \box_dp:N #1
          }
        \box_move_right:nn {#2}
          { \box_use_drop:N \g_@@_equation_box }
      }
  }
\cs_new_protected:Npn \@@_attach_equation_normal:Nn #1#2
  {
    \vbox_set:Nn \l_@@_last_box
      {
        \@@_tex_parameter:
        \dim_set_eq:NN \tex_hsize:D \l_@@_display_dim
        \para_raw_noindent:
          \hbox_unpack_drop:N #1 \tex_unskip:D
          \@@_insert_equation:
        \para_raw_end:
        \skip_gset_eq:NN \g_@@_pos_skip \tex_lastskip:D
        \tex_unskip:D
        \int_gset_eq:NN \g_@@_pos_int \tex_lastpenalty:D
        \tex_unpenalty:D
        \box_set_to_last:N \l_@@_last_box
        \skip_set_eq:NN \l_@@_last_skip \tex_lastskip:D
        \tex_unskip:D
        \skip_add:Nn \l_@@_last_skip { \tex_lastskip:D }
        \vbox_gset:Nn \g_@@_equation_box
          {
            \@@_nobreak:
            \skip_vertical:N \l_@@_last_skip
            \box_move_right:nn {#2}
              {
                \hbox_to_wd:nn
                  { \l_@@_display_dim }
                  {
                    \tex_hss:D
                      \box_use_drop:N \l_@@_last_box
                    \tex_hss:D
                  }
              }
          }
      }
  }
\cs_new_protected_nopar:Npn \@@_insert_equation:
  {
    \c_math_toggle_token \c_math_toggle_token
      \dim_compare:nNnTF \tex_displaywidth:D = \l_@@_display_dim
        { \box_use_drop:N \g_@@_equation_box }
        {
          \bool_if:NTF \g_@@_eqnum_bool
            { \@@_repack_equation: }
            { \box_use_drop:N \g_@@_equation_box }
        }
    \c_math_toggle_token \c_math_toggle_token
  }
\cs_new_protected_nopar:Npn \@@_repack_equation:
  {
    \box_gclear:N \g_@@_equation_box
    \box_use_drop:N \g_@@_eqbody_box
    \bool_if:NTF \g_@@_leqno_bool
      { \tex_leqno:D }
      { \tex_eqno:D }
    \box_use_drop:N \g_@@_eqnum_box
  }
\cs_new_protected_nopar:Npn \@@_adjust_equation:
  {
    \@@_test_eqnum:
    \bool_if:NT \g_@@_eqnum_bool
      { \@@_adjust_equation_width: }
  }
\cs_new_protected_nopar:Npn \@@_test_eqnum:
  {
    \hbox_set:Nn \l_@@_last_box
      {
        \bool_gset_false:N \g_@@_eqnum_bool
        \hbox_unpack:N \g_@@_equation_box
        \@@_if_last_hlist:F { \use_none_delimit_by_s_stop:w }
        \box_gset_to_last:N \g_@@_eqnum_box
        \@@_if_last_kern:F  { \use_none_delimit_by_s_stop:w }
        \tex_unkern:D
        \@@_if_last_hlist:F { \use_none_delimit_by_s_stop:w }
        \box_gset_to_last:N \g_@@_eqbody_box
        \@@_if_last_none:F  { \use_none_delimit_by_s_stop:w }
        \bool_gset_true:N \g_@@_eqnum_bool
        \use_none_delimit_by_s_stop:w \s_stop
      }
  }
\cs_new_protected_nopar:Npn \@@_adjust_equation_width:
  {
    \bool_if:NTF \g_@@_leqno_bool
      { \@@_adjust_leqno: }
      {
        \box_gset_wd:Nn \g_@@_equation_box
          { \box_wd:N \g_@@_eqbody_box }
      }
  }
\cs_new_protected_nopar:Npn \@@_adjust_leqno:
  {
    \box_set_eq_drop:NN \l_@@_last_box \g_@@_eqnum_box
    \box_gset_eq_drop:NN \g_@@_eqnum_box \g_@@_eqbody_box
    \box_gset_eq_drop:NN \g_@@_eqbody_box \l_@@_last_box
    \hbox_gset:Nn \g_@@_equation_box
      {
        \skip_horizontal:n
          {
              \box_wd:N \g_@@_eqbody_box
            - \box_wd:N \g_@@_equation_box
          }
        \box_use_drop:N \g_@@_equation_box
      }
  }
\box_new:N \g_@@_eqbody_box
\box_new:N \g_@@_eqnum_box
\box_new:N \g_@@_equation_box
\int_new:N \g_@@_pos_int
\skip_new:N \g_@@_pos_skip
\bool_new:N \g_@@_eqnum_bool
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_add_pos_kludge:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_add_pos_kludge:
  {
    \dim_gset:Nn \g_@@_prevdepth_dim
      { \box_dp:N \l_@@_window_box }
    \bool_gset_false:N \g_@@_equation_dp_bool
    \bool_if:NTF \g_@@_next_bool
      {
        \tex_vadjust:D
          {
            \box_if_empty:NF \g_@@_equation_box
              { \@@_output_equation_box: }
            \@@_nobreak:
            \bool_if:NT \l_@@_display_bool
              { \skip_vertical:N \g_@@_pos_skip }
          }
      }
      {
        \bool_if:NT \l_@@_display_bool
          {
            \tex_vadjust:D
              {
                \box_if_empty:NF \g_@@_equation_box
                  { \@@_output_equation_box: }
                \tex_penalty:D \g_@@_pos_int
                \skip_vertical:N \g_@@_pos_skip
              }
          }
      }
    \int_gzero:N \g_@@_pos_int
    \skip_gzero:N \g_@@_pos_skip
  }
\cs_new_protected_nopar:Npn \@@_output_equation_box:
  {
    \cs_gset_eq:NN
      \@@_para_after:
      \@@_set_equation_depth:
    \bool_gset_true:N \g_@@_equation_dp_bool
    \dim_gset:Nn \g_@@_prevdepth_dim
      { \box_dp:N \g_@@_equation_box }
    \vbox_unpack_drop:N \g_@@_equation_box
  }
\cs_new_protected_nopar:Npn \@@_set_equation_depth:
  {
    \cs_gset_eq:NN \@@_para_after: \@@_empty:
    \bool_gset_false:N \g_@@_equation_dp_bool
    \@@_set_prevdepth:N \g_@@_prevdepth_dim
  }
\bool_new:N \g_@@_equation_dp_bool
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_build_body_box:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_build_body_box:
  {
    \box_set_eq:NN \l_@@_save_body_box \l_@@_bottom_box
    \@@_build_window:
    \int_compare:nNnTF \g_@@_line_int &gt; \l_@@_window_line_int
      { \@@_extract_hbox:NN \l_@@_body_box \l_@@_bottom_box }
      { \box_clear:N \l_@@_bottom_box }
    \box_if_empty:NF \l_@@_bottom_box
      { \bool_set_false:N \l_@@_attach_equation_bool }
    \box_clear:N \l_@@_window_box
    \@@_build_box:
  }
\box_new:N \l_@@_save_body_box
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_build_body_box:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_build_window:
  {
    \vbox_set:Nn \l_@@_body_box
      {
        \dim_zero:N \tex_emergencystretch:D
        \dim_set_eq:NN \tex_hfuzz:D \c_max_dim
        \dim_set_eq:NN \tex_vfuzz:D \c_max_dim
        \int_set_eq:NN \tex_hbadness:D \c_max_int
        \int_set_eq:NN \tex_vbadness:D \c_max_int
        \int_set:Nn \tex_tolerance:D { 1000 }
        \para_raw_noindent:
          \hbox_unpack_drop:N \l_@@_bottom_box
          \@@_tex_parameter:
          \@@_make_parshape:
          \@@_interline_penalties:
        \para_raw_end:
        \int_gset_eq:NN \g_@@_line_int \tex_prevgraf:D
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_make_parshape:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_make_parshape:
  {
    \tex_parshape:D
      \int_eval:n { \l_@@_window_line_int + 1 } ~
      \bool_if:NTF \l_@@_hang_bool
        {
          \prg_replicate:nn
            { \l_@@_window_int }
            { \c_zero_dim \l_@@_window_dim }
        }
        {
          \bool_if:NTF \l_@@_column_bool
            {
              \prg_replicate:nn
                { \l_@@_window_int / 2 }
                { \c_zero_dim \l_@@_l_dim }
              \prg_replicate:nn
                {
                  \bool_if:NTF \g_@@_column_bool
                    { \g_@@_column_int }
                    { \l_@@_window_int / 2 }
                }
                { \c_zero_dim \l_@@_r_dim }
            }
            {
              \prg_replicate:nn
                { \l_@@_window_int / 2 }
                {
                  \c_zero_dim \l_@@_l_dim
                  \c_zero_dim \l_@@_r_dim
                }
            }
        }
      \c_zero_dim \c_max_dim
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_interline_penalties:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_interline_penalties:
  {
    \bool_if:NF \l_@@_hang_bool
      {
        \bool_if:NTF \l_@@_column_bool
          { \@@_column_penalties: }
          { \@@_block_penalties: }
      }
  }
\cs_new_protected_nopar:Npn \@@_column_penalties:
  {
    \tex_interlinepenalties:D
      \int_eval:n { \l_@@_window_int / 2 + \c_one_int } ~
      \prg_replicate:nn
        { \l_@@_window_int / 2 - \c_one_int }
        { \c_@@_nobreak_int }
      \c_@@_break_int
      \c_zero_int
  }
\cs_new_protected_nopar:Npn \@@_block_penalties:
  {
    \tex_interlinepenalties:D \l_@@_window_int
      \prg_replicate:nn
        { \l_@@_window_int - \c_one_int }
        { \c_@@_break_int }
      \c_zero_int
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_break:,\@@_nobreak:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_break:
  { \tex_penalty:D \c_@@_break_int }
\cs_new_protected_nopar:Npn \@@_nobreak:
  { \tex_penalty:D \c_@@_nobreak_int }
\int_const:Nn \c_@@_break_int { -10000 }
\int_const:Nn \c_@@_nobreak_int { 10000 }
%    \end{macrocode}
% \end{macro}
%
% \changes{v0.2}{2022/07/22}{æé«˜ç¨³å®šæ€§ã€‚}
%
% \begin{macro}{\@@_build_box:, \@@_build_block:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_build_block:
  {
    \vbox_set:Nn \l_@@_window_box
      {
        \@@_split_parameter:
        \skip_set_eq:NN \tex_baselineskip:D \g_@@_baseline_skip
        \@@_build_line:
      }
  }
\cs_new_protected_nopar:Npn \@@_build_line:
  {
    \vbox_set_split_to_ht:NNn \l_@@_l_box \l_@@_body_box
      { \g_@@_baseline_skip }
    \vbox_set_split_to_ht:NNn \l_@@_r_box \l_@@_body_box
      { \g_@@_baseline_skip }
    \@@_build_line_repack:
    \box_if_empty:NTF \l_@@_body_box
      { \@@_put_last_line: }
      {
        \@@_put_line_box:
        \@@_build_line:
      }
  }
\cs_new_protected_nopar:Npn \@@_build_line_repack:
  {
    \vbox_set:Nn \l_@@_l_box
      { \vbox_unpack_drop:N \l_@@_l_box }
    \box_if_empty:NF \l_@@_r_box
      {
        \vbox_set:Nn \l_@@_r_box
          { \vbox_unpack_drop:N \l_@@_r_box }
      }
    \@@_save_first_ht:
  }
\cs_new_protected_nopar:Npn \@@_put_last_line:
  {
    \bool_if:NT \l_@@_attach_equation_bool
      { \@@_attach_left:N \l_@@_l_box }
    \@@_put_line_box:
  }
\cs_new_protected_nopar:Npn \@@_put_line_box:
  {
    \hbox_to_wd:nn { \l_@@_line_dim }
      {
        \box_use_drop:N \l_@@_l_box
        \tex_hfil:D
        \box_use_drop:N \l_@@_r_box
      }
  }
\cs_new_protected_nopar:Npn \@@_save_first_ht:
  {
    \dim_gset:Nn \g_@@_ht_dim
      {
        \dim_max:nn
          { \box_ht:N \l_@@_l_box }
          { \box_ht:N \l_@@_r_box }
      }
    \cs_set_eq:NN \@@_save_first_ht: \@@_empty:
  }
\dim_new:N \g_@@_ht_dim
\box_new:N \l_@@_l_box
\box_new:N \l_@@_r_box
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_build_column_fuzzy:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_build_column_fuzzy:
  {
    \hbox_set_to_wd:Nnn \l_@@_window_box
      { \l_@@_line_dim }
      {
        \@@_split_parameter:
        \@@_build_column_aux:
        \box_if_empty:NT \l_@@_bottom_box
          { \@@_build_column_fuzzy_aux: }
        \@@_repack_left_box:
        \bool_if:NT \l_@@_attach_equation_bool
          { \@@_attach_left:N \l_@@_l_box }
        \box_use:N \l_@@_l_box
        \tex_hfil:D
        \box_move_up:nn
          { \box_ht:N \l_@@_l_box - \box_ht:N \l_@@_r_box }
          { \box_use_drop:N \l_@@_r_box }
      }
  }
\cs_new_protected_nopar:Npn \@@_build_column_aux:
  {
    \vbox_set_split_to_ht:NNn \l_@@_l_box \l_@@_body_box
      { \box_ht:N \l_@@_body_box / 2 }
    \vbox_set_top:Nn \l_@@_l_box
      { \vbox_unpack_drop:N \l_@@_l_box }
    \box_set_eq_drop:NN \l_@@_r_box \l_@@_body_box
  }
\cs_new_protected_nopar:Npn \@@_build_column_fuzzy_aux:
  {
    \dim_compare:nNnTF
      {
        \box_ht_plus_dp:N \l_@@_r_box -
        \box_ht_plus_dp:N \l_@@_l_box
      }
      &gt;
      { \l_@@_min_dim }
      {
        \box_if_empty:NF \l_@@_last_l_box
          {
            \box_set_eq_drop:NN \l_@@_l_box \l_@@_last_l_box
            \box_set_eq_drop:NN \l_@@_r_box \l_@@_last_r_box
          }
      }
      { \@@_rebuild_window: }
  }
\cs_new_protected_nopar:Npn \@@_rebuild_window:
  {
    \int_compare:nNnT \l_@@_window_int &gt; { 2 }
      { \@@_rebuild_window_aux: }
  }
\cs_new_protected_nopar:Npn \@@_rebuild_window_aux:
  {
    \int_sub:Nn \l_@@_window_int { 2 }
    \box_set_eq_drop:NN \l_@@_last_l_box \l_@@_l_box
    \box_set_eq_drop:NN \l_@@_last_r_box \l_@@_r_box
    \box_set_eq:NN \l_@@_bottom_box \l_@@_save_body_box
    \int_set_eq:NN \l_@@_window_line_int \l_@@_window_int
    \@@_build_window:
    \@@_build_column_aux:
    \@@_build_column_fuzzy_aux:
  }
\box_new:N \l_@@_last_l_box
\box_new:N \l_@@_last_r_box
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_build_column_strict:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_build_column_strict:
  {
    \group_begin:
      \@@_split_parameter:
      \@@_build_column_aux:
      \box_if_empty:NTF \l_@@_r_box
        { \@@_build_column_strict_auxi: }
        {
          \box_if_empty:NTF \l_@@_bottom_box
            { \@@_build_column_strict_auxii: }
            {
              \bool_if:NTF \g_@@_column_bool
                { \@@_build_column_strict_auxiii: }
                { \@@_build_column_strict_auxiv: }
            }
        }
    \group_end:
    \box_set_eq_drop:NN \l_@@_window_box \g_@@_window_box
  }
\cs_new_protected_nopar:Npn \@@_build_column_strict_auxi:
  {
    \@@_repack_left_box:
    \bool_if:NT \l_@@_attach_equation_bool
      { \@@_attach_left:N \l_@@_l_box }
    \box_gset_eq_drop:NN \g_@@_window_box \l_@@_l_box
    \bool_gset_true:N \g_@@_column_bool
    \bool_if:NF \g_@@_first_save_bool
      {
        \bool_gset_true:N \g_@@_first_save_bool
        \dim_gset:Nn \g_@@_first_sep_dim
          { \tex_baselineskip:D - \g_@@_ht_dim }
        \dim_gset_eq:NN \g_@@_first_dp_dim \g_@@_prevdepth_dim
      }
    \int_case:nnT { \g_@@_window_int }
      {
        { \c_zero_int } { }
        { \g_@@_line_int } { }
      }
      { \@@_column_move_entire_aux: }
  }
\cs_new_protected_nopar:Npn \@@_column_move_entire_aux:
  {
    \bool_gset_true:N \g_@@_entire_bool
    \bool_gset_true:N \g_@@_next_hang_bool
  }
\cs_new_protected_nopar:Npn \@@_column_move_entire:
  {
    \dim_gsub:Nn \g_@@_first_sep_dim
      { \box_dp:N \l_@@_window_box }
    \bool_gset_false:N \g_@@_entire_bool
    \dim_gzero:N \g_@@_column_ht_dim
    \dim_gset_eq:NN \g_@@_prevdepth_dim \g_@@_first_dp_dim
    \@@_column_right_move_set:nn
      { \g_@@_stuff_ht_dim }
      { \g_@@_window_ht_dim }
    \int_gset_eq:NN \g_@@_window_int \g_@@_column_int
  }
\cs_new_protected:Npn \@@_column_right_move_set:nn #1#2
  {
    \bool_gset_true:N \g_@@_right_move_bool
    \bool_gset_true:N \g_@@_first_set_bool
    \tl_gput_right:Nn \g_@@_main_setting_tl
      {
        \bool_if:NTF \g_@@_first_set_bool
          {
            \bool_gset_false:N \g_@@_first_set_bool
            \bool_set_true:N \l_@@_first_move_bool
          }
          { \bool_set_false:N \l_@@_first_move_bool }
        \fp_zero:N \l_@@_ratio_fp
      }
    \@@_make_next_stuff:nn
      { \l_@@_line_dim - \l_@@_r_dim - \l_@@_rightsep_dim }
      {#1}
    \dim_gset:Nn \g_@@_column_room_dim {#2}
    \int_gzero:N \g_@@_top_int
  }
\cs_new_protected_nopar:Npn \@@_build_column_strict_auxii:
  {
    \bool_gset_false:N \g_@@_entire_bool
    \@@_repack_left_box:
    \bool_if:NT \l_@@_attach_equation_bool
      { \@@_attach_right:N \l_@@_r_box }
    \dim_gset:Nn \g_@@_hang_ht_dim
      {
        \g_@@_stuff_ht_dim - \tex_baselineskip:D *
          \@@_unit:n { \box_ht_plus_dp:N \l_@@_r_box }
        - \box_ht_plus_dp:N \g_@@_equation_box
        - \g_@@_pos_skip
      }
    \dim_compare:nNnTF \g_@@_hang_ht_dim &gt; \c_zero_dim
      { \@@_column_move_right: }
      { \@@_column_put_right: }
    \box_gset_ht:Nn \g_@@_window_box { \box_ht:N \l_@@_l_box }
    \box_gset_dp:Nn \g_@@_window_box { \box_dp:N \l_@@_l_box }
  }
\cs_new_protected_nopar:Npn \@@_column_move_right:
  {
    \int_compare:nNnTF \g_@@_window_int &gt; \c_zero_int
      {
        \dim_gset:Nn \g_@@_column_room_dim
          {
              \g_@@_window_ht_dim
            - \g_@@_first_sep_dim
            - \box_ht_plus_dp:N \l_@@_r_box
            - \box_ht_plus_dp:N \g_@@_equation_box
          }
        \@@_next_hang_para:
      }
      {
        \dim_gset:Nn \g_@@_column_room_dim
          {
              \box_ht:N \l_@@_l_box
            - \box_ht_plus_dp:N \l_@@_r_box
            - \box_ht_plus_dp:N \g_@@_equation_box
          }
        \dim_gset:Nn \g_@@_first_sep_dim
          { \tex_baselineskip:D - \g_@@_ht_dim }
        \bool_gset_true:N \g_@@_right_move_bool
        \bool_gset_true:N \g_@@_next_hang_bool
      }
    \hbox_gset_to_wd:Nnn \g_@@_window_box
      { \l_@@_line_dim }
      {
        \box_use:N \l_@@_l_box
        \tex_hfil:D
        \box_move_up:nn
          { \g_@@_column_room_dim }
          { \box_use:N \l_@@_r_box }
      }
    \dim_gset:Nn \g_@@_column_ht_dim
      {
          \box_ht_plus_dp:N \l_@@_r_box
        + \box_ht_plus_dp:N \g_@@_equation_box
        + \g_@@_pos_skip
      }
  }
\cs_new_protected_nopar:Npn \@@_column_put_right:
  {
    \hbox_gset_to_wd:Nnn \g_@@_window_box
      { \l_@@_line_dim }
      {
        \box_use:N \l_@@_l_box
        \tex_hfil:D
        \box_move_up:nn
          {
            \int_compare:nNnTF \g_@@_window_int &gt; \c_zero_int
              { \g_@@_window_ht_dim - \g_@@_first_sep_dim }
              { \box_ht:N \l_@@_l_box }
            - \box_ht:N \l_@@_r_box
          }
          { \box_use:N \l_@@_r_box }
      }
    \skip_gzero:N \g_@@_pos_skip
  }
\cs_new_protected_nopar:Npn \@@_next_hang_para:
  {
    \bool_if:NTF \g_@@_entire_bool
      { \@@_column_move_entire: }
      {
        \@@_column_right_move_set:nn
          { \g_@@_hang_ht_dim }
          { \g_@@_column_room_dim }
        \int_gzero:N \g_@@_window_int
      }
    \bool_gset_false:N \g_@@_next_hang_bool
  }
\cs_new_protected_nopar:Npn \@@_build_column_strict_auxiii:
  {
    \bool_gset_false:N \g_@@_column_bool
    \@@_repack_left_box:
    \hbox_gset_to_wd:Nnn \g_@@_window_box
      { \l_@@_line_dim }
      {
        \box_use:N \l_@@_l_box
        \tex_hfil:D
        \box_use:N \l_@@_r_box
      }
    \box_gset_ht:Nn \g_@@_window_box
      { \box_ht:N \l_@@_l_box }
  }
\cs_new_protected_nopar:Npn \@@_build_column_strict_auxiv:
  {
    \@@_repack_left_box:
    \hbox_gset_to_wd:Nnn \g_@@_window_box
      { \l_@@_line_dim }
      {
        \box_use:N \l_@@_l_box
        \tex_hfil:D
        \box_move_up:nn
          { \box_ht:N \l_@@_l_box - \box_ht:N \l_@@_r_box }
          { \box_use_drop:N \l_@@_r_box }
      }
  }
\cs_new_protected_nopar:Npn \@@_repack_left_box:
  {
    \dim_gset:Nn \g_@@_ht_dim { \box_ht:N \l_@@_l_box }
    \vbox_set:Nn \l_@@_l_box
      { \vbox_unpack_drop:N \l_@@_l_box }
  }
\box_new:N \g_@@_window_box
\bool_new:N \l_@@_first_move_bool
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_build_box:,\@@_build_column:}
%    \begin{macrocode}
\bool_new:N \l_@@_column_bool
\cs_new_eq:NN \@@_build_column: \@@_build_column_strict:
\cs_new_eq:NN \@@_build_box:    \@@_build_column:
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_build_hang:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_build_hang:
  {
    \bool_if:NTF \g_@@_hangfrom_bool
      { \@@_build_hangfrom: }
      {
        \vbox_set_top:Nn \l_@@_window_box
          { \vbox_unpack:N \l_@@_body_box }
        \dim_gset:Nn \g_@@_ht_dim { \box_ht:N \l_@@_window_box }
      }
    \box_set_eq_drop:NN \l_@@_window_box \l_@@_body_box
    \bool_if:NT \l_@@_attach_equation_bool
      { \@@_build_hang_attach: }
    \dim_compare:nNnT \g_@@_column_room_dim &gt; \c_zero_dim
      { \@@_build_hang_move: }
  }
\cs_new_protected_nopar:Npn \@@_build_hang_attach:
  {
    \dim_compare:nNnTF \l_@@_r_dim = \c_zero_dim
      { \@@_attach_left:N  \l_@@_window_box }
      { \@@_attach_right:N \l_@@_window_box }
  }
\cs_new_protected_nopar:Npn \@@_build_hang_move:
  {
    \dim_set:Nn \l_@@_shift_dim
      {
        \dim_max:nn
          { \box_ht:N \l_@@_window_box }
          { \tex_baselineskip:D * \g_@@_line_int }
        + \box_ht_plus_dp:N \g_@@_equation_box
        + \tex_parskip:D
      }
    \dim_gsub:Nn \g_@@_column_room_dim { \l_@@_shift_dim }
    \dim_compare:nNnTF \g_@@_column_room_dim &gt; \c_zero_dim
      {
        \box_if_empty:NTF \l_@@_bottom_box
          { \bool_if:NT \g_@@_right_move_bool { \@@_set_next_hang: } }
      }
      { \use:n }
      {
        \bool_gset_false:N \g_@@_move_hang_bool
        \bool_gset_false:N \g_@@_right_move_bool
      }
  }
\cs_new_protected_nopar:Npn \@@_set_next_hang:
  {
    \bool_if:NF \g_@@_move_hang_bool
      {
        \bool_gset_true:N \g_@@_move_hang_bool
        \dim_gset_eq:NN \g_@@_hang_ht_dim \g_@@_remaining_dim
      }
    \dim_gsub:Nn \g_@@_hang_ht_dim { \l_@@_shift_dim }
    \@@_column_right_move_set:nn
      { \g_@@_hang_ht_dim }
      { \g_@@_column_room_dim }
    \int_gzero:N \g_@@_window_int
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_build_hangfrom:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_build_hangfrom:
  {
    \group_begin:
      \vbox_gset:Nn \g_@@_window_box
        {
          \@@_break:
          \vbox_unpack:N \l_@@_body_box
        }
      \@@_split_parameter:
      \vbox_set_split_to_ht:NNn \l_@@_last_box \g_@@_window_box
        { \c_zero_dim }
      \dim_gset:Nn \g_@@_ht_dim
        {
            \g_@@_baseline_skip
          - \g_@@_prevdepth_dim
          - \box_ht:N \l_@@_body_box
          + \box_ht:N \g_@@_window_box
        }
    \group_end:
    \box_set_eq_drop:NN \l_@@_body_box \g_@@_window_box
  }
%    \end{macrocode}
% \end{macro}
%
% \changes{v0.3}{2022/07/31}{ä¿®å¤ stuff æ·±åº¦ä¸ä¸ºé›¶æ—¶çš„åž‚ç›´å¯¹é½é—®é¢˜ã€‚}
%
% \begin{macro}{\@@_put_box:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_put_box:
  {
    \@@_para_raw_end:
    \dim_compare:nNnTF \g_@@_prevdepth_dim &gt; \c_@@_ignore_depth_dim
      { \@@_add_vskip: }
      { \@@_set_vskip: }
    \skip_set_eq:NN \l_@@_par_skip \tex_parskip:D
    \skip_zero:N \tex_parskip:D
    \dim_set:Nn \l_@@_window_ht_dim
      { \box_ht_plus_dp:N \l_@@_window_box }
    \bool_if:NTF \g_@@_right_move_bool
      { \@@_put_box_aux: }
      {
        \box_if_empty:NTF \l_@@_bottom_box
          { \@@_put_next_test: }
          { \@@_put_box_aux: }
      }
  }
\dim_new:N \l_@@_window_ht_dim
\skip_new:N \l_@@_par_skip
\cs_new_protected_nopar:Npn \@@_put_next_test:
  {
    \box_if_empty:NF \g_@@_equation_box
      {
        \dim_add:Nn \l_@@_window_ht_dim
          { \box_ht_plus_dp:N \g_@@_equation_box + \g_@@_pos_skip }
      }
    \dim_compare:nNnTF
      { \g_@@_remaining_dim + \g_@@_pos_skip } &gt; \l_@@_window_ht_dim
      { \@@_set_next: }
      { \@@_put_box_aux: }
  }
\cs_new_protected_nopar:Npn \@@_put_box_aux:
  {
    \@@_output_window_box:
    \box_if_empty:NTF \l_@@_bottom_box
      { \@@_put_trailer_box: }
      { \@@_put_bottom_box: }
  }
\cs_new_protected_nopar:Npn \@@_put_trailer_box:
  {
    \bool_if:NTF \g_@@_next_hang_bool
      {
        \@@_next_hang_para:
        \@@_next_para_trailer:
      }
      {
        \bool_if:NTF \g_@@_right_move_bool
          { \@@_next_para_trailer: }
          {
            \@@_add_pos_kludge:
            \@@_put_pos_box:
            \@@_clear_variable:
          }
      }
  }
\cs_new_protected_nopar:Npn \@@_put_bottom_box:
  {
    \@@_para_raw_end:
    \para_raw_noindent:
    \hbox_unpack_drop:N \l_@@_bottom_box
    \box_if_empty:NF \g_@@_equation_box
      { \@@_insert_equation: }
    \@@_put_pos_box:
    \@@_clear_variable:
  }
\cs_new_protected_nopar:Npn \@@_output_window_box:
  {
    \@@_hbox:n
      {
        \@@_put_window_box:
        \bool_if:NF \g_@@_next_bool
          { \@@_output_stuff_box: }
      }
  }
\cs_new_protected_nopar:Npn \@@_put_pos_box:
  {
    \box_if_empty:NF \g_@@_pos_box
      { \@@_output_pos_box: }
  }
\cs_new_protected_nopar:Npn \@@_output_pos_box:
  {
    \@@_if_last_none:F
      { \@@_output_pos_box_aux: }
    \hbox_unpack_drop:N \g_@@_pos_box
  }
\cs_new_protected_nopar:Npn \@@_output_pos_box_aux:
  {
    \@@_para_raw_end:
    \bool_if:NT \g_@@_equation_dp_bool
      { \@@_set_equation_depth: }
    \para_raw_noindent:
  }
\cs_new_protected:Npn \@@_hbox:n #1
  {
    \para_raw_noindent:
    \hbox_gset:Nn \g_@@_last_box {#1}
    \box_gset_wd:Nn \g_@@_last_box { \l_@@_line_dim }
    \box_use_drop:N \g_@@_last_box
  }
\cs_new_protected_nopar:Npn \@@_put_window_box:
  {
    \dim_compare:nNnF \l_@@_l_dim &gt; \c_zero_dim
      { \skip_horizontal:n { \l_@@_line_dim - \l_@@_r_dim } }
    \box_use:N \l_@@_window_box
  }
\cs_new_protected_nopar:Npn \@@_output_stuff_box:
  {
    \hbox_gset:Nn \g_@@_stuff_box
      {
        \@@_parshape_kern:
        \box_move_up:nn
          {
              \box_dp:N \g_@@_stuff_box
            + \box_ht:N \l_@@_window_box
            - (   \l_@@_window_ht_dim
                + \box_ht_plus_dp:N \g_@@_stuff_box ) / 2
            + \l_@@_voffset_dim
          }
          { \box_use_drop:N \g_@@_stuff_box }
      }
    \box_gset_ht:Nn \g_@@_stuff_box { \c_zero_dim }
    \box_gset_dp:Nn \g_@@_stuff_box { \c_zero_dim }
    \skip_horizontal:n
      {
        \dim_compare:nNnTF \l_@@_r_dim &gt; \c_zero_dim
          {
            \dim_compare:nNnTF
              { \box_wd:N \l_@@_window_box }
              &lt;
              { \l_@@_window_dim }
              { \l_@@_leftsep_dim }
              {
                - \l_@@_r_dim
                - \l_@@_rightsep_dim
                - \g_@@_stuff_wd_dim
              }
          }
          { \l_@@_leftsep_dim }
      }
    \box_use_drop:N \g_@@_stuff_box
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_add_vskip:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_add_vskip:
  {
    \box_if_empty:NTF \g_@@_display_box
      { \@@_add_vskip_auxi: }
      { \@@_add_vskip_display: }
  }
\cs_new_protected_nopar:Npn \@@_add_vskip_display:
  {
    \bool_set_true:N \l_@@_display_pre_bool
    \vbox_unpack_drop:N \g_@@_display_box
    \@@_ignore_depth:
  }
\cs_new_protected_nopar:Npn \@@_add_vskip_auxi:
  {
    \dim_compare:nNnTF \tex_pagegoal:D &lt; \c_max_dim
      { \@@_add_vskip_auxii: }
      {
        \bool_if:NTF \g_@@_next_bool
          { \@@_add_vskip_auxii: }
          { \@@_add_vskip_auxiii: }
      }
  }
\cs_new_protected_nopar:Npn \@@_add_vskip_auxii:
  {
    \@@_add_vskip_auxiv:
    \bool_if:NTF \l_@@_first_move_bool
      { \@@_first_move_skip: }
      { \skip_vertical:N \g_@@_pre_skip }
    \@@_ignore_depth:
  }
\cs_new_protected_nopar:Npn \@@_add_vskip_auxiii:
  {
    \@@_add_vskip_auxiv:
    \skip_vertical:N \g_@@_pre_skip
    \dim_compare:nNnTF \tex_topskip:D &gt; \g_@@_ht_dim
      {
        \skip_sub:Nn \tex_topskip:D { \g_@@_ht_dim }
        \tex_hrule:D height \c_zero_dim \scan_stop:
      }
      { \@@_ignore_depth: }
  }
\cs_new_protected_nopar:Npn \@@_add_vskip_auxiv:
  {
    \skip_gset:Nn \g_@@_pre_skip
      {
          \g_@@_baseline_skip
        - \g_@@_prevdepth_dim
        - \g_@@_ht_dim
      }
    \dim_compare:nNnT \g_@@_pre_skip &lt; \tex_lineskiplimit:D
      { \skip_gset_eq:NN \g_@@_pre_skip \tex_lineskip:D }
  }
\cs_new_protected_nopar:Npn \@@_first_move_skip:
  {
    \skip_vertical:n
      {
          \g_@@_first_sep_dim
        - \g_@@_window_ht_dim
        - \tex_parskip:D
        \dim_compare:nNnT \g_@@_column_ht_dim &gt; \c_zero_dim
          { + \g_@@_column_ht_dim + \g_@@_pre_skip }
      }
  }
\skip_new:N \g_@@_pre_skip
\bool_new:N \l_@@_display_pre_bool
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_set_vskip:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_set_vskip:
  {
    \box_if_empty:NTF \g_@@_display_box
      {
        \skip_gset:Nn \g_@@_pre_skip
          { \g_@@_baseline_skip - \g_@@_ht_dim }
      }
      { \@@_add_vskip_display: }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_ignore_depth:,\@@_set_prevdepth:N}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_ignore_depth:
  { \dim_set_eq:NN \tex_prevdepth:D \c_@@_ignore_depth_dim }
\cs_new_protected_nopar:Npn \@@_set_prevdepth:N
  { \dim_set_eq:NN \tex_prevdepth:D }
\dim_const:Nn \c_@@_ignore_depth_dim { -1000pt }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_set_next:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_set_next:
  {
    \dim_set:Nn \l_@@_height_dim
      {
        \bool_if:NT \g_@@_next_bool { \l_@@_par_skip }
        + \g_@@_pre_skip
        + \l_@@_window_ht_dim
      }
    \dim_gadd:Nn \g_@@_total_ht_dim { \l_@@_height_dim }
    \dim_set:Nn \l_@@_shift_dim
      { \g_@@_remaining_dim - \l_@@_height_dim }
    \dim_compare:nNnTF
      { - \l_@@_shift_dim } &lt; \l_@@_min_dim
      { \@@_set_next_para: }
      { \@@_set_next_output: }
  }
\cs_new_protected_nopar:Npn \@@_set_next_para:
  {
    \int_gset:Nn \g_@@_window_int
      {
        \dim_compare:nNnTF \l_@@_shift_dim &gt; \c_zero_dim
          { \@@_unit:n { \l_@@_shift_dim } }
          { \c_one_int }
      }
    \@@_set_next_verify:
    \@@_output_window_box:
    \@@_make_next_stuff:nn
      { \g_@@_stuff_wd_dim }
      { \l_@@_shift_dim }
    \int_gzero:N \g_@@_top_int
    \@@_next_para_trailer:
  }
\cs_new_protected_nopar:Npn \@@_set_next_output:
  {
    \@@_output_window_box:
    \@@_add_pos_kludge:
    \@@_put_pos_box:
    \@@_clear_variable:
  }
\cs_new_protected_nopar:Npn \@@_set_next_verify:
  {
    \dim_set:Nn \l_@@_height_dim
      { \g_@@_window_ht_dim - \g_@@_total_ht_dim - \l_@@_min_dim }
    \dim_while_do:nNnn
      { \tex_baselineskip:D * \g_@@_window_int + \l_@@_par_skip }
      &lt;
      { \l_@@_height_dim }
      { \int_gincr:N \g_@@_window_int }
    \bool_if:NF \g_@@_next_bool
      {
        \dim_add:Nn \l_@@_window_ht_dim
          { \tex_baselineskip:D * \g_@@_window_int + \l_@@_par_skip }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_next_para_trailer:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_next_para_trailer:
  {
    \@@_add_pos_kludge:
    \box_if_empty:NTF \g_@@_pos_box
      { \@@_next_para: }
      {
        \@@_env_begin:
          \hbox_unpack_drop:N \g_@@_pos_box
        \@@_env_end:
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_make_next_stuff:nn}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_make_next_stuff:nn #1#2
  {
    \bool_gset_true:N \g_@@_next_bool
    \dim_gset:Nn \g_@@_stuff_wd_dim  {#1}
    \dim_gset:Nn \g_@@_remaining_dim {#2}
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_extract_hbox:NN}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_extract_display_hbox:NN #1
  {
    \box_gclear:N \g_@@_pos_box
    \vbox_set:Nn #1
      {
        \vbox_unpack_drop:N #1
        \bool_if:NTF \g_@@_display_bool
          { \@@_test_display_math: }
          { \box_gclear:N \g_@@_display_box }
        \box_if_empty:NTF \g_@@_display_box
          {
            \bool_gset_false:N \g_@@_amsmath_bool
            \@@_extract_last_hbox:N \g_@@_last_box
          }
          { \box_gclear:N \g_@@_last_box }
      }
    \box_if_empty:NF \g_@@_display_box
      { \dim_gset:Nn \g_@@_display_pre_dim { \box_dp:N #1 } }
    \@@_extract_hbox_aux:N
  }
\cs_new_protected:Npn \@@_extract_hbox:NN #1
  {
    \vbox_set:Nn #1
      {
        \vbox_unpack_drop:N #1
        \@@_extract_last_hbox:N \g_@@_last_box
      }
    \@@_extract_hbox_aux:N
  }
\cs_new_protected:Npn \@@_extract_hbox_aux:N #1
  {
    \box_if_empty:NTF \g_@@_last_box
      { \box_clear:N #1 }
      { \@@_repack_hbox:N #1 }
  }
\cs_new_protected:Npn \@@_repack_hbox:N #1
  {
    \hbox_set:Nn #1
      {
        \skip_if_eq:nnF
          { \g_@@_main_left_skip } { \c_zero_skip }
          { \skip_horizontal:N \g_@@_main_left_skip }
        \hbox_unpack_drop:N \g_@@_last_box
        \tex_unskip:D \tex_unskip:D \tex_unpenalty:D
      }
  }
\cs_new_protected:Npn \@@_extract_last_hbox:N #1
  {
    \@@_if_last_hlist:TF
      {
        \box_gset_to_last:N #1
        \tex_unskip:D
      }
      { \box_gclear:N #1 }
  }
\box_new:N \g_@@_last_box
\box_new:N \g_@@_display_box
\dim_new:N \g_@@_display_pre_dim
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_test_display_math:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_test_display_math:
  {
    \@@_if_last_hlist:T { \@@_extract_pos_hbox: }
    \box_clear:N \l_@@_add_box
    \box_gclear:N \g_@@_display_box
    \skip_gzero:N \g_@@_last_skip
    \skip_gzero:N \g_@@_display_pre_skip
    \bool_gset_false:N \g_@@_amsmath_bool
    \@@_add_last_skip:w
    \@@_add_last_penalty:w
    \@@_add_last_box:w
    \@@_add_last_skip:w
    \@@_add_last_skip:w
    \@@_add_last_penalty:w
    \@@_add_last_finalise:w \s_stop
  }
\cs_new_protected_nopar:Npn \@@_extract_pos_hbox:
  {
    \box_gset_to_last:N \g_@@_last_box
    \@@_repack_hbox:N \l_@@_last_box
    \box_gset_eq_drop:NN \g_@@_pos_box \l_@@_last_box
    \tex_unskip:D
  }
\box_new:N \l_@@_add_box
\box_new:N \g_@@_pos_box
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_add_last_stop:w}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_add_last_stop:w
  {
    \vbox_unpack_drop:N \l_@@_add_box
    \use_none_delimit_by_s_stop:w
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_add_last_skip:w}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_add_last_skip:w
  {
    \@@_if_last_glue:TF
      {
        \skip_set_eq:NN \l_@@_last_skip \tex_lastskip:D
        \vbox_set:Nn \l_@@_add_box
          {
            \skip_vertical:N \l_@@_last_skip
            \vbox_unpack_drop:N \l_@@_add_box
          }
        \tex_unskip:D
        \skip_gadd:Nn \g_@@_last_skip { \l_@@_last_skip }
      }
      { \@@_skip_stop:w }
  }
\skip_new:N \l_@@_last_skip
\skip_new:N \g_@@_last_skip
\cs_new_eq:NN \@@_skip_stop:w \@@_add_last_stop:w
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_add_last_penalty:w}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_add_last_penalty:w
  {
    \@@_if_last_penalty:TF
      {
        \int_set_eq:NN \l_@@_last_int \tex_lastpenalty:D
        \vbox_set:Nn \l_@@_add_box
          {
            \tex_penalty:D \l_@@_last_int
            \vbox_unpack_drop:N \l_@@_add_box
          }
        \tex_unpenalty:D
        \skip_gset_eq:NN \g_@@_pre_skip \g_@@_last_skip
        \skip_gzero:N \g_@@_last_skip
      }
      { \@@_penalty_stop:w }
  }
\int_new:N \l_@@_last_int
\cs_new_eq:NN \@@_penalty_stop:w \@@_add_last_stop:w
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_add_last_box:w}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_add_last_box:w
  {
    \@@_if_last_hlist:TF
      {
        \skip_gzero:N \g_@@_last_skip
        \box_set_to_last:N \l_@@_last_box
        \vbox_set:Nn \l_@@_add_box
          {
            \box_use_drop:N \l_@@_last_box
            \vbox_unpack_drop:N \l_@@_add_box
          }
      }
      { \@@_box_stop:w }
  }
\box_new:N \l_@@_last_box
\cs_new_eq:NN \@@_box_stop:w \@@_add_last_stop:w
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_add_last_finalise:w}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_add_last_finalise:w
  {
    \int_gset_eq:NN \g_@@_display_pre_int \l_@@_last_int
    \skip_gadd:Nn \g_@@_display_pre_skip { \g_@@_pre_skip }
    \int_case:nnTF { \tex_lastnodetype:D }
      {
        { \c_@@_hlist_node }   { }
        { \c_@@_none_node }    { }
        { \c_@@_whatsit_node } { }
      }
      { \box_gset_eq_drop:NN \g_@@_display_box \l_@@_add_box }
      { \vbox_unpack_drop:N \l_@@_add_box }
    \use_none_delimit_by_s_stop:w
  }
\int_new:N \g_@@_display_pre_int
\skip_new:N \g_@@_display_pre_skip
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_amsmath_boot:w,\@@_amsmath_recursion:w,\@@_amsmath_multline:w}
% \pkg{amsmath} çš„ \env{align} ç­‰æ•°å­¦çŽ¯å¢ƒå†…éƒ¨æ˜¯ä¸€ä¸ª \tn{halign} çŽ¯å¢ƒï¼Œç»“æž„ä¸ä¸€æ&nbsp;·ï¼Œéœ€è¦å¦å¤–å¤„ç†ã€‚
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_amsmath_boot:w
  {
    \@@_add_last_skip:w
    \@@_add_last_penalty:w
    \cs_set_eq:NN \@@_box_stop:w \@@_add_last_stop:w
    \@@_add_last_box:w
    \bool_gset_true:N \g_@@_amsmath_bool
    \cs_set_eq:NN \@@_skip_stop:w \@@_amsmath_multline:w
    \cs_set_eq:NN \@@_penalty_stop:w \@@_amsmath_stop:NN
    \@@_amsmath_recursion:w
  }
\cs_new_protected_nopar:Npn \@@_amsmath_recursion:w
  {
    \@@_add_last_skip:w
    \@@_add_last_skip:w
    \@@_add_last_penalty:w
    \@@_add_last_box:w
    \@@_amsmath_recursion:w
  }
\cs_new_protected:Npn \@@_amsmath_stop:NN #1#2
  {
    \cs_set_eq:NN \@@_skip_stop:w \@@_add_last_stop:w
    \cs_set_eq:NN \@@_penalty_stop:w \@@_add_last_stop:w
  }
\bool_new:N \g_@@_amsmath_bool
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_amsmath_multline:w}
% \env{multline} çŽ¯å¢ƒçš„ç»“æž„ä¸Žå…¶ä»–çŽ¯å¢ƒä¸ä¸€æ&nbsp;·ã€‚\pkg{amsmath} çš„ \tn{@display@init} å®šä¹‰ä¸º
% \begin{verbatim}
% \def\@display@init#1{%
%     \global\dt@ptrue \spread@equation
%     \everycr{%
%         \noalign{%
%             #1%
%             \ifdt@p
%                 \global\dt@pfalse
%                 \vskip-\lineskiplimit
%                 \vskip\normallineskiplimit
%             \else
%                 \penalty\@eqpen \global\dspbrk@lvl\m@ne
%             \fi
%         }%
%     }%
% }
% \end{verbatim}
% \env{align} ç­‰çŽ¯å¢ƒçš„å¼€å¤´ \tn{ifdt@p} ä¸ºçœŸï¼Œä¼šæ’å…¥ä¸¤ä¸ª \tn{vskip}ï¼Œ
% ä½†æ˜¯ \env{multline} å®šä¹‰ä¸­çš„ \tn{mmeasure@} æ²¡æœ‰é‡å®šä¹‰ \tn{everycr}ï¼Œ
% ä¸Šè¿°å®šä¹‰ä¸­çš„ \tn{dt@pfalse} è¢«æ‰§è¡Œï¼Œå¯¼è‡´çŽ¯å¢ƒå¼€å¤´è¢«åŠ&nbsp;å…¥äº† \tn{penalty}ï¼Œ
% ä¸ç¡®å®šæ˜¯æœ‰æ„ä¸ºä¹‹è¿˜æ˜¯ç–å¿½^^A
% \footnote{\url{https://github.com/latex3/latex2e/issues/793}}ã€‚
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_amsmath_multline:w
  {
    \@@_amsmath_stop:NN ? ?
    \@@_add_last_penalty:w
    \skip_gset_eq:NN \g_@@_display_pre_skip
                     \g_@@_pre_skip
    \@@_add_last_skip:w
    \@@_add_last_penalty:w
    \@@_add_last_finalise:w
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_amsmath_leqno:}
% \pkg{amsmath} çš„ \opt{leqno} æ˜¯ç›´æŽ¥ç”¨ \cs{tex_leqno:D} å®žçŽ°çš„ï¼Œä¸Ž \LaTeX\ çš„å®žçŽ°ä¸ä¸€æ&nbsp;·ã€‚
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_amsmath_leqno:
  {
    \legacy_if:nTF { tagsleft@ }
      { \bool_gset_true:N  \g_@@_leqno_bool }
      { \bool_gset_false:N \g_@@_leqno_bool }
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\@@_package_hook:nn { amsmath }
  {
    \cs_gset_eq:NN \@@_box_stop:w
                   \@@_amsmath_boot:w
    \cs_gset_eq:NN \@@_test_leqno:
                   \@@_amsmath_leqno:
  }
%    \end{macrocode}
%
% \begin{macro}{\@@_set_float:}
%    \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_set_float:
  {
    \cs_set_eq:NN \@captype \l_@@_type_tl
    \@@_float_pre_hook:
    \@@_caption_hook:
    \@floatboxreset
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_float_pre_hook:, \@@_float_pos_hook:}
%    \begin{macrocode}
\cs_new_eq:NN \@@_float_pre_hook: \@@_empty:
\cs_new_eq:NN \@@_float_pos_hook: \@@_empty:
\@@_package_hook:nn { float }
  {
    \bool_new:N \g_@@_float_pos_bool
    \cs_gset_protected_nopar:Npn \@@_float_pre_hook:
      { \exp_args:No \@@_float_pre_aux:n { \l_@@_type_tl } }
    \cs_new_protected:Npn \@@_float_pre_aux:n #1
      {
        \cs_if_exist_use:cTF { fst@ #1 }
          {
            \@float@setevery {#1}
            \bool_gset_true:N \g_@@_float_pos_bool
          }
          { \bool_gset_false:N \g_@@_float_pos_bool }
      }
    \cs_gset_protected_nopar:Npn \@@_float_pos_hook:
      {
        \bool_if:NT \g_@@_float_pos_bool
          { \exp_args:No \@@_float_pos_aux:n { \l_@@_type_tl } }
      }
    \cs_new_protected:Npn \@@_float_pos_aux:n #1
      {
        \hbox_gset:Nn \g_@@_stuff_box
          {
            \use:c { fst@ #1 }
            \cs_set_eq:NN \@currbox \g_@@_stuff_box
            \vbox_gset:Nn \g_@@_stuff_box
              { \box_use_drop:N \g_@@_stuff_box }
            \exp_args:Ne \float@makebox
              { \dim_eval:n { \box_wd:N \g_@@_stuff_box } }
          }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_floatrow_hook:}
%    \begin{macrocode}
\cs_new_eq:NN \@@_floatrow_hook: \@@_empty:
\@@_package_hook:nn { floatrow }
  {
    \cs_gset_protected_nopar:Npn \@@_floatrow_hook:
      {
        \cs_set_eq:NN \@captype \l_@@_type_tl
        \killfloatstyle
        \FR@redefs
        \dim_zero:N \FBc@wd
        \exp_args:Ne \flrow@setlist
          {
            { \l_@@_type_tl }
            { wrapfloat }
            { wrap \l_@@_type_tl }
          }
        \FRifFBOX \@@@@setframe \relax \@@@@FStrue
        \hbox_gset:Nw \g_@@_stuff_box
          \tl_set:Nx \FBB@wd { \dim_use:N \l_@@_width_dim }
          \FB@fs@wd
          \dim_set:Nn \l_@@_width_dim { \FBo@wd }
      }
    \cs_gset_protected_nopar:Npn \@@_float_pre_hook:
      { \the \FR@everyfloat }
    \cs_gset_protected_nopar:Npn \@@_float_pos_hook:
      {
        \legacy_if:nTF { FBbuild }
          {
            \cs_set_eq:NN \@currbox \g_@@_stuff_box
            \vbox_gset:Nn \g_@@_stuff_box
              { \box_use_drop:N \g_@@_stuff_box }
            \flrow@FB { \l_@@_width_dim }
          }
          {
            \cs_undefine:N \flrow@typ@tmpset
            \box_use_drop:N \g_@@_stuff_box
          }
        \hbox_gset_end:
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@@_caption_hook:}
%    \begin{macrocode}
\cs_new_eq:NN \@@_caption_hook: \@@_empty:
\@@_package_hook:nn { caption }
  {
    \cs_gset_protected_nopar:Npn \@@_caption_hook:
      { \exp_args:No \@@_caption_aux:n { \l_@@_type_tl } }
    \cs_new_protected:Npn \@@_caption_aux:n #1
      {
        \caption@settype {#1}
        \caption@clearmargin
        \caption@setoptions { wrap #1 }
      }
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{top}
%    \begin{macrocode}
\keys_define:nn { wrapstuff }
  {
    abovesep   .tl_set:N = \l_@@_abovesep_tl ,
    belowsep   .tl_set:N = \l_@@_belowsep_tl ,
    leftsep    .tl_set:N = \l_@@_leftsep_tl ,
    rightsep   .tl_set:N = \l_@@_rightsep_tl ,
    linewidth  .tl_set:N = \l_@@_linewidth_tl ,
    lines      .tl_set:N = \l_@@_lines_tl ,
    width      .tl_set:N = \l_@@_width_tl ,
    height     .tl_set:N = \l_@@_height_tl ,
    hoffset    .tl_set:N = \l_@@_hoffset_tl ,
    voffset    .tl_set:N = \l_@@_voffset_tl ,
    type       .tl_set:N = \l_@@_type_tl ,
    ratio      .fp_set:N = \l_@@_ratio_fp ,
    top       .int_set:N = \l_@@_top_int ,
    i            .code:n = \@@_swap_true:N \c_true_bool ,
    o            .code:n = \@@_swap_true:N \c_false_bool ,
    l            .code:n = \@@_swap_false:N \c_zero_fp ,
    r            .code:n = \@@_swap_false:N \c_one_fp ,
    c            .code:n = \@@_swap_false:N \c_@@_c_fp ,
    column     .choice: ,
    column/true  .code:n =
      {
        \bool_set_true:N \l_@@_column_bool
        \cs_set_eq:NN \@@_build_column:
                      \@@_build_column_strict:
      } ,
    column/par   .code:n =
      {
        \bool_set_true:N \l_@@_column_bool
        \cs_set_eq:NN \@@_build_column:
                      \@@_build_column_fuzzy:
      } ,
    column/false .code:n =
      { \bool_set_false:N \l_@@_column_bool } ,
    hsep         .code:n =
      {
        \tl_set:Nn \l_@@_leftsep_tl {#1}
        \tl_set_eq:NN \l_@@_rightsep_tl
                      \l_@@_leftsep_tl
      } ,
    vsep         .code:n =
      {
        \tl_set:Nn \l_@@_abovesep_tl {#1}
        \tl_set_eq:NN \l_@@_belowsep_tl
                      \l_@@_abovesep_tl
      } ,
    unknown      .code:n =
      { \exp_args:No \@@_unknown_key:n { \l_keys_key_str } } ,
    leftsep    .groups:n = main ,
    rightsep   .groups:n = main ,
    hsep       .groups:n = main ,
    linewidth  .groups:n = main ,
    lines      .groups:n = main ,
    column     .groups:n = main ,
    hoffset    .groups:n = main ,
    voffset    .groups:n = main ,
    top        .groups:n = stuff ,
    abovesep   .groups:n = stuff ,
    belowsep   .groups:n = stuff ,
    vsep       .groups:n = stuff ,
    width      .groups:n = stuff ,
    height     .groups:n = stuff ,
    float      .groups:n = stuff ,
    ratio      .groups:n = ratio ,
    l          .groups:n = ratio ,
    r          .groups:n = ratio ,
    c          .groups:n = ratio ,
    i          .groups:n = ratio ,
    o          .groups:n = ratio ,
    column    .default:n = true ,
    column    .initial:n = true ,
    abovesep  .initial:n = \c_zero_dim ,
    belowsep  .initial:n = \c_zero_dim ,
    leftsep   .initial:n = 1em ,
    rightsep  .initial:n = 1em ,
    linewidth .initial:n = \linewidth ,
    hoffset   .initial:n = \c_zero_dim ,
    voffset   .initial:n = \c_zero_dim ,
    width     .initial:n = \c_zero_dim ,
    height    .initial:n = \c_zero_dim ,
    ratio     .initial:n = \c_one_fp ,
    abovesep  .value_required:n = true ,
    belowsep  .value_required:n = true ,
    leftsep   .value_required:n = true ,
    rightsep  .value_required:n = true ,
    linewidth .value_required:n = true ,
    width     .value_required:n = true ,
    height    .value_required:n = true ,
    hoffset   .value_required:n = true ,
    voffset   .value_required:n = true ,
    hsep      .value_required:n = true ,
    vsep      .value_required:n = true ,
    l        .value_forbidden:n = true ,
    r        .value_forbidden:n = true ,
    c        .value_forbidden:n = true ,
    i        .value_forbidden:n = true ,
    o        .value_forbidden:n = true
  }
\fp_const:Nn \c_@@_c_fp { 0.5 }
\cs_new_protected:Npn \@@_swap_true:N #1
  {
    \bool_set_true:N \l_@@_swap_bool
    \bool_set_eq:NN \l_@@_inner_bool #1
    \bool_if:NTF \l_@@_inner_bool
      { \bool_set_false:N \l_@@_outer_bool }
      { \bool_set_true:N  \l_@@_outer_bool }
  }
\cs_new_protected_nopar:Npn \@@_swap_false:N
  {
    \bool_set_false:N \l_@@_swap_bool
    \fp_set_eq:NN \l_@@_ratio_fp
  }
\cs_new_protected:Npn \@@_unknown_key:n #1
  {
    \regex_match:NnTF \c_@@_integer_regex {#1}
      { \int_set:Nn \l_@@_top_int }
      { \@@_unknown_key_error:n }
      {#1}
  }
\regex_const:Nn \c_@@_integer_regex { \A \d+ \Z }
\cs_new_protected_nopar:Npn \@@_unknown_key_error:n
  { \msg_error:nnn { wstf } { unknown-key } }
\msg_new:nnnn { wstf } { unknown-key }
  { The~key~"#1"~is~unknown~and~is~being~ignored. }
  {
    The~package~wrapstuff~does~not~have~a~key~called~"#1".\\
    Check~that~you~have~spelled~the~key~name~correctly.
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\wrapstuffset}
%    \begin{macrocode}
\NewDocumentCommand \wrapstuffset { m }
  { \keys_set:nn { wrapstuff } {#1} }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\wrapstuffclear}
% ä¿é™©èµ·è§ï¼ŒåŠ&nbsp;å…¥ \tn{par} ç»“æŸæ®µè½ï¼ŒåŒæ—¶ç»“æŸ \env{wrapstuff@par} çŽ¯å¢ƒã€‚
%    \begin{macrocode}
\NewDocumentCommand \wrapstuffclear { }
  {
    \par
    \@@_clear:
  }
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
\cs_if_exist:NTF \ProcessKeyOptions
  { \ProcessKeyOptions [ wrapstuff ] }
  {
    \RequirePackage { l3keys2e }
    \ProcessKeysOptions { wrapstuff }
  }
%    \end{macrocode}
%
%    \begin{macrocode}
%&lt;/package&gt;
%    \end{macrocode}
%
% \end{implementation}
%
% \Finale
%
\endinput
</pre></body></html>