diff options
author | Karl Berry <karl@freefriends.org> | 2023-08-02 20:06:50 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-08-02 20:06:50 +0000 |
commit | f240543182d3865e981aec3471cbe2aa48a3a8df (patch) | |
tree | 089288fc2b121d486268f8d59793f9fc2f92237a /Master/texmf-dist | |
parent | acb7235f08e2f54cd0c2420abba35ae06aedeca3 (diff) |
mandi (2aug23)
git-svn-id: svn://tug.org/texlive/trunk@67796 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/mandi/README.md | 11 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/mandi/mandi.pdf | bin | 500572 -> 515270 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/mandi/mandi.dtx | 1170 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mandi/mandi.ins | 28 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mandi/mandiexp.dtx | 237 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mandi/mandistudent.dtx | 545 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mandi/mandi.sty | 462 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mandi/mandiexp.sty | 31 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mandi/mandistudent.sty | 204 |
9 files changed, 1575 insertions, 1113 deletions
diff --git a/Master/texmf-dist/doc/latex/mandi/README.md b/Master/texmf-dist/doc/latex/mandi/README.md index b40227e66d6..bc2d56ec0ad 100644 --- a/Master/texmf-dist/doc/latex/mandi/README.md +++ b/Master/texmf-dist/doc/latex/mandi/README.md @@ -1,10 +1,9 @@ `mandi` provides commands for introductory physics. To install, open a command line and type the following, repeating 2-4 until there are no warnings: -1. `lualatex mandi.ins` (can also use latex) -2. `lualatex mandi.dtx` (lualatex is required) -3. `makeindex -s gind.ist -o mandi.ind mandi.idx` -4. `makeindex -s gglo.ist -o mandi.gls mandi.glo` + 1. `lualatex mandi.ins` (can also use latex) + 2. `lualatex mandi.dtx` (lualatex is required) + 3. `makeindex -s gind.ist -o mandi.ind mandi.idx` + 4. `makeindex -s gglo.ist -o mandi.gls mandi.glo` -Move the `*.sty` files into a directory searched by TeX. -The `vdemo.py` file is not needed and can be deleted. +Move the `*.sty` files into a directory searched by TeX. Delete `vdemo.py`. diff --git a/Master/texmf-dist/doc/latex/mandi/mandi.pdf b/Master/texmf-dist/doc/latex/mandi/mandi.pdf Binary files differindex 4fb21eac802..02dbcf4efd6 100644 --- a/Master/texmf-dist/doc/latex/mandi/mandi.pdf +++ b/Master/texmf-dist/doc/latex/mandi/mandi.pdf diff --git a/Master/texmf-dist/source/latex/mandi/mandi.dtx b/Master/texmf-dist/source/latex/mandi/mandi.dtx index d3313fc5b48..745b779af65 100644 --- a/Master/texmf-dist/source/latex/mandi/mandi.dtx +++ b/Master/texmf-dist/source/latex/mandi/mandi.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % !TEX program = lualatexmk % -% Copyright (C) 2021,2022 by Paul J. Heafner <heafnerj@gmail.com> +% Copyright (C) 2023 by Paul J. Heafner <heafnerj@gmail.com> % --------------------------------------------------------------------------- % This work may be distributed and/or modified under the conditions of the % LaTeX Project Public License, either version 1.3 of this license or (at @@ -24,7 +24,7 @@ % and includes the derived files mandi.sty % mandistudent.sty % mandiexp.sty -% vdemo.py +% vdemo.py (not needed) % --------------------------------------------------------------------------- % % \fi @@ -58,9 +58,10 @@ % This can be changed in a local ltxdoc.cfg file but it is % easier to just use the article class and the doc package % instead and force letterpaper size. -% \documentclass[10pt]{ltxdoc} -\documentclass[10pt,letterpaper]{article} -\usepackage{doc} +\documentclass[10pt,letterpaper]{ltxdoc} +\SetupDoc{reportchangedates} +%\documentclass[10pt,letterpaper]{article} +%\usepackage[nohyperref,reportchangedates]{doc} % doc v3 zzzz \PassOptionsToPackage{listings,documentation}{tcolorbox} % prevent option clash \usepackage{\jobname} % load mandi.sty \usepackage{mandistudent} % load mandistudent.sty @@ -72,6 +73,7 @@ \usepackage[listings,documentation]{tcolorbox} % workhorse package \tcbset{% % tcolorbox options index german settings,% + index gather commands = false,% index colorize = false,% lefthand ratio = 0.50,% color hyperlink = blue,% @@ -130,29 +132,6 @@ }% }% -% Clean up the Change History entries to get rid of General: -% and add dates. -% See https://tex.stackexchange.com/a/283894/218142 -\renewcommand{\generalname}{} % gets rid of General -\makeatletter -\renewcommand*{\changes@}[3]{% - \protected@edef\@tempa{% - \noexpand\glossary{#1 (#2)\levelchar - \ifx\saved@macroname\@empty - \space\actualchar\generalname - \else - \expandafter\@gobble\saved@macroname - \actualchar - \string\verb\quotechar*\verbatimchar\saved@macroname\verbatimchar - \fi - #3}}% gets rid of colon and adjusts spacing - \@tempa - \endgroup - \@esphack -}% -\makeatother -%%%%% End local hacks. - % We need a new command for in-line listings to prevent overfull boxes. % Anything in |...| will be in small plain text. % Previously used !...! but that conflicts with colors. @@ -168,31 +147,39 @@ \DocInput{\jobname student.dtx} % \setcounter{CodelineNo}{0} % reset line numbers if desired \DocInput{\jobname exp.dtx} % - \PrintIndex % + \phantomsection\addcontentsline{toc}{section}{Index}\PrintIndex% \end{document} % end main document %</driver> % \fi % -% \IndexPrologue{\section{Index}Page numbers refer to page where the -% corresponding entry is documented and/or referenced.} +% ^^A Put unnumbered Index entry in TOC +% \IndexPrologue{\section*{Index}Page numbers refer to page where the +% corresponding entry is documented and/or referenced.\vspace{\baselineskip}} % -% \CheckSum{2156} -% -% \CharacterTable -% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -% Digits \0\1\2\3\4\5\6\7\8\9 -% Exclamation \! Double quote \" Hash (number) \# -% Dollar \$ Percent \% Ampersand \& -% Acute accent \' Left paren \( Right paren \) -% Asterisk \* Plus \+ Comma \, -% Minus \- Point \. Solidus \/ -% Colon \: Semicolon \; Less than \< -% Equals \= Greater than \> Question mark \? -% Commercial at \@ Left bracket \[ Backslash \\ -% Right bracket \] Circumflex \^ Underscore \_ -% Grave accent \` Left brace \{ Vertical bar \| -% Right brace \} Tilde \~} +% ^^A Local hack to Change History to remove `General:` +% ^^A See https://tex.stackexchange.com/a/283894/218142 +% \makeatletter +% \renewcommand{\generalname}{} +% \renewcommand{\changes@}[3]{% +% \protected@edef\@tempa{\noexpand\glossary{#1% +% \ifdoc@reportchangedates% +% \space -- #2\fi% +% \levelchar% +% \ifx\saved@macroname\@empty% +% \quotechar!% +% \actualchar% +% \generalname% +% \else% +% \saved@indexname% +% \actualchar% +% \string\verb% % to fool emacs highlighting +% \quotechar*% +% \verbatimchar\saved@macroname% +% \verbatimchar% +% \fi% +% #3}}% +% \@tempa\endgroup\@esphack}% +% \makeatother % % \title{The \href{https://ctan.org/pkg/mandi}{\mandi} Bundle} % \author{^^A @@ -201,14 +188,14 @@ % {heafnerj@gmail.com}^^A % }^^A % }^^A -% \date{\today} +% \date{Printed \today} % % \newgeometry{left=1.0in,right=1.0in,top=4.0in} % \maketitle % \thispagestyle{empty} -% \centerline{\mandi\ version \mandiversion} -% \centerline{\mandistudent\ version \mandistudentversion} -% \centerline{\mandiexp\ version \mandiexpversion} +% \centerline{\mandi{} version \mandiversion} +% \centerline{\mandistudent{} version \mandistudentversion} +% \centerline{\mandiexp{} version \mandiexpversion} % ^^A\centerline{\textbf{PLEASE DO NOT DISTRIBUTE THIS BUILD.}} % \restoregeometry % @@ -218,17 +205,17 @@ % \phantomsection % \addcontentsline{toc}{section}{Acknowledgements} % \section*{Acknowledgements} -% To all of the students who have learned \LaTeXe\ in my introductory +% To all of the students who have learned \LaTeXe{} in my introductory % physics courses over the years, I say a heartfelt thank you. You % have contributed directly to the state of this software and to its % use in introductory physics courses and to innovating how physics % is taught. % -% I also acknowledge the \LaTeXe\ developers who inhabit the -% \href{https://tex.stackexchange.com/}{\TeX\ StackExchange} site. +% I also acknowledge the \LaTeXe{} developers who inhabit the +% \href{https://tex.stackexchange.com/}{\TeX{} StackExchange} site. % Entering a new culture is daunting for anyone, especially for -% newcomers; the \LaTeXe\ development culture is no exception. We all -% share a passion for creating beautiful documents and I have learned +% newcomers; the \LaTeXe{} development culture is no exception. We all +% share a passion for creating beautiful documents and I learned % much over the summers of 2020 and 2021 that improved my ability to % do just that. There are too many of you to list individually, and I % would surely accidentally omit some were I to try. Collectively, I @@ -249,51 +236,53 @@ % \listoffigures % \restoregeometry % -% \changes{v3.0.0}{2021-08-22}{\linktoplace{sec:mandipkg}{mandi} Initial release} -% \changes{v3.0.0}{2021-08-22}{\linktoplace{sec:mandistudentpkg}{mandistudent} Initial release} -% \changes{v3.0.0}{2021-08-22}{\linktoplace{sec:mandiexppkg}{mandiexp} Initial release} -% \changes{v3.0.1}{2021-08-24}{\linktoplace{sec:mandipkg}{mandi} Minor doc changes} -% \changes{v3.0.1}{2021-08-24}{\linktoplace{sec:mandistudentpkg}{mandistudent} Minor doc changes} -% \changes{v3.0.1}{2021-08-24}{\linktoplace{sec:mandiexppkg}{mandiexp} Minor doc changes} +% \changes{v3.0.0}{2021-08-22}{\linktoplace{sec:mandia}{mandi} Initial release} +% \changes{v3.0.0}{2021-08-22}{\linktoplace{sec:mandib}{mandistudent} Initial release} +% \changes{v3.0.0}{2021-08-22}{\linktoplace{sec:mandic}{mandiexp} Initial release} +% \changes{v3.0.1}{2021-08-24}{\linktoplace{sec:mandia}{mandi} Minor doc changes} +% \changes{v3.0.1}{2021-08-24}{\linktoplace{sec:mandib}{mandistudent} Minor doc changes} +% \changes{v3.0.1}{2021-08-24}{\linktoplace{sec:mandic}{mandiexp} Minor doc changes} +% \changes{v3.2.0}{2023-08-01}{\linktoplace{sec:mandia}{mandi} Source updated} +% \changes{v3.2.0}{2023-08-01}{\linktoplace{sec:mandib}{mandistudent} Source updated} +% \changes{v3.2.0}{2023-08-01}{\linktoplace{sec:mandic}{mandiexp} Source updated} % % \section{Introduction} -% % The \mandi \footnote{The bundle name can be pronounced either with two % syllables, to rhyme with \emph{candy}, or with three syllables, as % \emph{M and I}.} bundle consists of three packages: \mandi, \mandistudent, -% and \mandiexp. Package \linktoplace{sec:mandipkg}{mandi} provides the +% and \mandiexp. Package \linktoplace{sec:mandia}{mandi} provides the % core functionality, namely correctly typesetting physical quantities % and constants with their correct SI units as either scalars or vectors, % depending on which is appropriate. Package -% \linktoplace{sec:mandistudentpkg}{mandistudent} provides other typesetting +% \linktoplace{sec:mandib}{mandistudent} provides other typesetting % capability appropriate for written problem solutions. Finally, package -% \linktoplace{sec:mandiexppkg}{mandiexp} provides commands for typesetting +% \linktoplace{sec:mandic}{mandiexp} provides commands for typesetting % expressions from \emph{Matter \& Interactions}\footnote{See % \href{https://www.wiley.com/en-us/Matter+and+Interactions%2C+4th+Edition-p-9781118875865} % {\emph{Matter \& Interactions}} and % \url{https://matterandinteractions.org/} for details.} % -% \mandi\ has been completely rewritten from the ground up. It had gotten too -% large and clumsy to use and maintain. It (unknowingly) used deprecated -% packages. It had too many arcane ``features'' that were never used. It -% did not support Unicode. It was not compatible with modern engines, like -% \lualatex. It did not have a key-value interface. Options could not be -% changed on the fly within a document. In short, it was a mess. I hope -% this rewrite addresses all of the bad things and forms a better code base -% for maintenance, useability, and future improvements. -% % So many changes have been made that I think the best approach for former, % as well as new, users is to treat this as a brand new experience. I think % the most important thing to keep in mind is that I assume users, -% expecially new users, will have a relatively recent TeX distribution -% (like TeX Live) that includes a recently updated \LaTeXe\ kernel. If users +% especially new users, will have a relatively recent TeX distribution +% (like TeX Live) that includes a recently updated \LaTeXe{} kernel. If users % report that this is a major problem, I can provide some degree of % backwards compatibility. However, I use a fully updated TeX Live distribution. +% +% \section{Getting Help} +% If you have a question about \mandi, first please read this documentation to make +% sure your question is not addressed here. Then if you wish, email me. As a user, +% you deserve courteous and timely help if you need it. You will never get a +% response from me saying that because this software is free you are not entitled +% to help using it. It is sad that some developers take that attitude. Using free +% software does not absolve the developer of helping users unless the license +% specifically says so. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandipkg}{mandi} Added GitHub links to code} +% {\linktoplace{sec:mandia}{mandi} Added GitHub links to code} % \section{Code Availability} -% The \mandi\ source repository's \texttt{main} branch is at +% The \mandi{} source repository's \texttt{main} branch is at % \url{https://github.com/heafnerj/mandi}. This code will usually coincide % with that found on \href{https://ctan.org/pkg/mandi}{CTAN}. The very latest % build can be found on the \texttt{dev} branch found at @@ -301,9 +290,18 @@ % academic users should probably get the \texttt{dev} branch code since it is % stable and may contain improvements over the \texttt{main} branch code. % +% \changes{v3.2.0}{2023-08-01} +% {\linktoplace{sec:mandib}{mandistudent} Added statement about \textsc{beamer} +% compatibility} +% \section{Compatibility with Other Packages and Classes} +% When using \textsc{beamer}, certain commands in the \mandistudent{} package +% are not defined. Because \textsc{beamer} uses the \pkg{enumitem} package, +% the \refEnv{physicsproblem} and \refEnv{physicsproblem*} environments are not +% defined. The \refCom{hilite} command is also not defined because it does not +% work and I do not currently know why. +% % \newpage % \section{Student/Instructor Quick Guide} -% % Use \refCom{vec} to typeset the symbol for a vector. Use \refCom{magnitude} % to typeset the symbol for a vector's magnitude. Use \refCom{dirvec} to % typeset the symbol for a vector's direction. Use \refCom{changein} to @@ -382,9 +380,9 @@ % typeset \href{https://\vpurl}{VPython} program files. % % \newpage -% \section{The \mandi\ Package}\setplace{sec:mandipkg} +% \section{The \mandi{} Package}\setplace{sec:mandia} % -% Load \mandi\ as you would any package in your preamble. +% Load \mandi{} as you would any package in your preamble. % %\iffalse %<*example> @@ -403,7 +401,7 @@ Typesets the current version and build date. \end{docCommand} \begin{dispExample*}{sidebyside = false} - The version is \mandiversion\ and is a stable build. + The version is \mandiversion{} and is a stable build. \end{dispExample*} %\iffalse %</example> @@ -430,7 +428,7 @@ doc description = {initially unspecified, set to \docValue{false}},% },% }% - Now \mandi\ uses a key-value interface for options. + Now \mandi{} uses a key-value interface for options. The \refKey{units} key can be set to \docValue{base}, \docValue{derived}, or \docValue{alternate}. The \refKey{preciseconstants} key is always either \docValue{true} or \docValue{false}. @@ -462,10 +460,10 @@ %</example> %\fi % -% \subsection{\lualatex\ is Required} +% \subsection{\lualatex{} is Required} % -% In order to make use of better fonts and Unicode features, \mandi\ now -% requires the \lualatex\ engine for processing documents. It will not +% In order to make use of better fonts and Unicode features, \mandi{} now +% requires the \lualatex{} engine for processing documents. It will not % work with other engines. % % \newpage @@ -498,7 +496,7 @@ },% }% Command for momentum and its vector variants. The default units will depend - on the options passed to \mandi\ at load time. Alternate units are the + on the options passed to \mandi{} at load time. Alternate units are the default. Other units can be forced as demonstrated. The vector variants can take more than three components. Note the other variants for the quantity's value and units. @@ -544,7 +542,7 @@ %\iffalse %<*example> %\fi -\begin{docCommand}[doc updated = 2022-01-27]{checkquantity}{\marg{name}} +\begin{docCommand}[doc updated = 2022-01-27]{CheckQuantity}{\marg{name}} Command to check and typeset the command, base units, derived units, and alternate units of a defined physical quantity. @@ -558,7 +556,7 @@ % Every other defined physical quantity can be treated similarly. Just replace % |momentum| with the quantity's name. Obviously, the variants that begin with % |\vector| will not be defined for scalar quantities. Here are all the -% physical quantities, with all their units, defined in \mandi. Rememeber that +% physical quantities, with all their units, defined in \mandi. Remember that % units are not present with symbolic (algebraic) quantities, so do not use % the |\vector| variants of these commands for symbolic components. % Use \refCom{mivector} instead. @@ -583,10 +581,10 @@ },% }% \end{docCommands} -\checkquantity{acceleration} +\CheckQuantity{acceleration} \begin{docCommand}{amount}{\marg{magnitude}} \end{docCommand} -\checkquantity{amount} +\CheckQuantity{amount} \begin{docCommands} {% {% @@ -604,10 +602,10 @@ },% }% \end{docCommands} -\checkquantity{angularacceleration} +\CheckQuantity{angularacceleration} \begin{docCommand}{angularfrequency}{\marg{magnitude}} \end{docCommand} -\checkquantity{angularfrequency} +\CheckQuantity{angularfrequency} \begin{docCommands} {% {% @@ -625,7 +623,7 @@ },% }% \end{docCommands} -\checkquantity{angularimpulse} +\CheckQuantity{angularimpulse} \begin{docCommands} {% {% @@ -643,7 +641,7 @@ },% }% \end{docCommands} -\checkquantity{angularmomentum} +\CheckQuantity{angularmomentum} \begin{docCommands} {% {% @@ -661,22 +659,22 @@ },% }% \end{docCommands} -\checkquantity{angularvelocity} +\CheckQuantity{angularvelocity} \begin{docCommand}{area}{\marg{magnitude}} \end{docCommand} -\checkquantity{area} +\CheckQuantity{area} \begin{docCommand}{areachargedensity}{\marg{magnitude}} \end{docCommand} -\checkquantity{areachargedensity} +\CheckQuantity{areachargedensity} \begin{docCommand}{areamassdensity}{\marg{magnitude}} \end{docCommand} -\checkquantity{areamassdensity} +\CheckQuantity{areamassdensity} \begin{docCommand}{capacitance}{\marg{magnitude}} \end{docCommand} -\checkquantity{capacitance} +\CheckQuantity{capacitance} \begin{docCommand}{charge}{\marg{magnitude}} \end{docCommand} -\checkquantity{charge} +\CheckQuantity{charge} \begin{docCommands} {% {% @@ -694,19 +692,19 @@ },% }% \end{docCommands} -\checkquantity{cmagneticfield} +\CheckQuantity{cmagneticfield} \begin{docCommand}{conductance}{\marg{magnitude}} \end{docCommand} -\checkquantity{conductance} +\CheckQuantity{conductance} \begin{docCommand}{conductivity}{\marg{magnitude}} \end{docCommand} -\checkquantity{conductivity} +\CheckQuantity{conductivity} \begin{docCommand}{conventionalcurrent}{\marg{magnitude}} \end{docCommand} -\checkquantity{conventionalcurrent} +\CheckQuantity{conventionalcurrent} \begin{docCommand}{current}{\marg{magnitude}} \end{docCommand} -\checkquantity{current} +\CheckQuantity{current} \begin{docCommands} {% {% @@ -724,10 +722,10 @@ },% }% \end{docCommands} -\checkquantity{currentdensity} +\CheckQuantity{currentdensity} \begin{docCommand}{dielectricconstant}{\marg{magnitude}} \end{docCommand} -\checkquantity{dielectricconstant} +\CheckQuantity{dielectricconstant} \begin{docCommands} {% {% @@ -745,7 +743,7 @@ },% }% \end{docCommands} -\checkquantity{direction} +\CheckQuantity{direction} \begin{docCommands} {% {% @@ -763,10 +761,10 @@ },% }% \end{docCommands} -\checkquantity{displacement} +\CheckQuantity{displacement} \begin{docCommand}{duration}{\marg{magnitude}} \end{docCommand} -\checkquantity{duration} +\CheckQuantity{duration} \begin{docCommands} {% {% @@ -783,7 +781,7 @@ },% }% \end{docCommands} -\checkquantity{electricdipolemoment} +\CheckQuantity{electricdipolemoment} \begin{docCommands} {% {% @@ -801,37 +799,37 @@ },% }% \end{docCommands} -\checkquantity{electricfield} +\CheckQuantity{electricfield} \begin{docCommand}{electricflux}{\marg{magnitude}} \end{docCommand} -\checkquantity{electricflux} +\CheckQuantity{electricflux} \begin{docCommand}{electricpotential}{\marg{magnitude}} \end{docCommand} -\checkquantity{electricpotential} +\CheckQuantity{electricpotential} \begin{docCommand}[doc new = 2021-05-01]{electricpotentialdifference}{\marg{magnitude}} \end{docCommand} -\checkquantity{electricpotentialdifference} +\CheckQuantity{electricpotentialdifference} \begin{docCommand}{electroncurrent}{\marg{magnitude}} \end{docCommand} -\checkquantity{electroncurrent} +\CheckQuantity{electroncurrent} \begin{docCommand}{emf}{\marg{magnitude}} \end{docCommand} -\checkquantity{emf} +\CheckQuantity{emf} \begin{docCommand}{energy}{\marg{magnitude}} \end{docCommand} -\checkquantity{energy} +\CheckQuantity{energy} \begin{docCommand}[doc new = 2021-04-15]{energyinev}{\marg{magnitude}} \end{docCommand} -\checkquantity{energyinev} +\CheckQuantity{energyinev} \begin{docCommand}[doc new = 2021-04-15]{energyinkev}{\marg{magnitude}} \end{docCommand} -\checkquantity{energyinkev} +\CheckQuantity{energyinkev} \begin{docCommand}[doc new = 2021-04-15]{energyinmev}{\marg{magnitude}} \end{docCommand} -\checkquantity{energyinmev} +\CheckQuantity{energyinmev} \begin{docCommand}{energydensity}{\marg{magnitude}} \end{docCommand} -\checkquantity{energydensity} +\CheckQuantity{energydensity} \begin{docCommands} {% {% @@ -849,10 +847,10 @@ },% }% \end{docCommands} -\checkquantity{energyflux} +\CheckQuantity{energyflux} \begin{docCommand}{entropy}{\marg{magnitude}} \end{docCommand} -\checkquantity{entropy} +\CheckQuantity{entropy} \begin{docCommands} {% {% @@ -870,10 +868,10 @@ },% }% \end{docCommands} -\checkquantity{force} +\CheckQuantity{force} \begin{docCommand}{frequency}{\marg{magnitude}} \end{docCommand} -\checkquantity{frequency} +\CheckQuantity{frequency} \begin{docCommands} {% {% @@ -891,13 +889,13 @@ },% }% \end{docCommands} -\checkquantity{gravitationalfield} +\CheckQuantity{gravitationalfield} \begin{docCommand}{gravitationalpotential}{\marg{magnitude}} \end{docCommand} -\checkquantity{gravitationalpotential} +\CheckQuantity{gravitationalpotential} \begin{docCommand}[doc new = 2021-05-01]{gravitationalpotentialdifference}{\marg{magnitude}} \end{docCommand} -\checkquantity{gravitationalpotentialdifference} +\CheckQuantity{gravitationalpotentialdifference} \begin{docCommands} {% {% @@ -915,28 +913,28 @@ },% }% \end{docCommands} -\checkquantity{impulse} +\CheckQuantity{impulse} \begin{docCommand}{indexofrefraction}{\marg{magnitude}} \end{docCommand} -\checkquantity{indexofrefraction} +\CheckQuantity{indexofrefraction} \begin{docCommand}{inductance}{\marg{magnitude}} \end{docCommand} -\checkquantity{inductance} +\CheckQuantity{inductance} \begin{docCommand}{linearchargedensity}{\marg{magnitude}} \end{docCommand} -\checkquantity{linearchargedensity} +\CheckQuantity{linearchargedensity} \begin{docCommand}{linearmassdensity}{\marg{magnitude}} \end{docCommand} -\checkquantity{linearmassdensity} +\CheckQuantity{linearmassdensity} \begin{docCommand}[doc new = 2022-01-27]{lorentzfactor}{\marg{magnitude}} \end{docCommand} -\checkquantity{lorentzfactor} +\CheckQuantity{lorentzfactor} \begin{docCommand}[doc updated = 2021-05-02]{luminousintensity}{\marg{magnitude}} \end{docCommand} -\checkquantity{luminousintensity} +\CheckQuantity{luminousintensity} \begin{docCommand}{magneticcharge}{\marg{magnitude}} \end{docCommand} -\checkquantity{magneticcharge} +\CheckQuantity{magneticcharge} \begin{docCommands} {% {% @@ -954,7 +952,7 @@ },% }% \end{docCommands} -\checkquantity{magneticdipolemoment} +\CheckQuantity{magneticdipolemoment} \begin{docCommands} {% {% @@ -972,19 +970,19 @@ },% }% \end{docCommands} -\checkquantity{magneticfield} +\CheckQuantity{magneticfield} \begin{docCommand}{magneticflux}{\marg{magnitude}} \end{docCommand} -\checkquantity{magneticflux} +\CheckQuantity{magneticflux} \begin{docCommand}{mass}{\marg{magnitude}} \end{docCommand} -\checkquantity{mass} +\CheckQuantity{mass} \begin{docCommand}{mobility}{\marg{magnitude}} \end{docCommand} -\checkquantity{mobility} +\CheckQuantity{mobility} \begin{docCommand}{momentofinertia}{\marg{magnitude}} \end{docCommand} -\checkquantity{momentofinertia} +\CheckQuantity{momentofinertia} \begin{docCommands} {% {% @@ -1004,7 +1002,7 @@ doc parameter = \marg{\( c_1,\dots,c_n \)} },% }% \end{docCommands} -\checkquantity{momentum} +\CheckQuantity{momentum} \begin{docCommands} {% {% @@ -1022,25 +1020,25 @@ },% }% \end{docCommands} -\checkquantity{momentumflux} +\CheckQuantity{momentumflux} \begin{docCommand}{numberdensity}{\marg{magnitude}} \end{docCommand} -\checkquantity{numberdensity} +\CheckQuantity{numberdensity} \begin{docCommand}{permeability}{\marg{magnitude}} \end{docCommand} -\checkquantity{permeability} +\CheckQuantity{permeability} \begin{docCommand}{permittivity}{\marg{magnitude}} \end{docCommand} -\checkquantity{permittivity} +\CheckQuantity{permittivity} \begin{docCommand}{planeangle}{\marg{magnitude}} \end{docCommand} -\checkquantity{planeangle} +\CheckQuantity{planeangle} \begin{docCommand}{polarizability}{\marg{magnitude}} \end{docCommand} -\checkquantity{polarizability} +\CheckQuantity{polarizability} \begin{docCommand}{power}{\marg{magnitude}} \end{docCommand} -\checkquantity{power} +\CheckQuantity{power} \begin{docCommands} {% {% @@ -1058,43 +1056,43 @@ },% }% \end{docCommands} -\checkquantity{poynting} +\CheckQuantity{poynting} \begin{docCommand}{pressure}{\marg{magnitude}} \end{docCommand} -\checkquantity{pressure} +\CheckQuantity{pressure} \begin{docCommand}{relativepermeability}{\marg{magnitude}} \end{docCommand} -\checkquantity{relativepermeability} +\CheckQuantity{relativepermeability} \begin{docCommand}{relativepermittivity}{\marg{magnitude}} \end{docCommand} -\checkquantity{relativepermittivity} +\CheckQuantity{relativepermittivity} \begin{docCommand}{resistance}{\marg{magnitude}} \end{docCommand} -\checkquantity{resistance} +\CheckQuantity{resistance} \begin{docCommand}{resistivity}{\marg{magnitude}} \end{docCommand} -\checkquantity{resistivity} +\CheckQuantity{resistivity} \begin{docCommand}{solidangle}{\marg{magnitude}} \end{docCommand} -\checkquantity{solidangle} +\CheckQuantity{solidangle} \begin{docCommand}{specificheatcapacity}{\marg{magnitude}} \end{docCommand} -\checkquantity{specificheatcapacity} +\CheckQuantity{specificheatcapacity} \begin{docCommand}{springstiffness}{\marg{magnitude}} \end{docCommand} -\checkquantity{springstiffness} +\CheckQuantity{springstiffness} \begin{docCommand}{springstretch}{\marg{magnitude}} \end{docCommand} -\checkquantity{springstretch} +\CheckQuantity{springstretch} \begin{docCommand}{stress}{\marg{magnitude}} \end{docCommand} -\checkquantity{stress} +\CheckQuantity{stress} \begin{docCommand}{strain}{\marg{magnitude}} \end{docCommand} -\checkquantity{strain} +\CheckQuantity{strain} \begin{docCommand}{temperature}{\marg{magnitude}} \end{docCommand} -\checkquantity{temperature} +\CheckQuantity{temperature} \begin{docCommands} {% {% @@ -1112,7 +1110,7 @@ },% }% \end{docCommands} -\checkquantity{torque} +\CheckQuantity{torque} \begin{docCommands} {% {% @@ -1130,7 +1128,7 @@ },% }% \end{docCommands} -\checkquantity{velocity} +\CheckQuantity{velocity} \begin{docCommands} {% {% @@ -1148,19 +1146,19 @@ },% }% \end{docCommands} -\checkquantity{velocityc} +\CheckQuantity{velocityc} \begin{docCommand}{volume}{\marg{magnitude}} \end{docCommand} -\checkquantity{volume} +\CheckQuantity{volume} \begin{docCommand}{volumechargedensity}{\marg{magnitude}} \end{docCommand} -\checkquantity{volumechargedensity} +\CheckQuantity{volumechargedensity} \begin{docCommand}{volumemassdensity}{\marg{magnitude}} \end{docCommand} -\checkquantity{volumemassdensity} +\CheckQuantity{volumemassdensity} \begin{docCommand}{wavelength}{\marg{magnitude}} \end{docCommand} -\checkquantity{wavelength} +\CheckQuantity{wavelength} \begin{docCommands} {% {% @@ -1178,13 +1176,13 @@ },% }% \end{docCommands} -\checkquantity{wavenumber} +\CheckQuantity{wavenumber} \begin{docCommand}{work}{\marg{magnitude}} \end{docCommand} -\checkquantity{work} +\CheckQuantity{work} \begin{docCommand}{youngsmodulus}{\marg{magnitude}} \end{docCommand} -\checkquantity{youngsmodulus} +\CheckQuantity{youngsmodulus} %\iffalse %</example> %\fi @@ -1200,18 +1198,18 @@ {% {% doc new = 2021-02-16,% - doc name = newscalarquantity,% + doc name = NewScalarQuantity,% },% {% doc new = 2021-02-21,% - doc name = renewscalarquantity,% + doc name = RenewScalarQuantity,% },% }% Command to (re)define a new/existing scalar quantity. If the derived or alternate units are omitted, they are defined to be the same as the base units. Do not use both this command and - \refCom{newvectorquantity} or \refCom{renewvectorquantity} + \refCom{NewVectorQuantity} or \refCom{RenewVectorQuantity} to (re)define a quantity. \end{docCommands} %\iffalse @@ -1227,18 +1225,18 @@ {% {% doc new = 2021-02-16,% - doc name = newvectorquantity,% + doc name = NewVectorQuantity,% },% {% doc new = 2021-02-21,% - doc name = renewvectorquantity,% + doc name = RenewVectorQuantity,% },% }% Command to (re)define a new/existing vector quantity. If the derived or alternate units are omitted, they are defined to be the same as the base units. Do not use both this command and - \refCom{newscalarquantity} or \refCom{renewscalarquantity} + \refCom{NewScalarQuantity} or \refCom{RenewScalarQuantity} to (re)define a quantity. \end{docCommands} %\iffalse @@ -1247,7 +1245,7 @@ % % \subsubsection{Changing Units}\setplace{ssec:chgunits} % -% Units are set when \mandi\ is loaded, but the default setting +% Units are set when \mandi{} is loaded, but the default setting % can be easily overridden in four ways: command variants that % are defined when a \linktoplace{ssec:physquants}{physical quantity} % or \linktoplace{ssec:physconsts}{physical constant} is @@ -1276,7 +1274,7 @@ },% }% Modal commands (switches) for setting the default unit form for the entire - document. When \mandi\ is loaded, one of these three commands is executed + document. When \mandi{} is loaded, one of these three commands is executed depending on whether the optional |units| key is provided. See the section on loading the package for details. Alternate units are the default because they are the most likely ones to be seen in introductory physics textbooks. @@ -1300,7 +1298,7 @@ doc name = hereusederivedunits,% },% {% - doc name = hereusedalternateunits,% + doc name = hereusealternateunits,% },% }% Commands for setting the unit form on the fly for a single instance. The @@ -1379,7 +1377,7 @@ %\fi \begin{docCommand}[doc label = oofpezdemo]{oofpez}{} Command for the Coulomb constant. The constant's numerical precision and - default units will depend on the options passed to \mandi\ at load time. + default units will depend on the options passed to \mandi{} at load time. Alternate units and approximate numerical values are the defaults. Other units can be forced as demonstrated. \end{docCommand} @@ -1404,7 +1402,7 @@ %\iffalse %<*example> %\fi -\begin{docCommand}[doc updated = 2022-01-27]{checkconstant}{\marg{name}} +\begin{docCommand}[doc updated = 2022-01-27]{CheckConstant}{\marg{name}} Command to check and typeset the constant's name, mathematical symbol, approximate value, precise value, base units, derived units, and alternate units. @@ -1429,115 +1427,115 @@ %\fi \begin{docCommand}[doc description = exact]{avogadro}{} \end{docCommand} -\checkconstant{avogadro} +\CheckConstant{avogadro} \begin{docCommand}[doc new = 2021-02-02]{biotsavartconstant}{} \end{docCommand} -\checkconstant{biotsavartconstant} +\CheckConstant{biotsavartconstant} \begin{docCommand}{bohrradius}{} \end{docCommand} -\checkconstant{bohrradius} +\CheckConstant{bohrradius} \begin{docCommand}[doc description = exact]{boltzmann}{} \end{docCommand} -\checkconstant{boltzmann} +\CheckConstant{boltzmann} \begin{docCommand}[doc new = 2021-02-02]{coulombconstant}{} \end{docCommand} -\checkconstant{coulombconstant} +\CheckConstant{coulombconstant} \begin{docCommand}{earthmass}{} \end{docCommand} -\checkconstant{earthmass} +\CheckConstant{earthmass} \begin{docCommand}{earthmoondistance}{} \end{docCommand} -\checkconstant{earthmoondistance} +\CheckConstant{earthmoondistance} \begin{docCommand}{earthradius}{} \end{docCommand} -\checkconstant{earthradius} +\CheckConstant{earthradius} \begin{docCommand}{earthsundistance}{} \end{docCommand} -\checkconstant{earthsundistance} +\CheckConstant{earthsundistance} \begin{docCommand}{electroncharge}{} \end{docCommand} -\checkconstant{electroncharge} +\CheckConstant{electroncharge} \begin{docCommand}{electronCharge}{} \end{docCommand} -\checkconstant{electronCharge} +\CheckConstant{electronCharge} \begin{docCommand}{electronmass}{} \end{docCommand} -\checkconstant{electronmass} +\CheckConstant{electronmass} \begin{docCommand}[doc description = exact]{elementarycharge}{} \end{docCommand} -\checkconstant{elementarycharge} +\CheckConstant{elementarycharge} \begin{docCommand}{finestructure}{} \end{docCommand} -\checkconstant{finestructure} +\CheckConstant{finestructure} \begin{docCommand}{hydrogenmass}{} \end{docCommand} -\checkconstant{hydrogenmass} +\CheckConstant{hydrogenmass} \begin{docCommand}{moonearthdistance}{} \end{docCommand} -\checkconstant{moonearthdistance} +\CheckConstant{moonearthdistance} \begin{docCommand}{moonmass}{} \end{docCommand} -\checkconstant{moonmass} +\CheckConstant{moonmass} \begin{docCommand}{moonradius}{} \end{docCommand} -\checkconstant{moonradius} +\CheckConstant{moonradius} \begin{docCommand}{mzofp}{} \end{docCommand} -\checkconstant{mzofp} +\CheckConstant{mzofp} \begin{docCommand}{neutronmass}{} \end{docCommand} -\checkconstant{neutronmass} +\CheckConstant{neutronmass} \begin{docCommand}{oofpez}{} \end{docCommand} -\checkconstant{oofpez} +\CheckConstant{oofpez} \begin{docCommand}{oofpezcs}{} \end{docCommand} -\checkconstant{oofpezcs} +\CheckConstant{oofpezcs} \begin{docCommand}[doc description = exact]{planck}{} \end{docCommand} -\checkconstant{planck} +\CheckConstant{planck} \begin{docCommand}{planckbar}{} \end{docCommand} -\checkconstant{planckbar} +\CheckConstant{planckbar} \begin{docCommand}{planckc}{} \end{docCommand} -\checkconstant{planckc} +\CheckConstant{planckc} \begin{docCommand}{protoncharge}{} \end{docCommand} -\checkconstant{protoncharge} +\CheckConstant{protoncharge} \begin{docCommand}{protonCharge}{} \end{docCommand} -\checkconstant{protonCharge} +\CheckConstant{protonCharge} \begin{docCommand}{protonmass}{} \end{docCommand} -\checkconstant{protonmass} +\CheckConstant{protonmass} \begin{docCommand}{rydberg}{} \end{docCommand} -\checkconstant{rydberg} +\CheckConstant{rydberg} \begin{docCommand}[doc description = exact]{speedoflight}{} \end{docCommand} -\checkconstant{speedoflight} +\CheckConstant{speedoflight} \begin{docCommand}{stefanboltzmann}{} \end{docCommand} -\checkconstant{stefanboltzmann} +\CheckConstant{stefanboltzmann} \begin{docCommand}{sunearthdistance}{} \end{docCommand} -\checkconstant{sunearthdistance} +\CheckConstant{sunearthdistance} \begin{docCommand}{sunradius}{} \end{docCommand} -\checkconstant{sunradius} +\CheckConstant{sunradius} \begin{docCommand}{surfacegravfield}{} \end{docCommand} -\checkconstant{surfacegravfield} +\CheckConstant{surfacegravfield} \begin{docCommand}{universalgrav}{} \end{docCommand} -\checkconstant{universalgrav} +\CheckConstant{universalgrav} \begin{docCommand}{vacuumpermeability}{} \end{docCommand} -\checkconstant{vacuumpermeability} +\CheckConstant{vacuumpermeability} \begin{docCommand}{vacuumpermittivity}{} \end{docCommand} -\checkconstant{vacuumpermittivity} +\CheckConstant{vacuumpermittivity} %\iffalse %</example> %\fi @@ -1556,11 +1554,11 @@ {% {% doc new = 2021-02-16,% - doc name = newphysicalconstant,% + doc name = NewPhysicalConstant,% },% {% doc new = 2021-02-21,% - doc name = renewphysicalconstant,% + doc name = RenewPhysicalConstant,% },% }% Command to define/redefine a new/existing physical constant. @@ -1682,7 +1680,8 @@ },% {% doc parameter = \marg{magnitude}\marg{unit},% - doc name = unit,% + doc updated = 2023-08-01,% + doc name = units,% },% {% doc name = emptyunit,% @@ -1829,7 +1828,7 @@ \begin{dispExample} \( \per \) \\ \( \usk \) \\ - \( \unit{3}{\meter\per\second} \) \\ + \( \units{3}{\meter\per\second} \) \\ \( \emptyunit \) \\ \( \ampere \) \\ \( \atomicmassunit \) \\ @@ -1939,26 +1938,26 @@ %</example> %\fi % -% \StopEventually{} +% \MaybeStop{} % % \newgeometry{left=0.50in,right=0.50in,top=1.00in,bottom=1.00in} -% \subsection{\mandi\ Source Code} +% \subsection{\mandi{} Source Code} % % \iffalse %<*package> % \fi -% Definine the package version and date for global use, exploiting the fact +% Define the package version and date for global use, exploiting the fact % that in a \pkg{.sty} file there is now no need for |\makeatletter| and % |\makeatother|. This simplifies defining internal commands (with |@| % in the name) that are not for the user to know about. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandipkg}{mandi} Code formatted for better readability} +% {\linktoplace{sec:mandia}{mandi} Code formatted for better readability} % \begin{macrocode} -\def\mandi@version{3.1.0} -\def\mandi@date{2022-01-27} +\def\mandi@version{3.2.0} +\def\mandi@date{2023-08-01} \NeedsTeXFormat{LaTeX2e}[2020-02-02] -\DeclareRelease{v3.1.0}{2022-01-27}{mandi.sty} +\DeclareRelease{v3.2.0}{2023-08-01}{mandi.sty} \DeclareCurrentRelease{v\mandi@version}{\mandi@date} \ProvidesPackage{mandi} [\mandi@date\space v\mandi@version\space Macros for physical quantities] @@ -1972,44 +1971,83 @@ % % Load third party packages, documenting why each one is needed. % +% We need \pkg{pgfopts} for a key-value interface. +% +% \begin{macrocode} +\RequirePackage{pgfopts} +% \end{macrocode} +% +% We need \pkg{array} for |\chkquantity| and |\chkconstant|. +% +% \begin{macrocode} +\RequirePackage{array} +% \end{macrocode} +% +% We need \pkg{iftex} so we can require \lualatex. +% % \begin{macrocode} -\RequirePackage{pgfopts} % needed for key-value interface -\RequirePackage{array} % needed for \checkquantity and \checkconstant -\RequirePackage{iftex} % needed for requiring LuaLaTeX -\RequirePackage{unicode-math} % needed for Unicode support +\RequirePackage{iftex} % \end{macrocode} % +% We need \pkg{mathtools} for intelligent delimiters. +% +% \begin{macrocode} +\RequirePackage{mathtools} +% \end{macrocode} +% +% We need \pkg{unicode-math} for Unicode support and changing fonts. +% +% \begin{macrocode} +\RequirePackage{unicode-math} +% \end{macrocode} +% +% Suppress some annoying warnings. +% +% \begin{macrocode} +\unimathsetup{warnings-off={mathtools-colon,mathtools-overbracket}} +% \end{macrocode} +% +% Load \pkg{xparse} if necessary. +% % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandipkg}{mandi} \pkg{xparse} is loaded for older formats} +% {\linktoplace{sec:mandia}{mandi} \pkg{xparse} is loaded for older formats} % \begin{macrocode} -\IfFormatAtLeastTF {2020-10-01} % load xparse if necessary +\IfFormatAtLeastTF{2020-10-01} {}% {\RequirePackage{xparse}}% -\RequireLuaTeX % require this engine +% \end{macrocode} +% +% We require the \lualatex{} engine. +% +% \begin{macrocode} +\RequireLuaTeX % \end{macrocode} % % Parts of the unit engine have been rewritten with % \href{https://www.ctan.org/pkg/xparse}{\pkg{xparse}} for both clarity -% and power. Note that \pkg{xparse} is now part of the \LaTeXe\ kernel. -% Other parts have been rewriten in +% and power. Note that \pkg{xparse} is now part of the \LaTeXe{} kernel. +% Other parts have been rewritten in % \href{https://www.ctan.org/pkg/expl}{\pkg{expl}} with a look to the % future. % -% Generic internal selectors. +% Define some generic internal selectors. % % \begin{macrocode} \newcommand*{\mandi@selectunits}{} \newcommand*{\mandi@selectprecision}{} % \end{macrocode} % -% Specific internal selectors. +% Define some specific internal selectors. The first two are really just +% workalikes for |\@firstoftwo| and |\@secondoftwo|. The third, fourth, +% and fifth are |\@firstofthree|, |\@secondofthree|, and |\@thirdofthree| +% and apparently do not yet exist. % % \begin{macrocode} -\newcommand*{\mandi@selectapproximate}[2]{#1} % really \@firstoftwo -\newcommand*{\mandi@selectprecise}[2]{#2} % really \@secondoftwo -\newcommand*{\mandi@selectbaseunits}[3]{#1} % really \@firstofthree -\newcommand*{\mandi@selectderivedunits}[3]{#2} % really \@secondofthree -\newcommand*{\mandi@selectalternateunits}[3]{#3} % really \@thirdofthree +\newcommand*{\mandi@selectapproximate}[2]{#1} +\newcommand*{\mandi@selectprecise}[2]{#2} +\newcommand*{\mandi@selectbaseunits}[3]{#1} +\newcommand*{\mandi@selectderivedunits}[3]{#2} +\newcommand*{\mandi@selectalternateunits}[3]{#3} % \end{macrocode} % % Document level global switches. @@ -2047,7 +2085,7 @@ \NewDocumentEnvironment{usepreciseconstants}{}{\alwaysusepreciseconstants}{}% % \end{macrocode} % -% \mandi\ now has a key-value interface, implemented with +% \mandi{} now has a key-value interface, implemented with % \href{https://www.ctan.org/pkg/pgfopts}{\pkg{pgfopts}} and % \href{https://www.ctan.org/pkg/pgfkeys}{\pkg{pgfkeys}}. % There are two options:\newline @@ -2061,7 +2099,7 @@ % by the unit engine. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandipkg}{mandi} Unknown package options handled safely} +% {\linktoplace{sec:mandia}{mandi} Unknown package options handled safely} % \begin{macrocode} \newif\ifusingpreciseconstants \pgfkeys{% @@ -2119,7 +2157,8 @@ % \end{macrocode} % % Define a setup command that overrides the loadtime options -% when called with new options. A new banner is written to the console. +% when called with new options. A new banner is written to +% the console. % % \begin{macrocode} \NewDocumentCommand{\mandisetup}{ m }% @@ -2141,11 +2180,22 @@ % We make use of |\symup{...}| from the \pkg{unicode-math} package. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandipkg}{mandi} Added a negative space to \refCom{lightspeed}} +% {\linktoplace{sec:mandia}{mandi} Added a negative space to \refCom{lightspeed}} +% \changes{v3.2.0}{2023-08-01} +% {\linktoplace{sec:mandia}{mandi} Changed \cs{unit} to \cs{units}} % \begin{macrocode} \NewDocumentCommand{\per}{}{/} \NewDocumentCommand{\usk}{}{\cdot} -\NewDocumentCommand{\unit}{ m m }{{#1}{\,#2}} +\NewDocumentCommand{\units}{ m m }% +{% + \IfValueTF{#2} + {% + {#1}{\,#2} + }% + {% + {#1}{} + }% +}% \NewDocumentCommand{\ampere}{}{\symup{A}} \NewDocumentCommand{\atomicmassunit}{}{\symup{u}} \NewDocumentCommand{\candela}{}{\symup{cd}} @@ -2178,13 +2228,13 @@ \NewDocumentCommand{\volt}{}{\symup{V}} \NewDocumentCommand{\watt}{}{\symup{W}} \NewDocumentCommand{\weber}{}{\symup{Wb}} -\NewDocumentCommand{\tothetwo}{}{^2} % postfix 2 -\NewDocumentCommand{\tothethree}{}{^3} % postfix 3 -\NewDocumentCommand{\tothefour}{}{^4} % postfix 4 -\NewDocumentCommand{\inverse}{}{^{-1}} % postfix -1 -\NewDocumentCommand{\totheinversetwo}{}{^{-2}} % postfix -2 -\NewDocumentCommand{\totheinversethree}{}{^{-3}} % postfix -3 -\NewDocumentCommand{\totheinversefour}{}{^{-4}} % postfix -4 +\NewDocumentCommand{\tothetwo}{}{^{2}} +\NewDocumentCommand{\tothethree}{}{^{3}} +\NewDocumentCommand{\tothefour}{}{^{4}} +\NewDocumentCommand{\inverse}{}{^{-1}} +\NewDocumentCommand{\totheinversetwo}{}{^{-2}} +\NewDocumentCommand{\totheinversethree}{}{^{-3}} +\NewDocumentCommand{\totheinversefour}{}{^{-4}} \NewDocumentCommand{\emptyunit}{}{\mdlgwhtsquare} \NewDocumentCommand{\tento}{ m }{10^{#1}} \NewDocumentCommand{\timestento}{ m }{\times\tento{#1}} @@ -2192,21 +2242,21 @@ % \end{macrocode} % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandipkg}{mandi} \LaTeX3 code now conforms to formatting standards} +% {\linktoplace{sec:mandia}{mandi} \LaTeX3 code now conforms to formatting standards} % \begin{macrocode} \ExplSyntaxOn \cs_new:Npn \__mandi_newscalarquantity:nnnn #1#2#3#4 { - \cs_new:cpn {#1} ##1 {\unit{##1}{\mandi@selectunits{#2}{#3}{#4}}} + \cs_new:cpn {#1} ##1 {\units{##1}{\mandi@selectunits{#2}{#3}{#4}}} \cs_new:cpn {#1value} ##1 {##1} - \cs_new:cpn {#1baseunits} ##1 {\unit{##1}{\mandi@selectbaseunits{#2}{#3}{#4}}} - \cs_new:cpn {#1derivedunits} ##1 {\unit{##1}{\mandi@selectderivedunits{#2}{#3}{#4}}} - \cs_new:cpn {#1alternateunits} ##1 {\unit{##1}{\mandi@selectalternateunits{#2}{#3}{#4}}} + \cs_new:cpn {#1baseunits} ##1 {\units{##1}{\mandi@selectbaseunits{#2}{#3}{#4}}} + \cs_new:cpn {#1derivedunits} ##1 {\units{##1}{\mandi@selectderivedunits{#2}{#3}{#4}}} + \cs_new:cpn {#1alternateunits} ##1 {\units{##1}{\mandi@selectalternateunits{#2}{#3}{#4}}} \cs_new:cpn {#1onlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}} \cs_new:cpn {#1onlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}} \cs_new:cpn {#1onlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}} } -\NewDocumentCommand{\newscalarquantity}{ m m O{#2} O{#2} } +\NewDocumentCommand{\NewScalarQuantity}{ m m O{#2} O{#2} } { \__mandi_newscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 } } @@ -2219,16 +2269,16 @@ \ExplSyntaxOn \cs_new:Npn \__mandi_renewscalarquantity:nnnn #1#2#3#4 { - \cs_set:cpn {#1} ##1 {\unit{##1}{\mandi@selectunits{#2}{#3}{#4}}} + \cs_set:cpn {#1} ##1 {\units{##1}{\mandi@selectunits{#2}{#3}{#4}}} \cs_set:cpn {#1value} ##1 {##1} - \cs_set:cpn {#1baseunits} ##1 {\unit{##1}{\mandi@selectbaseunits{#2}{#3}{#4}}} - \cs_set:cpn {#1derivedunits} ##1 {\unit{##1}{\mandi@selectderivedunits{#2}{#3}{#4}}} - \cs_set:cpn {#1alternateunits} ##1 {\unit{##1}{\mandi@selectalternateunits{#2}{#3}{#4}}} + \cs_set:cpn {#1baseunits} ##1 {\units{##1}{\mandi@selectbaseunits{#2}{#3}{#4}}} + \cs_set:cpn {#1derivedunits} ##1 {\units{##1}{\mandi@selectderivedunits{#2}{#3}{#4}}} + \cs_set:cpn {#1alternateunits} ##1 {\units{##1}{\mandi@selectalternateunits{#2}{#3}{#4}}} \cs_set:cpn {#1onlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}} \cs_set:cpn {#1onlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}} \cs_set:cpn {#1onlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}} } -\NewDocumentCommand{\renewscalarquantity}{ m m O{#2} O{#2} } +\NewDocumentCommand{\RenewScalarQuantity}{ m m O{#2} O{#2} } { \__mandi_renewscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 } } @@ -2242,16 +2292,16 @@ \cs_new:Npn \__mandi_newvectorquantity:nnnn #1#2#3#4 { \__mandi_newscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 } - \cs_new:cpn {vector#1} ##1 {\unit{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} - \cs_new:cpn {#1vector} ##1 {\unit{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} + \cs_new:cpn {vector#1} ##1 {\units{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} + \cs_new:cpn {#1vector} ##1 {\units{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} \cs_new:cpn {vector#1value} ##1 {\mivector{##1}} \cs_new:cpn {#1vectorvalue} ##1 {\mivector{##1}} - \cs_new:cpn {vector#1baseunits} ##1 {\unit{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} - \cs_new:cpn {#1vectorbaseunits} ##1 {\unit{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} - \cs_new:cpn {vector#1derivedunits} ##1 {\unit{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} - \cs_new:cpn {#1vectorderivedunits} ##1 {\unit{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} - \cs_new:cpn {vector#1alternateunits} ##1 {\unit{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} - \cs_new:cpn {#1vectoralternateunits} ##1 {\unit{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} + \cs_new:cpn {vector#1baseunits} ##1 {\units{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} + \cs_new:cpn {#1vectorbaseunits} ##1 {\units{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} + \cs_new:cpn {vector#1derivedunits} ##1 {\units{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} + \cs_new:cpn {#1vectorderivedunits} ##1 {\units{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} + \cs_new:cpn {vector#1alternateunits} ##1 {\units{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} + \cs_new:cpn {#1vectoralternateunits} ##1 {\units{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} \cs_new:cpn {vector#1onlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}} \cs_new:cpn {#1vectoronlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}} \cs_new:cpn {vector#1onlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}} @@ -2259,7 +2309,7 @@ \cs_new:cpn {vector#1onlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}} \cs_new:cpn {#1vectoronlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}} } -\NewDocumentCommand{\newvectorquantity}{ m m O{#2} O{#2} } +\NewDocumentCommand{\NewVectorQuantity}{ m m O{#2} O{#2} } { \__mandi_newvectorquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 } } @@ -2273,16 +2323,16 @@ \cs_new:Npn \__mandi_renewvectorquantity:nnnn #1#2#3#4 { \__mandi_renewscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 } - \cs_set:cpn {vector#1} ##1 {\unit{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} - \cs_set:cpn {#1vector} ##1 {\unit{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} + \cs_set:cpn {vector#1} ##1 {\units{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} + \cs_set:cpn {#1vector} ##1 {\units{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} \cs_set:cpn {vector#1value} ##1 {\mivector{##1}} \cs_set:cpn {#1vectorvalue} ##1 {\mivector{##1}} - \cs_set:cpn {vector#1baseunits} ##1 {\unit{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} - \cs_set:cpn {#1vectorbaseunits} ##1 {\unit{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} - \cs_set:cpn {vector#1derivedunits} ##1 {\unit{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} - \cs_set:cpn {#1vectorderivedunits} ##1 {\unit{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} - \cs_set:cpn {vector#1alternateunits} ##1 {\unit{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} - \cs_set:cpn {#1vectoralternateunits} ##1 {\unit{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} + \cs_set:cpn {vector#1baseunits} ##1 {\units{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} + \cs_set:cpn {#1vectorbaseunits} ##1 {\units{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} + \cs_set:cpn {vector#1derivedunits} ##1 {\units{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} + \cs_set:cpn {#1vectorderivedunits} ##1 {\units{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} + \cs_set:cpn {vector#1alternateunits} ##1 {\units{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} + \cs_set:cpn {#1vectoralternateunits} ##1 {\units{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} \cs_set:cpn {vector#1onlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}} \cs_set:cpn {#1vectoronlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}} \cs_set:cpn {vector#1onlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}} @@ -2290,7 +2340,7 @@ \cs_set:cpn {vector#1onlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}} \cs_set:cpn {#1vectoronlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}} } -\NewDocumentCommand{\renewvectorquantity}{ m m O{#2} O{#2} } +\NewDocumentCommand{\RenewVectorQuantity}{ m m O{#2} O{#2} } { \__mandi_renewvectorquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 } } @@ -2303,21 +2353,21 @@ \ExplSyntaxOn \cs_new:Npn \__mandi_newphysicalconstant:nnnnnnn #1#2#3#4#5#6#7 { - \cs_new:cpn {#1} {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}} + \cs_new:cpn {#1} {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}} \cs_new:cpn {#1mathsymbol} {#2} \cs_new:cpn {#1approximatevalue} {#3} \cs_new:cpn {#1precisevalue} {#4} \cs_new:cpn {#1baseunits} - {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectbaseunits{#5}{#6}{#7}}} + {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectbaseunits{#5}{#6}{#7}}} \cs_new:cpn {#1derivedunits} - {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectderivedunits{#5}{#6}{#7}}} + {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectderivedunits{#5}{#6}{#7}}} \cs_new:cpn {#1alternateunits} - {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectalternateunits{#5}{#6}{#7}}} + {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectalternateunits{#5}{#6}{#7}}} \cs_new:cpn {#1onlybaseunits} {\mandi@selectbaseunits{#5}{#6}{#7}} \cs_new:cpn {#1onlyderivedunits} {\mandi@selectderivedunits{#5}{#6}{#7}} \cs_new:cpn {#1onlyalternateunits} {\mandi@selectalternateunits{#5}{#6}{#7}} } -\NewDocumentCommand{\newphysicalconstant}{ m m m m m O{#5} O{#5} } +\NewDocumentCommand{\NewPhysicalConstant}{ m m m m m O{#5} O{#5} } { \__mandi_newphysicalconstant:nnnnnnn { #1 }{ #2 }{ #3 }{ #4 }{ #5 }{ #6 }{ #7 } } @@ -2330,21 +2380,21 @@ \ExplSyntaxOn \cs_new:Npn \__mandi_renewphysicalconstant:nnnnnnn #1#2#3#4#5#6#7 { - \cs_set:cpn {#1} {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}} + \cs_set:cpn {#1} {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}} \cs_set:cpn {#1mathsymbol} {#2} \cs_set:cpn {#1approximatevalue} {#3} \cs_set:cpn {#1precisevalue} {#4} \cs_set:cpn {#1baseunits} - {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectbaseunits{#5}{#6}{#7}}} + {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectbaseunits{#5}{#6}{#7}}} \cs_set:cpn {#1derivedunits} - {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectderivedunits{#5}{#6}{#7}}} + {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectderivedunits{#5}{#6}{#7}}} \cs_set:cpn {#1alternateunits} - {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectalternateunits{#5}{#6}{#7}}} + {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectalternateunits{#5}{#6}{#7}}} \cs_set:cpn {#1onlybaseunits} {\mandi@selectbaseunits{#5}{#6}{#7}} \cs_set:cpn {#1onlyderivedunits} {\mandi@selectderivedunits{#5}{#6}{#7}} \cs_set:cpn {#1onlyalternateunits} {\mandi@selectalternateunits{#5}{#6}{#7}} } -\NewDocumentCommand{\renewphysicalconstant}{ m m m m m O{#5} O{#5} } +\NewDocumentCommand{\RenewPhysicalConstant}{ m m m m m O{#5} O{#5} } { \__mandi_renewphysicalconstant:nnnnnnn { #1 }{ #2 }{ #3 }{ #4 }{ #5 }{ #6 }{ #7 } } @@ -2352,331 +2402,438 @@ % \end{macrocode} % % Define every quantity we need in introductory physics, alphabetically -% for convenience. This is really the core feature of \mandi\ that no other +% for convenience. This is really the core feature of \mandi{} that no other % package offers. There are commands for quantities that have no dimensions % or units, and these quantities are defined for semantic completeness. % % \begin{macrocode} -\newvectorquantity{acceleration}% +\NewVectorQuantity{acceleration}% {\meter\usk\second\totheinversetwo}% [\newton\per\kilogram]% [\meter\per\second\tothetwo]% -\newscalarquantity{amount}% +\NewScalarQuantity{amount}% {\mole}% -\newvectorquantity{angularacceleration}% +\NewVectorQuantity{angularacceleration}% {\radian\usk\second\totheinversetwo}% [\radian\per\second\tothetwo]% [\radian\per\second\tothetwo]% -\newscalarquantity{angularfrequency}% +\NewScalarQuantity{angularfrequency}% {\radian\usk\second\inverse}% [\radian\per\second]% [\radian\per\second]% -%\ifmandi@rotradians -% \newphysicalquantity{angularimpulse}% -% {\meter\tothetwo\usk\kilogram\usk\second\inverse\usk\radian\inverse}% -% [\joule\usk\second\per\radian]% -% [\newton\usk\meter\usk\second\per\radian]% -% \newphysicalquantity{angularmomentum}% -% {\meter\tothetwo\usk\kilogram\usk\second\inverse\usk\radian\inverse}% -% [\kilogram\usk\meter\tothetwo\per(\second\usk\radian)]% -% [\newton\usk\meter\usk\second\per\radian]% -%\else -\newvectorquantity{angularimpulse}% +% \end{macrocode} +% +% Angular impulse may also be |\newton\usk\meter\usk\second| or +% |\joule\usk\second|. +% +% \begin{macrocode} +\NewVectorQuantity{angularimpulse}% {\kilogram\usk\meter\tothetwo\usk\second\inverse}% - [\kilogram\usk\meter\tothetwo\per\second]% % also \joule\usk\second - [\kilogram\usk\meter\tothetwo\per\second]% % also \newton\usk\meter\usk\second -\newvectorquantity{angularmomentum}% + [\kilogram\usk\meter\tothetwo\per\second]% + [\kilogram\usk\meter\tothetwo\per\second]% +% \end{macrocode} +% +% Angular momentum may also be |\joule\usk\second| or +% |\newton\usk\meter\usk\second|. +% +% \begin{macrocode} +\NewVectorQuantity{angularmomentum}% {\kilogram\usk\meter\tothetwo\usk\second\inverse}% - [\kilogram\usk\meter\tothetwo\per\second]% % also \joule\usk\second - [\kilogram\usk\meter\tothetwo\per\second]% % also \newton\usk\meter\usk\second -%\fi -\newvectorquantity{angularvelocity}% + [\kilogram\usk\meter\tothetwo\per\second]% + [\kilogram\usk\meter\tothetwo\per\second]% +% \end{macrocode} +% +% \begin{macrocode} +\NewVectorQuantity{angularvelocity}% {\radian\usk\second\inverse}% [\radian\per\second]% [\radian\per\second]% -\newscalarquantity{area}% +\NewScalarQuantity{area}% {\meter\tothetwo}% -\newscalarquantity{areachargedensity}% +\NewScalarQuantity{areachargedensity}% {\ampere\usk\second\usk\meter\totheinversetwo}% [\coulomb\per\meter\tothetwo]% [\coulomb\per\meter\tothetwo]% -\newscalarquantity{areamassdensity}% +\NewScalarQuantity{areamassdensity}% {\kilogram\usk\meter\totheinversetwo}% [\kilogram\per\meter\tothetwo]% [\kilogram\per\meter\tothetwo]% -\newscalarquantity{capacitance}% +% \end{macrocode} +% +% Capacitance may also be |\coulomb\tothetwo\per\newton\usk\meter| or +% |\second\per\ohm|. +% +% \begin{macrocode} +\NewScalarQuantity{capacitance}% {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse\usk\meter\totheinversetwo}% [\farad]% - [\coulomb\per\volt]% % also \coulomb\tothetwo\per\newton\usk\meter, \second\per\ohm -\newscalarquantity{charge}% + [\coulomb\per\volt]% +% \end{macrocode} +% +% Charge may also be |\farad\usk\volt|. +% +% \begin{macrocode} +\NewScalarQuantity{charge}% {\ampere\usk\second}% [\coulomb]% - [\coulomb]% % also \farad\usk\volt -\newvectorquantity{cmagneticfield}% + [\coulomb]% +% \end{macrocode} +% +% Magnetic field times \(\symup{c}\) may also be |\volt\per\meter|. +% +% \begin{macrocode} +\NewVectorQuantity{cmagneticfield}% {\kilogram\usk\meter\usk\ampere\inverse\usk\second\totheinversethree}% - [\newton\per\coulomb]% % also \volt\per\meter [\newton\per\coulomb]% -\newscalarquantity{conductance}% + [\newton\per\coulomb]% +% \end{macrocode} +% +% \begin{macrocode} +\NewScalarQuantity{conductance}% {\ampere\tothetwo\usk\second\tothethree\usk\kilogram\inverse\usk\meter\totheinversetwo}% [\siemens]% [\ampere\per\volt]% -\newscalarquantity{conductivity}% +\NewScalarQuantity{conductivity}% {\ampere\tothetwo\usk\second\tothethree\usk\kilogram\inverse\usk\meter\totheinversethree}% [\siemens\per\meter]% [\ampere\per\volt\usk\meter]% -\newscalarquantity{conventionalcurrent}% +\NewScalarQuantity{conventionalcurrent}% {\ampere}% [\coulomb\per\second]% [\ampere]% -\newscalarquantity{current}% +\NewScalarQuantity{current}% {\ampere}% -\newscalarquantity{currentdensity}% +\NewScalarQuantity{currentdensity}% {\ampere\usk\meter\totheinversetwo}% [\coulomb\per\second\usk\meter\tothetwo]% [\ampere\per\meter\tothetwo]% -\newscalarquantity{dielectricconstant}% +\NewScalarQuantity{dielectricconstant}% {}% -\newvectorquantity{direction}% +\NewVectorQuantity{direction}% {}% -\newvectorquantity{displacement}% +\NewVectorQuantity{displacement}% {\meter} -\newscalarquantity{duration}% +\NewScalarQuantity{duration}% {\second}% -\newvectorquantity{electricdipolemoment}% +\NewVectorQuantity{electricdipolemoment}% {\ampere\usk\second\usk\meter}% [\coulomb\usk\meter]% [\coulomb\usk\meter]% -\newvectorquantity{electricfield}% +\NewVectorQuantity{electricfield}% {\kilogram\usk\meter\usk\ampere\inverse\usk\second\totheinversethree}% [\volt\per\meter]% [\newton\per\coulomb]% -\newscalarquantity{electricflux}% +\NewScalarQuantity{electricflux}% {\kilogram\usk\meter\tothethree\usk\ampere\inverse\usk\second\totheinversethree}% [\volt\usk\meter]% [\newton\usk\meter\tothetwo\per\coulomb]% -\newscalarquantity{electricpotential}% +% \end{macrocode} +% +% Electric potential, electric potential difference, and emf +% may also be |\joule\per\coulomb|. +% +% \begin{macrocode} +\NewScalarQuantity{electricpotential}% {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversethree}% - [\volt]% % also \joule\per\coulomb [\volt]% -\newscalarquantity{electricpotentialdifference}% + [\volt]% +% \end{macrocode} +% +% \begin{macrocode} +\NewScalarQuantity{electricpotentialdifference}% {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversethree}% - [\volt]% % also \joule\per\coulomb [\volt]% -\newscalarquantity{electroncurrent}% + [\volt]% +\NewScalarQuantity{electroncurrent}% {\second\inverse}% [\ensuremath{\symup{e}}\per\second]% [\ensuremath{\symup{e}}\per\second]% -\newscalarquantity{emf}% +\NewScalarQuantity{emf}% {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversethree}% - [\volt]% % also \joule\per\coulomb [\volt]% -\newscalarquantity{energy}% + [\volt]% +% \end{macrocode} +% +% Energy may also be |\newton\usk\meter|. +% +% \begin{macrocode} +\NewScalarQuantity{energy}% {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo}% - [\joule]% % also \newton\usk\meter [\joule]% -\newscalarquantity{energyinev}% + [\joule]% +% \end{macrocode} +% +% \begin{macrocode} +\NewScalarQuantity{energyinev}% {\electronvolt}% -\newscalarquantity{energyinkev}% +\NewScalarQuantity{energyinkev}% {\kiloelectronvolt}% -\newscalarquantity{energyinmev}% +\NewScalarQuantity{energyinmev}% {\megaelectronvolt}% -\newscalarquantity{energydensity}% +\NewScalarQuantity{energydensity}% {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}% [\joule\per\meter\tothethree]% [\joule\per\meter\tothethree]% -\newscalarquantity{energyflux}% +\NewScalarQuantity{energyflux}% {\kilogram\usk\second\totheinversethree}% [\watt\per\meter\tothetwo]% [\watt\per\meter\tothetwo]% -\newscalarquantity{entropy}% +\NewScalarQuantity{entropy}% {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo\usk\kelvin\inverse}% [\joule\per\kelvin]% [\joule\per\kelvin]% -\newvectorquantity{force}% +% \end{macrocode} +% +% Force may also be |\kilogram\usk\meter\per\second\tothetwo|. +% +% \begin{macrocode} +\NewVectorQuantity{force}% {\kilogram\usk\meter\usk\second\totheinversetwo}% [\newton]% - [\newton]% % also \kilogram\usk\meter\per\second\tothetwo -\newscalarquantity{frequency}% + [\newton]% +% \end{macrocode} +% +% \begin{macrocode} +\NewScalarQuantity{frequency}% {\second\inverse}% [\hertz]% [\hertz]% -\newvectorquantity{gravitationalfield}% +\NewVectorQuantity{gravitationalfield}% {\meter\usk\second\totheinversetwo}% [\newton\per\kilogram]% [\newton\per\kilogram]% -\newscalarquantity{gravitationalpotential}% +\NewScalarQuantity{gravitationalpotential}% {\meter\tothetwo\usk\second\totheinversetwo}% [\joule\per\kilogram]% [\joule\per\kilogram]% -\newscalarquantity{gravitationalpotentialdifference}% +\NewScalarQuantity{gravitationalpotentialdifference}% {\meter\tothetwo\usk\second\totheinversetwo}% [\joule\per\kilogram]% [\joule\per\kilogram]% -\newvectorquantity{impulse}% +\NewVectorQuantity{impulse}% {\kilogram\usk\meter\usk\second\inverse}% [\newton\usk\second]% [\newton\usk\second]% -\newscalarquantity{indexofrefraction}% +\NewScalarQuantity{indexofrefraction}% {}% -\newscalarquantity{inductance}% +% \end{macrocode} +% +% Inductance may also be |\square\meter\usk\kilogram\per\coulomb\tothetwo| or +% |\Wb\per\ampere|. +% +% \begin{macrocode} +\NewScalarQuantity{inductance}% {\kilogram\usk\meter\tothetwo\usk\ampere\totheinversetwo\usk\second\totheinversetwo}% [\henry]% - [\volt\usk\second\per\ampere]% % also \square\meter\usk\kilogram\per\coulomb\tothetwo, \Wb\per\ampere -\newscalarquantity{linearchargedensity}% + [\volt\usk\second\per\ampere]% +% \end{macrocode} +% +% \begin{macrocode} +\NewScalarQuantity{linearchargedensity}% {\ampere\usk\second\usk\meter\inverse}% [\coulomb\per\meter]% [\coulomb\per\meter]% -\newscalarquantity{linearmassdensity}% +\NewScalarQuantity{linearmassdensity}% {\kilogram\usk\meter\inverse}% [\kilogram\per\meter]% [\kilogram\per\meter]% % \end{macrocode} % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandipkg}{mandi} Added \refCom{lorentzfactor}} +% {\linktoplace{sec:mandia}{mandi} Added \refCom{lorentzfactor}} % \begin{macrocode} -\newscalarquantity{lorentzfactor}% +\NewScalarQuantity{lorentzfactor}% {}% -\newscalarquantity{luminousintensity}% +\NewScalarQuantity{luminousintensity}% {\candela}% -\newscalarquantity{magneticcharge}% - {\ampere\usk\meter}% % There is another convention. Be careful! -\newvectorquantity{magneticdipolemoment}% +% \end{macrocode} +% +% There is another convention for magnetic charge, so be careful. +% +% \begin{macrocode} +\NewScalarQuantity{magneticcharge}% + {\ampere\usk\meter}% +% \end{macrocode} +% +% \begin{macrocode} +\NewVectorQuantity{magneticdipolemoment}% {\ampere\usk\meter\tothetwo}% [\ampere\usk\meter\tothetwo]% [\joule\per\tesla]% -\newvectorquantity{magneticfield}% +% \end{macrocode} +% +% Magnetic field may also be |\Wb\per\meter\tothetwo|. +% +% \begin{macrocode} +\NewVectorQuantity{magneticfield}% {\kilogram\usk\ampere\inverse\usk\second\totheinversetwo}% - [\newton\per\ampere\usk\meter]% % also \Wb\per\meter\tothetwo + [\newton\per\ampere\usk\meter]% [\tesla]% -\newscalarquantity{magneticflux}% +% \end{macrocode} +% +% Magnetic flux may also be |\Wb| or +% |\joule\per\ampere|. +% +% \begin{macrocode} +\NewScalarQuantity{magneticflux}% {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversetwo}% [\tesla\usk\meter\tothetwo]% - [\volt\usk\second]% % also \Wb and \joule\per\ampere -\newscalarquantity{mass}% + [\volt\usk\second]% +% \end{macrocode} +% +% \begin{macrocode} +\NewScalarQuantity{mass}% {\kilogram}% -\newscalarquantity{mobility}% +\NewScalarQuantity{mobility}% {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversefour}% [\meter\tothetwo\per\volt\usk\second]% [\coulomb\usk\meter\per\newton\usk\second]% -\newscalarquantity{momentofinertia}% +\NewScalarQuantity{momentofinertia}% {\kilogram\usk\meter\tothetwo}% [\joule\usk\second\tothetwo]% [\kilogram\usk\meter\tothetwo]% -\newvectorquantity{momentum}% +\NewVectorQuantity{momentum}% {\kilogram\usk\meter\usk\second\inverse}% [\kilogram\usk\meter\per\second]% [\kilogram\usk\meter\per\second]% -\newvectorquantity{momentumflux}% +\NewVectorQuantity{momentumflux}% {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}% [\newton\per\meter\tothetwo]% [\newton\per\meter\tothetwo]% -\newscalarquantity{numberdensity}% +\NewScalarQuantity{numberdensity}% {\meter\totheinversethree}% [\per\meter\tothethree]% [\per\meter\tothethree]% -\newscalarquantity{permeability}% +\NewScalarQuantity{permeability}% {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}% [\henry\per\meter]% [\tesla\usk\meter\per\ampere]% -\newscalarquantity{permittivity}% +\NewScalarQuantity{permittivity}% {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse\usk\meter\totheinversethree}% [\farad\per\meter]% [\coulomb\tothetwo\per\newton\usk\meter\tothetwo]% -\newscalarquantity{planeangle}% +\NewScalarQuantity{planeangle}% {\meter\usk\meter\inverse}% [\radian]% [\radian]% -\newscalarquantity{polarizability}% +\NewScalarQuantity{polarizability}% {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse}% [\coulomb\usk\meter\tothetwo\per\volt]% [\coulomb\tothetwo\usk\meter\per\newton]% -\newscalarquantity{power}% +\NewScalarQuantity{power}% {\kilogram\usk\meter\tothetwo\usk\second\totheinversethree}% [\watt]% [\joule\per\second]% -\newvectorquantity{poynting}% +\NewVectorQuantity{poynting}% {\kilogram\usk\second\totheinversethree}% [\watt\per\meter\tothetwo]% [\watt\per\meter\tothetwo]% -\newscalarquantity{pressure}% +\NewScalarQuantity{pressure}% {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}% [\pascal]% [\newton\per\meter\tothetwo]% -\newscalarquantity{relativepermeability} +\NewScalarQuantity{relativepermeability} {}% -\newscalarquantity{relativepermittivity}% +\NewScalarQuantity{relativepermittivity}% {}% -\newscalarquantity{resistance}% +% \end{macrocode} +% +% Resistance may also be |\volt\per\ampere|. +% +% \begin{macrocode} +\NewScalarQuantity{resistance}% {\kilogram\usk\meter\tothetwo\usk\ampere\totheinversetwo\usk\second\totheinversethree}% - [\ohm]% % also \volt\per\ampere [\ohm]% -\newscalarquantity{resistivity}% + [\ohm]% +% \end{macrocode} +% +% \begin{macrocode} +\NewScalarQuantity{resistivity}% {\kilogram\usk\meter\tothethree\usk\ampere\totheinversetwo\usk\second\totheinversethree}% [\ohm\usk\meter]% [\volt\usk\meter\per\ampere]% -\newscalarquantity{solidangle}% +\NewScalarQuantity{solidangle}% {\meter\tothetwo\usk\meter\totheinversetwo}% [\steradian]% [\steradian]% -\newscalarquantity{specificheatcapacity}% +\NewScalarQuantity{specificheatcapacity}% {\meter\tothetwo\usk\second\totheinversetwo\usk\kelvin\inverse}% [\joule\per\kelvin\usk\kilogram]% [\joule\per\kelvin\usk\kilogram] -\newscalarquantity{springstiffness}% +\NewScalarQuantity{springstiffness}% {\kilogram\usk\second\totheinversetwo}% [\newton\per\meter]% [\newton\per\meter]% -\newscalarquantity{springstretch}% % This is really just a displacement. +% \end{macrocode} +% +% Spring stretch is really just a displacement. +% +% \begin{macrocode} +\NewScalarQuantity{springstretch}% {\meter}% -\newscalarquantity{stress}% +% \end{macrocode} +% +% \begin{macrocode} +\NewScalarQuantity{stress}% {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}% [\pascal]% [\newton\per\meter\tothetwo]% -\newscalarquantity{strain}% +\NewScalarQuantity{strain}% {}% -\newscalarquantity{temperature}% +\NewScalarQuantity{temperature}% {\kelvin}% -%\ifmandi@rotradians -% \newphysicalquantity{torque}% -% {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo\usk\radian\inverse}% -% [\newton\usk\meter\per\radian]% -% [\newton\usk\meter\per\radian]% -%\else -\newvectorquantity{torque}% +\NewVectorQuantity{torque}% {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo}% [\newton\usk\meter]% [\newton\usk\meter]% -%\fi -\newvectorquantity{velocity}% +\NewVectorQuantity{velocity}% {\meter\usk\second\inverse}% [\meter\per\second]% [\meter\per\second]% -\newvectorquantity{velocityc}% +\NewVectorQuantity{velocityc}% {\lightspeed}% [\lightspeed]% [\lightspeed]% -\newscalarquantity{volume}% +\NewScalarQuantity{volume}% {\meter\tothethree}% -\newscalarquantity{volumechargedensity}% +\NewScalarQuantity{volumechargedensity}% {\ampere\usk\second\per\meter\totheinversethree}% [\coulomb\per\meter\tothethree]% [\coulomb\per\meter\tothethree]% -\newscalarquantity{volumemassdensity}% +\NewScalarQuantity{volumemassdensity}% {\kilogram\usk\meter\totheinversethree}% [\kilogram\per\meter\tothethree]% [\kilogram\per\meter\tothethree]% -\newscalarquantity{wavelength}% % This is really just a displacement. +% \end{macrocode} +% +% Wavelength is really just a displacement. +% +% \begin{macrocode} +\NewScalarQuantity{wavelength}% {\meter}% -\newvectorquantity{wavenumber}% +% \end{macrocode} +% +% \begin{macrocode} +\NewVectorQuantity{wavenumber}% {\meter\inverse}% [\per\meter]% [\per\meter]% -\newscalarquantity{work}% +% \end{macrocode} +% +% Work may also be |\newton\usk\meter| but this +% is discouraged to avoid confusion with torque. +% +% \begin{macrocode} +\NewScalarQuantity{work}% {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo}% - [\joule]% % also \newton\usk\meter but discouraged [\joule]% -\newscalarquantity{youngsmodulus}% % This is really just a stress. + [\joule]% +% \end{macrocode} +% +% Young's modulus is really just a stress. +% +% \begin{macrocode} +\NewScalarQuantity{youngsmodulus}% {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}% [\pascal]% [\newton\per\meter\tothetwo]% @@ -2685,14 +2842,19 @@ % We need a better glyph for Planck's constant over \( 2\pi \). % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandipkg}{mandi} Added \refCom{hbar}} +% {\linktoplace{sec:mandia}{mandi} Added \refCom{hbar}} % \begin{macrocode} \AtBeginDocument{% \DeclareRobustCommand{\hbar}{{\mathpalette\hbar@\relax\symup{h}}}% }% \newcommand*{\hbar@}[2]{% \makebox[0pt][l]{\raisebox{-0.07\height}{\(\m@th#1\mkern-2mu\mathchar"AF\)}}% - % optional line to make the bar thicker; must use -0.11 +% \end{macrocode} +% +% Optional line to make the bar thicker; must use \(-0.11\) +% in |\raisebox|. +% +% \begin{macrocode} \makebox[0pt][l]{\raisebox{-0.11\height}{\(\m@th#1\mkern-2mu\mathchar"AF\)}}% }% % \end{macrocode} @@ -2701,119 +2863,129 @@ % for convenience. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandipkg}{mandi} Constants' values now use only \cs{times}} +% {\linktoplace{sec:mandia}{mandi} Constants' values now use only \cs{times}} % \begin{macrocode} -\newphysicalconstant{avogadro}% - {\symup{N_A}}% - {6\times10^{23}}{6.02214076\times10^{23}}% % exact 2019 value +\NewPhysicalConstant{avogadro}% + {\symup{N_{A}}}% + {6\times10^{23}}{6.02214076\times10^{23}}% {\mole\inverse}% [\per\mole]% [\per\mole]% -\newphysicalconstant{biotsavartconstant}% % alias for \mzofp - {\symup{\frac{\mu_o}{4\pi}}}% +% \end{macrocode} +% +% |\biotsavartconstant| is an alias for |\mzofp|. +% +% \begin{macrocode} +\NewPhysicalConstant{biotsavartconstant}% + {\symup{\frac{\mu_{o}}{4\pi}}}% {10^{-7}}{10^{-7}}% {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}% [\henry\per\meter]% [\tesla\usk\meter\per\ampere]% -\newphysicalconstant{bohrradius}% - {\symup{a_o}}% +\NewPhysicalConstant{bohrradius}% + {\symup{a_{o}}}% {5.3\times10^{-11}}{5.29177210903\times10^{-11}}% {\meter}% -\newphysicalconstant{boltzmann}% - {\symup{k_B}}% - {1.4\times10^{-23}}{1.380649\times10^{-23}}% % exact 2019 value +\NewPhysicalConstant{boltzmann}% + {\symup{k_{B}}}% + {1.4\times10^{-23}}{1.380649\times10^{-23}}% {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo\usk\kelvin\inverse}% [\joule\per\kelvin]% [\joule\per\kelvin]% -\newphysicalconstant{coulombconstant}% % alias for \oofpez - {\symup{\frac{1}{4\pi\epsilon_o}}}% +% \end{macrocode} +% +% |\coulombconstant| is an alias for |\oofpez|. +% +% \begin{macrocode} +\NewPhysicalConstant{coulombconstant}% + {\symup{\frac{1}{4\pi\epsilon_{o}}}}% {9\times10^{9}}{8.9875517923\times10^{9}}% {\kilogram\usk\meter\tothethree\usk\ampere\totheinversetwo\usk\second\totheinversefour}% [\meter\per\farad]% [\newton\usk\meter\tothetwo\per\coulomb\tothetwo]% -\newphysicalconstant{earthmass}% +\NewPhysicalConstant{earthmass}% {\symup{M_{Earth}}}% {6.0\times10^{24}}{5.9722\times10^{24}}% {\kilogram}% -\newphysicalconstant{earthmoondistance}% +\NewPhysicalConstant{earthmoondistance}% {\symup{d_{EM}}}% {3.8\times10^{8}}{3.81550\times10^{8}}% {\meter}% -\newphysicalconstant{earthradius}% +\NewPhysicalConstant{earthradius}% {\symup{R_{Earth}}}% {6.4\times10^{6}}{6.3781\times10^{6}}% {\meter}% -\newphysicalconstant{earthsundistance}% +\NewPhysicalConstant{earthsundistance}% {\symup{d_{ES}}}% {1.5\times10^{11}}{1.496\times10^{11}}% {\meter}% -\newphysicalconstant{electroncharge}% - {\symup{q_e}}% +\NewPhysicalConstant{electroncharge}% + {\symup{q_{e}}}% {-\elementarychargeapproximatevalue}{-\elementarychargeprecisevalue}% {\ampere\usk\second}% [\coulomb]% [\coulomb]% -\newphysicalconstant{electronCharge}% - {\symup{Q_e}}% +\NewPhysicalConstant{electronCharge}% + {\symup{Q_{e}}}% {-\elementarychargeapproximatevalue}{-\elementarychargeprecisevalue}% {\ampere\usk\second}% [\coulomb]% [\coulomb]% -\newphysicalconstant{electronmass}% - {\symup{m_e}}% +\NewPhysicalConstant{electronmass}% + {\symup{m_{e}}}% {9.1\times10^{-31}}{9.1093837015\times10^{-31}}% {\kilogram}% -\newphysicalconstant{elementarycharge}% +\NewPhysicalConstant{elementarycharge}% {\symup{e}}% - {1.6\times10^{-19}}{1.602176634\times10^{-19}}% % exact 2019 value + {1.6\times10^{-19}}{1.602176634\times10^{-19}}% {\ampere\usk\second}% [\coulomb]% [\coulomb]% -\newphysicalconstant{finestructure}% +\NewPhysicalConstant{finestructure}% {\symup{\alpha}}% {\frac{1}{137}}{7.2973525693\times10^{-3}}% {}% -\newphysicalconstant{hydrogenmass}% - {\symup{m_H}}% +\NewPhysicalConstant{hydrogenmass}% + {\symup{m_{H}}}% {1.7\times10^{-27}}{1.6737236\times10^{-27}}% {\kilogram}% -\newphysicalconstant{moonearthdistance}% +\NewPhysicalConstant{moonearthdistance}% {\symup{d_{ME}}}% {3.8\times10^{8}}{3.81550\times10^{8}}% {\meter}% -\newphysicalconstant{moonmass}% +\NewPhysicalConstant{moonmass}% {\symup{M_{Moon}}}% {7.3\times10^{22}}{7.342\times10^{22}}% {\kilogram}% -\newphysicalconstant{moonradius}% +\NewPhysicalConstant{moonradius}% {\symup{R_{Moon}}}% {1.7\times10^{6}}{1.7371\times10^{6}}% {\meter}% -\newphysicalconstant{mzofp}% - {\symup{\frac{\mu_o}{4\pi}}}% +\NewPhysicalConstant{mzofp}% + {\symup{\frac{\mu_{o}}{4\pi}}}% {10^{-7}}{10^{-7}}% {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}% [\henry\per\meter]% [\tesla\usk\meter\per\ampere]% -\newphysicalconstant{neutronmass}% - {\symup{m_n}}% +\NewPhysicalConstant{neutronmass}% + {\symup{m_{n}}}% {1.7\times10^{-27}}{1.67492749804\times10^{-27}}% {\kilogram}% -\newphysicalconstant{oofpez}% - {\symup{\frac{1}{4\pi\epsilon_o}}}% +\NewPhysicalConstant{oofpez}% + {\symup{\frac{1}{4\pi\epsilon_{o}}}}% {9\times10^{9}}{8.9875517923\times10^{9}}% {\kilogram\usk\meter\tothethree\usk\ampere\totheinversetwo\usk\second\totheinversefour}% [\meter\per\farad]% [\newton\usk\meter\tothetwo\per\coulomb\tothetwo]% -\newphysicalconstant{oofpezcs}% - {\symup{\frac{1}{4\pi\epsilon_o c^2}}}% +\NewPhysicalConstant{oofpezcs}% + {\symup{\frac{1}{4\pi\epsilon_{o} c^2}}}% {10^{-7}}{10^{-7}}% {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}% [\tesla\usk\meter\tothetwo]% [\newton\usk\second\tothetwo\per\coulomb\tothetwo]% -\newphysicalconstant{planck}% +\NewPhysicalConstant{planck}% {\symup{h}}% - {6.6\times10^{-34}}{6.62607015\times10^{-34}}% % exact 2019 value + {6.6\times10^{-34}}{6.62607015\times10^{-34}}% {\kilogram\usk\meter\tothetwo\usk\second\inverse}% [\joule\usk\second]% [\joule\usk\second]% @@ -2822,81 +2994,93 @@ % See \url{https://tex.stackexchange.com/a/448565/218142}. % % \begin{macrocode} -\newphysicalconstant{planckbar}% +\NewPhysicalConstant{planckbar}% {\hbar}% {1.1\times10^{-34}}{1.054571817\times10^{-34}}% {\kilogram\usk\meter\tothetwo\usk\second\inverse}% [\joule\usk\second]% [\joule\usk\second] -\newphysicalconstant{planckc}% +\NewPhysicalConstant{planckc}% {\symup{hc}}% {2.0\times10^{-25}}{1.98644586\times10^{-25}}% {\kilogram\usk\meter\tothethree\usk\second\totheinversetwo}% [\joule\usk\meter]% [\joule\usk\meter]% -\newphysicalconstant{protoncharge}% +\NewPhysicalConstant{protoncharge}% {\symup{q_p}}% {+\elementarychargeapproximatevalue}{+\elementarychargeprecisevalue}% {\ampere\usk\second}% [\coulomb]% [\coulomb]% -\newphysicalconstant{protonCharge}% +\NewPhysicalConstant{protonCharge}% {\symup{Q_p}}% {+\elementarychargeapproximatevalue}{+\elementarychargeprecisevalue}% {\ampere\usk\second}% [\coulomb]% [\coulomb]% -\newphysicalconstant{protonmass}% +\NewPhysicalConstant{protonmass}% {\symup{m_p}}% {1.7\times10^{-27}}{1.672621898\times10^{-27}}% {\kilogram}% -\newphysicalconstant{rydberg}% +\NewPhysicalConstant{rydberg}% {\symup{R_{\infty}}}% {1.1\times10^{7}}{1.0973731568160\times10^{7}}% {\meter\inverse}% -\newphysicalconstant{speedoflight}% +\NewPhysicalConstant{speedoflight}% {\symup{c}}% - {3\times10^{8}}{2.99792458\times10^{8}}% % exact value + {3\times10^{8}}{2.99792458\times10^{8}}% {\meter\usk\second\inverse}% [\meter\per\second]% [\meter\per\second] -\newphysicalconstant{stefanboltzmann}% +\NewPhysicalConstant{stefanboltzmann}% {\symup{\sigma}}% {5.7\times10^{-8}}{5.670374\times10^{-8}}% {\kilogram\usk\second\totheinversethree\usk\kelvin\totheinversefour}% [\watt\per\meter\tothetwo\usk\kelvin\tothefour]% [\watt\per\meter\tothetwo\usk\kelvin\tothefour] -\newphysicalconstant{sunearthdistance}% +\NewPhysicalConstant{sunearthdistance}% {\symup{d_{SE}}}% {1.5\times10^{11}}{1.496\times10^{11}}% {\meter}% -\newphysicalconstant{sunmass}% +\NewPhysicalConstant{sunmass}% {\symup{M_{Sun}}}% {2.0\times10^{30}}{1.98855\times10^{30}}% {\kilogram}% -\newphysicalconstant{sunradius}% +\NewPhysicalConstant{sunradius}% {\symup{R_{Sun}}}% {7.0\times10^{8}}{6.957\times10^{8}}% {\meter}% -\newphysicalconstant{surfacegravfield}% +\NewPhysicalConstant{surfacegravfield}% {\symup{g}}% {9.8}{9.807}% {\meter\usk\second\totheinversetwo}% [\newton\per\kilogram]% [\newton\per\kilogram]% -\newphysicalconstant{universalgrav}% +% \end{macrocode} +% +% The gravitational constant may also have units of +% |\joule\usk\meter\per\kilogram\tothetwo|. +% +% \begin{macrocode} +\NewPhysicalConstant{universalgrav}% {\symup{G}}% {6.7\times10^{-11}}{6.67430\times10^{-11}}% {\meter\tothethree\usk\kilogram\inverse\usk\second\totheinversetwo}% - [\newton\usk\meter\tothetwo\per\kilogram\tothetwo]% % also \joule\usk\meter\per\kilogram\tothetwo [\newton\usk\meter\tothetwo\per\kilogram\tothetwo]% -\newphysicalconstant{vacuumpermeability}% + [\newton\usk\meter\tothetwo\per\kilogram\tothetwo]% +% \end{macrocode} +% +% As of 2018 the vacuum permeability is no longer defined as +% \( 4\pi\times10^{-7} \). +% +% \begin{macrocode} +\NewPhysicalConstant{vacuumpermeability}% {\symup{\mu_o}}% - {4\pi\times10^{-7}}{4\pi\times10^{-7}}% % as of 2018 no longer 4\pi\times10^{-7} + {4\pi\times10^{-7}}{4\pi\times10^{-7}}% {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}% [\henry\per\meter]% [\tesla\usk\meter\per\ampere]% -\newphysicalconstant{vacuumpermittivity}% +\NewPhysicalConstant{vacuumpermittivity}% {\symup{\epsilon_o}}% {9\times10^{-12}}{8.854187817\times10^{-12}}% {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse\usk\meter\totheinversethree}% @@ -2908,9 +3092,9 @@ % represent physical quantities and constants. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandipkg}{mandi} Improved \refCom{checkquantity}} +% {\linktoplace{sec:mandia}{mandi} Improved \refCom{CheckQuantity}} % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandipkg}{mandi} Improved \refCom{checkconstant}} +% {\linktoplace{sec:mandia}{mandi} Improved \refCom{CheckConstant}} % \begin{macrocode} \ExplSyntaxOn \NewDocumentCommand{\@aux}{ m } @@ -2923,7 +3107,7 @@ } \ExplSyntaxOff \newcolumntype{M}{>{\(}p{0.25\linewidth}<{\)}} -\NewDocumentCommand{\checkquantity}{ m } +\NewDocumentCommand{\CheckQuantity}{ m } {% \begin{center} \begin{tabular}{MMM} @@ -2933,7 +3117,7 @@ \end{tabular} \end{center} }% -\NewDocumentCommand{\checkconstant}{ m } +\NewDocumentCommand{\CheckConstant}{ m } {% \begin{center} \begin{tabular}{MMM} @@ -2951,7 +3135,7 @@ % See \url{https://tex.stackexchange.com/a/39054/218142}. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandipkg}{mandi} \refCom{mivector} now +% {\linktoplace{sec:mandia}{mandi} \refCom{mivector} now % requires more than one component} % \begin{macrocode} \ExplSyntaxOn diff --git a/Master/texmf-dist/source/latex/mandi/mandi.ins b/Master/texmf-dist/source/latex/mandi/mandi.ins index 45abce7e591..e235a16fbe3 100644 --- a/Master/texmf-dist/source/latex/mandi/mandi.ins +++ b/Master/texmf-dist/source/latex/mandi/mandi.ins @@ -6,7 +6,7 @@ %% %% mandi.dtx (with options: `install') %% -%% Copyright (C) 2021,2022 by Paul J. Heafner <heafnerj@gmail.com> +%% Copyright (C) 2023 by Paul J. Heafner <heafnerj@gmail.com> %% --------------------------------------------------------------------------- %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3 of this license or (at @@ -38,7 +38,7 @@ \usedir{tex/latex/mandi} \preamble - Copyright (C) 2021,2022 by Paul J. Heafner <heafnerj@gmail.com> + Copyright (C) 2023 by Paul J. Heafner <heafnerj@gmail.com> --------------------------------------------------------------------------- This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at @@ -73,18 +73,18 @@ \file{vdemo.py}{\from{mandistudent.dtx}{vdemo}}} \obeyspaces -\Msg{*************************************************************} -\Msg{* *} -\Msg{* To finish the installation, open a command line and *} -\Msg{* type the following, repeating 2-4 until there are no *} -\Msg{* warnings: *} -\Msg{* 2. lualatex mandi.dtx (lualatex is required) *} -\Msg{* 3. makeindex -s gind.ist -o mandi.ind mandi.idx *} -\Msg{* 4. makeindex -s gglo.ist -o mandi.gls mandi.glo *} -\Msg{* Move the *.sty files into a directory searched by TeX. *} -\Msg{* The vdemo.py file can be deleted. *} -\Msg{* *} -\Msg{*************************************************************} +\Msg{**************************************************************} +\Msg{* *} +\Msg{* To finish the installation, open a command line and *} +\Msg{* type the following, repeating 2-4 until there are no *} +\Msg{* warnings: *} +\Msg{* 2. lualatex mandi.dtx (lualatex is required) *} +\Msg{* 3. makeindex -s gind.ist -o mandi.ind mandi.idx *} +\Msg{* 4. makeindex -s gglo.ist -o mandi.gls mandi.glo *} +\Msg{* Move the *.sty files into a directory searched by TeX. *} +\Msg{* Delete vdemo.py. *} +\Msg{* *} +\Msg{**************************************************************} \endbatchfile \endinput %% diff --git a/Master/texmf-dist/source/latex/mandi/mandiexp.dtx b/Master/texmf-dist/source/latex/mandi/mandiexp.dtx index 507263bd63d..3e4f83f419d 100644 --- a/Master/texmf-dist/source/latex/mandi/mandiexp.dtx +++ b/Master/texmf-dist/source/latex/mandi/mandiexp.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % !TEX program = lualatexmk % -% Copyright (C) 2021,2022 by Paul J. Heafner <heafnerj@gmail.com> +% Copyright (C) 2023 by Paul J. Heafner <heafnerj@gmail.com> % --------------------------------------------------------------------------- % This work may be distributed and/or modified under the conditions of the % LaTeX Project Public License, either version 1.3 of this license or (at @@ -24,7 +24,7 @@ % and includes the derived files mandi.sty % mandistudent.sty % mandiexp.sty -% vdemo.py +% vdemo.py (not needed) % --------------------------------------------------------------------------- % % \fi @@ -65,40 +65,24 @@ %</driver> % \fi % -% \CheckSum{225} -% -% \CharacterTable -% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -% Digits \0\1\2\3\4\5\6\7\8\9 -% Exclamation \! Double quote \" Hash (number) \# -% Dollar \$ Percent \% Ampersand \& -% Acute accent \' Left paren \( Right paren \) -% Asterisk \* Plus \+ Comma \, -% Minus \- Point \. Solidus \/ -% Colon \: Semicolon \; Less than \< -% Equals \= Greater than \> Question mark \? -% Commercial at \@ Left bracket \[ Backslash \\ -% Right bracket \] Circumflex \^ Underscore \_ -% Grave accent \` Left brace \{ Vertical bar \| -% Right brace \} Tilde \~} -% % ^^A DO NOT TRY TO COMPILE THIS DTX FILE BY ITSELF. IT WILL FAIL. % -% \section{The \mandiexp\ Package}\setplace{sec:mandiexppkg} +% \section{The \mandiexp{} Package}\setplace{sec:mandic} % -% \mandi\ comes with an accessory package \mandiexp\ -% which includes commands specific to +% \mandi{} comes with an accessory package \mandiexp{} +% which extends \mandi{} with commands specific to % \emph{Matter \& Interactions}.\footnote{See % \href{https://www.wiley.com/en-us/Matter+and+Interactions%2C+4th+Edition-p-9781118875865} % {\emph{Matter \& Interactions}} and % \url{https://matterandinteractions.org/} for details.} % The commands are primarily for typesetting -% mathematical expressions used in that text. Note that \mandiexp\ -% requires, and loads, \mandi\ but \mandi\ doesn't require, -% and doesn't load, \mandiexp. +% mathematical expressions used in that text. \mandiexp{} +% requires, and loads, \mandi{} but \mandi{} doesn't require, +% and doesn't load, \mandiexp. \mandiexp{} requires the \cs{vec*} +% command and so loads \mandistudent{} if it has not already been +% loaded. % -% Load \mandiexp\ as you would any package in your preamble. +% Load \mandiexp{} as you would any package in your preamble. % There are no package options. % %\iffalse @@ -118,7 +102,7 @@ Typesets the current version and build date. \end{docCommand} \begin{dispExample*}{sidebyside = false} - The version is \mandiexpversion\ and is a stable build. + The version is \mandiexpversion{} and is a stable build. \end{dispExample*} %\iffalse %</example> @@ -334,7 +318,7 @@ %</example> %\fi % -% \subsection{Other Expressions} +% \subsection{Other Symbols} % %\iffalse %<*example> @@ -575,10 +559,10 @@ %</example> %\fi % -% \StopEventually{} +% \MaybeStop{} % % \newgeometry{left=0.50in,right=0.50in,top=1.00in,bottom=1.00in} -% \subsection{\mandiexp\ Source Code} +% \subsection{\mandiexp{} Source Code} % % \iffalse %<*package> @@ -589,14 +573,14 @@ % in the name, that are not for the user to know about. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandiexppkg}{mandiexp} Version number works} +% {\linktoplace{sec:mandic}{mandiexp} Version number works} % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandiexppkg}{mandiexp} Code formatted for better readability} +% {\linktoplace{sec:mandic}{mandiexp} Code formatted for better readability} % \begin{macrocode} -\def\mandiexp@version{3.1.0} -\def\mandiexp@date{2022-01-27} +\def\mandiexp@version{3.2.0} +\def\mandiexp@date{2023-08-01} \NeedsTeXFormat{LaTeX2e}[2020-02-02] -\DeclareRelease{v3.1.0}{2022-01-27}{mandiexp.sty} +\DeclareRelease{v3.2.0}{2023-08-01}{mandiexp.sty} \DeclareCurrentRelease{v\mandiexp@version}{\mandiexp@date} \ProvidesPackage{mandiexp} [\mandiexp@date\space v\mandiexp@version\space Macros for Matter & Interactions] @@ -608,26 +592,55 @@ \newcommand*{\mandiexpversion}{v\mandiexp@version\space dated \mandiexp@date} % \end{macrocode} % +% We need \mandi{} to load \pkg{mathtools} and \pkg{unicode-math}. +% +% \begin{macrocode} +\IfPackageLoadedTF{mandi}% + {}% + {% + \RequirePackage{mandi}% + }% +% \end{macrocode} +% +% \changes{v3.2.0}{2023-08-01} +% {\linktoplace{sec:mandic}{mandiexp} \pkg{mandistudent} is loaded for \cs{vec*}} +% +% We need \mandistudent{} for the new \cs{vec*} command. +% % \begin{macrocode} -\RequirePackage{mandi} +\IfPackageLoadedTF{mandistudent}% + {}% + {% + \RequirePackage{mandistudent}% + }% % \end{macrocode} % +% Load \pkg{xparse} if necessary. +% % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandiexppkg}{mandiexp} \pkg{xparse} is loaded for older formats} +% {\linktoplace{sec:mandic}{mandiexp} \pkg{xparse} is loaded for older formats} % \begin{macrocode} -\IfFormatAtLeastTF {2020-10-01} % load xparse if necessary +\IfFormatAtLeastTF{2020-10-01}% {}% {\RequirePackage{xparse}}% % \end{macrocode} % +% We require the \lualatex{} engine. +% +% \begin{macrocode} +\RequireLuaTeX +% \end{macrocode} +% % \begin{macrocode} \typeout{}% \typeout{mandiexp: You are using mandiexp \mandiexpversion.} \typeout{mandiexp: This package requires LuaLaTeX.}% \typeout{}% +% \end{macrocode} +% +% The momentum principle's lefthand and righthand sides. % -% Commands specific to Matter & Interactions -% The momentum principle +% \begin{macrocode} \NewDocumentCommand{\lhsmomentumprinciple}{ s }% {% \Delta @@ -651,6 +664,12 @@ }% \sb{\symup{sys,net}}\,\Delta t% }% +% \end{macrocode} +% +% The momentum principle in update form, lefthand and +% righthand sides. +% +% \begin{macrocode} \NewDocumentCommand{\lhsmomentumprincipleupdate}{ s }% {% \IfBooleanTF{#1}% @@ -681,6 +700,11 @@ }% \sb{\symup{sys,net}}\,\Delta t% }% +% \end{macrocode} +% +% The full momentum principle as an expression. +% +% \begin{macrocode} \NewDocumentCommand{\momentumprinciple}{ s }% {% \IfBooleanTF{#1}% @@ -691,6 +715,11 @@ \lhsmomentumprinciple = \rhsmomentumprinciple% }% }% +% \end{macrocode} +% +% The full momentum principle in update form as an expression. +% +% \begin{macrocode} \NewDocumentCommand{\momentumprincipleupdate}{ s }% {% \IfBooleanTF{#1}% @@ -701,7 +730,11 @@ \lhsmomentumprincipleupdate = \rhsmomentumprincipleupdate% }% }% -% The momentum principle +% \end{macrocode} +% +% The energy principle's lefthand and righthand sides. +% +% \begin{macrocode} \NewDocumentCommand{\lhsenergyprinciple}{}% {% \Delta E_{\symup{sys}}% @@ -710,6 +743,12 @@ {% W_{\symup{ext}}#1% }% +% \end{macrocode} +% +% The energy principle in update form, lefthand and +% righthand sides. +% +% \begin{macrocode} \NewDocumentCommand{\lhsenergyprincipleupdate}{}% {% E_{\symup{sys,final}}% @@ -719,15 +758,29 @@ E_{\symup{sys,initial}}+% W_{\symup{ext}}#1% }% +% \end{macrocode} +% +% The full energy principle as an expression. +% +% \begin{macrocode} \NewDocumentCommand{\energyprinciple}{ O{} }% {% \lhsenergyprinciple = \rhsenergyprinciple[#1]% }% +% \end{macrocode} +% +% The full energy principle in update form as an expression. +% +% \begin{macrocode} \NewDocumentCommand{\energyprincipleupdate}{ O{} }% {% \lhsenergyprincipleupdate = \rhsenergyprincipleupdate[#1]% }% -% The angular momentum principle +% \end{macrocode} +% +% The angular momentum principle's lefthand and righthand sides. +% +% \begin{macrocode} \NewDocumentCommand{\lhsangularmomentumprinciple}{ s }% {% \Delta% @@ -751,6 +804,12 @@ }% \sb{A\symup{,sys,net}}\,\Delta t% }% +% \end{macrocode} +% +% The energy principle in update form, lefthand and +% righthand sides. +% +% \begin{macrocode} \NewDocumentCommand{\lhsangularmomentumprincipleupdate}{ s }% {% \IfBooleanTF{#1}% @@ -781,6 +840,11 @@ }% \sb{A\symup{,sys,net}}\,\Delta t% }% +% \end{macrocode} +% +% The full angular momentum principle as an expression. +% +% \begin{macrocode} \NewDocumentCommand{\angularmomentumprinciple}{ s }% {% \IfBooleanTF{#1}% @@ -791,6 +855,11 @@ \lhsangularmomentumprinciple = \rhsangularmomentumprinciple% }% }% +% \end{macrocode} +% +% The full angular momentum principle in update form as an expression. +% +% \begin{macrocode} \NewDocumentCommand{\angularmomentumprincipleupdate}{ s }% {% \IfBooleanTF{#1}% @@ -801,6 +870,11 @@ \lhsangularmomentumprincipleupdate = \rhsangularmomentumprincipleupdate% }% }% +% \end{macrocode} +% +% The symbol for an arbitrary entity. +% +% \begin{macrocode} \NewDocumentCommand{\energyof}{ m o }% {% E_{#1% @@ -808,6 +882,11 @@ {,#2}% }% }% +% \end{macrocode} +% +% The symbol for a system's energy. +% +% \begin{macrocode} \NewDocumentCommand{\systemenergy}{ o }% {% E_{\symup{sys}% @@ -815,6 +894,11 @@ {,#1}% }% }% +% \end{macrocode} +% +% +% +% \begin{macrocode} \NewDocumentCommand{\particleenergy}{ o }% {% E_{\symup{particle}% @@ -822,6 +906,11 @@ {,#1}% }% }% +% \end{macrocode} +% +% The symbol for a particle's rest energy. +% +% \begin{macrocode} \NewDocumentCommand{\restenergy}{ o }% {% E_{\symup{rest}% @@ -829,6 +918,11 @@ {,#1}% }% }% +% \end{macrocode} +% +% The symbol for a system's internal energy. +% +% \begin{macrocode} \NewDocumentCommand{\internalenergy}{ o }% {% E_{\symup{internal}% @@ -836,6 +930,11 @@ {,#1}% }% }% +% \end{macrocode} +% +% The symbol for a system's chemical energy. +% +% \begin{macrocode} \NewDocumentCommand{\chemicalenergy}{ o }% {% E_{\symup{chem}% @@ -843,6 +942,11 @@ {,#1}% }% }% +% \end{macrocode} +% +% The symbol for a system's thermal energy. +% +% \begin{macrocode} \NewDocumentCommand{\thermalenergy}{ o }% {% E_{\symup{therm}% @@ -850,6 +954,11 @@ {,#1}% }% }% +% \end{macrocode} +% +% The symbol for a photon's energy. +% +% \begin{macrocode} \NewDocumentCommand{\photonenergy}{ o }% {% E_{\symup{photon}% @@ -857,11 +966,16 @@ {,#1}% }% }% +% \end{macrocode} +% +% The symbol for translational kinetic energy. +% |d[]| must be used because of the way consecutive optional +% arguments are handled. See \pkg{xparse} docs for details.\newline +% See \url{https://tex.stackexchange.com/a/569011/218142}. +% +% \begin{macrocode} \NewDocumentCommand{\translationalkineticenergy}{ s d[] }% {% - % d[] must be used because of the way consecutive optional - % arguments are handled. See xparse docs for details. - % See https://tex.stackexchange.com/a/569011/218142 \IfBooleanTF{#1}% {% E_\bgroup \symup{K}% @@ -872,11 +986,13 @@ \IfValueT{#2}{,#2}% \egroup% }% +% \end{macrocode} +% +% The symbol for rotational kinetic energy. +% +% \begin{macrocode} \NewDocumentCommand{\rotationalkineticenergy}{ s d[] }% {% - % d[] must be used because of the way consecutive optional - % arguments are handled. See xparse docs for details. - % See https://tex.stackexchange.com/a/569011/218142 \IfBooleanTF{#1}% {% E_\bgroup% @@ -887,11 +1003,13 @@ \symup{rot}\IfValueT{#2}{,#2}% \egroup% }% +% \end{macrocode} +% +% The symbol for vibrational kinetic energy. +% +% \begin{macrocode} \NewDocumentCommand{\vibrationalkineticenergy}{ s d[] }% {% - % d[] must be used because of the way consecutive optional - % arguments are handled. See xparse docs for details. - % See https://tex.stackexchange.com/a/569011/218142 \IfBooleanTF{#1}% {% E_\bgroup% @@ -902,6 +1020,11 @@ \symup{vib}\IfValueT{#2}{,#2}% \egroup% }% +% \end{macrocode} +% +% The symbol for a system's gravitational potential energy. +% +% \begin{macrocode} \NewDocumentCommand{\gravitationalpotentialenergy}{ o }% {% U_{\symup{g}% @@ -909,6 +1032,11 @@ {,#1}% }% }% +% \end{macrocode} +% +% The symbol for a system's electric potential energy. +% +% \begin{macrocode} \NewDocumentCommand{\electricpotentialenergy}{ o }% {% U_{\symup{e}% @@ -916,6 +1044,11 @@ {,#1}% }% }% +% \end{macrocode} +% +% The symbol for a system's spring potential energy. +% +% \begin{macrocode} \NewDocumentCommand{\springpotentialenergy}{ o }% {% U_{\symup{s}% diff --git a/Master/texmf-dist/source/latex/mandi/mandistudent.dtx b/Master/texmf-dist/source/latex/mandi/mandistudent.dtx index d27bc93ac54..90b4a3dbd7e 100644 --- a/Master/texmf-dist/source/latex/mandi/mandistudent.dtx +++ b/Master/texmf-dist/source/latex/mandi/mandistudent.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % !TEX program = lualatexmk % -% Copyright (C) 2021,2022 by Paul J. Heafner <heafnerj@gmail.com> +% Copyright (C) 2023 by Paul J. Heafner <heafnerj@gmail.com> % --------------------------------------------------------------------------- % This work may be distributed and/or modified under the conditions of the % LaTeX Project Public License, either version 1.3 of this license or (at @@ -24,7 +24,7 @@ % and includes the derived files mandi.sty % mandistudent.sty % mandiexp.sty -% vdemo.py +% vdemo.py (not needed) % --------------------------------------------------------------------------- % % \fi @@ -111,37 +111,19 @@ while t < 10: %</driver> % \fi % -% \CheckSum{745} -% -% \CharacterTable -% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -% Digits \0\1\2\3\4\5\6\7\8\9 -% Exclamation \! Double quote \" Hash (number) \# -% Dollar \$ Percent \% Ampersand \& -% Acute accent \' Left paren \( Right paren \) -% Asterisk \* Plus \+ Comma \, -% Minus \- Point \. Solidus \/ -% Colon \: Semicolon \; Less than \< -% Equals \= Greater than \> Question mark \? -% Commercial at \@ Left bracket \[ Backslash \\ -% Right bracket \] Circumflex \^ Underscore \_ -% Grave accent \` Left brace \{ Vertical bar \| -% Right brace \} Tilde \~} -% % ^^A DO NOT TRY TO COMPILE THIS DTX FILE BY ITSELF. IT WILL FAIL. % -% \section{The \mandistudent\ Package}\setplace{sec:mandistudentpkg} +% \section{The \mandistudent{} Package}\setplace{sec:mandib} % -% \mandi\ comes with an accessory package \mandistudent, -% which provides a collection of commands physics students can -% use for writing problem solutions. This package focuses on -% the most frequently needed tools. These commands should always -% be used in math mode. Note that \mandistudent\ requires, and -% loads, \mandi\ but \mandi\ doesn't require, and doesn't load, -% \mandistudent. +% \mandi{} comes with an accessory package \mandistudent, +% which extends \mandi{} with a collection of commands physics +% students can use for writing problem solutions. This package +% focuses on the most frequently needed tools. These commands +% should always be used in math mode. \mandistudent{} requires, +% and loads, \mandi{} but \mandi{} doesn't require, and doesn't +% load, \mandistudent. % -% Load \mandistudent\ as you would any package in your preamble. +% Load \mandistudent{} as you would any package in your preamble. % There are no package options. % %\iffalse @@ -161,7 +143,7 @@ while t < 10: Typesets the current version and build date. \end{docCommand} \begin{dispExample*}{sidebyside = false} - The version is \mandistudentversion\ and is a stable build. + The version is \mandistudentversion{} and is a stable build. \end{dispExample*} %\iffalse %</example> @@ -470,7 +452,7 @@ while t < 10: %<*example> %\fi \begin{docEnvironments}[% - doc new = 2021-02-03,% + doc updated = 2023-08-01,% doc parameter = \marg{title},% doclang/environment content = problem,% ]% @@ -490,11 +472,14 @@ while t < 10: }% Provides an environment for stating physics problems. Each problem will begin on a new page. See the examples for how to handle single and - multiple part problems. + multiple part problems. Due to incompatibilities with \textsc{beamer} + and the \pkg{enumitem} package, these environments are not defined if + \textsc{beamer} is loaded. \end{docEnvironments} -\begin{docCommand}[doc new = 2021-02-03]{problempart}{} +\begin{docCommand}[doc updated = 2023-08-01]{problempart}{} Denotes a part of a problem within a \refEnv{parts} - environment. + environment. This command is not defined if \textsc{beamer} + is loaded. \end{docCommand} \begin{dispExample*}{sidebyside = false} \begin{physicsproblem}{Problem 1} @@ -629,12 +614,12 @@ while t < 10: %\iffalse %<*example> %\fi -\begin{docCommand}[doc new = 2021-02-06]{hilite}{% +\begin{docCommand}[doc updated = 2023-08-01]{hilite}{% \oarg{color}\marg{target}\oarg{shape} }% Hilites the desired target, which can be an entire mathematical expression or a part thereof. The default color is magenta and the default shape is a - rectangle. + rectangle. This command is not defined if \textsc{beamer} is loaded. \end{docCommand} \begin{dispListing*}{sidebyside = false,listing only} \begin{align*} @@ -880,7 +865,7 @@ while t < 10: %\fi % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} \cs{diff} renamed to +% {\linktoplace{sec:mandib}{mandistudent} \cs{diff} renamed to % \refCom{df} for compatibility with the \pkg{numerica} package} %\iffalse %<*example> @@ -905,9 +890,9 @@ while t < 10: %\fi % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} All instances of +% {\linktoplace{sec:mandib}{mandistudent} All instances of % \texttt{GlowScript} have been changed to \texttt{Web VPython}} -% \subsection{\WebVPython\ and \VPython\ Program Listings} +% \subsection{\WebVPython{} and \VPython{} Program Listings} % % \href{https://\gsurl}{\WebVPython} % \footnote{On November 9, 2021 \texttt{GlowScript} was renamed to @@ -917,7 +902,7 @@ while t < 10: % \href{https://\vpurl}{VPython}\footnote{\href{https://\vpurl}{https://\vpurl}} % are programming environments (both use \href{https://www.python.org}{Python}) % frequently used in introductory physics to introduce students -% for modeling physical systems. \mandi\ makes including code listings +% for modeling physical systems. \mandi{} makes including code listings % very simple for students. % % \subsection{The \texttt{\small webvpythonblock} Environment} @@ -931,29 +916,32 @@ while t < 10: ]% {% {% - doc updated = 2022-01-27,% + doc updated = 2023-08-01,% doc name = webvpythonblock,% doc description = now includes a QR code,% },% {% - doc new = 2022-01-27,% + doc updated = 2023-08-01,% doc name = webvpythonblock*,% doc description = use this variant to omit QR code,% },% }% Code placed here is nicely formatted and optionally linked to its source on \href{https://\gsurl}{\WebVPythonorg}, which must be in a public (not private) - folder. Clicking anywhere in the code window will open the link in the default - browser. A caption is mandatory, and a label is internally generated. The - listing always begins on a new page. A URL shortening utility is recommended - to keep the URL from getting unruly. For convenience, |https://| is - automatically prepended to the URL and can thus be omitted. The |#| character - in a URL should not cause problems. The default URL is that of the \WebVPython\ + folder. Clicking anywhere in the code window (between the black horizontal bars) + or on the URL will open the link in the default browser. A caption is mandatory, + and a label is internally generated. The listing always begins on a new page. + A URL shortening utility is recommended to keep the URL from getting unruly + especially if it generates an overfull box error. For convenience, |https://| + is automatically prepended to the URL and can be omitted. The |#| character + in a URL should not cause problems. The default URL is that of the \WebVPython{} home page. \end{docEnvironments} \begin{dispListing*}{sidebyside = false} -\begin{webvpythonblock}(tinyurl.com/y3lnqyn3){A \texttt{Web VPython} Program With QR Code} -GlowScript 3.0 vpython +\begin{webvpythonblock} + (glowscript.org/#/user/heafnerj/folder/mandidemo/program/mandidemo) + {Example With QR Code} +Web VPython 3.2 scene.width = 400 scene.height = 760 @@ -998,8 +986,10 @@ while t < 10: t = t + deltat \end{webvpythonblock} \end{dispListing*} -\begin{webvpythonblock}(tinyurl.com/y3lnqyn3){A \texttt{Web VPython} Program With QR Code} -GlowScript 3.0 vpython +\begin{webvpythonblock} + (glowscript.org/#/user/heafnerj/folder/mandidemo/program/mandidemo) + {Example With QR Code} +Web VPython 3.2 scene.width = 400 scene.height = 760 @@ -1056,7 +1046,7 @@ while t < 10: %<*example> %\fi \begin{dispExample*}{sidebyside = false} - \WebVPython\ program \ref{gs:1} is nice. + \WebVPython{} program \ref{gs:1} is nice. It's called \nameref{gs:1} and is on page \pageref{gs:1}. \end{dispExample*} %\iffalse @@ -1069,8 +1059,10 @@ while t < 10: %<*example> %\fi \begin{dispListing*}{sidebyside = false} -\begin{webvpythonblock*}(tinyurl.com/y3lnqyn3){A \texttt{Web VPython} Program Without QR Code} -GlowScript 3.0 vpython +\begin{webvpythonblock*} + (glowscript.org/#/user/heafnerj/folder/mandidemo/program/mandidemo) + {Example Without QR Code} +Web VPython 3.2 scene.width = 400 scene.height = 760 @@ -1115,8 +1107,10 @@ while t < 10: t = t + deltat \end{webvpythonblock*} \end{dispListing*} -\begin{webvpythonblock*}(tinyurl.com/y3lnqyn3){A \texttt{Web VPython} Program Without QR Code} -GlowScript 3.0 vpython +\begin{webvpythonblock*} + (glowscript.org/#/user/heafnerj/folder/mandidemo/program/mandidemo) + {Example Without QR Code} +Web VPython 3.2 scene.width = 400 scene.height = 760 @@ -1161,7 +1155,7 @@ while t < 10: t = t + deltat \end{webvpythonblock*} \begin{dispExample*}{sidebyside = false} - \WebVPython\ program \ref{gs:2} is nice. + \WebVPython{} program \ref{gs:2} is nice. It's called \nameref{gs:2} and is on page \pageref{gs:2}. \end{dispExample*} % @@ -1174,20 +1168,21 @@ while t < 10: %\iffalse %<*example> %\fi -\begin{docCommand}[doc updated = 2022-01-27]{vpythonfile} +\begin{docCommand}[doc updated = 2023-08-01]{vpythonfile} {\oarg{options}(\meta{link})\marg{file}\marg{caption}} - Command to load and typeset a \VPython\ program, read from local file - \marg{file}. Clicking anywhere in the code window can optionally open - a link, passed as an option, in the default browser. A caption is mandatory, - and a label is internally generated. The listing always begins on a new page. - A URL shortening utility is recommended to keep the URL from getting unruly. - For convenience, |https://| is automatically prepended to the URL and can - thus be omitted. The default URL is that of the \VPython\ home page. + Command to load and typeset a \VPython{} program, read from local file + \marg{file}. Clicking anywhere in the code window (between the black + horizontal bars) or on the URL will open the link in the default browser. + A caption is mandatory, and a label is internally generated. The listing + always begins on a new page. A URL shortening utility is recommended to + keep the URL from getting unruly especially if it generates an overfull + box error. For convenience, |https://| is automatically prepended to the + URL and can be omitted. The default URL is that of the \VPython{} home page. \end{docCommand} \begin{dispListing*}{sidebyside = false} -\vpythonfile{vdemo.py}{A \VPython\ Program} +\vpythonfile{vdemo.py}{A \VPython{} Program} \end{dispListing*} -\vpythonfile{vdemo.py}{A \VPython\ Program} +\vpythonfile{vdemo.py}{A \VPython{} Program} %\iffalse %</example> %\fi @@ -1196,7 +1191,7 @@ while t < 10: %<*example> %\fi \begin{dispExample*}{sidebyside = false} - \VPython\ program \ref{vp:1} is nice. + \VPython{} program \ref{vp:1} is nice. It's called \nameref{vp:1} and is on page \pageref{vp:1}. \end{dispExample*} % @@ -1227,17 +1222,19 @@ while t < 10: less than one line long. \end{docCommands} \begin{dispExample*}{sidebyside = false} - \WebVPython\ programs begin with \webvpythoninline{GlowScript 3.0 VPython} - and \VPython\ programs begin with \vpythoninline{from vpython import *}. + \WebVPython{} programs begin with \webvpythoninline{Web VPython 3.2}. +\end{dispExample*} +\begin{dispExample*}{sidebyside = false} + \VPython{} programs begin with \vpythoninline{from vpython import *}. \end{dispExample*} %\iffalse %</example> %\fi % -% \StopEventually{} +% \MaybeStop{} % % \newgeometry{left=0.50in,right=0.50in,top=1.00in,bottom=1.00in} -% \subsection{\mandistudent\ Source Code} +% \subsection{\mandistudent{} Source Code} % % \iffalse %<*package> @@ -1248,14 +1245,14 @@ while t < 10: % in the name, that are not for the user to know about. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} Version number works} +% {\linktoplace{sec:mandib}{mandistudent} Version number works} % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} Code formatted for better readability} +% {\linktoplace{sec:mandib}{mandistudent} Code formatted for better readability} % \begin{macrocode} -\def\mandistudent@version{3.1.0} -\def\mandistudent@date{2022-01-27} +\def\mandistudent@version{3.2.0} +\def\mandistudent@date{2023-08-01} \NeedsTeXFormat{LaTeX2e}[2020-02-02] -\DeclareRelease{v3.1.0}{2022-01-27}{mandistudent.sty} +\DeclareRelease{v3.2.0}{2023-08-01}{mandistudent.sty} \DeclareCurrentRelease{v\mandistudent@version}{\mandistudent@date} \ProvidesPackage{mandistudent} [\mandistudent@date\space v\mandistudent@version\space Macros for introductory physics] @@ -1269,70 +1266,157 @@ while t < 10: % % Load third party packages, documenting why each one is needed. % +% AMS goodness. Don't load \pkg{amssymb} or \pkg{amsfonts}. +% +% \begin{macrocode} +\RequirePackage{amsmath} +% \end{macrocode} +% +% We need \pkg{enumitem} for the |physicsproblem| environment. +% +% \textsc{beamer} is not compatible with \pkg{enumitem} so if +% \textsc{beamer} is loaded certain commands are not defined. +% +% \begin{macrocode} +\IfClassLoadedTF{beamer}% + {}% + {% + \RequirePackage[inline]{enumitem}% + }% +% \end{macrocode} +% +% We need \pkg{eso-pic} for |\hilite|. +% +% \begin{macrocode} +\RequirePackage{eso-pic} +% \end{macrocode} +% +% We need \pkg{esvect} for nice vector arrows, style g. +% % \begin{macrocode} -\RequirePackage{amsmath} % AMS goodness (don't load amssymb or amsfonts) -\RequirePackage[inline]{enumitem} % needed for physicsproblem environment -\RequirePackage{eso-pic} % needed for \hilite -\RequirePackage[g]{esvect} % needed for nice vector arrow, style g -\RequirePackage{pgfopts} % needed for key-value interface -\RequirePackage{iftex} % needed for requiring LuaLaTeX -\RequirePackage{makebox} % needed for consistent \dirvect; \makebox -\RequirePackage{mandi} -\RequirePackage{mathtools} % needed for paired delimiters; extends amsmath -\RequirePackage{nicematrix} % needed for column and row vectors -\RequirePackage{qrcode} % needed for QR codes in webvpythonblock -\qrset{height=1.5cm} % set default size of QR code -\RequirePackage[most]{tcolorbox} % needed for program listings -\RequirePackage{tensor} % needed for index notation -\RequirePackage{tikz} % needed for \hilite -\usetikzlibrary{shapes,fit,tikzmark} % needed for \hilite -\RequirePackage{unicode-math} % needed for Unicode support +\RequirePackage[g]{esvect} % \end{macrocode} % +% We need \pkg{pgfopts} for a key-value interface. +% +% \begin{macrocode} +\RequirePackage{pgfopts} +% \end{macrocode} +% +% We need \pkg{iftex} so we can require \lualatex. +% +% \begin{macrocode} +\RequirePackage{iftex} +% \end{macrocode} +% +% We need \pkg{makebox} for consistent |\dirvect| notation. +% +% \begin{macrocode} +\RequirePackage{makebox} +% \end{macrocode} +% +% We need \mandi{} to load \pkg{mathtools} and \pkg{unicode-math}. +% +% \begin{macrocode} +\IfPackageLoadedTF{mandi}% + {}% + {% + \RequirePackage{mandi}% + }% +% \end{macrocode} +% +% We need \pkg{nicematrix} for column and row vectors. +% +% \begin{macrocode} +\RequirePackage{nicematrix} +% \end{macrocode} +% +% We need \pkg{qrcode} for QR codes in |webvpythonblock|. +% +% \begin{macrocode} +\RequirePackage{qrcode} +% \end{macrocode} +% +% Set the default size for QR codes. +% +% \begin{macrocode} +\qrset{height=1.5cm} +% \end{macrocode} +% +% We need \pkg{tcolorbox} for program listings. +% +% \begin{macrocode} +\RequirePackage[most]{tcolorbox} +% \end{macrocode} +% +% We need \pkg{tensor} for index notation. +% +% \begin{macrocode} +\RequirePackage{tensor} +% \end{macrocode} +% \begin{macrocode} +% +% We need \pkg{tikz} for |\hilite|.. +% +\RequirePackage{tikz} +\usetikzlibrary{shapes,fit,tikzmark} +% \end{macrocode} +% +% Load \pkg{xparse} if necessary. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} \pkg{xparse} is loaded for older formats} +% {\linktoplace{sec:mandib}{mandistudent} \pkg{xparse} is loaded for older formats} % \begin{macrocode} -\IfFormatAtLeastTF {2020-10-01} % load xparse if necessary +\IfFormatAtLeastTF{2020-10-01} {}% {\RequirePackage{xparse}}% -\RequirePackage{hyperref} % load last -\RequireLuaTeX % require this engine +% \end{macrocode} +% +% Always load \pkg{hyperref} last if possible. +% +% \begin{macrocode} +\RequirePackage{hyperref} +% \end{macrocode} +% +% We require the \lualatex{} engine. +% +% \begin{macrocode} +\RequireLuaTeX % \end{macrocode} % % Set up the fonts to be consistent with ISO 80000-2 notation. % The \href{https://www.ctan.org/pkg/unicode-math}{\pkg{unicode-math}} package % loads the \href{https://www.ctan.org/pkg/fontspec}{\pkg{fontspec}} and % \href{https://www.ctan.org/pkg/xparse}{\pkg{xparse}} -% packages. Note that \pkg{xparse} is now part of the \LaTeXe\ kernel. -% Because \pkg{unicode-math} is required, all documents using \mandi\ must -% be compiled with an engine that supports Unicode. We recommend \lualatex. +% packages. Note that \pkg{xparse} is now part of the \LaTeXe{} kernel. +% Because \pkg{unicode-math} is required, all documents using \mandi{} must +% be compiled with an engine that supports Unicode, and I recommend \lualatex. % % \begin{macrocode} \unimathsetup{math-style=ISO} -\unimathsetup{warnings-off={mathtools-colon,mathtools-overbracket}} % \end{macrocode} % % Use normal math letters from Latin Modern Math for familiarity with -% textbooks. +% textbooks. This gives a better J. % % \begin{macrocode} \setmathfont[Scale=MatchLowercase] - {Latin Modern Math} % default math font; better J + {Latin Modern Math} % \end{macrocode} % -% Borrow from TeX Gyre DejaVu Math for vectors and tensors to get single-storey g. +% Borrow from TeX Gyre DejaVu Math for vectors and tensors to get +% single-storey lowercase g. % % \begin{macrocode} \setmathfont[Scale=MatchLowercase,range={sfit/{latin},bfsfit/{latin}}] - {TeX Gyre DejaVu Math} % single-storey lowercase g + {TeX Gyre DejaVu Math} % \end{macrocode} % -% Borrow from TeX Gyre DejaVu Math to get single-storey g. +% Borrow from TeX Gyre DejaVu Math to get single-storey lowercase g. % % \begin{macrocode} \setmathfont[Scale=MatchLowercase,range={sfup/{latin},bfsfup/{latin}}] - {TeX Gyre DejaVu Math} % single-storey lowercase g + {TeX Gyre DejaVu Math} % \end{macrocode} % % Borrow |mathscr| and |mathbfscr| from XITS Math.\newline @@ -1349,14 +1433,18 @@ while t < 10: \setmathfont[Scale=MatchLowercase,range={\mathcal,\mathbfcal},StylisticSet=1]{XITS Math} % \end{macrocode} % -% Borrow Greek sfup and sfit letters from STIX Two Math. +% Borrow Greek |sfup| and |sfit| letters from STIX Two Math. % Since this isn't officially supported in \pkg{unicode-math} % we have to manually set this up. % % \begin{macrocode} \setmathfont[Scale=MatchLowercase,range={"E17C-"E1F6}]{STIX Two Math} \newfontfamily{\symsfgreek}{STIX Two Math} -% I don't understand why \text{...} is necessary. +% \end{macrocode} +% +% I don't understand why |\text{...}| is necessary. +% +% \begin{macrocode} \newcommand{\symsfupalpha} {\text{\symsfgreek{^^^^e196}}} \newcommand{\symsfupbeta} {\text{\symsfgreek{^^^^e197}}} \newcommand{\symsfupgamma} {\text{\symsfgreek{^^^^e198}}} @@ -1465,12 +1553,17 @@ while t < 10: \typeout{mandistudent: This package requires LuaLaTeX.}% \typeout{mandistudent: This package changes the default math font(s).}% \typeout{mandistudent: This package redefines the \protect\vec\space command.}% +\IfClassLoadedTF{beamer}% + {% + \typeout{mandistudent: BEAMER detected. Certain commands will not be defined.}% + }% + {}% \typeout{}% % \end{macrocode} % % A better, intelligent coordinate-free \refCom{vec} command. Note the use of % the |e{_^}| type of optional argument. This accounts for much of the -% flexibility and power of this command. Also note the use of the \TeX\ +% flexibility and power of this command. Also note the use of the \TeX{} % primitives |\sb{}| and |\sp{}|. Why doesn't it work when I put spaces % around |#3| or |#4|? Because outside of |\ExplSyntaxOn...\ExplSyntaxOff|, % the |_| character has a different catcode and is treated as a mathematical @@ -1479,28 +1572,22 @@ while t < 10: % See also \url{https://tex.stackexchange.com/a/531037/218142}. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} \refCom{vec}% +% {\linktoplace{sec:mandib}{mandistudent} \refCom{vec}% % no longer adds \cs{scriptspace} when no sub/superscript is given} % \begin{macrocode} \RenewDocumentCommand{\vec}{ s m e{_^} }% {% - % Note the \, used to make superscript look better. \IfBooleanTF{#1} {% - \vv{#2}% % * gives an arrow - % Use \sp{} primitive for superscript. - % Adjust superscript for the arrow. + \vv{#2}% \IfValueT{#4}% {\sp{\,#4\vphantom{\smash[t]{\big|}}}} }% {% - \symbfit{#2} % no * gives us bold - % Use \sp{} primitive for superscript. - % No superscript adjustment needed. + \symbfit{#2} \IfValueT{#4}% {\sp{#4\vphantom{\smash[t]{\big|}}}} }% - % Use \sb{} primitive for subscript. \IfValueT{#3}% {\sb{#3\vphantom{\smash[b]{|}}}} }% @@ -1513,7 +1600,7 @@ while t < 10: % See \url{https://tex.stackexchange.com/a/391204/218142}. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} \refCom{dirvec}% +% {\linktoplace{sec:mandib}{mandistudent} \refCom{dirvec}% % no longer adds \cs{scriptspace} when no sub/superscript is given} % \begin{macrocode} \NewDocumentCommand{\dirvec}{ s m e{_^} }% @@ -1555,7 +1642,7 @@ while t < 10: % See \url{https://tex.stackexchange.com/a/39054/218142}. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} \LaTeX3 code now conforms to formatting standards} +% {\linktoplace{sec:mandib}{mandistudent} \LaTeX3 code now conforms to formatting standards} % \begin{macrocode} \ExplSyntaxOn \NewDocumentCommand{\colvec}{ O{,} m } @@ -1621,34 +1708,41 @@ while t < 10: % \end{macrocode} % % An environment for problem statements. The starred variant gives -% in-line lists. +% in-line lists. These are not defined if \textsc{beamer} is loaded. % +% \changes{v3.2.0}{2023-08-01} +% {\linktoplace{sec:mandib}{mandistudent} \refEnv{physicsproblem} and +% \refEnv{physicsproblem*} are not defined if \textsc{beamer} is loaded} % \begin{macrocode} -\NewDocumentEnvironment{physicsproblem}{ m }% - {% - \newpage% - \section*{#1}% - \newlist{parts}{enumerate}{2}% - \setlist[parts]{label=\bfseries(\alph*)}% - }% +\IfClassLoadedTF{beamer} {}% -\NewDocumentEnvironment{physicsproblem*}{ m }% {% - \newpage% - \section*{#1}% - \newlist{parts}{enumerate*}{2}% - \setlist[parts]{label=\bfseries(\alph*)}% + \NewDocumentEnvironment{physicsproblem}{ m }% + {% + \newpage% + \section*{#1}% + \newlist{parts}{enumerate}{2}% + \setlist[parts]{label=\bfseries(\alph*)}% + }% + {}% + \NewDocumentEnvironment{physicsproblem*}{ m }% + {% + \newpage% + \section*{#1}% + \newlist{parts}{enumerate*}{2}% + \setlist[parts]{label=\bfseries(\alph*)}% + }% + {}% + \NewDocumentCommand{\problempart}{}{\item}% }% - {}% -\NewDocumentCommand{\problempart}{}{\item}% % \end{macrocode} % -% An environment for problem solutions. +% An environment for problem solutions. Equation numbering +% is consecutive through the document. % % \begin{macrocode} \NewDocumentEnvironment{physicssolution}{ +b }% {% - % Make equation numbering consecutive through the document. \begin{align} #1 \end{align} @@ -1656,7 +1750,6 @@ while t < 10: {}% \NewDocumentEnvironment{physicssolution*}{ +b }% {% - % Make equation numbering consecutive through the document. \begin{align*} #1 \end{align*} @@ -1664,7 +1757,7 @@ while t < 10: {}% % \end{macrocode} % -% See \url{https://tex.stackexchange.com/q/570223/218142}. +% See \url{https://tex.stackexchange.com/q/570223/218142}. % % \begin{macrocode} \NewDocumentCommand{\reason}{ O{4cm} m }% @@ -1674,14 +1767,18 @@ while t < 10: % \end{macrocode} % % Command for highlighting parts of, or entire, mathematical expressions.\newline -% See \url{https://texample.net/tikz/examples/beamer-arrows/}.\newline -% See also \url{https://tex.stackexchange.com/a/406084/218142}.\newline -% See also \url{https://tex.stackexchange.com/a/570858/218142}.\newline -% See also \url{https://tex.stackexchange.com/a/570789/218142}.\newline -% See also \url{https://tex.stackexchange.com/a/79659/218142}.\newline -% See also \url{https://tex.stackexchange.com/q/375032/218142}.\newline -% See also \url{https://tex.stackexchange.com/a/571744/218142}% -% +% This command is not defined if \textsc{beamer} is loaded.\newline +% See \url{https://texample.net/tikz/examples/beamer-arrows/}.\newline +% See also \url{https://tex.stackexchange.com/a/406084/218142}.\newline +% See also \url{https://tex.stackexchange.com/a/570858/218142}.\newline +% See also \url{https://tex.stackexchange.com/a/570789/218142}.\newline +% See also \url{https://tex.stackexchange.com/a/79659/218142}.\newline +% See also \url{https://tex.stackexchange.com/q/375032/218142}.\newline +% See also \url{https://tex.stackexchange.com/a/571744/218142}% +% +% \changes{v3.2.0}{2023-08-01} +% {\linktoplace{sec:mandib}{mandistudent} \refCom{hilite} is +% not defined if \textsc{beamer} is loaded} % \begin{macrocode} \newcounter{tikzhighlightnode} \NewDocumentCommand{\hilite}{ O{magenta!60} m O{rectangle} }% @@ -1705,7 +1802,7 @@ while t < 10: % See \url{https://tex.stackexchange.com/a/614478/218142}. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} Slightly modified \refCom{image}} +% {\linktoplace{sec:mandib}{mandistudent} Slightly modified \refCom{image}} % \begin{macrocode} \NewDocumentCommand{\image}{ O{scale=1} m m m }% {% @@ -1725,10 +1822,11 @@ while t < 10: % notations. Use starred form for index notation, unstarred form for % coordinate-free. % +% Consider renaming these to |\vectorsym| and |\tensorsym|. +% % \begin{macrocode} \NewDocumentCommand{\veccomp}{ s m }% {% - % Consider renaming this to \vectorsym. \IfBooleanTF{#1} {% \symnormal{#2}% @@ -1739,7 +1837,6 @@ while t < 10: }% \NewDocumentCommand{\tencomp}{ s m }% {% - % Consider renaming this to \tensororsym. \IfBooleanTF{#1}% {% \symsfit{#2}% @@ -1782,28 +1879,48 @@ while t < 10: % \end{macrocode} % % Intelligent slot command for coordinate-free tensor notation. +% |d[]| must be used because of the way consecutive optional +% arguments are handled. See \pkg{xparse} docs for details. % % \begin{macrocode} \NewDocumentCommand{\slot}{ s d[] }% {% - % d[] must be used because of the way consecutive optional - % arguments are handled. See xparse docs for details. \IfBooleanTF{#1} {% \IfValueTF{#2} - {% Insert a vector, but don't show the slot. +% \end{macrocode} +% +% Insert a vector, but don't show the slot. +% +% \begin{macrocode} + {% \smash{\makebox[1.5em]{\ensuremath{#2}}} }% - {% No vector, no slot. +% \end{macrocode} +% +% No vector, no slot. +% +% \begin{macrocode} + {% \smash{\makebox[1.5em]{\ensuremath{}}} }% }% {% \IfValueTF{#2} - {% Insert a vector and show the slot. +% \end{macrocode} +% +% Insert a vector and show the slot. +% +% \begin{macrocode} + {% \underline{\smash{\makebox[1.5em]{\ensuremath{#2}}}} }% - {% No vector; just show the slot. +% \end{macrocode} +% +% No vector; just show the slot. +% +% \begin{macrocode} + {% \underline{\smash{\makebox[1.5em]{\ensuremath{}}}} }% }% @@ -1843,36 +1960,39 @@ while t < 10: % \href{https://www.ctan.org/pkg/tcolorbox}{\pkg{tcolorbox}}.\newline % See \url{https://tex.stackexchange.com/a/529421/218142}. % +% We set a new font for listings and some new colors (background gray, gray, +% green, orange, peach, pearl, and plum). +% % \begin{macrocode} -\newfontfamily{\gsfontfamily}{DejaVuSansMono} % new font for listings -\definecolor{gsbggray} {rgb}{0.90,0.90,0.90} % background gray -\definecolor{gsgray} {rgb}{0.30,0.30,0.30} % gray -\definecolor{gsgreen} {rgb}{0.00,0.60,0.00} % green -\definecolor{gsorange} {rgb}{0.80,0.45,0.12} % orange -\definecolor{gspeach} {rgb}{1.00,0.90,0.71} % peach -\definecolor{gspearl} {rgb}{0.94,0.92,0.84} % pearl -\definecolor{gsplum} {rgb}{0.74,0.46,0.70} % plum +\newfontfamily{\gsfontfamily}{DejaVuSansMono} +\definecolor{gsbggray} {rgb}{0.90,0.90,0.90} +\definecolor{gsgray} {rgb}{0.30,0.30,0.30} +\definecolor{gsgreen} {rgb}{0.00,0.60,0.00} +\definecolor{gsorange} {rgb}{0.80,0.45,0.12} +\definecolor{gspeach} {rgb}{1.00,0.90,0.71} +\definecolor{gspearl} {rgb}{0.94,0.92,0.84} +\definecolor{gsplum} {rgb}{0.74,0.46,0.70} \lstdefinestyle{vpython}% - {% % style for listings - backgroundcolor=\color{gsbggray},% % background color - basicstyle=\colordigits\footnotesize,% % default style - breakatwhitespace=true% % break at whitespace - breaklines=true,% % break long lines - captionpos=b,% % position caption - classoffset=1,% % STILL DON'T UNDERSTAND THIS - commentstyle=\color{gsgray},% % font for comments - deletekeywords={print},% % delete keywords from the given language - emph={self,cls,@classmethod,@property},% % words to emphasize - emphstyle=\color{gsorange}\itshape,% % font for emphasis + {% + backgroundcolor=\color{gsbggray},% % background color + basicstyle=\colordigits\footnotesize,% % default style + breakatwhitespace=true% % break at whitespace + breaklines=true,% % break long lines + captionpos=b,% % position caption + classoffset=1,% % STILL DON'T UNDERSTAND THIS + commentstyle=\color{gsgray},% % font for comments + deletekeywords={print},% % delete keywords from the given language + emph={self,cls,@classmethod,@property},% % words to emphasize + emphstyle=\color{gsorange}\itshape,% % font for emphasis escapeinside={(*@}{@*)},% % add LaTeX within your code - frame=tb,% % frame style - framerule=2.0pt,% % frame thickness - framexleftmargin=5pt,% % extra frame left margin - %identifierstyle=\sffamily,% % style for identifiers - keywordstyle=\gsfontfamily\color{gsplum},% % color for keywords - language=Python,% % select language - linewidth=\linewidth,% % width of listings - morekeywords={% % VPython/Web VPython specific keywords + frame=tb,% % frame style + framerule=2.0pt,% % frame thickness + framexleftmargin=5pt,% % extra frame left margin + %identifierstyle=\sffamily,% % style for identifiers + keywordstyle=\gsfontfamily\color{gsplum},% % color for keywords + language=Python,% % select language + linewidth=\linewidth,% % width of listings + morekeywords={% % VPython/Web VPython specific keywords __future__,abs,acos,align,ambient,angle,append,append_to_caption,% append_to_title,arange,arrow,asin,astuple,atan,atan2,attach_arrow,% attach_trail,autoscale,axis,background,billboard,bind,black,blue,border,% @@ -1896,18 +2016,18 @@ while t < 10: texture,textures,thickness,title,trail_color,trail_object,trail_radius,% trail_type,triangle,trigger,True,twist,unbind,up,upper_left,upper_right,% userpan,userspin,userzoom,vec,vector,vertex,vertical_spacing,visible,% - visual,vpython,VPython,waitfor,WebVPython,white,width,world,xtitle,% + visual,vpython,VPython,waitfor,Web,VPython,white,width,world,xtitle,% yellow,yoffset,ytitle% },% - morekeywords={print,None,TypeError},% % additional keywords - morestring=[b]{"""},% % treat triple quotes as strings - numbers=left,% % where to put line numbers - numbersep=10pt,% % how far line numbers are from code - numberstyle=\bfseries\tiny,% % set to 'none' for no line numbers - showstringspaces=false,% % show spaces in strings - showtabs=false,% % show tabs within strings - stringstyle=\gsfontfamily\color{gsgreen},% % color for strings - upquote=true,% % how to typeset quotes + morekeywords={print,None,TypeError},% % additional keywords + morestring=[b]{"""},% % treat triple quotes as strings + numbers=left,% % where to put line numbers + numbersep=10pt,% % how far line numbers are from code + numberstyle=\bfseries\tiny,% % set to 'none' for no line numbers + showstringspaces=false,% % show spaces in strings + showtabs=false,% % show tabs within strings + stringstyle=\gsfontfamily\color{gsgreen},% % color for strings + upquote=true,% % how to typeset quotes }% % \end{macrocode} % @@ -1915,10 +2035,13 @@ while t < 10: % See \url{https://tex.stackexchange.com/a/232208/218142}. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} URLs fixed in \refEnv{webvpythonblock}} +% {\linktoplace{sec:mandib}{mandistudent} URLs fixed in \refEnv{webvpythonblock}} % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} \refEnv{webvpythonblock} now automatically +% {\linktoplace{sec:mandib}{mandistudent} \refEnv{webvpythonblock} now automatically % generates QR codes for program listings} +% \changes{v3.2.0}{2023-08-01} +% {\linktoplace{sec:mandib}{mandistudent} \refEnv{webvpythonblock} now shows +% URL in header} % \begin{macrocode} \AtBeginEnvironment{webvpythonblock}{\catcode`\#=12} \AtEndEnvironment{webvpythonblock}{\catcode`\#=6} @@ -1939,8 +2062,9 @@ while t < 10: title = \begin{minipage}{1.5cm}% \protect\qrcode*{https://#2}% \end{minipage}\hspace{5mm}% - \begin{minipage}{0.7\textwidth}% - \texttt{Web VPython} Program \thetcbcounter: #3% + \begin{minipage}{0.8\textwidth}% + \texttt{Web VPython} Program \thetcbcounter: #3\\ + \footnotesize{\href{https://#2}{\color{white}{https://#2}}}% \end{minipage},% width = 0.9\textwidth,% {#1}, @@ -1950,8 +2074,11 @@ while t < 10: % Here is a variant that omits the QR code. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} \refEnv{webvpythonblock*} is a variant +% {\linktoplace{sec:mandib}{mandistudent} \refEnv{webvpythonblock*} is a variant % of \refEnv{webvpythonblock} that omits the QR code} +% \changes{v3.2.0}{2023-08-01} +% {\linktoplace{sec:mandib}{mandistudent} \refEnv{webvpythonblock*} now shows +% URL in header} % \begin{macrocode} \AtBeginEnvironment{webvpythonblock*}{\catcode`\#=12} \AtEndEnvironment{webvpythonblock*}{\catcode`\#=6} @@ -1970,13 +2097,14 @@ while t < 10: listing only,% listing style = vpython,% nameref = {#3},% - title = \texttt{Web VPython} Program \thetcbcounter: #3,% + title = \texttt{Web VPython} Program \thetcbcounter: #3\\% + \footnotesize{\href{https://#2}{\color{white}{https://#2}}},% width = 0.9\textwidth,% {#1}, }% % \end{macrocode} % -% A new command for generating a list of \WebVPython\ programs. +% A new command for generating a list of \WebVPython{} programs. % % \begin{macrocode} \NewDocumentCommand{\listofwebvpythonprograms}{}% @@ -1989,10 +2117,13 @@ while t < 10: % See \url{https://tex.stackexchange.com/q/616205/218142}. % % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} URLs fixed in \refCom{vpythonfile}} +% {\linktoplace{sec:mandib}{mandistudent} URLs fixed in \refCom{vpythonfile}} % \changes{v3.1.0}{2022-01-27} -% {\linktoplace{sec:mandistudentpkg}{mandistudent} Default URL for \refCom{vpythonfile} +% {\linktoplace{sec:mandib}{mandistudent} Default URL for \refCom{vpythonfile} % is now \vpurl} +% \changes{v3.2.0}{2023-08-01} +% {\linktoplace{sec:mandib}{mandistudent} \refCom{vpythonfile} now shows +% URL in header} % \begin{macrocode} \newcommand*{\vpythonfile}{\catcode`\#=12 \vpythonfile@auxA} \NewDocumentCommand{\vpythonfile@auxA}{ O{} D(){vpython.org} m m }% @@ -2022,7 +2153,7 @@ while t < 10: }% % \end{macrocode} % -% A new command for generating a list of \VPython\ programs. +% A new command for generating a list of \VPython{} programs. % % \begin{macrocode} \NewDocumentCommand{\listofvpythonprograms}{}% @@ -2054,7 +2185,7 @@ while t < 10: {\lstinline[style = vpython]{#1}}% % \end{macrocode} % -% Define \refCom{vpythoninline}, a semantic alias for \VPython\ +% Define \refCom{vpythoninline}, a semantic alias for \VPython{} % in-line listings. % % \begin{macrocode} diff --git a/Master/texmf-dist/tex/latex/mandi/mandi.sty b/Master/texmf-dist/tex/latex/mandi/mandi.sty index 8d712ebb943..286ed3aabc2 100644 --- a/Master/texmf-dist/tex/latex/mandi/mandi.sty +++ b/Master/texmf-dist/tex/latex/mandi/mandi.sty @@ -6,7 +6,7 @@ %% %% mandi.dtx (with options: `package') %% -%% Copyright (C) 2021,2022 by Paul J. Heafner <heafnerj@gmail.com> +%% Copyright (C) 2023 by Paul J. Heafner <heafnerj@gmail.com> %% --------------------------------------------------------------------------- %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3 of this license or (at @@ -32,29 +32,31 @@ %% vdemo.py (not needed) %% --------------------------------------------------------------------------- %% -\def\mandi@version{3.1.0} -\def\mandi@date{2022-01-27} +\def\mandi@version{3.2.0} +\def\mandi@date{2023-08-01} \NeedsTeXFormat{LaTeX2e}[2020-02-02] -\DeclareRelease{v3.1.0}{2022-01-27}{mandi.sty} +\DeclareRelease{v3.2.0}{2023-08-01}{mandi.sty} \DeclareCurrentRelease{v\mandi@version}{\mandi@date} \ProvidesPackage{mandi} [\mandi@date\space v\mandi@version\space Macros for physical quantities] \newcommand*{\mandiversion}{v\mandi@version\space dated \mandi@date} -\RequirePackage{pgfopts} % needed for key-value interface -\RequirePackage{array} % needed for \checkquantity and \checkconstant -\RequirePackage{iftex} % needed for requiring LuaLaTeX -\RequirePackage{unicode-math} % needed for Unicode support -\IfFormatAtLeastTF {2020-10-01} % load xparse if necessary +\RequirePackage{pgfopts} +\RequirePackage{array} +\RequirePackage{iftex} +\RequirePackage{mathtools} +\RequirePackage{unicode-math} +\unimathsetup{warnings-off={mathtools-colon,mathtools-overbracket}} +\IfFormatAtLeastTF{2020-10-01} {}% {\RequirePackage{xparse}}% -\RequireLuaTeX % require this engine +\RequireLuaTeX \newcommand*{\mandi@selectunits}{} \newcommand*{\mandi@selectprecision}{} -\newcommand*{\mandi@selectapproximate}[2]{#1} % really \@firstoftwo -\newcommand*{\mandi@selectprecise}[2]{#2} % really \@secondoftwo -\newcommand*{\mandi@selectbaseunits}[3]{#1} % really \@firstofthree -\newcommand*{\mandi@selectderivedunits}[3]{#2} % really \@secondofthree -\newcommand*{\mandi@selectalternateunits}[3]{#3} % really \@thirdofthree +\newcommand*{\mandi@selectapproximate}[2]{#1} +\newcommand*{\mandi@selectprecise}[2]{#2} +\newcommand*{\mandi@selectbaseunits}[3]{#1} +\newcommand*{\mandi@selectderivedunits}[3]{#2} +\newcommand*{\mandi@selectalternateunits}[3]{#3} \NewDocumentCommand{\alwaysusebaseunits}{} {\renewcommand*{\mandi@selectunits}{\mandi@selectbaseunits}}% \NewDocumentCommand{\alwaysusederivedunits}{} @@ -123,7 +125,16 @@ }% \NewDocumentCommand{\per}{}{/} \NewDocumentCommand{\usk}{}{\cdot} -\NewDocumentCommand{\unit}{ m m }{{#1}{\,#2}} +\NewDocumentCommand{\units}{ m m }% +{% + \IfValueTF{#2} + {% + {#1}{\,#2} + }% + {% + {#1}{} + }% +}% \NewDocumentCommand{\ampere}{}{\symup{A}} \NewDocumentCommand{\atomicmassunit}{}{\symup{u}} \NewDocumentCommand{\candela}{}{\symup{cd}} @@ -156,13 +167,13 @@ \NewDocumentCommand{\volt}{}{\symup{V}} \NewDocumentCommand{\watt}{}{\symup{W}} \NewDocumentCommand{\weber}{}{\symup{Wb}} -\NewDocumentCommand{\tothetwo}{}{^2} % postfix 2 -\NewDocumentCommand{\tothethree}{}{^3} % postfix 3 -\NewDocumentCommand{\tothefour}{}{^4} % postfix 4 -\NewDocumentCommand{\inverse}{}{^{-1}} % postfix -1 -\NewDocumentCommand{\totheinversetwo}{}{^{-2}} % postfix -2 -\NewDocumentCommand{\totheinversethree}{}{^{-3}} % postfix -3 -\NewDocumentCommand{\totheinversefour}{}{^{-4}} % postfix -4 +\NewDocumentCommand{\tothetwo}{}{^{2}} +\NewDocumentCommand{\tothethree}{}{^{3}} +\NewDocumentCommand{\tothefour}{}{^{4}} +\NewDocumentCommand{\inverse}{}{^{-1}} +\NewDocumentCommand{\totheinversetwo}{}{^{-2}} +\NewDocumentCommand{\totheinversethree}{}{^{-3}} +\NewDocumentCommand{\totheinversefour}{}{^{-4}} \NewDocumentCommand{\emptyunit}{}{\mdlgwhtsquare} \NewDocumentCommand{\tento}{ m }{10^{#1}} \NewDocumentCommand{\timestento}{ m }{\times\tento{#1}} @@ -170,16 +181,16 @@ \ExplSyntaxOn \cs_new:Npn \__mandi_newscalarquantity:nnnn #1#2#3#4 { - \cs_new:cpn {#1} ##1 {\unit{##1}{\mandi@selectunits{#2}{#3}{#4}}} + \cs_new:cpn {#1} ##1 {\units{##1}{\mandi@selectunits{#2}{#3}{#4}}} \cs_new:cpn {#1value} ##1 {##1} - \cs_new:cpn {#1baseunits} ##1 {\unit{##1}{\mandi@selectbaseunits{#2}{#3}{#4}}} - \cs_new:cpn {#1derivedunits} ##1 {\unit{##1}{\mandi@selectderivedunits{#2}{#3}{#4}}} - \cs_new:cpn {#1alternateunits} ##1 {\unit{##1}{\mandi@selectalternateunits{#2}{#3}{#4}}} + \cs_new:cpn {#1baseunits} ##1 {\units{##1}{\mandi@selectbaseunits{#2}{#3}{#4}}} + \cs_new:cpn {#1derivedunits} ##1 {\units{##1}{\mandi@selectderivedunits{#2}{#3}{#4}}} + \cs_new:cpn {#1alternateunits} ##1 {\units{##1}{\mandi@selectalternateunits{#2}{#3}{#4}}} \cs_new:cpn {#1onlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}} \cs_new:cpn {#1onlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}} \cs_new:cpn {#1onlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}} } -\NewDocumentCommand{\newscalarquantity}{ m m O{#2} O{#2} } +\NewDocumentCommand{\NewScalarQuantity}{ m m O{#2} O{#2} } { \__mandi_newscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 } } @@ -187,16 +198,16 @@ \ExplSyntaxOn \cs_new:Npn \__mandi_renewscalarquantity:nnnn #1#2#3#4 { - \cs_set:cpn {#1} ##1 {\unit{##1}{\mandi@selectunits{#2}{#3}{#4}}} + \cs_set:cpn {#1} ##1 {\units{##1}{\mandi@selectunits{#2}{#3}{#4}}} \cs_set:cpn {#1value} ##1 {##1} - \cs_set:cpn {#1baseunits} ##1 {\unit{##1}{\mandi@selectbaseunits{#2}{#3}{#4}}} - \cs_set:cpn {#1derivedunits} ##1 {\unit{##1}{\mandi@selectderivedunits{#2}{#3}{#4}}} - \cs_set:cpn {#1alternateunits} ##1 {\unit{##1}{\mandi@selectalternateunits{#2}{#3}{#4}}} + \cs_set:cpn {#1baseunits} ##1 {\units{##1}{\mandi@selectbaseunits{#2}{#3}{#4}}} + \cs_set:cpn {#1derivedunits} ##1 {\units{##1}{\mandi@selectderivedunits{#2}{#3}{#4}}} + \cs_set:cpn {#1alternateunits} ##1 {\units{##1}{\mandi@selectalternateunits{#2}{#3}{#4}}} \cs_set:cpn {#1onlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}} \cs_set:cpn {#1onlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}} \cs_set:cpn {#1onlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}} } -\NewDocumentCommand{\renewscalarquantity}{ m m O{#2} O{#2} } +\NewDocumentCommand{\RenewScalarQuantity}{ m m O{#2} O{#2} } { \__mandi_renewscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 } } @@ -205,16 +216,16 @@ \cs_new:Npn \__mandi_newvectorquantity:nnnn #1#2#3#4 { \__mandi_newscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 } - \cs_new:cpn {vector#1} ##1 {\unit{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} - \cs_new:cpn {#1vector} ##1 {\unit{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} + \cs_new:cpn {vector#1} ##1 {\units{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} + \cs_new:cpn {#1vector} ##1 {\units{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} \cs_new:cpn {vector#1value} ##1 {\mivector{##1}} \cs_new:cpn {#1vectorvalue} ##1 {\mivector{##1}} - \cs_new:cpn {vector#1baseunits} ##1 {\unit{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} - \cs_new:cpn {#1vectorbaseunits} ##1 {\unit{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} - \cs_new:cpn {vector#1derivedunits} ##1 {\unit{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} - \cs_new:cpn {#1vectorderivedunits} ##1 {\unit{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} - \cs_new:cpn {vector#1alternateunits} ##1 {\unit{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} - \cs_new:cpn {#1vectoralternateunits} ##1 {\unit{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} + \cs_new:cpn {vector#1baseunits} ##1 {\units{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} + \cs_new:cpn {#1vectorbaseunits} ##1 {\units{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} + \cs_new:cpn {vector#1derivedunits} ##1 {\units{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} + \cs_new:cpn {#1vectorderivedunits} ##1 {\units{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} + \cs_new:cpn {vector#1alternateunits} ##1 {\units{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} + \cs_new:cpn {#1vectoralternateunits} ##1 {\units{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} \cs_new:cpn {vector#1onlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}} \cs_new:cpn {#1vectoronlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}} \cs_new:cpn {vector#1onlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}} @@ -222,7 +233,7 @@ \cs_new:cpn {vector#1onlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}} \cs_new:cpn {#1vectoronlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}} } -\NewDocumentCommand{\newvectorquantity}{ m m O{#2} O{#2} } +\NewDocumentCommand{\NewVectorQuantity}{ m m O{#2} O{#2} } { \__mandi_newvectorquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 } } @@ -231,16 +242,16 @@ \cs_new:Npn \__mandi_renewvectorquantity:nnnn #1#2#3#4 { \__mandi_renewscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 } - \cs_set:cpn {vector#1} ##1 {\unit{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} - \cs_set:cpn {#1vector} ##1 {\unit{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} + \cs_set:cpn {vector#1} ##1 {\units{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} + \cs_set:cpn {#1vector} ##1 {\units{\mivector{##1}}{\mandi@selectunits{#2}{#3}{#4}}} \cs_set:cpn {vector#1value} ##1 {\mivector{##1}} \cs_set:cpn {#1vectorvalue} ##1 {\mivector{##1}} - \cs_set:cpn {vector#1baseunits} ##1 {\unit{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} - \cs_set:cpn {#1vectorbaseunits} ##1 {\unit{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} - \cs_set:cpn {vector#1derivedunits} ##1 {\unit{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} - \cs_set:cpn {#1vectorderivedunits} ##1 {\unit{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} - \cs_set:cpn {vector#1alternateunits} ##1 {\unit{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} - \cs_set:cpn {#1vectoralternateunits} ##1 {\unit{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} + \cs_set:cpn {vector#1baseunits} ##1 {\units{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} + \cs_set:cpn {#1vectorbaseunits} ##1 {\units{\mivector{##1}}{\mandi@selectbaseunits{#2}{#3}{#4}}} + \cs_set:cpn {vector#1derivedunits} ##1 {\units{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} + \cs_set:cpn {#1vectorderivedunits} ##1 {\units{\mivector{##1}}{\mandi@selectderivedunits{#2}{#3}{#4}}} + \cs_set:cpn {vector#1alternateunits} ##1 {\units{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} + \cs_set:cpn {#1vectoralternateunits} ##1 {\units{\mivector{##1}}{\mandi@selectalternateunits{#2}{#3}{#4}}} \cs_set:cpn {vector#1onlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}} \cs_set:cpn {#1vectoronlybaseunits} {\mandi@selectbaseunits{#2}{#3}{#4}} \cs_set:cpn {vector#1onlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}} @@ -248,7 +259,7 @@ \cs_set:cpn {vector#1onlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}} \cs_set:cpn {#1vectoronlyalternateunits} {\mandi@selectalternateunits{#2}{#3}{#4}} } -\NewDocumentCommand{\renewvectorquantity}{ m m O{#2} O{#2} } +\NewDocumentCommand{\RenewVectorQuantity}{ m m O{#2} O{#2} } { \__mandi_renewvectorquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 } } @@ -256,21 +267,21 @@ \ExplSyntaxOn \cs_new:Npn \__mandi_newphysicalconstant:nnnnnnn #1#2#3#4#5#6#7 { - \cs_new:cpn {#1} {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}} + \cs_new:cpn {#1} {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}} \cs_new:cpn {#1mathsymbol} {#2} \cs_new:cpn {#1approximatevalue} {#3} \cs_new:cpn {#1precisevalue} {#4} \cs_new:cpn {#1baseunits} - {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectbaseunits{#5}{#6}{#7}}} + {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectbaseunits{#5}{#6}{#7}}} \cs_new:cpn {#1derivedunits} - {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectderivedunits{#5}{#6}{#7}}} + {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectderivedunits{#5}{#6}{#7}}} \cs_new:cpn {#1alternateunits} - {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectalternateunits{#5}{#6}{#7}}} + {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectalternateunits{#5}{#6}{#7}}} \cs_new:cpn {#1onlybaseunits} {\mandi@selectbaseunits{#5}{#6}{#7}} \cs_new:cpn {#1onlyderivedunits} {\mandi@selectderivedunits{#5}{#6}{#7}} \cs_new:cpn {#1onlyalternateunits} {\mandi@selectalternateunits{#5}{#6}{#7}} } -\NewDocumentCommand{\newphysicalconstant}{ m m m m m O{#5} O{#5} } +\NewDocumentCommand{\NewPhysicalConstant}{ m m m m m O{#5} O{#5} } { \__mandi_newphysicalconstant:nnnnnnn { #1 }{ #2 }{ #3 }{ #4 }{ #5 }{ #6 }{ #7 } } @@ -278,322 +289,322 @@ \ExplSyntaxOn \cs_new:Npn \__mandi_renewphysicalconstant:nnnnnnn #1#2#3#4#5#6#7 { - \cs_set:cpn {#1} {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}} + \cs_set:cpn {#1} {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}} \cs_set:cpn {#1mathsymbol} {#2} \cs_set:cpn {#1approximatevalue} {#3} \cs_set:cpn {#1precisevalue} {#4} \cs_set:cpn {#1baseunits} - {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectbaseunits{#5}{#6}{#7}}} + {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectbaseunits{#5}{#6}{#7}}} \cs_set:cpn {#1derivedunits} - {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectderivedunits{#5}{#6}{#7}}} + {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectderivedunits{#5}{#6}{#7}}} \cs_set:cpn {#1alternateunits} - {\unit{\mandi@selectprecision{#3}{#4}}{\mandi@selectalternateunits{#5}{#6}{#7}}} + {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectalternateunits{#5}{#6}{#7}}} \cs_set:cpn {#1onlybaseunits} {\mandi@selectbaseunits{#5}{#6}{#7}} \cs_set:cpn {#1onlyderivedunits} {\mandi@selectderivedunits{#5}{#6}{#7}} \cs_set:cpn {#1onlyalternateunits} {\mandi@selectalternateunits{#5}{#6}{#7}} } -\NewDocumentCommand{\renewphysicalconstant}{ m m m m m O{#5} O{#5} } +\NewDocumentCommand{\RenewPhysicalConstant}{ m m m m m O{#5} O{#5} } { \__mandi_renewphysicalconstant:nnnnnnn { #1 }{ #2 }{ #3 }{ #4 }{ #5 }{ #6 }{ #7 } } \ExplSyntaxOff -\newvectorquantity{acceleration}% +\NewVectorQuantity{acceleration}% {\meter\usk\second\totheinversetwo}% [\newton\per\kilogram]% [\meter\per\second\tothetwo]% -\newscalarquantity{amount}% +\NewScalarQuantity{amount}% {\mole}% -\newvectorquantity{angularacceleration}% +\NewVectorQuantity{angularacceleration}% {\radian\usk\second\totheinversetwo}% [\radian\per\second\tothetwo]% [\radian\per\second\tothetwo]% -\newscalarquantity{angularfrequency}% +\NewScalarQuantity{angularfrequency}% {\radian\usk\second\inverse}% [\radian\per\second]% [\radian\per\second]% -\newvectorquantity{angularimpulse}% +\NewVectorQuantity{angularimpulse}% {\kilogram\usk\meter\tothetwo\usk\second\inverse}% - [\kilogram\usk\meter\tothetwo\per\second]% % also \joule\usk\second - [\kilogram\usk\meter\tothetwo\per\second]% % also \newton\usk\meter\usk\second -\newvectorquantity{angularmomentum}% + [\kilogram\usk\meter\tothetwo\per\second]% + [\kilogram\usk\meter\tothetwo\per\second]% +\NewVectorQuantity{angularmomentum}% {\kilogram\usk\meter\tothetwo\usk\second\inverse}% - [\kilogram\usk\meter\tothetwo\per\second]% % also \joule\usk\second - [\kilogram\usk\meter\tothetwo\per\second]% % also \newton\usk\meter\usk\second -\newvectorquantity{angularvelocity}% + [\kilogram\usk\meter\tothetwo\per\second]% + [\kilogram\usk\meter\tothetwo\per\second]% +\NewVectorQuantity{angularvelocity}% {\radian\usk\second\inverse}% [\radian\per\second]% [\radian\per\second]% -\newscalarquantity{area}% +\NewScalarQuantity{area}% {\meter\tothetwo}% -\newscalarquantity{areachargedensity}% +\NewScalarQuantity{areachargedensity}% {\ampere\usk\second\usk\meter\totheinversetwo}% [\coulomb\per\meter\tothetwo]% [\coulomb\per\meter\tothetwo]% -\newscalarquantity{areamassdensity}% +\NewScalarQuantity{areamassdensity}% {\kilogram\usk\meter\totheinversetwo}% [\kilogram\per\meter\tothetwo]% [\kilogram\per\meter\tothetwo]% -\newscalarquantity{capacitance}% +\NewScalarQuantity{capacitance}% {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse\usk\meter\totheinversetwo}% [\farad]% - [\coulomb\per\volt]% % also \coulomb\tothetwo\per\newton\usk\meter, \second\per\ohm -\newscalarquantity{charge}% + [\coulomb\per\volt]% +\NewScalarQuantity{charge}% {\ampere\usk\second}% [\coulomb]% - [\coulomb]% % also \farad\usk\volt -\newvectorquantity{cmagneticfield}% + [\coulomb]% +\NewVectorQuantity{cmagneticfield}% {\kilogram\usk\meter\usk\ampere\inverse\usk\second\totheinversethree}% - [\newton\per\coulomb]% % also \volt\per\meter [\newton\per\coulomb]% -\newscalarquantity{conductance}% + [\newton\per\coulomb]% +\NewScalarQuantity{conductance}% {\ampere\tothetwo\usk\second\tothethree\usk\kilogram\inverse\usk\meter\totheinversetwo}% [\siemens]% [\ampere\per\volt]% -\newscalarquantity{conductivity}% +\NewScalarQuantity{conductivity}% {\ampere\tothetwo\usk\second\tothethree\usk\kilogram\inverse\usk\meter\totheinversethree}% [\siemens\per\meter]% [\ampere\per\volt\usk\meter]% -\newscalarquantity{conventionalcurrent}% +\NewScalarQuantity{conventionalcurrent}% {\ampere}% [\coulomb\per\second]% [\ampere]% -\newscalarquantity{current}% +\NewScalarQuantity{current}% {\ampere}% -\newscalarquantity{currentdensity}% +\NewScalarQuantity{currentdensity}% {\ampere\usk\meter\totheinversetwo}% [\coulomb\per\second\usk\meter\tothetwo]% [\ampere\per\meter\tothetwo]% -\newscalarquantity{dielectricconstant}% +\NewScalarQuantity{dielectricconstant}% {}% -\newvectorquantity{direction}% +\NewVectorQuantity{direction}% {}% -\newvectorquantity{displacement}% +\NewVectorQuantity{displacement}% {\meter} -\newscalarquantity{duration}% +\NewScalarQuantity{duration}% {\second}% -\newvectorquantity{electricdipolemoment}% +\NewVectorQuantity{electricdipolemoment}% {\ampere\usk\second\usk\meter}% [\coulomb\usk\meter]% [\coulomb\usk\meter]% -\newvectorquantity{electricfield}% +\NewVectorQuantity{electricfield}% {\kilogram\usk\meter\usk\ampere\inverse\usk\second\totheinversethree}% [\volt\per\meter]% [\newton\per\coulomb]% -\newscalarquantity{electricflux}% +\NewScalarQuantity{electricflux}% {\kilogram\usk\meter\tothethree\usk\ampere\inverse\usk\second\totheinversethree}% [\volt\usk\meter]% [\newton\usk\meter\tothetwo\per\coulomb]% -\newscalarquantity{electricpotential}% +\NewScalarQuantity{electricpotential}% {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversethree}% - [\volt]% % also \joule\per\coulomb [\volt]% -\newscalarquantity{electricpotentialdifference}% + [\volt]% +\NewScalarQuantity{electricpotentialdifference}% {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversethree}% - [\volt]% % also \joule\per\coulomb [\volt]% -\newscalarquantity{electroncurrent}% + [\volt]% +\NewScalarQuantity{electroncurrent}% {\second\inverse}% [\ensuremath{\symup{e}}\per\second]% [\ensuremath{\symup{e}}\per\second]% -\newscalarquantity{emf}% +\NewScalarQuantity{emf}% {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversethree}% - [\volt]% % also \joule\per\coulomb [\volt]% -\newscalarquantity{energy}% + [\volt]% +\NewScalarQuantity{energy}% {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo}% - [\joule]% % also \newton\usk\meter [\joule]% -\newscalarquantity{energyinev}% + [\joule]% +\NewScalarQuantity{energyinev}% {\electronvolt}% -\newscalarquantity{energyinkev}% +\NewScalarQuantity{energyinkev}% {\kiloelectronvolt}% -\newscalarquantity{energyinmev}% +\NewScalarQuantity{energyinmev}% {\megaelectronvolt}% -\newscalarquantity{energydensity}% +\NewScalarQuantity{energydensity}% {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}% [\joule\per\meter\tothethree]% [\joule\per\meter\tothethree]% -\newscalarquantity{energyflux}% +\NewScalarQuantity{energyflux}% {\kilogram\usk\second\totheinversethree}% [\watt\per\meter\tothetwo]% [\watt\per\meter\tothetwo]% -\newscalarquantity{entropy}% +\NewScalarQuantity{entropy}% {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo\usk\kelvin\inverse}% [\joule\per\kelvin]% [\joule\per\kelvin]% -\newvectorquantity{force}% +\NewVectorQuantity{force}% {\kilogram\usk\meter\usk\second\totheinversetwo}% [\newton]% - [\newton]% % also \kilogram\usk\meter\per\second\tothetwo -\newscalarquantity{frequency}% + [\newton]% +\NewScalarQuantity{frequency}% {\second\inverse}% [\hertz]% [\hertz]% -\newvectorquantity{gravitationalfield}% +\NewVectorQuantity{gravitationalfield}% {\meter\usk\second\totheinversetwo}% [\newton\per\kilogram]% [\newton\per\kilogram]% -\newscalarquantity{gravitationalpotential}% +\NewScalarQuantity{gravitationalpotential}% {\meter\tothetwo\usk\second\totheinversetwo}% [\joule\per\kilogram]% [\joule\per\kilogram]% -\newscalarquantity{gravitationalpotentialdifference}% +\NewScalarQuantity{gravitationalpotentialdifference}% {\meter\tothetwo\usk\second\totheinversetwo}% [\joule\per\kilogram]% [\joule\per\kilogram]% -\newvectorquantity{impulse}% +\NewVectorQuantity{impulse}% {\kilogram\usk\meter\usk\second\inverse}% [\newton\usk\second]% [\newton\usk\second]% -\newscalarquantity{indexofrefraction}% +\NewScalarQuantity{indexofrefraction}% {}% -\newscalarquantity{inductance}% +\NewScalarQuantity{inductance}% {\kilogram\usk\meter\tothetwo\usk\ampere\totheinversetwo\usk\second\totheinversetwo}% [\henry]% - [\volt\usk\second\per\ampere]% % also \square\meter\usk\kilogram\per\coulomb\tothetwo, \Wb\per\ampere -\newscalarquantity{linearchargedensity}% + [\volt\usk\second\per\ampere]% +\NewScalarQuantity{linearchargedensity}% {\ampere\usk\second\usk\meter\inverse}% [\coulomb\per\meter]% [\coulomb\per\meter]% -\newscalarquantity{linearmassdensity}% +\NewScalarQuantity{linearmassdensity}% {\kilogram\usk\meter\inverse}% [\kilogram\per\meter]% [\kilogram\per\meter]% -\newscalarquantity{lorentzfactor}% +\NewScalarQuantity{lorentzfactor}% {}% -\newscalarquantity{luminousintensity}% +\NewScalarQuantity{luminousintensity}% {\candela}% -\newscalarquantity{magneticcharge}% - {\ampere\usk\meter}% % There is another convention. Be careful! -\newvectorquantity{magneticdipolemoment}% +\NewScalarQuantity{magneticcharge}% + {\ampere\usk\meter}% +\NewVectorQuantity{magneticdipolemoment}% {\ampere\usk\meter\tothetwo}% [\ampere\usk\meter\tothetwo]% [\joule\per\tesla]% -\newvectorquantity{magneticfield}% +\NewVectorQuantity{magneticfield}% {\kilogram\usk\ampere\inverse\usk\second\totheinversetwo}% - [\newton\per\ampere\usk\meter]% % also \Wb\per\meter\tothetwo + [\newton\per\ampere\usk\meter]% [\tesla]% -\newscalarquantity{magneticflux}% +\NewScalarQuantity{magneticflux}% {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversetwo}% [\tesla\usk\meter\tothetwo]% - [\volt\usk\second]% % also \Wb and \joule\per\ampere -\newscalarquantity{mass}% + [\volt\usk\second]% +\NewScalarQuantity{mass}% {\kilogram}% -\newscalarquantity{mobility}% +\NewScalarQuantity{mobility}% {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversefour}% [\meter\tothetwo\per\volt\usk\second]% [\coulomb\usk\meter\per\newton\usk\second]% -\newscalarquantity{momentofinertia}% +\NewScalarQuantity{momentofinertia}% {\kilogram\usk\meter\tothetwo}% [\joule\usk\second\tothetwo]% [\kilogram\usk\meter\tothetwo]% -\newvectorquantity{momentum}% +\NewVectorQuantity{momentum}% {\kilogram\usk\meter\usk\second\inverse}% [\kilogram\usk\meter\per\second]% [\kilogram\usk\meter\per\second]% -\newvectorquantity{momentumflux}% +\NewVectorQuantity{momentumflux}% {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}% [\newton\per\meter\tothetwo]% [\newton\per\meter\tothetwo]% -\newscalarquantity{numberdensity}% +\NewScalarQuantity{numberdensity}% {\meter\totheinversethree}% [\per\meter\tothethree]% [\per\meter\tothethree]% -\newscalarquantity{permeability}% +\NewScalarQuantity{permeability}% {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}% [\henry\per\meter]% [\tesla\usk\meter\per\ampere]% -\newscalarquantity{permittivity}% +\NewScalarQuantity{permittivity}% {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse\usk\meter\totheinversethree}% [\farad\per\meter]% [\coulomb\tothetwo\per\newton\usk\meter\tothetwo]% -\newscalarquantity{planeangle}% +\NewScalarQuantity{planeangle}% {\meter\usk\meter\inverse}% [\radian]% [\radian]% -\newscalarquantity{polarizability}% +\NewScalarQuantity{polarizability}% {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse}% [\coulomb\usk\meter\tothetwo\per\volt]% [\coulomb\tothetwo\usk\meter\per\newton]% -\newscalarquantity{power}% +\NewScalarQuantity{power}% {\kilogram\usk\meter\tothetwo\usk\second\totheinversethree}% [\watt]% [\joule\per\second]% -\newvectorquantity{poynting}% +\NewVectorQuantity{poynting}% {\kilogram\usk\second\totheinversethree}% [\watt\per\meter\tothetwo]% [\watt\per\meter\tothetwo]% -\newscalarquantity{pressure}% +\NewScalarQuantity{pressure}% {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}% [\pascal]% [\newton\per\meter\tothetwo]% -\newscalarquantity{relativepermeability} +\NewScalarQuantity{relativepermeability} {}% -\newscalarquantity{relativepermittivity}% +\NewScalarQuantity{relativepermittivity}% {}% -\newscalarquantity{resistance}% +\NewScalarQuantity{resistance}% {\kilogram\usk\meter\tothetwo\usk\ampere\totheinversetwo\usk\second\totheinversethree}% - [\ohm]% % also \volt\per\ampere [\ohm]% -\newscalarquantity{resistivity}% + [\ohm]% +\NewScalarQuantity{resistivity}% {\kilogram\usk\meter\tothethree\usk\ampere\totheinversetwo\usk\second\totheinversethree}% [\ohm\usk\meter]% [\volt\usk\meter\per\ampere]% -\newscalarquantity{solidangle}% +\NewScalarQuantity{solidangle}% {\meter\tothetwo\usk\meter\totheinversetwo}% [\steradian]% [\steradian]% -\newscalarquantity{specificheatcapacity}% +\NewScalarQuantity{specificheatcapacity}% {\meter\tothetwo\usk\second\totheinversetwo\usk\kelvin\inverse}% [\joule\per\kelvin\usk\kilogram]% [\joule\per\kelvin\usk\kilogram] -\newscalarquantity{springstiffness}% +\NewScalarQuantity{springstiffness}% {\kilogram\usk\second\totheinversetwo}% [\newton\per\meter]% [\newton\per\meter]% -\newscalarquantity{springstretch}% % This is really just a displacement. +\NewScalarQuantity{springstretch}% {\meter}% -\newscalarquantity{stress}% +\NewScalarQuantity{stress}% {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}% [\pascal]% [\newton\per\meter\tothetwo]% -\newscalarquantity{strain}% +\NewScalarQuantity{strain}% {}% -\newscalarquantity{temperature}% +\NewScalarQuantity{temperature}% {\kelvin}% -\newvectorquantity{torque}% +\NewVectorQuantity{torque}% {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo}% [\newton\usk\meter]% [\newton\usk\meter]% -\newvectorquantity{velocity}% +\NewVectorQuantity{velocity}% {\meter\usk\second\inverse}% [\meter\per\second]% [\meter\per\second]% -\newvectorquantity{velocityc}% +\NewVectorQuantity{velocityc}% {\lightspeed}% [\lightspeed]% [\lightspeed]% -\newscalarquantity{volume}% +\NewScalarQuantity{volume}% {\meter\tothethree}% -\newscalarquantity{volumechargedensity}% +\NewScalarQuantity{volumechargedensity}% {\ampere\usk\second\per\meter\totheinversethree}% [\coulomb\per\meter\tothethree]% [\coulomb\per\meter\tothethree]% -\newscalarquantity{volumemassdensity}% +\NewScalarQuantity{volumemassdensity}% {\kilogram\usk\meter\totheinversethree}% [\kilogram\per\meter\tothethree]% [\kilogram\per\meter\tothethree]% -\newscalarquantity{wavelength}% % This is really just a displacement. +\NewScalarQuantity{wavelength}% {\meter}% -\newvectorquantity{wavenumber}% +\NewVectorQuantity{wavenumber}% {\meter\inverse}% [\per\meter]% [\per\meter]% -\newscalarquantity{work}% +\NewScalarQuantity{work}% {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo}% - [\joule]% % also \newton\usk\meter but discouraged [\joule]% -\newscalarquantity{youngsmodulus}% % This is really just a stress. + [\joule]% +\NewScalarQuantity{youngsmodulus}% {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}% [\pascal]% [\newton\per\meter\tothetwo]% @@ -602,198 +613,197 @@ }% \newcommand*{\hbar@}[2]{% \makebox[0pt][l]{\raisebox{-0.07\height}{\(\m@th#1\mkern-2mu\mathchar"AF\)}}% - % optional line to make the bar thicker; must use -0.11 \makebox[0pt][l]{\raisebox{-0.11\height}{\(\m@th#1\mkern-2mu\mathchar"AF\)}}% }% -\newphysicalconstant{avogadro}% - {\symup{N_A}}% - {6\times10^{23}}{6.02214076\times10^{23}}% % exact 2019 value +\NewPhysicalConstant{avogadro}% + {\symup{N_{A}}}% + {6\times10^{23}}{6.02214076\times10^{23}}% {\mole\inverse}% [\per\mole]% [\per\mole]% -\newphysicalconstant{biotsavartconstant}% % alias for \mzofp - {\symup{\frac{\mu_o}{4\pi}}}% +\NewPhysicalConstant{biotsavartconstant}% + {\symup{\frac{\mu_{o}}{4\pi}}}% {10^{-7}}{10^{-7}}% {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}% [\henry\per\meter]% [\tesla\usk\meter\per\ampere]% -\newphysicalconstant{bohrradius}% - {\symup{a_o}}% +\NewPhysicalConstant{bohrradius}% + {\symup{a_{o}}}% {5.3\times10^{-11}}{5.29177210903\times10^{-11}}% {\meter}% -\newphysicalconstant{boltzmann}% - {\symup{k_B}}% - {1.4\times10^{-23}}{1.380649\times10^{-23}}% % exact 2019 value +\NewPhysicalConstant{boltzmann}% + {\symup{k_{B}}}% + {1.4\times10^{-23}}{1.380649\times10^{-23}}% {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo\usk\kelvin\inverse}% [\joule\per\kelvin]% [\joule\per\kelvin]% -\newphysicalconstant{coulombconstant}% % alias for \oofpez - {\symup{\frac{1}{4\pi\epsilon_o}}}% +\NewPhysicalConstant{coulombconstant}% + {\symup{\frac{1}{4\pi\epsilon_{o}}}}% {9\times10^{9}}{8.9875517923\times10^{9}}% {\kilogram\usk\meter\tothethree\usk\ampere\totheinversetwo\usk\second\totheinversefour}% [\meter\per\farad]% [\newton\usk\meter\tothetwo\per\coulomb\tothetwo]% -\newphysicalconstant{earthmass}% +\NewPhysicalConstant{earthmass}% {\symup{M_{Earth}}}% {6.0\times10^{24}}{5.9722\times10^{24}}% {\kilogram}% -\newphysicalconstant{earthmoondistance}% +\NewPhysicalConstant{earthmoondistance}% {\symup{d_{EM}}}% {3.8\times10^{8}}{3.81550\times10^{8}}% {\meter}% -\newphysicalconstant{earthradius}% +\NewPhysicalConstant{earthradius}% {\symup{R_{Earth}}}% {6.4\times10^{6}}{6.3781\times10^{6}}% {\meter}% -\newphysicalconstant{earthsundistance}% +\NewPhysicalConstant{earthsundistance}% {\symup{d_{ES}}}% {1.5\times10^{11}}{1.496\times10^{11}}% {\meter}% -\newphysicalconstant{electroncharge}% - {\symup{q_e}}% +\NewPhysicalConstant{electroncharge}% + {\symup{q_{e}}}% {-\elementarychargeapproximatevalue}{-\elementarychargeprecisevalue}% {\ampere\usk\second}% [\coulomb]% [\coulomb]% -\newphysicalconstant{electronCharge}% - {\symup{Q_e}}% +\NewPhysicalConstant{electronCharge}% + {\symup{Q_{e}}}% {-\elementarychargeapproximatevalue}{-\elementarychargeprecisevalue}% {\ampere\usk\second}% [\coulomb]% [\coulomb]% -\newphysicalconstant{electronmass}% - {\symup{m_e}}% +\NewPhysicalConstant{electronmass}% + {\symup{m_{e}}}% {9.1\times10^{-31}}{9.1093837015\times10^{-31}}% {\kilogram}% -\newphysicalconstant{elementarycharge}% +\NewPhysicalConstant{elementarycharge}% {\symup{e}}% - {1.6\times10^{-19}}{1.602176634\times10^{-19}}% % exact 2019 value + {1.6\times10^{-19}}{1.602176634\times10^{-19}}% {\ampere\usk\second}% [\coulomb]% [\coulomb]% -\newphysicalconstant{finestructure}% +\NewPhysicalConstant{finestructure}% {\symup{\alpha}}% {\frac{1}{137}}{7.2973525693\times10^{-3}}% {}% -\newphysicalconstant{hydrogenmass}% - {\symup{m_H}}% +\NewPhysicalConstant{hydrogenmass}% + {\symup{m_{H}}}% {1.7\times10^{-27}}{1.6737236\times10^{-27}}% {\kilogram}% -\newphysicalconstant{moonearthdistance}% +\NewPhysicalConstant{moonearthdistance}% {\symup{d_{ME}}}% {3.8\times10^{8}}{3.81550\times10^{8}}% {\meter}% -\newphysicalconstant{moonmass}% +\NewPhysicalConstant{moonmass}% {\symup{M_{Moon}}}% {7.3\times10^{22}}{7.342\times10^{22}}% {\kilogram}% -\newphysicalconstant{moonradius}% +\NewPhysicalConstant{moonradius}% {\symup{R_{Moon}}}% {1.7\times10^{6}}{1.7371\times10^{6}}% {\meter}% -\newphysicalconstant{mzofp}% - {\symup{\frac{\mu_o}{4\pi}}}% +\NewPhysicalConstant{mzofp}% + {\symup{\frac{\mu_{o}}{4\pi}}}% {10^{-7}}{10^{-7}}% {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}% [\henry\per\meter]% [\tesla\usk\meter\per\ampere]% -\newphysicalconstant{neutronmass}% - {\symup{m_n}}% +\NewPhysicalConstant{neutronmass}% + {\symup{m_{n}}}% {1.7\times10^{-27}}{1.67492749804\times10^{-27}}% {\kilogram}% -\newphysicalconstant{oofpez}% - {\symup{\frac{1}{4\pi\epsilon_o}}}% +\NewPhysicalConstant{oofpez}% + {\symup{\frac{1}{4\pi\epsilon_{o}}}}% {9\times10^{9}}{8.9875517923\times10^{9}}% {\kilogram\usk\meter\tothethree\usk\ampere\totheinversetwo\usk\second\totheinversefour}% [\meter\per\farad]% [\newton\usk\meter\tothetwo\per\coulomb\tothetwo]% -\newphysicalconstant{oofpezcs}% - {\symup{\frac{1}{4\pi\epsilon_o c^2}}}% +\NewPhysicalConstant{oofpezcs}% + {\symup{\frac{1}{4\pi\epsilon_{o} c^2}}}% {10^{-7}}{10^{-7}}% {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}% [\tesla\usk\meter\tothetwo]% [\newton\usk\second\tothetwo\per\coulomb\tothetwo]% -\newphysicalconstant{planck}% +\NewPhysicalConstant{planck}% {\symup{h}}% - {6.6\times10^{-34}}{6.62607015\times10^{-34}}% % exact 2019 value + {6.6\times10^{-34}}{6.62607015\times10^{-34}}% {\kilogram\usk\meter\tothetwo\usk\second\inverse}% [\joule\usk\second]% [\joule\usk\second]% -\newphysicalconstant{planckbar}% +\NewPhysicalConstant{planckbar}% {\hbar}% {1.1\times10^{-34}}{1.054571817\times10^{-34}}% {\kilogram\usk\meter\tothetwo\usk\second\inverse}% [\joule\usk\second]% [\joule\usk\second] -\newphysicalconstant{planckc}% +\NewPhysicalConstant{planckc}% {\symup{hc}}% {2.0\times10^{-25}}{1.98644586\times10^{-25}}% {\kilogram\usk\meter\tothethree\usk\second\totheinversetwo}% [\joule\usk\meter]% [\joule\usk\meter]% -\newphysicalconstant{protoncharge}% +\NewPhysicalConstant{protoncharge}% {\symup{q_p}}% {+\elementarychargeapproximatevalue}{+\elementarychargeprecisevalue}% {\ampere\usk\second}% [\coulomb]% [\coulomb]% -\newphysicalconstant{protonCharge}% +\NewPhysicalConstant{protonCharge}% {\symup{Q_p}}% {+\elementarychargeapproximatevalue}{+\elementarychargeprecisevalue}% {\ampere\usk\second}% [\coulomb]% [\coulomb]% -\newphysicalconstant{protonmass}% +\NewPhysicalConstant{protonmass}% {\symup{m_p}}% {1.7\times10^{-27}}{1.672621898\times10^{-27}}% {\kilogram}% -\newphysicalconstant{rydberg}% +\NewPhysicalConstant{rydberg}% {\symup{R_{\infty}}}% {1.1\times10^{7}}{1.0973731568160\times10^{7}}% {\meter\inverse}% -\newphysicalconstant{speedoflight}% +\NewPhysicalConstant{speedoflight}% {\symup{c}}% - {3\times10^{8}}{2.99792458\times10^{8}}% % exact value + {3\times10^{8}}{2.99792458\times10^{8}}% {\meter\usk\second\inverse}% [\meter\per\second]% [\meter\per\second] -\newphysicalconstant{stefanboltzmann}% +\NewPhysicalConstant{stefanboltzmann}% {\symup{\sigma}}% {5.7\times10^{-8}}{5.670374\times10^{-8}}% {\kilogram\usk\second\totheinversethree\usk\kelvin\totheinversefour}% [\watt\per\meter\tothetwo\usk\kelvin\tothefour]% [\watt\per\meter\tothetwo\usk\kelvin\tothefour] -\newphysicalconstant{sunearthdistance}% +\NewPhysicalConstant{sunearthdistance}% {\symup{d_{SE}}}% {1.5\times10^{11}}{1.496\times10^{11}}% {\meter}% -\newphysicalconstant{sunmass}% +\NewPhysicalConstant{sunmass}% {\symup{M_{Sun}}}% {2.0\times10^{30}}{1.98855\times10^{30}}% {\kilogram}% -\newphysicalconstant{sunradius}% +\NewPhysicalConstant{sunradius}% {\symup{R_{Sun}}}% {7.0\times10^{8}}{6.957\times10^{8}}% {\meter}% -\newphysicalconstant{surfacegravfield}% +\NewPhysicalConstant{surfacegravfield}% {\symup{g}}% {9.8}{9.807}% {\meter\usk\second\totheinversetwo}% [\newton\per\kilogram]% [\newton\per\kilogram]% -\newphysicalconstant{universalgrav}% +\NewPhysicalConstant{universalgrav}% {\symup{G}}% {6.7\times10^{-11}}{6.67430\times10^{-11}}% {\meter\tothethree\usk\kilogram\inverse\usk\second\totheinversetwo}% - [\newton\usk\meter\tothetwo\per\kilogram\tothetwo]% % also \joule\usk\meter\per\kilogram\tothetwo [\newton\usk\meter\tothetwo\per\kilogram\tothetwo]% -\newphysicalconstant{vacuumpermeability}% + [\newton\usk\meter\tothetwo\per\kilogram\tothetwo]% +\NewPhysicalConstant{vacuumpermeability}% {\symup{\mu_o}}% - {4\pi\times10^{-7}}{4\pi\times10^{-7}}% % as of 2018 no longer 4\pi\times10^{-7} + {4\pi\times10^{-7}}{4\pi\times10^{-7}}% {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}% [\henry\per\meter]% [\tesla\usk\meter\per\ampere]% -\newphysicalconstant{vacuumpermittivity}% +\NewPhysicalConstant{vacuumpermittivity}% {\symup{\epsilon_o}}% {9\times10^{-12}}{8.854187817\times10^{-12}}% {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse\usk\meter\totheinversethree}% @@ -810,7 +820,7 @@ } \ExplSyntaxOff \newcolumntype{M}{>{\(}p{0.25\linewidth}<{\)}} -\NewDocumentCommand{\checkquantity}{ m } +\NewDocumentCommand{\CheckQuantity}{ m } {% \begin{center} \begin{tabular}{MMM} @@ -820,7 +830,7 @@ \end{tabular} \end{center} }% -\NewDocumentCommand{\checkconstant}{ m } +\NewDocumentCommand{\CheckConstant}{ m } {% \begin{center} \begin{tabular}{MMM} diff --git a/Master/texmf-dist/tex/latex/mandi/mandiexp.sty b/Master/texmf-dist/tex/latex/mandi/mandiexp.sty index 2dbc81637ee..7e9bc72e422 100644 --- a/Master/texmf-dist/tex/latex/mandi/mandiexp.sty +++ b/Master/texmf-dist/tex/latex/mandi/mandiexp.sty @@ -6,7 +6,7 @@ %% %% mandiexp.dtx (with options: `package') %% -%% Copyright (C) 2021,2022 by Paul J. Heafner <heafnerj@gmail.com> +%% Copyright (C) 2023 by Paul J. Heafner <heafnerj@gmail.com> %% --------------------------------------------------------------------------- %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3 of this license or (at @@ -32,18 +32,28 @@ %% vdemo.py (not needed) %% --------------------------------------------------------------------------- %% -\def\mandiexp@version{3.1.0} -\def\mandiexp@date{2022-01-27} +\def\mandiexp@version{3.2.0} +\def\mandiexp@date{2023-08-01} \NeedsTeXFormat{LaTeX2e}[2020-02-02] -\DeclareRelease{v3.1.0}{2022-01-27}{mandiexp.sty} +\DeclareRelease{v3.2.0}{2023-08-01}{mandiexp.sty} \DeclareCurrentRelease{v\mandiexp@version}{\mandiexp@date} \ProvidesPackage{mandiexp} [\mandiexp@date\space v\mandiexp@version\space Macros for Matter & Interactions] \newcommand*{\mandiexpversion}{v\mandiexp@version\space dated \mandiexp@date} -\RequirePackage{mandi} -\IfFormatAtLeastTF {2020-10-01} % load xparse if necessary +\IfPackageLoadedTF{mandi}% + {}% + {% + \RequirePackage{mandi}% + }% +\IfPackageLoadedTF{mandistudent}% + {}% + {% + \RequirePackage{mandistudent}% + }% +\IfFormatAtLeastTF{2020-10-01}% {}% {\RequirePackage{xparse}}% +\RequireLuaTeX \typeout{}% \typeout{mandiexp: You are using mandiexp \mandiexpversion.} \typeout{mandiexp: This package requires LuaLaTeX.}% @@ -277,9 +287,6 @@ }% \NewDocumentCommand{\translationalkineticenergy}{ s d[] }% {% - % d[] must be used because of the way consecutive optional - % arguments are handled. See xparse docs for details. - % See https://tex.stackexchange.com/a/569011/218142 \IfBooleanTF{#1}% {% E_\bgroup \symup{K}% @@ -292,9 +299,6 @@ }% \NewDocumentCommand{\rotationalkineticenergy}{ s d[] }% {% - % d[] must be used because of the way consecutive optional - % arguments are handled. See xparse docs for details. - % See https://tex.stackexchange.com/a/569011/218142 \IfBooleanTF{#1}% {% E_\bgroup% @@ -307,9 +311,6 @@ }% \NewDocumentCommand{\vibrationalkineticenergy}{ s d[] }% {% - % d[] must be used because of the way consecutive optional - % arguments are handled. See xparse docs for details. - % See https://tex.stackexchange.com/a/569011/218142 \IfBooleanTF{#1}% {% E_\bgroup% diff --git a/Master/texmf-dist/tex/latex/mandi/mandistudent.sty b/Master/texmf-dist/tex/latex/mandi/mandistudent.sty index 3bfe3b00531..ca7e0bc5538 100644 --- a/Master/texmf-dist/tex/latex/mandi/mandistudent.sty +++ b/Master/texmf-dist/tex/latex/mandi/mandistudent.sty @@ -6,7 +6,7 @@ %% %% mandistudent.dtx (with options: `package') %% -%% Copyright (C) 2021,2022 by Paul J. Heafner <heafnerj@gmail.com> +%% Copyright (C) 2023 by Paul J. Heafner <heafnerj@gmail.com> %% --------------------------------------------------------------------------- %% This work may be distributed and/or modified under the conditions of the %% LaTeX Project Public License, either version 1.3 of this license or (at @@ -32,44 +32,49 @@ %% vdemo.py (not needed) %% --------------------------------------------------------------------------- %% -\def\mandistudent@version{3.1.0} -\def\mandistudent@date{2022-01-27} +\def\mandistudent@version{3.2.0} +\def\mandistudent@date{2023-08-01} \NeedsTeXFormat{LaTeX2e}[2020-02-02] -\DeclareRelease{v3.1.0}{2022-01-27}{mandistudent.sty} +\DeclareRelease{v3.2.0}{2023-08-01}{mandistudent.sty} \DeclareCurrentRelease{v\mandistudent@version}{\mandistudent@date} \ProvidesPackage{mandistudent} [\mandistudent@date\space v\mandistudent@version\space Macros for introductory physics] \newcommand*{\mandistudentversion}{v\mandistudent@version\space dated \mandistudent@date} -\RequirePackage{amsmath} % AMS goodness (don't load amssymb or amsfonts) -\RequirePackage[inline]{enumitem} % needed for physicsproblem environment -\RequirePackage{eso-pic} % needed for \hilite -\RequirePackage[g]{esvect} % needed for nice vector arrow, style g -\RequirePackage{pgfopts} % needed for key-value interface -\RequirePackage{iftex} % needed for requiring LuaLaTeX -\RequirePackage{makebox} % needed for consistent \dirvect; \makebox -\RequirePackage{mandi} -\RequirePackage{mathtools} % needed for paired delimiters; extends amsmath -\RequirePackage{nicematrix} % needed for column and row vectors -\RequirePackage{qrcode} % needed for QR codes in webvpythonblock -\qrset{height=1.5cm} % set default size of QR code -\RequirePackage[most]{tcolorbox} % needed for program listings -\RequirePackage{tensor} % needed for index notation -\RequirePackage{tikz} % needed for \hilite -\usetikzlibrary{shapes,fit,tikzmark} % needed for \hilite -\RequirePackage{unicode-math} % needed for Unicode support -\IfFormatAtLeastTF {2020-10-01} % load xparse if necessary +\RequirePackage{amsmath} +\IfClassLoadedTF{beamer}% + {}% + {% + \RequirePackage[inline]{enumitem}% + }% +\RequirePackage{eso-pic} +\RequirePackage[g]{esvect} +\RequirePackage{pgfopts} +\RequirePackage{iftex} +\RequirePackage{makebox} +\IfPackageLoadedTF{mandi}% + {}% + {% + \RequirePackage{mandi}% + }% +\RequirePackage{nicematrix} +\RequirePackage{qrcode} +\qrset{height=1.5cm} +\RequirePackage[most]{tcolorbox} +\RequirePackage{tensor} +\RequirePackage{tikz} +\usetikzlibrary{shapes,fit,tikzmark} +\IfFormatAtLeastTF{2020-10-01} {}% {\RequirePackage{xparse}}% -\RequirePackage{hyperref} % load last -\RequireLuaTeX % require this engine +\RequirePackage{hyperref} +\RequireLuaTeX \unimathsetup{math-style=ISO} -\unimathsetup{warnings-off={mathtools-colon,mathtools-overbracket}} \setmathfont[Scale=MatchLowercase] - {Latin Modern Math} % default math font; better J + {Latin Modern Math} \setmathfont[Scale=MatchLowercase,range={sfit/{latin},bfsfit/{latin}}] - {TeX Gyre DejaVu Math} % single-storey lowercase g + {TeX Gyre DejaVu Math} \setmathfont[Scale=MatchLowercase,range={sfup/{latin},bfsfup/{latin}}] - {TeX Gyre DejaVu Math} % single-storey lowercase g + {TeX Gyre DejaVu Math} \setmathfont[Scale=MatchLowercase,range={\mathscr,\mathbfscr}]{XITS Math} \setmathfont[Scale=MatchLowercase,range={\mathcal,\mathbfcal},StylisticSet=1]{XITS Math} \setmathfont[Scale=MatchLowercase,range={"E17C-"E1F6}]{STIX Two Math} @@ -170,26 +175,25 @@ \typeout{mandistudent: This package requires LuaLaTeX.}% \typeout{mandistudent: This package changes the default math font(s).}% \typeout{mandistudent: This package redefines the \protect\vec\space command.}% +\IfClassLoadedTF{beamer}% + {% + \typeout{mandistudent: BEAMER detected. Certain commands will not be defined.}% + }% + {}% \typeout{}% \RenewDocumentCommand{\vec}{ s m e{_^} }% {% - % Note the \, used to make superscript look better. \IfBooleanTF{#1} {% - \vv{#2}% % * gives an arrow - % Use \sp{} primitive for superscript. - % Adjust superscript for the arrow. + \vv{#2}% \IfValueT{#4}% {\sp{\,#4\vphantom{\smash[t]{\big|}}}} }% {% - \symbfit{#2} % no * gives us bold - % Use \sp{} primitive for superscript. - % No superscript adjustment needed. + \symbfit{#2} \IfValueT{#4}% {\sp{#4\vphantom{\smash[t]{\big|}}}} }% - % Use \sb{} primitive for subscript. \IfValueT{#3}% {\sb{#3\vphantom{\smash[b]{|}}}} }% @@ -254,26 +258,29 @@ \mkern3mu\vphantom{\perp}\vrule depth 0pt\mkern2mu\vrule depth 0pt\mkern3mu% }% \NewDocumentCommand{\perpendicularto}{}{\perp} -\NewDocumentEnvironment{physicsproblem}{ m }% - {% - \newpage% - \section*{#1}% - \newlist{parts}{enumerate}{2}% - \setlist[parts]{label=\bfseries(\alph*)}% - }% +\IfClassLoadedTF{beamer} {}% -\NewDocumentEnvironment{physicsproblem*}{ m }% {% - \newpage% - \section*{#1}% - \newlist{parts}{enumerate*}{2}% - \setlist[parts]{label=\bfseries(\alph*)}% + \NewDocumentEnvironment{physicsproblem}{ m }% + {% + \newpage% + \section*{#1}% + \newlist{parts}{enumerate}{2}% + \setlist[parts]{label=\bfseries(\alph*)}% + }% + {}% + \NewDocumentEnvironment{physicsproblem*}{ m }% + {% + \newpage% + \section*{#1}% + \newlist{parts}{enumerate*}{2}% + \setlist[parts]{label=\bfseries(\alph*)}% + }% + {}% + \NewDocumentCommand{\problempart}{}{\item}% }% - {}% -\NewDocumentCommand{\problempart}{}{\item}% \NewDocumentEnvironment{physicssolution}{ +b }% {% - % Make equation numbering consecutive through the document. \begin{align} #1 \end{align} @@ -281,7 +288,6 @@ {}% \NewDocumentEnvironment{physicssolution*}{ +b }% {% - % Make equation numbering consecutive through the document. \begin{align*} #1 \end{align*} @@ -320,7 +326,6 @@ }% \NewDocumentCommand{\veccomp}{ s m }% {% - % Consider renaming this to \vectorsym. \IfBooleanTF{#1} {% \symnormal{#2}% @@ -331,7 +336,6 @@ }% \NewDocumentCommand{\tencomp}{ s m }% {% - % Consider renaming this to \tensororsym. \IfBooleanTF{#1}% {% \symsfit{#2}% @@ -363,24 +367,22 @@ }% \NewDocumentCommand{\slot}{ s d[] }% {% - % d[] must be used because of the way consecutive optional - % arguments are handled. See xparse docs for details. \IfBooleanTF{#1} {% \IfValueTF{#2} - {% Insert a vector, but don't show the slot. + {% \smash{\makebox[1.5em]{\ensuremath{#2}}} }% - {% No vector, no slot. + {% \smash{\makebox[1.5em]{\ensuremath{}}} }% }% {% \IfValueTF{#2} - {% Insert a vector and show the slot. + {% \underline{\smash{\makebox[1.5em]{\ensuremath{#2}}}} }% - {% No vector; just show the slot. + {% \underline{\smash{\makebox[1.5em]{\ensuremath{}}}} }% }% @@ -401,35 +403,35 @@ {["8000FF"] = {"one","two","three","four","five","six","seven","eight","nine","zero"}}) }% \newfontfamily\colordigits{DejaVuSansMono}[RawFeature={color=colordigits}] -\newfontfamily{\gsfontfamily}{DejaVuSansMono} % new font for listings -\definecolor{gsbggray} {rgb}{0.90,0.90,0.90} % background gray -\definecolor{gsgray} {rgb}{0.30,0.30,0.30} % gray -\definecolor{gsgreen} {rgb}{0.00,0.60,0.00} % green -\definecolor{gsorange} {rgb}{0.80,0.45,0.12} % orange -\definecolor{gspeach} {rgb}{1.00,0.90,0.71} % peach -\definecolor{gspearl} {rgb}{0.94,0.92,0.84} % pearl -\definecolor{gsplum} {rgb}{0.74,0.46,0.70} % plum +\newfontfamily{\gsfontfamily}{DejaVuSansMono} +\definecolor{gsbggray} {rgb}{0.90,0.90,0.90} +\definecolor{gsgray} {rgb}{0.30,0.30,0.30} +\definecolor{gsgreen} {rgb}{0.00,0.60,0.00} +\definecolor{gsorange} {rgb}{0.80,0.45,0.12} +\definecolor{gspeach} {rgb}{1.00,0.90,0.71} +\definecolor{gspearl} {rgb}{0.94,0.92,0.84} +\definecolor{gsplum} {rgb}{0.74,0.46,0.70} \lstdefinestyle{vpython}% - {% % style for listings - backgroundcolor=\color{gsbggray},% % background color - basicstyle=\colordigits\footnotesize,% % default style - breakatwhitespace=true% % break at whitespace - breaklines=true,% % break long lines - captionpos=b,% % position caption - classoffset=1,% % STILL DON'T UNDERSTAND THIS - commentstyle=\color{gsgray},% % font for comments - deletekeywords={print},% % delete keywords from the given language - emph={self,cls,@classmethod,@property},% % words to emphasize - emphstyle=\color{gsorange}\itshape,% % font for emphasis + {% + backgroundcolor=\color{gsbggray},% % background color + basicstyle=\colordigits\footnotesize,% % default style + breakatwhitespace=true% % break at whitespace + breaklines=true,% % break long lines + captionpos=b,% % position caption + classoffset=1,% % STILL DON'T UNDERSTAND THIS + commentstyle=\color{gsgray},% % font for comments + deletekeywords={print},% % delete keywords from the given language + emph={self,cls,@classmethod,@property},% % words to emphasize + emphstyle=\color{gsorange}\itshape,% % font for emphasis escapeinside={(*@}{@*)},% % add LaTeX within your code - frame=tb,% % frame style - framerule=2.0pt,% % frame thickness - framexleftmargin=5pt,% % extra frame left margin - %identifierstyle=\sffamily,% % style for identifiers - keywordstyle=\gsfontfamily\color{gsplum},% % color for keywords - language=Python,% % select language - linewidth=\linewidth,% % width of listings - morekeywords={% % VPython/Web VPython specific keywords + frame=tb,% % frame style + framerule=2.0pt,% % frame thickness + framexleftmargin=5pt,% % extra frame left margin + %identifierstyle=\sffamily,% % style for identifiers + keywordstyle=\gsfontfamily\color{gsplum},% % color for keywords + language=Python,% % select language + linewidth=\linewidth,% % width of listings + morekeywords={% % VPython/Web VPython specific keywords __future__,abs,acos,align,ambient,angle,append,append_to_caption,% append_to_title,arange,arrow,asin,astuple,atan,atan2,attach_arrow,% attach_trail,autoscale,axis,background,billboard,bind,black,blue,border,% @@ -453,18 +455,18 @@ texture,textures,thickness,title,trail_color,trail_object,trail_radius,% trail_type,triangle,trigger,True,twist,unbind,up,upper_left,upper_right,% userpan,userspin,userzoom,vec,vector,vertex,vertical_spacing,visible,% - visual,vpython,VPython,waitfor,WebVPython,white,width,world,xtitle,% + visual,vpython,VPython,waitfor,Web,VPython,white,width,world,xtitle,% yellow,yoffset,ytitle% },% - morekeywords={print,None,TypeError},% % additional keywords - morestring=[b]{"""},% % treat triple quotes as strings - numbers=left,% % where to put line numbers - numbersep=10pt,% % how far line numbers are from code - numberstyle=\bfseries\tiny,% % set to 'none' for no line numbers - showstringspaces=false,% % show spaces in strings - showtabs=false,% % show tabs within strings - stringstyle=\gsfontfamily\color{gsgreen},% % color for strings - upquote=true,% % how to typeset quotes + morekeywords={print,None,TypeError},% % additional keywords + morestring=[b]{"""},% % treat triple quotes as strings + numbers=left,% % where to put line numbers + numbersep=10pt,% % how far line numbers are from code + numberstyle=\bfseries\tiny,% % set to 'none' for no line numbers + showstringspaces=false,% % show spaces in strings + showtabs=false,% % show tabs within strings + stringstyle=\gsfontfamily\color{gsgreen},% % color for strings + upquote=true,% % how to typeset quotes }% \AtBeginEnvironment{webvpythonblock}{\catcode`\#=12} \AtEndEnvironment{webvpythonblock}{\catcode`\#=6} @@ -485,8 +487,9 @@ title = \begin{minipage}{1.5cm}% \protect\qrcode*{https://#2}% \end{minipage}\hspace{5mm}% - \begin{minipage}{0.7\textwidth}% - \texttt{Web VPython} Program \thetcbcounter: #3% + \begin{minipage}{0.8\textwidth}% + \texttt{Web VPython} Program \thetcbcounter: #3\\ + \footnotesize{\href{https://#2}{\color{white}{https://#2}}}% \end{minipage},% width = 0.9\textwidth,% {#1}, @@ -508,7 +511,8 @@ listing only,% listing style = vpython,% nameref = {#3},% - title = \texttt{Web VPython} Program \thetcbcounter: #3,% + title = \texttt{Web VPython} Program \thetcbcounter: #3\\% + \footnotesize{\href{https://#2}{\color{white}{https://#2}}},% width = 0.9\textwidth,% {#1}, }% |