Commit 16f0718f authored by Philip Carns's avatar Philip Carns

initial skeleton for best practices document

parent 5c18392e
This source diff could not be displayed because it is too large. You can view the blob instead.
%%
%% IEEEtrantools.sty 2007/01/11 version V1.2
%%
%%
%% This package provides several popular and unique commands from the
%% IEEEtran.cls class (version 1.7) file.
%%
%% The provided commands include \IEEEPARstart, \IEEEitemize, \IEEEenumerate,
%% \IEEEdescription as well as the \IEEEeqnarray, \IEEEeqnarraybox family
%% of commands including support commands such as \IEEEstrut.
%% Also provides the \bstctlcite command for the control entry types of
%% IEEEtran.bst V1.00 and later.
%%
%% IEEEtrantools.sty should not be used with IEEEtran.cls.
%%
%% Support sites:
%% http://www.michaelshell.org/tex/ieeetran/
%% http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/
%%
%%
%% Copyright (c) 2002-2007 by Michael Shell
%% See: http://www.michaelshell.org/
%% for current contact information.
%%
%%*************************************************************************
%% Legal Notice:
%% This code is offered as-is without any warranty either expressed or
%% implied; without even the implied warranty of MERCHANTABILITY or
%% FITNESS FOR A PARTICULAR PURPOSE!
%% User assumes all risk.
%% In no event shall IEEE or any contributor to this code be liable for
%% any damages or losses, including, but not limited to, incidental,
%% consequential, or any other damages, resulting from the use or misuse
%% of any information contained here.
%%
%% All comments are the opinions of their respective authors and are not
%% necessarily endorsed by the IEEE.
%%
%% This work is distributed under the LaTeX Project Public License (LPPL)
%% ( http://www.latex-project.org/ ) version 1.3, and may be freely used,
%% distributed and modified. A copy of the LPPL, version 1.3, is included
%% in the base LaTeX documentation of all distributions of LaTeX released
%% 2003/12/01 or later.
%% Retain all contribution notices and credits.
%% ** Modified files should be clearly indicated as such, including **
%% ** renaming them and changing author support contact information. **
%%
%% File list of work: IEEEtrantools.sty, IEEEtrantools_doc.txt
%%*************************************************************************
%%
%%
%%
%% Available package options (e.g., \usepackage[retainorgcmds]{IEEEtrantools}
%%
%% retainorgcmds
%% Prevents IEEEtrantools from overriding existing LaTeX commands.
%% Currently, the only effect is to preserve the original definitions
%% of itemize, enumerate and description. The IEEEtran versions are
%% always available as IEEEitemize, IEEEenumerate and IEEEdescription.
%%
%%*******
% 1/2007 V1.2 (V1.7 of IEEEtran.cls) changes:
%
% 1) Several commands and environments have depreciated in favor of
% replacements with IEEE prefixes to better avoid potential future name
% clashes with other packages. Legacy code retained to allow
% use of the obsolete forms, but with an warning message to the
% console during compilation:
% \IEEEPARstart
% For IED lists:
% \IEEEiedlabeljustifyc, \IEEEiedlabeljustifyl, \IEEEiedlabeljustifyr,
% \IEEEnocalcleftmargin, \IEEElabelindent, \IEEEsetlabelwidth,
% \IEEEusemathlabelsep
%
% 2) These commands/lengths now require the IEEE prefix and do not have
% legacy support: \IEEEnormaljot.
% For IED lists: \ifIEEEnocalcleftmargin, \ifIEEEnolabelindentfactor,
% \IEEEiedlistdecl, \IEEElabelindentfactor
%
% 3) \normalsizebaselineskip no longer provided.
%
% 4) New \IEEEPARstart controls:
% \IEEEPARstartHEIGHTTEXT, \IEEEPARstartFONTSTYLE, \IEEEPARstartCAPSTYLE,
% \IEEEPARstartWORDFONTSTYLE, \IEEEPARstartWORDCAPSTYLE,
% \IEEEPARstartHOFFSET, \IEEEPARstartITLCORRECT
% and the (output) length \IEEEPARstartletwidth.
%
% 5) Provide for an optional argument to \bstctlcite to provide a way to
% specify a different aux file.
%
%
% 11/2002 V1.1 (V1.6b of IEEEtran.cls) changes:
%
% 1) In addition to the IEEE IED lists, the original LaTeX IED style list
% environments are now preserved as LaTeXitemize, LaTeXenumerate, and
% LaTeXdescription. Also, users can now redefine \makelabel within
% IEEE IED list controls. There may be some use for these in specialized
% applications. Thanks to Eli Barzilay for suggesting this feature.
%
%%**********************************************************************
\ProvidesPackage{IEEEtrantools}[2007/01/11 V1.2 by Michael Shell]
\typeout{-- See the "IEEEtrantools_doc.txt" manual for usage information.}
\typeout{-- http://www.michaelshell.org/tex/ieeetran/tools/}
\NeedsTeXFormat{LaTeX2e}
% If IEEEtran.cls is detected, error.
{\@ifundefined{IEEEtransversionmajor}{\relax}{%
\PackageError{IEEEtrantools}{IEEEtrantools is not for use with the\MessageBreak
IEEEtran class}%
{Do not load IEEEtrantools - you don't need it.}%
}}
% define new needed flags to indicate document options
% and set a few "failsafe" defaults
\newif\if@IEEETOOLSretainorgcmds
\global\@IEEETOOLSretainorgcmdsfalse
% IEEEtran class scratch pad registers
% dimen
\newdimen\@IEEEtrantmpdimenA
\newdimen\@IEEEtrantmpdimenB
% count
\newcount\@IEEEtrantmpcountA
\newcount\@IEEEtrantmpcountB
% token list
\newtoks\@IEEEtrantmptoksA
% declare the options
\DeclareOption{retainorgcmds}{\@IEEETOOLSretainorgcmdstrue}
% get and process any supplied options
\ProcessOptions
% store the nominal value of jot
\newdimen\IEEEnormaljot
\IEEEnormaljot\jot\relax
% Itemize, Enumerate and Description (IED) List Controls
% ***************************
%
%
% IEEE seems to use at least two different values by
% which ITEMIZED list labels are indented to the right
% For The Journal of Lightwave Technology (JLT) and The Journal
% on Selected Areas in Communications (JSAC), they tend to use
% an indention equal to \parindent. For Transactions on Communications
% they tend to indent ITEMIZED lists a little more--- 1.3\parindent.
% We'll provide both values here for you so that you can choose
% which one you like in your document using a command such as:
% setlength{\IEEEilabelindent}{\IEEEilabelindentB}
\newdimen\IEEEilabelindentA
\IEEEilabelindentA \parindent
\newdimen\IEEEilabelindentB
\IEEEilabelindentB 1.3\parindent
% However, we'll default to using \parindent
% which makes more sense to me
\newdimen\IEEEilabelindent
\IEEEilabelindent \IEEEilabelindentA
% This controls the default amount the enumerated list labels
% are indented to the right.
% Normally, this is the same as the paragraph indention
\newdimen\IEEEelabelindent
\IEEEelabelindent \parindent
% This controls the default amount the description list labels
% are indented to the right.
% Normally, this is the same as the paragraph indention
\newdimen\IEEEdlabelindent
\IEEEdlabelindent \parindent
% This is the value actually used within the IED lists.
% The IED environments automatically set its value to
% one of the three values above, so global changes do
% not have any effect
\newdimen\IEEElabelindent
\IEEElabelindent \parindent
% The actual amount labels will be indented is
% \IEEElabelindent multiplied by the factor below
% corresponding to the level of nesting depth
% This provides a means by which the user can
% alter the effective \IEEElabelindent for deeper
% levels
% There may not be such a thing as correct "standard IEEE"
% values. What IEEE actually does may depend on the specific
% circumstances.
% The first list level almost always has full indention.
% The second levels I've seen have only 75% of the normal indentation
% Three level or greater nestings are very rare. I am guessing
% that they don't use any indentation.
\def\IEEElabelindentfactori{1.0} % almost always one
\def\IEEElabelindentfactorii{0.75} % 0.0 or 1.0 may be used in some cases
\def\IEEElabelindentfactoriii{0.0} % 0.75? 0.5? 0.0?
\def\IEEElabelindentfactoriv{0.0}
\def\IEEElabelindentfactorv{0.0}
\def\IEEElabelindentfactorvi{0.0}
% value actually used within IED lists, it is auto
% set to one of the 6 values above
% global changes here have no effect
\def\IEEElabelindentfactor{1.0}
% This controls the default spacing between the end of the IED
% list labels and the list text, when normal text is used for
% the labels.
\newdimen\IEEEiednormlabelsep
\IEEEiednormlabelsep 0.6em
% This controls the default spacing between the end of the IED
% list labels and the list text, when math symbols are used for
% the labels (nomenclature lists). IEEE usually increases the
% spacing in these cases
\newdimen\IEEEiedmathlabelsep
\IEEEiedmathlabelsep 1.2em
% This controls the extra vertical separation put above and
% below each IED list. IEEE usually puts a little extra spacing
% around each list. However, this spacing is barely noticeable.
\newskip\IEEEiedtopsep
\IEEEiedtopsep 2pt plus 1pt minus 1pt
% This command is executed within each IED list environment
% at the beginning of the list. You can use this to set the
% parameters for some/all your IED list(s) without disturbing
% global parameters that affect things other than lists.
% i.e., renewcommand{\IEEEiedlistdecl}{\setlength{\labelsep}{5em}}
% will alter the \labelsep for the next list(s) until
% \IEEEiedlistdecl is redefined.
\def\IEEEiedlistdecl{\relax}
% This command provides an easy way to set \leftmargin based
% on the \labelwidth, \labelsep and the argument \IEEElabelindent
% Usage: \IEEEcalcleftmargin{width-to-indent-the-label}
% output is in the \leftmargin variable, i.e., effectively:
% \leftmargin = argument + \labelwidth + \labelsep
% Note controlled spacing here, shield end of lines with %
\def\IEEEcalcleftmargin#1{\setlength{\leftmargin}{#1}%
\addtolength{\leftmargin}{\labelwidth}%
\addtolength{\leftmargin}{\labelsep}}
% This command provides an easy way to set \labelwidth to the
% width of the given text. It is the same as
% \settowidth{\labelwidth}{label-text}
% and useful as a shorter alternative.
% Typically used to set \labelwidth to be the width
% of the longest label in the list
\def\IEEEsetlabelwidth#1{\settowidth{\labelwidth}{#1}}
% When this command is executed, IED lists will use the
% IEEEiedmathlabelsep label separation rather than the normal
% spacing. To have an effect, this command must be executed via
% the \IEEEiedlistdecl or within the option of the IED list
% environments.
\def\IEEEusemathlabelsep{\setlength{\labelsep}{\IEEEiedmathlabelsep}}
% A flag which controls whether the IED lists automatically
% calculate \leftmargin from \IEEElabelindent, \labelwidth and \labelsep
% Useful if you want to specify your own \leftmargin
% This flag must be set (\IEEEnocalcleftmargintrue or \IEEEnocalcleftmarginfalse)
% via the \IEEEiedlistdecl or within the option of the IED list
% environments to have an effect.
\newif\ifIEEEnocalcleftmargin
\IEEEnocalcleftmarginfalse
% A flag which controls whether \IEEElabelindent is multiplied by
% the \IEEElabelindentfactor for each list level.
% This flag must be set via the \IEEEiedlistdecl or within the option
% of the IED list environments to have an effect.
\newif\ifIEEEnolabelindentfactor
\IEEEnolabelindentfactorfalse
% internal variable to indicate type of IED label
% justification
% 0 - left; 1 - center; 2 - right
\def\@IEEEiedjustify{0}
% commands to allow the user to control IED
% label justifications. Use these commands within
% the IED environment option or in the \IEEEiedlistdecl
% Note that changing the normal list justifications
% is nonstandard and IEEE may not like it if you do so!
% I include these commands as they may be helpful to
% those who are using these enhanced list controls for
% other non-IEEE related LaTeX work.
% itemize and enumerate automatically default to right
% justification, description defaults to left.
\def\IEEEiedlabeljustifyl{\def\@IEEEiedjustify{0}}%left
\def\IEEEiedlabeljustifyc{\def\@IEEEiedjustify{1}}%center
\def\IEEEiedlabeljustifyr{\def\@IEEEiedjustify{2}}%right
% commands to save to and restore from the list parameter copies
% this allows us to set all the list parameters within
% the list_decl and prevent \list (and its \@list)
% from overriding any of our parameters
% V1.6 use \edefs instead of dimen's to conserve dimen registers
% Note controlled spacing here, shield end of lines with %
\def\@IEEEsavelistparams{\edef\@IEEEiedtopsep{\the\topsep}%
\edef\@IEEEiedlabelwidth{\the\labelwidth}%
\edef\@IEEEiedlabelsep{\the\labelsep}%
\edef\@IEEEiedleftmargin{\the\leftmargin}%
\edef\@IEEEiedpartopsep{\the\partopsep}%
\edef\@IEEEiedparsep{\the\parsep}%
\edef\@IEEEieditemsep{\the\itemsep}%
\edef\@IEEEiedrightmargin{\the\rightmargin}%
\edef\@IEEEiedlistparindent{\the\listparindent}%
\edef\@IEEEieditemindent{\the\itemindent}}
% Note controlled spacing here
\def\@IEEErestorelistparams{\topsep\@IEEEiedtopsep\relax%
\labelwidth\@IEEEiedlabelwidth\relax%
\labelsep\@IEEEiedlabelsep\relax%
\leftmargin\@IEEEiedleftmargin\relax%
\partopsep\@IEEEiedpartopsep\relax%
\parsep\@IEEEiedparsep\relax%
\itemsep\@IEEEieditemsep\relax%
\rightmargin\@IEEEiedrightmargin\relax%
\listparindent\@IEEEiedlistparindent\relax%
\itemindent\@IEEEieditemindent\relax}
% v1.6b provide original LaTeX IED list environments
% note that latex.ltx defines \itemize and \enumerate, but not \description
% which must be created by the base classes
% save original LaTeX itemize and enumerate
\let\LaTeXitemize\itemize
\let\endLaTeXitemize\enditemize
\let\LaTeXenumerate\enumerate
\let\endLaTeXenumerate\endenumerate
% base class should define \description
\let\LaTeXdescription\description
\let\endLaTeXdescription\enddescription
% override LaTeX's default IED lists, unless the user requested they be retained
\if@IEEETOOLSretainorgcmds\relax\else
\def\itemize{\@IEEEitemize}
\def\enditemize{\@endIEEEitemize}
\def\enumerate{\@IEEEenumerate}
\def\endenumerate{\@endIEEEenumerate}
\def\description{\@IEEEdescription}
\def\enddescription{\@endIEEEdescription}
\fi
% provide the user with the IEEE IED commands
\def\IEEEitemize{\@IEEEitemize}
\def\endIEEEitemize{\@endIEEEitemize}
\def\IEEEenumerate{\@IEEEenumerate}
\def\endIEEEenumerate{\@endIEEEenumerate}
\def\IEEEdescription{\@IEEEdescription}
\def\endIEEEdescription{\@endIEEEdescription}
% V1.6 we want to keep the IEEEtran IED list definitions as our own internal
% commands so they are protected against redefinition
\def\@IEEEitemize{\@ifnextchar[{\@@IEEEitemize}{\@@IEEEitemize[\relax]}}
\def\@IEEEenumerate{\@ifnextchar[{\@@IEEEenumerate}{\@@IEEEenumerate[\relax]}}
\def\@IEEEdescription{\@ifnextchar[{\@@IEEEdescription}{\@@IEEEdescription[\relax]}}
\def\@endIEEEitemize{\endlist}
\def\@endIEEEenumerate{\endlist}
\def\@endIEEEdescription{\endlist}
% DO NOT ALLOW BLANK LINES TO BE IN THESE IED ENVIRONMENTS
% AS THIS WILL FORCE NEW PARAGRAPHS AFTER THE IED LISTS
% IEEEtran itemized list MDS 1/2001
% Note controlled spacing here, shield end of lines with %
\def\@@IEEEitemize[#1]{%
\ifnum\@itemdepth>3\relax\@toodeep\else%
\ifnum\@listdepth>5\relax\@toodeep\else%
\advance\@itemdepth\@ne%
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
% get the labelindentfactor for this level
\advance\@listdepth\@ne% we need to know what the level WILL be
\edef\IEEElabelindentfactor{\csname IEEElabelindentfactor\romannumeral\the\@listdepth\endcsname}%
\advance\@listdepth-\@ne% undo our increment
\def\@IEEEiedjustify{2}% right justified labels are default
% set other defaults
\IEEEnocalcleftmarginfalse%
\IEEEnolabelindentfactorfalse%
\topsep\IEEEiedtopsep%
\IEEElabelindent\IEEEilabelindent%
\labelsep\IEEEiednormlabelsep%
\partopsep 0ex%
\parsep 0ex%
\itemsep 0ex%
\rightmargin 0em%
\listparindent 0em%
\itemindent 0em%
% calculate the label width
% the user can override this later if
% they specified a \labelwidth
\settowidth{\labelwidth}{\csname labelitem\romannumeral\the\@itemdepth\endcsname}%
\@IEEEsavelistparams% save our list parameters
\list{\csname\@itemitem\endcsname}{%
\@IEEErestorelistparams% override any list{} changes
% to our globals
\let\makelabel\@IEEEiedmakelabel% v1.6b setup \makelabel
\IEEEiedlistdecl% let user alter parameters
#1\relax%
% If the user has requested not to use the
% labelindent factor, don't revise \labelindent
\ifIEEEnolabelindentfactor\relax%
\else\IEEElabelindent=\IEEElabelindentfactor\labelindent%
\fi%
% Unless the user has requested otherwise,
% calculate our left margin based
% on \IEEElabelindent, \labelwidth and
% \labelsep
\ifIEEEnocalcleftmargin\relax%
\else\IEEEcalcleftmargin{\IEEElabelindent}%
\fi}\fi\fi}%
% DO NOT ALLOW BLANK LINES TO BE IN THESE IED ENVIRONMENTS
% AS THIS WILL FORCE NEW PARAGRAPHS AFTER THE IED LISTS
% IEEEtran enumerate list MDS 1/2001
% Note controlled spacing here, shield end of lines with %
\def\@@IEEEenumerate[#1]{%
\ifnum\@enumdepth>3\relax\@toodeep\else%
\ifnum\@listdepth>5\relax\@toodeep\else%
\advance\@enumdepth\@ne%
\edef\@enumctr{enum\romannumeral\the\@enumdepth}%
% get the labelindentfactor for this level
\advance\@listdepth\@ne% we need to know what the level WILL be
\edef\IEEElabelindentfactor{\csname IEEElabelindentfactor\romannumeral\the\@listdepth\endcsname}%
\advance\@listdepth-\@ne% undo our increment
\def\@IEEEiedjustify{2}% right justified labels are default
% set other defaults
\IEEEnocalcleftmarginfalse%
\IEEEnolabelindentfactorfalse%
\topsep\IEEEiedtopsep%
\IEEElabelindent\IEEEelabelindent%
\labelsep\IEEEiednormlabelsep%
\partopsep 0ex%
\parsep 0ex%
\itemsep 0ex%
\rightmargin 0em%
\listparindent 0em%
\itemindent 0em%
% calculate the label width
% We'll set it to the width suitable for all labels using
% normalfont 1) to 9)
% The user can override this later
\settowidth{\labelwidth}{9)}%
\@IEEEsavelistparams% save our list parameters
\list{\csname label\@enumctr\endcsname}{\usecounter{\@enumctr}%
\@IEEErestorelistparams% override any list{} changes
% to our globals
\let\makelabel\@IEEEiedmakelabel% v1.6b setup \makelabel
\IEEEiedlistdecl% let user alter parameters
#1\relax%
% If the user has requested not to use the
% IEEElabelindent factor, don't revise \IEEElabelindent
\ifIEEEnolabelindentfactor\relax%
\else\IEEElabelindent=\IEEElabelindentfactor\IEEElabelindent%
\fi%
% Unless the user has requested otherwise,
% calculate our left margin based
% on \IEEElabelindent, \labelwidth and
% \labelsep
\ifIEEEnocalcleftmargin\relax%
\else\IEEEcalcleftmargin{\IEEElabelindent}%
\fi}\fi\fi}%
% DO NOT ALLOW BLANK LINES TO BE IN THESE IED ENVIRONMENTS
% AS THIS WILL FORCE NEW PARAGRAPHS AFTER THE IED LISTS
% IEEEtran description list MDS 1/2001
% Note controlled spacing here, shield end of lines with %
\def\@@IEEEdescription[#1]{%
\ifnum\@listdepth>5\relax\@toodeep\else%
% get the labelindentfactor for this level
\advance\@listdepth\@ne% we need to know what the level WILL be
\edef\IEEElabelindentfactor{\csname IEEElabelindentfactor\romannumeral\the\@listdepth\endcsname}%
\advance\@listdepth-\@ne% undo our increment
\def\@IEEEiedjustify{0}% left justified labels are default
% set other defaults
\IEEEnocalcleftmarginfalse%
\IEEEnolabelindentfactorfalse%
\topsep\IEEEiedtopsep%
\IEEElabelindent\IEEEdlabelindent%
% assume normal labelsep
\labelsep\IEEEiednormlabelsep%
\partopsep 0ex%
\parsep 0ex%
\itemsep 0ex%
\rightmargin 0em%
\listparindent 0em%
\itemindent 0em%
% Bogus label width in case the user forgets
% to set it.
% TIP: If you want to see what a variable's width is you
% can use the TeX command \showthe\width-variable to
% display it on the screen during compilation
% (This might be helpful to know when you need to find out
% which label is the widest)
\settowidth{\labelwidth}{Hello}%
\@IEEEsavelistparams% save our list parameters
\list{}{\@IEEErestorelistparams% override any list{} changes
% to our globals
\let\makelabel\@IEEEiedmakelabel% v1.6b setup \makelabel
\IEEEiedlistdecl% let user alter parameters
#1\relax%
% If the user has requested not to use the
% labelindent factor, don't revise \IEEElabelindent
\ifIEEEnolabelindentfactor\relax%
\else\IEEElabelindent=\IEEElabelindentfactor\IEEElabelindent%
\fi%
% Unless the user has requested otherwise,
% calculate our left margin based
% on \IEEElabelindent, \labelwidth and
% \labelsep
\ifIEEEnocalcleftmargin\relax%
\else\IEEEcalcleftmargin{\IEEElabelindent}\relax%
\fi}\fi}
% v1.6b we use one makelabel that does justification as needed.
\def\@IEEEiedmakelabel#1{\relax\if\@IEEEiedjustify 0\relax
\makebox[\labelwidth][l]{\normalfont #1}\else
\if\@IEEEiedjustify 1\relax
\makebox[\labelwidth][c]{\normalfont #1}\else
\makebox[\labelwidth][r]{\normalfont #1}\fi\fi}
% used only by IEEEtran's IEEEeqnarray as other packages may
% have their own, different, implementations
\newcounter{IEEEsubequation}[equation]
% e.g., "1a" (used only by IEEEtran's IEEEeqnarray)
\def\theIEEEsubequation{\theequation\alph{IEEEsubequation}}
% just like LaTeX2e's \@eqnnum
\def\theequationdis{{\normalfont \normalcolor (\theequation)}}% (1)
% IEEEsubequation used only by IEEEtran's IEEEeqnarray
\def\theIEEEsubequationdis{{\normalfont \normalcolor (\theIEEEsubequation)}}% (1a)
%%
%% START OF IEEEeqnarry DEFINITIONS
%%
%% Inspired by the concepts, examples, and previous works of LaTeX
%% coders and developers such as Donald Arseneau, Fred Bartlett,
%% David Carlisle, Tony Liu, Frank Mittelbach, Piet van Oostrum,
%% Roland Winkler and Mark Wooding.
%% I don't make the claim that my work here is even near their calibre. ;)
% hook to allow easy changeover to IEEEtran.cls/tools.sty error reporting
\def\@IEEEclspkgerror{\PackageError{IEEEtran}}
\newif\if@IEEEeqnarraystarform% flag to indicate if the environment was called as the star form
\@IEEEeqnarraystarformfalse
\newif\if@advanceIEEEeqncolcnt% tracks if the environment should advance the col counter
% allows a way to make an \IEEEeqnarraybox that can be used within an \IEEEeqnarray
% used by IEEEeqnarraymulticol so that it can work properly in both
\@advanceIEEEeqncolcnttrue
\newcount\@IEEEeqnnumcols % tracks how many IEEEeqnarray cols are defined
\newcount\@IEEEeqncolcnt % tracks how many IEEEeqnarray cols the user actually used
% The default math style used by the columns
\def\IEEEeqnarraymathstyle{\displaystyle}
% The default text style used by the columns
% default to using the current font
\def\IEEEeqnarraytextstyle{\relax}
% like the iedlistdecl but for \IEEEeqnarray
\def\IEEEeqnarraydecl{\relax}
\def\IEEEeqnarrayboxdecl{\relax}
% \yesnumber is the opposite of \nonumber
% a novel concept with the same def as the equationarray package
% However, we give IEEE versions too since some LaTeX packages such as
% the MDWtools mathenv.sty redefine \nonumber to something else.
\providecommand{\yesnumber}{\global\@eqnswtrue}
\def\IEEEyesnumber{\global\@eqnswtrue}
\def\IEEEnonumber{\global\@eqnswfalse}
\def\IEEEyessubnumber{\global\@IEEEissubequationtrue\global\@eqnswtrue%
\if@IEEEeqnarrayISinner% only do something inside an IEEEeqnarray
\if@IEEElastlinewassubequation\addtocounter{equation}{-1}\else\setcounter{IEEEsubequation}{1}\fi%
\def\@currentlabel{\p@IEEEsubequation\theIEEEsubequation}\fi}
% flag to indicate that an equation is a sub equation
\newif\if@IEEEissubequation%
\@IEEEissubequationfalse
% allows users to "push away" equations that get too close to the equation numbers
\def\IEEEeqnarraynumspace{\hphantom{\if@IEEEissubequation\theIEEEsubequationdis\else\theequationdis\fi}}
% provides a way to span multiple columns within IEEEeqnarray environments
% will consider \if@advanceIEEEeqncolcnt before globally advancing the
% column counter - so as to work within \IEEEeqnarraybox
% usage: \IEEEeqnarraymulticol{number cols. to span}{col type}{cell text}
\long\def\IEEEeqnarraymulticol#1#2#3{\multispan{#1}%
% check if column is defined
\relax\expandafter\ifx\csname @IEEEeqnarraycolDEF#2\endcsname\@IEEEeqnarraycolisdefined%
\csname @IEEEeqnarraycolPRE#2\endcsname#3\relax\relax\relax\relax\relax%
\relax\relax\relax\relax\relax\csname @IEEEeqnarraycolPOST#2\endcsname%
\else% if not, error and use default type
\@IEEEclspkgerror{Invalid column type "#2" in \string\IEEEeqnarraymulticol.\MessageBreak
Using a default centering column instead}%
{You must define IEEEeqnarray column types before use.}%
\csname @IEEEeqnarraycolPRE@IEEEdefault\endcsname#3\relax\relax\relax\relax\relax%
\relax\relax\relax\relax\relax\csname @IEEEeqnarraycolPOST@IEEEdefault\endcsname%
\fi%
% advance column counter only if the IEEEeqnarray environment wants it
\if@advanceIEEEeqncolcnt\global\advance\@IEEEeqncolcnt by #1\relax\fi}
% like \omit, but maintains track of the column counter for \IEEEeqnarray
\def\IEEEeqnarrayomit{\omit\if@advanceIEEEeqncolcnt\global\advance\@IEEEeqncolcnt by 1\relax\fi}
% provides a way to define a letter referenced column type
% usage: \IEEEeqnarraydefcol{col. type letter/name}{pre insertion text}{post insertion text}
\def\IEEEeqnarraydefcol#1#2#3{\expandafter\def\csname @IEEEeqnarraycolPRE#1\endcsname{#2}%
\expandafter\def\csname @IEEEeqnarraycolPOST#1\endcsname{#3}%
\expandafter\def\csname @IEEEeqnarraycolDEF#1\endcsname{1}}
% provides a way to define a numerically referenced inter-column glue types
% usage: \IEEEeqnarraydefcolsep{col. glue number}{glue definition}
\def\IEEEeqnarraydefcolsep#1#2{\expandafter\def\csname @IEEEeqnarraycolSEP\romannumeral #1\endcsname{#2}%
\expandafter\def\csname @IEEEeqnarraycolSEPDEF\romannumeral #1\endcsname{1}}
\def\@IEEEeqnarraycolisdefined{1}% just a macro for 1, used for checking undefined column types
% expands and appends the given argument to the \@IEEEtrantmptoksA token list
% used to build up the \halign preamble
\def\@IEEEappendtoksA#1{\edef\@@IEEEappendtoksA{\@IEEEtrantmptoksA={\the\@IEEEtrantmptoksA #1}}%
\@@IEEEappendtoksA}
% also appends to \@IEEEtrantmptoksA, but does not expand the argument
% uses \toks8 as a scratchpad register
\def\@IEEEappendNOEXPANDtoksA#1{\toks8={#1}%
\edef\@@IEEEappendNOEXPANDtoksA{\@IEEEtrantmptoksA={\the\@IEEEtrantmptoksA\the\toks8}}%
\@@IEEEappendNOEXPANDtoksA}
% define some common column types for the user
% math
\IEEEeqnarraydefcol{l}{$\IEEEeqnarraymathstyle}{$\hfil}
\IEEEeqnarraydefcol{c}{\hfil$\IEEEeqnarraymathstyle}{$\hfil}
\IEEEeqnarraydefcol{r}{\hfil$\IEEEeqnarraymathstyle}{$}
\IEEEeqnarraydefcol{L}{$\IEEEeqnarraymathstyle{}}{{}$\hfil}
\IEEEeqnarraydefcol{C}{\hfil$\IEEEeqnarraymathstyle{}}{{}$\hfil}
\IEEEeqnarraydefcol{R}{\hfil$\IEEEeqnarraymathstyle{}}{{}$}
% text
\IEEEeqnarraydefcol{s}{\IEEEeqnarraytextstyle}{\hfil}
\IEEEeqnarraydefcol{t}{\hfil\IEEEeqnarraytextstyle}{\hfil}
\IEEEeqnarraydefcol{u}{\hfil\IEEEeqnarraytextstyle}{}
% vertical rules
\IEEEeqnarraydefcol{v}{}{\vrule width\arrayrulewidth}
\IEEEeqnarraydefcol{vv}{\vrule width\arrayrulewidth\hfil}{\hfil\vrule width\arrayrulewidth}
\IEEEeqnarraydefcol{V}{}{\vrule width\arrayrulewidth\hskip\doublerulesep\vrule width\arrayrulewidth}
\IEEEeqnarraydefcol{VV}{\vrule width\arrayrulewidth\hskip\doublerulesep\vrule width\arrayrulewidth\hfil}%
{\hfil\vrule width\arrayrulewidth\hskip\doublerulesep\vrule width\arrayrulewidth}
% horizontal rules
\IEEEeqnarraydefcol{h}{}{\leaders\hrule height\arrayrulewidth\hfil}
\IEEEeqnarraydefcol{H}{}{\leaders\vbox{\hrule width\arrayrulewidth\vskip\doublerulesep\hrule width\arrayrulewidth}\hfil}
% plain
\IEEEeqnarraydefcol{x}{}{}
\IEEEeqnarraydefcol{X}{$}{$}
% the default column type to use in the event a column type is not defined
\IEEEeqnarraydefcol{@IEEEdefault}{\hfil$\IEEEeqnarraymathstyle}{$\hfil}
% a zero tabskip (used for "-" col types)
\def\@IEEEeqnarraycolSEPzero{0pt plus 0pt minus 0pt}
% a centering tabskip (used for "+" col types)
\def\@IEEEeqnarraycolSEPcenter{1000pt plus 0pt minus 1000pt}
% top level default tabskip glues for the start, end, and inter-column
% may be reset within environments not always at the top level, e.g., \IEEEeqnarraybox
\edef\@IEEEeqnarraycolSEPdefaultstart{\@IEEEeqnarraycolSEPcenter}% default start glue
\edef\@IEEEeqnarraycolSEPdefaultend{\@IEEEeqnarraycolSEPcenter}% default end glue
\edef\@IEEEeqnarraycolSEPdefaultmid{\@IEEEeqnarraycolSEPzero}% default inter-column glue
% creates a vertical rule that extends from the bottom to the top a a cell
% Provided in case other packages redefine \vline some other way.
% usage: \IEEEeqnarrayvrule[rule thickness]
% If no argument is provided, \arrayrulewidth will be used for the rule thickness.
\newcommand\IEEEeqnarrayvrule[1][\arrayrulewidth]{\vrule\@width#1\relax}
% creates a blank separator row
% usage: \IEEEeqnarrayseprow[separation length][font size commands]
% default is \IEEEeqnarrayseprow[0.25\normalbaselineskip][\relax]
% blank arguments inherit the default values
% uses \skip5 as a scratch register - calls \@IEEEeqnarraystrutsize which uses more scratch registers
\def\IEEEeqnarrayseprow{\relax\@ifnextchar[{\@IEEEeqnarrayseprow}{\@IEEEeqnarrayseprow[0.25\normalbaselineskip]}}
\def\@IEEEeqnarrayseprow[#1]{\relax\@ifnextchar[{\@@IEEEeqnarrayseprow[#1]}{\@@IEEEeqnarrayseprow[#1][\relax]}}
\def\@@IEEEeqnarrayseprow[#1][#2]{\def\@IEEEeqnarrayseprowARGONE{#1}%
\ifx\@IEEEeqnarrayseprowARGONE\@empty%
% get the skip value, based on the font commands
% use skip5 because \IEEEeqnarraystrutsize uses \skip0, \skip2, \skip3
% assign within a bogus box to confine the font changes
{\setbox0=\hbox{#2\relax\global\skip5=0.25\normalbaselineskip}}%
\else%
{\setbox0=\hbox{#2\relax\global\skip5=#1}}%
\fi%
\@IEEEeqnarrayhoptolastcolumn\IEEEeqnarraystrutsize{\skip5}{0pt}[\relax]\relax}
% creates a blank separator row, but omits all the column templates
% usage: \IEEEeqnarrayseprowcut[separation length][font size commands]
% default is \IEEEeqnarrayseprowcut[0.25\normalbaselineskip][\relax]
% blank arguments inherit the default values
% uses \skip5 as a scratch register - calls \@IEEEeqnarraystrutsize which uses more scratch registers
\def\IEEEeqnarrayseprowcut{\multispan{\@IEEEeqnnumcols}\relax% span all the cols
% advance column counter only if the IEEEeqnarray environment wants it
\if@advanceIEEEeqncolcnt\global\advance\@IEEEeqncolcnt by \@IEEEeqnnumcols\relax\fi%
\@ifnextchar[{\@IEEEeqnarrayseprowcut}{\@IEEEeqnarrayseprowcut[0.25\normalbaselineskip]}}
\def\@IEEEeqnarrayseprowcut[#1]{\relax\@ifnextchar[{\@@IEEEeqnarrayseprowcut[#1]}{\@@IEEEeqnarrayseprowcut[#1][\relax]}}
\def\@@IEEEeqnarrayseprowcut[#1][#2]{\def\@IEEEeqnarrayseprowARGONE{#1}%
\ifx\@IEEEeqnarrayseprowARGONE\@empty%
% get the skip value, based on the font commands
% use skip5 because \IEEEeqnarraystrutsize uses \skip0, \skip2, \skip3
% assign within a bogus box to confine the font changes
{\setbox0=\hbox{#2\relax\global\skip5=0.25\normalbaselineskip}}%
\else%
{\setbox0=\hbox{#2\relax\global\skip5=#1}}%