texlive[66711] Master/texmf-dist: physics2 (30mar23)
commits+karl at tug.org
commits+karl at tug.org
Thu Mar 30 22:05:52 CEST 2023
Revision: 66711
http://tug.org/svn/texlive?view=revision&revision=66711
Author: karl
Date: 2023-03-30 22:05:52 +0200 (Thu, 30 Mar 2023)
Log Message:
-----------
physics2 (30mar23)
Modified Paths:
--------------
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-braket.sty
trunk/Master/texmf-dist/tex/latex/physics2/phy-common.sty
Modified: trunk/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex 2023-03-30 20:05:05 UTC (rev 66710)
+++ trunk/Master/texmf-dist/doc/latex/physics2/phy2docdef.tex 2023-03-30 20:05:52 UTC (rev 66711)
@@ -64,7 +64,7 @@
\newenvironment{example}
{\stepcounter{example}\example at start}{\example at end}
\author{Zhang Tingxuan}
-\date{2023/02/07\quad Version 0.1.1\thanks{%
+\date{2023/03/30\quad Version 0.2.0\thanks{%
\url{https://www.github.com/AlphaZTX/physics2}}}
\makeatother
\endinput
\ No newline at end of file
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-03-30 20:05:05 UTC (rev 66710)
+++ trunk/Master/texmf-dist/doc/latex/physics2/physics2-legacy.tex 2023-03-30 20:05:52 UTC (rev 66711)
@@ -8,10 +8,10 @@
\documentclass[11pt,letterpaper]{article}
\usepackage{amsmath}
\usepackage{unicode-math}
-\setmainfont{Latin Modern Roman}
-\setsansfont{Latin Modern Sans}
-\setmonofont{Latin Modern Mono}
-\setmathfont{Latin Modern Math}
+\setmainfont{Libertinus Serif}
+\setsansfont{Libertinus Sans}
+\setmonofont{Noto Sans Mono}[Scale=MatchLowercase]
+\setmathfont{Libertinus Math}
\usepackage{physics2}
\usephysicsmodule{ab}
\usephysicsmodule{ab.legacy,nabla.legacy}
@@ -177,11 +177,11 @@
\[ \aab{\0} \quad \vab{\0}
\quad \Vab{\0} \]
\end{example}
-Also, after \texttt{\textbackslash}$X$\texttt{ab} can be a ``biggg'' command
-or a star. For example,
+\texttt{\textbackslash$X$ab} can take an optional star and an optional \oarg{biggg}
+argument. For example,
\begin{example}
\def\0{\frac12}
-\[ \pab\Big{\0} \quad \bab*{\0} \]
+\[ \pab[Big]{\0} \quad \bab*{\0} \]
\end{example}
\pkg{physics} also provides the following commands:
@@ -197,18 +197,19 @@
For example,
\begin{example}
\def\0{\frac12}
-\[ \abs{\0} \quad \abs\Big{\0}
+\[ \abs{\0} \quad \abs[big]{\0}
\quad \abs*{\0} \]
\end{example}
Users of the legacy \pkg{physics} package should notice that the syntax of
-\cs{eval} has been changed to \cs{eval}\oarg{left delimiter}\marg{subformula}.
-The \modu{ab.legacy} module abandoned the \verb"\eval(foo|"-like syntax. The
-\meta{left delimiter} argument is optional. For example,
+\cs{eval} has been changed. The \modu{ab.legacy} module abandoned the
+\verb"\eval(foo|"-like syntax. The new \cs{eval}'s syntax is just like other
+commands in this module. There are also two variants of \cs{eval} --- \cs{peval}
+and \cs{beval}. For example,
\begin{example}
-\def\0{\frac12x}
-\[ \eval{\0}_a^b \quad
- \eval[(]{\0}_a^b \quad
- \eval[[]\big{\0}_a^b \]
+\def\0{1+\frac12x}
+\[ \eval{\0}_a^b \quad
+ \peval*{\0}_a^b \quad
+ \beval[big]{\0}_a^b \]
\end{example}
The \cs{comm}, \cs{acomm} and \cs{pb} (Poisson bracket) are not supported.
But you can write like \verb|\ab[foo,baz]| or \verb|\bab{foo,baz}| instead.
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-03-30 20:05:05 UTC (rev 66710)
+++ trunk/Master/texmf-dist/doc/latex/physics2/physics2.tex 2023-03-30 20:05:52 UTC (rev 66711)
@@ -172,11 +172,12 @@
\[ \pab{\0} \bab{\0} \Bab{\0} \]
\[ \aab{\0} \vab{\0} \Vab{\0} \]
\end{example}
-After \texttt{\textbackslash}$X$\texttt{ab} can be a ``biggg'' command or a
-star. For example,
+These \texttt{\textbackslash$X$ab} commands can take an optional star and
+an optional \oarg{biggg} argument. Star stands for using the default sizes.
+For example,
\begin{example}
-\def\0{\frac12}
-\[ \pab\Big{\0} \quad \bab*{\0} \]
+\def\0{n+\frac12}
+\[ \pab[Big]{\0} \quad \bab*{\0} \]
\end{example}
\paragraph{The options of \modu{ab} module}
@@ -471,21 +472,22 @@
\subsection{The \modu{ab.legacy} module}
This module provides the following commands:
\begin{Verbatim}[fontsize=\small]
-\abs \norm \eval \order
+\abs \norm \eval (\peval \beval) \order
\end{Verbatim}
-They can take a normal argument. Between these commands and their argument
-can be a ``biggg'' command or a star. For example,
+They shares 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}
-\def\0{\frac12}
+\def\0{1+\frac12}
\[ \abs{\0} \quad
- \norm\Big{\0} \quad
+ \norm[Big]{\0} \quad
\order*{\0} \]
\end{example}
\begin{example}
-\def\0{\frac12x}
-\[ \eval{\0}_a^b \quad
- \eval[(]{\0}_a^b \quad
- \eval[[]\big{\0}_a^b \]
+\def\0{1+\frac12x}
+\[ \eval{\0}_a^b \quad
+ \peval*{\0}_a^b \quad
+ \beval[big]{\0}_a^b \]
\end{example}
You can set the ``order'' symbol in this module through
the \opt{order} option like this:
Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.braket.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.braket.sty 2023-03-30 20:05:05 UTC (rev 66710)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.braket.sty 2023-03-30 20:05:52 UTC (rev 66711)
@@ -39,11 +39,11 @@
% \braket<foo|bar>
\begingroup
\catcode`\|=\active
-\gdef\phy@@mb at bk#1#2{\begingroup%
+\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%
+\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}
@@ -58,18 +58,18 @@
\begingroup
\catcode`\<=\active
\catcode`\>=\active
-\gdef\phy@@mb at kb#1#2{\begingroup%
+\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%
+\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%
+ \phy at abopen\langle#3\mathclose{\phy at mathvphantom{#1}}\phy at abclose\vert
\endgroup}
-\AtBeginDocument{\ifcsname symbf\endcsname%
+\AtBeginDocument{\ifcsname symbf\endcsname
\def\phy at abb@l{\Umathchar 3 \symoperators "003C }%
\def\phy at abb@r{\Umathchar 3 \symoperators "003E }%
\fi}
Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.legacy.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.legacy.sty 2023-03-30 20:05:05 UTC (rev 66710)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.legacy.sty 2023-03-30 20:05:52 UTC (rev 66711)
@@ -17,7 +17,7 @@
%% The Current Maintainer of this work is Zhang Tingxuan.
%%
\ProvidesFile{phy-ab.legacy.sty}
- [2023/01/25 `ab.legacy' module of `physics2.sty']
+ [2023/03/29 `ab.legacy' module of `physics2.sty']
\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}}
@@ -25,9 +25,19 @@
\phy at setkeys{ab.legacy}{order}
\phy at processkeyopt{ab.legacy}
% The braced operators.
-\DeclareRobustCommand\abs{\phy at d@ly\vert\vert}
-\DeclareRobustCommand\norm{\phy at d@ly\Vert\Vert}
-\DeclareRobustCommand\order{\phy at ab@ordersym\phy at d@ly()}
-\DeclareRobustCommand\eval[1][.]{\phy at d@ly#1|}
+\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
\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-03-30 20:05:05 UTC (rev 66710)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-ab.sty 2023-03-30 20:05:52 UTC (rev 66711)
@@ -57,7 +57,7 @@
\phy at AB@gen{mb}\vert{mr\vert\vert}{\mathopen#1\vert#2\mathclose#1\vert}
\phy at AB@gen{mb}\Vert{mr\Vert\Vert}{\mathopen#1\Vert#2\mathclose#1\Vert}
\phy at AB@gen{mb}\langle{mr\langle\rangle}{\mathopen#1\langle#2\mathclose#1\rangle}
-% \phy at del, the automatic
+% \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}
@@ -66,8 +66,6 @@
\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 AB@gb(a|b|..): gobble (a|b|..) arguments in the middle.
-\def\phy at AB@gbc#1#2#3#4#5{#1{#5}}
% \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{%
@@ -88,18 +86,24 @@
% Generate the `mb' and `ab' arguments.
\phy at d@l at genxm{mb}
\phy at d@l at genxa{ab}
-% \phy at d@ly (phy_del_y): the internal defination of \(p|b|..)ab.
-\def\phy at d@ly#1#2#3{\ifcsname phy at del\string#3\endcsname
- \phy at AB@gbc{\csname phy at del\string#3\endcsname#1#2}%
- \else{\phy at del#1#2{#3}}\fi}
% \ab(<subformula>), after \ab can be a star or \biggg.
\DeclareRobustCommand\ab{\phy at d@lx{mb}{ab}}
-% \(p|b|..)ab{<subformula>}, after \(p|..)ab can be a star or \biggg.
-\DeclareRobustCommand\pab{\phy at d@ly()}
-\DeclareRobustCommand\bab{\phy at d@ly[]}
-\DeclareRobustCommand\Bab{\phy at d@ly\lbrace\rbrace}
-\DeclareRobustCommand\vab{\phy at d@ly\vert\vert}
-\DeclareRobustCommand\aab{\phy at d@ly\langle\rangle}
-\DeclareRobustCommand\Vab{\phy at d@ly\Vert\Vert}
+% \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}%
+ {#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
\endinput
%% End of file `phy-ab.sty'.
Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-braket.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-braket.sty 2023-03-30 20:05:05 UTC (rev 66710)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-braket.sty 2023-03-30 20:05:52 UTC (rev 66711)
@@ -17,7 +17,7 @@
%% The Current Maintainer of this work is Zhang Tingxuan.
%%
\ProvidesFile{phy-braket.sty}
- [2023/01/25 `braket' module of `physics2.sty']
+ [2023/03/29 `braket' module of `physics2.sty']
% Here we need to get the definition of \phy at abopen and \phy at abclose.
\phy at requiremodule{ab}
\ifdefined\phy at abb@bkv
@@ -74,23 +74,23 @@
\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.
-\def\@phy at bk@do at pt#1,{\ifx#1\relax\@empty\else%
+% 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%
- \ifcsname phy at del\expandafter\string\csname\reserved at a\endcsname\endcsname%
+ \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%
+ \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%
+ \fi
\xdef\@phy at bk@argnum{\romannumeral\reserved at a}%
- \fi%
- \fi%
+ \fi
+ \fi
\expandafter\@phy at bk@do at pt\fi}
\def\phy at bk@doopt#1{\@phy at bk@do at pt#1,\relax,}
% \ketbra
@@ -100,9 +100,9 @@
{\IfValueTF{#2}%
{\csname#2l\endcsname\vert#3\csname#2r\endcsname\rangle#4%
\csname#2l\endcsname\langle#5\csname#2r\endcsname\vert}%
- {\begingroup%
+ {\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%
+ \phy at abopen\langle#5\mathclose{\phy at mathvphantom{#3}}\phy at abclose\vert
\endgroup}%
}%
}
Modified: trunk/Master/texmf-dist/tex/latex/physics2/phy-common.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics2/phy-common.sty 2023-03-30 20:05:05 UTC (rev 66710)
+++ trunk/Master/texmf-dist/tex/latex/physics2/phy-common.sty 2023-03-30 20:05:52 UTC (rev 66711)
@@ -17,9 +17,10 @@
%% The Current Maintainer of this work is Zhang Tingxuan.
%%
\ProvidesFile{phy-common.sty}
- [2023/01/25 `common' module of `physics2.sty']
-% Check if `unicode-math' loaded and (re)define the vert symbols.
-% The `\relax'es here are for \ifx to compare.
+ [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}%
More information about the tex-live-commits
mailing list.