summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/mandi/mandi.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/mandi/mandi.dtx')
-rw-r--r--macros/latex/contrib/mandi/mandi.dtx147
1 files changed, 71 insertions, 76 deletions
diff --git a/macros/latex/contrib/mandi/mandi.dtx b/macros/latex/contrib/mandi/mandi.dtx
index 3907b21e1b..d1a72ab2b2 100644
--- a/macros/latex/contrib/mandi/mandi.dtx
+++ b/macros/latex/contrib/mandi/mandi.dtx
@@ -1,7 +1,7 @@
% \iffalse meta-comment
% !TEX program = lualatexmk
%
-% Copyright (C) 2023 by Paul J. Heafner <heafnerj@gmail.com>
+% Copyright (C) 2021-2024 by Paul J. Heafner <heafnerj@gmail.com>
% ---------------------------------------------------------------------------
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License, either version 1.3c of this license or (at
@@ -181,7 +181,7 @@
% \title{The \href{https://ctan.org/pkg/mandi}{\mandi} Bundle}
% \author{^^A
% Paul J. Heafner\thanks{^^A
-% Email: \href{mailto:heafnerj@gmail.com?subject=[Heafner]\%20mandi}
+% Email: \href{mailto:heafnerj@gmail.com?subject=from mandi documentation}
% {heafnerj@gmail.com}^^A
% }^^A
% }^^A
@@ -259,6 +259,10 @@
% {\linktoplace{sec:mandia}{mandi} \linktoplace{sec:mandib}{mandistudent}
% \linktoplace{sec:mandic}{mandiexp} Source updated and bumped version for new
% \texttt{CTAN} upload}
+% \changes{v3.2.2}{2024-02-27}{\linktoplace{sec:mandia}{mandi} Removed unnecessary
+% \cs{ExplSyntaxOn} and \cs{ExplSyntaxOff} pairs}
+% \changes{v3.2.2}{2024-02-27}{\linktoplace{sec:mandia}{mandi} Ensured all
+% subscripts and superscripts are braced}
%
% \section{Introduction}
% The \mandi \footnote{The bundle name can be pronounced either with two
@@ -380,7 +384,7 @@
%<*example>
%\fi
\begin{dispExample*}{sidebyside = false}
- \( \mivector{\slot,\slot,\slot} \) or \( \mivector{p_x,p_y,p_z} \) \\
+ \( \mivector{\slot,\slot,\slot} \) or \( \mivector{p_{x},p_{y},p_{z}} \) \\
\( \direction{\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}}} \) or
\end{dispExample*}
%\iffalse
@@ -502,11 +506,11 @@
{%
doc new = 2021-02-24,%
doc name = momentumvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectormomentum,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
Command for momentum and its vector variants. The default units will depend
@@ -548,8 +552,9 @@
%
% Commands that include the name of a physical quantity typeset units, so
% they shouldn't be used for algebraic or symbolic values of components.
-% For example, one shouldn't use |\vectormomentum{mv_x,mv_y,mv_z}| but
-% instead the generic |\mivector{mv_x,mv_y,mv_z}| instead.
+% Don't use
+% |\vectormomentum{mv_{x},mv_{y},mv_{z}}| but
+% instead the generic |\mivector{mv_{x},mv_{y},mv_{z}}| instead.
%
% \subsubsection{Checking Physical Quantities}
%
@@ -587,11 +592,11 @@
{%
doc new = 2021-02-24,%
doc name = accelerationvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectoracceleration,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -608,11 +613,11 @@
{%
doc new = 2021-02-24,%
doc name = angularaccelerationvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorangularacceleration,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -629,11 +634,11 @@
{%
doc new = 2021-02-24,%
doc name = angularimpulsevector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorangularimpulse,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -647,11 +652,11 @@
{%
doc new = 2021-02-24,%
doc name = angularmomentumvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorangularmomentum,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -665,11 +670,11 @@
{%
doc new = 2021-02-24,%
doc name = angularvelocityvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorangularvelocity,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -698,11 +703,11 @@
{%
doc new = 2021-02-24,%
doc name = cmagneticfieldvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorcmagneticfield,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -728,11 +733,11 @@
{%
doc new = 2021-02-24,%
doc name = currentdensityvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorcurrentdensity,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -749,11 +754,11 @@
},%
{%
doc name = directionvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectordirection,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -767,11 +772,11 @@
{%
doc new = 2021-02-24,%
doc name = displacementvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectordisplacement,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -788,10 +793,10 @@
{%
doc new = 2021-02-24,%
doc name = electricdipolemomentvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{ doc name = vectorelectricdipolemoment,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -805,11 +810,11 @@
{%
doc new = 2021-02-24,%
doc name = electricfieldvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorelectricfield,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -853,11 +858,11 @@
{%
doc new = 2021-02-24,%
doc name = energyfluxvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorenergyflux,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -874,11 +879,11 @@
{%
doc new = 2021-02-24,%
doc name = forcevector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorforce,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -895,11 +900,11 @@
{%
doc new = 2021-02-24,%
doc name = gravitationalfieldvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorgravitationalfield,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -919,11 +924,11 @@
{%
doc new = 2021-02-24,%
doc name = impulsevector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorimpulse,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -958,11 +963,11 @@
{%
doc new = 2021-02-24,%
doc name = magneticdipolemomentvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectormagneticdipolemoment,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -976,11 +981,11 @@
{%
doc new = 2021-02-24,%
doc name = magneticfieldvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectormagneticfield,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -1008,12 +1013,12 @@
doc new = 2021-02-24,%
doc name = momentumvector,%
doc label = momentumvectordemo,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectormomentum,%
doc label = vectormomentumdemo,%
- doc parameter = \marg{\( c_1,\dots,c_n \)} },%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)} },%
}%
\end{docCommands}
\CheckQuantity{momentum}
@@ -1026,11 +1031,11 @@
{%
doc new = 2021-02-24,%
doc name = momentumfluxvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectormomentumflux,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -1062,11 +1067,11 @@
{%
doc new = 2021-02-24,%
doc name = poyntingvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorpoynting,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -1116,11 +1121,11 @@
{%
doc new = 2021-02-24,%
doc name = torquevector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectortorque,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -1134,11 +1139,11 @@
{%
doc new = 2021-02-24,%
doc name = velocityvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorvelocity,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -1152,11 +1157,11 @@
{%
doc new = 2021-02-24,%
doc name = velocitycvector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorvelocityc,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -1182,11 +1187,11 @@
{%
doc new = 2021-02-24,%
doc name = wavenumbervector,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
{%
doc name = vectorwavenumber,%
- doc parameter = \marg{\( c_1,\dots,c_n \)},%
+ doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
},%
}%
\end{docCommands}
@@ -1842,7 +1847,7 @@
\begin{dispExample}
\( \per \) \\
\( \usk \) \\
- \( \units{3}{\meter\per\second} \) \\
+ \( \units{3}{\meter\per\second} \) \\
\( \emptyunit \) \\
\( \ampere \) \\
\( \atomicmassunit \) \\
@@ -1930,7 +1935,7 @@
%<*example>
%\fi
\begin{docCommand}[doc updated = 2022-01-27]{mivector}{%
- \oarg{delimiter}\marg{\( c_1,\dots,c_n \)}\oarg{units}
+ \oarg{delimiter}\marg{\( c_{1},\dots,c_{n} \)}\oarg{units}
}%
Typesets a vector as either numeric or symbolic components with an
optional unit (for numerical components only). There must be more
@@ -1940,12 +1945,12 @@
\emph{Matter \& Interactions}.
\end{docCommand}
\begin{dispExample*}{lefthand ratio = 0.70}
- \( \mivector{p_0,p_1,p_2,p_3} \) \\
- \( \mivector{\gamma mc,\gamma mv_x,\gamma mv_y,\gamma mv_z} \) \\
- \( \mivector{\frac{Q_1Q_2}{x^2},0,0} \) \\
- \( \mivector{-1,0,0} \) \\
- \( \mivector{-1,0,0}[\velocityonlyderivedunits] \) \\
- \( \mivector{-1,0,0}[\meter\per\second] \) \\
+ \( \mivector{p_0,p_1,p_2,p_3} \) \\
+ \( \mivector{\gamma mc,\gamma mv_{x},\gamma mv_{y},\gamma mv_{z}} \) \\
+ \( \mivector{\frac{Q_1Q_2}{x^2},0,0} \) \\
+ \( \mivector{-1,0,0} \) \\
+ \( \mivector{-1,0,0}[\velocityonlyderivedunits] \) \\
+ \( \mivector{-1,0,0}[\meter\per\second] \) \\
\( \velocity{\mivector{-1,0,0}} \)
\end{dispExample*}
%\iffalse
@@ -1966,10 +1971,10 @@
% in the name) that are not for the user to know about.
%
% \begin{macrocode}
-\def\mandi@version{3.2.1}
-\def\mandi@date{2023-11-22}
+\def\mandi@version{3.2.2}
+\def\mandi@date{2024-02-27}
\NeedsTeXFormat{LaTeX2e}[2020-02-02]
-\DeclareRelease{v3.2.1}{2023-11-22}{mandi.sty}
+\DeclareRelease{v3.2.2}{2024-02-27}{mandi.sty}
\DeclareCurrentRelease{v\mandi@version}{\mandi@date}
\ProvidesPackage{mandi}
[\mandi@date\space v\mandi@version\space Macros for physical quantities]
@@ -2268,13 +2273,11 @@
{
\__mandi_newscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
}
-\ExplSyntaxOff
% \end{macrocode}
%
% Redefining an existing scalar quantity.
%
% \begin{macrocode}
-\ExplSyntaxOn
\cs_new:Npn \__mandi_renewscalarquantity:nnnn #1#2#3#4
{
\cs_set:cpn {#1} ##1 {\units{##1}{\mandi@selectunits{#2}{#3}{#4}}}
@@ -2290,13 +2293,11 @@
{
\__mandi_renewscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
}
-\ExplSyntaxOff
% \end{macrocode}
%
% Defining a new vector quantity. Note that a corresponding scalar is also defined.
%
% \begin{macrocode}
-\ExplSyntaxOn
\cs_new:Npn \__mandi_newvectorquantity:nnnn #1#2#3#4
{
\__mandi_newscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
@@ -2321,13 +2322,11 @@
{
\__mandi_newvectorquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
}
-\ExplSyntaxOff
% \end{macrocode}
%
% Redefining an existing vector quantity. Note that a corresponding scalar is also redefined.
%
% \begin{macrocode}
-\ExplSyntaxOn
\cs_new:Npn \__mandi_renewvectorquantity:nnnn #1#2#3#4
{
\__mandi_renewscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
@@ -2352,13 +2351,11 @@
{
\__mandi_renewvectorquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
}
-\ExplSyntaxOff
% \end{macrocode}
%
% Defining a new physical constant.
%
% \begin{macrocode}
-\ExplSyntaxOn
\cs_new:Npn \__mandi_newphysicalconstant:nnnnnnn #1#2#3#4#5#6#7
{
\cs_new:cpn {#1} {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}}
@@ -2379,13 +2376,11 @@
{
\__mandi_newphysicalconstant:nnnnnnn { #1 }{ #2 }{ #3 }{ #4 }{ #5 }{ #6 }{ #7 }
}
-\ExplSyntaxOff
% \end{macrocode}
%
% Redefining an existing physical constant.
%
% \begin{macrocode}
-\ExplSyntaxOn
\cs_new:Npn \__mandi_renewphysicalconstant:nnnnnnn #1#2#3#4#5#6#7
{
\cs_set:cpn {#1} {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}}