texlive[69369] Master/texmf-dist: physics2 (10jan24)

commits+karl at tug.org commits+karl at tug.org
Wed Jan 10 21:43:48 CET 2024


Revision: 69369
          https://tug.org/svn/texlive?view=revision&revision=69369
Author:   karl
Date:     2024-01-10 21:43:48 +0100 (Wed, 10 Jan 2024)
Log Message:
-----------
physics2 (10jan24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex
    trunk/Master/texmf-dist/doc/latex/physics2/physics2-code.pdf
    trunk/Master/texmf-dist/doc/latex/physics2/physics2-legacy.pdf
    trunk/Master/texmf-dist/doc/latex/physics2/physics2.pdf
    trunk/Master/texmf-dist/doc/latex/physics2/physics2.tex
    trunk/Master/texmf-dist/source/latex/physics2/physics2-code.dtx
    trunk/Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty
    trunk/Master/texmf-dist/tex/latex/physics2/physics2.sty

Modified: trunk/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex	2024-01-10 20:43:37 UTC (rev 69368)
+++ trunk/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex	2024-01-10 20:43:48 UTC (rev 69369)
@@ -64,7 +64,7 @@
 \newenvironment{example}
   {\stepcounter{example}\example at start}{\example at end}
 \author{Zhang Tingxuan}
-\date{2023/10/24\quad Version 1.0.0\thanks{%
+\date{2024/01/10\quad Version 1.0.1\thanks{%
   \url{https://www.github.com/AlphaZTX/physics2}}}
 \makeatother
 \endinput

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

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

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	2024-01-10 20:43:37 UTC (rev 69368)
+++ trunk/Master/texmf-dist/doc/latex/physics2/physics2.tex	2024-01-10 20:43:48 UTC (rev 69369)
@@ -169,6 +169,19 @@
 \verb|$\ab$|, because \cs{ab} will try to absorb the following math shift
 character (\verb|$|) as its argument.
 
+\pardanger
+\textbf{Important Note:} The \modu{ab} module uses ``document commands''
+module of \LaTeXe{} kernel (source file: ltcmd.dtx). This \LaTeXe{} kernel
+module provides a document-level command parser. \cs{ab} is a complex
+encapsulation of some internal document-level commands. Take an example,
+if you define a document-level command like this:
+\begin{Verbatim}
+\NewDocumentCommand \foo { r() } {::#1::}
+\end{Verbatim}
+You can write \verb|\foo(bar)| legally, but \verb|\foo(()| will be regarded
+illegal when you write another document-level command or end the paragraph.
+Similarly, things like \verb|\ab(()| will also cause errors.
+
 The \modu{ab} module also provides \texttt{\textbackslash}$X$\texttt{ab}
 commands, where $X$ can be \opt{p}, \opt{b}, \opt{B}, \opt{a}, \opt{v} and
 \opt{V}. These commands take a normal argument but not an argument delimited
@@ -266,6 +279,18 @@
 \verb|\mathrel{<}| because in these commands' argument, \opt{>} and \opt{<}
 will be redefined.
 
+\pardanger
+\textbf{Important Notes:} Commands provided by \modu{ab.braket} should NOT
+be placed barely in \meta{subformula} of \cs{ab}\texttt|\meta{subformula}\texttt|.
+Errors will arise if you write such code. To avoid the errors, you can write
+like this:
+\begin{example}
+\[
+  \ab| { \braket<\psi|\hat H|\psi> } |
+\]
+\end{example}
+Just add the braces.
+
 Next, the \modu{braket} module will be introduced. Please notice that
 \modu{braket} is conflict with \modu{ab.braket}, they cannot be used together.
 
@@ -338,7 +363,7 @@
 \opt{0}. For example,
 \begin{example}
 \[
-  \diagmat { 1, 2, 3 }
+  \diagmat { 1, \sqrt2, \sqrt[3]4 }
 \]
 \end{example}
 \cs{pdiagmat}, \cs{bdiagmat}, \cs{Bdiagmat}, \cs{vdiagmat} and \cs{Vdiagmat}
@@ -570,6 +595,7 @@
 \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
-\href{./physics2-legacy.pdf}{physics2-legacy} for more information.
+\href{./physics2-legacy.pdf}{\texttt{texdoc physics2-legacy}} for
+more information.
 
 \end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/source/latex/physics2/physics2-code.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/physics2/physics2-code.dtx	2024-01-10 20:43:37 UTC (rev 69368)
+++ trunk/Master/texmf-dist/source/latex/physics2/physics2-code.dtx	2024-01-10 20:43:48 UTC (rev 69369)
@@ -150,7 +150,7 @@
 %</internal>
 %
 %<*driver>
-\ProvidesFile{fixdif.dtx}[2023/03/20 (c) Copyright 2022-2023 by Zhang Tingxuan]
+\ProvidesFile{fixdif.dtx}[2024/01/10 (c) Copyright 2022-2024 by Zhang Tingxuan]
 \documentclass{l3doc}
 \usepackage{doc}
 \hypersetup{hidelinks}
@@ -208,7 +208,7 @@
 \makeatother
 \title{Code documentation to the \pkg{physics2} package}
 \author{Zhang Tingxuan}
-\date{2023/10/24 v1.0.0}
+\date{2024/01/10 v1.0.1}
 \begin{document}
   \DocInput{physics2-code.dtx}
 \end{document}
@@ -226,12 +226,12 @@
 %<*package>
 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
 \ProvidesPackage{physics2}
-  [2023/10/24 v1.0.0 Tools for typesetting math for physics.]
+  [2024/01/10 v1.0.1 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}
+%     \cs{phy at temp}\meta{register type}\meta{a or b}
 %   \end{syntax}
 %   Some \LaTeXe\ variables starting with ``|\phy at temp|''. 
 %   These variables can be shared by any module of \pkg{physics2}.
@@ -920,7 +920,7 @@
 % \section{The \modu{diagmat} module}
 %    \begin{macrocode}
 %<*diagmat>
-\ProvidesExplFile{phy-diagmat.sty}{2023/10/24}{}
+\ProvidesExplFile{phy-diagmat.sty}{2024/01/10}{}
   {`diagmat' module of physics2}
 \RequirePackage { amsmath }
 \phy at define@key { diagmat } { empty } [ 0 ] { \tl_gset:Nn \l_@@_mat_empty_tl { #1 } }
@@ -928,9 +928,6 @@
 % 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
@@ -976,9 +973,9 @@
       { \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 { 1 } { \l_@@_mat_dim_int }
       {
-        \int_step_inline:nnn { 0 } { \l_@@_mat_dim_int - 1 }
+        \int_step_inline:nnn { 1 } { \l_@@_mat_dim_int }
           {
             \int_compare:nNnTF { ##1 } = { ####1 }
               {
@@ -985,13 +982,13 @@
                 \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 } }
+%    \end{macrocode}
+% Maybe it's better to use \verb|\expandafter\scantokens\expandafter{\l_@@_tmpa_tl}| in the next line.
+%    \begin{macrocode}
+                  { \tl_gput_right:No \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 }
+            \int_compare:nNnTF { ####1 } = { \l_@@_mat_dim_int }
               {
                 \tl_gput_right:Nn \l_@@_mat_line_tl { \\ }
               }
@@ -999,7 +996,7 @@
                 \tl_gput_right:Nn \l_@@_mat_line_tl { & }
               }
           }
-        \tl_gput_right:Nx \l_@@_diagmat_tl { \l_@@_mat_line_tl }
+        \tl_gput_right:No \l_@@_diagmat_tl { \l_@@_mat_line_tl }
         \tl_gclear:N \l_@@_mat_line_tl
       }
     \begin { #1 matrix }

Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty	2024-01-10 20:43:37 UTC (rev 69368)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty	2024-01-10 20:43:48 UTC (rev 69369)
@@ -29,14 +29,11 @@
 %%                                   physics2-code.pdf,
 %%                               and README.md.
 %% 
-\ProvidesExplFile{phy-diagmat.sty}{2023/10/24}{}
+\ProvidesExplFile{phy-diagmat.sty}{2024/01/10}{}
   {`diagmat' module of physics2}
 \RequirePackage { amsmath }
 \phy at define@key { diagmat } { empty } [ 0 ] { \tl_gset:Nn \l__phy_mat_empty_tl { #1 } }
 \clist_new:N \l__phy_mat_diag_clist
-\clist_new:N \l__phy_mat_tmpa_clist
-\clist_new:N \l__phy_mat_tmpb_clist
-\clist_new:N \l__phy_mat_diagpos_clist
 \int_new:N \l__phy_mat_dim_int
 \tl_new:N \l__phy_mat_line_tl
 \tl_new:N \l__phy_diagmat_tl
@@ -68,9 +65,9 @@
       { \setcounter { MaxMatrixCols } { \l__phy_mat_dim_int } }
     \keys_set:nn { phy/diagmat } { #2 }
     \tl_gclear:N \l__phy_diagmat_tl
-    \int_step_inline:nnn { 0 } { \l__phy_mat_dim_int - 1 }
+    \int_step_inline:nnn { 1 } { \l__phy_mat_dim_int }
       {
-        \int_step_inline:nnn { 0 } { \l__phy_mat_dim_int - 1 }
+        \int_step_inline:nnn { 1 } { \l__phy_mat_dim_int }
           {
             \int_compare:nNnTF { ##1 } = { ####1 }
               {
@@ -77,10 +74,10 @@
                 \clist_gpop:NN \l__phy_mat_diag_clist \l__phy_tmpa_tl
                 \tl_if_empty:NTF \l__phy_tmpa_tl
                   { \tl_gput_right:Nn \l__phy_mat_line_tl { \l__phy_mat_empty_tl } }
-                  { \tl_gput_right:Nx \l__phy_mat_line_tl { \l__phy_tmpa_tl } }
+                  { \tl_gput_right:No \l__phy_mat_line_tl { \l__phy_tmpa_tl } }
               }
               { \tl_gput_right:Nn \l__phy_mat_line_tl { \l__phy_mat_empty_tl } }
-            \int_compare:nNnTF { ####1 } = { \l__phy_mat_dim_int - 1 }
+            \int_compare:nNnTF { ####1 } = { \l__phy_mat_dim_int }
               {
                 \tl_gput_right:Nn \l__phy_mat_line_tl { \\ }
               }
@@ -88,7 +85,7 @@
                 \tl_gput_right:Nn \l__phy_mat_line_tl { & }
               }
           }
-        \tl_gput_right:Nx \l__phy_diagmat_tl { \l__phy_mat_line_tl }
+        \tl_gput_right:No \l__phy_diagmat_tl { \l__phy_mat_line_tl }
         \tl_gclear:N \l__phy_mat_line_tl
       }
     \begin { #1 matrix }

Modified: trunk/Master/texmf-dist/tex/latex/physics2/physics2.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/physics2.sty	2024-01-10 20:43:37 UTC (rev 69368)
+++ trunk/Master/texmf-dist/tex/latex/physics2/physics2.sty	2024-01-10 20:43:48 UTC (rev 69369)
@@ -31,7 +31,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}[2020/10/01]
 \ProvidesPackage{physics2}
-  [2023/10/24 v1.0.0 Tools for typesetting math for physics.]
+  [2024/01/10 v1.0.1 Tools for typesetting math for physics.]
 \newcount  \phy at tempcnta
 \newdimen  \phy at tempdima
 \newdimen  \phy at tempdimb



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