From f60f1c10905a3b33dab411367c85412f8dce0a07 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 30 Jun 2016 21:01:17 +0000 Subject: mandi (30jun16) git-svn-id: svn://tug.org/texlive/trunk@41580 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/mandi/mandi.sty | 157 +++++++++++++++++++++------- 1 file changed, 119 insertions(+), 38 deletions(-) (limited to 'Master/texmf-dist/tex/latex/mandi') diff --git a/Master/texmf-dist/tex/latex/mandi/mandi.sty b/Master/texmf-dist/tex/latex/mandi/mandi.sty index 652a6bdbf6e..d2e819cb89a 100644 --- a/Master/texmf-dist/tex/latex/mandi/mandi.sty +++ b/Master/texmf-dist/tex/latex/mandi/mandi.sty @@ -19,16 +19,16 @@ %% %% The Current Maintainer of this work is Paul J. Heafner. %% -%% This work consists of the files mandi.dtx -%% README -%% mandi.pdf +%% This work consists of the files mandi.dtx +%% mandi.ins +%% mandi.pdf +%% README %% -%% and includes the derived files mandi.ins -%% mandi.sty and -%% vdemo.py. +%% and includes the derived files mandi.sty +%% vdemo.py. %% --------------------------------------------------------------------------- %% -\ProvidesPackage{mandi}[2016/03/15 2.5.1 Macros for physics and astronomy] +\ProvidesPackage{mandi}[2016/06/29 2.6.0 Macros for physics and astronomy] \NeedsTeXFormat{LaTeX2e}[1999/12/01] \RequirePackage{amsmath} @@ -36,6 +36,7 @@ \RequirePackage{array} \RequirePackage{cancel} \RequirePackage[dvipsnames]{xcolor} +\RequirePackage{enumitem} \RequirePackage{environ} \RequirePackage{esint} \RequirePackage[g]{esvect} @@ -52,12 +53,14 @@ \RequirePackage[framemethod=TikZ]{mdframed} \RequirePackage{stackengine} \RequirePackage{suffix} +\RequirePackage{tensor} \RequirePackage{xargs} \RequirePackage{xparse} \RequirePackage{xspace} \RequirePackage{ifthen} \RequirePackage{calligra} \RequirePackage{hyperref} +\hypersetup{colorlinks=true,urlcolor=blue} \DeclareMathAlphabet{\mathcalligra}{T1}{calligra}{m}{n} \DeclareFontShape{T1}{calligra}{m}{n}{<->s*[2.2]callig15}{} \DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `basename #1 .tif`.png} @@ -97,27 +100,27 @@ \newcolumntype{C}[1]{>{\centering}m{#1}} \newboolean{@optromanvectors} \newboolean{@optboldvectors} -\newboolean{@optsingleabsbars} +\newboolean{@optsinglemagbars} \newboolean{@optbaseunits} \newboolean{@optdrvdunits} \newboolean{@optapproxconsts} \newboolean{@optuseradians} \setboolean{@optromanvectors}{false} % this is where you set the default option \setboolean{@optboldvectors}{false} % this is where you set the default option -\setboolean{@optsingleabsbars}{false} % this is where you set the default option +\setboolean{@optsinglemagbars}{false} % this is where you set the default option \setboolean{@optbaseunits}{false} % this is where you set the default option \setboolean{@optdrvdunits}{false} % this is where you set the default option \setboolean{@optapproxconsts}{false} % this is where you set the default option \setboolean{@optuseradians}{false} % this is where you set the default option \DeclareOption{romanvectors}{\setboolean{@optromanvectors}{true}} \DeclareOption{boldvectors}{\setboolean{@optboldvectors}{true}} -\DeclareOption{singleabsbars}{\setboolean{@optsingleabsbars}{true}} +\DeclareOption{singlemagbars}{\setboolean{@optsinglemagbars}{true}} \DeclareOption{baseunits}{\setboolean{@optbaseunits}{true}} \DeclareOption{drvdunits}{\setboolean{@optdrvdunits}{true}} \DeclareOption{approxconsts}{\setboolean{@optapproxconsts}{true}} \DeclareOption{useradians}{\setboolean{@optuseradians}{true}} \ProcessOptions\relax -\newcommand*{\mandiversion}{2.5.0} +\newcommand*{\mandiversion}{2.6.0 dated 2016/06/29} \typeout{mandi: You're using mandi version \mandiversion.} \@ifpackageloaded{amssymb}{% \csundef{square} @@ -242,9 +245,9 @@ {\ifthenelse{\boolean{@optromanvectors}} {\typeout{mandi: You'll get Roman vectors.}} {\typeout{mandi: You'll get italic vectors.}}} -\ifthenelse{\boolean{@optsingleabsbars}} - {\typeout{mandi: You'll get single absolute value bars.}} - {\typeout{mandi: You'll get double absolute value bars.}} +\ifthenelse{\boolean{@optsinglemagbars}} + {\typeout{mandi: You'll get single magnitude bars.}} + {\typeout{mandi: You'll get double magnitude bars.}} \ifthenelse{\boolean{@optbaseunits}} {\perpusebaseunit % \typeout{mandi: You'll get base units.}} @@ -587,6 +590,10 @@ {\kg\usk\s\reciprocalcubed}% [\W\per\m\squared]% [\W\per\m\squared] +\newphysicsquantity{momentumflux}% + {\reciprocal\m\usk\kg\usk\s\reciprocalsquared}% + [\N\per\m\squared]% + [\N\per\m\squared] \newphysicsquantity{electroncurrent}% {\reciprocal\s}% [\ensuremath{\mathrm{e}}\per\s]% @@ -631,7 +638,34 @@ {\m\usk\A}% [\m\usk\A]% [\m\usk\A] -\newcommand*{\lv}{\ensuremath{\left\langle}} +\newcommand*{\vectordisplacement}[1]{\ensuremath{\displacement{\mivector{#1}}}} +\newcommand*{\vectorvelocity}[1]{\ensuremath{\velocity{\mivector{#1}}}} +\newcommand*{\vectorvelocityc}[1]{\ensuremath{\velocityc{\mivector{#1}}}} +\newcommand*{\vectoracceleration}[1]{\ensuremath{\acceleration{\mivector{#1}}}} +\newcommand*{\vectormomentum}[1]{\ensuremath{\momentum{\mivector{#1}}}} +\newcommand*{\vectorforce}[1]{\ensuremath{\force{\mivector{#1}}}} +\newcommand*{\vectorgravitationalfield}[1] + {\ensuremath{\gravitationalfield{\mivector{#1}}}} +\newcommand*{\vectorimpulse}[1]{\ensuremath{\impulse{\mivector{#1}}}} +\newcommand*{\vectorangularvelocity}[1]{\ensuremath{\angularvelocity{\mivector{#1}}}} +\newcommand*{\vectorangularacceleration}[1] + {\ensuremath{\angularacceleration{\mivector{#1}}}} +\newcommand*{\vectorangularmomentum}[1]{\ensuremath{\angularmomentum{\mivector{#1}}}} +\newcommand*{\vectorangularimpulse}[1]{\ensuremath{\angularimpulse{\mivector{#1}}}} +\newcommand*{\vectortorque}[1]{\ensuremath{\torque{\mivector{#1}}}} +\newcommand*{\vectorwavenumber}[1]{\ensuremath{\wavenumber{\mivector{#1}}}} +\newcommand*{\vectorelectricfield}[1]{\ensuremath{\electricfield{\mivector{#1}}}} +\newcommand*{\vectorelectricdipolemoment}[1] + {\ensuremath{\electricdipolemoment{\mivector{#1}}}} +\newcommand*{\vectormagneticfield}[1]{\ensuremath{\magneticfield{\mivector{#1}}}} +\newcommand*{\vectorcmagneticfield}[1]{\ensuremath{\cmagneticfield{\mivector{#1}}}} +\newcommand*{\vectormagneticdipolemoment}[1] + {\ensuremath{\magneticdipolemoment{\mivector{#1}}}} +\newcommand*{\vectorcurrentdensity}[1]{\ensuremath{\currentdensity{\mivector{#1}}}} + \newcommand*{\lv}{\ensuremath{\left\langle}} +\newcommand*{\vectorenergyflux}[1]{\ensuremath{\energyflux{\mivector{#1}}}} +\newcommand*{\vectormomentumflux}[1]{\ensuremath{\momentumflux{\mivector{#1}}}} +\newcommand*{\poyntingvector}{\vectorenergyflux} \newcommand*{\rv}{\ensuremath{\right\rangle}} \ExplSyntaxOn % Written in LaTeX3 \NewDocumentCommand{\magvectncomps}{ m O{} } @@ -658,13 +692,12 @@ }% \ExplSyntaxOff \newcommand*{\zerovect}{\vect{0}} -\newcommand*{\ncompszerovect}{\mivector{0,0,0}} \ifthenelse{\boolean{@optboldvectors}} {\newcommand*{\vect}[1]{\ensuremath{\boldsymbol{#1}}}} {\ifthenelse{\boolean{@optromanvectors}} {\newcommand*{\vect}[1]{\ensuremath{\vv{\mathrm{#1}}}}} {\newcommand*{\vect}[1]{\ensuremath{\vv{#1}}}}} -\ifthenelse{\boolean{@optsingleabsbars}} +\ifthenelse{\boolean{@optsinglemagbars}} {\newcommand*{\magvect}[1]{\ensuremath{\absof{\vect{#1}}}}} {\newcommand*{\magvect}[1]{\ensuremath{\magof{\vect{#1}}}}} \newcommand*{\magsquaredvect}[1]{\ensuremath{\magvect{#1}\squared}} @@ -676,7 +709,8 @@ {\ifthenelse{\boolean{@optromanvectors}} {\newcommand*{\dirvect}[1]{\ensuremath{\widehat{\mathrm{#1}}}}} {\newcommand*{\dirvect}[1]{\ensuremath{\widehat{#1}}}}} -\newcommand*{\direction}{\dirvect} +\newcommand*{\direction}[1]{\ensuremath{\mivector{#1}}} +\newcommand*{\vectordirection}{\direction} \newcommand*{\componentalong}[2]{\ensuremath{\mathrm{comp}_{#1}{#2}}} \newcommand*{\expcomponentalong}[2]{\ensuremath{\frac{\vectdotvect{#2}{#1}} {\magof{#1}}}} @@ -714,7 +748,7 @@ \newcommand*{\ddirection}{\ddirvect} \newcommand*{\Ddirvect}[1]{\ensuremath{\Delta\dirvect{#1}}} \newcommand*{\Ddirection}{\Ddirvect} -\ifthenelse{\boolean{@optsingleabsbars}} +\ifthenelse{\boolean{@optsinglemagbars}} {\newcommand*{\magdvect}[1]{\ensuremath{\absof{\dvect{#1}}}} \newcommand*{\magDvect}[1]{\ensuremath{\absof{\Dvect{#1}}}}} {\newcommand*{\magdvect}[1]{\ensuremath{\magof{\dvect{#1}}}} @@ -741,7 +775,7 @@ \compDervect{#1}{x}{#2},% \compDervect{#1}{y}{#2},% \compDervect{#1}{z}{#2}\rv}} -\ifthenelse{\boolean{@optsingleabsbars}} +\ifthenelse{\boolean{@optsinglemagbars}} {\newcommand*{\magdervect}[2]{\ensuremath{\absof{\dervect{#1}{#2}}}} \newcommand*{\magDervect}[2]{\ensuremath{\absof{\Dervect{#1}{#2}}}}} {\newcommand*{\magdervect}[2]{\ensuremath{\magof{\dervect{#1}{#2}}}} @@ -764,7 +798,7 @@ \compvectsub{#1}{#2}{x},% \compvectsub{#1}{#2}{y},% \compvectsub{#1}{#2}{z}\rv}} -\ifthenelse{\boolean{@optsingleabsbars}} +\ifthenelse{\boolean{@optsinglemagbars}} {\newcommand*{\magvectsub}[2]{\ensuremath{\absof{\vectsub{#1}{#2}}}}} {\newcommand*{\magvectsub}[2]{\ensuremath{\magof{\vectsub{#1}{#2}}}}} \newcommand*{\magsquaredvectsub}[2]{\ensuremath{\magvectsub{#1}{#2}\squared}} @@ -793,7 +827,7 @@ \newcommand*{\Dermagvectsub}[3]{\ensuremath{\DbyD{\magvectsub{#1}{#2}}{#3}}} \newcommand*{\dervectsub}[3]{\ensuremath{\dbyd{\vectsub{#1}{#2}}{#3}}} \newcommand*{\Dervectsub}[3]{\ensuremath{\DbyD{\vectsub{#1}{#2}}{#3}}} -\ifthenelse{\boolean{@optsingleabsbars}} +\ifthenelse{\boolean{@optsinglemagbars}} {\newcommand*{\magdervectsub}[3]{\ensuremath{\absof{\dervectsub{#1}{#2}{#3}}}} \newcommand*{\magDervectsub}[3]{\ensuremath{\absof{\Dervectsub{#1}{#2}{#3}}}}} {\newcommand*{\magdervectsub}[3]{\ensuremath{\magof{\dervectsub{#1}{#2}{#3}}}} @@ -1462,10 +1496,9 @@ \newcommand*{\sumoverall}[1]{\ensuremath{\displaystyle \sum_{\substack{\text{\tiny{all }}\text{\tiny{{#1}}}}}}} \newcommand*{\dx}[1]{\ensuremath{\,\mathrm{d}{#1}}} -\newcommand*{\evalfromto}[3]{\ensuremath{% - \Bigg.{#1}\Bigg\rvert_{#2}^{#3}}} -\newcommand*{\evalat}[2]{\ensuremath{\Bigg.{#1}\Bigg\rvert_{#2}}} -\newcommand*{\evaluatedat}[1]{\ensuremath{\Bigg.\Bigg\rvert_{#1}}} +\newcommandx{\evaluatedfromto}[2][2,usedefault]{\ensuremath{% + \Bigg.\Bigg\rvert_{#1}^{#2}}} +\newcommand*{\evaluatedat}{\evaluatedfromto} \newcommandx{\integral}[4][1,2,usedefault]{\ensuremath{% \int_{\ifthenelse{\equal{#1}{}}{}{#4=#1}}^{\ifthenelse{% \equal{#2}{}}{}{#4=#2}}}{#3}\dx{#4}} @@ -1566,21 +1599,17 @@ \newcommand*{\Lagr}{\ensuremath{\mathcal{L}}} \newcommandx{\flux}[1][1]{\ensuremath{\ssub{\Phi}{#1}}} \newcommand*{\absof}[1]{\ensuremath{% - \left\lvert{\ifblank{#1}{\:\cdot\:}{#1}}\right\rvert}} + \left\lvert{\ifblank{#1}{\:\_\:}{#1}}\right\rvert}} \newcommand*{\inparens}[1]{\ensuremath{% - \left({\ifblank{#1}{\:\cdot\:}{#1}}\right)}} + \left({\ifblank{#1}{\:\_\:}{#1}}\right)}} \newcommand*{\magof}[1]{\ensuremath{% - \left\lVert{\ifblank{#1}{\:\cdot\:}{#1}}\right\rVert}} + \left\lVert{\ifblank{#1}{\:\_\:}{#1}}\right\rVert}} \newcommand*{\dimsof}[1]{\ensuremath{% - \left[{\ifblank{#1}{\:\cdot\:}{#1}}\right]}} + \left[{\ifblank{#1}{\:\_\:}{#1}}\right]}} \newcommand*{\unitsof}[1]{\ensuremath{% - \left[{\ifblank{#1}{\:\cdot\:}{#1}}\right]_u}} + \left[{\ifblank{#1}{\:\_\:}{#1}}\right]_u}} \newcommand*{\changein}[1]{\ensuremath{\delta{#1}}} \newcommand*{\Changein}[1]{\ensuremath{\Delta{#1}}} -\newcommandx{\scin}[3][1,3=\!\!,usedefault]{\ensuremath{% - \ifthenelse{\equal{#1}{}} - {\unit{10^{#2}}{#3}} - {\unit{{#1}\times 10^{#2}}{#3}}}} \newcommandx{\timestento}[2][2=\!\!,usedefault]{\ensuremath{% \ifthenelse{\equal{#2}{}} {\unit{\;\times\;10^{#1}}{}} @@ -1674,6 +1703,47 @@ \xLongleftarrow[\text{\tiny{#1}}]{}}} \newcommand*{\brelatedto}[2]{\ensuremath{% \xLongleftrightarrow[\text{\tiny{#1}}]{\text{\tiny{#2}}}}} +\newcommand*{\genericinteractionplaces}[5]{\ensuremath{\inparens{#1} + \frac{\inparens{#2}\inparens{#3}}{\inparens{#4}^2}{{\ifblank{#5}{% + \mivector{\_ , \_ , \_}}{#5}}}}} +\newcommand*{\genericfieldofparticleplaces}[4]{\ensuremath{\inparens{#1} + \frac{\inparens{#2}}{\inparens{#3}^2}{{\ifblank{#4}{\mivector{\_ , \_ , \_}}{#4}}}}} +\newcommand*{\genericpotentialenergyplaces}[4]{\ensuremath{% + \inparens{#1}\frac{\inparens{#2}\inparens{#3}}{\inparens{#4}}}} +\newcommand*{\genericelectricdipoleplaces}[5]{% + \ensuremath{\inparens{#1}\frac{\inparens{#2}\inparens{#3}}{\inparens{#4}^3}% + {{\ifblank{#5}{\mivector{\_ , \_ , \_}}{#5}}}}} +\newcommand*{\genericelectricdipoleonaxisplaces}[5]{% + \ensuremath{\inparens{#1}\frac{2\inparens{#2}\inparens{#3}}{\inparens{#4}^3}% + {{\ifblank{#5}{\mivector{\_ , \_ , \_}}{#5}}}}} +\newcommand*{\gfieldofparticle}{\ensuremath{\universalgravmathsymbol\frac{M}% + {\magsquaredvect{r}}\inparens{-\dirvect{r}}}} +\newcommand*{\gravitationalinteractionplaces}[4]{% + \genericinteractionplaces{\universalgrav}{#1}{#2}{#3}{#4}} +\newcommand*{\gfieldofparticleplaces}[3]{% + \genericfieldofparticleplaces{\universalgrav}{#1}{#2}{#3}} +\newcommand*{\electricinteractionplaces}[4]{% + \genericinteractionplaces{\oofpez}{#1}{#2}{#3}{#4}} +\newcommand*{\Efieldofparticleplaces}[3]{% + \genericfieldofparticleplaces{\oofpez}{#1}{#2}{#3}} +\newcommand*{\Bfieldofparticleplaces}[5]{\ensuremath{\inparens{\mzofp}% + \frac{\inparens{#1}\inparens{#2}}{\inparens{#3}^2}{{\ifblank{#4}{% + \mivector{\_ , \_ , \_}}{#4}}}\times{{\ifblank{#5}{\mivector{\_ , \_ , \_}}{#5}}}}} +\newcommand*{\springinteractionplaces}[3]{\ensuremath{\inparens{#1} + \inparens{#2}{{\ifblank{#3}{\mivector{\_ , \_ , \_}}{#3}}}}} +\newcommand*{\gravitationalpotentialenergyplaces}[3]{% + -\genericpotentialenergyplaces{\universalgrav}{#1}{#2}{#3}} +\newcommand*{\electricpotentialenergyplaces}[3]{% + \genericpotentialenergyplaces{\oofpez}{#1}{#2}{#3}} +\newcommand*{\springpotentialenergyplaces}[2]{\ensuremath{% + \onehalf\inparens{#1}\inparens{#2}^2}} +\newcommand*{\electricdipoleonaxisplaces}[4]{% + \genericelectricdipoleonaxisplaces{\oofpez}{\absof{#1}}{#2}{#3}{{\ifblank{#4}{% + \mivector{\_ , \_ , \_}}{#4}}}} +\newcommand*{\electricdipoleonbisectorplaces}[4]{% + \genericelectricdipoleplaces{\oofpez}{\absof{#1}}{#2}{#3}{{\ifblank{#4}{% + \mivector{\_ , \_ , \_}}{#4}}}} +\newcommand{\define}[2]{\newcommand{#1}{#2}} \newcommand*{\momentumprinciple}{\ensuremath{% \vectsub{p}{sys,final}=\vectsub{p}{sys,initial}+\Fnetsys\Delta t}} \newcommand*{\LHSmomentumprinciple}{\ensuremath{\vectsub{p}{sys,final}}} @@ -1702,10 +1772,10 @@ \dirvectsub{r}{12}}} \newcommand*{\springinteraction}{\ensuremath{\ks\magvect{s}(-\dirvect{s})}} \newcommand*{\Bfieldofparticle}{\ensuremath{% - \mzofpmathsymbol\frac{Q\magvect{v}}{\magvect{r}\squared}\dirvect{v}\times + \mzofpmathsymbol\frac{Q\magvect{v}}{\magsquaredvect{r}}\dirvect{v}\times \dirvect{r}}} \newcommand*{\Efieldofparticle}{\ensuremath{% - \oofpezmathsymbol\frac{Q}{\magvect{r}\squared}\dirvect{r}}} + \oofpezmathsymbol\frac{Q}{\magsquaredvect{r}}\dirvect{r}}} \newcommandx{\Esys}[1][1]{\ifthenelse{% \equal{#1}{}}{\ssub{E}{sys}}{\ssub{E}{sys,#1}}} \newcommandx{\Us}[1][1]{\ifthenelse{% @@ -1882,8 +1952,12 @@ \newcommandx{\Eulerlagrange}[1][1={q_i},usedefault]{\ensuremath{% \DbyD{\mathcal{L}}{#1}-\DbyDt\inparens{\DbyD{\mathcal{L}}{\dot{#1}}} = 0}} \newcommand*{\vpythonline}{\lstinline[style=vpython]} +\newcommand*{\glowscriptline}{\lstinline[style=vpython]} \lstnewenvironment{vpythonblock}[1][]{\lstset{style=vpython,caption={#1}}}{} +\lstnewenvironment{glowscriptblock}[1][]{\lstset{style=vpython,caption={#1}}}{} \newcommand*{\vpythonfile}[1][]{\newpage\lstinputlisting[style=vpython,caption={#1}]} +\newcommand*{\glowscriptfile}[1][]{% + \newpage\lstinputlisting[style=vpython,caption={#1}]} \newcommandx{\emptyanswer}[2][1=0.80,2=0.1,usedefault] {\begin{minipage}{#1\textwidth}\hfill\vspace{#2\textheight}\end{minipage}} \newenvironmentx{activityanswer}[5][1=white,2=black,3=black,4=0.90,% @@ -2259,6 +2333,13 @@ \BODY \end{align*} }% +\newenvironment{problem}[1]{% + \newpage% + \section*{#1}% + \newlist{parts}{enumerate}{2}% + \setlist[parts]{label=(\alph*)}}{\newpage} +\newcommand{\problempart}{\item}% +\newcommand{\reason}[1]{\parbox{2cm}{#1}} \newcommand*{\checkpoint}{% \vspace{1cm}\begin{center}% \colorbox{yellow!80}{|--------- CHECKPOINT ---------|}% @@ -2272,6 +2353,7 @@ \end{center}% \end{figure}} \newcommand*{\sneakyone}[1]{\ensuremath{\cancelto{1}{#1}}} +\newcommand*{\qed}{\ensuremath{\text{ Q.E.D.}}} \newcommand*{\chkquantity}[1]{% \begin{center} \begin{tabular}{C{4.5cm} C{4cm} C{4cm} C{4cm}} @@ -2281,7 +2363,6 @@ \end{tabular} \end{center} }% -\newcommand*{\qed}{\ensuremath{\text{ Q.E.D.}}} \newcommand*{\chkconstant}[1]{% \begin{center} \begin{tabular}{C{4cm} C{2cm} C{3cm} C{3cm} C{3cm} C{3cm}} -- cgit v1.2.3