texlive[74688] Master/texmf-dist: physics-patch (18mar25)

commits+karl at tug.org commits+karl at tug.org
Tue Mar 18 21:28:10 CET 2025


Revision: 74688
          https://tug.org/svn/texlive?view=revision&revision=74688
Author:   karl
Date:     2025-03-18 21:28:10 +0100 (Tue, 18 Mar 2025)
Log Message:
-----------
physics-patch (18mar25)

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-03-18 04:07:01 UTC (rev 74687)
+++ trunk/Master/texmf-dist/doc/latex/physics-patch/README.txt	2025-03-18 20:28:10 UTC (rev 74688)
@@ -1,4 +1,4 @@
-physics-patch 2.4
+physics-patch 2.7
 
 Improved version of the physics package
 
@@ -16,6 +16,6 @@
 
 Author: Willie Shen (Willie169)
 Repository: https://github.com/Willie169/physics-patch
-Last update: Feb 16, 2025
+Last update: Mar 18, 2025
 
 For documentation, see physics-patch.pdf
\ No newline at end of file

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-03-18 04:07:01 UTC (rev 74687)
+++ trunk/Master/texmf-dist/doc/latex/physics-patch/physics-patch.tex	2025-03-18 20:28:10 UTC (rev 74688)
@@ -1,7 +1,7 @@
 \documentclass[a4paper,12pt]{article}
 \usepackage[margin=1.27cm,foot=0.77cm]{geometry}
-\usepackage{amsmath,amssymb,array,etoolbox,fontspec,longtable,listings,multirow,needspace,parskip,setspace,titling,xcolor,xparse,xstring}
-\usepackage{physics-patch}
+\usepackage{amsmath,amssymb,array,etoolbox,fontspec,longtable,listings,multirow,needspace,parskip,setspace,verbatim,titling,xcolor,xparse,xstring}
+\usepackage[shortgreek,shortmathrm,shorttext]{physics-patch}
 \usepackage[colorlinks,urlcolor=blue]{hyperref}
 \setmainfont{TeX Gyre Termes}[Ligatures=TeX]
 \setsansfont{TeX Gyre Heros}[Ligatures=TeX]
@@ -12,6 +12,7 @@
 \everydisplay{\displaystyle}
 \newcolumntype{M}{>{$\displaystyle}c<{$}}
 \newcolumntype{L}{>{$\displaystyle}l<{$}}
+\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
 \setlength{\LTleft}{\fill}
 \setlength{\LTright}{\fill}
 \renewcommand{\maketitle}{
@@ -45,14 +46,17 @@
 }
 \title{The \texttt{physics-patch} package\\\mbox{}\\\textnormal{\large Improved version of the physics package}}
 \author{\mbox{}\\Willie Shen (Willie169)}
