Debian Codegraph @

texmf-dist/source/latex/mandi/mandi.dtx

raw
1 % \iffalse meta-comment
2 % !TEX program = lualatexmk
3 %
4 % Copyright (C) 2021-2024 by Paul J. Heafner <[email protected]>
5 % ---------------------------------------------------------------------------
6 % This work may be distributed and/or modified under the conditions of the
7 % LaTeX Project Public License, either version 1.3c of this license or (at
8 % your option) any later version. The latest version of this license is in
9 % https://www.latex-project.org/lppl.txt
10 % and version 1.3c or later is part of all distributions of LaTeX version
11 % 2005/12/01 or later.
12 %
13 % This work has the LPPL maintenance status `maintained'.
14 %
15 % The Current Maintainer of this work is Paul J. Heafner.
16 %
17 % This work consists of the files mandi.dtx
18 % mandistudent.dtx
19 % mandiexp.dtx
20 % mandi.ins
21 % mandi.pdf
22 % README.md
23 %
24 % and includes the derived files mandi.sty
25 % mandistudent.sty
26 % mandiexp.sty
27 % vdemo.py (not needed)
28 % ---------------------------------------------------------------------------
29 %
30 %<*internal>
31 \iffalse
32 %</internal>
33 %
34 %<*internal>
35 \fi
36 \def\nameofplainTeX{plain}
37 \ifx\fmtname\nameofplainTeX\else
38 \expandafter\begingroup
39 \fi
40 %</internal>
41 %
42 %<*internal>
43 \ifx\fmtname\nameofplainTeX
44 \expandafter\endbatchfile
45 \else
46 \expandafter\endgroup
47 \fi
48 %</internal>
49 %
50 %<*driver>
51 \ProvidesFile{mandi.dtx}
52 % As of 2021-12-02 ltxdoc.cls picks up ltxdoc.cfg and sets
53 % the default paper size to a4paper rather than letter.
54 % This can be changed in a local ltxdoc.cfg file but it is
55 % easier to just use the article class and the doc package
56 % instead and force letterpaper size.
57 %\documentclass[10pt,letterpaper]{ltxdoc}
58 %\SetupDoc{reportchangedates}
59 \documentclass[10pt,letterpaper]{article}
60 \usepackage[reportchangedates]{doc} % THIS SUDDENLY WORKS!
61 %\usepackage{hypdoc} % THIS ALSO WORKS!
62 \PassOptionsToPackage{listings,documentation}{tcolorbox} % prevent option clash
63 \usepackage{\jobname} % load mandi.sty
64 \usepackage{mandistudent} % load mandistudent.sty
65 \usepackage{mandiexp} % load mandiexp.sty
66 \usepackage{mwe} % provides test images
67 \usepackage[left = 1.00in,% %
68 right = 1.00in,% %
69 marginparwidth = 0.70in]{geometry} % main documentation
70 \usepackage[listings,documentation]{tcolorbox} % workhorse package
71 \tcbset{% % tcolorbox options
72 index german settings,%
73 index gather commands = false,%
74 index colorize = false,%
75 lefthand ratio = 0.50,%
76 color hyperlink = blue,%
77 color command = purple,%
78 color environment = purple!65!black,%
79 doc left = 0.5in,%
80 doc marginnote = {colframe = blue!50!white,colback = blue!5!white},%
81 doc head command = {interior style = {fill,left color = blue!15!white}},%
82 doc head environment = {interior style = {fill,left color = blue!15!white}},%
83 doc head key = {interior style = {fill,left color = blue!15!white}},%
84 docexample/.style = {%
85 colback = gray!10!white,sidebyside,lefthand ratio = 0.5,center},%
86 listing style = vpython,%
87 }%
88
89 % See https://tex.stackexchange.com/q/156383/218142
90 \newcommand*{\pkg}[1]{\textsf{#1}} % typeset package names
91 \newcommand*{\mandi}{\textsf{mandi}} % typeset mandi
92 \newcommand*{\mandistudent}{\textsf{mandistudent}} % typeset mandistudent
93 \newcommand*{\mandiexp}{\textsf{mandiexp}} % typeset mandiexp
94 \newcommand*{\WebVPython}{\texttt{Web VPython}} % typeset Web VPython
95 \newcommand*{\WebVPythonorg}{\texttt{WebVPython.org}} % typeset WebVPython.org
96 \newcommand*{\VPython}{\texttt{VPython}} % typeset VPython
97 \newcommand*{\VPythonorg}{\texttt{VPython.org}} % typeset VPython.org
98 \newcommand*{\gsurl}{webvpython.org} % Web VPython URL
99 \newcommand*{\vpurl}{vpython.org} % VPython URL
100 \newcommand*{\lualatex}{Lua\LaTeX} % typeset LuaLaTeX
101
102 %%%%% Some local hacks to make things better.
103 % Redefine tcolorbox's \tcbdocnew and \tcbdocupdated defaults.
104 \renewcommand*{\tcbdocnew}[1]
105 {\textcolor{green!50!black}{\sffamily\bfseries N} #1}
106 \renewcommand*{\tcbdocupdated}[1]
107 {\textcolor{blue!75!black}{\sffamily\bfseries U} #1}
108 \hypersetup{colorlinks=true} % colored links; no borders
109
110 % A customized internal hyperref tool to mimic that in tcolorbox.
111 % In fact, I borrowed it from tcolorbox.
112 \NewDocumentCommand{\setplace}{ s m }%
113 {%
114 \IfBooleanTF {#1}%
115 {\phantomsection}%
116 {}%
117 \label{#2}%
118 }%
119 \NewDocumentCommand{\linktoplace}{ m m }%
120 {%
121 \hyperref[#1]{\texttt{#2}%
122 \ifnum\getpagerefnumber{#1}=\thepage\relax%
123 \else%
124 %\textsuperscript{\ding{213}\,{P.}\,\pageref*{#1}}%
125 % Changed with tcolorbox 4.51
126 \textsuperscript{{\fontfamily{pzd}\fontencoding{U}\fontseries{m}\fontshape{n}\selectfont\char213}
127 \,{P.}\,\pageref*{#1}}%
128 \fi%
129 }%
130 }%
131
132 % We need a new command for in-line listings to prevent overfull boxes.
133 % Anything in |...| will be in small plain text.
134 % Previously used !...! but that conflicts with colors.
135 \lstMakeShortInline[basicstyle=\normalfont\ttfamily\small]|
136
137 \DisableCrossrefs % index descriptions only
138 \PageIndex % index refers to page numbers
139 \CodelineNumbered % number source lines
140 \RecordChanges % record changes
141 \begin{document} % main document
142 \DocInput{\jobname.dtx} %
143 \setcounter{CodelineNo}{0} % reset line numbers if desired
144 \DocInput{\jobname student.dtx} %
145 \setcounter{CodelineNo}{0} % reset line numbers if desired
146 \DocInput{\jobname exp.dtx} %
147 \phantomsection\addcontentsline{toc}{section}{Index}\PrintIndex%
148 \end{document} % end main document
149 %</driver>
150 % \fi
151 %
152 % ^^A Put unnumbered Index entry in TOC
153 % \IndexPrologue{\section*{Index}Page numbers refer to page where the
154 % corresponding entry is documented and/or referenced.\vspace{\baselineskip}}
155 %
156 % ^^A Local hack to Change History to remove `General:`
157 % ^^A See https://tex.stackexchange.com/a/283894/218142
158 % \makeatletter
159 % \renewcommand{\generalname}{}
160 % \renewcommand{\changes@}[3]{%
161 % \protected@edef\@tempa{\noexpand\glossary{#1%
162 % \ifdoc@reportchangedates%
163 % \space -- #2\fi%
164 % \levelchar%
165 % \ifx\saved@macroname\@empty%
166 % \quotechar!%
167 % \actualchar%
168 % \generalname%
169 % \else%
170 % \saved@indexname%
171 % \actualchar%
172 % \string\verb% % to fool emacs highlighting
173 % \quotechar*%
174 % \verbatimchar\saved@macroname%
175 % \verbatimchar%
176 % \fi%
177 % #3}}%
178 % \@tempa\endgroup\@esphack}%
179 % \makeatother
180 %
181 % \title{The \href{https://ctan.org/pkg/mandi}{\mandi} Bundle}
182 % \author{^^A
183 % Paul J. Heafner\thanks{^^A
184 % Email: \href{mailto:[email protected]?subject=from mandi documentation}
185 % {[email protected]}^^A
186 % }^^A
187 % }^^A
188 % \date{Printed \today}
189 %
190 % \newgeometry{left=1.0in,right=1.0in,top=4.0in}
191 % \maketitle
192 % \thispagestyle{empty}
193 % \centerline{\mandi{} version \mandiversion}
194 % \centerline{\mandistudent{} version \mandistudentversion}
195 % \centerline{\mandiexp{} version \mandiexpversion}
196 % ^^A\centerline{\textbf{PLEASE DO NOT DISTRIBUTE THIS BUILD.}}
197 % \restoregeometry
198 %
199 % \newgeometry{left=1.0in,right=1.0in,top=0.5in,bottom=1.0in}
200 % \tableofcontents
201 % \newpage
202 % \phantomsection
203 % \addcontentsline{toc}{section}{Acknowledgements}
204 % \section*{Acknowledgements}
205 % To all of the students who have learned \LaTeXe{} in my introductory
206 % physics courses over the years, I say a heartfelt thank you. You
207 % have contributed directly to the state of this software and to its
208 % use in introductory physics courses and to innovating how physics
209 % is taught.
210 %
211 % I also acknowledge the \LaTeXe{} developers who inhabit the
212 % \href{https://tex.stackexchange.com/}{\TeX{} StackExchange} site.
213 % Entering a new culture is daunting for anyone, especially for
214 % newcomers; the \LaTeXe{} development culture is no exception. We all
215 % share a passion for creating beautiful documents and I learned
216 % much over the summers of 2020 and 2021 that improved my ability to
217 % do just that. There are too many of you to list individually, and I
218 % would surely accidentally omit some were I to try. Collectively, I
219 % thank you all for your patience and advice.
220 % \newpage
221 % \phantomsection
222 % \addcontentsline{toc}{section}{Change History}
223 % \PrintChanges
224 % \newpage
225 % \phantomsection
226 % \addcontentsline{toc}{section}{List of \texttt{Web VPython} Programs}
227 % \listofwebvpythonprograms
228 % \phantomsection
229 % \addcontentsline{toc}{section}{List of \texttt{VPython} Programs}
230 % \listofvpythonprograms
231 % \phantomsection
232 % \addcontentsline{toc}{section}{List of Figures}
233 % \listoffigures
234 % \restoregeometry
235 %
236 % \changes{v3.0.0}{2021-08-22}
237 % {\linktoplace{sec:mandia}{mandi} \linktoplace{sec:mandib}{mandistudent}
238 % \linktoplace{sec:mandic}{mandiexp} Initial release}
239 % \changes{v3.0.1}{2021-08-24}
240 % {\linktoplace{sec:mandia}{mandi} \linktoplace{sec:mandib}{mandistudent}
241 % \linktoplace{sec:mandic}{mandiexp}Minor doc changes}
242 % \changes{v3.1.0}{2022-01-27}
243 % {\linktoplace{sec:mandia}{mandi} \linktoplace{sec:mandib}{mandistudent}
244 % \linktoplace{sec:mandic}{mandiexp} Code formatted for better readability}
245 % \changes{v3.1.0}{2022-01-27}
246 % {\linktoplace{sec:mandia}{mandi} \linktoplace{sec:mandib}{mandistudent}
247 % \linktoplace{sec:mandic}{mandiexp} \pkg{xparse} is loaded for older formats}
248 % \changes{v3.1.0}{2022-01-27}
249 % {\linktoplace{sec:mandia}{mandi} \linktoplace{sec:mandib}{mandistudent}
250 % \LaTeX3 code now conforms to formatting standards}
251 % \changes{v3.2.0}{2023-08-01}
252 % {\linktoplace{sec:mandia}{mandi} \linktoplace{sec:mandib}{mandistudent}
253 % \linktoplace{sec:mandic}{mandiexp} Source updated}
254 % \changes{v3.2.1}{2023-11-22}{Improved \texttt{README.md} at request of \texttt{CTAN}
255 % maintainer}
256 % \changes{v3.2.1}{2023-11-22}{\linktoplace{sec:mandia}{mandi} Minor changes to
257 % \texttt{mandi.ins} inside \texttt{mandi.dtx}}
258 % \changes{v3.2.1}{2023-11-22}
259 % {\linktoplace{sec:mandia}{mandi} \linktoplace{sec:mandib}{mandistudent}
260 % \linktoplace{sec:mandic}{mandiexp} Source updated and bumped version for new
261 % \texttt{CTAN} upload}
262 % \changes{v3.2.2}{2024-02-27}{\linktoplace{sec:mandia}{mandi} Removed unnecessary
263 % \cs{ExplSyntaxOn} and \cs{ExplSyntaxOff} pairs}
264 % \changes{v3.2.2}{2024-02-27}{\linktoplace{sec:mandia}{mandi} Ensured all
265 % subscripts and superscripts are braced}
266 %
267 % \section{Introduction}
268 % The \mandi \footnote{The bundle name can be pronounced either with two
269 % syllables, to rhyme with \emph{candy}, or with three syllables, as
270 % \emph{M and I}.} bundle consists of three packages: \mandi, \mandistudent,
271 % and \mandiexp. Package \linktoplace{sec:mandia}{mandi} provides the
272 % core functionality, namely correctly typesetting physical quantities
273 % and constants with their correct SI units as either scalars or vectors,
274 % depending on which is appropriate. Package
275 % \linktoplace{sec:mandib}{mandistudent} provides other typesetting
276 % capability appropriate for written problem solutions. Finally, package
277 % \linktoplace{sec:mandic}{mandiexp} provides commands for typesetting
278 % expressions from \emph{Matter \& Interactions}\footnote{See
279 % \href{https://www.wiley.com/en-us/Matter+and+Interactions%2C+4th+Edition-p-9781118875865}
280 % {\emph{Matter \& Interactions}} and
281 % \url{https://matterandinteractions.org/} for details.}
282 %
283 % So many changes have been made that I think the best approach for all
284 % users is to treat this as a brand new experience. I think the most
285 % important thing to keep in mind is that I assume all users will have a
286 % relatively recent \TeX\ distribution (like \TeX~Live) that includes an
287 % updated kernel. If users report that this is a major problem, I can provide
288 % some degree of backwards compatibility. However, I use a fully updated
289 % \TeX~Live distribution.
290 %
291 % \section{Getting Help}
292 % If you have a question about \mandi, first please read this documentation to make
293 % sure your question is not addressed here. Then if you wish, email me. As a user,
294 % you deserve courteous and timely help if you need it. You will never get a
295 % response from me saying that because this software is free you are not entitled
296 % to help using it. It is sad that some developers take that attitude. Using free
297 % software does not absolve the developer of helping users unless the license
298 % specifically says so.
299 %
300 % \changes{v3.1.0}{2022-01-27}
301 % {\linktoplace{sec:mandia}{mandi} Added GitHub links to code}
302 % \section{Code Availability}
303 % The \mandi{} source repository's \texttt{main} branch is at
304 % \url{https://github.com/heafnerj/mandi}. This code will usually coincide
305 % with that found on \href{https://ctan.org/pkg/mandi}{CTAN}. The very latest
306 % build can be found on the \texttt{dev} branch found at
307 % \url{https://github.com/heafnerj/mandi/tree/dev}. Students and other academic
308 % academic users should probably get the \texttt{dev} branch code since it is
309 % stable and may contain improvements over the \texttt{main} branch code.
310 %
311 % \changes{v3.2.0}{2023-08-01}
312 % {\linktoplace{sec:mandib}{mandistudent} Added statement about \textsc{beamer}
313 % compatibility}
314 % \section{Compatibility with Other Packages and Classes}
315 % When using \textsc{beamer}, certain commands in the \mandistudent{} package
316 % are not defined. Because \textsc{beamer} uses the \pkg{enumitem} package,
317 % the \refEnv{physicsproblem} and \refEnv{physicsproblem*} environments are not
318 % defined. The \refCom{hilite} command is also not defined because it does not
319 % work and I do not currently know why.
320 %
321 % \newpage
322 % \section{Student/Instructor Quick Guide}
323 % Use \refCom{vec} to typeset the symbol for a vector. Use \refCom{magnitude}
324 % to typeset the symbol for a vector's magnitude. Use \refCom{dirvec} to
325 % typeset the symbol for a vector's direction. Use \refCom{changein} to
326 % typeset the symbol for the change in a vector or scalar. Use
327 % \refCom{zerovec} to typeset the zero vector. Use \refCom{timestento} to
328 % typeset scientific notation.
329 %
330 %\iffalse
331 %<*example>
332 %\fi
333 \begin{dispExample*}{lefthand ratio = 0.80}
334 \( \vec{p} \) or \( \vec*{p} \) \\
335 \( \vec{p}_{\symup{final}} \) or \( \vec*{p}_{\symup{final}} \) \\
336 \( \magnitude{\vec{p}} \) or \( \magnitude*{\vec{p}_{\symup{final}}} \) \\
337 \( \dirvec{p} \) or \( \dirvec*{p} \) \\
338 \( \changein \vec{p} \) or \( \changein t \) \\
339 \( \zerovec \) or \( \zerovec* \) \\
340 \( 6.02\timestento{-19} \)
341 \end{dispExample*}
342 %\iffalse
343 %</example>
344 %\fi
345 %
346 % Use a \linktoplace{ssec:physquants}{physical quantity's} name to typeset
347 % a magnitude and that quantity's units. If the quantity is a vector, you
348 % can add |vector| either to the beginning or the end of the quantity's
349 % name. For example, if you want momentum, use \refCom{momentum} and
350 % its variants.
351 %
352 %\iffalse
353 %<*example>
354 %\fi
355 \begin{dispExample}
356 \( \momentum{7.071} \) \\
357 \( \vectormomentum{3,-4,5} \) \\
358 \( \momentumvector{3,-4,5} \)
359 \end{dispExample}
360 %\iffalse
361 %</example>
362 %\fi
363 %
364 % Use a \linktoplace{ssec:physconsts}{physical constant's} name
365 % to typeset its numerical value and units. Append |mathsymbol|
366 % to the constant's name to get its mathematical symbol. For
367 % example, if you want to typeset the vacuum permittivity, use
368 % \refCom{vacuumpermittivity} and its variant.
369 %
370 %\iffalse
371 %<*example>
372 %\fi
373 \begin{dispExample*}{lefthand ratio = 0.70}
374 \( \vacuumpermittivitymathsymbol = \vacuumpermittivity \)
375 \end{dispExample*}
376 %\iffalse
377 %</example>
378 %\fi
379 %
380 % Use \refCom{mivector} to typeset symbolic vectors with components.
381 % Use the alias \refCom{direction} to typeset a direction or unit
382 % vector.
383 %\iffalse
384 %<*example>
385 %\fi
386 \begin{dispExample*}{sidebyside = false}
387 \( \mivector{\slot,\slot,\slot} \) or \( \mivector{p_{x},p_{y},p_{z}} \) \\
388 \( \direction{\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}}} \) or
389 \end{dispExample*}
390 %\iffalse
391 %</example>
392 %\fi
393 %
394 % Use \refEnv{physicsproblem} and \refEnv{parts} and \refCom{problempart}
395 % for problems. For step-by-step mathematical solutions use
396 % \refEnv{physicssolution}. Use \refEnv{webvpythonblock} to typeset
397 % \href{https://\gsurl}{\WebVPython} programs. Use \refCom{vpythonfile} to
398 % typeset \href{https://\vpurl}{VPython} program files.
399 %
400 % \newpage
401 % \section{The \mandi{} Package}\setplace{sec:mandia}
402 %
403 % Load \mandi{} as you would any package in your preamble.
404 %
405 %\iffalse
406 %<*example>
407 %\fi
408 \begin{dispListing*}{sidebyside = false,listing only}
409 \usepackage[options]{mandi}
410 \end{dispListing*}
411 %\iffalse
412 %</example>
413 %\fi
414 %
415 %\iffalse
416 %<*example>
417 %\fi
418 \begin{docCommand}{mandiversion}{}
419 Typesets the current version and build date.
420 \end{docCommand}
421 \begin{dispExample*}{sidebyside = false}
422 The version is \mandiversion{} and is a stable build.
423 \end{dispExample*}
424 %\iffalse
425 %</example>
426 %\fi
427 %
428 % \subsection{Package Options}
429 %
430 %\iffalse
431 %<*example>
432 %\fi
433 \begin{docKeys}[%
434 doc new = 2021-01-30,%
435 doc keypath = {},%
436 ]%
437 {%
438 {%
439 doc name = units,%
440 doc parameter = {=\meta{type of unit}},%
441 doc description = {initially unspecified, set to \docValue{alternate}},%
442 },%
443 {%
444 doc name = preciseconstants,%
445 doc parameter = {=\meta{boolean}},%
446 doc description = {initially unspecified, set to \docValue{false}},%
447 },%
448 }%
449 Now \mandi{} uses a key-value interface for options.
450 The \refKey{units} key can be set to \docValue{base}, \docValue{derived},
451 or \docValue{alternate}. The \refKey{preciseconstants} key is always
452 either \docValue{true} or \docValue{false}.
453 \end{docKeys}
454 %\iffalse
455 %</example>
456 %\fi
457 %
458 % \subsection{The \texttt{\small mandisetup} Command}
459 %
460 %\iffalse
461 %<*example>
462 %\fi
463 \begin{docCommand}[doc new = 2021-02-17]{mandisetup}{\marg{options}}
464 Command to set package options on the fly after loadtime. This
465 can be done in the preamble or inside the
466 |\begin{document}...\end{document}| environment.
467 \end{docCommand}
468 \begin{dispListing*}{sidebyside = false,listing only}
469 \mandisetup{units=base}
470 \end{dispListing*}
471 \begin{dispListing*}{sidebyside = false,listing only}
472 \mandisetup{preciseconstants}
473 \end{dispListing*}
474 \begin{dispListing*}{sidebyside = false,listing only}
475 \mandisetup{preciseconstants = false}
476 \end{dispListing*}
477 %\iffalse
478 %</example>
479 %\fi
480 %
481 % \subsection{\lualatex{} is Required}
482 %
483 % In order to make use of better fonts and Unicode features, \mandi{} now
484 % requires the \lualatex{} engine for processing documents. It will not
485 % work with other engines.
486 %
487 % \newpage
488 % \subsection{Physical Quantities}
489 % \subsubsection{Typesetting Physical Quantities}\setplace{ssec:physquants}
490 %
491 % Typesetting physical quantities and constants using semantically appropriate
492 % names, along with the correct
493 % \href{https://en.wikipedia.org/wiki/International_System_of_Units}{SI units},
494 % is the core function of \mandi. Take momentum as the prototypical physical
495 % quantity in an introductory physics course.
496 %
497 %\iffalse
498 %<*example>
499 %\fi
500 \begin{docCommands}
501 {%
502 {%
503 doc name = momentum,%
504 doc parameter = \marg{magnitude},%
505 },%
506 {%
507 doc new = 2021-02-24,%
508 doc name = momentumvector,%
509 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
510 },%
511 {%
512 doc name = vectormomentum,%
513 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
514 },%
515 }%
516 Command for momentum and its vector variants. The default units will depend
517 on the options passed to \mandi{} at load time. Alternate units are the
518 default. Other units can be forced as demonstrated. The vector variants can
519 take more than three components. Note the other variants for the quantity's
520 value and units.
521 \end{docCommands}
522 \begin{dispExample*}{lefthand ratio = 0.60}
523 \( \momentum{5} \) \\
524 \( \momentumvalue{5} \) \\
525 \( \momentumbaseunits{5} \) \\
526 \( \momentumderivedunits{5} \) \\
527 \( \momentumalternateunits{5} \) \\
528 \( \momentumvector{2,3,4} \) \\
529 \( \vectormomentum{2,3,4} \) \\
530 \( \momentum{\mivector{2,3,4}} \) \\
531 \( \momentumonlybaseunits \) \\
532 \( \momentumonlyderivedunits \) \\
533 \( \momentumonlyalternateunits \) \\
534 \( \momentumvectorvalue{2,3,4} \) \\
535 \( \vectormomentumvalue{2,3,4} \) \\
536 \( \momentumvectorbaseunits{2,3,4} \) \\
537 \( \vectormomentumbaseunits{2,3,4} \) \\
538 \( \momentumvectorderivedunits{2,3,4} \) \\
539 \( \vectormomentumderivedunits{2,3,4} \) \\
540 \( \momentumvectoralternateunits{2,3,4} \) \\
541 \( \vectormomentumalternateunits{2,3,4} \) \\
542 \( \momentumvectoronlybaseunits \) \\
543 \( \vectormomentumonlybaseunits \) \\
544 \( \momentumvectoronlyderivedunits \) \\
545 \( \vectormomentumonlyderivedunits \) \\
546 \( \momentumvectoronlyalternateunits \) \\
547 \( \vectormomentumonlyalternateunits \)
548 \end{dispExample*}
549 %\iffalse
550 %</example>
551 %\fi
552 %
553 % Commands that include the name of a physical quantity typeset units, so
554 % they shouldn't be used for algebraic or symbolic values of components.
555 % Don't use
556 % |\vectormomentum{mv_{x},mv_{y},mv_{z}}| but
557 % instead the generic |\mivector{mv_{x},mv_{y},mv_{z}}| instead.
558 %
559 % \subsubsection{Checking Physical Quantities}
560 %
561 %\iffalse
562 %<*example>
563 %\fi
564 \begin{docCommand}[doc updated = 2022-01-27]{CheckQuantity}{\marg{name}}
565 Command to check and typeset the command, base units,
566 derived units, and alternate units of a defined physical
567 quantity.
568 \end{docCommand}
569 %\iffalse
570 %</example>
571 %\fi
572 %
573 % \subsubsection{Predefined Physical Quantities}
574 %
575 % Every other defined physical quantity can be treated similarly. Just replace
576 % |momentum| with the quantity's name. Obviously, the variants that begin with
577 % |\vector| will not be defined for scalar quantities. Here are all the
578 % physical quantities, with all their units, defined in \mandi. Remember that
579 % units are not present with symbolic (algebraic) quantities, so do not use
580 % the |\vector| variants of these commands for symbolic components.
581 % Use \refCom{mivector} instead.
582 %
583 %\iffalse
584 %<*example>
585 %\fi
586 \begin{docCommands}
587 {%
588 {%
589 doc name = acceleration,%
590 doc parameter = \marg{magnitude},%
591 },%
592 {%
593 doc new = 2021-02-24,%
594 doc name = accelerationvector,%
595 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
596 },%
597 {%
598 doc name = vectoracceleration,%
599 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
600 },%
601 }%
602 \end{docCommands}
603 \CheckQuantity{acceleration}
604 \begin{docCommand}{amount}{\marg{magnitude}}
605 \end{docCommand}
606 \CheckQuantity{amount}
607 \begin{docCommands}
608 {%
609 {%
610 doc name = angularacceleration,%
611 doc parameter = \marg{magnitude},%
612 },%
613 {%
614 doc new = 2021-02-24,%
615 doc name = angularaccelerationvector,%
616 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
617 },%
618 {%
619 doc name = vectorangularacceleration,%
620 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
621 },%
622 }%
623 \end{docCommands}
624 \CheckQuantity{angularacceleration}
625 \begin{docCommand}{angularfrequency}{\marg{magnitude}}
626 \end{docCommand}
627 \CheckQuantity{angularfrequency}
628 \begin{docCommands}
629 {%
630 {%
631 doc name = angularimpulse,%
632 doc parameter = \marg{magnitude},%
633 },%
634 {%
635 doc new = 2021-02-24,%
636 doc name = angularimpulsevector,%
637 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
638 },%
639 {%
640 doc name = vectorangularimpulse,%
641 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
642 },%
643 }%
644 \end{docCommands}
645 \CheckQuantity{angularimpulse}
646 \begin{docCommands}
647 {%
648 {%
649 doc name = angularmomentum,%
650 doc parameter = \marg{magnitude},%
651 },%
652 {%
653 doc new = 2021-02-24,%
654 doc name = angularmomentumvector,%
655 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
656 },%
657 {%
658 doc name = vectorangularmomentum,%
659 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
660 },%
661 }%
662 \end{docCommands}
663 \CheckQuantity{angularmomentum}
664 \begin{docCommands}
665 {%
666 {%
667 doc name = angularvelocity,%
668 doc parameter = \marg{magnitude},%
669 },%
670 {%
671 doc new = 2021-02-24,%
672 doc name = angularvelocityvector,%
673 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
674 },%
675 {%
676 doc name = vectorangularvelocity,%
677 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
678 },%
679 }%
680 \end{docCommands}
681 \CheckQuantity{angularvelocity}
682 \begin{docCommand}{area}{\marg{magnitude}}
683 \end{docCommand}
684 \CheckQuantity{area}
685 \begin{docCommand}{areachargedensity}{\marg{magnitude}}
686 \end{docCommand}
687 \CheckQuantity{areachargedensity}
688 \begin{docCommand}{areamassdensity}{\marg{magnitude}}
689 \end{docCommand}
690 \CheckQuantity{areamassdensity}
691 \begin{docCommand}{capacitance}{\marg{magnitude}}
692 \end{docCommand}
693 \CheckQuantity{capacitance}
694 \begin{docCommand}{charge}{\marg{magnitude}}
695 \end{docCommand}
696 \CheckQuantity{charge}
697 \begin{docCommands}
698 {%
699 {%
700 doc name = cmagneticfield,%
701 doc parameter = \marg{magnitude},%
702 },%
703 {%
704 doc new = 2021-02-24,%
705 doc name = cmagneticfieldvector,%
706 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
707 },%
708 {%
709 doc name = vectorcmagneticfield,%
710 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
711 },%
712 }%
713 \end{docCommands}
714 \CheckQuantity{cmagneticfield}
715 \begin{docCommand}{conductance}{\marg{magnitude}}
716 \end{docCommand}
717 \CheckQuantity{conductance}
718 \begin{docCommand}{conductivity}{\marg{magnitude}}
719 \end{docCommand}
720 \CheckQuantity{conductivity}
721 \begin{docCommand}{conventionalcurrent}{\marg{magnitude}}
722 \end{docCommand}
723 \CheckQuantity{conventionalcurrent}
724 \begin{docCommand}{current}{\marg{magnitude}}
725 \end{docCommand}
726 \CheckQuantity{current}
727 \begin{docCommands}
728 {%
729 {%
730 doc name = currentdensity,%
731 doc parameter = \marg{magnitude},%
732 },%
733 {%
734 doc new = 2021-02-24,%
735 doc name = currentdensityvector,%
736 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
737 },%
738 {%
739 doc name = vectorcurrentdensity,%
740 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
741 },%
742 }%
743 \end{docCommands}
744 \CheckQuantity{currentdensity}
745 \begin{docCommand}{dielectricconstant}{\marg{magnitude}}
746 \end{docCommand}
747 \CheckQuantity{dielectricconstant}
748 \begin{docCommands}
749 {%
750 {%
751 doc new = 2021-02-24,%
752 doc name = direction,%
753 doc parameter = \marg{magnitude},%
754 },%
755 {%
756 doc name = directionvector,%
757 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
758 },%
759 {%
760 doc name = vectordirection,%
761 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
762 },%
763 }%
764 \end{docCommands}
765 \CheckQuantity{direction}
766 \begin{docCommands}
767 {%
768 {%
769 doc name = displacement,%
770 doc parameter = \marg{magnitude},%
771 },%
772 {%
773 doc new = 2021-02-24,%
774 doc name = displacementvector,%
775 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
776 },%
777 {%
778 doc name = vectordisplacement,%
779 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
780 },%
781 }%
782 \end{docCommands}
783 \CheckQuantity{displacement}
784 \begin{docCommand}{duration}{\marg{magnitude}}
785 \end{docCommand}
786 \CheckQuantity{duration}
787 \begin{docCommands}
788 {%
789 {%
790 doc name = electricdipolemoment,%
791 doc parameter = \marg{magnitude},%
792 },%
793 {%
794 doc new = 2021-02-24,%
795 doc name = electricdipolemomentvector,%
796 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
797 },%
798 { doc name = vectorelectricdipolemoment,%
799 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
800 },%
801 }%
802 \end{docCommands}
803 \CheckQuantity{electricdipolemoment}
804 \begin{docCommands}
805 {%
806 {%
807 doc name = electricfield,%
808 doc parameter = \marg{magnitude},%
809 },%
810 {%
811 doc new = 2021-02-24,%
812 doc name = electricfieldvector,%
813 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
814 },%
815 {%
816 doc name = vectorelectricfield,%
817 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
818 },%
819 }%
820 \end{docCommands}
821 \CheckQuantity{electricfield}
822 \begin{docCommand}{electricflux}{\marg{magnitude}}
823 \end{docCommand}
824 \CheckQuantity{electricflux}
825 \begin{docCommand}{electricpotential}{\marg{magnitude}}
826 \end{docCommand}
827 \CheckQuantity{electricpotential}
828 \begin{docCommand}[doc new = 2021-05-01]{electricpotentialdifference}{\marg{magnitude}}
829 \end{docCommand}
830 \CheckQuantity{electricpotentialdifference}
831 \begin{docCommand}{electroncurrent}{\marg{magnitude}}
832 \end{docCommand}
833 \CheckQuantity{electroncurrent}
834 \begin{docCommand}{emf}{\marg{magnitude}}
835 \end{docCommand}
836 \CheckQuantity{emf}
837 \begin{docCommand}{energy}{\marg{magnitude}}
838 \end{docCommand}
839 \CheckQuantity{energy}
840 \begin{docCommand}[doc new = 2021-04-15]{energyinev}{\marg{magnitude}}
841 \end{docCommand}
842 \CheckQuantity{energyinev}
843 \begin{docCommand}[doc new = 2021-04-15]{energyinkev}{\marg{magnitude}}
844 \end{docCommand}
845 \CheckQuantity{energyinkev}
846 \begin{docCommand}[doc new = 2021-04-15]{energyinmev}{\marg{magnitude}}
847 \end{docCommand}
848 \CheckQuantity{energyinmev}
849 \begin{docCommand}{energydensity}{\marg{magnitude}}
850 \end{docCommand}
851 \CheckQuantity{energydensity}
852 \begin{docCommands}
853 {%
854 {%
855 doc name = energyflux,%
856 doc parameter = \marg{magnitude},%
857 },%
858 {%
859 doc new = 2021-02-24,%
860 doc name = energyfluxvector,%
861 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
862 },%
863 {%
864 doc name = vectorenergyflux,%
865 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
866 },%
867 }%
868 \end{docCommands}
869 \CheckQuantity{energyflux}
870 \begin{docCommand}{entropy}{\marg{magnitude}}
871 \end{docCommand}
872 \CheckQuantity{entropy}
873 \begin{docCommands}
874 {%
875 {%
876 doc name = force,%
877 doc parameter = \marg{magnitude},%
878 },%
879 {%
880 doc new = 2021-02-24,%
881 doc name = forcevector,%
882 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
883 },%
884 {%
885 doc name = vectorforce,%
886 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
887 },%
888 }%
889 \end{docCommands}
890 \CheckQuantity{force}
891 \begin{docCommand}{frequency}{\marg{magnitude}}
892 \end{docCommand}
893 \CheckQuantity{frequency}
894 \begin{docCommands}
895 {%
896 {%
897 doc name = gravitationalfield,%
898 doc parameter = \marg{magnitude},%
899 },%
900 {%
901 doc new = 2021-02-24,%
902 doc name = gravitationalfieldvector,%
903 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
904 },%
905 {%
906 doc name = vectorgravitationalfield,%
907 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
908 },%
909 }%
910 \end{docCommands}
911 \CheckQuantity{gravitationalfield}
912 \begin{docCommand}{gravitationalpotential}{\marg{magnitude}}
913 \end{docCommand}
914 \CheckQuantity{gravitationalpotential}
915 \begin{docCommand}[doc new = 2021-05-01]{gravitationalpotentialdifference}{\marg{magnitude}}
916 \end{docCommand}
917 \CheckQuantity{gravitationalpotentialdifference}
918 \begin{docCommands}
919 {%
920 {%
921 doc name = impulse,%
922 doc parameter = \marg{magnitude},%
923 },%
924 {%
925 doc new = 2021-02-24,%
926 doc name = impulsevector,%
927 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
928 },%
929 {%
930 doc name = vectorimpulse,%
931 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
932 },%
933 }%
934 \end{docCommands}
935 \CheckQuantity{impulse}
936 \begin{docCommand}{indexofrefraction}{\marg{magnitude}}
937 \end{docCommand}
938 \CheckQuantity{indexofrefraction}
939 \begin{docCommand}{inductance}{\marg{magnitude}}
940 \end{docCommand}
941 \CheckQuantity{inductance}
942 \begin{docCommand}{linearchargedensity}{\marg{magnitude}}
943 \end{docCommand}
944 \CheckQuantity{linearchargedensity}
945 \begin{docCommand}{linearmassdensity}{\marg{magnitude}}
946 \end{docCommand}
947 \CheckQuantity{linearmassdensity}
948 \begin{docCommand}[doc new = 2022-01-27]{lorentzfactor}{\marg{magnitude}}
949 \end{docCommand}
950 \CheckQuantity{lorentzfactor}
951 \begin{docCommand}[doc updated = 2021-05-02]{luminousintensity}{\marg{magnitude}}
952 \end{docCommand}
953 \CheckQuantity{luminousintensity}
954 \begin{docCommand}{magneticcharge}{\marg{magnitude}}
955 \end{docCommand}
956 \CheckQuantity{magneticcharge}
957 \begin{docCommands}
958 {%
959 {%
960 doc name = magneticdipolemoment,%
961 doc parameter = \marg{magnitude},%
962 },%
963 {%
964 doc new = 2021-02-24,%
965 doc name = magneticdipolemomentvector,%
966 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
967 },%
968 {%
969 doc name = vectormagneticdipolemoment,%
970 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
971 },%
972 }%
973 \end{docCommands}
974 \CheckQuantity{magneticdipolemoment}
975 \begin{docCommands}
976 {%
977 {%
978 doc name = magneticfield,%
979 doc parameter = \marg{magnitude},%
980 },%
981 {%
982 doc new = 2021-02-24,%
983 doc name = magneticfieldvector,%
984 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
985 },%
986 {%
987 doc name = vectormagneticfield,%
988 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
989 },%
990 }%
991 \end{docCommands}
992 \CheckQuantity{magneticfield}
993 \begin{docCommand}{magneticflux}{\marg{magnitude}}
994 \end{docCommand}
995 \CheckQuantity{magneticflux}
996 \begin{docCommand}{mass}{\marg{magnitude}}
997 \end{docCommand}
998 \CheckQuantity{mass}
999 \begin{docCommand}{mobility}{\marg{magnitude}}
1000 \end{docCommand}
1001 \CheckQuantity{mobility}
1002 \begin{docCommand}{momentofinertia}{\marg{magnitude}}
1003 \end{docCommand}
1004 \CheckQuantity{momentofinertia}
1005 \begin{docCommands}
1006 {%
1007 {%
1008 doc name = momentum,%
1009 doc label = momentumdemo,%
1010 doc parameter = \marg{magnitude},%
1011 },%
1012 {%
1013 doc new = 2021-02-24,%
1014 doc name = momentumvector,%
1015 doc label = momentumvectordemo,%
1016 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1017 },%
1018 {%
1019 doc name = vectormomentum,%
1020 doc label = vectormomentumdemo,%
1021 doc parameter = \marg{\( c_{1},\dots,c_{n} \)} },%
1022 }%
1023 \end{docCommands}
1024 \CheckQuantity{momentum}
1025 \begin{docCommands}
1026 {%
1027 {%
1028 doc name = momentumflux,%
1029 doc parameter = \marg{magnitude},%
1030 },%
1031 {%
1032 doc new = 2021-02-24,%
1033 doc name = momentumfluxvector,%
1034 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1035 },%
1036 {%
1037 doc name = vectormomentumflux,%
1038 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1039 },%
1040 }%
1041 \end{docCommands}
1042 \CheckQuantity{momentumflux}
1043 \begin{docCommand}{numberdensity}{\marg{magnitude}}
1044 \end{docCommand}
1045 \CheckQuantity{numberdensity}
1046 \begin{docCommand}{permeability}{\marg{magnitude}}
1047 \end{docCommand}
1048 \CheckQuantity{permeability}
1049 \begin{docCommand}{permittivity}{\marg{magnitude}}
1050 \end{docCommand}
1051 \CheckQuantity{permittivity}
1052 \begin{docCommand}{planeangle}{\marg{magnitude}}
1053 \end{docCommand}
1054 \CheckQuantity{planeangle}
1055 \begin{docCommand}{polarizability}{\marg{magnitude}}
1056 \end{docCommand}
1057 \CheckQuantity{polarizability}
1058 \begin{docCommand}{power}{\marg{magnitude}}
1059 \end{docCommand}
1060 \CheckQuantity{power}
1061 \begin{docCommands}
1062 {%
1063 {%
1064 doc name = poynting,%
1065 doc parameter = \marg{magnitude},%
1066 },%
1067 {%
1068 doc new = 2021-02-24,%
1069 doc name = poyntingvector,%
1070 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1071 },%
1072 {%
1073 doc name = vectorpoynting,%
1074 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1075 },%
1076 }%
1077 \end{docCommands}
1078 \CheckQuantity{poynting}
1079 \begin{docCommand}{pressure}{\marg{magnitude}}
1080 \end{docCommand}
1081 \CheckQuantity{pressure}
1082 \begin{docCommand}{relativepermeability}{\marg{magnitude}}
1083 \end{docCommand}
1084 \CheckQuantity{relativepermeability}
1085 \begin{docCommand}{relativepermittivity}{\marg{magnitude}}
1086 \end{docCommand}
1087 \CheckQuantity{relativepermittivity}
1088 \begin{docCommand}{resistance}{\marg{magnitude}}
1089 \end{docCommand}
1090 \CheckQuantity{resistance}
1091 \begin{docCommand}{resistivity}{\marg{magnitude}}
1092 \end{docCommand}
1093 \CheckQuantity{resistivity}
1094 \begin{docCommand}{solidangle}{\marg{magnitude}}
1095 \end{docCommand}
1096 \CheckQuantity{solidangle}
1097 \begin{docCommand}{specificheatcapacity}{\marg{magnitude}}
1098 \end{docCommand}
1099 \CheckQuantity{specificheatcapacity}
1100 \begin{docCommand}{springstiffness}{\marg{magnitude}}
1101 \end{docCommand}
1102 \CheckQuantity{springstiffness}
1103 \begin{docCommand}{springstretch}{\marg{magnitude}}
1104 \end{docCommand}
1105 \CheckQuantity{springstretch}
1106 \begin{docCommand}{stress}{\marg{magnitude}}
1107 \end{docCommand}
1108 \CheckQuantity{stress}
1109 \begin{docCommand}{strain}{\marg{magnitude}}
1110 \end{docCommand}
1111 \CheckQuantity{strain}
1112 \begin{docCommand}{temperature}{\marg{magnitude}}
1113 \end{docCommand}
1114 \CheckQuantity{temperature}
1115 \begin{docCommands}
1116 {%
1117 {%
1118 doc name = torque,%
1119 doc parameter = \marg{magnitude},%
1120 },%
1121 {%
1122 doc new = 2021-02-24,%
1123 doc name = torquevector,%
1124 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1125 },%
1126 {%
1127 doc name = vectortorque,%
1128 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1129 },%
1130 }%
1131 \end{docCommands}
1132 \CheckQuantity{torque}
1133 \begin{docCommands}
1134 {%
1135 {%
1136 doc name = velocity,%
1137 doc parameter = \marg{magnitude},%
1138 },%
1139 {%
1140 doc new = 2021-02-24,%
1141 doc name = velocityvector,%
1142 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1143 },%
1144 {%
1145 doc name = vectorvelocity,%
1146 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1147 },%
1148 }%
1149 \end{docCommands}
1150 \CheckQuantity{velocity}
1151 \begin{docCommands}
1152 {%
1153 {%
1154 doc name = velocityc,%
1155 doc parameter = \marg{magnitude},%
1156 },%
1157 {%
1158 doc new = 2021-02-24,%
1159 doc name = velocitycvector,%
1160 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1161 },%
1162 {%
1163 doc name = vectorvelocityc,%
1164 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1165 },%
1166 }%
1167 \end{docCommands}
1168 \CheckQuantity{velocityc}
1169 \begin{docCommand}{volume}{\marg{magnitude}}
1170 \end{docCommand}
1171 \CheckQuantity{volume}
1172 \begin{docCommand}{volumechargedensity}{\marg{magnitude}}
1173 \end{docCommand}
1174 \CheckQuantity{volumechargedensity}
1175 \begin{docCommand}{volumemassdensity}{\marg{magnitude}}
1176 \end{docCommand}
1177 \CheckQuantity{volumemassdensity}
1178 \begin{docCommand}{wavelength}{\marg{magnitude}}
1179 \end{docCommand}
1180 \CheckQuantity{wavelength}
1181 \begin{docCommands}
1182 {%
1183 {%
1184 doc name = wavenumber,%
1185 doc parameter = \marg{magnitude},%
1186 },%
1187 {%
1188 doc new = 2021-02-24,%
1189 doc name = wavenumbervector,%
1190 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1191 },%
1192 {%
1193 doc name = vectorwavenumber,%
1194 doc parameter = \marg{\( c_{1},\dots,c_{n} \)},%
1195 },%
1196 }%
1197 \end{docCommands}
1198 \CheckQuantity{wavenumber}
1199 \begin{docCommand}{work}{\marg{magnitude}}
1200 \end{docCommand}
1201 \CheckQuantity{work}
1202 \begin{docCommand}{youngsmodulus}{\marg{magnitude}}
1203 \end{docCommand}
1204 \CheckQuantity{youngsmodulus}
1205 %\iffalse
1206 %</example>
1207 %\fi
1208 %
1209 % \subsubsection{Defining and Redefining Physical Quantities}
1210 %
1211 %\iffalse
1212 %<*example>
1213 %\fi
1214 \begin{docCommands}[%
1215 doc parameter = \marg{name}\marg{base units}\oarg{derived units}\oarg{alternate units},%
1216 ]%
1217 {%
1218 {%
1219 doc new = 2021-02-16,%
1220 doc name = NewScalarQuantity,%
1221 },%
1222 {%
1223 doc new = 2021-02-21,%
1224 doc name = RenewScalarQuantity,%
1225 },%
1226 }%
1227 Command to (re)define a new/existing scalar quantity.
1228 If the derived or alternate units are omitted, they are
1229 defined to be the same as the base units. Do not use both
1230 this command and
1231 \refCom{NewVectorQuantity} or \refCom{RenewVectorQuantity}
1232 to (re)define a quantity.
1233 \end{docCommands}
1234 %\iffalse
1235 %</example>
1236 %\fi
1237 %
1238 %\iffalse
1239 %<*example>
1240 %\fi
1241 \begin{docCommands}[%
1242 doc parameter = \marg{name}\marg{base units}\oarg{derived units}\oarg{alternate units},%
1243 ]%
1244 {%
1245 {%
1246 doc new = 2021-02-16,%
1247 doc name = NewVectorQuantity,%
1248 },%
1249 {%
1250 doc new = 2021-02-21,%
1251 doc name = RenewVectorQuantity,%
1252 },%
1253 }%
1254 Command to (re)define a new/existing vector quantity.
1255 If the derived or alternate units are omitted, they are
1256 defined to be the same as the base units. Do not use both
1257 this command and
1258 \refCom{NewScalarQuantity} or \refCom{RenewScalarQuantity}
1259 to (re)define a quantity.
1260 \end{docCommands}
1261 %\iffalse
1262 %</example>
1263 %\fi
1264 %
1265 % \subsubsection{Changing Units}\setplace{ssec:chgunits}
1266 %
1267 % Units are set when \mandi{} is loaded, but the default setting
1268 % can be easily overridden in four ways: command variants that
1269 % are defined when a \linktoplace{ssec:physquants}{physical quantity}
1270 % or \linktoplace{ssec:physconsts}{physical constant} is
1271 % defined, a global modal command (switch), a
1272 % command that sets units for a single instance, and an
1273 % environment that sets units for its duration. All of these
1274 % methods work for both physical quantities and physical
1275 % constants.
1276 %
1277 %\iffalse
1278 %<*example>
1279 %\fi
1280 \begin{docCommands}[%
1281 doc updated = 2021-02-26,%
1282 doc parameter = {},%
1283 ]%
1284 {%
1285 {%
1286 doc name = alwaysusebaseunits,%
1287 },%
1288 {%
1289 doc name = alwaysusederivedunits,%
1290 },%
1291 {%
1292 doc name = alwaysusealternateunits,%
1293 },%
1294 }%
1295 Modal commands (switches) for setting the default unit form for the entire
1296 document. When \mandi{} is loaded, one of these three commands is executed
1297 depending on whether the optional |units| key is provided. See the section
1298 on loading the package for details. Alternate units are the default because
1299 they are the most likely ones to be seen in introductory physics textbooks.
1300 \end{docCommands}
1301 %\iffalse
1302 %</example>
1303 %\fi
1304 %
1305 %\iffalse
1306 %<*example>
1307 %\fi
1308 \begin{docCommands}[%
1309 doc updated = 2021-02-26,%
1310 doc parameter = \marg{content},%
1311 ]%
1312 {%
1313 {%
1314 doc name = hereusebaseunits,%
1315 },%
1316 {%
1317 doc name = hereusederivedunits,%
1318 },%
1319 {%
1320 doc name = hereusealternateunits,%
1321 },%
1322 }%
1323 Commands for setting the unit form on the fly for a single instance. The
1324 example uses momentum and the Coulomb constant, but they work for any
1325 defined quantity and constant.
1326 \end{docCommands}
1327 \begin{dispExample}
1328 \( \hereusebaseunits{\momentum{5}} \) \\
1329 \( \hereusederivedunits{\momentum{5}} \) \\
1330 \( \hereusealternateunits{\momentum{5}} \) \\
1331 \( \hereusebaseunits{\oofpez} \) \\
1332 \( \hereusederivedunits{\oofpez} \) \\
1333 \( \hereusealternateunits{\oofpez} \)
1334 \end{dispExample}
1335 %\iffalse
1336 %</example>
1337 %\fi
1338 %
1339 %\iffalse
1340 %<*example>
1341 %\fi
1342 \begin{docEnvironments}[%
1343 doc updated = 2021-02-26,%
1344 doc parameter = {},%
1345 ]%
1346 {%
1347 {%
1348 doc name = usebaseunits,%
1349 doc description = use base units,%
1350 },%
1351 {%
1352 doc name = usederivedunits,%
1353 doc description = use derived units,%
1354 },%
1355 {%
1356 doc name = usealternateunits,%
1357 doc description = use alternate units,%
1358 },%
1359 }%
1360 Inside these environments units are changed for the duration
1361 of the environment regardless of the global default setting.
1362 \end{docEnvironments}
1363 \begin{dispExample}
1364 \( \momentum{5} \) \\
1365 \( \oofpez \) \\
1366 \begin{usebaseunits}
1367 \( \momentum{5} \) \\
1368 \( \oofpez \) \\
1369 \end{usebaseunits}
1370 \begin{usederivedunits}
1371 \( \momentum{5} \) \\
1372 \( \oofpez \) \\
1373 \end{usederivedunits}
1374 \begin{usealternateunits}
1375 \( \momentum{5} \) \\
1376 \( \oofpez \)
1377 \end{usealternateunits}
1378 \end{dispExample}
1379 %\iffalse
1380 %</example>
1381 %\fi
1382 %
1383 % \subsection{Physical Constants}
1384 % \subsubsection{Typesetting Physical Constants}\setplace{ssec:physconsts}
1385 %
1386 % Take the quantity \( \oofpezmathsymbol \), sometimes called the
1387 % \href{https://en.wikipedia.org/wiki/Coulomb_constant}{Coulomb constant},
1388 % as the prototypical
1389 % \href{https://en.wikipedia.org/wiki/Physical_constant}{physical constant}
1390 % in an introductory physics course. Here are all the ways to access this
1391 % quantity in \mandi. As you can see, these commands are almost identical
1392 % to the corresponding commands for physical quantities.
1393 %
1394 %\iffalse
1395 %<*example>
1396 %\fi
1397 \begin{docCommand}[doc label = oofpezdemo]{oofpez}{}
1398 Command for the Coulomb constant. The constant's numerical precision and
1399 default units will depend on the options passed to \mandi{} at load time.
1400 Alternate units and approximate numerical values are the defaults. Other
1401 units can be forced as demonstrated.
1402 \end{docCommand}
1403 \begin{dispExample}
1404 \( \oofpez \) \\
1405 \( \oofpezapproximatevalue \) \\
1406 \( \oofpezprecisevalue \) \\
1407 \( \oofpezmathsymbol \) \\
1408 \( \oofpezbaseunits \) \\
1409 \( \oofpezderivedunits \) \\
1410 \( \oofpezalternateunits \) \\
1411 \( \oofpezonlybaseunits \) \\
1412 \( \oofpezonlyderivedunits \) \\
1413 \( \oofpezonlyalternateunits \)
1414 \end{dispExample}
1415 %\iffalse
1416 %</example>
1417 %\fi
1418 %
1419 % \subsubsection{Checking Physical Constants}
1420 %
1421 %\iffalse
1422 %<*example>
1423 %\fi
1424 \begin{docCommand}[doc updated = 2022-01-27]{CheckConstant}{\marg{name}}
1425 Command to check and typeset the constant's name, mathematical symbol,
1426 approximate value, precise value, base units, derived units, and
1427 alternate units.
1428 \end{docCommand}
1429 %\iffalse
1430 %</example>
1431 %\fi
1432 %
1433 % \subsubsection{Predefined Physical Constants}
1434 %
1435 % Every other defined physical constant can be treated similarly to
1436 % \refCom{oofpez}. Just replace |oofpez| with the constant's name.
1437 % Unfortunately, there is no universal agreement on the names of every
1438 % constant so don't fret if the names used here vary from other sources.
1439 % Here are all the physical constants, with all their units, defined in
1440 % \mandi. The constants \refCom{coulombconstant} and
1441 % \refCom{biotsavartconstant} are defined as semantic aliases for,
1442 % respectively, \refCom{oofpez} and \refCom{mzofp}.
1443 %
1444 %\iffalse
1445 %<*example>
1446 %\fi
1447 \begin{docCommand}[doc description = exact]{avogadro}{}
1448 \end{docCommand}
1449 \CheckConstant{avogadro}
1450 \begin{docCommand}[doc new = 2021-02-02]{biotsavartconstant}{}
1451 \end{docCommand}
1452 \CheckConstant{biotsavartconstant}
1453 \begin{docCommand}{bohrradius}{}
1454 \end{docCommand}
1455 \CheckConstant{bohrradius}
1456 \begin{docCommand}[doc description = exact]{boltzmann}{}
1457 \end{docCommand}
1458 \CheckConstant{boltzmann}
1459 \begin{docCommand}[doc new = 2021-02-02]{coulombconstant}{}
1460 \end{docCommand}
1461 \CheckConstant{coulombconstant}
1462 \begin{docCommand}{earthmass}{}
1463 \end{docCommand}
1464 \CheckConstant{earthmass}
1465 \begin{docCommand}{earthmoondistance}{}
1466 \end{docCommand}
1467 \CheckConstant{earthmoondistance}
1468 \begin{docCommand}{earthradius}{}
1469 \end{docCommand}
1470 \CheckConstant{earthradius}
1471 \begin{docCommand}{earthsundistance}{}
1472 \end{docCommand}
1473 \CheckConstant{earthsundistance}
1474 \begin{docCommand}{electroncharge}{}
1475 \end{docCommand}
1476 \CheckConstant{electroncharge}
1477 \begin{docCommand}{electronCharge}{}
1478 \end{docCommand}
1479 \CheckConstant{electronCharge}
1480 \begin{docCommand}{electronmass}{}
1481 \end{docCommand}
1482 \CheckConstant{electronmass}
1483 \begin{docCommand}[doc description = exact]{elementarycharge}{}
1484 \end{docCommand}
1485 \CheckConstant{elementarycharge}
1486 \begin{docCommand}{finestructure}{}
1487 \end{docCommand}
1488 \CheckConstant{finestructure}
1489 \begin{docCommand}{hydrogenmass}{}
1490 \end{docCommand}
1491 \CheckConstant{hydrogenmass}
1492 \begin{docCommand}{moonearthdistance}{}
1493 \end{docCommand}
1494 \CheckConstant{moonearthdistance}
1495 \begin{docCommand}{moonmass}{}
1496 \end{docCommand}
1497 \CheckConstant{moonmass}
1498 \begin{docCommand}{moonradius}{}
1499 \end{docCommand}
1500 \CheckConstant{moonradius}
1501 \begin{docCommand}{mzofp}{}
1502 \end{docCommand}
1503 \CheckConstant{mzofp}
1504 \begin{docCommand}{neutronmass}{}
1505 \end{docCommand}
1506 \CheckConstant{neutronmass}
1507 \begin{docCommand}{oofpez}{}
1508 \end{docCommand}
1509 \CheckConstant{oofpez}
1510 \begin{docCommand}{oofpezcs}{}
1511 \end{docCommand}
1512 \CheckConstant{oofpezcs}
1513 \begin{docCommand}[doc description = exact]{planck}{}
1514 \end{docCommand}
1515 \CheckConstant{planck}
1516 \begin{docCommand}{planckbar}{}
1517 \end{docCommand}
1518 \CheckConstant{planckbar}
1519 \begin{docCommand}{planckc}{}
1520 \end{docCommand}
1521 \CheckConstant{planckc}
1522 \begin{docCommand}{protoncharge}{}
1523 \end{docCommand}
1524 \CheckConstant{protoncharge}
1525 \begin{docCommand}{protonCharge}{}
1526 \end{docCommand}
1527 \CheckConstant{protonCharge}
1528 \begin{docCommand}{protonmass}{}
1529 \end{docCommand}
1530 \CheckConstant{protonmass}
1531 \begin{docCommand}{rydberg}{}
1532 \end{docCommand}
1533 \CheckConstant{rydberg}
1534 \begin{docCommand}[doc description = exact]{speedoflight}{}
1535 \end{docCommand}
1536 \CheckConstant{speedoflight}
1537 \begin{docCommand}{stefanboltzmann}{}
1538 \end{docCommand}
1539 \CheckConstant{stefanboltzmann}
1540 \begin{docCommand}{sunearthdistance}{}
1541 \end{docCommand}
1542 \CheckConstant{sunearthdistance}
1543 \begin{docCommand}{sunradius}{}
1544 \end{docCommand}
1545 \CheckConstant{sunradius}
1546 \begin{docCommand}{surfacegravfield}{}
1547 \end{docCommand}
1548 \CheckConstant{surfacegravfield}
1549 \begin{docCommand}{universalgrav}{}
1550 \end{docCommand}
1551 \CheckConstant{universalgrav}
1552 \begin{docCommand}{vacuumpermeability}{}
1553 \end{docCommand}
1554 \CheckConstant{vacuumpermeability}
1555 \begin{docCommand}{vacuumpermittivity}{}
1556 \end{docCommand}
1557 \CheckConstant{vacuumpermittivity}
1558 %\iffalse
1559 %</example>
1560 %\fi
1561 %
1562 % \subsubsection{Defining and Redefining Physical Constants}
1563 %
1564 %\iffalse
1565 %<*example>
1566 %\fi
1567 \begin{docCommands}[%
1568 doc parameter = {%
1569 \marg{name}\marg{symbol}\marg{approximate value}\marg{precise value}\marg{base units}\\
1570 \oarg{derived units}\oarg{alternate units}%
1571 },%
1572 ]%
1573 {%
1574 {%
1575 doc new = 2021-02-16,%
1576 doc name = NewPhysicalConstant,%
1577 },%
1578 {%
1579 doc new = 2021-02-21,%
1580 doc name = RenewPhysicalConstant,%
1581 },%
1582 }%
1583 Command to define/redefine a new/existing physical constant.
1584 If the derived or alternate units are omitted, they are
1585 defined to be the same as the base units.
1586 \end{docCommands}
1587 %\iffalse
1588 %</example>
1589 %\fi
1590 %
1591 % \subsubsection{Changing Precision}
1592 %
1593 % \linktoplace{ssec:chgunits}{Changing units} works for
1594 % physical constants just as it does for physical quantities.
1595 % A similar mechanism is provided for changing the precision
1596 % of physical constants' numerical values.
1597 %
1598 %\iffalse
1599 %<*example>
1600 %\fi
1601 \begin{docCommands}[%
1602 doc new = 2021-02-16,%
1603 doc parameter = {},%
1604 ]%
1605 {%
1606 {%
1607 doc name = alwaysuseapproximateconstants,%
1608 },%
1609 {%
1610 doc name = alwaysusepreciseconstants,%
1611 },%
1612 }%
1613 Modal commands (switches) for setting the default precision for the entire
1614 document. The default when the package is loaded is set by the presence or
1615 absence of the \refKey{preciseconstants} key.
1616 \end{docCommands}
1617 %\iffalse
1618 %</example>
1619 %\fi
1620 %
1621 %\iffalse
1622 %<*example>
1623 %\fi
1624 \begin{docCommands}[%
1625 doc new = 2021-02-16,%
1626 doc parameter = \marg{content},%
1627 ]%
1628 {%
1629 {%
1630 doc name = hereuseapproximateconstants,%
1631 },%
1632 {%
1633 doc name = hereusepreciseconstants,%
1634 },%
1635 }%
1636 Commands for setting the precision on the fly for a single instance.
1637 \end{docCommands}
1638 \begin{dispExample}
1639 \( \hereuseapproximateconstants{\oofpez} \) \\
1640 \( \hereusepreciseconstants{\oofpez} \)
1641 \end{dispExample}
1642 %\iffalse
1643 %</example>
1644 %\fi
1645 %
1646 %\iffalse
1647 %<*example>
1648 %\fi
1649 \begin{docEnvironments}[%
1650 doc new = 2021-02-16,%
1651 doc parameter = {},%
1652 ]%
1653 {%
1654 {%
1655 doc name = useapproximateconstants,%
1656 doc description = use approximate constants,%
1657 },%
1658 {%
1659 doc name = usepreciseconstants,%
1660 doc description = use precise constants,%
1661 },%
1662 }%
1663 Inside these environments precision is changed for the duration
1664 of the environment regardless of the global default setting.
1665 \end{docEnvironments}
1666 \begin{dispExample}
1667 \( \oofpez \) \\
1668 \begin{useapproximateconstants}
1669 \( \oofpez \) \\
1670 \end{useapproximateconstants}
1671 \begin{usepreciseconstants}
1672 \( \oofpez \) \\
1673 \end{usepreciseconstants}
1674 \( \oofpez \)
1675 \end{dispExample}
1676 %\iffalse
1677 %</example>
1678 %\fi
1679 %
1680 % \subsection{Predefined Units and Constructs}
1681 %
1682 % These commands should be used only in defining or
1683 % redefining physical quantities or physical
1684 % constants. One exception is \refCom{emptyunit},
1685 % which may be used for explanatory purposes.
1686 %
1687 %\iffalse
1688 %<*example>
1689 %\fi
1690 \begin{docCommands}[%
1691 doc parameter = {},%
1692 ]%
1693 {%
1694 {%
1695 doc name = per,%
1696 },%
1697 {%
1698 doc name = usk,%
1699 },%
1700 {%
1701 doc parameter = \marg{magnitude}\marg{unit},%
1702 doc updated = 2023-08-01,%
1703 doc name = units,%
1704 },%
1705 {%
1706 doc name = emptyunit,%
1707 },%
1708 {%
1709 doc name = ampere,%
1710 },%
1711 {%
1712 doc name = atomicmassunit,%
1713 },%
1714 {%
1715 doc name = candela,%
1716 },%
1717 {%
1718 doc name = coulomb,%
1719 },%
1720 {%
1721 doc name = degree,%
1722 },%
1723 {%
1724 doc name = electronvolt,%
1725 doc description = not SI but common in introductory physics,%
1726 },%
1727 {%
1728 doc new = 2021-04-15,%
1729 doc name = ev,%
1730 doc description = alias,%
1731 },%
1732 {%
1733 doc name = farad,%
1734 },%
1735 {%
1736 doc name = henry,%
1737 },%
1738 {%
1739 doc name = hertz,%
1740 },%
1741 {%
1742 doc name = joule,%
1743 },%
1744 {%
1745 doc name = kelvin,%
1746 },%
1747 {%
1748 doc new = 2021-04-15,%
1749 doc name = kev,%
1750 doc description = alias,%
1751 },%
1752 {%
1753 doc new = 2021-04-15,%
1754 doc name = kiloelectronvolt,%
1755 doc description = not SI but common in introductory physics,%
1756 },%
1757 {%
1758 doc name = kilogram,%
1759 },%
1760 {%
1761 doc name = lightspeed,%
1762 doc description = not SI but common relativity,%
1763 },%
1764 {%
1765 doc new = 2021-04-15,%
1766 doc name = megaelectronvolt,%
1767 doc description = not SI but common in introductory physics,%
1768 },%
1769 {%
1770 doc name = meter,%
1771 },%
1772 {%
1773 doc name = metre,%
1774 doc description = alias,%
1775 },%
1776 {%
1777 doc new = 2021-04-15,%
1778 doc name = mev,%
1779 doc description = alias,%
1780 },%
1781 {%
1782 doc name = mole,%
1783 },%
1784 {%
1785 doc name = newton,%
1786 },%
1787 {%
1788 doc name = ohm,%
1789 },%
1790 {%
1791 doc name = pascal,%
1792 },%
1793 {%
1794 doc name = radian,%
1795 },%
1796 {%
1797 doc name = second,%
1798 },%
1799 {%
1800 doc name = siemens,%
1801 },%
1802 {%
1803 doc name = steradian,%
1804 },%
1805 {%
1806 doc name = tesla,%
1807 },%
1808 {%
1809 doc name = volt,%
1810 },%
1811 {%
1812 doc name = watt,%
1813 },%
1814 {%
1815 doc name = weber,%
1816 },%
1817 {%
1818 doc name = tothetwo,%
1819 doc description = postfix,%
1820 },%
1821 {%
1822 doc name = tothethree,%
1823 doc description = postfix,%
1824 },%
1825 {%
1826 doc name = tothefour,%
1827 doc description = postfix,%
1828 },%
1829 {%
1830 doc name = inverse,%
1831 doc description = postfix,%
1832 },%
1833 {%
1834 doc name = totheinversetwo,%
1835 doc description = postfix,%
1836 },%
1837 {%
1838 doc name = totheinversethree,%
1839 doc description = postfix,%
1840 },%
1841 {%
1842 doc name = totheinversefour,%
1843 doc description = postfix,%
1844 },%
1845 }%
1846 \end{docCommands}
1847 \begin{dispExample}
1848 \( \per \) \\
1849 \( \usk \) \\
1850 \( \units{3}{\meter\per\second} \) \\
1851 \( \emptyunit \) \\
1852 \( \ampere \) \\
1853 \( \atomicmassunit \) \\
1854 \( \candela \) \\
1855 \( \coulomb \) \\
1856 \( \degree \) \\
1857 \( \electronvolt \) \\
1858 \( \farad \) \\
1859 \( \henry \) \\
1860 \( \hertz \) \\
1861 \( \joule \) \\
1862 \( \kelvin \) \\
1863 \( \kev \) \\
1864 \( \kilogram \) \\
1865 \( \lightspeed \) \\
1866 \( \meter \) \\
1867 \( \metre \) \\
1868 \( \mev \) \\
1869 \( \mole \) \\
1870 \( \newton \) \\
1871 \( \ohm \) \\
1872 \( \pascal \) \\
1873 \( \radian \) \\
1874 \( \second \) \\
1875 \( \siemens \) \\
1876 \( \steradian \) \\
1877 \( \tesla \) \\
1878 \( \volt \) \\
1879 \( \watt \) \\
1880 \( \weber \) \\
1881 \( \emptyunit\tothetwo \) \\
1882 \( \emptyunit\tothethree \) \\
1883 \( \emptyunit\tothefour \) \\
1884 \( \emptyunit\inverse \) \\
1885 \( \emptyunit\totheinversetwo \) \\
1886 \( \emptyunit\totheinversethree \) \\
1887 \( \emptyunit\totheinversefour \)
1888 \end{dispExample}
1889 %\iffalse
1890 %</example>
1891 %\fi
1892 %
1893 %\iffalse
1894 %<*example>
1895 %\fi
1896 \begin{docCommand}[doc new = 2022-01-27,]{hbar}{}%
1897 A better glyph for Planck's constant over \( 2\pi \).
1898 \end{docCommand}
1899 \begin{dispExample}
1900 \( \hbar \)
1901 \end{dispExample}
1902 %\iffalse
1903 %</example>
1904 %\fi
1905 %
1906 %\iffalse
1907 %<*example>
1908 %\fi
1909 \begin{docCommands}[%
1910 doc parameter = \marg{number},%
1911 ]%
1912 {%
1913 {%
1914 doc name = tento,%
1915 },%
1916 {%
1917 doc name = timestento,%
1918 },%
1919 {%
1920 doc name = xtento,%
1921 },%
1922 }%
1923 Commands for powers of ten and scientific notation.
1924 \end{docCommands}
1925 \begin{dispExample}
1926 \( \tento{-4} \) \\
1927 \( 3\timestento{8} \) \\
1928 \( 3\xtento{8} \)
1929 \end{dispExample}
1930 %\iffalse
1931 %</example>
1932 %\fi
1933 %
1934 %\iffalse
1935 %<*example>
1936 %\fi
1937 \begin{docCommand}[doc updated = 2022-01-27]{mivector}{%
1938 \oarg{delimiter}\marg{\( c_{1},\dots,c_{n} \)}\oarg{units}
1939 }%
1940 Typesets a vector as either numeric or symbolic components with an
1941 optional unit (for numerical components only). There must be more
1942 than one component, and there can be more than three components.
1943 The delimiter used in the list of components can be specified;
1944 the default is a comma. The notation mirrors that of
1945 \emph{Matter \& Interactions}.
1946 \end{docCommand}
1947 \begin{dispExample*}{lefthand ratio = 0.70}
1948 \( \mivector{p_0,p_1,p_2,p_3} \) \\
1949 \( \mivector{\gamma mc,\gamma mv_{x},\gamma mv_{y},\gamma mv_{z}} \) \\
1950 \( \mivector{\frac{Q_1Q_2}{x^2},0,0} \) \\
1951 \( \mivector{-1,0,0} \) \\
1952 \( \mivector{-1,0,0}[\velocityonlyderivedunits] \) \\
1953 \( \mivector{-1,0,0}[\meter\per\second] \) \\
1954 \( \velocity{\mivector{-1,0,0}} \)
1955 \end{dispExample*}
1956 %\iffalse
1957 %</example>
1958 %\fi
1959 %
1960 % \MaybeStop{}
1961 %
1962 % \newgeometry{left=0.50in,right=0.50in,top=1.00in,bottom=1.00in}
1963 % \subsection{\mandi{} Source Code}
1964 %
1965 % \iffalse
1966 %<*package>
1967 % \fi
1968 % Define the package version and date for global use, exploiting the fact
1969 % that in a \pkg{.sty} file there is now no need for |\makeatletter| and
1970 % |\makeatother|. This simplifies defining internal commands (with |@|
1971 % in the name) that are not for the user to know about.
1972 %
1973 % \begin{macrocode}
1974 \def\mandi@version{3.2.2}
1975 \def\mandi@date{2024-02-27}
1976 \NeedsTeXFormat{LaTeX2e}[2020-02-02]
1977 \DeclareRelease{v3.2.2}{2024-02-27}{mandi.sty}
1978 \DeclareCurrentRelease{v\mandi@version}{\mandi@date}
1979 \ProvidesPackage{mandi}
1980 [\mandi@date\space v\mandi@version\space Macros for physical quantities]
1981 % \end{macrocode}
1982 %
1983 % Define a convenient package version command.
1984 %
1985 % \begin{macrocode}
1986 \newcommand*{\mandiversion}{v\mandi@version\space dated \mandi@date}
1987 % \end{macrocode}
1988 %
1989 % Load third party packages, documenting why each one is needed.
1990 %
1991 % We need \pkg{pgfopts} for a key-value interface.
1992 %
1993 % \begin{macrocode}
1994 \RequirePackage{pgfopts}
1995 % \end{macrocode}
1996 %
1997 % We need \pkg{array} for |\chkquantity| and |\chkconstant|.
1998 %
1999 % \begin{macrocode}
2000 \RequirePackage{array}
2001 % \end{macrocode}
2002 %
2003 % We need \pkg{iftex} so we can require \lualatex.
2004 %
2005 % \begin{macrocode}
2006 \RequirePackage{iftex}
2007 % \end{macrocode}
2008 %
2009 % We need \pkg{mathtools} for intelligent delimiters.
2010 %
2011 % \begin{macrocode}
2012 \RequirePackage{mathtools}
2013 % \end{macrocode}
2014 %
2015 % We need \pkg{unicode-math} for Unicode support and changing fonts.
2016 %
2017 % \begin{macrocode}
2018 \RequirePackage{unicode-math}
2019 % \end{macrocode}
2020 %
2021 % Suppress some annoying warnings.
2022 %
2023 % \begin{macrocode}
2024 \unimathsetup{warnings-off={mathtools-colon,mathtools-overbracket}}
2025 % \end{macrocode}
2026 %
2027 % Load \pkg{xparse} if necessary.
2028 %
2029 % \begin{macrocode}
2030 \IfFormatAtLeastTF{2020-10-01}
2031 {}%
2032 {\RequirePackage{xparse}}%
2033 % \end{macrocode}
2034 %
2035 % We require the \lualatex{} engine.
2036 %
2037 % \begin{macrocode}
2038 \RequireLuaTeX
2039 % \end{macrocode}
2040 %
2041 % Parts of the unit engine have been rewritten with
2042 % \href{https://www.ctan.org/pkg/xparse}{\pkg{xparse}} for both clarity
2043 % and power. Note that \pkg{xparse} is now part of the \LaTeXe{} kernel.
2044 % Other parts have been rewritten in
2045 % \href{https://www.ctan.org/pkg/expl}{\pkg{expl}} with a look to the
2046 % future.
2047 %
2048 % Define some generic internal selectors.
2049 %
2050 % \begin{macrocode}
2051 \newcommand*{\mandi@selectunits}{}
2052 \newcommand*{\mandi@selectprecision}{}
2053 % \end{macrocode}
2054 %
2055 % Define some specific internal selectors. The first two are really just
2056 % workalikes for |\@firstoftwo| and |\@secondoftwo|. The third, fourth,
2057 % and fifth are |\@firstofthree|, |\@secondofthree|, and |\@thirdofthree|
2058 % and apparently do not yet exist.
2059 %
2060 % \begin{macrocode}
2061 \newcommand*{\mandi@selectapproximate}[2]{#1}
2062 \newcommand*{\mandi@selectprecise}[2]{#2}
2063 \newcommand*{\mandi@selectbaseunits}[3]{#1}
2064 \newcommand*{\mandi@selectderivedunits}[3]{#2}
2065 \newcommand*{\mandi@selectalternateunits}[3]{#3}
2066 % \end{macrocode}
2067 %
2068 % Document level global switches.
2069 %
2070 % \begin{macrocode}
2071 \NewDocumentCommand{\alwaysusebaseunits}{}
2072 {\renewcommand*{\mandi@selectunits}{\mandi@selectbaseunits}}%
2073 \NewDocumentCommand{\alwaysusederivedunits}{}
2074 {\renewcommand*{\mandi@selectunits}{\mandi@selectderivedunits}}%
2075 \NewDocumentCommand{\alwaysusealternateunits}{}
2076 {\renewcommand*{\mandi@selectunits}{\mandi@selectalternateunits}}%
2077 \NewDocumentCommand{\alwaysuseapproximateconstants}{}
2078 {\renewcommand*{\mandi@selectprecision}{\mandi@selectapproximate}}%
2079 \NewDocumentCommand{\alwaysusepreciseconstants}{}
2080 {\renewcommand*{\mandi@selectprecision}{\mandi@selectprecise}}%
2081 % \end{macrocode}
2082 %
2083 % Document level localized variants.
2084 %
2085 % \begin{macrocode}
2086 \NewDocumentCommand{\hereusebaseunits}{ m }{\begingroup\alwaysusebaseunits#1\endgroup}%
2087 \NewDocumentCommand{\hereusederivedunits}{ m }{\begingroup\alwaysusederivedunits#1\endgroup}%
2088 \NewDocumentCommand{\hereusealternateunits}{ m }{\begingroup\alwaysusealternateunits#1\endgroup}%
2089 \NewDocumentCommand{\hereuseapproximateconstants}{ m }{\begingroup\alwaysuseapproximateconstants#1\endgroup}%
2090 \NewDocumentCommand{\hereusepreciseconstants}{ m }{\begingroup\alwaysusepreciseconstants#1\endgroup}%
2091 % \end{macrocode}
2092 %
2093 % Document level environments.
2094 %
2095 % \begin{macrocode}
2096 \NewDocumentEnvironment{usebaseunits}{}{\alwaysusebaseunits}{}%
2097 \NewDocumentEnvironment{usederivedunits}{}{\alwaysusederivedunits}{}%
2098 \NewDocumentEnvironment{usealternateunits}{}{\alwaysusealternateunits}{}%
2099 \NewDocumentEnvironment{useapproximateconstants}{}{\alwaysuseapproximateconstants}{}%
2100 \NewDocumentEnvironment{usepreciseconstants}{}{\alwaysusepreciseconstants}{}%
2101 % \end{macrocode}
2102 %
2103 % \mandi{} now has a key-value interface, implemented with
2104 % \href{https://www.ctan.org/pkg/pgfopts}{\pkg{pgfopts}} and
2105 % \href{https://www.ctan.org/pkg/pgfkeys}{\pkg{pgfkeys}}.
2106 % There are two options:\newline
2107 % \refKey{units}, with values \docValue{base}, \docValue{derived}, or
2108 % \docValue{alternate} selects the default form of units\newline
2109 % \refKey{preciseconstants}, with values \docValue{true} and
2110 % \docValue{false}, selects precise numerical values for constants
2111 % rather than approximate values.
2112 %
2113 % First, define the keys. The key handlers require certain commands defined
2114 % by the unit engine.
2115 %
2116 % \changes{v3.1.0}{2022-01-27}
2117 % {\linktoplace{sec:mandia}{mandi} Unknown package options handled safely}
2118 % \begin{macrocode}
2119 \newif\ifusingpreciseconstants
2120 \pgfkeys{%
2121 /mandi/options/.cd,
2122 initial@setup/.style={%
2123 /mandi/options/buffered@units/.initial=alternate,%
2124 },%
2125 initial@setup,%
2126 preciseconstants/.is if=usingpreciseconstants,%
2127 units/.is choice,%
2128 units/.default=derived,%
2129 units/alternate/.style={/mandi/options/buffered@units=alternate},%
2130 units/base/.style={/mandi/options/buffered@units=base},%
2131 units/derived/.style={/mandi/options/buffered@units=derived},%
2132 .unknown/.code={%
2133 \typeout{}%
2134 \typeout{mandi: You used unknown option '\pgfkeyscurrentname'.}%
2135 },%
2136 }%
2137 % \end{macrocode}
2138 %
2139 % Process the options.
2140 %
2141 % \begin{macrocode}
2142 \ProcessPgfPackageOptions{/mandi/options}
2143 % \end{macrocode}
2144 %
2145 % Write a banner to the console showing the options in use.
2146 %
2147 % \begin{macrocode}
2148 \typeout{}%
2149 \typeout{mandi: You are using mandi \mandiversion.}%
2150 \typeout{mandi: This package requires LuaLaTeX.}%
2151 \typeout{mandi: Loadtime options...}
2152 % \end{macrocode}
2153 %
2154 % Complete the banner by showing currently selected options.
2155 % The value of the \refKey{units} key is used in situ to set
2156 % the default units.
2157 %
2158 % \begin{macrocode}
2159 \newcommand*{\mandi@do@setup}{%
2160 \csname alwaysuse\pgfkeysvalueof{/mandi/options/buffered@units}units\endcsname%
2161 \typeout{mandi: You will get \pgfkeysvalueof{/mandi/options/buffered@units}\space units.}%
2162 \ifusingpreciseconstants
2163 \alwaysusepreciseconstants
2164 \typeout{mandi: You will get precise constants.}%
2165 \else
2166 \alwaysuseapproximateconstants
2167 \typeout{mandi: You will get approximate constants.}%
2168 \fi
2169 \typeout{}%
2170 }%
2171 \mandi@do@setup
2172 % \end{macrocode}
2173 %
2174 % Define a setup command that overrides the loadtime options
2175 % when called with new options. A new banner is written to
2176 % the console.
2177 %
2178 % \begin{macrocode}
2179 \NewDocumentCommand{\mandisetup}{ m }%
2180 {%
2181 \IfValueT{#1}%
2182 {%
2183 \pgfqkeys{/mandi/options}{#1}
2184 \typeout{}%
2185 \typeout{mandi: mandisetup options...}
2186 \mandi@do@setup
2187 }%
2188 }%
2189 % \end{macrocode}
2190 %
2191 % Define units and related constructs to be used with the unit engine.
2192 % All single letter macros are now gone. We basically absorbed and
2193 % adapted the now outdated
2194 % \href{https://ctan.org/pkg/siunits}{\pkg{SIunits}} package.
2195 % We make use of |\symup{...}| from the \pkg{unicode-math} package.
2196 %
2197 % \changes{v3.1.0}{2022-01-27}
2198 % {\linktoplace{sec:mandia}{mandi} Added a negative space to \refCom{lightspeed}}
2199 % \changes{v3.2.0}{2023-08-01}
2200 % {\linktoplace{sec:mandia}{mandi} Changed \cs{unit} to \cs{units}}
2201 % \begin{macrocode}
2202 \NewDocumentCommand{\per}{}{/}
2203 \NewDocumentCommand{\usk}{}{\cdot}
2204 \NewDocumentCommand{\units}{ m m }%
2205 {%
2206 \IfValueTF{#2}
2207 {%
2208 {#1}{\,#2}
2209 }%
2210 {%
2211 {#1}{}
2212 }%
2213 }%
2214 \NewDocumentCommand{\ampere}{}{\symup{A}}
2215 \NewDocumentCommand{\atomicmassunit}{}{\symup{u}}
2216 \NewDocumentCommand{\candela}{}{\symup{cd}}
2217 \NewDocumentCommand{\coulomb}{}{\symup{C}}
2218 \NewDocumentCommand{\degree}{}{^{\circ}}
2219 \NewDocumentCommand{\electronvolt}{}{\symup{eV}}
2220 \NewDocumentCommand{\ev}{}{\electronvolt}
2221 \NewDocumentCommand{\farad}{}{\symup{F}}
2222 \NewDocumentCommand{\henry}{}{\symup{H}}
2223 \NewDocumentCommand{\hertz}{}{\symup{Hz}}
2224 \NewDocumentCommand{\joule}{}{\symup{J}}
2225 \NewDocumentCommand{\kelvin}{}{\symup{K}}
2226 \NewDocumentCommand{\kev}{}{\kiloelectronvolt}
2227 \NewDocumentCommand{\kiloelectronvolt}{}{\symup{keV}}
2228 \NewDocumentCommand{\kilogram}{}{\symup{kg}}
2229 \NewDocumentCommand{\lightspeed}{}{\!\symup{c}}
2230 \NewDocumentCommand{\megaelectronvolt}{}{\symup{MeV}}
2231 \NewDocumentCommand{\meter}{}{\symup{m}}
2232 \NewDocumentCommand{\metre}{}{\meter}
2233 \NewDocumentCommand{\mev}{}{\megaelectronvolt}
2234 \NewDocumentCommand{\mole}{}{\symup{mol}}
2235 \NewDocumentCommand{\newton}{}{\symup{N}}
2236 \NewDocumentCommand{\ohm}{}{\symup\Omega}
2237 \NewDocumentCommand{\pascal}{}{\symup{Pa}}
2238 \NewDocumentCommand{\radian}{}{\symup{rad}}
2239 \NewDocumentCommand{\second}{}{\symup{s}}
2240 \NewDocumentCommand{\siemens}{}{\symup{S}}
2241 \NewDocumentCommand{\steradian}{}{\symup{sr}}
2242 \NewDocumentCommand{\tesla}{}{\symup{T}}
2243 \NewDocumentCommand{\volt}{}{\symup{V}}
2244 \NewDocumentCommand{\watt}{}{\symup{W}}
2245 \NewDocumentCommand{\weber}{}{\symup{Wb}}
2246 \NewDocumentCommand{\tothetwo}{}{^{2}}
2247 \NewDocumentCommand{\tothethree}{}{^{3}}
2248 \NewDocumentCommand{\tothefour}{}{^{4}}
2249 \NewDocumentCommand{\inverse}{}{^{-1}}
2250 \NewDocumentCommand{\totheinversetwo}{}{^{-2}}
2251 \NewDocumentCommand{\totheinversethree}{}{^{-3}}
2252 \NewDocumentCommand{\totheinversefour}{}{^{-4}}
2253 \NewDocumentCommand{\emptyunit}{}{\mdlgwhtsquare}
2254 \NewDocumentCommand{\tento}{ m }{10^{#1}}
2255 \NewDocumentCommand{\timestento}{ m }{\times\tento{#1}}
2256 \NewDocumentCommand{\xtento}{ m }{\times\tento{#1}}
2257 % \end{macrocode}
2258 %
2259 % \begin{macrocode}
2260 \ExplSyntaxOn
2261 \cs_new:Npn \__mandi_newscalarquantity:nnnn #1#2#3#4
2262 {
2263 \cs_new:cpn {#1} ##1 {\units{##1}{\mandi@selectunits{#2}{#3}{#4}}}
2264 \cs_new:cpn {#1value} ##1 {##1}
2265 \cs_new:cpn {#1baseunits} ##1 {\units{##1}{\mandi@selectbaseunits{#2}{#3}{#4}}}
2266 \cs_new:cpn {#1derivedunits} ##1 {\units{##1}{\mandi@selectderivedunits{#2}{#3}{#4}}}
2267 \cs_new:cpn {#1alternateunits} ##1 {\units{##1}{\mandi@selectalternateunits{#2}{#3}{#4}}}
2268 \cs_new:cpn {#1onlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}}
2269 \cs_new:cpn {#1onlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}}
2270 \cs_new:cpn {#1onlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}}
2271 }
2272 \NewDocumentCommand{\NewScalarQuantity}{ m m O{#2} O{#2} }
2273 {
2274 \__mandi_newscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
2275 }
2276 % \end{macrocode}
2277 %
2278 % Redefining an existing scalar quantity.
2279 %
2280 % \begin{macrocode}
2281 \cs_new:Npn \__mandi_renewscalarquantity:nnnn #1#2#3#4
2282 {
2283 \cs_set:cpn {#1} ##1 {\units{##1}{\mandi@selectunits{#2}{#3}{#4}}}
2284 \cs_set:cpn {#1value} ##1 {##1}
2285 \cs_set:cpn {#1baseunits} ##1 {\units{##1}{\mandi@selectbaseunits{#2}{#3}{#4}}}
2286 \cs_set:cpn {#1derivedunits} ##1 {\units{##1}{\mandi@selectderivedunits{#2}{#3}{#4}}}
2287 \cs_set:cpn {#1alternateunits} ##1 {\units{##1}{\mandi@selectalternateunits{#2}{#3}{#4}}}
2288 \cs_set:cpn {#1onlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}}
2289 \cs_set:cpn {#1onlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}}
2290 \cs_set:cpn {#1onlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}}
2291 }
2292 \NewDocumentCommand{\RenewScalarQuantity}{ m m O{#2} O{#2} }
2293 {
2294 \__mandi_renewscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
2295 }
2296 % \end{macrocode}
2297 %
2298 % Defining a new vector quantity. Note that a corresponding scalar is also defined.
2299 %
2300 % \begin{macrocode}
2301 \cs_new:Npn \__mandi_newvectorquantity:nnnn #1#2#3#4
2302 {
2303 \__mandi_newscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
2304 \cs_new:cpn {vector#1} ##1 {\units{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}}
2305 \cs_new:cpn {#1vector} ##1 {\units{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}}
2306 \cs_new:cpn {vector#1value} ##1 {\mivector{##1}}
2307 \cs_new:cpn {#1vectorvalue} ##1 {\mivector{##1}}
2308 \cs_new:cpn {vector#1baseunits} ##1 {\units{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}}
2309 \cs_new:cpn {#1vectorbaseunits} ##1 {\units{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}}
2310 \cs_new:cpn {vector#1derivedunits} ##1 {\units{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}}
2311 \cs_new:cpn {#1vectorderivedunits} ##1 {\units{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}}
2312 \cs_new:cpn {vector#1alternateunits} ##1 {\units{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}}
2313 \cs_new:cpn {#1vectoralternateunits} ##1 {\units{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}}
2314 \cs_new:cpn {vector#1onlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}}
2315 \cs_new:cpn {#1vectoronlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}}
2316 \cs_new:cpn {vector#1onlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}}
2317 \cs_new:cpn {#1vectoronlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}}
2318 \cs_new:cpn {vector#1onlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}}
2319 \cs_new:cpn {#1vectoronlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}}
2320 }
2321 \NewDocumentCommand{\NewVectorQuantity}{ m m O{#2} O{#2} }
2322 {
2323 \__mandi_newvectorquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
2324 }
2325 % \end{macrocode}
2326 %
2327 % Redefining an existing vector quantity. Note that a corresponding scalar is also redefined.
2328 %
2329 % \begin{macrocode}
2330 \cs_new:Npn \__mandi_renewvectorquantity:nnnn #1#2#3#4
2331 {
2332 \__mandi_renewscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
2333 \cs_set:cpn {vector#1} ##1 {\units{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}}
2334 \cs_set:cpn {#1vector} ##1 {\units{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}}
2335 \cs_set:cpn {vector#1value} ##1 {\mivector{##1}}
2336 \cs_set:cpn {#1vectorvalue} ##1 {\mivector{##1}}
2337 \cs_set:cpn {vector#1baseunits} ##1 {\units{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}}
2338 \cs_set:cpn {#1vectorbaseunits} ##1 {\units{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}}
2339 \cs_set:cpn {vector#1derivedunits} ##1 {\units{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}}
2340 \cs_set:cpn {#1vectorderivedunits} ##1 {\units{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}}
2341 \cs_set:cpn {vector#1alternateunits} ##1 {\units{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}}
2342 \cs_set:cpn {#1vectoralternateunits} ##1 {\units{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}}
2343 \cs_set:cpn {vector#1onlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}}
2344 \cs_set:cpn {#1vectoronlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}}
2345 \cs_set:cpn {vector#1onlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}}
2346 \cs_set:cpn {#1vectoronlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}}
2347 \cs_set:cpn {vector#1onlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}}
2348 \cs_set:cpn {#1vectoronlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}}
2349 }
2350 \NewDocumentCommand{\RenewVectorQuantity}{ m m O{#2} O{#2} }
2351 {
2352 \__mandi_renewvectorquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
2353 }
2354 % \end{macrocode}
2355 %
2356 % Defining a new physical constant.
2357 %
2358 % \begin{macrocode}
2359 \cs_new:Npn \__mandi_newphysicalconstant:nnnnnnn #1#2#3#4#5#6#7
2360 {
2361 \cs_new:cpn {#1} {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}}
2362 \cs_new:cpn {#1mathsymbol} {#2}
2363 \cs_new:cpn {#1approximatevalue} {#3}
2364 \cs_new:cpn {#1precisevalue} {#4}
2365 \cs_new:cpn {#1baseunits}
2366 {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectbaseunits{#5}{#6}{#7}}}
2367 \cs_new:cpn {#1derivedunits}
2368 {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectderivedunits{#5}{#6}{#7}}}
2369 \cs_new:cpn {#1alternateunits}
2370 {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectalternateunits{#5}{#6}{#7}}}
2371 \cs_new:cpn {#1onlybaseunits} {\mandi@selectbaseunits{#5}{#6}{#7}}
2372 \cs_new:cpn {#1onlyderivedunits} {\mandi@selectderivedunits{#5}{#6}{#7}}
2373 \cs_new:cpn {#1onlyalternateunits} {\mandi@selectalternateunits{#5}{#6}{#7}}
2374 }
2375 \NewDocumentCommand{\NewPhysicalConstant}{ m m m m m O{#5} O{#5} }
2376 {
2377 \__mandi_newphysicalconstant:nnnnnnn { #1 }{ #2 }{ #3 }{ #4 }{ #5 }{ #6 }{ #7 }
2378 }
2379 % \end{macrocode}
2380 %
2381 % Redefining an existing physical constant.
2382 %
2383 % \begin{macrocode}
2384 \cs_new:Npn \__mandi_renewphysicalconstant:nnnnnnn #1#2#3#4#5#6#7
2385 {
2386 \cs_set:cpn {#1} {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}}
2387 \cs_set:cpn {#1mathsymbol} {#2}
2388 \cs_set:cpn {#1approximatevalue} {#3}
2389 \cs_set:cpn {#1precisevalue} {#4}
2390 \cs_set:cpn {#1baseunits}
2391 {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectbaseunits{#5}{#6}{#7}}}
2392 \cs_set:cpn {#1derivedunits}
2393 {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectderivedunits{#5}{#6}{#7}}}
2394 \cs_set:cpn {#1alternateunits}
2395 {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectalternateunits{#5}{#6}{#7}}}
2396 \cs_set:cpn {#1onlybaseunits} {\mandi@selectbaseunits{#5}{#6}{#7}}
2397 \cs_set:cpn {#1onlyderivedunits} {\mandi@selectderivedunits{#5}{#6}{#7}}
2398 \cs_set:cpn {#1onlyalternateunits} {\mandi@selectalternateunits{#5}{#6}{#7}}
2399 }
2400 \NewDocumentCommand{\RenewPhysicalConstant}{ m m m m m O{#5} O{#5} }
2401 {
2402 \__mandi_renewphysicalconstant:nnnnnnn { #1 }{ #2 }{ #3 }{ #4 }{ #5 }{ #6 }{ #7 }
2403 }
2404 \ExplSyntaxOff
2405 % \end{macrocode}
2406 %
2407 % Define every quantity we need in introductory physics, alphabetically
2408 % for convenience. This is really the core feature of \mandi{} that no other
2409 % package offers. There are commands for quantities that have no dimensions
2410 % or units, and these quantities are defined for semantic completeness.
2411 %
2412 % \begin{macrocode}
2413 \NewVectorQuantity{acceleration}%
2414 {\meter\usk\second\totheinversetwo}%
2415 [\newton\per\kilogram]%
2416 [\meter\per\second\tothetwo]%
2417 \NewScalarQuantity{amount}%
2418 {\mole}%
2419 \NewVectorQuantity{angularacceleration}%
2420 {\radian\usk\second\totheinversetwo}%
2421 [\radian\per\second\tothetwo]%
2422 [\radian\per\second\tothetwo]%
2423 \NewScalarQuantity{angularfrequency}%
2424 {\radian\usk\second\inverse}%
2425 [\radian\per\second]%
2426 [\radian\per\second]%
2427 % \end{macrocode}
2428 %
2429 % Angular impulse may also be |\newton\usk\meter\usk\second| or
2430 % |\joule\usk\second|.
2431 %
2432 % \begin{macrocode}
2433 \NewVectorQuantity{angularimpulse}%
2434 {\kilogram\usk\meter\tothetwo\usk\second\inverse}%
2435 [\kilogram\usk\meter\tothetwo\per\second]%
2436 [\kilogram\usk\meter\tothetwo\per\second]%
2437 % \end{macrocode}
2438 %
2439 % Angular momentum may also be |\joule\usk\second| or
2440 % |\newton\usk\meter\usk\second|.
2441 %
2442 % \begin{macrocode}
2443 \NewVectorQuantity{angularmomentum}%
2444 {\kilogram\usk\meter\tothetwo\usk\second\inverse}%
2445 [\kilogram\usk\meter\tothetwo\per\second]%
2446 [\kilogram\usk\meter\tothetwo\per\second]%
2447 % \end{macrocode}
2448 %
2449 % \begin{macrocode}
2450 \NewVectorQuantity{angularvelocity}%
2451 {\radian\usk\second\inverse}%
2452 [\radian\per\second]%
2453 [\radian\per\second]%
2454 \NewScalarQuantity{area}%
2455 {\meter\tothetwo}%
2456 \NewScalarQuantity{areachargedensity}%
2457 {\ampere\usk\second\usk\meter\totheinversetwo}%
2458 [\coulomb\per\meter\tothetwo]%
2459 [\coulomb\per\meter\tothetwo]%
2460 \NewScalarQuantity{areamassdensity}%
2461 {\kilogram\usk\meter\totheinversetwo}%
2462 [\kilogram\per\meter\tothetwo]%
2463 [\kilogram\per\meter\tothetwo]%
2464 % \end{macrocode}
2465 %
2466 % Capacitance may also be |\coulomb\tothetwo\per\newton\usk\meter| or
2467 % |\second\per\ohm|.
2468 %
2469 % \begin{macrocode}
2470 \NewScalarQuantity{capacitance}%
2471 {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse\usk\meter\totheinversetwo}%
2472 [\farad]%
2473 [\coulomb\per\volt]%
2474 % \end{macrocode}
2475 %
2476 % Charge may also be |\farad\usk\volt|.
2477 %
2478 % \begin{macrocode}
2479 \NewScalarQuantity{charge}%
2480 {\ampere\usk\second}%
2481 [\coulomb]%
2482 [\coulomb]%
2483 % \end{macrocode}
2484 %
2485 % Magnetic field times \(\symup{c}\) may also be |\volt\per\meter|.
2486 %
2487 % \begin{macrocode}
2488 \NewVectorQuantity{cmagneticfield}%
2489 {\kilogram\usk\meter\usk\ampere\inverse\usk\second\totheinversethree}%
2490 [\newton\per\coulomb]%
2491 [\newton\per\coulomb]%
2492 % \end{macrocode}
2493 %
2494 % \begin{macrocode}
2495 \NewScalarQuantity{conductance}%
2496 {\ampere\tothetwo\usk\second\tothethree\usk\kilogram\inverse\usk\meter\totheinversetwo}%
2497 [\siemens]%
2498 [\ampere\per\volt]%
2499 \NewScalarQuantity{conductivity}%
2500 {\ampere\tothetwo\usk\second\tothethree\usk\kilogram\inverse\usk\meter\totheinversethree}%
2501 [\siemens\per\meter]%
2502 [\ampere\per\volt\usk\meter]%
2503 \NewScalarQuantity{conventionalcurrent}%
2504 {\ampere}%
2505 [\coulomb\per\second]%
2506 [\ampere]%
2507 \NewScalarQuantity{current}%
2508 {\ampere}%
2509 \NewScalarQuantity{currentdensity}%
2510 {\ampere\usk\meter\totheinversetwo}%
2511 [\coulomb\per\second\usk\meter\tothetwo]%
2512 [\ampere\per\meter\tothetwo]%
2513 \NewScalarQuantity{dielectricconstant}%
2514 {}%
2515 \NewVectorQuantity{direction}%
2516 {}%
2517 \NewVectorQuantity{displacement}%
2518 {\meter}
2519 \NewScalarQuantity{duration}%
2520 {\second}%
2521 \NewVectorQuantity{electricdipolemoment}%
2522 {\ampere\usk\second\usk\meter}%
2523 [\coulomb\usk\meter]%
2524 [\coulomb\usk\meter]%
2525 \NewVectorQuantity{electricfield}%
2526 {\kilogram\usk\meter\usk\ampere\inverse\usk\second\totheinversethree}%
2527 [\volt\per\meter]%
2528 [\newton\per\coulomb]%
2529 \NewScalarQuantity{electricflux}%
2530 {\kilogram\usk\meter\tothethree\usk\ampere\inverse\usk\second\totheinversethree}%
2531 [\volt\usk\meter]%
2532 [\newton\usk\meter\tothetwo\per\coulomb]%
2533 % \end{macrocode}
2534 %
2535 % Electric potential, electric potential difference, and emf
2536 % may also be |\joule\per\coulomb|.
2537 %
2538 % \begin{macrocode}
2539 \NewScalarQuantity{electricpotential}%
2540 {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversethree}%
2541 [\volt]%
2542 [\volt]%
2543 % \end{macrocode}
2544 %
2545 % \begin{macrocode}
2546 \NewScalarQuantity{electricpotentialdifference}%
2547 {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversethree}%
2548 [\volt]%
2549 [\volt]%
2550 \NewScalarQuantity{electroncurrent}%
2551 {\second\inverse}%
2552 [\ensuremath{\symup{e}}\per\second]%
2553 [\ensuremath{\symup{e}}\per\second]%
2554 \NewScalarQuantity{emf}%
2555 {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversethree}%
2556 [\volt]%
2557 [\volt]%
2558 % \end{macrocode}
2559 %
2560 % Energy may also be |\newton\usk\meter|.
2561 %
2562 % \begin{macrocode}
2563 \NewScalarQuantity{energy}%
2564 {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo}%
2565 [\joule]%
2566 [\joule]%
2567 % \end{macrocode}
2568 %
2569 % \begin{macrocode}
2570 \NewScalarQuantity{energyinev}%
2571 {\electronvolt}%
2572 \NewScalarQuantity{energyinkev}%
2573 {\kiloelectronvolt}%
2574 \NewScalarQuantity{energyinmev}%
2575 {\megaelectronvolt}%
2576 \NewScalarQuantity{energydensity}%
2577 {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}%
2578 [\joule\per\meter\tothethree]%
2579 [\joule\per\meter\tothethree]%
2580 \NewScalarQuantity{energyflux}%
2581 {\kilogram\usk\second\totheinversethree}%
2582 [\watt\per\meter\tothetwo]%
2583 [\watt\per\meter\tothetwo]%
2584 \NewScalarQuantity{entropy}%
2585 {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo\usk\kelvin\inverse}%
2586 [\joule\per\kelvin]%
2587 [\joule\per\kelvin]%
2588 % \end{macrocode}
2589 %
2590 % Force may also be |\kilogram\usk\meter\per\second\tothetwo|.
2591 %
2592 % \begin{macrocode}
2593 \NewVectorQuantity{force}%
2594 {\kilogram\usk\meter\usk\second\totheinversetwo}%
2595 [\newton]%
2596 [\newton]%
2597 % \end{macrocode}
2598 %
2599 % \begin{macrocode}
2600 \NewScalarQuantity{frequency}%
2601 {\second\inverse}%
2602 [\hertz]%
2603 [\hertz]%
2604 \NewVectorQuantity{gravitationalfield}%
2605 {\meter\usk\second\totheinversetwo}%
2606 [\newton\per\kilogram]%
2607 [\newton\per\kilogram]%
2608 \NewScalarQuantity{gravitationalpotential}%
2609 {\meter\tothetwo\usk\second\totheinversetwo}%
2610 [\joule\per\kilogram]%
2611 [\joule\per\kilogram]%
2612 \NewScalarQuantity{gravitationalpotentialdifference}%
2613 {\meter\tothetwo\usk\second\totheinversetwo}%
2614 [\joule\per\kilogram]%
2615 [\joule\per\kilogram]%
2616 \NewVectorQuantity{impulse}%
2617 {\kilogram\usk\meter\usk\second\inverse}%
2618 [\newton\usk\second]%
2619 [\newton\usk\second]%
2620 \NewScalarQuantity{indexofrefraction}%
2621 {}%
2622 % \end{macrocode}
2623 %
2624 % Inductance may also be |\square\meter\usk\kilogram\per\coulomb\tothetwo| or
2625 % |\Wb\per\ampere|.
2626 %
2627 % \begin{macrocode}
2628 \NewScalarQuantity{inductance}%
2629 {\kilogram\usk\meter\tothetwo\usk\ampere\totheinversetwo\usk\second\totheinversetwo}%
2630 [\henry]%
2631 [\volt\usk\second\per\ampere]%
2632 % \end{macrocode}
2633 %
2634 % \begin{macrocode}
2635 \NewScalarQuantity{linearchargedensity}%
2636 {\ampere\usk\second\usk\meter\inverse}%
2637 [\coulomb\per\meter]%
2638 [\coulomb\per\meter]%
2639 \NewScalarQuantity{linearmassdensity}%
2640 {\kilogram\usk\meter\inverse}%
2641 [\kilogram\per\meter]%
2642 [\kilogram\per\meter]%
2643 % \end{macrocode}
2644 %
2645 % \changes{v3.1.0}{2022-01-27}
2646 % {\linktoplace{sec:mandia}{mandi} Added \refCom{lorentzfactor}}
2647 % \begin{macrocode}
2648 \NewScalarQuantity{lorentzfactor}%
2649 {}%
2650 \NewScalarQuantity{luminousintensity}%
2651 {\candela}%
2652 % \end{macrocode}
2653 %
2654 % There is another convention for magnetic charge, so be careful.
2655 %
2656 % \begin{macrocode}
2657 \NewScalarQuantity{magneticcharge}%
2658 {\ampere\usk\meter}%
2659 % \end{macrocode}
2660 %
2661 % \begin{macrocode}
2662 \NewVectorQuantity{magneticdipolemoment}%
2663 {\ampere\usk\meter\tothetwo}%
2664 [\ampere\usk\meter\tothetwo]%
2665 [\joule\per\tesla]%
2666 % \end{macrocode}
2667 %
2668 % Magnetic field may also be |\Wb\per\meter\tothetwo|.
2669 %
2670 % \begin{macrocode}
2671 \NewVectorQuantity{magneticfield}%
2672 {\kilogram\usk\ampere\inverse\usk\second\totheinversetwo}%
2673 [\newton\per\ampere\usk\meter]%
2674 [\tesla]%
2675 % \end{macrocode}
2676 %
2677 % Magnetic flux may also be |\Wb| or
2678 % |\joule\per\ampere|.
2679 %
2680 % \begin{macrocode}
2681 \NewScalarQuantity{magneticflux}%
2682 {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversetwo}%
2683 [\tesla\usk\meter\tothetwo]%
2684 [\volt\usk\second]%
2685 % \end{macrocode}
2686 %
2687 % \begin{macrocode}
2688 \NewScalarQuantity{mass}%
2689 {\kilogram}%
2690 \NewScalarQuantity{mobility}%
2691 {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversefour}%
2692 [\meter\tothetwo\per\volt\usk\second]%
2693 [\coulomb\usk\meter\per\newton\usk\second]%
2694 \NewScalarQuantity{momentofinertia}%
2695 {\kilogram\usk\meter\tothetwo}%
2696 [\joule\usk\second\tothetwo]%
2697 [\kilogram\usk\meter\tothetwo]%
2698 \NewVectorQuantity{momentum}%
2699 {\kilogram\usk\meter\usk\second\inverse}%
2700 [\kilogram\usk\meter\per\second]%
2701 [\kilogram\usk\meter\per\second]%
2702 \NewVectorQuantity{momentumflux}%
2703 {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}%
2704 [\newton\per\meter\tothetwo]%
2705 [\newton\per\meter\tothetwo]%
2706 \NewScalarQuantity{numberdensity}%
2707 {\meter\totheinversethree}%
2708 [\per\meter\tothethree]%
2709 [\per\meter\tothethree]%
2710 \NewScalarQuantity{permeability}%
2711 {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}%
2712 [\henry\per\meter]%
2713 [\tesla\usk\meter\per\ampere]%
2714 \NewScalarQuantity{permittivity}%
2715 {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse\usk\meter\totheinversethree}%
2716 [\farad\per\meter]%
2717 [\coulomb\tothetwo\per\newton\usk\meter\tothetwo]%
2718 \NewScalarQuantity{planeangle}%
2719 {\meter\usk\meter\inverse}%
2720 [\radian]%
2721 [\radian]%
2722 \NewScalarQuantity{polarizability}%
2723 {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse}%
2724 [\coulomb\usk\meter\tothetwo\per\volt]%
2725 [\coulomb\tothetwo\usk\meter\per\newton]%
2726 \NewScalarQuantity{power}%
2727 {\kilogram\usk\meter\tothetwo\usk\second\totheinversethree}%
2728 [\watt]%
2729 [\joule\per\second]%
2730 \NewVectorQuantity{poynting}%
2731 {\kilogram\usk\second\totheinversethree}%
2732 [\watt\per\meter\tothetwo]%
2733 [\watt\per\meter\tothetwo]%
2734 \NewScalarQuantity{pressure}%
2735 {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}%
2736 [\pascal]%
2737 [\newton\per\meter\tothetwo]%
2738 \NewScalarQuantity{relativepermeability}
2739 {}%
2740 \NewScalarQuantity{relativepermittivity}%
2741 {}%
2742 % \end{macrocode}
2743 %
2744 % Resistance may also be |\volt\per\ampere|.
2745 %
2746 % \begin{macrocode}
2747 \NewScalarQuantity{resistance}%
2748 {\kilogram\usk\meter\tothetwo\usk\ampere\totheinversetwo\usk\second\totheinversethree}%
2749 [\ohm]%
2750 [\ohm]%
2751 % \end{macrocode}
2752 %
2753 % \begin{macrocode}
2754 \NewScalarQuantity{resistivity}%
2755 {\kilogram\usk\meter\tothethree\usk\ampere\totheinversetwo\usk\second\totheinversethree}%
2756 [\ohm\usk\meter]%
2757 [\volt\usk\meter\per\ampere]%
2758 \NewScalarQuantity{solidangle}%
2759 {\meter\tothetwo\usk\meter\totheinversetwo}%
2760 [\steradian]%
2761 [\steradian]%
2762 \NewScalarQuantity{specificheatcapacity}%
2763 {\meter\tothetwo\usk\second\totheinversetwo\usk\kelvin\inverse}%
2764 [\joule\per\kelvin\usk\kilogram]%
2765 [\joule\per\kelvin\usk\kilogram]
2766 \NewScalarQuantity{springstiffness}%
2767 {\kilogram\usk\second\totheinversetwo}%
2768 [\newton\per\meter]%
2769 [\newton\per\meter]%
2770 % \end{macrocode}
2771 %
2772 % Spring stretch is really just a displacement.
2773 %
2774 % \begin{macrocode}
2775 \NewScalarQuantity{springstretch}%
2776 {\meter}%
2777 % \end{macrocode}
2778 %
2779 % \begin{macrocode}
2780 \NewScalarQuantity{stress}%
2781 {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}%
2782 [\pascal]%
2783 [\newton\per\meter\tothetwo]%
2784 \NewScalarQuantity{strain}%
2785 {}%
2786 \NewScalarQuantity{temperature}%
2787 {\kelvin}%
2788 \NewVectorQuantity{torque}%
2789 {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo}%
2790 [\newton\usk\meter]%
2791 [\newton\usk\meter]%
2792 \NewVectorQuantity{velocity}%
2793 {\meter\usk\second\inverse}%
2794 [\meter\per\second]%
2795 [\meter\per\second]%
2796 \NewVectorQuantity{velocityc}%
2797 {\lightspeed}%
2798 [\lightspeed]%
2799 [\lightspeed]%
2800 \NewScalarQuantity{volume}%
2801 {\meter\tothethree}%
2802 \NewScalarQuantity{volumechargedensity}%
2803 {\ampere\usk\second\per\meter\totheinversethree}%
2804 [\coulomb\per\meter\tothethree]%
2805 [\coulomb\per\meter\tothethree]%
2806 \NewScalarQuantity{volumemassdensity}%
2807 {\kilogram\usk\meter\totheinversethree}%
2808 [\kilogram\per\meter\tothethree]%
2809 [\kilogram\per\meter\tothethree]%
2810 % \end{macrocode}
2811 %
2812 % Wavelength is really just a displacement.
2813 %
2814 % \begin{macrocode}
2815 \NewScalarQuantity{wavelength}%
2816 {\meter}%
2817 % \end{macrocode}
2818 %
2819 % \begin{macrocode}
2820 \NewVectorQuantity{wavenumber}%
2821 {\meter\inverse}%
2822 [\per\meter]%
2823 [\per\meter]%
2824 % \end{macrocode}
2825 %
2826 % Work may also be |\newton\usk\meter| but this
2827 % is discouraged to avoid confusion with torque.
2828 %
2829 % \begin{macrocode}
2830 \NewScalarQuantity{work}%
2831 {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo}%
2832 [\joule]%
2833 [\joule]%
2834 % \end{macrocode}
2835 %
2836 % Young's modulus is really just a stress.
2837 %
2838 % \begin{macrocode}
2839 \NewScalarQuantity{youngsmodulus}%
2840 {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}%
2841 [\pascal]%
2842 [\newton\per\meter\tothetwo]%
2843 % \end{macrocode}
2844 %
2845 % We need a better glyph for Planck's constant over \( 2\pi \).
2846 %
2847 % \changes{v3.1.0}{2022-01-27}
2848 % {\linktoplace{sec:mandia}{mandi} Added \refCom{hbar}}
2849 % \begin{macrocode}
2850 \AtBeginDocument{%
2851 \DeclareRobustCommand{\hbar}{{\mathpalette\hbar@\relax\symup{h}}}%
2852 }%
2853 \newcommand*{\hbar@}[2]{%
2854 \makebox[0pt][l]{\raisebox{-0.07\height}{\(\m@th#1\mkern-2mu\mathchar"AF\)}}%
2855 % \end{macrocode}
2856 %
2857 % Optional line to make the bar thicker; must use \(-0.11\)
2858 % in |\raisebox|.
2859 %
2860 % \begin{macrocode}
2861 \makebox[0pt][l]{\raisebox{-0.11\height}{\(\m@th#1\mkern-2mu\mathchar"AF\)}}%
2862 }%
2863 % \end{macrocode}
2864 %
2865 % Define physical constants for introductory physics, again alphabetically
2866 % for convenience.
2867 %
2868 % \changes{v3.1.0}{2022-01-27}
2869 % {\linktoplace{sec:mandia}{mandi} Constants' values now use only \cs{times}}
2870 % \begin{macrocode}
2871 \NewPhysicalConstant{avogadro}%
2872 {\symup{N_{A}}}%
2873 {6\times10^{23}}{6.02214076\times10^{23}}%
2874 {\mole\inverse}%
2875 [\per\mole]%
2876 [\per\mole]%
2877 % \end{macrocode}
2878 %
2879 % |\biotsavartconstant| is an alias for |\mzofp|.
2880 %
2881 % \begin{macrocode}
2882 \NewPhysicalConstant{biotsavartconstant}%
2883 {\symup{\frac{\mu_{o}}{4\pi}}}%
2884 {10^{-7}}{10^{-7}}%
2885 {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}%
2886 [\henry\per\meter]%
2887 [\tesla\usk\meter\per\ampere]%
2888 \NewPhysicalConstant{bohrradius}%
2889 {\symup{a_{o}}}%
2890 {5.3\times10^{-11}}{5.29177210903\times10^{-11}}%
2891 {\meter}%
2892 \NewPhysicalConstant{boltzmann}%
2893 {\symup{k_{B}}}%
2894 {1.4\times10^{-23}}{1.380649\times10^{-23}}%
2895 {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo\usk\kelvin\inverse}%
2896 [\joule\per\kelvin]%
2897 [\joule\per\kelvin]%
2898 % \end{macrocode}
2899 %
2900 % |\coulombconstant| is an alias for |\oofpez|.
2901 %
2902 % \begin{macrocode}
2903 \NewPhysicalConstant{coulombconstant}%
2904 {\symup{\frac{1}{4\pi\epsilon_{o}}}}%
2905 {9\times10^{9}}{8.9875517923\times10^{9}}%
2906 {\kilogram\usk\meter\tothethree\usk\ampere\totheinversetwo\usk\second\totheinversefour}%
2907 [\meter\per\farad]%
2908 [\newton\usk\meter\tothetwo\per\coulomb\tothetwo]%
2909 \NewPhysicalConstant{earthmass}%
2910 {\symup{M_{Earth}}}%
2911 {6.0\times10^{24}}{5.9722\times10^{24}}%
2912 {\kilogram}%
2913 \NewPhysicalConstant{earthmoondistance}%
2914 {\symup{d_{EM}}}%
2915 {3.8\times10^{8}}{3.81550\times10^{8}}%
2916 {\meter}%
2917 \NewPhysicalConstant{earthradius}%
2918 {\symup{R_{Earth}}}%
2919 {6.4\times10^{6}}{6.3781\times10^{6}}%
2920 {\meter}%
2921 \NewPhysicalConstant{earthsundistance}%
2922 {\symup{d_{ES}}}%
2923 {1.5\times10^{11}}{1.496\times10^{11}}%
2924 {\meter}%
2925 \NewPhysicalConstant{electroncharge}%
2926 {\symup{q_{e}}}%
2927 {-\elementarychargeapproximatevalue}{-\elementarychargeprecisevalue}%
2928 {\ampere\usk\second}%
2929 [\coulomb]%
2930 [\coulomb]%
2931 \NewPhysicalConstant{electronCharge}%
2932 {\symup{Q_{e}}}%
2933 {-\elementarychargeapproximatevalue}{-\elementarychargeprecisevalue}%
2934 {\ampere\usk\second}%
2935 [\coulomb]%
2936 [\coulomb]%
2937 \NewPhysicalConstant{electronmass}%
2938 {\symup{m_{e}}}%
2939 {9.1\times10^{-31}}{9.1093837015\times10^{-31}}%
2940 {\kilogram}%
2941 \NewPhysicalConstant{elementarycharge}%
2942 {\symup{e}}%
2943 {1.6\times10^{-19}}{1.602176634\times10^{-19}}%
2944 {\ampere\usk\second}%
2945 [\coulomb]%
2946 [\coulomb]%
2947 \NewPhysicalConstant{finestructure}%
2948 {\symup{\alpha}}%
2949 {\frac{1}{137}}{7.2973525693\times10^{-3}}%
2950 {}%
2951 \NewPhysicalConstant{hydrogenmass}%
2952 {\symup{m_{H}}}%
2953 {1.7\times10^{-27}}{1.6737236\times10^{-27}}%
2954 {\kilogram}%
2955 \NewPhysicalConstant{moonearthdistance}%
2956 {\symup{d_{ME}}}%
2957 {3.8\times10^{8}}{3.81550\times10^{8}}%
2958 {\meter}%
2959 \NewPhysicalConstant{moonmass}%
2960 {\symup{M_{Moon}}}%
2961 {7.3\times10^{22}}{7.342\times10^{22}}%
2962 {\kilogram}%
2963 \NewPhysicalConstant{moonradius}%
2964 {\symup{R_{Moon}}}%
2965 {1.7\times10^{6}}{1.7371\times10^{6}}%
2966 {\meter}%
2967 \NewPhysicalConstant{mzofp}%
2968 {\symup{\frac{\mu_{o}}{4\pi}}}%
2969 {10^{-7}}{10^{-7}}%
2970 {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}%
2971 [\henry\per\meter]%
2972 [\tesla\usk\meter\per\ampere]%
2973 \NewPhysicalConstant{neutronmass}%
2974 {\symup{m_{n}}}%
2975 {1.7\times10^{-27}}{1.67492749804\times10^{-27}}%
2976 {\kilogram}%
2977 \NewPhysicalConstant{oofpez}%
2978 {\symup{\frac{1}{4\pi\epsilon_{o}}}}%
2979 {9\times10^{9}}{8.9875517923\times10^{9}}%
2980 {\kilogram\usk\meter\tothethree\usk\ampere\totheinversetwo\usk\second\totheinversefour}%
2981 [\meter\per\farad]%
2982 [\newton\usk\meter\tothetwo\per\coulomb\tothetwo]%
2983 \NewPhysicalConstant{oofpezcs}%
2984 {\symup{\frac{1}{4\pi\epsilon_{o} c^2}}}%
2985 {10^{-7}}{10^{-7}}%
2986 {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}%
2987 [\tesla\usk\meter\tothetwo]%
2988 [\newton\usk\second\tothetwo\per\coulomb\tothetwo]%
2989 \NewPhysicalConstant{planck}%
2990 {\symup{h}}%
2991 {6.6\times10^{-34}}{6.62607015\times10^{-34}}%
2992 {\kilogram\usk\meter\tothetwo\usk\second\inverse}%
2993 [\joule\usk\second]%
2994 [\joule\usk\second]%
2995 % \end{macrocode}
2996 %
2997 % See \url{https://tex.stackexchange.com/a/448565/218142}.
2998 %
2999 % \begin{macrocode}
3000 \NewPhysicalConstant{planckbar}%
3001 {\hbar}%
3002 {1.1\times10^{-34}}{1.054571817\times10^{-34}}%
3003 {\kilogram\usk\meter\tothetwo\usk\second\inverse}%
3004 [\joule\usk\second]%
3005 [\joule\usk\second]
3006 \NewPhysicalConstant{planckc}%
3007 {\symup{hc}}%
3008 {2.0\times10^{-25}}{1.98644586\times10^{-25}}%
3009 {\kilogram\usk\meter\tothethree\usk\second\totheinversetwo}%
3010 [\joule\usk\meter]%
3011 [\joule\usk\meter]%
3012 \NewPhysicalConstant{protoncharge}%
3013 {\symup{q_p}}%
3014 {+\elementarychargeapproximatevalue}{+\elementarychargeprecisevalue}%
3015 {\ampere\usk\second}%
3016 [\coulomb]%
3017 [\coulomb]%
3018 \NewPhysicalConstant{protonCharge}%
3019 {\symup{Q_p}}%
3020 {+\elementarychargeapproximatevalue}{+\elementarychargeprecisevalue}%
3021 {\ampere\usk\second}%
3022 [\coulomb]%
3023 [\coulomb]%
3024 \NewPhysicalConstant{protonmass}%
3025 {\symup{m_p}}%
3026 {1.7\times10^{-27}}{1.672621898\times10^{-27}}%
3027 {\kilogram}%
3028 \NewPhysicalConstant{rydberg}%
3029 {\symup{R_{\infty}}}%
3030 {1.1\times10^{7}}{1.0973731568160\times10^{7}}%
3031 {\meter\inverse}%
3032 \NewPhysicalConstant{speedoflight}%
3033 {\symup{c}}%
3034 {3\times10^{8}}{2.99792458\times10^{8}}%
3035 {\meter\usk\second\inverse}%
3036 [\meter\per\second]%
3037 [\meter\per\second]
3038 \NewPhysicalConstant{stefanboltzmann}%
3039 {\symup{\sigma}}%
3040 {5.7\times10^{-8}}{5.670374\times10^{-8}}%
3041 {\kilogram\usk\second\totheinversethree\usk\kelvin\totheinversefour}%
3042 [\watt\per\meter\tothetwo\usk\kelvin\tothefour]%
3043 [\watt\per\meter\tothetwo\usk\kelvin\tothefour]
3044 \NewPhysicalConstant{sunearthdistance}%
3045 {\symup{d_{SE}}}%
3046 {1.5\times10^{11}}{1.496\times10^{11}}%
3047 {\meter}%
3048 \NewPhysicalConstant{sunmass}%
3049 {\symup{M_{Sun}}}%
3050 {2.0\times10^{30}}{1.98855\times10^{30}}%
3051 {\kilogram}%
3052 \NewPhysicalConstant{sunradius}%
3053 {\symup{R_{Sun}}}%
3054 {7.0\times10^{8}}{6.957\times10^{8}}%
3055 {\meter}%
3056 \NewPhysicalConstant{surfacegravfield}%
3057 {\symup{g}}%
3058 {9.8}{9.807}%
3059 {\meter\usk\second\totheinversetwo}%
3060 [\newton\per\kilogram]%
3061 [\newton\per\kilogram]%
3062 % \end{macrocode}
3063 %
3064 % The gravitational constant may also have units of
3065 % |\joule\usk\meter\per\kilogram\tothetwo|.
3066 %
3067 % \begin{macrocode}
3068 \NewPhysicalConstant{universalgrav}%
3069 {\symup{G}}%
3070 {6.7\times10^{-11}}{6.67430\times10^{-11}}%
3071 {\meter\tothethree\usk\kilogram\inverse\usk\second\totheinversetwo}%
3072 [\newton\usk\meter\tothetwo\per\kilogram\tothetwo]%
3073 [\newton\usk\meter\tothetwo\per\kilogram\tothetwo]%
3074 % \end{macrocode}
3075 %
3076 % As of 2018 the vacuum permeability is no longer defined as
3077 % \( 4\pi\times10^{-7} \).
3078 %
3079 % \begin{macrocode}
3080 \NewPhysicalConstant{vacuumpermeability}%
3081 {\symup{\mu_o}}%
3082 {4\pi\times10^{-7}}{4\pi\times10^{-7}}%
3083 {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}%
3084 [\henry\per\meter]%
3085 [\tesla\usk\meter\per\ampere]%
3086 \NewPhysicalConstant{vacuumpermittivity}%
3087 {\symup{\epsilon_o}}%
3088 {9\times10^{-12}}{8.854187817\times10^{-12}}%
3089 {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse\usk\meter\totheinversethree}%
3090 [\farad\per\meter]%
3091 [\coulomb\tothetwo\per\newton\usk\meter\tothetwo]%
3092 % \end{macrocode}
3093 %
3094 % Diagnostic commands to provide sanity checks on commands that
3095 % represent physical quantities and constants.
3096 %
3097 % \changes{v3.1.0}{2022-01-27}
3098 % {\linktoplace{sec:mandia}{mandi} Improved \refCom{CheckQuantity}}
3099 % \changes{v3.1.0}{2022-01-27}
3100 % {\linktoplace{sec:mandia}{mandi} Improved \refCom{CheckConstant}}
3101 % \begin{macrocode}
3102 \ExplSyntaxOn
3103 \NewDocumentCommand{\@aux}{ m }
3104 {
3105 \use:c { #1 }
3106 }
3107 \NewDocumentCommand{\@auy}{ m }
3108 {
3109 \normalfont\ttfamily\token_to_str:c { #1 }
3110 }
3111 \ExplSyntaxOff
3112 \newcolumntype{M}{>{\(}p{0.25\linewidth}<{\)}}
3113 \NewDocumentCommand{\CheckQuantity}{ m }
3114 {%
3115 \begin{center}
3116 \begin{tabular}{MMM}
3117 \textbf{command} & \multicolumn{2}{l}{\@auy{#1}} \tabularnewline
3118 \text{\textbf{base}} & \text{\textbf{derived}} & \text{\textbf{alternate}} \tabularnewline
3119 \@aux{#1onlybaseunits} & \@aux{#1onlyderivedunits} & \@aux{#1onlyalternateunits} \tabularnewline
3120 \end{tabular}
3121 \end{center}
3122 }%
3123 \NewDocumentCommand{\CheckConstant}{ m }
3124 {%
3125 \begin{center}
3126 \begin{tabular}{MMM}
3127 \textbf{command} & \multicolumn{2}{l}{\@auy{#1}} \tabularnewline
3128 \text{\textbf{symbol}} & \text{\textbf{approximate}} & \text{\textbf{precise}} \tabularnewline
3129 \@aux{#1mathsymbol} & \@aux{#1approximatevalue} & \@aux{#1precisevalue} \tabularnewline
3130 \text{\textbf{base}} & \text{\textbf{derived}} & \text{\textbf{alternate}} \tabularnewline
3131 \@aux{#1onlybaseunits} & \@aux{#1onlyderivedunits} & \@aux{#1onlyalternateunits} \tabularnewline
3132 \end{tabular}
3133 \end{center}
3134 }%
3135 % \end{macrocode}
3136 %
3137 % \refCom{mivector} is a workhorse command.\newline
3138 % See \url{https://tex.stackexchange.com/a/39054/218142}.
3139 %
3140 % \changes{v3.1.0}{2022-01-27}
3141 % {\linktoplace{sec:mandia}{mandi} \refCom{mivector} now
3142 % requires more than one component}
3143 % \begin{macrocode}
3144 \ExplSyntaxOn
3145 \NewDocumentCommand{\mivector}{ O{,} m o }
3146 {
3147 \__mandi_vector:nn { #1 } { #2 }
3148 \IfValueT{#3}{\,{#3}}
3149 }
3150 \seq_new:N \l__mandi_list_seq
3151 \cs_new_protected:Npn \__mandi_vector:nn #1#2
3152 {
3153 \seq_set_split:Nnn \l__mandi_list_seq { , } { #2 }
3154 \int_compare:nT { \seq_count:N \l__mandi_list_seq = 1 }
3155 {
3156 \msg_new:nnnn { mandi } { onecomponent }
3157 {
3158 More~than~one~component~expected. \iow_newline:
3159 You~provided~one~component~to~a~command \iow_newline:
3160 that~expects~a~vector.~Either~you~don't \iow_newline:
3161 need~a~vector~here~or~you~didn't~supply \iow_newline:
3162 all~the~components.
3163 }
3164 {
3165 Decide~whether~or~not~you~really~need~a~vector~command~here. \iow_newline:
3166 \msg_see_documentation_text:n { mandi }
3167 }
3168 \msg_fatal:nn { mandi } { onecomponent }
3169
3170 }
3171 \left\langle
3172 \seq_use:Nnnn \l__mandi_list_seq { #1 } { #1 } { #1 }
3173 \right\rangle
3174 }
3175 \ExplSyntaxOff
3176 % \end{macrocode}
3177 % \restoregeometry
3178 %
3179 % \iffalse
3180 %</package>
3181 % \fi
3182 %
3183 % \Finale