texlive[74066] Master/texmf-dist: physics-patch (17feb25)
commits+karl at tug.org
commits+karl at tug.org
Mon Feb 17 21:44:25 CET 2025
Revision: 74066
https://tug.org/svn/texlive?view=revision&revision=74066
Author: karl
Date: 2025-02-17 21:44:25 +0100 (Mon, 17 Feb 2025)
Log Message:
-----------
physics-patch (17feb25)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/physics-patch/README.txt
trunk/Master/texmf-dist/doc/latex/physics-patch/physics-patch.pdf
trunk/Master/texmf-dist/doc/latex/physics-patch/physics-patch.tex
trunk/Master/texmf-dist/tex/latex/physics-patch/physics-patch.sty
Modified: trunk/Master/texmf-dist/doc/latex/physics-patch/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/physics-patch/README.txt 2025-02-17 20:44:09 UTC (rev 74065)
+++ trunk/Master/texmf-dist/doc/latex/physics-patch/README.txt 2025-02-17 20:44:25 UTC (rev 74066)
@@ -1,4 +1,4 @@
-physics-patch 2.1
+physics-patch 2.4
Improved version of the physics package
Modified: trunk/Master/texmf-dist/doc/latex/physics-patch/physics-patch.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/physics-patch/physics-patch.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/physics-patch/physics-patch.tex 2025-02-17 20:44:09 UTC (rev 74065)
+++ trunk/Master/texmf-dist/doc/latex/physics-patch/physics-patch.tex 2025-02-17 20:44:25 UTC (rev 74066)
@@ -6,10 +6,14 @@
\setmainfont{TeX Gyre Termes}[Ligatures=TeX]
\setsansfont{TeX Gyre Heros}[Ligatures=TeX]
\setmonofont{TeX Gyre Cursor}[Ligatures=TeX]
+\usepackage{unicode-math}
+\setmathfont{XITS Math}\setmathfont[range={cal,bfcal},StylisticSet=1]{XITS Math}
\everymath{\displaystyle}
\everydisplay{\displaystyle}
\newcolumntype{M}{>{$\displaystyle}c<{$}}
\newcolumntype{L}{>{$\displaystyle}l<{$}}
+\setlength{\LTleft}{\fill}
+\setlength{\LTright}{\fill}
\renewcommand{\maketitle}{
\begin{titlepage}
\begin{center}
@@ -23,7 +27,6 @@
\end{center}
\end{titlepage}
}
-\renewcommand{\arraystretch}{2}
\lstset{
basicstyle=\ttfamily\scriptsize,
keywordstyle=\color{blue},
@@ -42,7 +45,7 @@
}
\title{The \texttt{physics-patch} package\\\mbox{}\\\textnormal{\large Improved version of the physics package}}
\author{\mbox{}\\Willie Shen (Willie169)}
-\date{Version 2.1\\\textnormal{Last update: Feb. 16, 2025}}
+\date{Version 2.4\\\textnormal{Last update: Feb. 17, 2025}}
\begin{document}
\onehalfspacing\thispagestyle{empty}\Needspace{1\textheight}\maketitle\setcounter{page}{1}\Needspace{1\textheight}\tableofcontents\Needspace{1\textheight}\setcounter{page}{1}
\section{Preface}
@@ -87,9 +90,9 @@
\section{List of Commands}
In the commands listed below, the left column is long-form names with non-default alternate names (if any), the middle column is default shorthand commands with detailed syntaxes and explanations.\\
Commands that have different definitions come with \texttt{PT} in the beginning of their name (e.g. \verb|\PTmqty|). If \texttt{nooverride} is not used or the \texttt{physics} package is not loaded before this package, the commands without \texttt{PT} will be silent overriden to be the same as the ones with \texttt{PT}.
-{\fontsize{6pt}{9pt}\selectfont
\subsection{Automatic bracing}
-\begin{longtable}[l]{ p{6cm} l p{6cm} l p{6cm} }
+\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\hline
\verb|\PTquantity| or \verb|\PHquantity| or \verb|\PHqty| & \verb|\PTqty(\typical)| $\displaystyle\rightarrow \PTqty(\typical)$ & automatic $\PTqty(\;)$ braces \\
& \verb|\PTqty(\tall)| $\displaystyle\rightarrow \PTqty(\tall)$ & \\
& \verb|\PTqty(\grande)| $\displaystyle\rightarrow \PTqty(\grande)$ & \\
@@ -103,26 +106,26 @@
& \verb|\pqty{}| $\leftrightarrow$ \verb|\PTqty()| & \multirow{2}{*}{\parbox{6cm}{alternative syntax; robust and more \LaTeX-friendly}} \\
& \verb|\bqty{}| $\leftrightarrow$ \verb|\PTqty[]| & \\
& \verb+\vqty{}+ $\leftrightarrow$ \verb+\PTqty||+ & \\
-& \verb|\Bqty{}| $\leftrightarrow$ \verb|\PTqty{}| & \\
+& \verb|\Bqty{}| $\leftrightarrow$ \verb|\PTqty{}| & \\\hline
\verb|\absolutevalue| & \verb|\abs{a}| $\rightarrow \abs{a}$ & automatic sizing; equivalent to \verb|\PTqty| \!\!\texttt{|a|} \\
& \verb|\abs\Big{a}| $\rightarrow \abs\Big{a}$ & inherits manual sizing syntax from \verb|\PTqty| \\
-& \verb|\abs*{\grande}| $\displaystyle\rightarrow \abs*{\grande}$ & star for no resize \\
+& \verb|\abs*{\grande}| $\displaystyle\rightarrow \abs*{\grande}$ & star for no resize \\\hline
\verb|\norm| & \verb|\norm{a}| $\rightarrow \norm{a}$ & automatic sizing \\
& \verb|\norm\Big{a}| $\rightarrow \norm\Big{a}$ & manual sizing \\
-& \verb|\norm*{\grande}| $\displaystyle\rightarrow \norm*{\grande}$ & star for no resize \\
+& \verb|\norm*{\grande}| $\displaystyle\rightarrow \norm*{\grande}$ & star for no resize \\\hline
\verb|\evaluated| & \verb|\eval{x}_0^\infty| $\displaystyle\rightarrow \eval{x}_0^\infty$ & vertical bar for evaluation limits \\
& \verb|\eval(x| \!\!\texttt{|}\!\! \verb|_0^\infty| $\displaystyle\rightarrow \eval(x|_0^\infty$ & alternate form \\
& \verb|\eval[x| \!\!\texttt{|}\!\! \verb|_0^\infty| $\displaystyle\rightarrow \eval[x|_0^\infty$ & alternate form \\
& \verb|\eval[\venti| \!\!\texttt{|}\!\! \verb|_0^\infty| $\displaystyle\rightarrow \eval[\venti|_0^\infty$ & automatic sizing\\
-& \verb|\eval*[\venti| \!\!\texttt{|}\!\! \verb|_0^\infty| $\displaystyle\rightarrow \eval*[\venti|_0^\infty$ & star for no resize \\
+& \verb|\eval*[\venti| \!\!\texttt{|}\!\! \verb|_0^\infty| $\displaystyle\rightarrow \eval*[\venti|_0^\infty$ & star for no resize \\\hline
\verb|\order| & \verb|\order{x^2}| $\rightarrow \order{x^2}$ & order symbol; automatic sizing and space handling \\
& \verb|\order\Big{x^2}| $\rightarrow \order\Big{x^2}$ & manual sizing \\
-& \verb|\order*{\grande}| $\displaystyle\rightarrow \order*{\grande}$ & star for no resize \\
+& \verb|\order*{\grande}| $\displaystyle\rightarrow \order*{\grande}$ & star for no resize \\\hline
\verb|\commutator| & \verb|\comm{A}{B}| $\rightarrow \comm{A}{B}$ & automatic sizing \\
& \verb|\comm\Big{A}{B}| $\rightarrow \comm\Big{A}{B}$ & manual sizing \\
-& \verb|\comm*{A}{\grande}| $\displaystyle\rightarrow \comm*{A}{\grande}$ & star for no resize \\
-\verb|\anticommutator| or \verb|\acommutator| & \verb|\acomm{A}{B}| $\rightarrow \acomm{A}{B}$ & same as \verb|\poissonbracket| \\
-\verb|\poissonbracket| & \verb|\pb{A}{B}| $\rightarrow \pb{A}{B}$ & same as \verb|\anticommutator|
+& \verb|\comm*{A}{\grande}| $\displaystyle\rightarrow \comm*{A}{\grande}$ & star for no resize \\\hline
+\verb|\anticommutator| or \verb|\acommutator| & \verb|\acomm{A}{B}| $\rightarrow \acomm{A}{B}$ & same as \verb|\poissonbracket| \\\hline
+\verb|\poissonbracket| & \verb|\pb{A}{B}| $\rightarrow \pb{A}{B}$ & same as \verb|\anticommutator|\\\hline
\end{longtable}
\subsection{Vector notation}
The default del symbol $\vnabla$ used in \texttt{physics-patch} vector notation can be switched to appear with an arrow $\vec{\vnabla}$ by including the option \texttt{arrowdel} in the document preamble:
@@ -129,33 +132,34 @@
\begin{lstlisting}[language=TeX]
\usepackage[arrowdel]{physics-patch}
\end{lstlisting}
-\begin{longtable}[l]{ p{6cm} l p{6cm} l p{6cm} }
+\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\hline
\verb|\vectorbold| & \verb|\vb{a}| $\rightarrow \vb{a}$ & upright/no Greek \\
-& \verb|\vb*{a}|, \verb|\vb*{\theta}| $\rightarrow \vb*{a}$, $\vb*{\theta}$ & italic/Greek \\
+& \verb|\vb*{a}|, \verb|\vb*{\theta}| $\rightarrow \vb*{a}$, $\vb*{\theta}$ & italic/Greek \\\hline
\verb|\vectorarrow| & \verb|\va{a}| $\rightarrow \va{a}$ & upright/no Greek \\
-& \verb|\va*{a}|, \verb|\va*{\theta}| $\rightarrow \va*{a}$, $\va*{\theta}$ & italic/Greek \\
+& \verb|\va*{a}|, \verb|\va*{\theta}| $\rightarrow \va*{a}$, $\va*{\theta}$ & italic/Greek \\\hline
\verb|\vectorunit| & \verb|\vu{a}| $\rightarrow \vu{a}$ & upright/no Greek \\
-& \verb|\vu*{a}|, \verb|\vu*{\theta}| $\rightarrow \vu*{a}$, $\vu*{\theta}$ & italic/Greek \\
-\verb|\dotproduct| & \verb|\vdot| $\rightarrow \vdot$ as in $\vb{a} \vdot \vb{b}$ & note: \verb|\dp| is a protected \TeX\ primitive \\
+& \verb|\vu*{a}|, \verb|\vu*{\theta}| $\rightarrow \vu*{a}$, $\vu*{\theta}$ & italic/Greek \\\hline
+\verb|\dotproduct| & \verb|\vdot| $\rightarrow \vdot$ as in $\vb{a} \vdot \vb{b}$ & note: \verb|\dp| is a protected \TeX\ primitive \\\hline
\verb|\crossproduct| & \verb|\cross| $\rightarrow \cross$ as in $\vb{a} \cross \vb{b}$ & alternate name \\
-& \verb|\cp| $\rightarrow \cp$ as in $\vb{a} \cp \vb{b}$ & shorthand name \\
+& \verb|\cp| $\rightarrow \cp$ as in $\vb{a} \cp \vb{b}$ & shorthand name \\\hline
\verb|\gradient| & \verb|\grad| $\rightarrow \grad$ & \\
& \verb|\grad{\Psi}| $\rightarrow \grad{\Psi}$ & default mode \\
& \verb|\grad(\Psi+\tall)| $\displaystyle\rightarrow \grad(\Psi+\tall)$ & long-form (like \verb|\PTqty| but also handles spacing) \\
-& \verb|\grad[\Psi+\tall]| $\displaystyle\rightarrow \grad[\Psi+\tall]$ & \\
+& \verb|\grad[\Psi+\tall]| $\displaystyle\rightarrow \grad[\Psi+\tall]$ & \\\hline
+\verb|\divisionsymbol| & \verb|\divisionsymbol| $\rightarrow \divisionsymbol$ & \\\hline
\verb|\divergence| & \verb|\divg| $\rightarrow \divg$ & note: if \texttt{nooriginaldiv} option is used, \verb|\div| will be overriden as $\divg$ too (not recommended) \\
-\verb|\divisionsymbol| & \verb|\divisionsymbol| $\rightarrow \divisionsymbol$ & \\
& \verb|\divg{\vb{a}}| $\rightarrow \divg{\vb{a}}$ & default mode \\
& \verb|\divg(\vb{a}+\tall)| $\displaystyle\rightarrow \divg(\vb{a}+\tall)$ & long-form \\
-& \verb|\divg[\vb{a}+\tall]| $\displaystyle\rightarrow \divg[\vb{a}+\tall]$ & \\
+& \verb|\divg[\vb{a}+\tall]| $\displaystyle\rightarrow \divg[\vb{a}+\tall]$ & \\\hline
\verb|\curl| & \verb|\curl| $\rightarrow \curl$ & \\
& \verb|\curl{\vb{a}}| $\rightarrow \curl{\vb{a}}$ & default mode \\
& \verb|\curl(\vb{a}+\tall)| $\displaystyle\rightarrow \curl(\vb{a}+\tall)$ & long-form \\
-& \verb|\curl[\vb{a}+\tall]| $\displaystyle\rightarrow \curl[\vb{a}+\tall]$ & \\
+& \verb|\curl[\vb{a}+\tall]| $\displaystyle\rightarrow \curl[\vb{a}+\tall]$ & \\\hline
\verb|\laplacian| & \verb|\laplacian| $\rightarrow \laplacian$ & \\
& \verb|\laplacian{\Psi}| $\rightarrow \laplacian{\Psi}$ & default mode \\
& \verb|\laplacian(\Psi+\tall)| $\displaystyle\rightarrow \laplacian(\Psi+\tall)$ & long-form \\
-& \verb|\laplacian[\Psi+\tall]| $\displaystyle\rightarrow \laplacian[\Psi+\tall]$ &
+& \verb|\laplacian[\Psi+\tall]| $\displaystyle\rightarrow \laplacian[\Psi+\tall]$ &\\\hline
\end{longtable}
\subsection{Operators}
The standard set of trig functions is redefined in \texttt{physics-patch} to provide automatic braces that behave like \verb|\PTqty()|. In addition, an optional power argument is provided. This behavior can be switched off by including the option \texttt{notrig} in the preamble:
@@ -162,13 +166,14 @@
\begin{lstlisting}[language=TeX]
\usepackage[notrig]{physics-patch}
\end{lstlisting}
-\begin{longtable}[l]{ l l p{8cm} }
-\multicolumn{3}{l}{Example trig redefinitions:} \\
+\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\hline
+\multicolumn{3}{|l|}{Example trig redefinitions:} \\\hline
\verb|\sin| & \verb|\sin(\grande)| $\displaystyle\rightarrow \sin(\grande)$ & automatic braces; old \verb|\sin| renamed \verb|\sine| \\
& \verb|\sin[2](x)| $\rightarrow \sin[2](x)$ & optional power \\
-& \verb|\sin x| $\rightarrow \sin x$ & can still use without an argument
+& \verb|\sin x| $\rightarrow \sin x$ & can still use without an argument \\\hline
\end{longtable}
-The full set of available trig functions in \texttt{physics-patch} includes:
+The full set of available trig functions in \texttt{physics-patch} includes:\\
\begin{longtable}{llll}
\verb|\sin(x)| & \verb|\sinh(x)| & \verb|\arcsin(x)| & \verb|\asin(x)| \\
\verb|\cos(x)| & \verb|\cosh(x)| & \verb|\arccos(x)| & \verb|\acos(x)| \\
@@ -183,9 +188,9 @@
\tan(x) & \tanh(x) & \arctan(x) & \atan(x) \\
\csc(x) & \csch(x) & \arccsc(x) & \acsc(x) \\
\sec(x) & \sech(x) & \arcsec(x) & \asec(x) \\
-\cot(x) & \coth(x) & \arccot(x) & \acot(x)
+\cot(x) & \coth(x) & \arccot(x) & \acot(x)\\
\end{longtable}
-The standard trig functions (plus a few that are missing in \texttt{amsmath}) are available without any automatic bracing under a new set of longer names:
+The standard trig functions (plus a few that are missing in \texttt{amsmath}) are available without any automatic bracing under a new set of longer names:\\
\begin{longtable}{llll}
\verb|\sine| & \verb|\hypsine| & \verb|\arcsine| & \verb|\asine| \\
\verb|\cosine| & \verb|\hypcosine| & \verb|\arccosine| & \verb|\acosine| \\
@@ -192,46 +197,48 @@
\verb|\tangent| & \verb|\hyptangent| & \verb|\arctangent| & \verb|\atangent| \\
\verb|\cosecant| & \verb|\hypcosecant| & \verb|\arccosecant| & \verb|\acosecant| \\
\verb|\secant| & \verb|\hypsecant| & \verb|\arcsecant| & \verb|\asecant| \\
-\verb|\cotangent| & \verb|\hypcotangent| & \verb|\arccotangent| & \verb|\acotangent|
+\verb|\cotangent| & \verb|\hypcotangent| & \verb|\arccotangent| & \verb|\acotangent|\\
\end{longtable}
-Similar behavior has also been extended to the following functions:
-\begin{longtable}{l>{$}l<{$}ll}
-\verb|\exp(\tall)| & \exp(\tall) & & \verb|\exponential| \\
-\verb|\log(\tall)| & \log(\tall) & & \verb|\logarithm| \\
-\verb|\ln(\tall)| & \ln(\tall) & old definitions $\Rightarrow$ & \verb|\naturallogarithm| \\
-\verb|\det(\tall)| & \det(\tall) & & \verb|\determinant| \\
-\verb|\Pr(\tall)| & \Pr(\tall) & & \verb|\Probability|
+Similar behavior has also been extended to the following functions:\\
+\begin{longtable}{|l|>{$}l<{$}|l|l|}
+\hline
+\verb|\exp(\tall)| & \exp(\tall) & \multirow{5}{*}{old definitions $\Rightarrow$} & \verb|\exponential| \\\cline{1-2}\cline{4-4}
+\verb|\log(\tall)| & \log(\tall) & & \verb|\logarithm| \\\cline{1-2}\cline{4-4}
+\verb|\ln(\tall)| & \ln(\tall) & & \verb|\naturallogarithm| \\\cline{1-2}\cline{4-4}
+\verb|\det(\tall)| & \det(\tall) & & \verb|\determinant| \\\cline{1-2}\cline{4-4}
+\verb|\Pr(\tall)| & \Pr(\tall) & & \verb|\Probability|\\\hline
\end{longtable}
-\begin{longtable}[l]{ l l p{8cm} }
-\multicolumn{3}{l}{New operators:} \\
-\verb|\trace| or \verb|\tr| & \verb|\tr\rho| $\rightarrow \tr\rho$ also \verb|\tr(\tall)| $\rightarrow \tr(\tall)$ & trace; same bracing as trig functions \\
-\verb|\Trace| or \verb|\Tr| & \verb|\Tr\rho| $\rightarrow \Tr\rho$ & alternate \\
-\verb|\rank| & \verb|\rank M| $\rightarrow \rank M$ & matrix rank \\
-\verb|\erf| & \verb|\erf(x)|$\rightarrow \erf(x)$ & Gauss error function \\
-\verb|\Res| & \verb|\Res[f(z)]|$\rightarrow \Res[f(z)]$ & residue; same bracing as trig functions \\
+\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\hline
+\multicolumn{3}{|l|}{New operators:} \\\hline
+\verb|\trace| or \verb|\tr| & \verb|\tr\rho| $\rightarrow \tr\rho$ also \verb|\tr(\tall)| $\rightarrow \tr(\tall)$ & trace; same bracing as trig functions \\\hline
+\verb|\Trace| or \verb|\Tr| & \verb|\Tr\rho| $\rightarrow \Tr\rho$ & alternate \\\hline
+\verb|\rank| & \verb|\rank M| $\rightarrow \rank M$ & matrix rank \\\hline
+\verb|\erf| & \verb|\erf(x)|$\rightarrow \erf(x)$ & Gauss error function \\\hline
+\verb|\Res| & \verb|\Res[f(z)]|$\rightarrow \Res[f(z)]$ & \parbox{6cm}{residue; same bracing as trig functions} \\\hline
\verb|\principalvalue| & \verb|\pv{\int f(z) \dd{z}}|$\rightarrow \pv{\int f(z) \dd{z}}$ & Cauchy principal value \\
-& \verb|\PV{\int f(z) \dd{z}}|$\rightarrow \PV{\int f(z) \dd{z}}$ & alternate \\
-\verb|\Re| & \verb|\Re{z}| $\rightarrow \Re{z}$ & old \verb|\Re| renamed to \verb|\real| $\rightarrow \real$ \\
-\verb|\Im| & \verb|\Im{z}| $\rightarrow \Im{z}$ & old \verb|\Im| renamed to \verb|\imaginary| $\rightarrow \imaginary$
+& \verb|\PV{\int f(z) \dd{z}}|$\rightarrow \PV{\int f(z) \dd{z}}$ & alternate \\\hline
\end{longtable}
\subsection{Quick quad text}
-This set of commands produces text in math-mode padded by \verb|\quad| spacing on either side. This is meant to provide a quick way to insert simple words or phrases in a sequence of equations. Each of the following commands includes a starred version which pads the text only on the right side with \verb|\quad| for use in aligned environments such as \texttt{cases}.
-\begin{longtable}[l]{ p{6cm} l p{6cm} l p{6cm} }
-General text: & & \\
+This set of commands produces text in math-mode padded by \verb|\quad| spacing on either side. This is meant to provide a quick way to insert simple words or phrases in a sequence of equations. Each of the following commands includes a starred version which pads the text only on the right side with \verb|\quad| for use in aligned environments such as \texttt{cases}.\\
+\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\hline
+\multicolumn{3}{|l|}{General text:} \\\hline
\verb|\qqtext| & \verb|\qq{}| & general quick quad text with argument \\
& \verb|\qq{word or phrase}| $\rightarrow$\Vtextvisiblespace[1em]$\text{word or phrase}$\Vtextvisiblespace[1em] & normal mode; left and right \verb|\quad| \\
-& \verb|\qq*{word or phrase}| $\rightarrow \text{word or phrase}$\Vtextvisiblespace[1em] & starred mode; right \verb|\quad| only
+& \verb|\qq*{word or phrase}| $\rightarrow \text{word or phrase}$\Vtextvisiblespace[1em] & starred mode; right \verb|\quad| only\\\hline
\end{longtable}
-\begin{longtable}[l]{ l l }
-Special macros: & \\
-\verb|\qcomma| or \verb|\qc| $\rightarrow ,$\Vtextvisiblespace[1em] & right \verb|\quad| only \\
-\verb|\qcc| $\rightarrow$\Vtextvisiblespace[1em]$\text{c.c.}$\Vtextvisiblespace[1em] & complex conjugate; left and right \verb|\quad| unless starred \verb|\qcc*| $\rightarrow \text{c.c.}$\Vtextvisiblespace[1em] \\
-\verb|\qif| $\rightarrow$\Vtextvisiblespace[1em]$\text{if}$\Vtextvisiblespace[1em] & left and right \verb|\quad| unless starred \verb|\qif*| $\rightarrow \text{if}$\Vtextvisiblespace[1em]
+\begin{longtable}[l]{| l | l | }
+\hline
+Special macros: & \\\hline
+\verb|\qcomma| or \verb|\qc| $\rightarrow ,$\Vtextvisiblespace[1em] & right \verb|\quad| only \\\hline
+\verb|\qcc| $\rightarrow$\Vtextvisiblespace[1em]$\text{c.c.}$\Vtextvisiblespace[1em] & complex conjugate; left and right \verb|\quad| unless starred \verb|\qcc*| $\rightarrow \text{c.c.}$\Vtextvisiblespace[1em] \\\hline
+\verb|\qif| $\rightarrow$\Vtextvisiblespace[1em]$\text{if}$\Vtextvisiblespace[1em] & left and right \verb|\quad| unless starred \verb|\qif*| $\rightarrow \text{if}$\Vtextvisiblespace[1em]\\\hline
\end{longtable}
-\begin{longtable}[l]{ l }
-Similar to \verb|\qif|: \\
-\verb|\qthen|, \verb|\qelse|, \verb|\qotherwise|, \verb|\qunless|, \verb|\qgiven|, \verb|\qusing|, \verb|\qassume|, \verb|\qsince|, \\
-\verb|\qlet|, \verb|\qfor|, \verb|\qall|, \verb|\qeven|, \verb|\qodd|, \verb|\qinteger|, \verb|\qand|, \verb|\qor|, \verb|\qas|, \verb|\qin|
+\begin{longtable}[l]{ | l | }
+\hline
+Similar to \verb|\qif|: \\\hline
+\verb|\qthen|, \verb|\qelse|, \verb|\qotherwise|, \verb|\qunless|, \verb|\qgiven|, \verb|\qusing|, \verb|\qassume|, \verb|\qsince|, \verb|\qlet| \\ \verb|\qfor|, \verb|\qall|, \verb|\qeven|, \verb|\qodd|, \verb|\qinteger|, \verb|\qand|, \verb|\qor|, \verb|\qas|, \verb|\qin| \\\hline
\end{longtable}
\subsection{Derivatives}
The default differential symbol $\dd$ which is used in \verb|\differential| and \verb|\derivative| can be switched to an italic form $d$ by including the option \texttt{italicdiff} in the preamble:
@@ -238,17 +245,18 @@
\begin{lstlisting}[language=TeX]
\usepackage[italicdiff]{physics-patch}
\end{lstlisting}
-\begin{longtable}[l]{ p{6cm} l p{6cm} l p{6cm} }
+\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\hline
\verb|\differential| & \verb|\dd| $\rightarrow \dd$ & \\
& \verb|\dd x| $\rightarrow \dd x$ & no spacing (not recommended) \\
& \verb|\dd{x}| $\rightarrow$ \textvisiblespace\,$\dd{x}$\textvisiblespace & automatic spacing based on neighbors \\
& \verb|\dd[3]{x}| $\rightarrow \dd[3]{x}$ & optional power \\
-& \verb|\dd(\cos\theta)| $\rightarrow \dd(\cos\theta)$ & long-form; automatic braces \\
+& \verb|\dd(\cos\theta)| $\rightarrow \dd(\cos\theta)$ & long-form; automatic braces \\\hline
\verb|\PTderivative| & \verb|\PTdv{x}| $\displaystyle\rightarrow \PTdv{x}$ & one argument \\
& \verb|\PTdv{f}{x}| $\displaystyle\rightarrow \PTdv{f}{x}$ & two arguments \\
& \verb|\PTdv[n]{f}{x}| $\displaystyle\rightarrow \PTdv[n]{f}{x}$ & optional power \\
& \verb|\PTdv{x}(\grande)| $\displaystyle\rightarrow \PTdv{x}(\grande)$ & long-form; automatic braces, spacing \\
-& \verb|\PTdv*{f}{x}| $\displaystyle\rightarrow \PTdv*{f}{x}$ & inline form using \verb|\flatfrac| \\
+& \verb|\PTdv*{f}{x}| $\displaystyle\rightarrow \PTdv*{f}{x}$ & inline form using \verb|\flatfrac| \\\hline
\verb|\PTpartialderivative| or \verb|\PTpderivative| & \verb|\PTdv{f}{x}(\grande)| $\displaystyle\rightarrow \PTdv{f}{x}(\grande)$ & note: in original \texttt{physics} package, \verb|\dv{f}{x}(\grande)| $\displaystyle\rightarrow \dv{f}{x}$\\
& \verb|\PTpdv{x}| $\displaystyle\rightarrow \PTpdv{x}$ & shorthand name \\
& \verb|\PTpdv{f}{x}| $\displaystyle\rightarrow \PTpdv{f}{x}$ & two arguments \\
@@ -256,13 +264,13 @@
& \verb|\PTpdv{x}(\grande)| $\displaystyle\rightarrow \PTpdv{x}(\grande)$ & long-form \\
& \verb|\PTpdv{f}{x}{y}| $\displaystyle\rightarrow \PTpdv{f}{x}{y}$ & mixed partial \\
& \verb|\PTpdv*{f}{x}| $\displaystyle\rightarrow \PTpdv*{f}{x}$ & inline form using \verb|\flatfrac| \\
-& \verb|\PTpdv{f}{x}(\grande)| $\displaystyle\rightarrow \PTpdv{f}{x}(\grande)$ & note: in original \texttt{physics} package, \verb|\pdv{f}{x}(\grande)| $\displaystyle\rightarrow \pdv{f}{x}$ \\
+& \verb|\PTpdv{f}{x}(\grande)| $\displaystyle\rightarrow \PTpdv{f}{x}(\grande)$ & note: in original \texttt{physics} package, \verb|\pdv{f}{x}(\grande)| $\displaystyle\rightarrow \pdv{f}{x}$ \\\hline
\verb|\variation| & \verb|\var{F[g(x)]}| $\rightarrow \var{F[g(x)]}$ & functional variation (works like \verb|\dd|) \\
-& \verb|\var(E-TS)| $\rightarrow \var(E-TS)$ & long-form \\
+& \verb|\var(E-TS)| $\rightarrow \var(E-TS)$ & long-form \\\hline
\verb|\functionalderivative| & \verb|\fdv{g}| $\displaystyle\rightarrow \fdv{g}$ & functional derivative (works like \verb|\PTdv|) \\
& \verb|\fdv{F}{g}| $\displaystyle\rightarrow \fdv{F}{g}$ & \\
& \verb|\fdv{V}(E-TS)| $\displaystyle\rightarrow \fdv{V}(E-TS)$ & long-form \\
-& \verb|\fdv*{F}{x}| $\displaystyle\rightarrow \fdv*{F}{x}$ & inline form using \verb|\flatfrac|
+& \verb|\fdv*{F}{x}| $\displaystyle\rightarrow \fdv*{F}{x}$ & inline form using \verb|\flatfrac| \\\hline
\end{longtable}
\subsection{Dirac bra-ket notation}
The following collection of macros for Dirac notation contains two fundamental commands, \verb|\bra| and \verb|\ket|, along with a set of more specialized macros which are essentially combinations of the fundamental pair. The fundamental commands are designed to contract with one another algebraically when appropriate and are thus suggested for general use. For instance, the following code renders correctly\footnote{Note the lack of a space between the bra and ket commands. This is necessary in order for the bra to find the corresponding ket and form a contraction.}
@@ -277,10 +285,11 @@
\begin{displaymath}
\verb|\bra{\phi}\ket{\psi}\bra{\xi}| \rightarrow \bra{\phi}\ket{\psi}\bra{\xi}
\end{displaymath}
-allowing the user to type out complicated quantum mechanical expressions without worrying about bra-ket contractions. That being said, the high-level macros do have a place in convenience and readability, as long as the user is aware of rendering issues that may arise due to an absence of automatic contractions.
-\begin{longtable}[l]{ p{6cm} l p{6cm} l p{6cm} }
+allowing the user to type out complicated quantum mechanical expressions without worrying about bra-ket contractions. That being said, the high-level macros do have a place in convenience and readability, as long as the user is aware of rendering issues that may arise due to an absence of automatic contractions.\\
+\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\hline
\verb|\ket| & \verb|\ket{\tall}| $\rightarrow \ket{\tall}$ & automatic sizing \\
-& \verb|\ket*{\tall}| $\rightarrow \ket*{\tall}$ & no resize \\
+& \verb|\ket*{\tall}| $\rightarrow \ket*{\tall}$ & no resize \\\hline
\verb|\bra| & \verb|\bra{\tall}| $\rightarrow \bra{\tall}$ & automatic sizing \\
& \verb|\bra*{\tall}| $\rightarrow \bra*{\tall}$ & no resize \\
& \verb|\bra{\phi}\ket{\psi}| $\rightarrow \bra{\phi}\ket{\psi}$ & automatic contraction \\
@@ -287,34 +296,33 @@
& \verb|\bra{\phi}\ket{\tall}| $\rightarrow \bra{\phi}\ket{\tall}$ & contraction inherits automatic sizing \\
& \verb|\bra{\phi}\ket*{\tall}| $\rightarrow \bra{\phi}\ket*{\tall}$ & \multirow{2}{*}{\parbox{6cm}{a star on either term in the contraction prohibits resizing}} \\
& \verb|\bra*{\phi}\ket{\tall}| $\rightarrow \bra*{\phi}\ket{\tall}$ & \\
-& \verb|\bra*{\phi}\ket*{\tall}| $\rightarrow \bra*{\phi}\ket*{\tall}$ & \\
+& \verb|\bra*{\phi}\ket*{\tall}| $\rightarrow \bra*{\phi}\ket*{\tall}$ & \\\hline
\verb|\innerproduct| & $\verb|\braket{a}{b}| \rightarrow \braket{a}{b}$ & two-argument braket \\
& \verb|\braket{a}| $\rightarrow \braket{a}$ & one-argument (norm) \\
& \verb|\braket{a}{\tall}| $\rightarrow \braket{a}{\tall}$ & automatic sizing \\
& \verb|\braket*{a}{\tall}| $\rightarrow \braket*{a}{\tall}$ & no resize \\
-& \verb|\ip{a}{b}| $\rightarrow \ip{a}{b}$ & shorthand name \\
+& \verb|\ip{a}{b}| $\rightarrow \ip{a}{b}$ & shorthand name \\\hline
\verb|\outerproduct| & \verb|\dyad{a}{b}| $\rightarrow \dyad{a}{b}$ & two-argument dyad \\
& \verb|\dyad{a}| $\rightarrow \dyad{a}$ & one-argument (projector) \\
& \verb|\dyad{a}{\tall}| $\rightarrow \dyad{a}{\tall}$ & automatic sizing \\
& \verb|\dyad*{a}{\tall}| $\rightarrow \dyad*{a}{\tall}$ & no resize \\
& \verb|\ketbra{a}{b}| $\rightarrow \ketbra{a}{b}$ & alternative name \\
-& \verb|\op{a}{b}| $\rightarrow \op{a}{b}$ & shorthand name \\
+& \verb|\op{a}{b}| $\rightarrow \op{a}{b}$ & shorthand name \\\hline
\verb|\expectationvalue| & \verb|\expval{A}| $\rightarrow \expval{A}$ & implicit form \\
& \verb|\expval{A}{\Psi}| $\rightarrow \expval{A}{\Psi}$ & explicit form \\
& \verb|\ev{A}{\Psi}| $\rightarrow \ev{A}{\Psi}$ & shorthand name \\
& \verb|\ev{\grande}{\Psi}| $\rightarrow \ev{\grande}{\Psi}$ & default sizing ignores middle argument \\
& \verb|\ev*{\grande}{\tall}| $\rightarrow \ev*{\grande}{\tall}$ & single star does no resizing whatsoever \\
-& \verb|\ev**{\grande}{\Psi}| $\rightarrow \ev**{\grande}{\Psi}$ & double star resizes based on all parts \\
+& \verb|\ev**{\grande}{\Psi}| $\rightarrow \ev**{\grande}{\Psi}$ & double star resizes based on all parts \\\hline
\verb|\matrixelement| & \verb|\matrixel{n}{A}{m}| $\rightarrow \matrixel{n}{A}{m}$ & requires all three arguments \\
& \verb|\mel{n}{A}{m}| $\rightarrow \mel{n}{A}{m}$ & shorthand name \\
& \verb|\mel{n}{\grande}{m}| $\rightarrow \mel{n}{\grande}{m}$ & default sizing ignores middle argument \\
& \verb|\mel*{n}{\grande}{\tall}| $\rightarrow \mel*{n}{\grande}{\tall}$ & single star does no resizing whatsoever \\
-& \verb|\mel**{n}{\grande}{m}| $\rightarrow \mel**{n}{\grande}{m}$ & double star resizes based on all parts
+& \verb|\mel**{n}{\grande}{m}| $\rightarrow \mel**{n}{\grande}{m}$ & double star resizes based on all parts \\\hline
\end{longtable}
\subsection{Matrix macros}
-{\fontsize{4pt}{6pt}\selectfont
Note: \verb|\mqty| and \verb|\smqty| in \texttt{physics} uses \verb|\mathord|, while \verb|\PTmqty| and \verb|\PTsmqty| in \texttt{physics-patch} don't.\\\\
-The following matrix macros produce unformatted rows and columns of matrix elements for use as separate matrices as well as blocks within larger matrices. For example, the command \verb|\identitymatrix{2}| which has also has the shortcut \verb|\imat{2}| produces the elements of a $2 \times 2$ identity matrix $\PTsmqty{\imat{2}}$ without braces or grouping. This allows the command to also be used within another matrix, as in:
+The following matrix macros produce unformatted rows and columns of matrix elements for use as separate matrices as well as blocks within larger matrices. For example, the command \verb|\identitymatrix{2}| which has also has the shortcut \verb|\imat{2}| produces the elements of a $2 \times 2$ identity matrix $\PTsmqty{\imat{2}}$ without braces or grouping. This allows the command to also be used within another matrix, as in:\\
\begin{minipage}{3cm}
\begin{lstlisting}[language=TeX]
\begin{pmatrix}
@@ -330,7 +338,7 @@
\end{pmatrix}
\end{displaymath}
\end{minipage}
-To specify elements on the right of left sides of our \verb|\imat{2}| sub-matrix we use the grouping command \verb|\PTmatrixquantity| or \verb|\PTmqty| to effectively convert \verb|\imat{2}| into a single matrix element of a larger matrix:
+To specify elements on the right of left sides of our \verb|\imat{2}| sub-matrix we use the grouping command \verb|\PTmatrixquantity| or \verb|\PTmqty| to effectively convert \verb|\imat{2}| into a single matrix element of a larger matrix:\\
\begin{minipage}{9cm}
\begin{lstlisting}[language=TeX]
\begin{pmatrix}
@@ -346,7 +354,7 @@
\end{pmatrix}
\end{displaymath}
\end{minipage}
-The extra \verb|\PTmqty| groups were required in this case in order to get the $a$ and $b$ elements to behave as a single element, since \verb|\PTmqty{\imat{2}}| also acts like a single matrix element (the same can be said of the grouped $c$ and $d$ elements). Finally, the outermost \texttt{pmatrix} environment could have also been replaced with the \texttt{physics-patch} macro \verb|\PTmqty()|, allowing the above example to be written on one line:
+The extra \verb|\PTmqty| groups were required in this case in order to get the $a$ and $b$ elements to behave as a single element, since \verb|\PTmqty{\imat{2}}| also acts like a single matrix element (the same can be said of the grouped $c$ and $d$ elements). Finally, the outermost \texttt{pmatrix} environment could have also been replaced with the \texttt{physics-patch} macro \verb|\PTmqty()|, allowing the above example to be written on one line:\\
\begin{minipage}{9cm}
\begin{lstlisting}[language=TeX]
\PTmqty(\PTmqty{\imat{2}} & \PTmqty{a\\b} \\ \PTmqty{c & d} & e)
@@ -358,7 +366,9 @@
\PTmqty(\PTmqty{\imat{2}} & \PTmqty{a\\b} \\ \PTmqty{c & d} & e)
\end{displaymath}
\end{minipage}
-\begin{longtable}[l]{ p{6cm} l p{6cm} l p{6cm} }
+{\fontsize{8pt}{12pt}\selectfont\\
+\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\hline
\verb|\PTmatrixquantity| & \verb|\PTmqty{a & b \\ c & d}| $\rightarrow \PTmqty{a & b \\ c & d}$ & groups a set of matrix elements into a single object \\
& \verb|\PTmqty(a & b \\ c & d)| $\rightarrow {\PTmqty(a & b \\ c & d)}$ & parentheses \\
& \verb|\PTmqty*(a & b \\ c & d)| $\rightarrow {\PTmqty*(a & b \\ c & d)}$ & alternate parentheses \\
@@ -370,16 +380,16 @@
& \verb|\PTpmqty*{}| $\leftrightarrow$ \verb|\PTmqty*{}| & \\
& \verb|\Pmqty{}| $\leftrightarrow$ \verb|\PTmqty*()| & \\
& \verb|\bmqty{}| $\leftrightarrow$ \verb|\PTmqty[]| & \\
-& \verb|\vmqty{}| $\leftrightarrow$ \verb+\PTmqty||+ & \\
+& \verb|\vmqty{}| $\leftrightarrow$ \verb+\PTmqty||+ & \\\hline
\verb|\PTsmallmatrixquantity| & \verb|\PTsmqty{a & b \\ c & d}| $\rightarrow \PTsmqty{a & b \\ c & d}$ & the \texttt{smallmatrix} form of \verb|\PTmqty| \\
& \verb|\PTsmqty()| \qor \verb|\spmqty{}| \qor \verb|\PTspmqty{}| & small version of \verb|\PTmqty()| \\
& \verb|\PTsmqty*()| \qor \verb|\sPmqty{}| \qor \verb|\PTspmqty*{}| & small version of \verb|\PTmqty*()|\\
& \verb|\PTsmqty[]| \qor \verb|\sbmqty{}| & small version of \verb|\PTmqty[]| \\
-& \verb+\PTsmqty||+ \qor \verb|\svmqty{}| & small version of \verb+\PTmqty||+ \\
+& \verb+\PTsmqty||+ \qor \verb|\svmqty{}| & small version of \verb+\PTmqty||+ \\\hline
\verb|\matrixdeterminant| & \verb|\mdet{a & b \\ c & d}| $\rightarrow {\mdet{a & b \\ c & d}}$ & matrix determinant \\
-& \verb|\smdet{a & b \\ c & d}| $\rightarrow {\smdet{a & b \\ c & d}}$ & small matrix determinant \\
+& \verb|\smdet{a & b \\ c & d}| $\rightarrow {\smdet{a & b \\ c & d}}$ & small matrix determinant \\\hline
\verb|\identitymatrix| & \verb|\imat{n}| & elements of $n \times n$ identity matrix \\
-& \verb|\PTmqty(\imat{3})| $\rightarrow \PTmqty(\imat{3})$ & formatted with \verb|\PTmqty| or \verb|\PTsmqty| \\
+& \verb|\PTmqty(\imat{3})| $\rightarrow \PTmqty(\imat{3})$ & formatted with \verb|\PTmqty| or \verb|\PTsmqty| \\\hline
\verb|\PTxmatrix| & \verb|\PTxmat{x}{n}{m}| & \multirow{4}{*}{\parbox{6cm}{elements of $n \times m$ matrix filled with $x$, if not provided, $1$ is used}} \\
& \verb|\PTmqty(\PTxmat{x}{3}{3})| $\rightarrow \PTmqty(\PTxmat{x}{3}{3})$ & \\
& \verb|\PTmqty(\PTxmat{x}{}{3})| $\rightarrow \PTmqty(\PTxmat{x}{}{3})$ & \\
@@ -407,54 +417,76 @@
& \verb|\PTxmat[0 or 1 or 2]{x}{n}{m}[p][q]| & \multirow{4}{*}{\parbox{6cm}{Change the \texttt{\textbackslash vdots} row/\texttt{\textbackslash ldots} column from the second last one to last one, 0 for both, 1 for row only, 2 for column only. Only work when corresponding $p$/$q$ is provided and do not change the behavior of element indices}} \\
& \verb|\PTmqty(\PTxmat[0]{x}{5}{5}[3][3])| $\rightarrow \PTmqty(\PTxmat[0]{x}{5}{5}[3][3])$ & \\
& \verb|\PTmqty(\PTxmat[1]{x}{5}{5}[3][3])| $\rightarrow \PTmqty(\PTxmat[1]{x}{5}{5}[3][3])$ & \\
-& \verb|\PTmqty(\PTxmat[2]{x}{5}{5}[3][3])| $\rightarrow \PTmqty(\PTxmat[2]{x}{5}{5}[3][3])$ & \\
+& \verb|\PTmqty(\PTxmat[2]{x}{5}{5}[3][3])| $\rightarrow \PTmqty(\PTxmat[2]{x}{5}{5}[3][3])$ & \\\hline
\verb|\zeromatrix| & \verb|\zmat{n}{m}| & \multirow{3}{*}{\parbox{6cm}{$n \times m$ matrix filled with zeros, equivalent to \texttt{\textbackslash xmat\{0\}\{n\}\{m\}}. If $m$ isn't provided, $n$ is used}} \\
& \verb|\PTmqty(\zmat{2}{2})| $\rightarrow \PTmqty(\zmat{2}{2})$ & \\
-& \verb|\PTmqty(\zmat{2})| $\rightarrow \PTmqty(\zmat{2})$ & \\
+& \verb|\PTmqty(\zmat{2})| $\rightarrow \PTmqty(\zmat{2})$ & \\\hline
\verb|\paulimatrix| & \verb|\pmat{n}| & $n^\text{th}$ Pauli matrix \\
& \verb|\PTmqty(\pmat{0})| $\rightarrow \PTmqty(\pmat{0})$ & $n\in \lbrace 0,1,2,3$ or $x,y,z \rbrace$ \\
& \verb|\PTmqty(\pmat{1})| $\rightarrow \PTmqty(\pmat{1})$ & \\
& \verb|\PTmqty(\pmat{2})| $\rightarrow \PTmqty(\pmat{2})$ & \\
-& \verb|\PTmqty(\pmat{3})| $\rightarrow \PTmqty(\pmat{3})$ & \\
+& \verb|\PTmqty(\pmat{3})| $\rightarrow \PTmqty(\pmat{3})$ & \\\hline
\verb|\diagonalmatrix| & \verb|\dmat{a,b,c,...}| & \multirow{2}{*}{\parbox{6cm}{specify up to eight diagonal or block diagonal elements}} \\
& \verb|\PTmqty(\dmat{1,2,3})| $\rightarrow \PTmqty(\dmat{1,2,3})$ & \\
& \verb|\PTmqty(\dmat[0]{1,2})| $\rightarrow \PTmqty(\dmat[0]{1,2})$ & optional argument to fill spaces \\
-& \verb|\PTmqty(\dmat{1,2&3\\4&5})| $\rightarrow \PTmqty(\dmat{1,2&3\\4&5})$ & enter matrix elements for each block as a single diagonal element \\
+& \verb|\PTmqty(\dmat{1,2&3\\4&5})| $\rightarrow \PTmqty(\dmat{1,2&3\\4&5})$ & enter matrix elements for each block as a single diagonal element \\\hline
\verb|\antidiagonalmatrix| & \verb|\admat{a,b,c,...}| & same as syntax as \verb|\dmat| \\
-& \verb|\PTmqty(\admat{1,2,3})| $\rightarrow \PTmqty(\admat{1,2,3})$ & \\
+& \verb|\PTmqty(\admat{1,2,3})| $\rightarrow \PTmqty(\admat{1,2,3})$ & \\\hline
\end{longtable}
+}
\subsection{Symbols}
-\begin{longtable}[l]{ p{0.5\textwidth} l p{0.5\textwidth} }
-\verb|\lparen| $\rightarrow ($ &\\
-\verb|\rparen| $\rightarrow )$ &\\
-\verb|\ordersymbol| $\rightarrow \ordersymbol$ & \\
-\verb|\typical| $\rightarrow \typical$ & \\
-\verb|\tall| $\rightarrow \tall$ & \\
-\verb|\grande| $\rightarrow \grande$ & \\
-\verb|\venti| $\rightarrow \venti$ & \\
-\verb|\Vtextvisiblespace[width]| $\rightarrow$ \Vtextvisiblespace & a visible space character, where the optional argument (defaulting to \texttt{.3em}) sets the width of the horizontal rule
+\begin{center}\begin{tabular}{ | p{6cm} | p{6cm} | }
+\hline
+\verb|\lparen| $\rightarrow\; ($ &\\\hline
+\verb|\rparen| $\rightarrow\; )$ &\\\hline
+\verb|\ordersymbol| $\rightarrow \ordersymbol$ & \\\hline
+\verb|\typical| $\rightarrow \typical$ & \\\hline
+\verb|\tall| $\rightarrow \tall$ & \\\hline
+\verb|\grande| $\rightarrow \grande$ & \\\hline
+\verb|\venti| $\rightarrow \venti$ & \\\hline
+\verb|\calE|$\rightarrow$\verb|\mathcal{E}| & \\\hline
+\verb|\bbR|$\rightarrow$\verb|\mathbb{R}| & \\\hline
+\verb|\bbC|$\rightarrow$\verb|\mathbb{C}| & \\\hline
+\verb|\bbQ|$\rightarrow$\verb|\mathbb{Q}| & \\\hline
+\verb|\bbN|$\rightarrow$\verb|\mathbb{N}| & \\\hline
+\verb|\bbZ|$\rightarrow$\verb|\mathbb{Z}| & \\\hline
+\verb|\Vtextvisiblespace[width]| $\rightarrow$ \Vtextvisiblespace & \parbox{6cm}{a visible space character, where the optional argument, defaulting to \texttt{.3em}, sets the width of the horizontal rule}\\\hline
+\end{tabular}\end{center}
+\subsection{Shorthands for Greek alphabet}
+If option \texttt{shortgreek} is used, the following shorthands will be defined for every uppercase and lowercase Greek letter:\\
+\begin{center}\begin{tabular}{ | p{6cm} | p{10cm} | }
+\hline
+\verb|\tgAlpha| $\rightarrow$ \verb|\text{\textAlpha}}| & accept an optional argument argument in \texttt{\{\}} that is simply skipped \\\hline
+\verb|\vAlpha| $\rightarrow$ \verb|\varAlpha| & \\\hline
+\verb|\uAlpha| $\rightarrow$ \verb|\upAlpha| & \\\hline
+\verb|\uvAlpha| $\rightarrow$ \verb|\upvarAlpha| & \\\hline
+\end{tabular}\end{center}
+Note that these don’t ensure those commands are defined.
+\subsection{Shorthands for mathrm alphabet and chemical element symbols}
+If option \texttt{shortmathrm} is used, the following shorthands will be defined for every uppercase and lowercase English letter and every chemical element symbols (\verb|A\verb| for example):\\
+\begin{longtable}[l]{ | p{6cm} | p{6cm} | }
+\hline
+\verb|\rmA_a^b| $\rightarrow\mathrm{A}_a^b$ & work in both math mode and text mode
+\\\hline
\end{longtable}
-}
-\subsection{Shorthands for Greek letters}
-If option \texttt{shortgreek} is used, the following shorthands will be defined for every Greeks letter:
+which are implemented with:
\begin{lstlisting}[language=TeX]
-\DeclareDocumentCommand{\tgAlpha}{O{}}{\text{\textAlpha}}
-\DeclareDocumentCommand{\tgalpha}{O{}}{\text{\textalpha}}
-\DeclareDocumentCommand{\vAlpha}{}{\varAlpha}
-\DeclareDocumentCommand{\valpha}{}{\varalpha}
-\DeclareDocumentCommand{\uAlpha}{}{\upAlpha}
-\DeclareDocumentCommand{\ualpha}{}{\upalpha}
-\DeclareDocumentCommand{\uvAlpha}{}{\upvarAlpha}
-\DeclareDocumentCommand{\uvalpha}{}{\upvaralpha}
+\DeclareDocumentCommand{\rmA}{e{_^}}{\ensuremath{\mathrm{A}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
\end{lstlisting}
+\subsection{Shorthands for textnormal alphabet}
+If option \texttt{shorttext} is used, the following shorthands will be defined for every uppercase and lowercase English letter (\verb|A\verb| for example):\\
+\begin{longtable}{| l |}
+\hline
+\verb|\txA| $\rightarrow$ \verb|\textnormal{A}|
+\\\hline
+\end{longtable}
\subsection{Others}
-\begin{longtable}[l]{ p{6cm} l p{6cm} l p{6cm} }
-\verb|\autommode| & \verb|\amm{content}| & \verb|\relax\ifmmode #1\else\(#1\)\fi| \\
+\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\hline
\verb|\mathcolorbox| & \verb|\mcbox{color}{content}| & \multirow{2}{*}{\parbox{6cm}{\texttt{\textbackslash colorbox} for math environment, applying to all four levels of math styles}} \\
-& \verb|\mcbox{cyan}{\phantom{A}}| $\rightarrow \mcbox{cyan}{\phantom{A}}$ & \\
-\verb|\autocolorbox| or \verb|\acbox| & \verb|\cbox{color}{content}| & samw as \verb|\colorbox| in text environment, same as \verb|\mathcolorbox| in math environment \\
-\verb|\tentothepowerof| & \verb|\tenpow{n}| $\rightarrow \tenpow{n}$ & work in both math mode and text mode \\
-\verb|\scientificnotation| & \verb|\scinote{3.00}{8}| $\rightarrow \scinote{3.00}{8}$ & \parbox{6cm}{work in both math mode and text mode}
+& \verb|\mcbox{cyan}{\phantom{A}}| $\rightarrow \mcbox{cyan}{\phantom{A}}$ & \\\hline
+\verb|\autocolorbox| or \verb|\acbox| & \verb|\cbox{color}{content}| & calls \verb|\colorbox| when in text mode, calls \verb|\mathcolorbox| when in math mode \\\hline
+\verb|\tentothepowerof| & \verb|\tenpow{n}| $\rightarrow \tenpow{n}$ & work in both math mode and text mode \\\hline
+\verb|\scientificnotation| & \verb|\scinote{3.00}{8}| $\rightarrow \scinote{3.00}{8}$ & work in both math mode and text mode\\\hline
\end{longtable}
-}
\end{document}
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/latex/physics-patch/physics-patch.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/physics-patch/physics-patch.sty 2025-02-17 20:44:09 UTC (rev 74065)
+++ trunk/Master/texmf-dist/tex/latex/physics-patch/physics-patch.sty 2025-02-17 20:44:25 UTC (rev 74066)
@@ -1,5 +1,5 @@
\ProvidesPackage{physics-patch}
-% physics-patch 2.1
+% physics-patch 2.4
%
% Improved version of the physics package
%
@@ -17,7 +17,7 @@
%
% Author: Willie Shen (Willie169)
% Repository: https://github.com/Willie169/physics-patch
-% Last update: Feb 16, 2025
+% Last update: Feb 17, 2025
%
% For documentation, see physics-patch.pdf
@@ -40,17 +40,26 @@
\newif\iforiginaldiv
\DeclareOption{originaldiv}{\originaldivtrue} % Let \div be division symbol (default)
\DeclareOption{nooriginaldiv}{\originaldivfalse} % Let \div be \divergence
-\DeclareOption{trig}{\let\trigopt = 1} % Redefine trig function and operator (default)
-\DeclareOption{notrig}{\let\trigopt = 0} % Not redefine trig function and operator
+\newif\iftrig
+\DeclareOption{trig}{\trigtrue} % Redefine trig function and operator (default)
+\DeclareOption{notrig}{\trigfalse} % Not redefine trig function and operator
\DeclareOption{uprightdiff}{\def\diffd{\mathrm{d}}} % Upright differentials (default)
\DeclareOption{italicdiff}{\def\diffd{d}} % Italic differentials
\DeclareOption{bolddel}{\DeclareDocumentCommand\vnabla{}{\boldsymbol\nabla}} % Vector bold \nabla symbol (default)
\DeclareOption{arrowdel}{\DeclareDocumentCommand\vnabla{}{\vec{\boldsymbol\nabla}}} % Vector arrow \nabla symbol
+\DeclareOption{bolddot}{\DeclareDocumentCommand\dotproduct{}{\boldsymbol\cdot}} % Vector bold dot product symbol
+\DeclareOption{plaindot}{\DeclareDocumentCommand\dotproduct{}{\cdot}} % Vector plain dot product symbol (default)
\newif\ifshortgreek
-\DeclareOption{shortgreek}{\shortgreektrue} % Define shorthands for Greek letters
-\DeclareOption{noshortgreek}{\shortgreekfalse} % Not define shorthands for Greek letters (default)
+\DeclareOption{shortgreek}{\shortgreektrue} % Define shorthands for Greek alphabet
+\DeclareOption{noshortgreek}{\shortgreekfalse} % Not define shorthands for Greek alphabet (default)
+\newif\ifshortmathrm
+\DeclareOption{shortmathrm}{\shortmathrmtrue} % Define shorthands for mathrm alphabet and chemical element symbols
+\DeclareOption{noshortmathrm}{\shortmathrmfalse} % Not define shorthands for mathrm alphabet and chemical element symbols (default)
+\newif\ifshorttext
+\DeclareOption{shorttext}{\shorttexttrue} % Define shorthands for textnormal alphabet
+\DeclareOption{noshorttext}{\shorttextfalse} % Not define shorthands for textnormal alphabet (default)
\DeclareOption*{}
-\ExecuteOptions{override,pretend,nosiintegrate,originaldiv,trig,uprightdiff,bolddel,noshortgreek,noshortalphabet}
+\ExecuteOptions{override,pretend,nosiintegrate,originaldiv,trig,uprightdiff,bolddel,plaindot,noshortgreek,noshortmathrm,noshorttext}
\ProcessOptions\relax
\newif\ifphysics
@@ -62,56 +71,56 @@
\makeatother
\fi
-% Shorthands for Greek letters
+% shortgreek
\ifshortgreek
-\DeclareDocumentCommand{\tgAlpha}{O{}}{\text{\textAlpha}}
-\DeclareDocumentCommand{\tgBeta}{O{}}{\text{\textBeta}}
-\DeclareDocumentCommand{\tgGamma}{O{}}{\text{\textGamma}}
-\DeclareDocumentCommand{\tgDelta}{O{}}{\text{\textDelta}}
-\DeclareDocumentCommand{\tgEpsilon}{O{}}{\text{\textEpsilon}}
-\DeclareDocumentCommand{\tgZeta}{O{}}{\text{\textZeta}}
-\DeclareDocumentCommand{\tgEta}{O{}}{\text{\textEta}}
-\DeclareDocumentCommand{\tgTheta}{O{}}{\text{\textTheta}}
-\DeclareDocumentCommand{\tgIota}{O{}}{\text{\textIota}}
-\DeclareDocumentCommand{\tgKappa}{O{}}{\text{\textKappa}}
-\DeclareDocumentCommand{\tgLambda}{O{}}{\text{\textLambda}}
-\DeclareDocumentCommand{\tgMu}{O{}}{\text{\textMu}}
-\DeclareDocumentCommand{\tgNu}{O{}}{\text{\textNu}}
-\DeclareDocumentCommand{\tgXi}{O{}}{\text{\textXi}}
-\DeclareDocumentCommand{\tgOmicron}{O{}}{\text{\textOmicron}}
-\DeclareDocumentCommand{\tgPi}{O{}}{\text{\textPi}}
-\DeclareDocumentCommand{\tgRho}{O{}}{\text{\textRho}}
-\DeclareDocumentCommand{\tgSigma}{O{}}{\text{\textSigma}}
-\DeclareDocumentCommand{\tgTau}{O{}}{\text{\textTau}}
-\DeclareDocumentCommand{\tgUpsilon}{O{}}{\text{\textUpsilon}}
-\DeclareDocumentCommand{\tgPhi}{O{}}{\text{\textPhi}}
-\DeclareDocumentCommand{\tgChi}{O{}}{\text{\textChi}}
-\DeclareDocumentCommand{\tgPsi}{O{}}{\text{\textPsi}}
-\DeclareDocumentCommand{\tgOmega}{O{}}{\text{\textOmega}}
-\DeclareDocumentCommand{\tgalpha}{O{}}{\text{\textalpha}}
-\DeclareDocumentCommand{\tgbeta}{O{}}{\text{\textbeta}}
-\DeclareDocumentCommand{\tggamma}{O{}}{\text{\textgamma}}
-\DeclareDocumentCommand{\tgdelta}{O{}}{\text{\textdelta}}
-\DeclareDocumentCommand{\tgepsilon}{O{}}{\text{\textepsilon}}
-\DeclareDocumentCommand{\tgzeta}{O{}}{\text{\textzeta}}
-\DeclareDocumentCommand{\tgeta}{O{}}{\text{\texteta}}
-\DeclareDocumentCommand{\tgtheta}{O{}}{\text{\texttheta}}
-\DeclareDocumentCommand{\tgiota}{O{}}{\text{\textiota}}
-\DeclareDocumentCommand{\tgkappa}{O{}}{\text{\textkappa}}
-\DeclareDocumentCommand{\tglambda}{O{}}{\text{\textlambda}}
-\DeclareDocumentCommand{\tgmu}{O{}}{\text{\textmu}}
-\DeclareDocumentCommand{\tgnu}{O{}}{\text{\textnu}}
-\DeclareDocumentCommand{\tgxi}{O{}}{\text{\textxi}}
-\DeclareDocumentCommand{\tgomicron}{O{}}{\text{\textomicron}}
-\DeclareDocumentCommand{\tgpi}{O{}}{\text{\textpi}}
-\DeclareDocumentCommand{\tgrho}{O{}}{\text{\textrho}}
-\DeclareDocumentCommand{\tgsigma}{O{}}{\text{\textsigma}}
-\DeclareDocumentCommand{\tgtau}{O{}}{\text{\texttau}}
-\DeclareDocumentCommand{\tgupsilon}{O{}}{\text{\textupsilon}}
-\DeclareDocumentCommand{\tgphi}{O{}}{\text{\textphi}}
-\DeclareDocumentCommand{\tgchi}{O{}}{\text{\textchi}}
-\DeclareDocumentCommand{\tgpsi}{O{}}{\text{\textpsi}}
-\DeclareDocumentCommand{\tgomega}{O{}}{\text{\textomega}}
+\DeclareDocumentCommand{\tgAlpha}{g}{\text{\textAlpha}}
+\DeclareDocumentCommand{\tgBeta}{g}{\text{\textBeta}}
+\DeclareDocumentCommand{\tgGamma}{g}{\text{\textGamma}}
+\DeclareDocumentCommand{\tgDelta}{g}{\text{\textDelta}}
+\DeclareDocumentCommand{\tgEpsilon}{g}{\text{\textEpsilon}}
+\DeclareDocumentCommand{\tgZeta}{g}{\text{\textZeta}}
+\DeclareDocumentCommand{\tgEta}{g}{\text{\textEta}}
+\DeclareDocumentCommand{\tgTheta}{g}{\text{\textTheta}}
+\DeclareDocumentCommand{\tgIota}{g}{\text{\textIota}}
+\DeclareDocumentCommand{\tgKappa}{g}{\text{\textKappa}}
+\DeclareDocumentCommand{\tgLambda}{g}{\text{\textLambda}}
+\DeclareDocumentCommand{\tgMu}{g}{\text{\textMu}}
+\DeclareDocumentCommand{\tgNu}{g}{\text{\textNu}}
+\DeclareDocumentCommand{\tgXi}{g}{\text{\textXi}}
+\DeclareDocumentCommand{\tgOmicron}{g}{\text{\textOmicron}}
+\DeclareDocumentCommand{\tgPi}{g}{\text{\textPi}}
+\DeclareDocumentCommand{\tgRho}{g}{\text{\textRho}}
+\DeclareDocumentCommand{\tgSigma}{g}{\text{\textSigma}}
+\DeclareDocumentCommand{\tgTau}{g}{\text{\textTau}}
+\DeclareDocumentCommand{\tgUpsilon}{g}{\text{\textUpsilon}}
+\DeclareDocumentCommand{\tgPhi}{g}{\text{\textPhi}}
+\DeclareDocumentCommand{\tgChi}{g}{\text{\textChi}}
+\DeclareDocumentCommand{\tgPsi}{g}{\text{\textPsi}}
+\DeclareDocumentCommand{\tgOmega}{g}{\text{\textOmega}}
+\DeclareDocumentCommand{\tgalpha}{g}{\text{\textalpha}}
+\DeclareDocumentCommand{\tgbeta}{g}{\text{\textbeta}}
+\DeclareDocumentCommand{\tggamma}{g}{\text{\textgamma}}
+\DeclareDocumentCommand{\tgdelta}{g}{\text{\textdelta}}
+\DeclareDocumentCommand{\tgepsilon}{g}{\text{\textepsilon}}
+\DeclareDocumentCommand{\tgzeta}{g}{\text{\textzeta}}
+\DeclareDocumentCommand{\tgeta}{g}{\text{\texteta}}
+\DeclareDocumentCommand{\tgtheta}{g}{\text{\texttheta}}
+\DeclareDocumentCommand{\tgiota}{g}{\text{\textiota}}
+\DeclareDocumentCommand{\tgkappa}{g}{\text{\textkappa}}
+\DeclareDocumentCommand{\tglambda}{g}{\text{\textlambda}}
+\DeclareDocumentCommand{\tgmu}{g}{\text{\textmu}}
+\DeclareDocumentCommand{\tgnu}{g}{\text{\textnu}}
+\DeclareDocumentCommand{\tgxi}{g}{\text{\textxi}}
+\DeclareDocumentCommand{\tgomicron}{g}{\text{\textomicron}}
+\DeclareDocumentCommand{\tgpi}{g}{\text{\textpi}}
+\DeclareDocumentCommand{\tgrho}{g}{\text{\textrho}}
+\DeclareDocumentCommand{\tgsigma}{g}{\text{\textsigma}}
+\DeclareDocumentCommand{\tgtau}{g}{\text{\texttau}}
+\DeclareDocumentCommand{\tgupsilon}{g}{\text{\textupsilon}}
+\DeclareDocumentCommand{\tgphi}{g}{\text{\textphi}}
+\DeclareDocumentCommand{\tgchi}{g}{\text{\textchi}}
+\DeclareDocumentCommand{\tgpsi}{g}{\text{\textpsi}}
+\DeclareDocumentCommand{\tgomega}{g}{\text{\textomega}}
\DeclareDocumentCommand{\vAlpha}{}{\varAlpha}
\DeclareDocumentCommand{\vBeta}{}{\varBeta}
\DeclareDocumentCommand{\vGamma}{}{\varGamma}
@@ -258,9 +267,223 @@
\DeclareDocumentCommand{\uvomega}{}{\upvaromega}
\fi
+% shortmathrm
+\ifshortmathrm
+\DeclareDocumentCommand{\rmA}{e{_^}}{\ensuremath{\mathrm{A}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmB}{e{_^}}{\ensuremath{\mathrm{B}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmC}{e{_^}}{\ensuremath{\mathrm{C}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmD}{e{_^}}{\ensuremath{\mathrm{D}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmE}{e{_^}}{\ensuremath{\mathrm{E}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmF}{e{_^}}{\ensuremath{\mathrm{F}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmG}{e{_^}}{\ensuremath{\mathrm{G}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmH}{e{_^}}{\ensuremath{\mathrm{H}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmI}{e{_^}}{\ensuremath{\mathrm{I}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmJ}{e{_^}}{\ensuremath{\mathrm{J}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmK}{e{_^}}{\ensuremath{\mathrm{K}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmL}{e{_^}}{\ensuremath{\mathrm{L}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmM}{e{_^}}{\ensuremath{\mathrm{M}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmN}{e{_^}}{\ensuremath{\mathrm{N}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmO}{e{_^}}{\ensuremath{\mathrm{O}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmP}{e{_^}}{\ensuremath{\mathrm{P}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmQ}{e{_^}}{\ensuremath{\mathrm{Q}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmR}{e{_^}}{\ensuremath{\mathrm{R}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmS}{e{_^}}{\ensuremath{\mathrm{S}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmT}{e{_^}}{\ensuremath{\mathrm{T}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmU}{e{_^}}{\ensuremath{\mathrm{U}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmV}{e{_^}}{\ensuremath{\mathrm{V}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmW}{e{_^}}{\ensuremath{\mathrm{W}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmX}{e{_^}}{\ensuremath{\mathrm{X}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmY}{e{_^}}{\ensuremath{\mathrm{Y}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmZ}{e{_^}}{\ensuremath{\mathrm{Z}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rma}{e{_^}}{\ensuremath{\mathrm{a}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmb}{e{_^}}{\ensuremath{\mathrm{b}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmc}{e{_^}}{\ensuremath{\mathrm{c}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmd}{e{_^}}{\ensuremath{\mathrm{d}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rme}{e{_^}}{\ensuremath{\mathrm{e}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmf}{e{_^}}{\ensuremath{\mathrm{f}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmg}{e{_^}}{\ensuremath{\mathrm{g}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmh}{e{_^}}{\ensuremath{\mathrm{h}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmi}{e{_^}}{\ensuremath{\mathrm{i}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmj}{e{_^}}{\ensuremath{\mathrm{j}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmk}{e{_^}}{\ensuremath{\mathrm{k}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rml}{e{_^}}{\ensuremath{\mathrm{l}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmm}{e{_^}}{\ensuremath{\mathrm{m}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmn}{e{_^}}{\ensuremath{\mathrm{n}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmo}{e{_^}}{\ensuremath{\mathrm{o}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmp}{e{_^}}{\ensuremath{\mathrm{p}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmq}{e{_^}}{\ensuremath{\mathrm{q}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmr}{e{_^}}{\ensuremath{\mathrm{r}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rms}{e{_^}}{\ensuremath{\mathrm{s}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmt}{e{_^}}{\ensuremath{\mathrm{t}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmu}{e{_^}}{\ensuremath{\mathrm{u}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmv}{e{_^}}{\ensuremath{\mathrm{v}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmw}{e{_^}}{\ensuremath{\mathrm{w}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmx}{e{_^}}{\ensuremath{\mathrm{x}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmy}{e{_^}}{\ensuremath{\mathrm{y}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmz}{e{_^}}{\ensuremath{\mathrm{z}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmHe}{e{_^}}{\ensuremath{\mathrm{He}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmLi}{e{_^}}{\ensuremath{\mathrm{Li}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmBe}{e{_^}}{\ensuremath{\mathrm{Be}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmNe}{e{_^}}{\ensuremath{\mathrm{Ne}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmNa}{e{_^}}{\ensuremath{\mathrm{Na}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmMg}{e{_^}}{\ensuremath{\mathrm{Mg}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmAl}{e{_^}}{\ensuremath{\mathrm{Al}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmSi}{e{_^}}{\ensuremath{\mathrm{Si}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmCl}{e{_^}}{\ensuremath{\mathrm{Cl}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmAr}{e{_^}}{\ensuremath{\mathrm{Ar}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmCa}{e{_^}}{\ensuremath{\mathrm{Ca}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmSc}{e{_^}}{\ensuremath{\mathrm{Sc}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmTi}{e{_^}}{\ensuremath{\mathrm{Ti}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmCr}{e{_^}}{\ensuremath{\mathrm{Cr}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmMn}{e{_^}}{\ensuremath{\mathrm{Mn}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmFe}{e{_^}}{\ensuremath{\mathrm{Fe}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmCo}{e{_^}}{\ensuremath{\mathrm{Co}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmNi}{e{_^}}{\ensuremath{\mathrm{Ni}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmCu}{e{_^}}{\ensuremath{\mathrm{Cu}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmZn}{e{_^}}{\ensuremath{\mathrm{Zn}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmGa}{e{_^}}{\ensuremath{\mathrm{Ga}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmGe}{e{_^}}{\ensuremath{\mathrm{Ge}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmAs}{e{_^}}{\ensuremath{\mathrm{As}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmSe}{e{_^}}{\ensuremath{\mathrm{Se}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmBr}{e{_^}}{\ensuremath{\mathrm{Br}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmKr}{e{_^}}{\ensuremath{\mathrm{Kr}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmRb}{e{_^}}{\ensuremath{\mathrm{Rb}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmSr}{e{_^}}{\ensuremath{\mathrm{Sr}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmZr}{e{_^}}{\ensuremath{\mathrm{Zr}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmNb}{e{_^}}{\ensuremath{\mathrm{Nb}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmMo}{e{_^}}{\ensuremath{\mathrm{Mo}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmTc}{e{_^}}{\ensuremath{\mathrm{Tc}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmRu}{e{_^}}{\ensuremath{\mathrm{Ru}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmRh}{e{_^}}{\ensuremath{\mathrm{Rh}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmPd}{e{_^}}{\ensuremath{\mathrm{Pd}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmAg}{e{_^}}{\ensuremath{\mathrm{Ag}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmCd}{e{_^}}{\ensuremath{\mathrm{Cd}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmIn}{e{_^}}{\ensuremath{\mathrm{In}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmSn}{e{_^}}{\ensuremath{\mathrm{Sn}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmSb}{e{_^}}{\ensuremath{\mathrm{Sb}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmTe}{e{_^}}{\ensuremath{\mathrm{Te}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmXe}{e{_^}}{\ensuremath{\mathrm{Xe}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmCs}{e{_^}}{\ensuremath{\mathrm{Cs}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmBa}{e{_^}}{\ensuremath{\mathrm{Ba}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmLa}{e{_^}}{\ensuremath{\mathrm{La}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmCe}{e{_^}}{\ensuremath{\mathrm{Ce}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmPr}{e{_^}}{\ensuremath{\mathrm{Pr}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmNd}{e{_^}}{\ensuremath{\mathrm{Nd}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmPm}{e{_^}}{\ensuremath{\mathrm{Pm}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmSm}{e{_^}}{\ensuremath{\mathrm{Sm}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmEu}{e{_^}}{\ensuremath{\mathrm{Eu}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmGd}{e{_^}}{\ensuremath{\mathrm{Gd}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmTb}{e{_^}}{\ensuremath{\mathrm{Tb}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmDy}{e{_^}}{\ensuremath{\mathrm{Dy}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmHo}{e{_^}}{\ensuremath{\mathrm{Ho}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmEr}{e{_^}}{\ensuremath{\mathrm{Er}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmTm}{e{_^}}{\ensuremath{\mathrm{Tm}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmYb}{e{_^}}{\ensuremath{\mathrm{Yb}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmLu}{e{_^}}{\ensuremath{\mathrm{Lu}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmHf}{e{_^}}{\ensuremath{\mathrm{Hf}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmTa}{e{_^}}{\ensuremath{\mathrm{Ta}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmRe}{e{_^}}{\ensuremath{\mathrm{Re}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmOs}{e{_^}}{\ensuremath{\mathrm{Os}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmIr}{e{_^}}{\ensuremath{\mathrm{Ir}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmPt}{e{_^}}{\ensuremath{\mathrm{Pt}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmAu}{e{_^}}{\ensuremath{\mathrm{Au}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmHg}{e{_^}}{\ensuremath{\mathrm{Hg}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmTl}{e{_^}}{\ensuremath{\mathrm{Tl}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmPb}{e{_^}}{\ensuremath{\mathrm{Pb}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmBi}{e{_^}}{\ensuremath{\mathrm{Bi}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmPo}{e{_^}}{\ensuremath{\mathrm{Po}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmAt}{e{_^}}{\ensuremath{\mathrm{At}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmRn}{e{_^}}{\ensuremath{\mathrm{Rn}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmFr}{e{_^}}{\ensuremath{\mathrm{Fr}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmRa}{e{_^}}{\ensuremath{\mathrm{Ra}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmAc}{e{_^}}{\ensuremath{\mathrm{Ac}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmTh}{e{_^}}{\ensuremath{\mathrm{Th}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmPa}{e{_^}}{\ensuremath{\mathrm{Pa}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmNp}{e{_^}}{\ensuremath{\mathrm{Np}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmPu}{e{_^}}{\ensuremath{\mathrm{Pu}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmAm}{e{_^}}{\ensuremath{\mathrm{Am}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmCm}{e{_^}}{\ensuremath{\mathrm{Cm}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmBk}{e{_^}}{\ensuremath{\mathrm{Bk}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmCf}{e{_^}}{\ensuremath{\mathrm{Cf}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmEs}{e{_^}}{\ensuremath{\mathrm{Es}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmFm}{e{_^}}{\ensuremath{\mathrm{Fm}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmMd}{e{_^}}{\ensuremath{\mathrm{Md}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmNo}{e{_^}}{\ensuremath{\mathrm{No}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmLr}{e{_^}}{\ensuremath{\mathrm{Lr}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmRf}{e{_^}}{\ensuremath{\mathrm{Rf}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmDb}{e{_^}}{\ensuremath{\mathrm{Db}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmSg}{e{_^}}{\ensuremath{\mathrm{Sg}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmBh}{e{_^}}{\ensuremath{\mathrm{Bh}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmHs}{e{_^}}{\ensuremath{\mathrm{Hs}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmMt}{e{_^}}{\ensuremath{\mathrm{Mt}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmDs}{e{_^}}{\ensuremath{\mathrm{Ds}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmRg}{e{_^}}{\ensuremath{\mathrm{Rg}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmCn}{e{_^}}{\ensuremath{\mathrm{Cn}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmNh}{e{_^}}{\ensuremath{\mathrm{Nh}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmFl}{e{_^}}{\ensuremath{\mathrm{Fl}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmMc}{e{_^}}{\ensuremath{\mathrm{Mc}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmLv}{e{_^}}{\ensuremath{\mathrm{Lv}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmTs}{e{_^}}{\ensuremath{\mathrm{Ts}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\DeclareDocumentCommand{\rmOg}{e{_^}}{\ensuremath{\mathrm{Og}\IfValueTF{#1}{_{#1}}{}\IfValueTF{#2}{^{#2}}{}}}
+\fi
+
+% shorttext
+\ifshorttext
+\DeclareDocumentCommand{\txA}{}{\textnormal{A}}
+\DeclareDocumentCommand{\txB}{}{\textnormal{B}}
+\DeclareDocumentCommand{\txC}{}{\textnormal{C}}
+\DeclareDocumentCommand{\txD}{}{\textnormal{D}}
+\DeclareDocumentCommand{\txE}{}{\textnormal{E}}
+\DeclareDocumentCommand{\txF}{}{\textnormal{F}}
+\DeclareDocumentCommand{\txG}{}{\textnormal{G}}
+\DeclareDocumentCommand{\txH}{}{\textnormal{H}}
+\DeclareDocumentCommand{\txI}{}{\textnormal{I}}
+\DeclareDocumentCommand{\txJ}{}{\textnormal{J}}
+\DeclareDocumentCommand{\txK}{}{\textnormal{K}}
+\DeclareDocumentCommand{\txL}{}{\textnormal{L}}
+\DeclareDocumentCommand{\txM}{}{\textnormal{M}}
+\DeclareDocumentCommand{\txN}{}{\textnormal{N}}
+\DeclareDocumentCommand{\txO}{}{\textnormal{O}}
+\DeclareDocumentCommand{\txP}{}{\textnormal{P}}
+\DeclareDocumentCommand{\txQ}{}{\textnormal{Q}}
+\DeclareDocumentCommand{\txR}{}{\textnormal{R}}
+\DeclareDocumentCommand{\txS}{}{\textnormal{S}}
+\DeclareDocumentCommand{\txT}{}{\textnormal{T}}
+\DeclareDocumentCommand{\txU}{}{\textnormal{U}}
+\DeclareDocumentCommand{\txV}{}{\textnormal{V}}
+\DeclareDocumentCommand{\txW}{}{\textnormal{W}}
+\DeclareDocumentCommand{\txX}{}{\textnormal{X}}
+\DeclareDocumentCommand{\txY}{}{\textnormal{Y}}
+\DeclareDocumentCommand{\txZ}{}{\textnormal{Z}}
+\DeclareDocumentCommand{\txa}{}{\textnormal{a}}
+\DeclareDocumentCommand{\txb}{}{\textnormal{b}}
+\DeclareDocumentCommand{\txc}{}{\textnormal{c}}
+\DeclareDocumentCommand{\txd}{}{\textnormal{d}}
+\DeclareDocumentCommand{\txe}{}{\textnormal{e}}
+\DeclareDocumentCommand{\txf}{}{\textnormal{f}}
+\DeclareDocumentCommand{\txg}{}{\textnormal{g}}
+\DeclareDocumentCommand{\txh}{}{\textnormal{h}}
+\DeclareDocumentCommand{\txi}{}{\textnormal{i}}
+\DeclareDocumentCommand{\txj}{}{\textnormal{j}}
+\DeclareDocumentCommand{\txk}{}{\textnormal{k}}
+\DeclareDocumentCommand{\txl}{}{\textnormal{l}}
+\DeclareDocumentCommand{\txm}{}{\textnormal{m}}
+\DeclareDocumentCommand{\txn}{}{\textnormal{n}}
+\DeclareDocumentCommand{\txo}{}{\textnormal{o}}
+\DeclareDocumentCommand{\txp}{}{\textnormal{p}}
+\DeclareDocumentCommand{\txq}{}{\textnormal{q}}
+\DeclareDocumentCommand{\txr}{}{\textnormal{r}}
+\DeclareDocumentCommand{\txs}{}{\textnormal{s}}
+\DeclareDocumentCommand{\txt}{}{\textnormal{t}}
+\DeclareDocumentCommand{\txu}{}{\textnormal{u}}
+\DeclareDocumentCommand{\txv}{}{\textnormal{v}}
+\DeclareDocumentCommand{\txw}{}{\textnormal{w}}
+\DeclareDocumentCommand{\txx}{}{\textnormal{x}}
+\DeclareDocumentCommand{\txy}{}{\textnormal{y}}
+\DeclareDocumentCommand{\txz}{}{\textnormal{z}}
+\fi
+
% Others
-\DeclareDocumentCommand{\autommode}{m}{\relax\ifmmode #1\else\(#1\)\fi}
-\let\amm\autommode
\DeclareDocumentCommand{\mathcolorbox}{ m m }{
\begingroup
\setlength{\fboxsep}{0pt}
@@ -271,16 +494,16 @@
{\colorbox{#1}{$\scriptscriptstyle#2$}}
\endgroup
}
-\let\mcbox\mathcolorbox
+\DeclareDocumentCommand\mcbox{}{\mathcolorbox}
\DeclareDocumentCommand{\autocolorbox}{m m}{
\relax\ifmmode \mathcolorbox{#1}{#2}\else\colorbox{#1}{#2}\fi
}
-\let\acbox\autocolorbox
-\let\cbox\autocolorbox
-\DeclareDocumentCommand{\tentothepowerof}{m}{\relax\ifmmode 10^{#1}\else\(10^{#1}\)\fi}
-\let\tenpow\tentothepowerof
-\DeclareDocumentCommand{\scientificnotation}{m m}{\relax\ifmmode #1\times 10^{#2}\else\(#1\times 10^{#2}\)\fi}
-\let\scinote\scientificnotation
+\DeclareDocumentCommand\acbox{}{\autocolorbox}
+\DeclareDocumentCommand\cbox{}{\autocolorbox}
+\DeclareDocumentCommand{\tentothepowerof}{m}{\ensuremath{10^{#1}}}
+\DeclareDocumentCommand\tenpow{}{\tentothepowerof}
+\DeclareDocumentCommand{\scientificnotation}{m m}{\ensuremath{#1\times 10^{#2}}}
+\DeclareDocumentCommand\scinote{}{\scientificnotation}
% Symbols
\DeclareDocumentCommand\lparen{}{(} % Left parenthesis
@@ -292,6 +515,13 @@
\DeclareDocumentCommand{\venti}{}{\cbox{cyan}{\phantom{\sum_x^x}}}
\DeclareDocumentCommand\Vtextvisiblespace{O{.3em}}{\mbox{\kern.06em\vrule height.3ex}\vbox{\hrule width#1}\hbox{\vrule height.3ex}}
+\DeclareDocumentCommand{\calE}{}{\mathcal{E}}
+\DeclareDocumentCommand{\bbR}{}{\mathbb{R}}
+\DeclareDocumentCommand{\bbC}{}{\mathbb{C}}
+\DeclareDocumentCommand{\bbQ}{}{\mathbb{Q}}
+\DeclareDocumentCommand{\bbN}{}{\mathbb{N}}
+\DeclareDocumentCommand{\bbZ}{}{\mathbb{Z}}
+
% Brackets and braces
\DeclareDocumentCommand{\PHquantity}{ t\big t\Big t\bigg t\Bigg o d() d|| g }
{ % Flexible automatic bracketing of an expression in () or [] or {} or ||
@@ -333,7 +563,7 @@
\IfNoValueTF{#8}{}{#8}
}
}
-\let\PHqty\PHquantity
+\DeclareDocumentCommand\PHqty{}{\PHquantity}
\IfPackageLoadedTF{siunitx}
{
\DeclareDocumentCommand{\ITquantity}{ t\big t\Big t\bigg t\Bigg o d() d|| g g }
@@ -383,17 +613,17 @@
}
}
}
- \let\ITqty\ITquantity
+ \DeclareDocumentCommand\ITqty{}{\ITquantity}
\ifsiintegrate
- \let\PTquantity\ITquantity
+ \DeclareDocumentCommand\PTquantity{}{\ITquantity}
\else
- \let\PTquantity\PHquantity
+ \DeclareDocumentCommand\PTquantity{}{\PHquantity}
\fi
-}{\let\PTquantity\PHquantity}
-\let\PTqty\PTquantity
+}{\DeclareDocumentCommand\PTquantity{}{\PHquantity}}
+\DeclareDocumentCommand\PTqty{}{\PTquantity}
\ifoverride
- \let\qty\PTquantity
- \let\quantity\PTquantity
+ \DeclareDocumentCommand\qty{}{\PTquantity}
+ \DeclareDocumentCommand\quantity{}{\PTquantity}
\fi
\DeclareDocumentCommand\pqty{ l m }{\braces#1{\lparen}{\rparen}{#2}}
\DeclareDocumentCommand\bqty{ l m }{\braces#1{\lbrack}{\rbrack}{#2}}
@@ -402,7 +632,7 @@
\DeclareDocumentCommand\omqty{m}{\begin{matrix}#1\end{matrix}}
\DeclareDocumentCommand\pmqty{m}{\begin{pmatrix}#1\end{pmatrix}}
\DeclareDocumentCommand\PTpmqty{s m}{\IfNoValueTF{#1}{\begin{pmatrix}#2\end{pmatrix}}{\left\lgroup\begin{matrix}#2\end{matrix}\right\rgroup}}
-\ifoverride\let\pmqty\PTpmqty\fi
+\ifoverride\DeclareDocumentCommand\pmqty{}{\PTpmqty}\fi
\DeclareDocumentCommand\Pmqty{m}{\left\lgroup\begin{matrix}#1\end{matrix}\right\rgroup}
\DeclareDocumentCommand\bmqty{m}{\begin{bmatrix}#1\end{bmatrix}}
\DeclareDocumentCommand\vmqty{m}{\begin{vmatrix}#1\end{vmatrix}}
@@ -435,8 +665,8 @@
\IfNoValueTF{#5}{}{|#5|}
}
}
-\let\PTmqty\PTmatrixquantity
-\ifoverride\let\mqty\PTmatrixquantity\fi
+\DeclareDocumentCommand\PTmqty{}{\PTmatrixquantity}
+\ifoverride\DeclareDocumentCommand\mqty{}{\PTmatrixquantity}\fi
\DeclareDocumentCommand\matrixdeterminant{m}{\vmqty{#1}} % Matrix determinant
\DeclareDocumentCommand\mdet{}{\matrixdeterminant} % Shorthand for matrix determinant
@@ -443,7 +673,7 @@
\DeclareDocumentCommand\somqty{m}{\begin{smallmatrix}#1\end{smallmatrix}}
\DeclareDocumentCommand\spmqty{m}{\pqty{\begin{smallmatrix}#1\end{smallmatrix}}}
\DeclareDocumentCommand\PTspmqty{s m}{\IfNoValueTF{#1}{\pqty{\begin{smallmatrix}#2\end{smallmatrix}}}{\left\lgroup\begin{smallmatrix}#2\end{smallmatrix}\right\rgroup}}
-\ifoverride\let\spmqty\PTspmqty\fi
+\ifoverride\DeclareDocumentCommand\spmqty{}{\PTspmqty}\fi
\DeclareDocumentCommand\sPmqty{m}{\left\lgroup\begin{smallmatrix}#1\end{smallmatrix}\right\rgroup}
\DeclareDocumentCommand\sbmqty{m}{\bqty{\begin{smallmatrix}#1\end{smallmatrix}}}
\DeclareDocumentCommand\svmqty{m}{\vqty{\begin{smallmatrix}#1\end{smallmatrix}}}
@@ -476,8 +706,8 @@
\IfNoValueTF{#5}{}{|#5|}
}
}
-\let\PTsmqty\PTsmallmatrixquantity
-\ifoverride\let\smqty\PTsmallmatrixquantity\fi
+\DeclareDocumentCommand\PTsmqty{}{\PTsmallmatrixquantity}
+\ifoverride\DeclareDocumentCommand\smqty{}{\PTsmallmatrixquantity}\fi
\DeclareDocumentCommand\smallmatrixdeterminant{m}{\svmqty{#1}} % Small matrix determinant
\DeclareDocumentCommand\smdet{}{\smallmatrixdeterminant} % Shorthand for small matrix determinant
@@ -572,8 +802,7 @@
\DeclareDocumentCommand\vectorunit{ s m }{\IfBooleanTF{#1}{\boldsymbol{\hat{#2}}}{\mathbf{\hat{#2}}}} % Unit vector [star for Greek and italic Roman]
\DeclareDocumentCommand\vu{}{\vectorunit} % Shorthand for \vectorunit
-\DeclareDocumentCommand\dotproduct{}{\boldsymbol\cdot} % Vector dot product symbol
-\DeclareDocumentCommand\vdot{}{\dotproduct} % Shorthand for \dotproduct [note that the command sequence \dp is protected]
+\DeclareDocumentCommand\vdot{}{\dotproduct}
\DeclareDocumentCommand\crossproduct{}{\boldsymbol\times} % Vector cross product symbol
\DeclareDocumentCommand\cross{}{\crossproduct} % Shorthand for \crossproduct
@@ -593,26 +822,25 @@
\DeclareDocumentCommand\divergence{ g o d() }{ % Divergence
\IfNoValueTF{#1}{
\IfNoValueTF{#2}{
- \IfNoValueTF{#3}{\vnabla \vdot}{\vnabla \vdot \quantity(#3)}
+ \IfNoValueTF{#3}{\vnabla \dotproduct}{\vnabla \dotproduct \quantity(#3)}
}
- {\vnabla \vdot \quantity[#2] \IfNoValueTF{#3}{}{(#3)}}
+ {\vnabla \dotproduct \quantity[#2] \IfNoValueTF{#3}{}{(#3)}}
}
- {\vnabla \vdot #1 \IfNoValueTF{#2}{}{[#2]} \IfNoValueTF{#3}{}{(#3)}}
+ {\vnabla \dotproduct #1 \IfNoValueTF{#2}{}{[#2]} \IfNoValueTF{#3}{}{(#3)}}
}
-\let\divg\divergence
+\DeclareDocumentCommand\divg{}{\divergence}
\iforiginaldiv
\ifphysics
- \let\div\divisionsymbol
- \let\divg\divergence
+ \DeclareDocumentCommand\div{}{\divisionsymbol}
\else
- \let\divisionsymbol\div
+ \DeclareDocumentCommand\divisionsymbol{}{\div}
\fi
\else
\ifphysics
- \let\div\divergence
+ \DeclareDocumentCommand\div{}{\divergence}
\else
- \let\divisionsymbol\div % Rename \div [division symbol] in order to free up control sequence for \divergence
- \let\div\divergence
+ \DeclareDocumentCommand\divisionsymbol{}{\div} % Rename \div [division symbol] in order to free up control sequence for \divergence
+ \DeclareDocumentCommand\div{}{\divergence}
\fi
\fi
@@ -645,8 +873,6 @@
\DeclareDocumentCommand\principalvalue{g}{\IfNoValueTF{#1}{\mathcal{P}}{\mathcal{P}\mathord{#1}}}
\DeclareDocumentCommand\pv{}{\principalvalue}
\DeclareDocumentCommand\PV{g}{\IfNoValueTF{#1}{\mathrm{P.V.}}{\mathrm{P.V.}\mathord{#1}}}
-\let\real\Re \DeclareDocumentCommand\Re{g}{\IfNoValueTF{#1}{\operatorname{Re}}{\fbraces{\lbrace}{\rbrace}{\operatorname{Re}}{#1}}}
-\let\imaginary\Im \DeclareDocumentCommand\Im{g}{\IfNoValueTF{#1}{\operatorname{Im}}{\fbraces{\lbrace}{\rbrace}{\operatorname{Im}}{#1}}}
\DeclareDocumentCommand\opbraces{ m g o d() }
{
\IfNoValueTF{#2}
@@ -676,7 +902,7 @@
}
% Trig function and operator redefinitions
-\ifx\trigopt 1
+\iftrig
\let\sine\sin \DeclareDocumentCommand\sin{}{\trigbraces{\sine}}
\let\cosine\cos \DeclareDocumentCommand\cos{}{\trigbraces{\cosine}}
\let\tangent\tan \DeclareDocumentCommand\tan{}{\trigbraces{\tangent}}
@@ -805,8 +1031,8 @@
{\fractype{\diffd \IfNoValueTF{#2}{}{^{#2}} #3}{\diffd #4\IfNoValueTF{#2}{}{^{#2}}}}
\IfNoValueTF{#5}{}{\argopen(#5\argclose)}
}
-\let\PTdv\PTderivative
-\ifoverride\let\dv\PTderivative\fi
+\DeclareDocumentCommand\PTdv{}{\PTderivative}
+\ifoverride\DeclareDocumentCommand\dv{}{\PTderivative}\fi
\DeclareDocumentCommand\PTpartialderivative{ s o m g g d() }
{ % Partial derivative
% s: star for \flatfrac flat derivative
@@ -831,11 +1057,11 @@
\IfNoValueTF{#6}{}{\argopen(#6\argclose)}
}
}
-\let\PTpdv\PTpartialderivative
-\let\PTpderivative\PTpartialderivative
+\DeclareDocumentCommand\PTpdv{}{\PTpartialderivative}
+\DeclareDocumentCommand\PTpderivative{}{\PTpartialderivative}
\ifoverride
- \let\pderivative\PTpartialderivative
- \let\pdv\PTpartialderivative
+ \DeclareDocumentCommand\pderivative{}{\PTpartialderivative}
+ \DeclareDocumentCommand\pdv{}{\PTpartialderivative}
\fi
\DeclareDocumentCommand\variation{ o g d() }{ % Functional variation
@@ -1133,8 +1359,8 @@
}
\the\matrixtoks
}
-\let\PTxmat\PTxmatrix
-\ifoverride\let\xmat\PTxmatrix\fi
+\DeclareDocumentCommand\PTxmat{}{\PTxmatrix}
+\ifoverride\DeclareDocumentCommand\xmat{}{\PTxmatrix}\fi
\DeclareDocumentCommand\zeromatrix{ m g }{\IfNoValueTF{#2}{\PTxmatrix{0}{#1}{#1}}{\PTxmatrix{0}{#1}{#2}}}
\DeclareDocumentCommand\zmat{}{\zeromatrix}
@@ -1231,8 +1457,8 @@
\DeclareDocumentCommand\flatfrac{ m m }{\left.#1\middle\slash#2\right.}
\DeclareDocumentCommand\homework{}{ % You can try it
\ensuremath{
- \div{\vb{E}}=\frac{\rho}{\epsilon_0} \qc
- \div{\vb{B}}=0 \qc
+ \divg{\vb{E}}=\frac{\rho}{\epsilon_0} \qc
+ \divg{\vb{B}}=0 \qc
\curl{\vb{E}}=-\pdv{\vb{B}}{t}\qc
\curl{\vb{B}}=\mu_0\vb{J}+\frac{1}{c^2}\pdv{\vb{E}}{t}\qc
H\ket{\Psi}=i\hbar\pdv{}{t}\ket{\Psi},
More information about the tex-live-commits
mailing list.