-\date{Version 2.4\\\textnormal{Last update: Feb. 17, 2025}}
+\date{Version 2.7\\\textnormal{Last update: Mar. 18, 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}
-Since version 2.0, the \texttt{physics-patch} package has evolved from merely patching the \texttt{physics} package to fully replacing it, covering all its commands. While preserving the original goal—simplifying mathematical and physics typesetting for greater readability and efficiency—this package refines the design by addressing unconventional behaviors, extending commands, and introducing additional macros.\\\\
-Like the original, this package provides commands with intuitive names and well-defined shorthands, ensuring both clarity and ease of recall.\\\\
-This package resolved the unintuitive definitions and behaviors in \texttt{physics} without changing the command names and intended behaviors. For instance, in the original package, suffix parentheses and their contents in expressions like \verb|\dv{f}{x}(\typical)| are ignored.\\\\
-Beyond refining existing functionality, this package extends commands for broader applicability—such as enabling \verb|\xmat| to support ellipses—and introduces entirely new macros, such as \verb|\omat|.
+Since version 2.0, the \texttt{physics-patch} package has evolved from merely patching the \texttt{physics} package to fully replacing it, covering all its commands. While preserving the original goal—simplifying mathematical and physics typesetting for greater readability and efficiency—this package refines the design by addressing unconventional behaviors, extending commands, and introducing additional macros.
+
+Like the original, this package provides commands with intuitive names and well-defined shorthands, ensuring both clarity and ease of recall.
+
+This package resolved the unintuitive definitions and behaviors in \texttt{physics} without changing the command names and intended behaviors. For instance, in the original package, parentheses and their contents after \verb|\dv{f}{x}| are ignored.
+
+Beyond refining existing functionality, this package extends commands for broader applicability such as enabling \verb|\xmat| to support ellipses and introduces entirely new macros such as \verb|\omat|.
 \section{Usage}
 \subsection{Required packages}
 The \texttt{physics-patch} package requires \texttt{amsmath}, \texttt{etoolbox}, \texttt{xcolor}, \texttt{xparse}, and \texttt{xstring} package to work properly in your \LaTeX~document. If you are unsure whether you've had them installed, you can either install it again using your local package manager (comes with most distributions) or by visiting the \href{http://www.ctan.org}{CTAN} online package database, or even just try to use \texttt{physics-patch} package without worrying about it. Many modern \LaTeX compilers will locate and offer to download missing required packages for you.
@@ -82,18 +86,21 @@
 \section{License and Credit}
 \begin{itemize}
 \item
-This package is released under the \textbf{LaTeX Project Public License (LPPL) 1.3c.}\\
+This package is released under the \textbf{LaTeX Project Public License (LPPL) 1.3c.}
+
 See \href{https://www.latex-project.org/lppl/lppl-1-3c}{https://www.latex-project.org/lppl/lppl-1-3c} for the details of that license.
-\item Many parts of this package are modified from the \texttt{physics} package, created by \textbf{Sergio C. de la Barrera} and licenced under \textbf{LPPL 1.3}.\\
+\item Many parts of this package are modified from the \texttt{physics} package, created by \textbf{Sergio C. de la Barrera} and licenced under \textbf{LPPL 1.3}.
+
 See \href{https://ctan.org/pkg/physics}{https://ctan.org/pkg/physics} for the details of that package.
 \end{itemize}
 \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.\\
+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}.
 \subsection{Automatic bracing}
-\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\begin{longtable}[l]{ | C{6cm} | C{6cm} | C{6cm} | }
 \hline
-\verb|\PTquantity| or \verb|\PHquantity| or \verb|\PHqty| & \verb|\PTqty(\typical)| $\displaystyle\rightarrow \PTqty(\typical)$ & automatic $\PTqty(\;)$ braces \\
+\verb|\PTquantity|, \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)$ & \\
 & \verb|\PTqty[\typical]| $\rightarrow \PTqty[\typical]$ & automatic $\PTqty[\;]$ braces \\
@@ -132,7 +139,7 @@
 \begin{lstlisting}[language=TeX]
 \usepackage[arrowdel]{physics-patch}
 \end{lstlisting}
-\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\begin{longtable}[l]{ | C{6cm} | C{6cm} | C{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 \\\hline
@@ -166,7 +173,7 @@
 \begin{lstlisting}[language=TeX]
 \usepackage[notrig]{physics-patch}
 \end{lstlisting}
-\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\begin{longtable}[l]{ | C{6cm} | C{6cm} | C{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| \\
@@ -207,21 +214,63 @@
 \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
+\verb|\Arg(\tall)| & \Arg(\tall) & & \verb|\Argument|\\\hline
+\verb|\arg(\tall)| & \arg(\tall) & & \verb|\argument|\\\hline
+\verb|\Re(\tall)| & \Re(\tall) & & \verb|\real|\\\hline
+\verb|\Im(\tall)| & \Im(\tall) & & \verb|\imaginary|\\\hline
 \end{longtable}
-\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\begin{longtable}[l]{ | C{6cm} | C{6cm} | C{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|\tr| & \verb|\tr\rho| $\rightarrow \tr\rho$ also \verb|\tr(\tall)| $\rightarrow \tr(\tall)$  & trace; same bracing as trig functions \\\hline
+\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|\erf| & \verb|\erf(x)|$\rightarrow \erf(x)$ & error function \\\hline
 \verb|\Res| & \verb|\Res[f(z)]|$\rightarrow \Res[f(z)]$ & \parbox{6cm}{residue; same bracing as trig functions} \\\hline
+\verb|acosh| & \verb|\acosh(\pi)| $\rightarrow\acosh(\pi)$ & acosh \\\hline
+\verb|acsch| & \verb|\acsch(\pi)| $\rightarrow\acsch(\pi)$ & acsch \\\hline
+\verb|arccosh| & \verb|\arccosh(\pi)| $\rightarrow\arccosh(\pi)$ & arccosh \\\hline
+\verb|arccsch| & \verb|\arccsch(\pi)| $\rightarrow\arccsch(\pi)$ & arccsch \\\hline
+\verb|arcsech| & \verb|\arcsech(\pi)| $\rightarrow\arcsech(\pi)$ & arcsech \\\hline
+\verb|arcsinh| & \verb|\arcsinh(\pi)| $\rightarrow\arcsinh(\pi)$ & arcsinh \\\hline
+\verb|arctanh| & \verb|\arctanh(\pi)| $\rightarrow\arctanh(\pi)$ & arctanh \\\hline
+\verb|arctantwo| & \verb|\arctantwo(\pi)| $\rightarrow\arctantwo(\pi)$ & arctan2 \\\hline
+\verb|asech| & \verb|\asech(\pi)| $\rightarrow\asech(\pi)$ & asech \\\hline
+\verb|asinh| & \verb|\asinh(\pi)| $\rightarrow\asinh(\pi)$ & asinh \\\hline
+\verb|atanh| & \verb|\atanh(\pi)| $\rightarrow\atanh(\pi)$ & atanh \\\hline
+\verb|atantwo| & \verb|\atantwo(\pi)| $\rightarrow\atantwo(\pi)$ & atan2 \\\hline
+\verb|closure| & \verb|\closure(A)| $\rightarrow\closure(A)$ & closure \\\hline
+\verb|col| & \verb|\col(\mathbf{A})| $\rightarrow\col(\mathbf{A})$ & column space \\\hline
+\verb|row| & \verb|\row(\mathbf{A})| $\rightarrow\row(\mathbf{A})$ & row space \\\hline
+\verb|ker| & \verb|\ker(\mathbf{A})| $\rightarrow\ker(\mathbf{A})$ & kernel \\\hline
+\verb|SD| & \verb|\SD(X)| $\rightarrow\SD(X)$ & standard deviation \\\hline
+\verb|Var| & \verb|\Var(X)| $\rightarrow\Var(X)$ & variation \\\hline
+\verb|Mode| & \verb|\Mode(X)| $\rightarrow\Mode(X)$ & mode \\\hline
+\verb|Median| & \verb|\Median(X)| $\rightarrow\Median(X)$ & median \\\hline
+\verb|gcd| & \verb|\gcd(X)| $\rightarrow\gcd(X)$ & lowercase greatest common divisor \\\hline
+\verb|lcm| & \verb|\lcm(X)| $\rightarrow\lcm(X)$ & lowercase lowest common multiple \\\hline
+\verb|GCD| & \verb|\GCD(X)| $\rightarrow\GCD(X)$ & uppercase greatest common divisor \\\hline
+\verb|LCM| & \verb|\LCM(X)| $\rightarrow\LCM(X)$ & uppercase lowest common multiple \\\hline
+\verb|UnitVector| & \verb|\UnitVector(\mathbf{r})| $\rightarrow\UnitVector(\mathbf{r})$ & unit vector \\\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 \\\hline
 \end{longtable}
+\subsection{Utilities}
+\begin{longtable}[l]{ | C{6cm} | C{6cm} | C{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}{\typical}| $\rightarrow \mcbox{cyan}{\typical}$ & \\\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
+\verb|\numbercircled| & \verb|\numcir{1}| $\rightarrow$ \numcir{1} & patched \verb|\textcircled| for numbers \\\hline
+\verb|\boldsymbol| & \verb|\bsb{\tau}| $\rightarrow\bsb{\tau}$ & shorthand for \verb|\boldsymbol| \\\hline
+\verb|\RNum| & \verb|\RNum{1}| $\rightarrow$ \RNum{1} & uppercase roman numeral\\\hline
+\verb|\flatfrac| & \verb|\flatfrac{a}{b}| $\rightarrow\flatfrac{a}{b}$ & flat fraction\\\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} | p{6cm} | p{6cm} | }
+\begin{longtable}[l]{ | C{6cm} | C{6cm} | C{6cm} | }
 \hline
 \multicolumn{3}{|l|}{General text:} \\\hline
 \verb|\qqtext| & \verb|\qq{}| & general quick quad text with argument \\
@@ -245,7 +294,7 @@
 \begin{lstlisting}[language=TeX]
 \usepackage[italicdiff]{physics-patch}
 \end{lstlisting}
-\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\begin{longtable}[l]{ | C{6cm} | C{6cm} | C{6cm} | }
 \hline
 \verb|\differential| & \verb|\dd| $\rightarrow \dd$ & \\
 & \verb|\dd x| $\rightarrow \dd x$ & no spacing (not recommended) \\
@@ -286,7 +335,7 @@
 \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} | p{6cm} | p{6cm} | }
+\begin{longtable}[l]{ | C{6cm} | C{6cm} | C{6cm} | }
 \hline
 \verb|\ket| & \verb|\ket{\tall}| $\rightarrow \ket{\tall}$ & automatic sizing \\
 & \verb|\ket*{\tall}| $\rightarrow \ket*{\tall}$ & no resize \\\hline
@@ -321,7 +370,8 @@
 & \verb|\mel**{n}{\grande}{m}| $\rightarrow \mel**{n}{\grande}{m}$ & double star resizes based on all parts \\\hline
 \end{longtable}
 \subsection{Matrix macros}
-Note: \verb|\mqty| and \verb|\smqty| in \texttt{physics} uses \verb|\mathord|, while \verb|\PTmqty| and \verb|\PTsmqty| in \texttt{physics-patch} don't.\\\\
+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:\\
 \begin{minipage}{3cm}
 \begin{lstlisting}[language=TeX]
@@ -367,7 +417,7 @@
 \end{displaymath}
 \end{minipage}
 {\fontsize{8pt}{12pt}\selectfont\\
-\begin{longtable}[l]{ | p{6cm} | p{6cm} | p{6cm} | }
+\begin{longtable}[l]{ | C{6cm} | C{6cm} | C{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 \\
@@ -435,7 +485,7 @@
 \end{longtable}
 }
 \subsection{Symbols}
-\begin{center}\begin{tabular}{ | p{6cm} | p{6cm} | }
+\begin{center}\begin{tabular}{ | C{6cm} | C{6cm} | }
 \hline
 \verb|\lparen| $\rightarrow\; ($ &\\\hline
 \verb|\rparen| $\rightarrow\; )$ &\\\hline
@@ -444,6 +494,7 @@
 \verb|\tall| $\rightarrow \tall$ & \\\hline
 \verb|\grande| $\rightarrow \grande$ & \\\hline
 \verb|\venti| $\rightarrow \venti$ & \\\hline
+\verb|\parallelsum| $\rightarrow \parallelsum$ & \\\hline
 \verb|\calE|$\rightarrow$\verb|\mathcal{E}| & \\\hline
 \verb|\bbR|$\rightarrow$\verb|\mathbb{R}| & \\\hline
 \verb|\bbC|$\rightarrow$\verb|\mathbb{C}| & \\\hline
@@ -450,11 +501,13 @@
 \verb|\bbQ|$\rightarrow$\verb|\mathbb{Q}| & \\\hline
 \verb|\bbN|$\rightarrow$\verb|\mathbb{N}| & \\\hline
 \verb|\bbZ|$\rightarrow$\verb|\mathbb{Z}| & \\\hline
+\verb|\bell|$\rightarrow$\verb|\boldsymbol{\ell}| & \\\hline
+\verb|\btau|$\rightarrow$\verb|\boldsymbol{\tau}| & \\\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} | }
+\begin{center}\begin{tabular}{ | C{6cm} | C{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
@@ -464,7 +517,7 @@
 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} | }
+\begin{longtable}[l]{ | C{6cm} | C{6cm} | }
 \hline
 \verb|\rmA_a^b| $\rightarrow\mathrm{A}_a^b$ & work in both math mode and text mode
 \\\hline
@@ -480,13 +533,4 @@
 \verb|\txA| $\rightarrow$ \verb|\textnormal{A}|
 \\\hline
 \end{longtable}
-\subsection{Others}
-\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}}$ & \\\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-03-18 04:07:01 UTC (rev 74687)
+++ trunk/Master/texmf-dist/tex/latex/physics-patch/physics-patch.sty	2025-03-18 20:28:10 UTC (rev 74688)
@@ -1,5 +1,5 @@
-\ProvidesPackage{physics-patch}
-% physics-patch 2.4
+\ProvidesPackage{physics-patch}[2025/03/05 Version 2.7 Improved version of the physics package]
+% physics-patch 2.7
 %
 % Improved version of the physics package
 %
@@ -17,7 +17,7 @@
 %
 % Author: Willie Shen (Willie169)
 % Repository: https://github.com/Willie169/physics-patch
-% Last update: Feb 17, 2025
+% Last update: Mar 18, 2025
 %
 % For documentation, see physics-patch.pdf
 
@@ -483,7 +483,7 @@
 \DeclareDocumentCommand{\txz}{}{\textnormal{z}}
 \fi
 
-% Others
+% Utilities
 \DeclareDocumentCommand{\mathcolorbox}{ m m }{
   \begingroup
   \setlength{\fboxsep}{0pt}
@@ -504,6 +504,11 @@
 \DeclareDocumentCommand\tenpow{}{\tentothepowerof}
 \DeclareDocumentCommand{\scientificnotation}{m m}{\ensuremath{#1\times 10^{#2}}}
 \DeclareDocumentCommand\scinote{}{\scientificnotation}
+\DeclareDocumentCommand\numbercircled{m}{\text{\raisebox{.6pt}{\textcircled{\raisebox{-.9pt}{#1}}}}}
+\let\numcir\numbercircled
+\let\bsb\boldsymbol
+\DeclareDocumentCommand{\RNum}{m}{\uppercase\expandafter{\romannumeral #1\relax}}
+\DeclareDocumentCommand\flatfrac{ m m }{\left.#1\middle\slash#2\right.}
 
 % Symbols
 \DeclareDocumentCommand\lparen{}{(} % Left parenthesis
@@ -514,7 +519,7 @@
 \DeclareDocumentCommand{\grande}{}{\cbox{cyan}{\phantom{\frac{1}{xx}}}}
 \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{\parallelsum}{}{\mathbin{\!/\mkern-5mu/\!}}
 \DeclareDocumentCommand{\calE}{}{\mathcal{E}}
 \DeclareDocumentCommand{\bbR}{}{\mathbb{R}}
 \DeclareDocumentCommand{\bbC}{}{\mathbb{C}}
@@ -521,6 +526,8 @@
 \DeclareDocumentCommand{\bbQ}{}{\mathbb{Q}}
 \DeclareDocumentCommand{\bbN}{}{\mathbb{N}}
 \DeclareDocumentCommand{\bbZ}{}{\mathbb{Z}}
+\DeclareDocumentCommand{\bell}{}{\boldsymbol{\ell}}
+\DeclareDocumentCommand{\btau}{}{\boldsymbol{\tau}}
 
 % Brackets and braces
 \DeclareDocumentCommand{\PHquantity}{ t\big t\Big t\bigg t\Bigg o d() d|| g }
@@ -566,6 +573,7 @@
 \DeclareDocumentCommand\PHqty{}{\PHquantity}
 \IfPackageLoadedTF{siunitx}
 {
+  \RequirePackage{siunitx}
   \DeclareDocumentCommand{\ITquantity}{ t\big t\Big t\bigg t\Bigg o d() d|| g g }
   { % integrate \qty from siunitx into \qty
     \IfValueTF{#9}
@@ -865,11 +873,38 @@
 }
 
 % Operators
-\DeclareMathOperator{\trace}{tr} % Trace of a matrix
-\DeclareMathOperator{\Trace}{Tr} % Trace of a matrix (alternate)
-\DeclareMathOperator{\rank}{rank} % Rank of a matrix
-\DeclareMathOperator{\erf}{erf} % Gauss error function
-\DeclareMathOperator{\Residue}{Res} % Residue
+\DeclareDocumentCommand\tr{}{\operatorname{tr}} % Trace of a matrix
+\DeclareDocumentCommand\Tr{}{\operatorname{Tr}} % Trace of a matrix (alternate)
+\DeclareDocumentCommand\rank{}{\operatorname{rank}} % Rank of a matrix
+\DeclareDocumentCommand\erf{}{\operatorname{erf}} % error function
+\DeclareDocumentCommand\Res{}{\operatorname{Res}} % Residue
+\DeclareDocumentCommand\Arg{}{\operatorname{Arg}} % principal argument
+\DeclareDocumentCommand\arg{}{\operatorname{arg}} % argument
+\DeclareDocumentCommand{\acosh}{}{\operatorname{acosh}}
+\DeclareDocumentCommand{\acsch}{}{\operatorname{acsch}}
+\DeclareDocumentCommand{\arccosh}{}{\operatorname{arccosh}}
+\DeclareDocumentCommand{\arccsch}{}{\operatorname{arccsch}}
+\DeclareDocumentCommand{\arcsech}{}{\operatorname{arcsech}}
+\DeclareDocumentCommand{\arcsinh}{}{\operatorname{arcsinh}}
+\DeclareDocumentCommand{\arctanh}{}{\operatorname{arctanh}}
+\DeclareDocumentCommand{\arctantwo}{}{\operatorname{arctan2}}
+\DeclareDocumentCommand{\asech}{}{\operatorname{asech}}
+\DeclareDocumentCommand{\asinh}{}{\operatorname{asinh}}
+\DeclareDocumentCommand{\atanh}{}{\operatorname{atanh}}
+\DeclareDocumentCommand{\atantwo}{}{\operatorname{atan2}}
+\DeclareDocumentCommand{\closure}{}{\operatorname{closure}}
+\DeclareDocumentCommand{\col}{}{\operatorname{col}}
+\DeclareDocumentCommand{\row}{}{\operatorname{row}}
+\DeclareDocumentCommand{\ker}{}{\operatorname{ker}}
+\DeclareDocumentCommand{\SD}{}{\operatorname{SD}}
+\DeclareDocumentCommand{\Var}{}{\operatorname{Var}}
+\DeclareDocumentCommand{\Mode}{}{\operatorname{Mode}}
+\DeclareDocumentCommand{\Median}{}{\operatorname{Median}}
+\DeclareDocumentCommand{\gcd}{}{\operatorname{gcd}}
+\DeclareDocumentCommand{\lcm}{}{\operatorname{lcm}}
+\DeclareDocumentCommand{\GCD}{}{\operatorname{GCD}}
+\DeclareDocumentCommand{\LCM}{}{\operatorname{LCM}}
+\DeclareDocumentCommand{\UnitVector}{}{\operatorname{UnitVector}}
 \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}}}
@@ -913,32 +948,32 @@
   \let\arcsine\arcsin \DeclareDocumentCommand\arcsin{}{\trigbraces{\arcsine}}
   \let\arccosine\arccos \DeclareDocumentCommand\arccos{}{\trigbraces{\arccosine}}
   \let\arctangent\arctan \DeclareDocumentCommand\arctan{}{\trigbraces{\arctangent}}
-  \DeclareMathOperator{\arccosecant}{arccsc}
+  \DeclareDocumentCommand{\arccosecant}{}{\operatorname{arccsc}}
   \DeclareDocumentCommand\arccsc{}{\trigbraces{\arccosecant}}
-  \DeclareMathOperator{\arcsecant}{arcsec}
+  \DeclareDocumentCommand{\arcsecant}{}{\operatorname{arcsec}}
   \DeclareDocumentCommand\arcsec{}{\trigbraces{\arcsecant}}
-  \DeclareMathOperator{\arccotangent}{arccot}
+  \DeclareDocumentCommand{\arccotangent}{}{\operatorname{arccot}}
   \DeclareDocumentCommand\arccot{}{\trigbraces{\arccotangent}}
 
-  \DeclareMathOperator{\asine}{asin}
+  \DeclareDocumentCommand{\asine}{}{\operatorname{asin}}
   \DeclareDocumentCommand\asin{}{\trigbraces{\asine}}
-  \DeclareMathOperator{\acosine}{acos}
+  \DeclareDocumentCommand{\acosine}{}{\operatorname{acos}}
   \DeclareDocumentCommand\acos{}{\trigbraces{\acosine}}
-  \DeclareMathOperator{\atangent}{atan}
+  \DeclareDocumentCommand{\atangent}{}{\operatorname{atan}}
   \DeclareDocumentCommand\atan{}{\trigbraces{\atangent}}
-  \DeclareMathOperator{\acosecant}{acsc}
+  \DeclareDocumentCommand{\acosecant}{}{\operatorname{acsc}}
   \DeclareDocumentCommand\acsc{}{\trigbraces{\acosecant}}
-  \DeclareMathOperator{\asecant}{asec}
+  \DeclareDocumentCommand{\asecant}{}{\operatorname{asec}}
   \DeclareDocumentCommand\asec{}{\trigbraces{\asecant}}
-  \DeclareMathOperator{\acotangent}{acot}
+  \DeclareDocumentCommand{\acotangent}{}{\operatorname{acot}}
   \DeclareDocumentCommand\acot{}{\trigbraces{\acotangent}}
 
   \let\hypsine\sinh \DeclareDocumentCommand\sinh{}{\trigbraces{\hypsine}}
   \let\hypcosine\cosh \DeclareDocumentCommand\cosh{}{\trigbraces{\hypcosine}}
   \let\hyptangent\tanh \DeclareDocumentCommand\tanh{}{\trigbraces{\hyptangent}}
-  \DeclareMathOperator{\hypcosecant}{csch}
+  \DeclareDocumentCommand{\hypcosecant}{}{\operatorname{csch}}
   \DeclareDocumentCommand\csch{}{\trigbraces{\hypcosecant}}
-  \DeclareMathOperator{\hypsecant}{sech}
+  \DeclareDocumentCommand{\hypsecant}{}{\operatorname{sech}}
   \DeclareDocumentCommand\sech{}{\trigbraces{\hypsecant}}
   \let\hypcotangent\coth \DeclareDocumentCommand\coth{}{\trigbraces{\hypcotangent}}
 
@@ -947,27 +982,55 @@
   \let\naturallogarithm\ln \DeclareDocumentCommand\ln{}{\trigbraces{\naturallogarithm}}
   \let\determinant\det \DeclareDocumentCommand\det{}{\opbraces{\determinant}}
   \let\Probability\Pr \DeclareDocumentCommand\Pr{}{\opbraces{\Probability}}
-  \DeclareDocumentCommand\tr{}{\opbraces{\trace}}
-  \DeclareDocumentCommand\Tr{}{\opbraces{\Trace}}
-  \DeclareDocumentCommand\Res{}{\opbraces{\Residue}}
+  \DeclareDocumentCommand\tr{}{\opbraces{\operatorname{tr}}}
+  \DeclareDocumentCommand\Tr{}{\opbraces{\operatorname{Tr}}}
+  \DeclareDocumentCommand\Res{}{\opbraces{\operatorname{Res}}}
+  \let\Argument\Arg
+  \DeclareDocumentCommand\Arg{}{\opbraces{\operatorname{Arg}}}
+  \let\argument\arg
+  \DeclareDocumentCommand\arg{}{\opbraces{\operatorname{arg}}}
+  \let\real\Re
+  \DeclareDocumentCommand\Re{}{\opbraces{\real}}
+  \let\imaginary\Im
+  \DeclareDocumentCommand\Im{}{\opbraces{\imaginary}}
+  \DeclareDocumentCommand{\acosh}{}{\trigbraces{\operatorname{acosh}}}
+  \DeclareDocumentCommand{\acsch}{}{\trigbraces{\operatorname{acsch}}}
+  \DeclareDocumentCommand{\arccosh}{}{\trigbraces{\operatorname{arccosh}}}
+  \DeclareDocumentCommand{\arccsch}{}{\trigbraces{\operatorname{arccsch}}}
+  \DeclareDocumentCommand{\arcsech}{}{\trigbraces{\operatorname{arcsech}}}
+  \DeclareDocumentCommand{\arcsinh}{}{\trigbraces{\operatorname{arcsinh}}}
+  \DeclareDocumentCommand{\arctanh}{}{\trigbraces{\operatorname{arctanh}}}
+  \DeclareDocumentCommand{\arctantwo}{}{\trigbraces{\operatorname{arctan2}}}
+  \DeclareDocumentCommand{\asech}{}{\trigbraces{\operatorname{asech}}}
+  \DeclareDocumentCommand{\asinh}{}{\trigbraces{\operatorname{asinh}}}
+  \DeclareDocumentCommand{\atanh}{}{\trigbraces{\operatorname{atanh}}}
+  \DeclareDocumentCommand{\atantwo}{}{\trigbraces{\operatorname{atan2}}}
+  \DeclareDocumentCommand{\closure}{}{\opbraces{\operatorname{closure}}}
+  \DeclareDocumentCommand{\col}{}{\opbraces{\operatorname{col}}}
+  \DeclareDocumentCommand{\row}{}{\opbraces{\operatorname{row}}}
+  \DeclareDocumentCommand{\ker}{}{\opbraces{\operatorname{ker}}}
+  \DeclareDocumentCommand{\SD}{}{\opbraces{\operatorname{SD}}}
+  \DeclareDocumentCommand{\Var}{}{\opbraces{\operatorname{Var}}}
+  \DeclareDocumentCommand{\Mode}{}{\opbraces{\operatorname{Mode}}}
+  \DeclareDocumentCommand{\Median}{}{\opbraces{\operatorname{Median}}}
+  \DeclareDocumentCommand{\gcd}{}{\opbraces{\operatorname{gcd}}}
+  \DeclareDocumentCommand{\lcm}{}{\opbraces{\operatorname{lcm}}}
+  \DeclareDocumentCommand{\GCD}{}{\opbraces{\operatorname{GCD}}}
+  \DeclareDocumentCommand{\LCM}{}{\opbraces{\operatorname{LCM}}}
+
 \else
-  \DeclareMathOperator{\arccsc}{arccsc}
-  \DeclareMathOperator{\arcsec}{arcsec}
-  \DeclareMathOperator{\arccot}{arccot}
+  \DeclareDocumentCommand{\arccsc}{}{\operatorname{arccsc}}
+  \DeclareDocumentCommand{\arcsec}{}{\operatorname{arcsec}}
+  \DeclareDocumentCommand{\arccot}{}{\operatorname{arccot}}
+  \DeclareDocumentCommand{\asin}{}{\operatorname{asin}}
+  \DeclareDocumentCommand{\acos}{}{\operatorname{acos}}
+  \DeclareDocumentCommand{\atan}{}{\operatorname{atan}}
+  \DeclareDocumentCommand{\acsc}{}{\operatorname{acsc}}
+  \DeclareDocumentCommand{\asec}{}{\operatorname{asec}}
+  \DeclareDocumentCommand{\acot}{}{\operatorname{acot}}
 
-  \DeclareMathOperator{\asin}{asin}
-  \DeclareMathOperator{\acos}{acos}
-  \DeclareMathOperator{\atan}{atan}
-  \DeclareMathOperator{\acsc}{acsc}
-  \DeclareMathOperator{\asec}{asec}
-  \DeclareMathOperator{\acot}{acot}
-
-  \DeclareMathOperator{\csch}{csch}
-  \DeclareMathOperator{\sech}{sech}
-
-  \DeclareDocumentCommand\tr{}{\trace}
-  \DeclareDocumentCommand\Tr{}{\Trace}
-  \DeclareDocumentCommand\Res{}{\Residue}
+  \DeclareDocumentCommand{\csch}{}{\operatorname{csch}}
+  \DeclareDocumentCommand{\sech}{}{\operatorname{sech}}
 \fi
 
 % Quick quad text (math-mode text with \quad spacing)
@@ -1299,7 +1362,7 @@
       }
       \coldots = 0
     }
-    
+
     \loop
       \colcount = 0
       \advance \rowcount by 1
@@ -1451,17 +1514,4 @@
 \the\matrixtoks
 }
 \DeclareDocumentCommand\antidiagonalmatrix{O{} >{\SplitList{,}}m }{\PTadmat{#1}#2}
-\DeclareDocumentCommand\admat{}{\antidiagonalmatrix}
-
-% Misc
-\DeclareDocumentCommand\flatfrac{ m m }{\left.#1\middle\slash#2\right.}
-\DeclareDocumentCommand\homework{}{ % You can try it
-  \ensuremath{
-  \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},
-  \qq{all else follows.}
-  }
-}
\ No newline at end of file
+\DeclareDocumentCommand\admat{}{\antidiagonalmatrix}
\ No newline at end of file



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