%%
%% This is file `mandi.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mandi.dtx  (with options: `package')
%% 
%%  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
%%  your option) any later version. The  latest  version  of this license is in
%%             http://www.latex-project.org/lppl.txt
%%  and  version 1.3 or  later is  part of  all distributions of  LaTeX version
%%  2005/12/01 or later.
%% 
%%  This work has the LPPL maintenance status `maintained'.
%% 
%%  The Current Maintainer of this work is Paul J. Heafner.
%% 
%%  This work consists of the files mandi.dtx
%%                                  mandistudent.dtx
%%                                  mandiexp.dtx
%%                                  mandi.ins
%%                                  mandi.pdf
%%                                  README.md
%% 
%%  and includes the derived files  mandi.sty
%%                                  mandistudent.sty
%%                                  mandiexp.sty
%%                                  vdemo.py (not needed)
%%  ---------------------------------------------------------------------------
%% 
\def\mandi@version{3.2.0}
\def\mandi@date{2023-08-01}
\NeedsTeXFormat{LaTeX2e}[2020-02-02]
\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}
\RequirePackage{array}
\RequirePackage{iftex}
\RequirePackage{mathtools}
\RequirePackage{unicode-math}
\unimathsetup{warnings-off={mathtools-colon,mathtools-overbracket}}
\IfFormatAtLeastTF{2020-10-01}
  {}%
  {\RequirePackage{xparse}}%
\RequireLuaTeX
\newcommand*{\mandi@selectunits}{}
\newcommand*{\mandi@selectprecision}{}
\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}{}
  {\renewcommand*{\mandi@selectunits}{\mandi@selectderivedunits}}%
\NewDocumentCommand{\alwaysusealternateunits}{}
  {\renewcommand*{\mandi@selectunits}{\mandi@selectalternateunits}}%
\NewDocumentCommand{\alwaysuseapproximateconstants}{}
  {\renewcommand*{\mandi@selectprecision}{\mandi@selectapproximate}}%
\NewDocumentCommand{\alwaysusepreciseconstants}{}
  {\renewcommand*{\mandi@selectprecision}{\mandi@selectprecise}}%
\NewDocumentCommand{\hereusebaseunits}{ m }{\begingroup\alwaysusebaseunits#1\endgroup}%
\NewDocumentCommand{\hereusederivedunits}{ m }{\begingroup\alwaysusederivedunits#1\endgroup}%
\NewDocumentCommand{\hereusealternateunits}{ m }{\begingroup\alwaysusealternateunits#1\endgroup}%
\NewDocumentCommand{\hereuseapproximateconstants}{ m }{\begingroup\alwaysuseapproximateconstants#1\endgroup}%
\NewDocumentCommand{\hereusepreciseconstants}{ m }{\begingroup\alwaysusepreciseconstants#1\endgroup}%
\NewDocumentEnvironment{usebaseunits}{}{\alwaysusebaseunits}{}%
\NewDocumentEnvironment{usederivedunits}{}{\alwaysusederivedunits}{}%
\NewDocumentEnvironment{usealternateunits}{}{\alwaysusealternateunits}{}%
\NewDocumentEnvironment{useapproximateconstants}{}{\alwaysuseapproximateconstants}{}%
\NewDocumentEnvironment{usepreciseconstants}{}{\alwaysusepreciseconstants}{}%
\newif\ifusingpreciseconstants
\pgfkeys{%
  /mandi/options/.cd,
  initial@setup/.style={%
    /mandi/options/buffered@units/.initial=alternate,%
  },%
  initial@setup,%
  preciseconstants/.is if=usingpreciseconstants,%
  units/.is choice,%
  units/.default=derived,%
  units/alternate/.style={/mandi/options/buffered@units=alternate},%
  units/base/.style={/mandi/options/buffered@units=base},%
  units/derived/.style={/mandi/options/buffered@units=derived},%
  .unknown/.code={%
    \typeout{}%
    \typeout{mandi: You used unknown option '\pgfkeyscurrentname'.}%
  },%
}%
\ProcessPgfPackageOptions{/mandi/options}
\typeout{}%
\typeout{mandi: You are using mandi \mandiversion.}%
\typeout{mandi: This package requires LuaLaTeX.}%
\typeout{mandi: Loadtime options...}
\newcommand*{\mandi@do@setup}{%
  \csname alwaysuse\pgfkeysvalueof{/mandi/options/buffered@units}units\endcsname%
  \typeout{mandi: You will get \pgfkeysvalueof{/mandi/options/buffered@units}\space units.}%
  \ifusingpreciseconstants
    \alwaysusepreciseconstants
    \typeout{mandi: You will get precise constants.}%
  \else
    \alwaysuseapproximateconstants
    \typeout{mandi: You will get approximate constants.}%
  \fi
  \typeout{}%
}%
\mandi@do@setup
\NewDocumentCommand{\mandisetup}{ m }%
  {%
    \IfValueT{#1}%
      {%
        \pgfqkeys{/mandi/options}{#1}
        \typeout{}%
        \typeout{mandi: mandisetup options...}
        \mandi@do@setup
      }%
  }%
\NewDocumentCommand{\per}{}{/}
\NewDocumentCommand{\usk}{}{\cdot}
\NewDocumentCommand{\units}{ m m }%
{%
  \IfValueTF{#2}
  {%
    {#1}{\,#2}
  }%
  {%
    {#1}{}
  }%
}%
\NewDocumentCommand{\ampere}{}{\symup{A}}
\NewDocumentCommand{\atomicmassunit}{}{\symup{u}}
\NewDocumentCommand{\candela}{}{\symup{cd}}
\NewDocumentCommand{\coulomb}{}{\symup{C}}
\NewDocumentCommand{\degree}{}{^{\circ}}
\NewDocumentCommand{\electronvolt}{}{\symup{eV}}
\NewDocumentCommand{\ev}{}{\electronvolt}
\NewDocumentCommand{\farad}{}{\symup{F}}
\NewDocumentCommand{\henry}{}{\symup{H}}
\NewDocumentCommand{\hertz}{}{\symup{Hz}}
\NewDocumentCommand{\joule}{}{\symup{J}}
\NewDocumentCommand{\kelvin}{}{\symup{K}}
\NewDocumentCommand{\kev}{}{\kiloelectronvolt}
\NewDocumentCommand{\kiloelectronvolt}{}{\symup{keV}}
\NewDocumentCommand{\kilogram}{}{\symup{kg}}
\NewDocumentCommand{\lightspeed}{}{\!\symup{c}}
\NewDocumentCommand{\megaelectronvolt}{}{\symup{MeV}}
\NewDocumentCommand{\meter}{}{\symup{m}}
\NewDocumentCommand{\metre}{}{\meter}
\NewDocumentCommand{\mev}{}{\megaelectronvolt}
\NewDocumentCommand{\mole}{}{\symup{mol}}
\NewDocumentCommand{\newton}{}{\symup{N}}
\NewDocumentCommand{\ohm}{}{\symup\Omega}
\NewDocumentCommand{\pascal}{}{\symup{Pa}}
\NewDocumentCommand{\radian}{}{\symup{rad}}
\NewDocumentCommand{\second}{}{\symup{s}}
\NewDocumentCommand{\siemens}{}{\symup{S}}
\NewDocumentCommand{\steradian}{}{\symup{sr}}
\NewDocumentCommand{\tesla}{}{\symup{T}}
\NewDocumentCommand{\volt}{}{\symup{V}}
\NewDocumentCommand{\watt}{}{\symup{W}}
\NewDocumentCommand{\weber}{}{\symup{Wb}}
\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}}
\NewDocumentCommand{\xtento}{ m }{\times\tento{#1}}
\ExplSyntaxOn
\cs_new:Npn \__mandi_newscalarquantity:nnnn #1#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 {\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} }
  {
    \__mandi_newscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
  }
\ExplSyntaxOff
\ExplSyntaxOn
\cs_new:Npn \__mandi_renewscalarquantity:nnnn #1#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 {\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} }
  {
    \__mandi_renewscalarquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
  }
\ExplSyntaxOff
\ExplSyntaxOn
\cs_new:Npn \__mandi_newvectorquantity:nnnn #1#2#3#4
  {
    \__mandi_newscalarquantity:nnnn { #1 }{ #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 {\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}}
    \cs_new:cpn {#1vectoronlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}}
    \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} }
  {
    \__mandi_newvectorquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
  }
\ExplSyntaxOff
\ExplSyntaxOn
\cs_new:Npn \__mandi_renewvectorquantity:nnnn #1#2#3#4
  {
    \__mandi_renewscalarquantity:nnnn { #1 }{ #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 {\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}}
    \cs_set:cpn {#1vectoronlyderivedunits} {\mandi@selectderivedunits{#2}{#3}{#4}}
    \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} }
  {
    \__mandi_renewvectorquantity:nnnn { #1 }{ #2 }{ #3 }{ #4 }
  }
\ExplSyntaxOff
\ExplSyntaxOn
\cs_new:Npn \__mandi_newphysicalconstant:nnnnnnn #1#2#3#4#5#6#7
  {
    \cs_new:cpn {#1} {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}}
    \cs_new:cpn {#1mathsymbol} {#2}
    \cs_new:cpn {#1approximatevalue} {#3}
    \cs_new:cpn {#1precisevalue} {#4}
    \cs_new:cpn {#1baseunits}
      {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectbaseunits{#5}{#6}{#7}}}
    \cs_new:cpn {#1derivedunits}
      {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectderivedunits{#5}{#6}{#7}}}
    \cs_new:cpn {#1alternateunits}
      {\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} }
  {
    \__mandi_newphysicalconstant:nnnnnnn { #1 }{ #2 }{ #3 }{ #4 }{ #5 }{ #6 }{ #7 }
  }
\ExplSyntaxOff
\ExplSyntaxOn
\cs_new:Npn \__mandi_renewphysicalconstant:nnnnnnn #1#2#3#4#5#6#7
  {
    \cs_set:cpn {#1} {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectunits{#5}{#6}{#7}}}
    \cs_set:cpn {#1mathsymbol} {#2}
    \cs_set:cpn {#1approximatevalue} {#3}
    \cs_set:cpn {#1precisevalue} {#4}
    \cs_set:cpn {#1baseunits}
      {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectbaseunits{#5}{#6}{#7}}}
    \cs_set:cpn {#1derivedunits}
      {\units{\mandi@selectprecision{#3}{#4}}{\mandi@selectderivedunits{#5}{#6}{#7}}}
    \cs_set:cpn {#1alternateunits}
      {\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} }
  {
    \__mandi_renewphysicalconstant:nnnnnnn { #1 }{ #2 }{ #3 }{ #4 }{ #5 }{ #6 }{ #7 }
  }
\ExplSyntaxOff
\NewVectorQuantity{acceleration}%
  {\meter\usk\second\totheinversetwo}%
  [\newton\per\kilogram]%
  [\meter\per\second\tothetwo]%
\NewScalarQuantity{amount}%
  {\mole}%
\NewVectorQuantity{angularacceleration}%
  {\radian\usk\second\totheinversetwo}%
  [\radian\per\second\tothetwo]%
  [\radian\per\second\tothetwo]%
\NewScalarQuantity{angularfrequency}%
  {\radian\usk\second\inverse}%
  [\radian\per\second]%
  [\radian\per\second]%
\NewVectorQuantity{angularimpulse}%
  {\kilogram\usk\meter\tothetwo\usk\second\inverse}%
  [\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]%
  [\kilogram\usk\meter\tothetwo\per\second]%
\NewVectorQuantity{angularvelocity}%
  {\radian\usk\second\inverse}%
  [\radian\per\second]%
  [\radian\per\second]%
\NewScalarQuantity{area}%
  {\meter\tothetwo}%
\NewScalarQuantity{areachargedensity}%
  {\ampere\usk\second\usk\meter\totheinversetwo}%
  [\coulomb\per\meter\tothetwo]%
  [\coulomb\per\meter\tothetwo]%
\NewScalarQuantity{areamassdensity}%
  {\kilogram\usk\meter\totheinversetwo}%
  [\kilogram\per\meter\tothetwo]%
  [\kilogram\per\meter\tothetwo]%
\NewScalarQuantity{capacitance}%
  {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse\usk\meter\totheinversetwo}%
  [\farad]%
  [\coulomb\per\volt]%
\NewScalarQuantity{charge}%
  {\ampere\usk\second}%
  [\coulomb]%
  [\coulomb]%
\NewVectorQuantity{cmagneticfield}%
  {\kilogram\usk\meter\usk\ampere\inverse\usk\second\totheinversethree}%
  [\newton\per\coulomb]%
  [\newton\per\coulomb]%
\NewScalarQuantity{conductance}%
  {\ampere\tothetwo\usk\second\tothethree\usk\kilogram\inverse\usk\meter\totheinversetwo}%
  [\siemens]%
  [\ampere\per\volt]%
\NewScalarQuantity{conductivity}%
  {\ampere\tothetwo\usk\second\tothethree\usk\kilogram\inverse\usk\meter\totheinversethree}%
  [\siemens\per\meter]%
  [\ampere\per\volt\usk\meter]%
\NewScalarQuantity{conventionalcurrent}%
  {\ampere}%
  [\coulomb\per\second]%
  [\ampere]%
\NewScalarQuantity{current}%
  {\ampere}%
\NewScalarQuantity{currentdensity}%
  {\ampere\usk\meter\totheinversetwo}%
  [\coulomb\per\second\usk\meter\tothetwo]%
  [\ampere\per\meter\tothetwo]%
\NewScalarQuantity{dielectricconstant}%
  {}%
\NewVectorQuantity{direction}%
  {}%
\NewVectorQuantity{displacement}%
  {\meter}
\NewScalarQuantity{duration}%
  {\second}%
\NewVectorQuantity{electricdipolemoment}%
  {\ampere\usk\second\usk\meter}%
  [\coulomb\usk\meter]%
  [\coulomb\usk\meter]%
\NewVectorQuantity{electricfield}%
  {\kilogram\usk\meter\usk\ampere\inverse\usk\second\totheinversethree}%
  [\volt\per\meter]%
  [\newton\per\coulomb]%
\NewScalarQuantity{electricflux}%
  {\kilogram\usk\meter\tothethree\usk\ampere\inverse\usk\second\totheinversethree}%
  [\volt\usk\meter]%
  [\newton\usk\meter\tothetwo\per\coulomb]%
\NewScalarQuantity{electricpotential}%
  {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversethree}%
  [\volt]%
  [\volt]%
\NewScalarQuantity{electricpotentialdifference}%
  {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversethree}%
  [\volt]%
  [\volt]%
\NewScalarQuantity{electroncurrent}%
  {\second\inverse}%
  [\ensuremath{\symup{e}}\per\second]%
  [\ensuremath{\symup{e}}\per\second]%
\NewScalarQuantity{emf}%
  {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversethree}%
  [\volt]%
  [\volt]%
\NewScalarQuantity{energy}%
  {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo}%
  [\joule]%
  [\joule]%
\NewScalarQuantity{energyinev}%
  {\electronvolt}%
\NewScalarQuantity{energyinkev}%
  {\kiloelectronvolt}%
\NewScalarQuantity{energyinmev}%
  {\megaelectronvolt}%
\NewScalarQuantity{energydensity}%
  {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}%
  [\joule\per\meter\tothethree]%
  [\joule\per\meter\tothethree]%
\NewScalarQuantity{energyflux}%
  {\kilogram\usk\second\totheinversethree}%
  [\watt\per\meter\tothetwo]%
  [\watt\per\meter\tothetwo]%
\NewScalarQuantity{entropy}%
  {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo\usk\kelvin\inverse}%
  [\joule\per\kelvin]%
  [\joule\per\kelvin]%
\NewVectorQuantity{force}%
  {\kilogram\usk\meter\usk\second\totheinversetwo}%
  [\newton]%
  [\newton]%
\NewScalarQuantity{frequency}%
  {\second\inverse}%
  [\hertz]%
  [\hertz]%
\NewVectorQuantity{gravitationalfield}%
  {\meter\usk\second\totheinversetwo}%
  [\newton\per\kilogram]%
  [\newton\per\kilogram]%
\NewScalarQuantity{gravitationalpotential}%
  {\meter\tothetwo\usk\second\totheinversetwo}%
  [\joule\per\kilogram]%
  [\joule\per\kilogram]%
\NewScalarQuantity{gravitationalpotentialdifference}%
  {\meter\tothetwo\usk\second\totheinversetwo}%
  [\joule\per\kilogram]%
  [\joule\per\kilogram]%
\NewVectorQuantity{impulse}%
  {\kilogram\usk\meter\usk\second\inverse}%
  [\newton\usk\second]%
  [\newton\usk\second]%
\NewScalarQuantity{indexofrefraction}%
  {}%
\NewScalarQuantity{inductance}%
  {\kilogram\usk\meter\tothetwo\usk\ampere\totheinversetwo\usk\second\totheinversetwo}%
  [\henry]%
  [\volt\usk\second\per\ampere]%
\NewScalarQuantity{linearchargedensity}%
  {\ampere\usk\second\usk\meter\inverse}%
  [\coulomb\per\meter]%
  [\coulomb\per\meter]%
\NewScalarQuantity{linearmassdensity}%
  {\kilogram\usk\meter\inverse}%
  [\kilogram\per\meter]%
  [\kilogram\per\meter]%
\NewScalarQuantity{lorentzfactor}%
  {}%
\NewScalarQuantity{luminousintensity}%
  {\candela}%
\NewScalarQuantity{magneticcharge}%
  {\ampere\usk\meter}%
\NewVectorQuantity{magneticdipolemoment}%
  {\ampere\usk\meter\tothetwo}%
  [\ampere\usk\meter\tothetwo]%
  [\joule\per\tesla]%
\NewVectorQuantity{magneticfield}%
  {\kilogram\usk\ampere\inverse\usk\second\totheinversetwo}%
  [\newton\per\ampere\usk\meter]%
  [\tesla]%
\NewScalarQuantity{magneticflux}%
  {\kilogram\usk\meter\tothetwo\usk\ampere\inverse\usk\second\totheinversetwo}%
  [\tesla\usk\meter\tothetwo]%
  [\volt\usk\second]%
\NewScalarQuantity{mass}%
  {\kilogram}%
\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}%
  {\kilogram\usk\meter\tothetwo}%
  [\joule\usk\second\tothetwo]%
  [\kilogram\usk\meter\tothetwo]%
\NewVectorQuantity{momentum}%
  {\kilogram\usk\meter\usk\second\inverse}%
  [\kilogram\usk\meter\per\second]%
  [\kilogram\usk\meter\per\second]%
\NewVectorQuantity{momentumflux}%
  {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}%
  [\newton\per\meter\tothetwo]%
  [\newton\per\meter\tothetwo]%
\NewScalarQuantity{numberdensity}%
  {\meter\totheinversethree}%
  [\per\meter\tothethree]%
  [\per\meter\tothethree]%
\NewScalarQuantity{permeability}%
  {\kilogram\usk\meter\usk\ampere\totheinversetwo\usk\second\totheinversetwo}%
  [\henry\per\meter]%
  [\tesla\usk\meter\per\ampere]%
\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}%
  {\meter\usk\meter\inverse}%
  [\radian]%
  [\radian]%
\NewScalarQuantity{polarizability}%
  {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse}%
  [\coulomb\usk\meter\tothetwo\per\volt]%
  [\coulomb\tothetwo\usk\meter\per\newton]%
\NewScalarQuantity{power}%
  {\kilogram\usk\meter\tothetwo\usk\second\totheinversethree}%
  [\watt]%
  [\joule\per\second]%
\NewVectorQuantity{poynting}%
  {\kilogram\usk\second\totheinversethree}%
  [\watt\per\meter\tothetwo]%
  [\watt\per\meter\tothetwo]%
\NewScalarQuantity{pressure}%
  {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}%
  [\pascal]%
  [\newton\per\meter\tothetwo]%
\NewScalarQuantity{relativepermeability}
  {}%
\NewScalarQuantity{relativepermittivity}%
  {}%
\NewScalarQuantity{resistance}%
  {\kilogram\usk\meter\tothetwo\usk\ampere\totheinversetwo\usk\second\totheinversethree}%
  [\ohm]%
  [\ohm]%
\NewScalarQuantity{resistivity}%
  {\kilogram\usk\meter\tothethree\usk\ampere\totheinversetwo\usk\second\totheinversethree}%
  [\ohm\usk\meter]%
  [\volt\usk\meter\per\ampere]%
\NewScalarQuantity{solidangle}%
  {\meter\tothetwo\usk\meter\totheinversetwo}%
  [\steradian]%
  [\steradian]%
\NewScalarQuantity{specificheatcapacity}%
  {\meter\tothetwo\usk\second\totheinversetwo\usk\kelvin\inverse}%
  [\joule\per\kelvin\usk\kilogram]%
  [\joule\per\kelvin\usk\kilogram]
\NewScalarQuantity{springstiffness}%
  {\kilogram\usk\second\totheinversetwo}%
  [\newton\per\meter]%
  [\newton\per\meter]%
\NewScalarQuantity{springstretch}%
  {\meter}%
\NewScalarQuantity{stress}%
  {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}%
  [\pascal]%
  [\newton\per\meter\tothetwo]%
\NewScalarQuantity{strain}%
  {}%
\NewScalarQuantity{temperature}%
  {\kelvin}%
\NewVectorQuantity{torque}%
  {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo}%
  [\newton\usk\meter]%
  [\newton\usk\meter]%
\NewVectorQuantity{velocity}%
  {\meter\usk\second\inverse}%
  [\meter\per\second]%
  [\meter\per\second]%
\NewVectorQuantity{velocityc}%
  {\lightspeed}%
  [\lightspeed]%
  [\lightspeed]%
\NewScalarQuantity{volume}%
  {\meter\tothethree}%
\NewScalarQuantity{volumechargedensity}%
  {\ampere\usk\second\per\meter\totheinversethree}%
  [\coulomb\per\meter\tothethree]%
  [\coulomb\per\meter\tothethree]%
\NewScalarQuantity{volumemassdensity}%
  {\kilogram\usk\meter\totheinversethree}%
  [\kilogram\per\meter\tothethree]%
  [\kilogram\per\meter\tothethree]%
\NewScalarQuantity{wavelength}%
  {\meter}%
\NewVectorQuantity{wavenumber}%
  {\meter\inverse}%
  [\per\meter]%
  [\per\meter]%
\NewScalarQuantity{work}%
  {\kilogram\usk\meter\tothetwo\usk\second\totheinversetwo}%
  [\joule]%
  [\joule]%
\NewScalarQuantity{youngsmodulus}%
  {\kilogram\usk\meter\inverse\usk\second\totheinversetwo}%
  [\pascal]%
  [\newton\per\meter\tothetwo]%
\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\)}}%
  \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}}%
  {\mole\inverse}%
  [\per\mole]%
  [\per\mole]%
\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}}}%
  {5.3\times10^{-11}}{5.29177210903\times10^{-11}}%
  {\meter}%
\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}%
  {\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}%
  {\symup{M_{Earth}}}%
  {6.0\times10^{24}}{5.9722\times10^{24}}%
  {\kilogram}%
\NewPhysicalConstant{earthmoondistance}%
  {\symup{d_{EM}}}%
  {3.8\times10^{8}}{3.81550\times10^{8}}%
  {\meter}%
\NewPhysicalConstant{earthradius}%
  {\symup{R_{Earth}}}%
  {6.4\times10^{6}}{6.3781\times10^{6}}%
  {\meter}%
\NewPhysicalConstant{earthsundistance}%
  {\symup{d_{ES}}}%
  {1.5\times10^{11}}{1.496\times10^{11}}%
  {\meter}%
\NewPhysicalConstant{electroncharge}%
  {\symup{q_{e}}}%
  {-\elementarychargeapproximatevalue}{-\elementarychargeprecisevalue}%
  {\ampere\usk\second}%
  [\coulomb]%
  [\coulomb]%
\NewPhysicalConstant{electronCharge}%
  {\symup{Q_{e}}}%
  {-\elementarychargeapproximatevalue}{-\elementarychargeprecisevalue}%
  {\ampere\usk\second}%
  [\coulomb]%
  [\coulomb]%
\NewPhysicalConstant{electronmass}%
  {\symup{m_{e}}}%
  {9.1\times10^{-31}}{9.1093837015\times10^{-31}}%
  {\kilogram}%
\NewPhysicalConstant{elementarycharge}%
  {\symup{e}}%
  {1.6\times10^{-19}}{1.602176634\times10^{-19}}%
  {\ampere\usk\second}%
  [\coulomb]%
  [\coulomb]%
\NewPhysicalConstant{finestructure}%
  {\symup{\alpha}}%
  {\frac{1}{137}}{7.2973525693\times10^{-3}}%
  {}%
\NewPhysicalConstant{hydrogenmass}%
  {\symup{m_{H}}}%
  {1.7\times10^{-27}}{1.6737236\times10^{-27}}%
  {\kilogram}%
\NewPhysicalConstant{moonearthdistance}%
  {\symup{d_{ME}}}%
  {3.8\times10^{8}}{3.81550\times10^{8}}%
  {\meter}%
\NewPhysicalConstant{moonmass}%
  {\symup{M_{Moon}}}%
  {7.3\times10^{22}}{7.342\times10^{22}}%
  {\kilogram}%
\NewPhysicalConstant{moonradius}%
  {\symup{R_{Moon}}}%
  {1.7\times10^{6}}{1.7371\times10^{6}}%
  {\meter}%
\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}}}%
  {1.7\times10^{-27}}{1.67492749804\times10^{-27}}%
  {\kilogram}%
\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}}}%
  {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}%
  {\symup{h}}%
  {6.6\times10^{-34}}{6.62607015\times10^{-34}}%
  {\kilogram\usk\meter\tothetwo\usk\second\inverse}%
  [\joule\usk\second]%
  [\joule\usk\second]%
\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}%
  {\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}%
  {\symup{q_p}}%
  {+\elementarychargeapproximatevalue}{+\elementarychargeprecisevalue}%
  {\ampere\usk\second}%
  [\coulomb]%
  [\coulomb]%
\NewPhysicalConstant{protonCharge}%
  {\symup{Q_p}}%
  {+\elementarychargeapproximatevalue}{+\elementarychargeprecisevalue}%
  {\ampere\usk\second}%
  [\coulomb]%
  [\coulomb]%
\NewPhysicalConstant{protonmass}%
  {\symup{m_p}}%
  {1.7\times10^{-27}}{1.672621898\times10^{-27}}%
  {\kilogram}%
\NewPhysicalConstant{rydberg}%
  {\symup{R_{\infty}}}%
  {1.1\times10^{7}}{1.0973731568160\times10^{7}}%
  {\meter\inverse}%
\NewPhysicalConstant{speedoflight}%
  {\symup{c}}%
  {3\times10^{8}}{2.99792458\times10^{8}}%
  {\meter\usk\second\inverse}%
  [\meter\per\second]%
  [\meter\per\second]
\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}%
  {\symup{d_{SE}}}%
  {1.5\times10^{11}}{1.496\times10^{11}}%
  {\meter}%
\NewPhysicalConstant{sunmass}%
  {\symup{M_{Sun}}}%
  {2.0\times10^{30}}{1.98855\times10^{30}}%
  {\kilogram}%
\NewPhysicalConstant{sunradius}%
  {\symup{R_{Sun}}}%
  {7.0\times10^{8}}{6.957\times10^{8}}%
  {\meter}%
\NewPhysicalConstant{surfacegravfield}%
  {\symup{g}}%
  {9.8}{9.807}%
  {\meter\usk\second\totheinversetwo}%
  [\newton\per\kilogram]%
  [\newton\per\kilogram]%
\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]%
  [\newton\usk\meter\tothetwo\per\kilogram\tothetwo]%
\NewPhysicalConstant{vacuumpermeability}%
  {\symup{\mu_o}}%
  {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}%
  {\symup{\epsilon_o}}%
  {9\times10^{-12}}{8.854187817\times10^{-12}}%
  {\ampere\tothetwo\usk\second\tothefour\usk\kilogram\inverse\usk\meter\totheinversethree}%
  [\farad\per\meter]%
  [\coulomb\tothetwo\per\newton\usk\meter\tothetwo]%
\ExplSyntaxOn
\NewDocumentCommand{\@aux}{ m }
  {
    \use:c { #1 }
  }
\NewDocumentCommand{\@auy}{ m }
  {
    \normalfont\ttfamily\token_to_str:c { #1 }
  }
\ExplSyntaxOff
\newcolumntype{M}{>{\(}p{0.25\linewidth}<{\)}}
\NewDocumentCommand{\CheckQuantity}{ m }
  {%
    \begin{center}
      \begin{tabular}{MMM}
        \textbf{command}       & \multicolumn{2}{l}{\@auy{#1}}                             \tabularnewline
        \text{\textbf{base}}   & \text{\textbf{derived}}     & \text{\textbf{alternate}}   \tabularnewline
        \@aux{#1onlybaseunits} & \@aux{#1onlyderivedunits}   & \@aux{#1onlyalternateunits} \tabularnewline
      \end{tabular}
    \end{center}
  }%
\NewDocumentCommand{\CheckConstant}{ m }
  {%
    \begin{center}
      \begin{tabular}{MMM}
        \textbf{command}       & \multicolumn{2}{l}{\@auy{#1}}                             \tabularnewline
        \text{\textbf{symbol}} & \text{\textbf{approximate}} & \text{\textbf{precise}}     \tabularnewline
        \@aux{#1mathsymbol}    & \@aux{#1approximatevalue}   & \@aux{#1precisevalue}       \tabularnewline
        \text{\textbf{base}}   & \text{\textbf{derived}}     & \text{\textbf{alternate}}   \tabularnewline
        \@aux{#1onlybaseunits} & \@aux{#1onlyderivedunits}   & \@aux{#1onlyalternateunits} \tabularnewline
      \end{tabular}
    \end{center}
  }%
\ExplSyntaxOn
\NewDocumentCommand{\mivector}{ O{,} m o }
  {
    \__mandi_vector:nn { #1 } { #2 }
    \IfValueT{#3}{\,{#3}}
  }
\seq_new:N \l__mandi_list_seq
\cs_new_protected:Npn \__mandi_vector:nn #1#2
  {
      \seq_set_split:Nnn \l__mandi_list_seq { , } { #2 }
      \int_compare:nT { \seq_count:N \l__mandi_list_seq = 1 }
       {
         \msg_new:nnnn { mandi } { onecomponent }
           {
             More~than~one~component~expected.       \iow_newline:
             You~provided~one~component~to~a~command \iow_newline:
             that~expects~a~vector.~Either~you~don't \iow_newline:
             need~a~vector~here~or~you~didn't~supply \iow_newline:
             all~the~components.
           }
           {
             Decide~whether~or~not~you~really~need~a~vector~command~here. \iow_newline:
             \msg_see_documentation_text:n { mandi }
           }
         \msg_fatal:nn { mandi } { onecomponent }

       }
      \left\langle
        \seq_use:Nnnn \l__mandi_list_seq { #1 } { #1 } { #1 }
      \right\rangle
  }
\ExplSyntaxOff
\endinput
%%
%% End of file `mandi.sty'.
