texlive[68657] Master: physics2 (26oct23)

commits+karl at tug.org commits+karl at tug.org
Thu Oct 26 21:51:23 CEST 2023


Revision: 68657
          https://tug.org/svn/texlive?view=revision&revision=68657
Author:   karl
Date:     2023-10-26 21:51:23 +0200 (Thu, 26 Oct 2023)
Log Message:
-----------
physics2 (26oct23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/physics2/README.md
    trunk/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex
    trunk/Master/texmf-dist/doc/latex/physics2/physics2-legacy.pdf
    trunk/Master/texmf-dist/doc/latex/physics2/physics2-legacy.tex
    trunk/Master/texmf-dist/doc/latex/physics2/physics2.pdf
    trunk/Master/texmf-dist/doc/latex/physics2/physics2.tex
    trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.braket.sty
    trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.legacy.sty
    trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.sty
    trunk/Master/texmf-dist/tex/latex/physics2/phy-bm-um.legacy.sty
    trunk/Master/texmf-dist/tex/latex/physics2/phy-braket.sty
    trunk/Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty
    trunk/Master/texmf-dist/tex/latex/physics2/phy-doubleprod.sty
    trunk/Master/texmf-dist/tex/latex/physics2/phy-nabla.legacy.sty
    trunk/Master/texmf-dist/tex/latex/physics2/phy-op.legacy.sty
    trunk/Master/texmf-dist/tex/latex/physics2/phy-qtext.legacy.sty
    trunk/Master/texmf-dist/tex/latex/physics2/phy-xmat.sty
    trunk/Master/texmf-dist/tex/latex/physics2/physics2.sty
    trunk/Master/tlpkg/libexec/ctan2tds

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/physics2/physics2-code.pdf
    trunk/Master/texmf-dist/source/latex/physics2/
    trunk/Master/texmf-dist/source/latex/physics2/physics2-code.dtx
    trunk/Master/texmf-dist/source/latex/physics2/physics2.ins

Removed Paths:
-------------
    trunk/Master/texmf-dist/tex/latex/physics2/phy-common.sty
    trunk/Master/texmf-dist/tex/latex/physics2/phy-explsetup.sty

Modified: trunk/Master/texmf-dist/doc/latex/physics2/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/physics2/README.md	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/doc/latex/physics2/README.md	2023-10-26 19:51:23 UTC (rev 68657)
@@ -24,4 +24,5 @@
 This work has the LPPL maintenance status `maintained`.
 
 The Current Maintainer of this work is
-[Zhang Tingxuan](https://www.ctan.org/author/zhang-tx).
\ No newline at end of file
+[Zhang Tingxuan](https://www.ctan.org/author/zhang-tx).
+

Modified: trunk/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex	2023-10-26 19:51:23 UTC (rev 68657)
@@ -22,8 +22,8 @@
 \hypersetup{colorlinks,urlcolor=magenta,linkcolor=black,filecolor=blue,
   pdfstartview=FitH,pdfview=FitH,pdfcreator=XeTeX output}
 \def\s at pkg#1{\texorpdfstring{\textcolor{pkgcolor}{\textsf{#1}}}{“#1”}}
-\def\@pkg#1{\texorpdfstring{\hyperref{https://www.ctan.org/pkg/#1}%
-  {}{}{\textcolor{pkgcolor}{\textsf{#1}}}}{“#1”}}
+\def\@pkg#1{\texorpdfstring{\href{https://www.ctan.org/pkg/#1}%
+  {\textcolor{pkgcolor}{\textsf{#1}}}}{“#1”}}
 \DeclareRobustCommand\pkg{\@ifstar\@pkg\s at pkg}
 \def\modu#1{\texorpdfstring{\textcolor{moducolor}{\textsf{#1}}}{“#1”}}
 \def\opt#1{\texorpdfstring{\texttt{#1}}{“#1”}}
@@ -64,7 +64,7 @@
 \newenvironment{example}
   {\stepcounter{example}\example at start}{\example at end}
 \author{Zhang Tingxuan}
-\date{2023/04/02\quad Version 0.2.1\thanks{%
+\date{2023/10/24\quad Version 1.0.0\thanks{%
   \url{https://www.github.com/AlphaZTX/physics2}}}
 \makeatother
-\endinput
\ No newline at end of file
+\endinput

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

Index: trunk/Master/texmf-dist/doc/latex/physics2/physics2-code.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/physics2/physics2-code.pdf	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/doc/latex/physics2/physics2-code.pdf	2023-10-26 19:51:23 UTC (rev 68657)

Property changes on: trunk/Master/texmf-dist/doc/latex/physics2/physics2-code.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/physics2/physics2-legacy.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/physics2/physics2-legacy.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/physics2/physics2-legacy.tex	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/doc/latex/physics2/physics2-legacy.tex	2023-10-26 19:51:23 UTC (rev 68657)
@@ -10,7 +10,12 @@
 \usepackage{unicode-math}
 \setmainfont{Libertinus Serif}
 \setsansfont{Libertinus Sans}
-\setmonofont{Noto Sans Mono}[Scale=MatchLowercase]
+\setmonofont{NotoSansMono}[
+  Scale=MatchLowercase,
+  Extension=.ttf,
+  UprightFont=*-Light,
+  BoldFont=*-Medium
+]
 \setmathfont{Libertinus Math}
 \usepackage{physics2}
 \usephysicsmodule{ab}
@@ -35,7 +40,7 @@
 \item Users who failed to use \pkg*{unicode-math} with \pkg{physics}.
 \end{itemize}
 It seems no reason for any other user to read \emph{this} document instead of
-the \hyperref{./physics2.pdf}{}{}{package documentation} of \pkg{physics2},
+the \href{./physics2.pdf}{package documentation} of \pkg{physics2},
 because this document cannot describe the package in detail.
 
 In this document, the modules of \pkg{physics2} will be introduced in
@@ -85,9 +90,9 @@
 
 Moreover, the code of \texttt{physics.sty} ``abuses'' the \texttt{g}-type
 arguments of \pkg*{xparse} package. Therefore the syntax of \pkg{physics} package
-looks kind of weird. See \hyperref{https://tex.stackexchange.com/questions/%
+looks kind of weird. See \href{https://tex.stackexchange.com/questions/%
 470819/macros-dv-and-pdv-eat-the-subsequent-parenthesis-argument/470842#470842}%
-{}{}{here} for more.
+{here} for more.
 
 \subsection{Loading \pkg{physics2}}
 The \pkg{physics2} package includes different modules, among which every module
@@ -97,9 +102,8 @@
 \begin{Verbatim}
 \usepackage{physics2}
 \end{Verbatim}
-But this is not enough. \pkg{physics2} contains different modules, among which,
-only the \modu{common} module would be loaded automatically by the package.
-If you want to load other modules of \pkg{physics2}, write this after loading
+But this is not enough. \pkg{physics2} contains different modules.
+If you want to load any module of \pkg{physics2}, write this line after loading
 \pkg{physics2} package:
 \begin{displayed}
 \cs{usephysicsmodule}\marg{module list}
@@ -241,7 +245,7 @@
 If you prefer to use \pkg{bm}, you can also use the \cs{bm} command.
 What's more, if you tried the commands above, you might find that,
 the result of \cs{va} above is different from that of \pkg{physics}.
-This is beacuse, if you choose to present a vector in bold, it's alomost
+This is because, if you choose to present a vector in bold, there's almost
 no need to put a \cs{vec} ($\vec{\mskip9mu}$) sign above it.
 
 However, the method above may not work well with \pkg*{unicode-math}
@@ -274,7 +278,7 @@
 The \modu{nabla.legacy} requires the \pkg*{fixdif} package at least
 version 2.0 (file date: 2023/01/31 or after 2023/01/31).
 
-By the way, if you are used to write \cs{bm} for a vector but interested in
+By the way, if you are used to writing \cs{bm} for a vector but interested in
 \pkg{unicode-math}, the \modu{bm-um.legacy} module would be a passable
 alternative to \pkg{bm} package. Notice that the \cs{bm} command from the
 \modu{bm-um.legacy} module can only take \emph{one} letter (or \emph{one} digit)
@@ -294,7 +298,7 @@
 
 The \pkg{physics} package provides a bundle of commands for log-like functions
 that have not been defined in the \LaTeXe\ kernel. Those log-like functions
-can be used with the \modu{op.legacy} module; this module do not support
+can be used with the \modu{op.legacy} module; this module does not support
 the syntax of \pkg{physics} either. For example:
 \begin{example}
 % \usephysicsmodule{op.legacy}
@@ -303,7 +307,7 @@
 The \cs{Re} and \cs{Im} commands are redefined as operators ``$\Re$'' and
 ``$\Im$'', while $\Resymbol$ and $\Imsymbol$ are reserved as \cs{Resymbol} and
 \cs{Imsymbol}. $\Resymbol$ and $\Imsymbol$ are ordinary symbols but $\Re$ and
-$\Im$ are opetators.
+$\Im$ are operators.
 
 \subsection{Quick quad text}\label{subsec:qtext}
 The \modu{qtext.legacy} module provides the \cs{q}\meta{foo} commands
@@ -317,9 +321,9 @@
 \[ F \qif G \qthen H \]
 \end{example}
 All the commands described in \S2.4 of
-\hyperref{http://mirrors.ctan.org/macros/latex/contrib/physics/physics.pdf}{}{}%
+\href{http://mirrors.ctan.org/macros/latex/contrib/physics/physics.pdf}%
 {\textsf{physics} documentation} are supported when using \modu{qtext.legacy}
-module, but I don't recommend to use this module unless you are maintaining a
+module, but I don't recommend using this module unless you are maintaining a
 document written with \pkg{physics}'s \cs{q}\meta{foo} commands.
 
 \subsection{Derivatives}
@@ -334,10 +338,10 @@
 Math ($\d x$) v.s.\ Text (\d x)
 \end{example}
 Here are the documentations of
-\hyperref{http://mirrors.ctan.org/macros/latex/contrib/fixdif/fixdif.pdf}%
-{}{}{\textsf{fixdif}} and
-\hyperref{http://mirrors.ctan.org/macros/latex/contrib/derivative/derivative%
-.pdf}{}{}{\textsf{derivative}}.
+\href{http://mirrors.ctan.org/macros/latex/contrib/fixdif/fixdif.pdf}%
+{\textsf{fixdif}} and
+\href{http://mirrors.ctan.org/macros/latex/contrib/derivative/derivative%
+.pdf}{\textsf{derivative}}.
 
 \pkg{fixdif}'s commands behave better in superscripts and subscripts.
 
@@ -401,7 +405,7 @@
 \end{example}
 The argument of \cs{ketbra} should be delimited with \opt{|} and \opt{|}.
 In the argument, \opt{>} and \opt{<} will be regarded as extensible $\rangle$
-and $\langle$. that is,
+and $\langle$. That is,
 \begin{center}
 \cs{ketbra} \opt{|} \meta{subformula$_1$} \opt{>} \meta{optional}
   \opt{<} \meta{subformula$_2$} \opt{|}
@@ -456,7 +460,7 @@
    \braket[big] {\0} {\psi} \]
 \end{example}
 If you want \cs{braket} to take one or three arguments, you can write the
-number of arguments in the sqare bracket. If you need to specify the size
+number of arguments in the square bracket. If you need to specify the size
 of bra-ket simultaneously, you need to separate the number and the size with
 a comma:
 \begin{example}

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

Modified: trunk/Master/texmf-dist/doc/latex/physics2/physics2.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/physics2/physics2.tex	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/doc/latex/physics2/physics2.tex	2023-10-26 19:51:23 UTC (rev 68657)
@@ -10,7 +10,12 @@
 \usepackage{unicode-math}
 \setmainfont{Libertinus Serif}
 \setsansfont{Libertinus Sans}
-\setmonofont{Noto Sans Mono}[Scale=MatchLowercase]
+\setmonofont{NotoSansMono}[
+  Scale=MatchLowercase,
+  Extension=.ttf,
+  UprightFont=*-Light,
+  BoldFont=*-Medium
+]
 \setmathfont{Libertinus Math}
 \usepackage{physics2}
 \usephysicsmodule{ab,ab.braket}
@@ -31,7 +36,7 @@
 
 This document describes the \pkg{physics2} package in more detail.
 But if you are a user of the legacy \pkg{physics} package, you can click
-\hyperref{./physics2-legacy.pdf}{}{}{here} to see the documention for
+\href{./physics2-legacy.pdf}{here} to see the documentation for
 \pkg{physics} users before you start. If you never used \pkg{physics} package
 before, just read \emph{this} documentation.
 \end{abstract}
@@ -55,17 +60,17 @@
 The \pkg{physics2} package requires \LaTeXe\ kernel released after 2020/10.
 Please make sure that your \LaTeX\ distribution is not too old.
 
-\subsection{Loading the \pkg{physics2} package}
+\subsection{Loading \pkg{physics2} and its modules}
 Just like loading any package, write
 \begin{Verbatim}
 \usepackage{physics2}
 \end{Verbatim}
-in the preamble to load the \pkg{physics2} package. In this version,
+in the preamble to load the \pkg{physics2} package. In the current version,
 \pkg{physics2} doesn't provide a package option.
 
-However, \pkg{physics2} itself only provides very few functions. Actually, it
-just provides a method to load modules. You need to load different modules of
-\pkg{physics2} to have different kinds of functions applied to your document.
+\pkg{physics2} itself doesn't provide many features. 
+You need to load different modules of \pkg{physics2} to have different
+features applied to your document.
 
 \subsection{Loading a module of \pkg{physics2}}
 You can load a module of \pkg{physics2} only \emph{after} you write
@@ -75,7 +80,7 @@
 \cs{usephysicsmodule}\marg{module}
 \end{center}
 The usage of \cs{usephysicsmodule} is similar to \cs{usepackage}, so you can
-load more than one modules in one line. For example,
+load several modules in one line. For example,
 \begin{Verbatim}
 \usephysicsmodule{ab,ab.braket}
 \end{Verbatim}
@@ -91,19 +96,12 @@
 \opt{tightbraces\:=\:true} and load \modu{ab.braket} and \modu{doubleprod}
 modules.
 
-\pardanger
-The \modu{common} module will be loaded automatically when you load the
-\pkg{physics2} package and \emph{only} the \modu{common} module will be
-loaded automatically. Any other module should be loaded manually by writing
-\cs{usephysicsmodule}\marg{module} after you loaded \pkg{physics2} in the
-preamble.
-
 The following sections introduce all the user-level modules of \pkg{physics2}.
 View back to the table of contents to see the names of user-level modules.
 
 \section{Modules of \pkg{physics2}}
-\subsection{The automatically loaded \modu{common} module}
-The \modu{common} module provides the following commands:
+\subsection{Features of the bare \pkg{physics2} package}
+The following commands are available once you load \pkg{physics2} in preamble.
 
 \cs{delopen} and \cs{delclose}, followed by a math delimiter. They can be
 regarded as abbreviations of ``open delimiter'' and ``close delimiter''. If
@@ -127,6 +125,14 @@
 \cs{bigggl}, \cs{bigggm}, \cs{bigggr}, \cs{Bigggl}, \cs{Bigggm} and \cs{Bigggr}
 are also supported.
 
+\textbf{Note:}
+If you had heard version $0.x.y$ of \pkg{physics2}, you might know the
+\modu{common} module. Now the \modu{common} module is included in
+\pkg{physics2}.sty --- the source file of \modu{common} module is deleted
+but all the features of \modu{common} are reserved. Those commands above
+used to be provided by \modu{common} module, but now they are provided by
+\pkg{physics2}.
+
 \subsection{The \modu{ab} module --- automatic braces}
 This module provides the command \cs{ab}. The \cs{ab} command, as a shorthand
 of ``automatic braces'', would specify the size of the following pair of
@@ -237,7 +243,7 @@
 \end{example}
 The argument of \cs{ketbra} should be delimited with \opt{|} and \opt{|}.
 In the argument, \opt{>} and \opt{<} will be regarded as extensible $\rangle$
-and $\langle$. that is,
+and $\langle$. That is,
 \begin{center}
 \cs{ketbra} \opt{|} \meta{subformula$_1$} \opt{>} \meta{optional}
   \opt{<} \meta{subformula$_2$} \opt{|}
@@ -298,7 +304,7 @@
    \braket[big] {\0} {\psi} \]
 \end{example}
 If you want \cs{braket} to take one or three arguments, you can write the
-number of arguments in the sqare bracket. If you need to specify the size
+number of arguments in the square bracket. If you need to specify the size
 of bra-ket simultaneously, you need to separate the number and the size with
 a comma:
 \begin{example}
@@ -454,7 +460,7 @@
 \]
 \end{example}
 In the value of \opt{format} key, \verb|#1| stands for the common entry,
-or the first mandotary \meta{entry} argument of \cs{xmat}; \verb|#2|
+or the first mandatory \meta{entry} argument of \cs{xmat}; \verb|#2|
 stands for the row index and \verb|#3| stands for the column index.
 
 This module requires \pkg{amsmath}.
@@ -467,7 +473,7 @@
 \section{The ``legacy'' modules}
 The legacy modules have similar names like \meta{module}\opt{.legacy}. Most of
 them are designed to provide solutions to maintain documents written with the
-legacy \pkg{physics} package. It's not suggest to use them in a new document.
+legacy \pkg{physics} package. It's not suggested to use them in a new document.
 
 \subsection{The \modu{ab.legacy} module}
 This module provides the following commands:
@@ -474,7 +480,7 @@
 \begin{Verbatim}[fontsize=\small]
 \abs   \norm   \eval   (\peval   \beval)   \order
 \end{Verbatim}
-They shares the same syntax as \meta{cmd}\opt{*}\oarg{biggg}\marg{subformula}.
+They share the same syntax as \meta{cmd}\opt{*}\oarg{biggg}\marg{subformula}.
 Star and \meta{biggg} are optional. Star stands for ``use the default size''.
 For example,
 \begin{example}
@@ -564,6 +570,6 @@
 \subsection{The \modu{qtext.legacy} module}
 This module was written just to offer a method to maintain documents written
 with the legacy \pkg{physics} package. See \S\ref*{lega-subsec:qtext} of
-\hyperref{./physics2-legacy.pdf}{}{}{physics2-legacy} for more information.
+\href{./physics2-legacy.pdf}{physics2-legacy} for more information.
 
 \end{document}
\ No newline at end of file

Added: trunk/Master/texmf-dist/source/latex/physics2/physics2-code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/physics2/physics2-code.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/physics2/physics2-code.dtx	2023-10-26 19:51:23 UTC (rev 68657)
@@ -0,0 +1,1345 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.3c of this license or (at your option) any later
+% version. The latest version of this license is in:
+%
+%   http://www.latex-project.org/lppl.txt
+%
+% and version 1.3 or later is part of all distributions of
+% LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Zhang Tingxuan.
+%
+% This work consists of the files physics2-code.dtx,
+%           and the derived files physics2.ins,
+%                                 physics2.sty,
+%                                 phy-<module>.sty,
+%                                 physics2-code.pdf,
+%                             and README.md.
+%
+%<*internal>
+\iffalse
+%</internal>
+%
+%<*readme>
+# The `physics2` package
+
+This package defines commands for typesetting math formulae faster and
+more simply. `physics2` is a modularized package, each module provides its
+own function while `physics2.sty` itself only provides very few functions.
+Therefore you can load modules separately after loading `physics2`.
+
+Modules of `physics2` provide the following supports:
+
+- Automatic braces;
+- Dirac bra-ket notation;
+- Easy way to typeset diagonal matrices and matrices with similar entries;
+- Double cross and double dot (binary) operators for tensors;
+
+**Welcome to pull requests
+[here](https://github.com/AlphaZTX/physics2/pulls).**
+
+## License
+
+This work may be distributed and/or modified under the conditions of the
+[LaTeX Project Public License](http://www.latex-project.org/lppl.txt),
+either version 1.3c of this license or (at your option) any later version.
+
+This work has the LPPL maintenance status `maintained`.
+
+The Current Maintainer of this work is
+[Zhang Tingxuan](https://www.ctan.org/author/zhang-tx).
+
+%</readme>
+%
+%<*internal>
+\fi
+\begingroup
+  \def\NameOfLaTeXe{LaTeX2e}
+\expandafter\endgroup\ifx\NameOfLaTeXe\fmtname\else
+\csname fi\endcsname
+%</internal>
+%
+%<*install>
+\input docstrip.tex
+\keepsilent
+
+\preamble
+
+  Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
+
+  This work may be distributed and/or modified under the
+  conditions of the LaTeX Project Public License, either
+  version 1.3c of this license or (at your option) any later
+  version. The latest version of this license is in:
+
+    http://www.latex-project.org/lppl.txt
+
+  and version 1.3 or later is part of all distributions of
+  LaTeX version 2005/12/01 or later.
+ 
+  This work has the LPPL maintenance status `maintained'.
+ 
+  The Current Maintainer of this work is Zhang Tingxuan.
+
+  This work consists of the files physics2-code.dtx,
+            and the derived files physics2.ins,
+                                  physics2.sty,
+                                  phy-<module>.sty,
+                                  physics2-code.pdf,
+                              and README.md.
+
+\endpreamble
+
+\generate{
+  \usedir{tex/latex/physics2}
+    \file{physics2.sty}          {\from{physics2-code.dtx}{package}}
+    \file{phy-ab.sty}            {\from{physics2-code.dtx}{ab}}
+    \file{phy-ab.braket.sty}     {\from{physics2-code.dtx}{ab.braket}}
+    \file{phy-braket.sty}        {\from{physics2-code.dtx}{braket}}
+    \file{phy-diagmat.sty}       {\from{physics2-code.dtx}{diagmat}}
+    \file{phy-doubleprod.sty}    {\from{physics2-code.dtx}{doubleprod}}
+    \file{phy-xmat.sty}          {\from{physics2-code.dtx}{xmat}}
+    \file{phy-ab.legacy.sty}     {\from{physics2-code.dtx}{ab.legacy}}
+    \file{phy-bm-um.legacy.sty}  {\from{physics2-code.dtx}{bm-um.legacy}}
+    \file{phy-nabla.legacy.sty}  {\from{physics2-code.dtx}{nabla.legacy}}
+    \file{phy-op.legacy.sty}     {\from{physics2-code.dtx}{op.legacy}}
+    \file{phy-qtext.legacy.sty}  {\from{physics2-code.dtx}{qtext.legacy}}
+%</install>
+%<*internal>
+  \usedir{source/latex/physics2}
+    \file{physics2.ins}          {\from{physics2-code.dtx}{install}}
+%</internal>
+%<*install>
+  \usedir{doc/latex/physics2}
+  \nopreamble\nopostamble
+    \file{README.md}             {\from{physics2-code.dtx}{readme}}
+}
+
+\obeyspaces
+\Msg{**********************************************************}
+\Msg{*                                                        *}
+\Msg{*  To finish the installation you have to move the       *}
+\Msg{*  following files into a directory searched by TeX:     *}
+\Msg{*                                                        *}
+\Msg{*                    physics2.sty,                       *}
+\Msg{*  (for all modules) phy-<module>.sty.                   *}
+\Msg{*                                                        *}
+\Msg{*  The recommended directory is                          *}
+\Msg{*    TEXMFDIST/tex/latex/physics2                        *}
+\Msg{*                                                        *}
+\Msg{*  To produce the documentation, run the file            *}
+\Msg{*  physics2-code.dtx through XeLaTeX or LuaLaTeX.        *}
+\Msg{*  XeLaTeX is recommended.                               *}
+\Msg{*                                                        *}
+\Msg{*  Happy TeXing!                                         *}
+\Msg{*                                                        *}
+\Msg{**********************************************************}
+
+\endbatchfile
+%</install>
+%
+%<*internal>
+\fi
+%</internal>
+%
+%<*driver>
+\ProvidesFile{fixdif.dtx}[2023/03/20 (c) Copyright 2022-2023 by Zhang Tingxuan]
+\documentclass{l3doc}
+\usepackage{doc}
+\hypersetup{hidelinks}
+\usepackage{color}
+\definecolor{pkgcolor}{RGB}{0,120,80}
+\definecolor{moducolor}{RGB}{0,0,150}
+\definecolor{gray}{rgb}{.5,.5,.5}
+\DeclareRobustCommand\pkg[1]{\texorpdfstring{\textcolor{pkgcolor}{\textsf{#1}}}{“#1”}}
+\DeclareRobustCommand\modu[1]{\texorpdfstring{\textcolor{moducolor}{\textsf{#1}}}{“#1”}}
+\DeclareRobustCommand\note{\textbf{Note:} }
+\usepackage{amsmath}
+\usepackage{fontspec}
+\setmonofont{Latin Modern Mono Light}
+\usepackage{fancyvrb}
+\fvset{gobble=2,xleftmargin=2em}
+\usepackage{physics2}
+\usephysicsmodule{ab}
+\makeatletter
+\@addtoreset{CodelineNo}{section}
+\newbox\@tempboxb
+\DeclareDocumentCommand\macrodef{O{4em}O{.6}mo+m}{\leavevmode
+\ensuremath{%
+  \setbox\@tempboxa\hbox to #1 {\hss\cs{#3}}%
+  \setbox\@tempboxb\vbox{\hsize=#2\textwidth
+    \textwidth=\hsize
+    \leftskip=\z@
+    \parindent=\z@
+    \textbf{begindef}\IfValueT{#4}{ \textcolor{gray}{(#4)}}\par
+    \begingroup\leftskip2em\parindent-1em#5\par\endgroup
+    \textbf{enddef}%
+  }%
+  \dp\@tempboxb=\dimexpr\ht\@tempboxb-\ht\@tempboxa\relax
+  \ht\@tempboxb=\ht\@tempboxa
+  \box\@tempboxa\leftarrow\box\@tempboxb
+}}
+\protected\long\def\macroifelse#1#2#3{\par
+  \textbf{if} #1 \textbf{then}\par
+  \begingroup\advance\leftskip1em#2\par\endgroup
+  \textbf{else}\par
+  \begingroup\advance\leftskip1em#3\par\endgroup
+  \textbf{endif}\par
+}
+\protected\long\def\macroif#1#2{\par
+  \textbf{if} #1 \textbf{then}\par
+  \begingroup\advance\leftskip1em#2\par\endgroup
+  \textbf{endif}\par
+}
+\protected\def\macrocr{\par}
+\newdimen\ttwd
+\protected\def\updatettwd{%
+  \setbox\@tempboxa\hbox{\normalsize\ttfamily a}
+  \ttwd=\wd\@tempboxa
+}
+\updatettwd
+\makeatother
+\title{Code documentation to the \pkg{physics2} package}
+\author{Zhang Tingxuan}
+\date{2023/10/24 v1.0.0}
+\begin{document}
+  \DocInput{physics2-code.dtx}
+\end{document}
+%</driver>
+% \fi
+% 
+% \maketitle
+% 
+% \tableofcontents\newpage
+%
+%^^A******************************************************************************** [physics2.sty]
+% \part{The bare \pkg{physics2}}
+% \section{The \pkg{physics2} package}
+%    \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}[2020/10/01]
+\ProvidesPackage{physics2}
+  [2023/10/24 v1.0.0 Tools for typesetting math for physics.]
+%    \end{macrocode}
+% \subsection{Common variables}
+% \begin{variable}{\phy at temp..}
+%   \begin{syntax}
+%     \cs{phy at temp}\meta{register type}\meta{a|b|c}
+%   \end{syntax}
+%   Some \LaTeXe\ variables starting with ``|\phy at temp|''. 
+%   These variables can be shared by any module of \pkg{physics2}.
+% \end{variable}
+%    \begin{macrocode}
+\newcount  \phy at tempcnta
+\newdimen  \phy at tempdima
+\newdimen  \phy at tempdimb
+\newskip   \phy at tempskipa
+\newmuskip \phy at tempmuskipa
+\newbox    \phy at tempboxa
+\newif     \ifphy at tempswa
+\newtoks   \phy at toksa
+%    \end{macrocode}
+% \subsection{Package requirements and module-loading methods}
+% \pkg{physics2} requires \pkg{keyval} (part of the graphics bundle) to 
+% process options of modules.
+%    \begin{macrocode}
+\RequirePackage{keyval}
+\def\phy at true{true}
+\def\phy at false{false}
+%    \end{macrocode}
+% \begin{function}{\phy at define@key, \phy at setkeys, \phy at processkeyopt}
+%   \begin{syntax}
+%     \cs{phy at define@key} \marg{module} \marg{key} \oarg{default value} \marg{code}
+%     \cs{phy at setkeys} \marg{module} \marg{key-val list}
+%     \cs{phy at processkeyopt} \marg{module}
+%   \end{syntax}
+%   The position of \cs{phy at processkeyopt} in a \pkg{physics2} module is just the same
+%   as the position of \cs{ProcessOptions} in a regular \LaTeX\ package.
+% \end{function}
+%    \begin{macrocode}
+\long\def\phy at define@key#1{\define at key{phy-#1}}
+\long\def\phy at setkeys#1{\setkeys{phy-#1}}
+\def\phy at processkeyopt#1{\let\reserved at a\@empty%
+  \edef\reserved at a{\@ptionlist{\@currname.\@currext}}%
+  \edef\reserved at a{\noexpand\phy at setkeys{#1}{\reserved at a}}%
+  \reserved at a% the next line thanks to `geometry'
+  \AtEndOfPackage{\let\@unprocessedoptions\relax}}
+%    \end{macrocode}
+% We use almost the same way to load \pkg{physics2} modules as \LaTeXe\ kernel
+% does. We use a lot of kernel commands in \LaTeXe.
+% 
+% \begin{function}{\usephysicsmodule, \phy at requiremodule}
+%   \begin{syntax}
+%     \cs{usephysicsmodule} \oarg{key-val options} \marg{module} \oarg{key-val options}
+%     \cs{phy at requiremodule} \oarg{key-val options} \marg{module} \oarg{key-val options}
+%   \end{syntax}
+%   \cs{usephysicsmodule} is a user command, and \cs{phy at requiremodule} is a developer
+%   command.
+% \end{function}
+%    \begin{macrocode}
+\def\usephysicsmodule{\phy at FWoptions\@pkgextension}
+\let\phy at requiremodule\usephysicsmodule
+\@onlypreamble\usephysicsmodule
+\def\phy at FWoptions#1{\@ifnextchar[%]
+  {\phy at FW@ptions#1}{\phy at FW@ptions#1[]}}
+\@onlypreamble\phy at FWoptions
+\def\phy at FW@ptions#1[#2]#3{\@ifnextchar[%]
+  {\phy at FW@pti at ns#1[{#2}]#3}{\phy at FW@pti at ns#1[{#2}]#3[]}}
+\@onlypreamble\phy at FW@ptions
+\def\phy at FW@pti at ns#1[#2]#3[#4]{%
+  \def\reserved at b##1,{%
+    \ifx\@nnil##1\relax\else
+      \ifx\@nnil##1\@nnil\else
+       \noexpand\@onefilewithoptions{phy-##1}[{\unexpanded{#2}}][{#4}]%
+       \noexpand\@pkgextension
+      \fi
+      \expandafter\reserved at b
+    \fi}%
+    \edef\reserved at a{\zap at space#3 \@empty}%
+    \edef\reserved at a{\expandafter\reserved at b\reserved at a,\@nnil,}%
+  \reserved at a}
+\@onlypreamble\phy at FW@pti at ns
+%    \end{macrocode}
+% \subsection{The (used to be) \modu{common} module}
+% The code below used to be the automatically-loaded \modu{common} module,
+% but now we load it together with \pkg{physics2}'s code. This change may
+% bring better performance in Windows system.
+% 
+% Check if \pkg{unicode-math} loaded and (re)define the vert symbols.
+% The \cs{relax}'s at the ends of \cs{vert} and \cs{Vert}'s definitions must not be
+% removed. They are for \cs{ifx} to compare. \pkg{unicode-math} sets these symbols
+% \cs{fam}1, \cs{symoperators} is equal to 1 in \LaTeXe\ kernel. Moreover, we make
+% \cs{mid} as a delimiter but it may not work.
+%    \begin{macrocode}
+\AtBeginDocument{\ifcsname symrm\endcsname
+  \protected\def\|{\Udelimiter 0 \symoperators "2016 }%
+  \protected\def\vert{\Udelimiter 0 \symoperators "007C\relax}%
+  \protected\def\Vert{\Udelimiter 0 \symoperators "2016\relax}%
+  \protected\def\mid{\Udelimiter 3 \symoperators "007C }%
+\fi}
+\protected\def\Vert{\delimiter"026B30D\relax}
+\protected\def\mid{\delimiter"326A30C }
+%    \end{macrocode}
+% \begin{function}{\delopen, \delclose}
+%   \begin{syntax}
+%     \cs{delopen} \meta{left delimiter}
+%     \cs{delclose} \meta{right delimiter}
+%   \end{syntax}
+%   Actually in \TeX, \cs{left} and \cs{right} will enclose the subformula as ``inner'',
+%   but \cs{delopen} and \cs{delclose} will make the subformula an empty open node and
+%   a non-empty close node.
+% \end{function}
+%    \begin{macrocode}
+\DeclareRobustCommand\delopen{\mathopen{}\mathclose\bgroup\left}
+\DeclareRobustCommand\delclose{\aftergroup\egroup\right}
+% Extension to 2e kernel's or amsmath's biggggg commands.
+%    \end{macrocode}
+% \cs{bBigg@} is a command from \pkg{amsmath}. The code below should
+% update with \pkg{amsmath} together.
+%    \begin{macrocode}
+\ifdefined\bBigg@
+  \DeclareRobustCommand\biggg{\bBigg@{3}}
+  \DeclareRobustCommand\Biggg{\bBigg@{3.5}}
+\else
+  \DeclareRobustCommand\biggg[1]{\leavevmode at ifvmode
+    {\hbox{$\left#1\vbox to20.5\p@{}\right.\n at space$}}}
+  \DeclareRobustCommand\Biggg[1]{\leavevmode at ifvmode
+    {\hbox{$\left#1\vbox to23.5\p@{}\right.\n at space$}}}
+  \AtBeginDocument{\ifdefined\bBigg@
+    \DeclareRobustCommand\biggg{\bBigg@{3}}%
+    \DeclareRobustCommand\Biggg{\bBigg@{3.5}}%
+  \fi}
+\fi
+\DeclareRobustCommand\bigggl{\mathopen\biggg}
+\DeclareRobustCommand\bigggm{\mathrel\biggg}
+\DeclareRobustCommand\bigggr{\mathclose\biggg}
+\DeclareRobustCommand\Bigggl{\mathopen\Biggg}
+\DeclareRobustCommand\Bigggm{\mathrel\Biggg}
+\DeclareRobustCommand\Bigggr{\mathclose\Biggg}
+%    \end{macrocode}
+% \begin{function}{\phy at mathvphantom}
+%   \begin{syntax}
+%     \cs{phy at mathvphantom} \marg{math mode material}
+%   \end{syntax}
+%   This command is just like \cs{vphantom} in \LaTeXe\ kernel but only works
+%   in math mode.
+% \end{function}
+%    \begin{macrocode}
+\def\phy at mathvphantom#1{\setbox\phy at tempboxa=\hbox{}%
+  \mathchoice
+    {\setbox\@tempboxa\hbox{$\displaystyle#1$}%
+      \ht\phy at tempboxa=\ht\@tempboxa
+      \dp\phy at tempboxa=\dp\@tempboxa
+      \box\phy at tempboxa}
+    {\setbox\@tempboxa\hbox{$\textstyle#1$}%
+      \ht\phy at tempboxa=\ht\@tempboxa
+      \dp\phy at tempboxa=\dp\@tempboxa
+      \box\phy at tempboxa}
+    {\setbox\@tempboxa\hbox{$\scriptstyle#1$}%
+      \ht\phy at tempboxa=\ht\@tempboxa
+      \dp\phy at tempboxa=\dp\@tempboxa
+      \box\phy at tempboxa}
+    {\setbox\@tempboxa\hbox{$\scriptscriptstyle#1$}%
+      \ht\phy at tempboxa=\ht\@tempboxa
+      \dp\phy at tempboxa=\dp\@tempboxa
+      \box\phy at tempboxa}%
+}
+%    \end{macrocode}
+% \subsection{The (used to be) \modu{explsetup} module}
+% Some common variables and functions for experimental \LaTeX3 syntax.
+%    \begin{macrocode}
+%<@@=phy>
+\ExplSyntaxOn
+\int_new:N \l_@@_tmpa_int
+\int_new:N \l_@@_tmpb_int
+\tl_new:N \l_@@_tmpa_tl
+\tl_new:N \l_@@_tmpb_tl
+%    \end{macrocode}
+% The function that can gobble one token.
+%    \begin{macrocode}
+\cs_new:Npn \_@@_gobble_i:n #1 { }
+\ExplSyntaxOff
+%<@@=>
+%</package>
+%    \end{macrocode}
+% 
+%^^A******************************************************************************** [l2e modules]
+% \part{Modules written in \LaTeXe\ syntax}
+% \section{The \modu{ab} module}
+% \begingroup\color{gray}%
+% \noindent$\langle*\hbox{\sffamily gibberish}\rangle$\par
+% This module is important but the code is hard to read. One of the motivations
+% I manage \pkg{physics2} with \pkg{DocStrip} is that, when I tried to write a
+% new module based on \modu{ab} after 5 months when I maintained \pkg{physics2}
+% the last time, I found that I could not understand the code I wrote at all!
+% Therefore, it's significant to comment out the alien code in \modu{ab}.\par
+% \noindent$\langle/\hbox{\sffamily gibberish}\rangle$\par
+% \endgroup
+%    \begin{macrocode}
+%<*ab>
+\ProvidesFile{phy-ab.sty}
+  [2023/10/24 `ab' (autobraces) module of physics2]
+%    \end{macrocode}
+% If you don't know when to use \cs{phy at define@key}, \cs{phy at setkeys} and
+% \cs{phy at processkeyopt} in a module, see ahead. In \modu{ab}, the |tightbraces|
+% option can control if the automatically-sized braces are tight or not. Do you
+% remember \cs{delopen} and \cs{delclose}?
+%    \begin{macrocode}
+\phy at define@key{ab}{tightbraces}[true]{\def\@phy at abtight{#1}}
+\phy at setkeys{ab}{tightbraces=true}
+\phy at processkeyopt{ab}
+%    \end{macrocode}
+% \begin{function}{\phy at abopen, \phy at abclose}
+%   \begin{syntax}
+%     \cs{phy at abopen} \meta{left delimiter}
+%     \cs{phy at abclose} \meta{right delimiter}
+%   \end{syntax}
+%   They are defined either \{\cs{delopen}, \cs{delclose}\} or
+%   \{\cs{left}, \cs{right}\}. If a module requires \modu{ab},
+%   these two commands are likely to be used.
+% \end{function}
+%    \begin{macrocode}
+\ifx\@phy at abtight\phy at true
+  \let\phy at abopen\delopen
+  \let\phy at abclose\delclose
+\else
+  \let\phy at abopen\left
+  \let\phy at abclose\right
+\fi
+%    \end{macrocode}
+% \subsection{The implementation of \cs{ab}}
+% This is the alienest part of \modu{ab}. It's better to draw something rather
+% than write boring comments. First let's take a look at \cs{ab}'s syntax.
+% After \cs{ab} should be a pair of delimiters; take \texttt{()} as an example.
+% Between \cs{ab} and ``\texttt{(}'' can be a biggg command or star, or even nothing.
+% \cs{ab} is defined as follows:
+% \[ \macrodef{ab}{\cs{phy at d@lx} \texttt{\{mb\}} \texttt{\{ab\}}} \]
+% where \texttt{ab} is the branch name of |\ab()|, and \texttt{mb} is the branch
+% name of |\ab\big()| and |\ab*()|. Then let's see the syntax of \cs{phy at d@lx}.
+% \[ \hbox{\ttfamily\cs{phy at d@lx} \marg{biggg or star branch name} \marg{automatic branch name} \{\#3\}} \]
+% Here exists an \texttt{\#3}. \texttt{\#3} is one token immediately following \cs{ab},
+% which can be \{\,a biggg command or a star\,\} or a ``\texttt{(}'', under our assumption.
+
+% \cs{phy at d@lx} is defined as follows:
+% \[
+%   \macrodef {phy at d@lx} [\#1: biggg or star branch name, \meta{mb}; \#2: automatic branch name, \meta{ab}; \#3, the token after \cs{ab}]
+%     {%
+%       \macroifelse {\#3 == biggg or \#3 == star ($\Leftrightarrow$ csname \{phy at del\cs{string}\#3\} is defined)}
+%         {let \meta{next cs} = csname \{phy at d@lx\meta{mb}\}}
+%         {let \meta{next cs} = csname \{phy at d@lx\meta{ab}\}}
+%       \meta{next cs} \#3
+%     }
+% \]
+% The condition should be true when \#3 is |\big| or |*|, and it should be false when
+% \#3 is ``|(|''. Accordingly, in math mode,
+% \begin{align*}
+%   \hbox{\ttfamily\cs{ab} \cs{big} (}&\quad\to\quad\hbox{\ttfamily\cs{phy at d@lxmb} \cs{big} (}\\
+%   \hbox{\ttfamily\cs{ab} \phantom{\cs{big}} (}&\quad\to\quad\hbox{\ttfamily\cs{phy at d@lxab} \phantom{\cs{big}} (}
+% \end{align*}
+% Then we meet two new commands --- \cs{phy at d@lxmb} and \cs{phy at d@lxab}. Syntax is as follows.
+% \begin{align*}
+%   &\hbox{\ttfamily\cs{phy at d@lxmb} \meta{biggg or *}
+%     \meta{left delimiter} \meta{subformula} \meta{right delimiter}}\\
+%   &\hbox{\ttfamily\cs{phy at d@lxab} \phantom{\meta{biggg or *}}
+%     \meta{left delimiter} \meta{subformula} \meta{right delimiter}}
+% \end{align*}
+% Notice that \texttt{ab} and \texttt{mb} in the above commands are names of \cs{ab}'s
+% two branches --- they are like namespaces. \cs{phy at d@lxmb} and \cs{phy at d@lxab} are
+% defined by the following two lines:
+% \begin{Verbatim}
+% \phy at d@l at genxm{mb}
+% \phy at d@l at genxa{ab}
+% \end{Verbatim}
+% \cs{phy at d@l at genxm} and \cs{phy at d@l at genxa} are defined as follows:
+% \begin{align*}
+%   & \macrodef {phy at d@l at genxm} [\#1: biggg or star branch name, \meta{mb}]
+%     {%
+%       \macrodef [12\ttwd] {phy at d@lx\meta{mb}} [\#\#1: biggg or star; \#\#2: left delimiter]
+%         {%
+%           \cs{begingroup}
+%           \macroifelse {\#\#1 == star}
+%             {\meta{temp} $\gets$ \cs{relax}}
+%             {\meta{temp} $\gets$ \#\#1}
+%           csname \{phy@\meta{mb}@\cs{string}\#\#2\} \meta{temp} \#\#2 \macrocr
+%           \% requires an \cs{endgroup} after the right delimiter
+%         }
+%     } \\[1ex]
+%     & \macrodef {phy at d@l at genxa} [\#1: automatic branch name, \meta{ab}]
+%     {%
+%       \macrodef [12\ttwd] {phy at d@lx\meta{ab}} [\#\#1: left delimiter]
+%         {%
+%           csname \{phy@\meta{ab}@\cs{string}\#\#1\} \#\#1
+%         }
+%     }
+% \end{align*}
+% So we can get
+% \begin{align*}
+%   \hbox{\ttfamily\cs{ab} \cs{big} (}&\quad\to\quad\hbox{\cs{begingroup} csname \{phy at mb@(\} \cs{big}\hskip2\ttwd\ \texttt(}\\
+%   \hbox{\ttfamily\cs{ab} *\phantom{big} (}&\quad\to\quad\hbox{\cs{begingroup} csname \{phy at mb@(\} \cs{relax} \texttt(}\\
+%   \hbox{\ttfamily\cs{ab} \phantom{\cs{big}} (}&\quad\to\quad\hbox{\hskip11\ttwd\ csname \{phy at ab@(\} \texttt(}
+% \end{align*}
+% The csnames above (\cs{phy at mb@(} and \cs{phy at ab@(}) are generated with \cs{phy at AB@gen}.
+% \[ \hbox{\cs{phy at AB@gen} \marg{branch name} \meta{left delimiter} \marg{arg spec} \marg{definition}} \]
+% If \meta{branch name} is \texttt{mb}, \marg{arg spec} should be |mr()|, where |m| is for biggg or star;
+% If \meta{branch name} is \texttt{ab}, \marg{arg spec} should be |r()|.
+% 
+% \note The ``|(|'' in the example above must not be replaced by a subformula braced by a pair of |{}|.
+% 
+% \begin{function}{\phy at AB@gen}
+%   \begin{syntax}
+%     \cs{phy at AB@gen} \marg{branch name} \meta{left delimiter} \marg{arg spec} \marg{definition}
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\def\phy at AB@gen#1#2{\expandafter\DeclareDocumentCommand\csname phy@#1@\string#2\endcsname}
+\phy at AB@gen{ab}({r()}{\phy at abopen(#1\phy at abclose)}
+\phy at AB@gen{ab}[{r[]}{\phy at abopen[#1\phy at abclose]}
+\phy at AB@gen{ab}\{{r\{\}}{\phy at abopen\{#1\phy at abclose\}}
+\phy at AB@gen{ab}|{r||}{\phy at abopen|#1\phy at abclose|}
+\phy at AB@gen{ab}\|{r\|\|}{\phy at abopen\|#1\phy at abclose\|}
+\phy at AB@gen{ab}<{r<>}{\phy at abopen<#1\phy at abclose>}
+\phy at AB@gen{ab}\lbrace{r\lbrace\rbrace}{\phy at abopen\lbrace#1\phy at abclose\rbrace}
+\phy at AB@gen{ab}\vert{r\vert\vert}{\phy at abopen\vert#1\phy at abclose\vert}
+\phy at AB@gen{ab}\Vert{r\Vert\Vert}{\phy at abopen\Vert#1\phy at abclose\Vert}
+\phy at AB@gen{ab}\langle{r\langle\rangle}{\phy at abopen\langle#1\phy at abclose\rangle}
+%    \end{macrocode}
+% \cs{endgroup}'s in the end of the following definitions are corresponding to
+% \cs{begingroup}'s in the definition of \cs{phy at d@l at genxm}.
+%    \begin{macrocode}
+\phy at AB@gen{mb}({mr()}{\mathopen#1(#2\mathclose#1)\endgroup}
+\phy at AB@gen{mb}[{mr[]}{\mathopen#1[#2\mathclose#1]\endgroup}
+\phy at AB@gen{mb}\{{mr\{\}}{\mathopen#1\lbrace#2\mathclose#1\rbrace\endgroup}
+\phy at AB@gen{mb}|{mr||}{\mathopen#1\vert#2\mathclose#1\vert\endgroup}
+\phy at AB@gen{mb}\|{mr\|\|}{\mathopen#1\Vert#2\mathclose#1\Vert\endgroup}
+\phy at AB@gen{mb}<{mr<>}{\mathopen#1\langle#2\mathclose#1\rangle\endgroup}
+\phy at AB@gen{mb}\lbrace{mr\lbrace\rbrace}{\mathopen#1\lbrace#2\mathclose#1\rbrace\endgroup}
+\phy at AB@gen{mb}\vert{mr\vert\vert}{\mathopen#1\vert#2\mathclose#1\vert\endgroup}
+\phy at AB@gen{mb}\Vert{mr\Vert\Vert}{\mathopen#1\Vert#2\mathclose#1\Vert\endgroup}
+\phy at AB@gen{mb}\langle{mr\langle\rangle}{\mathopen#1\langle#2\mathclose#1\rangle\endgroup}
+%    \end{macrocode}
+% \begin{function}{\phy at del\string.}
+%   The syntax seems not important. These following lines seems only for \cs{ifcsname}
+%   to judge if the commands are defined.
+% \end{function}
+%    \begin{macrocode}
+\def\phy at del#1#2#3{\phy at abopen#1#3\phy at abclose#2}
+\expandafter\def\csname phy at del\string*\endcsname#1#2#3{\mathopen#1#3\mathclose#2}
+\expandafter\def\csname phy at del\string\big\endcsname#1#2#3{\bigl#1#3\bigr#2}
+\expandafter\def\csname phy at del\string\Big\endcsname#1#2#3{\Bigl#1#3\Bigr#2}
+\expandafter\def\csname phy at del\string\bigg\endcsname#1#2#3{\biggl#1#3\biggr#2}
+\expandafter\def\csname phy at del\string\Bigg\endcsname#1#2#3{\Biggl#1#3\Biggr#2}
+\expandafter\def\csname phy at del\string\biggg\endcsname#1#2#3{\bigggl#1#3\bigggr#2}
+\expandafter\def\csname phy at del\string\Biggg\endcsname#1#2#3{\Bigggl#1#3\Bigggr#2}
+%    \end{macrocode}
+% \begin{function}{\phy at d@lx}
+%   \begin{syntax}
+%     \cs{phy at d@lx} \marg{biggg or star branch name} \marg{automatic branch name} \{\#3\}
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\def\phy at d@lx#1#2#3{%
+  \ifcsname phy at del\string#3\endcsname
+    \def\reserved at a{#1}% #3 is star or \biggg
+  \else
+    \def\reserved at a{#2}% #3 is delimiter
+  \fi
+  \csname phy at d@lx\reserved at a\endcsname#3}
+%    \end{macrocode}
+% \begin{function}{\phy at d@l at genxm, \phy at d@l at genxa}
+%   \begin{syntax}
+%     \cs{phy at d@l at genxm} \marg{biggg or star branch name}
+%     \cs{phy at d@l at genxa} \marg{automatic branch name}
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\def\phy at d@l at genxm#1{%
+  \expandafter\def\csname phy at d@lx#1\endcsname##1##2{%
+    \begingroup % \endgroup is at the end of #4 of \phy at AB@gen
+    \ifx##1*\let\phy at tempa=\relax\else\let\phy at tempa=##1\fi
+    \csname phy@#1@\string##2\endcsname\phy at tempa##2}}
+\def\phy at d@l at genxa#1{%
+  \expandafter\def\csname phy at d@lx#1\endcsname##1{%
+    \csname phy@#1@\string##1\endcsname##1}}
+%    \end{macrocode}
+% \begin{function}{\phy at d@lxmb, \phy at d@lxab}
+%   \begin{syntax}
+%     \cs{phy at d@lxmb} \meta{biggg or *} \meta{left delimiter} \meta{subformula} \meta{right delimiter}
+%     \cs{phy at d@lxab} \phantom{\meta{biggg or *}} \meta{left delimiter} \meta{subformula} \meta{right delimiter}
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\phy at d@l at genxm{mb}
+\phy at d@l at genxa{ab}
+%    \end{macrocode}
+% \begin{function}{\ab}
+%   The users' command \cs{ab}.
+% \end{function}
+%    \begin{macrocode}
+\DeclareRobustCommand\ab{\phy at d@lx{mb}{ab}}
+%    \end{macrocode}
+% \subsection{\cs{pab}-like commands}
+% This is so simple. No need to comment a lot.
+% 
+% \begin{function}{\phy at d@l at geny}
+%   \begin{syntax}
+%     \cs{phy at d@l at geny} \meta{command} \meta{left delimiter} \meta{right delimiter}
+%   \end{syntax}
+%   This command used to define commands like \cs{pab}.
+% \end{function}
+%    \begin{macrocode}
+\def\phy at d@l at geny#1#2#3{%
+  \DeclareDocumentCommand#1{som}{% ##1: star; ##2: bigg (csname); ##3: subformula.
+    \IfBooleanTF{##1}%
+      {#2##3#3}%
+      {\IfValueTF{##2}%
+        {\csname##2l\endcsname#2##3\csname##2r\endcsname#3}%
+        {\phy at abopen#2##3\phy at abclose#3}%
+      }%
+  }%
+}
+\phy at d@l at geny\pab()
+\phy at d@l at geny\bab[]
+\phy at d@l at geny\Bab\lbrace\rbrace
+\phy at d@l at geny\vab\vert\vert
+\phy at d@l at geny\aab\langle\rangle
+\phy at d@l at geny\Vab\Vert\Vert
+%</ab>
+%    \end{macrocode}
+% \section{The \modu{ab.braket} module}
+%    \begin{macrocode}
+%<*ab.braket>
+\ProvidesFile{phy-ab.braket.sty}
+  [2023/10/24 `ab.braket' module of physics2]
+%    \end{macrocode}
+% This module requires \cs{phy at abopen} and \cs{phy at abclose} from \modu{ab}.
+% This module may have conflict with \modu{braket}.
+%    \begin{macrocode}
+\phy at requiremodule{ab}
+\ifdefined\phy at bra@@
+  \PackageWarning{physics2}{You cannot load `ab.braket' and `braket'
+    modules together.\MessageBreak Only `ab.braket' module works now.}
+\fi
+%    \end{macrocode}
+% \begin{function}{\bra}
+%   \begin{syntax}
+%     \cs{bra} \char`\<\ \meta{subformula} \char`\|
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\phy at AB@gen{br.m}<{mr<|}{\mathopen#1\langle#2\mathclose#1\vert\endgroup}
+\phy at AB@gen{br.a}<{r<|}{\phy at abopen\langle#1\phy at abclose\vert}
+\phy at d@l at genxm{br.m}
+\phy at d@l at genxa{br.a}
+\DeclareRobustCommand\bra{\phy at d@lx{br.m}{br.a}}
+%    \end{macrocode}
+% \begin{function}{\ket}
+%   \begin{syntax}
+%     \cs{ket} \char`\|\ \meta{subformula} \char`\>
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\phy at AB@gen{kt.m}|{mr|>}{\mathopen#1\vert#2\mathclose#1\rangle\endgroup}
+\phy at AB@gen{kt.a}|{r|>}{\phy at abopen\vert#1\phy at abclose\rangle}
+\phy at d@l at genxm{kt.m}
+\phy at d@l at genxa{kt.a}
+\DeclareRobustCommand\ket{\phy at d@lx{kt.m}{kt.a}}
+%    \end{macrocode}
+% \begin{function}{\braket}
+%   \begin{syntax}
+%     \cs{braket} \char`\<\ \meta{subformula 1} \char`\|\ \meta{subformula 2} {\color{gray}\textrm{[}\char`\|\ \meta{subformula 3} \textrm{\dots]}} \char`\>
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\begingroup
+\catcode`\|=\active
+\gdef\phy@@mb at bk#1#2{\begingroup
+  \mathcode`\|="8000\def|{\egroup#1\vert\bgroup}%
+  \def\<{\mathrel{<}}\def\>{\mathrel{>}}%
+  \mathopen#1\langle\bgroup#2\egroup\mathclose#1\rangle\endgroup}
+\gdef\phy@@ab at bk#1{\begingroup
+  \mathcode`\|="8000\def|{\egroup\phy at abb@bkv\bgroup}%
+  \def\<{\mathrel{<}}\def\>{\mathrel{>}}%
+  \phy at abopen\langle\bgroup#1\egroup\phy at abclose\rangle\endgroup}
+\endgroup
+\def\phy at abb@bkv{\middle\vert}
+\phy at AB@gen{bk.m}<{mr<>}{\phy@@mb at bk#1{#2}\endgroup}
+\phy at AB@gen{bk.a}<{r<>}{\phy@@ab at bk{#1}}
+\phy at d@l at genxm{bk.m}
+\phy at d@l at genxa{bk.a}
+\DeclareRobustCommand\braket{\phy at d@lx{bk.m}{bk.a}}
+%    \end{macrocode}
+% \begin{function}{\ketbra}
+%   \begin{syntax}
+%     \cs{braket} \char`\|\ \meta{subformula 1} \char`\>\ \meta{subformula 2} \char`\<\ \meta{subformula 3} \char`\|
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\begingroup
+\catcode`\<=\active
+\catcode`\>=\active
+\gdef\phy@@mb at kb#1#2{\begingroup
+  \mathcode`\<="8000 \mathcode`\>="8000%
+  \def<{#1\langle}\def>{#1\rangle}%
+  \def\<{\phy at abb@l}\def\>{\phy at abb@r}%
+  \mathopen#1\vert#2\mathclose#1\vert\endgroup}
+\endgroup
+\gdef\phy@@ab at kb#1>#2<#3\phy@@end{\begingroup
+  \def\<{\phy at abb@l}\def\>{\phy at abb@r}%
+  \phy at abopen\vert\mathopen{\phy at mathvphantom{#3}}#1\phy at abclose\rangle#2%
+  \phy at abopen\langle#3\mathclose{\phy at mathvphantom{#1}}\phy at abclose\vert
+\endgroup}
+\AtBeginDocument{\ifcsname symbf\endcsname
+  \def\phy at abb@l{\Umathchar 3 \symoperators "003C }%
+  \def\phy at abb@r{\Umathchar 3 \symoperators "003E }%
+\fi}
+\def\phy at abb@l{\mathchar"313C }
+\def\phy at abb@r{\mathchar"313E }
+\phy at AB@gen{kb.m}|{mr||}{\phy@@mb at kb#1{#2}\endgroup}
+\phy at AB@gen{kb.a}|{r||}{\phy@@ab at kb#1\phy@@end}
+\phy at d@l at genxm{kb.m}
+\phy at d@l at genxa{kb.a}
+\DeclareRobustCommand\ketbra{\phy at d@lx{kb.m}{kb.a}}
+%</ab.braket>
+%    \end{macrocode}
+% \section{The \modu{braket} module}
+%    \begin{macrocode}
+%<*braket>
+\ProvidesFile{phy-braket.sty}
+  [2023/10/24 `braket' module of physics2]
+%    \end{macrocode}
+% This module requires \cs{phy at abopen} and \cs{phy at abclose} from \modu{ab}.
+% This module may have conflict with \modu{ab.braket}.
+%    \begin{macrocode}
+\phy at requiremodule{ab}
+\ifdefined\phy at abb@bkv
+  \PackageWarning{physics2}{You cannot load `ab.braket' and `braket'
+    modules together.\MessageBreak Only `braket' module works now.}
+\fi
+%    \end{macrocode}
+% \begin{function}{\bra}
+%   \begin{syntax}
+%     \cs{bra} * \oarg{biggg} \marg{subformula}
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\DeclareDocumentCommand\bra{ s o m }{%
+  \IfBooleanTF{#1}
+    {\mathopen\langle#3\mathclose\vert}
+    {\IfValueTF{#2}
+      {\csname#2l\endcsname\langle#3\csname#2r\endcsname\vert}
+      {\phy at abopen\langle#3\phy at abclose\vert}%
+    }%
+}
+%    \end{macrocode}
+% \begin{function}{\ket}
+%   \begin{syntax}
+%     \cs{ket} * \oarg{biggg} \marg{subformula}
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\DeclareDocumentCommand\ket{ s o m }{%
+  \IfBooleanTF{#1}
+    {\mathopen\vert#3\mathclose\rangle}
+    {\IfValueTF{#2}
+      {\csname#2l\endcsname\vert#3\csname#2r\endcsname\rangle}
+      {\phy at abopen\vert#3\phy at abclose\rangle}%
+    }%
+}
+%    \end{macrocode}
+% \begin{function}{\braket}
+%   \begin{syntax}
+%     \cs{ket} * [\meta{biggg}, $n \in \{1,2,3\}$] \marg{subformula 1} \dots \marg{subformula $n$}
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\DeclareDocumentCommand\braket{ s O{} }{%
+  \IfBooleanTF{#1}%
+    {%
+      \gdef\@phy at bk@argnum{ii}%
+      \phy at bk@doopt{#2}%
+      \gdef\@phy at bk@l{mathopen}%
+      \gdef\@phy at bk@m{mathord}%
+      \gdef\@phy at bk@r{mathclose}%
+    }%
+    {%
+      \gdef\@phy at bk@argnum{ii}%
+      \gdef\@phy at bk@l{phy at abopen}%
+      \gdef\@phy at bk@m{middle}%
+      \gdef\@phy at bk@r{phy at abclose}%
+      \phy at bk@doopt{#2}%
+    }%
+  \csname phy at bk@in@\@phy at bk@argnum\endcsname%
+}
+%    \end{macrocode}
+% \begin{function}{\phy at bk@in at i, \phy at bk@in at ii, \phy at bk@in at iii}
+%   \begin{syntax}
+%     \cs{phy at bk@in@\meta{n.roman}} \marg{subformula 1} \dots \marg{subformula $n$}
+%   \end{syntax}
+%   \meta{n.roman} is $n$ in roman lowercase, where $n \in \{1,2,3\}$.
+% \end{function}
+%    \begin{macrocode}
+\def\phy at bk@in at i#1{%
+  \csname\@phy at bk@l\endcsname\langle{#1}%
+  \csname\@phy at bk@r\endcsname\rangle}
+\def\phy at bk@in at ii#1#2{%
+  \csname\@phy at bk@l\endcsname\langle{#1}%
+  \csname\@phy at bk@m\endcsname\vert{#2}%
+  \csname\@phy at bk@r\endcsname\rangle}
+\def\phy at bk@in at iii#1#2#3{%
+  \csname\@phy at bk@l\endcsname\langle{#1}%
+  \csname\@phy at bk@m\endcsname\vert{#2}%
+  \csname\@phy at bk@m\endcsname\vert{#3}%
+  \csname\@phy at bk@r\endcsname\rangle}
+%    \end{macrocode}
+% \begin{function}{\phy at bk@doopt, \phy at bk@do at pt}
+%   \begin{syntax}
+%     \cs{phy at bk@doopt} \marg{clist}
+%   \end{syntax}
+%   Parse the optional argument of \cs{braket}. This will add 3 entries to hash.
+% \end{function}
+%    \begin{macrocode}
+\def\@phy at bk@do at pt#1,{\ifx#1\relax\@empty\else
+  \edef\reserved at a{\zap at space#1 \@empty}%
+  \ifx\reserved at a\@empty\else
+    \ifcsname phy at del\expandafter\string\csname\reserved at a\endcsname\endcsname
+      \xdef\@phy at bk@l{\reserved at a l}%
+      \xdef\@phy at bk@m{\reserved at a}% but not m (m stands for \mathrel)
+      \xdef\@phy at bk@r{\reserved at a r}%
+    \else
+      \ifnum\reserved at a>3%
+        \PackageError{physics2}{\string\braket\space can only take 3
+          mandatory arguments at most}{Check if you had written a number
+          more than 3 in the [optional] argument.}%
+      \fi
+      \xdef\@phy at bk@argnum{\romannumeral\reserved at a}%
+    \fi
+  \fi
+  \expandafter\@phy at bk@do at pt\fi}
+\def\phy at bk@doopt#1{\@phy at bk@do at pt#1,\relax,}
+%    \end{macrocode}
+% \begin{function}{\ketbra}
+%   \begin{syntax}
+%     \cs{ketbra} * [\meta{biggg}] \marg{subformula 1} \oarg{between 1 and 2} \marg{subformula 2}
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\DeclareDocumentCommand\ketbra{ s o m O{} m }{%
+  \IfBooleanTF{#1}%
+    {\mathopen\vert#3\mathclose\rangle#4\mathopen\langle#5\mathclose\vert}%
+    {\IfValueTF{#2}%
+      {\csname#2l\endcsname\vert#3\csname#2r\endcsname\rangle#4%
+        \csname#2l\endcsname\langle#5\csname#2r\endcsname\vert}%
+      {\begingroup
+        \phy at abopen\vert\mathopen{\phy at mathvphantom{#5}}#3\phy at abclose\rangle#4%
+        \phy at abopen\langle#5\mathclose{\phy at mathvphantom{#3}}\phy at abclose\vert
+      \endgroup}%
+    }%
+}
+%</braket>
+%    \end{macrocode}
+% \section{The \modu{doubleprod} module}
+%    \begin{macrocode}
+%<*doubleprod>
+\ProvidesFile{phy-doubleprod.sty}
+  [2023/10/24 `doubleprod' (vertically stacked binary operators) module of physics2]
+%    \end{macrocode}
+% Boolean options.
+%    \begin{macrocode}
+\phy at define@key{doubleprod}{crosssymbol}{\def\@phy at dbl@c{#1}}
+\phy at define@key{doubleprod}{dotsymbol}{\def\@phy at dbl@d{#1}}
+\phy at define@key{doubleprod}{crossscale}{\def\@phy at dbl@sc{#1}}
+\phy at define@key{doubleprod}{dotscale}{\def\@phy at dbl@sd{#1}}
+\phy at define@key{doubleprod}{crossopenup}{\def\@phy at dbl@oc{#1}}
+\phy at define@key{doubleprod}{dotopenup}{\def\@phy at dbl@od{#1}}
+\phy at setkeys{doubleprod}{crosssymbol=\times,dotsymbol=\ldotp,
+  crossscale=0.8,dotscale=1,crossopenup=.02,dotopenup=.2}
+\phy at processkeyopt{doubleprod}
+\def\phy at dbl@gen#1#2#3#4{%
+  \DeclareRobustCommand#1{\mathbin{\vcenter{\baselineskip\z at skip%
+    \lineskip#4\phy at dblcurrf@size%
+    \setbox\@tempboxa=\hbox{\fontsize{#2\phy at dblcurrf@size}\z@$#3$}%
+    \copy\@tempboxa\box\@tempboxa}}}}
+\def\phy at dblcurrf@size{\dimexpr\f at size pt\relax}
+\phy at dbl@gen\doublecross\@phy at dbl@sc\@phy at dbl@c\@phy at dbl@oc
+\phy at dbl@gen\doubledot\@phy at dbl@sd\@phy at dbl@d\@phy at dbl@od
+%</doubleprod>
+%    \end{macrocode}
+%^^A******************************************************************************** [l3 modules]
+% \part{Modules written in \LaTeX3 syntax}
+% We use |phy| as the namespace for \pkg{physics2} modules.
+%    \begin{macrocode}
+%<@@=phy>
+%    \end{macrocode}
+% \section{The \modu{diagmat} module}
+%    \begin{macrocode}
+%<*diagmat>
+\ProvidesExplFile{phy-diagmat.sty}{2023/10/24}{}
+  {`diagmat' module of physics2}
+\RequirePackage { amsmath }
+\phy at define@key { diagmat } { empty } [ 0 ] { \tl_gset:Nn \l_@@_mat_empty_tl { #1 } }
+%    \end{macrocode}
+% This module requires some new variables.
+%    \begin{macrocode}
+\clist_new:N \l_@@_mat_diag_clist
+\clist_new:N \l_@@_mat_tmpa_clist
+\clist_new:N \l_@@_mat_tmpb_clist
+\clist_new:N \l_@@_mat_diagpos_clist
+\int_new:N \l_@@_mat_dim_int
+\tl_new:N \l_@@_mat_line_tl
+\tl_new:N \l_@@_diagmat_tl
+\tl_new:N \l_@@_mat_empty_tl
+\tl_gset:Nn \l_@@_mat_empty_tl { 0 }
+\phy at processkeyopt { diagmat }
+\keys_define:nn { phy/diagmat }
+  {
+    empty .tl_set:N = \l_@@_mat_empty_tl ,
+  }
+%    \end{macrocode}
+% \begin{function}{\diagmat}
+%   \begin{syntax}
+%     \cs{\meta{delimiter type}diagmat} \oarg{key-val list} \marg{diagonal}
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\DeclareDocumentCommand \diagmat { O{} m }
+  { \_@@_diagmat_type:nnn { } { #1 } { #2 } }
+\DeclareDocumentCommand \pdiagmat { O{} m }
+  { \_@@_diagmat_type:nnn { p } { #1 } { #2 } }
+\DeclareDocumentCommand \bdiagmat { O{} m }
+  { \_@@_diagmat_type:nnn { b } { #1 } { #2 } }
+\DeclareDocumentCommand \Bdiagmat { O{} m }
+  { \_@@_diagmat_type:nnn { B } { #1 } { #2 } }
+\DeclareDocumentCommand \vdiagmat { O{} m }
+  { \_@@_diagmat_type:nnn { v } { #1 } { #2 } }
+\DeclareDocumentCommand \Vdiagmat { O{} m }
+  { \_@@_diagmat_type:nnn { V } { #1 } { #2 } }
+%    \end{macrocode}
+% \begin{function}{\_@@_diagmat_type:nnn}
+%   \begin{syntax}
+%     \cs{_@@_diagmat_type:nnn} \marg{delimiter type} \marg{key-val list} \marg{diagonal}
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\cs_new:Npn \_@@_diagmat_type:nnn #1#2#3
+  {
+    \group_begin:
+    \clist_set:Nn \l_@@_mat_diag_clist { #3 }
+    \int_set:Nn \l_@@_mat_dim_int { \clist_count:N \l_@@_mat_diag_clist }
+    \int_compare:nNnT { \l_@@_mat_dim_int } > { \value { MaxMatrixCols } }
+      { \setcounter { MaxMatrixCols } { \l_@@_mat_dim_int } }
+    \keys_set:nn { phy/diagmat } { #2 }
+    \tl_gclear:N \l_@@_diagmat_tl
+    \int_step_inline:nnn { 0 } { \l_@@_mat_dim_int - 1 }
+      {
+        \int_step_inline:nnn { 0 } { \l_@@_mat_dim_int - 1 }
+          {
+            \int_compare:nNnTF { ##1 } = { ####1 }
+              {
+                \clist_gpop:NN \l_@@_mat_diag_clist \l_@@_tmpa_tl
+                \tl_if_empty:NTF \l_@@_tmpa_tl
+                  { \tl_gput_right:Nn \l_@@_mat_line_tl { \l_@@_mat_empty_tl } }
+                  { \tl_gput_right:Nx \l_@@_mat_line_tl { \l_@@_tmpa_tl } }
+              }
+              { \tl_gput_right:Nn \l_@@_mat_line_tl { \l_@@_mat_empty_tl } }
+%    \end{macrocode}
+% Add |&| (or |\\|) between matrix entries.
+%    \begin{macrocode}
+            \int_compare:nNnTF { ####1 } = { \l_@@_mat_dim_int - 1 }
+              {
+                \tl_gput_right:Nn \l_@@_mat_line_tl { \\ }
+              }
+              {
+                \tl_gput_right:Nn \l_@@_mat_line_tl { & }
+              }
+          }
+        \tl_gput_right:Nx \l_@@_diagmat_tl { \l_@@_mat_line_tl }
+        \tl_gclear:N \l_@@_mat_line_tl
+      }
+    \begin { #1 matrix }
+      \tl_use:N \l_@@_diagmat_tl
+    \end { #1 matrix }
+    \group_end:
+  }
+%</diagmat>
+%    \end{macrocode}
+% \section{The \modu{xmat} module}
+%    \begin{macrocode}
+%<*xmat>
+\ProvidesExplFile{phy-xmat.sty}{2023/10/24}{}
+  {`xmat' module of physics2}
+\RequirePackage { amsmath }
+\phy at define@key { xmat } { showtop }
+  { \int_gset:Nn \l_@@_xmat_showtop_int { #1 } }
+\phy at define@key { xmat } { showleft }
+  { \int_gset:Nn \l_@@_xmat_showleft_int { #1 } }
+%    \end{macrocode}
+% This module requires some new variables.
+%    \begin{macrocode}
+\bool_new:N \l_@@_xmat_extra_vdots_bool
+\bool_new:N \l_@@_xmat_extra_cdots_bool
+\int_new:N \l_@@_xmat_showtop_int
+\int_new:N \l_@@_xmat_showleft_int
+\tl_new:N \l_@@_xmat_tl
+\int_gset:Nn \l_@@_xmat_showtop_int { \value { MaxMatrixCols } - 2 }
+\int_gset:Nn \l_@@_xmat_showleft_int { \value { MaxMatrixCols } - 2 }
+\cs_new:Npn \_@@_xmat_entry_format:nnn #1#2#3
+  {
+    #1 \c_math_subscript_token { #2 #3 }
+  }
+\phy at processkeyopt { xmat }
+\DeclareDocumentCommand \xmat { O{} m m m }
+ { \_@@_xmat_type:nnnnn { } { #1 } { #2 } { #3 } { #4 } }
+\DeclareDocumentCommand \pxmat { O{} m m m }
+ { \_@@_xmat_type:nnnnn { p } { #1 } { #2 } { #3 } { #4 } }
+\DeclareDocumentCommand \bxmat { O{} m m m }
+ { \_@@_xmat_type:nnnnn { b } { #1 } { #2 } { #3 } { #4 } }
+\DeclareDocumentCommand \Bxmat { O{} m m m }
+ { \_@@_xmat_type:nnnnn { B } { #1 } { #2 } { #3 } { #4 } }
+\DeclareDocumentCommand \vxmat { O{} m m m }
+ { \_@@_xmat_type:nnnnn { v } { #1 } { #2 } { #3 } { #4 } }
+\DeclareDocumentCommand \Vxmat { O{} m m m }
+ { \_@@_xmat_type:nnnnn { V } { #1 } { #2 } { #3 } { #4 } }
+\keys_define:nn { phy/xmat }
+  {
+    format  .cs_set:Np = \_@@_xmat_entry_format:nnn #1#2#3 ,
+    showtop .int_set:N = \l_@@_xmat_showtop_int ,
+    showleft.int_set:N = \l_@@_xmat_showleft_int ,
+  }
+%    \end{macrocode}
+% \begin{function}[pTF]{\_@@_if_digits_only:n}
+%   \begin{syntax}
+%     \cs{_@@_if_digits_only:nTF} \marg{token list} \marg{true code} \marg{flase code}
+%   \end{syntax}
+%   Use \LaTeX3 regular expression to tell if \meta{token list}
+%   (the numbers of rows or columns) contain digits only. 
+% \end{function}
+%    \begin{macrocode}
+\prg_new_conditional:Npnn \_@@_if_digits_only:n #1 { TF }
+  {
+    \regex_match:nnTF { \A [[:digit:]]* \Z } { #1 }
+      { \prg_return_true: } { \prg_return_false: }
+  }
+%    \end{macrocode}
+% \begin{function}{\_@@_xmat_type:nnnnn}
+%   \begin{syntax}
+%     \cs{_@@_xmat_type:nnnnn} \marg{delimiter type} \marg{key-val list} \marg{common entry} \marg{row number} \marg{column number}
+%   \end{syntax}
+% \end{function}
+%    \begin{macrocode}
+\cs_new:Npn \_@@_xmat_type:nnnnn #1#2#3#4#5
+  {
+    \group_begin:
+    \tl_gclear:N \l_@@_xmat_tl
+    \keys_set:nn { phy/xmat } { #2 } % 
+    \_@@_if_digits_only:nTF { #4 }
+      {
+        \int_compare:nNnTF { #4 } < { \l_@@_xmat_showtop_int + 1 }
+          {
+            \int_set:Nn \l_@@_xmat_showtop_int { #4 }
+            \bool_set_false:N \l_@@_xmat_extra_vdots_bool
+          }
+          {
+            \bool_set_true:N \l_@@_xmat_extra_vdots_bool
+          }
+      }
+      {
+        \bool_set_true:N \l_@@_xmat_extra_vdots_bool
+      }
+    \_@@_if_digits_only:nTF { #5 }
+      {
+        \int_compare:nNnTF { #5 } < { \l_@@_xmat_showleft_int + 1 }
+          {
+            \int_set:Nn \l_@@_xmat_showleft_int { #5 }
+            \bool_set_false:N \l_@@_xmat_extra_cdots_bool
+          }
+          {
+            \bool_set_true:N \l_@@_xmat_extra_cdots_bool
+          }
+      }
+      {
+        \bool_set_true:N \l_@@_xmat_extra_cdots_bool
+      }
+    \int_step_inline:nn { \l_@@_xmat_showtop_int }
+      {
+        \tl_put_right:Nn \l_@@_xmat_tl
+          { \_@@_xmat_entry_format:nnn { #3 } { ##1 } { 1 } }
+        \int_step_inline:nnn { 2 } { \l_@@_xmat_showleft_int }
+          {
+            \tl_put_right:Nn \l_@@_xmat_tl
+              { & \_@@_xmat_entry_format:nnn { #3 } { ##1 } { ####1 } }
+          }
+        \bool_if:NT \l_@@_xmat_extra_cdots_bool
+          {
+            \tl_put_right:Nn \l_@@_xmat_tl
+              { & \cdots & \_@@_xmat_entry_format:nnn { #3 } { ##1 } { #5 } }
+          }
+        \tl_put_right:Nn \l_@@_xmat_tl { \\ }
+      }
+    \bool_if:NT \l_@@_xmat_extra_vdots_bool
+      {
+        \tl_put_right:Nn \l_@@_xmat_tl { \vdots }
+        \prg_replicate:nn { \l_@@_xmat_showleft_int - 1 }
+          {
+            \tl_put_right:Nn \l_@@_xmat_tl { & \vdots }
+          }
+        % Add \ddots if vdots_bool and cdots_bool be true simultaneously.
+        \bool_if:NT \l_@@_xmat_extra_cdots_bool
+          {
+            \tl_put_right:Nn \l_@@_xmat_tl { & \ddots & \vdots }
+          } % else relax
+        \tl_put_right:Nn \l_@@_xmat_tl { \\ }
+        % The last row.
+        \tl_put_right:Nn \l_@@_xmat_tl
+          { \_@@_xmat_entry_format:nnn { #3 } { #4 } { 1 } }
+        \int_step_inline:nnn { 2 } { \l_@@_xmat_showleft_int }
+          {
+            \tl_put_right:Nn \l_@@_xmat_tl
+              { & \_@@_xmat_entry_format:nnn { #3 } { #4 } { ##1 } }
+          }
+        \bool_if:NT \l_@@_xmat_extra_cdots_bool
+          {
+            \tl_put_right:Nn \l_@@_xmat_tl
+              { & \cdots & \_@@_xmat_entry_format:nnn { #3 } { #4 } { #5 } }
+          }
+      } % else relax
+    \begin { #1 matrix }
+      \tl_use:N \l_@@_xmat_tl
+    \end { #1 matrix }
+    \group_end:
+  }
+%</xmat>
+%    \end{macrocode}
+% This part ends here.
+%    \begin{macrocode}
+%<@@=>
+%    \end{macrocode}
+%^^A******************************************************************************** [l2e legacy]
+% \part{Legacy modules written in \LaTeXe\ syntax}
+% \section{The \modu{ab.legacy} module}
+%    \begin{macrocode}
+%<*ab.legacy>
+\ProvidesFile{phy-ab.legacy.sty}
+  [2023/10/24 `ab.legacy' module of physics2]
+%    \end{macrocode}
+% Requires \modu{ab}'s |tight| option.
+%    \begin{macrocode}
+\phy at requiremodule{ab}
+\phy at define@key{ab.legacy}{order}[\mathcal{O}]{\def\phy at ab@ordersym{#1}}
+\phy at setkeys{ab.legacy}{order}
+\phy at processkeyopt{ab.legacy}
+\phy at d@l at geny\abs\vert\vert
+\phy at d@l at geny\norm\Vert\Vert
+\DeclareDocumentCommand\order{som}{%
+  \phy at ab@ordersym
+  \IfBooleanTF{#1}
+    {(#3)}
+    {\IfValueTF{#2}
+      {\csname#2l\endcsname(#3\csname#2r\endcsname)}
+      {\phy at abopen(#3\phy at abclose)}%
+    }%
+}
+\phy at d@l at geny\eval.\vert
+\phy at d@l at geny\peval(\vert
+\phy at d@l at geny\beval[\vert
+%</ab.legacy>
+%    \end{macrocode}
+% \section{The \modu{nabla.legacy} module}
+%    \begin{macrocode}
+%<*nabla.legacy>
+\ProvidesFile{phy-nabla.legacy.sty}
+  [2023/10/24 `nabla.legacy' module of physics2]
+\phy at requiremodule{ab}
+%    \end{macrocode}
+% Requires \pkg{fixdif} version 2.$x$.
+%    \begin{macrocode}
+\RequirePackage{fixdif}[2023/01/31]
+\letdif\phy at nl@nabla{nabla}
+\AtBeginDocument{\ifcsname div\endcsname\let\divsymbol\div\fi
+  \DeclareRobustCommand\grad{\phy at nl@nabla\ab}%
+  \DeclareRobustCommand\div{\phy at nl@nabla\cdot\ab}%
+  \DeclareRobustCommand\curl{\phy at nl@nabla\times\ab}%
+  \DeclareRobustCommand\laplacian{\phy at nl@nabla^2\ab}%
+}
+%</nabla.legacy>
+%    \end{macrocode}
+% \section{The \modu{op.legacy} module}
+%    \begin{macrocode}
+%<*op.legacy>
+\ProvidesFile{phy-op.legacy.sty}
+  [2023/10/24 `op.legacy' module of physics2]
+\phy at define@key{op.lega}{ReIm}[true]{\def\phy at reserveda{#1}}
+\phy at define@key{op.lega}{PV}{\def\@phy at oplega@PV{#1}}
+\phy at define@key{op.lega}{pv}{\def\@phy at oplega@pv{#1}}
+\phy at setkeys{op.lega}{PV=\mathcal{P},pv={p.v.},ReIm=true}
+\phy at processkeyopt{ab}
+\DeclareRobustCommand\asin{\mathop{\operator at font asin}\nolimits}
+\DeclareRobustCommand\acos{\mathop{\operator at font acos}\nolimits}
+\DeclareRobustCommand\atan{\mathop{\operator at font atan}\nolimits}
+\DeclareRobustCommand\acsc{\mathop{\operator at font acsc}\nolimits}
+\DeclareRobustCommand\asec{\mathop{\operator at font asec}\nolimits}
+\DeclareRobustCommand\acot{\mathop{\operator at font acot}\nolimits}
+\DeclareRobustCommand\Tr{\mathop{\operator at font Tr}\nolimits}
+\DeclareRobustCommand\tr{\mathop{\operator at font tr}\nolimits}
+\DeclareRobustCommand\rank{\mathop{\operator at font rank}\nolimits}
+\DeclareRobustCommand\erf{\mathop{\operator at font erf}\nolimits}
+\DeclareRobustCommand\Res{\mathop{\operator at font Res}\nolimits}
+\DeclareRobustCommand\res{\mathop{\operator at font res}\nolimits}
+\DeclareRobustCommand\PV{\mathord{\@phy at oplega@PV}}
+\DeclareRobustCommand\pv{\mathop{\operator at font\@phy at oplega@pv{}}\nolimits}
+%    \end{macrocode}
+% Restore \cs{Re} and \cs{Im} in \cs{Resymbol} and \cs{Imsymbol}. The \cs{AtBeginDocument}
+% hook is used for the compatibility of \pkg{unicode-math}.
+%    \begin{macrocode}
+\ifx\phy at reserveda\phy at true
+\AtBeginDocument{%
+  \let\Resymbol\Re%
+  \let\Imsymbol\Im%
+  \DeclareRobustCommand\Re{\mathop{\operator at font Re}\nolimits}%
+  \DeclareRobustCommand\Im{\mathop{\operator at font Im}\nolimits}%
+}
+\fi
+%</op.legacy>
+%    \end{macrocode}
+% \section{The \modu{qtext.legacy} module}
+% This module is written for the compatibility with the bad commands provided by
+% \pkg{physics} only. The commands in this module should NEVER be used!
+%    \begin{macrocode}
+%<*qtext.legacy>
+\ProvidesFile{phy-qtext.legacy.sty}
+  [2023/10/24 `qtext.legacy' module of physics2.sty]
+\RequirePackage{amstext}
+\def\phy at qtext@#1#2{#1\text{#2}\quad}
+\DeclareRobustCommand\qqtext{\@ifstar{\phy at qtext@{}}{\phy at qtext@\quad}}
+\DeclareRobustCommand\qq{\qqtext}
+\DeclareRobustCommand\qcomma{,\quad}
+\DeclareRobustCommand\qc{\qcomma}
+\DeclareRobustCommand\qcc{\@ifstar{\phy at qtext@{}{c.c}}{\phy at qtext@\quad{c.c}}}
+\def\phy at qtext@lega at gen@#1{%
+  \expandafter\DeclareRobustCommand\csname q#1\endcsname%
+    {\@ifstar{\phy at qtext@{}{#1}}{\phy at qtext@\quad{#1}}}}
+\phy at qtext@lega at gen@{if}
+\phy at qtext@lega at gen@{then}
+\phy at qtext@lega at gen@{else}
+\phy at qtext@lega at gen@{otherwise}
+\phy at qtext@lega at gen@{unless}
+\phy at qtext@lega at gen@{give}
+\phy at qtext@lega at gen@{using}
+\phy at qtext@lega at gen@{unless}
+\phy at qtext@lega at gen@{assume}
+\phy at qtext@lega at gen@{since}
+\phy at qtext@lega at gen@{let}
+\phy at qtext@lega at gen@{for}
+\phy at qtext@lega at gen@{all}
+\phy at qtext@lega at gen@{even}
+\phy at qtext@lega at gen@{odd}
+\phy at qtext@lega at gen@{integer}
+\phy at qtext@lega at gen@{and}
+\phy at qtext@lega at gen@{or}
+\phy at qtext@lega at gen@{as}
+\phy at qtext@lega at gen@{in}
+%</qtext.legacy>
+%    \end{macrocode}
+%^^A******************************************************************************** [l3 legacy]
+% \part{Legacy modules written in \LaTeX3 syntax}
+%    \begin{macrocode}
+%<@@=phy>
+%    \end{macrocode}
+% \section{The \modu{bm-um.legacy} module}
+%    \begin{macrocode}
+%<*bm-um.legacy>
+\ProvidesExplFile{phy-bm-um.legacy.sty}{2023/10/24}{}
+  {`bm-um.legacy' module of physics2}
+\AtBeginDocument
+  {
+    \cs_if_exist:cF { symbf }
+      {
+        \PackageError { physics2 }
+          {
+            The ~ `bm-um.legacy' ~ module ~ requires ~
+            `unicode-math' ~ package
+          }
+          {
+            Have ~ you ~ used ~ `unicode-math' ~
+            in ~ the ~ preamble?
+          }
+      }
+  }
+\DeclareDocumentCommand \bm { m }
+  {
+    \mode_if_math:TF
+      {
+        \tl_if_head_eq_catcode:nNTF { #1 } A
+          {
+            \symbfit { #1 }
+          }
+          {
+            \symbf { #1 }
+          }
+      }
+      {
+        \PackageError { physics2 }
+          {
+            The ~ \string\bm\space command ~ should ~ be ~
+            used ~ in ~ math ~ mode ~ only. \MessageBreak
+            This ~ is ~ an ~ error ~ from ~ `bm-um.legacy' ~ module
+          }
+          {
+            Check ~ if ~ any ~ `\string\bm' ~ is ~ out ~
+            of ~ math ~ mode.
+          }
+      }
+  }
+%</bm-um.legacy>
+%    \end{macrocode}
+% This part ends here.
+%    \begin{macrocode}
+%<@@=>
+%    \end{macrocode}
+\endinput


Property changes on: trunk/Master/texmf-dist/source/latex/physics2/physics2-code.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/physics2/physics2.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/physics2/physics2.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/physics2/physics2.ins	2023-10-26 19:51:23 UTC (rev 68657)
@@ -0,0 +1,104 @@
+%%
+%% This is file `physics2.ins',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `install')
+%% 
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
+%% 
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
+%% 
+%%     http://www.latex-project.org/lppl.txt
+%% 
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
+\input docstrip.tex
+\keepsilent
+
+\preamble
+
+  Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
+
+  This work may be distributed and/or modified under the
+  conditions of the LaTeX Project Public License, either
+  version 1.3c of this license or (at your option) any later
+  version. The latest version of this license is in:
+
+    http://www.latex-project.org/lppl.txt
+
+  and version 1.3 or later is part of all distributions of
+  LaTeX version 2005/12/01 or later.
+
+  This work has the LPPL maintenance status `maintained'.
+
+  The Current Maintainer of this work is Zhang Tingxuan.
+
+  This work consists of the files physics2-code.dtx,
+            and the derived files physics2.ins,
+                                  physics2.sty,
+                                  phy-<module>.sty,
+                                  physics2-code.pdf,
+                              and README.md.
+
+\endpreamble
+
+\generate{
+  \usedir{tex/latex/physics2}
+    \file{physics2.sty}          {\from{physics2-code.dtx}{package}}
+    \file{phy-ab.sty}            {\from{physics2-code.dtx}{ab}}
+    \file{phy-ab.braket.sty}     {\from{physics2-code.dtx}{ab.braket}}
+    \file{phy-braket.sty}        {\from{physics2-code.dtx}{braket}}
+    \file{phy-diagmat.sty}       {\from{physics2-code.dtx}{diagmat}}
+    \file{phy-doubleprod.sty}    {\from{physics2-code.dtx}{doubleprod}}
+    \file{phy-xmat.sty}          {\from{physics2-code.dtx}{xmat}}
+    \file{phy-ab.legacy.sty}     {\from{physics2-code.dtx}{ab.legacy}}
+    \file{phy-bm-um.legacy.sty}  {\from{physics2-code.dtx}{bm-um.legacy}}
+    \file{phy-nabla.legacy.sty}  {\from{physics2-code.dtx}{nabla.legacy}}
+    \file{phy-op.legacy.sty}     {\from{physics2-code.dtx}{op.legacy}}
+    \file{phy-qtext.legacy.sty}  {\from{physics2-code.dtx}{qtext.legacy}}
+  \usedir{doc/latex/physics2}
+  \nopreamble\nopostamble
+    \file{README.md}             {\from{physics2-code.dtx}{readme}}
+}
+
+\obeyspaces
+\Msg{**********************************************************}
+\Msg{*                                                        *}
+\Msg{*  To finish the installation you have to move the       *}
+\Msg{*  following files into a directory searched by TeX:     *}
+\Msg{*                                                        *}
+\Msg{*                    physics2.sty,                       *}
+\Msg{*  (for all modules) phy-<module>.sty.                   *}
+\Msg{*                                                        *}
+\Msg{*  The recommended directory is                          *}
+\Msg{*    TEXMFDIST/tex/latex/physics2                        *}
+\Msg{*                                                        *}
+\Msg{*  To produce the documentation, run the file            *}
+\Msg{*  physics2-code.dtx through XeLaTeX or LuaLaTeX.        *}
+\Msg{*  XeLaTeX is recommended.                               *}
+\Msg{*                                                        *}
+\Msg{*  Happy TeXing!                                         *}
+\Msg{*                                                        *}
+\Msg{**********************************************************}
+
+\endbatchfile
+\endinput
+%%
+%% End of file `physics2.ins'.

Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.braket.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.braket.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.braket.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,42 +1,51 @@
-%% 
+%%
 %% This is file `phy-ab.braket.sty',
-%% the `ab.braket' module of `physics2' package.
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `ab.braket')
 %% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
 %% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
+%%     http://www.latex-project.org/lppl.txt
 %% 
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
 \ProvidesFile{phy-ab.braket.sty}
-  [2023/04/02 `ab.braket' module of `physics2.sty']
-% This module requires \phy at abopen and \phy at abclose from `ab'.
+  [2023/10/24 `ab.braket' module of physics2]
 \phy at requiremodule{ab}
 \ifdefined\phy at bra@@
   \PackageWarning{physics2}{You cannot load `ab.braket' and `braket'
     modules together.\MessageBreak Only `ab.braket' module works now.}
 \fi
-% \bra<foo|
 \phy at AB@gen{br.m}<{mr<|}{\mathopen#1\langle#2\mathclose#1\vert\endgroup}
 \phy at AB@gen{br.a}<{r<|}{\phy at abopen\langle#1\phy at abclose\vert}
 \phy at d@l at genxm{br.m}
 \phy at d@l at genxa{br.a}
 \DeclareRobustCommand\bra{\phy at d@lx{br.m}{br.a}}
-% \ket|foo>
 \phy at AB@gen{kt.m}|{mr|>}{\mathopen#1\vert#2\mathclose#1\rangle\endgroup}
 \phy at AB@gen{kt.a}|{r|>}{\phy at abopen\vert#1\phy at abclose\rangle}
 \phy at d@l at genxm{kt.m}
 \phy at d@l at genxa{kt.a}
 \DeclareRobustCommand\ket{\phy at d@lx{kt.m}{kt.a}}
-% \braket<foo|bar>
 \begingroup
 \catcode`\|=\active
 \gdef\phy@@mb at bk#1#2{\begingroup
@@ -54,7 +63,6 @@
 \phy at d@l at genxm{bk.m}
 \phy at d@l at genxa{bk.a}
 \DeclareRobustCommand\braket{\phy at d@lx{bk.m}{bk.a}}
-% \ketbra|foo>bar<baz|
 \begingroup
 \catcode`\<=\active
 \catcode`\>=\active
@@ -81,4 +89,5 @@
 \phy at d@l at genxa{kb.a}
 \DeclareRobustCommand\ketbra{\phy at d@lx{kb.m}{kb.a}}
 \endinput
+%%
 %% End of file `phy-ab.braket.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.legacy.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.legacy.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.legacy.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,38 +1,48 @@
-%% 
+%%
 %% This is file `phy-ab.legacy.sty',
-%% the `ab.legacy' module of `physics2' package.
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `ab.legacy')
 %% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
 %% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
+%%     http://www.latex-project.org/lppl.txt
 %% 
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
 \ProvidesFile{phy-ab.legacy.sty}
-  [2023/03/29 `ab.legacy' module of `physics2.sty']
+  [2023/10/24 `ab.legacy' module of physics2]
 \phy at requiremodule{ab}
-% The `tight' bool option, true or false.
 \phy at define@key{ab.legacy}{order}[\mathcal{O}]{\def\phy at ab@ordersym{#1}}
-% The default values to keys in this module.
 \phy at setkeys{ab.legacy}{order}
 \phy at processkeyopt{ab.legacy}
-% The braced operators.
 \phy at d@l at geny\abs\vert\vert
 \phy at d@l at geny\norm\Vert\Vert
 \DeclareDocumentCommand\order{som}{%
   \phy at ab@ordersym
-  \IfBooleanTF{#1}%
-    {(#3)}%
-    {\IfValueTF{#2}%
-      {\csname#2l\endcsname(#3\csname#2r\endcsname)}%
+  \IfBooleanTF{#1}
+    {(#3)}
+    {\IfValueTF{#2}
+      {\csname#2l\endcsname(#3\csname#2r\endcsname)}
       {\phy at abopen(#3\phy at abclose)}%
     }%
 }
@@ -40,4 +50,5 @@
 \phy at d@l at geny\peval(\vert
 \phy at d@l at geny\beval[\vert
 \endinput
+%%
 %% End of file `phy-ab.legacy.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,31 +1,39 @@
-%% 
+%%
 %% This is file `phy-ab.sty',
-%% the `ab' module of `physics2' package.
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `ab')
 %% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
 %% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
+%%     http://www.latex-project.org/lppl.txt
 %% 
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
 \ProvidesFile{phy-ab.sty}
-  [2023/04/02 `ab' (autobraces) module of `physics2.sty']
-% \phy at requiremodule{common}
-% The `tightbraces' bool option, true or false.
+  [2023/10/24 `ab' (autobraces) module of physics2]
 \phy at define@key{ab}{tightbraces}[true]{\def\@phy at abtight{#1}}
-% Execute the default values to keys in this module.
 \phy at setkeys{ab}{tightbraces=true}
 \phy at processkeyopt{ab}
-% \phy at abopen and \phy at abclose,
-% internal definition for all commands in this module.
 \ifx\@phy at abtight\phy at true
   \let\phy at abopen\delopen
   \let\phy at abclose\delclose
@@ -33,9 +41,8 @@
   \let\phy at abopen\left
   \let\phy at abclose\right
 \fi
-% The internal version of \ab. #1: `ab' or `mb'; #2: open symbol; (#3: arg-spec; #4: definition)
+
 \def\phy at AB@gen#1#2{\expandafter\DeclareDocumentCommand\csname phy@#1@\string#2\endcsname}
-% #1 (r<token1><token2>): inner content.
 \phy at AB@gen{ab}({r()}{\phy at abopen(#1\phy at abclose)}
 \phy at AB@gen{ab}[{r[]}{\phy at abopen[#1\phy at abclose]}
 \phy at AB@gen{ab}\{{r\{\}}{\phy at abopen\{#1\phy at abclose\}}
@@ -46,8 +53,6 @@
 \phy at AB@gen{ab}\vert{r\vert\vert}{\phy at abopen\vert#1\phy at abclose\vert}
 \phy at AB@gen{ab}\Vert{r\Vert\Vert}{\phy at abopen\Vert#1\phy at abclose\Vert}
 \phy at AB@gen{ab}\langle{r\langle\rangle}{\phy at abopen\langle#1\phy at abclose\rangle}
-% #1 (m): \biggg; #2 (r<token1><token2>): inner content.
-% \endgroup's in the end of definition are corresponding to \begingroup in \phy at d@l at genxm.
 \phy at AB@gen{mb}({mr()}{\mathopen#1(#2\mathclose#1)\endgroup}
 \phy at AB@gen{mb}[{mr[]}{\mathopen#1[#2\mathclose#1]\endgroup}
 \phy at AB@gen{mb}\{{mr\{\}}{\mathopen#1\lbrace#2\mathclose#1\rbrace\endgroup}
@@ -58,7 +63,6 @@
 \phy at AB@gen{mb}\vert{mr\vert\vert}{\mathopen#1\vert#2\mathclose#1\vert\endgroup}
 \phy at AB@gen{mb}\Vert{mr\Vert\Vert}{\mathopen#1\Vert#2\mathclose#1\Vert\endgroup}
 \phy at AB@gen{mb}\langle{mr\langle\rangle}{\mathopen#1\langle#2\mathclose#1\rangle\endgroup}
-% \phy at del, the automatic braces. #1: opensymbol; #2: close symbol; #3
 \def\phy at del#1#2#3{\phy at abopen#1#3\phy at abclose#2}
 \expandafter\def\csname phy at del\string*\endcsname#1#2#3{\mathopen#1#3\mathclose#2}
 \expandafter\def\csname phy at del\string\big\endcsname#1#2#3{\bigl#1#3\bigr#2}
@@ -67,30 +71,24 @@
 \expandafter\def\csname phy at del\string\Bigg\endcsname#1#2#3{\Biggl#1#3\Biggr#2}
 \expandafter\def\csname phy at del\string\biggg\endcsname#1#2#3{\bigggl#1#3\bigggr#2}
 \expandafter\def\csname phy at del\string\Biggg\endcsname#1#2#3{\Bigggl#1#3\Bigggr#2}
-% \phy at d@lx (phy_del_x): the internal defination of \ab.
-% #1: `mb', according to \phy at AB@gen; #2: `ab'; #3: star or big or left delimiter.
 \def\phy at d@lx#1#2#3{%
-  \ifcsname phy at del\string#3\endcsname%
-    \def\reserved at a{#1}% #3 is star or \biggg, then get the next argument.
-  \else%
-    \def\reserved at a{#2}% #3 is delimiter, the braces are automatic.
-  \fi%
+  \ifcsname phy at del\string#3\endcsname
+    \def\reserved at a{#1}% #3 is star or \biggg
+  \else
+    \def\reserved at a{#2}% #3 is delimiter
+  \fi
   \csname phy at d@lx\reserved at a\endcsname#3}
-% The first two arguments of \phy at d@lx need to be generated by the following two commands.
-\def\phy at d@l at genxm#1{% generate arguments like `mb'
+\def\phy at d@l at genxm#1{%
   \expandafter\def\csname phy at d@lx#1\endcsname##1##2{%
-    \begingroup% \endgroup in \phy at AB@gen{mb}<open><arg><definition>
+    \begingroup % \endgroup is at the end of #4 of \phy at AB@gen
     \ifx##1*\let\phy at tempa=\relax\else\let\phy at tempa=##1\fi
     \csname phy@#1@\string##2\endcsname\phy at tempa##2}}
-\def\phy at d@l at genxa#1{% generate arguments like `ab'
+\def\phy at d@l at genxa#1{%
   \expandafter\def\csname phy at d@lx#1\endcsname##1{%
     \csname phy@#1@\string##1\endcsname##1}}
-% Generate the `mb' and `ab' arguments.
 \phy at d@l at genxm{mb}
 \phy at d@l at genxa{ab}
-% \ab(<subformula>), after \ab can be a star or \biggg.
 \DeclareRobustCommand\ab{\phy at d@lx{mb}{ab}}
-% \phy at d@l at geny: define commands like \pab. #1: cs; #2: open symbol; #3: close symbol.
 \def\phy at d@l at geny#1#2#3{%
   \DeclareDocumentCommand#1{som}{% ##1: star; ##2: bigg (csname); ##3: subformula.
     \IfBooleanTF{##1}%
@@ -108,4 +106,5 @@
 \phy at d@l at geny\aab\langle\rangle
 \phy at d@l at geny\Vab\Vert\Vert
 \endinput
+%%
 %% End of file `phy-ab.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-bm-um.legacy.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-bm-um.legacy.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-bm-um.legacy.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,23 +1,36 @@
-%% 
+%%
 %% This is file `phy-bm-um.legacy.sty',
-%% the `bm-um.legacy' module of `physics2' package.
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `bm-um.legacy')
 %% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
 %% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
+%%     http://www.latex-project.org/lppl.txt
 %% 
-\ProvidesExplFile{phy-bm-um.legacy.sty}{2023/01/25}{}
-  {`bm-um.legacy' module of `physics2.sty'}
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
+\ProvidesExplFile{phy-bm-um.legacy.sty}{2023/10/24}{}
+  {`bm-um.legacy' module of physics2}
 \AtBeginDocument
   {
     \cs_if_exist:cF { symbf }
@@ -59,4 +72,5 @@
       }
   }
 \endinput
+%%
 %% End of file `phy-bm-um.legacy.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-braket.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-braket.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-braket.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,48 +1,57 @@
-%% 
+%%
 %% This is file `phy-braket.sty',
-%% the `braket' module of `physics2' package.
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `braket')
 %% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
 %% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
+%%     http://www.latex-project.org/lppl.txt
 %% 
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
 \ProvidesFile{phy-braket.sty}
-  [2023/03/29 `braket' module of `physics2.sty']
-% Here we need to get the definition of \phy at abopen and \phy at abclose.
+  [2023/10/24 `braket' module of physics2]
 \phy at requiremodule{ab}
 \ifdefined\phy at abb@bkv
   \PackageWarning{physics2}{You cannot load `ab.braket' and `braket'
     modules together.\MessageBreak Only `braket' module works now.}
 \fi
-% \bra
 \DeclareDocumentCommand\bra{ s o m }{%
-  \IfBooleanTF{#1}%
-    {\mathopen\langle#3\mathclose\vert}%
-    {\IfValueTF{#2}%
-      {\csname#2l\endcsname\langle#3\csname#2r\endcsname\vert}%
+  \IfBooleanTF{#1}
+    {\mathopen\langle#3\mathclose\vert}
+    {\IfValueTF{#2}
+      {\csname#2l\endcsname\langle#3\csname#2r\endcsname\vert}
       {\phy at abopen\langle#3\phy at abclose\vert}%
     }%
 }
-% \ket
 \DeclareDocumentCommand\ket{ s o m }{%
-  \IfBooleanTF{#1}%
-    {\mathopen\vert#3\mathclose\rangle}%
-    {\IfValueTF{#2}%
-      {\csname#2l\endcsname\vert#3\csname#2r\endcsname\rangle}%
+  \IfBooleanTF{#1}
+    {\mathopen\vert#3\mathclose\rangle}
+    {\IfValueTF{#2}
+      {\csname#2l\endcsname\vert#3\csname#2r\endcsname\rangle}
       {\phy at abopen\vert#3\phy at abclose\rangle}%
     }%
 }
-% \braket
 \DeclareDocumentCommand\braket{ s O{} }{%
   \IfBooleanTF{#1}%
     {%
@@ -61,7 +70,6 @@
     }%
   \csname phy at bk@in@\@phy at bk@argnum\endcsname%
 }
-% The internal version of \braket
 \def\phy at bk@in at i#1{%
   \csname\@phy at bk@l\endcsname\langle{#1}%
   \csname\@phy at bk@r\endcsname\rangle}
@@ -74,7 +82,6 @@
   \csname\@phy at bk@m\endcsname\vert{#2}%
   \csname\@phy at bk@m\endcsname\vert{#3}%
   \csname\@phy at bk@r\endcsname\rangle}
-% Parse the optional argument of \braket. This will add 3 entries to hash table.
 \def\@phy at bk@do at pt#1,{\ifx#1\relax\@empty\else
   \edef\reserved at a{\zap at space#1 \@empty}%
   \ifx\reserved at a\@empty\else
@@ -91,9 +98,8 @@
       \xdef\@phy at bk@argnum{\romannumeral\reserved at a}%
     \fi
   \fi
-\expandafter\@phy at bk@do at pt\fi}
+  \expandafter\@phy at bk@do at pt\fi}
 \def\phy at bk@doopt#1{\@phy at bk@do at pt#1,\relax,}
-% \ketbra
 \DeclareDocumentCommand\ketbra{ s o m O{} m }{%
   \IfBooleanTF{#1}%
     {\mathopen\vert#3\mathclose\rangle#4\mathopen\langle#5\mathclose\vert}%
@@ -107,4 +113,5 @@
     }%
 }
 \endinput
+%%
 %% End of file `phy-braket.sty'.

Deleted: trunk/Master/texmf-dist/tex/latex/physics2/phy-common.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-common.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-common.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,68 +0,0 @@
-%% 
-%% This is file `phy-common.sty',
-%% the `common' module of `physics2' package.
-%% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
-%% 
-%% This work has the LPPL maintenance status `maintained'.
-%% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
-%% 
-\ProvidesFile{phy-common.sty}
-  [2023/03/29 `common' module of `physics2.sty']
-% Check if unicode-math loaded and (re)define the vert symbols.
-% The \relax's here are for \ifx to compare.
-% unicode-math sets these symbols in \fam1, \symoperators is set 1 in 2e kernel.
-\AtBeginDocument{\ifcsname symrm\endcsname
-  \protected\def\|{\Udelimiter 0 \symoperators "2016 }%
-  \protected\def\vert{\Udelimiter 0 \symoperators "007C\relax}%
-  \protected\def\Vert{\Udelimiter 0 \symoperators "2016\relax}%
-  \protected\def\mid{\Udelimiter 3 \symoperators "007C }%
-\fi}
-\protected\def\Vert{\delimiter"026B30D\relax}
-\protected\def\mid{\delimiter"326A30C }
-% \delopen and \delclose, make inner subformulae delimited by
-% \left and \right behave as an open plus a close atom.
-\DeclareRobustCommand\delopen{\mathopen{}\mathclose\bgroup\left}
-\DeclareRobustCommand\delclose{\aftergroup\egroup\right}
-% Extension to the 2e kernel biggggg commands.
-\DeclareRobustCommand\biggg[1]{\leavevmode at ifvmode
-  {\hbox{$\left#1\vbox to20.5\p@{}\right.\n at space$}}}
-\DeclareRobustCommand\Biggg[1]{\leavevmode at ifvmode
-  {\hbox{$\left#1\vbox to23.5\p@{}\right.\n at space$}}}
-\DeclareRobustCommand\bigggl{\mathopen\biggg}
-\DeclareRobustCommand\bigggm{\mathrel\biggg}
-\DeclareRobustCommand\bigggr{\mathclose\biggg}
-\DeclareRobustCommand\Bigggl{\mathopen\Biggg}
-\DeclareRobustCommand\Bigggm{\mathrel\Biggg}
-\DeclareRobustCommand\Bigggr{\mathclose\Biggg}
-% \phy at mathvphantom, does the same job as \vphantom in math mode actually.
-\def\phy at mathvphantom#1{\setbox\phy at tempboxa=\hbox{}%
-  \mathchoice%
-    {\setbox\@tempboxa\hbox{$\displaystyle#1$}%
-      \ht\phy at tempboxa=\ht\@tempboxa%
-      \dp\phy at tempboxa=\dp\@tempboxa%
-      \box\phy at tempboxa}%
-    {\setbox\@tempboxa\hbox{$\textstyle#1$}%
-      \ht\phy at tempboxa=\ht\@tempboxa%
-      \dp\phy at tempboxa=\dp\@tempboxa%
-      \box\phy at tempboxa}%
-    {\setbox\@tempboxa\hbox{$\scriptstyle#1$}%
-      \ht\phy at tempboxa=\ht\@tempboxa%
-      \dp\phy at tempboxa=\dp\@tempboxa%
-      \box\phy at tempboxa}%
-    {\setbox\@tempboxa\hbox{$\scriptscriptstyle#1$}%
-      \ht\phy at tempboxa=\ht\@tempboxa%
-      \dp\phy at tempboxa=\dp\@tempboxa%
-      \box\phy at tempboxa}%
-}
-\endinput
-%% End of file `phy-common.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,27 +1,38 @@
-%% 
+%%
 %% This is file `phy-diagmat.sty',
-%% the `diagmat' module of `physics2' package.
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `diagmat')
 %% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
 %% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
+%%     http://www.latex-project.org/lppl.txt
 %% 
-\ProvidesExplFile{phy-diagmat.sty}{2023/01/25}{}
-  {`diagmat' module of `physics2.sty'}
-\phy at requiremodule { explsetup }
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
+\ProvidesExplFile{phy-diagmat.sty}{2023/10/24}{}
+  {`diagmat' module of physics2}
 \RequirePackage { amsmath }
 \phy at define@key { diagmat } { empty } [ 0 ] { \tl_gset:Nn \l__phy_mat_empty_tl { #1 } }
-% New variables
 \clist_new:N \l__phy_mat_diag_clist
 \clist_new:N \l__phy_mat_tmpa_clist
 \clist_new:N \l__phy_mat_tmpb_clist
@@ -36,7 +47,6 @@
   {
     empty .tl_set:N = \l__phy_mat_empty_tl ,
   }
-% Document Commands
 \DeclareDocumentCommand \diagmat { O{} m }
   { \__phy_diagmat_type:nnn { } { #1 } { #2 } }
 \DeclareDocumentCommand \pdiagmat { O{} m }
@@ -49,7 +59,6 @@
   { \__phy_diagmat_type:nnn { v } { #1 } { #2 } }
 \DeclareDocumentCommand \Vdiagmat { O{} m }
   { \__phy_diagmat_type:nnn { V } { #1 } { #2 } }
-% Internal function
 \cs_new:Npn \__phy_diagmat_type:nnn #1#2#3
   {
     \group_begin:
@@ -71,7 +80,6 @@
                   { \tl_gput_right:Nx \l__phy_mat_line_tl { \l__phy_tmpa_tl } }
               }
               { \tl_gput_right:Nn \l__phy_mat_line_tl { \l__phy_mat_empty_tl } }
-            % The `&' and `\\' between entries.
             \int_compare:nNnTF { ####1 } = { \l__phy_mat_dim_int - 1 }
               {
                 \tl_gput_right:Nn \l__phy_mat_line_tl { \\ }
@@ -89,4 +97,5 @@
     \group_end:
   }
 \endinput
+%%
 %% End of file `phy-diagmat.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-doubleprod.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-doubleprod.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-doubleprod.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,24 +1,36 @@
-%% 
+%%
 %% This is file `phy-doubleprod.sty',
-%% the `doubleprod' module of `physics2' package.
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `doubleprod')
 %% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
 %% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
+%%     http://www.latex-project.org/lppl.txt
 %% 
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
 \ProvidesFile{phy-doubleprod.sty}
-  [2023/01/25 `doubleprod' (double binary) module of `physics2.sty']
-% The options, true or false.
+  [2023/10/24 `doubleprod' (vertically stacked binary operators) module of physics2]
 \phy at define@key{doubleprod}{crosssymbol}{\def\@phy at dbl@c{#1}}
 \phy at define@key{doubleprod}{dotsymbol}{\def\@phy at dbl@d{#1}}
 \phy at define@key{doubleprod}{crossscale}{\def\@phy at dbl@sc{#1}}
@@ -37,4 +49,5 @@
 \phy at dbl@gen\doublecross\@phy at dbl@sc\@phy at dbl@c\@phy at dbl@oc
 \phy at dbl@gen\doubledot\@phy at dbl@sd\@phy at dbl@d\@phy at dbl@od
 \endinput
+%%
 %% End of file `phy-doubleprod.sty'.

Deleted: trunk/Master/texmf-dist/tex/latex/physics2/phy-explsetup.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-explsetup.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-explsetup.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,29 +0,0 @@
-%% 
-%% This is file `phy-explsetup.sty',
-%% the `explsetup' module of `physics2' package.
-%% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
-%% 
-%% This work has the LPPL maintenance status `maintained'.
-%% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
-%% 
-\ProvidesExplFile{phy-explsetup.sty}{2023/01/25}{}
-  {`explsetup' module of `physics2.sty'}
-% temporary variables
-\int_new:N \l__phy_tmpa_int
-\int_new:N \l__phy_tmpb_int
-\tl_new:N \l__phy_tmpa_tl
-\tl_new:N \l__phy_tmpb_tl
-% gobble one token
-\cs_new:Npn \__phy_gobble_i:n #1 { }
-\endinput
-%% End of file `phy-explsetup.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-nabla.legacy.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-nabla.legacy.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-nabla.legacy.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,25 +1,37 @@
-%% 
+%%
 %% This is file `phy-nabla.legacy.sty',
-%% the `nabla.legacy' module of `physics2' package.
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `nabla.legacy')
 %% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
 %% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
+%%     http://www.latex-project.org/lppl.txt
 %% 
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
 \ProvidesFile{phy-nabla.legacy.sty}
-  [2023/01/25 `nabla.legacy' (autobraces) module of `physics2.sty']
+  [2023/10/24 `nabla.legacy' module of physics2]
 \phy at requiremodule{ab}
-% This package required `fixdif' package version 2.x.
 \RequirePackage{fixdif}[2023/01/31]
 \letdif\phy at nl@nabla{nabla}
 \AtBeginDocument{\ifcsname div\endcsname\let\divsymbol\div\fi
@@ -29,4 +41,5 @@
   \DeclareRobustCommand\laplacian{\phy at nl@nabla^2\ab}%
 }
 \endinput
+%%
 %% End of file `phy-nabla.legacy.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-op.legacy.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-op.legacy.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-op.legacy.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,25 +1,37 @@
-%% 
+%%
 %% This is file `phy-op.legacy.sty',
-%% the `op.legacy' module of `physics2' package.
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `op.legacy')
 %% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
 %% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
+%%     http://www.latex-project.org/lppl.txt
 %% 
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
 \ProvidesFile{phy-op.legacy.sty}
-  [2023/01/25 `op.legacy' module of `physics2.sty']
+  [2023/10/24 `op.legacy' module of physics2]
 \phy at define@key{op.lega}{ReIm}[true]{\def\phy at reserveda{#1}}
-% The keys for \PV and \pv
 \phy at define@key{op.lega}{PV}{\def\@phy at oplega@PV{#1}}
 \phy at define@key{op.lega}{pv}{\def\@phy at oplega@pv{#1}}
 \phy at setkeys{op.lega}{PV=\mathcal{P},pv={p.v.},ReIm=true}
@@ -38,7 +50,6 @@
 \DeclareRobustCommand\res{\mathop{\operator at font res}\nolimits}
 \DeclareRobustCommand\PV{\mathord{\@phy at oplega@PV}}
 \DeclareRobustCommand\pv{\mathop{\operator at font\@phy at oplega@pv{}}\nolimits}
-% \Re and \Im, restore the former comands as \Resymbol and \Imsymbol
 \ifx\phy at reserveda\phy at true
 \AtBeginDocument{%
   \let\Resymbol\Re%
@@ -48,4 +59,5 @@
 }
 \fi
 \endinput
+%%
 %% End of file `phy-op.legacy.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-qtext.legacy.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-qtext.legacy.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-qtext.legacy.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,23 +1,36 @@
-%% 
+%%
 %% This is file `phy-qtext.legacy.sty',
-%% the `qtext.legacy' module of `physics2' package.
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `qtext.legacy')
 %% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
 %% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
+%%     http://www.latex-project.org/lppl.txt
 %% 
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
 \ProvidesFile{phy-qtext.legacy.sty}
-  [2023/01/25 `qtext.legacy' module of `physics2.sty']
+  [2023/10/24 `qtext.legacy' module of physics2.sty]
 \RequirePackage{amstext}
 \def\phy at qtext@#1#2{#1\text{#2}\quad}
 \DeclareRobustCommand\qqtext{\@ifstar{\phy at qtext@{}}{\phy at qtext@\quad}}
@@ -49,4 +62,5 @@
 \phy at qtext@lega at gen@{as}
 \phy at qtext@lega at gen@{in}
 \endinput
+%%
 %% End of file `phy-qtext.legacy.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-xmat.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-xmat.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-xmat.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,30 +1,41 @@
-%% 
+%%
 %% This is file `phy-xmat.sty',
-%% the `xmat' module of `physics2' package.
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `xmat')
 %% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
 %% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
+%%     http://www.latex-project.org/lppl.txt
 %% 
-\ProvidesExplFile{phy-xmat.sty}{2023/01/25}{}
-  {`xmat' module of `physics2.sty'}
-\phy at requiremodule { explsetup }
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
+\ProvidesExplFile{phy-xmat.sty}{2023/10/24}{}
+  {`xmat' module of physics2}
 \RequirePackage { amsmath }
 \phy at define@key { xmat } { showtop }
   { \int_gset:Nn \l__phy_xmat_showtop_int { #1 } }
 \phy at define@key { xmat } { showleft }
   { \int_gset:Nn \l__phy_xmat_showleft_int { #1 } }
-% New variables
 \bool_new:N \l__phy_xmat_extra_vdots_bool
 \bool_new:N \l__phy_xmat_extra_cdots_bool
 \int_new:N \l__phy_xmat_showtop_int
@@ -49,7 +60,6 @@
  { \__phy_xmat_type:nnnnn { v } { #1 } { #2 } { #3 } { #4 } }
 \DeclareDocumentCommand \Vxmat { O{} m m m }
  { \__phy_xmat_type:nnnnn { V } { #1 } { #2 } { #3 } { #4 } }
-
 \keys_define:nn { phy/xmat }
   {
     format  .cs_set:Np = \__phy_xmat_entry_format:nnn #1#2#3 ,
@@ -56,18 +66,16 @@
     showtop .int_set:N = \l__phy_xmat_showtop_int ,
     showleft.int_set:N = \l__phy_xmat_showleft_int ,
   }
-% Use regex to judge if the total row/column number contains digits **only**.
 \prg_new_conditional:Npnn \__phy_if_digits_only:n #1 { TF }
   {
     \regex_match:nnTF { \A [[:digit:]]* \Z } { #1 }
       { \prg_return_true: } { \prg_return_false: }
   }
-% #1: p,b,B; #2: options; #2: common entry; #3: total rows; #4: total cols.
 \cs_new:Npn \__phy_xmat_type:nnnnn #1#2#3#4#5
   {
     \group_begin:
     \tl_gclear:N \l__phy_xmat_tl
-    \keys_set:nn { phy/xmat } { #2 } % 
+    \keys_set:nn { phy/xmat } { #2 } %
     \__phy_if_digits_only:nTF { #4 }
       {
         \int_compare:nNnTF { #4 } < { \l__phy_xmat_showtop_int + 1 }
@@ -145,4 +153,5 @@
     \group_end:
   }
 \endinput
+%%
 %% End of file `phy-xmat.sty'.

Modified: trunk/Master/texmf-dist/tex/latex/physics2/physics2.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/physics2.sty	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/texmf-dist/tex/latex/physics2/physics2.sty	2023-10-26 19:51:23 UTC (rev 68657)
@@ -1,47 +1,55 @@
 %%
-%% This is file `physics2.sty'.
+%% This is file `physics2.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% physics2-code.dtx  (with options: `package')
 %% 
-%% ******************************************************
-%% * This work may be distributed and/or modified under *
-%% * the conditions of the LaTeX Project Public License *
-%% *                                                    *
-%% *     http://www.latex-project.org/lppl.txt          *
-%% *                                                    *
-%% * either version 1.3c of this license or any later   *
-%% * version.                                           *
-%% ******************************************************
+%%   Copyright (C) 2023 by Zhang Tingxuan <alphaztx at 163.com>
 %% 
-%% This work has the LPPL maintenance status `maintained'.
+%%   This work may be distributed and/or modified under the
+%%   conditions of the LaTeX Project Public License, either
+%%   version 1.3c of this license or (at your option) any later
+%%   version. The latest version of this license is in:
 %% 
-%% The Current Maintainer of this work is Zhang Tingxuan.
+%%     http://www.latex-project.org/lppl.txt
 %% 
+%%   and version 1.3 or later is part of all distributions of
+%%   LaTeX version 2005/12/01 or later.
+%% 
+%%   This work has the LPPL maintenance status `maintained'.
+%% 
+%%   The Current Maintainer of this work is Zhang Tingxuan.
+%% 
+%%   This work consists of the files physics2-code.dtx,
+%%             and the derived files physics2.ins,
+%%                                   physics2.sty,
+%%                                   phy-<module>.sty,
+%%                                   physics2-code.pdf,
+%%                               and README.md.
+%% 
 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
 \ProvidesPackage{physics2}
-  [2023/04/02 v0.2.1 Tools for typesetting math for physics.]
-% Some common variables.
-\newcount\phy at tempcnta
-\newdimen\phy at tempdima
-\newdimen\phy at tempdimb
-\newskip\phy at tempskipa
-\newmuskip\phy at tempmuskipa
-\newbox\phy at tempboxa
-\newif\ifphy at tempswa
-\newtoks\phy at toksa
-% The package uses `keyval' to support key-value settings.
+  [2023/10/24 v1.0.0 Tools for typesetting math for physics.]
+\newcount  \phy at tempcnta
+\newdimen  \phy at tempdima
+\newdimen  \phy at tempdimb
+\newskip   \phy at tempskipa
+\newmuskip \phy at tempmuskipa
+\newbox    \phy at tempboxa
+\newif     \ifphy at tempswa
+\newtoks   \phy at toksa
 \RequirePackage{keyval}
 \def\phy at true{true}
 \def\phy at false{false}
-% \phy at define@key{<module>}{<key>}[<default value>]{<code>}
 \long\def\phy at define@key#1{\define at key{phy-#1}}
-% \phy at setkeys{<module>}{<key-val list>}
 \long\def\phy at setkeys#1{\setkeys{phy-#1}}
-% \phy at processkeyopt{<module>}
 \def\phy at processkeyopt#1{\let\reserved at a\@empty%
   \edef\reserved at a{\@ptionlist{\@currname.\@currext}}%
   \edef\reserved at a{\noexpand\phy at setkeys{#1}{\reserved at a}}%
   \reserved at a% the next line thanks to `geometry'
   \AtEndOfPackage{\let\@unprocessedoptions\relax}}
-% Load the physics modules as 2e kernel does.
 \def\usephysicsmodule{\phy at FWoptions\@pkgextension}
 \let\phy at requiremodule\usephysicsmodule
 \@onlypreamble\usephysicsmodule
@@ -64,7 +72,61 @@
     \edef\reserved at a{\expandafter\reserved at b\reserved at a,\@nnil,}%
   \reserved at a}
 \@onlypreamble\phy at FW@pti at ns
-% The `common' module of physics2, every module needs this.
-\phy at requiremodule{common}
+\AtBeginDocument{\ifcsname symrm\endcsname
+  \protected\def\|{\Udelimiter 0 \symoperators "2016 }%
+  \protected\def\vert{\Udelimiter 0 \symoperators "007C\relax}%
+  \protected\def\Vert{\Udelimiter 0 \symoperators "2016\relax}%
+  \protected\def\mid{\Udelimiter 3 \symoperators "007C }%
+\fi}
+\protected\def\Vert{\delimiter"026B30D\relax}
+\protected\def\mid{\delimiter"326A30C }
+\DeclareRobustCommand\delopen{\mathopen{}\mathclose\bgroup\left}
+\DeclareRobustCommand\delclose{\aftergroup\egroup\right}
+\ifdefined\bBigg@
+  \DeclareRobustCommand\biggg{\bBigg@{3}}
+  \DeclareRobustCommand\Biggg{\bBigg@{3.5}}
+\else
+  \DeclareRobustCommand\biggg[1]{\leavevmode at ifvmode
+    {\hbox{$\left#1\vbox to20.5\p@{}\right.\n at space$}}}
+  \DeclareRobustCommand\Biggg[1]{\leavevmode at ifvmode
+    {\hbox{$\left#1\vbox to23.5\p@{}\right.\n at space$}}}
+  \AtBeginDocument{\ifdefined\bBigg@
+    \DeclareRobustCommand\biggg{\bBigg@{3}}%
+    \DeclareRobustCommand\Biggg{\bBigg@{3.5}}%
+  \fi}
+\fi
+\DeclareRobustCommand\bigggl{\mathopen\biggg}
+\DeclareRobustCommand\bigggm{\mathrel\biggg}
+\DeclareRobustCommand\bigggr{\mathclose\biggg}
+\DeclareRobustCommand\Bigggl{\mathopen\Biggg}
+\DeclareRobustCommand\Bigggm{\mathrel\Biggg}
+\DeclareRobustCommand\Bigggr{\mathclose\Biggg}
+\def\phy at mathvphantom#1{\setbox\phy at tempboxa=\hbox{}%
+  \mathchoice
+    {\setbox\@tempboxa\hbox{$\displaystyle#1$}%
+      \ht\phy at tempboxa=\ht\@tempboxa
+      \dp\phy at tempboxa=\dp\@tempboxa
+      \box\phy at tempboxa}
+    {\setbox\@tempboxa\hbox{$\textstyle#1$}%
+      \ht\phy at tempboxa=\ht\@tempboxa
+      \dp\phy at tempboxa=\dp\@tempboxa
+      \box\phy at tempboxa}
+    {\setbox\@tempboxa\hbox{$\scriptstyle#1$}%
+      \ht\phy at tempboxa=\ht\@tempboxa
+      \dp\phy at tempboxa=\dp\@tempboxa
+      \box\phy at tempboxa}
+    {\setbox\@tempboxa\hbox{$\scriptscriptstyle#1$}%
+      \ht\phy at tempboxa=\ht\@tempboxa
+      \dp\phy at tempboxa=\dp\@tempboxa
+      \box\phy at tempboxa}%
+}
+\ExplSyntaxOn
+\int_new:N \l__phy_tmpa_int
+\int_new:N \l__phy_tmpb_int
+\tl_new:N \l__phy_tmpa_tl
+\tl_new:N \l__phy_tmpb_tl
+\cs_new:Npn \__phy_gobble_i:n #1 { }
+\ExplSyntaxOff
 \endinput
+%%
 %% End of file `physics2.sty'.

Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds	2023-10-26 19:49:37 UTC (rev 68656)
+++ trunk/Master/tlpkg/libexec/ctan2tds	2023-10-26 19:51:23 UTC (rev 68657)
@@ -3307,6 +3307,7 @@
  'pbsheet'      => 'latex',  # requires interaction
  'pdflscape'	=> 'etex',
  'penrose'	=> 'etex',
+ 'physics2'	=> 'etex-answer-y',
  'powerdot'	=> 'latex',
  'thumb'        => 'latex -translate-file=empty.tcx',   # no 8-bit
  'pagegrid'	=> 'etex',



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