summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp-physics.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-05-12 21:22:49 +0000
committerKarl Berry <karl@freefriends.org>2020-05-12 21:22:49 +0000
commitf36c8d17d5eb18410042dd433a2c9899cb7a3db9 (patch)
tree5a4c62c6e9f29f27de129691ba28e86dd80213cf /Master/texmf-dist/tex/latex/lwarp/lwarp-physics.sty
parent783e8cfca1f7216ca1a10889772733d0eb8b902f (diff)
lwarp (12may20)
git-svn-id: svn://tug.org/texlive/trunk@55122 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-physics.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp-physics.sty258
1 files changed, 214 insertions, 44 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-physics.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-physics.sty
index 262cb356ea2..b86ac7f589c 100644
--- a/Master/texmf-dist/tex/latex/lwarp/lwarp-physics.sty
+++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-physics.sty
@@ -26,36 +26,78 @@
\CustomizeMathJax{\newcommand{\vqty}[1]{\left\vert#1\right\rvert}}
\CustomizeMathJax{\newcommand{\Bqty}[1]{\left\lbrace#1\right\rbrace}}
-\CustomizeMathJax{\newcommand{\absolutevalue}[1]{\left\lvert#1\right\rvert}}
+\CustomizeMathJax{\newcommand{\LWRabsolutevaluenostar}[1]{\left\lvert#1\right\rvert}}
+\CustomizeMathJax{\newcommand{\LWRabsolutevaluestar}[1]{\lvert#1\rvert}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\absolutevalue}{\LWRabsolutevaluestar}{\LWRabsolutevaluenostar}%
+}
+
\CustomizeMathJax{\let\abs\absolutevalue}
-\CustomizeMathJax{\newcommand{\norm}[1]{%
- \left\lvert\left\lvert#1\right\rvert\right\rvert}%
+\CustomizeMathJax{%
+ \newcommand{\LWRnormnostar}[1]{\left\lvert\left\lvert#1\right\rvert\right\rvert}%
+}
+\CustomizeMathJax{\newcommand{\LWRnormstar}[1]{\lvert\lvert#1\rvert\rvert}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\norm}{\LWRnormstar}{\LWRnormnostar}%
+}
+
+\CustomizeMathJax{\newcommand{\LWRevaluatednostar}[1]{\left . #1\right\vert}}
+\CustomizeMathJax{\newcommand{\LWRevaluatedstar}[1]{#1\vert}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\evaluated}{\LWRevaluatedstar}{\LWRevaluatednostar}%
}
-\CustomizeMathJax{\newcommand{\evaluated}[1]{#1\vert}}
\CustomizeMathJax{\let\eval\evaluated}
-\CustomizeMathJax{\newcommand{\order}[1]{\mathcal{O}\left(#1\right)}}
+\CustomizeMathJax{\newcommand{\LWRordernostar}[1]{\mathcal{O}\left(#1\right)}}
+\CustomizeMathJax{\newcommand{\LWRorderstar}[1]{\mathcal{O}(#1)}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\order}{\LWRorderstar}{\LWRordernostar}%
+}
+
+\CustomizeMathJax{\newcommand{\LWRcommutatornostar}[2]{\left\lbrack#1,#2\right\rbrack}}
+\CustomizeMathJax{\newcommand{\LWRcommutatorstar}[2]{\lbrack#1,#2\rbrack}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\commutator}{\LWRcommutatorstar}{\LWRcommutatornostar}%
+}
-\CustomizeMathJax{\newcommand{\commutator}[2]{\left\lbrack#1,#2\right\rbrack}}
\CustomizeMathJax{\let\comm\commutator}
-\CustomizeMathJax{\newcommand{\anticommutator}[2]{%
+\CustomizeMathJax{\newcommand{\LWRanticommutatornostar}[2]{%
\left\lbrace#1,#2\right\rbrace}%
}
+\CustomizeMathJax{\newcommand{\LWRanticommutatorstar}[2]{%
+ \lbrace#1,#2\rbrace}%
+}
+\CustomizeMathJax{%
+ \DeclareIfstar{\anticommutator}{\LWRanticommutatorstar}{\LWRanticommutatornostar}%
+}
+
\CustomizeMathJax{\let\acomm\anticommutator}
\CustomizeMathJax{\let\poissonbracket\anticommutator}
\CustomizeMathJax{\let\pb\anticommutator}
-\CustomizeMathJax{\newcommand{\vectorbold}[1]{\mathbf{#1}}}
+\CustomizeMathJax{\newcommand{\LWRvectorboldnostar}[1]{\mathbf{#1}}}
+\CustomizeMathJax{\newcommand{\LWRvectorboldstar}[1]{\pmb{#1}}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\vectorbold}{\LWRvectorboldstar}{\LWRvectorboldnostar}%
+}
\CustomizeMathJax{\let\vb\vectorbold}
-\CustomizeMathJax{\newcommand{\vectorarrow}[1]{\vec{\mathbf{#1}}}}
+\CustomizeMathJax{\newcommand{\LWRvectorarrownostar}[1]{\vec{\mathbf{#1}}}}
+\CustomizeMathJax{\newcommand{\LWRvectorarrowstar}[1]{\vec{\pmb{#1}}}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\vectorarrow}{\LWRvectorarrowstar}{\LWRvectorarrownostar}%
+}
\CustomizeMathJax{\let\va\vectorarrow}
-\CustomizeMathJax{\newcommand{\vectorunit}[1]{\mathbf{\hat{#1}}}}
+\CustomizeMathJax{\newcommand{\LWRvectorunitnostar}[1]{\mathbf{\hat{#1}}}}
+\CustomizeMathJax{\newcommand{\LWRvectorunitstar}[1]{\pmb{\hat{#1}}}}
+\CustomizeMathJax{%
+ \DeclareIfstar{\vectorunit}{\LWRvectorunitstar}{\LWRvectorunitnostar}%
+}
\CustomizeMathJax{\let\va\vectorunit}
\CustomizeMathJax{\newcommand{\dotproduct}{\boldsymbol\cdot}}
@@ -153,82 +195,209 @@
\CustomizeMathJax{\newcommand{\Re}[1]{\mathrm{Re}\left\lbrace#1\right\rbrace}}
\CustomizeMathJax{\newcommand{\Im}[1]{\mathrm{Im}\left\lbrace#1\right\rbrace}}
-\CustomizeMathJax{\newcommand{\qqtext}[1]{\quad\mathrm{#1}\quad}}
+\CustomizeMathJax{\newcommand{\LWRqqtextnostar}[1]{\quad\mathrm{#1}\quad}}
+\CustomizeMathJax{\newcommand{\LWRqqtextstar}[1]{\mathrm{#1}\quad}}
+\CustomizeMathJax{\DeclareIfstar{\qqtext}{\LWRqqtextstar}{\LWRqqtextnostar}}
\CustomizeMathJax{\let\qq\qqtext}
+
\CustomizeMathJax{\newcommand{\qqcomma}{\text{,}\quad}}
\CustomizeMathJax{\let\qc\qqcomma}
-\CustomizeMathJax{\newcommand{\qcc}{\quad\text{c.c.}\quad}}
-\CustomizeMathJax{\let\qcc}
-\CustomizeMathJax{\newcommand{\qif}{\quad\text{if}\quad}}
-\CustomizeMathJax{\newcommand{\qthen}{\quad\text{then}\quad}}
-\CustomizeMathJax{\newcommand{\qelse}{\quad\text{else}\quad}}
-\CustomizeMathJax{\newcommand{\qotherwise}{\quad\text{otherwise}\quad}}
-\CustomizeMathJax{\newcommand{\qunless}{\quad\text{unless}\quad}}
-\CustomizeMathJax{\newcommand{\qgiven}{\quad\text{given}\quad}}
-\CustomizeMathJax{\newcommand{\qusing}{\quad\text{using}\quad}}
-\CustomizeMathJax{\newcommand{\qassume}{\quad\text{assume}\quad}}
-\CustomizeMathJax{\newcommand{\qsince}{\quad\text{since}\quad}}
-\CustomizeMathJax{\newcommand{\qlet}{\quad\text{let}\quad}}
-\CustomizeMathJax{\newcommand{\qfor}{\quad\text{for}\quad}}
-\CustomizeMathJax{\newcommand{\qall}{\quad\text{all}\quad}}
-\CustomizeMathJax{\newcommand{\qeven}{\quad\text{even}\quad}}
-\CustomizeMathJax{\newcommand{\qodd}{\quad\text{odd}\quad}}
-\CustomizeMathJax{\newcommand{\qinteger}{\quad\text{integer}\quad}}
-\CustomizeMathJax{\newcommand{\qand}{\quad\text{and}\quad}}
-\CustomizeMathJax{\newcommand{\qor}{\quad\text{or}\quad}}
-\CustomizeMathJax{\newcommand{\qas}{\quad\text{as}\quad}}
-\CustomizeMathJax{\newcommand{\qin}{\quad\text{in}\quad}}
+
+\newcommand*{\LWR@physics@qtext}[2]{%
+ \appto\LWR@customizedMathJax{\LWRbackslash(}
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}newcommand\{\LWRbackslash{}LWR\macrotocsname{#1}subnostar\}%
+ }%
+ \appto\LWR@customizedMathJax{\{}%
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}quad\LWRbackslash{}text\{#2\}\LWRbackslash{}quad%
+ }%
+ \appto\LWR@customizedMathJax{\}}%
+ \appto\LWR@customizedMathJax{\LWRbackslash)\par}%
+ \appto\LWR@customizedMathJax{\LWRbackslash(}
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}newcommand\{\LWRbackslash{}LWR\macrotocsname{#1}substar\}%
+ }%
+ \appto\LWR@customizedMathJax{\{}%
+ \appto\LWR@customizedMathJax{\LWRbackslash{}text\{#2\}\LWRbackslash{}quad}%
+ \appto\LWR@customizedMathJax{\}}%
+ \appto\LWR@customizedMathJax{\LWRbackslash)\par}%
+ \appto\LWR@customizedMathJax{\LWRbackslash(}
+ \appto\LWR@customizedMathJax{%
+ \LWRbackslash{}DeclareIfstar\{\LWRbackslash\macrotocsname{#1}\}%
+ }%
+ \appto\LWR@customizedMathJax{\{}%
+ \appto\LWR@customizedMathJax{\LWRbackslash{}LWR\macrotocsname{#1}substar\}}%
+ \appto\LWR@customizedMathJax{\LWRbackslash{}LWR\macrotocsname{#1}subnostar\}}%
+ \appto\LWR@customizedMathJax{\LWRbackslash)\par}%
+}
+
+\LWR@physics@qtext{\qcc}{c.c.}
+\LWR@physics@qtext{\qif}{if}
+\LWR@physics@qtext{\qthen}{then}
+\LWR@physics@qtext{\qelse}{else}
+\LWR@physics@qtext{\qotherwise}{otherwise}
+\LWR@physics@qtext{\qunless}{unless}
+\LWR@physics@qtext{\qgiven}{given}
+\LWR@physics@qtext{\qusing}{using}
+\LWR@physics@qtext{\qassume}{assume}
+\LWR@physics@qtext{\qsince}{since}
+\LWR@physics@qtext{\qlet}{let}
+\LWR@physics@qtext{\qfor}{for}
+\LWR@physics@qtext{\qall}{all}
+\LWR@physics@qtext{\qeven}{even}
+\LWR@physics@qtext{\qodd}{odd}
+\LWR@physics@qtext{\qinteger}{integer}
+\LWR@physics@qtext{\qand}{and}
+\LWR@physics@qtext{\qor}{or}
+\LWR@physics@qtext{\qas}{as}
+\LWR@physics@qtext{\qin}{in}
\CustomizeMathJax{\newcommand{\differential}[1][]{\text{d}^{#1}}}
\CustomizeMathJax{\let\dd\differential}
-\CustomizeMathJax{\newcommand{\derivative}[3][]{%
+\CustomizeMathJax{\newcommand{\LWRderivativenostar}[3][]{%
\frac{\text{d}^{#1}#2}{\text{d}#3^{#1}}}%
}
+\CustomizeMathJax{\newcommand{\LWRderivativestar}[3][]{%
+ {\text{d}^{#1}#2}/{\text{d}#3^{#1}}}%
+}
+\CustomizeMathJax{%
+ \DeclareIfstar{\derivative}{\LWRderivativestar}{\LWRderivativenostar}%
+}
+
\CustomizeMathJax{\let\dv\derivative}
-\CustomizeMathJax{\newcommand{\partialderivative}[3][]{%
+\CustomizeMathJax{\newcommand{\LWRpartialderivativenostar}[3][]{%
\frac{\partial^{#1}#2}{\partial#3^{#1}}}%
}
+\CustomizeMathJax{\newcommand{\LWRpartialderivativestar}[3][]{%
+ {\partial^{#1}#2}/{\partial#3^{#1}}}%
+}
+\CustomizeMathJax{%
+ \DeclareIfstar{\partialderivative}%
+ {\LWRpartialderivativestar}{\LWRpartialderivativenostar}
+}
+
\CustomizeMathJax{\let\pderivative\partialderivative}
\CustomizeMathJax{\let\pdv\partialderivative}
\CustomizeMathJax{\newcommand{\variation}{\delta}}
\CustomizeMathJax{\let\var\variation}
-\CustomizeMathJax{\newcommand{\functionalderivative}[3][]{%
+\CustomizeMathJax{\newcommand{\LWRfunctionalderivativenostar}[3][]{%
\frac{\delta^{#1}#2}{\delta#3^{#1}}}%
}
+\CustomizeMathJax{\newcommand{\LWRfunctionalderivativestar}[3][]{%
+ {\delta^{#1}#2}/{\delta#3^{#1}}}%
+}
+\CustomizeMathJax{%
+ \DeclareIfstar{\functionalderivative}
+ {\LWRfunctionalderivativestar}{\LWRfunctionalderivativenostar}
+}
\CustomizeMathJax{\let\fdv\functionalderivative}
-\CustomizeMathJax{\newcommand{\bra}[1]{\langle{#1}\rvert}}
-\CustomizeMathJax{\newcommand{\ket}[1]{\lvert{#1}\rangle}}
+\CustomizeMathJax{\newcommand{\LWRbranostar}[1]{\left\langle{#1}\right\rvert}}
+\CustomizeMathJax{\newcommand{\LWRbrastar}[1]{\langle{#1}\rvert}}
+\CustomizeMathJax{\DeclareIfstar{\bra}{\LWRbrastar}{\LWRbranostar}}
-\CustomizeMathJax{\newcommand{\innerproduct}[2]{%
+\CustomizeMathJax{\newcommand{\LWRketnostar}[1]{\left\lvert{#1}\right\rangle}}
+\CustomizeMathJax{\newcommand{\LWRketstar}[1]{\lvert{#1}\rangle}}
+\CustomizeMathJax{\DeclareIfstar{\ket}{\LWRketstar}{\LWRketnostar}}
+
+\CustomizeMathJax{\newcommand{\LWRinnerproductnostar}[2]{%
\left\langle{#1}\middle\vert{#2}\right\rangle}%
}
+\CustomizeMathJax{\newcommand{\LWRinnerproductstar}[2]{%
+ \langle{#1}\vert{#2}\rangle}%
+}
+\CustomizeMathJax{%
+ \DeclareIfstar{\innerproduct}
+ {\LWRinnerproductstar}{\LWRinnerproductnostar}
+}
+
\CustomizeMathJax{\let\braket\innerproduct}
\CustomizeMathJax{\let\ip\innerproduct}
-\CustomizeMathJax{\newcommand{\outerproduct}[2]{%
+\CustomizeMathJax{\newcommand{\LWRouterproductnostar}[2]{%
\left\lvert{#1}\middle\rangle\!\middle\langle#2\right\rvert}%
}
+\CustomizeMathJax{\newcommand{\LWRouterproductstar}[2]{%
+ \lvert{#1}\rangle\!\langle#2\rvert}%
+}
+\CustomizeMathJax{%
+ \DeclareIfstar{\outerproduct}
+ {\LWRouterproductstar}{\LWRouterproductnostar}
+}
+
\CustomizeMathJax{\let\dyad\outerproduct}
\CustomizeMathJax{\let\op\outerproduct}
-\CustomizeMathJax{\newcommand{\expectationvalue}[2]{%
- \left\langle{#2}\middle\vert{#1}\middle\vert{#2}\right\rangle}%
+\CustomizeMathJax{%
+ \newcommand{\LWRexpectationvaluenostar}[2]{%
+ \vphantom{#1}%
+ \left\langle{#2}\middle\vert\smash{#1}\middle\vert{#2}%
+ \right\rangle%
+ }%
+}
+\CustomizeMathJax{%
+ \newcommand{\LWRexpectationvaluestar}[2]{%
+ \vphantom{#1#2}%
+ \left\langle\smash{#2}%
+ \middle\vert\smash{#1}\middle\vert\smash{#2}%
+ \right\rangle%
+ }%
}
+\CustomizeMathJax{%
+ \newcommand{\LWRexpectationvaluedoublestar}[2]{%
+ \left\langle{#2}\middle\vert{#1}\middle\vert{#2}\right\rangle%
+ }%
+}
+\CustomizeMathJax{% second star
+ \DeclareIfstar{\LWRsubexpectationvalue}
+ {\LWRexpectationvaluedoublestar}{\LWRexpectationvaluestar}
+}
+\CustomizeMathJax{% first star
+ \DeclareIfstar{\expectationvalue}
+ {\LWRsubexpectationvalue}{\LWRexpectationvaluenostar}
+}
+
\CustomizeMathJax{\let\expval\expectationvalue}
\CustomizeMathJax{\let\ev\expectationvalue}
-\CustomizeMathJax{\newcommand{\matrixelement}[3]{%
- \left\langle{#1}\middle\vert{#2}\middle\vert{#3}\right\rangle}%
+\CustomizeMathJax{%
+ \newcommand{\LWRmatrixelementnostar}[3]{%
+ \vphantom{#2}\left\langle{#1}\middle\vert\smash{#2}\middle\vert{#3}\right\rangle%
+ }%
+}
+\CustomizeMathJax{%
+ \newcommand{\LWRmatrixelementstar}[3]{%
+ \vphantom{#1#2#3}%
+ \left\langle\smash{#1}%
+ \middle\vert\smash{#2}\middle\vert\smash{#3}%
+ \right\rangle%
+ }%
+}
+\CustomizeMathJax{%
+ \newcommand{\LWRmatrixelementdoublestar}[3]{%
+ \left\langle{#1}\middle\vert{#2}\middle\vert{#3}\right\rangle%
+ }%
}
+\CustomizeMathJax{% second star
+ \DeclareIfstar{\LWRsubmatrixelement}
+ {\LWRmatrixelementdoublestar}{\LWRmatrixelementstar}
+}
+
+\CustomizeMathJax{% first star
+ \DeclareIfstar{\matrixelement}
+ {\LWRsubmatrixelement}{\LWRmatrixelementnostar}
+}
+
\CustomizeMathJax{\let\mel\matrixelement}
\CustomizeMathJax{\newcommand{\matrixquantity}[1]{\begin{matrix}#1\end{matrix}}}
\CustomizeMathJax{\let\mqty\matrixquantity}
+
\CustomizeMathJax{\newcommand{\pmqty}[1]{\begin{pmatrix}#1\end{pmatrix}}}
\CustomizeMathJax{\newcommand{\Pmqty}[1]{%
\left\lgroup\begin{matrix}#1\end{matrix}\right\rgroup}%
@@ -260,7 +429,8 @@
\CustomizeMathJax{\newcommand{\identitymatrix}[1]{(\text{imat}\{#1\})}}
\CustomizeMathJax{\let\imat\identitymatrix}
-\CustomizeMathJax{\newcommand{\xmatrix}[3]{(\text{xmat}\{\}\{#2\}\{#3\})}}
+\CustomizeMathJax{\newcommand{\LWRxmatrix}[3]{(\text{xmat}\{\}\{#2\}\{#3\})}}
+\CustomizeMathJax{\DeclareIfstar{\xmatrix}{\LWRxmatrix}{\LWRxmatrix}}
\CustomizeMathJax{\let\xmat\xmatrix}
\CustomizeMathJax{\newcommand{\zeromatrix}[2]{(\text{zmat}\{#1\}\{#2\})}}