%Thisfile,equations.sty(August1988),containsacollectionofmacros %toaidinconstructingdisplayedequationsinLaTeX.Writtenby %CharlesKarney %PlasmaPhysicsLaboratoryPhone:+16092432607 %PrincetonUniversityMFEnet:Karney@PPC.MFEnet %POBox451ARPAnet:Karney%PPC.MFEnet@NMFECC.ARPA %Princeton,NJ08543-0451Bitnet:Karney%PPC.MFEnet@ANLVMS.Bitnet %withsomeideasandmacrosborrowedfromJohnHobbyandStephenGildea. %--------------------USERDOCUMENTATION-------------------- %Usethisasastyleoption,e.g., %\documentstyle[equations]{article} %Theseprobablydon'tworkinconjunctionwiththeleqnooption. %Thisimplementsthefollowing: %(1)\yesnumberturnsonanequationnumberinaneqnarray*environment %(justas\nonumberturnsitoffinaneqnarrayenvironment).E.g., %\begin{eqnarray*} %a&=&b\\ %&&+c\\ %&&+d\\ %&&+e\\ %&&+f\\ %&&+g\yesnumber %\end{eqnarray*} %(2)TheeqalignenvironmentisjustlikePlainTeX's\eqalign.E.g., %%\begin{eqalign}%a&=b,\\%c&=d.%\end{eqalign}% %Notethatorequivalentisneeded. %(3)TheeqalignnoenvironmentisjustlikePlainTeX's\eqalignno.E.g., %\begin{eqalignno} %a&=b,\label{foo}\\ %c&=d.\label{bar} %\end{eqalignno} %Notetheabsenceof.\nonumbercanbeused %tosuppresstheequationnumber.eqalignno*isthesameexceptthatthe %equationnumbersaresuppressed(unlessa\yesnumberappears). %(4)Theeqaligntwoenvironmentisatwo-equationperlineequivalentof %eqalignno.E.g., %\begin{eqaligntwo} %a&=b,&x&=y,\label{foo}\\ %c&=d,&z&=w.\label{bar} %\end{eqaligntwo} %eqaligntwo*isdefinedsimilarly. %(5)ThecasesenvironmentisjustlikePlainTeX's\cases.E.g., % %u(x)= %\begin{cases} %0,&for$x<0$, %1,&for$x\ge0$. %\end{cases} % %Notethefirstcolumnistreatedasmath,thesecondcolumnastext. %(6)I'veborrowedJohnHobby'smodificationstotheeqnarrayenvironment %(tofixupthespacingaroundtheoperator),andtothe\big,\bigg,etc. %operators(tomakethemscalewiththepointsize). %(7)I'veborrowedStephenGildea'ssubequationsenvironment,andfixedit %sothatitignoresspacesaftertheenvironmentandsothatyoucanrefer %bothtotheoverallsetofequationsandtoindividualsubequations.E.g., %\begin{subequations}\label{foo} %\begin{eqalignno} %a&=b,\label{foo-a}\\ %c&=d,\label{foo-b} %\end{eqalignno} %texttexttexttext... % %e=f.\label{foo-c} % %\end{subequations} %Now\ref{foo},\ref{foo-a},\ref{foo-b},\ref{foo-c},produce1,1a,1b, %1c. %--------------------ENDOFUSERDOCUMENTATION-------------------- %Fixupeqnarray*sothat\yesnumberand\nonumberdotheobviousthings \newif\if@defeqnsw\@defeqnswtrue %ThisisJohnHobby's(hobby@research.att.com)versiontofixupthespacing. \def\eqnarray{\stepcounter{equation}\let\@currentlabel=\theequation \if@defeqnsw\global\@eqnswtrue\else\global\@eqnswfalse\fi \global\@eqnswtrue \tabskip\@centering\let\\=\@eqncr \halignto\displaywidth\bgroup\hfil\global\@eqcnt\z@ \displaystyle\tabskip\z@{##}&\global\@eqcnt\@ne \hfil\displaystyle{{}##{}}\hfil &\global\@eqcnt\tw@\displaystyle{##}\hfil \tabskip\@centering&\llap{##}\tabskip\z@\cr} \def\yesnumber{\global\@eqnswtrue} \def\@@eqncr{\let\@tempa\relax\global\advance\@eqcntby\@ne \ifcase\@eqcnt\def\@tempa{&&&&}\or\def\@tempa{&&&}\or \def\@tempa{&&}\or\def\@tempa{&}\else\fi \@tempa\if@eqnsw\@eqnnum\stepcounter{equation}\fi \if@defeqnsw\global\@eqnswtrue\else\global\@eqnswfalse\fi \global\@eqcnt\z@\cr} %Severalformulaslike\eqalign(togoinside %or. \def\@eqnacr{{\ifnum0=}\fi\@ifstar{\@yeqnacr}{\@yeqnacr}} \def\@yeqnacr{\@ifnextchar[{\@xeqnacr}{\@xeqnacr[\z@]}} \def\@xeqnacr[#1]{\ifnum0={\fi}\cr\noalign{\vskip\jot\vskip#1\relax}} \def\eqalign{\null\,\vcenter\bgroup\openup1\jot\m@th\let\\=\@eqnacr \ialign\bgroup\strut \hfil\displaystyle{##}&\displaystyle{{}##}\hfil\crcr} \def\endeqalign{\crcr\egroup\egroup\,} %\cases \def\cases{\left\{\,\vcenter\bgroup\normalbaselines\m@th\let\\=\@eqnacr \ialign\bgroup##\hfil&\quad##\hfil\crcr} \def\endcases{\crcr\egroup\egroup\right.} %Severalformulaslike\eqalignno(doesn'tneedthe) \def\eqalignno{\stepcounter{equation}\let\@currentlabel=\theequation \if@defeqnsw\global\@eqnswtrue\else\global\@eqnswfalse\fi \let\\=\@eqncr\displ@y\tabskip\@centering\halignto\displaywidth\bgroup \global\@eqcnt\@ne\hfil $\@lign\displaystyle{##}$\tabskip\z@skip&\global\@eqcnt\tw@ $\@lign\displaystyle{{}##}$\hfil\tabskip\@centering& \llap{\@lign##}\tabskip\z@skip\crcr} \def\endeqalignno{\@@eqncr\egroup \global\advance\c@equation\m@ne\global\@ignoretrue} %Here'stheeqalignno*environment: \@namedef{eqalignno*}{\@defeqnswfalse\eqalignno} \@namedef{endeqalignno*}{\endeqalignno} %Twoformulaslike\eqalignno(doesn'tneedthe) \def\eqaligntwo{\stepcounter{equation}\let\@currentlabel=\theequation \if@defeqnsw\global\@eqnswtrue\else\global\@eqnswfalse\fi \let\\=\@eqncr\displ@y\tabskip\@centering\halignto\displaywidth\bgroup \global\@eqcnt\m@ne\hfil $\@lign\displaystyle{##}$\tabskip\z@skip&\global\@eqcnt\z@ $\@lign\displaystyle{{}##}$\hfil\qquad&\global\@eqcnt\@ne \hfil$\@lign\displaystyle{##}$&\global\@eqcnt\tw@ $\@lign\displaystyle{{}##}$\hfil\tabskip\@centering& \llap{\@lign##}\tabskip\z@skip\crcr} \def\endeqaligntwo{\@@eqncr\egroup \global\advance\c@equation\m@ne\global\@ignoretrue} \@namedef{eqaligntwo*}{\@defeqnswfalse\eqaligntwo} \@namedef{endeqaligntwo*}{\endeqaligntwo} %subequations %%%File:subeqn.sty %%%Thesubequationsenvironment%%% % %Withinthesubequationsenvironment,theonlychangeisthat %equationsarelabeleddifferently.Thenumberstaysthesame, %andlowercaselettersareappended.Forexample,ifafterdoing %threeequations,numbered1,2,and3,youstartasubequations %environmmentanddothreemoreequations,theywillbenumbered %4a,4b,and4c.Afteryouendthesubequationsenvironment,the %nextequationwillbenumbered5. % %Bothtextandequationscanbeputinsidethesubequationsenvironment. % %Ifyoumakeanyimprovements,I'dliketohearaboutthem. % %StephenGildea %MITEarthResourcesLab %Cambridge,Mass.02139 %mit-erl!gildea %gildea@erl.mit.edu % \newtoks\@stequation \def\subequations{\refstepcounter{equation}% \edef\@savedequation{\the\c@equation}% \@stequation=\expandafter{\theequation}%%onlywant\theequation \edef\@savedtheequation{\the\@stequation}%%expandedonce \edef\oldtheequation{\theequation}% \setcounter{equation}{0}% \def\theequation{\oldtheequation\alph{equation}}} \def\endsubequations{% \setcounter{equation}{\@savedequation}% \@stequation=\expandafter{\@savedtheequation}% \edef\theequation{\the\@stequation}% \global\@ignoretrue} %MorefromJohnHobby %FixPlain's\bigl,\Bigl,etc.macrossothattheytrytoscalewith %LaTeXsizechanges.Thisusesthefactthat\@setsizesets\ht\strutbox %tobe70%ofthenormalunstretchedbaselineskip. \def\big#1{{\hbox{$\left#1\vcenterto1.428\ht\strutbox{}\right.\n@space$}}} \def\Big#1{{\hbox{$\left#1\vcenterto2.142\ht\strutbox{}\right.\n@space$}}} \def\bigg#1{{\hbox{$\left#1\vcenterto2.857\ht\strutbox{}\right.\n@space$}}} \def\Bigg#1{{\hbox{$\left#1\vcenterto3.571\ht\strutbox{}\right.\n@space$}}} \endinput