diff options
author | Karl Berry <karl@freefriends.org> | 2024-01-10 20:43:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-01-10 20:43:48 +0000 |
commit | 9c5953fc6d090a5e9d1b9e7145ea2df9ced77a32 (patch) | |
tree | 47629c79a62cd8fb02e19a3133de393b5805ae25 /Master | |
parent | 7652b0a2c265fdad2d7f7d1eb6e16d664b5fb79e (diff) |
physics2 (10jan24)
git-svn-id: svn://tug.org/texlive/trunk@69369 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/physics2/phy2docdef.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/physics2/physics2-code.pdf | bin | 137994 -> 137750 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/physics2/physics2-legacy.pdf | bin | 82674 -> 82676 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/physics2/physics2.pdf | bin | 88146 -> 90339 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/physics2/physics2.tex | 30 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/physics2/physics2-code.dtx | 29 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty | 15 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/physics2/physics2.sty | 2 |
8 files changed, 49 insertions, 29 deletions
diff --git a/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex b/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex index 25908230979..8344bec7099 100644 --- a/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex +++ b/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex @@ -64,7 +64,7 @@ \newenvironment{example} {\stepcounter{example}\example@start}{\example@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 diff --git a/Master/texmf-dist/doc/latex/physics2/physics2-code.pdf b/Master/texmf-dist/doc/latex/physics2/physics2-code.pdf Binary files differindex ea4d90cd319..adfcb254ec1 100644 --- a/Master/texmf-dist/doc/latex/physics2/physics2-code.pdf +++ b/Master/texmf-dist/doc/latex/physics2/physics2-code.pdf diff --git a/Master/texmf-dist/doc/latex/physics2/physics2-legacy.pdf b/Master/texmf-dist/doc/latex/physics2/physics2-legacy.pdf Binary files differindex 5406b3d7481..03a8dc1377d 100644 --- a/Master/texmf-dist/doc/latex/physics2/physics2-legacy.pdf +++ b/Master/texmf-dist/doc/latex/physics2/physics2-legacy.pdf diff --git a/Master/texmf-dist/doc/latex/physics2/physics2.pdf b/Master/texmf-dist/doc/latex/physics2/physics2.pdf Binary files differindex d8a1f3a3760..d98b1502d68 100644 --- a/Master/texmf-dist/doc/latex/physics2/physics2.pdf +++ b/Master/texmf-dist/doc/latex/physics2/physics2.pdf diff --git a/Master/texmf-dist/doc/latex/physics2/physics2.tex b/Master/texmf-dist/doc/latex/physics2/physics2.tex index c643ab72f92..02458f4cc0e 100644 --- a/Master/texmf-dist/doc/latex/physics2/physics2.tex +++ b/Master/texmf-dist/doc/latex/physics2/physics2.tex @@ -169,6 +169,19 @@ Always remember, do not put an \cs{ab} separately at the end of math mode like \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 @@ is almost no such need). It is quite different from \verb|\mathrel{>}| or \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 @@ be separated by commas. The \opt{empty} option is optional, with default value \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 @@ redefine \cs{Re} and \cs{Im}. If you want to reserve the definition of \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 diff --git a/Master/texmf-dist/source/latex/physics2/physics2-code.dtx b/Master/texmf-dist/source/latex/physics2/physics2-code.dtx index f83913530fa..8f7beb9d907 100644 --- a/Master/texmf-dist/source/latex/physics2/physics2-code.dtx +++ b/Master/texmf-dist/source/latex/physics2/physics2-code.dtx @@ -150,7 +150,7 @@ The Current Maintainer of this work is %</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 @@ The Current Maintainer of this work is \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 @@ The Current Maintainer of this work is %<*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@temp..} % \begin{syntax} -% \cs{phy@temp}\meta{register type}\meta{a|b|c} +% \cs{phy@temp}\meta{register type}\meta{a or b} % \end{syntax} % Some \LaTeXe\ variables starting with ``|\phy@temp|''. % These variables can be shared by any module of \pkg{physics2}. @@ -920,7 +920,7 @@ The Current Maintainer of this work is % \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@define@key { diagmat } { empty } [ 0 ] { \tl_gset:Nn \l_@@_mat_empty_tl { #1 } } @@ -928,9 +928,6 @@ The Current Maintainer of this work is % 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,22 +973,22 @@ The Current Maintainer of this work is { \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 } { \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. +% Maybe it's better to use \verb|\expandafter\scantokens\expandafter{\l_@@_tmpa_tl}| in the next line. % \begin{macrocode} - \int_compare:nNnTF { ####1 } = { \l_@@_mat_dim_int - 1 } + { \tl_gput_right:No \l_@@_mat_line_tl { \l_@@_tmpa_tl } } + } + { \tl_gput_right:Nn \l_@@_mat_line_tl { \l_@@_mat_empty_tl } } + \int_compare:nNnTF { ####1 } = { \l_@@_mat_dim_int } { \tl_gput_right:Nn \l_@@_mat_line_tl { \\ } } @@ -999,7 +996,7 @@ The Current Maintainer of this work is \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 } diff --git a/Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty b/Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty index 5bd6c6229dc..87b4562197b 100644 --- a/Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty +++ b/Master/texmf-dist/tex/latex/physics2/phy-diagmat.sty @@ -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@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,19 +65,19 @@ { \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 } { \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 } diff --git a/Master/texmf-dist/tex/latex/physics2/physics2.sty b/Master/texmf-dist/tex/latex/physics2/physics2.sty index 0c6758e6364..e16db4c1dfb 100644 --- a/Master/texmf-dist/tex/latex/physics2/physics2.sty +++ b/Master/texmf-dist/tex/latex/physics2/physics2.sty @@ -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@tempcnta \newdimen \phy@tempdima \newdimen \phy@tempdimb |