texlive[74944] Master: qworld (14apr25)

commits+karl at tug.org commits+karl at tug.org
Mon Apr 14 21:51:45 CEST 2025


Revision: 74944
          https://tug.org/svn/texlive?view=revision&revision=74944
Author:   karl
Date:     2025-04-14 21:51:45 +0200 (Mon, 14 Apr 2025)
Log Message:
-----------
qworld (14apr25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/qworld/README.md
    trunk/Master/texmf-dist/doc/latex/qworld/qworld.pdf
    trunk/Master/texmf-dist/doc/latex/qworld/qworld.tex
    trunk/Master/texmf-dist/tex/latex/qworld/qworld.sty
    trunk/Master/tlpkg/libexec/ctan2tds

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/qworld/qworld_en.pdf
    trunk/Master/texmf-dist/doc/latex/qworld/qworld_en.tex

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/qworld/qworld_eng.pdf
    trunk/Master/texmf-dist/doc/latex/qworld/qworld_eng.tex

Modified: trunk/Master/texmf-dist/doc/latex/qworld/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/qworld/README.md	2025-04-14 19:50:58 UTC (rev 74943)
+++ trunk/Master/texmf-dist/doc/latex/qworld/README.md	2025-04-14 19:51:45 UTC (rev 74944)
@@ -52,7 +52,10 @@
 This Package consists of the following files:
 
 - `qworld.sty` (the main package file)
-- `qworld.pdf` (documentation)
+- `qworld.pdf` (documentation compiled from `qworld.tex`)
+- `qworld.tex` (LaTeX source file for documentation)
+- `qworld_en.tex` (LaTeX source file for the English version of the documentation; compiled into `qworld_en.pdf`)
+- `qworld_en.pdf` (compiled English documentation; English version of `qworld.pdf`)
 
 The current maintainer of this package is **Niina Ryota**.
 
@@ -70,16 +73,30 @@
 Email: qworld-package at googlegroups.com
 
 ## Change Log
+### 1.1.1 (2025-04-14)
+- Color annotation for wires and tangles
+  - The `frame color` attribute is now supported for CAP and CUP structures, allowing wires to express object identity through color.
+  - Additionally BRAIDING now supports separate `L color` and `R color` options for independently coloring the left and right wires.
+- Improved wire rendering
+  - The rendering of curves has been refined to produce smoother and more aesthetically coherent diagrams.
 ### 1.1.0 (2025-04-03)
-- The following commands have been updated. The ID, which was previously a required argument for these commands, has been made optional. Users can now specify the ID via an optional key, allowing for more flexible usage of the commands.
-  - `\symbolI`, `\symbols`, `\symbolS`, `\symbolO`, `\symboln`, `\symbolN`.
-    - Specific changes:
-      - Old format: `\symbolI[i]{ID}{text}[above right]`
-      - New format: `\symbolI[i]{text}[above right, id=ID]`
-- English documentation has been added to the package.
+- Argument structure revised for symbol commands
+  - The following commands were updated to support key-value-style optional arguments instead of mandatory positional arguments:
+    - `\symbolI`
+    - `\symbols`
+    - `\symbolS`
+    - `\symbolO`
+    - `\symboln`
+    - `\symbolN`
+  - Specific changes:
+    - Old format: `\symbolI[i]{ID}{text}[position options]`
+    - New format: `\symbolI[i]{text}[position opotions, id=ID]`
+  - With this revision, the `ID` parameter is now optional. In simple cases, `\symbolI{text}` suffices. This change enables more concise and readable definitions.
+- English documentation
+  - An English version of the user guide has been added.
 
 ### 1.0.0 (2025-04-01)
-- Initial release of the package.
+- Initial release.
 
 ## Contributions
 

Modified: trunk/Master/texmf-dist/doc/latex/qworld/qworld.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/qworld/qworld.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/qworld/qworld.tex	2025-04-14 19:50:58 UTC (rev 74943)
+++ trunk/Master/texmf-dist/doc/latex/qworld/qworld.tex	2025-04-14 19:51:45 UTC (rev 74944)
@@ -17,6 +17,8 @@
 \usepackage{mathrsfs}
 %\numberwithin{equation}{subsection}
 
+\usepackage{changelog}
+
 \usepackage{framed}
 \newenvironment{longshadowbox}{%
   \def\FrameCommand{\fboxsep=\FrameSep \shadowbox}%
@@ -135,10 +137,24 @@
   #1
 }
 
+\usepackage{xcolor}
+\NewDocumentCommand{\showcmd}{O{\textbackslash} m O{black}}{%
+    \leavevmode%
+    \ifthenelse{\equal{#3}{new}}{%
+        \textcolor{green!50!black}{\texttt{#1#2}}%
+    }{%
+        \ifthenelse{\equal{#3}{old}}{%
+            \textcolor{red}{\texttt{#1#2}}%
+        }{%
+            \textcolor{#3}{\texttt{#1#2}}%
+        }%
+    }%
+}
+
 \begin{document}
 \title{
     \Huge \textbf{\qworldname}\\[4pt]
-    \scriptsize\texttt{Version 1.1.0} \\[4pt]
+    \scriptsize\texttt{Version 1.1.1} \\[4pt]
 }
 \author{
     \textbf{新名 亮太} \\[4pt]
@@ -153,25 +169,27 @@
 \end{abstract}
 
 \tableofcontents
+
 \section{導入}
 本稿では, \qworldname パッケージのインストール方法, 基本的な使用法, 応用例を体系的に解説する. 
 \qworldname は, モノイダル圏に基づく図式言語の組版に特化した\LaTeX パッケージであり, 
 モノイダル圏, フロベニウス構造, 組紐, ホップ代数, シンメトリー, 双対性, ピボタル構造, ダガーなど, 多岐にわたる圏論的概念を図式表現するための直感的なコマンドセットを提供する.  
+
 \section{基本的な使い方}
 \subsection{基本要素}
 \qworldname パッケージのの最も基本的なコマンドを以下に示す. 
 これらは図式を描画するための基礎となる. 
 \begin{itemize}
-  \item \texttt{\textbackslash q}: 図の素子を配置するためのキャンバス.
-  \item \texttt{\textbackslash qbox}: ボックス\q[scale=0.5]{\qbox}の描画.
-  \item \texttt{\textbackslash qwire}: ワイヤー\q[scale=0.5]{\qwire}の描画.
-  \item \texttt{\textbackslash qcirc}: 合成.
+  \item \showcmd{q}: 図の素子を配置するためのキャンバス.
+  \item \showcmd{qbox}: ボックス\q[scale=0.5]{\qbox}の描画.
+  \item \showcmd{qwire}: ワイヤー\q[scale=0.5]{\qwire}の描画.
+  \item \showcmd{qcirc}: 合成.
 \end{itemize}
   これらのコマンドは, キャンバスである\verb|\q{...}|内に記述する. 
   例えば\verb|\q{\qbox}|と記述すると, ボックス\q[scale=0.5]{\qbox}が描画される.\par
   \(\q[scale=0.5]{\qbox}\)と\(\q[scale=0.5]{\qbox}\)を合成するためには, \verb|\qcirc|を使用する. 
   これは数学における合成\(g\circ f\) (\verb|\(g\circ f\)|) と似ている. 
-  \begin{codebox}{}{Ex:20250317}
+  \begin{codebox}{}{Ex:7812973891217}
     \q{ \qbox \qcirc \qbox }
   \end{codebox}
   また, \verb|\qbox| を並置すると, 描画結果でもボックス\(\q[scale=0.5]{\qbox}\)が横に並ぶ:
@@ -195,12 +213,81 @@
       \qbox \qbox \qbox
     }
 \end{codebox}
-\subsubsection{識別番号}
+\begin{codebox}{}{ex:hopflink}
+  \q{
+    \qcaprev \qcap          \n
+    \qwire   \qbraid \qwire \n
+    \qwire   \qbraid \qwire \n
+    \qcup    \qcuprev
+  }
+\end{codebox}
+\verb|\qcaprev|は\q[scale=0.6]{\qcaprev}を, 
+\verb|\qcap|は\q[scale=0.6]{\qcap}を, 
+\verb|\qwire|は\q[scale=0.5]{\qwire}を, 
+\verb|\qbraid|は\q[scale=0.5]{\qbraid}を, 
+\verb|\qcup|は\q[scale=0.6]{\qcup}を, 
+\verb|\qcuprev|は\q[scale=0.6]{\qcuprev}を, 各々描画する. 
+全体として, コマンドの配置の通りに描画されていることが分かる.\par
+\subsection{数式モード}
+図式言語を含んだ数式を記述する場合は, 数式モードを使用する. 
+\begin{CODEBOX}{}{IntroEx}
+  \[
+    \operatorname{Tr}\left(
+      \q{
+        \qbraid\n
+        \qbraid
+      }
+    \right)
+    =\q{
+      \qcap    \qcap             \n
+      \qwire   \qbraidinv \qwire \n
+      \qwire   \qbraidinv \qwire \n
+      \qcuprev \qcuprev
+    }
+  \]
+\end{CODEBOX}
+
+\subsection{インストール}
+\qworldname パッケージのスタイルファイル\verb|qworld.sty|はCTANからダウンロード可能である. 
+\TeX のパッケージディレクトリに配置し, 
+プリアンブルに以下を記述することで使用可能となる:
+\begin{verbatim}
+  \usepackage{qworld}
+\end{verbatim}
+
+依存パッケージは以下の通りである:
+\begin{itemize}
+    \item \tikzname
+      \iitem \showcmd[]{cd}
+      \iitem \showcmd[]{positioning}
+      \iitem \showcmd[]{arrows}
+      \iitem \showcmd[]{arrows.meta}
+      \iitem \showcmd[]{calc}
+      \iitem \showcmd[]{intersections}
+      \iitem \showcmd[]{shapes.symbols}
+      \iitem \showcmd[]{shapes.geometric}
+      \iitem \showcmd[]{shapes.misc}
+      \iitem \showcmd[]{decorations.pathreplacing}
+      \iitem \showcmd[]{decorations.markings}
+      \iitem \showcmd[]{decorations.pathmorphing}
+    \item \showcmd[]{pgffor}
+    \item \showcmd[]{ifthen}
+    \item \showcmd[]{xparse}
+    \item \showcmd[]{xfp}
+    \item \showcmd[]{xstring}
+\end{itemize}
+これらのパッケージは\texlivename ディストリビューションに標準で含まれており, 特別な手間をかける必要はない. 
+\section{基本的なカスタマイズ}
+本節では, \qworldname のコマンドをカスタマイズする方法を解説する.
+\subsection{識別番号}
+
 \verb|\q{...}|内に配置された全てのコマンドには, 実行順に基づいて自動的に固有の識別番号が割り当てられる. 
 例えば, 先の例 \ref{boxsn} では各\verb|\qbox|に番号が振られる:
 \[\q{\qloop[2]{\qloop[3]{\qbox[show id={true}]}\n}}\]
 詳細は, \pageref{subsub:show id}ページの\ref{subsub:show id}項を参照せよ.
-\subsubsection{バウンディングボックス}
+
+\subsection{バウンディングボックス}
+
 \[\q{
   \qcaprev \qcap           \n
   \qwire   \qbraid  \qwire \n
@@ -218,250 +305,192 @@
     \bbsymbol{Create}
     \bbsymbol[W]{Initialize}[left]
 }\]
-次の例 \ref{ex:hopflink} をみよ:
-\begin{codebox}{}{ex:hopflink}
+
+各素子には, バウンディングボックスが付随する. 
+以下に例を示す:
+\begin{itemize}
+  \item \q{\qcaprev}のバウンディングボックスを可視化すると\q{\qcaprev\qbball}.
+  \item \q{\qbraid}のバウンディングボックスを可視化すると\q{\qbraid\qbball}.
+  \item \q{\qwire}のバウンディングボックスを可視化すると\q{\qwire\qbball}.
+  \item \q{\qcuprev}のバウンディングボックスを可視化すると\q{\qcuprev\qbball}.
+\end{itemize}
+バウンディングボックスを可視化するコマンドと, 
+可視化したバウンディングボックス近辺にテキストを置くコマンドは次の通りである:
+\begin{itemize}
+  \item 可視化
+    \iitem \showcmd{qbb}: 特定の素子のバウンディングボックスを表示.
+    \iitem \showcmd{qbball}: 全ての素子のバウンディングボックスを一度に表示.
+    \iitem \showcmd{qBBall}: キャンバス全体を囲むバウンディングボックスをを表示.
+  \item テキストを置く
+    \iitem \showcmd{bbsymbol}: バウンディングボックスにテキストを配置.
+\end{itemize}
+
+\begin{verbatim}
+  \qbb[<色>][<ID列>]
+\end{verbatim}
+\begin{itemize}
+  \item 第一引数 (オプション): 色を指定. 未指定の場合は無色. 
+  \item 第二引数: 対象となる素子の識別番号のリストを指定し, それらを含むバウンディングボックスを表示.
+\end{itemize}
+\begin{codebox}{}{Ex:7812973891220}
+  \q{\qbox\qbb[1]}
+\end{codebox}
+\begin{codebox}{}{ex:78129738912270454}
   \q{
     \qcaprev \qcap          \n
     \qwire   \qbraid \qwire \n
     \qwire   \qbraid \qwire \n
     \qcup    \qcuprev
+    \qbb[4,7]
   }
 \end{codebox}
-\verb|\qcaprev|は\q[scale=0.6]{\qcaprev}を, 
-\verb|\qcap|は\q[scale=0.6]{\qcap}を, 
-\verb|\qwire|は\q[scale=0.5]{\qwire}を, 
-\verb|\qbraid|は\q[scale=0.5]{\qbraid}を, 
-\verb|\qcup|は\q[scale=0.6]{\qcup}を, 
-\verb|\qcuprev|は\q[scale=0.6]{\qcuprev}を, 各々描画する. 
-全体として, コマンドの配置の通りに描画されていることが分かる.\par
-  各素子には, バウンディングボックスが付随する. 
-  以下に例を示す:
-  \begin{itemize}
-    \item \q{\qcaprev}のバウンディングボックスを可視化すると\q{\qcaprev\qbball}.
-    \item \q{\qbraid}のバウンディングボックスを可視化すると\q{\qbraid\qbball}.
-    \item \q{\qwire}のバウンディングボックスを可視化すると\q{\qwire\qbball}.
-    \item \q{\qcuprev}のバウンディングボックスを可視化すると\q{\qcuprev\qbball}.
-  \end{itemize}
-  バウンディングボックスを可視化するコマンドと, 
-  可視化したバウンディングボックス近辺にテキストを置くコマンドは次の通りである:
-  \begin{itemize}
-    \item 可視化
-      \iitem \texttt{\textbackslash qbb}: 特定の素子のバウンディングボックスを表示.
-      \iitem \texttt{\textbackslash qbball}: 全ての素子のバウンディングボックスを一度に表示.
-      \iitem \texttt{\textbackslash qBBall}: キャンバス全体を囲むバウンディングボックスをを表示.
-    \item テキストを置く
-      \iitem \texttt{\textbackslash bbsymbol}: バウンディングボックスにテキストを配置.
-  \end{itemize}
-  
-  \begin{verbatim}
-    \qbb[<色>][<ID列>]
-  \end{verbatim}
-  \begin{itemize}
-    \item 第一引数 (オプション): 色を指定. 未指定の場合は無色. 
-    \item 第二引数: 対象となる素子の識別番号のリストを指定し, それらを含むバウンディングボックスを表示.
-  \end{itemize}
-  \begin{codebox}{}{Ex:20250320}
-    \q{\qbox\qbb[1]}
-  \end{codebox}
-  \begin{codebox}{}{ex:202503270454}
-    \q{
-      \qcaprev \qcap          \n
-      \qwire   \qbraid \qwire \n
-      \qwire   \qbraid \qwire \n
-      \qcup    \qcuprev
-      \qbb[4,7]
-    }
-  \end{codebox}
-  \begin{CODEBOX}{}{Ex:20250321}
-    \q{\qbox\qbox\qbox\qbox\qbox\qbox\qbb[yellow][2,...,5]}
-  \end{CODEBOX}
-  \begin{codebox}{}{Ex:20250222}
-    \q
-    {
-      \qbox\qbox\qbox\n
-      \qbox\qbox\qbox
-      \qbb[green][2,5]
-    }
-  \end{codebox}
-  \begin{codebox}{}{Ex:20250318}
-    \q{
-      \qcaprev \qcap          \n
-      \qwire   \qbraid \qwire \n
-      \qwire   \qbraid \qwire \n
-      \qcup    \qcuprev
-      \qbb[blue][4,7]
-    }
-  \end{codebox}
-  \begin{verbatim}
-    \qbball[<色>]
-  \end{verbatim}
-  複数 (一個でも良いが) のバウンディングボックスを一度に可視化する. 
-  \begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{Ex:202503270511}
-    \q{
-      \qcaprev \qcap          \n
-      \qwire   \qbraid \qwire \n
-      \qwire   \qbraid \qwire \n
-      \qcup    \qcuprev
-      \qbball
-    }
-  \end{codebox}
-  各素子のバウンディングボックスが重なることなく組み合っていることが判る. 
-  \qworldname パッケージは, 図式描画に伴う\textbf{細かく面倒な座標設定の多くを省略できる}.
+\begin{CODEBOX}{}{Ex:7812973891221}
+  \q{\qbox\qbox\qbox\qbox\qbox\qbox\qbb[yellow][2,...,5]}
+\end{CODEBOX}
+\begin{codebox}{}{Ex:74839722}
+  \q
+  {
+    \qbox\qbox\qbox\n
+    \qbox\qbox\qbox
+    \qbb[green][2,5]
+  }
+\end{codebox}
+\begin{codebox}{}{Ex:7812973891218}
+  \q{
+    \qcaprev \qcap          \n
+    \qwire   \qbraid \qwire \n
+    \qwire   \qbraid \qwire \n
+    \qcup    \qcuprev
+    \qbb[blue][4,7]
+  }
+\end{codebox}
+\begin{verbatim}
+  \qbball[<色>]
+\end{verbatim}
+複数 (一個でも良いが) のバウンディングボックスを一度に可視化する. 
+\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{Ex:78129738912270511}
+  \q{
+    \qcaprev \qcap          \n
+    \qwire   \qbraid \qwire \n
+    \qwire   \qbraid \qwire \n
+    \qcup    \qcuprev
+    \qbball
+  }
+\end{codebox}
+各素子のバウンディングボックスが重なることなく組み合っていることが判る. 
+\qworldname パッケージは, 図式描画に伴う\textbf{細かく面倒な座標設定の多くを省略できる}.
 
-  \begin{verbatim}
-    \qBBall[<色>]
-  \end{verbatim}
-  キャンバス内の全素子を囲むバウンディングボックスを表示する. 
-  \begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{Ex:20250316}
-    \q{
-      \qcaprev \qcap          \n
-      \qwire   \qbraid \qwire \n
-      \qwire   \qbraid \qwire \n
-      \qcup    \qcuprev
-      \qBBall
-    }
-  \end{codebox}
-  \begin{verbatim}
-    \bbsymbol[<方角>]{<text>}[<オプション>]
-  \end{verbatim}
-  直前のバウンディングボックスにテキストを配置する. 
-  \begin{itemize}
-    \item 第一引数 (オプション): \texttt{N} (北), \texttt{S} (南), \texttt{E} (東), \texttt{S} (西), \texttt{NW} (北西), \texttt{NE} (北東), \texttt{SE} (南東), \texttt{SW} (南西) のいずれかを指定. デフォルトは\texttt{E}.
-    \item 第二引数: 配置するテキスト.
-    \item 第三引数 (オプション): 位置調整 (例: \texttt{above}, \texttt{below}, \texttt{left}, \texttt{right}). デフォルトは\texttt{right}.
-  \end{itemize}
-  \begin{CODEBOX}{}{Ex:bbsymbol}
-    \q[scale=5]{
-      \qbox
-      \qbb[1]
-      \bbsymbol{東 (デフォルト)}
-      \bbsymbol[W]{西}[left]
-      \bbsymbol[N]{北}[above]
-      \bbsymbol[S]{南}[below]
-      \bbsymbol[NE]{北東}[above right]
-      \bbsymbol[NW]{北西}[above left]
-      \bbsymbol[SE]{南東}[below right]
-      \bbsymbol[SW]{南西}[below left]
-      \bbsymbol[C]{重心}[]
-    }
-  \end{CODEBOX}
-  \begin{CODEBOX}{}{Ex:20250315}
-    \q
-    {
-      \qcaprev \qcap          \n
-      \qwire   \qbraid \qwire \n
-      \qwire   \qbraid \qwire \n
-      \qcup    \qcuprev
-      \qbb[red][1,2]
-        \bbsymbol{Measure}
-        \bbsymbol[W]{Output}[left]
-        \bbsymbol[NW]{Computation}[above left]
-        \bbsymbol[NE]{Physics}[above right]
-      \qbb[yellow][3,5,6,8]
-        \bbsymbol{Braid}
-        \bbsymbol[W]{Compute}[left]
-      \qbb[cyan][9,10]
-        \bbsymbol{Create}
-        \bbsymbol[W]{Initialize}[left]
-    }
-  \end{CODEBOX}
-
-  \subsubsection{数式モード}
-  図式言語を含んだ数式を記述する場合は, 数式モードを使用する. 
-  \begin{CODEBOX}{}{IntroEx}
-    \[
-      \operatorname{Tr}\left(\q{\qbraid\qcirc\qbraid}\right)
-      =\q{
-        \qcap    \qcap             \n
-        \qwire   \qbraidinv \qwire \n
-        \qwire   \qbraidinv \qwire \n
-        \qcuprev \qcuprev
-      }
-    \]
-  \end{CODEBOX}
-
-  \subsection{インストール}
-  \qworldname パッケージのスタイルファイル\verb|qworld.sty|はCTANからダウンロード可能である. 
-  \TeX のパッケージディレクトリに配置し, 
-  プリアンブルに以下を記述することで使用可能となる:
-  \begin{verbatim}
-    \usepackage{qworld}
-  \end{verbatim}
-  
-  依存パッケージは以下の通りである:
-  \begin{itemize}
-      \item \tikzname
-        \iitem \texttt{cd}
-        \iitem \texttt{positioning}
-        \iitem \texttt{arrows}
-        \iitem \texttt{arrows.meta}
-        \iitem \texttt{calc}
-        \iitem \texttt{intersections}
-        \iitem \texttt{shapes.symbols}
-        \iitem \texttt{shapes.geometric}
-        \iitem \texttt{shapes.misc}
-        \iitem \texttt{decorations.pathreplacing}
-        \iitem \texttt{decorations.markings}
-        \iitem \texttt{decorations.pathmorphing}
-      \item \texttt{pgffor}
-      \item \texttt{ifthen}
-      \item \texttt{xparse}
-      \item \texttt{xfp}
-      \item \texttt{xstring}
-  \end{itemize}
-  これらのパッケージは\texlivename ディストリビューションに標準で含まれており, 特別な手間をかける必要はない. 
-\subsection{基本的なカスタマイズ}
-本節では, \qworldname のコマンドをカスタマイズする方法を解説する.
-  \subsubsection{ボックスのカスタマイズ}
-  \label{subsubsec:boxcustomization}
+\begin{verbatim}
+  \qBBall[<色>]
+\end{verbatim}
+キャンバス内の全素子を囲むバウンディングボックスを表示する. 
+\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{Ex:7812973891216}
+  \q{
+    \qcaprev \qcap          \n
+    \qwire   \qbraid \qwire \n
+    \qwire   \qbraid \qwire \n
+    \qcup    \qcuprev
+    \qBBall
+  }
+\end{codebox}
+\begin{verbatim}
+  \bbsymbol[<方角>]{<text>}[<オプション>]
+\end{verbatim}
+直前のバウンディングボックスにテキストを配置する. 
+\begin{itemize}
+  \item 第一引数 (オプション): \showcmd[]{N} (北), \showcmd[]{S} (南), \showcmd[]{E} (東), \showcmd[]{S} (西), \showcmd[]{NW} (北西), \showcmd[]{NE} (北東), \showcmd[]{SE} (南東), \showcmd[]{SW} (南西) のいずれかを指定. デフォルトは\showcmd[]{E}.
+  \item 第二引数: 配置するテキスト.
+  \item 第三引数 (オプション): 位置調整 (例: \showcmd[]{above}, \showcmd[]{below}, \showcmd[]{left}, \showcmd[]{right}). デフォルトは\showcmd[]{right}.
+\end{itemize}
+\begin{CODEBOX}{}{Ex:bbsymbol}
+  \q[scale=5]{
+    \qbox
+    \qbb[1]
+    \bbsymbol{東 (デフォルト)}
+    \bbsymbol[W]{西}[left]
+    \bbsymbol[N]{北}[above]
+    \bbsymbol[S]{南}[below]
+    \bbsymbol[NE]{北東}[above right]
+    \bbsymbol[NW]{北西}[above left]
+    \bbsymbol[SE]{南東}[below right]
+    \bbsymbol[SW]{南西}[below left]
+    \bbsymbol[C]{重心}[]
+  }
+\end{CODEBOX}
+\begin{CODEBOX}{}{Ex:7812973891215}
+  \q
+  {
+    \qcaprev \qcap          \n
+    \qwire   \qbraid \qwire \n
+    \qwire   \qbraid \qwire \n
+    \qcup    \qcuprev
+    \qbb[red][1,2]
+      \bbsymbol{Measure}
+      \bbsymbol[W]{Output}[left]
+      \bbsymbol[NW]{Computation}[above left]
+      \bbsymbol[NE]{Physics}[above right]
+    \qbb[yellow][3,5,6,8]
+      \bbsymbol{Braid}
+      \bbsymbol[W]{Compute}[left]
+    \qbb[cyan][9,10]
+      \bbsymbol{Create}
+      \bbsymbol[W]{Initialize}[left]
+  }
+\end{CODEBOX}
+\subsection{ボックスのカスタマイズ}
+\label{subsec:boxcustomization}
 キーを使い, ボックスの経線の数や配置を調整できる. 
-例えば\q[scale=0.5]{\qbox[p=20,hlen=3]}や\q[scale=0.5]{\qbox[p=10,N={1,2,3,8,9,10},S={4,5,6,7},hlen=3]}などを描画可能である. 
+例えば以下のようなボックスが描画可能である:
+\begin{itemize}
+  \item \(\q[scale=0.5]{\qbox[p=20,hlen=3]}\)
+  \item \(\q[scale=0.5]{\qbox[p=10,N={1,2,3,8,9,10},S={4,5,6,7},hlen=3]}\)
+\end{itemize}
 これらのキーはワイヤー以外の多くの素子にも適用可能である. 
 主要なキーは以下の通り:
 \begin{itemize}
-  \item \texttt{n}
-      \iitem ボックス\(\q[scale=0.5]{\qbox[p=2, P={}]}\)の北縁において経線\q[scale=0.31]{\qwire}を生やすことができる点 (このような点を\texttt{n}端子と呼ぶこととする) の数. 
-      \iitem 例えば \texttt{n=3}とすれば, ボックスの北縁に \(3\) 点等間隔に打つことができる.
-      \iitem デフォルト値は \texttt{n=1}.
-      \iitem \texttt{n}端子を最北端まで垂直移動させた点を\texttt{N}端子と呼ぶ. 
-      \iitem \texttt{n}端子及び\texttt{N}端子は西 (左) から順に\(1,2,...\)と添え字付けられる.
-      \iitem \(i\)番目の\texttt{n}端子に経線を生やすとは, \(i\)番目の\texttt{n}端子と\(i\)番目の\texttt{N}端子を線分で結ぶことをいう.
-  \item \texttt{N}
-      \iitem 経線を実際に生やす\texttt{n}端子の添え字の集合.
-      \iitem 例えば \texttt{n=3}とした上で\texttt{N=\{2\}}とすれば, \(3\)点のうち\(2\)番目の\texttt{n}端子に経線を生やすことができる.
-      \iitem \texttt{n}が未指定で, \texttt{N}が指定されているときは, 自動で \(\texttt{n}\coloneq\max\texttt{N}\) となる. 
-      \iitem \texttt{N}が未指定で, \texttt{n}が指定されているときは, 自動で \(\texttt{N}\coloneq\{1,...,\texttt{n}\}\) となる. 
-      \iitem \texttt{n}端子から実際に生えた経線の最北端を出力点, あるいは\texttt{O}端子と呼ぶこととする.
-  \item \texttt{s}
-      \iitem ボックスの南縁において経線を生やすことができる点 (このような点を\texttt{s}端子と呼ぶこととする) の数. 
-      \iitem 例えば \texttt{s=4}とすれば, ボックスの南縁に\(4\)点等間隔に打つことができる.
-      \iitem デフォルト値は\texttt{s=1}. 
-      \iitem \texttt{s}端子を最南端まで垂直移動させた点を\texttt{S}端子と呼ぶ. 
-      \iitem \texttt{s}端子及び\texttt{S}端子は西 (左) から順に\(1,2,...\)と添え字付けられる.
-      \iitem \(i\)番目の\texttt{s}端子に経線を生やすとは, \(i\)番目の\texttt{s}端子と\(i\)番目の\texttt{S}端子を線分で結ぶことをいう.
-  \item \texttt{S}
-      \iitem 経線を実際に生やす\texttt{s}端子の添え字の集合.
-      \iitem 例えば \texttt{s=4}とした上で \texttt{S=\{1,4\}} とすれば,  \(4\)点のうち\(1\)番目と\(4\)番目の点に経線を生やすことができる.
-      \iitem \texttt{s}が未指定で, \texttt{S}が指定されているときは, 自動で \(\texttt{s}\coloneq\max \texttt{S}\) となる. 
-      \iitem \texttt{S}が未指定で, \texttt{s}が指定されているときは, 自動で \(\texttt{S}\coloneq\{1,...,\texttt{s}\}\) となる.
-      \iitem \texttt{s}端子から実際に生えた経線の最南端を入力点, あるいは\texttt{I}端子と呼ぶこととする.
-  \item \texttt{hlen}
+  \item \showcmd[]{n}
+      \iitem ボックス\(\q[scale=0.5]{\qbox[p=2, P={}]}\)の北縁において経線\q[scale=0.31]{\qwire}を生やすことができる点 (このような点を\showcmd[]{n}端子と呼ぶこととする) の数. 
+      \iitem 例えば \showcmd[]{n=3}とすれば, ボックスの北縁に \(3\) 点等間隔に打つことができる.
+      \iitem デフォルト値は \showcmd[]{n=1}.
+      \iitem \showcmd[]{n}端子を最北端まで垂直移動させた点を\showcmd[]{N}端子と呼ぶ. 
+      \iitem \showcmd[]{n}端子及び\showcmd[]{N}端子は西 (左) から順に\(1,2,...\)と添え字付けられる.
+      \iitem \(i\)番目の\showcmd[]{n}端子に経線を生やすとは, \(i\)番目の\showcmd[]{n}端子と\(i\)番目の\showcmd[]{N}端子を線分で結ぶことをいう.
+  \item \showcmd[]{N}
+      \iitem 経線を実際に生やす\showcmd[]{n}端子の添え字の集合.
+      \iitem 例えば \showcmd[]{n=3}とした上で\showcmd[]{N=\{2\}}とすれば, \(3\)点のうち\(2\)番目の\showcmd[]{n}端子に経線を生やすことができる.
+      \iitem \showcmd[]{n}が未指定で, \showcmd[]{N}が指定されているときは, 自動で \(\showcmd[]{n}\coloneq\max\showcmd[]{N}\) となる. 
+      \iitem \showcmd[]{N}が未指定で, \showcmd[]{n}が指定されているときは, 自動で \(\showcmd[]{N}\coloneq\{1,...,\showcmd[]{n}\}\) となる. 
+      \iitem \showcmd[]{n}端子から実際に生えた経線の最北端を出力点, あるいは\showcmd[]{O}端子と呼ぶこととする.
+  \item \showcmd[]{s}
+      \iitem ボックスの南縁において経線を生やすことができる点 (このような点を\showcmd[]{s}端子と呼ぶこととする) の数. 
+      \iitem 例えば \showcmd[]{s=4}とすれば, ボックスの南縁に\(4\)点等間隔に打つことができる.
+      \iitem デフォルト値は\showcmd[]{s=1}. 
+      \iitem \showcmd[]{s}端子を最南端まで垂直移動させた点を\showcmd[]{S}端子と呼ぶ. 
+      \iitem \showcmd[]{s}端子及び\showcmd[]{S}端子は西 (左) から順に\(1,2,...\)と添え字付けられる.
+      \iitem \(i\)番目の\showcmd[]{s}端子に経線を生やすとは, \(i\)番目の\showcmd[]{s}端子と\(i\)番目の\showcmd[]{S}端子を線分で結ぶことをいう.
+  \item \showcmd[]{S}
+      \iitem 経線を実際に生やす\showcmd[]{s}端子の添え字の集合.
+      \iitem 例えば \showcmd[]{s=4}とした上で \showcmd[]{S=\{1,4\}} とすれば,  \(4\)点のうち\(1\)番目と\(4\)番目の点に経線を生やすことができる.
+      \iitem \showcmd[]{s}が未指定で, \showcmd[]{S}が指定されているときは, 自動で \(\showcmd[]{s}\coloneq\max \showcmd[]{S}\) となる. 
+      \iitem \showcmd[]{S}が未指定で, \showcmd[]{s}が指定されているときは, 自動で \(\showcmd[]{S}\coloneq\{1,...,\showcmd[]{s}\}\) となる.
+      \iitem \showcmd[]{s}端子から実際に生えた経線の最南端を入力点, あるいは\showcmd[]{I}端子と呼ぶこととする.
+  \item \showcmd[]{hlen}
       \iitem 水平方向のバウンディングボックスの長さ.
-      \iitem 例えば\texttt{hlen=2}とすれば, 水平方向のバウンディングボックスの長さが\(2\)となる. 
-      \iitem 唯一つの例外を除いて, 最西端の経線とバウンディングボックスの境界線との距離, 最東端の経線とバウンディングボックスの境界線との距離はともに\(\fpeval{0.5*\qwireinterval}\)である. 
-      \iitem \texttt{hlen}が未指定であるとき, \texttt{n}端子及び\texttt{s}端子は, 間隔を\(1\)に保って並べられる. 
-      \iitem \texttt{hlen}が指定されているとき, \texttt{n}端子及び\texttt{s}端子は, 長さ\(\texttt{hlen}-\fpeval{\qwireinterval}\)の区間を等間隔に並べられる. このときの端子の間隔は\texttt{hlen}及び端子の数に依存する. 
-          \iiitem 端子の数が\(1\)つであるときは, 区間の中心に置かれる. このとき, \(\texttt{hlen}>1\) であるならば, 最西端の経線とバウンディングボックスの境界線との距離, 及び最東端の経線とバウンディングボックスの境界線との距離はともに\(\frac{\texttt{hlen}}{2}>\fpeval{0.5*\qwireinterval}\)である. 
-  \item \texttt{vlen}
+      \iitem 例えば\showcmd[]{hlen=2}とすれば, 水平方向のバウンディングボックスの長さが\(2\)となる. 
+      \iitem 唯一つの例外を除いて, 最西端の経線とバウンディングボックスの境界線との距離, 最東端の経線とバウンディングボックスの境界線との距離はともに\(\fpeval{0.5}\)である. 
+      \iitem \showcmd[]{hlen}が未指定であるとき, \showcmd[]{n}端子及び\showcmd[]{s}端子は, 間隔を\(1\)に保って並べられる. 
+      \iitem \showcmd[]{hlen}が指定されているとき, \showcmd[]{n}端子及び\showcmd[]{s}端子は, 長さ\(\showcmd[]{hlen}-1\)の区間を等間隔に並べられる. このときの端子の間隔は\showcmd[]{hlen}及び端子の数に依存する. 
+          \iiitem 端子の数が\(1\)つであるときは, 区間の中心に置かれる. このとき, \(\showcmd[]{hlen}>1\) であるならば, 最西端の経線とバウンディングボックスの境界線との距離, 及び最東端の経線とバウンディングボックスの境界線との距離はともに\(\frac{\showcmd[]{hlen}}{2}>\fpeval{0.5}\)である. 
+  \item \showcmd[]{vlen}
       \iitem 垂直方向のバウンディングボックスの長さ (高さ).
-      \iitem デフォルト値は \texttt{vlen=1}. 
-  \item \texttt{id}
+      \iitem デフォルト値は \showcmd[]{vlen=1}. 
+  \item \showcmd[]{id}
       \iitem ボックスの識別子. 
-      \iitem 例えば\texttt{id=ID}とすれば, ここまで登場した様々な点に次のような名前が自動的に付けられる:
-          \iiitem (西から数えて) \(i\)番目の\texttt{n}端子: (n-\(i\)-ID)
-          \iiitem \(i\)番目の\texttt{s}端子: (s-\(i\)-ID)
-          \iiitem \(i\)番目の\texttt{n}端子をボックスの北縁へ垂直移動させた点: (N-\(i\)-ID)
-          \iiitem \(i\)番目の\texttt{s}端子をボックスの南縁へ垂直移動させた点: (S-\(i\)-ID)
+      \iitem 例えば\showcmd[]{id=ID}とすれば, ここまで登場した様々な点に次のような名前が自動的に付けられる:
+          \iiitem (西から数えて) \(i\)番目の\showcmd[]{n}端子: (n-\(i\)-ID)
+          \iiitem \(i\)番目の\showcmd[]{s}端子: (s-\(i\)-ID)
+          \iiitem \(i\)番目の\showcmd[]{n}端子をボックスの北縁へ垂直移動させた点: (N-\(i\)-ID)
+          \iiitem \(i\)番目の\showcmd[]{s}端子をボックスの南縁へ垂直移動させた点: (S-\(i\)-ID)
           \iiitem バウンディングボックスの最北西端: (NW-ID)
           \iiitem バウンディングボックスの最北東端: (NE-ID)
           \iiitem バウンディングボックスの最南西端: (SW-ID)
@@ -481,12 +510,12 @@
           \iiitem ボックスの最東端: (e-ID)
           \iiitem \(i\) 番目の出力点: (O-\(i\)-ID)
           \iiitem \(i\) 番目の入力点: (I-\(i\)-ID)
-      \iitem 指定の有無にかかわらず, \texttt{\textbackslash q\{...\}}内に置かれた各コマンドには識別番号が振られている. 各々\texttt{ID}部分をその番号に置き換えても同じ点を表す. 詳細は \ref{subsub:show id} 項を確認されたし. 
-    \item \texttt{p}, \texttt{P}
-        \iitem 正整数\texttt{k}に対して, \texttt{p=k}は\texttt{n=k}, \texttt{s=k}を意味する. 
-        \iitem 正整数の有限集合\texttt{K}に対して, \texttt{P=K}は\texttt{N=K}, \texttt{S=K}を意味する. 
-    \item \texttt{name}
-        \iitem \texttt{name=<text>} により, ボックスの重心に\texttt{<text>}が置かれる. 
+      \iitem 指定の有無にかかわらず, \showcmd{q\{...\}}内に置かれた各コマンドには識別番号が振られている. 各々\showcmd[]{ID}部分をその番号に置き換えても同じ点を表す. 詳細は \ref{subsub:show id} 項を確認されたし. 
+    \item \showcmd[]{p}, \showcmd[]{P}
+        \iitem 正整数\showcmd[]{k}に対して, \showcmd[]{p=k}は\showcmd[]{n=k}, \showcmd[]{s=k}を意味する. 
+        \iitem 正整数の有限集合\showcmd[]{K}に対して, \showcmd[]{P=K}は\showcmd[]{N=K}, \showcmd[]{S=K}を意味する. 
+    \item \showcmd[]{name}
+        \iitem \showcmd[]{name=<text>} により, ボックスの重心に\showcmd[]{<text>}が置かれる. 
 \end{itemize}
 \begin{CODEBOX}{}{ex:boxpoints}
   \def\pradius{0.4pt}
@@ -551,8 +580,8 @@
   }
 \end{CODEBOX}
 \verb|\qwire|の\verb|arrowtype|キーと\verb|dom|, \verb|cod|キーは
-\pageref{subsubsec:wirecustomization}ページの\ref{subsubsec:wirecustomization}項にて説明する. 
-\paragraph{ラベル (\texttt{\textbackslash symbol})}
+\pageref{subsec:wirecustomization}ページの\ref{subsec:wirecustomization}項にて説明する. 
+\paragraph{ラベル (\showcmd{symbol})}
 \begin{verbatim}
   \symbolI[<番号>]{<label>}[<オプション>]
 \end{verbatim}
@@ -579,7 +608,7 @@
 番号\(i\)のデフォルト値は \(1\), オプションのデフォルト値は below である. 
 \verb|\symbolO|, \verb|\symbolN|, \verb|\symboln| はそれぞれ点 (O-\(i\)-ID), (N-\(i\)-ID), (n-\(i\)-ID) に\textless label\textgreater を置く. 
 番号\(i\)のデフォルト値は \(1\), オプションのデフォルト値は above である. 
-\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{Ex:20250311}
+\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{Ex:7812973891211}
   \q{
     \qbox[p=5, S={1,4,5}, id=ID]
     \symbolO{A}
@@ -591,7 +620,7 @@
     \symbolI[3]{G}[below right]
   }
 \end{codebox}
-\begin{CODEBOX}{}{Ex:20250310}
+\begin{CODEBOX}{}{Ex:7812973891210}
   \q{
     \qbox[p=10,N={1,2,5,6,9,10}, id=ID]
     \foreach\i in {1,...,10}
@@ -605,30 +634,32 @@
   }
 \end{CODEBOX}
 
-\subsubsection{繰り返し}
+\subsection{繰り返し}
 \label{subsub:forloop}
 \begin{verbatim}
   \qloop[<回数>]{<コマンド>}
 \end{verbatim}
 \verb|\qloop|コマンドを用いれば, 指定した回数だけコマンドを繰り返せる:
-\begin{CODEBOX}{}{Ex:20250305}
+\begin{CODEBOX}{}{Ex:7812973891205}
   \q{ \qloop[10]{\qbox} }
 \end{CODEBOX}
 \verb|\qloop|コマンドは\verb|\q|外でも使用可能である:
-\begin{codebox}[center lower,listing side text,righthand width=5.5cm,bicolor,colbacklower=white]{}{Ex:202503220930}
-  \qloop[30]{僕ボブ}
-\end{codebox}
-\subsubsection{識別番号の表示}
+\begin{CODEBOX}[bicolor,colbacklower=white]{}{Ex:78129738912220930}
+  結論だけ, 書く.\par
+  \qloop[20]{失敗した}\par
+  あたしは\qloop[10]{失敗した}
+\end{CODEBOX}
+\subsection{識別番号の表示}
 \label{subsub:show id}
 \verb|\q{...}| 内のコマンドには自動的に識別番号が付与される. 
-\texttt{show id=true}を指定すると, それらが表示される. 
-\begin{CODEBOX}{}{Ex:20250303}
+\showcmd[]{show id=true}を指定すると, それらが表示される. 
+\begin{CODEBOX}{}{Ex:7812973891203}
   \q{
     \qbox[show id={true}] \qbox[show id={true}] \qbox[show id={true}]\n
     \qbox[show id={true}] \qbox[show id={true}] \qbox[show id={true}]
   }
 \end{CODEBOX}
-\begin{CODEBOX}{}{Ex:20250302}
+\begin{CODEBOX}{}{Ex:7812973891202}
   \q
   {
     \qloop[10]
@@ -641,69 +672,74 @@
   }
 \end{CODEBOX}
 
-\subsubsection{色}
-
-ボックスに色を指定できる: 
+\subsection{色}
+\label{subsec:color}
+ボックスに三種類の色属性を指定できる: 
 \begin{itemize}
-  \item \texttt{color}
-    \iitem ボックス内部の色, 例えば\texttt{color=green}により\q[scale=0.5]{\qbox[color={green}]}
-  \item \texttt{frame color}
-    \iitem ボックスの枠の色, 例えば\texttt{frame color=cyan}により\q[scale=0.5]{\qbox[frame color={cyan}]}
-  \item \texttt{morphism color}
-    \iitem ボックス内の射の色, 例えば\texttt{morphism colon=red}により\q[scale=0.5]{\qbox[morphism color={red}, name={\(f\)}]}
+  \item \showcmd[]{color}
+    \iitem ボックス内部の色, 例えば\showcmd[]{color=green}により\q[scale=0.5]{\qbox[color={green}]}
+  \item \showcmd[]{frame color}
+    \iitem ボックスの枠の色, 例えば\showcmd[]{frame color=cyan}により\q[scale=0.5]{\qbox[frame color={cyan}]}
+  \item \showcmd[]{morphism color}
+    \iitem ボックス内の射の色, 例えば\showcmd[]{morphism colon=red}により\q[scale=0.5]{\qbox[morphism color={red}, name={\(f\)}]}
 \end{itemize}
-\begin{CODEBOX}{}{Ex:20250259}
+\begin{CODEBOX}{}{Ex:74839759}
     \q
     {
       \qbox
       [
         name={\(f\)},
-        color=green,
-        frame color=cyan,
-        morphism color=red
+        color=red,
+        frame color={green!50!black},
+        morphism color=yellow
       ]
     }
 \end{CODEBOX}
 
-\paragraph{\texttt{N}, \texttt{S}, 等差数列}
-\qworldname は\texttt{pgffor}パッケージをロードしているため, リストに対して\verb|...|を用いた省略記法が使用できる:
+\subsubsection{組紐, シンメトリー, キャップ, カップの色指定}
+\label{subsubsec:tanglecolor}
+組紐, シンメトリー, キャップ, カップといった一部の射は, 図式上では箱ではなく曲線として描画される. 
+これらには明確な内部領域が存在せず, 射のラベルも通常付けないため, \showcmd[]{color}及び\showcmd[]{morphism color}は適用されない. 
+
+\paragraph{\showcmd[]{N}, \showcmd[]{S}, 等差数列}
+\qworldname は\showcmd[]{pgffor}パッケージをロードしているため, リストに対して\verb|...|を用いた省略記法が使用できる:
 \begin{itemize}
   \item \(1,...,10\): 公差\(1\)の等差数列
   \item \(1,3,...,11\): 最初の二項に基づいた公差の等差数列
 \end{itemize}
-\begin{CODEBOX}{}{Ex:20250258}
+\begin{CODEBOX}{}{Ex:74839758}
    \q{
      \qbox[N={1,...,10}, S={1,3,...,11}]
    }
 \end{CODEBOX}
-\begin{CODEBOX}{}{Ex:20250257}
+\begin{CODEBOX}{}{Ex:74839757}
   \q{
     \qbox[N={1,...,4,6,8,...,20}, S={1,...,20}, hlen=10]
   }
 \end{CODEBOX}
-\begin{CODEBOX}{}{Ex:20250256}
+\begin{CODEBOX}{}{Ex:74839756}
   \q{
     \qbox[N={1,...,4,7,10,...,19,20,21,...,25}, S={1,...,25}, hlen=10]
   }
 \end{CODEBOX}
-\subsubsection{相対座標}
+\subsection{相対座標}
 素子の位置座標を相対的に指定するコマンドである. 
 なお, \(x\), \(y\) は整数である必要はなく, \verb|2^1.5|や\verb|cos(pi)|, \verb|sqrt(2)|などの\verb|\fpeval|の評価可能式であればよい. 
 \begin{itemize}
-  \item \texttt{\textbackslash qmv[\(x\),\(y\)]}
+  \item \showcmd{qmv[\(x\),\(y\)]}
     \iitem (\(x\), \(y\)) だけ並行移動する.
     \iitem デフォルトで\(x=y=0\).
-  \item \texttt{\textbackslash n[\(y\)]}
+  \item \showcmd{n[\(y\)]}
     \iitem \(y\)だけ垂直降下し (\(Y\mapsto Y-y\)), X座標を\(0\)にする.
     \iitem デフォルトで \(y=1\) であり, 改行のような挙動をみせる.
-  \item \texttt{\textbackslash qspace[\(x\)]}
+  \item \showcmd{qspace[\(x\)]}
     \iitem \(x\) だけ水平移動する. 
     \iitem デフォルトで \(x=1\) であり, スペースキーのような挙動をみせる.
-    \iitem \texttt{\textbackslash qmv[\(x\),0]} と同義である.
-  \item \texttt{\textbackslash qreset[\(x\),\(y\)]}
+    \iitem \showcmd{qmv[\(x\),0]} と同義である.
+  \item \showcmd{qreset[\(x\),\(y\)]}
     \iitem 点 (\(x\),\(y\)) に移動する.
 \end{itemize}
-\q[scale=2.35]{
+\[\q[scale=2.35]{
   \fill[blue] (qworldat) circle (1pt);
   \coordinate (I) at (qworldat);
 \qbox
@@ -738,37 +774,41 @@
   \coordinate (XI) at (qworldat); 
 \qbball
 \qwireup[dom={I}, cod={II},
-         label={Auto-update}, label side={below},
+         label={自動更新}, label side={below},
          label at={midway}, color=cyan]
 \qwireup[dom={II},cod={III},
-         label={\texttt{\textbackslash n}},
+         label={\showcmd{n}},
          label side={below}, color=cyan]
 \qwireup[dom={III},cod={IV},
-         label={\texttt{\textbackslash qspace}},
+         label={\showcmd{qspace}},
          label side={below}, color=cyan]
 \qwireup[dom={IV},cod={V},
-         label={\texttt{\textbackslash qspace[0.5]}},
-         label at={at end}, label side={above right}, color=cyan]
+         label={\showcmd{qspace[0.5]}},
+         label side={above}, color=cyan]
 \qwireup[dom={V},cod={VI},
-         label={\texttt{\textbackslash n[2]}},color=cyan]
+         label={\showcmd{n[2]}},color=cyan]
 \qwireup[dom={VI},cod={VII},
-         label={\texttt{\textbackslash qmv[-2,-1]}},color=cyan]
+         label={\showcmd{qmv[-2,-1]}},color=cyan]
 \qwireup[dom={VII},cod={VIII},
-         label={\texttt{\textbackslash n}},color=cyan]
+         label={\showcmd{n}},color=cyan]
 \qwireup[dom={VIII},cod={IX},
-         label={\texttt{\textbackslash qspace[-3]}}, 
+         label={\showcmd{qspace[-3]}}, 
          label side={below},color=cyan]
 \qwireup[dom={IX},cod={X},
-         label={\texttt{\textbackslash qreset}},color=cyan]
+         label={\showcmd{qreset}},
+         label side=left, color=cyan]
 \qwireup[dom={X},cod={XI},
-         label={\texttt{\textbackslash qreset[-2,1]}},color=cyan]
+         label={\showcmd{qreset[-2,1]}},
+         label side=left, 
+         label at={near start},
+         color=cyan]
 \draw[help lines] (-4,-6) grid (2,2);
-}
+}\]
 
-\subsubsection{絶対座標}
-\texttt{at}キーを用いれば, 絶対座標で位置を指定できる. 
+\subsection{絶対座標}
+\showcmd[]{at}キーを用いれば, 絶対座標で位置を指定できる. 
 \verb|\q{\qbox[at={2,3}]}|は\verb|\q{\qreset[2,3]\qbox}|と同義である. 
-\begin{CODEBOX}{絶対座標}{Ex:20250254}
+\begin{CODEBOX}{絶対座標}{Ex:74839754}
   \q{
     \coordinate (a) at (0,{\fpeval{2*sqrt(3)}});
     \qbox[at=a]
@@ -793,8 +833,8 @@
 それは表計算ソフトでスーパーマリオを作るようなものだからである.\par
 ------ところが, である.\par
 筆者は``天啓''を受けた
-\footnote{元ネタ: 2011年1月20日, 匿名掲示板4chanにおいて``Sleep Sort''というソートアルゴリズムが公開された\cite{geniussorting,gfxhatena}. このアルゴリズムは\texttt{Bash}スクリプトを用いて各入力値をスレッドとして非同期に実行し, それぞれのスレッドの終了タイミング (指定された``スリープ''時間) を用いてリストをソートする手法である.}. 
-そして\texttt{at}キーを用いたソートアルゴリズムを作り上げた.
+\footnote{元ネタ: 2011年1月20日, 匿名掲示板4chanにおいて``Sleep Sort''というソートアルゴリズムが公開された\cite{geniussorting,gfxhatena}. このアルゴリズムは\showcmd[]{Bash}スクリプトを用いて各入力値をスレッドとして非同期に実行し, それぞれのスレッドの終了タイミング (指定された``スリープ''時間) を用いてリストをソートする手法である.}. 
+そして\showcmd[]{at}キーを用いたソートアルゴリズムを作り上げた.
 \begin{codebox}{}{Ex:genius}
   \newcommand{\AtSort}[1][1]{
     \q
@@ -811,21 +851,29 @@
 だが, 一つ問題がある.\par
 \textbf{リストの要素に絶対値の大きな値が含まれていると, 出力が紙面からはみ出してしまうのである}. 
 
-\subsubsection{ワイヤーのカスタマイズ}
-\label{subsubsec:wirecustomization}
-\ref{subsubsec:boxcustomization} 項で登場したボックス\q[scale=0.5]{\qbox}のキーの中で, \texttt{id}, \texttt{vlen} はワイヤーでも有効である. 
+\subsection{ワイヤーのカスタマイズ}
+\label{subsec:wirecustomization}
+\[\q{
+    \def\maxn{11}
+    \foreach \i in {0,...,\maxn}
+    {
+        \qwireup[dom={0,0}, cod={{\fpeval{\i*360/(\maxn+1)}}:3}]
+        \node at ({\fpeval{\i*360/(\maxn+1)}}:3.6) {\showcmd[]{cod}\i};
+    }
+}\]
+\ref{subsec:boxcustomization} 項で登場したボックス\q[scale=0.5]{\qbox}のキーの中で, \showcmd[]{id}, \showcmd[]{vlen} はワイヤーでも有効である. 
 ワイヤー特有のキーとして, 基本的なものは次の通りである:
 \begin{itemize}
-  \item \texttt{dom}: 入力点. 
-  \item \texttt{cod}: 出力点.
-      \iitem デフォルト値は\texttt{dom}を \(1\) だけ北へ垂直移動した位置. 
-  \item \texttt{label}: ワイヤーにラベルを付ける. 
-  \item \texttt{label at}: ラベルのワイヤー上の位置.
+  \item \showcmd[]{dom}: 入力点. 
+  \item \showcmd[]{cod}: 出力点.
+      \iitem デフォルト値は\showcmd[]{dom}を \(1\) だけ北へ垂直移動した位置. 
+  \item \showcmd[]{label}: ワイヤーにラベルを付ける. 
+  \item \showcmd[]{label at}: ラベルのワイヤー上の位置.
       \iitem デフォルトで midway.
-  \item \texttt{label side}: ラベルとワイヤーの位置関係.
+  \item \showcmd[]{label side}: ラベルとワイヤーの位置関係.
       \iitem デフォルトで right.
 \end{itemize}
-\begin{codebox}{}{ex:202503260951}
+\begin{codebox}{}{ex:78129738912260951}
   \q{
     \qbox[n=3,hlen=1.5]
     \qbox[at={1,2}, s=2, hlen=1.5]
@@ -836,8 +884,18 @@
     \qwire[dom={N-1-2}, cod={S-2-3}]
   }
 \end{codebox}
+\begin{CODEBOX}{}{ex:193477432894112213}
+  \q{
+    \def\maxi{11}
+    \foreach \i in {0,...,\maxi}
+    {
+        \qwireup[dom={0,0}, cod={{\fpeval{\i*360/(\maxi+1)}}:2}]
+        \node at ({\fpeval{\i*360/(\maxi+1)}}:2.4) {\texttt{cod} \i};
+    }
+  }
+\end{CODEBOX}
 ワイヤー\q[scale=0.6]{\qwire}のバウンディングボックスは, \q[scale=0.5]{\qbox}と同じである:
-\begin{codebox}{}{ex:202503220926}
+\begin{codebox}{}{ex:78129738912220926}
   \q
   {
     \qwire\qbox\qwire\n
@@ -845,13 +903,13 @@
     \qbball
   }
 \end{codebox}
-ワイヤーのバウンディングボックスは, \texttt{dom}を入力点, \texttt{cod}を出力点とするようなボックスのそれと一致する:
+ワイヤーのバウンディングボックスは, \showcmd[]{dom}を入力点, \showcmd[]{cod}を出力点とするようなボックスのそれと一致する:
 \begin{itemize}
   \item \(\q[scale=0.5]{\qwire}\) と \(\q[scale=0.5]{\qbox}\)
   \item \(\q[scale=0.5]{\qwire[dom={0,0},cod={1,1}]}\) と \(\q[scale=0.5]{\qbox[p=2,S={1},N={2}]}\)
 \end{itemize}
 
-\begin{CODEBOX}{}{Ex:20250309}
+\begin{CODEBOX}{}{Ex:7812973891209}
   \q[scale=3]{
     \coordinate (A) at (0,0);
     \coordinate (B) at (2,3);
@@ -864,7 +922,7 @@
   }
 \end{CODEBOX}
 
-\begin{CODEBOX}{}{Ex:20250301}
+\begin{CODEBOX}{}{Ex:7812973891201}
   \q{
     \qloop[5]{
       \qloop[10]{
@@ -887,7 +945,7 @@
 \end{CODEBOX}
 
 \paragraph{arrowtype}
-ワイヤーのスタイルは, \texttt{arrowtype}キーを用いて指定する. 
+ワイヤーのスタイルは, \showcmd[]{arrowtype}キーを用いて指定する. 
 \begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{wirearrowtype}
   \q{
     \qwire[arrowtype=dotted]
@@ -915,7 +973,7 @@
   }
 \end{codebox}
 
-\subsubsection{キャンバス}
+\subsection{キャンバス}
 \begin{verbatim}
   \q[オプション]
   {
@@ -925,11 +983,11 @@
   }
 \end{verbatim}
 キャンバスのオプションで図式全体を変換できる.
-\begin{codebox}{}{Ex:20250253}
+\begin{codebox}{}{Ex:74839753}
   \q[scale=2,rotate=30]{\qbox}
 \end{codebox}
 キャンバスを傾けることもできる. 
-\begin{CODEBOX}{}{Ex:20250252}
+\begin{CODEBOX}{}{Ex:74839752}
   \def\anglerot{-55}
   \tikzset
   {
@@ -947,7 +1005,7 @@
     \qBBall
   }
 \end{CODEBOX}
-\begin{CODEBOX}{}{Ex:20250251}
+\begin{CODEBOX}{}{Ex:74839751}
   \def\anglerot{-60}
   \tikzset
   {
@@ -989,12 +1047,13 @@
 \section{モノイダル圏と\qworldname}
 本章では, \qworldname パッケージを用いてモノイダル圏の図式計算をどのように表現できるかを探る. 
 \qworldname は, それ単体で機能し, 図式を扱うことができるが, 
-数式をより柔軟に表現するために, その基盤となるパッケージ (\texttt{amsmath}, \texttt{amssymb}, \texttt{mathtools}) を使用する. 
+数式をより柔軟に表現するために, その基盤となるパッケージ (\showcmd[]{amsmath}, \showcmd[]{amssymb}, \showcmd[]{mathtools}) を使用する. 
 再現の際は, 以下のようにパッケージを適宜ロードせよ:
 \begin{verbatim}
   \usepackage{amsmath, amssymb, mathtools}
   \usepackage{qworld}
 \end{verbatim}
+\subsection{圏}
 \begin{codebox}{ドメイン}{ex:dom2}
   \[
     \operatorname{dom}\left(
@@ -1003,7 +1062,7 @@
         \symbolI{\(x\)}
         \symbolO{\(y\)}
       }
-    \right)=\q{\qwire[label={\(x\)}]}
+    \right)=x
   \]
 \end{codebox}
 \begin{codebox}{コドメイン}{ex:cod2}
@@ -1014,7 +1073,7 @@
         \symbolI{\(x\)}
         \symbolO{\(y\)}
       }
-    \right)=\q{\qwire[label={\(y\)}]}
+    \right)=y
   \]
 \end{codebox}
 
@@ -1025,7 +1084,7 @@
     }=\q{\qbox[name={\(f\circ g\)}]}
   \]
 \end{codebox}
-\begin{CODEBOX}{結合律}{Ex:20250250}
+\begin{CODEBOX}{結合律}{Ex:74839750}
   \[
     \forall\q{\qbox[name={\(h\)}] \symbolI{\(z\)} \symbolO{\(w\)}},
            \q{\qbox[name={\(g\)}] \symbolI{\(y\)} \symbolO{\(z\)}},
@@ -1061,6 +1120,37 @@
     }
   \end{equation}
 \end{CODEBOX}
+\subsubsection{対象情報と色}
+\label{subsubsec:objectcolor}
+圏の図式計算において, 恒等射は通常, 単なるワイヤーとして描かれる. 
+こうしたワイヤーがどの対象の恒等射であるかを, \textbf{対象ごとに固有の色を割り当てる}ことによって視認可能にする手法が存在する. 
+この手法を用いることにより, ワイヤ上に対象の情報をエンコードすることが可能となり, 曲線構造からなる図式において, 対象の区別を直感的に把握する助けとなる. 
+この手法の理論的背景には, \textbf{任意の射に対してドメインとなる対象とコドメインとなる対象がそれぞれ一意的に存在する}という事実がある. 
+この構造が前提として存在する以上, 図式表現において``色''という視覚的属性を通じて対象を暗示/表現することは十分に正当化される操作である. 
+例えば組紐 (\pageref{subsubsec:braid:color}ページの\ref{subsubsec:braid:color}項) や双対性 (\pageref{subsubsec:duality:color}ページ\ref{subsubsec:duality:color}項) を含む図式において, 色による補助が正確な解釈を支援する. 
+この考え方のもとでは, 対象とはワイヤーを彩る色のような存在であり, 
+\begin{CODEBOX}[bicolor,colbacklower=white]{}{objectcolor}
+  \(\operatorname{dom}\)は射
+  \(\q{\qbox[name={\(f\)}, dom color=red, cod color=cyan]}\)
+  のドメインの色\(\q{\qwire[color=red]}\)
+  を識別するための関数であり, 
+  \(\operatorname{cod}\)は同様に, コドメインの色
+  \(\q{\qwire[color=cyan]}\)を識別するための関数である.\par
+  そして紙面上で
+  \(\q{\qbox[name={\(f\)}, dom color=purple, cod color=teal]}\)
+  のコドメインの色と
+  \(\q{\qbox[name={\(g\)}, dom color=teal, cod color=orange]}\)
+  のドメインの色が一致していることが色によって明示され, 
+  この条件が満たされているときに限り, 合成 (垂直合成)
+  \[
+    \q{
+      \qbox[name={\(g\)}, dom color=cyan, cod color=orange]\n
+      \qbox[name={\(f\)}, dom color=red, cod color=cyan]
+    }
+  \]
+  が整合性を保つ操作として許容される.
+\end{CODEBOX}
+\subsection{モノイダル圏}
 \begin{CODEBOX}{テンソル積 (並列合成)}{monoidalproduct}
   \[
     \q
@@ -1083,7 +1173,7 @@
     }
   \]
 \end{CODEBOX}
-
+\subsubsection{交換則}
 \begin{CODEBOX}{交換則 (\(\bigotimes\)の共変関手性)}{InterchangeLaw}
   \begin{equation}
     \label{law:interchange}
@@ -1104,7 +1194,7 @@
   \end{equation}
 \end{CODEBOX}
 
-\begin{CODEBOX}{単位対象}{Ex:20250244}
+\begin{CODEBOX}{単位対象}{Ex:74839744}
   \begin{gather}
     \q{ \qwire[arrowtype=dotted]}
     =\q{ \qunitob \qbball }\\
@@ -1113,7 +1203,7 @@
     =\q{ \qbox[name={\(f\)}] \qunitob \qbball }\label{cond:unitob}
   \end{gather}
 \end{CODEBOX}
-\begin{CODEBOX}{}{Ex:20250243}
+\begin{CODEBOX}{}{Ex:74839743}
   \[
     \q{\qunitob\qbball}
     =\q{\qloop[2]{\qunitob}\qbball}
@@ -1125,25 +1215,25 @@
 \subsection{特殊ボックス}
 
 \begin{itemize}
-  \item \texttt{\textbackslash qstate}: \(\q[scale=0.5]{\qstate}\) (\(0\)入力).
-  \item \texttt{\textbackslash qeffect}: \(\q[scale=0.5]{\qeffect}\) (\(0\)出力).
-  \item \texttt{\textbackslash qscalar}: \(\q[scale=0.5]{\qscalar}\) (\(0\)入力, \(0\)出力).
-  \item \texttt{\textbackslash qasym}: \(\q[scale=0.5]{\qasym}\) (非対称ボックス). 
-  \item \texttt{\textbackslash qtrans}: \(\q[scale=0.5]{\qtrans}\) (転置ボックス). \pageref{subsub:transpose}ページの\ref{subsub:transpose}項.
-  \item \texttt{\textbackslash qadj}: \(\q[scale=0.5]{\qadj}\) (随伴ボックス). \pageref{subsub:adjoint}ページの\ref{subsub:adjoint}項.
-  \item \texttt{\textbackslash qconj}: \(\q[scale=0.5]{\qconj}\) (共役ボックス). \pageref{subsub:conj}ページの\ref{subsub:conj}項.
+  \item \showcmd{qstate}: \(\q[scale=0.5]{\qstate}\) (\(0\)入力).
+  \item \showcmd{qeffect}: \(\q[scale=0.5]{\qeffect}\) (\(0\)出力).
+  \item \showcmd{qscalar}: \(\q[scale=0.5]{\qscalar}\) (\(0\)入力, \(0\)出力).
+  \item \showcmd{qasym}: \(\q[scale=0.5]{\qasym}\) (非対称ボックス). 
+  \item \showcmd{qtrans}: \(\q[scale=0.5]{\qtrans}\) (転置ボックス). \pageref{subsub:transpose}ページの\ref{subsub:transpose}項.
+  \item \showcmd{qadj}: \(\q[scale=0.5]{\qadj}\) (随伴ボックス). \pageref{subsub:adjoint}ページの\ref{subsub:adjoint}項.
+  \item \showcmd{qconj}: \(\q[scale=0.5]{\qconj}\) (共役ボックス). \pageref{subsub:conj}ページの\ref{subsub:conj}項.
 \end{itemize}
-\subsubsection{\(0\)入力}
+\subsubsection{ゼロ入力}
 \label{subsub:zeroinput}
 \begin{codebox}{}{def:state}
   \q{\qstate}
 \end{codebox}
-\subsubsection{\(0\)出力}
+\subsubsection{ゼロ出力}
 \label{subsub:zerooutput}
 \begin{codebox}{}{def:effect}
   \q{\qeffect}
 \end{codebox}
-\subsubsection{\(0\)入力\(0\)出力}
+\subsubsection{ゼロ入力ゼロ出力}
 \label{subsub:zeroinputoutput}
 \begin{codebox}{}{def:scalar}
   \q{\qscalar}
@@ -1199,15 +1289,15 @@
 \end{CODEBOX}
 
 \subsection{モノイド対象}
-\label{sub:monoid}
+\label{subsec:monoid}
 \begin{itemize}
-  \item \texttt{\textbackslash qmul}: \(\q[scale=0.5]{\qmul}\)
-    \iitem \texttt{hlen=2}: \(\q[scale=0.5]{\qmul[hlen=2]}\)
-  \item \texttt{\textbackslash qcomul}: \(\q[scale=0.5]{\qcomul}\)
-    \iitem \texttt{hlen=2}: \(\q[scale=0.5]{\qcomul[hlen=2]}\)
-  \item \texttt{\textbackslash qunit}: \(\q[scale=0.5]{\qunit}\)
-  \item \texttt{\textbackslash qcounit}: \(\q[scale=0.5]{\qcounit}\)
-  \item \texttt{\textbackslash qspider}: \(\q[scale=0.5]{\qspider}\)
+  \item \showcmd{qmul}: \(\q[scale=0.5]{\qmul}\)
+    \iitem \showcmd[]{hlen=2}: \(\q[scale=0.5]{\qmul[hlen=2]}\)
+  \item \showcmd{qcomul}: \(\q[scale=0.5]{\qcomul}\)
+    \iitem \showcmd[]{hlen=2}: \(\q[scale=0.5]{\qcomul[hlen=2]}\)
+  \item \showcmd{qunit}: \(\q[scale=0.5]{\qunit}\)
+  \item \showcmd{qcounit}: \(\q[scale=0.5]{\qcounit}\)
+  \item \showcmd{qspider}: \(\q[scale=0.5]{\qspider}\)
 \end{itemize}
 
 \begin{CODEBOX}{結合律}{AssociateLaw}
@@ -1301,7 +1391,7 @@
   \end{CODEBOX}
 
   \verb|\qspider|は, ノードがボックスではなく円であることを除けば, \verb|\qbox|と同じである. 
-  \begin{codebox}{}{spider202503240521}
+  \begin{codebox}{}{spider78129738912240521}
     \[\q{\qspider}\]
     \[\q{\qspider[n=0]}\]
     \[\q{\qspider[n=0,s=4]}\]
@@ -1313,7 +1403,7 @@
     \[\q{\qspider[n=1,s=2,hlen=2]}\]
   \end{codebox}
 
-  \begin{CODEBOX}{}{spider202503270738}
+  \begin{CODEBOX}{}{spider78129738912270738}
     \[
       \q{
         \qspider[n=2, s=4, hlen=4]\qwire\qwire\n
@@ -1323,17 +1413,17 @@
   \end{CODEBOX}
 
 \subsection{組紐}
-\label{sub:braidedcategory}
+\label{subsec:braidedcategory}
 \begin{itemize}
-  \item \texttt{\textbackslash qbraid}: \(\q[scale=0.5]{\qbraid}\)
-  \item \texttt{\textbackslash qbraidinv}: \(\q[scale=0.5]{\qbraidinv}\)
-  \item \texttt{\textbackslash qsym}: \(\q[scale=0.5]{\qsym}\)
+  \item \showcmd{qbraid}: \(\q[scale=0.5]{\qbraid}\)
+  \item \showcmd{qbraidinv}: \(\q[scale=0.5]{\qbraidinv}\)
+  \item \showcmd{qsym}: \(\q[scale=0.5]{\qsym}\)
 \end{itemize}
 
-\paragraph{\texttt{num L} と \texttt{num R} キー}
+\paragraph{\showcmd[]{num L} と \showcmd[]{num R} キー}
 ワイヤーを交叉させた図式を描画するコマンド\verb|\qbraid|, \verb|\qbraidinv|, \verb|\qsym|に対し, 
-\texttt{num L}は左側のワイヤーの本数を, \texttt{num R}は右側のワイヤーの本数を指定するキーである. 
-例えば, \texttt{num L=3}, \texttt{num R=2} とすれば, \(\q{\qbraid[num L=3,num R=2]}\)が描画される. 
+\showcmd[]{num L}は左側のワイヤーの本数を, \showcmd[]{num R}は右側のワイヤーの本数を指定するキーである. 
+例えば, \showcmd[]{num L=3}, \showcmd[]{num R=2} とすれば, \(\q{\qbraid[num L=3,num R=2]}\)が描画される. 
 双方デフォルト値はともに\(1\)である. 
 
 \begin{CODEBOX}{六角形等式}{hexagon}
@@ -1418,10 +1508,9 @@
   \end{equation}
 \end{CODEBOX}
 
-
 コマンド\verb|\qbraid|, \verb|\qbraidinv|, \verb|\qsym|に対し, 
-\texttt{num R=0}と指定すると, \(\q[scale=0.65]{\qbraid[num R=0]}\)のように右側のワイヤーが点線となる. 
-\texttt{num L=0}と指定すると, \(\q[scale=0.65]{\qbraid[num L=0]}\)のように左側のワイヤーが点線となる. 
+\showcmd[]{num R=0}と指定すると, \(\q[scale=0.65]{\qbraid[num R=0]}\)のように右側のワイヤーが点線となる. 
+\showcmd[]{num L=0}と指定すると, \(\q[scale=0.65]{\qbraid[num L=0]}\)のように左側のワイヤーが点線となる. 
 これは, 単位対象を空図式, すなわち\(0\)本のワイヤーとして表すことに由来している.
 \begin{CODEBOX}{}{stateeffect3dimbraid}
   \begin{gather}
@@ -1526,7 +1615,7 @@
     }
   \end{align}
 \end{CODEBOX}
-
+  
 \begin{CODEBOX}{ヤン-バクスター方程式}{YangBaxer}
   \[
     \q
@@ -1611,22 +1700,26 @@
     }\label{cond:naturality:twist}
   \end{gather}
 \end{CODEBOX}
-\subsubsection{自明な平衡圏, 対称モノイダル圏}
-\label{subsub:symmetry}
+\subsubsection{色}
+\label{subsubsec:braid:color}
+
 \begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{対称}{defeq:sym}
   \begin{equation}
     \label{cond:symmetry}
     \q
     {
-      \qbraid\n
-      \qbraid
+      \qbraid[L color=cyan, R color=red]\n
+      \qbraid[L color=red, R color=cyan]
     }
-    =\q{\qloop[2]{\qwire[vlen=2]}}
+    =\q{\qwire[color=red, vlen=2]\qwire[color=cyan, vlen=2]}
   \end{equation}
 \end{codebox}
-\begin{codebox}{}{wowsym}
-  \[\q{\qbraid}=\q{\qbraidinv}\]
-\end{codebox}
+
+\begin{CODEBOX}{}{wowsym}
+  \[\q{\qbraid[L color=red, R color=cyan]}
+  =\left(\q{\qbraid[L color=cyan, R color=red]}\right)^{-1}
+  =\q{\qbraidinv[L color=red, R color=cyan]}\]
+\end{CODEBOX}
 \begin{codebox}{シンメトリー}{def:sym}
   \q{\qsym}
 \end{codebox}
@@ -1634,10 +1727,10 @@
 \subsection{双対性}
 \label{subsub:duality}
 \begin{itemize}
-  \item \texttt{\textbackslash qcap}: \(\q[scale=0.6]{\qcap}\)
-  \item \texttt{\textbackslash qcup}: \(\q[scale=0.6]{\qcup}\)
-  \item \texttt{\textbackslash qcaprev}: \(\q[scale=0.6]{\qcaprev}\)
-  \item \texttt{\textbackslash qcuprev}: \(\q[scale=0.6]{\qcuprev}\)
+  \item \showcmd{qcap}: \(\q[scale=0.6]{\qcap}\)
+  \item \showcmd{qcup}: \(\q[scale=0.6]{\qcup}\)
+  \item \showcmd{qcaprev}: \(\q[scale=0.6]{\qcaprev}\)
+  \item \showcmd{qcuprev}: \(\q[scale=0.6]{\qcuprev}\)
 \end{itemize}
 
 \begin{CODEBOX}{ジグザグ等式}{Snake}
@@ -1677,7 +1770,7 @@
     }
   \]
 \end{CODEBOX}
-\begin{CODEBOX}{}{ex:202504021826}
+\begin{CODEBOX}{}{ex:193477432894021826}
   \begin{equation}
     \label{eq:wirerev}
     \left(\q{\qwireup}\right)^T=\q{\qwiredown}
@@ -1800,13 +1893,13 @@
         hlen=2
       ]\n\qcup
     }\\
-    &\stackrel{\text{(\ref{cond:copy})}}{=}\q{
+    &\stackrel{\text{(\ref{cond:copy})}}{=}\q[scale=0.6]{
         \qwire\qbraid\qwire\n
         \qloop[4]{\qwire}\n
         \qloop[2]{\qcomul[hlen=2, name={\(\operatorname{copy}\)}]}\n
         \qspace[0.5]\qcup[hlen=3]
         \qbb[red][4,8]
-    }\stackrel{\text{(\ref{cond:ccmt})}}{=}\q{
+    }\stackrel{\text{(\ref{cond:ccmt})}}{=}\q[scale=0.6]{
         \qwire\qbraid\qwire\n
         \qbraidinv\qwire\qwire\n
         \qloop[2]{\qcomul[hlen=2, name={\(\operatorname{copy}\)}]}\n
@@ -1813,7 +1906,7 @@
         \qspace[0.5]\qcup[hlen=3]
         \qbb[red][4,7]
       }\\
-      &=\q{
+      &=\q[scale=0.6]{
         \qwire\qbraid\qwire\n
         \qbraidinv\qwire\qwire\n[2]
         \qloop[4]{\qwire[vlen=2]}\n
@@ -1822,7 +1915,7 @@
         \qbb[blue][8,9]
       }
       \stackrel{\text{(\ref{eq:inverse:braid})}}{=}
-      \q{
+      \q[scale=0.6]{
         \qwire\qbraid\qwire\n
         \qbraidinv\qwire\qwire\n
         \qwire\qbraidinv\qwire\n
@@ -1831,7 +1924,7 @@
         \qspace[0.5]\qcup[hlen=3]
         \qbb[blue][8,11]
       }\\
-      &=\q{
+      &=\q[scale=0.6]{
         \qwire\qbraid\qwire\n
         \qbraidinv\qwire\qwire\n
         \qwire\qbraidinv\qwire\n
@@ -1840,7 +1933,7 @@
         \qspace[0.5]\qcup[hlen=3]
         \qbb[yellow][10,14,15]
       }\stackrel{\text{(\ref{cond:copy}, \ref{cond:morcopy}, \ref{cond:i:copy})}}{=}
-      \q{
+      \q[scale=0.6]{
         \qwire\qbraid\qwire\n
         \qbraidinv\qwire\qwire\n
         \qwire\qbraidinv\qwire\n
@@ -1859,13 +1952,13 @@
       \qbraid
       \symbolI{\(X\)}\symbolO{\(X\)}
       \symbolI[2]{\(X\)}\symbolO[2]{\(X\)}
-    }&\stackrel{\text{(\ref{eq:snake})}}{=}\q{
+    }&\stackrel{\text{(\ref{eq:snake})}}{=}\q[scale=0.6]{
       \qwire\qspace[2]\qcap\qwire\n
       \qbraid[hlen=4]\qwire\qwire\n
       \qwire\qcap\qwire\qcup\n
       \qwire\qwire\qcup
       \qbb[blue][1,5]
-    }=\q{
+    }=\q[scale=0.6]{
       \qcap[hlen=4]\qwire\n
       \qwire\qspace[2]\qbraidinv\n
       \qwire\qcap\qwire\qwire\qwire[vlen=3]\n
@@ -1873,7 +1966,7 @@
       \qbb[blue][1,4]
       \qbb[yellow][12,13]
     }\\
-    &\stackrel{\text{例 \ref{len:copycupcup}}}{=}\q{
+    &\stackrel{\text{例 \ref{len:copycupcup}}}{=}\q[scale=0.6]{
       \qcap[hlen=4]\qwire\n
       \qwire\qspace[2]\qbraidinv\n
       \qwire\qcap\qwire\qwire\qwire[vlen=3]\n
@@ -1881,13 +1974,13 @@
       \qwire\qwire\qcup[n=4]
       \qbb[yellow][12,14,17]
     }\\
-    &=\q{
+    &=\q[scale=0.6]{
       \qcap[s=4]\qwire\n
       \qloop[3]{\qwire}\qbraidinv\n
       \qloop[3]{\qwire}\qbraid\qwire[vlen=3]\n
       \qwire\qwire\qcup[n=4]
       \qbb[green][6,10]
-    }\stackrel{\text{(\ref{eq:inverse:braid})}}{=}\q{
+    }\stackrel{\text{(\ref{eq:inverse:braid})}}{=}\q[scale=0.6]{
       \qcap[s=4]\qwire\qwire\n[2]
       \qloop[6]{\qwire[vlen=2]}\n
       \qwire\qwire\qcup[n=4]
@@ -1948,7 +2041,7 @@
   \end{align*}
 \end{CODEBOX}
 \subsection{ピボタル圏}
-\label{sub:pivotal}
+\label{subsec:pivotal}
 \begin{CODEBOX}{}{struct:Pivotal}
   \begin{equation}
     \label{cond:naturality:pivotal}
@@ -2006,11 +2099,11 @@
 \begin{CODEBOX}{}{corr:pivotal:twist}
   \begin{gather}
     \q{
-      \qwireuu[label={\(X^{**}\)}]\n
+      \qwireuu[label={\(X^{TT}\)}]\n
       \qasym[name={\(\pi_X\)}]\n
       \qwireup[label={\(X\)}]
     }=\q{
-      \qwireuu[label={\(X^{**}\)}]\qcap\n
+      \qwireuu[label={\(X^{TT}\)}]\qcap\n
       \qbraid\qwired[label={\(X^T\)}]\n
       \qasym[name={\(\theta_X^{-1}\)}]\qcuprev\n
       \qwireup[label={\(X\)}]
@@ -2022,12 +2115,52 @@
     }=\q{
       \qwireup[label={\(X\)}]\n
       \qasym[name={\(\pi_X^{-1}\)}]\n
-      \qwireuu[label={\(X^{**}\)}]\qcap\n
+      \qwireuu[label={\(X^{TT}\)}]\qcap\n
       \qbraid\qwired[label={\(X^T\)}]\n
       \qwire[label={\(X\)}]\qcuprev
     }\label{pivotal:twist}
   \end{gather}
 \end{CODEBOX}
+\begin{CODEBOX}{}{ex193477432894100303}
+  \begin{align*}
+    \q{\qasym[name={\(\theta_X\)}]}
+    &=\q{
+      \qwireu[label={\(X\)}]\qcap\n
+      \qbraid\qwired\n
+      \qwireu[label={\(X\)}]\qcuprev
+    }&\q{\qasym[name={\(\theta_X^{-1}\)}]}
+    &=\q{
+      \qcaprev\qwireu[label={\(X\)}]\n
+      \qwired\qbraidinv\n
+      \qcup\qwireu[label={\(X\)}]
+    }\\
+    \q{\qtrans[name={\(\theta_X\)}]}
+    &=\q{
+      \qcap\qwired[label={\(X^T\)}]\n
+      \qwireu\qbraid\n
+      \qcuprev\qwired[label={\(X^T\)}]
+    }&\q{\qtrans[name={\(\theta_X^{-1}\)}]}
+    &=\q{
+      \qwired[label={\(X^T\)}]\qcaprev\n
+      \qbraidinv\qwireu\n
+      \qwired[label={\(X^T\)}]\qcup
+    }
+  \end{align*}
+\end{CODEBOX}
+\begin{CODEBOX}{リボン圏}{code:def:ribboncategory}
+  \begin{equation}
+    \label{def:ribboncategory}
+    \q{
+      \qwired\qcaprev\n
+      \qbraid\qwireu\n
+      \qwired\qcup
+    }=\q{
+      \qcap\qwired\n
+      \qwireu\qbraid\n
+      \qcuprev\qwired
+    }
+  \end{equation}
+\end{CODEBOX}
 
 \subsubsection{トレース}
 \label{subsub:trace}
@@ -2046,6 +2179,7 @@
     \end{array}
   \]
 \end{CODEBOX}
+
 \begin{CODEBOX}{トレースの可換性}{Cotr}
   \begin{equation}
     \label{cmt:trace}
@@ -2081,8 +2215,53 @@
     =\q{\qcap\n\qcuprev}
   \]
 \end{CODEBOX}
+\subsubsection{コンパクト圏}
+\label{subsubsec:compact}
+\begin{CODEBOX}{コンパクト圏}{Def:compact}
+  \begin{equation}
+    \label{def:compact}
+    \q{\qasym[name={\(\pi_X\)}]}=\q{
+      \qwireuu[label={\(X^{TT}\)}]\qcap\n
+      \qsym\qwired[label={\(X^T\)}]\n
+      \qwire[label={\(X\)}]\qcuprev
+    }
+  \end{equation}
+\end{CODEBOX}
+\subsubsection{色}
+\label{subsubsec:duality:color}
+\begin{CODEBOX}{}{Ex:coloredhopflink}
+  \begin{equation}
+    \label{eq:tr:hopf}
+    \operatorname{Tr}\left(
+      \q{
+        \qbraid[L color=blue, R color=orange]\n
+        \qbraid[L color=orange, R color=blue]}
+    \right)
+    =\q{
+      \qcap[hlen=4, frame color=orange]\n
+      \qwire[color=orange]\qcap[frame color=blue]\n
+      \qbraid[L color=blue, R color=orange]\n
+      \qbraid[L color=orange, R color=blue
+      ]\qwiredown[vlen=2, color=blue]\n
+      \qwire[color=orange]
+      \qcuprev[frame color=blue]
+      \qwiredown[vlen=4, color=orange]\n
+      \qcuprev[hlen=4, frame color=orange]
+    }=\q{
+      \qcap[frame color=blue]
+      \qcap[frame color=orange]\n
+      \qspace
+      \qbraidinv[L color=orange, R color=blue]\n
+      \qwireup[vlen=2, color=blue]
+      \qbraidinv[L color=blue, R color=orange]
+      \qwiredown[vlen=2, color=orange]\n
+      \qcuprev[frame color=blue]
+      \qcuprev[frame color=orange]
+    }
+  \end{equation}
+\end{CODEBOX}
 \subsection{ダガー}
-\label{sub:dagger}
+\label{subsec:dagger}
 \subsubsection{随伴ボックス}
 \label{subsub:adjoint}
 \begin{CODEBOX}{随伴}{def:adj}
@@ -2134,239 +2313,247 @@
 \end{CODEBOX}
 \section{素子一覧}
 \label{sec:fcommands}
-      \begin{tcbraster}[raster columns=4,raster equal height=rows,fonttitle=\bfseries,
-        colframe=cyan!90,coltitle=cyan!50,colbacktitle=black,
-        subtitle style={boxrule=0.4pt,
-        colback=black!70,
-        colupper=cyan!50}
-        ]
-        \def\mortype{射}
-        \def\AoE{舞台}
-        \def\RMK{備考}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qwire}]
-          \[\q{\qwire}\]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qbox}]
-          \[
-            \q{
-              \qbox
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qstate}]
-          \[
-            \q{
-              \qstate
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qeffect}]
-          \[
-            \q{
-              \qeffect
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qscalar}]
-          \[
-            \q{
-              \qscalar
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qunitob}]
-          \[
-            \q{
-              \qunitob
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qmul}]
-          \[
-            \q{
-              \qmul[hlen=2]
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qcomul}]
-          \[
-            \q{
-              \qcomul[hlen=2]
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qunit}]
-          \[
-            \q{
-              \qunit
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qcounit}]
-          \[
-            \q{
-              \qcounit
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qspider}]
-          \[
-            \q{
-              \qspider[p=4,hlen=2]
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qbraid}]
-          \[
-            \q{
-                \qbraid
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qbraidinv}]
-          \[
-            \q{
-              \qbraidinv
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qsym}]
-          \[
-            \q{
-              \qsym
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qcap}]
-          \[
-            \q{
-              \qcap
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qcup}]
-          \[
-            \q{
-              \qcup
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qwireu}]
-          \[\q{\qwireup}\]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qwired}]
-          \[\q{\qwiredown}\]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qwireuu}]
-          \[\q{\qwireuu}\]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qwiredd}]
-          \[\q{\qwiredd}\]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qasym}]
-          \[
-            \q{
-              \qasym
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qtrans}]
-          \[
-            \q{
-              \qtrans
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash adj}]
-          \[
-            \q{
-              \qadj
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qconj}]
-          \[
-            \q{
-              \qconj
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qcaprev}]
-          \[
-            \q{
-              \qcaprev
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qcuprev}]
-          \[
-            \q{
-              \qcuprev
-            }
-          \]
-        \end{tcolorbox}
-      \end{tcbraster}
-      \addcontentsline{toc}{section}{参考文献}
-      \begin{thebibliography}{99}
-        \bibitem{tikz-manual}
-        Till Tantau,
-        \textit{The TikZ and PGF Packages Manual for Version 3.1.10},
-        Institut für Theoretische Informatik, Universität zu Lübeck,
-        n.d.,
-        \url{https://github.com/pgf-tikz/pgf}
-        (retrieved March 22, 2025).
-        \bibitem{geniussorting}
-        Anonymous,
-        \textit{Genius Sorting Algorithm},
-        4chan Programming Board,
-        January 20, 2011,
-        \url{https://dis.4chan.org/read/prog/1295544154}
-        (accessed January 20, 2011; link currently inactive).
-        \bibitem{gfxhatena}
-        gfx,
-        \textit{常識を覆すソートアルゴリズム!その名も"sleep sort"!},
-        Hatena Diary,
-        May 19, 2011,
-        \url{https://gfx.hatenadiary.org/entry/20110519/1305810786}.
-        \bibitem{literateprograms}
-        LiteratePrograms,
-        \textit{Turing Machine Simulator in \LaTeX},
-        \url{https://literateprograms.org/turing_machine_simulator__latex_.html},
-        n.d.,
-        retrieved March 22, 2025.
-        \bibitem{overleaf}
-        Overleaf,
-        \textit{\LaTeX\ is More Powerful than You Think: Computing the Fibonacci Numbers and Turing Completeness},
-        \url{https://www.overleaf.com/learn/latex/Articles/LaTeX_is_More_Powerful_than_you_Think_-_Computing_the_Fibonacci_Numbers_and_Turing_Completeness},
-        n.d.,
-        retrieved March 22, 2025.
-      \end{thebibliography}
-      \section*{変更履歴}
-      \subsection*{Version 1.1.0 (2025-04-03)}
-      \paragraph{以下のコマンドが更新された:}
+\begin{tcbraster}[raster columns=4,raster equal height=rows,fonttitle=\bfseries,
+  colframe=cyan!90,coltitle=cyan!50,colbacktitle=black,
+  subtitle style={boxrule=0.4pt,
+  colback=black!70}
+  ]
+  \begin{tcolorbox}[adjusted title={\showcmd{qwire}[cyan]}]
+    \[\q{\qwire}\]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qbox}[cyan]}]
+    \[
+      \q{
+        \qbox
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qstate}[cyan]}]
+    \[
+      \q{
+        \qstate
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qeffect}[cyan]}]
+    \[
+      \q{
+        \qeffect
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qscalar}[cyan]}]
+    \[
+      \q{
+        \qscalar
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qunitob}[cyan]}]
+    \[
+      \q{
+        \qunitob
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qmul}[cyan]}]
+    \[
+      \q{
+        \qmul[hlen=2]
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qcomul}[cyan]}]
+    \[
+      \q{
+        \qcomul[hlen=2]
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qunit}[cyan]}]
+    \[
+      \q{
+        \qunit
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qcounit}[cyan]}]
+    \[
+      \q{
+        \qcounit
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qspider}[cyan]}]
+    \[
+      \q{
+        \qspider[p=4,hlen=2]
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qbraid}[cyan]}]
+    \[
+      \q{
+          \qbraid
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qbraidinv}[cyan]}]
+    \[
+      \q{
+        \qbraidinv
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qsym}[cyan]}]
+    \[
+      \q{
+        \qsym
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qcap}[cyan]}]
+    \[
+      \q{
+        \qcap
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qcup}[cyan]}]
+    \[
+      \q{
+        \qcup
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qwireu}[cyan]}]
+    \[\q{\qwireup}\]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qwired}[cyan]}]
+    \[\q{\qwiredown}\]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qwireuu}[cyan]}]
+    \[\q{\qwireuu}\]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qwiredd}[cyan]}]
+    \[\q{\qwiredd}\]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qasym}[cyan]}]
+    \[
+      \q{
+        \qasym
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qtrans}[cyan]}]
+    \[
+      \q{
+        \qtrans
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{adj}[cyan]}]
+    \[
+      \q{
+        \qadj
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qconj}[cyan]}]
+    \[
+      \q{
+        \qconj
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qcaprev}[cyan]}]
+    \[
+      \q{
+        \qcaprev
+      }
+    \]
+  \end{tcolorbox}
+  \begin{tcolorbox}[adjusted title={\showcmd{qcuprev}[cyan]}]
+    \[
+      \q{
+        \qcuprev
+      }
+    \]
+  \end{tcolorbox}
+\end{tcbraster}
+\addcontentsline{toc}{section}{参考文献}
+\begin{thebibliography}{99}
+  \bibitem{tikz-manual}
+  Till Tantau,
+  \textit{The TikZ and PGF Packages Manual for Version 3.1.10},
+  Institut für Theoretische Informatik, Universität zu Lübeck,
+  n.d.,
+  \url{https://github.com/pgf-tikz/pgf}
+  (retrieved March 22, 2025).
+  \bibitem{geniussorting}
+  Anonymous,
+  \textit{Genius Sorting Algorithm},
+  4chan Programming Board,
+  January 20, 2011,
+  \url{https://dis.4chan.org/read/prog/1295544154}
+  (accessed January 20, 2011; link currently inactive).
+  \bibitem{gfxhatena}
+  gfx,
+  \textit{常識を覆すソートアルゴリズム!その名も"sleep sort"!},
+  Hatena Diary,
+  May 19, 2011,
+  \url{https://gfx.hatenadiary.org/entry/20110519/1305810786}.
+  \bibitem{literateprograms}
+  LiteratePrograms,
+  \textit{Turing Machine Simulator in \LaTeX},
+  \url{https://literateprograms.org/turing_machine_simulator__latex_.html},
+  n.d.,
+  retrieved March 22, 2025.
+  \bibitem{overleaf}
+  Overleaf,
+  \textit{\LaTeX\ is More Powerful than You Think: Computing the Fibonacci Numbers and Turing Completeness},
+  \url{https://www.overleaf.com/learn/latex/Articles/LaTeX_is_More_Powerful_than_you_Think_-_Computing_the_Fibonacci_Numbers_and_Turing_Completeness},
+  n.d.,
+  retrieved March 22, 2025.
+\end{thebibliography}
+\begin{changelog}[author=新名亮太, sectioncmd=\section*]
+  \begin{version}[v=1.1.1, date=2025-04-14]
+    \added
+      \item 彩色機能\par 図式表現において, 組紐, シンメトリー, キャップ, カップ等に対して色属性を指定できるようになった. 対象の識別に有効な視覚的手がかりを提供する. 
+    \fixed
+      \item ワイヤーや組紐, シンメトリー, キャップ, カップの曲線処理が修正され, より滑らかな描画が可能となった. 
+  \end{version}
+  \begin{version}[v=1.1.0,date=2025-04-03]
+    \changed
+      \item コマンドの引数仕様の刷新\par 以下のコマンドがアップデートされ, 従来の必須引数から柔軟なキーバリュー形式の柔軟なオプション引数へと変更された:
       \begin{itemize}
-        \item \texttt{\textbackslash symbolI}
-        \item \texttt{\textbackslash symbols}
-        \item \texttt{\textbackslash symbolS}
-        \item \texttt{\textbackslash symbolO}
-        \item \texttt{\textbackslash symboln}
-        \item \texttt{\textbackslash symbolN}
+        \item \showcmd{symbolI}
+        \item \showcmd{symbols}
+        \item \showcmd{symbolS}
+        \item \showcmd{symbolO}
+        \item \showcmd{symboln}
+        \item \showcmd{symbolN}
       \end{itemize}
-      これらのコマンドの\texttt{ID}は, 従来の必須引数からオプション引数に変更され, ユーザーは\texttt{ID}をオプションでキーで指定できるようになり, コマンド使用時の柔軟性が向上した.
-      \begin{itemize}
-        \item 旧: \texttt{\textbackslash symbolI[i]\{ID\}\{text\}[above right]}
-        \item 新: \texttt{\textbackslash symbolI[i]\{text\}[above right, id=ID]}
-      \end{itemize}
-      \paragraph{英語のドキュメントが追加された.}
-      \subsection*{Version 1.0.0 (2025-04-01)}
-      \paragraph{初回リリース.}
-      \section*{License and Copyright}
+      \begin{description}
+        \item[旧仕様] \showcmd{symbolI[i]\{ID\}\{text\}[位置オプション]}[old]
+        \item[新仕様] \showcmd{symbolI[i]\{text\}[id=ID, 位置オプション]}[new]
+      \end{description}
+      この変更により, \showcmd[]{ID}の指定を省略できるようになり, 従来の\showcmd{symbolI\{ID\}\{text\}}[old]に比べ, \showcmd[]{ID}が不要な場面では\showcmd{symbolI\{text\}}[new]と記述するだけで済むようになった. 結果として, 記述量が削減されコードの可読性が向上した. 
+    \added
+      \item 英語のドキュメントの追加\par パッケージのユーザーガイド (英語版) を新たに追加した. 
+  \end{version}
+  \shortversion{v=1.0.0,
+    date=2025-04-01,
+    changes={初回リリース}
+  }
+\end{changelog}
+\section*{License and Copyright}
 
-      This package is distributed under the \textbf{LaTeX Project Public License (LPPL)}, version 1.3c or later.  
-      For details, see \url{https://www.latex-project.org/lppl.txt}.
-      
-      Copyright \textcopyright 2025 Niina Ryota
-      
-      You are free to distribute and modify this package under the terms of LPPL.  
-      However, any modified versions \textbf{must not} be distributed under the original name, and the original author must be credited.
-\end{document}
+This package is distributed under the \textbf{LaTeX Project Public License (LPPL)}, version 1.3c or later.  
+For details, see \url{https://www.latex-project.org/lppl.txt}.
+
+Copyright \textcopyright 2025 Niina Ryota
+
+You are free to distribute and modify this package under the terms of LPPL.  
+However, any modified versions \textbf{must not} be distributed under the original name, and the original author must be credited.
+\end{document}
\ No newline at end of file

Added: trunk/Master/texmf-dist/doc/latex/qworld/qworld_en.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/qworld/qworld_en.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/qworld/qworld_en.pdf	2025-04-14 19:50:58 UTC (rev 74943)
+++ trunk/Master/texmf-dist/doc/latex/qworld/qworld_en.pdf	2025-04-14 19:51:45 UTC (rev 74944)

Property changes on: trunk/Master/texmf-dist/doc/latex/qworld/qworld_en.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/qworld/qworld_en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/qworld/qworld_en.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/qworld/qworld_en.tex	2025-04-14 19:51:45 UTC (rev 74944)
@@ -0,0 +1,2540 @@
+\documentclass{article}
+\usepackage[a4paper, textwidth=150mm]{geometry}
+
+\usepackage{qworld}
+
+\usepackage{bookmark}
+\usepackage{fontspec}
+\usepackage{pdfpages}
+
+\usepackage{amsmath}
+\usepackage{amssymb}
+\usepackage{amsfonts}
+\usepackage{mathtools}
+
+\usepackage{ascmac}
+\usepackage{fancybox}
+\usepackage{float}
+
+\usepackage{bbm}
+\usepackage{mathrsfs}
+%\numberwithin{equation}{subsection}
+
+\usepackage{changelog}
+
+\usepackage{framed}
+\newenvironment{longshadowbox}{%
+  \def\FrameCommand{\fboxsep=\FrameSep \shadowbox}%
+  \MakeFramed {\FrameRestore}}%
+{\endMakeFramed}
+
+\usepackage{url}
+\usepackage{hyperref}
+\hypersetup{colorlinks=true, linkcolor=blue}
+
+\usepackage{iitem}
+
+\usepackage{xspace}
+\newcommand{\qworldname}{\texttt{QWorld}\xspace}
+\newcommand{\tikzname}{Ti\emph{k}Z\xspace}
+\newcommand{\texlivename}{\TeX{} \textsf{Live}\xspace}
+
+\setcounter{tocdepth}{3}
+
+\usepackage[most]{tcolorbox}
+\newtcblisting{mybox}[2][]{
+  colback=red!5!white,
+  colframe=red!75!black,
+  fonttitle=\bfseries,
+  title=#2,
+  #1
+}
+
+\tcbset
+{
+  codeinfo/.style=
+  { 
+    colframe=cyan!90,
+    coltitle=cyan!60,
+    colbacktitle=black,
+    fonttitle=\small\sffamily\bfseries, 
+    fontupper=\small, 
+    fontlower=\small
+  },
+  exampletitleinfo/.style 2 args=
+  {
+    codeinfo,
+    title={Example \thetcbcounter : #1},
+    label={#2}
+  },
+  failurecodeinfo/.style=
+  {
+    colframe=red!90,
+    coltitle=red!60, 
+    colbacktitle=black,
+    fonttitle=\small\sffamily\bfseries, 
+    fontupper=\small, 
+    fontlower=\small
+  },
+  failureexampletitleinfo/.style 2 args=
+  {
+    failurecodeinfo,
+    title={Failure Example \thetcbcounter : #1},
+    label={#2}
+  }
+}
+\newtcblisting{texexp}[1]
+{
+  codeinfo,
+  #1
+}
+\newtcblisting[auto counter,number within=section]{codebox}[3][center lower,listing side text,righthand width=3.5cm,bicolor,colbacklower=white]
+{
+  exampletitleinfo={#2}{#3},
+  breakable,
+  #1
+}
+
+\newtcblisting[use counter from=codebox,number within=section]{CODEBOX}[3][center lower,bicolor,colbacklower=white]
+{
+  exampletitleinfo={#2}{#3},
+  breakable,
+  #1
+}
+\newtcolorbox[use counter from=codebox]{codeboxspec}[3][]
+{
+  exampletitleinfo={#2}{#3},
+  breakable,
+  #1
+}
+
+\newtcblisting{texfexp}[1]
+{
+  failurecodeinfo,
+  #1
+}
+\newtcblisting[auto counter,number within=section]{fcodebox}[3][center lower,listing side text,righthand width=3.5cm,bicolor,colbacklower=white]
+{
+  failureexampletitleinfo={#2}{#3},
+  breakable,
+  #1
+}
+
+\newtcblisting[use counter from=fcodebox,number within=section]{FCODEBOX}[3][center lower,bicolor,colbacklower=white]
+{
+  failureexampletitleinfo={#2}{#3},
+  breakable,
+  #1
+}
+\newtcolorbox[use counter from=fcodebox]{fcodeboxspec}[3][]
+{
+  failureexampletitleinfo={#2}{#3},
+  breakable,
+  #1
+}
+
+\usepackage{xcolor}
+\NewDocumentCommand{\showcmd}{O{\textbackslash} m O{black}}{%
+    \leavevmode%
+    \ifthenelse{\equal{#3}{new}}{%
+        \textcolor{green!50!black}{\texttt{#1#2}}%
+    }{%
+        \ifthenelse{\equal{#3}{old}}{%
+            \textcolor{red}{\texttt{#1#2}}%
+        }{%
+            \textcolor{#3}{\texttt{#1#2}}%
+        }%
+    }%
+}
+
+\begin{document}
+
+\title{
+    \Huge\textbf{The QWorld Package}\\[4pt]
+    \scriptsize\texttt{Version 1.1.1} \\[4pt]
+}
+\author{
+    \textbf{Niina Ryota} \\[4pt]
+}
+\date{\today}
+\maketitle
+
+\begin{abstract}
+  \qworldname is a \LaTeX\ package designed for efficiently rendering complex graphical calculus in monoidal categories.
+  In particular, it supports the typesetting of diagrammatic languages in category theory, quantum theory, and related fields, where diagrammatic reasoning plays a crucial role.
+\end{abstract}
+
+\tableofcontents
+\section{Introduction}
+This document aims to provide a step-by-step guide to installing and using the \qworldname package, from basic commands to advanced applications. 
+\qworldname is a \LaTeX\ package specifically designed for the typesetting of diagrammatic languages, offering an intuitive command set for describing diagrams related to monoidal categories, Frobenius structures, braiding, Hopf algebras, symmetries, dualities, pivotal structures, and dagger categories using \tikzname\cite{tikz-manual}.
+\section{Basic Usage}
+\subsection{Fundamental Elements}
+The following are the most fundamental commands in the \qworldname package, forming the basis for drawing diagrams:
+\begin{itemize}
+  \item \showcmd{q}: A canvas for placing diagram elements.
+  \item \showcmd{qbox}: Draws a box\(\q[scale=0.5]{\qbox}\).
+  \item \showcmd{qwire}: Draws a wire\(\q[scale=0.5]{\qwire}\).
+  \item \showcmd{qcirc}: Compositon.
+\end{itemize}
+These commands are used within the canvas environment, denoted by \verb|\q{...}|. 
+For example, writing \verb|\q{\qbox}| results in the rendering of a box\(\q[scale=0.5]{\qbox}\).\par
+To compose \(\q[scale=0.5]{\qbox}\)and\(\q[scale=0.5]{\qbox}\), use \verb|\qcirc|. 
+This is analogous to function composition in mathematics, such as \(g\circ f\) (\verb|\(g\circ f\)|). 
+\begin{codebox}{}{Ex:78129738917}
+  \q{ \qbox \qcirc \qbox }
+\end{codebox}
+Additionally, placing multiple \verb|\qbox| commands in sequence results in boxes\(\q[scale=0.5]{\qbox}\)being arranged horizontally:
+\begin{codebox}{}{boxs2}
+  \q{ \qbox \qbox \qbox }
+\end{codebox}
+It is also possible to compose multiple boxes using\verb|\qcirc|:
+\begin{codebox}{}{boxsbr}
+    \q
+    {
+      \qbox \qbox \qbox
+        \qcirc
+      \qbox \qbox \qbox
+    }
+\end{codebox}
+Note that \verb|\n| is synonymous with\verb|\qcirc|
+\begin{codebox}{}{boxsn}
+  \q
+  {
+    \qbox \qbox \qbox \n
+    \qbox \qbox \qbox
+  }
+\end{codebox}
+\begin{codebox}{}{ex:hopflink}
+  \q{
+    \qcaprev         \qcap  \n
+    \qwire   \qbraid \qwire \n
+    \qwire   \qbraid \qwire \n
+    \qcup            \qcuprev
+  }
+\end{codebox}
+\begin{itemize}
+  \item \verb|\qcaprev| draws \(\q[scale=0.6]{\qcaprev}\).
+  \item \verb|\qcap| draws \(\q[scale=0.6]{\qcap}\).
+  \item \verb|\qwire| draws \(\q[scale=0.5]{\qwire}\).
+  \item \verb|\qbraid| draws \(\q[scale=0.5]{\qbraid}\).
+  \item \verb|\qcup| draws\(\q[scale=0.6]{\qcup}\).
+  \item \verb|\qcuprev| draws \(\q[scale=0.6]{\qcuprev}\).
+\end{itemize}
+As a whole, the elements are arranged in the diagram according to the order in which the commands are written.\par
+\subsection{Mathematical Mode}
+When writing equations that include diagrammatic language, use the mathematical mode.
+\begin{CODEBOX}{}{IntroEx}
+  \[
+    \operatorname{Tr}\left(\q{\qbraid\qcirc\qbraid}\right)
+    =\q{
+      \qcap               \qcap    \n
+      \qwire   \qbraidinv \qwire   \n
+      \qwire   \qbraidinv \qwire   \n
+      \qcuprev            \qcuprev
+    }
+  \]
+\end{CODEBOX}
+
+\subsection{Installation}
+The style file for the \qworldname package, \showcmd[]{qworld.sty}, is available for download from CTAN.
+To use it, place the file in your \TeX\ package directory and include the following line in the preamble:
+\begin{verbatim}
+  \usepackage{qworld}
+\end{verbatim}
+\paragraph{Dependencies} 
+The package depends on the following:
+\begin{itemize}
+  \item \tikzname, with the following libraries:
+    \iitem \showcmd[]{cd}
+    \iitem \showcmd[]{positioning}
+    \iitem \showcmd[]{arrows}
+    \iitem \showcmd[]{arrows.meta}
+    \iitem \showcmd[]{calc}
+    \iitem \showcmd[]{intersections}
+    \iitem \showcmd[]{shapes.symbols}
+    \iitem \showcmd[]{shapes.geometric}
+    \iitem \showcmd[]{shapes.misc}
+    \iitem \showcmd[]{decorations.pathreplacing}
+    \iitem \showcmd[]{decorations.markings}
+    \iitem \showcmd[]{decorations.pathmorphing}
+  \item \showcmd[]{pgffor}
+  \item \showcmd[]{ifthen}
+  \item \showcmd[]{xparse}
+  \item \showcmd[]{xfp}
+  \item \showcmd[]{xstring}
+\end{itemize}
+These dependencies are included by default in the \texlivename distribution, so no additional setup is required.
+\section{Basic Customization}
+This section explains how to customize commands in the \qworldname package.
+
+\subsection{Identification Number}
+All commands placed within \verb|\q{...}| are automatically assigned unique identification numbers based on their execution order. 
+For example, in the previous example \ref{boxsn}, each \verb|\qbox| is numbered as follows:
+\[\q{\qloop[2]{\qloop[3]{\qbox[show id={true}]}\n}}\]
+For more details, see Section \ref{subsec:show id} on page \pageref{subsec:show id}.
+\subsection{Bounding Box}
+\[
+  \q{
+  \qcaprev         \qcap  \n
+  \qwire   \qbraid \qwire \n
+  \qwire   \qbraid \qwire \n
+  \qcup            \qcuprev
+  \qbb[red][1,2]
+    \bbsymbol{Measure}
+    \bbsymbol[W]{Output}[left]
+    \bbsymbol[NW]{Computation}[above left]
+    \bbsymbol[NE]{Physics}[above right]
+  \qbb[yellow][3,5,6,8]
+    \bbsymbol{Braid}
+    \bbsymbol[W]{Compute}[left]
+  \qbb[cyan][9,10]
+    \bbsymbol{Create}
+    \bbsymbol[W]{Initialize}[left]
+  }
+\]
+
+Each element has an associated bounding box. The following are examples:
+\begin{itemize}
+  \item The bounding box of\q{\qcaprev}is visualized as\q{\qcaprev\qbball}.
+  \item The bounding box of\q{\qbraid}is visualized as\q{\qbraid\qbball}.
+  \item The bounding box of\q{\qwire}is visualized as\q{\qwire\qbball}.
+  \item The bounding box of\q{\qcuprev}is visualized as\q{\qcuprev\qbball}.
+\end{itemize}
+The following commands are available for visualizing bounding boxes and placing text near them:
+\begin{itemize}
+  \item Visualization
+    \iitem \showcmd{qbb}: Displays the bounding box of a specific element.
+    \iitem \showcmd{qbball}: Displays the bounding boxes of all elements at once.
+    \iitem \showcmd{qBBall}: Displays the bounding box surrounding the entire canvas.
+  \item Placing text
+    \iitem \showcmd{bbsymbol}: Places text within a bounding box.
+\end{itemize}
+\begin{verbatim}
+  \qbb[<color>][<ID list>]
+\end{verbatim}
+\begin{itemize}
+  \item First argument (optional): Specifies the color. If omitted, no color is applied.
+  \item Second argument: Specifies a list of element IDs to display their bounding boxes.
+\end{itemize}
+\begin{codebox}{}{Ex:78129738920}
+  \q{\qbox\qbb[1]}
+\end{codebox}
+\begin{codebox}{}{ex:781297389270454}
+  \q{
+    \qcaprev         \qcap  \n
+    \qwire   \qbraid \qwire \n
+    \qwire   \qbraid \qwire \n
+    \qcup            \qcuprev
+    \qbb[4,7]
+  }
+\end{codebox}
+\begin{CODEBOX}{}{Ex:78129738921}
+  \q{\qbox\qbox\qbox\qbox\qbox\qbox\qbb[yellow][2,...,5]}
+\end{CODEBOX}
+\begin{codebox}{}{Ex:74839722}
+  \q
+  {
+    \qbox\qbox\qbox\n
+    \qbox\qbox\qbox
+    \qbb[green][2,5]
+  }
+\end{codebox}
+\begin{codebox}{}{Ex:78129738918}
+  \q{
+    \qcaprev \qcap          \n
+    \qwire   \qbraid \qwire \n
+    \qwire   \qbraid \qwire \n
+    \qcup    \qcuprev
+    \qbb[blue][4,7]
+  }
+\end{codebox}
+\begin{verbatim}
+  \qbball[<color>]
+\end{verbatim}
+\begin{itemize}
+  \item Displays multiple bounding boxes at once (even for a single element).
+  \item Ensures that the bounding boxes of different elements are properly aligned without overlap.
+  \item The \qworldname package \textbf{minimizes the need for tedious manual coordinate adjustments} in diagram drawing.
+\end{itemize}
+\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{Ex:781297389270511}
+  \q{
+    \qcaprev         \qcap    \n
+    \qwire   \qbraid \qwire   \n
+    \qwire   \qbraid \qwire   \n
+    \qcup            \qcuprev
+    \qbball
+  }
+\end{codebox}
+
+\begin{verbatim}
+  \qBBall[<color>]
+\end{verbatim}
+\begin{itemize}
+  \item Displays the bounding box surrounding all elements within the canvas.
+\end{itemize}
+\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{Ex:78129738916}
+  \q{
+    \qcaprev         \qcap    \n
+    \qwire   \qbraid \qwire   \n
+    \qwire   \qbraid \qwire   \n
+    \qcup            \qcuprev
+    \qBBall
+  }
+\end{codebox}
+\begin{verbatim}
+  \bbsymbol[<direction>]{<text>}[<options>]
+\end{verbatim}
+\begin{itemize}
+  \item First argument (optional): Specifies placement direction. Options:
+    \iitem \showcmd[]{N} (North), \showcmd[]{S} (South), \showcmd[]{E} (East), \showcmd[]{W} (West),
+    \iitem \showcmd[]{NW} (Northwest), \showcmd[]{NE} (Northeast), \showcmd[]{SE} (Southeast), \showcmd[]{SW} (Southwest),
+    \iitem \showcmd[]{C} (Center).
+    \iitem Default: \showcmd[]{E} (East).
+  \item Second argument: Specifies the text to be placed.
+  \item Third argument (optional): Adjusts position (e.g., \showcmd[]{above}, \showcmd[]{below}, \showcmd[]{left}, \showcmd[]{right}).
+    \iitem Default: \showcmd[]{right}.
+\end{itemize}
+\begin{CODEBOX}{}{Ex:bbsymbol}
+  \q[scale=5]{
+    \qbox
+    \qbb[1]
+    \bbsymbol{East (Default)}
+    \bbsymbol[W]{West}[left]
+    \bbsymbol[N]{North}[above]
+    \bbsymbol[S]{South}[below]
+    \bbsymbol[NE]{NorthEast}[above right]
+    \bbsymbol[NW]{NorthWest}[above left]
+    \bbsymbol[SE]{SouthWest}[below right]
+    \bbsymbol[SW]{SouthEast}[below left]
+    \bbsymbol[C]{Center}[]
+  }
+\end{CODEBOX}
+\begin{CODEBOX}{}{Ex:78129738915}
+  \q
+  {
+    \qcaprev         \qcap    \n
+    \qwire   \qbraid \qwire   \n
+    \qwire   \qbraid \qwire   \n
+    \qcup            \qcuprev
+    \qbb[red][1,2]
+    \bbsymbol{Measure}
+    \bbsymbol[W]{Output}[left]
+    \bbsymbol[NW]{Computation}[above left]
+    \bbsymbol[NE]{Physics}[above right]
+    \qbb[yellow][3,5,6,8]
+    \bbsymbol{Braid}
+    \bbsymbol[W]{Compute}[left]
+    \qbb[cyan][9,10]
+    \bbsymbol{Create}
+    \bbsymbol[W]{Initialize}[left]
+  }
+\end{CODEBOX}
+
+\subsection{Box Customization}
+\label{subsec:boxcustomization}
+Keys can be used to adjust the number and arrangement of the box’s boundary lines.
+For example, the following boxes can be drawn:
+\begin{itemize}
+  \item \(\q[scale=0.5]{\qbox[p=20,hlen=3]}\)
+  \item \(\q[scale=0.5]{\qbox[p=10,N={1,2,3,8,9,10},S={4,5,6,7},hlen=3]}\)
+\end{itemize}
+These keys are applicable to many elements other than wires.
+The main keys are as follows: 
+\begin{itemize}
+  \item \showcmd[]{n}
+    \iitem The number of points on the north edge of the box\(\q[scale=0.5]{\qbox[p=2, P={}]}\)where wires\(\q[scale=0.31]{\qwire}\)can be generated (these points will be referred to as \showcmd[]{n} terminals).
+    \iitem For example, if \showcmd[]{n=3}, three points can be placed at equal intervals on the north edge of the box.
+    \iitem The default value is \showcmd[]{n=1}.
+    \iitem The point obtained by vertically moving an \showcmd[]{n} terminal to the northernmost position is called an \showcmd[]{N} terminal.
+    \iitem Both \showcmd[]{n} terminals and \showcmd[]{N} terminals are indexed as \(1,2,...\) from the west (left).   
+    \iitem Generating a wire from the \(i\)-th \showcmd[]{n} terminal means connecting the \(i\)-th \showcmd[]{n} terminal and the \(i\)-th \showcmd[]{N} terminal with a line segment.
+  \item \showcmd[]{N}
+    \iitem The set of indices of the \showcmd[]{n} terminals from which wires are actually generated.
+    \iitem For example, if \showcmd[]{n=3} and \showcmd[]{N=\{2\}}, a wire can be generated from the \(2\)nd of the three \showcmd[]{n} terminals.
+    \iitem If \showcmd[]{n} is unspecified and \showcmd[]{N} is specified, \showcmd[]{n} is automatically set to \(\showcmd[]{n}\coloneq\max\showcmd[]{N}\).
+    \iitem If \showcmd[]{N} is unspecified and \showcmd[]{n} is specified, \showcmd[]{N} is automatically set to \(\showcmd[]{N}\coloneq\{1,...,\showcmd[]{n}\}\).
+    \iitem The northernmost end of a wire actually generated from an \showcmd[]{n} terminal is called the output point, or \showcmd[]{O} terminal.
+  \item \showcmd[]{s}
+    \iitem The number of points on the south edge of the box where wires can be generated (these points will be referred to as \showcmd[]{s} terminals).
+    \iitem For example, if \showcmd[]{s=4}, four points can be placed at equal intervals on the south edge of the box. 
+    \iitem The default value is \showcmd[]{s=1}.
+    \iitem The point obtained by vertically moving an \showcmd[]{s} terminal to the southernmost position is called an \showcmd[]{S} terminal.
+    \iitem Both \showcmd[]{s} terminals and \showcmd[]{S} terminals are indexed as \(1,2,...\) from the west (left).     
+    \iitem Generating a wire from the \(i\)-th \showcmd[]{s} terminal means connecting the \(i\)-th \showcmd[]{s} terminal and the \(i\)-th \showcmd[]{S} terminal with a line segment.
+  \item \showcmd[]{S}
+    \iitem The set of indices of the \showcmd[]{s} terminals from which wires are actually generated.
+    \iitem For example, if \showcmd[]{s=4} and \showcmd[]{S=\{1,4\}}, wires can be generated from the 1st and 4th of the four \showcmd[]{s} terminals.
+    \iitem If \showcmd[]{s} is unspecified and \showcmd[]{S} is specified, \showcmd[]{s} is automatically set to \(\showcmd[]{s}\coloneq\max\showcmd[]{S}\).
+    \iitem If \showcmd[]{S} is unspecified and \showcmd[]{s} is specified, \showcmd[]{S} is automatically set to \(\showcmd[]{S}\coloneq\{1,...,\showcmd[]{s}\}\).
+    \iitem The southernmost end of a wire actually generated from an \showcmd[]{s} terminal is called the input point, or \showcmd[]{I} terminal.
+  \item \showcmd[]{hlen}
+    \iitem The horizontal length of the bounding box.
+    \iitem For example, if \showcmd[]{hlen=2}, the horizontal length of the bounding box becomes \showcmd[]{2}.
+    \iitem With one exception, the distance between the westernmost wire and the bounding box's boundary, and the distance between the easternmost wire and the bounding box's boundary, are both \(\fpeval{0.5}\).
+    \iitem When \showcmd[]{hlen} is unspecified, the \showcmd[]{n} terminals and \showcmd[]{s} terminals are arranged with an interval of \(1\).
+    \iitem When \showcmd[]{hlen} is specified, the \showcmd[]{n} terminals and \showcmd[]{s} terminals are arranged at equal intervals in a section of length \(\showcmd[]{hlen}-1\). The spacing depends on \showcmd[]{hlen} and the number of terminals.
+      \iiitem If there is only one terminal, it is placed at the center of the section. In this case, if \(\showcmd[]{hlen}>1\), the distance between the westernmost wire and the bounding box's boundary, and the distance between the easternmost wire and the bounding box's boundary, are both \(\frac{\showcmd[]{hlen}}{2}>\fpeval{0.5}\).
+  \item \showcmd[]{vlen}
+    \iitem The vertical length (height) of the bounding box.
+    \iitem The default value is \showcmd[]{vlen=1}.
+  \item \showcmd[]{id}
+    \iitem The identifier of the box.
+    \iitem For example, if \showcmd[]{id=ID}, the following names are automatically assigned to the various points:
+      \iiitem The \(i\)-th \showcmd[]{n} terminal (counting from the west): (n-\(i\)-ID).
+      \iiitem The \(i\)-th \showcmd[]{s} terminal: (s-\(i\)-ID).
+      \iiitem The point obtained by vertically moving the \(i\)-th \showcmd[]{n} terminal to the north edge of the box: (N-\(i\)-ID).
+      \iiitem The point obtained by vertically moving the \(i\)-th \showcmd[]{s} terminal to the south edge of the box: (S-\(i\)-ID).
+      \iiitem The northwest corner of the bounding box: (NW-ID)
+      \iiitem The northeast corner of the bounding box: (NE-ID)
+      \iiitem The southwest corner of the bounding box: (SW-ID)
+      \iiitem The southeast corner of the bounding box: (SE-ID)
+      \iiitem The northernmost point of the bounding box: (N-ID)
+      \iiitem The southernmost point of the bounding box: (S-ID)
+      \iiitem The westernmost point of the bounding box: (W-ID)
+      \iiitem The easternmost point of the bounding box: (E-ID)
+      \iiitem The center of the bounding box: (C-ID)
+      \iiitem The northwest corner of the box: (nw-ID)
+      \iiitem The northeast corner of the box: (ne-ID)
+      \iiitem The southwest corner of the box: (sw-ID)
+      \iiitem The southeast corner of the box: (se-ID)
+      \iiitem The northernmost point of the box: (n-ID)          
+      \iiitem The southernmost point of the box: (s-ID)
+      \iiitem The westernmost point of the box: (w-ID)
+      \iiitem The easternmost point of the box: (e-ID)          
+      \iiitem The \(i\)-th output point: (O-\(i\)-ID)
+      \iiitem The \(i\)-th input point: (I-\(i\)-ID)          
+    \iitem Regardless of whether it is specified, each command placed inside \showcmd{q\{...\}} is assigned an identification number. Replacing the ID part with that number refers to the same point. See section \ref{subsec:show id} for details.
+  \item \showcmd[]{p}, \showcmd[]{P}
+    \iitem For a positive integer \showcmd[]{k}, \showcmd[]{p=k} means \showcmd[]{n=k} and \showcmd[]{s=k}.
+    \iitem For a finite set of positive integers \showcmd[]{K}, \showcmd[]{P=K} means \showcmd[]{N=K} and \showcmd[]{S=K}.
+  \item \showcmd[]{name}
+    \iitem With \showcmd[]{name=<text>}, \text{<text>} is placed at the center of the box.
+\end{itemize}
+\begin{CODEBOX}{}{ex:boxpoints}
+  \def\pradius{0.4pt}
+  \q[scale=4]
+  {
+    \qbox
+    [
+      n=3,N={2},
+      s=4,S={1,4},
+      hlen=2,
+      vlen=2,
+      id={ID},
+      name={C-ID}
+    ]\n
+    \qbb[ID]
+    \node [above] at (NE-ID) {NE-ID};
+    \node [above] at (NW-ID) {NW-ID};
+    \node [below] at (SE-ID) {SE-ID};
+    \node [below] at (SW-ID) {SW-ID};
+    \fill (NE-ID) circle (\pradius);
+    \fill (NW-ID) circle (\pradius);
+    \fill (SE-ID) circle (\pradius);
+    \fill (SW-ID) circle (\pradius);
+    \node [above] at (ne-ID) {ne-ID};
+    \node [above] at (nw-ID) {nw-ID};
+    \node [below] at (se-ID) {se-ID};
+    \node [below] at (sw-ID) {sw-ID};
+    \fill (ne-ID) circle (\pradius);
+    \fill (nw-ID) circle (\pradius);
+    \fill (se-ID) circle (\pradius);
+    \fill (sw-ID) circle (\pradius);
+    \foreach\i in {1,...,3}
+    {
+      \symboln[\i]{n-\i-ID}[below]
+      \fill (n-\i-ID) circle (\pradius);
+      \symbolN[\i]{N-\i-ID}
+      \fill (N-\i-ID) circle (\pradius);
+    }
+    \foreach\i in {1,...,4}
+    {
+      \symbols[\i]{s-\i-ID}[above]
+      \fill (s-\i-ID) circle (\pradius);
+      \symbolS[\i]{S-\i-ID}[below]
+      \fill (S-\i-ID) circle (\pradius);
+    }
+    \draw[line width=0.2pt] (NW-ID) 
+      to [bend left=60] node [fill=white, midway] {hlen} (NE-ID);
+    \draw[line width=0.2pt] (NW-ID) 
+      to [bend right=60] node [fill=white, midway] {vlen} (SW-ID);
+    \draw [red, <->] (C-ID -| W-ID)
+      -- node [midway, auto, font=\footnotesize] {0.5} (C-ID -| S-1-ID);
+    \draw [red, <->] (C-ID -| S-4-ID)
+      -- node [midway, auto, font=\footnotesize] {0.5} (C-ID -| E-ID);
+    \qwire[arrowtype={loosely dotted}, dom={s-1-ID}, cod={n-1-ID}]
+    \qwire[arrowtype={loosely dotted}, dom={s-4-ID}, cod={n-3-ID}]
+    \node (O1prime) at ([shift={(0.25,0.25)}]O-1-ID){O-1-ID};
+    \draw[->,red] (O1prime) to ([shift={(0.05,0.05)}]O-1-ID);
+    \node (I1prime) at ([shift={(0.5,-0.5)}]I-1-ID){I-1-ID};
+    \node (I2prime) at ([shift={(0.5,-0.5)}]I-2-ID) {I-2-ID};
+    \draw[->,red](I1prime) to ([shift={(0.05,-0.05)}]I-1-ID);
+    \draw[->,red](I2prime) to ([shift={(0.05,-0.05)}]I-2-ID);
+  }
+\end{CODEBOX}
+The \verb|\qwire| \verb|arrowtype| key, as well as the \verb|dom| and \verb|cod| keys, are explained in section \ref{subsec:wirecustomization} on page \pageref{subsec:wirecustomization}.
+
+\paragraph{Label (\showcmd{symbol})}
+\begin{verbatim}
+  \symbolI[<number>]{<label>}[<options>]
+\end{verbatim}
+For example, \verb|\symbolI[2]{text}[below right, id=ID]| places the label "text" at the bottom right of the second input point (I-2-ID) of \verb|\q{\qbox[p=3, id=ID]}| (\(\q[scale=0.5]{\qbox[p=3, id=ID]}\)). 
+When no number or options are specified, the default values \(1\), below, and \verb|id=<previous>| are applied, respectively. 
+Other label display commands include:
+\begin{verbatim}
+  \symbolS[<number>]{<label>}[<options>]
+\end{verbatim}
+\begin{verbatim}
+  \symbols[<number>]{<label>}[<options>]
+\end{verbatim}
+\begin{verbatim}
+  \symbolO[<number>]{<label>}[<options>]
+\end{verbatim}
+\begin{verbatim}
+  \symbolN[<number>]{<label>}[<options>]
+\end{verbatim}
+\begin{verbatim}
+  \symboln[<number>]{<label>}[<options>]
+\end{verbatim}
+\verb|\symbolS| and \verb|\symbols| place the label \textless label\textgreater at points (S-\(i\)-ID) and (s-\(i\)-ID), respectively. 
+The default number \(i\) is \(1\), and the default option is below. 
+\verb|\symbolO|, \verb|\symbolN|, and \verb|\symboln| place the label \textless label\textgreater at points (O-\(i\)-ID), (N-\(i\)-ID), and (n-\(i\)-ID), respectively. 
+The default number \(i\) is \(1\), and the default option is above.
+\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{Ex:78129738911}
+  \q{
+    \qbox[p=5, S={1,4,5}, id=ID]
+    \symbolO{A}
+    \symbolN[3]{B}
+    \symboln[5]{C}[below left]
+    \symbolS[2]{D}
+    \symbols[3]{E}
+    \symbolI[2]{F}
+    \symbolI[3]{G}[below right]
+  }
+\end{codebox}
+\begin{CODEBOX}{}{Ex:78129738910}
+  \q{
+    \qbox[p=10,N={1,2,5,6,9,10}, id=ID]
+    \foreach\i in {1,...,10}
+    {
+      \symbolI[\i]{\(x_{\i}\)}
+    }
+    \foreach\j in {1,...,6}
+    {
+      \symbolO[\j]{\(y_{\j}\)}
+    }
+  }
+\end{CODEBOX}
+
+\subsection{Repetition}
+\label{subsec:forloop}
+\begin{verbatim}
+  \qloop[<number of repetitions>]{<command>}
+\end{verbatim}
+By using the \verb|\qloop| command, you can repeat a command the specified number of times:
+\begin{CODEBOX}{}{Ex:78129738905}
+  \q{ \qloop[10]{\qbox} }
+\end{CODEBOX}
+The \verb|\qloop| command can also be used outside of \verb|\q|:
+\begin{codebox}[listing side text,righthand width=5.5cm,bicolor,colbacklower=white]{}{Ex:781297389220930}
+  \qloop[30]{I AM BOB}
+\end{codebox}
+
+\subsection{Displaying Identification Numbers}
+\label{subsec:show id}
+Commands inside \verb|\q{...}| are automatically assigned identification numbers. 
+If \showcmd[]{show id=true} is specified, those identification numbers will be displayed.
+\begin{CODEBOX}{}{Ex:78129738903}
+  \q{
+    \qbox[show id={true}] \qbox[show id={true}] \qbox[show id={true}]\n
+    \qbox[show id={true}] \qbox[show id={true}] \qbox[show id={true}]
+  }
+\end{CODEBOX}
+\begin{CODEBOX}{}{Ex:78129738902}
+  \q{
+    \qloop[10]
+    {
+      \qloop[10]
+      {
+        \qbox[show id={true}]
+      }\n
+    }\n
+  }
+\end{CODEBOX}
+
+\subsection{Color}
+You can specify colors for the boxes:
+\begin{itemize}
+  \item \showcmd[]{color}
+    \iitem The color inside the box, for example, \showcmd[]{color=green} will produce \q[scale=0.75]{\qbox[color={green}]}.
+  \item \showcmd[]{frame color}
+    \iitem The color of the box's frame, for example, \showcmd[]{frame color=cyan} will produce \q[scale=0.75]{\qbox[frame color={cyan}]}.
+  \item \showcmd[]{morphism color}
+    \iitem The color of the morphisms inside the box, for example, \showcmd[]{morphism color=red} will produce \q[scale=0.75]{\qbox[morphism color={red}, name={\(f\)}]}.
+\end{itemize}
+\begin{CODEBOX}{}{Ex:74839759}
+  \q[scale={\fpeval{pi}}]{
+    \qbox
+    [
+      name={\textbf{Q-WORLD}},
+      color=red,
+      frame color={green!50!black},
+      morphism color=yellow
+    ]
+  }
+\end{CODEBOX}
+
+\paragraph{\showcmd[]{N}, \showcmd[]{S}, Arithmetic Sequence}
+\qworldname loads the \showcmd[]{pgffor} package, so the shorthand notation using \verb|...| can be used for lists:
+\begin{itemize}
+  \item \(1,...,10\): An arithmetic sequence with a common difference of \(1\)
+  \item \(1,3,...,11\): An arithmetic sequence based on the first two terms with a common difference
+\end{itemize}
+\begin{CODEBOX}{}{Ex:74839758}
+  \q{
+    \qbox[N={1,...,10}, S={1,3,...,11}]
+    }
+\end{CODEBOX}
+\begin{CODEBOX}{}{Ex:74839757}
+  \q{
+    \qbox[N={1,...,4,6,8,...,20}, S={1,...,20}, hlen=10]
+  }
+\end{CODEBOX}
+\begin{CODEBOX}{}{Ex:74839756}
+  \q{
+    \qbox[N={1,...,4,7,10,...,19,20,21,...,25}, S={1,...,25}, hlen=10]
+  }
+\end{CODEBOX}
+\subsection{Relative Coordinates}
+This is a command for specifying the position of elements relative to a given point. 
+Note that \(x\) and \(y\) do not have to be integers; expressions evaluable by \verb|\fpeval|, 
+such as \verb|2^1.5|, \verb|cos(pi)|, and \verb|sprt(2)|, are valid.
+\begin{itemize}
+  \item \showcmd{qmv[\(x\),\(y\)]}
+    \iitem Translates by (\(x\), \(y\)).
+    \iitem The default is \(x=y=0\).
+  \item \showcmd{n[\(y\)]}
+    \iitem Moves vertically by \(y\) (\(Y\mapsto Y-y\)), and sets the X coordinate to \(0\).
+    \iitem The default is \(y=1\) , which behaves like a line break.
+  \item \showcmd{qspace[\(x\)]}
+    \iitem Moves Horizontally by \(x\). 
+    \iitem The default is \(x=1\), which behaves like the spacebar.
+    \iitem This is equivalent to \showcmd{qmv[\(x\),0]}.
+  \item \showcmd{qreset[\(x\),\(y\)]}
+    \iitem Moves to the point (\(x\),\(y\)).
+\end{itemize}
+\[\q[scale=2.35]{
+  \fill[blue] (qworldat) circle (1pt);
+  \coordinate (I) at (qworldat);
+  \qbox
+  \fill[blue] (qworldat) circle (1pt);
+  \coordinate (II) at (qworldat);
+  \n
+  \fill[blue] (qworldat) circle (1pt);
+  \coordinate (III) at (qworldat);
+  \qspace
+  \fill[blue] (qworldat) circle (1pt);
+  \coordinate (IV) at (qworldat);
+  \qspace[0.5]
+  \fill[blue] (qworldat) circle (1pt);
+  \coordinate (V) at (qworldat);
+  \n[2]
+  \fill[blue] (qworldat) circle (1pt);
+  \coordinate (VI) at (qworldat);
+  \qmv[-2,-1]
+  \fill[blue] (qworldat) circle (1pt);
+  \coordinate (VII) at (qworldat);
+  \n
+  \fill[blue] (qworldat) circle (1pt);
+  \coordinate (VIII) at (qworldat);
+  \qspace[-3]
+  \fill[blue] (qworldat) circle (1pt);
+  \coordinate (IX) at (qworldat);
+  \qreset
+  \fill[blue] (qworldat) circle (1pt);
+  \coordinate (X) at (qworldat);
+  \qreset[-2,1]
+  \fill[blue] (qworldat) circle (1pt);
+  \coordinate (XI) at (qworldat); 
+  \qbball
+  \qwireup[dom={I}, cod={II},
+          label={Auto-update}, label side={below},
+          label at={midway}, color=cyan]
+  \qwireup[dom={II},cod={III},
+          label={\showcmd{n}},
+          label side={below}, color=cyan]
+  \qwireup[dom={III},cod={IV},
+          label={\showcmd{qspace}},
+          label side={below}, color=cyan]
+  \qwireup[dom={IV},cod={V},
+          label={\showcmd{qspace[0.5]}},
+          label at={at end}, label side={above}, color=cyan]
+  \qwireup[dom={V},cod={VI},
+          label={\showcmd{n[2]}},color=cyan]
+  \qwireup[dom={VI},cod={VII},
+          label={\showcmd{qmv[-2,-1]}},color=cyan]
+  \qwireup[dom={VII},cod={VIII},
+          label={\showcmd{n}},color=cyan]
+  \qwireup[dom={VIII},cod={IX},
+          label={\showcmd{qspace[-3]}}, 
+          label side={below},color=cyan]
+  \qwireup[dom={IX},cod={X},
+          label={\showcmd{qreset}},
+          label side=left, color=cyan]
+  \qwireup[dom={X},cod={XI},
+          label={\showcmd{qreset[-2,1]}},
+          label side=left, 
+          label at={near start}, color=cyan]
+  \draw[help lines] (-4,-6) grid (2,2);
+}\]
+
+\subsection{Absolute Coordinates}
+By using the \showcmd[]{at} key, positions can be specified with absolute coordinates. 
+\verb|\q{\qbox[at={2,3}]}| is equivalent to \verb|\q{\qreset[2,3]\qbox}|.
+\begin{CODEBOX}{Absolute Coordinates}{Ex:74839754}
+  \q{
+    \coordinate (a) at (0,{\fpeval{2*sqrt(3)}});
+    \qbox[at=a]
+    \qbox[at={-2,0}]
+    \qbox[at={2,0}]
+    \fill[red] (a) circle (2pt);
+    \fill[red] (-2,0) circle (2pt);
+    \fill[red] (2,0) circle (2pt);
+    \node[below left] at (a) {a};
+    \node[below left] at (-2,0) {(-2,0)};
+    \node[below left] at (2,0) {(2,0)};
+  }
+\end{CODEBOX}
+The \TeX\ language is Turing complete\footnote{For example, the ability to simulate a Turing machine is demonstrated in the example from LiteratePrograms\cite{literateprograms}. Additionally, an article on Overleaf introduces a method to compute Fibonacci numbers using \TeX, illustrating the  practical utility of its Turing completeness \cite{overleaf}}. 
+In other words, every algorithm that exists in the world can be expressed in \TeX. 
+Phisical simulations (such as weather forecasting or chemical reaction prediction), 
+economic simulations (such as investment strategies), 
+and even artificial intelligence learning algorithms (such as image recognition or natural language processing)------\par
+all of these can be implemented in \TeX.\par
+However, how many people would actually want to do that? 
+I for one, wouldn't want to write even a sorting algorithm in \TeX. 
+That's like tring to create Super Mario in spreadsheet.\par
+However, there is a twist.\par
+I had a ``revelation''\footnote{Original source: On January 20,  2011, an algorithm called "Sleep Sort" was posted on the anonymous message board 4chan \cite{geniussorting, gfxhatena}. This algorithm uses a \showcmd[]{Bash} script to execute each input value as a thread asynchronously, sorting the list by the timing of each thread’s completion (the specified "sleep" time).}.
+And with the \showcmd[]{at} key, I created a sorting algorithm.
+\begin{codebox}{}{Ex:genius}
+  \newcommand{\AtSort}[1][1]{
+    \q{
+      \foreach \i in {#1}
+      {
+        \qbox[name={\i}, at={0, -\i}]\n
+      }
+    }
+  }
+  \AtSort[4,1,3,-1,6,2]
+\end{codebox}
+It works. Indeed, it works.\par
+But there is one problem.
+\textbf{If the list contains elements with large absolute values, the output will overflow the page}.
+\subsection{Wire Customization}
+\label{subsec:wirecustomization}
+\[
+  \q{
+    \def\maxi{11}
+    \foreach \i in {0,...,\maxi}
+    {
+        \qwireup[dom={0,0}, cod={{\fpeval{\i*360/(\maxi+1)}}:3}]
+        \node at ({\fpeval{\i*360/(\maxi+1)}}:3.6) {\showcmd[]{cod}\i};
+    }
+  }
+\]
+Among the keys of the box \(\q[scale=0.5]{\qbox}\) introduced in section \ref{subsec:boxcustomization}, \showcmd[]{id} and \showcmd[]{vlen} are also valid for wires. 
+The basic keys specific to wires are as follows:
+\begin{itemize}
+  \item \showcmd[]{dom}: input point. 
+  \item \showcmd[]{cod}: output point.
+    \iitem Default value is the position obtained by moving \showcmd[]{dom} \(1\) unit vertically to the north.
+  \item \showcmd[]{label}: Label for the wire. 
+  \item \showcmd[]{label at}: Position of the label on the wire.
+    \iitem The default is midway.
+  \item \showcmd[]{label side}: Relationship between the label and the wire.
+    \iitem The default is right.
+\end{itemize}
+\begin{codebox}{}{ex:781297389260951}
+  \q{
+    \qbox[n=3,hlen=1.5]
+    \qbox[at={1,2}, s=2, hlen=1.5]
+    \qbox[at={-1,4}, s=2, hlen=1.5]
+    \qwire[dom={N-1-1}, cod={S-1-3}]
+    \qwire[dom={N-2-1}, cod={S-1-2}]
+    \qwire[dom={N-3-1}, cod={S-2-2}]
+    \qwire[dom={N-1-2}, cod={S-2-3}]
+  }
+\end{codebox}
+\begin{CODEBOX}{}{ex:193477432894112213}
+  \q{
+    \def\maxi{11}
+    \foreach \i in {0,...,\maxi}
+    {
+        \qwireup[dom={0,0}, cod={{\fpeval{\i*360/(\maxi+1)}}:2}]
+        \node at ({\fpeval{\i*360/(\maxi+1)}}:2.5) {\texttt{cod} \i};
+    }
+  }
+\end{CODEBOX}
+The bounding box of the wire \q[scale=0.6]{\qwire} is the same as that of \q[scale=0.5]{\qbox}:
+\begin{codebox}{}{ex:781297389220926}
+  \q{
+    \qwire\qbox\qwire\n
+    \qbox\qwire\qbox
+    \qbball
+  }
+\end{codebox}
+The bounding box of the wire matches that of a box with \showcmd[]{dom} as the input point and \showcmd[]{cod} as the output point:
+\begin{itemize}
+  \item \(\q[scale=0.5]{\qwire}\) and \(\q[scale=0.5]{\qbox}\)
+  \item \(\q[scale=0.5]{\qwire[dom={0,0},cod={1,1}]}\) and \(\q[scale=0.5]{\qbox[p=2,S={1},N={2}]}\)
+\end{itemize}
+
+\begin{CODEBOX}{}{Ex:78129738909}
+  \q[scale=3]{
+    \coordinate (A) at (0,0);
+    \coordinate (B) at (2,3);
+    \qwire[dom=A, cod={1,1}, label={wire1}, label side={left}]
+    \qwire[dom={1,1}, cod=B, label={wire2}, label at={near end}]
+    \node[fill=red, circle] at (A) {A};
+    \node[fill=green, circle] at (B) {B};
+    \node[fill=yellow, circle] at (1,1) {(1,1)};
+    \qbball
+  }
+\end{CODEBOX}
+
+\begin{CODEBOX}{}{Ex:78129738901}
+  \q{
+    \qloop[5]{
+      \qloop[10]{
+        \qbox[show id={true}]
+      }\n
+    }\n
+    \qspace[3]\qbox[s=2,show id={true},id={ego1}]\n\n
+    \qspace[6]\qbox[n=2,show id={true},id={ego2}]\n\n
+    \qloop[5]{
+      \qloop[10]{
+        \qbox[show id={true}]
+      }\n
+    }
+    \qwire[dom={O-1-55},cod={I-1-51}]
+    \qwire[dom={O-1-60},cod={I-1-52}]
+    \qwire[dom={O-1-51},cod={I-1-45}]
+    \qwire[dom={O-1-52},cod={I-2-51}]
+    \qwire[dom={O-2-52},cod={I-1-48}]
+  }
+\end{CODEBOX}
+
+\paragraph{arrowtype}
+The wire style is specified using the \showcmd[]{arrowtype} key.
+\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{wirearrowtype}
+  \q{
+    \qwire[arrowtype=dotted]
+    \qwire[arrowtype=dashed]
+    \qwire[arrowtype={dash dot}]
+    \qwire[arrowtype={dash dot dot}]
+    \qwire[arrowtype={densely dotted}]
+    \qwire[arrowtype={loosely dotted}]
+  }
+\end{codebox}
+
+\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{boxarrowtype}
+  \q{
+    \qbox[dom arrowtype={dotted}]
+    \qbox[cod arrowtype={dotted}]
+    \qbox[arrowtype={dotted}]
+  }
+\end{codebox}
+
+\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{spiderarrowtype}
+  \q{
+    \qspider[dom arrowtype={dotted}]
+    \qspider[cod arrowtype={dotted}]
+    \qspider[arrowtype={dotted}]
+  }
+\end{codebox}
+
+\subsection{Canvas}
+\begin{verbatim}
+  \q[option]
+  {
+    command 1
+    command 2
+    ...
+  }
+\end{verbatim}
+The entire diagram can be transformed useing canvas options.
+\begin{codebox}{}{Ex:74839753}
+  \q[scale=2,rotate=30]{\qbox}
+\end{codebox}
+It is also possible to \textbf{slant} the canvas.
+\begin{CODEBOX}{}{Ex:74839752}
+  \def\anglerot{-55}
+  \tikzset
+  {
+    my slant style/.style={
+      yslant=-cot(\anglerot), 
+      xscale=sin(-\anglerot)
+      }
+  }
+  \q[my slant style]
+  {
+    \qcaprev\qcap\n
+    \qwire\qbraidinv\qwiredown\n
+    \qwiredown\qbraidinv\qwire\n
+    \qcup\qcuprev
+    \qBBall
+  }
+\end{CODEBOX}
+\begin{CODEBOX}{}{Ex:74839751}
+  \def\anglerot{-60}
+  \tikzset
+  {
+    my slant style/.style={
+      yslant=-cot(\anglerot), 
+      xscale=sin(-\anglerot)
+    }
+  }
+  \[
+    \q[my slant style]{
+      \qbraid\qwire\n
+      \qwire\qbraid\n
+      \qbraid\qwire
+    }=\q[my slant style]{
+      \qbraid\qwire\n
+      \qwire\qwire\qwire\n
+      \qbraid[num R=2]
+      \qbb[red][1]
+      \qbb[cyan][6]
+    }=\q[my slant style]{
+      \qbraid[ num R=2]\n
+      \qwire\qwire\qwire\n
+      \qwire\qbraid
+      \qbb[red][6]
+      \qbb[cyan][1]
+    }=\q[my slant style]{
+      \qwire\qbraid\n
+      \qbraid\qwire\n
+      \qwire\qbraid
+    }
+  \]
+\end{CODEBOX}
+
+\section{Monoidal Categories and \qworldname}
+In this section, we explore how to typeset graphical calculus using the \qworldname package, examining its different applications and practical usage.\par
+While \qworldname can handle diagrams independently, it is often beneficial to combine it with packages like \showcmd[]{amsmath}, \showcmd[]{amssymb}, and \showcmd[]{mathtools} for more flexible mathematical expressions. 
+This section demonstrates how to typeset actual graphical calculus in \TeX\ while introducing the functionalities of \qworldname.\par
+To reproduce the examples in this section, please ensure that the following packages are loaded:
+\begin{verbatim}
+  \usepackage{amsmath, amssymb, mathtools}
+  \usepackage{qworld}
+\end{verbatim}
+\subsection{Category}
+\begin{codebox}{Domain}{ex:dom2}
+  \[
+    \operatorname{dom}\left(
+      \q{
+        \qbox[name={\(f\)}]
+        \symbolI{\(x\)}
+        \symbolO{\(y\)}
+      }
+    \right)=\q{\qwire[label={\(x\)}]}
+  \]
+\end{codebox}
+\begin{codebox}{Codomain}{ex:cod2}
+  \[
+    \operatorname{cod}\left(
+      \q{
+        \qbox[name={\(f\)}]
+        \symbolI{\(x\)}
+        \symbolO{\(y\)}
+      }
+    \right)=\q{\qwire[label={\(y\)}]}
+  \]
+\end{codebox}
+
+\begin{codebox}{(Vertical) Compositon}{def:composite}
+  \[
+    \q{
+      \qbox[name={\(f\)}]\qcirc\qbox[name={\(g\)}]
+    }=\q{\qbox[name={\(f\circ g\)}]}
+  \]
+\end{codebox}
+\begin{CODEBOX}{Associativity}{Ex:74839750}
+  \[
+    \forall\q{\qbox[name={\(h\)}] \symbolI{\(z\)} \symbolO{\(w\)}},
+           \q{\qbox[name={\(g\)}] \symbolI{\(y\)} \symbolO{\(z\)}},
+           \q{\qbox[name={\(f\)}] \symbolI{\(x\)} \symbolO{\(y\)}}:
+    \q{
+        \qbox[name={\(h\)}]\qcirc\qbox[name={\(g\)}]\qcirc\qbox[name={\(f\)}]
+        \qbb[2,3]
+    }
+    =
+    \q{
+        \qbox[name={\(h\)}]\qcirc\qbox[name={\(g\)}]\qcirc\qbox[name={\(f\)}]
+        \qbb[1,2]
+    }
+  \]
+\end{CODEBOX}
+\begin{CODEBOX}{Identity Law}{IdentityLaw}
+  \begin{equation}
+    \label{law:identity}
+    \forall\q
+    {
+      \qbox[name={\(f\)}]
+      \symbolS{\(x\)}
+      \symbolN{\(y\)}
+    }\colon
+    \q{
+      \qwire[label={\(y\)}]\n
+      \qbox[name={\(f\)}]
+    }=\q{
+      \qbox[name={\(f\)}]
+    }=\q{
+      \qbox[name={\(f\)}]\n
+      \qwire[label={\(x\)}]
+    }
+  \end{equation}
+\end{CODEBOX}
+\subsubsection{Object Information and Color}
+\label{subsubsec:objectcolor}
+In categorical string diagrammatics, identity morphism are typically represented as simple wires. 
+To make it visually evident which object an identity morphism corresponds to, a method has been introduced that assigns a \textbf{distinct color to each object}. 
+This allows object information to be encoded directly on the wire, providing intuitive visual cues for distinguishing between objects-especially in diagrams composed entirely of curved structures. 
+The theoretical foundation of this approach lies in the categorical fact that \textbf{every morphism has a uniquely defined domain and codomain object}. 
+Given that this structure is an intrinsic part of any category, it is entirely justified to represent objects diagrammatically via the visual attribute of ``color''. 
+In diagrams involving braidings (see Section \ref{subsubsec:braid:color}, page \pageref{subsubsec:braid:color}) or duality structures (see Section \ref{subsubsec:duality:color}, page \pageref{subsubsec:duality:color}), 
+color serves as an effective aid in supporting accurate interpretation.\par
+From this perspective, an object may be regarded as something that manifests as a color decorating a wire. 
+The following example illustrates how the domain and codomain colors of morphisms contribute to visually validating the composability of morphisms:
+\begin{CODEBOX}[bicolor,colbacklower=white]{}{objectcolor}
+  \(\operatorname{dom}\) is a function that identifies the domain color 
+  \(\q{\qwire[color=red]}\) 
+  of the morphism 
+  \(\q{\qbox[name={\(f\)}, dom color=red, cod color=cyan]}\), 
+  and \(\operatorname{cod}\) similarly identifies the codomain color 
+  \(\q{\qwire[color=cyan]}\).\par
+  On the page, the codomain color of 
+  \(\q{\qbox[name={\(f\)}, dom color=purple, cod color=teal]}\) 
+  and the domain color of 
+  \(\q{\qbox[name={\(g\)}, dom color=teal, cod color=orange]}\) 
+  are explicitly shown to be the same via color matching. 
+  Only when this condition holds is the vertical composition
+  \[
+    \q{
+      \qbox[name={\(g\)}, dom color=teal, cod color=orange]
+      \n
+      \qbox[name={\(f\)}, dom color=purple, cod color=teal]
+    }
+  \]
+  accepted as a type-consistent operation.
+\end{CODEBOX}
+\subsection{Monoidal Category}
+\begin{CODEBOX}{Tensor Product, Horizontal (Parallel) Compositon}{monoidalproduct}
+  \[
+    \q
+    {
+      \qbox[name={\(f\)}] \qbox[name={\(g\)}]
+      \symbolO{\(Y_1\)}[id=1] \symbolO{\(Y_2\)}
+      \symbolI{\(X_1\)}[id=1] \symbolI{\(X_2\)}
+    }
+    =\q
+    {
+      \qbox[name={\(f\otimes g\)}, p=2]
+      \symbolO{\(Y_1\)} \symbolO[2]{\(Y_2\)}
+      \symbolI{\(X_1\)} \symbolI[2]{\(X_2\)}
+    }
+    =\q
+    {
+      \qbox[name={\(f\otimes g\)}]
+      \symbolO{\(Y_1\otimes Y_2\)}
+      \symbolI{\(X_1\otimes X_2\)}
+    }
+  \]
+\end{CODEBOX}
+\subsubsection{Interchange Law}
+\begin{CODEBOX}{Interchange Law (Covariant Functoriality of \(\bigotimes\))}{InterchangeLaw}
+  \begin{equation}
+    \label{law:interchange}
+    \q
+    {
+      \qbox[name={\(f_2\)}]\qbox[name={\(g_2\)}]\n
+      \qbox[name={\(f_1\)}]\qbox[name={\(g_1\)}]
+      \qbb[1,2]
+      \qbb[3,4]
+    }
+    =\q
+    {
+      \qbox[name={\(f_2\)}]\qbox[name={\(g_2\)}]\n
+      \qbox[name={\(f_1\)}]\qbox[name={\(g_1\)}]
+      \qbb[2,4]
+      \qbb[1,3]
+    }
+  \end{equation}
+\end{CODEBOX}
+
+\begin{CODEBOX}{Unit Object}{Ex:74839744}
+  \begin{gather}
+    \q{ \qwire[arrowtype=dotted]}
+    =\q{ \qunitob \qbball }\\
+    \q{ \qunitob \qbox[name={\(f\)}] \qbball }
+    =\q{ \qbox[name={\(f\)}] }
+    =\q{ \qbox[name={\(f\)}] \qunitob \qbball }\label{cond:unitob}
+  \end{gather}
+\end{CODEBOX}
+\begin{CODEBOX}{}{Ex:74839743}
+  \[
+    \q{\qunitob\qbball}
+    =\q{\qloop[2]{\qunitob}\qbball}
+    =\q{\qloop[3]{\qunitob}\qbball}
+    =\cdots
+  \]
+\end{CODEBOX}
+
+\subsection{Special Boxes}
+
+\begin{itemize}
+  \item \showcmd{qstate}: \(\q[scale=0.5]{\qstate}\) (Zero Input).
+  \item \showcmd{qeffect}: \(\q[scale=0.5]{\qeffect}\) (Zero Output).
+  \item \showcmd{qscalar}: \(\q[scale=0.5]{\qscalar}\) (Zero Input, Zero Output).
+  \item \showcmd{qasym}: \(\q[scale=0.5]{\qasym}\) (Asymmetric Box). 
+  \item \showcmd{qtrans}: \(\q[scale=0.5]{\qtrans}\) (Transpose Box). Section \ref{subsubsec:transpose} on page \pageref{subsubsec:transpose}.
+  \item \showcmd{qadj}: \(\q[scale=0.5]{\qadj}\) (Adjoint Box). Section \ref{subsubsec:adjoint} on page \pageref{subsubsec:adjoint}.
+  \item \showcmd{qconj}: \(\q[scale=0.5]{\qconj}\) (Conjugate Box). Section \ref{subsubsec:conj} on page \pageref{subsubsec:conj}.
+\end{itemize}
+\subsubsection{Zero Input}
+\label{subsubsec:zeroinput}
+\begin{codebox}{}{def:state}
+  \q{\qstate}
+\end{codebox}
+\subsubsection{Zero Output}
+\label{subsubsec:zerooutput}
+\begin{codebox}{}{def:effect}
+  \q{\qeffect}
+\end{codebox}
+\subsubsection{Zero Input, Zero Output}
+\label{subsubsec:zeroinputoutput}
+\begin{codebox}{}{def:scalar}
+  \q{\qscalar}
+\end{codebox}
+\paragraph{\(\q[scale=0.4]{\qeffect\qstate\qwire[dom={O-1-2}, cod={1,2}]\qwire[dom={1,-1}, cod={I-1-1}]}=\q[scale=0.4]{\qwire[vlen=0.5]\n\qstate\n\qeffect\n[0.5]\qwire[vlen=0.5]}=\q[scale=0.4]{\qstate\qeffect\qwire[dom={O-1-1}, cod={1,2}]\qwire[dom={1,-1}, cod={I-1-2}]}\)}
+\begin{CODEBOX}{}{coherence:unitor}
+  \[
+    \q{
+      \qeffect\qstate
+      \qwire[dom={O-1-2}, cod={1,2}]
+      \qwire[dom={1,-1}, cod={I-1-1}]
+    }=\q{
+      \qwire[arrowtype=dotted]\qwire\n
+      \qeffect\qstate\n
+      \qwire\qwire[arrowtype=dotted]
+    }\stackrel{\text{(\ref{law:interchange}, \ref{law:identity})}}{=}\q{
+      \qwire[arrowtype=dotted]\qstate\n
+      \qeffect\qwire[arrowtype=dotted]
+    }\stackrel{\text{(\ref{law:interchange}, \ref{cond:unitob})}}{=}\q{\qstate\n\qeffect}
+  \]
+\end{CODEBOX}
+\begin{CODEBOX}{Matrix Representation}{matrixrepre}
+  \begin{align*}
+    \q{\qbox[name={\(f\)}]}
+    &=\sum\limits_{i,j}
+    \left(
+      \q{
+        \qeffect[name={\(w_j^{\dagger}\)}]\n
+        \qbox[name={\(f\)}]\n
+        \qstate[name={\(v_i\)}]\n
+      }\q{
+        \qstate[name={\(w_j\)}]\n
+        \qeffect[name={\(v_i^{\dagger}\)}]
+      }
+    \right)
+    =\sum\limits_{i,j}\left(
+      \q{
+        \qscalar[name={\(w_j^{\dagger}\circ f\circ v_i\)}]
+      }
+      \q{
+        \qstate[name={\(w_j\)}]\n
+        \qeffect[name={\(v_i^{\dagger}\)}]
+      }
+    \right)\\
+    &=\begin{pmatrix}
+      \q{\qscalar[name={\(w_1^{\dagger}\circ f\circ v_1\)}]}&&\cdots&&\q{\qscalar[name={\(w_1^{\dagger}\circ f\circ v_{m}\)}]}\\
+      &\ddots&&&\\        
+      \vdots& &\q{\qscalar[name={\(w_j^{\dagger}\circ f\circ v_i\)}]}& &\vdots\\
+      &&&\ddots&\\
+      \q{\qscalar[name={\(w_n^{\dagger}\circ f\circ v_1\)}]}&&\cdots&&\q{\qscalar[name={\(w_n^{\dagger}\circ f\circ v_m\)}]}
+    \end{pmatrix}
+  \end{align*}
+\end{CODEBOX}
+
+\subsection{Monoid Object}
+\label{subsec:monoid}
+\begin{itemize}
+  \item \showcmd{qmul}: \(\q[scale=0.5]{\qmul}\)
+    \iitem \showcmd[]{hlen=2}: \(\q[scale=0.5]{\qmul[hlen=2]}\)
+  \item \showcmd{qcomul}: \(\q[scale=0.5]{\qcomul}\)
+    \iitem \showcmd[]{hlen=2}: \(\q[scale=0.5]{\qcomul[hlen=2]}\)
+  \item \showcmd{qunit}: \(\q[scale=0.5]{\qunit}\)
+  \item \showcmd{qcounit}: \(\q[scale=0.5]{\qcounit}\)
+  \item \showcmd{qspider}: \(\q[scale=0.5]{\qspider}\)
+\end{itemize}
+
+\begin{CODEBOX}{Associativity}{AssociateLaw}
+  \begin{equation}
+    \label{law:associate}
+    \q{
+      \qspace[0.5]\qmul[hlen=2]\n
+      \qmul[hlen=2]\qspace[-0.5]\qwire
+    }=\q{
+      \qmul[hlen=2]\n
+      \qwire\qspace[-0.5]\qmul[hlen=2]
+    }
+  \end{equation}
+\end{CODEBOX}
+\begin{CODEBOX}{Unitality}{UnitLaw}
+  \begin{equation}
+  \label{law:unit}
+  \q{
+    \qmul[hlen=2]\n
+    \qwire\qunit
+  }=\q{\qwire[vlen=2]}
+  =\q{
+    \qmul[hlen=2]\n
+    \qunit\qwire
+  }
+  \end{equation}
+\end{CODEBOX}
+\begin{CODEBOX}{Coassociativity}{CoassociateLaw}
+  \begin{equation}
+  \label{law:coassociate}
+  \q{
+    \qcomul[hlen=2]\qspace[-0.5]\qwire\n
+    \qspace[0.5]\qcomul[hlen=2]
+  }
+  =\q{
+    \qwire\qspace[-0.5]\qcomul[hlen=2]\n
+    \qcomul[hlen=2]
+  }
+  \end{equation}
+\end{CODEBOX}
+\begin{CODEBOX}{Counitality}{CounitLaw}
+  \begin{equation}
+  \label{law:counit}
+  \q{
+      \qcounit\qwire\n
+      \qcomul[hlen=2]
+      }
+  =\q{\qwire[vlen=2]}
+  =\q{
+      \qwire\qcounit\n
+      \qcomul[hlen=2]
+  }
+  \end{equation}
+\end{CODEBOX}
+
+\subsubsection{Frobenius Law}
+\begin{FCODEBOX}{Frobenius Law}{FrobeniusLaw}
+  \[
+    \q{
+      \qwire\qmul[color=black]\n
+      \qcomul\qwire
+    }=\q{
+      \qcomul\n
+      \qmul[color=black]
+    }=\q{
+      \qmul[color=black]\qwire\n
+      \qwire\qcomul
+    }
+  \]
+\end{FCODEBOX}
+Although it is mentioned as a ``Failure Example'', in reality, the Frobenius law is accurately described. 
+Rather, since the spacing between all the wires is maintained as integer values, adjustment during vertical composition becomes easier, and in some cases, no adjustment may be necessary. 
+This is merely a matter of preference. 
+The default drawing results of \verb|\qmul| and \verb|\qcomul|, which are \q[scale=0.5]{\qmul} and \q[scale=0.5]{\qcomul}, are remnants of the default drawing results of \verb|\qbox[s=2]| and \verb|\qbox[n=2]|, which are \q[scale=0.5]{\qbox[s=2]} and \q[scale=0.5]{\qbox[n=2]}. 
+For adjustments in such cases, the adjustment key \verb|hlen| is available:
+\begin{CODEBOX}{Frobenius Law}{FrobeniusLaw2}
+  \[
+    \q{
+      \qwire\qmul[hlen=2,color=black]\n
+      \qcomul[hlen=2]\qwire
+    }=\q{
+      \qcomul[hlen=2]\n
+      \qmul[hlen=2,color=black]
+    }=\q{
+      \qmul[hlen=2,color=black]\qwire\n
+      \qwire\qcomul[hlen=2]
+    }
+  \]
+\end{CODEBOX}
+The command \verb|\qspider| is the same as \verb|\qbox|, except that the nodes are circles rather than boxes.
+\begin{codebox}{}{spider781297389240521}
+  \[\q{\qspider}\]
+  \[\q{\qspider[n=0]}\]
+  \[\q{\qspider[n=0,s=4]}\]
+  \[\q{\qspider[n=2,s=4]}\]
+  \[\q{\qspider[N={1,4},s=4]}\]
+  \[\q{\qspider[N={2,3},s=4]}\]
+  \[\q{\qspider[p=3,N={2},S={1,3}]}\]
+  \[\q{\qspider[p=3,N={2},S={1,3},hlen=2]}\]
+  \[\q{\qspider[n=1,s=2,hlen=2]}\]
+\end{codebox}
+
+\begin{CODEBOX}{}{spider781297389270738}
+  \[
+    \q{
+      \qspider[n=2, s=4, hlen=4]\qwire\qwire\n
+      \qwire\qwire\qspider[n=4, s=2, hlen=4]
+    }=\q{\qspider[p=4]}\]
+\end{CODEBOX}
+
+\subsection{Braiding}
+\label{subsec:braidedcategory}
+\begin{itemize}
+  \item \showcmd{qbraid}: \(\q[scale=0.5]{\qbraid}\)
+  \item \showcmd{qbraidinv}: \(\q[scale=0.5]{\qbraidinv}\)
+  \item \showcmd{qsym}: \(\q[scale=0.5]{\qsym}\)
+\end{itemize}
+
+\paragraph{\showcmd[]{num L} and \showcmd[]{num R}}
+
+For the commands \verb|\qbraid|, \verb|\qbraidinv|, and \verb|\qsym|, \showcmd[]{num L} specifies the number of wires on the left side, and \showcmd[]{num R} specifies the number of wires on the right side. 
+For example, specifies \showcmd[]{num L=3} and \showcmd[]{num R=2} will result in the diagram \q{\qbraid[num L=3, num R=2]}. 
+The default value for both is \(1\).
+
+\begin{CODEBOX}{Hexagon Equations}{hexagon}
+  \begin{equation}
+  \label{eq:hexagon}
+  \q
+  {
+    \qbraid[num R=2,,hlen=2,vlen=2]
+  }=\q
+  {
+    \qwire\qbraid\n
+    \qbraid\qwire
+  }
+  \qquad
+  \q
+  {
+    \qbraid[num L=2,,hlen=2,vlen=2]
+  }
+  =\q
+  {
+    \qbraid\qwire\n
+    \qwire\qbraid
+  }
+  \end{equation}
+\end{CODEBOX}
+\paragraph{\({\q[scale=0.5]{\qbraid}}^{-1}=\q[scale=0.5]{\qbraidinv}\)}
+\begin{CODEBOX}{}{braidisom2}
+  \begin{equation}
+  \label{eq:inverse:braid}
+  \q
+  {
+    \qbraidinv\n
+    \qbraid
+  }
+  =\q
+  {
+    \qwire[vlen=2]\qwire[vlen=2]
+  }
+  \qquad
+  \q
+  {
+    \qbraid\n
+    \qbraidinv
+  }
+  =\q
+  {
+    \qwire[vlen=2]\qwire[vlen=2]
+  }
+  \end{equation}
+\end{CODEBOX}
+\begin{CODEBOX}{Naturality of the Braid (Being a Natural Transformation)}{braidnatural}
+  \begin{equation}
+  \label{cond:naturality:braid}
+  \q
+  {
+    \qbraid\n
+    \qbox[name={\(f\)}]\qbox[name={\(g\)}]
+  }
+  =\q
+  {
+    \qbox[name={\(g\)}]\qbox[name={\(f\)}]\n
+    \qbraid
+  }
+  \qquad
+  \q
+  {
+    \qbraidinv\n
+    \qbox[name={\(f\)}]\qbox[name={\(g\)}]
+  }
+  =\q
+  {
+    \qbox[name={\(g\)}]\qbox[name={\(f\)}]\n
+    \qbraidinv
+  }
+  \end{equation}
+\end{CODEBOX}
+
+For the commands \verb|\qbraid|, \verb|\qbraidinv|, and \verb|\qasym|, specifying \showcmd[]{num R=0} results in a dashed line for the right wire, as shown in \q[scale=0.65]{\qbraid[num R=0]}. 
+Similarly, specifying \showcmd[]{num L=0} results in a dashed line for the left wire, as shown in \q[scale=0.65]{\qbraid[num L=0]}. 
+This is due to representing the unit object as an empty diagrams, i.e., a diagram with \(0\) wires.
+\begin{CODEBOX}{}{stateeffect3dimbraid}
+  \begin{gather}
+  \q{
+    \qwire\qstate\n
+    \qwire
+  }
+  =\q{
+    \qwire\qstate\n
+    \qbraid[num L=0]
+  }\stackrel{\text{(\ref{cond:naturality:braid})}}{=}\q{
+    \qbraid\n
+    \qstate\qwire
+  }\label{iso:u:state}\\
+  \q{
+    \qunitob\qwire\n
+    \qeffect\qwire
+  }
+  =\q{
+    \qbraid[num L=0]\n
+    \qeffect\qwire
+  }\stackrel{\text{(\ref{cond:naturality:braid})}}{=}\q{
+    \qwire\qeffect\n
+    \qbraid
+  }\label{iso:u:effect}
+  \end{gather}
+\end{CODEBOX}
+\begin{CODEBOX}{}{iso:spatial:scalar}
+  \begin{equation}
+  \label{iso:spatial}
+  \q{\qscalar\qmv[0,-1]\qwire[vlen=3]}
+  =\q{\qbraid[num L=0]\n\qscalar\qmv[0,-1]\qwire[vlen=2]}
+  \stackrel{\text{(\ref{cond:naturality:braid})}}{=}
+  \q{\qwire[vlen=2]\qscalar\n\qbraid[num L=0]}
+  =\q{\qscalar\qmv[-2,-1]\qwire[vlen=3]}
+  \end{equation}
+\end{CODEBOX}
+\begin{CODEBOX}{}{iso:spatial:state.effect}
+  \[
+    \q{\qscalar\qmv[0,-1]\qwire[vlen=3]}
+    =\q{\qeffect\n\qstate\qmv[0,-0.5]\qwire[vlen=3]}
+    \stackrel{\text{(\ref{iso:u:effect})}}{=}
+    \q{\qwire\qeffect\n\qbraid\n\qstate\qwire}
+    \stackrel{\text{(\ref{iso:u:state})}}{=}
+    \q{\qeffect\n\qstate\qmv[-2,-0.5]\qwire[vlen=3]}
+    =\q{\qscalar\qmv[-2,-1]\qwire[vlen=3]}
+  \]
+\end{CODEBOX}
+\paragraph{\(\q[scale=0.5]{\qbraid\qwire\n\qwire\qstate[n=2]}=\q[scale=0.5]{\qwire\qbraidinv\n\qstate[n=2]\qwire}\)}
+\begin{CODEBOX}{}{dashedbraid}
+  \begin{align}
+  \q
+  {
+    \qbraid\qwire\n
+    \qwire\qstate[n=2]
+  }&=\q
+  {
+    \qbraid\qwire\n
+    \qwire\qstate[n=2]\n\n
+    \qbraidinv[num L=0,vlen=2,hlen=2.5]
+  }
+  \stackrel{\text{(\ref{cond:naturality:braid})}}{=}\q
+  {
+    \qbraid\qwire\n\n
+    \qbraidinv[num L=2,vlen=2]\n
+    \qstate[n=2]\qwire\n
+    \qspace[0.5]\qwire[arrowtype={densely dotted}]\qspace[0.5]\qwire
+  }\\
+  &=\q
+  {
+    \qbraid\qwire\n\n
+    \qbraidinv[num L=2,vlen=2]\n
+    \qstate[n=2]\qwire\n
+    \qspace[2]\qwire
+    \qbb[green][3]
+  }\stackrel{\text{(\ref{eq:hexagon})}}{=}\q
+  {
+    \qbraid\qwire\n
+    \qbraidinv\qwire\n
+    \qwire\qbraidinv\n
+    \qstate[n=2]\qwire\n
+    \qspace[2]\qwire
+    \qbb[green][3,...,6]
+  }\\
+  &=\q
+  {
+    \qbraid\qwire\n
+    \qbraidinv\qwire\n
+    \qwire\qbraidinv\n
+    \qstate[n=2]\qwire\n
+    \qspace[2]\qwire
+    \qbb[orange][1,3]
+  }
+  \stackrel{\text{(\ref{eq:inverse:braid})}}{=}\q
+  {
+    \qloop[2]{\qloop[3]{\qwire}\n}
+    \qwire\qbraidinv\n
+    \qstate[n=2]\qwire\n
+    \qspace[2]\qwire
+    \qbb[orange][1,2,4,5]
+  }
+  \end{align}
+\end{CODEBOX}
+
+\begin{CODEBOX}{Yang-Baxer Equation}{YangBaxer}
+  \[
+    \q{
+      \qbraid\qwire\n
+      \qwire\qbraid\n
+      \qbraid\qwire
+    }=\q{
+      \qwire\qbraid\n
+      \qbraid\qwire\n
+      \qwire\qbraid
+    }
+  \]
+\end{CODEBOX}
+
+\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{Commutativity}{def:cmt}
+  \begin{equation}
+  \label{cond:cmt}
+  \q{\qmul[hlen=2]}=\q{\qmul[hlen=2]\n\qbraid}
+  \end{equation}
+\end{codebox}
+\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{Cocommutativity}{def:ccmt}
+  \begin{equation}
+  \label{cond:ccmt}
+  \q{\qcomul[hlen=2]}=\q{\qbraid\n\qcomul[hlen=2]}
+  \end{equation}
+\end{codebox}
+\subsubsection{Bialgebra}
+\begin{CODEBOX}{Bialgebra Law}{law:bialgebra}
+  \begin{gather}
+  \q{\qcomul[hlen=2]\qcirc\qmul[hlen=2, color=black]}
+  =\q{
+  \qmul[hlen=2, color=black]\qmul[hlen=2, color=black]\n
+  \qwire\qbraid\qwire\n\qcomul[hlen=2]\qcomul[hlen=2]
+  }\\
+  \q{\qspace[0.5]\qcounit\qcirc\qmul[hlen=2, color=black]}
+  =\q{\qcounit\qcounit}\\
+  \q{\qcomul[hlen=2]\qcirc\qspace[0.5]\qunit[color=black]}
+  =\q{\qunit[color=black]\qunit[color=black]}\\
+  \q{\qcounit\n\qunit[color=black]}
+  =\q{\qunitob}
+  \end{gather}
+\end{CODEBOX}
+\subsubsection{Hopf Algebra}
+\begin{CODEBOX}{Antipode and Hopf Algebra}{law:hopf}
+  \begin{equation}
+  \q{
+    \qmul[hlen=2, color=black]\n
+    \qwire\qbox[name={\(s\)}]\n
+    \qcomul[hlen=2]
+  }
+  =\q{\qunit[color=black]\qcirc\qcounit}
+  =\q{
+    \qmul[hlen=2, color=black]\n
+    \qbox[name={\(s\)}]\qwire\n
+    \qcomul[hlen=2]
+  }
+  \end{equation}
+\end{CODEBOX}
+\subsubsection{Balanced Structure}
+\label{subsubsec:balancedcategory}
+\begin{CODEBOX}{Twist}{def:twist}
+  \begin{gather}
+  \q{
+    \qbox[name={\(\theta_{X\otimes Y}\)}, p=2]
+    \symbolI{\(X\)}\symbolI[2]{\(Y\)}
+    \symbolO{\(X\)}\symbolO[2]{\(Y\)}
+  }
+  =\q{
+    \qbox[name={\(\theta_X\)}]\qbox[name={\(\theta_Y\)}]\n
+    \qbraid\n\qbraid
+  }\label{cond:twist}\\
+  \q{\qbox[name={\(\theta_I\)}]}=\q{\qunitob}\label{cond:i:twist}\\
+  \forall\q{\qbox[name={\(f\)}]}\colon
+  \q{
+    \qbox[name={\(\theta_{\operatorname{cod}(f)}\)}, hlen=1.5]\n
+    \qbox[name={\(f\)}, hlen=1.5]
+  }=\q{
+    \qbox[name={\(f\)}, hlen=1.5]\n
+    \qbox[name={\(\theta_{\operatorname{dom}(f)}\)}, hlen=1.5]
+  }\label{cond:naturality:twist}
+  \end{gather}
+\end{CODEBOX}
+\subsubsection{Color}
+\label{subsubsec:braid:color}
+\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{Symmetry}{defeq:sym}
+  \begin{equation}
+    \label{cond:symmetry}
+    \q
+    {
+      \qbraid[L color=cyan, R color=red]\n
+      \qbraid[L color=red, R color=cyan]
+    }
+    =\q{\qwire[color=red, vlen=2]\qwire[color=cyan, vlen=2]}
+  \end{equation}
+\end{codebox}
+
+\begin{CODEBOX}{}{wowsym}
+  \[\q{\qbraid[L color=red, R color=cyan]}
+  =\left(\q{\qbraid[L color=cyan, R color=red]}\right)^{-1}
+  =\q{\qbraidinv[L color=red, R color=cyan]}\]
+\end{CODEBOX}
+\begin{codebox}{Symmetry}{def:sym}
+  \q{\qsym}
+\end{codebox}
+
+\subsection{Duality}
+\label{subsubsec:duality}
+\begin{itemize}
+  \item \showcmd{qcap}: \(\q[scale=0.6]{\qcap}\)
+  \item \showcmd{qcup}: \(\q[scale=0.6]{\qcup}\)
+  \item \showcmd{qcaprev}: \(\q[scale=0.6]{\qcaprev}\)
+  \item \showcmd{qcuprev}: \(\q[scale=0.6]{\qcuprev}\)
+\end{itemize}
+
+\begin{CODEBOX}{Snake Equations}{Snake}
+  \begin{equation}
+  \label{eq:snake}
+  \q{
+    \qcap\qwireup\n
+    \qwireup\qcup
+  }
+  =\q{
+    \qwireup[vlen=2]
+  }
+  \qquad\land\qquad
+  \q{
+    \qwiredown\qcap\n
+    \qcup\qwiredown
+  }
+  =\q{
+    \qwiredown[vlen=2]
+  }
+  \end{equation}        
+\end{CODEBOX}
+
+\subsubsection{Transpose Box}
+\label{subsubsec:transpose}
+\begin{CODEBOX}{Transpose}{Transpose}
+  \[
+    \left(\q{\qwire\n\qasym[name={\(f\)}]\n\qwire}\right)^T
+    =\q{
+      \qwire\n
+      \qtrans[name={\(f\)}]\n
+      \qwire
+    }\coloneq\q{
+      \qwire\qcap\n
+      \qwire\qasym[name={\(f\)}]\qwire\n
+      \qcup\qwire
+    }
+  \]
+\end{CODEBOX}
+
+\begin{CODEBOX}{}{ex:193477432894021826}
+  \begin{equation}
+  \label{eq:wirerev}
+  \left(\q{\qwireup}\right)^T=\q{\qwiredown}
+  \end{equation}
+\end{CODEBOX}
+
+\begin{CODEBOX}{Sliding}{Sliding}
+  \begin{equation}
+  \label{eq:sliding}
+  \q{
+    \qcap \n
+    \qasym \qwire
+  }
+  =\q
+  {
+    \qcap \n
+    \qwire \qtrans
+  }\qquad
+  \q
+  {
+    \qwire\qasym \n
+    \qcup
+  }
+  =\q
+  {
+    \qtrans \qwire \n
+    \qcup
+  }
+  \end{equation}
+\end{CODEBOX}
+
+\begin{CODEBOX}{}{MapStateDuality}
+  \begin{equation}
+    \begin{array}{rccc}
+      \operatorname{NAME}\colon & \operatorname{Hom}(X,Y)
+      & \to & \operatorname{Hom}(I,X^T\otimes Y)\\
+      & \rotatebox{90}{\(\in\)} && \rotatebox{90}{\(\in\)}\\
+      & \q{
+        \qasym
+        \symbolI{\(X\)}
+        \symbolO{\(Y\)}
+      } & \mapsto 
+      & \q{
+        \qwire[label={\(X^T\)}, label at={at end}, label side={above}] \qasym \n
+        \qcup
+        \symbolO{\(Y\)}[id=2]
+      }
+    \end{array}
+  \end{equation}
+\end{CODEBOX}
+
+\begin{CODEBOX}{}{MapEffectDuality}
+  \begin{equation}
+    \begin{array}{rccc}
+      \operatorname{CONAME}\colon & \operatorname{Hom}(X,Y) 
+      & \to & \operatorname{Hom}(X\otimes Y^T,I)\\
+      & \rotatebox{90}{\(\in\)}&&\rotatebox{90}{\(\in\)}\\
+      & \q{
+        \qasym
+        \symbolI{\(X\)}
+        \symbolO{\(Y\)}
+      } & \mapsto 
+      & \q{
+        \qcap \n
+        \qasym \qwire[label={\(Y^T\)}, label at={at start}, label side={below}]
+        \symbolI{\(X\)}[id=2]
+      }
+    \end{array}
+  \end{equation}
+\end{CODEBOX}
+
+\subsubsection{No Cloning Theorem}
+\label{subsubsec:nocopy}
+\begin{CODEBOX}{Uniform Copying}{def:copy}
+  \begin{gather}
+    \q{
+      \qwire\qbraid\qwire\n
+      \qcomul[hlen=2, name={\(\operatorname{copy}_X\)}]\qcomul[hlen=2, name={\(\operatorname{copy}_Y\)}]
+      \symbolI{\(X\)}[id=4]\symbolI{\(Y\)}[id=5]
+      \symbolO{\(X\)}[id=1]\symbolO{\(Y\)}[id=2]
+      \symbolO[2]{\(X\)}[id=2]\symbolO{\(Y\)}[id=3]
+    }=\q{
+      \qcomul[hlen=3, vlen=2, name={\(\operatorname{copy}_{X\otimes Y}\)}]\symbolI{\(X\otimes Y\)}
+      \symbolO{\(X\otimes Y\)}\symbolO[2]{\(X\otimes Y\)}
+    }\label{cond:copy}\\
+    \forall\q{\qbox[name={\(f\)}]\symbolI{\(X\)}\symbolO{\(Y\)}}\colon
+    \q{
+      \qbox[name={\(f\)}]\qbox[name={\(f\)}]\n
+      \qcomul[hlen=2, name={\(\operatorname{copy}_X\)}]
+    }=\q{
+      \qcomul[hlen=2, name={\(\operatorname{copy}_Y\)}]\n
+      \qspace[0.5]\qbox[name={\(f\)}]
+    }\label{cond:morcopy}\\
+    \q{
+      \qcomul[hlen=2, name={\(\operatorname{copy}_I\)}]\symbolI{\(I\)}
+      \symbolO{\(I\)}\symbolO[2]{\(I\)}
+    }=\q{\qunitob}\label{cond:i:copy}
+  \end{gather}
+\end{CODEBOX}
+
+\begin{CODEBOX}{Copyable State}{def:copyablestate}
+  \[
+    \q{
+      \qcomul[hlen=2, name={\(\operatorname{copy}\)}]\n
+      \qspace[0.5]\qstate[name={\(a\)}]
+    }=\q{
+      \qstate[name={\(a\)}]\qstate[name={\(a\)}]
+    }
+  \]
+\end{CODEBOX}
+\begin{CODEBOX}{}{len:copycupcup}
+  \begin{align*}
+    \q{\qcup\qcup}&\stackrel{\text{(\ref{cond:i:copy})}}{=}
+    \q{
+      \qcup\qcup\n\qmv[0.5,0.4]
+      \qcomul[
+        dom arrowtype=dotted, 
+        cod arrowtype=dotted, 
+        hlen=3, 
+        name={\(\operatorname{copy}\)}
+      ]
+    }\stackrel{\text{(\ref{cond:morcopy})}}{=}
+    \q{
+      \qspider[
+        name={\(\operatorname{copy}\)}, 
+        N={1,2,4,5}, 
+        s=2, 
+        hlen=2
+      ]\n\qcup
+    }\\
+    &\stackrel{\text{(\ref{cond:copy})}}{=}\q[scale=0.6]{
+      \qwire\qbraid\qwire\n
+      \qloop[4]{\qwire}\n
+      \qcomul[hlen=2, name={\(\operatorname{copy}\)}]\qcomul[hlen=2]\n
+      \qspace[0.5]\qcup[hlen=3]
+      \qbb[red][4,8]
+    }\stackrel{\text{(\ref{cond:ccmt})}}{=}\q[scale=0.6]{
+      \qwire\qbraid\qwire\n
+      \qbraidinv\qwire\qwire\n
+      \qcomul[hlen=2]\qcomul[hlen=2]\n
+      \qspace[0.5]\qcup[hlen=3]
+      \qbb[red][4,7]
+    }\\
+    &=\q[scale=0.6]{
+      \qwire\qbraid\qwire\n
+      \qbraidinv\qwire\qwire\n[2]
+      \qloop[4]{\qwire[vlen=2]}\n
+      \qloop[2]{\qcomul[hlen=2, name={\(\operatorname{copy}\)}]}\n
+      \qspace[0.5]\qcup[hlen=3]
+      \qbb[blue][8,9]
+    }
+    \stackrel{\text{(\ref{eq:inverse:braid})}}{=}
+    \q[scale=0.6]{
+      \qwire\qbraid\qwire\n
+      \qbraidinv\qwire\qwire\n
+      \qwire\qbraidinv\qwire\n
+      \qwire\qbraid\qwire\n
+      \qloop[2]{\qcomul[hlen=2, name={\(\operatorname{copy}\)}]}\n
+      \qspace[0.5]\qcup[hlen=3]
+      \qbb[blue][8,11]
+    }\\
+    &=\q[xscale=0.6, yscale=0.5]{
+      \qwire\qbraid\qwire\n
+      \qbraidinv\qwire\qwire\n
+      \qwire\qbraidinv\qwire\n
+      \qwire\qbraid\qwire\n
+      \qloop[2]{\qcomul[hlen=2, name={\(\operatorname{copy}\)}]}\n
+      \qspace[0.5]\qcup[hlen=3]
+      \qbb[yellow][10,14,15]
+    }\stackrel{\text{(\ref{cond:copy}, \ref{cond:morcopy}, \ref{cond:i:copy})}}{=}
+    \q[scale=0.6]{
+      \qwire\qbraid\qwire\n
+      \qbraidinv\qwire\qwire\n
+      \qwire\qbraidinv\qwire\n
+      \qcup\qcup
+      \qbb[yellow][10,11]
+    }\\
+    &=\q{
+      \qwire\qbraid\qwire\n
+      \qcup[n=4]
+    }
+  \end{align*}
+\end{CODEBOX}
+\begin{CODEBOX}{}{len:copybraid}
+  \begin{align*}
+    \q{
+      \qbraid
+      \symbolI{\(X\)}\symbolO{\(X\)}
+      \symbolI[2]{\(X\)}\symbolO[2]{\(X\)}
+    }&\stackrel{\text{(\ref{eq:snake})}}{=}\q[scale=0.5]{
+      \qwire\qspace[2]\qcap\qwire\n
+      \qbraid[hlen=4]\qwire\qwire\n
+      \qwire\qcap\qwire\qcup\n
+      \qwire\qwire\qcup
+      \qbb[blue][1,5]
+    }=\q[scale=0.5]{
+      \qcap[hlen=4]\qwire\n
+      \qwire\qspace[2]\qbraidinv\n
+      \qwire\qcap\qwire\qwire\qwire[vlen=3]\n
+      \qwire\qwire\qcup\qcup
+      \qbb[blue][1,4]
+      \qbb[yellow][12,13]
+    }\\
+    &\stackrel{\text{Example \ref{len:copycupcup}}}{=}\q[scale=0.5]{
+      \qcap[hlen=4]\qwire\n
+      \qwire\qspace[2]\qbraidinv\n
+      \qwire\qcap\qwire\qwire\qwire[vlen=3]\n
+      \qwire\qwire\qwire\qbraid\qwire\n
+      \qwire\qwire\qcup[n=4]
+      \qbb[yellow][12,14,17]
+    }=\q[scale=0.5]{
+      \qcap[s=4]\qwire\n
+      \qloop[3]{\qwire}\qbraidinv\n
+      \qloop[3]{\qwire}\qbraid\qwire[vlen=3]\n
+      \qwire\qwire\qcup[n=4]
+      \qbb[green][6,10]
+    }\\
+    &\stackrel{\text{(\ref{eq:inverse:braid})}}{=}\q[scale=0.5]{
+      \qcap[s=4]\qwire\qwire\n[2]
+      \qloop[6]{\qwire[vlen=2]}\n
+      \qwire\qwire\qcup[n=4]
+      \qbb[green][7,8]
+    }\stackrel{\text{(\ref{eq:snake})}}{=}\q{
+      \qwire\qwire
+      \symbolI{\(X\)}[id=1]\symbolO{\(X\)}[id=1]
+      \symbolI{\(X\)}\symbolO{\(X\)}
+    }
+  \end{align*}
+\end{CODEBOX}
+
+\begin{CODEBOX}{No Cloning Theorem}{thm:nocopy}
+  \begin{align*}
+    \q{
+      \qasym[name={\(f\)}]
+      \symbolI{\(X\)}\symbolO{\(X\)}
+    }&\stackrel{\text{(\ref{eq:snake})}}{=}
+    \q{
+      \qcap\qasym[name={\(f\)}]\n
+      \qwire\qcup
+    }\stackrel{\text{(\ref{eq:inverse:braid})}}{=}\q{
+      \qcap\qasym[name={\(f\)}]\n
+      \qwire\qbraidinv\n
+      \qwire\qbraid\n
+      \qwire\qcup
+    }\\
+    &\stackrel{\text{(\ref{cond:naturality:braid})}}{=}\q{
+      \qcap\qwire\n
+      \qwire\qbraidinv\n
+      \qwire\qasym[name={\(f\)}]\qwire\n
+      \qwire\qbraid\n
+      \qwire\qcup
+      \qbb[red][1,4]
+    }=\q{
+      \qwire\qcap\n
+      \qbraid\qwire\n
+      \qwire\qasym[name={\(f\)}]\qwire\n
+      \qwire\qbraid\n
+      \qwire\qcup
+      \qbb[red][1,4]
+    }\\
+    &=\q{
+      \qwire\qcap\n
+      \qbraid\qwire\n
+      \qwire\qasym[name={\(f\)}]\qwire\n
+      \qwire\qbraid\n
+      \qwire\qcup
+      \qbb[blue][3]
+    }\stackrel{\text{Example \ref{len:copybraid}}}{=}\q{
+      \qwire\qcap\n
+      \qwire\qwire\qwire\n
+      \qwire\qasym[name={\(f\)}]\qwire\n
+      \qwire\qbraid\n
+      \qwire\qcup
+      \qbb[blue][3,4]
+    }
+  \end{align*}
+\end{CODEBOX}
+\subsection{Pivotal Category}
+\label{subsec:pivotal}
+\begin{CODEBOX}{}{struct:Pivotal}
+  \begin{equation}
+    \label{cond:naturality:pivotal}
+    \forall\q{\qasym[name={\(f\)}]\symbolI{\(X\)}\symbolO{\(Y\)}}\colon
+    \q[scale=0.5]{
+      \qwire\qcap[s=4]\n
+      \qwire\qwire\qasym[name={\(f\)}]\qwire\qwire\n
+      \qcup[n=4]\qwire\qmv[-1,-1]\qasym[name={\(\pi_X\)}]
+    }=\q{
+        \qasym[name={\(\pi_Y\)}]\n
+        \qasym[name={\(f\)}]
+    }
+  \end{equation}
+\end{CODEBOX}
+\begin{CODEBOX}{}{dualrev}
+  \begin{equation}
+    \label{def:dualrev}
+    \q{
+      \qcaprev\n
+      \symbolI{\(X^T\)}\symbolI[2]{\(X\)}
+    }\coloneq\q
+    {
+      \qcap \n
+      \qwire \qwireupup \n
+      \qwire \qasym[name={\(\pi_x\)}] \n
+    }\qquad\q{
+      \qcuprev
+      \symbolO{\(X\)}\symbolO[2]{\(X^T\)}
+    }\coloneq\q
+    {
+      \qasym[name={\(\pi_X^{-1}\)}]\qwire\n
+      \qwireupup\qwire\n
+      \qcup
+    }
+  \end{equation}
+\end{CODEBOX}
+\begin{CODEBOX}{}{revSliding}
+  \begin{equation}
+    \label{eq:sliding:rev}
+    \q{
+      \qcaprev\n
+      \qtrans\qwire\n
+    }=\q{
+      \qcaprev\n
+      \qwire\qasym
+    }\qquad\q{
+      \qwire\qtrans\n
+      \qcuprev
+    }=\q{
+      \qasym\qwire\n
+      \qcuprev
+    }
+  \end{equation}
+\end{CODEBOX}
+\begin{CODEBOX}{}{corr:pivotal:twist}
+  \begin{gather}
+    \q{
+      \qwireuu[label={\(X^{**}\)}]\n
+      \qasym[name={\(\pi_X\)}]\n
+      \qwireup[label={\(X\)}]
+    }=\q{
+      \qwireuu[label={\(X^{**}\)}]\qcap\n
+      \qbraid\qwired[label={\(X^T\)}]\n
+      \qasym[name={\(\theta_X^{-1}\)}]\qcuprev\n
+      \qwireup[label={\(X\)}]
+    }\label{twist:pivotal}\\
+    \q{
+      \qwireup[label={\(X\)}]\n
+      \qasym[name={\(\theta_X\)}]\n
+      \qwireup[label={\(X\)}]
+    }=\q{
+      \qwireup[label={\(X\)}]\n
+      \qasym[name={\(\pi_X^{-1}\)}]\n
+      \qwireuu[label={\(X^{**}\)}]\qcap\n
+      \qbraid\qwired[label={\(X^T\)}]\n
+      \qwire[label={\(X\)}]\qcuprev
+    }\label{pivotal:twist}
+  \end{gather}
+\end{CODEBOX}
+\begin{CODEBOX}{}{ex193477432894100303}
+  \begin{align*}
+    \q{\qasym[name={\(\theta_X\)}]}
+    &=\q{
+      \qwireu[label={\(X\)}]\qcap\n
+      \qbraid\qwired\n
+      \qwireu[label={\(X\)}]\qcuprev
+    }&\q{\qasym[name={\(\theta_X^{-1}\)}]}
+    &=\q{
+      \qcaprev\qwireu[label={\(X\)}]\n
+      \qwired\qbraidinv\n
+      \qcup\qwireu[label={\(X\)}]
+    }\\
+    \q{\qtrans[name={\(\theta_X\)}]}
+    &=\q{
+      \qcap\qwired[label={\(X^T\)}]\n
+      \qwireu\qbraid\n
+      \qcuprev\qwired[label={\(X^T\)}]
+    }&\q{\qtrans[name={\(\theta_X^{-1}\)}]}
+    &=\q{
+      \qwired[label={\(X^T\)}]\qcaprev\n
+      \qbraidinv\qwireu\n
+      \qwired[label={\(X^T\)}]\qcup
+    }
+  \end{align*}
+\end{CODEBOX}
+\begin{CODEBOX}{Ribbon Category}{code:def:ribboncategory}
+  \begin{equation}
+    \label{def:ribboncategory}
+    \q{
+      \qwired\qcaprev\n
+      \qbraid\qwireu\n
+      \qwired\qcup
+    }=\q{
+      \qcap\qwired\n
+      \qwireu\qbraid\n
+      \qcuprev\qwired
+    }
+  \end{equation}
+\end{CODEBOX}
+
+\subsubsection{Trace}
+\label{subsubsec:trace}
+\begin{CODEBOX}{Trace}{Trdef}
+  \[
+    \begin{array}{rccc}
+      \operatorname{Tr}\colon & \operatorname{Hom}(X,X) & \to &\operatorname{Hom}(I,I)\\
+      &\rotatebox{90}{\(\in\)}&&\rotatebox{90}{\(\in\)}\\
+      &\q{
+        \qasym[name={\(f\)}]
+      } & \mapsto & \q{
+        \qcap\n
+        \qasym[name={\(f\)}]\qwire\n
+        \qcuprev
+      }
+    \end{array}
+  \]
+\end{CODEBOX}
+\begin{CODEBOX}{Commutativity of the Trace}{Cotr}
+  \begin{equation}
+    \label{cmt:trace}
+    \operatorname{Tr}\left(\q{
+      \qasym[name={\(g\)}]\n
+      \qasym[name={\(f\)}]
+      }\right)
+    =\q{
+      \qcap\n
+      \qasym[name={\(g\)}]\qwire\n
+      \qasym[name={\(f\)}]\qwire\n
+      \qcuprev
+      }
+    \stackrel{\text{(\ref{eq:sliding})}}{=}\q{
+      \qcap\n
+      \qasym[name={\(f\)}]\qtrans[name={\(g\)}]\n
+      \qcuprev
+    }\stackrel{\text{(\ref{eq:sliding:rev})}}{=}\q{
+      \qcap\n
+      \qasym[name={\(f\)}]\qwire\n
+      \qasym[name={\(g\)}]\qwire\n
+      \qcuprev
+    }=\operatorname{Tr}\left(\q{
+      \qasym[name={\(f\)}]\n
+      \qasym[name={\(g\)}]
+      }\right)
+  \end{equation}
+\end{CODEBOX}
+\begin{CODEBOX}{Dimension}{def:dim}
+  \[
+    \q{\qscalar[name={\(\operatorname{dim}(X)\)}]}
+    \coloneq\q{\qscalar[name={\(\operatorname{Tr}(\operatorname{id}_X)\)}]}
+    =\q{\qcap\n\qcuprev}
+  \]
+\end{CODEBOX}
+\subsubsection{Compact Category}
+\label{subsubsec:compact}
+\begin{CODEBOX}{Compact Category}{Def:compact}
+  \begin{equation}
+    \label{def:compact}
+    \q{\qasym[name={\(\pi_X\)}]}=\q{
+      \qwireuu[label={\(X^{TT}\)}]\qcap\n
+      \qsym\qwired[label={\(X^T\)}]\n
+      \qwire[label={\(X\)}]\qcuprev
+    }
+  \end{equation}
+\end{CODEBOX}
+
+\subsubsection{Color}
+\label{subsubsec:duality:color}
+\begin{CODEBOX}{}{Ex:coloredhopflink}
+  \begin{equation}
+    \label{eq:tr:hopf}
+    \operatorname{Tr}\left(
+      \q{
+        \qbraid[L color=blue, R color=orange]\n
+        \qbraid[L color=orange, R color=blue]}
+    \right)
+    =\q{
+      \qcap[hlen=4, frame color=orange]\n
+      \qwire[color=orange]\qcap[frame color=blue]\n
+      \qbraid[L color=blue, R color=orange]\n
+      \qbraid[L color=orange, R color=blue
+      ]\qwiredown[vlen=2, color=blue]\n
+      \qwire[color=orange]
+      \qcuprev[frame color=blue]
+      \qwiredown[vlen=4, color=orange]\n
+      \qcuprev[hlen=4, frame color=orange]
+    }=\q{
+      \qcap[frame color=blue]
+      \qcap[frame color=orange]\n
+      \qspace
+      \qbraidinv[L color=orange, R color=blue]\n
+      \qwireup[vlen=2, color=blue]
+      \qbraidinv[L color=blue, R color=orange]
+      \qwiredown[vlen=2, color=orange]\n
+      \qcuprev[frame color=blue]
+      \qcuprev[frame color=orange]
+    }
+  \end{equation}
+\end{CODEBOX}
+
+\subsection{Dagger}
+\label{subsec:dagger}
+\subsubsection{Adjoint Box}
+\label{subsubsec:adjoint}
+\begin{CODEBOX}{Adjoint}{def:adj}
+  \begin{gather}
+    \left(
+      \q{
+        \qasym[name={\(f\)}]
+        \symbolI{\(X\)}\symbolO{\(Y\)}
+      }
+    \right)^{\dagger}
+    \coloneq
+    \q{
+      \qadj[name={\(f\)}]
+      \symbolI{\(Y\)}\symbolO{\(X\)}
+    }\\
+    \left(\q{\qasym[name={\(f\)}]}\right)^{\dagger\dagger}
+    =\left(\q{\qadj[name={\(f\)}]}\right)^{\dagger}
+    =\q{\qasym[name={\(f\)}]}\\
+    \left(\q{\qwire}\right)^{\dagger}=\q{\qwire}\\
+    \q{
+      \qadj[name={\(f\)}]\n
+      \qadj[name={\(g\)}]
+    }=\q{
+      \qadj[name={\(g\circ f\)}]
+    }
+\end{gather}
+\end{CODEBOX}
+\subsubsection{Conjugate Box}
+\label{subsubsec:conj}
+\begin{CODEBOX}{}{prep:conj}
+  \begin{align*}
+    \left(\q{\qadj}\right)^T
+    &=\q{
+      \qwire\qcap\n
+      \qwire\qadj\qwire\n
+      \qcup\qwire
+    }=\q{
+      \qcaprev\qwire\n
+      \qwire\qadj\qwire\n
+      \qwire\qcuprev
+    }=\left(
+      \q{
+        \qwire\qcap\n
+        \qwire\qasym\qwire\n
+        \qcup\qwire
+      }
+    \right)^{\dagger}=\left(\q{\qtrans}\right)^{\dagger}
+  \end{align*}
+\end{CODEBOX}
+\section{List of Primitive Diagrams}
+\label{sec:fcommands}
+      \begin{tcbraster}[raster columns=4,raster equal height=rows,fonttitle=\bfseries,
+        colframe=cyan!90,coltitle=cyan!50,colbacktitle=black,
+        subtitle style={boxrule=0.4pt,
+        colback=black!70}
+        ]
+        \begin{tcolorbox}[adjusted title={\showcmd{qwire}[cyan]}]
+          \[\q{\qwire}\]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qbox}[cyan]}]
+          \[
+            \q{
+              \qbox
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qstate}[cyan]}]
+          \[
+            \q{
+              \qstate
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qeffect}[cyan]}]
+          \[
+            \q{
+              \qeffect
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qscalar}[cyan]}]
+          \[
+            \q{
+              \qscalar
+              }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qunitob}[cyan]}]
+          \[
+            \q{
+              \qunitob
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qmul}[cyan]}]
+          \[
+            \q{
+              \qmul[hlen=2]
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qcomul}[cyan]}]
+          \[
+            \q{
+              \qcomul[hlen=2]
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qunit}[cyan]}]
+          \[
+            \q{
+              \qunit
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qcounit}[cyan]}]
+          \[
+            \q{
+              \qcounit
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qspider}[cyan]}]
+          \[
+            \q{
+              \qspider[p=4,hlen=2]
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qbraid}[cyan]}]
+          \[
+            \q{
+                \qbraid
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qbraidinv}[cyan]}]
+          \[
+            \q{
+              \qbraidinv
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qsym}[cyan]}]
+          \[
+            \q{
+              \qsym
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qcap}[cyan]}]
+          \[
+            \q{
+              \qcap
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qcup}[cyan]}]
+          \[
+            \q{
+              \qcup
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qwireu}[cyan]}]
+          \[\q{\qwireup}\]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qwired}[cyan]}]
+          \[\q{\qwiredown}\]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qwireuu}[cyan]}]
+          \[\q{\qwireuu}\]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qwiredd}[cyan]}]
+          \[\q{\qwiredd}\]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qasym}[cyan]}]
+          \[
+            \q{
+              \qasym
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qtrans}[cyan]}]
+          \[
+            \q{
+              \qtrans
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{adj}[cyan]}]
+          \[
+            \q{
+              \qadj
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qconj}[cyan]}]
+          \[
+            \q{
+              \qconj
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qcaprev}[cyan]}]
+          \[
+            \q{
+              \qcaprev
+            }
+          \]
+        \end{tcolorbox}
+        \begin{tcolorbox}[adjusted title={\showcmd{qcuprev}[cyan]}]
+          \[
+            \q{
+              \qcuprev
+            }
+          \]
+        \end{tcolorbox}
+      \end{tcbraster}
+      \addcontentsline{toc}{section}{References}
+      \begin{thebibliography}{99}
+        \bibitem{tikz-manual}
+        Till Tantau,
+        \textit{The TikZ and PGF Packages Manual for Version 3.1.10},
+        Institut für Theoretische Informatik, Universität zu Lübeck,
+        n.d.,
+        \url{https://github.com/pgf-tikz/pgf}
+        (retrieved March 22, 2025).
+        \bibitem{geniussorting}
+        Anonymous,
+        \textit{Genius Sorting Algorithm},
+        4chan Programming Board,
+        January 20, 2011,
+        \url{https://dis.4chan.org/read/prog/1295544154}
+        (accessed January 20, 2011; link currently inactive).
+        \bibitem{gfxhatena}
+        gfx,
+        \textit{Joushiki wo kutsugaesu so-to arugorizumu! Sono na mo "sleep sort"!},
+        Hatena Diary,
+        May 19, 2011,
+        \url{https://gfx.hatenadiary.org/entry/20110519/1305810786}.
+        \bibitem{literateprograms}
+        LiteratePrograms,
+        \textit{Turing Machine Simulator in \LaTeX},
+        \url{https://literateprograms.org/turing_machine_simulator__latex_.html},
+        n.d.,
+        retrieved March 22, 2025.
+        \bibitem{overleaf}
+        Overleaf,
+        \textit{\LaTeX\ is More Powerful than You Think: Computing the Fibonacci Numbers and Turing Completeness},
+        \url{https://www.overleaf.com/learn/latex/Articles/LaTeX_is_More_Powerful_than_you_Think_-_Computing_the_Fibonacci_Numbers_and_Turing_Completeness},
+        n.d.,
+        retrieved March 22, 2025.
+      \end{thebibliography}
+
+      \begin{changelog}[author=Ninna Ryota, sectioncmd=\section*]
+
+        \begin{version}[v=1.1.1, date=2025-04-14]
+          \added
+            \item Color annotation for wires and tangles\par The \showcmd[]{frame color} attribute is now supported for CAP and CUP structures, allowing wires to express object identity through color. Additionally, BRAIDING now supports separate \showcmd[]{L color} and \showcmd[]{R color} options for independently coloring the left and right wires.
+          \fixed
+            \item Improved wire rendering\par The rendering of curves has been refined to produce smoother and more aesthetically coherent diagrams.
+        \end{version}
+
+        \begin{version}[v=1.1.0, date=2025-04-03]
+          \changed
+            \item Argument structure revised for symbol commands\par The following commands were updated to support key-value-style optional arguments instead of mandatory positional arguments:
+              \begin{itemize}
+                \item \showcmd{symbolI}
+                \item \showcmd{symbols}
+                \item \showcmd{symbolS}
+                \item \showcmd{symbolO}
+                \item \showcmd{symboln}
+                \item \showcmd{symbolN}
+              \end{itemize}      
+              \begin{description}
+                \item[Previous syntax] \showcmd{symbolI[i]\{ID\}\{text\}[position options]}[old]
+                \item[New syntax] \showcmd{symbolI[i]\{text\}[id=ID, position options]}[new]
+              \end{description}
+              With this revision, the \showcmd[]{ID} parameter is now optional. In simple cases, \showcmd{symbolI\{text\}}[new] suffices. This change enables more concise and readable definitions.
+          \added
+            \item English documentation\par An English version of the user guide has been added.
+        \end{version}
+      
+        \shortversion{
+          v=1.0.0,
+          date=2025-04-01,
+          changes={Initial release}
+        }
+      
+      \end{changelog}
+
+      \section*{License and Copyright}
+
+      This package is distributed under the \textbf{LaTeX Project Public License (LPPL)}, version 1.3c or later.  
+      For details, see \url{https://www.latex-project.org/lppl.txt}.
+      
+      Copyright \textcopyright 2025 Niina Ryota
+      
+      You are free to distribute and modify this package under the terms of LPPL.  
+      However, any modified versions \textbf{must not} be distributed under the original name, and the original author must be credited.
+\end{document}
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/doc/latex/qworld/qworld_en.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/qworld/qworld_eng.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/qworld/qworld_eng.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/qworld/qworld_eng.tex	2025-04-14 19:50:58 UTC (rev 74943)
+++ trunk/Master/texmf-dist/doc/latex/qworld/qworld_eng.tex	2025-04-14 19:51:45 UTC (rev 74944)
@@ -1,2384 +0,0 @@
-\documentclass{article}
-\usepackage[a4paper, textwidth=150mm]{geometry}
-
-\usepackage{qworld}
-
-\usepackage{bookmark}
-\usepackage{fontspec}
-\usepackage{pdfpages}
-
-\usepackage{amsmath}
-\usepackage{amssymb}
-\usepackage{amsfonts}
-\usepackage{mathtools}
-
-\usepackage{ascmac}
-\usepackage{fancybox}
-\usepackage{float}
-
-\usepackage{bbm}
-\usepackage{mathrsfs}
-%\numberwithin{equation}{subsection}
-
-\usepackage{framed}
-\newenvironment{longshadowbox}{%
-  \def\FrameCommand{\fboxsep=\FrameSep \shadowbox}%
-  \MakeFramed {\FrameRestore}}%
-{\endMakeFramed}
-
-\usepackage{url}
-\usepackage{hyperref}
-\hypersetup{colorlinks=true, linkcolor=blue}
-
-\usepackage{iitem}
-
-\usepackage{xspace}
-\newcommand{\qworldname}{\texttt{QWorld}\xspace}
-\newcommand{\tikzname}{Ti\emph{k}Z\xspace}
-\newcommand{\texlivename}{\TeX{} \textsf{Live}\xspace}
-
-\setcounter{tocdepth}{3}
-
-\usepackage[most]{tcolorbox}
-\newtcblisting{mybox}[2][]{
-  colback=red!5!white,
-  colframe=red!75!black,
-  fonttitle=\bfseries,
-  title=#2,
-  #1
-}
-
-\tcbset
-{
-  codeinfo/.style=
-  { 
-    colframe=cyan!90,
-    coltitle=cyan!60,
-    colbacktitle=black,
-    fonttitle=\small\sffamily\bfseries, 
-    fontupper=\small, 
-    fontlower=\small
-  },
-  exampletitleinfo/.style 2 args=
-  {
-    codeinfo,
-    title={Example \thetcbcounter : #1},
-    label={#2}
-  },
-  failurecodeinfo/.style=
-  {
-    colframe=red!90,
-    coltitle=red!60, 
-    colbacktitle=black,
-    fonttitle=\small\sffamily\bfseries, 
-    fontupper=\small, 
-    fontlower=\small
-  },
-  failureexampletitleinfo/.style 2 args=
-  {
-    failurecodeinfo,
-    title={Failure Example \thetcbcounter : #1},
-    label={#2}
-  }
-}
-\newtcblisting{texexp}[1]
-{
-  codeinfo,
-  #1
-}
-\newtcblisting[auto counter,number within=section]{codebox}[3][center lower,listing side text,righthand width=3.5cm,bicolor,colbacklower=white]
-{
-  exampletitleinfo={#2}{#3},
-  breakable,
-  #1
-}
-
-\newtcblisting[use counter from=codebox,number within=section]{CODEBOX}[3][center lower,bicolor,colbacklower=white]
-{
-  exampletitleinfo={#2}{#3},
-  breakable,
-  #1
-}
-\newtcolorbox[use counter from=codebox]{codeboxspec}[3][]
-{
-  exampletitleinfo={#2}{#3},
-  breakable,
-  #1
-}
-
-\newtcblisting{texfexp}[1]
-{
-  failurecodeinfo,
-  #1
-}
-\newtcblisting[auto counter,number within=section]{fcodebox}[3][center lower,listing side text,righthand width=3.5cm,bicolor,colbacklower=white]
-{
-  failureexampletitleinfo={#2}{#3},
-  breakable,
-  #1
-}
-
-\newtcblisting[use counter from=fcodebox,number within=section]{FCODEBOX}[3][center lower,bicolor,colbacklower=white]
-{
-  failureexampletitleinfo={#2}{#3},
-  breakable,
-  #1
-}
-\newtcolorbox[use counter from=fcodebox]{fcodeboxspec}[3][]
-{
-  failureexampletitleinfo={#2}{#3},
-  breakable,
-  #1
-}
-
-\begin{document}
-
-\title{
-    \Huge\textbf{The QWorld Package}\\[4pt]
-    \scriptsize\texttt{Version 1.1.0} \\[4pt]
-}
-\author{
-    \textbf{Niina Ryota} \\[4pt]
-}
-\date{\today}
-\maketitle
-
-\begin{abstract}
-  \qworldname is a \LaTeX\ package designed for efficiently rendering complex graphical calculus in monoidal categories.
-  In particular, it supports the typesetting of diagrammatic languages in category theory, quantum theory, and related fields, where diagrammatic reasoning plays a crucial role.
-\end{abstract}
-
-\tableofcontents
-\section{Introduction}
-This document aims to provide a step-by-step guide to installing and using the \qworldname package, from basic commands to advanced applications. 
-\qworldname is a \LaTeX\ package specifically designed for the typesetting of diagrammatic languages, offering an intuitive command set for describing diagrams related to monoidal categories, Frobenius structures, braiding, Hopf algebras, symmetries, dualities, pivotal structures, and dagger categories using \tikzname\cite{tikz-manual}.
-\section{Basic Usage}
-\subsection{Fundamental Elements}
-The following are the most fundamental commands in the \qworldname package, forming the basis for drawing diagrams:
-\begin{itemize}
-  \item \texttt{\textbackslash q}: A canvas for placing diagram elements.
-  \item \texttt{\textbackslash qbox}: Draws a box\(\q[scale=0.5]{\qbox}\).
-  \item \texttt{\textbackslash qwire}: Draws a wire\(\q[scale=0.5]{\qwire}\).
-  \item \texttt{\textbackslash qcirc}: Compositon.
-\end{itemize}
-These commands are used within the canvas environment, denoted by \verb|\q{...}|. 
-For example, writing \verb|\q{\qbox}| results in the rendering of a box\(\q[scale=0.5]{\qbox}\).\par
-  To compose \(\q[scale=0.5]{\qbox}\)and\(\q[scale=0.5]{\qbox}\), use \verb|\qcirc|. 
-  This is analogous to function composition in mathematics, such as \(g\circ f\) (\verb|\(g\circ f\)|). 
-  \begin{codebox}{}{Ex:20250317}
-    \q{ \qbox \qcirc \qbox }
-  \end{codebox}
-  Additionally, placing multiple \verb|\qbox| commands in sequence results in boxes\(\q[scale=0.5]{\qbox}\)being arranged horizontally:
-  \begin{codebox}{}{boxs2}
-    \q{ \qbox \qbox \qbox }
-  \end{codebox}
-  It is also possible to compose multiple boxes using\verb|\qcirc|:
-  \begin{codebox}{}{boxsbr}
-      \q
-      {
-        \qbox \qbox \qbox
-          \qcirc
-        \qbox \qbox \qbox
-      }
-  \end{codebox}
-  Note that \verb|\n| is synonymous with\verb|\qcirc|
-  \begin{codebox}{}{boxsn}
-    \q
-    {
-      \qbox \qbox \qbox \n
-      \qbox \qbox \qbox
-    }
-\end{codebox}
-\subsubsection{Identification Number}
-All commands placed within \verb|\q{...}| are automatically assigned unique identification numbers based on their execution order. 
-For example, in the previous example \ref{boxsn}, each \verb|\qbox| is numbered as follows:
-\[\q{\qloop[2]{\qloop[3]{\qbox[show id={true}]}\n}}\]
-For more details, see Section \ref{subsub:show id} on page \pageref{subsub:show id}.
-\subsubsection{Bounding Box}
-\[\q{
-  \qcaprev \qcap           \n
-  \qwire   \qbraid  \qwire \n
-  \qwire   \qbraid \qwire \n
-  \qcup    \qcuprev
-  \qbb[red][1,2]
-    \bbsymbol{Measure}
-    \bbsymbol[W]{Output}[left]
-    \bbsymbol[NW]{Computation}[above left]
-    \bbsymbol[NE]{Physics}[above right]
-  \qbb[yellow][3,5,6,8]
-    \bbsymbol{Braid}
-    \bbsymbol[W]{Compute}[left]
-  \qbb[cyan][9,10]
-    \bbsymbol{Create}
-    \bbsymbol[W]{Initialize}[left]
-}\]
-See the following example \ref{ex:hopflink}:
-\begin{codebox}{}{ex:hopflink}
-  \q{
-    \qcaprev \qcap          \n
-    \qwire   \qbraid \qwire \n
-    \qwire   \qbraid \qwire \n
-    \qcup    \qcuprev
-  }
-\end{codebox}
-\begin{itemize}
-  \item \verb|\qcaprev| draws \(\q[scale=0.6]{\qcaprev}\).
-  \item \verb|\qcap| draws \(\q[scale=0.6]{\qcap}\).
-  \item \verb|\qwire| draws \(\q[scale=0.5]{\qwire}\).
-  \item \verb|\qbraid| draws \(\q[scale=0.5]{\qbraid}\).
-  \item \verb|\qcup| draws\(\q[scale=0.6]{\qcup}\).
-  \item \verb|\qcuprev| draws \(\q[scale=0.6]{\qcuprev}\).
-\end{itemize}
-As a whole, the elements are arranged in the diagram according to the order in which the commands are written.\par
-Each element has an associated bounding box. The following are examples:
-  \begin{itemize}
-    \item The bounding box of\q{\qcaprev}is visualized as\q{\qcaprev\qbball}.
-    \item The bounding box of\q{\qbraid}is visualized as\q{\qbraid\qbball}.
-    \item The bounding box of\q{\qwire}is visualized as\q{\qwire\qbball}.
-    \item The bounding box of\q{\qcuprev}is visualized as\q{\qcuprev\qbball}.
-  \end{itemize}
-  The following commands are available for visualizing bounding boxes and placing text near them:
-  \begin{itemize}
-    \item Visualization
-      \iitem \texttt{\textbackslash qbb}: Displays the bounding box of a specific element.
-      \iitem \texttt{\textbackslash qbball}: Displays the bounding boxes of all elements at once.
-      \iitem \texttt{\textbackslash qBBall}: Displays the bounding box surrounding the entire canvas.
-    \item Placing text
-      \iitem \texttt{\textbackslash bbsymbol}: Places text within a bounding box.
-  \end{itemize}
-  
-  \begin{verbatim}
-    \qbb[<color>][<ID list>]
-  \end{verbatim}
-  \begin{itemize}
-    \item First argument (optional): Specifies the color. If omitted, no color is applied.
-    \item Second argument: Specifies a list of element IDs to display their bounding boxes.
-  \end{itemize}
-  \begin{codebox}{}{Ex:20250320}
-    \q{\qbox\qbb[1]}
-  \end{codebox}
-  \begin{codebox}{}{ex:202503270454}
-    \q{
-      \qcaprev \qcap          \n
-      \qwire   \qbraid \qwire \n
-      \qwire   \qbraid \qwire \n
-      \qcup    \qcuprev
-      \qbb[4,7]
-    }
-  \end{codebox}
-  \begin{CODEBOX}{}{Ex:20250321}
-    \q{\qbox\qbox\qbox\qbox\qbox\qbox\qbb[yellow][2,...,5]}
-  \end{CODEBOX}
-  \begin{codebox}{}{Ex:20250222}
-    \q
-    {
-      \qbox\qbox\qbox\n
-      \qbox\qbox\qbox
-      \qbb[green][2,5]
-    }
-  \end{codebox}
-  \begin{codebox}{}{Ex:20250318}
-    \q{
-      \qcaprev \qcap          \n
-      \qwire   \qbraid \qwire \n
-      \qwire   \qbraid \qwire \n
-      \qcup    \qcuprev
-      \qbb[blue][4,7]
-    }
-  \end{codebox}
-  \begin{verbatim}
-    \qbball[<color>]
-  \end{verbatim}
-  \begin{itemize}
-    \item Displays multiple bounding boxes at once (even for a single element).
-    \item Ensures that the bounding boxes of different elements are properly aligned without overlap.
-    \item The \qworldname package \textbf{minimizes the need for tedious manual coordinate adjustments} in diagram drawing.
-  \end{itemize}
-  \begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{Ex:202503270511}
-    \q{
-      \qcaprev \qcap          \n
-      \qwire   \qbraid \qwire \n
-      \qwire   \qbraid \qwire \n
-      \qcup    \qcuprev
-      \qbball
-    }
-  \end{codebox}
-
-  \begin{verbatim}
-    \qBBall[<color>]
-  \end{verbatim}
-  \begin{itemize}
-    \item Displays the bounding box surrounding all elements within the canvas.
-  \end{itemize}
-  \begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{Ex:20250316}
-    \q{
-      \qcaprev \qcap          \n
-      \qwire   \qbraid \qwire \n
-      \qwire   \qbraid \qwire \n
-      \qcup    \qcuprev
-      \qBBall
-    }
-  \end{codebox}
-  \begin{verbatim}
-    \bbsymbol[<direction>]{<text>}[<options>]
-  \end{verbatim}
-  \begin{itemize}
-    \item First argument (optional): Specifies placement direction. Options:
-      \iitem N (North), S (South), E (East), W (West),
-      \iitem NW (Northwest), NE (Northeast), SE (Southeast), SW (Southwest),
-      \iitem C (Center).
-      \iitem Default: E (East).
-    \item Second argument: Specifies the text to be placed.
-    \item Third argument (optional): Adjusts position (e.g., above, below, left, right).
-      \iitem Default: right.
-  \end{itemize}
-  \begin{CODEBOX}{}{Ex:bbsymbol}
-    \q[scale=5]{
-      \qbox
-      \qbb[1]
-      \bbsymbol{East (Default)}
-      \bbsymbol[W]{West}[left]
-      \bbsymbol[N]{North}[above]
-      \bbsymbol[S]{South}[below]
-      \bbsymbol[NE]{NorthEast}[above right]
-      \bbsymbol[NW]{NorthWest}[above left]
-      \bbsymbol[SE]{SouthWest}[below right]
-      \bbsymbol[SW]{SouthEast}[below left]
-      \bbsymbol[C]{Center}[]
-    }
-  \end{CODEBOX}
-  \begin{CODEBOX}{}{Ex:20250315}
-    \q
-    {
-      \qcaprev \qcap          \n
-      \qwire   \qbraid \qwire \n
-      \qwire   \qbraid \qwire \n
-      \qcup    \qcuprev
-      \qbb[red][1,2]
-        \bbsymbol{Measure}
-        \bbsymbol[W]{Output}[left]
-        \bbsymbol[NW]{Computation}[above left]
-        \bbsymbol[NE]{Physics}[above right]
-      \qbb[yellow][3,5,6,8]
-        \bbsymbol{Braid}
-        \bbsymbol[W]{Compute}[left]
-      \qbb[cyan][9,10]
-        \bbsymbol{Create}
-        \bbsymbol[W]{Initialize}[left]
-    }
-  \end{CODEBOX}
-
-  \subsection{Mathematical Mode}
-  When writing equations that include diagrammatic language, use the mathematical mode.
-  \begin{CODEBOX}{}{IntroEx}
-    \[
-      \operatorname{Tr}\left(\q{\qbraid\qcirc\qbraid}\right)
-      =\q{
-        \qcap    \qcap             \n
-        \qwire   \qbraidinv \qwire \n
-        \qwire   \qbraidinv \qwire \n
-        \qcuprev \qcuprev
-      }
-    \]
-  \end{CODEBOX}
-
-  \subsection{Installation}
-  The style file for the \qworldname package, \texttt{qworld.sty}, is available for download from CTAN.
-  To use it, place the file in your \TeX\ package directory and include the following line in the preamble:
-  \begin{verbatim}
-    \usepackage{qworld}
-  \end{verbatim}
-  \paragraph{Dependencies} 
-  The package depends on the following:
-  \begin{itemize}
-      \item \tikzname, with the following libraries:
-        \iitem \texttt{cd}
-        \iitem \texttt{positioning}
-        \iitem \texttt{arrows}
-        \iitem \texttt{arrows.meta}
-        \iitem \texttt{calc}
-        \iitem \texttt{intersections}
-        \iitem \texttt{shapes.symbols}
-        \iitem \texttt{shapes.geometric}
-        \iitem \texttt{shapes.misc}
-        \iitem \texttt{decorations.pathreplacing}
-        \iitem \texttt{decorations.markings}
-        \iitem \texttt{decorations.pathmorphing}
-      \item \texttt{pgffor}
-      \item \texttt{ifthen}
-      \item \texttt{xparse}
-      \item \texttt{xfp}
-      \item \texttt{xstring}
-  \end{itemize}
-  These dependencies are included by default in the \texlivename distribution, so no additional setup is required.
-\subsection{Basic Customization}
-This section explains how to customize commands in the \qworldname package.
-  \subsubsection{Box Customization}
-  \label{subsubsec:boxcustomization}
-  Keys can be used to adjust the number and arrangement of the box’s boundary lines.
-For example, the following boxes can be drawn:
-\begin{itemize}
-  \item \(\q[scale=0.5]{\qbox[p=20,hlen=3]}\)
-  \item \(\q[scale=0.5]{\qbox[p=10,N={1,2,3,8,9,10},S={4,5,6,7},hlen=3]}\)
-\end{itemize}
-These keys are applicable to many elements other than wires.
-The main keys are as follows: 
-\begin{itemize}
-  \item \texttt{n}
-    \iitem The number of points on the north edge of the box\(\q[scale=0.5]{\qbox[p=2, P={}]}\)where wires\(\q[scale=0.31]{\qwire}\)can be generated (these points will be referred to as \texttt{n} terminals).
-    \iitem For example, if \texttt{n=3}, three points can be placed at equal intervals on the north edge of the box.
-    \iitem The default value is \texttt{n=1}.
-    \iitem The point obtained by vertically moving an \texttt{n} terminal to the northernmost position is called an \texttt{N} terminal.
-    \iitem Both \texttt{n} terminals and \texttt{N} terminals are indexed as \(1,2,...\) from the west (left).   
-    \iitem Generating a wire from the \(i\)-th \texttt{n} terminal means connecting the \(i\)-th \texttt{n} terminal and the \(i\)-th \texttt{N} terminal with a line segment.
-  \item \texttt{N}
-    \iitem The set of indices of the \texttt{n} terminals from which wires are actually generated.
-    \iitem For example, if \texttt{n=3} and \texttt{N=\{2\}}, a wire can be generated from the \(2\)nd of the three \texttt{n} terminals.
-    \iitem If \texttt{n} is unspecified and \texttt{N} is specified, \texttt{n} is automatically set to \(\texttt{n}\coloneq\max\texttt{N}\).
-    \iitem If \texttt{N} is unspecified and \texttt{n} is specified, \texttt{N} is automatically set to \(\texttt{N}\coloneq\{1,...,\texttt{n}\}\).
-    \iitem The northernmost end of a wire actually generated from an \texttt{n} terminal is called the output point, or \texttt{O} terminal.
-  \item \texttt{s}
-      \iitem The number of points on the south edge of the box where wires can be generated (these points will be referred to as \texttt{s} terminals).
-      \iitem For example, if \texttt{s=4}, four points can be placed at equal intervals on the south edge of the box. 
-      \iitem The default value is \texttt{s=1}.
-      \iitem The point obtained by vertically moving an \texttt{s} terminal to the southernmost position is called an \texttt{S} terminal.
-      \iitem Both \texttt{s} terminals and \texttt{S} terminals are indexed as \(1,2,...\) from the west (left).     
-      \iitem Generating a wire from the \(i\)-th \texttt{s} terminal means connecting the \(i\)-th \texttt{s} terminal and the \(i\)-th \texttt{S} terminal with a line segment.
-  \item \texttt{S}
-      \iitem The set of indices of the \texttt{s} terminals from which wires are actually generated.
-      \iitem For example, if \texttt{s=4} and \texttt{S=\{1,4\}}, wires can be generated from the 1st and 4th of the four \texttt{s} terminals.
-      \iitem If \texttt{s} is unspecified and \texttt{S} is specified, \texttt{s} is automatically set to \(\texttt{s}\coloneq\max\texttt{S}\).
-      \iitem If \texttt{S} is unspecified and \texttt{s} is specified, \texttt{S} is automatically set to \(\texttt{S}\coloneq\{1,...,\texttt{s}\}\).
-      \iitem The southernmost end of a wire actually generated from an \texttt{s} terminal is called the input point, or \texttt{I} terminal.
-  \item \texttt{hlen}
-      \iitem The horizontal length of the bounding box.
-      \iitem For example, if \texttt{hlen=2}, the horizontal length of the bounding box becomes \texttt{2}.
-      \iitem With one exception, the distance between the westernmost wire and the bounding box's boundary, and the distance between the easternmost wire and the bounding box's boundary, are both \(\fpeval{0.5*\qwireinterval}\).
-      \iitem When \texttt{hlen} is unspecified, the \texttt{n} terminals and \texttt{s} terminals are arranged with an interval of \(1\).
-      \iitem When \texttt{hlen} is specified, the \texttt{n} terminals and \texttt{s} terminals are arranged at equal intervals in a section of length \(\texttt{hlen}-\fpeval{\qwireinterval}\). The spacing depends on \texttt{hlen} and the number of terminals.
-          \iiitem If there is only one terminal, it is placed at the center of the section. In this case, if \(\texttt{hlen}>1\), the distance between the westernmost wire and the bounding box's boundary, and the distance between the easternmost wire and the bounding box's boundary, are both \(\frac{\texttt{hlen}}{2}>\fpeval{0.5*\qwireinterval}\).
-  \item \texttt{vlen}
-      \iitem The vertical length (height) of the bounding box.
-      \iitem The default value is \texttt{vlen=1}.
-  \item \texttt{id}
-      \iitem The identifier of the box.
-      \iitem For example, if \texttt{id=ID}, the following names are automatically assigned to the various points:
-          \iiitem The \(i\)-th \texttt{n} terminal (counting from the west): (n-\(i\)-ID).
-          \iiitem The \(i\)-th \texttt{s} terminal: (s-\(i\)-ID).
-          \iiitem The point obtained by vertically moving the \(i\)-th \texttt{n} terminal to the north edge of the box: (N-\(i\)-ID).
-          \iiitem The point obtained by vertically moving the \(i\)-th \texttt{s} terminal to the south edge of the box: (S-\(i\)-ID).
-          \iiitem The northwest corner of the bounding box: (NW-ID)
-          \iiitem The northeast corner of the bounding box: (NE-ID)
-          \iiitem The southwest corner of the bounding box: (SW-ID)
-          \iiitem The southeast corner of the bounding box: (SE-ID)
-          \iiitem The northernmost point of the bounding box: (N-ID)
-          \iiitem The southernmost point of the bounding box: (S-ID)
-          \iiitem The westernmost point of the bounding box: (W-ID)
-          \iiitem The easternmost point of the bounding box: (E-ID)
-          \iiitem The center of the bounding box: (C-ID)
-          \iiitem The northwest corner of the box: (nw-ID)
-          \iiitem The northeast corner of the box: (ne-ID)
-          \iiitem The southwest corner of the box: (sw-ID)
-          \iiitem The southeast corner of the box: (se-ID)
-          \iiitem The northernmost point of the box: (n-ID)          
-          \iiitem The southernmost point of the box: (s-ID)
-          \iiitem The westernmost point of the box: (w-ID)
-          \iiitem The easternmost point of the box: (e-ID)          
-          \iiitem The \(i\)-th output point: (O-\(i\)-ID)
-          \iiitem The \(i\)-th input point: (I-\(i\)-ID)          
-      \iitem Regardless of whether it is specified, each command placed inside \texttt{\textbackslash q\{...\}} is assigned an identification number. Replacing the ID part with that number refers to the same point. See section \ref{subsub:show id} for details.
-    \item \texttt{p}, \texttt{P}
-        \iitem For a positive integer \texttt{k}, \texttt{p=k} means \texttt{n=k} and \texttt{s=k}.
-        \iitem For a finite set of positive integers \texttt{K}, \texttt{P=K} means \texttt{N=K} and \texttt{S=K}.
-    \item \texttt{name}
-        \iitem With \texttt{name=<text>}, \text{<text>} is placed at the center of the box.
-\end{itemize}
-\begin{CODEBOX}{}{ex:boxpoints}
-  \def\pradius{0.4pt}
-  \q[scale=4]
-  {
-    \qbox
-    [
-      n=3,N={2},
-      s=4,S={1,4},
-      hlen=2,
-      vlen=2,
-      id={ID},
-      name={Center (C-ID)}
-    ]\n
-    \qbb[ID]
-    \node [above] at (NE-ID) {NE-ID};
-    \node [above] at (NW-ID) {NW-ID};
-    \node [below] at (SE-ID) {SE-ID};
-    \node [below] at (SW-ID) {SW-ID};
-    \fill (NE-ID) circle (\pradius);
-    \fill (NW-ID) circle (\pradius);
-    \fill (SE-ID) circle (\pradius);
-    \fill (SW-ID) circle (\pradius);
-    \node [above] at (ne-ID) {ne-ID};
-    \node [above] at (nw-ID) {nw-ID};
-    \node [below] at (se-ID) {se-ID};
-    \node [below] at (sw-ID) {sw-ID};
-    \fill (ne-ID) circle (\pradius);
-    \fill (nw-ID) circle (\pradius);
-    \fill (se-ID) circle (\pradius);
-    \fill (sw-ID) circle (\pradius);
-    \foreach\i in {1,...,3}
-    {
-      \symboln[\i]{n-\i-ID}[below]
-      \fill (n-\i-ID) circle (\pradius);
-      \symbolN[\i]{N-\i-ID}
-      \fill (N-\i-ID) circle (\pradius);
-    }
-    \foreach\i in {1,...,4}
-    {
-      \symbols[\i]{s-\i-ID}[above]
-      \fill (s-\i-ID) circle (\pradius);
-      \symbolS[\i]{S-\i-ID}[below]
-      \fill (S-\i-ID) circle (\pradius);
-    }
-    \draw[line width=0.2pt] (NW-ID) 
-      to [bend left=60] node [fill=white, midway] {hlen} (NE-ID);
-    \draw[line width=0.2pt] (NW-ID) 
-      to [bend right=60] node [fill=white, midway] {vlen} (SW-ID);
-    \draw [red, <->] (C-ID -| W-ID)
-      -- node [midway, auto, font=\footnotesize] {0.5} (C-ID -| S-1-ID);
-    \draw [red, <->] (C-ID -| S-4-ID)
-      -- node [midway, auto, font=\footnotesize] {0.5} (C-ID -| E-ID);
-    \qwire[arrowtype={loosely dotted}, dom={s-1-ID}, cod={n-1-ID}]
-    \qwire[arrowtype={loosely dotted}, dom={s-4-ID}, cod={n-3-ID}]
-    \node (O1prime) at ([shift={(0.25,0.25)}]O-1-ID){O-1-ID};
-    \draw[->,red] (O1prime) to ([shift={(0.05,0.05)}]O-1-ID);
-    \node (I1prime) at ([shift={(0.5,-0.5)}]I-1-ID){I-1-ID};
-    \node (I2prime) at ([shift={(0.5,-0.5)}]I-2-ID) {I-2-ID};
-    \draw[->,red](I1prime) to ([shift={(0.05,-0.05)}]I-1-ID);
-    \draw[->,red](I2prime) to ([shift={(0.05,-0.05)}]I-2-ID);
-  }
-\end{CODEBOX}
-The \verb|\qwire| \verb|arrowtype| key, as well as the \verb|dom| and \verb|cod| keys, are explained in section \ref{subsubsec:wirecustomization} on page \pageref{subsubsec:wirecustomization}.
-
-\paragraph{Label (\texttt{\textbackslash symbol})}
-\begin{verbatim}
-  \symbolI[<number>]{<label>}[<options>]
-\end{verbatim}
-For example, \verb|\symbolI[2]{text}[below right, id=ID]| places the label "text" at the bottom right of the second input point (I-2-ID) of \verb|\q{\qbox[p=3, id=ID]}| (\(\q[scale=0.5]{\qbox[p=3, id=ID]}\)). 
-When no number or options are specified, the default values \(1\), below, and \verb|id=<previous>| are applied, respectively. 
-Other label display commands include:
-\begin{verbatim}
-  \symbolS[<number>]{<label>}[<options>]
-\end{verbatim}
-\begin{verbatim}
-  \symbols[<number>]{<label>}[<options>]
-\end{verbatim}
-\begin{verbatim}
-  \symbolO[<number>]{<label>}[<options>]
-\end{verbatim}
-\begin{verbatim}
-  \symbolN[<number>]{<label>}[<options>]
-\end{verbatim}
-\begin{verbatim}
-  \symboln[<number>]{<label>}[<options>]
-\end{verbatim}
-\verb|\symbolS| and \verb|\symbols| place the label \textless label\textgreater at points (S-\(i\)-ID) and (s-\(i\)-ID), respectively. 
-The default number \(i\) is \(1\), and the default option is below. 
-\verb|\symbolO|, \verb|\symbolN|, and \verb|\symboln| place the label \textless label\textgreater at points (O-\(i\)-ID), (N-\(i\)-ID), and (n-\(i\)-ID), respectively. 
-The default number \(i\) is \(1\), and the default option is above.
-\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{Ex:20250311}
-  \q{
-    \qbox[p=5, S={1,4,5}, id=ID]
-    \symbolO{A}
-    \symbolN[3]{B}
-    \symboln[5]{C}[below left]
-    \symbolS[2]{D}
-    \symbols[3]{E}
-    \symbolI[2]{F}
-    \symbolI[3]{G}[below right]
-  }
-\end{codebox}
-\begin{CODEBOX}{}{Ex:20250310}
-  \q{
-    \qbox[p=10,N={1,2,5,6,9,10}, id=ID]
-    \foreach\i in {1,...,10}
-    {
-      \symbolI[\i]{\(x_{\i}\)}
-    }
-    \foreach\j in {1,...,6}
-    {
-      \symbolO[\j]{\(y_{\j}\)}
-    }
-  }
-\end{CODEBOX}
-
-\subsubsection{Repetition}
-\label{subsub:forloop}
-\begin{verbatim}
-  \qloop[<number of repetitions>]{<command>}
-\end{verbatim}
-By using the \verb|\qloop| command, you can repeat a command the specified number of times:
-\begin{CODEBOX}{}{Ex:20250305}
-  \q{ \qloop[10]{\qbox} }
-\end{CODEBOX}
-The \verb|\qloop| command can also be used outside of \verb|\q|:
-\begin{codebox}[center lower,listing side text,righthand width=5.5cm,bicolor,colbacklower=white]{}{Ex:202503220930}
-  \qloop[30]{I AM BOB}
-\end{codebox}
-
-\subsubsection{Displaying Identification Numbers}
-\label{subsub:show id}
-Commands inside \verb|\q{...}| are automatically assigned identification numbers. 
-If \texttt{show id=true} is specified, those identification numbers will be displayed.
-\begin{CODEBOX}{}{Ex:20250303}
-  \q{
-    \qbox[show id={true}] \qbox[show id={true}] \qbox[show id={true}]\n
-    \qbox[show id={true}] \qbox[show id={true}] \qbox[show id={true}]
-  }
-\end{CODEBOX}
-\begin{CODEBOX}{}{Ex:20250302}
-  \q
-  {
-    \qloop[10]
-    {
-      \qloop[10]
-      {
-        \qbox[show id={true}]
-      }\n
-    }\n
-  }
-\end{CODEBOX}
-
-\subsubsection{Color}
-You can specify colors for the boxes:
-\begin{itemize}
-  \item \texttt{color}
-    \iitem The color inside the box, for example, \texttt{color=green} will produce \q[scale=0.5]{\qbox[color={green}]}.
-  \item \texttt{frame color}
-    \iitem The color of the box's frame, for example, \texttt{frame color=cyan}will produce \q[scale=0.5]{\qbox[frame color={cyan}]}.
-  \item \texttt{morphism color}
-    \iitem The color of the morphisms inside the box, for example, \texttt{morphism color=red} will produce \q[scale=0.5]{\qbox[morphism color={red}, name={\(f\)}]}.
-\end{itemize}
-\begin{CODEBOX}{}{Ex:20250259}
-    \q
-    {
-      \qbox
-      [
-        name={\(f\)},
-        color=green,
-        frame color=cyan,
-        morphism color=red
-      ]
-    }
-\end{CODEBOX}
-
-\paragraph{\texttt{N}, \texttt{S}, Arithmetic Sequence}
-\qworldname loads the \texttt{pgffor} package, so the shorthand notation using \verb|...| can be used for lists:
-\begin{itemize}
-  \item \(1,...,10\): An arithmetic sequence with a common difference of \(1\)
-  \item \(1,3,...,11\): An arithmetic sequence based on the first two terms with a common difference
-\end{itemize}
-\begin{CODEBOX}{}{Ex:20250258}
-   \q{
-     \qbox[N={1,...,10}, S={1,3,...,11}]
-   }
-\end{CODEBOX}
-\begin{CODEBOX}{}{Ex:20250257}
-  \q{
-    \qbox[N={1,...,4,6,8,...,20}, S={1,...,20}, hlen=10]
-  }
-\end{CODEBOX}
-\begin{CODEBOX}{}{Ex:20250256}
-  \q{
-    \qbox[N={1,...,4,7,10,...,19,20,21,...,25}, S={1,...,25}, hlen=10]
-  }
-\end{CODEBOX}
-\subsubsection{Relative Coordinates}
-This is a command for specifying the position of elements relative to a given point. 
-Note that \(x\) and \(y\) do not have to be integers; expressions evaluable by \verb|\fpeval|, 
-such as \verb|2^1.5|, \verb|cos(pi)|, and \verb|sprt(2)|, are valid.
-\begin{itemize}
-  \item \texttt{\textbackslash qmv[\(x\),\(y\)]}
-    \iitem Translates by (\(x\), \(y\)).
-    \iitem The default is \(x=y=0\).
-  \item \texttt{\textbackslash n[\(y\)]}
-    \iitem Moves vertically by \(y\) (\(Y\mapsto Y-y\)), and sets the X coordinate to \(0\).
-    \iitem The default is \(y=1\) , which behaves like a line break.
-  \item \texttt{\textbackslash qspace[\(x\)]}
-    \iitem Moves Horizontally by \(x\). 
-    \iitem The default is \(x=1\), which behaves like the spacebar.
-    \iitem This is equivalent to \texttt{\textbackslash qmv[\(x\),0]}.
-  \item \texttt{\textbackslash qreset[\(x\),\(y\)]}
-    \iitem Moves to the point (\(x\),\(y\)).
-\end{itemize}
-  \q[scale=2.35]{
-      \fill[blue] (qworldat) circle (1pt);
-      \coordinate (I) at (qworldat);
-    \qbox
-      \fill[blue] (qworldat) circle (1pt);
-      \coordinate (II) at (qworldat);
-    \n
-      \fill[blue] (qworldat) circle (1pt);
-      \coordinate (III) at (qworldat);
-    \qspace
-      \fill[blue] (qworldat) circle (1pt);
-      \coordinate (IV) at (qworldat);
-    \qspace[0.5]
-      \fill[blue] (qworldat) circle (1pt);
-      \coordinate (V) at (qworldat);
-    \n[2]
-      \fill[blue] (qworldat) circle (1pt);
-      \coordinate (VI) at (qworldat);
-    \qmv[-2,-1]
-      \fill[blue] (qworldat) circle (1pt);
-      \coordinate (VII) at (qworldat);
-    \n
-      \fill[blue] (qworldat) circle (1pt);
-      \coordinate (VIII) at (qworldat);
-    \qspace[-3]
-      \fill[blue] (qworldat) circle (1pt);
-      \coordinate (IX) at (qworldat);
-    \qreset
-      \fill[blue] (qworldat) circle (1pt);
-      \coordinate (X) at (qworldat);
-    \qreset[-2,1]
-      \fill[blue] (qworldat) circle (1pt);
-      \coordinate (XI) at (qworldat); 
-    \qbball
-    \qwireup[dom={I}, cod={II},
-             label={Auto-update}, label side={below},
-             label at={midway}, color=cyan]
-    \qwireup[dom={II},cod={III},
-             label={\texttt{\textbackslash n}},
-             label side={below}, color=cyan]
-    \qwireup[dom={III},cod={IV},
-             label={\texttt{\textbackslash qspace}},
-             label side={below}, color=cyan]
-    \qwireup[dom={IV},cod={V},
-             label={\texttt{\textbackslash qspace[0.5]}},
-             label at={at end}, label side={above right}, color=cyan]
-    \qwireup[dom={V},cod={VI},
-             label={\texttt{\textbackslash n[2]}},color=cyan]
-    \qwireup[dom={VI},cod={VII},
-             label={\texttt{\textbackslash qmv[-2,-1]}},color=cyan]
-    \qwireup[dom={VII},cod={VIII},
-             label={\texttt{\textbackslash n}},color=cyan]
-    \qwireup[dom={VIII},cod={IX},
-             label={\texttt{\textbackslash qspace[-3]}}, 
-             label side={below},color=cyan]
-    \qwireup[dom={IX},cod={X},
-             label={\texttt{\textbackslash qreset}},color=cyan]
-    \qwireup[dom={X},cod={XI},
-             label={\texttt{\textbackslash qreset[-2,1]}},color=cyan]
-    \draw[help lines] (-4,-6) grid (2,2);
-    }
-
-\subsubsection{Absolute Coordinates}
-By using the \texttt{at} key, positions can be specified with absolute coordinates. 
-\verb|\q{\qbox[at={2,3}]}| is equivalent to \verb|\q{\qreset[2,3]\qbox}|.
-\begin{CODEBOX}{Absolute Coordinates}{Ex:20250254}
-  \q{
-    \coordinate (a) at (0,{\fpeval{2*sqrt(3)}});
-    \qbox[at=a]
-    \qbox[at={-2,0}]
-    \qbox[at={2,0}]
-    \fill[red] (a) circle (2pt);
-    \fill[red] (-2,0) circle (2pt);
-    \fill[red] (2,0) circle (2pt);
-    \node[below left] at (a) {a};
-    \node[below left] at (-2,0) {(-2,0)};
-    \node[below left] at (2,0) {(2,0)};
-  }
-\end{CODEBOX}
-The \TeX\ language is Turing complete\footnote{For example, the ability to simulate a Turing machine is demonstrated in the example from LiteratePrograms\cite{literateprograms}. Additionally, an article on Overleaf introduces a method to compute Fibonacci numbers using \TeX, illustrating the  practical utility of its Turing completeness \cite{overleaf}}. 
-In other words, every algorithm that exists in the world can be expressed in \TeX. 
-Phisical simulations (such as weather forecasting or chemical reaction prediction), 
-economic simulations (such as investment strategies), 
-and even artificial intelligence learning algorithms (such as image recognition or natural language processing)------\par
-all of these can be implemented in \TeX.\par
-However, how many people would actually want to do that? 
-I for one, wouldn't want to write even a sorting algorithm in \TeX. 
-That's like tring to create Super Mario in spreadsheet.\par
-However, there is a twist.\par
-I had a ``revelation''\footnote{Original source: On January 20,  2011, an algorithm called "Sleep Sort" was posted on the anonymous message board 4chan \cite{geniussorting, gfxhatena}. This algorithm uses a \texttt{Bash} script to execute each input value as a thread asynchronously, sorting the list by the timing of each thread’s completion (the specified "sleep" time).}.
-And with the \texttt{at} key, I created a sorting algorithm.
-\begin{codebox}{}{Ex:genius}
-  \newcommand{\AtSort}[1][1]{
-    \q
-    {
-      \foreach \i in {#1}
-      {
-        \qbox[name={\i}, at={0, -\i}]\n
-      }
-    }
-  }
-  \AtSort[4,1,3,-1,6,2]
-\end{codebox}
-It works. Indeed, it works.\par
-But there is one problem.
-\textbf{If the list contains elements with large absolute values, the output will overflow the page}.
-\subsubsection{Wire Customization}
-\label{subsubsec:wirecustomization}
-Among the keys of the box \(\q[scale=0.5]{\qbox}\) introduced in section \ref{subsubsec:boxcustomization}, \texttt{id} and \texttt{vlen} are also valid for wires. 
-The basic keys specific to wires are as follows:
-\begin{itemize}
-  \item \texttt{dom}: input point. 
-  \item \texttt{cod}: output point.
-      \iitem Default value is the position obtained by moving \texttt{dom} \(1\) unit vertically to the north.
-  \item \texttt{label}: Label for the wire. 
-  \item \texttt{label at}: Position of the label on the wire.
-      \iitem The default is midway.
-  \item \texttt{label side}: Relationship between the label and the wire.
-      \iitem The default is right.
-\end{itemize}
-\begin{codebox}{}{ex:202503260951}
-  \q{
-    \qbox[n=3,hlen=1.5]
-    \qbox[at={1,2}, s=2, hlen=1.5]
-    \qbox[at={-1,4}, s=2, hlen=1.5]
-    \qwire[dom={N-1-1}, cod={S-1-3}]
-    \qwire[dom={N-2-1}, cod={S-1-2}]
-    \qwire[dom={N-3-1}, cod={S-2-2}]
-    \qwire[dom={N-1-2}, cod={S-2-3}]
-  }
-\end{codebox}
-The bounding box of the wire \q[scale=0.6]{\qwire} is the same as that of \q[scale=0.5]{\qbox}:
-\begin{codebox}{}{ex:202503220926}
-  \q
-  {
-    \qwire\qbox\qwire\n
-    \qbox\qwire\qbox
-    \qbball
-  }
-\end{codebox}
-The bounding box of the wire matches that of a box with \texttt{dom} as the input point and \texttt{cod} as the output point:
-\begin{itemize}
-  \item \(\q[scale=0.5]{\qwire}\) and \(\q[scale=0.5]{\qbox}\)
-  \item \(\q[scale=0.5]{\qwire[dom={0,0},cod={1,1}]}\) and \(\q[scale=0.5]{\qbox[p=2,S={1},N={2}]}\)
-\end{itemize}
-
-\begin{CODEBOX}{}{Ex:20250309}
-  \q[scale=3]{
-    \coordinate (A) at (0,0);
-    \coordinate (B) at (2,3);
-    \qwire[dom=A, cod={1,1}, label={wire1}, label side={left}]
-    \qwire[dom={1,1}, cod=B, label={wire2}, label at={near end}]
-    \node[fill=red, circle] at (A) {A};
-    \node[fill=green, circle] at (B) {B};
-    \node[fill=yellow, circle] at (1,1) {(1,1)};
-    \qbball
-  }
-\end{CODEBOX}
-
-\begin{CODEBOX}{}{Ex:20250301}
-  \q{
-    \qloop[5]{
-      \qloop[10]{
-        \qbox[show id={true}]
-      }\n
-    }\n
-    \qspace[3]\qbox[s=2,show id={true},id={ego1}]\n\n
-    \qspace[6]\qbox[n=2,show id={true},id={ego2}]\n\n
-    \qloop[5]{
-      \qloop[10]{
-        \qbox[show id={true}]
-      }\n
-    }
-    \qwire[dom={O-1-55},cod={I-1-51}]
-    \qwire[dom={O-1-60},cod={I-1-52}]
-    \qwire[dom={O-1-51},cod={I-1-45}]
-    \qwire[dom={O-1-52},cod={I-2-51}]
-    \qwire[dom={O-2-52},cod={I-1-48}]
-  }
-\end{CODEBOX}
-
-\paragraph{arrowtype}
-The wire style is specified using the \texttt{arrowtype} key.
-\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{wirearrowtype}
-  \q{
-    \qwire[arrowtype=dotted]
-    \qwire[arrowtype=dashed]
-    \qwire[arrowtype={dash dot}]
-    \qwire[arrowtype={dash dot dot}]
-    \qwire[arrowtype={densely dotted}]
-    \qwire[arrowtype={loosely dotted}]
-  }
-\end{codebox}
-
-\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{boxarrowtype}
-  \q{
-    \qbox[dom arrowtype={dotted}]
-    \qbox[cod arrowtype={dotted}]
-    \qbox[arrowtype={dotted}]
-  }
-\end{codebox}
-
-\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{}{spiderarrowtype}
-  \q{
-    \qspider[dom arrowtype={dotted}]
-    \qspider[cod arrowtype={dotted}]
-    \qspider[arrowtype={dotted}]
-  }
-\end{codebox}
-
-\subsubsection{Canvas}
-\begin{verbatim}
-  \q[option]
-  {
-    command 1
-    command 2
-    ...
-  }
-\end{verbatim}
-The entire diagram can be transformed useing canvas options.
-\begin{codebox}{}{Ex:20250253}
-  \q[scale=2,rotate=30]{\qbox}
-\end{codebox}
-It is also possible to \textbf{slant} the canvas.
-\begin{CODEBOX}{}{Ex:20250252}
-  \def\anglerot{-55}
-  \tikzset
-  {
-    my slant style/.style={
-      yslant=-cot(\anglerot), 
-      xscale=sin(-\anglerot)
-      }
-  }
-  \q[my slant style]
-  {
-    \qcaprev\qcap\n
-    \qwire\qbraidinv\qwiredown\n
-    \qwiredown\qbraidinv\qwire\n
-    \qcup\qcuprev
-    \qBBall
-  }
-\end{CODEBOX}
-\begin{CODEBOX}{}{Ex:20250251}
-  \def\anglerot{-60}
-  \tikzset
-  {
-    my slant style/.style={
-      yslant=-cot(\anglerot), 
-      xscale=sin(-\anglerot)
-      }
-  }
-  \[\q[my slant style]
-  {
-    \qbraid\qwire\n
-    \qwire\qbraid\n
-    \qbraid\qwire
-  }
-  =\q[my slant style]
-  {
-    \qbraid\qwire\n
-    \qwire\qwire\qwire\n
-    \qbraid[num R=2]
-    \qbb[red][1]
-    \qbb[cyan][6]
-  }
-  =\q[my slant style]
-  {
-    \qbraid[ num R=2]\n
-    \qwire\qwire\qwire\n
-    \qwire\qbraid
-    \qbb[red][6]
-    \qbb[cyan][1]
-  }
-  =\q[my slant style]
-  {
-    \qwire\qbraid\n
-    \qbraid\qwire\n
-    \qwire\qbraid
-  }\]
-\end{CODEBOX}
-
-\section{Monoidal Categories and \qworldname}
-In this section, we explore how to typeset graphical calculus using the \qworldname package, examining its different applications and practical usage.\par
-While \qworldname can handle diagrams independently, it is often beneficial to combine it with packages like \texttt{amsmath}, \texttt{amssymb}, and \texttt{mathtools} for more flexible mathematical expressions. 
-This section demonstrates how to typeset actual graphical calculus in \TeX\ while introducing the functionalities of \qworldname.\par
-To reproduce the examples in this section, please ensure that the following packages are loaded:
-\begin{verbatim}
-  \usepackage{amsmath, amssymb, mathtools}
-  \usepackage{qworld}
-\end{verbatim}
-
-\begin{codebox}{Domain}{ex:dom2}
-  \[
-    \operatorname{dom}\left(
-      \q{
-        \qbox[name={\(f\)}]
-        \symbolI{\(x\)}
-        \symbolO{\(y\)}
-      }
-    \right)=\q{\qwire[label={\(x\)}]}
-  \]
-\end{codebox}
-\begin{codebox}{Codomain}{ex:cod2}
-  \[
-    \operatorname{cod}\left(
-      \q{
-        \qbox[name={\(f\)}]
-        \symbolI{\(x\)}
-        \symbolO{\(y\)}
-      }
-    \right)=\q{\qwire[label={\(y\)}]}
-  \]
-\end{codebox}
-
-\begin{codebox}{(Vertical) Compositon}{def:composite}
-  \[
-    \q{
-      \qbox[name={\(f\)}]\qcirc\qbox[name={\(g\)}]
-    }=\q{\qbox[name={\(f\circ g\)}]}
-  \]
-\end{codebox}
-\begin{CODEBOX}{Associativity}{Ex:20250250}
-  \[
-    \forall\q{\qbox[name={\(h\)}] \symbolI{\(z\)} \symbolO{\(w\)}},
-           \q{\qbox[name={\(g\)}] \symbolI{\(y\)} \symbolO{\(z\)}},
-           \q{\qbox[name={\(f\)}] \symbolI{\(x\)} \symbolO{\(y\)}}:
-    \q{
-        \qbox[name={\(h\)}]\qcirc\qbox[name={\(g\)}]\qcirc\qbox[name={\(f\)}]
-        \qbb[2,3]
-    }
-    =
-    \q{
-        \qbox[name={\(h\)}]\qcirc\qbox[name={\(g\)}]\qcirc\qbox[name={\(f\)}]
-        \qbb[1,2]
-    }
-  \]
-\end{CODEBOX}
-\begin{CODEBOX}{Identity Law}{IdentityLaw}
-  \begin{equation}
-    \label{law:identity}
-    \forall\q
-    {
-      \qbox[name={\(f\)}]
-      \symbolS{\(x\)}
-      \symbolN{\(y\)}
-    }\colon
-    \q{
-      \qwire[label={\(y\)}]\n
-      \qbox[name={\(f\)}]
-    }=\q{
-      \qbox[name={\(f\)}]
-    }=\q{
-      \qbox[name={\(f\)}]\n
-      \qwire[label={\(x\)}]
-    }
-  \end{equation}
-\end{CODEBOX}
-\begin{CODEBOX}{Tensor Product, Horizontal (Parallel) Compositon}{monoidalproduct}
-  \[
-    \q
-    {
-      \qbox[name={\(f\)}] \qbox[name={\(g\)}]
-      \symbolO{\(Y_1\)}[id=1] \symbolO{\(Y_2\)}
-      \symbolI{\(X_1\)}[id=1] \symbolI{\(X_2\)}
-    }
-    =\q
-    {
-      \qbox[name={\(f\otimes g\)}, p=2]
-      \symbolO{\(Y_1\)} \symbolO[2]{\(Y_2\)}
-      \symbolI{\(X_1\)} \symbolI[2]{\(X_2\)}
-    }
-    =\q
-    {
-      \qbox[name={\(f\otimes g\)}]
-      \symbolO{\(Y_1\otimes Y_2\)}
-      \symbolI{\(X_1\otimes X_2\)}
-    }
-  \]
-\end{CODEBOX}
-
-\begin{CODEBOX}{Interchange Law (Covariant Functoriality of \(\bigotimes\))}{InterchangeLaw}
-  \begin{equation}
-    \label{law:interchange}
-    \q
-    {
-      \qbox[name={\(f_2\)}]\qbox[name={\(g_2\)}]\n
-      \qbox[name={\(f_1\)}]\qbox[name={\(g_1\)}]
-      \qbb[1,2]
-      \qbb[3,4]
-    }
-    =\q
-    {
-      \qbox[name={\(f_2\)}]\qbox[name={\(g_2\)}]\n
-      \qbox[name={\(f_1\)}]\qbox[name={\(g_1\)}]
-      \qbb[2,4]
-      \qbb[1,3]
-    }
-  \end{equation}
-\end{CODEBOX}
-
-\begin{CODEBOX}{Unit Object}{Ex:20250244}
-  \begin{gather}
-    \q{ \qwire[arrowtype=dotted]}
-    =\q{ \qunitob \qbball }\\
-    \q{ \qunitob \qbox[name={\(f\)}] \qbball }
-    =\q{ \qbox[name={\(f\)}] }
-    =\q{ \qbox[name={\(f\)}] \qunitob \qbball }\label{cond:unitob}
-  \end{gather}
-\end{CODEBOX}
-\begin{CODEBOX}{}{Ex:20250243}
-  \[
-    \q{\qunitob\qbball}
-    =\q{\qloop[2]{\qunitob}\qbball}
-    =\q{\qloop[3]{\qunitob}\qbball}
-    =\cdots
-  \]
-\end{CODEBOX}
-
-\subsection{Special Boxes}
-
-\begin{itemize}
-  \item \texttt{\textbackslash qstate}: \(\q[scale=0.5]{\qstate}\) (Zero Input).
-  \item \texttt{\textbackslash qeffect}: \(\q[scale=0.5]{\qeffect}\) (Zero Output).
-  \item \texttt{\textbackslash qscalar}: \(\q[scale=0.5]{\qscalar}\) (Zero Input, Zero Output).
-  \item \texttt{\textbackslash qasym}: \(\q[scale=0.5]{\qasym}\) (Asymmetric Box). 
-  \item \texttt{\textbackslash qtrans}: \(\q[scale=0.5]{\qtrans}\) (Transpose Box). Section \ref{subsub:transpose} on page \pageref{subsub:transpose}.
-  \item \texttt{\textbackslash qadj}: \(\q[scale=0.5]{\qadj}\) (Adjoint Box). Section \ref{subsub:adjoint} on page \pageref{subsub:adjoint}.
-  \item \texttt{\textbackslash qconj}: \(\q[scale=0.5]{\qconj}\) (Conjugate Box). Section \ref{subsub:conj} on page \pageref{subsub:conj}.
-\end{itemize}
-\subsubsection{Zero Input}
-\label{subsub:zeroinput}
-\begin{codebox}{}{def:state}
-  \q{\qstate}
-\end{codebox}
-\subsubsection{Zero Output}
-\label{subsub:zerooutput}
-\begin{codebox}{}{def:effect}
-  \q{\qeffect}
-\end{codebox}
-\subsubsection{Zero Input, Zero Output}
-\label{subsub:zeroinputoutput}
-\begin{codebox}{}{def:scalar}
-  \q{\qscalar}
-\end{codebox}
-\paragraph{\(\q[scale=0.4]{\qeffect\qstate\qwire[dom={O-1-2}, cod={1,2}]\qwire[dom={1,-1}, cod={I-1-1}]}=\q[scale=0.4]{\qwire[vlen=0.5]\n\qstate\n\qeffect\n[0.5]\qwire[vlen=0.5]}=\q[scale=0.4]{\qstate\qeffect\qwire[dom={O-1-1}, cod={1,2}]\qwire[dom={1,-1}, cod={I-1-2}]}\)}
-\begin{CODEBOX}{}{coherence:unitor}
-  \[
-    \q{
-      \qeffect\qstate
-      \qwire[dom={O-1-2}, cod={1,2}]
-      \qwire[dom={1,-1}, cod={I-1-1}]
-    }=\q{
-        \qwire[arrowtype=dotted]\qwire\n
-        \qeffect\qstate\n
-        \qwire\qwire[arrowtype=dotted]
-    }\stackrel{\text{(\ref{law:interchange}, \ref{law:identity})}}{=}\q{
-        \qwire[arrowtype=dotted]\qstate\n
-        \qeffect\qwire[arrowtype=dotted]
-    }\stackrel{\text{(\ref{law:interchange}, \ref{cond:unitob})}}{=}\q{\qstate\n\qeffect}
-  \]
-\end{CODEBOX}
-\begin{CODEBOX}{Matrix Representation}{matrixrepre}
-  \begin{align*}
-    \q{\qbox[name={\(f\)}]}
-    &=\sum\limits_{i,j}
-    \left(
-      \q{
-        \qeffect[name={\(w_j^{\dagger}\)}]\n
-        \qbox[name={\(f\)}]\n
-        \qstate[name={\(v_i\)}]\n
-      }\q{
-        \qstate[name={\(w_j\)}]\n
-        \qeffect[name={\(v_i^{\dagger}\)}]
-      }
-    \right)
-    =\sum\limits_{i,j}\left(
-      \q{
-        \qscalar[name={\(w_j^{\dagger}\circ f\circ v_i\)}]
-      }
-      \q{
-        \qstate[name={\(w_j\)}]\n
-        \qeffect[name={\(v_i^{\dagger}\)}]
-      }
-    \right)\\
-    &=\begin{pmatrix}
-      \q{\qscalar[name={\(w_1^{\dagger}\circ f\circ v_1\)}]}&&\cdots&&\q{\qscalar[name={\(w_1^{\dagger}\circ f\circ v_{m}\)}]}\\
-      &\ddots&&&\\        
-      \vdots& &\q{\qscalar[name={\(w_j^{\dagger}\circ f\circ v_i\)}]}& &\vdots\\
-      &&&\ddots&\\
-      \q{\qscalar[name={\(w_n^{\dagger}\circ f\circ v_1\)}]}&&\cdots&&\q{\qscalar[name={\(w_n^{\dagger}\circ f\circ v_m\)}]}
-    \end{pmatrix}
-  \end{align*}
-\end{CODEBOX}
-
-\subsection{Monoid Object}
-\label{sub:monoid}
-\begin{itemize}
-  \item \texttt{\textbackslash qmul}: \(\q[scale=0.5]{\qmul}\)
-    \iitem \texttt{hlen=2}: \(\q[scale=0.5]{\qmul[hlen=2]}\)
-  \item \texttt{\textbackslash qcomul}: \(\q[scale=0.5]{\qcomul}\)
-    \iitem \texttt{hlen=2}: \(\q[scale=0.5]{\qcomul[hlen=2]}\)
-  \item \texttt{\textbackslash qunit}: \(\q[scale=0.5]{\qunit}\)
-  \item \texttt{\textbackslash qcounit}: \(\q[scale=0.5]{\qcounit}\)
-  \item \texttt{\textbackslash qspider}: \(\q[scale=0.5]{\qspider}\)
-\end{itemize}
-
-\begin{CODEBOX}{Associativity}{AssociateLaw}
-  \begin{equation}
-    \label{law:associate}
-    \q{
-        \qspace[0.5]\qmul[hlen=2]\n
-        \qmul[hlen=2]\qspace[-0.5]\qwire
-    }=\q{
-        \qmul[hlen=2]\n
-        \qwire\qspace[-0.5]\qmul[hlen=2]
-    }
-  \end{equation}
-\end{CODEBOX}
-  \begin{CODEBOX}{Unitality}{UnitLaw}
-  \begin{equation}
-    \label{law:unit}
-    \q{
-        \qmul[hlen=2]\n
-        \qwire\qunit
-    }=\q{\qwire[vlen=2]}
-    =\q
-    {
-        \qmul[hlen=2]\n
-        \qunit\qwire
-    }
-  \end{equation}
-\end{CODEBOX}
-\begin{CODEBOX}{Coassociativity}{CoassociateLaw}
-  \begin{equation}
-    \label{law:coassociate}
-    \q{
-        \qcomul[hlen=2]\qspace[-0.5]\qwire\n
-        \qspace[0.5]\qcomul[hlen=2]
-        }
-    =\q{
-        \qwire\qspace[-0.5]\qcomul[hlen=2]\n
-        \qcomul[hlen=2]
-    }
-  \end{equation}
-\end{CODEBOX}
-\begin{CODEBOX}{Counitality}{CounitLaw}
-  \begin{equation}
-    \label{law:counit}
-    \q{
-        \qcounit\qwire\n
-        \qcomul[hlen=2]
-        }
-    =\q{\qwire[vlen=2]}
-    =\q{
-        \qwire\qcounit\n
-        \qcomul[hlen=2]
-    }
-  \end{equation}
-\end{CODEBOX}
-
-\subsubsection{Frobenius Law}
-\begin{FCODEBOX}{Frobenius Law}{FrobeniusLaw}
-    \[
-      \q{
-        \qwire\qmul[color=black]\n
-        \qcomul\qwire
-      }=\q{
-        \qcomul\n
-        \qmul[color=black]
-      }=\q{
-        \qmul[color=black]\qwire\n
-        \qwire\qcomul
-      }
-    \]
-  \end{FCODEBOX}
-  Although it is mentioned as a ``Failure Example'', in reality, the Frobenius law is accurately described. 
-  Rather, since the spacing between all the wires is maintained as integer values, adjustment during vertical composition becomes easier, and in some cases, no adjustment may be necessary. 
-  This is merely a matter of preference. 
-  The default drawing results of \verb|\qmul| and \verb|\qcomul|, which are \q[scale=0.5]{\qmul} and \q[scale=0.5]{\qcomul}, are remnants of the default drawing results of \verb|\qbox[s=2]| and \verb|\qbox[n=2]|, which are \q[scale=0.5]{\qbox[s=2]} and \q[scale=0.5]{\qbox[n=2]}. 
-  For adjustments in such cases, the adjustment key \verb|hlen| is available:
-  \begin{CODEBOX}{Frobenius Law}{FrobeniusLaw2}
-    \[
-      \q{
-        \qwire\qmul[hlen=2,color=black]\n
-        \qcomul[hlen=2]\qwire
-      }=\q{
-        \qcomul[hlen=2]\n
-        \qmul[hlen=2,color=black]
-      }=\q{
-        \qmul[hlen=2,color=black]\qwire\n
-        \qwire\qcomul[hlen=2]
-      }
-    \]
-  \end{CODEBOX}
-  The command \verb|\qspider| is the same as \verb|\qbox|, except that the nodes are circles rather than boxes.
-  \begin{codebox}{}{spider202503240521}
-    \[\q{\qspider}\]
-    \[\q{\qspider[n=0]}\]
-    \[\q{\qspider[n=0,s=4]}\]
-    \[\q{\qspider[n=2,s=4]}\]
-    \[\q{\qspider[N={1,4},s=4]}\]
-    \[\q{\qspider[N={2,3},s=4]}\]
-    \[\q{\qspider[p=3,N={2},S={1,3}]}\]
-    \[\q{\qspider[p=3,N={2},S={1,3},hlen=2]}\]
-    \[\q{\qspider[n=1,s=2,hlen=2]}\]
-  \end{codebox}
-
-  \begin{CODEBOX}{}{spider202503270738}
-    \[
-      \q{
-        \qspider[n=2, s=4, hlen=4]\qwire\qwire\n
-        \qwire\qwire\qspider[n=4, s=2, hlen=4]
-      }
-      =\q{\qspider[p=4]}\]
-  \end{CODEBOX}
-
-\subsection{Braiding}
-\label{sub:braidedcategory}
-\begin{itemize}
-  \item \texttt{\textbackslash qbraid}: \(\q[scale=0.5]{\qbraid}\)
-  \item \texttt{\textbackslash qbraidinv}: \(\q[scale=0.5]{\qbraidinv}\)
-  \item \texttt{\textbackslash qsym}: \(\q[scale=0.5]{\qsym}\)
-\end{itemize}
-
-\paragraph{\texttt{num L} and \texttt{num R}}
-
-For the commands \verb|\qbraid|, \verb|\qbraidinv|, and \verb|\qsym|, \texttt{num L} specifies the number of wires on the left side, and \texttt{num R} specifies the number of wires on the right side. 
-For example, specifies \texttt{num L=3} and \texttt{num R=2} will result in the diagram \q{\qbraid[num L=3, num R=2]}. 
-The default value for both is \(1\).
-
-\begin{CODEBOX}{Hexagon Equations}{hexagon}
-  \begin{equation}
-    \label{eq:hexagon}
-    \q
-    {
-      \qbraid[num R=2,,hlen=2,vlen=2]
-    }
-    =
-    \q
-    {
-      \qwire\qbraid\n
-      \qbraid\qwire
-    }
-    \qquad
-    \q
-    {
-      \qbraid[num L=2,,hlen=2,vlen=2]
-    }
-    =
-    \q
-    {
-      \qbraid\qwire\n
-      \qwire\qbraid
-    }
-  \end{equation}
-\end{CODEBOX}
-\paragraph{\({\q[scale=0.5]{\qbraid}}^{-1}=\q[scale=0.5]{\qbraidinv}\)}
-\begin{CODEBOX}{}{braidisom2}
-  \begin{equation}
-    \label{eq:inverse:braid}
-    \q
-    {
-      \qbraidinv\n
-      \qbraid
-    }
-    =
-    \q
-    {
-      \qwire[vlen=2]\qwire[vlen=2]
-    }
-    \qquad
-    \q
-    {
-      \qbraid\n
-      \qbraidinv
-    }
-    =
-    \q
-    {
-      \qwire[vlen=2]\qwire[vlen=2]
-    }
-  \end{equation}
-\end{CODEBOX}
-\begin{CODEBOX}{Naturality of the Braid (Being a Natural Transformation)}{braidnatural}
-  \begin{equation}
-    \label{cond:naturality:braid}
-    \q
-    {
-      \qbraid\n
-      \qbox[name={\(f\)}]\qbox[name={\(g\)}]
-    }
-    =
-    \q
-    {
-      \qbox[name={\(g\)}]\qbox[name={\(f\)}]\n
-      \qbraid
-    }
-    \qquad
-    \q
-    {
-      \qbraidinv\n
-      \qbox[name={\(f\)}]\qbox[name={\(g\)}]
-    }
-    =
-    \q
-    {
-      \qbox[name={\(g\)}]\qbox[name={\(f\)}]\n
-      \qbraidinv
-    }
-  \end{equation}
-\end{CODEBOX}
-
-For the commands \verb|\qbraid|, \verb|\qbraidinv|, and \verb|\qasym|, specifying \texttt{num R=0} results in a dashed line for the right wire, as shown in \q[scale=0.65]{\qbraid[num R=0]}. 
-Similarly, specifying \texttt{num L=0} results in a dashed line for the left wire, as shown in \q[scale=0.65]{\qbraid[num L=0]}. 
-This is due to representing the unit object as an empty diagrams, i.e., a diagram with \(0\) wires.
-\begin{CODEBOX}{}{stateeffect3dimbraid}
-  \begin{gather}
-    \q{
-      \qwire\qstate\n
-      \qwire
-    }
-    =\q{
-      \qwire\qstate\n
-      \qbraid[num L=0]
-    }\stackrel{\text{(\ref{cond:naturality:braid})}}{=}\q{
-      \qbraid\n
-      \qstate\qwire
-    }\label{iso:u:state}\\
-    \q{
-      \qunitob\qwire\n
-      \qeffect\qwire
-    }
-    =\q{
-      \qbraid[num L=0]\n
-      \qeffect\qwire
-    }\stackrel{\text{(\ref{cond:naturality:braid})}}{=}\q{
-      \qwire\qeffect\n
-      \qbraid
-    }\label{iso:u:effect}
-  \end{gather}
-\end{CODEBOX}
-\begin{CODEBOX}{}{iso:spatial:scalar}
-  \begin{equation}
-    \label{iso:spatial}
-    \q{\qscalar\qmv[0,-1]\qwire[vlen=3]}
-    =\q{\qbraid[num L=0]\n\qscalar\qmv[0,-1]\qwire[vlen=2]}
-    \stackrel{\text{(\ref{cond:naturality:braid})}}{=}
-    \q{\qwire[vlen=2]\qscalar\n\qbraid[num L=0]}
-    =\q{\qscalar\qmv[-2,-1]\qwire[vlen=3]}
-  \end{equation}
-\end{CODEBOX}
-\begin{CODEBOX}{}{iso:spatial:state.effect}
-  \[
-    \q{\qscalar\qmv[0,-1]\qwire[vlen=3]}
-    =\q{\qeffect\n\qstate\qmv[0,-0.5]\qwire[vlen=3]}
-    \stackrel{\text{(\ref{iso:u:effect})}}{=}
-    \q{\qwire\qeffect\n\qbraid\n\qstate\qwire}
-    \stackrel{\text{(\ref{iso:u:state})}}{=}
-    \q{\qeffect\n\qstate\qmv[-2,-0.5]\qwire[vlen=3]}
-    =\q{\qscalar\qmv[-2,-1]\qwire[vlen=3]}
-  \]
-\end{CODEBOX}
-\paragraph{\(\q[scale=0.5]{\qbraid\qwire\n\qwire\qstate[n=2]}=\q[scale=0.5]{\qwire\qbraidinv\n\qstate[n=2]\qwire}\)}
-\begin{CODEBOX}{}{dashedbraid}
-  \begin{align}
-    \q
-    {
-      \qbraid\qwire\n
-      \qwire\qstate[n=2]
-    }
-    &=\q
-    {
-      \qbraid\qwire\n
-      \qwire\qstate[n=2]\n\n
-      \qbraidinv[num L=0,vlen=2,hlen=2.5]
-    }
-    \stackrel{\text{(\ref{cond:naturality:braid})}}{=}\q
-    {
-      \qbraid\qwire\n\n
-      \qbraidinv[num L=2,vlen=2]\n
-      \qstate[n=2]\qwire\n
-      \qspace[0.5]\qwire[arrowtype={densely dotted}]\qspace[0.5]\qwire
-    }\\
-    &=\q
-    {
-      \qbraid\qwire\n\n
-      \qbraidinv[num L=2,vlen=2]\n
-      \qstate[n=2]\qwire\n
-      \qspace[2]\qwire
-      \qbb[green][3]
-    }\stackrel{\text{(\ref{eq:hexagon})}}{=}\q
-    {
-      \qbraid\qwire\n
-      \qbraidinv\qwire\n
-      \qwire\qbraidinv\n
-      \qstate[n=2]\qwire\n
-      \qspace[2]\qwire
-      \qbb[green][3,...,6]
-    }\\
-    &=\q
-    {
-      \qbraid\qwire\n
-      \qbraidinv\qwire\n
-      \qwire\qbraidinv\n
-      \qstate[n=2]\qwire\n
-      \qspace[2]\qwire
-      \qbb[orange][1,3]
-    }
-    \stackrel{\text{(\ref{eq:inverse:braid})}}{=}\q
-    {
-      \qloop[2]{\qloop[3]{\qwire}\n}
-      \qwire\qbraidinv\n
-      \qstate[n=2]\qwire\n
-      \qspace[2]\qwire
-      \qbb[orange][1,2,4,5]
-    }
-  \end{align}
-\end{CODEBOX}
-
-\begin{CODEBOX}{Yang-Baxer Equation}{YangBaxer}
-  \[
-    \q
-    {
-      \qbraid\qwire\n
-      \qwire\qbraid\n
-      \qbraid\qwire
-    }=\q
-    {
-      \qwire\qbraid\n
-      \qbraid\qwire\n
-      \qwire\qbraid
-    }
-  \]
-\end{CODEBOX}
-
-\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{Commutativity}{def:cmt}
-  \begin{equation}
-    \label{cond:cmt}
-    \q{\qmul[hlen=2]}=\q{\qmul[hlen=2]\n\qbraid}
-  \end{equation}
-\end{codebox}
-\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{Cocommutativity}{def:ccmt}
-  \begin{equation}
-    \label{cond:ccmt}
-    \q{\qcomul[hlen=2]}=\q{\qbraid\n\qcomul[hlen=2]}
-  \end{equation}
-\end{codebox}
-\subsubsection{Bialgebra}
-\begin{CODEBOX}{Bialgebra Law}{law:bialgebra}
-  \begin{gather}
-    \q{\qcomul[hlen=2]\qcirc\qmul[hlen=2, color=black]}
-    =\q{
-      \qmul[hlen=2, color=black]\qmul[hlen=2, color=black]\n
-      \qwire\qbraid\qwire\n\qcomul[hlen=2]\qcomul[hlen=2]
-      }\\
-    \q{\qspace[0.5]\qcounit\qcirc\qmul[hlen=2, color=black]}
-    =\q{\qcounit\qcounit}\\
-    \q{\qcomul[hlen=2]\qcirc\qspace[0.5]\qunit[color=black]}
-    =\q{\qunit[color=black]\qunit[color=black]}\\
-    \q{\qcounit\n\qunit[color=black]}
-    =\q{\qunitob}
-  \end{gather}
-\end{CODEBOX}
-\subsubsection{Hopf Algebra}
-\begin{CODEBOX}{Antipode and Hopf Algebra}{law:hopf}
-  \begin{equation}
-    \q{
-      \qmul[hlen=2, color=black]\n
-      \qwire\qbox[name={\(s\)}]\n
-      \qcomul[hlen=2]
-    }
-    =\q{\qunit[color=black]\qcirc\qcounit}
-    =\q{
-      \qmul[hlen=2, color=black]\n
-      \qbox[name={\(s\)}]\qwire\n
-      \qcomul[hlen=2]
-    }
-  \end{equation}
-\end{CODEBOX}
-\subsubsection{Balanced Structure}
-\label{subsub:balancedcategory}
-\begin{CODEBOX}{Twist}{def:twist}
-  \begin{gather}
-    \q{
-      \qbox[name={\(\theta_{X\otimes Y}\)}, p=2]
-      \symbolI{\(X\)}\symbolI[2]{\(Y\)}
-      \symbolO{\(X\)}\symbolO[2]{\(Y\)}
-    }
-    =\q{
-      \qbox[name={\(\theta_X\)}]\qbox[name={\(\theta_Y\)}]\n
-      \qbraid\n\qbraid
-    }\label{cond:twist}\\
-    \q{\qbox[name={\(\theta_I\)}]}=\q{\qunitob}\label{cond:i:twist}\\
-    \forall\q{\qbox[name={\(f\)}]}\colon
-    \q{
-      \qbox[name={\(\theta_{\operatorname{cod}(f)}\)}, hlen=1.5]\n
-      \qbox[name={\(f\)}, hlen=1.5]
-    }=\q{
-      \qbox[name={\(f\)}, hlen=1.5]\n
-      \qbox[name={\(\theta_{\operatorname{dom}(f)}\)}, hlen=1.5]
-    }\label{cond:naturality:twist}
-  \end{gather}
-\end{CODEBOX}
-\subsubsection{Trivial Balanced Structure, Symmetric Monoidal Category}
-\label{subsub:symmetry}
-\begin{codebox}[center lower,listing side text,righthand width=5cm,bicolor,colbacklower=white]{Symmetry}{defeq:sym}
-  \begin{equation}
-    \label{cond:symmetry}
-    \q
-    {
-      \qbraid\n
-      \qbraid
-    }
-    =\q{\qloop[2]{\qwire[vlen=2]}}
-  \end{equation}
-\end{codebox}
-\begin{codebox}{}{wowsym}
-  \[\q{\qbraid}=\q{\qbraidinv}\]
-\end{codebox}
-\begin{codebox}{Symmetry}{def:sym}
-  \q{\qsym}
-\end{codebox}
-
-\subsection{Duality}
-\label{subsub:duality}
-\begin{itemize}
-  \item \texttt{\textbackslash qcap}: \(\q[scale=0.6]{\qcap}\)
-  \item \texttt{\textbackslash qcup}: \(\q[scale=0.6]{\qcup}\)
-  \item \texttt{\textbackslash qcaprev}: \(\q[scale=0.6]{\qcaprev}\)
-  \item \texttt{\textbackslash qcuprev}: \(\q[scale=0.6]{\qcuprev}\)
-\end{itemize}
-
-\begin{CODEBOX}{Snake Equations}{Snake}
-  \begin{equation}
-    \label{eq:snake}
-    \q{
-      \qcap\qwireup\n
-      \qwireup\qcup
-    }
-    =\q{
-      \qwireup[vlen=2]
-    }
-    \qquad\land\qquad
-    \q{
-      \qwiredown\qcap\n
-      \qcup\qwiredown
-    }
-    =\q{
-      \qwiredown[vlen=2]
-    }
-  \end{equation}        
-\end{CODEBOX}
-
-\subsubsection{Transpose Box}
-\label{subsub:transpose}
-\begin{CODEBOX}{Transpose}{Transpose}
-  \[
-    \left(\q{\qwire\n\qasym[name={\(f\)}]\n\qwire}\right)^T
-    =\q{
-      \qwire\n
-      \qtrans[name={\(f\)}]\n
-      \qwire
-    }\coloneq\q{
-      \qwire\qcap\n
-      \qwire\qasym[name={\(f\)}]\qwire\n
-      \qcup\qwire
-    }
-  \]
-\end{CODEBOX}
-
-\begin{CODEBOX}{}{ex:202504021826}
-  \begin{equation}
-    \label{eq:wirerev}
-    \left(\q{\qwireup}\right)^T=\q{\qwiredown}
-  \end{equation}
-\end{CODEBOX}
-
-\begin{CODEBOX}{Sliding}{Sliding}
-  \begin{equation}
-    \label{eq:sliding}
-    \q
-    {
-      \qcap \n
-      \qasym \qwire
-    }
-    =
-    \q
-    {
-      \qcap \n
-      \qwire \qtrans
-    }
-    \qquad
-    \q
-    {
-      \qwire\qasym \n
-      \qcup
-    }
-    =
-    \q
-    {
-      \qtrans \qwire \n
-      \qcup
-    }
-  \end{equation}
-\end{CODEBOX}
-
-\begin{CODEBOX}{}{MapStateDuality}
-  \begin{equation}
-    \begin{array}{rccc}
-      \operatorname{NAME}\colon & \operatorname{Hom}(X,Y)
-      & \to & \operatorname{Hom}(I,X^T\otimes Y)\\
-      & \rotatebox{90}{\(\in\)} && \rotatebox{90}{\(\in\)}\\
-      & \q{
-        \qasym
-        \symbolI{\(X\)}
-        \symbolO{\(Y\)}
-      } & \mapsto 
-      & \q{
-        \qwire[label={\(X^T\)}, label at={at end}, label side={above}] \qasym \n
-        \qcup
-        \symbolO{\(Y\)}[id=2]
-      }
-    \end{array}
-  \end{equation}
-\end{CODEBOX}
-
-\begin{CODEBOX}{}{MapEffectDuality}
-  \begin{equation}
-    \begin{array}{rccc}
-      \operatorname{CONAME}\colon & \operatorname{Hom}(X,Y) 
-      & \to & \operatorname{Hom}(X\otimes Y^T,I)\\
-      & \rotatebox{90}{\(\in\)}&&\rotatebox{90}{\(\in\)}\\
-      & \q{
-        \qasym
-        \symbolI{\(X\)}
-        \symbolO{\(Y\)}
-      } & \mapsto 
-      & \q{
-        \qcap \n
-        \qasym \qwire[label={\(Y^T\)}, label at={at start}, label side={below}]
-        \symbolI{\(X\)}[id=2]
-      }
-    \end{array}
-  \end{equation}
-\end{CODEBOX}
-
-\subsubsection{No Cloning Theorem}
-\label{subsub:nocopy}
-\begin{CODEBOX}{Uniform Copying}{def:copy}
-  \begin{gather}
-    \q{
-      \qwire\qbraid\qwire\n
-      \qcomul[hlen=2, name={\(\operatorname{copy}_X\)}]\qcomul[hlen=2, name={\(\operatorname{copy}_Y\)}]
-      \symbolI{\(X\)}[id=4]\symbolI{\(Y\)}[id=5]
-      \symbolO{\(X\)}[id=1]\symbolO{\(Y\)}[id=2]
-      \symbolO[2]{\(X\)}[id=2]\symbolO{\(Y\)}[id=3]
-    }=\q{
-      \qcomul[hlen=3, vlen=2, name={\(\operatorname{copy}_{X\otimes Y}\)}]\symbolI{\(X\otimes Y\)}
-      \symbolO{\(X\otimes Y\)}\symbolO[2]{\(X\otimes Y\)}
-    }\label{cond:copy}\\
-    \forall\q{\qbox[name={\(f\)}]\symbolI{\(X\)}\symbolO{\(Y\)}}\colon
-    \q{
-      \qbox[name={\(f\)}]\qbox[name={\(f\)}]\n
-      \qcomul[hlen=2, name={\(\operatorname{copy}_X\)}]
-    }=\q{
-      \qcomul[hlen=2, name={\(\operatorname{copy}_Y\)}]\n
-      \qspace[0.5]\qbox[name={\(f\)}]
-    }\label{cond:morcopy}\\
-    \q{
-      \qcomul[hlen=2, name={\(\operatorname{copy}_I\)}]\symbolI{\(I\)}
-      \symbolO{\(I\)}\symbolO[2]{\(I\)}
-    }=\q{\qunitob}\label{cond:i:copy}
-  \end{gather}
-\end{CODEBOX}
-
-\begin{CODEBOX}{Copyable State}{def:copyablestate}
-  \[
-    \q{
-      \qcomul[hlen=2, name={\(\operatorname{copy}\)}]\n
-      \qspace[0.5]\qstate[name={\(a\)}]
-    }=\q{
-      \qstate[name={\(a\)}]\qstate[name={\(a\)}]
-    }
-  \]
-\end{CODEBOX}
-\begin{CODEBOX}{}{len:copycupcup}
-  \begin{align*}
-    \q{\qcup\qcup}&\stackrel{\text{(\ref{cond:i:copy})}}{=}
-    \q{
-      \qcup\qcup\n\qmv[0.5,0.4]
-      \qcomul[dom arrowtype=dotted, cod arrowtype=dotted, hlen=3, name={\(\operatorname{copy}\)}]
-    }\stackrel{\text{(\ref{cond:morcopy})}}{=}
-    \q{
-      \qspider[
-        name={\(\operatorname{copy}\)}, 
-        N={1,2,4,5}, 
-        s=2, 
-        hlen=2
-      ]\n\qcup
-    }\\
-    &\stackrel{\text{(\ref{cond:copy})}}{=}\q{
-        \qwire\qbraid\qwire\n
-        \qloop[4]{\qwire}\n
-        \qcomul[hlen=2, name={\(\operatorname{copy}\)}]\qcomul[hlen=2]\n
-        \qspace[0.5]\qcup[hlen=3]
-        \qbb[red][4,8]
-    }\stackrel{\text{(\ref{cond:ccmt})}}{=}\q{
-        \qwire\qbraid\qwire\n
-        \qbraidinv\qwire\qwire\n
-        \qcomul[hlen=2]\qcomul[hlen=2]\n
-        \qspace[0.5]\qcup[hlen=3]
-        \qbb[red][4,7]
-      }\\
-      &=\q{
-        \qwire\qbraid\qwire\n
-        \qbraidinv\qwire\qwire\n[2]
-        \qloop[4]{\qwire[vlen=2]}\n
-        \qloop[2]{\qcomul[hlen=2, name={\(\operatorname{copy}\)}]}\n
-        \qspace[0.5]\qcup[hlen=3]
-        \qbb[blue][8,9]
-      }
-      \stackrel{\text{(\ref{eq:inverse:braid})}}{=}
-      \q{
-        \qwire\qbraid\qwire\n
-        \qbraidinv\qwire\qwire\n
-        \qwire\qbraidinv\qwire\n
-        \qwire\qbraid\qwire\n
-        \qloop[2]{\qcomul[hlen=2, name={\(\operatorname{copy}\)}]}\n
-        \qspace[0.5]\qcup[hlen=3]
-        \qbb[blue][8,11]
-      }\\
-      &=\q{
-        \qwire\qbraid\qwire\n
-        \qbraidinv\qwire\qwire\n
-        \qwire\qbraidinv\qwire\n
-        \qwire\qbraid\qwire\n
-        \qloop[2]{\qcomul[hlen=2, name={\(\operatorname{copy}\)}]}\n
-        \qspace[0.5]\qcup[hlen=3]
-        \qbb[yellow][10,14,15]
-      }\stackrel{\text{(\ref{cond:copy}, \ref{cond:morcopy}, \ref{cond:i:copy})}}{=}
-      \q{
-        \qwire\qbraid\qwire\n
-        \qbraidinv\qwire\qwire\n
-        \qwire\qbraidinv\qwire\n
-        \qcup\qcup
-        \qbb[yellow][10,11]
-      }\\
-      &=\q{
-        \qwire\qbraid\qwire\n
-        \qcup[n=4]
-      }
-  \end{align*}
-\end{CODEBOX}
-\begin{CODEBOX}{}{len:copybraid}
-  \begin{align*}
-    \q{
-      \qbraid
-      \symbolI{\(X\)}\symbolO{\(X\)}
-      \symbolI[2]{\(X\)}\symbolO[2]{\(X\)}
-    }&\stackrel{\text{(\ref{eq:snake})}}{=}\q{
-      \qwire\qspace[2]\qcap\qwire\n
-      \qbraid[hlen=4]\qwire\qwire\n
-      \qwire\qcap\qwire\qcup\n
-      \qwire\qwire\qcup
-      \qbb[blue][1,5]
-    }\\
-    &=\q{
-      \qcap[hlen=4]\qwire\n
-      \qwire\qspace[2]\qbraidinv\n
-      \qwire\qcap\qwire\qwire\qwire[vlen=3]\n
-      \qwire\qwire\qcup\qcup
-      \qbb[blue][1,4]
-      \qbb[yellow][12,13]
-    }\\
-    &\stackrel{\text{Example \ref{len:copycupcup}}}{=}\q{
-      \qcap[hlen=4]\qwire\n
-      \qwire\qspace[2]\qbraidinv\n
-      \qwire\qcap\qwire\qwire\qwire[vlen=3]\n
-      \qwire\qwire\qwire\qbraid\qwire\n
-      \qwire\qwire\qcup[n=4]
-      \qbb[yellow][12,14,17]
-    }\\
-    &=\q{
-      \qcap[s=4]\qwire\n
-      \qloop[3]{\qwire}\qbraidinv\n
-      \qloop[3]{\qwire}\qbraid\qwire[vlen=3]\n
-      \qwire\qwire\qcup[n=4]
-      \qbb[green][6,10]
-    }\\
-    &\stackrel{\text{(\ref{eq:inverse:braid})}}{=}\q{
-      \qcap[s=4]\qwire\qwire\n[2]
-      \qloop[6]{\qwire[vlen=2]}\n
-      \qwire\qwire\qcup[n=4]
-      \qbb[green][7,8]
-    }\\
-    &\stackrel{\text{(\ref{eq:snake})}}{=}\q{
-      \qwire\qwire
-      \symbolI{\(X\)}[id=1]\symbolO{\(X\)}[id=1]
-      \symbolI{\(X\)}\symbolO{\(X\)}
-    }
-  \end{align*}
-\end{CODEBOX}
-
-\begin{CODEBOX}{No Cloning Theorem}{thm:nocopy}
-  \begin{align*}
-    \q{
-      \qasym[name={\(f\)}]
-      \symbolI{\(X\)}\symbolO{\(X\)}
-    }&\stackrel{\text{(\ref{eq:snake})}}{=}
-    \q{
-      \qcap\qasym[name={\(f\)}]\n
-      \qwire\qcup
-    }\stackrel{\text{(\ref{eq:inverse:braid})}}{=}\q{
-      \qcap\qasym[name={\(f\)}]\n
-      \qwire\qbraidinv\n
-      \qwire\qbraid\n
-      \qwire\qcup
-    }\\
-    &\stackrel{\text{(\ref{cond:naturality:braid})}}{=}\q{
-      \qcap\qwire\n
-      \qwire\qbraidinv\n
-      \qwire\qasym[name={\(f\)}]\qwire\n
-      \qwire\qbraid\n
-      \qwire\qcup
-      \qbb[red][1,4]
-    }=\q{
-      \qwire\qcap\n
-      \qbraid\qwire\n
-      \qwire\qasym[name={\(f\)}]\qwire\n
-      \qwire\qbraid\n
-      \qwire\qcup
-      \qbb[red][1,4]
-    }\\
-    &=\q{
-      \qwire\qcap\n
-      \qbraid\qwire\n
-      \qwire\qasym[name={\(f\)}]\qwire\n
-      \qwire\qbraid\n
-      \qwire\qcup
-      \qbb[blue][3]
-    }\stackrel{\text{Example \ref{len:copybraid}}}{=}\q{
-      \qwire\qcap\n
-      \qwire\qwire\qwire\n
-      \qwire\qasym[name={\(f\)}]\qwire\n
-      \qwire\qbraid\n
-      \qwire\qcup
-      \qbb[blue][3,4]
-    }
-  \end{align*}
-\end{CODEBOX}
-\subsection{Pivotal Category}
-\label{sub:pivotal}
-\begin{CODEBOX}{}{struct:Pivotal}
-  \begin{equation}
-    \label{cond:naturality:pivotal}
-    \forall\q{\qasym[name={\(f\)}]\symbolI{\(X\)}\symbolO{\(Y\)}}\colon
-    \q[scale=0.5]{
-      \qwire\qcap[s=4]\n
-      \qwire\qwire\qasym[name={\(f\)}]\qwire\qwire\n
-      \qcup[n=4]\qwire\qmv[-1,-1]\qasym[name={\(\pi_X\)}]
-    }=\q{
-        \qasym[name={\(\pi_Y\)}]\n
-        \qasym[name={\(f\)}]
-    }
-  \end{equation}
-\end{CODEBOX}
-\begin{CODEBOX}{}{dualrev}
-  \begin{equation}
-    \label{def:dualrev}
-    \q{
-      \qcaprev\n
-      \symbolI{\(X^T\)}\symbolI[2]{\(X\)}
-    }\coloneq\q
-    {
-      \qcap \n
-      \qwire \qwireupup \n
-      \qwire \qasym[name={\(\pi_x\)}] \n
-    }\qquad\q{
-      \qcuprev
-      \symbolO{\(X\)}\symbolO[2]{\(X^T\)}
-    }\coloneq\q
-    {
-      \qasym[name={\(\pi_X^{-1}\)}]\qwire\n
-      \qwireupup\qwire\n
-      \qcup
-    }
-  \end{equation}
-\end{CODEBOX}
-\begin{CODEBOX}{}{revSliding}
-  \begin{equation}
-    \label{eq:sliding:rev}
-    \q{
-      \qcaprev\n
-      \qtrans\qwire\n
-    }=\q{
-      \qcaprev\n
-      \qwire\qasym
-    }\qquad\q{
-      \qwire\qtrans\n
-      \qcuprev
-    }=\q{
-      \qasym\qwire\n
-      \qcuprev
-    }
-  \end{equation}
-\end{CODEBOX}
-\begin{CODEBOX}{}{corr:pivotal:twist}
-  \begin{gather}
-    \q{
-      \qwireuu[label={\(X^{**}\)}]\n
-      \qasym[name={\(\pi_X\)}]\n
-      \qwireup[label={\(X\)}]
-    }=\q{
-      \qwireuu[label={\(X^{**}\)}]\qcap\n
-      \qbraid\qwired[label={\(X^T\)}]\n
-      \qasym[name={\(\theta_X^{-1}\)}]\qcuprev\n
-      \qwireup[label={\(X\)}]
-    }\label{twist:pivotal}\\
-    \q{
-      \qwireup[label={\(X\)}]\n
-      \qasym[name={\(\theta_X\)}]\n
-      \qwireup[label={\(X\)}]
-    }=\q{
-      \qwireup[label={\(X\)}]\n
-      \qasym[name={\(\pi_X^{-1}\)}]\n
-      \qwireuu[label={\(X^{**}\)}]\qcap\n
-      \qbraid\qwired[label={\(X^T\)}]\n
-      \qwire[label={\(X\)}]\qcuprev
-    }\label{pivotal:twist}
-  \end{gather}
-\end{CODEBOX}
-
-\subsubsection{Trace}
-\label{subsub:trace}
-\begin{CODEBOX}{Trace}{Trdef}
-  \[
-    \begin{array}{rccc}
-      \operatorname{Tr}\colon & \operatorname{Hom}(X,X) & \to &\operatorname{Hom}(I,I)\\
-      &\rotatebox{90}{\(\in\)}&&\rotatebox{90}{\(\in\)}\\
-      &\q{
-        \qasym[name={\(f\)}]
-      } & \mapsto & \q{
-        \qcap\n
-        \qasym[name={\(f\)}]\qwire\n
-        \qcuprev
-      }
-    \end{array}
-  \]
-\end{CODEBOX}
-\begin{CODEBOX}{Commutativity of the Trace}{Cotr}
-  \begin{equation}
-    \label{cmt:trace}
-    \operatorname{Tr}\left(\q{
-      \qasym[name={\(g\)}]\n
-      \qasym[name={\(f\)}]
-      }\right)
-    =\q{
-      \qcap\n
-      \qasym[name={\(g\)}]\qwire\n
-      \qasym[name={\(f\)}]\qwire\n
-      \qcuprev
-      }
-    \stackrel{\text{(\ref{eq:sliding})}}{=}\q{
-      \qcap\n
-      \qasym[name={\(f\)}]\qtrans[name={\(g\)}]\n
-      \qcuprev
-    }\stackrel{\text{(\ref{eq:sliding:rev})}}{=}\q{
-      \qcap\n
-      \qasym[name={\(f\)}]\qwire\n
-      \qasym[name={\(g\)}]\qwire\n
-      \qcuprev
-    }=\operatorname{Tr}\left(\q{
-      \qasym[name={\(f\)}]\n
-      \qasym[name={\(g\)}]
-      }\right)
-  \end{equation}
-\end{CODEBOX}
-\begin{CODEBOX}{Dimension}{def:dim}
-  \[
-    \q{\qscalar[name={\(\operatorname{dim}(X)\)}]}
-    \coloneq\q{\qscalar[name={\(\operatorname{Tr}(\operatorname{id}_X)\)}]}
-    =\q{\qcap\n\qcuprev}
-  \]
-\end{CODEBOX}
-\subsection{Dagger}
-\label{sub:dagger}
-\subsubsection{Adjoint Box}
-\label{subsub:adjoint}
-\begin{CODEBOX}{Adjoint}{def:adj}
-  \begin{gather}
-    \left(
-      \q{
-        \qasym[name={\(f\)}]
-        \symbolI{\(X\)}\symbolO{\(Y\)}
-      }
-    \right)^{\dagger}
-    \coloneq
-    \q{
-      \qadj[name={\(f\)}]
-      \symbolI{\(Y\)}\symbolO{\(X\)}
-    }\\
-    \left(\q{\qasym[name={\(f\)}]}\right)^{\dagger\dagger}
-    =\left(\q{\qadj[name={\(f\)}]}\right)^{\dagger}
-    =\q{\qasym[name={\(f\)}]}\\
-    \left(\q{\qwire}\right)^{\dagger}=\q{\qwire}\\
-    \q{
-      \qadj[name={\(f\)}]\n
-      \qadj[name={\(g\)}]
-    }=\q{
-      \qadj[name={\(g\circ f\)}]
-    }
-\end{gather}
-\end{CODEBOX}
-\subsubsection{Conjugate Box}
-\label{subsub:conj}
-\begin{CODEBOX}{}{prep:conj}
-  \begin{align*}
-    \left(\q{\qadj}\right)^T
-    &=\q{
-      \qwire\qcap\n
-      \qwire\qadj\qwire\n
-      \qcup\qwire
-    }=\q{
-      \qcaprev\qwire\n
-      \qwire\qadj\qwire\n
-      \qwire\qcuprev
-    }=\left(
-      \q{
-        \qwire\qcap\n
-        \qwire\qasym\qwire\n
-        \qcup\qwire
-      }
-    \right)^{\dagger}=\left(\q{\qtrans}\right)^{\dagger}
-  \end{align*}
-\end{CODEBOX}
-\section{List of Primitive Diagrams}
-\label{sec:fcommands}
-      \begin{tcbraster}[raster columns=4,raster equal height=rows,fonttitle=\bfseries,
-        colframe=cyan!90,coltitle=cyan!50,colbacktitle=black,
-        subtitle style={boxrule=0.4pt,
-        colback=black!70,
-        colupper=cyan!50}
-        ]
-        \def\mortype{射}
-        \def\AoE{舞台}
-        \def\RMK{備考}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qwire}]
-          \[\q{\qwire}\]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qbox}]
-          \[
-            \q{
-              \qbox
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qstate}]
-          \[
-            \q{
-              \qstate
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qeffect}]
-          \[
-            \q{
-              \qeffect
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qscalar}]
-          \[
-            \q{
-              \qscalar
-              }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qunitob}]
-          \[
-            \q{
-              \qunitob
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qmul}]
-          \[
-            \q{
-              \qmul[hlen=2]
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qcomul}]
-          \[
-            \q{
-              \qcomul[hlen=2]
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qunit}]
-          \[
-            \q{
-              \qunit
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qcounit}]
-          \[
-            \q{
-              \qcounit
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qspider}]
-          \[
-            \q{
-              \qspider[p=4,hlen=2]
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qbraid}]
-          \[
-            \q{
-                \qbraid
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qbraidinv}]
-          \[
-            \q{
-              \qbraidinv
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qsym}]
-          \[
-            \q{
-              \qsym
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qcap}]
-          \[
-            \q{
-              \qcap
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qcup}]
-          \[
-            \q{
-              \qcup
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qwireu}]
-          \[\q{\qwireup}\]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qwired}]
-          \[\q{\qwiredown}\]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qwireuu}]
-          \[\q{\qwireuu}\]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qwiredd}]
-          \[\q{\qwiredd}\]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qasym}]
-          \[
-            \q{
-              \qasym
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qtrans}]
-          \[
-            \q{
-              \qtrans
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash adj}]
-          \[
-            \q{
-              \qadj
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qconj}]
-          \[
-            \q{
-              \qconj
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qcaprev}]
-          \[
-            \q{
-              \qcaprev
-            }
-          \]
-        \end{tcolorbox}
-        \begin{tcolorbox}[adjusted title=\texttt{\textbackslash qcuprev}]
-          \[
-            \q{
-              \qcuprev
-            }
-          \]
-        \end{tcolorbox}
-      \end{tcbraster}
-      \addcontentsline{toc}{section}{References}
-      \begin{thebibliography}{99}
-        \bibitem{tikz-manual}
-        Till Tantau,
-        \textit{The TikZ and PGF Packages Manual for Version 3.1.10},
-        Institut für Theoretische Informatik, Universität zu Lübeck,
-        n.d.,
-        \url{https://github.com/pgf-tikz/pgf}
-        (retrieved March 22, 2025).
-        \bibitem{geniussorting}
-        Anonymous,
-        \textit{Genius Sorting Algorithm},
-        4chan Programming Board,
-        January 20, 2011,
-        \url{https://dis.4chan.org/read/prog/1295544154}
-        (accessed January 20, 2011; link currently inactive).
-        \bibitem{gfxhatena}
-        gfx,
-        \textit{Joushiki wo kutsugaesu so-to arugorizumu! Sono na mo "sleep sort"!},
-        Hatena Diary,
-        May 19, 2011,
-        \url{https://gfx.hatenadiary.org/entry/20110519/1305810786}.
-        \bibitem{literateprograms}
-        LiteratePrograms,
-        \textit{Turing Machine Simulator in \LaTeX},
-        \url{https://literateprograms.org/turing_machine_simulator__latex_.html},
-        n.d.,
-        retrieved March 22, 2025.
-        \bibitem{overleaf}
-        Overleaf,
-        \textit{\LaTeX\ is More Powerful than You Think: Computing the Fibonacci Numbers and Turing Completeness},
-        \url{https://www.overleaf.com/learn/latex/Articles/LaTeX_is_More_Powerful_than_you_Think_-_Computing_the_Fibonacci_Numbers_and_Turing_Completeness},
-        n.d.,
-        retrieved March 22, 2025.
-      \end{thebibliography}
-      \section*{Change Log}
-      \subsection*{1.1.0 (2025-04-03)}
-      \paragraph{The following commands have been updated.}
-      \begin{itemize}
-        \item \texttt{\textbackslash symbolI}
-        \item \texttt{\textbackslash symbols}
-        \item \texttt{\textbackslash symbolS}
-        \item \texttt{\textbackslash symbolO}
-        \item \texttt{\textbackslash symboln}
-        \item \texttt{\textbackslash symbolN}
-      \end{itemize}
-      The ID, which was previously a required argument for these commands, has been made optional. 
-      Users can now specify the ID via an optional key, allowing for more flexible usage of the commands.
-      \begin{itemize}
-        \item Old format: \texttt{\textbackslash symbolI[i]\{ID\}\{text\}[above right]}
-        \item New format: \texttt{\textbackslash symbolI[i]\{text\}[above right, id=ID]}
-      \end{itemize}
-      \paragraph{English documentation has been added to the package.}
-      \subsection*{1.0.0 (2025-04-01)}
-      \paragraph{Initial release.}
-      \section*{License and Copyright}
-
-      This package is distributed under the \textbf{LaTeX Project Public License (LPPL)}, version 1.3c or later.  
-      For details, see \url{https://www.latex-project.org/lppl.txt}.
-      
-      Copyright \textcopyright 2025 Niina Ryota
-      
-      You are free to distribute and modify this package under the terms of LPPL.  
-      However, any modified versions \textbf{must not} be distributed under the original name, and the original author must be credited.
-\end{document}

Modified: trunk/Master/texmf-dist/tex/latex/qworld/qworld.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/qworld/qworld.sty	2025-04-14 19:50:58 UTC (rev 74943)
+++ trunk/Master/texmf-dist/tex/latex/qworld/qworld.sty	2025-04-14 19:51:45 UTC (rev 74944)
@@ -1,3 +1,4 @@
+%% === qworld.sty ===
 %% A LaTeX package for typesetting string diagrams in various categorical structures, including monoidal, dagger compact closed, rigid, braided, symmetric, and compact categories.
 %% Copyright (C) 2025 Niina Ryota
 %% 
@@ -13,30 +14,58 @@
 %% This work consists of the following files:
 %%   qworld.sty
 %%   qworld.pdf
+%%   qworld.tex
+%%   qworld_en.tex
+%%   qworld_en.pdf
+%% ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+%% Modification Policy
+%% - Any modifications must not be distributed under the original package name.
+%% - Any modified versions must clearly state that they are derived from this package.
+%% - The original author (Niina Ryota) must always be credited in derived works.
+%% ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 %% Change Log
-%% -----------
+%% Version 1.1.1 (2025-04-14)
+%% - Color annotation for wires and tangles
+%%   - The frame color attribute is now supported for CAP and CUP structures, allowing wires to express object identity through color.
+%%   - Additionally BRAIDING now supports separate L color and R color options for independently coloring the left and right wires.
+%% - Improved wire rendering
+%%   - The rendering of curves has been refined to produce smoother and more aesthetically coherent diagrams.
 %%
 %% Version 1.1.0 (2025-04-03)
-%% - The following commands have been updated:
-%%   - \symbolI, \symbols \symbolS, \symbolO, \symboln \symbolN.
-%% - The ID, which was previously a required argument for these commands, has been made optional.
-%% - Users can now specify the ID via an optional key, providing more flexibility when using the commands.
-%% - English documentation has been added to the package.
+%% - Argument structure revised for symbol commands
+%%   - The following commands were updated to support key-value-style optional arguments instead of mandatory positional arguments:
+%%     - \symbolI
+%%     - \symbols
+%%     - \symbolS
+%%     - \symbolO
+%%     - \symboln
+%%     - \symbolN
+%%   - Specific changes:
+%%     - Old format: \symbolI[i]{ID}{text}[position options]
+%%     - New format: \symbolI[i]{text}[position opotions, id=ID]
+%%   - With this revision, the ID parameter is now optional. In simple cases, \symbolI{text} suffices. This change enables more concise and readable definitions.
+%% - English documentation
+%%   - An English version of the user guide has been added.
+%%
 %% Version 1.0.0 (2025-04-01)
-%% - Initial release of the package.
-\ProvidesPackage{qworld}[2025/04/03 Version 1.1.0]
+%% - Initial release.
+%% ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{qworld}[2025/04/14 Version 1.1.1]
 \RequirePackage{tikz, pgffor, ifthen, xparse, xfp, xstring}
 \usetikzlibrary{cd,positioning,shapes.symbols,decorations.pathmorphing,arrows,calc,shapes.misc,intersections,decorations.pathreplacing,decorations.markings,arrows.meta, shapes.geometric}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newif\ifflowup
-\newif\ifflowdown
-\newif\ifflowleft
-\newif\ifflowright
+\makeatletter
+
+\newif\if at qworld@flow at up
+\newif\if at qworld@flow at down
+\newif\if at qworld@flow at left
+\newif\if at qworld@flow at right
 % Default: bottom-to-top (flow up)
-\flowuptrue
-\flowdownfalse
-\flowleftfalse
-\flowrightfalse
+\@qworld at flow@uptrue
+\@qworld at flow@downfalse
+\@qworld at flow@leftfalse
+\@qworld at flow@rightfalse
 
 \newif\ifsimplify
 \simplifytrue
@@ -43,279 +72,321 @@
 \DeclareOption{simplify=false}{
     \simplifyfalse
 }
-\DeclareOption{flow direction=up}{
-    \flowuptrue
-    \flowdownfalse
-    \flowleftfalse
-    \flowrightfalse
+
+\def\qworld at rotate@angle{0}
+\def\qworld at yscale@value{1}
+\def\qworld at symbol@output{above}
+\def\qworld at symbol@input{below}
+\def\qworld at wire@label at side{right}
+\def\qworld at boundingbox@symbol at side{right}
+
+\DeclareOption{up}{
+    \@qworld at flow@uptrue
+    \@qworld at flow@downfalse
+    \@qworld at flow@leftfalse
+    \@qworld at flow@rightfalse
+    \def\qworld at rotate@angle{0}
+    \def\qworld at yscale@value{1}
+    \def\qworld at symbol@output{above}
+    \def\qworld at symbol@input{below}
+    \def\qworld at wire@label at side{right}
+    \def\qworld at boundingbox@symbol at side{right}
 }
-\DeclareOption{flow direction=down}{
-    \flowupfalse
-    \flowdowntrue
-    \flowleftfalse
-    \flowrightfalse
+\DeclareOption{down}{
+    \@qworld at flow@upfalse
+    \@qworld at flow@downtrue
+    \@qworld at flow@leftfalse
+    \@qworld at flow@rightfalse
+    \def\qworld at rotate@angle{0}
+    \def\qworld at yscale@value{-1}
+    \def\qworld at symbol@output{below}
+    \def\qworld at symbol@input{above}
+    \def\qworld at wire@label at side{right}
+    \def\qworld at boundingbox@symbol at side{right}
 }
-\DeclareOption{flow direction=left}{
-    \flowupfalse
-    \flowdownfalse
-    \flowlefttrue
-    \flowrightfalse
+\DeclareOption{left}{
+    \@qworld at flow@upfalse
+    \@qworld at flow@downfalse
+    \@qworld at flow@lefttrue
+    \@qworld at flow@rightfalse
+    \def\qworld at rotate@angle{90}
+    \def\qworld at yscale@value{1}
+    \def\qworld at symbol@output{left}
+    \def\qworld at symbol@input{right}
+    \def\qworld at wire@label at side{above}
+    \def\qworld at boundingbox@symbol at side{below}
 }
-\DeclareOption{flow direction=right}{%
-    \flowupfalse
-    \flowdownfalse
-    \flowleftfalse
-    \flowrighttrue
+\DeclareOption{right}{%
+    \@qworld at flow@upfalse
+    \@qworld at flow@downfalse
+    \@qworld at flow@leftfalse
+    \@qworld at flow@righttrue
+    \def\qworld at rotate@angle{-90}
+    \def\qworld at yscale@value{1}
+    \def\qworld at symbol@output{right}
+    \def\qworld at symbol@input{left}
+    \def\qworld at wire@label at side{above}
+    \def\qworld at boundingbox@symbol at side{below}
 }
+
+\newcommand{\qworld at diagram}[2][]{
+    \ifmmode
+        {\vcenter{\hbox{
+            \begin{tikzpicture}[rotate=\qworld at rotate@angle, yscale=\qworld at yscale@value, #1]
+                \setcounter{qworldnumeros}{1}
+                \qworld at reset
+                #2
+                \qworld at reset
+            \end{tikzpicture}
+        }}}
+    \else
+        \({\vcenter{\hbox{
+            \begin{tikzpicture}[rotate=\qworld at rotate@angle, yscale=\qworld at yscale@value, #1]
+                \setcounter{qworldnumeros}{1}
+                \qworld at reset
+                #2
+                \qworld at reset
+            \end{tikzpicture}
+        }}}\)
+    \fi
+}
+
+\DeclareOption*{
+  \PackageWarning{qworld}{Unknown option `\CurrentOption'}
+}
+
 \ProcessOptions\relax
 \AtEndOfPackage{
     \ifsimplify
-        \qwsimplify
+        \qworld at simplify
     \fi
 }
-\newcounter{portNnum}
-\newcounter{portSnum}
-\newcounter{portNtempnum}
-\newcounter{portStempnum}
-\newcounter{bbcount}
+\newcounter{qworld at box@port at num@N}
+\newcounter{qworld at box@port at num@S}
+\newcounter{qworld at box@port at num@N at temp}
+\newcounter{qworld at box@port at num@S at temp}
+\newcounter{qworld at boundingbox@count}
 \newcounter{qworldnumeros}\setcounter{qworldnumeros}{1}
-
-\newcommand{\qwreset}[1][0,0]
+\newcommand{\qworld at reset}[1][0,0]
 {
     \coordinate (qworldat) at (#1);
 }
 
-\newcommand{\qwbr}[1][1]
+\newcommand{\qworld at linebreak}[1][1]
 {
-    \coordinate (O) at (0,0);
+    \coordinate (qworldtempO) at (0,0);
     \coordinate (qworldattemp) at ([shift={(0,{\fpeval{-1*#1}})}]qworldat);
-    \coordinate (qworldat) at (O |- qworldattemp);
+    \coordinate (qworldat) at (qworldtempO |- qworldattemp);
 }
 
-\newcommand{\qwmove}[1][0,0]
+\newcommand{\qworld at move}[1][0,0]
 {
     \coordinate (qworldattemp) at ([shift={{\fpeval{(#1)}}}]qworldat);
     \coordinate (qworldat) at (qworldattemp);
 }
 
-\newcommand{\qwspace}[1][1]
+\newcommand{\qworld at space}[1][1]
 {
-    \qwmove[#1,0]
+    \qworld at move[#1,0]
 }
 
-\def\qwepsilony{0.2}
-\def\qwepsilonx{0}
-\def\qwinnersep{3.1415926536pt}
-\def\qwcontrolepsilon{0.5}
-\def\qwfillrate{0.13}
-\def\qwfillratex{0.37}
-\def\qwasymrate{0.05}
-\def\qwasymstress{2.5}
-\def\qwvelocityx{0}
-\def\qwvelocityy{0.2}
-\def\qwthickness{semithick}
-\def\qwspideradjust{1}
-\def\qwireinterval{1}
-\def\qcanvasslantstyle{notentered}
-\def\qwcompariaccu{1000}
+\def\qworld at box@fillrate at vertical{0.175}
+\def\qworld at box@fillrate at horizontal{0.37}
+\def\qworld at velocity@x{0}
+\def\qworld at velocity@y{0.85}
+\def\qworld at thickness{thick}
+\def\qworld at box@spider at adjust{1}
+\def\qworld at wire@interval{1}
+\def\qworld at compare@accuracy{1000}
 
-\newcommand{\qwtext}[2]
+\newcommand{\qworld at text}[2]
 {
     \node at (#2) {#1};
 }
 
-\NewDocumentCommand{\qwid}{O{}}
+\NewDocumentCommand{\qworld at id}{O{}}
 {
-    \qwidprocess[#1]
+    \qworld at id@process[#1]
 }
 
-\NewDocumentCommand{\qwbox}{O{at=qworldat}}{
-    \qwboxprocess[box]{#1}
+\NewDocumentCommand{\qworld at box}{O{at=qworldat}}
+{
+    \qworld at box@process[box]{#1}
 }
 
-\NewDocumentCommand{\qwasymbox}{O{at=qworldat}}{
-    \qwboxprocess[asym]{#1}
+\NewDocumentCommand{\qworld at box@asymmetry}{O{at=qworldat}}
+{
+    \qworld at box@process[asym]{#1}
 }
 
-\NewDocumentCommand{\qwadjbox}{O{at=qworldat}}{
-    \qwboxprocess[adj]{#1}
+\NewDocumentCommand{\qworld at box@adjoint}{O{at=qworldat}}
+{
+    \qworld at box@process[adj]{#1}
 }
 
-\NewDocumentCommand{\qwtransposebox}{O{at=qworldat}}{
-    \qwboxprocess[transpose]{#1}
+\NewDocumentCommand{\qworld at box@transpose}{O{at=qworldat}}
+{
+    \qworld at box@process[transpose]{#1}
 }
 
-\NewDocumentCommand{\qwconjbox}{O{at=qworldat}}{
-    \qwboxprocess[conj]{#1}
+\NewDocumentCommand{\qworld at box@conjugate}{O{at=qworldat}}
+{
+    \qworld at box@process[conj]{#1}
 }
 
 
-\NewDocumentCommand{\qwscalar}{O{at=qworldat}}{
-    \qwboxprocess[scalar]{p=0,#1}
+\NewDocumentCommand{\qworld at box@scalar}{O{at=qworldat}}
+{
+    \qworld at box@process[scalar]{p=0,#1}
 }
 
-\NewDocumentCommand{\qwstate}{O{at=qworldat}}{
-    \qwboxprocess[state]{s=0,#1}
+\NewDocumentCommand{\qworld at box@state}{O{at=qworldat}}
+{
+    \qworld at box@process[state]{s=0,#1}
 }
 
-\NewDocumentCommand{\qweffect}{O{at=qworldat}}{
-    \qwboxprocess[effect]{n=0,#1}
+\NewDocumentCommand{\qworld at box@effect}{O{at=qworldat}}
+{
+    \qworld at box@process[effect]{n=0,#1}
 }
 
-\NewDocumentCommand{\qwbraid}{O{at=qworldat}}{
-    \qwboxprocess[braid]{#1}
+\NewDocumentCommand{\qworld at box@braid}{O{at=qworldat}}
+{
+    \qworld at box@process[braid]{#1}
 }
 
-\NewDocumentCommand{\qwbraidinv}{O{at=qworldat}}{
-    \qwboxprocess[braidinv]{#1}
+\NewDocumentCommand{\qworld at box@braid at inv}{O{at=qworldat}}
+{
+    \qworld at box@process[braidinv]{#1}
 }
 
-\NewDocumentCommand{\qwsymmetry}{O{at=qworldat}}{
-    \qwboxprocess[sym]{#1}
+\NewDocumentCommand{\qworld at box@symmetry}{O{at=qworldat}}
+{
+    \qworld at box@process[sym]{#1}
 }
 
-\NewDocumentCommand{\qwidup}{O{at=qworldat}}{
-    \qwidprocess[arrowtype=->-, #1]
+\NewDocumentCommand{\qworld at idup}{O{at=qworldat}}
+{
+    \qworld at id@process[arrowtype=->-, #1]
 }
 
-\NewDocumentCommand{\qwiddown}{O{at=qworldat}}
+\NewDocumentCommand{\qworld at iddown}{O{at=qworldat}}
 {
-    \qwidprocess[arrowtype=-<-, #1]
+    \qworld at id@process[arrowtype=-<-, #1]
 }
 
-\NewDocumentCommand{\qwidupup}{O{at=qworldat}}
+\NewDocumentCommand{\qworld at idupup}{O{at=qworldat}}
 {
-    \qwidprocess[arrowtype=->>-, #1]
+    \qworld at id@process[arrowtype=->>-, #1]
 }
 
-\NewDocumentCommand{\qwiddowndown}{O{at=qworldat}}
+\NewDocumentCommand{\qworld at iddowndown}{O{at=qworldat}}
 {
-    \qwidprocess[arrowtype=-<<-, #1]
+    \qworld at id@process[arrowtype=-<<-, #1]
 }
 
-\NewDocumentCommand{\qwcap}{O{at=qworldat}}
+\NewDocumentCommand{\qworld at box@cap}{O{at=qworldat}}
 {
-    \qwboxprocess[cap]{#1}
+    \qworld at box@process[cap]{#1}
 }
 
-\NewDocumentCommand{\qwcup}{O{at=qworldat}}
+\NewDocumentCommand{\qworld at box@cup}{O{at=qworldat}}
 {
-    \qwboxprocess[cup]{#1}
+    \qworld at box@process[cup]{#1}
 }
 
-\NewDocumentCommand{\qwcaprev}{O{at=qworldat}}
+\NewDocumentCommand{\qworld at box@cap at reverse}{O{at=qworldat}}
 {
-    \qwboxprocess[caprev]{#1}
+    \qworld at box@process[caprev]{#1}
 }
 
-\NewDocumentCommand{\qwcuprev}{O{at=qworldat}}
+\NewDocumentCommand{\qworld at box@cup at reverse}{O{at=qworldat}}
 {
-    \qwboxprocess[cuprev]{#1}
+    \qworld at box@process[cuprev]{#1}
 }
 
-\NewDocumentCommand{\qwmul}{O{at={qworldat}}}
+\NewDocumentCommand{\qworld at box@multiplication}{O{at={qworldat}}}
 {
-     \qwboxprocess[spider]{s=2,n=1,#1}
+     \qworld at box@process[spider]{s=2,n=1,#1}
 }
 
-\NewDocumentCommand{\qwunit}{O{at={qworldat}}}
+\NewDocumentCommand{\qworld at box@unit}{O{at={qworldat}}}
 {
-     \qwboxprocess[spider]{s=0,n=1,#1}
+     \qworld at box@process[spider]{s=0,n=1,#1}
 }
-\NewDocumentCommand{\qwcounit}{O{at={qworldat}}}
+\NewDocumentCommand{\qworld at box@counit}{O{at={qworldat}}}
 {
-     \qwboxprocess[spider]{s=1,n=0,#1}
+     \qworld at box@process[spider]{s=1,n=0,#1}
 }
 
-\NewDocumentCommand{\qwcomul}{O{at={qworldat}}}
+\NewDocumentCommand{\qworld at box@comultiplication}{O{at={qworldat}}}
 {
-    \qwboxprocess[spider]{s=1,n=2,#1}
+    \qworld at box@process[spider]{s=1,n=2,#1}
 }
 
-\NewDocumentCommand{\qwspider}{O{at={qworldat}}}
+\NewDocumentCommand{\qworld at box@spider}{O{at={qworldat}}}
 {
-    \qwboxprocess[spider]{#1}
+    \qworld at box@process[spider]{#1}
 }
 
-\newcommand{\qwdiagram}[2][]{
-    \ifmmode
-        {\vcenter{\hbox{
-                \begin{tikzpicture}[#1]
-                    \setcounter{qworldnumeros}{1}
-                    \qwreset
-                    #2
-                    \qwreset
-                \end{tikzpicture}
-        }}}
-    \else
-        \({\vcenter{\hbox{
-            \begin{tikzpicture}[#1]
-                \setcounter{qworldnumeros}{1}
-                \qwreset
-                #2
-                \qwreset
-            \end{tikzpicture}
-        }}}\)
-    \fi
+\newcommand{\qworld at canvas}[2][]{
+    \qworld at diagram[#1]{#2}
 }
 
-\newcommand{\qwcanvas}[2][]{
-    \qwdiagram[#1]{#2}
-}
-
-\NewDocumentCommand{\qwbb}{O{notentered} O{notentered}}{
+\NewDocumentCommand{\qworld at boundingbox}{O{notentered} O{notentered}}
+{
     \ifthenelse{\equal{#2}{notentered}}
     {
         \ifthenelse{\equal{#1}{notentered}}{
-            \def\BBcolor{}
-            \def\BBP{1}
+            \def\qworld at boundingbox@color{}
+            \def\qworld at boundingbox@ids{1}
         }{
-            \def\BBcolor{}
-            \def\BBP{#1}
+            \def\qworld at boundingbox@color{}
+            \def\qworld at boundingbox@ids{#1}
         }
     }{
-        \def\BBcolor{#1}
-        \def\BBP{#2}
+        \def\qworld at boundingbox@color{#1}
+        \def\qworld at boundingbox@ids{#2}
     }
   
-    \setcounter{bbcount}{0}
-    \foreach \i in \BBP{
-        \stepcounter{bbcount}
+    \setcounter{qworld at boundingbox@count}{0}
+    \foreach \qworldindex in \qworld at boundingbox@ids{
+        \stepcounter{qworld at boundingbox@count}
     }
 
-    \def\minX{10000}\def\maxX{-10000}
-    \def\minY{10000}\def\maxY{-10000}
-    \foreach \hogaku in {NE, NW, SE, SW}{
-        \foreach \qwindex in \BBP {
-            \path let \p1 = (\hogaku-\qwindex)
+    \def\qworld at boundingbox@X at minimum{10000}\def\qworld at boundingbox@X at maximum{-10000}
+    \def\qworld at boundingbox@Y at minimum{10000}\def\qworld at boundingbox@Y at maximum{-10000}
+    \foreach \qworlddirection in {NE, NW, SE, SW}{
+        \foreach \qworldindex in \qworld at boundingbox@ids {
+            \path let \p1 = (\qworlddirection-\qworldindex)
             in \pgfextra
             {
-                \xdef\px{\x1} 
-                \xdef\py{\y1}
+                \xdef\qworldcoordx{\x1} 
+                \xdef\qworldcoordy{\y1}
             };
-            \xdef\minX{\fpeval{min(\minX, \px/1pt)}}
-            \xdef\minY{\fpeval{min(\minY, \py/1pt)}}
-            \xdef\maxX{\fpeval{max(\maxX, \px/1pt)}}
-            \xdef\maxY{\fpeval{max(\maxY, \py/1pt)}}
+            \xdef\qworld at boundingbox@X at minimum{\fpeval{min(\qworld at boundingbox@X at minimum, \qworldcoordx/1pt)}}
+            \xdef\qworld at boundingbox@Y at minimum{\fpeval{min(\qworld at boundingbox@Y at minimum, \qworldcoordy/1pt)}}
+            \xdef\qworld at boundingbox@X at maximum{\fpeval{max(\qworld at boundingbox@X at maximum, \qworldcoordx/1pt)}}
+            \xdef\qworld at boundingbox@Y at maximum{\fpeval{max(\qworld at boundingbox@Y at maximum, \qworldcoordy/1pt)}}
         }
     }
-    \ifnum\thebbcount=1
-        \foreach \i in \BBP{
+    \ifnum\theqworld at boundingbox@count=1
+        \foreach \qworldboundingboxid in \qworld at boundingbox@ids{
             \ifthenelse{\equal{#2}{notentered}}{
-                \draw[densely dotted, \BBcolor] (NW-\i) -- (NE-\i) -- (SE-\i) -- (SW-\i) --cycle;
+                \draw[densely dotted, \qworld at boundingbox@color] (NW-\qworldboundingboxid) -- (NE-\qworldboundingboxid) -- (SE-\qworldboundingboxid) -- (SW-\qworldboundingboxid) --cycle;
             }{
-                \draw[densely dotted, fill=#1, fill opacity=0.3] (NW-\i) -- (NE-\i) -- (SE-\i) -- (SW-\i) --cycle;
+                \draw[densely dotted, fill=#1, fill opacity=0.3] (NW-\qworldboundingboxid) -- (NE-\qworldboundingboxid) -- (SE-\qworldboundingboxid) -- (SW-\qworldboundingboxid) --cycle;
             }
         }
     \else
         \ifthenelse{\equal{#2}{notentered}}{
-            \draw[densely dotted, \BBcolor] (\minX pt,\minY pt) rectangle (\maxX pt,\maxY pt);%
+            \draw[densely dotted, \qworld at boundingbox@color] (\qworld at boundingbox@X at minimum pt,\qworld at boundingbox@Y at minimum pt) rectangle (\qworld at boundingbox@X at maximum pt,\qworld at boundingbox@Y at maximum pt);%
         }{
-            \draw[densely dotted, fill=#1, fill opacity=0.3] (\minX pt,\minY pt) rectangle (\maxX pt,\maxY pt);%
+            \draw[densely dotted, fill=#1, fill opacity=0.3] (\qworld at boundingbox@X at minimum pt,\qworld at boundingbox@Y at minimum pt) rectangle (\qworld at boundingbox@X at maximum pt,\qworld at boundingbox@Y at maximum pt);%
         }
     \fi
-    \coordinate (BB-NE) at (\maxX pt, \maxY pt);
-    \coordinate (BB-SW) at (\minX pt, \minY pt);
+    \coordinate (BB-NE) at (\qworld at boundingbox@X at maximum pt, \qworld at boundingbox@Y at maximum pt);
+    \coordinate (BB-SW) at (\qworld at boundingbox@X at minimum pt, \qworld at boundingbox@Y at minimum pt);
     \coordinate (BB-NW) at (BB-SW |- BB-NE);
     \coordinate (BB-SE) at (BB-SW -| BB-NE);
     \coordinate (BB-N) at ($(BB-NW)!0.5!(BB-NE)$);
@@ -325,40 +396,42 @@
     \coordinate (BB-C) at ($(BB-N)!0.5!(BB-S)$);
 }
 
-\newcommand{\qwbball}[1][notentered]{
+\newcommand{\qworld at boundingbox@all}[1][notentered]
+{
     \ifthenelse{\equal{#1}{notentered}}{
-        \foreach\j in{1,...,\theqworldnumeros}
+        \foreach\qworldboundingboxallidnum in {1,...,\theqworldnumeros}
         {
-            \ifnum\j<\theqworldnumeros
-                \qwbb[\j]
+            \ifnum\qworldboundingboxallidnum<\theqworldnumeros
+                \qworld at boundingbox[\qworldboundingboxallidnum]
             \fi
         }
     }{
-        \foreach\j in{1,...,\theqworldnumeros}{
-            \ifnum\j<\theqworldnumeros
-                \qwbb[#1][\j]
+        \foreach\qworldboundingboxallidnum in {1,...,\theqworldnumeros}{
+            \ifnum\qworldboundingboxallidnum<\theqworldnumeros
+                \qworld at boundingbox[#1][\qworldboundingboxallidnum]
             \fi
         }
     }
 }
 
-\NewDocumentCommand{\qwbbsymbol}{O{E} m O{right}}
+\NewDocumentCommand{\qworld at boundingbox@symbol}{O{E} m O{\qworld at boundingbox@symbol at side}}
 {
     \node[#3] at (BB-#1) {#2};
 }
 
-\newcommand{\qwBBall}[1][notentered]{
+\newcommand{\qworld at BoundingBox@all}[1][notentered]
+{
     \addtocounter{qworldnumeros}{-1}
     \ifthenelse{\equal{#1}{notentered}}{
-        \qwbb[1,...,\theqworldnumeros]
+        \qworld at boundingbox[1,...,\theqworldnumeros]
     }{
-        \qwbb[#1][1,...,\theqworldnumeros]
+        \qworld at boundingbox[#1][1,...,\theqworldnumeros]
     }
     \stepcounter{qworldnumeros}
 }
 
-\newcommand{\qwloop}[2][1]{
-    \foreach \i in {1,...,#1}
+\newcommand{\qworld at loop}[2][1]{
+    \foreach \qworldindex in {1,...,#1}
     {
         #2
     }
@@ -460,7 +533,8 @@
     }
 }
 
-\newcommand{\qwPhantomArrow}[2][>]{
+\newcommand{\qworld at Arrow@Phantom}[2][>]
+{
   \tikzset{
         phantomarrow/.style={
         decoration={markings, mark=at position #2 with {\arrow{#1}}},
@@ -468,363 +542,291 @@
     }
   }
 }
-\def\qworiginalarrow{\qwPhantomArrow}
-\newcommand{\qwsimplify}{
+\def\qworiginalarrow{\qworld at Arrow@Phantom}
+\newcommand{\qworld at simplify}{
     \ifdefined\qid
     \else
-        \def\qid{\qwid}
+        \def\qid{\qworld at id}
     \fi
     \ifdefined\qwire
     \else
-        \def\qwire{\qwid}
+        \def\qwire{\qworld at id}
     \fi
     \ifdefined\qbox
     \else
-        \def\qbox{\qwbox}
+        \def\qbox{\qworld at box}
     \fi
     \ifdefined\qasym
     \else
-        \def\qasym{\qwasymbox}
+        \def\qasym{\qworld at box@asymmetry}
     \fi
     \ifdefined\qasymbox
     \else
-        \def\qasymbox{\qwasymbox}
+        \def\qasymbox{\qworld at box@asymmetry}
     \fi
     \ifdefined\qadj
     \else
-        \def\qadj{\qwadjbox}
+        \def\qadj{\qworld at box@adjoint}
     \fi
     \ifdefined\qadjbox
     \else
-        \def\qadjbox{\qwadjbox}
+        \def\qadjbox{\qworld at box@adjoint}
     \fi
     \ifdefined\qtranspose
     \else
-        \def\qtranspose{\qwtransposebox}
+        \def\qtranspose{\qworld at box@transpose}
     \fi
     \ifdefined\qtransposebox
     \else
-        \def\qtransposebox{\qwtransposebox}
+        \def\qtransposebox{\qworld at box@transpose}
     \fi
     \ifdefined\qtrans
     \else
-        \def\qtrans{\qwtransposebox}
+        \def\qtrans{\qworld at box@transpose}
     \fi
     \ifdefined\qconj
     \else
-        \def\qconj{\qwconjbox}
+        \def\qconj{\qworld at box@conjugate}
     \fi
     \ifdefined\qconjbox
     \else
-        \def\qconjbox{\qwconjbox}
+        \def\qconjbox{\qworld at box@conjugate}
     \fi
     \ifdefined\qsc
     \else
-        \def\qsc{\qwscalar}
+        \def\qsc{\qworld at box@scalar}
     \fi
     \ifdefined\qwsc
     \else
-        \def\qwsc{\qwscalar}
+        \def\qwsc{\qworld at box@scalar}
     \fi
     \ifdefined\qscalar
     \else
-        \def\qscalar{\qwscalar}
+        \def\qscalar{\qworld at box@scalar}
     \fi
     \ifdefined\qstate
     \else
-        \def\qstate{\qwstate}
+        \def\qstate{\qworld at box@state}
     \fi
     \ifdefined\qeffect
     \else
-        \def\qeffect{\qweffect}
+        \def\qeffect{\qworld at box@effect}
     \fi
     \ifdefined\qbraid
     \else
-        \def\qbraid{\qwbraid}
+        \def\qbraid{\qworld at box@braid}
     \fi
     \ifdefined\qbraidinv
     \else
-        \def\qbraidinv{\qwbraidinv}
+        \def\qbraidinv{\qworld at box@braid at inv}
     \fi
     \ifdefined\qsymmetry
     \else
-        \def\qsymmetry{\qwsymmetry}
+        \def\qsymmetry{\qworld at box@symmetry}
     \fi
     \ifdefined\qsym
     \else
-        \def\qsym{\qwsymmetry}
+        \def\qsym{\qworld at box@symmetry}
     \fi
     \ifdefined\qidup
     \else
-        \def\qidup{\qwidup}
+        \def\qidup{\qworld at idup}
     \fi
     \ifdefined\qwireup
     \else
-        \def\qwireup{\qwidup}
+        \def\qwireup{\qworld at idup}
     \fi
     \ifdefined\qwireu
     \else
-        \def\qwireu{\qwidup}
+        \def\qwireu{\qworld at idup}
     \fi
     \ifdefined\qiddown
     \else
-        \def\qiddown{\qwiddown}
+        \def\qiddown{\qworld at iddown}
     \fi
     \ifdefined\qidown
     \else
-        \def\qidown{\qwiddown}
+        \def\qidown{\qworld at iddown}
     \fi
     \ifdefined\qwiredown
     \else
-        \def\qwiredown{\qwiddown}
+        \def\qwiredown{\qworld at iddown}
     \fi
     \ifdefined\qwired
     \else
-        \def\qwired{\qwiddown}
+        \def\qwired{\qworld at iddown}
     \fi
     \ifdefined\qwireupup
     \else
-        \def\qwireupup{\qwidupup}
+        \def\qwireupup{\qworld at idupup}
     \fi
     \ifdefined\qwireuu
     \else
-        \def\qwireuu{\qwidupup}
+        \def\qwireuu{\qworld at idupup}
     \fi
     \ifdefined\qwiredowndown
     \else
-        \def\qwiredowndown{\qwiddowndown}
+        \def\qwiredowndown{\qworld at iddowndown}
     \fi
     \ifdefined\qwiredd
     \else
-        \def\qwiredd{\qwiddowndown}
+        \def\qwiredd{\qworld at iddowndown}
     \fi
     \ifdefined\qcap
     \else
-        \def\qcap{\qwcap}
+        \def\qcap{\qworld at box@cap}
     \fi
     \ifdefined\qcup
     \else
-        \def\qcup{\qwcup}
+        \def\qcup{\qworld at box@cup}
     \fi
     \ifdefined\qcaprev
     \else
-        \def\qcaprev{\qwcaprev}
+        \def\qcaprev{\qworld at box@cap at reverse}
     \fi
     \ifdefined\qcuprev
     \else
-        \def\qcuprev{\qwcuprev}
+        \def\qcuprev{\qworld at box@cup at reverse}
     \fi
     \ifdefined\qmul
     \else
-        \def\qmul{\qwmul}
+        \def\qmul{\qworld at box@multiplication}
     \fi
     \ifdefined\qunit
     \else
-        \def\qunit{\qwunit}
+        \def\qunit{\qworld at box@unit}
     \fi
     \ifdefined\qcomul
     \else
-        \def\qcomul{\qwcomul}
+        \def\qcomul{\qworld at box@comultiplication}
     \fi
     \ifdefined\qcounit
     \else
-        \def\qcounit{\qwcounit}
+        \def\qcounit{\qworld at box@counit}
     \fi
     \ifdefined\qspider
     \else
-        \def\qspider{\qwspider}
+        \def\qspider{\qworld at box@spider}
     \fi
     \ifdefined\qunitobject
     \else
-        \def\qunitobject{\qwunitobject}
+        \def\qunitobject{\qworld at box@unitobject}
     \fi
     \ifdefined\qunitob
     \else
-        \def\qunitob{\qwunitobject}
+        \def\qunitob{\qworld at box@unitobject}
     \fi
     \ifdefined\qdiagram
     \else
-      \def\qdiagram{\qwdiagram}
+      \def\qdiagram{\qworld at diagram}
     \fi
     \ifdefined\qwpuzzle
     \else
-      \def\qwpuzzle{\qwdiagram}
+      \def\qwpuzzle{\qworld at diagram}
     \fi
     \ifdefined\qpuzzle
     \else
-      \def\qpuzzle{\qwdiagram}
+      \def\qpuzzle{\qworld at diagram}
     \fi
     \ifdefined\qpuz
     \else
-      \def\qpuz{\qwdiagram}
+      \def\qpuz{\qworld at diagram}
     \fi
     \ifdefined\qcanvas
     \else
-      \def\qcanvas{\qwcanvas}
+      \def\qcanvas{\qworld at canvas}
     \fi
     \ifdefined\qcv
     \else
-      \def\qcv{\qwcanvas}
+      \def\qcv{\qworld at canvas}
     \fi
     \ifdefined\q
     \else
-      \def\q{\qwcanvas}
+      \def\q{\qworld at canvas}
     \fi
     \ifdefined\Q
     \else
-        \def\Q{\qwcanvas}
+        \def\Q{\qworld at canvas}
     \fi
     \ifdefined\qbb
     \else
-        \def\qbb{\qwbb}
+        \def\qbb{\qworld at boundingbox}
     \fi
     \ifdefined\qbball
     \else
-        \def\qbball{\qwbball}
+        \def\qbball{\qworld at boundingbox@all}
     \fi
     \ifdefined\qBBall
     \else
-        \def\qBBall{\qwBBall}
+        \def\qBBall{\qworld at BoundingBox@all}
     \fi
     \ifdefined\qloop
     \else
-        \def\qloop{\qwloop}
+        \def\qloop{\qworld at loop}
     \fi
-    \ifdefined\qI
-    \else
-        \def\qI{\qwI}
-    \fi
-    \ifdefined\qs
-    \else
-        \def\qs{\qws}
-    \fi
-    \ifdefined\qS
-    \else
-        \def\qS{\qwS}
-    \fi
-    \ifdefined\qO
-    \else
-        \def\qO{\qwO}
-    \fi
-    \ifdefined\qn
-    \else
-        \def\qn{\qwn}
-    \fi
-    \ifdefined\qN
-    \else
-        \def\qN{\qwN}
-    \fi
-    \ifdefined\qshowI
-    \else
-        \def\qshowI{\qwI}
-    \fi
-    \ifdefined\qshows
-    \else
-        \def\qshows{\qws}
-    \fi
-    \ifdefined\qshowS
-    \else
-        \def\qshowS{\qwS}
-    \fi
-    \ifdefined\qshowO
-    \else
-        \def\qshowO{\qwO}
-    \fi
-    \ifdefined\qshown
-    \else
-        \def\qshown{\qwn}
-    \fi
-    \ifdefined\qshowN
-    \else
-        \def\qshowN{\qwN}
-    \fi
-    \ifdefined\showI
-    \else
-        \def\showI{\qwI}
-    \fi
-    \ifdefined\shows
-    \else
-        \def\shows{\qws}
-    \fi
-    \ifdefined\showS
-    \else
-        \def\showS{\qwS}
-    \fi
-    \ifdefined\showO
-    \else
-        \def\showO{\qwO}
-    \fi
-    \ifdefined\shown
-    \else
-        \def\shown{\qwn}
-    \fi
-    \ifdefined\showN
-    \else
-        \def\showN{\qwN}
-    \fi
     \ifdefined\symbolI
     \else
-        \def\symbolI{\qwI}
+        \def\symbolI{\qworld at Input}
     \fi
     \ifdefined\symbols
     \else
-        \def\symbols{\qws}
+        \def\symbols{\qworld at south}
     \fi
     \ifdefined\symbolS
     \else
-        \def\symbolS{\qwS}
+        \def\symbolS{\qworld at South}
     \fi
     \ifdefined\symbolO
     \else
-        \def\symbolO{\qwO}
+        \def\symbolO{\qworld at Output}
     \fi
     \ifdefined\symboln
     \else
-        \def\symboln{\qwn}
+        \def\symboln{\qworld at north}
     \fi
     \ifdefined\symbolN
     \else
-        \def\symbolN{\qwN}
+        \def\symbolN{\qworld at North}
     \fi
     \ifdefined\qbbsymbol
     \else
-        \def\qbbsymbol{\qwbbsymbol}
+        \def\qbbsymbol{\qworld at boundingbox@symbol}
     \fi
     \ifdefined\bbsymbol
     \else
-        \def\bbsymbol{\qwbbsymbol}
+        \def\bbsymbol{\qworld at boundingbox@symbol}
     \fi
     \ifdefined\qreset
     \else
-      \def\qreset{\qwreset}
+      \def\qreset{\qworld at reset}
     \fi
     \ifdefined\qbr
     \else
-        \def\qbr{\qwbr}
+        \def\qbr{\qworld at linebreak}
     \fi
     \ifdefined\xx
     \else
-        \def\xx{\qwbr}
+        \def\xx{\qworld at linebreak}
     \fi
     \ifdefined\n
     \else
-        \def\n{\qwbr}
+        \def\n{\qworld at linebreak}
     \fi
     \ifdefined\qcirc
     \else
-        \def\qcirc{\qwbr}
+        \def\qcirc{\qworld at linebreak}
     \fi
     \ifdefined\qspace
     \else
-        \def\qspace{\qwspace}
+        \def\qspace{\qworld at space}
     \fi
     \ifdefined\qmove
     \else
-        \def\qmove{\qwmove}
+        \def\qmove{\qworld at move}
     \fi
     \ifdefined\qmv
     \else
-        \def\qmv{\qwmove}
+        \def\qmv{\qworld at move}
     \fi
 }
 \pgfkeys{
@@ -844,7 +846,6 @@
     sv/.store in=\startvelocity,
     ev/.store in=\endvelocity,
     arrowtype/.store in=\wirearrowtype,
-    innersep/.store in=\wireinnersep,
     color/.store in=\wirecolor,
     internal invocation/.store in=\internalinvocation,
     vertical length/.store in=\wireverlen,
@@ -854,7 +855,7 @@
     dom/.default={qworldat},
     cod/.default={[shift={(0,1)}]qworldat},
     label/.default={},
-    label side/.default={right},
+    label side/.default={\qworld at wire@label at side},
     label at/.default={midway},
     label option/.default={right,midway},
     name/.default={notentered},
@@ -862,10 +863,9 @@
     name side/.default={notentered},
     name option/.default={notentered},
     id/.default={},
-    sv/.default={\qwvelocityx,\qwvelocityy},
-    ev/.default={\qwvelocityx,\qwvelocityy},
+    sv/.default={\qworld at velocity@x,\qworld at velocity@y},
+    ev/.default={\qworld at velocity@x,\qworld at velocity@y},
     arrowtype/.default={},
-    innersep/.default={5pt},
     color/.default={},
     internal invocation/.default={0},
     vertical length/.default={1},
@@ -872,15 +872,15 @@
     vlen/.default={notentered},
     slant style/.default={}
 }
-\newcommand{\qwidprocess}[1][]
+\newcommand{\qworld at id@process}[1][]
 {
     \pgfkeys{/qworld/wire/.cd, 
     at={}, dom={}, cod={}, 
-    label={}, label side={right},label at={midway}, label option={right,midway}, 
+    label={}, label side={\qworld at wire@label at side},label at={midway}, label option={right,midway}, 
     name={notentered}, name side={notentered}, name at={notentered}, name option={notentered},
     id={},
-    sv={\qwvelocityx,\qwvelocityy}, ev={\qwvelocityx,\qwvelocityy},
-    arrowtype={}, innersep={\qwinnersep}, color={}, internal invocation={0},
+    sv={\qworld at velocity@x,\qworld at velocity@y}, ev={\qworld at velocity@x,\qworld at velocity@y},
+    arrowtype={}, color={}, internal invocation={0},
     vertical length={1}, 
     vlen={notentered},
     slant style={},
@@ -909,7 +909,7 @@
     \ifx\wireat\empty
         \ifx\endpoint\empty
             \ifx\startpoint\empty
-                \coordinate (I-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qwireinterval}},0)}]qworldat);
+                \coordinate (I-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qworld at wire@interval}},0)}]qworldat);
             \else
                 \coordinate (I-\theqworldnumeros) at (\startpoint);          
             \fi
@@ -923,7 +923,7 @@
             \fi
         \fi
     \else
-        \coordinate (I-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qwireinterval}},0)}]\wireat);
+        \coordinate (I-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qworld at wire@interval}},0)}]\wireat);
         \ifx\endpoint\empty
             \coordinate (O-\theqworldnumeros) at ([shift={(0,\wireverlen)}]I-\theqworldnumeros);
         \else
@@ -939,37 +939,29 @@
         \coordinate (O-\wireid) at (O-\theqworldnumeros);
         \coordinate (O-1-\wireid) at (O-\theqworldnumeros);
     \fi
-    \ifx\wirelabel\empty
-        \draw [\wirearrowtype,\qwthickness,\wirecolor] 
-          (I-\theqworldnumeros) ..controls ([shift={\fpeval{\wireverlen*(\startvelocity)}}]I-\theqworldnumeros) 
-          and ([shift={\fpeval{-1*\wireverlen*(\endvelocity)}}]O-\theqworldnumeros) .. (O-\theqworldnumeros);
-    \else
-        \draw [\wirearrowtype,\qwthickness,\wirecolor] (I-\theqworldnumeros) ..controls ([shift={\fpeval{\wireverlen*(\startvelocity)}}]I-\theqworldnumeros) 
-        and ([shift={\fpeval{-1*\wireverlen*(\endvelocity)}}]O-\theqworldnumeros) ..(O-\theqworldnumeros) node[\wirelabelat,\wirelabelside,\wireslantstyle] {\wirelabel};
-    \fi
     \ifnum\internalinvocation=0
         \path let \p1 = (I-\theqworldnumeros),\p2=(O-\theqworldnumeros) in \pgfextra{\xdef\inputx{\x1} \xdef\inputy{\y1} \xdef\outputx{\x2}\xdef\outputy{\y2}};
-        \ifnum\fpeval{ceil(\qwcompariaccu*\inputx/1pt)}<\fpeval{ceil(\qwcompariaccu*\outputx/1pt)}
-            \ifnum\fpeval{ceil(\qwcompariaccu*\inputy/1pt)}<\fpeval{ceil(\qwcompariaccu*\outputy/1pt)}
-                \coordinate (NE-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qwireinterval}},0)}]O-\theqworldnumeros);
-                \coordinate (SW-\theqworldnumeros) at ([shift={({\fpeval{-0.5*\qwireinterval}},0)}]I-\theqworldnumeros);
+        \ifnum\fpeval{ceil(\qworld at compare@accuracy*\inputx/1pt)}<\fpeval{ceil(\qworld at compare@accuracy*\outputx/1pt)}
+            \ifnum\fpeval{ceil(\qworld at compare@accuracy*\inputy/1pt)}<\fpeval{ceil(\qworld at compare@accuracy*\outputy/1pt)}
+                \coordinate (NE-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qworld at wire@interval}},0)}]O-\theqworldnumeros);
+                \coordinate (SW-\theqworldnumeros) at ([shift={({\fpeval{-0.5*\qworld at wire@interval}},0)}]I-\theqworldnumeros);
                 \coordinate (NW-\theqworldnumeros) at (SW-\theqworldnumeros |- NE-\theqworldnumeros);
                 \coordinate (SE-\theqworldnumeros) at (SW-\theqworldnumeros -| NE-\theqworldnumeros);
             \else
-                \coordinate (NW-\theqworldnumeros) at ([shift={({\fpeval{-0.5*\qwireinterval}},0)}]I-\theqworldnumeros);
-                \coordinate (SE-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qwireinterval}},0)}]O-\theqworldnumeros);
+                \coordinate (NW-\theqworldnumeros) at ([shift={({\fpeval{-0.5*\qworld at wire@interval}},0)}]I-\theqworldnumeros);
+                \coordinate (SE-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qworld at wire@interval}},0)}]O-\theqworldnumeros);
                 \coordinate (NE-\theqworldnumeros) at (NW-\theqworldnumeros -| SE-\theqworldnumeros);
                 \coordinate (SW-\theqworldnumeros) at (NW-\theqworldnumeros |- SE-\theqworldnumeros);
             \fi
         \else
-            \ifnum\fpeval{ceil(\qwcompariaccu*\inputy/1pt)}<\fpeval{ceil(\qwcompariaccu*\outputy/1pt)}
-                \coordinate (NW-\theqworldnumeros) at ([shift={({\fpeval{-0.5*\qwireinterval}},0)}]O-\theqworldnumeros);
-                \coordinate (SE-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qwireinterval}},0)}]I-\theqworldnumeros);
+            \ifnum\fpeval{ceil(\qworld at compare@accuracy*\inputy/1pt)}<\fpeval{ceil(\qworld at compare@accuracy*\outputy/1pt)}
+                \coordinate (NW-\theqworldnumeros) at ([shift={({\fpeval{-0.5*\qworld at wire@interval}},0)}]O-\theqworldnumeros);
+                \coordinate (SE-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qworld at wire@interval}},0)}]I-\theqworldnumeros);
                 \coordinate (NE-\theqworldnumeros) at (NW-\theqworldnumeros -| SE-\theqworldnumeros);
                 \coordinate (SW-\theqworldnumeros) at (NW-\theqworldnumeros |- SE-\theqworldnumeros);
             \else
-                \coordinate (NE-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qwireinterval}},0)}]I-\theqworldnumeros);
-                \coordinate (SW-\theqworldnumeros) at ([shift={({\fpeval{-0.5*\qwireinterval}},0)}]O-\theqworldnumeros);
+                \coordinate (NE-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qworld at wire@interval}},0)}]I-\theqworldnumeros);
+                \coordinate (SW-\theqworldnumeros) at ([shift={({\fpeval{-0.5*\qworld at wire@interval}},0)}]O-\theqworldnumeros);
                 \coordinate (NW-\theqworldnumeros) at (SW-\theqworldnumeros |- NE-\theqworldnumeros);
                 \coordinate (SE-\theqworldnumeros) at (SW-\theqworldnumeros -| NE-\theqworldnumeros);
             \fi
@@ -989,8 +981,23 @@
             \coordinate (S-\wireid) at (S-\theqworldnumeros);
             \coordinate (W-\wireid) at (W-\theqworldnumeros);
             \coordinate (E-\wireid) at (E-\theqworldnumeros);
-            \coordinate (C-\wireid) at (c-\theqworldnumeros);
+            \coordinate (C-\wireid) at (C-\theqworldnumeros);
         \fi
+        \coordinate (qworldvertexA) at (I-\theqworldnumeros -| C-\theqworldnumeros);
+        \coordinate (qworldvertexB) at (O-\theqworldnumeros -| C-\theqworldnumeros);
+        \coordinate (qworldvertexC) at ($(I-\theqworldnumeros)!{\fpeval{1-\qworld at velocity@y}}!(qworldvertexA)$);
+        \coordinate (qworldvertexD) at ($(O-\theqworldnumeros)!{\fpeval{1-\qworld at velocity@y}}!(qworldvertexB)$);
+        \coordinate (qworldvertexE) at (qworldvertexC |- C-\theqworldnumeros);
+        \coordinate (qworldvertexF) at (qworldvertexD |- C-\theqworldnumeros);
+        \ifx\wirelabel\empty
+            \draw [\wirearrowtype,\qworld at thickness,\wirecolor] 
+                (I-\theqworldnumeros) ..controls (qworldvertexE) 
+                and (qworldvertexF) .. (O-\theqworldnumeros);
+        \else
+            \draw [\wirearrowtype,\qworld at thickness,\wirecolor] 
+                (I-\theqworldnumeros) ..controls (qworldvertexE)
+                and (qworldvertexF) ..(O-\theqworldnumeros) node[\wirelabelat,\wirelabelside,\wireslantstyle] {\wirelabel};
+        \fi
         \coordinate (qworldat) at (SE-\theqworldnumeros);
             \stepcounter{qworldnumeros}
     \fi
@@ -1019,6 +1026,12 @@
     color/.store in=\boxcolor,
     morphism color/.store in=\morphismcolor,
     frame color/.store in=\framecolor,
+    dom color/.store in=\domcolor,
+    cod color/.store in=\codcolor,
+    L color/.store in=\leftcolor,
+    R color/.store in=\rightcolor,
+    L color output/.store in=\leftcoloroutput,
+    R color output/.store in=\rightcoloroutput,
     arrowtype/.store in=\arrowtype,
     dom arrowtype/.store in=\domarrowtype,
     cod arrowtype/.store in=\codarrowtype,
@@ -1046,6 +1059,7 @@
     braid smoothness/.store in=\braidsmoothness,
     dual angle/.store in=\dualangle,
     slant style/.store in=\boxslantstyle,
+    spider smoothness/.store in=\spidersmoothness,
     at/.default={qworldat},
     name/.default={},
     arity/.default={1},
@@ -1062,11 +1076,17 @@
     num L/.default={1},
     num R/.default={1},
     center margin length/.default={1},
-    sv/.default={\qwvelocityx,\qwvelocityy},
-    ev/.default={\qwvelocityx,-\qwvelocityy},
+    sv/.default={\qworld at velocity@x,\qworld at velocity@y},
+    ev/.default={\qworld at velocity@x,-\qworld at velocity@y},
     color/.default={white},
     morphism color/.default={black},
     frame color/.default={black},
+    dom color/.default={notenterd},
+    cod color/.default={notenterd},
+    L color/.default={black},
+    R color/.default={black},
+    L color output/.default={black},
+    R color output/.default={black},
     arrowtype/.default={},
     dom arrowtype/.default={},
     cod arrowtype/.default={},
@@ -1091,12 +1111,13 @@
     S/.default={notentered},
     W/.default={notentered},
     E/.default={notentered},
-    braid smoothness/.default={0.85},
-    dual angle/.default={55},
-    slant style/.default={}
+    braid smoothness/.default={0.975},
+    dual angle/.default={89},
+    slant style/.default={},
+    spider smoothness/.default={}
 }
-\newcommand{\qwboxprocess}[2][box]{
-    \def\boxtype{#1}
+\newcommand{\qworld at box@process}[2][box]{
+    \def\qworld at box@type{#1}
     \pgfkeys{/qworld/box/.cd, 
     at={qworldat},
     name={},
@@ -1114,11 +1135,17 @@
     num L={1},
     num R={1},
     center margin length={1},
-    sv={\qwvelocityx,\qwvelocityy},
-    ev={\qwvelocityx,\qwvelocityy},
+    sv={\qworld at velocity@x,\qworld at velocity@y},
+    ev={\qworld at velocity@x,\qworld at velocity@y},
     color={white},
     morphism color={black},
     frame color={black},
+    dom color={notenterd},
+    cod color={notenterd},
+    L color={black},
+    R color={black},
+    L color output={black},
+    R color output={black},
     arrowtype={},
     dom arrowtype={},
     cod arrowtype={},
@@ -1143,14 +1170,55 @@
     S={notentered},
     W={notentered},
     E={notentered},
-    braid smoothness={0.85},
-    dual angle={55},
+    braid smoothness={0.99},
+    dual angle={89},
     slant style={},
+    spider smoothness={0.99},
     #2}
+    \ifthenelse{
+        \equal{\qworld at box@type}{braid}\or
+        \equal{\qworld at box@type}{braidinv}\or
+        \equal{\qworld at box@type}{sym}\or
+        \equal{\qworld at box@type}{cap}\or
+        \equal{\qworld at box@type}{caprev}\or
+        \equal{\qworld at box@type}{cup}\or
+        \equal{\qworld at box@type}{cuprev}\or
+        \equal{\qworld at box@type}{spider}
+    }{
+        \def\qworld at box@type at tangle{TRUE}
+    }{
+        \def\qworld at box@type at tangle{FALSE}
+    }
+    \ifthenelse{\equal{\domcolor}{notenterd}}{
+        \ifthenelse{\equal{\codcolor}{notenterd}}{
+            \pgfkeys{/qworld/box/.cd, 
+                L color output=\leftcolor,
+                R color output=\rightcolor
+            }
+        }{
+            \pgfkeys{/qworld/box/.cd,
+                R color output=\codcolor,
+                L color output=\codcolor
+            } 
+        }
+    }{
+        \ifthenelse{\equal{\codcolor}{notenterd}}{
+            \pgfkeys{/qworld/box/.cd, 
+                R color=\domcolor,
+                L color=\domcolor
+            }
+        }{
+            \pgfkeys{/qworld/box/.cd, 
+                R color=\domcolor,
+                L color=\domcolor,
+                R color output=\codcolor,
+                L color output=\codcolor
+            } 
+        }
+    }
+
     \ifthenelse{\equal{\boxshowid}{notentered}}
-    {
-
-    }{
+    {}{
         \pgfkeys{/qworld/box/.cd, index={true}} 
     }
     \ifthenelse{\equal{\boxhlen}{notentered}}
@@ -1171,10 +1239,10 @@
     \ifx\codarrowtype\empty
         \pgfkeys{/qworld/box/.cd, cod arrowtype=\arrowtype}
     \fi
-    \ifthenelse{\equal{\boxtype}{cap}\or\equal{\boxtype}{caprev}\or\equal{\boxtype}{effect}\or\equal{\boxtype}{scalar}}
+    \ifthenelse{\equal{\qworld at box@type}{cap}\or\equal{\qworld at box@type}{caprev}\or\equal{\qworld at box@type}{effect}\or\equal{\qworld at box@type}{scalar}}
     {
         \pgfkeys{/qworld/box/.cd, n=0}
-        \ifthenelse{\equal{\boxtype}{cap}\or\equal{\boxtype}{caprev}}
+        \ifthenelse{\equal{\qworld at box@type}{cap}\or\equal{\qworld at box@type}{caprev}}
         {
             \ifthenelse{\equal{\numPortsS}{notentered}}{
                 \pgfkeys{/qworld/box/.cd, s=2}
@@ -1181,10 +1249,10 @@
             }{}
         }{}
     }{}
-    \ifthenelse{\equal{\boxtype}{cup}\or\equal{\boxtype}{cuprev}\or\equal{\boxtype}{state}\or\equal{\boxtype}{scalar}}
+    \ifthenelse{\equal{\qworld at box@type}{cup}\or\equal{\qworld at box@type}{cuprev}\or\equal{\qworld at box@type}{state}\or\equal{\qworld at box@type}{scalar}}
     {
         \pgfkeys{/qworld/box/.cd, s=0}
-        \ifthenelse{\equal{\boxtype}{cup}\or\equal{\boxtype}{cuprev}}
+        \ifthenelse{\equal{\qworld at box@type}{cup}\or\equal{\qworld at box@type}{cuprev}}
         {
             \ifthenelse{\equal{\numPortsN}{notentered}}{
                 \pgfkeys{/qworld/box/.cd, n=2}
@@ -1205,7 +1273,7 @@
     }{
         \def\rstrandtype{}
     }
-    \ifthenelse{\equal{\boxtype}{braid}\or\equal{\boxtype}{braidinv}\or\equal{\boxtype}{sym}}
+    \ifthenelse{\equal{\qworld at box@type}{braid}\or\equal{\qworld at box@type}{braidinv}\or\equal{\qworld at box@type}{sym}}
     {
         \pgfkeys{/qworld/box/.cd, p={\fpeval{\braidfsc+\braidbsc}}}
     }{}
@@ -1215,25 +1283,26 @@
     }
     \ifthenelse{\equal{\numPorts}{0}}
     {
-        \pgfkeys{/qworld/box/.cd, n=0,s=0}
+        \pgfkeys{/qworld/box/.cd, n=0, s=0}
     }{}
     \ifthenelse{\equal{\numPortsS}{0}}
     {
-        \pgfkeys{/qworld/box/.cd, s=1,S={}}
+        \pgfkeys{/qworld/box/.cd, s=1, S={}}
     }{}
     \ifthenelse{\equal{\numPortsN}{0}}
     {
-        \pgfkeys{/qworld/box/.cd, n=1,N={}}
+        \pgfkeys{/qworld/box/.cd, n=1, N={}}
     }{}
     \ifthenelse{\equal{\Ports}{notentered}}
     {}{
         \pgfkeys{/qworld/box/.cd, S=\Ports, N=\Ports}
+        % 工事中
     }
     \ifthenelse{\equal{\PortsS}{notentered}}
     {
         \ifthenelse{\equal{\numPortsS}{notentered}}
         {
-            \pgfkeys{/qworld/box/.cd,s=1,S={1}}
+            \pgfkeys{/qworld/box/.cd,s=1, S={1}}
         }{
             \pgfkeys{/qworld/box/.cd, S={1,...,\fpeval{\numPortsS}}}
         }
@@ -1242,41 +1311,47 @@
     {
         \ifthenelse{\equal{\numPortsN}{notentered}}
         {
-            \pgfkeys{/qworld/box/.cd,n=1,N={1}}
+            \pgfkeys{/qworld/box/.cd,n=1, N={1}}
         }{
             \pgfkeys{/qworld/box/.cd, N={1,...,\fpeval{\numPortsN}}}
         }
     }{}
-    \setcounter{portSnum}{0}
-    \ifthenelse{\equal{\PortsS}{{}}\or\equal{\PortsS}{}}{}{
-        \foreach\qwtempindex in \PortsS
+    \setcounter{qworld at box@port at num@S}{0}
+    \def\qworldmaxS{0}
+    \ifthenelse{\equal{\PortsS}{{}}\or\equal{\PortsS}{}}
+    {}{
+        \foreach\qworldindex in \PortsS
         {
-            \stepcounter{portSnum}
+            \stepcounter{qworld at box@port at num@S}
         }
+        \foreach \qworldindex in\PortsS
+        {
+            \ifnum\qworldmaxS<\qworldindex
+                \xdef\qworldmaxStemp{\qworldindex}
+            \fi
+            \xdef\qworldmaxS{\qworldmaxStemp}
+        }
     }
-    \def\cardportsS{\fpeval{\theportSnum}}
+    \def\qworld at card@ports at S{\fpeval{\theqworld at box@port at num@S}}
 
-    \setcounter{portNnum}{0}
-    \ifthenelse{\equal{\PortsN}{{}}\or\equal{\PortsN}{}}{
-    }{
-        \foreach\qwindex in \PortsN
+    \setcounter{qworld at box@port at num@N}{0}
+    \def\qworldmaxN{0}
+    \ifthenelse{\equal{\PortsN}{{}}\or\equal{\PortsN}{}}
+    {}{
+        \foreach\qworldindex in \PortsN
         {
-            \stepcounter{portNnum}
+            \stepcounter{qworld at box@port at num@N}
         }
-    }
-    \def\cardportsN{\theportNnum}
-    \def\maxN{0}
-    \ifthenelse{\equal{\PortsN}{}\or\equal{\PortsN}{{}}}
-    {
-    }{
-        \foreach \qwiii in\PortsN
+        \foreach \qworldindex in\PortsN
         {
-            \ifnum\maxN<\qwiii
-                \xdef\maxNtemp{\qwiii}
+            \ifnum\qworldmaxN<\qworldindex
+                \xdef\qworldmaxNtemp{\qworldindex}
             \fi
-            \xdef\maxN{\maxNtemp}
+            \xdef\qworldmaxN{\qworldmaxNtemp}
         }
     }
+
+    \def\qworld at card@ports at N{\theqworld at box@port at num@N}
     \ifthenelse{\equal{\numPortsN}{notentered}\or\equal{\numPortsN}{{notentered}}}
     {
         \ifthenelse{\equal{\PortsN}{}\or\equal{\PortsN}{{}}}
@@ -1283,21 +1358,10 @@
         {
             \pgfkeys{/qworld/box/.cd, n=1}
         }{
-            \pgfkeys{/qworld/box/.cd, n=\maxN}
+            \pgfkeys{/qworld/box/.cd, n=\qworldmaxN}
         }
     }{}
-    \def\maxS{0}
-    \ifthenelse{\equal{\PortsS}{}\or\equal{\PortsS}{{}}}
-    {
-    }{
-        \foreach \qwiii in\PortsS
-        {
-            \ifnum\maxS<\qwiii
-                \xdef\maxStemp{\qwiii}
-            \fi
-            \xdef\maxS{\maxStemp}
-        }
-    }
+
     \ifthenelse{\equal{\numPortsS}{notentered}\or\equal{\numPortsS}{{notentered}}}
     {
         \ifthenelse{\equal{\PortsS}{}\or\equal{\PortsS}{{}}}
@@ -1304,31 +1368,31 @@
         {
             \pgfkeys{/qworld/box/.cd, s=1}
         }{
-            \pgfkeys{/qworld/box/.cd, s=\maxS}
+            \pgfkeys{/qworld/box/.cd, s=\qworldmaxS}
         }
     }{}
-    \ifnum\numPortsN<\maxN
-        \pgfkeys{/qworld/box/.cd, n=\maxN}
+    \ifnum\numPortsN<\qworldmaxN
+        \pgfkeys{/qworld/box/.cd, n=\qworldmaxN}
     \fi
-    \ifnum\numPortsS<\maxS
-        \pgfkeys{/qworld/box/.cd, s=\maxS}
+    \ifnum\numPortsS<\qworldmaxS
+        \pgfkeys{/qworld/box/.cd, s=\qworldmaxS}
     \fi
     \def\qworldwireScorrection{0}
     \def\qworldwireNcorrection{0}
     \ifthenelse{\equal{\boxhorilen}{notentered}}
     {
-        \def\smargin{1}
-        \def\nmargin{1}
-        \pgfkeys{/qworld/box/.cd, horizontal length={\fpeval{max(1,\smargin*(\numPortsS-1)+1,\nmargin*(\numPortsN-1)+1)}}}
+        \def\qworld at margin@s{1}
+        \def\qworld at margin@n{1}
+        \pgfkeys{/qworld/box/.cd, horizontal length={\fpeval{max(1,\qworld at margin@s*(\numPortsS-1)+1,\qworld at margin@n*(\numPortsN-1)+1)}}}
     }{
         \ifnum\numPortsS=1
-            \def\qworldwireScorrection{\fpeval{0.5*\boxhorilen-0.5*\qwireinterval}}
+            \def\qworldwireScorrection{\fpeval{0.5*\boxhorilen-0.5*\qworld at wire@interval}}
         \fi
         \ifnum\numPortsN=1
-            \def\qworldwireNcorrection{\fpeval{0.5*\boxhorilen-0.5*\qwireinterval}}
+            \def\qworldwireNcorrection{\fpeval{0.5*\boxhorilen-0.5*\qworld at wire@interval}}
         \fi
-        \def\smargin{\fpeval{(\boxhorilen-\qwireinterval)/(max(1,\numPortsS-1))}}
-        \def\nmargin{\fpeval{(\boxhorilen-\qwireinterval)/(max(1,\numPortsN-1))}}
+        \def\qworld at margin@s{\fpeval{(\boxhorilen-\qworld at wire@interval)/(max(1,\numPortsS-1))}}
+        \def\qworld at margin@n{\fpeval{(\boxhorilen-\qworld at wire@interval)/(max(1,\numPortsN-1))}}
     }
     \coordinate (SW-\theqworldnumeros) at (\boxat);
     \coordinate (SE-\theqworldnumeros) at ([shift={(\boxhorilen,0)}]SW-\theqworldnumeros);
@@ -1352,18 +1416,18 @@
         \coordinate (C-\boxid) at (C-\theqworldnumeros);
     \fi
     \ifnum\numPortsS>0
-        \foreach \qwindex in {1,...,\numPortsS}
+        \foreach \qworldindex in {1,...,\numPortsS}
         {
-            \coordinate (s-\qwindex-\theqworldnumeros) at ([shift={({\fpeval{(0.5*\qwireinterval)+((\qwindex-1)*\smargin)+\qworldwireScorrection}},{\fpeval{\qwfillrate}})}]\boxat);
-            \coordinate (S-\qwindex-\theqworldnumeros) at (SW-\theqworldnumeros -| s-\qwindex-\theqworldnumeros);
+            \coordinate (s-\qworldindex-\theqworldnumeros) at ([shift={({\fpeval{(0.5*\qworld at wire@interval)+((\qworldindex-1)*\qworld at margin@s)+\qworldwireScorrection}},{\fpeval{\qworld at box@fillrate at vertical}})}]\boxat);
+            \coordinate (S-\qworldindex-\theqworldnumeros) at (SW-\theqworldnumeros -| s-\qworldindex-\theqworldnumeros);
             \ifx\boxid\empty
             \else
-                \coordinate (s-\qwindex-\boxid) at (s-\qwindex-\theqworldnumeros);
-                \coordinate (S-\qwindex-\boxid) at (S-\qwindex-\theqworldnumeros);
+                \coordinate (s-\qworldindex-\boxid) at (s-\qworldindex-\theqworldnumeros);
+                \coordinate (S-\qworldindex-\boxid) at (S-\qworldindex-\theqworldnumeros);
             \fi
         }
     \else
-        \coordinate (s-1-\theqworldnumeros) at ([shift={({\fpeval{(0.5*\qwireinterval)}},{\fpeval{\qwfillrate}})}]\boxat);
+        \coordinate (s-1-\theqworldnumeros) at ([shift={({\fpeval{(0.5*\qworld at wire@interval)}},{\fpeval{\qworld at box@fillrate at vertical}})}]\boxat);
         \coordinate (S-1-\theqworldnumeros) at (SW-\theqworldnumeros -| s-1-\theqworldnumeros);
         \ifx\boxid\empty
         \else
@@ -1372,18 +1436,18 @@
         \fi
     \fi
     \ifnum\numPortsN>0
-        \foreach \qwindex in {1,...,\numPortsN}
+        \foreach \qworldindex in {1,...,\numPortsN}
         {
-            \coordinate (n-\qwindex-\theqworldnumeros) at ([shift={({\fpeval{(0.5*\qwireinterval)+((\qwindex-1)*\nmargin)+\qworldwireNcorrection}},{\fpeval{\boxverlen-\qwfillrate}})}]\boxat);
-            \coordinate (N-\qwindex-\theqworldnumeros) at (NW-\theqworldnumeros -| n-\qwindex-\theqworldnumeros);
+            \coordinate (n-\qworldindex-\theqworldnumeros) at ([shift={({\fpeval{(0.5*\qworld at wire@interval)+((\qworldindex-1)*\qworld at margin@n)+\qworldwireNcorrection}},{\fpeval{\boxverlen-\qworld at box@fillrate at vertical}})}]\boxat);
+            \coordinate (N-\qworldindex-\theqworldnumeros) at (NW-\theqworldnumeros -| n-\qworldindex-\theqworldnumeros);
             \ifx\boxid\empty
             \else
-                \coordinate (n-\qwindex-\boxid) at (n-\qwindex-\theqworldnumeros);
-                \coordinate (N-\qwindex-\boxid) at (N-\qwindex-\theqworldnumeros);
+                \coordinate (n-\qworldindex-\boxid) at (n-\qworldindex-\theqworldnumeros);
+                \coordinate (N-\qworldindex-\boxid) at (N-\qworldindex-\theqworldnumeros);
             \fi
         }
     \else
-        \coordinate (n-1-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qwireinterval}},{\fpeval{\boxverlen-\qwfillrate}})}]\boxat);
+        \coordinate (n-1-\theqworldnumeros) at ([shift={({\fpeval{0.5*\qworld at wire@interval}},{\fpeval{\boxverlen-\qworld at box@fillrate at vertical}})}]\boxat);
         \coordinate (N-1-\theqworldnumeros) at (NW-\theqworldnumeros -| n-1-\theqworldnumeros);
         \ifx\boxid\empty
         \else
@@ -1398,95 +1462,131 @@
         \coordinate (n-\boxid) at (n-\theqworldnumeros);
         \coordinate (s-\boxid) at (s-\theqworldnumeros);
     \fi
-    \setcounter{portStempnum}{0}
-    \ifnum\cardportsS>0
-        \foreach\qwindex in \PortsS
-        {
-            \stepcounter{portStempnum}
-            \draw[\qwthickness, \domarrowtype] (S-\qwindex-\theqworldnumeros)--(s-\qwindex-\theqworldnumeros);
-            \coordinate (i-\theportStempnum-\theqworldnumeros) at (s-\qwindex-\theqworldnumeros);
-            \coordinate (I-\theportStempnum-\theqworldnumeros) at (S-\qwindex-\theqworldnumeros);
-            \ifx\boxid\empty
-            \else
-                \coordinate (i-\theportStempnum-\boxid) at (i-\theportStempnum-\theqworldnumeros);
-                \coordinate (I-\theportStempnum-\boxid) at (I-\theportStempnum-\theqworldnumeros);
-            \fi
+    \setcounter{qworld at box@port at num@S at temp}{0}
+    \ifnum\qworld at card@ports at S>0
+        \ifthenelse{\equal{\qworld at box@type at tangle}{FALSE}}{
+            \foreach\qworldindex in \PortsS
+            {
+                \stepcounter{qworld at box@port at num@S at temp}
+                \ifnum\theqworld at box@port at num@S at temp>\braidfsc
+                    \draw[\qworld at thickness, \domarrowtype, \rightcolor] (S-\qworldindex-\theqworldnumeros)--(s-\qworldindex-\theqworldnumeros);
+                \else
+                    \draw[\qworld at thickness, \domarrowtype, \leftcolor] (S-\qworldindex-\theqworldnumeros)--(s-\qworldindex-\theqworldnumeros);
+                \fi
+                \coordinate (i-\theqworld at box@port at num@S at temp-\theqworldnumeros) at (s-\qworldindex-\theqworldnumeros);
+                \coordinate (I-\theqworld at box@port at num@S at temp-\theqworldnumeros) at (S-\qworldindex-\theqworldnumeros);
+                \ifx\boxid\empty
+                \else
+                    \coordinate (i-\theqworld at box@port at num@S at temp-\boxid) at (i-\theqworld at box@port at num@S at temp-\theqworldnumeros);
+                    \coordinate (I-\theqworld at box@port at num@S at temp-\boxid) at (I-\theqworld at box@port at num@S at temp-\theqworldnumeros);
+                \fi
+            }
+        }{
+            \foreach\qworldindex in \PortsS
+            {
+                \stepcounter{qworld at box@port at num@S at temp}
+                \coordinate (i-\theqworld at box@port at num@S at temp-\theqworldnumeros) at (s-\qworldindex-\theqworldnumeros);
+                \coordinate (I-\theqworld at box@port at num@S at temp-\theqworldnumeros) at (S-\qworldindex-\theqworldnumeros);
+                \ifx\boxid\empty
+                \else
+                    \coordinate (i-\theqworld at box@port at num@S at temp-\boxid) at (i-\theqworld at box@port at num@S at temp-\theqworldnumeros);
+                    \coordinate (I-\theqworld at box@port at num@S at temp-\boxid) at (I-\theqworld at box@port at num@S at temp-\theqworldnumeros);
+                \fi
+            }
         }
     \fi
-    \setcounter{portNtempnum}{0}
-    \ifnum\cardportsN>0
-        \foreach\qwindex in \PortsN
-        {
-            \stepcounter{portNtempnum}
-            \draw[\qwthickness, \codarrowtype] (n-\qwindex-\theqworldnumeros)--(N-\qwindex-\theqworldnumeros);
-            \coordinate (o-\theportNtempnum-\theqworldnumeros) at (n-\qwindex-\theqworldnumeros);
-            \coordinate (O-\theportNtempnum-\theqworldnumeros) at (N-\qwindex-\theqworldnumeros);
-            \ifx\boxid\empty
-            \else
-                \coordinate (o-\theportNtempnum-\boxid) at (o-\theportNtempnum-\theqworldnumeros);
-                \coordinate (O-\theportNtempnum-\boxid) at (O-\theportNtempnum-\theqworldnumeros);
-            \fi
+    \setcounter{qworld at box@port at num@N at temp}{0}
+    \ifnum\qworld at card@ports at N>0
+        \ifthenelse{\equal{\qworld at box@type at tangle}{FALSE}}{
+            \foreach\qworldindex in \PortsN
+            {
+                \stepcounter{qworld at box@port at num@N at temp}
+                \ifnum\theqworld at box@port at num@N at temp>\braidbsc
+                    \draw[\qworld at thickness, \codarrowtype, \leftcoloroutput] (n-\qworldindex-\theqworldnumeros)--(N-\qworldindex-\theqworldnumeros);
+                \else
+                    \draw[\qworld at thickness, \codarrowtype, \rightcoloroutput] (n-\qworldindex-\theqworldnumeros)--(N-\qworldindex-\theqworldnumeros);
+                \fi
+                \coordinate (o-\theqworld at box@port at num@N at temp-\theqworldnumeros) at (n-\qworldindex-\theqworldnumeros);
+                \coordinate (O-\theqworld at box@port at num@N at temp-\theqworldnumeros) at (N-\qworldindex-\theqworldnumeros);
+                \ifx\boxid\empty
+                \else
+                    \coordinate (o-\theqworld at box@port at num@N at temp-\boxid) at (o-\theqworld at box@port at num@N at temp-\theqworldnumeros);
+                    \coordinate (O-\theqworld at box@port at num@N at temp-\boxid) at (O-\theqworld at box@port at num@N at temp-\theqworldnumeros);
+                \fi
+            }
+        }{
+            \foreach\qworldindex in \PortsN
+            {
+                \stepcounter{qworld at box@port at num@N at temp}
+                \coordinate (o-\theqworld at box@port at num@N at temp-\theqworldnumeros) at (n-\qworldindex-\theqworldnumeros);
+                \coordinate (O-\theqworld at box@port at num@N at temp-\theqworldnumeros) at (N-\qworldindex-\theqworldnumeros);
+                \ifx\boxid\empty
+                \else
+                    \coordinate (o-\theqworld at box@port at num@N at temp-\boxid) at (o-\theqworld at box@port at num@N at temp-\theqworldnumeros);
+                    \coordinate (O-\theqworld at box@port at num@N at temp-\boxid) at (O-\theqworld at box@port at num@N at temp-\theqworldnumeros);
+                \fi
+            }
         }
     \fi
-    \ifthenelse{\equal{\boxtype}{effect}}
+    \ifthenelse{\equal{\qworld at box@type}{effect}}
     {
         \coordinate (sw-\theqworldnumeros) at ($(SW-\theqworldnumeros |- s-\theqworldnumeros)!0.1!(s-1-\theqworldnumeros)$);
         \coordinate (se-\theqworldnumeros) at ($(SE-\theqworldnumeros |- s-\theqworldnumeros)!0.1!(s-\numPortsS-\theqworldnumeros)$);
-        \draw[{\qwthickness},draw = {\framecolor}, fill = {\boxcolor}] (se-\theqworldnumeros)--(sw-\theqworldnumeros)--(n-\theqworldnumeros)--cycle;
-        \node[\boxslantstyle] at ([shift={(0,{\fpeval{-0.1*\boxverlen}})}]C-\theqworldnumeros) {{\scalebox{\fpeval{min(\boxhorilen-\qwireinterval+2*\qwfillratex,\boxverlen-2*\qwfillrate)}}{\color{\morphismcolor}\boxname}}};
+        \draw[{\qworld at thickness},draw = {\framecolor}, fill = {\boxcolor}] (se-\theqworldnumeros)--(sw-\theqworldnumeros)--(n-\theqworldnumeros)--cycle;
+        \node[\boxslantstyle] at ([shift={(0,{\fpeval{-0.1*\boxverlen}})}]C-\theqworldnumeros) {{\scalebox{\fpeval{min(\boxhorilen-\qworld at wire@interval+2*\qworld at box@fillrate at horizontal,\boxverlen-2*\qworld at box@fillrate at vertical)}}{\color{\morphismcolor}\boxname}}};
     }{}
-    \ifthenelse{\equal{\boxtype}{state}}
+    \ifthenelse{\equal{\qworld at box@type}{state}}
     {
         \coordinate (ne-\theqworldnumeros) at ($(n-\numPortsN-\theqworldnumeros -| NE-\theqworldnumeros)!0.1!(n-\numPortsN-\theqworldnumeros)$);
         \coordinate (nw-\theqworldnumeros) at ($(n-\theqworldnumeros -| NW-\theqworldnumeros)!0.1!(n-1-\theqworldnumeros)$);
-        \draw[{\qwthickness}, draw = {\framecolor}, fill = {\boxcolor}] (ne-\theqworldnumeros)--(nw-\theqworldnumeros)--(s-\theqworldnumeros)--cycle;
-        \node[\boxslantstyle] at ([shift={(0,{\fpeval{0.1*\boxverlen}})}]C-\theqworldnumeros) [anchor=center] {{\scalebox{\fpeval{min(\boxhorilen-\qwireinterval+2*\qwfillratex,\boxverlen-2*\qwfillrate)}}{\color{\morphismcolor}\boxname}}};
+        \draw[{\qworld at thickness}, draw = {\framecolor}, fill = {\boxcolor}] (ne-\theqworldnumeros)--(nw-\theqworldnumeros)--(s-\theqworldnumeros)--cycle;
+        \node[\boxslantstyle] at ([shift={(0,{\fpeval{0.1*\boxverlen}})}]C-\theqworldnumeros) [anchor=center] {{\scalebox{\fpeval{min(\boxhorilen-\qworld at wire@interval+2*\qworld at box@fillrate at horizontal,\boxverlen-2*\qworld at box@fillrate at vertical)}}{\color{\morphismcolor}\boxname}}};
     }{}
-    \ifthenelse{\equal{\boxtype}{scalar}}
+    \ifthenelse{\equal{\qworld at box@type}{scalar}}
     {
-        \def\xradius{\fpeval{0.45*\boxhorilen}}
-        \def\yradius{\fpeval{0.5*\boxverlen-\qwfillrate}}
-        \def\radis{\fpeval{min(\xradius,\yradius)}}    
-        \node[draw={\framecolor}, {\qwthickness}, fill={\boxcolor},
-              ellipse, minimum width={\fpeval{2*\xradius}cm}, minimum height={\fpeval{2*\yradius}cm}
+        \def\qworldxradius{\fpeval{0.45*\boxhorilen}}
+        \def\qworldyradius{\fpeval{0.5*\boxverlen-\qworld at box@fillrate at vertical}}
+        \def\radis{\fpeval{min(\qworldxradius,\qworldyradius)}}    
+        \node[draw={\framecolor}, {\qworld at thickness}, fill={\boxcolor},
+              ellipse, minimum width={\fpeval{2*\qworldxradius}cm}, minimum height={\fpeval{2*\qworldyradius}cm}
               \boxslantstyle, transform shape] 
-              (SCALAR-\theqworldnumeros) at (C-\theqworldnumeros) {{\scalebox{\fpeval{min(\boxhorilen-\qwireinterval+2*\qwfillratex,\boxverlen-2*\qwfillrate)}}{\color{\morphismcolor}\boxname}}};
+              (SCALAR-\theqworldnumeros) at (C-\theqworldnumeros) {{\scalebox{\fpeval{min(\boxhorilen-\qworld at wire@interval+2*\qworld at box@fillrate at horizontal,\boxverlen-2*\qworld at box@fillrate at vertical)}}{\color{\morphismcolor}\boxname}}};
     }{}
-    \def\ner{0}
-    \def\nwr{0}
-    \def\ser{0}
-    \def\swr{0}
-    \ifthenelse{\equal{\boxtype}{asym}}
+    \def\qworld at box@distortion at ne{0}
+    \def\qworld at box@distortion at nw{0}
+    \def\qworld at box@distortion at se{0}
+    \def\qworld at box@distortion at sw{0}
+    \ifthenelse{\equal{\qworld at box@type}{asym}}
     {
-        \def\ner{\fpeval{-0.5*(0.5*\qwireinterval-\qwfillratex)}}
-        \def\ser{\fpeval{0.5*(0.5*\qwireinterval-\qwfillratex)}}
-        \def\boxtype{box}
+        \def\qworld at box@distortion at ne{\fpeval{-0.5*(0.5*\qworld at wire@interval-\qworld at box@fillrate at horizontal)}}
+        \def\qworld at box@distortion at se{\fpeval{0.5*(0.5*\qworld at wire@interval-\qworld at box@fillrate at horizontal)}}
+        \def\qworld at box@type{box}
     }{}
-    \ifthenelse{\equal{\boxtype}{adj}}
+    \ifthenelse{\equal{\qworld at box@type}{adj}}
     {
-        \def\ner{\fpeval{0.5*(0.5*\qwireinterval-\qwfillratex)}}
-        \def\ser{\fpeval{-0.5*(0.5*\qwireinterval-\qwfillratex)}}
-        \def\boxtype{box}
+        \def\qworld at box@distortion at ne{\fpeval{0.5*(0.5*\qworld at wire@interval-\qworld at box@fillrate at horizontal)}}
+        \def\qworld at box@distortion at se{\fpeval{-0.5*(0.5*\qworld at wire@interval-\qworld at box@fillrate at horizontal)}}
+        \def\qworld at box@type{box}
     }{}
-    \ifthenelse{\equal{\boxtype}{transpose}}
+    \ifthenelse{\equal{\qworld at box@type}{transpose}}
     {
-        \def\nwr{\fpeval{-0.5*(0.5*\qwireinterval-\qwfillratex)}}
-        \def\swr{\fpeval{0.5*(0.5*\qwireinterval-\qwfillratex)}}
-        \def\boxtype{box}
+        \def\qworld at box@distortion at nw{\fpeval{-0.5*(0.5*\qworld at wire@interval-\qworld at box@fillrate at horizontal)}}
+        \def\qworld at box@distortion at sw{\fpeval{0.5*(0.5*\qworld at wire@interval-\qworld at box@fillrate at horizontal)}}
+        \def\qworld at box@type{box}
     }{}
-    \ifthenelse{\equal{\boxtype}{conj}}
+    \ifthenelse{\equal{\qworld at box@type}{conj}}
     {
-        \def\nwr{\fpeval{0.5*(0.5*\qwireinterval-\qwfillratex)}}
-        \def\swr{\fpeval{-0.5*(0.5*\qwireinterval-\qwfillratex)}}
-        \def\boxtype{box}
+        \def\qworld at box@distortion at nw{\fpeval{0.5*(0.5*\qworld at wire@interval-\qworld at box@fillrate at horizontal)}}
+        \def\qworld at box@distortion at sw{\fpeval{-0.5*(0.5*\qworld at wire@interval-\qworld at box@fillrate at horizontal)}}
+        \def\qworld at box@type{box}
     }{}
-    \ifthenelse{\equal{\boxtype}{box}}
+    \ifthenelse{\equal{\qworld at box@type}{box}}
     {
-        \coordinate (nw-\theqworldnumeros) at ([shift={({0.5*\qwireinterval-\qwfillratex+\nwr},{-\qwfillrate})}]NW-\theqworldnumeros);
-        \coordinate (ne-\theqworldnumeros) at ([shift={({-0.5*\qwireinterval+\qwfillratex+\ner},{-\qwfillrate})}]NE-\theqworldnumeros);
-        \coordinate (se-\theqworldnumeros) at ([shift={({-0.5*\qwireinterval+\qwfillratex+\ser},{\qwfillrate})}]SE-\theqworldnumeros);
-        \coordinate (sw-\theqworldnumeros) at ([shift={({0.5*\qwireinterval-\qwfillratex+\swr},{\qwfillrate})}]SW-\theqworldnumeros);
-        \draw[draw = \framecolor, fill = \boxcolor,\qwthickness] (nw-\theqworldnumeros)--(ne-\theqworldnumeros)--(se-\theqworldnumeros)--(sw-\theqworldnumeros)--cycle;
+        \coordinate (nw-\theqworldnumeros) at ([shift={({0.5*\qworld at wire@interval-\qworld at box@fillrate at horizontal+\qworld at box@distortion at nw},{-\qworld at box@fillrate at vertical})}]NW-\theqworldnumeros);
+        \coordinate (ne-\theqworldnumeros) at ([shift={({-0.5*\qworld at wire@interval+\qworld at box@fillrate at horizontal+\qworld at box@distortion at ne},{-\qworld at box@fillrate at vertical})}]NE-\theqworldnumeros);
+        \coordinate (se-\theqworldnumeros) at ([shift={({-0.5*\qworld at wire@interval+\qworld at box@fillrate at horizontal+\qworld at box@distortion at se},{\qworld at box@fillrate at vertical})}]SE-\theqworldnumeros);
+        \coordinate (sw-\theqworldnumeros) at ([shift={({0.5*\qworld at wire@interval-\qworld at box@fillrate at horizontal+\qworld at box@distortion at sw},{\qworld at box@fillrate at vertical})}]SW-\theqworldnumeros);
+        \draw[draw = \framecolor, fill = \boxcolor,\qworld at thickness] (nw-\theqworldnumeros)--(ne-\theqworldnumeros)--(se-\theqworldnumeros)--(sw-\theqworldnumeros)--cycle;
         \ifx\boxid\empty
         \else
             \coordinate (nw-\boxid) at (nw-\theqworldnumeros);
@@ -1494,159 +1594,156 @@
             \coordinate (se-\boxid) at (se-\theqworldnumeros);
             \coordinate (sw-\boxid) at (sw-\theqworldnumeros);
         \fi
-        \node[\boxslantstyle] at (C-\theqworldnumeros) [anchor=center] {{\scalebox{\fpeval{min(\boxhorilen-1+2*\qwfillratex,\boxverlen-2*\qwfillrate)}}{\color{\morphismcolor}\boxname}}};
+        % \node[\boxslantstyle] at (C-\theqworldnumeros) [anchor=center] {{\scalebox{\fpeval{min(\boxhorilen-1+2*\qworld at box@fillrate at horizontal,\boxverlen-2*\qworld at box@fillrate at vertical)}}{\color{\morphismcolor}\boxname}}};
+        \node[\boxslantstyle] at (C-\theqworldnumeros) [anchor=center] {{\scalebox{\fpeval{min(\boxhorilen,\boxverlen)}}{\color{\morphismcolor}\boxname}}};
     }{}
-    \def\qwwhitewidth{0.8pt}
-    \ifthenelse{\equal{\boxtype}{braid}}
+    \ifthenelse{\equal{\qworld at box@type}{braid}}
     {
-        \foreach\x in {1,...,\braidbsc}
+        \foreach\qworldindexx in {1,...,\braidbsc}
         {
-            \def\i{\fpeval{round(\x+\braidfsc)}}
-            \coordinate (tempA) at ($(o-\i-\theqworldnumeros)!{\fpeval{1-\braidsmoothness}}!(C-\theqworldnumeros)$);
-            \coordinate (tempB) at ($(C-\theqworldnumeros)!{\fpeval{\braidsmoothness}}!(o-\x-\theqworldnumeros)$);
-            \draw [\qwthickness,\framecolor,\rstrandtype] (i-\i-\theqworldnumeros) ..controls (tempA |- C-\theqworldnumeros) and (tempB |- C-\theqworldnumeros)..(o-\x-\theqworldnumeros);
+            \def\i{\fpeval{round(\qworldindexx+\braidfsc)}}
+            \coordinate (qworldvertexA) at ($(I-\i-\theqworldnumeros)!{\fpeval{1-\braidsmoothness}}!(C-\theqworldnumeros)$);
+            \coordinate (qworldvertexB) at ($(C-\theqworldnumeros)!{\fpeval{\braidsmoothness}}!(O-\qworldindexx-\theqworldnumeros)$);
+            \draw [\qworld at thickness,\rstrandtype, \rightcolor] (I-\i-\theqworldnumeros) ..controls (qworldvertexA |- C-\theqworldnumeros) and (qworldvertexB |- C-\theqworldnumeros)..(O-\qworldindexx-\theqworldnumeros);
         }
-        \foreach\x in{1,...,\braidfsc}
+        \foreach\qworldindexx in {1,...,\braidfsc}
         {
-            \def\i{\fpeval{round(\x+\braidbsc)}}
-            \coordinate (tempA) at ($(i-\x-\theqworldnumeros)!{\fpeval{1-\braidsmoothness}}!(C-\theqworldnumeros)$);
-            \coordinate (tempB) at ($(C-\theqworldnumeros)!{\fpeval{\braidsmoothness}}!(o-\i-\theqworldnumeros)$);
+            \def\i{\fpeval{round(\qworldindexx+\braidbsc)}}
+            \coordinate (qworldvertexA) at ($(I-\qworldindexx-\theqworldnumeros)!{\fpeval{1-\braidsmoothness}}!(C-\theqworldnumeros)$);
+            \coordinate (qworldvertexB) at ($(C-\theqworldnumeros)!{\fpeval{\braidsmoothness}}!(O-\i-\theqworldnumeros)$);
             \draw [ultra thick, draw = white, double = white, double distance =\pgflinewidth] 
-            (i-\x-\theqworldnumeros) ..controls (tempA |- C-\theqworldnumeros) and (tempB |- C-\theqworldnumeros)..(o-\i-\theqworldnumeros);
-            \draw [\qwthickness, draw = white, double = \framecolor, double distance =\pgflinewidth,\lstrandtype] 
-            (i-\x-\theqworldnumeros) ..controls (tempA |- C-\theqworldnumeros) and (tempB |- C-\theqworldnumeros)..(o-\i-\theqworldnumeros);
+            (I-\qworldindexx-\theqworldnumeros) ..controls (qworldvertexA |- C-\theqworldnumeros) and (qworldvertexB |- C-\theqworldnumeros)..(O-\i-\theqworldnumeros);
+            \draw [\qworld at thickness, draw = white, double = \leftcolor, double distance =\pgflinewidth,\lstrandtype] 
+            (I-\qworldindexx-\theqworldnumeros) ..controls (qworldvertexA |- C-\theqworldnumeros) and (qworldvertexB |- C-\theqworldnumeros)..(O-\i-\theqworldnumeros);
         }
     }{}
-    \ifthenelse{\equal{\boxtype}{braidinv}}
+    \ifthenelse{\equal{\qworld at box@type}{braidinv}}
     {
-        \foreach\x in{1,...,\braidfsc}
+        \foreach\qworldindexx in {1,...,\braidfsc}
         {
-            \def\i{\fpeval{round(\x+\braidbsc)}}
-            \coordinate (tempA) at ($(i-\x-\theqworldnumeros)!{\fpeval{1-\braidsmoothness}}!(C-\theqworldnumeros)$);
-            \coordinate (tempB) at ($(C-\theqworldnumeros)!{\fpeval{\braidsmoothness}}!(o-\i-\theqworldnumeros)$);
-            \draw [\qwthickness,\framecolor,\rstrandtype] (i-\x-\theqworldnumeros) ..controls (tempA |- C-\theqworldnumeros) and (tempB |- C-\theqworldnumeros)..(o-\i-\theqworldnumeros);
+            \def\i{\fpeval{round(\qworldindexx+\braidbsc)}}
+            \coordinate (qworldvertexA) at ($(I-\qworldindexx-\theqworldnumeros)!{\fpeval{1-\braidsmoothness}}!(C-\theqworldnumeros)$);
+            \coordinate (qworldvertexB) at ($(C-\theqworldnumeros)!{\fpeval{\braidsmoothness}}!(O-\i-\theqworldnumeros)$);
+            \draw [\qworld at thickness,\lstrandtype, \leftcolor] (I-\qworldindexx-\theqworldnumeros) ..controls (qworldvertexA |- C-\theqworldnumeros) and (qworldvertexB |- C-\theqworldnumeros)..(O-\i-\theqworldnumeros);
         }
-        \foreach\x in {1,...,\braidbsc}
+        \foreach\qworldindexx in {1,...,\braidbsc}
         {
-            \def\i{\fpeval{round(\x+\braidfsc)}}
-            \coordinate (tempA) at ($(i-\i-\theqworldnumeros)!{\fpeval{1-\braidsmoothness}}!(C-\theqworldnumeros)$);
-            \coordinate (tempB) at ($(C-\theqworldnumeros)!{\fpeval{\braidsmoothness}}!(o-\x-\theqworldnumeros)$);
-            \draw[ultra thick,draw = white, double = white, double distance = \pgflinewidth,\lstrandtype]
-            (i-\i-\theqworldnumeros) ..controls (tempA |- C-\theqworldnumeros) and (tempB |- C-\theqworldnumeros)..(o-\x-\theqworldnumeros);
-            \draw[\qwthickness,draw = white, double = \framecolor, double distance = \pgflinewidth,\lstrandtype]
-            (i-\i-\theqworldnumeros) ..controls (tempA |- C-\theqworldnumeros) and (tempB |- C-\theqworldnumeros)..(o-\x-\theqworldnumeros);
+            \def\i{\fpeval{round(\qworldindexx+\braidfsc)}}
+            \coordinate (qworldvertexA) at ($(I-\i-\theqworldnumeros)!{\fpeval{1-\braidsmoothness}}!(C-\theqworldnumeros)$);
+            \coordinate (qworldvertexB) at ($(C-\theqworldnumeros)!{\fpeval{\braidsmoothness}}!(O-\qworldindexx-\theqworldnumeros)$);
+            \draw[ultra thick,draw = white, double = white, double distance = \pgflinewidth,\rstrandtype]
+            (I-\i-\theqworldnumeros) ..controls (qworldvertexA |- C-\theqworldnumeros) and (qworldvertexB |- C-\theqworldnumeros)..(O-\qworldindexx-\theqworldnumeros);
+            \draw[\qworld at thickness,draw = white, double = \rightcolor, double distance = \pgflinewidth,\rstrandtype]
+            (I-\i-\theqworldnumeros) ..controls (qworldvertexA |- C-\theqworldnumeros) and (qworldvertexB |- C-\theqworldnumeros)..(O-\qworldindexx-\theqworldnumeros);
         }
     }{}
-    \ifthenelse{\equal{\boxtype}{sym}}
+    \ifthenelse{\equal{\qworld at box@type}{sym}}
     {
-        \foreach\x in {1,...,\braidbsc}
+        \foreach\qworldindexx in {1,...,\braidbsc}
         {
-            \def\i{\fpeval{round(\x+\braidfsc)}}
-            \coordinate (tempA) at ($(i-\i-\theqworldnumeros)!{\fpeval{1-\braidsmoothness}}!(C-\theqworldnumeros)$);
-            \coordinate (tempB) at ($(C-\theqworldnumeros)!{\fpeval{\braidsmoothness}}!(o-\x-\theqworldnumeros)$);
-            \draw [\qwthickness,\framecolor,\rstrandtype] (i-\i-\theqworldnumeros) ..controls (tempA |- C-\theqworldnumeros) and (tempB |- C-\theqworldnumeros)..(o-\x-\theqworldnumeros);
+            \def\i{\fpeval{round(\qworldindexx+\braidfsc)}}
+            \coordinate (qworldvertexA) at ($(I-\i-\theqworldnumeros)!{\fpeval{1-\braidsmoothness}}!(C-\theqworldnumeros)$);
+            \coordinate (qworldvertexB) at ($(C-\theqworldnumeros)!{\fpeval{\braidsmoothness}}!(O-\qworldindexx-\theqworldnumeros)$);
+            \draw [\qworld at thickness,\rstrandtype, \rightcolor] (I-\i-\theqworldnumeros) ..controls (qworldvertexA |- C-\theqworldnumeros) and (qworldvertexB |- C-\theqworldnumeros)..(O-\qworldindexx-\theqworldnumeros);
         }
-        \foreach\x in{1,...,\braidfsc}
+        \foreach\qworldindexx in {1,...,\braidfsc}
         {
-            \def\i{\fpeval{round(\x+\braidbsc)}}
-            \coordinate (tempA) at ($(i-\x-\theqworldnumeros)!{\fpeval{1-\braidsmoothness}}!(C-\theqworldnumeros)$);
-            \coordinate (tempB) at ($(C-\theqworldnumeros)!{\fpeval{\braidsmoothness}}!(o-\i-\theqworldnumeros)$);
-            \draw [\qwthickness,\framecolor,\lstrandtype] (i-\x-\theqworldnumeros) ..controls (tempA |- C-\theqworldnumeros) and (tempB |- C-\theqworldnumeros)..(o-\i-\theqworldnumeros);
+            \def\i{\fpeval{round(\qworldindexx+\braidbsc)}}
+            \coordinate (qworldvertexA) at ($(I-\qworldindexx-\theqworldnumeros)!{\fpeval{1-\braidsmoothness}}!(C-\theqworldnumeros)$);
+            \coordinate (qworldvertexB) at ($(C-\theqworldnumeros)!{\fpeval{\braidsmoothness}}!(O-\i-\theqworldnumeros)$);
+            \draw [\qworld at thickness,\lstrandtype, \leftcolor] (I-\qworldindexx-\theqworldnumeros) ..controls (qworldvertexA |- C-\theqworldnumeros) and (qworldvertexB |- C-\theqworldnumeros)..(O-\i-\theqworldnumeros);
         }
     }{}
-    \ifthenelse{\equal{\boxtype}{cap}}
+    \ifthenelse{\equal{\qworld at box@type}{cap}}
     {
-        \foreach \qwi in {1,...,\cardportsS}{
-            \def\qwj{\fpeval{\cardportsS-\qwi+1}}
-            \ifnum\qwi<\qwj
-                \draw[midarrow,\qwthickness,\framecolor]
-                    (i-\qwi-\theqworldnumeros) to [out={\dualangle},in={\fpeval{180-\dualangle}}] (i-\qwj-\theqworldnumeros);
+        \foreach \qworldi in {1,...,\qworld at card@ports at S}{
+            \def\qworldj{\fpeval{\qworld at card@ports at S-\qworldi+1}}
+            \ifnum\qworldi<\qworldj
+                \draw[midarrow,\qworld at thickness,\framecolor]
+                    (I-\qworldi-\theqworldnumeros) to [out={\dualangle},in={\fpeval{180-\dualangle}}] (I-\qworldj-\theqworldnumeros);
             \fi
         }
     }{}
-    \ifthenelse{\equal{\boxtype}{cup}}
+    \ifthenelse{\equal{\qworld at box@type}{cup}}
     {
-        \foreach \qwi in {1,...,\cardportsN}{
-            \def\qwj{\fpeval{\cardportsN-\qwi+1}}
-            \ifnum\qwi<\qwj
-                \draw[midarrow,\qwthickness,\framecolor]
-                    (o-\qwi-\theqworldnumeros) to [out={\fpeval{-1*\dualangle}},in={\fpeval{\dualangle-180}}] (o-\qwj-\theqworldnumeros);
+        \foreach \qworldi in {1,...,\qworld at card@ports at N}{
+            \def\qworldj{\fpeval{\qworld at card@ports at N-\qworldi+1}}
+            \ifnum\qworldi<\qworldj
+                \draw[midarrow,\qworld at thickness,\framecolor]
+                    (O-\qworldi-\theqworldnumeros) to [out={\fpeval{-1*\dualangle}},in={\fpeval{\dualangle-180}}] (O-\qworldj-\theqworldnumeros);
             \fi
         }
     }{}
-    \ifthenelse{\equal{\boxtype}{caprev}}
+    \ifthenelse{\equal{\qworld at box@type}{caprev}}
     {
-        \foreach \qwi in {1,...,\cardportsS}{
-            \def\qwj{\fpeval{\cardportsS-\qwi+1}}
-            \ifnum\qwi<\qwj
-                \draw[midarrowinv,\qwthickness,\framecolor]
-                    (i-\qwi-\theqworldnumeros) to [out={\dualangle},in={\fpeval{180-\dualangle}}] (i-\qwj-\theqworldnumeros);
+        \foreach \qworldi in {1,...,\qworld at card@ports at S}{
+            \def\qworldj{\fpeval{\qworld at card@ports at S-\qworldi+1}}
+            \ifnum\qworldi<\qworldj
+                \draw[midarrowinv,\qworld at thickness,\framecolor]
+                    (I-\qworldi-\theqworldnumeros) to [out={\dualangle},in={\fpeval{180-\dualangle}}] (I-\qworldj-\theqworldnumeros);
             \fi
         }
     }{}
-    \ifthenelse{\equal{\boxtype}{cuprev}}
+    \ifthenelse{\equal{\qworld at box@type}{cuprev}}
     {
-        \foreach \qwi in {1,...,\cardportsN}{
-            \def\qwj{\fpeval{\cardportsN-\qwi+1}}
-            \ifnum\qwi<\qwj
-                \draw[midarrowinv,\qwthickness,\framecolor]
-                    (o-\qwi-\theqworldnumeros) to [out={\fpeval{-1*\dualangle}},in={\fpeval{\dualangle-180}}] (o-\qwj-\theqworldnumeros);
+        \foreach \qworldi in {1,...,\qworld at card@ports at N}{
+            \def\qworldj{\fpeval{\qworld at card@ports at N-\qworldi+1}}
+            \ifnum\qworldi<\qworldj
+                \draw[midarrowinv,\qworld at thickness,\framecolor]
+                    (O-\qworldi-\theqworldnumeros) to [out={\fpeval{-1*\dualangle}},in={\fpeval{\dualangle-180}}] (O-\qworldj-\theqworldnumeros);
             \fi
         }
     }{}
-    \ifthenelse{\equal{\boxtype}{spider}}
+    \ifthenelse{\equal{\qworld at box@type}{spider}}
     {
-        \ifnum\cardportsS>0
-            \foreach\x in\PortsS
+        \ifnum\qworld at card@ports at S>0
+            \foreach\qworldindexx in\PortsS
             {
-                \coordinate (tempD) at ($(C-\theqworldnumeros)!0.5!(s-\x-\theqworldnumeros)$);
-                \coordinate (tempA) at ($(tempD)!0.5!(C-\theqworldnumeros)$);
-                \coordinate (tempB) at ($(tempD)!0.5!(s-\x-\theqworldnumeros)$);
-                \coordinate (tempG) at (tempA -| tempD);
-                \coordinate (tempH) at (tempD -| tempB);
-                \draw [\qwthickness,\domarrowtype] (s-\x-\theqworldnumeros) ..controls (tempH) and (tempG) .. (C-\theqworldnumeros);
+                \coordinate (qworldvertexD) at ($(C-\theqworldnumeros)!0.5!(S-\qworldindexx-\theqworldnumeros)$);
+                \coordinate (qworldvertexA) at ($(qworldvertexD)!{\fpeval{\spidersmoothness}}!(C-\theqworldnumeros)$);
+                \coordinate (qworldvertexB) at ($(qworldvertexD)!{\fpeval{\spidersmoothness}}!(S-\qworldindexx-\theqworldnumeros)$);
+                \coordinate (qworldvertexG) at (qworldvertexA -| qworldvertexD);
+                \coordinate (qworldvertexH) at (qworldvertexD -| qworldvertexB);
+                \draw [\qworld at thickness,\domarrowtype] (S-\qworldindexx-\theqworldnumeros) ..controls (qworldvertexH) and (qworldvertexG) .. (C-\theqworldnumeros);
             }
         \fi
-        \ifnum\cardportsN>0
-            \foreach\x in\PortsN
+        \ifnum\qworld at card@ports at N>0
+            \foreach\qworldindexx in\PortsN
             {
-                \coordinate (tempD) at ($(C-\theqworldnumeros)!0.5!(n-\x-\theqworldnumeros)$);
-                \coordinate (tempA) at ($(tempD)!0.5!(C-\theqworldnumeros)$);
-                \coordinate (tempB) at ($(tempD)!0.5!(n-\x-\theqworldnumeros)$);
-                \coordinate (tempG) at (tempA -| tempD);
-                \coordinate (tempH) at (tempD -| tempB);
-                \draw [\qwthickness,\codarrowtype] (C-\theqworldnumeros) ..controls (tempG) and (tempH) .. (n-\x-\theqworldnumeros);
-                  %\draw [\qwthickness,\codarrowtype] (C-\theqworldnumeros) ..controls ([shift={(\qwvelocityx,-\qwspideradjust*\qwvelocityy)}]C-\theqworldnumeros) and ([shift={(\qwvelocityx,-\qwspideradjust*\qwvelocityy)}]n-\x-\theqworldnumeros) .. (n-\x-\theqworldnumeros);
+                \coordinate (qworldvertexD) at ($(C-\theqworldnumeros)!0.5!(N-\qworldindexx-\theqworldnumeros)$);
+                \coordinate (qworldvertexA) at ($(qworldvertexD)!{\fpeval{\spidersmoothness}}!(C-\theqworldnumeros)$);
+                \coordinate (qworldvertexB) at ($(qworldvertexD)!{\fpeval{\spidersmoothness}}!(N-\qworldindexx-\theqworldnumeros)$);
+                \coordinate (qworldvertexG) at (qworldvertexA -| qworldvertexD);
+                \coordinate (qworldvertexH) at (qworldvertexD -| qworldvertexB);
+                \draw [\qworld at thickness,\codarrowtype] (C-\theqworldnumeros) ..controls (qworldvertexG) and (qworldvertexH) .. (N-\qworldindexx-\theqworldnumeros);
             }
         \fi
         \ifx\boxname\empty
-            \draw[\qwthickness,draw=\framecolor,fill=\boxcolor] (C-\theqworldnumeros) circle [x radius={0.1},y radius={0.1}];
+            \draw[\qworld at thickness,draw=\framecolor,fill=\boxcolor] (C-\theqworldnumeros) circle [x radius={0.1},y radius={0.1}];
         \else
-            % \draw[\qwthickness,draw=\framecolor,fill=\boxcolor] (C-\theqworldnumeros) circle [x radius={0.4},y radius={0.4}];
-            % \node[\boxslantstyle] at (C-\theqworldnumeros) [anchor=center]{{\scalebox{\fpeval{min(0.9*\boxhorilen,1-2*\qwfillrate)}}{\color{\morphismcolor}\boxname}}};
-            \def\xradius{\fpeval{0.4*\boxhorilen}}
-            \def\yradius{\fpeval{0.4*\boxverlen-\qwfillrate}}
-            \def\radis{\fpeval{min(\xradius,\yradius)}}    
-            \node[draw={\framecolor}, {\qwthickness}, fill={\boxcolor},
-                  ellipse, minimum width={\fpeval{\xradius}cm}, minimum height={\fpeval{\yradius}cm}
+            \def\qworldxradius{\fpeval{0.4*\boxhorilen}}
+            \def\qworldyradius{\fpeval{0.4*\boxverlen-\qworld at box@fillrate at vertical}}
+            \def\radis{\fpeval{min(\qworldxradius,\qworldyradius)}}    
+            \node[draw={\framecolor}, {\qworld at thickness}, fill={\boxcolor},
+                  ellipse, minimum width={\fpeval{\qworldxradius}cm}, minimum height={\fpeval{\qworldyradius}cm}
                   \boxslantstyle, transform shape] 
-                  (SCALAR-\theqworldnumeros) at (C-\theqworldnumeros) {{\scalebox{\fpeval{0.6*min(\boxhorilen-\qwireinterval+2*\qwfillratex,\boxverlen-2*\qwfillrate)}}{\color{\morphismcolor}\boxname}}};
+                  (SCALAR-\theqworldnumeros) at (C-\theqworldnumeros) {{\scalebox{\fpeval{0.6*min(\boxhorilen-\qworld at wire@interval+2*\qworld at box@fillrate at horizontal,\boxverlen-2*\qworld at box@fillrate at vertical)}}{\color{\morphismcolor}\boxname}}};
         \fi
     }{}
-    \ifthenelse{\equal{\boxtype}{unitobject}}
+    \ifthenelse{\equal{\qworld at box@type}{unitobject}}
     {
         \draw[draw = {\framecolor}, fill = {\boxcolor}, opacity=0] (NE-\theqworldnumeros)--(NW-\theqworldnumeros)--(SW-\theqworldnumeros)--(SE-\theqworldnumeros)--cycle;
     }{}
-    \ifthenelse{\equal{\boxtype}{rpcurl}}
+    \ifthenelse{\equal{\qworld at box@type}{rpcurl}}
     {
-        \foreach \qwindex in {1,...,\cardportsN}{
-            \coordinate (temptempE) at ([shift={({\fpeval{-0.3*\smargin*(\qwindex-1)}},0)}]E-\theqworldnumeros);
-            \draw[\qwthickness] (temptempE) to [in=-\dualangle, out=\dualangle-180] (n-\qwindex-\theqworldnumeros);
+        \foreach \qworldindex in {1,...,\qworld at card@ports at N}{
+            \coordinate (qworldvertexE) at ([shift={({\fpeval{-0.3*\qworld at margin@s*(\qworldindex-1)}},0)}]E-\theqworldnumeros);
+            \draw[\qworld at thickness] (qworldvertexE) to [in=-\dualangle, out=\dualangle-180] (n-\qworldindex-\theqworldnumeros);
         }
-        \foreach \qwindex in {1,...,\cardportsS}{
-            \coordinate (temptempE) at ([shift={({\fpeval{-0.3*\smargin*(\qwindex-1)}},0)}]E-\theqworldnumeros);
-            \draw[ultra thick,draw = white, double = white, double distance = \pgflinewidth] (s-\qwindex-\theqworldnumeros) to [out=\dualangle, in=180-\dualangle] (temptempE);
-            \draw[\qwthickness,draw = white, double = \framecolor, double distance = \pgflinewidth] (s-\qwindex-\theqworldnumeros) to [out=\dualangle, in=180-\dualangle] (temptempE);
+        \foreach \qworldindex in {1,...,\qworld at card@ports at S}{
+            \coordinate (qworldvertexE) at ([shift={({\fpeval{-0.3*\qworld at margin@s*(\qworldindex-1)}},0)}]E-\theqworldnumeros);
+            \draw[ultra thick,draw = white, double = white, double distance = \pgflinewidth] (s-\qworldindex-\theqworldnumeros) to [out=\dualangle, in=180-\dualangle] (qworldvertexE);
+            \draw[\qworld at thickness,draw = white, double = \framecolor, double distance = \pgflinewidth] (s-\qworldindex-\theqworldnumeros) to [out=\dualangle, in=180-\dualangle] (qworldvertexE);
         }
     }{}
 
@@ -1709,54 +1806,54 @@
     \node[\codat] at (\codtype-\codnum-\codid) {\codlabel};
 }
 
-\NewDocumentCommand{\qwI}{O{1} m O{below}}
+\NewDocumentCommand{\qworld at Input}{O{1} m O{\qworld at symbol@input}}
 {
     \addtocounter{qworldnumeros}{-1}%
-    \qwforkeysanalyst{#3}
-    \node[below,\atinfo] at (I-#1-\qwforkeysid) {#2};%
+    \qworld at forkeys@analyst{#3}
+    \node[\qworld at symbol@input,\qworld at forkeys@analyst at atinfo] at (I-#1-\qworld at forkeys@analyst at id) {#2};%
     \stepcounter{qworldnumeros}
 }
 
-\NewDocumentCommand{\qws}{O{1} m O{below}}
+\NewDocumentCommand{\qworld at south}{O{1} m O{\qworld at symbol@input}}
 {
     \addtocounter{qworldnumeros}{-1}%
-    \qwforkeysanalyst{#3}
-    \node[below,\atinfo] at (s-#1-\qwforkeysid) {#2};%
+    \qworld at forkeys@analyst{#3}
+    \node[\qworld at symbol@input,\qworld at forkeys@analyst at atinfo] at (s-#1-\qworld at forkeys@analyst at id) {#2};%
     \stepcounter{qworldnumeros}}
 
-\NewDocumentCommand{\qwS}{O{1} m O{below}}
+\NewDocumentCommand{\qworld at South}{O{1} m O{\qworld at symbol@input}}
 {
     \addtocounter{qworldnumeros}{-1}%
-    \qwforkeysanalyst{#3}
-    \node[below,\atinfo] at (S-#1-\qwforkeysid) {#2};%
+    \qworld at forkeys@analyst{#3}
+    \node[\qworld at symbol@input,\qworld at forkeys@analyst at atinfo] at (S-#1-\qworld at forkeys@analyst at id) {#2};%
     \stepcounter{qworldnumeros}}
 
-\NewDocumentCommand{\qwO}{O{1} m O{above}}
+\NewDocumentCommand{\qworld at Output}{O{1} m O{\qworld at symbol@output}}
 {
     \addtocounter{qworldnumeros}{-1}%
-    \qwforkeysanalyst{#3}
-    \node[above,\atinfo] at (O-#1-\qwforkeysid) {#2};%
+    \qworld at forkeys@analyst{#3}
+    \node[\qworld at symbol@output,\qworld at forkeys@analyst at atinfo] at (O-#1-\qworld at forkeys@analyst at id) {#2};%
     \stepcounter{qworldnumeros}
 }
 
-\NewDocumentCommand{\qwn}{O{1} m O{above}}
+\NewDocumentCommand{\qworld at north}{O{1} m O{\qworld at symbol@output}}
 {
     \addtocounter{qworldnumeros}{-1}%
-    \qwforkeysanalyst{#3}
-    \node[above,\atinfo] at (n-#1-\qwforkeysid) {#2};%
+    \qworld at forkeys@analyst{#3}
+    \node[\qworld at symbol@output,\qworld at forkeys@analyst at atinfo] at (n-#1-\qworld at forkeys@analyst at id) {#2};%
     \stepcounter{qworldnumeros}
 }
 
-\NewDocumentCommand{\qwN}{O{1} m O{above}}
+\NewDocumentCommand{\qworld at North}{O{1} m O{\qworld at symbol@output}}
 {
     \addtocounter{qworldnumeros}{-1}%
-    \qwforkeysanalyst{#3}
-    \node[above,\atinfo] at (N-#1-\qwforkeysid) {#2};%
+    \qworld at forkeys@analyst{#3}
+    \node[\qworld at symbol@output,\qworld at forkeys@analyst at atinfo] at (N-#1-\qworld at forkeys@analyst at id) {#2};%
     \stepcounter{qworldnumeros}
 }
 
-\newcommand{\qwunitobject}[1][at={qworldat}]{
-    \qwboxprocess[unitobject]{#1, P={}}
+\newcommand{\qworld at box@unitobject}[1][at={qworldat}]{
+    \qworld at box@process[unitobject]{#1, P={}}
 }
 \pgfkeys{
     /qworld/forkeys/.cd,
@@ -1764,14 +1861,14 @@
     id/.default=0
 }
 
-\newcommand{\qwforkeysanalyst}[1]
+\newcommand{\qworld at forkeys@analyst}[1]
 {
-    \def\atinfo{}
+    \def\qworld at forkeys@analyst at atinfo{}
     \pgfkeys{
         /qworld/forkeys/.cd, 
         id=\theqworldnumeros
     }
-    \def\qwforkeysid{\forkeysid}
+    \def\qworld at forkeys@analyst at id{\forkeysid}
     \foreach \kvornot in {#1}
     {
         \IfSubStr{\kvornot}{=}
@@ -1780,12 +1877,11 @@
             \pgfkeys{
                 /qworld/forkeys/.cd,id=\result
             }
-            \xdef\qwforkeysid{\forkeysid}
+            \xdef\qworld at forkeys@analyst at id{\forkeysid}
         }{
-            \xdef\atinfo{\kvornot}
+            \xdef\qworld at forkeys@analyst at atinfo{\kvornot}
         }
     }
 }
-\newcommand{\extractid}[1]{%
-    \StrBehind{#1}{id=}[\result]%
-}
+\makeatother
+\endinput
\ No newline at end of file

Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds	2025-04-14 19:50:58 UTC (rev 74943)
+++ trunk/Master/tlpkg/libexec/ctan2tds	2025-04-14 19:51:45 UTC (rev 74944)
@@ -1907,6 +1907,7 @@
  'quran-en'		=> '&POST_onelevel',
  'quran-es'		=> '&POST_onelevel',
  'quran-id'		=> '&POST_onelevel',
+ 'qworld'		=> '&POST_onelevel',
  'randintlist'		=> '&POST_onelevel',
  'recipebook'		=> '&POST_rmsymlink',
  'regulatory'		=> '&POST_onelevel',



More information about the tex-live-commits mailing list.