document/IEEEtran.cls
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Fri, 06 Sep 2013 14:55:53 +0100
changeset 15 baa2970a9687
parent 2 301f567e2a8e
permissions -rw-r--r--
some small changes according to the reviews
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
301f567e2a8e add document
chunhan
parents:
diff changeset
     1
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
     2
%% IEEEtran.cls 2007/03/05 version V1.7a
301f567e2a8e add document
chunhan
parents:
diff changeset
     3
%% 
301f567e2a8e add document
chunhan
parents:
diff changeset
     4
%% 
301f567e2a8e add document
chunhan
parents:
diff changeset
     5
%% This is the official IEEE LaTeX class for authors of the Institute of 
301f567e2a8e add document
chunhan
parents:
diff changeset
     6
%% Electrical and Electronics Engineers (IEEE) Transactions journals and
301f567e2a8e add document
chunhan
parents:
diff changeset
     7
%% conferences.
301f567e2a8e add document
chunhan
parents:
diff changeset
     8
%% 
301f567e2a8e add document
chunhan
parents:
diff changeset
     9
%% Support sites:
301f567e2a8e add document
chunhan
parents:
diff changeset
    10
%% http://www.michaelshell.org/tex/ieeetran/
301f567e2a8e add document
chunhan
parents:
diff changeset
    11
%% http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/
301f567e2a8e add document
chunhan
parents:
diff changeset
    12
%% and
301f567e2a8e add document
chunhan
parents:
diff changeset
    13
%% http://www.ieee.org/
301f567e2a8e add document
chunhan
parents:
diff changeset
    14
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
    15
%% Based on the original 1993 IEEEtran.cls, but with many bug fixes
301f567e2a8e add document
chunhan
parents:
diff changeset
    16
%% and enhancements (from both JVH and MDS) over the 1996/7 version.
301f567e2a8e add document
chunhan
parents:
diff changeset
    17
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
    18
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
    19
%% Contributors:
301f567e2a8e add document
chunhan
parents:
diff changeset
    20
%% Gerry Murray (1993), Silvano Balemi (1993),
301f567e2a8e add document
chunhan
parents:
diff changeset
    21
%% Jon Dixon (1996), Peter N"uchter (1996),
301f567e2a8e add document
chunhan
parents:
diff changeset
    22
%% Juergen von Hagen (2000), and Michael Shell (2001-2007)
301f567e2a8e add document
chunhan
parents:
diff changeset
    23
%% 
301f567e2a8e add document
chunhan
parents:
diff changeset
    24
%% 
301f567e2a8e add document
chunhan
parents:
diff changeset
    25
%% Copyright (c) 1993-2000 by Gerry Murray, Silvano Balemi, 
301f567e2a8e add document
chunhan
parents:
diff changeset
    26
%%                         Jon Dixon, Peter N"uchter,
301f567e2a8e add document
chunhan
parents:
diff changeset
    27
%%                         Juergen von Hagen
301f567e2a8e add document
chunhan
parents:
diff changeset
    28
%%                         and
301f567e2a8e add document
chunhan
parents:
diff changeset
    29
%% Copyright (c) 2001-2007 by Michael Shell
301f567e2a8e add document
chunhan
parents:
diff changeset
    30
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
    31
%% Current maintainer (V1.3 to V1.7): Michael Shell
301f567e2a8e add document
chunhan
parents:
diff changeset
    32
%%                                    See:
301f567e2a8e add document
chunhan
parents:
diff changeset
    33
%%                                    http://www.michaelshell.org/
301f567e2a8e add document
chunhan
parents:
diff changeset
    34
%%                                    for current contact information.
301f567e2a8e add document
chunhan
parents:
diff changeset
    35
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
    36
%% Special thanks to Peter Wilson (CUA) and Donald Arseneau
301f567e2a8e add document
chunhan
parents:
diff changeset
    37
%% for allowing the inclusion of the \@ifmtarg command 
301f567e2a8e add document
chunhan
parents:
diff changeset
    38
%% from their ifmtarg LaTeX package. 
301f567e2a8e add document
chunhan
parents:
diff changeset
    39
%% 
301f567e2a8e add document
chunhan
parents:
diff changeset
    40
%%*************************************************************************
301f567e2a8e add document
chunhan
parents:
diff changeset
    41
%% Legal Notice:
301f567e2a8e add document
chunhan
parents:
diff changeset
    42
%% This code is offered as-is without any warranty either expressed or
301f567e2a8e add document
chunhan
parents:
diff changeset
    43
%% implied; without even the implied warranty of MERCHANTABILITY or
301f567e2a8e add document
chunhan
parents:
diff changeset
    44
%% FITNESS FOR A PARTICULAR PURPOSE! 
301f567e2a8e add document
chunhan
parents:
diff changeset
    45
%% User assumes all risk.
301f567e2a8e add document
chunhan
parents:
diff changeset
    46
%% In no event shall IEEE or any contributor to this code be liable for
301f567e2a8e add document
chunhan
parents:
diff changeset
    47
%% any damages or losses, including, but not limited to, incidental,
301f567e2a8e add document
chunhan
parents:
diff changeset
    48
%% consequential, or any other damages, resulting from the use or misuse
301f567e2a8e add document
chunhan
parents:
diff changeset
    49
%% of any information contained here.
301f567e2a8e add document
chunhan
parents:
diff changeset
    50
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
    51
%% All comments are the opinions of their respective authors and are not
301f567e2a8e add document
chunhan
parents:
diff changeset
    52
%% necessarily endorsed by the IEEE.
301f567e2a8e add document
chunhan
parents:
diff changeset
    53
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
    54
%% This work is distributed under the LaTeX Project Public License (LPPL)
301f567e2a8e add document
chunhan
parents:
diff changeset
    55
%% ( http://www.latex-project.org/ ) version 1.3, and may be freely used,
301f567e2a8e add document
chunhan
parents:
diff changeset
    56
%% distributed and modified. A copy of the LPPL, version 1.3, is included
301f567e2a8e add document
chunhan
parents:
diff changeset
    57
%% in the base LaTeX documentation of all distributions of LaTeX released
301f567e2a8e add document
chunhan
parents:
diff changeset
    58
%% 2003/12/01 or later.
301f567e2a8e add document
chunhan
parents:
diff changeset
    59
%% Retain all contribution notices and credits.
301f567e2a8e add document
chunhan
parents:
diff changeset
    60
%% ** Modified files should be clearly indicated as such, including  **
301f567e2a8e add document
chunhan
parents:
diff changeset
    61
%% ** renaming them and changing author support contact information. **
301f567e2a8e add document
chunhan
parents:
diff changeset
    62
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
    63
%% File list of work: IEEEtran.cls, IEEEtran_HOWTO.pdf, bare_adv.tex,
301f567e2a8e add document
chunhan
parents:
diff changeset
    64
%%                    bare_conf.tex, bare_jrnl.tex, bare_jrnl_compsoc.tex
301f567e2a8e add document
chunhan
parents:
diff changeset
    65
%% 
301f567e2a8e add document
chunhan
parents:
diff changeset
    66
%% Major changes to the user interface should be indicated by an 
301f567e2a8e add document
chunhan
parents:
diff changeset
    67
%% increase in the version numbers. If a version is a beta, it will 
301f567e2a8e add document
chunhan
parents:
diff changeset
    68
%% be indicated with a BETA suffix, i.e., 1.4 BETA.
301f567e2a8e add document
chunhan
parents:
diff changeset
    69
%% Small changes can be indicated by appending letters to the version
301f567e2a8e add document
chunhan
parents:
diff changeset
    70
%% such as "IEEEtran_v14a.cls".
301f567e2a8e add document
chunhan
parents:
diff changeset
    71
%% In all cases, \Providesclass, any \typeout messages to the user,
301f567e2a8e add document
chunhan
parents:
diff changeset
    72
%% \IEEEtransversionmajor and \IEEEtransversionminor must reflect the
301f567e2a8e add document
chunhan
parents:
diff changeset
    73
%% correct version information.
301f567e2a8e add document
chunhan
parents:
diff changeset
    74
%% The changes should also be documented via source comments.
301f567e2a8e add document
chunhan
parents:
diff changeset
    75
%%*************************************************************************
301f567e2a8e add document
chunhan
parents:
diff changeset
    76
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
    77
%
301f567e2a8e add document
chunhan
parents:
diff changeset
    78
% Available class options 
301f567e2a8e add document
chunhan
parents:
diff changeset
    79
% e.g., \documentclass[10pt,conference]{IEEEtran} 
301f567e2a8e add document
chunhan
parents:
diff changeset
    80
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
    81
%             *** choose only one from each category ***
301f567e2a8e add document
chunhan
parents:
diff changeset
    82
%
301f567e2a8e add document
chunhan
parents:
diff changeset
    83
% 9pt, 10pt, 11pt, 12pt
301f567e2a8e add document
chunhan
parents:
diff changeset
    84
%    Sets normal font size. The default is 10pt.
301f567e2a8e add document
chunhan
parents:
diff changeset
    85
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
    86
% conference, journal, technote, peerreview, peerreviewca
301f567e2a8e add document
chunhan
parents:
diff changeset
    87
%    determines format mode - conference papers, journal papers,
301f567e2a8e add document
chunhan
parents:
diff changeset
    88
%    correspondence papers (technotes), or peer review papers. The user
301f567e2a8e add document
chunhan
parents:
diff changeset
    89
%    should also select 9pt when using technote. peerreview is like
301f567e2a8e add document
chunhan
parents:
diff changeset
    90
%    journal mode, but provides for a single-column "cover" title page for
301f567e2a8e add document
chunhan
parents:
diff changeset
    91
%    anonymous peer review. The paper title (without the author names) is
301f567e2a8e add document
chunhan
parents:
diff changeset
    92
%    repeated at the top of the page after the cover page. For peer review
301f567e2a8e add document
chunhan
parents:
diff changeset
    93
%    papers, the \IEEEpeerreviewmaketitle command must be executed (will
301f567e2a8e add document
chunhan
parents:
diff changeset
    94
%    automatically be ignored for non-peerreview modes) at the place the
301f567e2a8e add document
chunhan
parents:
diff changeset
    95
%    cover page is to end, usually just after the abstract (keywords are
301f567e2a8e add document
chunhan
parents:
diff changeset
    96
%    not normally used with peer review papers). peerreviewca is like
301f567e2a8e add document
chunhan
parents:
diff changeset
    97
%    peerreview, but allows the author names to be entered and formatted
301f567e2a8e add document
chunhan
parents:
diff changeset
    98
%    as with conference mode so that author affiliation and contact
301f567e2a8e add document
chunhan
parents:
diff changeset
    99
%    information can be easily seen on the cover page.
301f567e2a8e add document
chunhan
parents:
diff changeset
   100
%    The default is journal.
301f567e2a8e add document
chunhan
parents:
diff changeset
   101
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   102
% draft, draftcls, draftclsnofoot, final
301f567e2a8e add document
chunhan
parents:
diff changeset
   103
%    determines if paper is formatted as a widely spaced draft (for
301f567e2a8e add document
chunhan
parents:
diff changeset
   104
%    handwritten editor comments) or as a properly typeset final version.
301f567e2a8e add document
chunhan
parents:
diff changeset
   105
%    draftcls restricts draft mode to the class file while all other LaTeX
301f567e2a8e add document
chunhan
parents:
diff changeset
   106
%    packages (i.e., \usepackage{graphicx}) will behave as final - allows
301f567e2a8e add document
chunhan
parents:
diff changeset
   107
%    for a draft paper with visible figures, etc. draftclsnofoot is like
301f567e2a8e add document
chunhan
parents:
diff changeset
   108
%    draftcls, but does not display the date and the word "DRAFT" at the foot
301f567e2a8e add document
chunhan
parents:
diff changeset
   109
%    of the pages. If using one of the draft modes, the user will probably
301f567e2a8e add document
chunhan
parents:
diff changeset
   110
%    also want to select onecolumn.
301f567e2a8e add document
chunhan
parents:
diff changeset
   111
%    The default is final.
301f567e2a8e add document
chunhan
parents:
diff changeset
   112
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   113
% letterpaper, a4paper
301f567e2a8e add document
chunhan
parents:
diff changeset
   114
%    determines paper size: 8.5in X 11in or 210mm X 297mm. CHANGING THE PAPER
301f567e2a8e add document
chunhan
parents:
diff changeset
   115
%    SIZE WILL NOT ALTER THE TYPESETTING OF THE DOCUMENT - ONLY THE MARGINS
301f567e2a8e add document
chunhan
parents:
diff changeset
   116
%    WILL BE AFFECTED. In particular, documents using the a4paper option will
301f567e2a8e add document
chunhan
parents:
diff changeset
   117
%    have reduced side margins (A4 is narrower than US letter) and a longer
301f567e2a8e add document
chunhan
parents:
diff changeset
   118
%    bottom margin (A4 is longer than US letter). For both cases, the top
301f567e2a8e add document
chunhan
parents:
diff changeset
   119
%    margins will be the same and the text will be horizontally centered. 
301f567e2a8e add document
chunhan
parents:
diff changeset
   120
%    For final submission to IEEE, authors should use US letter (8.5 X 11in)
301f567e2a8e add document
chunhan
parents:
diff changeset
   121
%    paper. Note that authors should ensure that all post-processing 
301f567e2a8e add document
chunhan
parents:
diff changeset
   122
%    (ps, pdf, etc.) uses the same paper specificiation as the .tex document.
301f567e2a8e add document
chunhan
parents:
diff changeset
   123
%    Problems here are by far the number one reason for incorrect margins.
301f567e2a8e add document
chunhan
parents:
diff changeset
   124
%    IEEEtran will automatically set the default paper size under pdflatex 
301f567e2a8e add document
chunhan
parents:
diff changeset
   125
%    (without requiring a change to pdftex.cfg), so this issue is more
301f567e2a8e add document
chunhan
parents:
diff changeset
   126
%    important to dvips users. Fix config.ps, config.pdf, or ~/.dvipsrc for
301f567e2a8e add document
chunhan
parents:
diff changeset
   127
%    dvips, or use the dvips -t papersize option instead as needed. See the
301f567e2a8e add document
chunhan
parents:
diff changeset
   128
%    testflow documentation
301f567e2a8e add document
chunhan
parents:
diff changeset
   129
%    http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/testflow
301f567e2a8e add document
chunhan
parents:
diff changeset
   130
%    for more details on dvips paper size configuration.
301f567e2a8e add document
chunhan
parents:
diff changeset
   131
%    The default is letterpaper.
301f567e2a8e add document
chunhan
parents:
diff changeset
   132
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   133
% oneside, twoside
301f567e2a8e add document
chunhan
parents:
diff changeset
   134
%    determines if layout follows single sided or two sided (duplex)
301f567e2a8e add document
chunhan
parents:
diff changeset
   135
%    printing. The only notable change is with the headings at the top of
301f567e2a8e add document
chunhan
parents:
diff changeset
   136
%    the pages.
301f567e2a8e add document
chunhan
parents:
diff changeset
   137
%    The default is oneside.
301f567e2a8e add document
chunhan
parents:
diff changeset
   138
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   139
% onecolumn, twocolumn
301f567e2a8e add document
chunhan
parents:
diff changeset
   140
%    determines if text is organized into one or two columns per page. One
301f567e2a8e add document
chunhan
parents:
diff changeset
   141
%    column mode is usually used only with draft papers.
301f567e2a8e add document
chunhan
parents:
diff changeset
   142
%    The default is twocolumn.
301f567e2a8e add document
chunhan
parents:
diff changeset
   143
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   144
% compsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
   145
%    Use the format of the IEEE Computer Society.
301f567e2a8e add document
chunhan
parents:
diff changeset
   146
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   147
% compsocconf
301f567e2a8e add document
chunhan
parents:
diff changeset
   148
% 	Use the	format of IEEE Computer Society conferencs (CPS)
301f567e2a8e add document
chunhan
parents:
diff changeset
   149
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   150
% romanappendices
301f567e2a8e add document
chunhan
parents:
diff changeset
   151
%    Use the "Appendix I" convention when numbering appendices. IEEEtran.cls
301f567e2a8e add document
chunhan
parents:
diff changeset
   152
%    now defaults to Alpha "Appendix A" convention - the opposite of what
301f567e2a8e add document
chunhan
parents:
diff changeset
   153
%    v1.6b and earlier did.
301f567e2a8e add document
chunhan
parents:
diff changeset
   154
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   155
% captionsoff
301f567e2a8e add document
chunhan
parents:
diff changeset
   156
%    disables the display of the figure/table captions. Some IEEE journals
301f567e2a8e add document
chunhan
parents:
diff changeset
   157
%    request that captions be removed and figures/tables be put on pages
301f567e2a8e add document
chunhan
parents:
diff changeset
   158
%    of their own at the end of an initial paper submission. The endfloat
301f567e2a8e add document
chunhan
parents:
diff changeset
   159
%    package can be used with this class option to achieve this format.
301f567e2a8e add document
chunhan
parents:
diff changeset
   160
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   161
% nofonttune
301f567e2a8e add document
chunhan
parents:
diff changeset
   162
%    turns off tuning of the font interword spacing. Maybe useful to those
301f567e2a8e add document
chunhan
parents:
diff changeset
   163
%    not using the standard Times fonts or for those who have already "tuned"
301f567e2a8e add document
chunhan
parents:
diff changeset
   164
%    their fonts.
301f567e2a8e add document
chunhan
parents:
diff changeset
   165
%    The default is to enable IEEEtran to tune font parameters.
301f567e2a8e add document
chunhan
parents:
diff changeset
   166
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   167
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   168
%----------
301f567e2a8e add document
chunhan
parents:
diff changeset
   169
% Available CLASSINPUTs provided (all are macros unless otherwise noted):
301f567e2a8e add document
chunhan
parents:
diff changeset
   170
% \CLASSINPUTbaselinestretch
301f567e2a8e add document
chunhan
parents:
diff changeset
   171
% \CLASSINPUTinnersidemargin
301f567e2a8e add document
chunhan
parents:
diff changeset
   172
% \CLASSINPUToutersidemargin
301f567e2a8e add document
chunhan
parents:
diff changeset
   173
% \CLASSINPUTtoptextmargin
301f567e2a8e add document
chunhan
parents:
diff changeset
   174
% \CLASSINPUTbottomtextmargin
301f567e2a8e add document
chunhan
parents:
diff changeset
   175
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   176
% Available CLASSINFOs provided:
301f567e2a8e add document
chunhan
parents:
diff changeset
   177
% \ifCLASSINFOpdf                       (TeX if conditional)
301f567e2a8e add document
chunhan
parents:
diff changeset
   178
% \CLASSINFOpaperwidth                  (macro)
301f567e2a8e add document
chunhan
parents:
diff changeset
   179
% \CLASSINFOpaperheight                 (macro)
301f567e2a8e add document
chunhan
parents:
diff changeset
   180
% \CLASSINFOnormalsizebaselineskip      (length)
301f567e2a8e add document
chunhan
parents:
diff changeset
   181
% \CLASSINFOnormalsizeunitybaselineskip (length)
301f567e2a8e add document
chunhan
parents:
diff changeset
   182
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   183
% Available CLASSOPTIONs provided:
301f567e2a8e add document
chunhan
parents:
diff changeset
   184
% all class option flags (TeX if conditionals) unless otherwise noted,
301f567e2a8e add document
chunhan
parents:
diff changeset
   185
% e.g., \ifCLASSOPTIONcaptionsoff
301f567e2a8e add document
chunhan
parents:
diff changeset
   186
% point size options provided as a single macro:
301f567e2a8e add document
chunhan
parents:
diff changeset
   187
% \CLASSOPTIONpt
301f567e2a8e add document
chunhan
parents:
diff changeset
   188
% which will be defined as 9, 10, 11, or 12 depending on the document's
301f567e2a8e add document
chunhan
parents:
diff changeset
   189
% normalsize point size.
301f567e2a8e add document
chunhan
parents:
diff changeset
   190
% also, class option peerreviewca implies the use of class option peerreview
301f567e2a8e add document
chunhan
parents:
diff changeset
   191
% and classoption draft implies the use of class option draftcls
301f567e2a8e add document
chunhan
parents:
diff changeset
   192
301f567e2a8e add document
chunhan
parents:
diff changeset
   193
301f567e2a8e add document
chunhan
parents:
diff changeset
   194
301f567e2a8e add document
chunhan
parents:
diff changeset
   195
301f567e2a8e add document
chunhan
parents:
diff changeset
   196
301f567e2a8e add document
chunhan
parents:
diff changeset
   197
\ProvidesClass{IEEEtran}[2007/03/05 V1.7a by Michael Shell]
301f567e2a8e add document
chunhan
parents:
diff changeset
   198
\typeout{-- See the "IEEEtran_HOWTO" manual for usage information.}
301f567e2a8e add document
chunhan
parents:
diff changeset
   199
\typeout{-- http://www.michaelshell.org/tex/ieeetran/}
301f567e2a8e add document
chunhan
parents:
diff changeset
   200
\NeedsTeXFormat{LaTeX2e}
301f567e2a8e add document
chunhan
parents:
diff changeset
   201
301f567e2a8e add document
chunhan
parents:
diff changeset
   202
% IEEEtran.cls version numbers, provided as of V1.3
301f567e2a8e add document
chunhan
parents:
diff changeset
   203
% These values serve as a way a .tex file can
301f567e2a8e add document
chunhan
parents:
diff changeset
   204
% determine if the new features are provided.
301f567e2a8e add document
chunhan
parents:
diff changeset
   205
% The version number of this IEEEtrans.cls can be obtained from 
301f567e2a8e add document
chunhan
parents:
diff changeset
   206
% these values. i.e., V1.4
301f567e2a8e add document
chunhan
parents:
diff changeset
   207
% KEEP THESE AS INTEGERS! i.e., NO {4a} or anything like that-
301f567e2a8e add document
chunhan
parents:
diff changeset
   208
% (no need to enumerate "a" minor changes here)
301f567e2a8e add document
chunhan
parents:
diff changeset
   209
\def\IEEEtransversionmajor{1}
301f567e2a8e add document
chunhan
parents:
diff changeset
   210
\def\IEEEtransversionminor{7}
301f567e2a8e add document
chunhan
parents:
diff changeset
   211
301f567e2a8e add document
chunhan
parents:
diff changeset
   212
% These do nothing, but provide them like in article.cls
301f567e2a8e add document
chunhan
parents:
diff changeset
   213
\newif\if@restonecol
301f567e2a8e add document
chunhan
parents:
diff changeset
   214
\newif\if@titlepage
301f567e2a8e add document
chunhan
parents:
diff changeset
   215
301f567e2a8e add document
chunhan
parents:
diff changeset
   216
301f567e2a8e add document
chunhan
parents:
diff changeset
   217
% class option conditionals
301f567e2a8e add document
chunhan
parents:
diff changeset
   218
\newif\ifCLASSOPTIONonecolumn       \CLASSOPTIONonecolumnfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   219
\newif\ifCLASSOPTIONtwocolumn       \CLASSOPTIONtwocolumntrue
301f567e2a8e add document
chunhan
parents:
diff changeset
   220
301f567e2a8e add document
chunhan
parents:
diff changeset
   221
\newif\ifCLASSOPTIONoneside         \CLASSOPTIONonesidetrue
301f567e2a8e add document
chunhan
parents:
diff changeset
   222
\newif\ifCLASSOPTIONtwoside         \CLASSOPTIONtwosidefalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   223
301f567e2a8e add document
chunhan
parents:
diff changeset
   224
\newif\ifCLASSOPTIONfinal           \CLASSOPTIONfinaltrue
301f567e2a8e add document
chunhan
parents:
diff changeset
   225
\newif\ifCLASSOPTIONdraft           \CLASSOPTIONdraftfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   226
\newif\ifCLASSOPTIONdraftcls        \CLASSOPTIONdraftclsfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   227
\newif\ifCLASSOPTIONdraftclsnofoot  \CLASSOPTIONdraftclsnofootfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   228
301f567e2a8e add document
chunhan
parents:
diff changeset
   229
\newif\ifCLASSOPTIONpeerreview      \CLASSOPTIONpeerreviewfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   230
\newif\ifCLASSOPTIONpeerreviewca    \CLASSOPTIONpeerreviewcafalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   231
301f567e2a8e add document
chunhan
parents:
diff changeset
   232
\newif\ifCLASSOPTIONjournal         \CLASSOPTIONjournaltrue
301f567e2a8e add document
chunhan
parents:
diff changeset
   233
\newif\ifCLASSOPTIONconference      \CLASSOPTIONconferencefalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   234
\newif\ifCLASSOPTIONtechnote        \CLASSOPTIONtechnotefalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   235
301f567e2a8e add document
chunhan
parents:
diff changeset
   236
\newif\ifCLASSOPTIONnofonttune      \CLASSOPTIONnofonttunefalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   237
301f567e2a8e add document
chunhan
parents:
diff changeset
   238
\newif\ifCLASSOPTIONcaptionsoff     \CLASSOPTIONcaptionsofffalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   239
301f567e2a8e add document
chunhan
parents:
diff changeset
   240
\newif\ifCLASSOPTIONcompsoc         \CLASSOPTIONcompsocfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   241
301f567e2a8e add document
chunhan
parents:
diff changeset
   242
\newif\ifCLASSOPTIONcompsocconf     \CLASSOPTIONcompsocconffalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   243
301f567e2a8e add document
chunhan
parents:
diff changeset
   244
\newif\ifCLASSOPTIONromanappendices \CLASSOPTIONromanappendicesfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   245
301f567e2a8e add document
chunhan
parents:
diff changeset
   246
301f567e2a8e add document
chunhan
parents:
diff changeset
   247
% class info conditionals
301f567e2a8e add document
chunhan
parents:
diff changeset
   248
301f567e2a8e add document
chunhan
parents:
diff changeset
   249
% indicates if pdf (via pdflatex) output
301f567e2a8e add document
chunhan
parents:
diff changeset
   250
\newif\ifCLASSINFOpdf               \CLASSINFOpdffalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   251
301f567e2a8e add document
chunhan
parents:
diff changeset
   252
301f567e2a8e add document
chunhan
parents:
diff changeset
   253
% V1.6b internal flag to show if using a4paper
301f567e2a8e add document
chunhan
parents:
diff changeset
   254
\newif\if@IEEEusingAfourpaper       \@IEEEusingAfourpaperfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   255
301f567e2a8e add document
chunhan
parents:
diff changeset
   256
301f567e2a8e add document
chunhan
parents:
diff changeset
   257
301f567e2a8e add document
chunhan
parents:
diff changeset
   258
% IEEEtran class scratch pad registers
301f567e2a8e add document
chunhan
parents:
diff changeset
   259
% dimen
301f567e2a8e add document
chunhan
parents:
diff changeset
   260
\newdimen\@IEEEtrantmpdimenA
301f567e2a8e add document
chunhan
parents:
diff changeset
   261
\newdimen\@IEEEtrantmpdimenB
301f567e2a8e add document
chunhan
parents:
diff changeset
   262
% count
301f567e2a8e add document
chunhan
parents:
diff changeset
   263
\newcount\@IEEEtrantmpcountA
301f567e2a8e add document
chunhan
parents:
diff changeset
   264
\newcount\@IEEEtrantmpcountB
301f567e2a8e add document
chunhan
parents:
diff changeset
   265
% token list
301f567e2a8e add document
chunhan
parents:
diff changeset
   266
\newtoks\@IEEEtrantmptoksA
301f567e2a8e add document
chunhan
parents:
diff changeset
   267
301f567e2a8e add document
chunhan
parents:
diff changeset
   268
% we use \CLASSOPTIONpt so that we can ID the point size (even for 9pt docs)
301f567e2a8e add document
chunhan
parents:
diff changeset
   269
% as well as LaTeX's \@ptsize to retain some compatability with some
301f567e2a8e add document
chunhan
parents:
diff changeset
   270
% external packages
301f567e2a8e add document
chunhan
parents:
diff changeset
   271
\def\@ptsize{0}
301f567e2a8e add document
chunhan
parents:
diff changeset
   272
% LaTeX does not support 9pt, so we set \@ptsize to 0 - same as that of 10pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   273
\DeclareOption{9pt}{\def\CLASSOPTIONpt{9}\def\@ptsize{0}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   274
\DeclareOption{10pt}{\def\CLASSOPTIONpt{10}\def\@ptsize{0}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   275
\DeclareOption{11pt}{\def\CLASSOPTIONpt{11}\def\@ptsize{1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   276
\DeclareOption{12pt}{\def\CLASSOPTIONpt{12}\def\@ptsize{2}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   277
301f567e2a8e add document
chunhan
parents:
diff changeset
   278
301f567e2a8e add document
chunhan
parents:
diff changeset
   279
301f567e2a8e add document
chunhan
parents:
diff changeset
   280
\DeclareOption{letterpaper}{\setlength{\paperheight}{11in}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   281
                            \setlength{\paperwidth}{8.5in}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   282
                            \@IEEEusingAfourpaperfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   283
                            \def\CLASSOPTIONpaper{letter}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   284
                            \def\CLASSINFOpaperwidth{8.5in}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   285
                            \def\CLASSINFOpaperheight{11in}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   286
301f567e2a8e add document
chunhan
parents:
diff changeset
   287
301f567e2a8e add document
chunhan
parents:
diff changeset
   288
\DeclareOption{a4paper}{\setlength{\paperheight}{297mm}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   289
                        \setlength{\paperwidth}{210mm}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   290
                        \@IEEEusingAfourpapertrue
301f567e2a8e add document
chunhan
parents:
diff changeset
   291
                        \def\CLASSOPTIONpaper{a4}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   292
                        \def\CLASSINFOpaperwidth{210mm}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   293
                        \def\CLASSINFOpaperheight{297mm}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   294
301f567e2a8e add document
chunhan
parents:
diff changeset
   295
\DeclareOption{oneside}{\@twosidefalse\@mparswitchfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   296
                        \CLASSOPTIONonesidetrue\CLASSOPTIONtwosidefalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
   297
\DeclareOption{twoside}{\@twosidetrue\@mparswitchtrue
301f567e2a8e add document
chunhan
parents:
diff changeset
   298
                        \CLASSOPTIONtwosidetrue\CLASSOPTIONonesidefalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
   299
301f567e2a8e add document
chunhan
parents:
diff changeset
   300
\DeclareOption{onecolumn}{\CLASSOPTIONonecolumntrue\CLASSOPTIONtwocolumnfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
   301
\DeclareOption{twocolumn}{\CLASSOPTIONtwocolumntrue\CLASSOPTIONonecolumnfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
   302
301f567e2a8e add document
chunhan
parents:
diff changeset
   303
% If the user selects draft, then this class AND any packages
301f567e2a8e add document
chunhan
parents:
diff changeset
   304
% will go into draft mode.
301f567e2a8e add document
chunhan
parents:
diff changeset
   305
\DeclareOption{draft}{\CLASSOPTIONdrafttrue\CLASSOPTIONdraftclstrue
301f567e2a8e add document
chunhan
parents:
diff changeset
   306
                      \CLASSOPTIONdraftclsnofootfalse} 
301f567e2a8e add document
chunhan
parents:
diff changeset
   307
% draftcls is for a draft mode which will not affect any packages
301f567e2a8e add document
chunhan
parents:
diff changeset
   308
% used by the document.
301f567e2a8e add document
chunhan
parents:
diff changeset
   309
\DeclareOption{draftcls}{\CLASSOPTIONdraftfalse\CLASSOPTIONdraftclstrue
301f567e2a8e add document
chunhan
parents:
diff changeset
   310
                         \CLASSOPTIONdraftclsnofootfalse} 
301f567e2a8e add document
chunhan
parents:
diff changeset
   311
% draftclsnofoot is like draftcls, but without the footer.
301f567e2a8e add document
chunhan
parents:
diff changeset
   312
\DeclareOption{draftclsnofoot}{\CLASSOPTIONdraftfalse\CLASSOPTIONdraftclstrue
301f567e2a8e add document
chunhan
parents:
diff changeset
   313
                               \CLASSOPTIONdraftclsnofoottrue} 
301f567e2a8e add document
chunhan
parents:
diff changeset
   314
\DeclareOption{final}{\CLASSOPTIONdraftfalse\CLASSOPTIONdraftclsfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   315
                      \CLASSOPTIONdraftclsnofootfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
   316
301f567e2a8e add document
chunhan
parents:
diff changeset
   317
\DeclareOption{journal}{\CLASSOPTIONpeerreviewfalse\CLASSOPTIONpeerreviewcafalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   318
                        \CLASSOPTIONjournaltrue\CLASSOPTIONconferencefalse\CLASSOPTIONtechnotefalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
   319
301f567e2a8e add document
chunhan
parents:
diff changeset
   320
\DeclareOption{conference}{\CLASSOPTIONpeerreviewfalse\CLASSOPTIONpeerreviewcafalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   321
                           \CLASSOPTIONjournalfalse\CLASSOPTIONconferencetrue\CLASSOPTIONtechnotefalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
   322
301f567e2a8e add document
chunhan
parents:
diff changeset
   323
\DeclareOption{technote}{\CLASSOPTIONpeerreviewfalse\CLASSOPTIONpeerreviewcafalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   324
                         \CLASSOPTIONjournalfalse\CLASSOPTIONconferencefalse\CLASSOPTIONtechnotetrue}
301f567e2a8e add document
chunhan
parents:
diff changeset
   325
301f567e2a8e add document
chunhan
parents:
diff changeset
   326
\DeclareOption{peerreview}{\CLASSOPTIONpeerreviewtrue\CLASSOPTIONpeerreviewcafalse
301f567e2a8e add document
chunhan
parents:
diff changeset
   327
                           \CLASSOPTIONjournalfalse\CLASSOPTIONconferencefalse\CLASSOPTIONtechnotefalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
   328
301f567e2a8e add document
chunhan
parents:
diff changeset
   329
\DeclareOption{peerreviewca}{\CLASSOPTIONpeerreviewtrue\CLASSOPTIONpeerreviewcatrue
301f567e2a8e add document
chunhan
parents:
diff changeset
   330
                             \CLASSOPTIONjournalfalse\CLASSOPTIONconferencefalse\CLASSOPTIONtechnotefalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
   331
301f567e2a8e add document
chunhan
parents:
diff changeset
   332
\DeclareOption{nofonttune}{\CLASSOPTIONnofonttunetrue}
301f567e2a8e add document
chunhan
parents:
diff changeset
   333
301f567e2a8e add document
chunhan
parents:
diff changeset
   334
\DeclareOption{captionsoff}{\CLASSOPTIONcaptionsofftrue}
301f567e2a8e add document
chunhan
parents:
diff changeset
   335
301f567e2a8e add document
chunhan
parents:
diff changeset
   336
\DeclareOption{compsoc}{\CLASSOPTIONcompsoctrue}
301f567e2a8e add document
chunhan
parents:
diff changeset
   337
301f567e2a8e add document
chunhan
parents:
diff changeset
   338
\DeclareOption{compsocconf}{\CLASSOPTIONcompsocconftrue}
301f567e2a8e add document
chunhan
parents:
diff changeset
   339
301f567e2a8e add document
chunhan
parents:
diff changeset
   340
\DeclareOption{romanappendices}{\CLASSOPTIONromanappendicestrue}
301f567e2a8e add document
chunhan
parents:
diff changeset
   341
301f567e2a8e add document
chunhan
parents:
diff changeset
   342
301f567e2a8e add document
chunhan
parents:
diff changeset
   343
% default to US letter paper, 10pt, twocolumn, one sided, final, journal
301f567e2a8e add document
chunhan
parents:
diff changeset
   344
\ExecuteOptions{letterpaper,10pt,twocolumn,oneside,final,journal}
301f567e2a8e add document
chunhan
parents:
diff changeset
   345
% overrride these defaults per user requests
301f567e2a8e add document
chunhan
parents:
diff changeset
   346
\ProcessOptions
301f567e2a8e add document
chunhan
parents:
diff changeset
   347
301f567e2a8e add document
chunhan
parents:
diff changeset
   348
301f567e2a8e add document
chunhan
parents:
diff changeset
   349
301f567e2a8e add document
chunhan
parents:
diff changeset
   350
% Computer Society conditional execution command
301f567e2a8e add document
chunhan
parents:
diff changeset
   351
\long\def\@IEEEcompsoconly#1{\relax\ifCLASSOPTIONcompsoc\relax#1\relax\fi\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
   352
% inverse
301f567e2a8e add document
chunhan
parents:
diff changeset
   353
\long\def\@IEEEnotcompsoconly#1{\relax\ifCLASSOPTIONcompsoc\else\relax#1\relax\fi\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
   354
% compsoc conference
301f567e2a8e add document
chunhan
parents:
diff changeset
   355
\long\def\@IEEEcompsocconfonly#1{\relax\ifCLASSOPTIONcompsocconf\ifCLASSOPTIONconference\relax#1\relax\fi\fi\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
   356
% compsoc not conference
301f567e2a8e add document
chunhan
parents:
diff changeset
   357
\long\def\@IEEEcompsocnotconfonly#1{\relax\ifCLASSOPTIONcompsoc\ifCLASSOPTIONconference\else\relax#1\relax\fi\fi\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
   358
301f567e2a8e add document
chunhan
parents:
diff changeset
   359
301f567e2a8e add document
chunhan
parents:
diff changeset
   360
% IEEE uses Times Roman font, so we'll default to Times.
301f567e2a8e add document
chunhan
parents:
diff changeset
   361
% These three commands make up the entire times.sty package.
301f567e2a8e add document
chunhan
parents:
diff changeset
   362
\renewcommand{\sfdefault}{phv}
301f567e2a8e add document
chunhan
parents:
diff changeset
   363
\renewcommand{\rmdefault}{ptm}
301f567e2a8e add document
chunhan
parents:
diff changeset
   364
\renewcommand{\ttdefault}{pcr}
301f567e2a8e add document
chunhan
parents:
diff changeset
   365
301f567e2a8e add document
chunhan
parents:
diff changeset
   366
\@IEEEcompsoconly{\typeout{-- Using IEEE Computer Society mode.}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   367
301f567e2a8e add document
chunhan
parents:
diff changeset
   368
% V1.7 compsoc nonconference papers, use Palatino/Palladio as the main text font,
301f567e2a8e add document
chunhan
parents:
diff changeset
   369
% not Times Roman.
301f567e2a8e add document
chunhan
parents:
diff changeset
   370
\@IEEEcompsocnotconfonly{\renewcommand{\rmdefault}{ppl}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   371
301f567e2a8e add document
chunhan
parents:
diff changeset
   372
% enable Times/Palatino main text font
301f567e2a8e add document
chunhan
parents:
diff changeset
   373
\normalfont\selectfont
301f567e2a8e add document
chunhan
parents:
diff changeset
   374
301f567e2a8e add document
chunhan
parents:
diff changeset
   375
301f567e2a8e add document
chunhan
parents:
diff changeset
   376
301f567e2a8e add document
chunhan
parents:
diff changeset
   377
301f567e2a8e add document
chunhan
parents:
diff changeset
   378
301f567e2a8e add document
chunhan
parents:
diff changeset
   379
% V1.7 conference notice message hook
301f567e2a8e add document
chunhan
parents:
diff changeset
   380
\def\@IEEEconsolenoticeconference{\typeout{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   381
\typeout{** Conference Paper **}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   382
\typeout{Before submitting the final camera ready copy, remember to:}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   383
\typeout{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   384
\typeout{ 1. Manually equalize the lengths of two columns on the last page}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   385
\typeout{ of your paper;}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   386
\typeout{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   387
\typeout{ 2. Ensure that any PostScript and/or PDF output post-processing}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   388
\typeout{ uses only Type 1 fonts and that every step in the generation}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   389
\typeout{ process uses the appropriate paper size.}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   390
\typeout{}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   391
301f567e2a8e add document
chunhan
parents:
diff changeset
   392
301f567e2a8e add document
chunhan
parents:
diff changeset
   393
% we can send console reminder messages to the user here
301f567e2a8e add document
chunhan
parents:
diff changeset
   394
\AtEndDocument{\ifCLASSOPTIONconference\@IEEEconsolenoticeconference\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
   395
301f567e2a8e add document
chunhan
parents:
diff changeset
   396
301f567e2a8e add document
chunhan
parents:
diff changeset
   397
% warn about the use of single column other than for draft mode
301f567e2a8e add document
chunhan
parents:
diff changeset
   398
\ifCLASSOPTIONtwocolumn\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
   399
  \ifCLASSOPTIONdraftcls\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
   400
   \typeout{** ATTENTION: Single column mode is not typically used with IEEE publications.}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   401
  \fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
   402
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   403
301f567e2a8e add document
chunhan
parents:
diff changeset
   404
301f567e2a8e add document
chunhan
parents:
diff changeset
   405
% V1.7 improved paper size setting code.
301f567e2a8e add document
chunhan
parents:
diff changeset
   406
% Set pdfpage and dvips paper sizes. Conditional tests are similar to that
301f567e2a8e add document
chunhan
parents:
diff changeset
   407
% of ifpdf.sty. Retain within {} to ensure tested macros are never altered,
301f567e2a8e add document
chunhan
parents:
diff changeset
   408
% even if only effect is to set them to \relax.
301f567e2a8e add document
chunhan
parents:
diff changeset
   409
% if \pdfoutput is undefined or equal to relax, output a dvips special
301f567e2a8e add document
chunhan
parents:
diff changeset
   410
{\@ifundefined{pdfoutput}{\AtBeginDvi{\special{papersize=\CLASSINFOpaperwidth,\CLASSINFOpaperheight}}}{%
301f567e2a8e add document
chunhan
parents:
diff changeset
   411
% pdfoutput is defined and not equal to \relax
301f567e2a8e add document
chunhan
parents:
diff changeset
   412
% check for pdfpageheight existence just in case someone sets pdfoutput
301f567e2a8e add document
chunhan
parents:
diff changeset
   413
% under non-pdflatex. If exists, set them regardless of value of \pdfoutput.
301f567e2a8e add document
chunhan
parents:
diff changeset
   414
\@ifundefined{pdfpageheight}{\relax}{\global\pdfpagewidth\paperwidth
301f567e2a8e add document
chunhan
parents:
diff changeset
   415
\global\pdfpageheight\paperheight}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   416
% if using \pdfoutput=0 under pdflatex, send dvips papersize special
301f567e2a8e add document
chunhan
parents:
diff changeset
   417
\ifcase\pdfoutput
301f567e2a8e add document
chunhan
parents:
diff changeset
   418
\AtBeginDvi{\special{papersize=\CLASSINFOpaperwidth,\CLASSINFOpaperheight}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   419
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   420
% we are using pdf output, set CLASSINFOpdf flag
301f567e2a8e add document
chunhan
parents:
diff changeset
   421
\global\CLASSINFOpdftrue
301f567e2a8e add document
chunhan
parents:
diff changeset
   422
\fi}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   423
301f567e2a8e add document
chunhan
parents:
diff changeset
   424
% let the user know the selected papersize
301f567e2a8e add document
chunhan
parents:
diff changeset
   425
\typeout{-- Using \CLASSINFOpaperwidth\space x \CLASSINFOpaperheight\space
301f567e2a8e add document
chunhan
parents:
diff changeset
   426
(\CLASSOPTIONpaper)\space paper.}
301f567e2a8e add document
chunhan
parents:
diff changeset
   427
301f567e2a8e add document
chunhan
parents:
diff changeset
   428
\ifCLASSINFOpdf
301f567e2a8e add document
chunhan
parents:
diff changeset
   429
\typeout{-- Using PDF output.}
301f567e2a8e add document
chunhan
parents:
diff changeset
   430
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   431
\typeout{-- Using DVI output.}
301f567e2a8e add document
chunhan
parents:
diff changeset
   432
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   433
301f567e2a8e add document
chunhan
parents:
diff changeset
   434
301f567e2a8e add document
chunhan
parents:
diff changeset
   435
% The idea hinted here is for LaTeX to generate markleft{} and markright{}
301f567e2a8e add document
chunhan
parents:
diff changeset
   436
% automatically for you after you enter \author{}, \journal{},
301f567e2a8e add document
chunhan
parents:
diff changeset
   437
% \journaldate{}, journalvol{}, \journalnum{}, etc.
301f567e2a8e add document
chunhan
parents:
diff changeset
   438
% However, there may be some backward compatibility issues here as
301f567e2a8e add document
chunhan
parents:
diff changeset
   439
% well as some special applications for IEEEtran.cls and special issues
301f567e2a8e add document
chunhan
parents:
diff changeset
   440
% that may require the flexible \markleft{}, \markright{} and/or \markboth{}.
301f567e2a8e add document
chunhan
parents:
diff changeset
   441
% We'll leave this as an open future suggestion.
301f567e2a8e add document
chunhan
parents:
diff changeset
   442
%\newcommand{\journal}[1]{\def\@journal{#1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   443
%\def\@journal{}
301f567e2a8e add document
chunhan
parents:
diff changeset
   444
301f567e2a8e add document
chunhan
parents:
diff changeset
   445
301f567e2a8e add document
chunhan
parents:
diff changeset
   446
301f567e2a8e add document
chunhan
parents:
diff changeset
   447
% pointsize values
301f567e2a8e add document
chunhan
parents:
diff changeset
   448
% used with ifx to determine the document's normal size
301f567e2a8e add document
chunhan
parents:
diff changeset
   449
\def\@IEEEptsizenine{9}
301f567e2a8e add document
chunhan
parents:
diff changeset
   450
\def\@IEEEptsizeten{10}
301f567e2a8e add document
chunhan
parents:
diff changeset
   451
\def\@IEEEptsizeeleven{11}
301f567e2a8e add document
chunhan
parents:
diff changeset
   452
\def\@IEEEptsizetwelve{12}
301f567e2a8e add document
chunhan
parents:
diff changeset
   453
301f567e2a8e add document
chunhan
parents:
diff changeset
   454
301f567e2a8e add document
chunhan
parents:
diff changeset
   455
301f567e2a8e add document
chunhan
parents:
diff changeset
   456
% FONT DEFINITIONS (No sizexx.clo file needed) 
301f567e2a8e add document
chunhan
parents:
diff changeset
   457
% V1.6 revised font sizes, displayskip values and
301f567e2a8e add document
chunhan
parents:
diff changeset
   458
%      revised normalsize baselineskip to reduce underfull vbox problems
301f567e2a8e add document
chunhan
parents:
diff changeset
   459
%      on the 58pc = 696pt = 9.5in text height we want
301f567e2a8e add document
chunhan
parents:
diff changeset
   460
%      normalsize     #lines/column  baselineskip (aka leading)
301f567e2a8e add document
chunhan
parents:
diff changeset
   461
%             9pt     63             11.0476pt (truncated down)
301f567e2a8e add document
chunhan
parents:
diff changeset
   462
%            10pt     58             12pt      (exact)
301f567e2a8e add document
chunhan
parents:
diff changeset
   463
%            11pt     52             13.3846pt (truncated down)
301f567e2a8e add document
chunhan
parents:
diff changeset
   464
%            12pt     50             13.92pt   (exact)
301f567e2a8e add document
chunhan
parents:
diff changeset
   465
%
301f567e2a8e add document
chunhan
parents:
diff changeset
   466
301f567e2a8e add document
chunhan
parents:
diff changeset
   467
% we need to store the nominal baselineskip for the given font size
301f567e2a8e add document
chunhan
parents:
diff changeset
   468
% in case baselinestretch ever changes.
301f567e2a8e add document
chunhan
parents:
diff changeset
   469
% this is a dimen, so it will not hold stretch or shrink
301f567e2a8e add document
chunhan
parents:
diff changeset
   470
\newdimen\@IEEEnormalsizeunitybaselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
   471
\@IEEEnormalsizeunitybaselineskip\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
   472
301f567e2a8e add document
chunhan
parents:
diff changeset
   473
\ifx\CLASSOPTIONpt\@IEEEptsizenine
301f567e2a8e add document
chunhan
parents:
diff changeset
   474
\typeout{-- This is a 9 point document.}
301f567e2a8e add document
chunhan
parents:
diff changeset
   475
\def\normalsize{\@setfontsize{\normalsize}{9}{11.0476pt}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   476
\setlength{\@IEEEnormalsizeunitybaselineskip}{11.0476pt}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   477
\normalsize
301f567e2a8e add document
chunhan
parents:
diff changeset
   478
\abovedisplayskip 1.5ex plus3pt minus1pt%
301f567e2a8e add document
chunhan
parents:
diff changeset
   479
\belowdisplayskip \abovedisplayskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
   480
\abovedisplayshortskip 0pt plus3pt%
301f567e2a8e add document
chunhan
parents:
diff changeset
   481
\belowdisplayshortskip 1.5ex plus3pt minus1pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   482
\def\small{\@setfontsize{\small}{8.5}{10pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   483
\def\footnotesize{\@setfontsize{\footnotesize}{8}{9pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   484
\def\scriptsize{\@setfontsize{\scriptsize}{7}{8pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   485
\def\tiny{\@setfontsize{\tiny}{5}{6pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   486
% sublargesize is the same as large - 10pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   487
\def\sublargesize{\@setfontsize{\sublargesize}{10}{12pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   488
\def\large{\@setfontsize{\large}{10}{12pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   489
\def\Large{\@setfontsize{\Large}{12}{14pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   490
\def\LARGE{\@setfontsize{\LARGE}{14}{17pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   491
\def\huge{\@setfontsize{\huge}{17}{20pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   492
\def\Huge{\@setfontsize{\Huge}{20}{24pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   493
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   494
301f567e2a8e add document
chunhan
parents:
diff changeset
   495
301f567e2a8e add document
chunhan
parents:
diff changeset
   496
% Check if we have selected 10 points
301f567e2a8e add document
chunhan
parents:
diff changeset
   497
\ifx\CLASSOPTIONpt\@IEEEptsizeten
301f567e2a8e add document
chunhan
parents:
diff changeset
   498
\typeout{-- This is a 10 point document.}
301f567e2a8e add document
chunhan
parents:
diff changeset
   499
\def\normalsize{\@setfontsize{\normalsize}{10}{12.00pt}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   500
\setlength{\@IEEEnormalsizeunitybaselineskip}{12pt}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   501
\normalsize
301f567e2a8e add document
chunhan
parents:
diff changeset
   502
\abovedisplayskip 1.5ex plus4pt minus2pt%
301f567e2a8e add document
chunhan
parents:
diff changeset
   503
\belowdisplayskip \abovedisplayskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
   504
\abovedisplayshortskip 0pt plus4pt%
301f567e2a8e add document
chunhan
parents:
diff changeset
   505
\belowdisplayshortskip 1.5ex plus4pt minus2pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   506
\def\small{\@setfontsize{\small}{9}{10pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   507
\def\footnotesize{\@setfontsize{\footnotesize}{8}{9pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   508
\def\scriptsize{\@setfontsize{\scriptsize}{7}{8pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   509
\def\tiny{\@setfontsize{\tiny}{5}{6pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   510
% sublargesize is a tad smaller than large - 11pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   511
\def\sublargesize{\@setfontsize{\sublargesize}{11}{13.4pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   512
\def\large{\@setfontsize{\large}{12}{14pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   513
\def\Large{\@setfontsize{\Large}{14}{17pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   514
\def\LARGE{\@setfontsize{\LARGE}{17}{20pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   515
\def\huge{\@setfontsize{\huge}{20}{24pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   516
\def\Huge{\@setfontsize{\Huge}{24}{28pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   517
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   518
301f567e2a8e add document
chunhan
parents:
diff changeset
   519
301f567e2a8e add document
chunhan
parents:
diff changeset
   520
% Check if we have selected 11 points
301f567e2a8e add document
chunhan
parents:
diff changeset
   521
\ifx\CLASSOPTIONpt\@IEEEptsizeeleven
301f567e2a8e add document
chunhan
parents:
diff changeset
   522
\typeout{-- This is an 11 point document.}
301f567e2a8e add document
chunhan
parents:
diff changeset
   523
\def\normalsize{\@setfontsize{\normalsize}{11}{13.3846pt}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   524
\setlength{\@IEEEnormalsizeunitybaselineskip}{13.3846pt}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   525
\normalsize
301f567e2a8e add document
chunhan
parents:
diff changeset
   526
\abovedisplayskip 1.5ex plus5pt minus3pt%
301f567e2a8e add document
chunhan
parents:
diff changeset
   527
\belowdisplayskip \abovedisplayskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
   528
\abovedisplayshortskip 0pt plus5pt%
301f567e2a8e add document
chunhan
parents:
diff changeset
   529
\belowdisplayshortskip 1.5ex plus5pt minus3pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   530
\def\small{\@setfontsize{\small}{10}{12pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   531
\def\footnotesize{\@setfontsize{\footnotesize}{9}{10.5pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   532
\def\scriptsize{\@setfontsize{\scriptsize}{8}{9pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   533
\def\tiny{\@setfontsize{\tiny}{6}{7pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   534
% sublargesize is the same as large - 12pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   535
\def\sublargesize{\@setfontsize{\sublargesize}{12}{14pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   536
\def\large{\@setfontsize{\large}{12}{14pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   537
\def\Large{\@setfontsize{\Large}{14}{17pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   538
\def\LARGE{\@setfontsize{\LARGE}{17}{20pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   539
\def\huge{\@setfontsize{\huge}{20}{24pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   540
\def\Huge{\@setfontsize{\Huge}{24}{28pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   541
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   542
301f567e2a8e add document
chunhan
parents:
diff changeset
   543
301f567e2a8e add document
chunhan
parents:
diff changeset
   544
% Check if we have selected 12 points
301f567e2a8e add document
chunhan
parents:
diff changeset
   545
\ifx\CLASSOPTIONpt\@IEEEptsizetwelve
301f567e2a8e add document
chunhan
parents:
diff changeset
   546
\typeout{-- This is a 12 point document.}
301f567e2a8e add document
chunhan
parents:
diff changeset
   547
\def\normalsize{\@setfontsize{\normalsize}{12}{13.92pt}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   548
\setlength{\@IEEEnormalsizeunitybaselineskip}{13.92pt}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   549
\normalsize
301f567e2a8e add document
chunhan
parents:
diff changeset
   550
\abovedisplayskip 1.5ex plus6pt minus4pt%
301f567e2a8e add document
chunhan
parents:
diff changeset
   551
\belowdisplayskip \abovedisplayskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
   552
\abovedisplayshortskip 0pt plus6pt%
301f567e2a8e add document
chunhan
parents:
diff changeset
   553
\belowdisplayshortskip 1.5ex plus6pt minus4pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   554
\def\small{\@setfontsize{\small}{10}{12pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   555
\def\footnotesize{\@setfontsize{\footnotesize}{9}{10.5pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   556
\def\scriptsize{\@setfontsize{\scriptsize}{8}{9pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   557
\def\tiny{\@setfontsize{\tiny}{6}{7pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   558
% sublargesize is the same as large - 14pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   559
\def\sublargesize{\@setfontsize{\sublargesize}{14}{17pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   560
\def\large{\@setfontsize{\large}{14}{17pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   561
\def\Large{\@setfontsize{\Large}{17}{20pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   562
\def\LARGE{\@setfontsize{\LARGE}{20}{24pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   563
\def\huge{\@setfontsize{\huge}{22}{26pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   564
\def\Huge{\@setfontsize{\Huge}{24}{28pt}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   565
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   566
301f567e2a8e add document
chunhan
parents:
diff changeset
   567
301f567e2a8e add document
chunhan
parents:
diff changeset
   568
% V1.6 The Computer Modern Fonts will issue a substitution warning for
301f567e2a8e add document
chunhan
parents:
diff changeset
   569
% 24pt titles (24.88pt is used instead) increase the substitution
301f567e2a8e add document
chunhan
parents:
diff changeset
   570
% tolerance to turn off this warning
301f567e2a8e add document
chunhan
parents:
diff changeset
   571
\def\fontsubfuzz{.9pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
   572
% However, the default (and correct) Times font will scale exactly as needed.
301f567e2a8e add document
chunhan
parents:
diff changeset
   573
301f567e2a8e add document
chunhan
parents:
diff changeset
   574
301f567e2a8e add document
chunhan
parents:
diff changeset
   575
% warn the user in case they forget to use the 9pt option with
301f567e2a8e add document
chunhan
parents:
diff changeset
   576
% technote
301f567e2a8e add document
chunhan
parents:
diff changeset
   577
\ifCLASSOPTIONtechnote%
301f567e2a8e add document
chunhan
parents:
diff changeset
   578
 \ifx\CLASSOPTIONpt\@IEEEptsizenine\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
   579
  \typeout{** ATTENTION: Technotes are normally 9pt documents.}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   580
 \fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
   581
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   582
301f567e2a8e add document
chunhan
parents:
diff changeset
   583
301f567e2a8e add document
chunhan
parents:
diff changeset
   584
% V1.7
301f567e2a8e add document
chunhan
parents:
diff changeset
   585
% Improved \textunderscore to provide a much better fake _ when used with
301f567e2a8e add document
chunhan
parents:
diff changeset
   586
% OT1 encoding. Under OT1, detect use of pcr or cmtt \ttfamily and use
301f567e2a8e add document
chunhan
parents:
diff changeset
   587
% available true _ glyph for those two typewriter fonts.
301f567e2a8e add document
chunhan
parents:
diff changeset
   588
\def\@IEEEstringptm{ptm} % Times Roman family
301f567e2a8e add document
chunhan
parents:
diff changeset
   589
\def\@IEEEstringppl{ppl} % Palatino Roman family
301f567e2a8e add document
chunhan
parents:
diff changeset
   590
\def\@IEEEstringphv{phv} % Helvetica Sans Serif family
301f567e2a8e add document
chunhan
parents:
diff changeset
   591
\def\@IEEEstringpcr{pcr} % Courier typewriter family
301f567e2a8e add document
chunhan
parents:
diff changeset
   592
\def\@IEEEstringcmtt{cmtt} % Computer Modern typewriter family
301f567e2a8e add document
chunhan
parents:
diff changeset
   593
\DeclareTextCommandDefault{\textunderscore}{\leavevmode
301f567e2a8e add document
chunhan
parents:
diff changeset
   594
\ifx\f@family\@IEEEstringpcr\string_\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   595
\ifx\f@family\@IEEEstringcmtt\string_\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   596
\ifx\f@family\@IEEEstringptm\kern 0em\vbox{\hrule\@width 0.5em\@height 0.5pt\kern -0.3ex}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   597
\ifx\f@family\@IEEEstringppl\kern 0em\vbox{\hrule\@width 0.5em\@height 0.5pt\kern -0.3ex}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   598
\ifx\f@family\@IEEEstringphv\kern -0.03em\vbox{\hrule\@width 0.62em\@height 0.52pt\kern -0.33ex}\kern -0.03em\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   599
\kern 0.09em\vbox{\hrule\@width 0.6em\@height 0.44pt\kern -0.63pt\kern -0.42ex}\kern 0.09em\fi\fi\fi\fi\fi\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
   600
301f567e2a8e add document
chunhan
parents:
diff changeset
   601
301f567e2a8e add document
chunhan
parents:
diff changeset
   602
301f567e2a8e add document
chunhan
parents:
diff changeset
   603
301f567e2a8e add document
chunhan
parents:
diff changeset
   604
% set the default \baselinestretch
301f567e2a8e add document
chunhan
parents:
diff changeset
   605
\def\baselinestretch{1}
301f567e2a8e add document
chunhan
parents:
diff changeset
   606
\ifCLASSOPTIONdraftcls
301f567e2a8e add document
chunhan
parents:
diff changeset
   607
  \def\baselinestretch{1.5}% default baselinestretch for draft modes
301f567e2a8e add document
chunhan
parents:
diff changeset
   608
\fi 
301f567e2a8e add document
chunhan
parents:
diff changeset
   609
301f567e2a8e add document
chunhan
parents:
diff changeset
   610
301f567e2a8e add document
chunhan
parents:
diff changeset
   611
% process CLASSINPUT baselinestretch
301f567e2a8e add document
chunhan
parents:
diff changeset
   612
\ifx\CLASSINPUTbaselinestretch\@IEEEundefined
301f567e2a8e add document
chunhan
parents:
diff changeset
   613
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   614
  \edef\baselinestretch{\CLASSINPUTbaselinestretch} % user CLASSINPUT override
301f567e2a8e add document
chunhan
parents:
diff changeset
   615
  \typeout{** ATTENTION: Overriding \string\baselinestretch\space to
301f567e2a8e add document
chunhan
parents:
diff changeset
   616
           \baselinestretch\space via \string\CLASSINPUT.}
301f567e2a8e add document
chunhan
parents:
diff changeset
   617
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   618
301f567e2a8e add document
chunhan
parents:
diff changeset
   619
\normalsize % make \baselinestretch take affect
301f567e2a8e add document
chunhan
parents:
diff changeset
   620
301f567e2a8e add document
chunhan
parents:
diff changeset
   621
301f567e2a8e add document
chunhan
parents:
diff changeset
   622
301f567e2a8e add document
chunhan
parents:
diff changeset
   623
301f567e2a8e add document
chunhan
parents:
diff changeset
   624
% store the normalsize baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
   625
\newdimen\CLASSINFOnormalsizebaselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
   626
\CLASSINFOnormalsizebaselineskip=\baselineskip\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
   627
% and the normalsize unity (baselinestretch=1) baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
   628
% we could save a register by giving the user access to
301f567e2a8e add document
chunhan
parents:
diff changeset
   629
% \@IEEEnormalsizeunitybaselineskip. However, let's protect
301f567e2a8e add document
chunhan
parents:
diff changeset
   630
% its read only internal status
301f567e2a8e add document
chunhan
parents:
diff changeset
   631
\newdimen\CLASSINFOnormalsizeunitybaselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
   632
\CLASSINFOnormalsizeunitybaselineskip=\@IEEEnormalsizeunitybaselineskip\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
   633
% store the nominal value of jot
301f567e2a8e add document
chunhan
parents:
diff changeset
   634
\newdimen\IEEEnormaljot
301f567e2a8e add document
chunhan
parents:
diff changeset
   635
\IEEEnormaljot=0.25\baselineskip\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
   636
301f567e2a8e add document
chunhan
parents:
diff changeset
   637
% set \jot
301f567e2a8e add document
chunhan
parents:
diff changeset
   638
\jot=\IEEEnormaljot\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
   639
301f567e2a8e add document
chunhan
parents:
diff changeset
   640
301f567e2a8e add document
chunhan
parents:
diff changeset
   641
301f567e2a8e add document
chunhan
parents:
diff changeset
   642
301f567e2a8e add document
chunhan
parents:
diff changeset
   643
% V1.6, we are now going to fine tune the interword spacing
301f567e2a8e add document
chunhan
parents:
diff changeset
   644
% The default interword glue for Times under TeX appears to use a
301f567e2a8e add document
chunhan
parents:
diff changeset
   645
% nominal interword spacing of 25% (relative to the font size, i.e., 1em)
301f567e2a8e add document
chunhan
parents:
diff changeset
   646
% a maximum of 40% and a minimum of 19%.
301f567e2a8e add document
chunhan
parents:
diff changeset
   647
% For example, 10pt text uses an interword glue of:
301f567e2a8e add document
chunhan
parents:
diff changeset
   648
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
   649
% 2.5pt plus 1.49998pt minus 0.59998pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   650
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
   651
% However, IEEE allows for a more generous range which reduces the need
301f567e2a8e add document
chunhan
parents:
diff changeset
   652
% for hyphenation, especially for two column text. Furthermore, IEEE
301f567e2a8e add document
chunhan
parents:
diff changeset
   653
% tends to use a little bit more nominal space between the words.
301f567e2a8e add document
chunhan
parents:
diff changeset
   654
% IEEE's interword spacing percentages appear to be:
301f567e2a8e add document
chunhan
parents:
diff changeset
   655
% 35% nominal
301f567e2a8e add document
chunhan
parents:
diff changeset
   656
% 23% minimum
301f567e2a8e add document
chunhan
parents:
diff changeset
   657
% 50% maximum
301f567e2a8e add document
chunhan
parents:
diff changeset
   658
% (They may even be using a tad more for the largest fonts such as 24pt.)
301f567e2a8e add document
chunhan
parents:
diff changeset
   659
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
   660
% for bold text, IEEE increases the spacing a little more:
301f567e2a8e add document
chunhan
parents:
diff changeset
   661
% 37.5% nominal
301f567e2a8e add document
chunhan
parents:
diff changeset
   662
% 23% minimum
301f567e2a8e add document
chunhan
parents:
diff changeset
   663
% 55% maximum
301f567e2a8e add document
chunhan
parents:
diff changeset
   664
301f567e2a8e add document
chunhan
parents:
diff changeset
   665
% here are the interword spacing ratios we'll use
301f567e2a8e add document
chunhan
parents:
diff changeset
   666
% for medium (normal weight)
301f567e2a8e add document
chunhan
parents:
diff changeset
   667
\def\@IEEEinterspaceratioM{0.35}
301f567e2a8e add document
chunhan
parents:
diff changeset
   668
\def\@IEEEinterspaceMINratioM{0.23}
301f567e2a8e add document
chunhan
parents:
diff changeset
   669
\def\@IEEEinterspaceMAXratioM{0.50}
301f567e2a8e add document
chunhan
parents:
diff changeset
   670
301f567e2a8e add document
chunhan
parents:
diff changeset
   671
% for bold
301f567e2a8e add document
chunhan
parents:
diff changeset
   672
\def\@IEEEinterspaceratioB{0.375}
301f567e2a8e add document
chunhan
parents:
diff changeset
   673
\def\@IEEEinterspaceMINratioB{0.23}
301f567e2a8e add document
chunhan
parents:
diff changeset
   674
\def\@IEEEinterspaceMAXratioB{0.55}
301f567e2a8e add document
chunhan
parents:
diff changeset
   675
301f567e2a8e add document
chunhan
parents:
diff changeset
   676
301f567e2a8e add document
chunhan
parents:
diff changeset
   677
% command to revise the interword spacing for the current font under TeX:
301f567e2a8e add document
chunhan
parents:
diff changeset
   678
% \fontdimen2 = nominal interword space
301f567e2a8e add document
chunhan
parents:
diff changeset
   679
% \fontdimen3 = interword stretch
301f567e2a8e add document
chunhan
parents:
diff changeset
   680
% \fontdimen4 = interword shrink
301f567e2a8e add document
chunhan
parents:
diff changeset
   681
% since all changes to the \fontdimen are global, we can enclose these commands
301f567e2a8e add document
chunhan
parents:
diff changeset
   682
% in braces to confine any font attribute or length changes
301f567e2a8e add document
chunhan
parents:
diff changeset
   683
\def\@@@IEEEsetfontdimens#1#2#3{{%
301f567e2a8e add document
chunhan
parents:
diff changeset
   684
\setlength{\@IEEEtrantmpdimenB}{\f@size pt}% grab the font size in pt, could use 1em instead.
301f567e2a8e add document
chunhan
parents:
diff changeset
   685
\setlength{\@IEEEtrantmpdimenA}{#1\@IEEEtrantmpdimenB}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   686
\fontdimen2\font=\@IEEEtrantmpdimenA\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
   687
\addtolength{\@IEEEtrantmpdimenA}{-#2\@IEEEtrantmpdimenB}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   688
\fontdimen3\font=-\@IEEEtrantmpdimenA\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
   689
\setlength{\@IEEEtrantmpdimenA}{#1\@IEEEtrantmpdimenB}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   690
\addtolength{\@IEEEtrantmpdimenA}{-#3\@IEEEtrantmpdimenB}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   691
\fontdimen4\font=\@IEEEtrantmpdimenA\relax}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   692
301f567e2a8e add document
chunhan
parents:
diff changeset
   693
% revise the interword spacing for each font weight
301f567e2a8e add document
chunhan
parents:
diff changeset
   694
\def\@@IEEEsetfontdimens{{%
301f567e2a8e add document
chunhan
parents:
diff changeset
   695
\mdseries
301f567e2a8e add document
chunhan
parents:
diff changeset
   696
\@@@IEEEsetfontdimens{\@IEEEinterspaceratioM}{\@IEEEinterspaceMAXratioM}{\@IEEEinterspaceMINratioM}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   697
\bfseries
301f567e2a8e add document
chunhan
parents:
diff changeset
   698
\@@@IEEEsetfontdimens{\@IEEEinterspaceratioB}{\@IEEEinterspaceMAXratioB}{\@IEEEinterspaceMINratioB}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   699
}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   700
301f567e2a8e add document
chunhan
parents:
diff changeset
   701
% revise the interword spacing for each font shape
301f567e2a8e add document
chunhan
parents:
diff changeset
   702
% \slshape is not often used for IEEE work and is not altered here. The \scshape caps are
301f567e2a8e add document
chunhan
parents:
diff changeset
   703
% already a tad too large in the free LaTeX fonts (as compared to what IEEE uses) so we
301f567e2a8e add document
chunhan
parents:
diff changeset
   704
% won't alter these either.
301f567e2a8e add document
chunhan
parents:
diff changeset
   705
\def\@IEEEsetfontdimens{{%
301f567e2a8e add document
chunhan
parents:
diff changeset
   706
\normalfont
301f567e2a8e add document
chunhan
parents:
diff changeset
   707
\@@IEEEsetfontdimens
301f567e2a8e add document
chunhan
parents:
diff changeset
   708
\normalfont\itshape
301f567e2a8e add document
chunhan
parents:
diff changeset
   709
\@@IEEEsetfontdimens
301f567e2a8e add document
chunhan
parents:
diff changeset
   710
}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   711
301f567e2a8e add document
chunhan
parents:
diff changeset
   712
% command to revise the interword spacing for each font size (and shape
301f567e2a8e add document
chunhan
parents:
diff changeset
   713
% and weight). Only the \rmfamily is done here as \ttfamily uses a 
301f567e2a8e add document
chunhan
parents:
diff changeset
   714
% fixed spacing and \sffamily is not used as the main text of IEEE papers.
301f567e2a8e add document
chunhan
parents:
diff changeset
   715
\def\@IEEEtunefonts{{\selectfont\rmfamily
301f567e2a8e add document
chunhan
parents:
diff changeset
   716
\tiny\@IEEEsetfontdimens
301f567e2a8e add document
chunhan
parents:
diff changeset
   717
\scriptsize\@IEEEsetfontdimens
301f567e2a8e add document
chunhan
parents:
diff changeset
   718
\footnotesize\@IEEEsetfontdimens
301f567e2a8e add document
chunhan
parents:
diff changeset
   719
\small\@IEEEsetfontdimens
301f567e2a8e add document
chunhan
parents:
diff changeset
   720
\normalsize\@IEEEsetfontdimens
301f567e2a8e add document
chunhan
parents:
diff changeset
   721
\sublargesize\@IEEEsetfontdimens
301f567e2a8e add document
chunhan
parents:
diff changeset
   722
\large\@IEEEsetfontdimens
301f567e2a8e add document
chunhan
parents:
diff changeset
   723
\LARGE\@IEEEsetfontdimens
301f567e2a8e add document
chunhan
parents:
diff changeset
   724
\huge\@IEEEsetfontdimens
301f567e2a8e add document
chunhan
parents:
diff changeset
   725
\Huge\@IEEEsetfontdimens}}
301f567e2a8e add document
chunhan
parents:
diff changeset
   726
301f567e2a8e add document
chunhan
parents:
diff changeset
   727
% if the nofonttune class option is not given, revise the interword spacing
301f567e2a8e add document
chunhan
parents:
diff changeset
   728
% now - in case IEEEtran makes any default length measurements, and make
301f567e2a8e add document
chunhan
parents:
diff changeset
   729
% sure all the default fonts are loaded
301f567e2a8e add document
chunhan
parents:
diff changeset
   730
\ifCLASSOPTIONnofonttune\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   731
\@IEEEtunefonts
301f567e2a8e add document
chunhan
parents:
diff changeset
   732
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   733
301f567e2a8e add document
chunhan
parents:
diff changeset
   734
% and again at the start of the document in case the user loaded different fonts
301f567e2a8e add document
chunhan
parents:
diff changeset
   735
\AtBeginDocument{\ifCLASSOPTIONnofonttune\else\@IEEEtunefonts\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
   736
301f567e2a8e add document
chunhan
parents:
diff changeset
   737
301f567e2a8e add document
chunhan
parents:
diff changeset
   738
301f567e2a8e add document
chunhan
parents:
diff changeset
   739
% V1.6 
301f567e2a8e add document
chunhan
parents:
diff changeset
   740
% LaTeX is a little to quick to use hyphenations
301f567e2a8e add document
chunhan
parents:
diff changeset
   741
% So, we increase the penalty for their use and raise
301f567e2a8e add document
chunhan
parents:
diff changeset
   742
% the badness level that triggers an underfull hbox
301f567e2a8e add document
chunhan
parents:
diff changeset
   743
% warning. The author may still have to tweak things,
301f567e2a8e add document
chunhan
parents:
diff changeset
   744
% but the appearance will be much better "right out
301f567e2a8e add document
chunhan
parents:
diff changeset
   745
% of the box" than that under V1.5 and prior.
301f567e2a8e add document
chunhan
parents:
diff changeset
   746
% TeX default is 50
301f567e2a8e add document
chunhan
parents:
diff changeset
   747
\hyphenpenalty=750
301f567e2a8e add document
chunhan
parents:
diff changeset
   748
% If we didn't adjust the interword spacing, 2200 might be better.
301f567e2a8e add document
chunhan
parents:
diff changeset
   749
% The TeX default is 1000
301f567e2a8e add document
chunhan
parents:
diff changeset
   750
\hbadness=1350
301f567e2a8e add document
chunhan
parents:
diff changeset
   751
% IEEE does not use extra spacing after punctuation
301f567e2a8e add document
chunhan
parents:
diff changeset
   752
\frenchspacing
301f567e2a8e add document
chunhan
parents:
diff changeset
   753
301f567e2a8e add document
chunhan
parents:
diff changeset
   754
% V1.7 increase this a tad to discourage equation breaks
301f567e2a8e add document
chunhan
parents:
diff changeset
   755
\binoppenalty=1000 % default 700
301f567e2a8e add document
chunhan
parents:
diff changeset
   756
\relpenalty=800     % default 500
301f567e2a8e add document
chunhan
parents:
diff changeset
   757
301f567e2a8e add document
chunhan
parents:
diff changeset
   758
301f567e2a8e add document
chunhan
parents:
diff changeset
   759
% margin note stuff
301f567e2a8e add document
chunhan
parents:
diff changeset
   760
\marginparsep      10pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   761
\marginparwidth    20pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   762
\marginparpush     25pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   763
301f567e2a8e add document
chunhan
parents:
diff changeset
   764
301f567e2a8e add document
chunhan
parents:
diff changeset
   765
% if things get too close, go ahead and let them touch
301f567e2a8e add document
chunhan
parents:
diff changeset
   766
\lineskip            0pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   767
\normallineskip      0pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   768
\lineskiplimit       0pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   769
\normallineskiplimit 0pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   770
301f567e2a8e add document
chunhan
parents:
diff changeset
   771
% The distance from the lower edge of the text body to the
301f567e2a8e add document
chunhan
parents:
diff changeset
   772
% footline
301f567e2a8e add document
chunhan
parents:
diff changeset
   773
\footskip 0.4in
301f567e2a8e add document
chunhan
parents:
diff changeset
   774
301f567e2a8e add document
chunhan
parents:
diff changeset
   775
% normally zero, should be relative to font height.
301f567e2a8e add document
chunhan
parents:
diff changeset
   776
% put in a little rubber to help stop some bad breaks (underfull vboxes)
301f567e2a8e add document
chunhan
parents:
diff changeset
   777
\parskip 0ex plus 0.2ex minus 0.1ex
301f567e2a8e add document
chunhan
parents:
diff changeset
   778
301f567e2a8e add document
chunhan
parents:
diff changeset
   779
\parindent    1.0em
301f567e2a8e add document
chunhan
parents:
diff changeset
   780
301f567e2a8e add document
chunhan
parents:
diff changeset
   781
\topmargin    -49.0pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   782
\headheight   12pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   783
\headsep      0.25in
301f567e2a8e add document
chunhan
parents:
diff changeset
   784
301f567e2a8e add document
chunhan
parents:
diff changeset
   785
% use the normal font baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
   786
% so that \topskip is unaffected by changes in \baselinestretch
301f567e2a8e add document
chunhan
parents:
diff changeset
   787
\topskip=\@IEEEnormalsizeunitybaselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
   788
\textheight       58pc  % 9.63in, 696pt
301f567e2a8e add document
chunhan
parents:
diff changeset
   789
% Tweak textheight to a perfect integer number of lines/page.
301f567e2a8e add document
chunhan
parents:
diff changeset
   790
% The normal baselineskip for each document point size is used 
301f567e2a8e add document
chunhan
parents:
diff changeset
   791
% to determine these values.
301f567e2a8e add document
chunhan
parents:
diff changeset
   792
\ifx\CLASSOPTIONpt\@IEEEptsizenine\textheight=63\@IEEEnormalsizeunitybaselineskip\fi      % 63 lines/page
301f567e2a8e add document
chunhan
parents:
diff changeset
   793
\ifx\CLASSOPTIONpt\@IEEEptsizeten\textheight=58\@IEEEnormalsizeunitybaselineskip\fi       % 58 lines/page
301f567e2a8e add document
chunhan
parents:
diff changeset
   794
\ifx\CLASSOPTIONpt\@IEEEptsizeeleven\textheight=52\@IEEEnormalsizeunitybaselineskip\fi    % 52 lines/page
301f567e2a8e add document
chunhan
parents:
diff changeset
   795
\ifx\CLASSOPTIONpt\@IEEEptsizetwelve\textheight=50\@IEEEnormalsizeunitybaselineskip\fi    % 50 lines/page
301f567e2a8e add document
chunhan
parents:
diff changeset
   796
301f567e2a8e add document
chunhan
parents:
diff changeset
   797
301f567e2a8e add document
chunhan
parents:
diff changeset
   798
\columnsep         1pc
301f567e2a8e add document
chunhan
parents:
diff changeset
   799
\textwidth        43pc   % 2 x 21pc + 1pc = 43pc
301f567e2a8e add document
chunhan
parents:
diff changeset
   800
 
301f567e2a8e add document
chunhan
parents:
diff changeset
   801
301f567e2a8e add document
chunhan
parents:
diff changeset
   802
% the default side margins are equal
301f567e2a8e add document
chunhan
parents:
diff changeset
   803
\if@IEEEusingAfourpaper 
301f567e2a8e add document
chunhan
parents:
diff changeset
   804
\oddsidemargin        19.05mm
301f567e2a8e add document
chunhan
parents:
diff changeset
   805
\evensidemargin       19.05mm
301f567e2a8e add document
chunhan
parents:
diff changeset
   806
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   807
\oddsidemargin        0.680in
301f567e2a8e add document
chunhan
parents:
diff changeset
   808
\evensidemargin       0.680in
301f567e2a8e add document
chunhan
parents:
diff changeset
   809
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   810
% compensate for LaTeX's 1in offset
301f567e2a8e add document
chunhan
parents:
diff changeset
   811
\addtolength{\oddsidemargin}{-1in}
301f567e2a8e add document
chunhan
parents:
diff changeset
   812
\addtolength{\evensidemargin}{-1in}
301f567e2a8e add document
chunhan
parents:
diff changeset
   813
301f567e2a8e add document
chunhan
parents:
diff changeset
   814
301f567e2a8e add document
chunhan
parents:
diff changeset
   815
301f567e2a8e add document
chunhan
parents:
diff changeset
   816
% adjust margins for conference mode
301f567e2a8e add document
chunhan
parents:
diff changeset
   817
\ifCLASSOPTIONconference
301f567e2a8e add document
chunhan
parents:
diff changeset
   818
 \topmargin        -0.25in
301f567e2a8e add document
chunhan
parents:
diff changeset
   819
 % we retain the reserved, but unused space for headers
301f567e2a8e add document
chunhan
parents:
diff changeset
   820
 \addtolength{\topmargin}{-\headheight}
301f567e2a8e add document
chunhan
parents:
diff changeset
   821
 \addtolength{\topmargin}{-\headsep}
301f567e2a8e add document
chunhan
parents:
diff changeset
   822
 \textheight        9.25in % The standard for conferences (668.4975pt)
301f567e2a8e add document
chunhan
parents:
diff changeset
   823
 % Tweak textheight to a perfect integer number of lines/page.
301f567e2a8e add document
chunhan
parents:
diff changeset
   824
 \ifx\CLASSOPTIONpt\@IEEEptsizenine\textheight=61\@IEEEnormalsizeunitybaselineskip\fi      % 61 lines/page
301f567e2a8e add document
chunhan
parents:
diff changeset
   825
 \ifx\CLASSOPTIONpt\@IEEEptsizeten\textheight=56\@IEEEnormalsizeunitybaselineskip\fi       % 56 lines/page
301f567e2a8e add document
chunhan
parents:
diff changeset
   826
 \ifx\CLASSOPTIONpt\@IEEEptsizeeleven\textheight=50\@IEEEnormalsizeunitybaselineskip\fi    % 50 lines/page
301f567e2a8e add document
chunhan
parents:
diff changeset
   827
 \ifx\CLASSOPTIONpt\@IEEEptsizetwelve\textheight=48\@IEEEnormalsizeunitybaselineskip\fi    % 48 lines/page
301f567e2a8e add document
chunhan
parents:
diff changeset
   828
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   829
301f567e2a8e add document
chunhan
parents:
diff changeset
   830
301f567e2a8e add document
chunhan
parents:
diff changeset
   831
% compsoc conference
301f567e2a8e add document
chunhan
parents:
diff changeset
   832
\ifCLASSOPTIONcompsocconf
301f567e2a8e add document
chunhan
parents:
diff changeset
   833
\ifCLASSOPTIONconference
301f567e2a8e add document
chunhan
parents:
diff changeset
   834
 % compsoc conference use a larger value for columnsep
301f567e2a8e add document
chunhan
parents:
diff changeset
   835
 \columnsep 0.25in
301f567e2a8e add document
chunhan
parents:
diff changeset
   836
 % compsoc conferences want 1in top margin, 1.125in bottom margin
301f567e2a8e add document
chunhan
parents:
diff changeset
   837
 \topmargin        0in
301f567e2a8e add document
chunhan
parents:
diff changeset
   838
 %\addtolength{\topmargin}{-6pt}% we tweak this a tad to better comply with top of line stuff
301f567e2a8e add document
chunhan
parents:
diff changeset
   839
 % we retain the reserved, but unused space for headers
301f567e2a8e add document
chunhan
parents:
diff changeset
   840
 \addtolength{\topmargin}{-\headheight}
301f567e2a8e add document
chunhan
parents:
diff changeset
   841
 \addtolength{\topmargin}{-\headsep}
301f567e2a8e add document
chunhan
parents:
diff changeset
   842
 \textheight        9.0in % (641.39625pt)
301f567e2a8e add document
chunhan
parents:
diff changeset
   843
301f567e2a8e add document
chunhan
parents:
diff changeset
   844
 % Tweak textheight to a perfect integer number of lines/page.
301f567e2a8e add document
chunhan
parents:
diff changeset
   845
 \ifx\CLASSOPTIONpt\@IEEEptsizenine\textheight=58\@IEEEnormalsizeunitybaselineskip\fi      % 58 lines/page
301f567e2a8e add document
chunhan
parents:
diff changeset
   846
 \ifx\CLASSOPTIONpt\@IEEEptsizeten\textheight=54\@IEEEnormalsizeunitybaselineskip\fi       % 54 lines/page
301f567e2a8e add document
chunhan
parents:
diff changeset
   847
 \ifx\CLASSOPTIONpt\@IEEEptsizeeleven\textheight=48\@IEEEnormalsizeunitybaselineskip\fi    % 48 lines/page
301f567e2a8e add document
chunhan
parents:
diff changeset
   848
 \ifx\CLASSOPTIONpt\@IEEEptsizetwelve\textheight=46\@IEEEnormalsizeunitybaselineskip\fi    % 46 lines/page 
301f567e2a8e add document
chunhan
parents:
diff changeset
   849
 \textwidth 7in
301f567e2a8e add document
chunhan
parents:
diff changeset
   850
301f567e2a8e add document
chunhan
parents:
diff changeset
   851
 
301f567e2a8e add document
chunhan
parents:
diff changeset
   852
 %adjust text h/w for A4 paper
301f567e2a8e add document
chunhan
parents:
diff changeset
   853
 \if@IEEEusingAfourpaper 
301f567e2a8e add document
chunhan
parents:
diff changeset
   854
  \textheight 9.69in
301f567e2a8e add document
chunhan
parents:
diff changeset
   855
  \textwidth 6.77in 
301f567e2a8e add document
chunhan
parents:
diff changeset
   856
 \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   857
 
301f567e2a8e add document
chunhan
parents:
diff changeset
   858
 % the default side margins are equal
301f567e2a8e add document
chunhan
parents:
diff changeset
   859
 \if@IEEEusingAfourpaper 
301f567e2a8e add document
chunhan
parents:
diff changeset
   860
  \oddsidemargin        19.05mm
301f567e2a8e add document
chunhan
parents:
diff changeset
   861
  \evensidemargin       19.05mm
301f567e2a8e add document
chunhan
parents:
diff changeset
   862
 \else
301f567e2a8e add document
chunhan
parents:
diff changeset
   863
  \oddsidemargin        0.75in
301f567e2a8e add document
chunhan
parents:
diff changeset
   864
  \evensidemargin       0.75in
301f567e2a8e add document
chunhan
parents:
diff changeset
   865
 \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   866
 % compensate for LaTeX's 1in offset
301f567e2a8e add document
chunhan
parents:
diff changeset
   867
 \addtolength{\oddsidemargin}{-1in}
301f567e2a8e add document
chunhan
parents:
diff changeset
   868
 \addtolength{\evensidemargin}{-1in}
301f567e2a8e add document
chunhan
parents:
diff changeset
   869
\fi\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   870
301f567e2a8e add document
chunhan
parents:
diff changeset
   871
301f567e2a8e add document
chunhan
parents:
diff changeset
   872
301f567e2a8e add document
chunhan
parents:
diff changeset
   873
% draft mode settings override that of all other modes
301f567e2a8e add document
chunhan
parents:
diff changeset
   874
% provides a nice 1in margin all around the paper and extra
301f567e2a8e add document
chunhan
parents:
diff changeset
   875
% space between the lines for editor's comments
301f567e2a8e add document
chunhan
parents:
diff changeset
   876
\ifCLASSOPTIONdraftcls 
301f567e2a8e add document
chunhan
parents:
diff changeset
   877
  % want 1in from top of paper to text
301f567e2a8e add document
chunhan
parents:
diff changeset
   878
  \setlength{\topmargin}{-\headsep}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   879
  \addtolength{\topmargin}{-\headheight}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   880
  % we want 1in side margins regardless of paper type
301f567e2a8e add document
chunhan
parents:
diff changeset
   881
  \oddsidemargin      0in
301f567e2a8e add document
chunhan
parents:
diff changeset
   882
  \evensidemargin     0in
301f567e2a8e add document
chunhan
parents:
diff changeset
   883
  % set the text width
301f567e2a8e add document
chunhan
parents:
diff changeset
   884
  \setlength{\textwidth}{\paperwidth}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   885
  \addtolength{\textwidth}{-2.0in}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   886
  \setlength{\textheight}{\paperheight}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   887
  \addtolength{\textheight}{-2.0in}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   888
  % digitize textheight to be an integer number of lines.
301f567e2a8e add document
chunhan
parents:
diff changeset
   889
  % this may cause the bottom margin to be off a tad
301f567e2a8e add document
chunhan
parents:
diff changeset
   890
  \addtolength{\textheight}{-1\topskip}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   891
  \divide\textheight  by \baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
   892
  \multiply\textheight  by \baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
   893
  \addtolength{\textheight}{\topskip}%
301f567e2a8e add document
chunhan
parents:
diff changeset
   894
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   895
301f567e2a8e add document
chunhan
parents:
diff changeset
   896
301f567e2a8e add document
chunhan
parents:
diff changeset
   897
301f567e2a8e add document
chunhan
parents:
diff changeset
   898
% process CLASSINPUT inner/outer margin
301f567e2a8e add document
chunhan
parents:
diff changeset
   899
% if inner margin defined, but outer margin not, set outer to inner.
301f567e2a8e add document
chunhan
parents:
diff changeset
   900
\ifx\CLASSINPUTinnersidemargin\@IEEEundefined
301f567e2a8e add document
chunhan
parents:
diff changeset
   901
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   902
  \ifx\CLASSINPUToutersidemargin\@IEEEundefined
301f567e2a8e add document
chunhan
parents:
diff changeset
   903
    \edef\CLASSINPUToutersidemargin{\CLASSINPUTinnersidemargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
   904
  \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   905
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   906
301f567e2a8e add document
chunhan
parents:
diff changeset
   907
\ifx\CLASSINPUToutersidemargin\@IEEEundefined
301f567e2a8e add document
chunhan
parents:
diff changeset
   908
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   909
  % if outer margin defined, but inner margin not, set inner to outer.
301f567e2a8e add document
chunhan
parents:
diff changeset
   910
  \ifx\CLASSINPUTinnersidemargin\@IEEEundefined
301f567e2a8e add document
chunhan
parents:
diff changeset
   911
    \edef\CLASSINPUTinnersidemargin{\CLASSINPUToutersidemargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
   912
  \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   913
  \setlength{\oddsidemargin}{\CLASSINPUTinnersidemargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
   914
  \ifCLASSOPTIONtwoside
301f567e2a8e add document
chunhan
parents:
diff changeset
   915
    \setlength{\evensidemargin}{\CLASSINPUToutersidemargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
   916
  \else
301f567e2a8e add document
chunhan
parents:
diff changeset
   917
    \setlength{\evensidemargin}{\CLASSINPUTinnersidemargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
   918
  \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   919
  \addtolength{\oddsidemargin}{-1in}
301f567e2a8e add document
chunhan
parents:
diff changeset
   920
  \addtolength{\evensidemargin}{-1in}
301f567e2a8e add document
chunhan
parents:
diff changeset
   921
  \setlength{\textwidth}{\paperwidth}
301f567e2a8e add document
chunhan
parents:
diff changeset
   922
  \addtolength{\textwidth}{-\CLASSINPUTinnersidemargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
   923
  \addtolength{\textwidth}{-\CLASSINPUToutersidemargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
   924
  \typeout{** ATTENTION: Overriding inner side margin to \CLASSINPUTinnersidemargin\space and 
301f567e2a8e add document
chunhan
parents:
diff changeset
   925
           outer side margin to \CLASSINPUToutersidemargin\space via \string\CLASSINPUT.}
301f567e2a8e add document
chunhan
parents:
diff changeset
   926
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   927
301f567e2a8e add document
chunhan
parents:
diff changeset
   928
301f567e2a8e add document
chunhan
parents:
diff changeset
   929
301f567e2a8e add document
chunhan
parents:
diff changeset
   930
% process CLASSINPUT top/bottom text margin
301f567e2a8e add document
chunhan
parents:
diff changeset
   931
% if toptext margin defined, but bottomtext margin not, set bottomtext to toptext margin
301f567e2a8e add document
chunhan
parents:
diff changeset
   932
\ifx\CLASSINPUTtoptextmargin\@IEEEundefined
301f567e2a8e add document
chunhan
parents:
diff changeset
   933
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   934
  \ifx\CLASSINPUTbottomtextmargin\@IEEEundefined
301f567e2a8e add document
chunhan
parents:
diff changeset
   935
    \edef\CLASSINPUTbottomtextmargin{\CLASSINPUTtoptextmargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
   936
  \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   937
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   938
301f567e2a8e add document
chunhan
parents:
diff changeset
   939
\ifx\CLASSINPUTbottomtextmargin\@IEEEundefined
301f567e2a8e add document
chunhan
parents:
diff changeset
   940
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
   941
  % if bottomtext margin defined, but toptext margin not, set toptext to bottomtext margin
301f567e2a8e add document
chunhan
parents:
diff changeset
   942
  \ifx\CLASSINPUTtoptextmargin\@IEEEundefined
301f567e2a8e add document
chunhan
parents:
diff changeset
   943
    \edef\CLASSINPUTtoptextmargin{\CLASSINPUTbottomtextmargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
   944
  \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   945
  \setlength{\topmargin}{\CLASSINPUTtoptextmargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
   946
  \addtolength{\topmargin}{-1in}
301f567e2a8e add document
chunhan
parents:
diff changeset
   947
  \addtolength{\topmargin}{-\headheight}
301f567e2a8e add document
chunhan
parents:
diff changeset
   948
  \addtolength{\topmargin}{-\headsep}
301f567e2a8e add document
chunhan
parents:
diff changeset
   949
  \setlength{\textheight}{\paperheight}
301f567e2a8e add document
chunhan
parents:
diff changeset
   950
  \addtolength{\textheight}{-\CLASSINPUTtoptextmargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
   951
  \addtolength{\textheight}{-\CLASSINPUTbottomtextmargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
   952
  % in the default format we use the normal baselineskip as topskip
301f567e2a8e add document
chunhan
parents:
diff changeset
   953
  % we only need 0.7 of this to clear typical top text and we need
301f567e2a8e add document
chunhan
parents:
diff changeset
   954
  % an extra 0.3 spacing at the bottom for descenders. This will
301f567e2a8e add document
chunhan
parents:
diff changeset
   955
  % correct for both.
301f567e2a8e add document
chunhan
parents:
diff changeset
   956
  \addtolength{\topmargin}{-0.3\@IEEEnormalsizeunitybaselineskip}
301f567e2a8e add document
chunhan
parents:
diff changeset
   957
  \typeout{** ATTENTION: Overriding top text margin to \CLASSINPUTtoptextmargin\space and 
301f567e2a8e add document
chunhan
parents:
diff changeset
   958
           bottom text margin to \CLASSINPUTbottomtextmargin\space via \string\CLASSINPUT.}
301f567e2a8e add document
chunhan
parents:
diff changeset
   959
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
   960
301f567e2a8e add document
chunhan
parents:
diff changeset
   961
301f567e2a8e add document
chunhan
parents:
diff changeset
   962
301f567e2a8e add document
chunhan
parents:
diff changeset
   963
301f567e2a8e add document
chunhan
parents:
diff changeset
   964
301f567e2a8e add document
chunhan
parents:
diff changeset
   965
301f567e2a8e add document
chunhan
parents:
diff changeset
   966
301f567e2a8e add document
chunhan
parents:
diff changeset
   967
% LIST SPACING CONTROLS
301f567e2a8e add document
chunhan
parents:
diff changeset
   968
301f567e2a8e add document
chunhan
parents:
diff changeset
   969
% Controls the amount of EXTRA spacing
301f567e2a8e add document
chunhan
parents:
diff changeset
   970
% above and below \trivlist 
301f567e2a8e add document
chunhan
parents:
diff changeset
   971
% Both \list and IED lists override this.
301f567e2a8e add document
chunhan
parents:
diff changeset
   972
% However, \trivlist will use this as will most
301f567e2a8e add document
chunhan
parents:
diff changeset
   973
% things built from \trivlist like the \center
301f567e2a8e add document
chunhan
parents:
diff changeset
   974
% environment.
301f567e2a8e add document
chunhan
parents:
diff changeset
   975
\topsep           0.5\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
   976
301f567e2a8e add document
chunhan
parents:
diff changeset
   977
% Controls the additional spacing around lists preceded
301f567e2a8e add document
chunhan
parents:
diff changeset
   978
% or followed by blank lines. IEEE does not increase
301f567e2a8e add document
chunhan
parents:
diff changeset
   979
% spacing before or after paragraphs so it is set to zero.
301f567e2a8e add document
chunhan
parents:
diff changeset
   980
% \z@ is the same as zero, but faster.
301f567e2a8e add document
chunhan
parents:
diff changeset
   981
\partopsep          \z@
301f567e2a8e add document
chunhan
parents:
diff changeset
   982
301f567e2a8e add document
chunhan
parents:
diff changeset
   983
% Controls the spacing between paragraphs in lists. 
301f567e2a8e add document
chunhan
parents:
diff changeset
   984
% IEEE does not increase spacing before or after paragraphs
301f567e2a8e add document
chunhan
parents:
diff changeset
   985
% so this is also zero. 
301f567e2a8e add document
chunhan
parents:
diff changeset
   986
% With IEEEtran.cls, global changes to
301f567e2a8e add document
chunhan
parents:
diff changeset
   987
% this value DO affect lists (but not IED lists).
301f567e2a8e add document
chunhan
parents:
diff changeset
   988
\parsep             \z@
301f567e2a8e add document
chunhan
parents:
diff changeset
   989
301f567e2a8e add document
chunhan
parents:
diff changeset
   990
% Controls the extra spacing between list items. 
301f567e2a8e add document
chunhan
parents:
diff changeset
   991
% IEEE does not put extra spacing between items.
301f567e2a8e add document
chunhan
parents:
diff changeset
   992
% With IEEEtran.cls, global changes to this value DO affect
301f567e2a8e add document
chunhan
parents:
diff changeset
   993
% lists (but not IED lists).
301f567e2a8e add document
chunhan
parents:
diff changeset
   994
\itemsep            \z@
301f567e2a8e add document
chunhan
parents:
diff changeset
   995
301f567e2a8e add document
chunhan
parents:
diff changeset
   996
% \itemindent is the amount to indent the FIRST line of a list
301f567e2a8e add document
chunhan
parents:
diff changeset
   997
% item. It is auto set to zero within the \list environment. To alter
301f567e2a8e add document
chunhan
parents:
diff changeset
   998
% it, you have to do so when you call the \list.
301f567e2a8e add document
chunhan
parents:
diff changeset
   999
% However, IEEE uses this for the theorem environment
301f567e2a8e add document
chunhan
parents:
diff changeset
  1000
% There is an alternative value for this near \leftmargini below
301f567e2a8e add document
chunhan
parents:
diff changeset
  1001
\itemindent         -1em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1002
301f567e2a8e add document
chunhan
parents:
diff changeset
  1003
% \leftmargin, the spacing from the left margin of the main text to
301f567e2a8e add document
chunhan
parents:
diff changeset
  1004
% the left of the main body of a list item is set by \list.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1005
% Hence this statement does nothing for lists.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1006
% But, quote and verse do use it for indention.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1007
\leftmargin         2em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1008
301f567e2a8e add document
chunhan
parents:
diff changeset
  1009
% we retain this stuff from the older IEEEtran.cls so that \list
301f567e2a8e add document
chunhan
parents:
diff changeset
  1010
% will work the same way as before. However, itemize, enumerate and
301f567e2a8e add document
chunhan
parents:
diff changeset
  1011
% description (IED) could care less about what these are as they
301f567e2a8e add document
chunhan
parents:
diff changeset
  1012
% all are overridden.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1013
\leftmargini        2em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1014
%\itemindent         2em  % Alternative values: sometimes used.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1015
%\leftmargini        0em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1016
\leftmarginii       1em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1017
\leftmarginiii    1.5em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1018
\leftmarginiv     1.5em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1019
\leftmarginv      1.0em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1020
\leftmarginvi     1.0em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1021
\labelsep         0.5em 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1022
\labelwidth         \z@
301f567e2a8e add document
chunhan
parents:
diff changeset
  1023
301f567e2a8e add document
chunhan
parents:
diff changeset
  1024
301f567e2a8e add document
chunhan
parents:
diff changeset
  1025
% The old IEEEtran.cls behavior of \list is retained.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1026
% However, the new V1.3 IED list environments override all the
301f567e2a8e add document
chunhan
parents:
diff changeset
  1027
% @list stuff (\@listX is called within \list for the
301f567e2a8e add document
chunhan
parents:
diff changeset
  1028
% appropriate level just before the user's list_decl is called). 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1029
% \topsep is now 2pt as IEEE puts a little extra space around
301f567e2a8e add document
chunhan
parents:
diff changeset
  1030
% lists - used by those non-IED macros that depend on \list.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1031
% Note that \parsep and \itemsep are not redefined as in 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1032
% the sizexx.clo \@listX (which article.cls uses) so global changes
301f567e2a8e add document
chunhan
parents:
diff changeset
  1033
% of these values DO affect \list
301f567e2a8e add document
chunhan
parents:
diff changeset
  1034
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1035
\def\@listi{\leftmargin\leftmargini \topsep 2pt plus 1pt minus 1pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1036
\let\@listI\@listi
301f567e2a8e add document
chunhan
parents:
diff changeset
  1037
\def\@listii{\leftmargin\leftmarginii\labelwidth\leftmarginii%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1038
    \advance\labelwidth-\labelsep \topsep 2pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1039
\def\@listiii{\leftmargin\leftmarginiii\labelwidth\leftmarginiii%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1040
    \advance\labelwidth-\labelsep \topsep 2pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1041
\def\@listiv{\leftmargin\leftmarginiv\labelwidth\leftmarginiv%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1042
    \advance\labelwidth-\labelsep \topsep 2pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1043
\def\@listv{\leftmargin\leftmarginv\labelwidth\leftmarginv%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1044
    \advance\labelwidth-\labelsep \topsep 2pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1045
\def\@listvi{\leftmargin\leftmarginvi\labelwidth\leftmarginvi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1046
    \advance\labelwidth-\labelsep \topsep 2pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1047
301f567e2a8e add document
chunhan
parents:
diff changeset
  1048
301f567e2a8e add document
chunhan
parents:
diff changeset
  1049
% IEEE uses 5) not 5.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1050
\def\labelenumi{\theenumi)}     \def\theenumi{\arabic{enumi}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1051
301f567e2a8e add document
chunhan
parents:
diff changeset
  1052
% IEEE uses a) not (a)
301f567e2a8e add document
chunhan
parents:
diff changeset
  1053
\def\labelenumii{\theenumii)}  \def\theenumii{\alph{enumii}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1054
301f567e2a8e add document
chunhan
parents:
diff changeset
  1055
% IEEE uses iii) not iii.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1056
\def\labelenumiii{\theenumiii)} \def\theenumiii{\roman{enumiii}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1057
301f567e2a8e add document
chunhan
parents:
diff changeset
  1058
% IEEE uses A) not A.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1059
\def\labelenumiv{\theenumiv)}   \def\theenumiv{\Alph{enumiv}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1060
301f567e2a8e add document
chunhan
parents:
diff changeset
  1061
% exactly the same as in article.cls
301f567e2a8e add document
chunhan
parents:
diff changeset
  1062
\def\p@enumii{\theenumi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1063
\def\p@enumiii{\theenumi(\theenumii)}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1064
\def\p@enumiv{\p@enumiii\theenumiii}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1065
301f567e2a8e add document
chunhan
parents:
diff changeset
  1066
% itemized list label styles
301f567e2a8e add document
chunhan
parents:
diff changeset
  1067
\def\labelitemi{$\scriptstyle\bullet$}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1068
\def\labelitemii{\textbf{--}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1069
\def\labelitemiii{$\ast$}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1070
\def\labelitemiv{$\cdot$}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1071
301f567e2a8e add document
chunhan
parents:
diff changeset
  1072
301f567e2a8e add document
chunhan
parents:
diff changeset
  1073
301f567e2a8e add document
chunhan
parents:
diff changeset
  1074
% **** V1.3 ENHANCEMENTS ****
301f567e2a8e add document
chunhan
parents:
diff changeset
  1075
% Itemize, Enumerate and Description (IED) List Controls
301f567e2a8e add document
chunhan
parents:
diff changeset
  1076
% ***************************
301f567e2a8e add document
chunhan
parents:
diff changeset
  1077
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1078
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1079
% IEEE seems to use at least two different values by
301f567e2a8e add document
chunhan
parents:
diff changeset
  1080
% which ITEMIZED list labels are indented to the right
301f567e2a8e add document
chunhan
parents:
diff changeset
  1081
% For The Journal of Lightwave Technology (JLT) and The Journal
301f567e2a8e add document
chunhan
parents:
diff changeset
  1082
% on Selected Areas in Communications (JSAC), they tend to use
301f567e2a8e add document
chunhan
parents:
diff changeset
  1083
% an indention equal to \parindent. For Transactions on Communications
301f567e2a8e add document
chunhan
parents:
diff changeset
  1084
% they tend to indent ITEMIZED lists a little more--- 1.3\parindent.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1085
% We'll provide both values here for you so that you can choose 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1086
% which one you like in your document using a command such as:
301f567e2a8e add document
chunhan
parents:
diff changeset
  1087
% setlength{\IEEEilabelindent}{\IEEEilabelindentB}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1088
\newdimen\IEEEilabelindentA
301f567e2a8e add document
chunhan
parents:
diff changeset
  1089
\IEEEilabelindentA \parindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1090
301f567e2a8e add document
chunhan
parents:
diff changeset
  1091
\newdimen\IEEEilabelindentB
301f567e2a8e add document
chunhan
parents:
diff changeset
  1092
\IEEEilabelindentB 1.3\parindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1093
% However, we'll default to using \parindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1094
% which makes more sense to me
301f567e2a8e add document
chunhan
parents:
diff changeset
  1095
\newdimen\IEEEilabelindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1096
\IEEEilabelindent \IEEEilabelindentA
301f567e2a8e add document
chunhan
parents:
diff changeset
  1097
301f567e2a8e add document
chunhan
parents:
diff changeset
  1098
301f567e2a8e add document
chunhan
parents:
diff changeset
  1099
% This controls the default amount the enumerated list labels
301f567e2a8e add document
chunhan
parents:
diff changeset
  1100
% are indented to the right.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1101
% Normally, this is the same as the paragraph indention
301f567e2a8e add document
chunhan
parents:
diff changeset
  1102
\newdimen\IEEEelabelindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1103
\IEEEelabelindent \parindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1104
301f567e2a8e add document
chunhan
parents:
diff changeset
  1105
% This controls the default amount the description list labels
301f567e2a8e add document
chunhan
parents:
diff changeset
  1106
% are indented to the right.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1107
% Normally, this is the same as the paragraph indention
301f567e2a8e add document
chunhan
parents:
diff changeset
  1108
\newdimen\IEEEdlabelindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1109
\IEEEdlabelindent \parindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1110
301f567e2a8e add document
chunhan
parents:
diff changeset
  1111
% This is the value actually used within the IED lists.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1112
% The IED environments automatically set its value to
301f567e2a8e add document
chunhan
parents:
diff changeset
  1113
% one of the three values above, so global changes do 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1114
% not have any effect
301f567e2a8e add document
chunhan
parents:
diff changeset
  1115
\newdimen\IEEElabelindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1116
\IEEElabelindent \parindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1117
301f567e2a8e add document
chunhan
parents:
diff changeset
  1118
% The actual amount labels will be indented is
301f567e2a8e add document
chunhan
parents:
diff changeset
  1119
% \IEEElabelindent multiplied by the factor below
301f567e2a8e add document
chunhan
parents:
diff changeset
  1120
% corresponding to the level of nesting depth
301f567e2a8e add document
chunhan
parents:
diff changeset
  1121
% This provides a means by which the user can
301f567e2a8e add document
chunhan
parents:
diff changeset
  1122
% alter the effective \IEEElabelindent for deeper
301f567e2a8e add document
chunhan
parents:
diff changeset
  1123
% levels
301f567e2a8e add document
chunhan
parents:
diff changeset
  1124
% There may not be such a thing as correct "standard IEEE"
301f567e2a8e add document
chunhan
parents:
diff changeset
  1125
% values. What IEEE actually does may depend on the specific
301f567e2a8e add document
chunhan
parents:
diff changeset
  1126
% circumstances.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1127
% The first list level almost always has full indention.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1128
% The second levels I've seen have only 75% of the normal indentation
301f567e2a8e add document
chunhan
parents:
diff changeset
  1129
% Three level or greater nestings are very rare. I am guessing
301f567e2a8e add document
chunhan
parents:
diff changeset
  1130
% that they don't use any indentation.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1131
\def\IEEElabelindentfactori{1.0}   % almost always one
301f567e2a8e add document
chunhan
parents:
diff changeset
  1132
\def\IEEElabelindentfactorii{0.75} % 0.0 or 1.0 may be used in some cases
301f567e2a8e add document
chunhan
parents:
diff changeset
  1133
\def\IEEElabelindentfactoriii{0.0} % 0.75? 0.5? 0.0?
301f567e2a8e add document
chunhan
parents:
diff changeset
  1134
\def\IEEElabelindentfactoriv{0.0}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1135
\def\IEEElabelindentfactorv{0.0}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1136
\def\IEEElabelindentfactorvi{0.0}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1137
301f567e2a8e add document
chunhan
parents:
diff changeset
  1138
% value actually used within IED lists, it is auto
301f567e2a8e add document
chunhan
parents:
diff changeset
  1139
% set to one of the 6 values above
301f567e2a8e add document
chunhan
parents:
diff changeset
  1140
% global changes here have no effect
301f567e2a8e add document
chunhan
parents:
diff changeset
  1141
\def\IEEElabelindentfactor{1.0}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1142
301f567e2a8e add document
chunhan
parents:
diff changeset
  1143
% This controls the default spacing between the end of the IED
301f567e2a8e add document
chunhan
parents:
diff changeset
  1144
% list labels and the list text, when normal text is used for
301f567e2a8e add document
chunhan
parents:
diff changeset
  1145
% the labels.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1146
\newdimen\IEEEiednormlabelsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  1147
\IEEEiednormlabelsep 0.6em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1148
301f567e2a8e add document
chunhan
parents:
diff changeset
  1149
% This controls the default spacing between the end of the IED
301f567e2a8e add document
chunhan
parents:
diff changeset
  1150
% list labels and the list text, when math symbols are used for
301f567e2a8e add document
chunhan
parents:
diff changeset
  1151
% the labels (nomenclature lists). IEEE usually increases the 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1152
% spacing in these cases
301f567e2a8e add document
chunhan
parents:
diff changeset
  1153
\newdimen\IEEEiedmathlabelsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  1154
\IEEEiedmathlabelsep 1.2em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1155
301f567e2a8e add document
chunhan
parents:
diff changeset
  1156
% This controls the extra vertical separation put above and
301f567e2a8e add document
chunhan
parents:
diff changeset
  1157
% below each IED list. IEEE usually puts a little extra spacing
301f567e2a8e add document
chunhan
parents:
diff changeset
  1158
% around each list. However, this spacing is barely noticeable.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1159
\newskip\IEEEiedtopsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  1160
\IEEEiedtopsep 2pt plus 1pt minus 1pt
301f567e2a8e add document
chunhan
parents:
diff changeset
  1161
301f567e2a8e add document
chunhan
parents:
diff changeset
  1162
301f567e2a8e add document
chunhan
parents:
diff changeset
  1163
% This command is executed within each IED list environment
301f567e2a8e add document
chunhan
parents:
diff changeset
  1164
% at the beginning of the list. You can use this to set the 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1165
% parameters for some/all your IED list(s) without disturbing 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1166
% global parameters that affect things other than lists.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1167
% i.e., renewcommand{\IEEEiedlistdecl}{\setlength{\labelsep}{5em}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1168
% will alter the \labelsep for the next list(s) until 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1169
% \IEEEiedlistdecl is redefined. 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1170
\def\IEEEiedlistdecl{\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1171
301f567e2a8e add document
chunhan
parents:
diff changeset
  1172
% This command provides an easy way to set \leftmargin based
301f567e2a8e add document
chunhan
parents:
diff changeset
  1173
% on the \labelwidth, \labelsep and the argument \IEEElabelindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1174
% Usage: \IEEEcalcleftmargin{width-to-indent-the-label}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1175
% output is in the \leftmargin variable, i.e., effectively:
301f567e2a8e add document
chunhan
parents:
diff changeset
  1176
% \leftmargin = argument + \labelwidth + \labelsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  1177
% Note controlled spacing here, shield end of lines with %
301f567e2a8e add document
chunhan
parents:
diff changeset
  1178
\def\IEEEcalcleftmargin#1{\setlength{\leftmargin}{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1179
\addtolength{\leftmargin}{\labelwidth}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1180
\addtolength{\leftmargin}{\labelsep}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1181
301f567e2a8e add document
chunhan
parents:
diff changeset
  1182
% This command provides an easy way to set \labelwidth to the
301f567e2a8e add document
chunhan
parents:
diff changeset
  1183
% width of the given text. It is the same as
301f567e2a8e add document
chunhan
parents:
diff changeset
  1184
% \settowidth{\labelwidth}{label-text}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1185
% and useful as a shorter alternative.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1186
% Typically used to set \labelwidth to be the width
301f567e2a8e add document
chunhan
parents:
diff changeset
  1187
% of the longest label in the list
301f567e2a8e add document
chunhan
parents:
diff changeset
  1188
\def\IEEEsetlabelwidth#1{\settowidth{\labelwidth}{#1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1189
301f567e2a8e add document
chunhan
parents:
diff changeset
  1190
% When this command is executed, IED lists will use the 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1191
% IEEEiedmathlabelsep label separation rather than the normal
301f567e2a8e add document
chunhan
parents:
diff changeset
  1192
% spacing. To have an effect, this command must be executed via
301f567e2a8e add document
chunhan
parents:
diff changeset
  1193
% the \IEEEiedlistdecl or within the option of the IED list
301f567e2a8e add document
chunhan
parents:
diff changeset
  1194
% environments.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1195
\def\IEEEusemathlabelsep{\setlength{\labelsep}{\IEEEiedmathlabelsep}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1196
301f567e2a8e add document
chunhan
parents:
diff changeset
  1197
% A flag which controls whether the IED lists automatically
301f567e2a8e add document
chunhan
parents:
diff changeset
  1198
% calculate \leftmargin from \IEEElabelindent, \labelwidth and \labelsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  1199
% Useful if you want to specify your own \leftmargin
301f567e2a8e add document
chunhan
parents:
diff changeset
  1200
% This flag must be set (\IEEEnocalcleftmargintrue or \IEEEnocalcleftmarginfalse) 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1201
% via the \IEEEiedlistdecl or within the option of the IED list
301f567e2a8e add document
chunhan
parents:
diff changeset
  1202
% environments to have an effect.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1203
\newif\ifIEEEnocalcleftmargin
301f567e2a8e add document
chunhan
parents:
diff changeset
  1204
\IEEEnocalcleftmarginfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  1205
301f567e2a8e add document
chunhan
parents:
diff changeset
  1206
% A flag which controls whether \IEEElabelindent is multiplied by
301f567e2a8e add document
chunhan
parents:
diff changeset
  1207
% the \IEEElabelindentfactor for each list level.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1208
% This flag must be set via the \IEEEiedlistdecl or within the option 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1209
% of the IED list environments to have an effect.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1210
\newif\ifIEEEnolabelindentfactor
301f567e2a8e add document
chunhan
parents:
diff changeset
  1211
\IEEEnolabelindentfactorfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  1212
301f567e2a8e add document
chunhan
parents:
diff changeset
  1213
301f567e2a8e add document
chunhan
parents:
diff changeset
  1214
% internal variable to indicate type of IED label
301f567e2a8e add document
chunhan
parents:
diff changeset
  1215
% justification
301f567e2a8e add document
chunhan
parents:
diff changeset
  1216
% 0 - left; 1 - center; 2 - right
301f567e2a8e add document
chunhan
parents:
diff changeset
  1217
\def\@IEEEiedjustify{0}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1218
301f567e2a8e add document
chunhan
parents:
diff changeset
  1219
301f567e2a8e add document
chunhan
parents:
diff changeset
  1220
% commands to allow the user to control IED
301f567e2a8e add document
chunhan
parents:
diff changeset
  1221
% label justifications. Use these commands within
301f567e2a8e add document
chunhan
parents:
diff changeset
  1222
% the IED environment option or in the \IEEEiedlistdecl
301f567e2a8e add document
chunhan
parents:
diff changeset
  1223
% Note that changing the normal list justifications
301f567e2a8e add document
chunhan
parents:
diff changeset
  1224
% is nonstandard and IEEE may not like it if you do so!
301f567e2a8e add document
chunhan
parents:
diff changeset
  1225
% I include these commands as they may be helpful to
301f567e2a8e add document
chunhan
parents:
diff changeset
  1226
% those who are using these enhanced list controls for
301f567e2a8e add document
chunhan
parents:
diff changeset
  1227
% other non-IEEE related LaTeX work.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1228
% itemize and enumerate automatically default to right
301f567e2a8e add document
chunhan
parents:
diff changeset
  1229
% justification, description defaults to left.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1230
\def\IEEEiedlabeljustifyl{\def\@IEEEiedjustify{0}}%left
301f567e2a8e add document
chunhan
parents:
diff changeset
  1231
\def\IEEEiedlabeljustifyc{\def\@IEEEiedjustify{1}}%center
301f567e2a8e add document
chunhan
parents:
diff changeset
  1232
\def\IEEEiedlabeljustifyr{\def\@IEEEiedjustify{2}}%right
301f567e2a8e add document
chunhan
parents:
diff changeset
  1233
301f567e2a8e add document
chunhan
parents:
diff changeset
  1234
301f567e2a8e add document
chunhan
parents:
diff changeset
  1235
301f567e2a8e add document
chunhan
parents:
diff changeset
  1236
301f567e2a8e add document
chunhan
parents:
diff changeset
  1237
% commands to save to and restore from the list parameter copies
301f567e2a8e add document
chunhan
parents:
diff changeset
  1238
% this allows us to set all the list parameters within
301f567e2a8e add document
chunhan
parents:
diff changeset
  1239
% the list_decl and prevent \list (and its \@list) 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1240
% from overriding any of our parameters
301f567e2a8e add document
chunhan
parents:
diff changeset
  1241
% V1.6 use \edefs instead of dimen's to conserve dimen registers
301f567e2a8e add document
chunhan
parents:
diff changeset
  1242
% Note controlled spacing here, shield end of lines with %
301f567e2a8e add document
chunhan
parents:
diff changeset
  1243
\def\@IEEEsavelistparams{\edef\@IEEEiedtopsep{\the\topsep}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1244
\edef\@IEEEiedlabelwidth{\the\labelwidth}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1245
\edef\@IEEEiedlabelsep{\the\labelsep}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1246
\edef\@IEEEiedleftmargin{\the\leftmargin}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1247
\edef\@IEEEiedpartopsep{\the\partopsep}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1248
\edef\@IEEEiedparsep{\the\parsep}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1249
\edef\@IEEEieditemsep{\the\itemsep}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1250
\edef\@IEEEiedrightmargin{\the\rightmargin}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1251
\edef\@IEEEiedlistparindent{\the\listparindent}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1252
\edef\@IEEEieditemindent{\the\itemindent}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1253
301f567e2a8e add document
chunhan
parents:
diff changeset
  1254
% Note controlled spacing here
301f567e2a8e add document
chunhan
parents:
diff changeset
  1255
\def\@IEEErestorelistparams{\topsep\@IEEEiedtopsep\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1256
\labelwidth\@IEEEiedlabelwidth\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1257
\labelsep\@IEEEiedlabelsep\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1258
\leftmargin\@IEEEiedleftmargin\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1259
\partopsep\@IEEEiedpartopsep\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1260
\parsep\@IEEEiedparsep\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1261
\itemsep\@IEEEieditemsep\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1262
\rightmargin\@IEEEiedrightmargin\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1263
\listparindent\@IEEEiedlistparindent\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1264
\itemindent\@IEEEieditemindent\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1265
301f567e2a8e add document
chunhan
parents:
diff changeset
  1266
301f567e2a8e add document
chunhan
parents:
diff changeset
  1267
% v1.6b provide original LaTeX IED list environments
301f567e2a8e add document
chunhan
parents:
diff changeset
  1268
% note that latex.ltx defines \itemize and \enumerate, but not \description
301f567e2a8e add document
chunhan
parents:
diff changeset
  1269
% which must be created by the base classes
301f567e2a8e add document
chunhan
parents:
diff changeset
  1270
% save original LaTeX itemize and enumerate
301f567e2a8e add document
chunhan
parents:
diff changeset
  1271
\let\LaTeXitemize\itemize
301f567e2a8e add document
chunhan
parents:
diff changeset
  1272
\let\endLaTeXitemize\enditemize
301f567e2a8e add document
chunhan
parents:
diff changeset
  1273
\let\LaTeXenumerate\enumerate
301f567e2a8e add document
chunhan
parents:
diff changeset
  1274
\let\endLaTeXenumerate\endenumerate
301f567e2a8e add document
chunhan
parents:
diff changeset
  1275
301f567e2a8e add document
chunhan
parents:
diff changeset
  1276
% provide original LaTeX description environment from article.cls
301f567e2a8e add document
chunhan
parents:
diff changeset
  1277
\newenvironment{LaTeXdescription}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1278
               {\list{}{\labelwidth\z@ \itemindent-\leftmargin
301f567e2a8e add document
chunhan
parents:
diff changeset
  1279
                        \let\makelabel\descriptionlabel}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1280
               {\endlist}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1281
\newcommand*\descriptionlabel[1]{\hspace\labelsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  1282
                                 \normalfont\bfseries #1}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1283
301f567e2a8e add document
chunhan
parents:
diff changeset
  1284
301f567e2a8e add document
chunhan
parents:
diff changeset
  1285
% override LaTeX's default IED lists
301f567e2a8e add document
chunhan
parents:
diff changeset
  1286
\def\itemize{\@IEEEitemize}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1287
\def\enditemize{\@endIEEEitemize}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1288
\def\enumerate{\@IEEEenumerate}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1289
\def\endenumerate{\@endIEEEenumerate}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1290
\def\description{\@IEEEdescription}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1291
\def\enddescription{\@endIEEEdescription}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1292
301f567e2a8e add document
chunhan
parents:
diff changeset
  1293
% provide the user with aliases - may help those using packages that
301f567e2a8e add document
chunhan
parents:
diff changeset
  1294
% override itemize, enumerate, or description
301f567e2a8e add document
chunhan
parents:
diff changeset
  1295
\def\IEEEitemize{\@IEEEitemize}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1296
\def\endIEEEitemize{\@endIEEEitemize}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1297
\def\IEEEenumerate{\@IEEEenumerate}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1298
\def\endIEEEenumerate{\@endIEEEenumerate}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1299
\def\IEEEdescription{\@IEEEdescription}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1300
\def\endIEEEdescription{\@endIEEEdescription}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1301
301f567e2a8e add document
chunhan
parents:
diff changeset
  1302
301f567e2a8e add document
chunhan
parents:
diff changeset
  1303
% V1.6 we want to keep the IEEEtran IED list definitions as our own internal
301f567e2a8e add document
chunhan
parents:
diff changeset
  1304
% commands so they are protected against redefinition
301f567e2a8e add document
chunhan
parents:
diff changeset
  1305
\def\@IEEEitemize{\@ifnextchar[{\@@IEEEitemize}{\@@IEEEitemize[\relax]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1306
\def\@IEEEenumerate{\@ifnextchar[{\@@IEEEenumerate}{\@@IEEEenumerate[\relax]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1307
\def\@IEEEdescription{\@ifnextchar[{\@@IEEEdescription}{\@@IEEEdescription[\relax]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1308
\def\@endIEEEitemize{\endlist}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1309
\def\@endIEEEenumerate{\endlist}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1310
\def\@endIEEEdescription{\endlist}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1311
301f567e2a8e add document
chunhan
parents:
diff changeset
  1312
301f567e2a8e add document
chunhan
parents:
diff changeset
  1313
% DO NOT ALLOW BLANK LINES TO BE IN THESE IED ENVIRONMENTS
301f567e2a8e add document
chunhan
parents:
diff changeset
  1314
% AS THIS WILL FORCE NEW PARAGRAPHS AFTER THE IED LISTS
301f567e2a8e add document
chunhan
parents:
diff changeset
  1315
% IEEEtran itemized list MDS 1/2001
301f567e2a8e add document
chunhan
parents:
diff changeset
  1316
% Note controlled spacing here, shield end of lines with %
301f567e2a8e add document
chunhan
parents:
diff changeset
  1317
\def\@@IEEEitemize[#1]{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1318
                \ifnum\@itemdepth>3\relax\@toodeep\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1319
                \ifnum\@listdepth>5\relax\@toodeep\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1320
                \advance\@itemdepth\@ne%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1321
                \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1322
                % get the labelindentfactor for this level
301f567e2a8e add document
chunhan
parents:
diff changeset
  1323
                \advance\@listdepth\@ne% we need to know what the level WILL be
301f567e2a8e add document
chunhan
parents:
diff changeset
  1324
                \edef\IEEElabelindentfactor{\csname IEEElabelindentfactor\romannumeral\the\@listdepth\endcsname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1325
                \advance\@listdepth-\@ne% undo our increment
301f567e2a8e add document
chunhan
parents:
diff changeset
  1326
                \def\@IEEEiedjustify{2}% right justified labels are default
301f567e2a8e add document
chunhan
parents:
diff changeset
  1327
                % set other defaults
301f567e2a8e add document
chunhan
parents:
diff changeset
  1328
                \IEEEnocalcleftmarginfalse%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1329
                \IEEEnolabelindentfactorfalse%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1330
                \topsep\IEEEiedtopsep%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1331
                \IEEElabelindent\IEEEilabelindent%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1332
                \labelsep\IEEEiednormlabelsep%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1333
                \partopsep 0ex%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1334
                \parsep 0ex%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1335
                \itemsep 0ex%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1336
                \rightmargin 0em%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1337
                \listparindent 0em%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1338
                \itemindent 0em%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1339
                % calculate the label width
301f567e2a8e add document
chunhan
parents:
diff changeset
  1340
                % the user can override this later if
301f567e2a8e add document
chunhan
parents:
diff changeset
  1341
                % they specified a \labelwidth
301f567e2a8e add document
chunhan
parents:
diff changeset
  1342
                \settowidth{\labelwidth}{\csname labelitem\romannumeral\the\@itemdepth\endcsname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1343
                \@IEEEsavelistparams% save our list parameters
301f567e2a8e add document
chunhan
parents:
diff changeset
  1344
                \list{\csname\@itemitem\endcsname}{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1345
                \@IEEErestorelistparams% override any list{} changes
301f567e2a8e add document
chunhan
parents:
diff changeset
  1346
                                       % to our globals
301f567e2a8e add document
chunhan
parents:
diff changeset
  1347
                \let\makelabel\@IEEEiedmakelabel% v1.6b setup \makelabel
301f567e2a8e add document
chunhan
parents:
diff changeset
  1348
                \IEEEiedlistdecl% let user alter parameters
301f567e2a8e add document
chunhan
parents:
diff changeset
  1349
                #1\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1350
                % If the user has requested not to use the
301f567e2a8e add document
chunhan
parents:
diff changeset
  1351
                % labelindent factor, don't revise \labelindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1352
                \ifIEEEnolabelindentfactor\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1353
                \else\IEEElabelindent=\IEEElabelindentfactor\labelindent%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1354
                \fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1355
                % Unless the user has requested otherwise,
301f567e2a8e add document
chunhan
parents:
diff changeset
  1356
                % calculate our left margin based
301f567e2a8e add document
chunhan
parents:
diff changeset
  1357
                % on \IEEElabelindent, \labelwidth and
301f567e2a8e add document
chunhan
parents:
diff changeset
  1358
                % \labelsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  1359
                \ifIEEEnocalcleftmargin\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1360
                \else\IEEEcalcleftmargin{\IEEElabelindent}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1361
                \fi}\fi\fi}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1362
301f567e2a8e add document
chunhan
parents:
diff changeset
  1363
301f567e2a8e add document
chunhan
parents:
diff changeset
  1364
% DO NOT ALLOW BLANK LINES TO BE IN THESE IED ENVIRONMENTS
301f567e2a8e add document
chunhan
parents:
diff changeset
  1365
% AS THIS WILL FORCE NEW PARAGRAPHS AFTER THE IED LISTS
301f567e2a8e add document
chunhan
parents:
diff changeset
  1366
% IEEEtran enumerate list MDS 1/2001
301f567e2a8e add document
chunhan
parents:
diff changeset
  1367
% Note controlled spacing here, shield end of lines with %
301f567e2a8e add document
chunhan
parents:
diff changeset
  1368
\def\@@IEEEenumerate[#1]{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1369
                \ifnum\@enumdepth>3\relax\@toodeep\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1370
                \ifnum\@listdepth>5\relax\@toodeep\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1371
                \advance\@enumdepth\@ne%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1372
                \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1373
                % get the labelindentfactor for this level
301f567e2a8e add document
chunhan
parents:
diff changeset
  1374
                \advance\@listdepth\@ne% we need to know what the level WILL be
301f567e2a8e add document
chunhan
parents:
diff changeset
  1375
                \edef\IEEElabelindentfactor{\csname IEEElabelindentfactor\romannumeral\the\@listdepth\endcsname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1376
                \advance\@listdepth-\@ne% undo our increment
301f567e2a8e add document
chunhan
parents:
diff changeset
  1377
                \def\@IEEEiedjustify{2}% right justified labels are default
301f567e2a8e add document
chunhan
parents:
diff changeset
  1378
                % set other defaults
301f567e2a8e add document
chunhan
parents:
diff changeset
  1379
                \IEEEnocalcleftmarginfalse%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1380
                \IEEEnolabelindentfactorfalse%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1381
                \topsep\IEEEiedtopsep%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1382
                \IEEElabelindent\IEEEelabelindent%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1383
                \labelsep\IEEEiednormlabelsep%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1384
                \partopsep 0ex%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1385
                \parsep 0ex%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1386
                \itemsep 0ex%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1387
                \rightmargin 0em%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1388
                \listparindent 0em%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1389
                \itemindent 0em%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1390
                % calculate the label width
301f567e2a8e add document
chunhan
parents:
diff changeset
  1391
                % We'll set it to the width suitable for all labels using
301f567e2a8e add document
chunhan
parents:
diff changeset
  1392
                % normalfont 1) to 9)
301f567e2a8e add document
chunhan
parents:
diff changeset
  1393
                % The user can override this later
301f567e2a8e add document
chunhan
parents:
diff changeset
  1394
                \settowidth{\labelwidth}{9)}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1395
                \@IEEEsavelistparams% save our list parameters
301f567e2a8e add document
chunhan
parents:
diff changeset
  1396
                \list{\csname label\@enumctr\endcsname}{\usecounter{\@enumctr}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1397
                \@IEEErestorelistparams% override any list{} changes
301f567e2a8e add document
chunhan
parents:
diff changeset
  1398
                                       % to our globals
301f567e2a8e add document
chunhan
parents:
diff changeset
  1399
                \let\makelabel\@IEEEiedmakelabel% v1.6b setup \makelabel
301f567e2a8e add document
chunhan
parents:
diff changeset
  1400
                \IEEEiedlistdecl% let user alter parameters 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1401
                #1\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1402
                % If the user has requested not to use the
301f567e2a8e add document
chunhan
parents:
diff changeset
  1403
                % IEEElabelindent factor, don't revise \IEEElabelindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1404
                \ifIEEEnolabelindentfactor\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1405
                \else\IEEElabelindent=\IEEElabelindentfactor\IEEElabelindent%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1406
                \fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1407
                % Unless the user has requested otherwise,
301f567e2a8e add document
chunhan
parents:
diff changeset
  1408
                % calculate our left margin based
301f567e2a8e add document
chunhan
parents:
diff changeset
  1409
                % on \IEEElabelindent, \labelwidth and
301f567e2a8e add document
chunhan
parents:
diff changeset
  1410
                % \labelsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  1411
                \ifIEEEnocalcleftmargin\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1412
                \else\IEEEcalcleftmargin{\IEEElabelindent}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1413
                \fi}\fi\fi}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1414
301f567e2a8e add document
chunhan
parents:
diff changeset
  1415
301f567e2a8e add document
chunhan
parents:
diff changeset
  1416
% DO NOT ALLOW BLANK LINES TO BE IN THESE IED ENVIRONMENTS
301f567e2a8e add document
chunhan
parents:
diff changeset
  1417
% AS THIS WILL FORCE NEW PARAGRAPHS AFTER THE IED LISTS
301f567e2a8e add document
chunhan
parents:
diff changeset
  1418
% IEEEtran description list MDS 1/2001
301f567e2a8e add document
chunhan
parents:
diff changeset
  1419
% Note controlled spacing here, shield end of lines with %
301f567e2a8e add document
chunhan
parents:
diff changeset
  1420
\def\@@IEEEdescription[#1]{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1421
                \ifnum\@listdepth>5\relax\@toodeep\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1422
                % get the labelindentfactor for this level
301f567e2a8e add document
chunhan
parents:
diff changeset
  1423
                \advance\@listdepth\@ne% we need to know what the level WILL be
301f567e2a8e add document
chunhan
parents:
diff changeset
  1424
                \edef\IEEElabelindentfactor{\csname IEEElabelindentfactor\romannumeral\the\@listdepth\endcsname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1425
                \advance\@listdepth-\@ne% undo our increment
301f567e2a8e add document
chunhan
parents:
diff changeset
  1426
                \def\@IEEEiedjustify{0}% left justified labels are default
301f567e2a8e add document
chunhan
parents:
diff changeset
  1427
                % set other defaults
301f567e2a8e add document
chunhan
parents:
diff changeset
  1428
                \IEEEnocalcleftmarginfalse%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1429
                \IEEEnolabelindentfactorfalse%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1430
                \topsep\IEEEiedtopsep% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1431
                \IEEElabelindent\IEEEdlabelindent%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1432
                % assume normal labelsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  1433
                \labelsep\IEEEiednormlabelsep%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1434
                \partopsep 0ex%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1435
                \parsep 0ex%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1436
                \itemsep 0ex%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1437
                \rightmargin 0em%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1438
                \listparindent 0em%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1439
                \itemindent 0em%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1440
                % Bogus label width in case the user forgets
301f567e2a8e add document
chunhan
parents:
diff changeset
  1441
                % to set it.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1442
                % TIP: If you want to see what a variable's width is you
301f567e2a8e add document
chunhan
parents:
diff changeset
  1443
                % can use the TeX command \showthe\width-variable to 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1444
                % display it on the screen during compilation 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1445
                % (This might be helpful to know when you need to find out
301f567e2a8e add document
chunhan
parents:
diff changeset
  1446
                % which label is the widest)
301f567e2a8e add document
chunhan
parents:
diff changeset
  1447
                \settowidth{\labelwidth}{Hello}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1448
                \@IEEEsavelistparams% save our list parameters
301f567e2a8e add document
chunhan
parents:
diff changeset
  1449
                \list{}{\@IEEErestorelistparams% override any list{} changes
301f567e2a8e add document
chunhan
parents:
diff changeset
  1450
                                               % to our globals
301f567e2a8e add document
chunhan
parents:
diff changeset
  1451
                \let\makelabel\@IEEEiedmakelabel% v1.6b setup \makelabel
301f567e2a8e add document
chunhan
parents:
diff changeset
  1452
                \IEEEiedlistdecl% let user alter parameters 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1453
                #1\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1454
                % If the user has requested not to use the
301f567e2a8e add document
chunhan
parents:
diff changeset
  1455
                % labelindent factor, don't revise \IEEElabelindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1456
                \ifIEEEnolabelindentfactor\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1457
                \else\IEEElabelindent=\IEEElabelindentfactor\IEEElabelindent%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1458
                \fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1459
                % Unless the user has requested otherwise,
301f567e2a8e add document
chunhan
parents:
diff changeset
  1460
                % calculate our left margin based
301f567e2a8e add document
chunhan
parents:
diff changeset
  1461
                % on \IEEElabelindent, \labelwidth and
301f567e2a8e add document
chunhan
parents:
diff changeset
  1462
                % \labelsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  1463
                \ifIEEEnocalcleftmargin\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1464
                \else\IEEEcalcleftmargin{\IEEElabelindent}\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1465
                \fi}\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1466
301f567e2a8e add document
chunhan
parents:
diff changeset
  1467
% v1.6b we use one makelabel that does justification as needed.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1468
\def\@IEEEiedmakelabel#1{\relax\if\@IEEEiedjustify 0\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  1469
\makebox[\labelwidth][l]{\normalfont #1}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  1470
\if\@IEEEiedjustify 1\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  1471
\makebox[\labelwidth][c]{\normalfont #1}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  1472
\makebox[\labelwidth][r]{\normalfont #1}\fi\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1473
301f567e2a8e add document
chunhan
parents:
diff changeset
  1474
301f567e2a8e add document
chunhan
parents:
diff changeset
  1475
% VERSE and QUOTE
301f567e2a8e add document
chunhan
parents:
diff changeset
  1476
% V1.7 define environments with newenvironment
301f567e2a8e add document
chunhan
parents:
diff changeset
  1477
\newenvironment{verse}{\let\\=\@centercr
301f567e2a8e add document
chunhan
parents:
diff changeset
  1478
    \list{}{\itemsep\z@ \itemindent -1.5em \listparindent \itemindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1479
    \rightmargin\leftmargin\advance\leftmargin 1.5em}\item\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1480
    {\endlist}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1481
\newenvironment{quotation}{\list{}{\listparindent 1.5em \itemindent\listparindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  1482
    \rightmargin\leftmargin \parsep 0pt plus 1pt}\item\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1483
    {\endlist}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1484
\newenvironment{quote}{\list{}{\rightmargin\leftmargin}\item\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1485
    {\endlist}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1486
301f567e2a8e add document
chunhan
parents:
diff changeset
  1487
301f567e2a8e add document
chunhan
parents:
diff changeset
  1488
% \titlepage
301f567e2a8e add document
chunhan
parents:
diff changeset
  1489
% provided only for backward compatibility. \maketitle is the correct
301f567e2a8e add document
chunhan
parents:
diff changeset
  1490
% way to create the title page. 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1491
\newif\if@restonecol
301f567e2a8e add document
chunhan
parents:
diff changeset
  1492
\def\titlepage{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
301f567e2a8e add document
chunhan
parents:
diff changeset
  1493
    \else \newpage \fi \thispagestyle{empty}\c@page\z@}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1494
\def\endtitlepage{\if@restonecol\twocolumn \else \newpage \fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1495
301f567e2a8e add document
chunhan
parents:
diff changeset
  1496
% standard values from article.cls
301f567e2a8e add document
chunhan
parents:
diff changeset
  1497
\arraycolsep     5pt
301f567e2a8e add document
chunhan
parents:
diff changeset
  1498
\arrayrulewidth .4pt
301f567e2a8e add document
chunhan
parents:
diff changeset
  1499
\doublerulesep   2pt
301f567e2a8e add document
chunhan
parents:
diff changeset
  1500
301f567e2a8e add document
chunhan
parents:
diff changeset
  1501
\tabcolsep       6pt
301f567e2a8e add document
chunhan
parents:
diff changeset
  1502
\tabbingsep      0.5em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1503
301f567e2a8e add document
chunhan
parents:
diff changeset
  1504
301f567e2a8e add document
chunhan
parents:
diff changeset
  1505
%% FOOTNOTES
301f567e2a8e add document
chunhan
parents:
diff changeset
  1506
%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1507
%\skip\footins 10pt plus 4pt minus 2pt
301f567e2a8e add document
chunhan
parents:
diff changeset
  1508
% V1.6 respond to changes in font size
301f567e2a8e add document
chunhan
parents:
diff changeset
  1509
% space added above the footnotes (if present)
301f567e2a8e add document
chunhan
parents:
diff changeset
  1510
\skip\footins 0.9\baselineskip  plus 0.4\baselineskip  minus 0.2\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  1511
301f567e2a8e add document
chunhan
parents:
diff changeset
  1512
% V1.6, we need to make \footnotesep responsive to changes
301f567e2a8e add document
chunhan
parents:
diff changeset
  1513
% in \baselineskip or strange spacings will result when in
301f567e2a8e add document
chunhan
parents:
diff changeset
  1514
% draft mode. Here is a little LaTeX secret - \footnotesep
301f567e2a8e add document
chunhan
parents:
diff changeset
  1515
% determines the height of an invisible strut that is placed
301f567e2a8e add document
chunhan
parents:
diff changeset
  1516
% *above* the baseline of footnotes after the first. Since
301f567e2a8e add document
chunhan
parents:
diff changeset
  1517
% LaTeX considers the space for characters to be 0.7/baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  1518
% above the baseline and 0.3/baselineskip below it, we need to
301f567e2a8e add document
chunhan
parents:
diff changeset
  1519
% use 0.7/baselineskip as a \footnotesep to maintain equal spacing
301f567e2a8e add document
chunhan
parents:
diff changeset
  1520
% between all the lines of the footnotes. IEEE often uses a tad
301f567e2a8e add document
chunhan
parents:
diff changeset
  1521
% more, so use 0.8\baselineskip. This slightly larger value also helps
301f567e2a8e add document
chunhan
parents:
diff changeset
  1522
% the text to clear the footnote marks. Note that \thanks in IEEEtran
301f567e2a8e add document
chunhan
parents:
diff changeset
  1523
% uses its own value of \footnotesep which is set in \maketitle.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1524
{\footnotesize
301f567e2a8e add document
chunhan
parents:
diff changeset
  1525
\global\footnotesep 0.8\baselineskip}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1526
301f567e2a8e add document
chunhan
parents:
diff changeset
  1527
301f567e2a8e add document
chunhan
parents:
diff changeset
  1528
\skip\@mpfootins = \skip\footins
301f567e2a8e add document
chunhan
parents:
diff changeset
  1529
\fboxsep = 3pt
301f567e2a8e add document
chunhan
parents:
diff changeset
  1530
\fboxrule = .4pt
301f567e2a8e add document
chunhan
parents:
diff changeset
  1531
% V1.6 use 1em, then use LaTeX2e's \@makefnmark
301f567e2a8e add document
chunhan
parents:
diff changeset
  1532
% Note that IEEE normally *left* aligns the footnote marks, so we don't need
301f567e2a8e add document
chunhan
parents:
diff changeset
  1533
% box resizing tricks here.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1534
\long\def\@makefntext#1{\parindent 1em\indent\hbox{\@makefnmark}#1}% V1.6 use 1em
301f567e2a8e add document
chunhan
parents:
diff changeset
  1535
% V1.7 compsoc does not use superscipts for footnote marks
301f567e2a8e add document
chunhan
parents:
diff changeset
  1536
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  1537
\def\@IEEEcompsocmakefnmark{\hbox{\normalfont\@thefnmark.\ }}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1538
\long\def\@makefntext#1{\parindent 1em\indent\hbox{\@IEEEcompsocmakefnmark}#1}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1539
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  1540
301f567e2a8e add document
chunhan
parents:
diff changeset
  1541
% IEEE does not use footnote rules
301f567e2a8e add document
chunhan
parents:
diff changeset
  1542
\def\footnoterule{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1543
301f567e2a8e add document
chunhan
parents:
diff changeset
  1544
% V1.7 for compsoc, IEEE uses a footnote rule only for \thanks. We devise a "one-shot"
301f567e2a8e add document
chunhan
parents:
diff changeset
  1545
% system to implement this.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1546
\newif\if@IEEEenableoneshotfootnoterule
301f567e2a8e add document
chunhan
parents:
diff changeset
  1547
\@IEEEenableoneshotfootnoterulefalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  1548
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  1549
\def\footnoterule{\relax\if@IEEEenableoneshotfootnoterule
301f567e2a8e add document
chunhan
parents:
diff changeset
  1550
\kern-5pt
301f567e2a8e add document
chunhan
parents:
diff changeset
  1551
\hbox to \columnwidth{\hfill\vrule width 0.5\columnwidth height 0.4pt\hfill}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1552
\kern4.6pt
301f567e2a8e add document
chunhan
parents:
diff changeset
  1553
\global\@IEEEenableoneshotfootnoterulefalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  1554
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  1555
\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  1556
\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1557
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  1558
301f567e2a8e add document
chunhan
parents:
diff changeset
  1559
% V1.6 do not allow LaTeX to break a footnote across multiple pages
301f567e2a8e add document
chunhan
parents:
diff changeset
  1560
\interfootnotelinepenalty=10000
301f567e2a8e add document
chunhan
parents:
diff changeset
  1561
301f567e2a8e add document
chunhan
parents:
diff changeset
  1562
% V1.6 discourage breaks within equations
301f567e2a8e add document
chunhan
parents:
diff changeset
  1563
% Note that amsmath normally sets this to 10000,
301f567e2a8e add document
chunhan
parents:
diff changeset
  1564
% but LaTeX2e normally uses 100.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1565
\interdisplaylinepenalty=2500
301f567e2a8e add document
chunhan
parents:
diff changeset
  1566
301f567e2a8e add document
chunhan
parents:
diff changeset
  1567
% default allows section depth up to /paragraph
301f567e2a8e add document
chunhan
parents:
diff changeset
  1568
\setcounter{secnumdepth}{4}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1569
301f567e2a8e add document
chunhan
parents:
diff changeset
  1570
% technotes do not allow /paragraph
301f567e2a8e add document
chunhan
parents:
diff changeset
  1571
\ifCLASSOPTIONtechnote
301f567e2a8e add document
chunhan
parents:
diff changeset
  1572
   \setcounter{secnumdepth}{3}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1573
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  1574
% neither do compsoc conferences
301f567e2a8e add document
chunhan
parents:
diff changeset
  1575
\@IEEEcompsocconfonly{\setcounter{secnumdepth}{3}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1576
301f567e2a8e add document
chunhan
parents:
diff changeset
  1577
301f567e2a8e add document
chunhan
parents:
diff changeset
  1578
\newcounter{section}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1579
\newcounter{subsection}[section]
301f567e2a8e add document
chunhan
parents:
diff changeset
  1580
\newcounter{subsubsection}[subsection]
301f567e2a8e add document
chunhan
parents:
diff changeset
  1581
\newcounter{paragraph}[subsubsection]
301f567e2a8e add document
chunhan
parents:
diff changeset
  1582
301f567e2a8e add document
chunhan
parents:
diff changeset
  1583
% used only by IEEEtran's IEEEeqnarray as other packages may
301f567e2a8e add document
chunhan
parents:
diff changeset
  1584
% have their own, different, implementations
301f567e2a8e add document
chunhan
parents:
diff changeset
  1585
\newcounter{IEEEsubequation}[equation]
301f567e2a8e add document
chunhan
parents:
diff changeset
  1586
301f567e2a8e add document
chunhan
parents:
diff changeset
  1587
% as shown when called by user from \ref, \label and in table of contents
301f567e2a8e add document
chunhan
parents:
diff changeset
  1588
\def\theequation{\arabic{equation}}                          % 1
301f567e2a8e add document
chunhan
parents:
diff changeset
  1589
\def\theIEEEsubequation{\theequation\alph{IEEEsubequation}}  % 1a (used only by IEEEtran's IEEEeqnarray)
301f567e2a8e add document
chunhan
parents:
diff changeset
  1590
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  1591
% compsoc is all arabic
301f567e2a8e add document
chunhan
parents:
diff changeset
  1592
\def\thesection{\arabic{section}}                
301f567e2a8e add document
chunhan
parents:
diff changeset
  1593
\def\thesubsection{\thesection.\arabic{subsection}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1594
\def\thesubsubsection{\thesubsection.\arabic{subsubsection}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1595
\def\theparagraph{\thesubsubsection.\arabic{paragraph}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1596
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  1597
\def\thesection{\Roman{section}}                             % I
301f567e2a8e add document
chunhan
parents:
diff changeset
  1598
% V1.7, \mbox prevents breaks around - 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1599
\def\thesubsection{\mbox{\thesection-\Alph{subsection}}}     % I-A
301f567e2a8e add document
chunhan
parents:
diff changeset
  1600
% V1.7 use I-A1 format used by IEEE rather than I-A.1
301f567e2a8e add document
chunhan
parents:
diff changeset
  1601
\def\thesubsubsection{\thesubsection\arabic{subsubsection}}  % I-A1
301f567e2a8e add document
chunhan
parents:
diff changeset
  1602
\def\theparagraph{\thesubsubsection\alph{paragraph}}         % I-A1a
301f567e2a8e add document
chunhan
parents:
diff changeset
  1603
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  1604
301f567e2a8e add document
chunhan
parents:
diff changeset
  1605
% From Heiko Oberdiek. Because of the \mbox in \thesubsection, we need to
301f567e2a8e add document
chunhan
parents:
diff changeset
  1606
% tell hyperref to disable the \mbox command when making PDF bookmarks.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1607
% This done already with hyperref.sty version 6.74o and later, but
301f567e2a8e add document
chunhan
parents:
diff changeset
  1608
% it will not hurt to do it here again for users of older versions.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1609
\@ifundefined{pdfstringdefPreHook}{\let\pdfstringdefPreHook\@empty}{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1610
\g@addto@macro\pdfstringdefPreHook{\let\mbox\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1611
301f567e2a8e add document
chunhan
parents:
diff changeset
  1612
301f567e2a8e add document
chunhan
parents:
diff changeset
  1613
% Main text forms (how shown in main text headings)
301f567e2a8e add document
chunhan
parents:
diff changeset
  1614
% V1.6, using \thesection in \thesectiondis allows changes
301f567e2a8e add document
chunhan
parents:
diff changeset
  1615
% in the former to automatically appear in the latter
301f567e2a8e add document
chunhan
parents:
diff changeset
  1616
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  1617
  \ifCLASSOPTIONconference% compsoc conference
301f567e2a8e add document
chunhan
parents:
diff changeset
  1618
    \def\thesectiondis{\thesection.}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1619
    \def\thesubsectiondis{\thesectiondis\arabic{subsection}.}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1620
    \def\thesubsubsectiondis{\thesubsectiondis\arabic{subsubsection}.}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1621
    \def\theparagraphdis{\thesubsubsectiondis\arabic{paragraph}.}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1622
  \else% compsoc not conferencs
301f567e2a8e add document
chunhan
parents:
diff changeset
  1623
    \def\thesectiondis{\thesection}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1624
    \def\thesubsectiondis{\thesectiondis.\arabic{subsection}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1625
    \def\thesubsubsectiondis{\thesubsectiondis.\arabic{subsubsection}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1626
    \def\theparagraphdis{\thesubsubsectiondis.\arabic{paragraph}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1627
  \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  1628
\else% not compsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  1629
  \def\thesectiondis{\thesection.}                   % I.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1630
  \def\thesubsectiondis{\Alph{subsection}.}          % B.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1631
  \def\thesubsubsectiondis{\arabic{subsubsection})}  % 3)
301f567e2a8e add document
chunhan
parents:
diff changeset
  1632
  \def\theparagraphdis{\alph{paragraph})}            % d)
301f567e2a8e add document
chunhan
parents:
diff changeset
  1633
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  1634
301f567e2a8e add document
chunhan
parents:
diff changeset
  1635
% just like LaTeX2e's \@eqnnum
301f567e2a8e add document
chunhan
parents:
diff changeset
  1636
\def\theequationdis{{\normalfont \normalcolor (\theequation)}}% (1)
301f567e2a8e add document
chunhan
parents:
diff changeset
  1637
% IEEEsubequation used only by IEEEtran's IEEEeqnarray
301f567e2a8e add document
chunhan
parents:
diff changeset
  1638
\def\theIEEEsubequationdis{{\normalfont \normalcolor (\theIEEEsubequation)}}% (1a)
301f567e2a8e add document
chunhan
parents:
diff changeset
  1639
% redirect LaTeX2e's equation number display and all that depend on
301f567e2a8e add document
chunhan
parents:
diff changeset
  1640
% it, through IEEEtran's \theequationdis
301f567e2a8e add document
chunhan
parents:
diff changeset
  1641
\def\@eqnnum{\theequationdis}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1642
301f567e2a8e add document
chunhan
parents:
diff changeset
  1643
301f567e2a8e add document
chunhan
parents:
diff changeset
  1644
301f567e2a8e add document
chunhan
parents:
diff changeset
  1645
% V1.7 provide string macros as article.cls does
301f567e2a8e add document
chunhan
parents:
diff changeset
  1646
\def\contentsname{Contents}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1647
\def\listfigurename{List of Figures}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1648
\def\listtablename{List of Tables}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1649
\def\refname{References}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1650
\def\indexname{Index}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1651
\def\figurename{Fig.}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1652
\def\tablename{TABLE}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1653
\@IEEEcompsocconfonly{\def\figurename{Figure}\def\tablename{Table}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1654
\def\partname{Part}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1655
\def\appendixname{Appendix}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1656
\def\abstractname{Abstract}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1657
% IEEE specific names
301f567e2a8e add document
chunhan
parents:
diff changeset
  1658
\def\IEEEkeywordsname{Keywords}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1659
\def\IEEEproofname{Proof}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1660
301f567e2a8e add document
chunhan
parents:
diff changeset
  1661
301f567e2a8e add document
chunhan
parents:
diff changeset
  1662
% LIST OF FIGURES AND TABLES AND TABLE OF CONTENTS
301f567e2a8e add document
chunhan
parents:
diff changeset
  1663
%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1664
\def\@pnumwidth{1.55em}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1665
\def\@tocrmarg{2.55em}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1666
\def\@dotsep{4.5}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1667
\setcounter{tocdepth}{3}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1668
301f567e2a8e add document
chunhan
parents:
diff changeset
  1669
% adjusted some spacings here so that section numbers will not easily 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1670
% collide with the section titles. 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1671
% VIII; VIII-A; and VIII-A.1 are usually the worst offenders.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1672
% MDS 1/2001
301f567e2a8e add document
chunhan
parents:
diff changeset
  1673
\def\tableofcontents{\section*{\contentsname}\@starttoc{toc}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1674
\def\l@section#1#2{\addpenalty{\@secpenalty}\addvspace{1.0em plus 1pt}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1675
    \@tempdima 2.75em \begingroup \parindent \z@ \rightskip \@pnumwidth%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1676
    \parfillskip-\@pnumwidth {\bfseries\leavevmode #1}\hfil\hbox to\@pnumwidth{\hss #2}\par%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1677
    \endgroup}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1678
% argument format #1:level, #2:labelindent,#3:labelsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  1679
\def\l@subsection{\@dottedtocline{2}{2.75em}{3.75em}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1680
\def\l@subsubsection{\@dottedtocline{3}{6.5em}{4.5em}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1681
% must provide \l@ defs for ALL sublevels EVEN if tocdepth
301f567e2a8e add document
chunhan
parents:
diff changeset
  1682
% is such as they will not appear in the table of contents
301f567e2a8e add document
chunhan
parents:
diff changeset
  1683
% these defs are how TOC knows what level these things are!
301f567e2a8e add document
chunhan
parents:
diff changeset
  1684
\def\l@paragraph{\@dottedtocline{4}{6.5em}{5.5em}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1685
\def\l@subparagraph{\@dottedtocline{5}{6.5em}{6.5em}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1686
\def\listoffigures{\section*{\listfigurename}\@starttoc{lof}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1687
\def\l@figure{\@dottedtocline{1}{0em}{2.75em}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1688
\def\listoftables{\section*{\listtablename}\@starttoc{lot}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1689
\let\l@table\l@figure
301f567e2a8e add document
chunhan
parents:
diff changeset
  1690
301f567e2a8e add document
chunhan
parents:
diff changeset
  1691
301f567e2a8e add document
chunhan
parents:
diff changeset
  1692
%% Definitions for floats
301f567e2a8e add document
chunhan
parents:
diff changeset
  1693
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1694
%% Normal Floats
301f567e2a8e add document
chunhan
parents:
diff changeset
  1695
\floatsep 1\baselineskip plus  0.2\baselineskip minus  0.2\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  1696
\textfloatsep 1.7\baselineskip plus  0.2\baselineskip minus  0.4\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  1697
\@fptop 0pt plus 1fil
301f567e2a8e add document
chunhan
parents:
diff changeset
  1698
\@fpsep 0.75\baselineskip plus 2fil 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1699
\@fpbot 0pt plus 1fil
301f567e2a8e add document
chunhan
parents:
diff changeset
  1700
\def\topfraction{0.9}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1701
\def\bottomfraction{0.4}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1702
\def\floatpagefraction{0.8}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1703
% V1.7, let top floats approach 90% of page
301f567e2a8e add document
chunhan
parents:
diff changeset
  1704
\def\textfraction{0.1}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1705
301f567e2a8e add document
chunhan
parents:
diff changeset
  1706
%% Double Column Floats
301f567e2a8e add document
chunhan
parents:
diff changeset
  1707
\dblfloatsep 1\baselineskip plus  0.2\baselineskip minus  0.2\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  1708
301f567e2a8e add document
chunhan
parents:
diff changeset
  1709
\dbltextfloatsep 1.7\baselineskip plus  0.2\baselineskip minus  0.4\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  1710
% Note that it would be nice if the rubber here actually worked in LaTeX2e.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1711
% There is a long standing limitation in LaTeX, first discovered (to the best
301f567e2a8e add document
chunhan
parents:
diff changeset
  1712
% of my knowledge) by Alan Jeffrey in 1992. LaTeX ignores the stretchable
301f567e2a8e add document
chunhan
parents:
diff changeset
  1713
% portion of \dbltextfloatsep, and as a result, double column figures can and
301f567e2a8e add document
chunhan
parents:
diff changeset
  1714
% do result in an non-integer number of lines in the main text columns with
301f567e2a8e add document
chunhan
parents:
diff changeset
  1715
% underfull vbox errors as a consequence. A post to comp.text.tex
301f567e2a8e add document
chunhan
parents:
diff changeset
  1716
% by Donald Arseneau confirms that this had not yet been fixed in 1998.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1717
% IEEEtran V1.6 will fix this problem for you in the titles, but it doesn't
301f567e2a8e add document
chunhan
parents:
diff changeset
  1718
% protect you from other double floats. Happy vspace'ing.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1719
301f567e2a8e add document
chunhan
parents:
diff changeset
  1720
\@dblfptop 0pt plus 1fil
301f567e2a8e add document
chunhan
parents:
diff changeset
  1721
\@dblfpsep 0.75\baselineskip plus 2fil
301f567e2a8e add document
chunhan
parents:
diff changeset
  1722
\@dblfpbot 0pt plus 1fil
301f567e2a8e add document
chunhan
parents:
diff changeset
  1723
\def\dbltopfraction{0.8}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1724
\def\dblfloatpagefraction{0.8}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1725
\setcounter{dbltopnumber}{4}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1726
301f567e2a8e add document
chunhan
parents:
diff changeset
  1727
\intextsep 1\baselineskip plus 0.2\baselineskip minus  0.2\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  1728
\setcounter{topnumber}{2}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1729
\setcounter{bottomnumber}{2}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1730
\setcounter{totalnumber}{4}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1731
301f567e2a8e add document
chunhan
parents:
diff changeset
  1732
301f567e2a8e add document
chunhan
parents:
diff changeset
  1733
301f567e2a8e add document
chunhan
parents:
diff changeset
  1734
% article class provides these, we should too.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1735
\newlength\abovecaptionskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  1736
\newlength\belowcaptionskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  1737
% but only \abovecaptionskip is used above figure captions and *below* table
301f567e2a8e add document
chunhan
parents:
diff changeset
  1738
% captions
301f567e2a8e add document
chunhan
parents:
diff changeset
  1739
\setlength\abovecaptionskip{0.5\baselineskip}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1740
\setlength\belowcaptionskip{0pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1741
% V1.6 create hooks in case the caption spacing ever needs to be
301f567e2a8e add document
chunhan
parents:
diff changeset
  1742
% overridden by a user
301f567e2a8e add document
chunhan
parents:
diff changeset
  1743
\def\@IEEEfigurecaptionsepspace{\vskip\abovecaptionskip\relax}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1744
\def\@IEEEtablecaptionsepspace{\vskip\abovecaptionskip\relax}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1745
301f567e2a8e add document
chunhan
parents:
diff changeset
  1746
301f567e2a8e add document
chunhan
parents:
diff changeset
  1747
% 1.6b revise caption system so that \@makecaption uses two arguments
301f567e2a8e add document
chunhan
parents:
diff changeset
  1748
% as with LaTeX2e. Otherwise, there will be problems when using hyperref.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1749
\def\@IEEEtablestring{table}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1750
301f567e2a8e add document
chunhan
parents:
diff changeset
  1751
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  1752
% V1.7 compsoc \@makecaption
301f567e2a8e add document
chunhan
parents:
diff changeset
  1753
\ifCLASSOPTIONconference% compsoc conference
301f567e2a8e add document
chunhan
parents:
diff changeset
  1754
\long\def\@makecaption#1#2{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1755
% test if is a for a figure or table
301f567e2a8e add document
chunhan
parents:
diff changeset
  1756
\ifx\@captype\@IEEEtablestring%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1757
% if a table, do table caption
301f567e2a8e add document
chunhan
parents:
diff changeset
  1758
\normalsize\begin{center}{\normalfont\sffamily\normalsize {#1.}~ #2}\end{center}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1759
\@IEEEtablecaptionsepspace
301f567e2a8e add document
chunhan
parents:
diff changeset
  1760
% if not a table, format it as a figure
301f567e2a8e add document
chunhan
parents:
diff changeset
  1761
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  1762
\@IEEEfigurecaptionsepspace
301f567e2a8e add document
chunhan
parents:
diff changeset
  1763
\setbox\@tempboxa\hbox{\normalfont\sffamily\normalsize {#1.}~ #2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1764
\ifdim \wd\@tempboxa >\hsize%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1765
% if caption is longer than a line, let it wrap around
301f567e2a8e add document
chunhan
parents:
diff changeset
  1766
\setbox\@tempboxa\hbox{\normalfont\sffamily\normalsize {#1.}~ }%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1767
\parbox[t]{\hsize}{\normalfont\sffamily\normalsize \noindent\unhbox\@tempboxa#2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1768
% if caption is shorter than a line, center
301f567e2a8e add document
chunhan
parents:
diff changeset
  1769
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1770
\hbox to\hsize{\normalfont\sffamily\normalsize\hfil\box\@tempboxa\hfil}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1771
\fi\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1772
\else% nonconference compsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  1773
\long\def\@makecaption#1#2{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1774
% test if is a for a figure or table
301f567e2a8e add document
chunhan
parents:
diff changeset
  1775
\ifx\@captype\@IEEEtablestring%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1776
% if a table, do table caption
301f567e2a8e add document
chunhan
parents:
diff changeset
  1777
\normalsize\begin{center}{\normalfont\sffamily\normalsize #1}\\{\normalfont\sffamily\normalsize #2}\end{center}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1778
\@IEEEtablecaptionsepspace
301f567e2a8e add document
chunhan
parents:
diff changeset
  1779
% if not a table, format it as a figure
301f567e2a8e add document
chunhan
parents:
diff changeset
  1780
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  1781
\@IEEEfigurecaptionsepspace
301f567e2a8e add document
chunhan
parents:
diff changeset
  1782
\setbox\@tempboxa\hbox{\normalfont\sffamily\normalsize {#1.}~ #2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1783
\ifdim \wd\@tempboxa >\hsize%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1784
% if caption is longer than a line, let it wrap around
301f567e2a8e add document
chunhan
parents:
diff changeset
  1785
\setbox\@tempboxa\hbox{\normalfont\sffamily\normalsize {#1.}~ }%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1786
\parbox[t]{\hsize}{\normalfont\sffamily\normalsize \noindent\unhbox\@tempboxa#2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1787
% if caption is shorter than a line, left justify
301f567e2a8e add document
chunhan
parents:
diff changeset
  1788
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1789
\hbox to\hsize{\normalfont\sffamily\normalsize\box\@tempboxa\hfil}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1790
\fi\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1791
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  1792
301f567e2a8e add document
chunhan
parents:
diff changeset
  1793
\else% traditional noncompsoc \@makecaption
301f567e2a8e add document
chunhan
parents:
diff changeset
  1794
\long\def\@makecaption#1#2{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1795
% test if is a for a figure or table
301f567e2a8e add document
chunhan
parents:
diff changeset
  1796
\ifx\@captype\@IEEEtablestring%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1797
% if a table, do table caption
301f567e2a8e add document
chunhan
parents:
diff changeset
  1798
\footnotesize\begin{center}{\normalfont\footnotesize #1}\\{\normalfont\footnotesize\scshape #2}\end{center}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1799
\@IEEEtablecaptionsepspace
301f567e2a8e add document
chunhan
parents:
diff changeset
  1800
% if not a table, format it as a figure
301f567e2a8e add document
chunhan
parents:
diff changeset
  1801
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  1802
\@IEEEfigurecaptionsepspace
301f567e2a8e add document
chunhan
parents:
diff changeset
  1803
% 3/2001 use footnotesize, not small; use two nonbreaking spaces, not one
301f567e2a8e add document
chunhan
parents:
diff changeset
  1804
\setbox\@tempboxa\hbox{\normalfont\footnotesize {#1.}~~ #2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1805
\ifdim \wd\@tempboxa >\hsize%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1806
% if caption is longer than a line, let it wrap around
301f567e2a8e add document
chunhan
parents:
diff changeset
  1807
\setbox\@tempboxa\hbox{\normalfont\footnotesize {#1.}~~ }%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1808
\parbox[t]{\hsize}{\normalfont\footnotesize\noindent\unhbox\@tempboxa#2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1809
% if caption is shorter than a line, center if conference, left justify otherwise
301f567e2a8e add document
chunhan
parents:
diff changeset
  1810
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1811
\ifCLASSOPTIONconference \hbox to\hsize{\normalfont\footnotesize\hfil\box\@tempboxa\hfil}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1812
\else \hbox to\hsize{\normalfont\footnotesize\box\@tempboxa\hfil}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1813
\fi\fi\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1814
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  1815
301f567e2a8e add document
chunhan
parents:
diff changeset
  1816
301f567e2a8e add document
chunhan
parents:
diff changeset
  1817
301f567e2a8e add document
chunhan
parents:
diff changeset
  1818
% V1.7 disable captions class option, do so in a way that retains operation of \label
301f567e2a8e add document
chunhan
parents:
diff changeset
  1819
% within \caption
301f567e2a8e add document
chunhan
parents:
diff changeset
  1820
\ifCLASSOPTIONcaptionsoff
301f567e2a8e add document
chunhan
parents:
diff changeset
  1821
\long\def\@makecaption#1#2{\vspace*{2em}\footnotesize\begin{center}{\footnotesize #1}\end{center}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1822
\let\@IEEEtemporiglabeldefsave\label
301f567e2a8e add document
chunhan
parents:
diff changeset
  1823
\let\@IEEEtemplabelargsave\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  1824
\def\label##1{\gdef\@IEEEtemplabelargsave{##1}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1825
\setbox\@tempboxa\hbox{#2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1826
\let\label\@IEEEtemporiglabeldefsave
301f567e2a8e add document
chunhan
parents:
diff changeset
  1827
\ifx\@IEEEtemplabelargsave\relax\else\label{\@IEEEtemplabelargsave}\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1828
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  1829
301f567e2a8e add document
chunhan
parents:
diff changeset
  1830
301f567e2a8e add document
chunhan
parents:
diff changeset
  1831
% V1.7 define end environments with \def not \let so as to work OK with
301f567e2a8e add document
chunhan
parents:
diff changeset
  1832
% preview-latex
301f567e2a8e add document
chunhan
parents:
diff changeset
  1833
\newcounter{figure}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1834
\def\thefigure{\@arabic\c@figure}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1835
\def\fps@figure{tbp}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1836
\def\ftype@figure{1}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1837
\def\ext@figure{lof}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1838
\def\fnum@figure{\figurename~\thefigure}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1839
\def\figure{\@float{figure}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1840
\def\endfigure{\end@float}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1841
\@namedef{figure*}{\@dblfloat{figure}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1842
\@namedef{endfigure*}{\end@dblfloat}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1843
\newcounter{table}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1844
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  1845
\def\thetable{\arabic{table}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1846
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  1847
\def\thetable{\@Roman\c@table}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1848
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  1849
\def\fps@table{tbp}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1850
\def\ftype@table{2}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1851
\def\ext@table{lot}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1852
\def\fnum@table{\tablename~\thetable}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1853
% V1.6 IEEE uses 8pt text for tables
301f567e2a8e add document
chunhan
parents:
diff changeset
  1854
% to default to footnotesize, we hack into LaTeX2e's \@floatboxreset and pray
301f567e2a8e add document
chunhan
parents:
diff changeset
  1855
\def\table{\def\@floatboxreset{\reset@font\footnotesize\@setminipage}\@float{table}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1856
\def\endtable{\end@float}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1857
% v1.6b double column tables need to default to footnotesize as well.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1858
\@namedef{table*}{\def\@floatboxreset{\reset@font\footnotesize\@setminipage}\@dblfloat{table}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1859
\@namedef{endtable*}{\end@dblfloat}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1860
301f567e2a8e add document
chunhan
parents:
diff changeset
  1861
301f567e2a8e add document
chunhan
parents:
diff changeset
  1862
301f567e2a8e add document
chunhan
parents:
diff changeset
  1863
301f567e2a8e add document
chunhan
parents:
diff changeset
  1864
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1865
%% START OF IEEEeqnarry DEFINITIONS
301f567e2a8e add document
chunhan
parents:
diff changeset
  1866
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1867
%% Inspired by the concepts, examples, and previous works of LaTeX 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1868
%% coders and developers such as Donald Arseneau, Fred Bartlett, 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1869
%% David Carlisle, Tony Liu, Frank Mittelbach, Piet van Oostrum, 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1870
%% Roland Winkler and Mark Wooding.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1871
%% I don't make the claim that my work here is even near their calibre. ;)
301f567e2a8e add document
chunhan
parents:
diff changeset
  1872
301f567e2a8e add document
chunhan
parents:
diff changeset
  1873
301f567e2a8e add document
chunhan
parents:
diff changeset
  1874
% hook to allow easy changeover to IEEEtran.cls/tools.sty error reporting
301f567e2a8e add document
chunhan
parents:
diff changeset
  1875
\def\@IEEEclspkgerror{\ClassError{IEEEtran}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1876
301f567e2a8e add document
chunhan
parents:
diff changeset
  1877
\newif\if@IEEEeqnarraystarform% flag to indicate if the environment was called as the star form
301f567e2a8e add document
chunhan
parents:
diff changeset
  1878
\@IEEEeqnarraystarformfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  1879
301f567e2a8e add document
chunhan
parents:
diff changeset
  1880
\newif\if@advanceIEEEeqncolcnt% tracks if the environment should advance the col counter
301f567e2a8e add document
chunhan
parents:
diff changeset
  1881
% allows a way to make an \IEEEeqnarraybox that can be used within an \IEEEeqnarray
301f567e2a8e add document
chunhan
parents:
diff changeset
  1882
% used by IEEEeqnarraymulticol so that it can work properly in both
301f567e2a8e add document
chunhan
parents:
diff changeset
  1883
\@advanceIEEEeqncolcnttrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  1884
301f567e2a8e add document
chunhan
parents:
diff changeset
  1885
\newcount\@IEEEeqnnumcols % tracks how many IEEEeqnarray cols are defined
301f567e2a8e add document
chunhan
parents:
diff changeset
  1886
\newcount\@IEEEeqncolcnt  % tracks how many IEEEeqnarray cols the user actually used
301f567e2a8e add document
chunhan
parents:
diff changeset
  1887
301f567e2a8e add document
chunhan
parents:
diff changeset
  1888
301f567e2a8e add document
chunhan
parents:
diff changeset
  1889
% The default math style used by the columns
301f567e2a8e add document
chunhan
parents:
diff changeset
  1890
\def\IEEEeqnarraymathstyle{\displaystyle}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1891
% The default text style used by the columns
301f567e2a8e add document
chunhan
parents:
diff changeset
  1892
% default to using the current font
301f567e2a8e add document
chunhan
parents:
diff changeset
  1893
\def\IEEEeqnarraytextstyle{\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1894
301f567e2a8e add document
chunhan
parents:
diff changeset
  1895
% like the iedlistdecl but for \IEEEeqnarray
301f567e2a8e add document
chunhan
parents:
diff changeset
  1896
\def\IEEEeqnarraydecl{\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1897
\def\IEEEeqnarrayboxdecl{\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1898
301f567e2a8e add document
chunhan
parents:
diff changeset
  1899
% \yesnumber is the opposite of \nonumber
301f567e2a8e add document
chunhan
parents:
diff changeset
  1900
% a novel concept with the same def as the equationarray package
301f567e2a8e add document
chunhan
parents:
diff changeset
  1901
% However, we give IEEE versions too since some LaTeX packages such as 
301f567e2a8e add document
chunhan
parents:
diff changeset
  1902
% the MDWtools mathenv.sty redefine \nonumber to something else.
301f567e2a8e add document
chunhan
parents:
diff changeset
  1903
\providecommand{\yesnumber}{\global\@eqnswtrue}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1904
\def\IEEEyesnumber{\global\@eqnswtrue}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1905
\def\IEEEnonumber{\global\@eqnswfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1906
301f567e2a8e add document
chunhan
parents:
diff changeset
  1907
301f567e2a8e add document
chunhan
parents:
diff changeset
  1908
\def\IEEEyessubnumber{\global\@IEEEissubequationtrue\global\@eqnswtrue%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1909
\if@IEEEeqnarrayISinner% only do something inside an IEEEeqnarray
301f567e2a8e add document
chunhan
parents:
diff changeset
  1910
\if@IEEElastlinewassubequation\addtocounter{equation}{-1}\else\setcounter{IEEEsubequation}{1}\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1911
\def\@currentlabel{\p@IEEEsubequation\theIEEEsubequation}\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1912
301f567e2a8e add document
chunhan
parents:
diff changeset
  1913
% flag to indicate that an equation is a sub equation
301f567e2a8e add document
chunhan
parents:
diff changeset
  1914
\newif\if@IEEEissubequation%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1915
\@IEEEissubequationfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  1916
301f567e2a8e add document
chunhan
parents:
diff changeset
  1917
% allows users to "push away" equations that get too close to the equation numbers
301f567e2a8e add document
chunhan
parents:
diff changeset
  1918
\def\IEEEeqnarraynumspace{\hphantom{\if@IEEEissubequation\theIEEEsubequationdis\else\theequationdis\fi}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1919
301f567e2a8e add document
chunhan
parents:
diff changeset
  1920
% provides a way to span multiple columns within IEEEeqnarray environments
301f567e2a8e add document
chunhan
parents:
diff changeset
  1921
% will consider \if@advanceIEEEeqncolcnt before globally advancing the
301f567e2a8e add document
chunhan
parents:
diff changeset
  1922
% column counter - so as to work within \IEEEeqnarraybox
301f567e2a8e add document
chunhan
parents:
diff changeset
  1923
% usage: \IEEEeqnarraymulticol{number cols. to span}{col type}{cell text}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1924
\long\def\IEEEeqnarraymulticol#1#2#3{\multispan{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1925
% check if column is defined
301f567e2a8e add document
chunhan
parents:
diff changeset
  1926
\relax\expandafter\ifx\csname @IEEEeqnarraycolDEF#2\endcsname\@IEEEeqnarraycolisdefined%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1927
\csname @IEEEeqnarraycolPRE#2\endcsname#3\relax\relax\relax\relax\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1928
\relax\relax\relax\relax\relax\csname @IEEEeqnarraycolPOST#2\endcsname%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1929
\else% if not, error and use default type
301f567e2a8e add document
chunhan
parents:
diff changeset
  1930
\@IEEEclspkgerror{Invalid column type "#2" in \string\IEEEeqnarraymulticol.\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  1931
Using a default centering column instead}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1932
{You must define IEEEeqnarray column types before use.}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1933
\csname @IEEEeqnarraycolPRE@IEEEdefault\endcsname#3\relax\relax\relax\relax\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1934
\relax\relax\relax\relax\relax\csname @IEEEeqnarraycolPOST@IEEEdefault\endcsname%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1935
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1936
% advance column counter only if the IEEEeqnarray environment wants it
301f567e2a8e add document
chunhan
parents:
diff changeset
  1937
\if@advanceIEEEeqncolcnt\global\advance\@IEEEeqncolcnt by #1\relax\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1938
301f567e2a8e add document
chunhan
parents:
diff changeset
  1939
% like \omit, but maintains track of the column counter for \IEEEeqnarray
301f567e2a8e add document
chunhan
parents:
diff changeset
  1940
\def\IEEEeqnarrayomit{\omit\if@advanceIEEEeqncolcnt\global\advance\@IEEEeqncolcnt by 1\relax\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1941
301f567e2a8e add document
chunhan
parents:
diff changeset
  1942
301f567e2a8e add document
chunhan
parents:
diff changeset
  1943
% provides a way to define a letter referenced column type
301f567e2a8e add document
chunhan
parents:
diff changeset
  1944
% usage: \IEEEeqnarraydefcol{col. type letter/name}{pre insertion text}{post insertion text}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1945
\def\IEEEeqnarraydefcol#1#2#3{\expandafter\def\csname @IEEEeqnarraycolPRE#1\endcsname{#2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1946
\expandafter\def\csname @IEEEeqnarraycolPOST#1\endcsname{#3}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1947
\expandafter\def\csname @IEEEeqnarraycolDEF#1\endcsname{1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1948
301f567e2a8e add document
chunhan
parents:
diff changeset
  1949
301f567e2a8e add document
chunhan
parents:
diff changeset
  1950
% provides a way to define a numerically referenced inter-column glue types
301f567e2a8e add document
chunhan
parents:
diff changeset
  1951
% usage: \IEEEeqnarraydefcolsep{col. glue number}{glue definition}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1952
\def\IEEEeqnarraydefcolsep#1#2{\expandafter\def\csname @IEEEeqnarraycolSEP\romannumeral #1\endcsname{#2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1953
\expandafter\def\csname @IEEEeqnarraycolSEPDEF\romannumeral #1\endcsname{1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1954
301f567e2a8e add document
chunhan
parents:
diff changeset
  1955
301f567e2a8e add document
chunhan
parents:
diff changeset
  1956
\def\@IEEEeqnarraycolisdefined{1}% just a macro for 1, used for checking undefined column types
301f567e2a8e add document
chunhan
parents:
diff changeset
  1957
301f567e2a8e add document
chunhan
parents:
diff changeset
  1958
301f567e2a8e add document
chunhan
parents:
diff changeset
  1959
% expands and appends the given argument to the \@IEEEtrantmptoksA token list
301f567e2a8e add document
chunhan
parents:
diff changeset
  1960
% used to build up the \halign preamble
301f567e2a8e add document
chunhan
parents:
diff changeset
  1961
\def\@IEEEappendtoksA#1{\edef\@@IEEEappendtoksA{\@IEEEtrantmptoksA={\the\@IEEEtrantmptoksA #1}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1962
\@@IEEEappendtoksA}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1963
301f567e2a8e add document
chunhan
parents:
diff changeset
  1964
% also appends to \@IEEEtrantmptoksA, but does not expand the argument
301f567e2a8e add document
chunhan
parents:
diff changeset
  1965
% uses \toks8 as a scratchpad register
301f567e2a8e add document
chunhan
parents:
diff changeset
  1966
\def\@IEEEappendNOEXPANDtoksA#1{\toks8={#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1967
\edef\@@IEEEappendNOEXPANDtoksA{\@IEEEtrantmptoksA={\the\@IEEEtrantmptoksA\the\toks8}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1968
\@@IEEEappendNOEXPANDtoksA}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1969
301f567e2a8e add document
chunhan
parents:
diff changeset
  1970
% define some common column types for the user
301f567e2a8e add document
chunhan
parents:
diff changeset
  1971
% math
301f567e2a8e add document
chunhan
parents:
diff changeset
  1972
\IEEEeqnarraydefcol{l}{$\IEEEeqnarraymathstyle}{$\hfil}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1973
\IEEEeqnarraydefcol{c}{\hfil$\IEEEeqnarraymathstyle}{$\hfil}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1974
\IEEEeqnarraydefcol{r}{\hfil$\IEEEeqnarraymathstyle}{$}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1975
\IEEEeqnarraydefcol{L}{$\IEEEeqnarraymathstyle{}}{{}$\hfil}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1976
\IEEEeqnarraydefcol{C}{\hfil$\IEEEeqnarraymathstyle{}}{{}$\hfil}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1977
\IEEEeqnarraydefcol{R}{\hfil$\IEEEeqnarraymathstyle{}}{{}$}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1978
% text
301f567e2a8e add document
chunhan
parents:
diff changeset
  1979
\IEEEeqnarraydefcol{s}{\IEEEeqnarraytextstyle}{\hfil}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1980
\IEEEeqnarraydefcol{t}{\hfil\IEEEeqnarraytextstyle}{\hfil}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1981
\IEEEeqnarraydefcol{u}{\hfil\IEEEeqnarraytextstyle}{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1982
301f567e2a8e add document
chunhan
parents:
diff changeset
  1983
% vertical rules
301f567e2a8e add document
chunhan
parents:
diff changeset
  1984
\IEEEeqnarraydefcol{v}{}{\vrule width\arrayrulewidth}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1985
\IEEEeqnarraydefcol{vv}{\vrule width\arrayrulewidth\hfil}{\hfil\vrule width\arrayrulewidth}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1986
\IEEEeqnarraydefcol{V}{}{\vrule width\arrayrulewidth\hskip\doublerulesep\vrule width\arrayrulewidth}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1987
\IEEEeqnarraydefcol{VV}{\vrule width\arrayrulewidth\hskip\doublerulesep\vrule width\arrayrulewidth\hfil}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  1988
{\hfil\vrule width\arrayrulewidth\hskip\doublerulesep\vrule width\arrayrulewidth}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1989
301f567e2a8e add document
chunhan
parents:
diff changeset
  1990
% horizontal rules
301f567e2a8e add document
chunhan
parents:
diff changeset
  1991
\IEEEeqnarraydefcol{h}{}{\leaders\hrule height\arrayrulewidth\hfil}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1992
\IEEEeqnarraydefcol{H}{}{\leaders\vbox{\hrule width\arrayrulewidth\vskip\doublerulesep\hrule width\arrayrulewidth}\hfil}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1993
301f567e2a8e add document
chunhan
parents:
diff changeset
  1994
% plain
301f567e2a8e add document
chunhan
parents:
diff changeset
  1995
\IEEEeqnarraydefcol{x}{}{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1996
\IEEEeqnarraydefcol{X}{$}{$}
301f567e2a8e add document
chunhan
parents:
diff changeset
  1997
301f567e2a8e add document
chunhan
parents:
diff changeset
  1998
% the default column type to use in the event a column type is not defined
301f567e2a8e add document
chunhan
parents:
diff changeset
  1999
\IEEEeqnarraydefcol{@IEEEdefault}{\hfil$\IEEEeqnarraymathstyle}{$\hfil}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2000
301f567e2a8e add document
chunhan
parents:
diff changeset
  2001
301f567e2a8e add document
chunhan
parents:
diff changeset
  2002
% a zero tabskip (used for "-" col types)
301f567e2a8e add document
chunhan
parents:
diff changeset
  2003
\def\@IEEEeqnarraycolSEPzero{0pt plus 0pt minus 0pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2004
% a centering tabskip (used for "+" col types)
301f567e2a8e add document
chunhan
parents:
diff changeset
  2005
\def\@IEEEeqnarraycolSEPcenter{1000pt plus 0pt minus 1000pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2006
301f567e2a8e add document
chunhan
parents:
diff changeset
  2007
% top level default tabskip glues for the start, end, and inter-column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2008
% may be reset within environments not always at the top level, e.g., \IEEEeqnarraybox
301f567e2a8e add document
chunhan
parents:
diff changeset
  2009
\edef\@IEEEeqnarraycolSEPdefaultstart{\@IEEEeqnarraycolSEPcenter}% default start glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2010
\edef\@IEEEeqnarraycolSEPdefaultend{\@IEEEeqnarraycolSEPcenter}% default end glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2011
\edef\@IEEEeqnarraycolSEPdefaultmid{\@IEEEeqnarraycolSEPzero}% default inter-column glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2012
301f567e2a8e add document
chunhan
parents:
diff changeset
  2013
301f567e2a8e add document
chunhan
parents:
diff changeset
  2014
301f567e2a8e add document
chunhan
parents:
diff changeset
  2015
% creates a vertical rule that extends from the bottom to the top a a cell
301f567e2a8e add document
chunhan
parents:
diff changeset
  2016
% Provided in case other packages redefine \vline some other way.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2017
% usage: \IEEEeqnarrayvrule[rule thickness]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2018
% If no argument is provided, \arrayrulewidth will be used for the rule thickness. 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2019
\newcommand\IEEEeqnarrayvrule[1][\arrayrulewidth]{\vrule\@width#1\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2020
301f567e2a8e add document
chunhan
parents:
diff changeset
  2021
% creates a blank separator row
301f567e2a8e add document
chunhan
parents:
diff changeset
  2022
% usage: \IEEEeqnarrayseprow[separation length][font size commands]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2023
% default is \IEEEeqnarrayseprow[0.25\normalbaselineskip][\relax]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2024
% blank arguments inherit the default values
301f567e2a8e add document
chunhan
parents:
diff changeset
  2025
% uses \skip5 as a scratch register - calls \@IEEEeqnarraystrutsize which uses more scratch registers
301f567e2a8e add document
chunhan
parents:
diff changeset
  2026
\def\IEEEeqnarrayseprow{\relax\@ifnextchar[{\@IEEEeqnarrayseprow}{\@IEEEeqnarrayseprow[0.25\normalbaselineskip]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2027
\def\@IEEEeqnarrayseprow[#1]{\relax\@ifnextchar[{\@@IEEEeqnarrayseprow[#1]}{\@@IEEEeqnarrayseprow[#1][\relax]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2028
\def\@@IEEEeqnarrayseprow[#1][#2]{\def\@IEEEeqnarrayseprowARGONE{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2029
\ifx\@IEEEeqnarrayseprowARGONE\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2030
% get the skip value, based on the font commands
301f567e2a8e add document
chunhan
parents:
diff changeset
  2031
% use skip5 because \IEEEeqnarraystrutsize uses \skip0, \skip2, \skip3
301f567e2a8e add document
chunhan
parents:
diff changeset
  2032
% assign within a bogus box to confine the font changes
301f567e2a8e add document
chunhan
parents:
diff changeset
  2033
{\setbox0=\hbox{#2\relax\global\skip5=0.25\normalbaselineskip}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2034
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2035
{\setbox0=\hbox{#2\relax\global\skip5=#1}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2036
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2037
\@IEEEeqnarrayhoptolastcolumn\IEEEeqnarraystrutsize{\skip5}{0pt}[\relax]\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2038
301f567e2a8e add document
chunhan
parents:
diff changeset
  2039
% creates a blank separator row, but omits all the column templates
301f567e2a8e add document
chunhan
parents:
diff changeset
  2040
% usage: \IEEEeqnarrayseprowcut[separation length][font size commands]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2041
% default is \IEEEeqnarrayseprowcut[0.25\normalbaselineskip][\relax]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2042
% blank arguments inherit the default values
301f567e2a8e add document
chunhan
parents:
diff changeset
  2043
% uses \skip5 as a scratch register - calls \@IEEEeqnarraystrutsize which uses more scratch registers
301f567e2a8e add document
chunhan
parents:
diff changeset
  2044
\def\IEEEeqnarrayseprowcut{\multispan{\@IEEEeqnnumcols}\relax% span all the cols
301f567e2a8e add document
chunhan
parents:
diff changeset
  2045
% advance column counter only if the IEEEeqnarray environment wants it
301f567e2a8e add document
chunhan
parents:
diff changeset
  2046
\if@advanceIEEEeqncolcnt\global\advance\@IEEEeqncolcnt by \@IEEEeqnnumcols\relax\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2047
\@ifnextchar[{\@IEEEeqnarrayseprowcut}{\@IEEEeqnarrayseprowcut[0.25\normalbaselineskip]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2048
\def\@IEEEeqnarrayseprowcut[#1]{\relax\@ifnextchar[{\@@IEEEeqnarrayseprowcut[#1]}{\@@IEEEeqnarrayseprowcut[#1][\relax]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2049
\def\@@IEEEeqnarrayseprowcut[#1][#2]{\def\@IEEEeqnarrayseprowARGONE{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2050
\ifx\@IEEEeqnarrayseprowARGONE\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2051
% get the skip value, based on the font commands
301f567e2a8e add document
chunhan
parents:
diff changeset
  2052
% use skip5 because \IEEEeqnarraystrutsize uses \skip0, \skip2, \skip3
301f567e2a8e add document
chunhan
parents:
diff changeset
  2053
% assign within a bogus box to confine the font changes
301f567e2a8e add document
chunhan
parents:
diff changeset
  2054
{\setbox0=\hbox{#2\relax\global\skip5=0.25\normalbaselineskip}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2055
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2056
{\setbox0=\hbox{#2\relax\global\skip5=#1}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2057
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2058
\IEEEeqnarraystrutsize{\skip5}{0pt}[\relax]\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2059
301f567e2a8e add document
chunhan
parents:
diff changeset
  2060
301f567e2a8e add document
chunhan
parents:
diff changeset
  2061
301f567e2a8e add document
chunhan
parents:
diff changeset
  2062
% draws a single rule across all the columns optional
301f567e2a8e add document
chunhan
parents:
diff changeset
  2063
% argument determines the rule width, \arrayrulewidth is the default
301f567e2a8e add document
chunhan
parents:
diff changeset
  2064
% updates column counter as needed and turns off struts
301f567e2a8e add document
chunhan
parents:
diff changeset
  2065
% usage: \IEEEeqnarrayrulerow[rule line thickness]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2066
\def\IEEEeqnarrayrulerow{\multispan{\@IEEEeqnnumcols}\relax% span all the cols
301f567e2a8e add document
chunhan
parents:
diff changeset
  2067
% advance column counter only if the IEEEeqnarray environment wants it
301f567e2a8e add document
chunhan
parents:
diff changeset
  2068
\if@advanceIEEEeqncolcnt\global\advance\@IEEEeqncolcnt by \@IEEEeqnnumcols\relax\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2069
\@ifnextchar[{\@IEEEeqnarrayrulerow}{\@IEEEeqnarrayrulerow[\arrayrulewidth]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2070
\def\@IEEEeqnarrayrulerow[#1]{\leaders\hrule height#1\hfil\relax% put in our rule 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2071
% turn off any struts
301f567e2a8e add document
chunhan
parents:
diff changeset
  2072
\IEEEeqnarraystrutsize{0pt}{0pt}[\relax]\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2073
301f567e2a8e add document
chunhan
parents:
diff changeset
  2074
301f567e2a8e add document
chunhan
parents:
diff changeset
  2075
% draws a double rule by using a single rule row, a separator row, and then
301f567e2a8e add document
chunhan
parents:
diff changeset
  2076
% another single rule row 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2077
% first optional argument determines the rule thicknesses, \arrayrulewidth is the default
301f567e2a8e add document
chunhan
parents:
diff changeset
  2078
% second optional argument determines the rule spacing, \doublerulesep is the default
301f567e2a8e add document
chunhan
parents:
diff changeset
  2079
% usage: \IEEEeqnarraydblrulerow[rule line thickness][rule spacing]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2080
\def\IEEEeqnarraydblrulerow{\multispan{\@IEEEeqnnumcols}\relax% span all the cols
301f567e2a8e add document
chunhan
parents:
diff changeset
  2081
% advance column counter only if the IEEEeqnarray environment wants it
301f567e2a8e add document
chunhan
parents:
diff changeset
  2082
\if@advanceIEEEeqncolcnt\global\advance\@IEEEeqncolcnt by \@IEEEeqnnumcols\relax\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2083
\@ifnextchar[{\@IEEEeqnarraydblrulerow}{\@IEEEeqnarraydblrulerow[\arrayrulewidth]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2084
\def\@IEEEeqnarraydblrulerow[#1]{\relax\@ifnextchar[{\@@IEEEeqnarraydblrulerow[#1]}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2085
{\@@IEEEeqnarraydblrulerow[#1][\doublerulesep]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2086
\def\@@IEEEeqnarraydblrulerow[#1][#2]{\def\@IEEEeqnarraydblrulerowARG{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2087
% we allow the user to say \IEEEeqnarraydblrulerow[][]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2088
\ifx\@IEEEeqnarraydblrulerowARG\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2089
\@IEEEeqnarrayrulerow[\arrayrulewidth]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2090
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2091
\@IEEEeqnarrayrulerow[#1]\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2092
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2093
\def\@IEEEeqnarraydblrulerowARG{#2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2094
\ifx\@IEEEeqnarraydblrulerowARG\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2095
\\\IEEEeqnarrayseprow[\doublerulesep][\relax]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2096
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2097
\\\IEEEeqnarrayseprow[#2][\relax]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2098
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2099
\\\multispan{\@IEEEeqnnumcols}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2100
% advance column counter only if the IEEEeqnarray environment wants it
301f567e2a8e add document
chunhan
parents:
diff changeset
  2101
\if@advanceIEEEeqncolcnt\global\advance\@IEEEeqncolcnt by \@IEEEeqnnumcols\relax\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2102
\def\@IEEEeqnarraydblrulerowARG{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2103
\ifx\@IEEEeqnarraydblrulerowARG\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2104
\@IEEEeqnarrayrulerow[\arrayrulewidth]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2105
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2106
\@IEEEeqnarrayrulerow[#1]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2107
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2108
}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2109
301f567e2a8e add document
chunhan
parents:
diff changeset
  2110
% draws a double rule by using a single rule row, a separator (cutting) row, and then
301f567e2a8e add document
chunhan
parents:
diff changeset
  2111
% another single rule row 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2112
% first optional argument determines the rule thicknesses, \arrayrulewidth is the default
301f567e2a8e add document
chunhan
parents:
diff changeset
  2113
% second optional argument determines the rule spacing, \doublerulesep is the default
301f567e2a8e add document
chunhan
parents:
diff changeset
  2114
% usage: \IEEEeqnarraydblrulerow[rule line thickness][rule spacing]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2115
\def\IEEEeqnarraydblrulerowcut{\multispan{\@IEEEeqnnumcols}\relax% span all the cols
301f567e2a8e add document
chunhan
parents:
diff changeset
  2116
% advance column counter only if the IEEEeqnarray environment wants it
301f567e2a8e add document
chunhan
parents:
diff changeset
  2117
\if@advanceIEEEeqncolcnt\global\advance\@IEEEeqncolcnt by \@IEEEeqnnumcols\relax\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2118
\@ifnextchar[{\@IEEEeqnarraydblrulerowcut}{\@IEEEeqnarraydblrulerowcut[\arrayrulewidth]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2119
\def\@IEEEeqnarraydblrulerowcut[#1]{\relax\@ifnextchar[{\@@IEEEeqnarraydblrulerowcut[#1]}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2120
{\@@IEEEeqnarraydblrulerowcut[#1][\doublerulesep]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2121
\def\@@IEEEeqnarraydblrulerowcut[#1][#2]{\def\@IEEEeqnarraydblrulerowARG{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2122
% we allow the user to say \IEEEeqnarraydblrulerow[][]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2123
\ifx\@IEEEeqnarraydblrulerowARG\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2124
\@IEEEeqnarrayrulerow[\arrayrulewidth]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2125
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2126
\@IEEEeqnarrayrulerow[#1]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2127
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2128
\def\@IEEEeqnarraydblrulerowARG{#2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2129
\ifx\@IEEEeqnarraydblrulerowARG\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2130
\\\IEEEeqnarrayseprowcut[\doublerulesep][\relax]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2131
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2132
\\\IEEEeqnarrayseprowcut[#2][\relax]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2133
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2134
\\\multispan{\@IEEEeqnnumcols}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2135
% advance column counter only if the IEEEeqnarray environment wants it
301f567e2a8e add document
chunhan
parents:
diff changeset
  2136
\if@advanceIEEEeqncolcnt\global\advance\@IEEEeqncolcnt by \@IEEEeqnnumcols\relax\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2137
\def\@IEEEeqnarraydblrulerowARG{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2138
\ifx\@IEEEeqnarraydblrulerowARG\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2139
\@IEEEeqnarrayrulerow[\arrayrulewidth]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2140
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2141
\@IEEEeqnarrayrulerow[#1]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2142
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2143
}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2144
301f567e2a8e add document
chunhan
parents:
diff changeset
  2145
301f567e2a8e add document
chunhan
parents:
diff changeset
  2146
301f567e2a8e add document
chunhan
parents:
diff changeset
  2147
% inserts a full row's worth of &'s
301f567e2a8e add document
chunhan
parents:
diff changeset
  2148
% relies on \@IEEEeqnnumcols to provide the correct number of columns
301f567e2a8e add document
chunhan
parents:
diff changeset
  2149
% uses \@IEEEtrantmptoksA, \count0 as scratch registers
301f567e2a8e add document
chunhan
parents:
diff changeset
  2150
\def\@IEEEeqnarrayhoptolastcolumn{\@IEEEtrantmptoksA={}\count0=1\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2151
\loop% add cols if the user did not use them all
301f567e2a8e add document
chunhan
parents:
diff changeset
  2152
\ifnum\count0<\@IEEEeqnnumcols\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2153
\@IEEEappendtoksA{&}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2154
\advance\count0 by 1\relax% update the col count
301f567e2a8e add document
chunhan
parents:
diff changeset
  2155
\repeat%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2156
\the\@IEEEtrantmptoksA%execute the &'s
301f567e2a8e add document
chunhan
parents:
diff changeset
  2157
}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2158
301f567e2a8e add document
chunhan
parents:
diff changeset
  2159
301f567e2a8e add document
chunhan
parents:
diff changeset
  2160
301f567e2a8e add document
chunhan
parents:
diff changeset
  2161
\newif\if@IEEEeqnarrayISinner % flag to indicate if we are within the lines
301f567e2a8e add document
chunhan
parents:
diff changeset
  2162
\@IEEEeqnarrayISinnerfalse    % of an IEEEeqnarray - after the IEEEeqnarraydecl
301f567e2a8e add document
chunhan
parents:
diff changeset
  2163
301f567e2a8e add document
chunhan
parents:
diff changeset
  2164
\edef\@IEEEeqnarrayTHEstrutheight{0pt} % height and depth of IEEEeqnarray struts
301f567e2a8e add document
chunhan
parents:
diff changeset
  2165
\edef\@IEEEeqnarrayTHEstrutdepth{0pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2166
301f567e2a8e add document
chunhan
parents:
diff changeset
  2167
\edef\@IEEEeqnarrayTHEmasterstrutheight{0pt} % default height and depth of
301f567e2a8e add document
chunhan
parents:
diff changeset
  2168
\edef\@IEEEeqnarrayTHEmasterstrutdepth{0pt}  % struts within an IEEEeqnarray
301f567e2a8e add document
chunhan
parents:
diff changeset
  2169
301f567e2a8e add document
chunhan
parents:
diff changeset
  2170
\edef\@IEEEeqnarrayTHEmasterstrutHSAVE{0pt} % saved master strut height
301f567e2a8e add document
chunhan
parents:
diff changeset
  2171
\edef\@IEEEeqnarrayTHEmasterstrutDSAVE{0pt} % and depth
301f567e2a8e add document
chunhan
parents:
diff changeset
  2172
301f567e2a8e add document
chunhan
parents:
diff changeset
  2173
\newif\if@IEEEeqnarrayusemasterstrut % flag to indicate that the master strut value
301f567e2a8e add document
chunhan
parents:
diff changeset
  2174
\@IEEEeqnarrayusemasterstruttrue     % is to be used
301f567e2a8e add document
chunhan
parents:
diff changeset
  2175
301f567e2a8e add document
chunhan
parents:
diff changeset
  2176
301f567e2a8e add document
chunhan
parents:
diff changeset
  2177
301f567e2a8e add document
chunhan
parents:
diff changeset
  2178
% saves the strut height and depth of the master strut
301f567e2a8e add document
chunhan
parents:
diff changeset
  2179
\def\@IEEEeqnarraymasterstrutsave{\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2180
\expandafter\skip0=\@IEEEeqnarrayTHEmasterstrutheight\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2181
\expandafter\skip2=\@IEEEeqnarrayTHEmasterstrutdepth\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2182
% remove stretchability
301f567e2a8e add document
chunhan
parents:
diff changeset
  2183
\dimen0\skip0\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2184
\dimen2\skip2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2185
% save values
301f567e2a8e add document
chunhan
parents:
diff changeset
  2186
\edef\@IEEEeqnarrayTHEmasterstrutHSAVE{\the\dimen0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2187
\edef\@IEEEeqnarrayTHEmasterstrutDSAVE{\the\dimen2}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2188
301f567e2a8e add document
chunhan
parents:
diff changeset
  2189
% restores the strut height and depth of the master strut
301f567e2a8e add document
chunhan
parents:
diff changeset
  2190
\def\@IEEEeqnarraymasterstrutrestore{\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2191
\expandafter\skip0=\@IEEEeqnarrayTHEmasterstrutHSAVE\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2192
\expandafter\skip2=\@IEEEeqnarrayTHEmasterstrutDSAVE\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2193
% remove stretchability
301f567e2a8e add document
chunhan
parents:
diff changeset
  2194
\dimen0\skip0\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2195
\dimen2\skip2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2196
% restore values
301f567e2a8e add document
chunhan
parents:
diff changeset
  2197
\edef\@IEEEeqnarrayTHEmasterstrutheight{\the\dimen0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2198
\edef\@IEEEeqnarrayTHEmasterstrutdepth{\the\dimen2}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2199
301f567e2a8e add document
chunhan
parents:
diff changeset
  2200
301f567e2a8e add document
chunhan
parents:
diff changeset
  2201
% globally restores the strut height and depth to the 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2202
% master values and sets the master strut flag to true
301f567e2a8e add document
chunhan
parents:
diff changeset
  2203
\def\@IEEEeqnarraystrutreset{\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2204
\expandafter\skip0=\@IEEEeqnarrayTHEmasterstrutheight\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2205
\expandafter\skip2=\@IEEEeqnarrayTHEmasterstrutdepth\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2206
% remove stretchability
301f567e2a8e add document
chunhan
parents:
diff changeset
  2207
\dimen0\skip0\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2208
\dimen2\skip2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2209
% restore values
301f567e2a8e add document
chunhan
parents:
diff changeset
  2210
\xdef\@IEEEeqnarrayTHEstrutheight{\the\dimen0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2211
\xdef\@IEEEeqnarrayTHEstrutdepth{\the\dimen2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2212
\global\@IEEEeqnarrayusemasterstruttrue}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2213
301f567e2a8e add document
chunhan
parents:
diff changeset
  2214
301f567e2a8e add document
chunhan
parents:
diff changeset
  2215
% if the master strut is not to be used, make the current
301f567e2a8e add document
chunhan
parents:
diff changeset
  2216
% values of \@IEEEeqnarrayTHEstrutheight, \@IEEEeqnarrayTHEstrutdepth
301f567e2a8e add document
chunhan
parents:
diff changeset
  2217
% and the use master strut flag, global
301f567e2a8e add document
chunhan
parents:
diff changeset
  2218
% this allows user strut commands issued in the last column to be carried
301f567e2a8e add document
chunhan
parents:
diff changeset
  2219
% into the isolation/strut column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2220
\def\@IEEEeqnarrayglobalizestrutstatus{\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2221
\if@IEEEeqnarrayusemasterstrut\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2222
\xdef\@IEEEeqnarrayTHEstrutheight{\@IEEEeqnarrayTHEstrutheight}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2223
\xdef\@IEEEeqnarrayTHEstrutdepth{\@IEEEeqnarrayTHEstrutdepth}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2224
\global\@IEEEeqnarrayusemasterstrutfalse%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2225
\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2226
301f567e2a8e add document
chunhan
parents:
diff changeset
  2227
301f567e2a8e add document
chunhan
parents:
diff changeset
  2228
301f567e2a8e add document
chunhan
parents:
diff changeset
  2229
% usage: \IEEEeqnarraystrutsize{height}{depth}[font size commands]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2230
% If called outside the lines of an IEEEeqnarray, sets the height
301f567e2a8e add document
chunhan
parents:
diff changeset
  2231
% and depth of both the master and local struts. If called inside
301f567e2a8e add document
chunhan
parents:
diff changeset
  2232
% an IEEEeqnarray line, sets the height and depth of the local strut
301f567e2a8e add document
chunhan
parents:
diff changeset
  2233
% only and sets the flag to indicate the use of the local strut
301f567e2a8e add document
chunhan
parents:
diff changeset
  2234
% values. If the height or depth is left blank, 0.7\normalbaselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  2235
% and 0.3\normalbaselineskip will be used, respectively.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2236
% The optional argument can be used to evaluate the lengths under
301f567e2a8e add document
chunhan
parents:
diff changeset
  2237
% a different font size and styles. If none is specified, the current
301f567e2a8e add document
chunhan
parents:
diff changeset
  2238
% font is used.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2239
% uses scratch registers \skip0, \skip2, \skip3, \dimen0, \dimen2
301f567e2a8e add document
chunhan
parents:
diff changeset
  2240
\def\IEEEeqnarraystrutsize#1#2{\relax\@ifnextchar[{\@IEEEeqnarraystrutsize{#1}{#2}}{\@IEEEeqnarraystrutsize{#1}{#2}[\relax]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2241
\def\@IEEEeqnarraystrutsize#1#2[#3]{\def\@IEEEeqnarraystrutsizeARG{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2242
\ifx\@IEEEeqnarraystrutsizeARG\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2243
{\setbox0=\hbox{#3\relax\global\skip3=0.7\normalbaselineskip}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2244
\skip0=\skip3\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2245
\else% arg one present
301f567e2a8e add document
chunhan
parents:
diff changeset
  2246
{\setbox0=\hbox{#3\relax\global\skip3=#1\relax}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2247
\skip0=\skip3\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2248
\fi% if null arg
301f567e2a8e add document
chunhan
parents:
diff changeset
  2249
\def\@IEEEeqnarraystrutsizeARG{#2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2250
\ifx\@IEEEeqnarraystrutsizeARG\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2251
{\setbox0=\hbox{#3\relax\global\skip3=0.3\normalbaselineskip}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2252
\skip2=\skip3\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2253
\else% arg two present
301f567e2a8e add document
chunhan
parents:
diff changeset
  2254
{\setbox0=\hbox{#3\relax\global\skip3=#2\relax}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2255
\skip2=\skip3\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2256
\fi% if null arg
301f567e2a8e add document
chunhan
parents:
diff changeset
  2257
% remove stretchability, just to be safe
301f567e2a8e add document
chunhan
parents:
diff changeset
  2258
\dimen0\skip0\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2259
\dimen2\skip2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2260
% dimen0 = height, dimen2 = depth
301f567e2a8e add document
chunhan
parents:
diff changeset
  2261
\if@IEEEeqnarrayISinner% inner does not touch master strut size
301f567e2a8e add document
chunhan
parents:
diff changeset
  2262
\edef\@IEEEeqnarrayTHEstrutheight{\the\dimen0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2263
\edef\@IEEEeqnarrayTHEstrutdepth{\the\dimen2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2264
\@IEEEeqnarrayusemasterstrutfalse% do not use master
301f567e2a8e add document
chunhan
parents:
diff changeset
  2265
\else% outer, have to set master strut too
301f567e2a8e add document
chunhan
parents:
diff changeset
  2266
\edef\@IEEEeqnarrayTHEmasterstrutheight{\the\dimen0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2267
\edef\@IEEEeqnarrayTHEmasterstrutdepth{\the\dimen2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2268
\edef\@IEEEeqnarrayTHEstrutheight{\the\dimen0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2269
\edef\@IEEEeqnarrayTHEstrutdepth{\the\dimen2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2270
\@IEEEeqnarrayusemasterstruttrue% use master strut
301f567e2a8e add document
chunhan
parents:
diff changeset
  2271
\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2272
301f567e2a8e add document
chunhan
parents:
diff changeset
  2273
301f567e2a8e add document
chunhan
parents:
diff changeset
  2274
% usage: \IEEEeqnarraystrutsizeadd{added height}{added depth}[font size commands]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2275
% If called outside the lines of an IEEEeqnarray, adds the given height
301f567e2a8e add document
chunhan
parents:
diff changeset
  2276
% and depth to both the master and local struts.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2277
% If called inside an IEEEeqnarray line, adds the given height and depth
301f567e2a8e add document
chunhan
parents:
diff changeset
  2278
% to the local strut only and sets the flag to indicate the use 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2279
% of the local strut values.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2280
% In both cases, if a height or depth is left blank, 0pt is used instead.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2281
% The optional argument can be used to evaluate the lengths under
301f567e2a8e add document
chunhan
parents:
diff changeset
  2282
% a different font size and styles. If none is specified, the current
301f567e2a8e add document
chunhan
parents:
diff changeset
  2283
% font is used.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2284
% uses scratch registers \skip0, \skip2, \skip3, \dimen0, \dimen2
301f567e2a8e add document
chunhan
parents:
diff changeset
  2285
\def\IEEEeqnarraystrutsizeadd#1#2{\relax\@ifnextchar[{\@IEEEeqnarraystrutsizeadd{#1}{#2}}{\@IEEEeqnarraystrutsizeadd{#1}{#2}[\relax]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2286
\def\@IEEEeqnarraystrutsizeadd#1#2[#3]{\def\@IEEEeqnarraystrutsizearg{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2287
\ifx\@IEEEeqnarraystrutsizearg\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2288
\skip0=0pt\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2289
\else% arg one present
301f567e2a8e add document
chunhan
parents:
diff changeset
  2290
{\setbox0=\hbox{#3\relax\global\skip3=#1}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2291
\skip0=\skip3\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2292
\fi% if null arg
301f567e2a8e add document
chunhan
parents:
diff changeset
  2293
\def\@IEEEeqnarraystrutsizearg{#2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2294
\ifx\@IEEEeqnarraystrutsizearg\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2295
\skip2=0pt\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2296
\else% arg two present
301f567e2a8e add document
chunhan
parents:
diff changeset
  2297
{\setbox0=\hbox{#3\relax\global\skip3=#2}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2298
\skip2=\skip3\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2299
\fi% if null arg
301f567e2a8e add document
chunhan
parents:
diff changeset
  2300
% remove stretchability, just to be safe
301f567e2a8e add document
chunhan
parents:
diff changeset
  2301
\dimen0\skip0\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2302
\dimen2\skip2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2303
% dimen0 = height, dimen2 = depth
301f567e2a8e add document
chunhan
parents:
diff changeset
  2304
\if@IEEEeqnarrayISinner% inner does not touch master strut size
301f567e2a8e add document
chunhan
parents:
diff changeset
  2305
% get local strut size
301f567e2a8e add document
chunhan
parents:
diff changeset
  2306
\expandafter\skip0=\@IEEEeqnarrayTHEstrutheight\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2307
\expandafter\skip2=\@IEEEeqnarrayTHEstrutdepth\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2308
% add it to the user supplied values
301f567e2a8e add document
chunhan
parents:
diff changeset
  2309
\advance\dimen0 by \skip0\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2310
\advance\dimen2 by \skip2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2311
% update the local strut size
301f567e2a8e add document
chunhan
parents:
diff changeset
  2312
\edef\@IEEEeqnarrayTHEstrutheight{\the\dimen0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2313
\edef\@IEEEeqnarrayTHEstrutdepth{\the\dimen2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2314
\@IEEEeqnarrayusemasterstrutfalse% do not use master
301f567e2a8e add document
chunhan
parents:
diff changeset
  2315
\else% outer, have to set master strut too
301f567e2a8e add document
chunhan
parents:
diff changeset
  2316
% get master strut size
301f567e2a8e add document
chunhan
parents:
diff changeset
  2317
\expandafter\skip0=\@IEEEeqnarrayTHEmasterstrutheight\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2318
\expandafter\skip2=\@IEEEeqnarrayTHEmasterstrutdepth\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2319
% add it to the user supplied values
301f567e2a8e add document
chunhan
parents:
diff changeset
  2320
\advance\dimen0 by \skip0\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2321
\advance\dimen2 by \skip2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2322
% update the local and master strut sizes
301f567e2a8e add document
chunhan
parents:
diff changeset
  2323
\edef\@IEEEeqnarrayTHEmasterstrutheight{\the\dimen0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2324
\edef\@IEEEeqnarrayTHEmasterstrutdepth{\the\dimen2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2325
\edef\@IEEEeqnarrayTHEstrutheight{\the\dimen0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2326
\edef\@IEEEeqnarrayTHEstrutdepth{\the\dimen2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2327
\@IEEEeqnarrayusemasterstruttrue% use master strut
301f567e2a8e add document
chunhan
parents:
diff changeset
  2328
\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2329
301f567e2a8e add document
chunhan
parents:
diff changeset
  2330
301f567e2a8e add document
chunhan
parents:
diff changeset
  2331
% allow user a way to see the struts
301f567e2a8e add document
chunhan
parents:
diff changeset
  2332
\newif\ifIEEEvisiblestruts
301f567e2a8e add document
chunhan
parents:
diff changeset
  2333
\IEEEvisiblestrutsfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  2334
301f567e2a8e add document
chunhan
parents:
diff changeset
  2335
% inserts an invisible strut using the master or local strut values
301f567e2a8e add document
chunhan
parents:
diff changeset
  2336
% uses scratch registers \skip0, \skip2, \dimen0, \dimen2
301f567e2a8e add document
chunhan
parents:
diff changeset
  2337
\def\@IEEEeqnarrayinsertstrut{\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2338
\if@IEEEeqnarrayusemasterstrut
301f567e2a8e add document
chunhan
parents:
diff changeset
  2339
% get master strut size
301f567e2a8e add document
chunhan
parents:
diff changeset
  2340
\expandafter\skip0=\@IEEEeqnarrayTHEmasterstrutheight\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2341
\expandafter\skip2=\@IEEEeqnarrayTHEmasterstrutdepth\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2342
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2343
% get local strut size
301f567e2a8e add document
chunhan
parents:
diff changeset
  2344
\expandafter\skip0=\@IEEEeqnarrayTHEstrutheight\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2345
\expandafter\skip2=\@IEEEeqnarrayTHEstrutdepth\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2346
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2347
% remove stretchability, probably not needed
301f567e2a8e add document
chunhan
parents:
diff changeset
  2348
\dimen0\skip0\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2349
\dimen2\skip2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2350
% dimen0 = height, dimen2 = depth
301f567e2a8e add document
chunhan
parents:
diff changeset
  2351
% allow user to see struts if desired
301f567e2a8e add document
chunhan
parents:
diff changeset
  2352
\ifIEEEvisiblestruts%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2353
\vrule width0.2pt height\dimen0 depth\dimen2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2354
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2355
\vrule width0pt height\dimen0 depth\dimen2\relax\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2356
301f567e2a8e add document
chunhan
parents:
diff changeset
  2357
301f567e2a8e add document
chunhan
parents:
diff changeset
  2358
% creates an invisible strut, useable even outside \IEEEeqnarray
301f567e2a8e add document
chunhan
parents:
diff changeset
  2359
% if \IEEEvisiblestrutstrue, the strut will be visible and 0.2pt wide. 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2360
% usage: \IEEEstrut[height][depth][font size commands]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2361
% default is \IEEEstrut[0.7\normalbaselineskip][0.3\normalbaselineskip][\relax]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2362
% blank arguments inherit the default values
301f567e2a8e add document
chunhan
parents:
diff changeset
  2363
% uses \dimen0, \dimen2, \skip0, \skip2
301f567e2a8e add document
chunhan
parents:
diff changeset
  2364
\def\IEEEstrut{\relax\@ifnextchar[{\@IEEEstrut}{\@IEEEstrut[0.7\normalbaselineskip]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2365
\def\@IEEEstrut[#1]{\relax\@ifnextchar[{\@@IEEEstrut[#1]}{\@@IEEEstrut[#1][0.3\normalbaselineskip]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2366
\def\@@IEEEstrut[#1][#2]{\relax\@ifnextchar[{\@@@IEEEstrut[#1][#2]}{\@@@IEEEstrut[#1][#2][\relax]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2367
\def\@@@IEEEstrut[#1][#2][#3]{\mbox{#3\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2368
\def\@IEEEstrutARG{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2369
\ifx\@IEEEstrutARG\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2370
\skip0=0.7\normalbaselineskip\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2371
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2372
\skip0=#1\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2373
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2374
\def\@IEEEstrutARG{#2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2375
\ifx\@IEEEstrutARG\@empty%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2376
\skip2=0.3\normalbaselineskip\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2377
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2378
\skip2=#2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2379
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2380
% remove stretchability, probably not needed
301f567e2a8e add document
chunhan
parents:
diff changeset
  2381
\dimen0\skip0\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2382
\dimen2\skip2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2383
\ifIEEEvisiblestruts%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2384
\vrule width0.2pt height\dimen0 depth\dimen2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2385
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2386
\vrule width0.0pt height\dimen0 depth\dimen2\relax\fi}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2387
301f567e2a8e add document
chunhan
parents:
diff changeset
  2388
301f567e2a8e add document
chunhan
parents:
diff changeset
  2389
% enables strut mode by setting a default strut size and then zeroing the
301f567e2a8e add document
chunhan
parents:
diff changeset
  2390
% \baselineskip, \lineskip, \lineskiplimit and \jot
301f567e2a8e add document
chunhan
parents:
diff changeset
  2391
\def\IEEEeqnarraystrutmode{\IEEEeqnarraystrutsize{0.7\normalbaselineskip}{0.3\normalbaselineskip}[\relax]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2392
\baselineskip=0pt\lineskip=0pt\lineskiplimit=0pt\jot=0pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2393
301f567e2a8e add document
chunhan
parents:
diff changeset
  2394
301f567e2a8e add document
chunhan
parents:
diff changeset
  2395
301f567e2a8e add document
chunhan
parents:
diff changeset
  2396
\def\IEEEeqnarray{\@IEEEeqnarraystarformfalse\@IEEEeqnarray}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2397
\def\endIEEEeqnarray{\end@IEEEeqnarray}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2398
301f567e2a8e add document
chunhan
parents:
diff changeset
  2399
\@namedef{IEEEeqnarray*}{\@IEEEeqnarraystarformtrue\@IEEEeqnarray}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2400
\@namedef{endIEEEeqnarray*}{\end@IEEEeqnarray}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2401
301f567e2a8e add document
chunhan
parents:
diff changeset
  2402
301f567e2a8e add document
chunhan
parents:
diff changeset
  2403
% \IEEEeqnarray is an enhanced \eqnarray. 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2404
% The star form defaults to not putting equation numbers at the end of each row.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2405
% usage: \IEEEeqnarray[decl]{cols}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2406
\def\@IEEEeqnarray{\relax\@ifnextchar[{\@@IEEEeqnarray}{\@@IEEEeqnarray[\relax]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2407
\def\@@IEEEeqnarray[#1]#2{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2408
   % default to showing the equation number or not based on whether or not
301f567e2a8e add document
chunhan
parents:
diff changeset
  2409
   % the star form was involked
301f567e2a8e add document
chunhan
parents:
diff changeset
  2410
   \if@IEEEeqnarraystarform\global\@eqnswfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  2411
   \else% not the star form
301f567e2a8e add document
chunhan
parents:
diff changeset
  2412
   \global\@eqnswtrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2413
   \fi% if star form
301f567e2a8e add document
chunhan
parents:
diff changeset
  2414
   \@IEEEissubequationfalse% default to no subequations
301f567e2a8e add document
chunhan
parents:
diff changeset
  2415
   \@IEEElastlinewassubequationfalse% assume last line is not a sub equation
301f567e2a8e add document
chunhan
parents:
diff changeset
  2416
   \@IEEEeqnarrayISinnerfalse% not yet within the lines of the halign
301f567e2a8e add document
chunhan
parents:
diff changeset
  2417
   \@IEEEeqnarraystrutsize{0pt}{0pt}[\relax]% turn off struts by default
301f567e2a8e add document
chunhan
parents:
diff changeset
  2418
   \@IEEEeqnarrayusemasterstruttrue% use master strut till user asks otherwise
301f567e2a8e add document
chunhan
parents:
diff changeset
  2419
   \IEEEvisiblestrutsfalse% diagnostic mode defaults to off
301f567e2a8e add document
chunhan
parents:
diff changeset
  2420
   % no extra space unless the user specifically requests it
301f567e2a8e add document
chunhan
parents:
diff changeset
  2421
   \lineskip=0pt\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  2422
   \lineskiplimit=0pt\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  2423
   \baselineskip=\normalbaselineskip\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2424
   \jot=\IEEEnormaljot\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2425
   \mathsurround\z@\relax% no extra spacing around math
301f567e2a8e add document
chunhan
parents:
diff changeset
  2426
   \@advanceIEEEeqncolcnttrue% advance the col counter for each col the user uses, 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2427
                             % used in \IEEEeqnarraymulticol and in the preamble build
301f567e2a8e add document
chunhan
parents:
diff changeset
  2428
   \stepcounter{equation}% advance equation counter before first line
301f567e2a8e add document
chunhan
parents:
diff changeset
  2429
   \setcounter{IEEEsubequation}{0}% no subequation yet 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2430
   \def\@currentlabel{\p@equation\theequation}% redefine the ref label
301f567e2a8e add document
chunhan
parents:
diff changeset
  2431
   \IEEEeqnarraydecl\relax% allow a way for the user to make global overrides
301f567e2a8e add document
chunhan
parents:
diff changeset
  2432
   #1\relax% allow user to override defaults
301f567e2a8e add document
chunhan
parents:
diff changeset
  2433
   \let\\\@IEEEeqnarraycr% replace newline with one that can put in eqn. numbers
301f567e2a8e add document
chunhan
parents:
diff changeset
  2434
   \global\@IEEEeqncolcnt\z@% col. count = 0 for first line
301f567e2a8e add document
chunhan
parents:
diff changeset
  2435
   \@IEEEbuildpreamble #2\end\relax% build the preamble and put it into \@IEEEtrantmptoksA 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2436
   % put in the column for the equation number
301f567e2a8e add document
chunhan
parents:
diff changeset
  2437
   \ifnum\@IEEEeqnnumcols>0\relax\@IEEEappendtoksA{&}\fi% col separator for those after the first
301f567e2a8e add document
chunhan
parents:
diff changeset
  2438
   \toks0={##}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2439
   % advance the \@IEEEeqncolcnt for the isolation col, this helps with error checking
301f567e2a8e add document
chunhan
parents:
diff changeset
  2440
   \@IEEEappendtoksA{\global\advance\@IEEEeqncolcnt by 1\relax}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2441
   % add the isolation column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2442
   \@IEEEappendtoksA{\tabskip\z@skip\bgroup\the\toks0\egroup}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2443
   % advance the \@IEEEeqncolcnt for the equation number col, this helps with error checking
301f567e2a8e add document
chunhan
parents:
diff changeset
  2444
   \@IEEEappendtoksA{&\global\advance\@IEEEeqncolcnt by 1\relax}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2445
   % add the equation number col to the preamble
301f567e2a8e add document
chunhan
parents:
diff changeset
  2446
   \@IEEEappendtoksA{\tabskip\z@skip\hb@xt@\z@\bgroup\hss\the\toks0\egroup}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2447
   % note \@IEEEeqnnumcols does not count the equation col or isolation col
301f567e2a8e add document
chunhan
parents:
diff changeset
  2448
   % set the starting tabskip glue as determined by the preamble build
301f567e2a8e add document
chunhan
parents:
diff changeset
  2449
   \tabskip=\@IEEEBPstartglue\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  2450
   % begin the display alignment
301f567e2a8e add document
chunhan
parents:
diff changeset
  2451
   \@IEEEeqnarrayISinnertrue% commands are now within the lines
301f567e2a8e add document
chunhan
parents:
diff changeset
  2452
   $$\everycr{}\halign to\displaywidth\bgroup
301f567e2a8e add document
chunhan
parents:
diff changeset
  2453
   % "exspand" the preamble
301f567e2a8e add document
chunhan
parents:
diff changeset
  2454
   \span\the\@IEEEtrantmptoksA\cr}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2455
301f567e2a8e add document
chunhan
parents:
diff changeset
  2456
% enter isolation/strut column (or the next column if the user did not use
301f567e2a8e add document
chunhan
parents:
diff changeset
  2457
% every column), record the strut status, complete the columns, do the strut if needed,
301f567e2a8e add document
chunhan
parents:
diff changeset
  2458
% restore counters to correct values and exit
301f567e2a8e add document
chunhan
parents:
diff changeset
  2459
\def\end@IEEEeqnarray{\@IEEEeqnarrayglobalizestrutstatus&\@@IEEEeqnarraycr\egroup%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2460
\if@IEEElastlinewassubequation\global\advance\c@IEEEsubequation\m@ne\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2461
\global\advance\c@equation\m@ne%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2462
$$\@ignoretrue}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2463
301f567e2a8e add document
chunhan
parents:
diff changeset
  2464
% need a way to remember if last line is a subequation
301f567e2a8e add document
chunhan
parents:
diff changeset
  2465
\newif\if@IEEElastlinewassubequation%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2466
\@IEEElastlinewassubequationfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  2467
301f567e2a8e add document
chunhan
parents:
diff changeset
  2468
% IEEEeqnarray uses a modifed \\ instead of the plain \cr to
301f567e2a8e add document
chunhan
parents:
diff changeset
  2469
% end rows. This allows for things like \\*[vskip amount]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2470
% This "cr" macros are modified versions those for LaTeX2e's eqnarray
301f567e2a8e add document
chunhan
parents:
diff changeset
  2471
% the {\ifnum0=`} braces must be kept away from the last column to avoid
301f567e2a8e add document
chunhan
parents:
diff changeset
  2472
% altering spacing of its math, so we use & to advance to the next column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2473
% as there is an isolation/strut column after the user's columns
301f567e2a8e add document
chunhan
parents:
diff changeset
  2474
\def\@IEEEeqnarraycr{\@IEEEeqnarrayglobalizestrutstatus&% save strut status and advance to next column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2475
   {\ifnum0=`}\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2476
   \@ifstar{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2477
      \global\@eqpen\@M\@IEEEeqnarrayYCR
301f567e2a8e add document
chunhan
parents:
diff changeset
  2478
   }{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2479
      \global\@eqpen\interdisplaylinepenalty \@IEEEeqnarrayYCR
301f567e2a8e add document
chunhan
parents:
diff changeset
  2480
   }%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2481
}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2482
301f567e2a8e add document
chunhan
parents:
diff changeset
  2483
\def\@IEEEeqnarrayYCR{\@testopt\@IEEEeqnarrayXCR\z@skip}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2484
301f567e2a8e add document
chunhan
parents:
diff changeset
  2485
\def\@IEEEeqnarrayXCR[#1]{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2486
   \ifnum0=`{\fi}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2487
   \@@IEEEeqnarraycr
301f567e2a8e add document
chunhan
parents:
diff changeset
  2488
   \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2489
301f567e2a8e add document
chunhan
parents:
diff changeset
  2490
\def\@@IEEEeqnarraycr{\@IEEEtrantmptoksA={}% clear token register
301f567e2a8e add document
chunhan
parents:
diff changeset
  2491
    \advance\@IEEEeqncolcnt by -1\relax% adjust col count because of the isolation column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2492
    \ifnum\@IEEEeqncolcnt>\@IEEEeqnnumcols\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  2493
    \@IEEEclspkgerror{Too many columns within the IEEEeqnarray\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2494
                          environment}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2495
    {Use fewer \string &'s or put more columns in the IEEEeqnarry column\MessageBreak 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2496
     specifications.}\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2497
    \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2498
    \loop% add cols if the user did not use them all
301f567e2a8e add document
chunhan
parents:
diff changeset
  2499
    \ifnum\@IEEEeqncolcnt<\@IEEEeqnnumcols\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  2500
    \@IEEEappendtoksA{&}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2501
    \advance\@IEEEeqncolcnt by 1\relax% update the col count
301f567e2a8e add document
chunhan
parents:
diff changeset
  2502
    \repeat
301f567e2a8e add document
chunhan
parents:
diff changeset
  2503
    % this number of &'s will take us the the isolation column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2504
    \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2505
    % execute the &'s
301f567e2a8e add document
chunhan
parents:
diff changeset
  2506
    \the\@IEEEtrantmptoksA%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2507
    % handle the strut/isolation column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2508
    \@IEEEeqnarrayinsertstrut% do the strut if needed
301f567e2a8e add document
chunhan
parents:
diff changeset
  2509
    \@IEEEeqnarraystrutreset% reset the strut system for next line or IEEEeqnarray
301f567e2a8e add document
chunhan
parents:
diff changeset
  2510
    &% and enter the equation number column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2511
    % is this line needs an equation number, display it and advance the
301f567e2a8e add document
chunhan
parents:
diff changeset
  2512
    % (sub)equation counters, record what type this line was
301f567e2a8e add document
chunhan
parents:
diff changeset
  2513
    \if@eqnsw%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2514
     \if@IEEEissubequation\theIEEEsubequationdis\addtocounter{equation}{1}\stepcounter{IEEEsubequation}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2515
     \global\@IEEElastlinewassubequationtrue%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2516
     \else% display a standard equation number, initialize the IEEEsubequation counter
301f567e2a8e add document
chunhan
parents:
diff changeset
  2517
     \theequationdis\stepcounter{equation}\setcounter{IEEEsubequation}{0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2518
     \global\@IEEElastlinewassubequationfalse\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2519
    \fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2520
    % reset the eqnsw flag to indicate default preference of the display of equation numbers
301f567e2a8e add document
chunhan
parents:
diff changeset
  2521
    \if@IEEEeqnarraystarform\global\@eqnswfalse\else\global\@eqnswtrue\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2522
    \global\@IEEEissubequationfalse% reset the subequation flag
301f567e2a8e add document
chunhan
parents:
diff changeset
  2523
    % reset the number of columns the user actually used
301f567e2a8e add document
chunhan
parents:
diff changeset
  2524
    \global\@IEEEeqncolcnt\z@\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  2525
    % the real end of the line
301f567e2a8e add document
chunhan
parents:
diff changeset
  2526
    \cr}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2527
301f567e2a8e add document
chunhan
parents:
diff changeset
  2528
301f567e2a8e add document
chunhan
parents:
diff changeset
  2529
301f567e2a8e add document
chunhan
parents:
diff changeset
  2530
301f567e2a8e add document
chunhan
parents:
diff changeset
  2531
301f567e2a8e add document
chunhan
parents:
diff changeset
  2532
% \IEEEeqnarraybox is like \IEEEeqnarray except the box form puts everything
301f567e2a8e add document
chunhan
parents:
diff changeset
  2533
% inside a vtop, vbox, or vcenter box depending on the letter in the second
301f567e2a8e add document
chunhan
parents:
diff changeset
  2534
% optional argument (t,b,c). Vbox is the default. Unlike \IEEEeqnarray,
301f567e2a8e add document
chunhan
parents:
diff changeset
  2535
% equation numbers are not displayed and \IEEEeqnarraybox can be nested.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2536
% \IEEEeqnarrayboxm is for math mode (like \array) and does not put the vbox
301f567e2a8e add document
chunhan
parents:
diff changeset
  2537
% within an hbox.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2538
% \IEEEeqnarrayboxt is for text mode (like \tabular) and puts the vbox within
301f567e2a8e add document
chunhan
parents:
diff changeset
  2539
% a \hbox{$ $} construct.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2540
% \IEEEeqnarraybox will auto detect whether to use \IEEEeqnarrayboxm or 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2541
% \IEEEeqnarrayboxt depending on the math mode.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2542
% The third optional argument specifies the width this box is to be set to -
301f567e2a8e add document
chunhan
parents:
diff changeset
  2543
% natural width is the default.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2544
% The * forms do not add \jot line spacing
301f567e2a8e add document
chunhan
parents:
diff changeset
  2545
% usage: \IEEEeqnarraybox[decl][pos][width]{cols}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2546
\def\IEEEeqnarrayboxm{\@IEEEeqnarraystarformfalse\@IEEEeqnarrayboxHBOXSWfalse\@IEEEeqnarraybox}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2547
\def\endIEEEeqnarrayboxm{\end@IEEEeqnarraybox}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2548
\@namedef{IEEEeqnarrayboxm*}{\@IEEEeqnarraystarformtrue\@IEEEeqnarrayboxHBOXSWfalse\@IEEEeqnarraybox}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2549
\@namedef{endIEEEeqnarrayboxm*}{\end@IEEEeqnarraybox}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2550
301f567e2a8e add document
chunhan
parents:
diff changeset
  2551
\def\IEEEeqnarrayboxt{\@IEEEeqnarraystarformfalse\@IEEEeqnarrayboxHBOXSWtrue\@IEEEeqnarraybox}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2552
\def\endIEEEeqnarrayboxt{\end@IEEEeqnarraybox}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2553
\@namedef{IEEEeqnarrayboxt*}{\@IEEEeqnarraystarformtrue\@IEEEeqnarrayboxHBOXSWtrue\@IEEEeqnarraybox}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2554
\@namedef{endIEEEeqnarrayboxt*}{\end@IEEEeqnarraybox}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2555
301f567e2a8e add document
chunhan
parents:
diff changeset
  2556
\def\IEEEeqnarraybox{\@IEEEeqnarraystarformfalse\ifmmode\@IEEEeqnarrayboxHBOXSWfalse\else\@IEEEeqnarrayboxHBOXSWtrue\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2557
\@IEEEeqnarraybox}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2558
\def\endIEEEeqnarraybox{\end@IEEEeqnarraybox}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2559
301f567e2a8e add document
chunhan
parents:
diff changeset
  2560
\@namedef{IEEEeqnarraybox*}{\@IEEEeqnarraystarformtrue\ifmmode\@IEEEeqnarrayboxHBOXSWfalse\else\@IEEEeqnarrayboxHBOXSWtrue\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2561
\@IEEEeqnarraybox}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2562
\@namedef{endIEEEeqnarraybox*}{\end@IEEEeqnarraybox}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2563
301f567e2a8e add document
chunhan
parents:
diff changeset
  2564
% flag to indicate if the \IEEEeqnarraybox needs to put things into an hbox{$ $} 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2565
% for \vcenter in non-math mode
301f567e2a8e add document
chunhan
parents:
diff changeset
  2566
\newif\if@IEEEeqnarrayboxHBOXSW%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2567
\@IEEEeqnarrayboxHBOXSWfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  2568
301f567e2a8e add document
chunhan
parents:
diff changeset
  2569
\def\@IEEEeqnarraybox{\relax\@ifnextchar[{\@@IEEEeqnarraybox}{\@@IEEEeqnarraybox[\relax]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2570
\def\@@IEEEeqnarraybox[#1]{\relax\@ifnextchar[{\@@@IEEEeqnarraybox[#1]}{\@@@IEEEeqnarraybox[#1][b]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2571
\def\@@@IEEEeqnarraybox[#1][#2]{\relax\@ifnextchar[{\@@@@IEEEeqnarraybox[#1][#2]}{\@@@@IEEEeqnarraybox[#1][#2][\relax]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2572
301f567e2a8e add document
chunhan
parents:
diff changeset
  2573
% #1 = decl; #2 = t,b,c; #3 = width, #4 = col specs
301f567e2a8e add document
chunhan
parents:
diff changeset
  2574
\def\@@@@IEEEeqnarraybox[#1][#2][#3]#4{\@IEEEeqnarrayISinnerfalse % not yet within the lines of the halign
301f567e2a8e add document
chunhan
parents:
diff changeset
  2575
   \@IEEEeqnarraymasterstrutsave% save current master strut values
301f567e2a8e add document
chunhan
parents:
diff changeset
  2576
   \@IEEEeqnarraystrutsize{0pt}{0pt}[\relax]% turn off struts by default
301f567e2a8e add document
chunhan
parents:
diff changeset
  2577
   \@IEEEeqnarrayusemasterstruttrue% use master strut till user asks otherwise
301f567e2a8e add document
chunhan
parents:
diff changeset
  2578
   \IEEEvisiblestrutsfalse% diagnostic mode defaults to off
301f567e2a8e add document
chunhan
parents:
diff changeset
  2579
   % no extra space unless the user specifically requests it
301f567e2a8e add document
chunhan
parents:
diff changeset
  2580
   \lineskip=0pt\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2581
   \lineskiplimit=0pt\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2582
   \baselineskip=\normalbaselineskip\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2583
   \jot=\IEEEnormaljot\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2584
   \mathsurround\z@\relax% no extra spacing around math
301f567e2a8e add document
chunhan
parents:
diff changeset
  2585
   % the default end glues are zero for an \IEEEeqnarraybox
301f567e2a8e add document
chunhan
parents:
diff changeset
  2586
   \edef\@IEEEeqnarraycolSEPdefaultstart{\@IEEEeqnarraycolSEPzero}% default start glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2587
   \edef\@IEEEeqnarraycolSEPdefaultend{\@IEEEeqnarraycolSEPzero}% default end glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2588
   \edef\@IEEEeqnarraycolSEPdefaultmid{\@IEEEeqnarraycolSEPzero}% default inter-column glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2589
   \@advanceIEEEeqncolcntfalse% do not advance the col counter for each col the user uses, 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2590
                              % used in \IEEEeqnarraymulticol and in the preamble build
301f567e2a8e add document
chunhan
parents:
diff changeset
  2591
   \IEEEeqnarrayboxdecl\relax% allow a way for the user to make global overrides
301f567e2a8e add document
chunhan
parents:
diff changeset
  2592
   #1\relax% allow user to override defaults
301f567e2a8e add document
chunhan
parents:
diff changeset
  2593
   \let\\\@IEEEeqnarrayboxcr% replace newline with one that allows optional spacing
301f567e2a8e add document
chunhan
parents:
diff changeset
  2594
   \@IEEEbuildpreamble #4\end\relax% build the preamble and put it into \@IEEEtrantmptoksA
301f567e2a8e add document
chunhan
parents:
diff changeset
  2595
   % add an isolation column to the preamble to stop \\'s {} from getting into the last col
301f567e2a8e add document
chunhan
parents:
diff changeset
  2596
   \ifnum\@IEEEeqnnumcols>0\relax\@IEEEappendtoksA{&}\fi% col separator for those after the first
301f567e2a8e add document
chunhan
parents:
diff changeset
  2597
   \toks0={##}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2598
   % add the isolation column to the preamble
301f567e2a8e add document
chunhan
parents:
diff changeset
  2599
   \@IEEEappendtoksA{\tabskip\z@skip\bgroup\the\toks0\egroup}% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2600
   % set the starting tabskip glue as determined by the preamble build
301f567e2a8e add document
chunhan
parents:
diff changeset
  2601
   \tabskip=\@IEEEBPstartglue\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  2602
   % begin the alignment
301f567e2a8e add document
chunhan
parents:
diff changeset
  2603
   \everycr{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2604
   % use only the very first token to determine the positioning
301f567e2a8e add document
chunhan
parents:
diff changeset
  2605
   % this stops some problems when the user uses more than one letter,
301f567e2a8e add document
chunhan
parents:
diff changeset
  2606
   % but is probably not worth the effort
301f567e2a8e add document
chunhan
parents:
diff changeset
  2607
   % \noindent is used as a delimiter
301f567e2a8e add document
chunhan
parents:
diff changeset
  2608
   \def\@IEEEgrabfirstoken##1##2\noindent{\let\@IEEEgrabbedfirstoken=##1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2609
   \@IEEEgrabfirstoken#2\relax\relax\noindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  2610
   % \@IEEEgrabbedfirstoken has the first token, the rest are discarded
301f567e2a8e add document
chunhan
parents:
diff changeset
  2611
   % if we need to put things into and hbox and go into math mode, do so now
301f567e2a8e add document
chunhan
parents:
diff changeset
  2612
   \if@IEEEeqnarrayboxHBOXSW \leavevmode \hbox \bgroup $\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2613
   % use the appropriate vbox type
301f567e2a8e add document
chunhan
parents:
diff changeset
  2614
   \if\@IEEEgrabbedfirstoken t\relax\vtop\else\if\@IEEEgrabbedfirstoken c\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2615
   \vcenter\else\vbox\fi\fi\bgroup%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2616
   \@IEEEeqnarrayISinnertrue% commands are now within the lines
301f567e2a8e add document
chunhan
parents:
diff changeset
  2617
   \ifx#3\relax\halign\else\halign to #3\relax\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2618
   \bgroup
301f567e2a8e add document
chunhan
parents:
diff changeset
  2619
   % "exspand" the preamble
301f567e2a8e add document
chunhan
parents:
diff changeset
  2620
   \span\the\@IEEEtrantmptoksA\cr}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2621
301f567e2a8e add document
chunhan
parents:
diff changeset
  2622
% carry strut status and enter the isolation/strut column, 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2623
% exit from math mode if needed, and exit
301f567e2a8e add document
chunhan
parents:
diff changeset
  2624
\def\end@IEEEeqnarraybox{\@IEEEeqnarrayglobalizestrutstatus% carry strut status
301f567e2a8e add document
chunhan
parents:
diff changeset
  2625
&% enter isolation/strut column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2626
\@IEEEeqnarrayinsertstrut% do strut if needed
301f567e2a8e add document
chunhan
parents:
diff changeset
  2627
\@IEEEeqnarraymasterstrutrestore% restore the previous master strut values
301f567e2a8e add document
chunhan
parents:
diff changeset
  2628
% reset the strut system for next IEEEeqnarray
301f567e2a8e add document
chunhan
parents:
diff changeset
  2629
% (sets local strut values back to previous master strut values)
301f567e2a8e add document
chunhan
parents:
diff changeset
  2630
\@IEEEeqnarraystrutreset%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2631
% ensure last line, exit from halign, close vbox
301f567e2a8e add document
chunhan
parents:
diff changeset
  2632
\crcr\egroup\egroup%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2633
% exit from math mode and close hbox if needed
301f567e2a8e add document
chunhan
parents:
diff changeset
  2634
\if@IEEEeqnarrayboxHBOXSW $\egroup\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2635
301f567e2a8e add document
chunhan
parents:
diff changeset
  2636
301f567e2a8e add document
chunhan
parents:
diff changeset
  2637
301f567e2a8e add document
chunhan
parents:
diff changeset
  2638
% IEEEeqnarraybox uses a modifed \\ instead of the plain \cr to
301f567e2a8e add document
chunhan
parents:
diff changeset
  2639
% end rows. This allows for things like \\[vskip amount]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2640
% This "cr" macros are modified versions those for LaTeX2e's eqnarray
301f567e2a8e add document
chunhan
parents:
diff changeset
  2641
% For IEEEeqnarraybox, \\* is the same as \\
301f567e2a8e add document
chunhan
parents:
diff changeset
  2642
% the {\ifnum0=`} braces must be kept away from the last column to avoid
301f567e2a8e add document
chunhan
parents:
diff changeset
  2643
% altering spacing of its math, so we use & to advance to the isolation/strut column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2644
% carry strut status into isolation/strut column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2645
\def\@IEEEeqnarrayboxcr{\@IEEEeqnarrayglobalizestrutstatus% carry strut status
301f567e2a8e add document
chunhan
parents:
diff changeset
  2646
&% enter isolation/strut column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2647
\@IEEEeqnarrayinsertstrut% do strut if needed
301f567e2a8e add document
chunhan
parents:
diff changeset
  2648
% reset the strut system for next line or IEEEeqnarray
301f567e2a8e add document
chunhan
parents:
diff changeset
  2649
\@IEEEeqnarraystrutreset%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2650
{\ifnum0=`}\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2651
\@ifstar{\@IEEEeqnarrayboxYCR}{\@IEEEeqnarrayboxYCR}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2652
301f567e2a8e add document
chunhan
parents:
diff changeset
  2653
% test and setup the optional argument to \\[]
301f567e2a8e add document
chunhan
parents:
diff changeset
  2654
\def\@IEEEeqnarrayboxYCR{\@testopt\@IEEEeqnarrayboxXCR\z@skip}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2655
301f567e2a8e add document
chunhan
parents:
diff changeset
  2656
% IEEEeqnarraybox does not automatically increase line spacing by \jot
301f567e2a8e add document
chunhan
parents:
diff changeset
  2657
\def\@IEEEeqnarrayboxXCR[#1]{\ifnum0=`{\fi}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2658
\cr\noalign{\if@IEEEeqnarraystarform\else\vskip\jot\fi\vskip#1\relax}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2659
301f567e2a8e add document
chunhan
parents:
diff changeset
  2660
301f567e2a8e add document
chunhan
parents:
diff changeset
  2661
301f567e2a8e add document
chunhan
parents:
diff changeset
  2662
% starts the halign preamble build
301f567e2a8e add document
chunhan
parents:
diff changeset
  2663
\def\@IEEEbuildpreamble{\@IEEEtrantmptoksA={}% clear token register
301f567e2a8e add document
chunhan
parents:
diff changeset
  2664
\let\@IEEEBPcurtype=u%current column type is not yet known
301f567e2a8e add document
chunhan
parents:
diff changeset
  2665
\let\@IEEEBPprevtype=s%the previous column type was the start
301f567e2a8e add document
chunhan
parents:
diff changeset
  2666
\let\@IEEEBPnexttype=u%next column type is not yet known
301f567e2a8e add document
chunhan
parents:
diff changeset
  2667
% ensure these are valid
301f567e2a8e add document
chunhan
parents:
diff changeset
  2668
\def\@IEEEBPcurglue={0pt plus 0pt minus 0pt}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2669
\def\@IEEEBPcurcolname{@IEEEdefault}% name of current column definition
301f567e2a8e add document
chunhan
parents:
diff changeset
  2670
% currently acquired numerically referenced glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2671
% use a name that is easier to remember
301f567e2a8e add document
chunhan
parents:
diff changeset
  2672
\let\@IEEEBPcurnum=\@IEEEtrantmpcountA%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2673
\@IEEEBPcurnum=0%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2674
% tracks number of columns in the preamble
301f567e2a8e add document
chunhan
parents:
diff changeset
  2675
\@IEEEeqnnumcols=0%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2676
% record the default end glues
301f567e2a8e add document
chunhan
parents:
diff changeset
  2677
\edef\@IEEEBPstartglue{\@IEEEeqnarraycolSEPdefaultstart}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2678
\edef\@IEEEBPendglue{\@IEEEeqnarraycolSEPdefaultend}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2679
% now parse the user's column specifications
301f567e2a8e add document
chunhan
parents:
diff changeset
  2680
\@@IEEEbuildpreamble}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2681
301f567e2a8e add document
chunhan
parents:
diff changeset
  2682
301f567e2a8e add document
chunhan
parents:
diff changeset
  2683
% parses and builds the halign preamble
301f567e2a8e add document
chunhan
parents:
diff changeset
  2684
\def\@@IEEEbuildpreamble#1#2{\let\@@nextIEEEbuildpreamble=\@@IEEEbuildpreamble%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2685
% use only the very first token to check the end
301f567e2a8e add document
chunhan
parents:
diff changeset
  2686
% \noindent is used as a delimiter as \end can be present here
301f567e2a8e add document
chunhan
parents:
diff changeset
  2687
\def\@IEEEgrabfirstoken##1##2\noindent{\let\@IEEEgrabbedfirstoken=##1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2688
\@IEEEgrabfirstoken#1\relax\relax\noindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  2689
\ifx\@IEEEgrabbedfirstoken\end\let\@@nextIEEEbuildpreamble=\@@IEEEfinishpreamble\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2690
% identify current and next token type
301f567e2a8e add document
chunhan
parents:
diff changeset
  2691
\@IEEEgetcoltype{#1}{\@IEEEBPcurtype}{1}% current, error on invalid
301f567e2a8e add document
chunhan
parents:
diff changeset
  2692
\@IEEEgetcoltype{#2}{\@IEEEBPnexttype}{0}% next, no error on invalid next
301f567e2a8e add document
chunhan
parents:
diff changeset
  2693
% if curtype is a glue, get the glue def
301f567e2a8e add document
chunhan
parents:
diff changeset
  2694
\if\@IEEEBPcurtype g\@IEEEgetcurglue{#1}{\@IEEEBPcurglue}\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2695
% if curtype is a column, get the column def and set the current column name
301f567e2a8e add document
chunhan
parents:
diff changeset
  2696
\if\@IEEEBPcurtype c\@IEEEgetcurcol{#1}\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2697
% if curtype is a numeral, acquire the user defined glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2698
\if\@IEEEBPcurtype n\@IEEEprocessNcol{#1}\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2699
% process the acquired glue 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2700
\if\@IEEEBPcurtype g\@IEEEprocessGcol\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2701
% process the acquired col 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2702
\if\@IEEEBPcurtype c\@IEEEprocessCcol\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2703
% ready prevtype for next col spec.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2704
\let\@IEEEBPprevtype=\@IEEEBPcurtype%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2705
% be sure and put back the future token(s) as a group
301f567e2a8e add document
chunhan
parents:
diff changeset
  2706
\fi\@@nextIEEEbuildpreamble{#2}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2707
301f567e2a8e add document
chunhan
parents:
diff changeset
  2708
301f567e2a8e add document
chunhan
parents:
diff changeset
  2709
% executed just after preamble build is completed
301f567e2a8e add document
chunhan
parents:
diff changeset
  2710
% warn about zero cols, and if prevtype type = u, put in end tabskip glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2711
\def\@@IEEEfinishpreamble#1{\ifnum\@IEEEeqnnumcols<1\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  2712
\@IEEEclspkgerror{No column specifiers declared for IEEEeqnarray}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2713
{At least one column type must be declared for each IEEEeqnarray.}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2714
\fi%num cols less than 1
301f567e2a8e add document
chunhan
parents:
diff changeset
  2715
%if last type undefined, set default end tabskip glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2716
\if\@IEEEBPprevtype u\@IEEEappendtoksA{\tabskip=\@IEEEBPendglue}\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2717
301f567e2a8e add document
chunhan
parents:
diff changeset
  2718
301f567e2a8e add document
chunhan
parents:
diff changeset
  2719
% Identify and return the column specifier's type code
301f567e2a8e add document
chunhan
parents:
diff changeset
  2720
\def\@IEEEgetcoltype#1#2#3{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2721
% use only the very first token to determine the type
301f567e2a8e add document
chunhan
parents:
diff changeset
  2722
% \noindent is used as a delimiter as \end can be present here
301f567e2a8e add document
chunhan
parents:
diff changeset
  2723
\def\@IEEEgrabfirstoken##1##2\noindent{\let\@IEEEgrabbedfirstoken=##1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2724
\@IEEEgrabfirstoken#1\relax\relax\noindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  2725
% \@IEEEgrabfirstoken has the first token, the rest are discarded
301f567e2a8e add document
chunhan
parents:
diff changeset
  2726
% n = number
301f567e2a8e add document
chunhan
parents:
diff changeset
  2727
% g = glue (any other char in catagory 12)
301f567e2a8e add document
chunhan
parents:
diff changeset
  2728
% c = letter
301f567e2a8e add document
chunhan
parents:
diff changeset
  2729
% e = \end
301f567e2a8e add document
chunhan
parents:
diff changeset
  2730
% u = undefined
301f567e2a8e add document
chunhan
parents:
diff changeset
  2731
% third argument: 0 = no error message, 1 = error on invalid char
301f567e2a8e add document
chunhan
parents:
diff changeset
  2732
\let#2=u\relax% assume invalid until know otherwise
301f567e2a8e add document
chunhan
parents:
diff changeset
  2733
\ifx\@IEEEgrabbedfirstoken\end\let#2=e\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2734
\ifcat\@IEEEgrabbedfirstoken\relax\else% screen out control sequences
301f567e2a8e add document
chunhan
parents:
diff changeset
  2735
\if0\@IEEEgrabbedfirstoken\let#2=n\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2736
\if1\@IEEEgrabbedfirstoken\let#2=n\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2737
\if2\@IEEEgrabbedfirstoken\let#2=n\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2738
\if3\@IEEEgrabbedfirstoken\let#2=n\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2739
\if4\@IEEEgrabbedfirstoken\let#2=n\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2740
\if5\@IEEEgrabbedfirstoken\let#2=n\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2741
\if6\@IEEEgrabbedfirstoken\let#2=n\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2742
\if7\@IEEEgrabbedfirstoken\let#2=n\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2743
\if8\@IEEEgrabbedfirstoken\let#2=n\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2744
\if9\@IEEEgrabbedfirstoken\let#2=n\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2745
\ifcat,\@IEEEgrabbedfirstoken\let#2=g\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  2746
\else\ifcat a\@IEEEgrabbedfirstoken\let#2=c\relax\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2747
\if#2u\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  2748
\if0\noexpand#3\relax\else\@IEEEclspkgerror{Invalid character in column specifications}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2749
{Only letters, numerals and certain other symbols are allowed \MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2750
as IEEEeqnarray column specifiers.}\fi\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2751
301f567e2a8e add document
chunhan
parents:
diff changeset
  2752
301f567e2a8e add document
chunhan
parents:
diff changeset
  2753
% identify the current letter referenced column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2754
% if invalid, use a default column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2755
\def\@IEEEgetcurcol#1{\expandafter\ifx\csname @IEEEeqnarraycolDEF#1\endcsname\@IEEEeqnarraycolisdefined%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2756
\def\@IEEEBPcurcolname{#1}\else% invalid column name
301f567e2a8e add document
chunhan
parents:
diff changeset
  2757
\@IEEEclspkgerror{Invalid column type "#1" in column specifications.\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2758
Using a default centering column instead}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2759
{You must define IEEEeqnarray column types before use.}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2760
\def\@IEEEBPcurcolname{@IEEEdefault}\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2761
301f567e2a8e add document
chunhan
parents:
diff changeset
  2762
301f567e2a8e add document
chunhan
parents:
diff changeset
  2763
% identify and return the predefined (punctuation) glue value
301f567e2a8e add document
chunhan
parents:
diff changeset
  2764
\def\@IEEEgetcurglue#1#2{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2765
% ! = \! (neg small)  -0.16667em (-3/18 em)
301f567e2a8e add document
chunhan
parents:
diff changeset
  2766
% , = \, (small)       0.16667em ( 3/18 em)
301f567e2a8e add document
chunhan
parents:
diff changeset
  2767
% : = \: (med)         0.22222em ( 4/18 em)
301f567e2a8e add document
chunhan
parents:
diff changeset
  2768
% ; = \; (large)       0.27778em ( 5/18 em)
301f567e2a8e add document
chunhan
parents:
diff changeset
  2769
% ' = \quad            1em
301f567e2a8e add document
chunhan
parents:
diff changeset
  2770
% " = \qquad           2em
301f567e2a8e add document
chunhan
parents:
diff changeset
  2771
% . = 0.5\arraycolsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  2772
% / = \arraycolsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  2773
% ? = 2\arraycolsep
301f567e2a8e add document
chunhan
parents:
diff changeset
  2774
% * = 1fil
301f567e2a8e add document
chunhan
parents:
diff changeset
  2775
% + = \@IEEEeqnarraycolSEPcenter
301f567e2a8e add document
chunhan
parents:
diff changeset
  2776
% - = \@IEEEeqnarraycolSEPzero
301f567e2a8e add document
chunhan
parents:
diff changeset
  2777
% Note that all em values are referenced to the math font (textfont2) fontdimen6
301f567e2a8e add document
chunhan
parents:
diff changeset
  2778
% value for 1em.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2779
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2780
% use only the very first token to determine the type
301f567e2a8e add document
chunhan
parents:
diff changeset
  2781
% this prevents errant tokens from getting in the main text
301f567e2a8e add document
chunhan
parents:
diff changeset
  2782
% \noindent is used as a delimiter here
301f567e2a8e add document
chunhan
parents:
diff changeset
  2783
\def\@IEEEgrabfirstoken##1##2\noindent{\let\@IEEEgrabbedfirstoken=##1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2784
\@IEEEgrabfirstoken#1\relax\relax\noindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  2785
% get the math font 1em value
301f567e2a8e add document
chunhan
parents:
diff changeset
  2786
% LaTeX2e's NFSS2 does not preload the fonts, but \IEEEeqnarray needs
301f567e2a8e add document
chunhan
parents:
diff changeset
  2787
% to gain access to the math (\textfont2) font's spacing parameters.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2788
% So we create a bogus box here that uses the math font to ensure
301f567e2a8e add document
chunhan
parents:
diff changeset
  2789
% that \textfont2 is loaded and ready. If this is not done,
301f567e2a8e add document
chunhan
parents:
diff changeset
  2790
% the \textfont2 stuff here may not work.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2791
% Thanks to Bernd Raichle for his 1997 post on this topic.
301f567e2a8e add document
chunhan
parents:
diff changeset
  2792
{\setbox0=\hbox{$\displaystyle\relax$}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2793
% fontdimen6 has the width of 1em (a quad).
301f567e2a8e add document
chunhan
parents:
diff changeset
  2794
\@IEEEtrantmpdimenA=\fontdimen6\textfont2\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2795
% identify the glue value based on the first token
301f567e2a8e add document
chunhan
parents:
diff changeset
  2796
% we discard anything after the first
301f567e2a8e add document
chunhan
parents:
diff changeset
  2797
\if!\@IEEEgrabbedfirstoken\@IEEEtrantmpdimenA=-0.16667\@IEEEtrantmpdimenA\edef#2{\the\@IEEEtrantmpdimenA}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2798
\if,\@IEEEgrabbedfirstoken\@IEEEtrantmpdimenA=0.16667\@IEEEtrantmpdimenA\edef#2{\the\@IEEEtrantmpdimenA}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2799
\if:\@IEEEgrabbedfirstoken\@IEEEtrantmpdimenA=0.22222\@IEEEtrantmpdimenA\edef#2{\the\@IEEEtrantmpdimenA}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2800
\if;\@IEEEgrabbedfirstoken\@IEEEtrantmpdimenA=0.27778\@IEEEtrantmpdimenA\edef#2{\the\@IEEEtrantmpdimenA}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2801
\if'\@IEEEgrabbedfirstoken\@IEEEtrantmpdimenA=1\@IEEEtrantmpdimenA\edef#2{\the\@IEEEtrantmpdimenA}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2802
\if"\@IEEEgrabbedfirstoken\@IEEEtrantmpdimenA=2\@IEEEtrantmpdimenA\edef#2{\the\@IEEEtrantmpdimenA}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2803
\if.\@IEEEgrabbedfirstoken\@IEEEtrantmpdimenA=0.5\arraycolsep\edef#2{\the\@IEEEtrantmpdimenA}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2804
\if/\@IEEEgrabbedfirstoken\edef#2{\the\arraycolsep}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2805
\if?\@IEEEgrabbedfirstoken\@IEEEtrantmpdimenA=2\arraycolsep\edef#2{\the\@IEEEtrantmpdimenA}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2806
\if *\@IEEEgrabbedfirstoken\edef#2{0pt plus 1fil minus 0pt}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2807
\if+\@IEEEgrabbedfirstoken\edef#2{\@IEEEeqnarraycolSEPcenter}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2808
\if-\@IEEEgrabbedfirstoken\edef#2{\@IEEEeqnarraycolSEPzero}\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2809
\edef#2{\@IEEEeqnarraycolSEPzero}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2810
\@IEEEclspkgerror{Invalid predefined inter-column glue type "#1" in\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2811
column specifications. Using a default value of\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2812
0pt instead}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2813
{Only !,:;'"./?*+ and - are valid predefined glue types in the\MessageBreak 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2814
IEEEeqnarray column specifications.}\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2815
301f567e2a8e add document
chunhan
parents:
diff changeset
  2816
301f567e2a8e add document
chunhan
parents:
diff changeset
  2817
301f567e2a8e add document
chunhan
parents:
diff changeset
  2818
% process a numerical digit from the column specification
301f567e2a8e add document
chunhan
parents:
diff changeset
  2819
% and look up the corresponding user defined glue value
301f567e2a8e add document
chunhan
parents:
diff changeset
  2820
% can transform current type from n to g or a as the user defined glue is acquired
301f567e2a8e add document
chunhan
parents:
diff changeset
  2821
\def\@IEEEprocessNcol#1{\if\@IEEEBPprevtype g%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2822
\@IEEEclspkgerror{Back-to-back inter-column glue specifiers in column\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2823
specifications. Ignoring consecutive glue specifiers\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2824
after the first}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2825
{You cannot have two or more glue types next to each other\MessageBreak 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2826
in the IEEEeqnarray column specifications.}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2827
\let\@IEEEBPcurtype=a% abort this glue, future digits will be discarded
301f567e2a8e add document
chunhan
parents:
diff changeset
  2828
\@IEEEBPcurnum=0\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2829
\else% if we previously aborted a glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2830
\if\@IEEEBPprevtype a\@IEEEBPcurnum=0\let\@IEEEBPcurtype=a%maintain digit abortion
301f567e2a8e add document
chunhan
parents:
diff changeset
  2831
\else%acquire this number
301f567e2a8e add document
chunhan
parents:
diff changeset
  2832
% save the previous type before the numerical digits started
301f567e2a8e add document
chunhan
parents:
diff changeset
  2833
\if\@IEEEBPprevtype n\else\let\@IEEEBPprevsavedtype=\@IEEEBPprevtype\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2834
\multiply\@IEEEBPcurnum by 10\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2835
\advance\@IEEEBPcurnum by #1\relax% add in number, \relax is needed to stop TeX's number scan
301f567e2a8e add document
chunhan
parents:
diff changeset
  2836
\if\@IEEEBPnexttype n\else%close acquisition
301f567e2a8e add document
chunhan
parents:
diff changeset
  2837
\expandafter\ifx\csname @IEEEeqnarraycolSEPDEF\expandafter\romannumeral\number\@IEEEBPcurnum\endcsname\@IEEEeqnarraycolisdefined%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2838
\edef\@IEEEBPcurglue{\csname @IEEEeqnarraycolSEP\expandafter\romannumeral\number\@IEEEBPcurnum\endcsname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2839
\else%user glue not defined
301f567e2a8e add document
chunhan
parents:
diff changeset
  2840
\@IEEEclspkgerror{Invalid user defined inter-column glue type "\number\@IEEEBPcurnum" in\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2841
column specifications. Using a default value of\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2842
0pt instead}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2843
{You must define all IEEEeqnarray numerical inter-column glue types via\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2844
\string\IEEEeqnarraydefcolsep \space before they are used in column specifications.}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2845
\edef\@IEEEBPcurglue{\@IEEEeqnarraycolSEPzero}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2846
\fi% glue defined or not
301f567e2a8e add document
chunhan
parents:
diff changeset
  2847
\let\@IEEEBPcurtype=g% change the type to reflect the acquired glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2848
\let\@IEEEBPprevtype=\@IEEEBPprevsavedtype% restore the prev type before this number glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2849
\@IEEEBPcurnum=0\relax%ready for next acquisition
301f567e2a8e add document
chunhan
parents:
diff changeset
  2850
\fi%close acquisition, get glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2851
\fi%discard or acquire number
301f567e2a8e add document
chunhan
parents:
diff changeset
  2852
\fi%prevtype glue or not
301f567e2a8e add document
chunhan
parents:
diff changeset
  2853
}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2854
301f567e2a8e add document
chunhan
parents:
diff changeset
  2855
301f567e2a8e add document
chunhan
parents:
diff changeset
  2856
% process an acquired glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2857
% add any acquired column/glue pair to the preamble
301f567e2a8e add document
chunhan
parents:
diff changeset
  2858
\def\@IEEEprocessGcol{\if\@IEEEBPprevtype a\let\@IEEEBPcurtype=a%maintain previous glue abortions
301f567e2a8e add document
chunhan
parents:
diff changeset
  2859
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2860
% if this is the start glue, save it, but do nothing else 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2861
% as this is not used in the preamble, but before
301f567e2a8e add document
chunhan
parents:
diff changeset
  2862
\if\@IEEEBPprevtype s\edef\@IEEEBPstartglue{\@IEEEBPcurglue}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2863
\else%not the start glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2864
\if\@IEEEBPprevtype g%ignore if back to back glues
301f567e2a8e add document
chunhan
parents:
diff changeset
  2865
\@IEEEclspkgerror{Back-to-back inter-column glue specifiers in column\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2866
specifications. Ignoring consecutive glue specifiers\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2867
after the first}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2868
{You cannot have two or more glue types next to each other\MessageBreak 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2869
in the IEEEeqnarray column specifications.}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2870
\let\@IEEEBPcurtype=a% abort this glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2871
\else% not a back to back glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2872
\if\@IEEEBPprevtype c\relax% if the previoustype was a col, add column/glue pair to preamble
301f567e2a8e add document
chunhan
parents:
diff changeset
  2873
\ifnum\@IEEEeqnnumcols>0\relax\@IEEEappendtoksA{&}\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2874
\toks0={##}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2875
% make preamble advance col counter if this environment needs this
301f567e2a8e add document
chunhan
parents:
diff changeset
  2876
\if@advanceIEEEeqncolcnt\@IEEEappendtoksA{\global\advance\@IEEEeqncolcnt by 1\relax}\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2877
% insert the column defintion into the preamble, being careful not to expand
301f567e2a8e add document
chunhan
parents:
diff changeset
  2878
% the column definition
301f567e2a8e add document
chunhan
parents:
diff changeset
  2879
\@IEEEappendtoksA{\tabskip=\@IEEEBPcurglue}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2880
\@IEEEappendNOEXPANDtoksA{\begingroup\csname @IEEEeqnarraycolPRE}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2881
\@IEEEappendtoksA{\@IEEEBPcurcolname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2882
\@IEEEappendNOEXPANDtoksA{\endcsname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2883
\@IEEEappendtoksA{\the\toks0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2884
\@IEEEappendNOEXPANDtoksA{\relax\relax\relax\relax\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2885
\relax\relax\relax\relax\relax\csname @IEEEeqnarraycolPOST}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2886
\@IEEEappendtoksA{\@IEEEBPcurcolname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2887
\@IEEEappendNOEXPANDtoksA{\endcsname\relax\relax\relax\relax\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2888
\relax\relax\relax\relax\relax\endgroup}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2889
\advance\@IEEEeqnnumcols by 1\relax%one more column in the preamble
301f567e2a8e add document
chunhan
parents:
diff changeset
  2890
\else% error: non-start glue with no pending column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2891
\@IEEEclspkgerror{Inter-column glue specifier without a prior column\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2892
type in the column specifications. Ignoring this glue\MessageBreak 
301f567e2a8e add document
chunhan
parents:
diff changeset
  2893
specifier}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2894
{Except for the first and last positions, glue can be placed only\MessageBreak
301f567e2a8e add document
chunhan
parents:
diff changeset
  2895
between column types.}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2896
\let\@IEEEBPcurtype=a% abort this glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2897
\fi% previous was a column
301f567e2a8e add document
chunhan
parents:
diff changeset
  2898
\fi% back-to-back glues
301f567e2a8e add document
chunhan
parents:
diff changeset
  2899
\fi% is start column glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2900
\fi% prev type not a
301f567e2a8e add document
chunhan
parents:
diff changeset
  2901
}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2902
301f567e2a8e add document
chunhan
parents:
diff changeset
  2903
301f567e2a8e add document
chunhan
parents:
diff changeset
  2904
% process an acquired letter referenced column and, if necessary, add it to the preamble
301f567e2a8e add document
chunhan
parents:
diff changeset
  2905
\def\@IEEEprocessCcol{\if\@IEEEBPnexttype g\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2906
\if\@IEEEBPnexttype n\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2907
% we have a column followed by something other than a glue (or numeral glue)
301f567e2a8e add document
chunhan
parents:
diff changeset
  2908
% so we must add this column to the preamble now
301f567e2a8e add document
chunhan
parents:
diff changeset
  2909
\ifnum\@IEEEeqnnumcols>0\relax\@IEEEappendtoksA{&}\fi%col separator for those after the first
301f567e2a8e add document
chunhan
parents:
diff changeset
  2910
\if\@IEEEBPnexttype e\@IEEEappendtoksA{\tabskip=\@IEEEBPendglue\relax}\else%put in end glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2911
\@IEEEappendtoksA{\tabskip=\@IEEEeqnarraycolSEPdefaultmid\relax}\fi% or default mid glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2912
\toks0={##}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2913
% make preamble advance col counter if this environment needs this
301f567e2a8e add document
chunhan
parents:
diff changeset
  2914
\if@advanceIEEEeqncolcnt\@IEEEappendtoksA{\global\advance\@IEEEeqncolcnt by 1\relax}\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2915
% insert the column definition into the preamble, being careful not to expand
301f567e2a8e add document
chunhan
parents:
diff changeset
  2916
% the column definition
301f567e2a8e add document
chunhan
parents:
diff changeset
  2917
\@IEEEappendNOEXPANDtoksA{\begingroup\csname @IEEEeqnarraycolPRE}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2918
\@IEEEappendtoksA{\@IEEEBPcurcolname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2919
\@IEEEappendNOEXPANDtoksA{\endcsname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2920
\@IEEEappendtoksA{\the\toks0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2921
\@IEEEappendNOEXPANDtoksA{\relax\relax\relax\relax\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2922
\relax\relax\relax\relax\relax\csname @IEEEeqnarraycolPOST}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2923
\@IEEEappendtoksA{\@IEEEBPcurcolname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2924
\@IEEEappendNOEXPANDtoksA{\endcsname\relax\relax\relax\relax\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2925
\relax\relax\relax\relax\relax\endgroup}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2926
\advance\@IEEEeqnnumcols by 1\relax%one more column in the preamble
301f567e2a8e add document
chunhan
parents:
diff changeset
  2927
\fi%next type not numeral
301f567e2a8e add document
chunhan
parents:
diff changeset
  2928
\fi%next type not glue
301f567e2a8e add document
chunhan
parents:
diff changeset
  2929
}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2930
301f567e2a8e add document
chunhan
parents:
diff changeset
  2931
301f567e2a8e add document
chunhan
parents:
diff changeset
  2932
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2933
%% END OF IEEEeqnarry DEFINITIONS
301f567e2a8e add document
chunhan
parents:
diff changeset
  2934
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2935
301f567e2a8e add document
chunhan
parents:
diff changeset
  2936
301f567e2a8e add document
chunhan
parents:
diff changeset
  2937
301f567e2a8e add document
chunhan
parents:
diff changeset
  2938
301f567e2a8e add document
chunhan
parents:
diff changeset
  2939
% set up the running headings, this complex because of all the different
301f567e2a8e add document
chunhan
parents:
diff changeset
  2940
% modes IEEEtran supports
301f567e2a8e add document
chunhan
parents:
diff changeset
  2941
\if@twoside
301f567e2a8e add document
chunhan
parents:
diff changeset
  2942
 \ifCLASSOPTIONtechnote
301f567e2a8e add document
chunhan
parents:
diff changeset
  2943
   \def\ps@headings{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2944
       \def\@oddhead{\hbox{}\scriptsize\leftmark \hfil \thepage}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2945
       \def\@evenhead{\scriptsize\thepage \hfil \leftmark\hbox{}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2946
       \ifCLASSOPTIONdraftcls
301f567e2a8e add document
chunhan
parents:
diff changeset
  2947
            \ifCLASSOPTIONdraftclsnofoot
301f567e2a8e add document
chunhan
parents:
diff changeset
  2948
               \def\@oddfoot{}\def\@evenfoot{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2949
            \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2950
               \def\@oddfoot{\scriptsize\@date\hfil DRAFT}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2951
               \def\@evenfoot{\scriptsize DRAFT\hfil\@date}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2952
            \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2953
       \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2954
            \def\@oddfoot{}\def\@evenfoot{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2955
       \fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2956
 \else % not a technote
301f567e2a8e add document
chunhan
parents:
diff changeset
  2957
   \def\ps@headings{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2958
       \ifCLASSOPTIONconference
301f567e2a8e add document
chunhan
parents:
diff changeset
  2959
        \def\@oddhead{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2960
        \def\@evenhead{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2961
       \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2962
        \def\@oddhead{\hbox{}\scriptsize\rightmark \hfil \thepage}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2963
        \def\@evenhead{\scriptsize\thepage \hfil \leftmark\hbox{}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2964
       \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2965
       \ifCLASSOPTIONdraftcls
301f567e2a8e add document
chunhan
parents:
diff changeset
  2966
            \def\@oddhead{\hbox{}\scriptsize\rightmark \hfil \thepage}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2967
            \def\@evenhead{\scriptsize\thepage \hfil \leftmark\hbox{}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2968
            \ifCLASSOPTIONdraftclsnofoot
301f567e2a8e add document
chunhan
parents:
diff changeset
  2969
               \def\@oddfoot{}\def\@evenfoot{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2970
            \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2971
               \def\@oddfoot{\scriptsize\@date\hfil DRAFT}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2972
               \def\@evenfoot{\scriptsize DRAFT\hfil\@date}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2973
            \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2974
       \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2975
            \def\@oddfoot{}\def\@evenfoot{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2976
       \fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2977
 \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2978
\else % single side
301f567e2a8e add document
chunhan
parents:
diff changeset
  2979
\def\ps@headings{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  2980
    \ifCLASSOPTIONconference
301f567e2a8e add document
chunhan
parents:
diff changeset
  2981
     \def\@oddhead{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2982
     \def\@evenhead{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2983
    \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2984
     \def\@oddhead{\hbox{}\scriptsize\leftmark \hfil \thepage}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2985
     \def\@evenhead{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2986
    \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2987
    \ifCLASSOPTIONdraftcls
301f567e2a8e add document
chunhan
parents:
diff changeset
  2988
          \def\@oddhead{\hbox{}\scriptsize\leftmark \hfil \thepage}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2989
          \def\@evenhead{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2990
          \ifCLASSOPTIONdraftclsnofoot
301f567e2a8e add document
chunhan
parents:
diff changeset
  2991
             \def\@oddfoot{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2992
          \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2993
             \def\@oddfoot{\scriptsize \@date \hfil DRAFT}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2994
          \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2995
    \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  2996
         \def\@oddfoot{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2997
    \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  2998
    \def\@evenfoot{}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  2999
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3000
301f567e2a8e add document
chunhan
parents:
diff changeset
  3001
301f567e2a8e add document
chunhan
parents:
diff changeset
  3002
% title page style
301f567e2a8e add document
chunhan
parents:
diff changeset
  3003
\def\ps@IEEEtitlepagestyle{\def\@oddfoot{}\def\@evenfoot{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3004
\ifCLASSOPTIONconference
301f567e2a8e add document
chunhan
parents:
diff changeset
  3005
   \def\@oddhead{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3006
   \def\@evenhead{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3007
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3008
   \def\@oddhead{\hbox{}\scriptsize\leftmark \hfil \thepage}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3009
   \def\@evenhead{\scriptsize\thepage \hfil \leftmark\hbox{}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3010
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3011
\ifCLASSOPTIONdraftcls
301f567e2a8e add document
chunhan
parents:
diff changeset
  3012
   \def\@oddhead{\hbox{}\scriptsize\leftmark \hfil \thepage}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3013
   \def\@evenhead{\scriptsize\thepage \hfil \leftmark\hbox{}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3014
   \ifCLASSOPTIONdraftclsnofoot\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3015
      \def\@oddfoot{\scriptsize \@date\hfil DRAFT}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3016
      \def\@evenfoot{\scriptsize DRAFT\hfil \@date}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3017
   \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3018
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3019
   % all non-draft mode footers
301f567e2a8e add document
chunhan
parents:
diff changeset
  3020
   \if@IEEEusingpubid
301f567e2a8e add document
chunhan
parents:
diff changeset
  3021
      % for title pages that are using a pubid
301f567e2a8e add document
chunhan
parents:
diff changeset
  3022
      % do not repeat pubid if using peer review option
301f567e2a8e add document
chunhan
parents:
diff changeset
  3023
      \ifCLASSOPTIONpeerreview
301f567e2a8e add document
chunhan
parents:
diff changeset
  3024
      \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3025
         \footskip 0pt%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3026
         \ifCLASSOPTIONcompsocconf
301f567e2a8e add document
chunhan
parents:
diff changeset
  3027
           \def\@oddfoot{\hss\normalfont\scriptsize\raisebox{-1.5\@IEEEnormalsizeunitybaselineskip}[0ex][0ex]{\@IEEEpubid}\hss}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3028
           \def\@evenfoot{\hss\normalfont\scriptsize\raisebox{-1.5\@IEEEnormalsizeunitybaselineskip}[0ex][0ex]{\@IEEEpubid}\hss}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3029
         \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3030
           \def\@oddfoot{\hss\normalfont\footnotesize\raisebox{1.5ex}[1.5ex]{\@IEEEpubid}\hss}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3031
           \def\@evenfoot{\hss\normalfont\footnotesize\raisebox{1.5ex}[1.5ex]{\@IEEEpubid}\hss}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3032
         \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3033
      \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3034
   \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3035
\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3036
301f567e2a8e add document
chunhan
parents:
diff changeset
  3037
301f567e2a8e add document
chunhan
parents:
diff changeset
  3038
% peer review cover page style
301f567e2a8e add document
chunhan
parents:
diff changeset
  3039
\def\ps@IEEEpeerreviewcoverpagestyle{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3040
\def\@oddhead{}\def\@evenhead{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3041
\def\@oddfoot{}\def\@evenfoot{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3042
\ifCLASSOPTIONdraftcls
301f567e2a8e add document
chunhan
parents:
diff changeset
  3043
   \ifCLASSOPTIONdraftclsnofoot\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3044
      \def\@oddfoot{\scriptsize \@date\hfil DRAFT}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3045
      \def\@evenfoot{\scriptsize DRAFT\hfil \@date}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3046
   \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3047
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3048
   % non-draft mode footers
301f567e2a8e add document
chunhan
parents:
diff changeset
  3049
   \if@IEEEusingpubid
301f567e2a8e add document
chunhan
parents:
diff changeset
  3050
      \footskip 0pt%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3051
      \ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  3052
        \def\@oddfoot{\hss\normalfont\scriptsize\raisebox{-1.5\@IEEEnormalsizeunitybaselineskip}[0ex][0ex]{\@IEEEpubid}\hss}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3053
        \def\@evenfoot{\hss\normalfont\scriptsize\raisebox{-1.5\@IEEEnormalsizeunitybaselineskip}[0ex][0ex]{\@IEEEpubid}\hss}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3054
      \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3055
        \def\@oddfoot{\hss\normalfont\footnotesize\raisebox{1.5ex}[1.5ex]{\@IEEEpubid}\hss}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3056
        \def\@evenfoot{\hss\normalfont\footnotesize\raisebox{1.5ex}[1.5ex]{\@IEEEpubid}\hss}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3057
      \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3058
   \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3059
\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3060
301f567e2a8e add document
chunhan
parents:
diff changeset
  3061
301f567e2a8e add document
chunhan
parents:
diff changeset
  3062
% start with empty headings
301f567e2a8e add document
chunhan
parents:
diff changeset
  3063
\def\rightmark{}\def\leftmark{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3064
301f567e2a8e add document
chunhan
parents:
diff changeset
  3065
301f567e2a8e add document
chunhan
parents:
diff changeset
  3066
%% Defines the command for putting the header. \footernote{TEXT} is the same
301f567e2a8e add document
chunhan
parents:
diff changeset
  3067
%% as \markboth{TEXT}{TEXT}. 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3068
%% Note that all the text is forced into uppercase, if you have some text
301f567e2a8e add document
chunhan
parents:
diff changeset
  3069
%% that needs to be in lower case, for instance et. al., then either manually
301f567e2a8e add document
chunhan
parents:
diff changeset
  3070
%% set \leftmark and \rightmark or use \MakeLowercase{et. al.} within the
301f567e2a8e add document
chunhan
parents:
diff changeset
  3071
%% arguments to \markboth.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3072
\def\markboth#1#2{\def\leftmark{\@IEEEcompsoconly{\sffamily}\MakeUppercase{#1}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3073
\def\rightmark{\@IEEEcompsoconly{\sffamily}\MakeUppercase{#2}}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3074
\def\footernote#1{\markboth{#1}{#1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3075
301f567e2a8e add document
chunhan
parents:
diff changeset
  3076
\def\today{\ifcase\month\or
301f567e2a8e add document
chunhan
parents:
diff changeset
  3077
    January\or February\or March\or April\or May\or June\or
301f567e2a8e add document
chunhan
parents:
diff changeset
  3078
    July\or August\or September\or October\or November\or December\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3079
    \space\number\day, \number\year}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3080
301f567e2a8e add document
chunhan
parents:
diff changeset
  3081
301f567e2a8e add document
chunhan
parents:
diff changeset
  3082
301f567e2a8e add document
chunhan
parents:
diff changeset
  3083
301f567e2a8e add document
chunhan
parents:
diff changeset
  3084
%% CITATION AND BIBLIOGRAPHY COMMANDS
301f567e2a8e add document
chunhan
parents:
diff changeset
  3085
%% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3086
%% V1.6 no longer supports the older, nonstandard \shortcite and \citename setup stuff
301f567e2a8e add document
chunhan
parents:
diff changeset
  3087
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3088
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3089
% Modify Latex2e \@citex to separate citations with "], ["
301f567e2a8e add document
chunhan
parents:
diff changeset
  3090
\def\@citex[#1]#2{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3091
  \let\@citea\@empty
301f567e2a8e add document
chunhan
parents:
diff changeset
  3092
  \@cite{\@for\@citeb:=#2\do
301f567e2a8e add document
chunhan
parents:
diff changeset
  3093
    {\@citea\def\@citea{], [}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3094
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3095
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3096
     \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3097
       \G@refundefinedtrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  3098
       \@latex@warning
301f567e2a8e add document
chunhan
parents:
diff changeset
  3099
         {Citation `\@citeb' on page \thepage \space undefined}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3100
       {\hbox{\csname b@\@citeb\endcsname}}}}{#1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3101
301f567e2a8e add document
chunhan
parents:
diff changeset
  3102
% V1.6 we create hooks for the optional use of Donald Arseneau's
301f567e2a8e add document
chunhan
parents:
diff changeset
  3103
% cite.sty package. cite.sty is "smart" and will notice that the
301f567e2a8e add document
chunhan
parents:
diff changeset
  3104
% following format controls are already defined and will not
301f567e2a8e add document
chunhan
parents:
diff changeset
  3105
% redefine them. The result will be the proper sorting of the
301f567e2a8e add document
chunhan
parents:
diff changeset
  3106
% citation numbers and auto detection of 3 or more entry "ranges" -
301f567e2a8e add document
chunhan
parents:
diff changeset
  3107
% all in IEEE style:  [1], [2], [5]--[7], [12]
301f567e2a8e add document
chunhan
parents:
diff changeset
  3108
% This also allows for an optional note, i.e., \cite[mynote]{..}.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3109
% If the \cite with note has more than one reference, the note will
301f567e2a8e add document
chunhan
parents:
diff changeset
  3110
% be applied to the last of the listed references. It is generally
301f567e2a8e add document
chunhan
parents:
diff changeset
  3111
% desired that if a note is given, only one reference is listed in
301f567e2a8e add document
chunhan
parents:
diff changeset
  3112
% that \cite.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3113
% Thanks to Mr. Arseneau for providing the required format arguments
301f567e2a8e add document
chunhan
parents:
diff changeset
  3114
% to produce the IEEE style.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3115
\def\citepunct{], [}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3116
\def\citedash{]--[}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3117
301f567e2a8e add document
chunhan
parents:
diff changeset
  3118
% V1.7 default to using same font for urls made by url.sty
301f567e2a8e add document
chunhan
parents:
diff changeset
  3119
\AtBeginDocument{\csname url@samestyle\endcsname}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3120
301f567e2a8e add document
chunhan
parents:
diff changeset
  3121
% V1.6 class files should always provide these
301f567e2a8e add document
chunhan
parents:
diff changeset
  3122
\def\newblock{\hskip .11em\@plus.33em\@minus.07em}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3123
\let\@openbib@code\@empty
301f567e2a8e add document
chunhan
parents:
diff changeset
  3124
301f567e2a8e add document
chunhan
parents:
diff changeset
  3125
301f567e2a8e add document
chunhan
parents:
diff changeset
  3126
% Provide support for the control entries of IEEEtran.bst V1.00 and later.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3127
% V1.7 optional argument allows for a different aux file to be specified in
301f567e2a8e add document
chunhan
parents:
diff changeset
  3128
% order to handle multiple bibliographies. For example, with multibib.sty:
301f567e2a8e add document
chunhan
parents:
diff changeset
  3129
% \newcites{sec}{Secondary Literature}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3130
% \bstctlcite[@auxoutsec]{BSTcontrolhak}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3131
\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3132
\def\@bstctlcite[#1]#2{\@bsphack
301f567e2a8e add document
chunhan
parents:
diff changeset
  3133
  \@for\@citeb:=#2\do{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3134
    \edef\@citeb{\expandafter\@firstofone\@citeb}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3135
    \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3136
  \@esphack}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3137
301f567e2a8e add document
chunhan
parents:
diff changeset
  3138
% V1.6 provide a way for a user to execute a command just before 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3139
% a given reference number - used to insert a \newpage to balance
301f567e2a8e add document
chunhan
parents:
diff changeset
  3140
% the columns on the last page
301f567e2a8e add document
chunhan
parents:
diff changeset
  3141
\edef\@IEEEtriggerrefnum{0}   % the default of zero means that
301f567e2a8e add document
chunhan
parents:
diff changeset
  3142
                              % the command is not executed
301f567e2a8e add document
chunhan
parents:
diff changeset
  3143
\def\@IEEEtriggercmd{\newpage}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3144
301f567e2a8e add document
chunhan
parents:
diff changeset
  3145
% allow the user to alter the triggered command
301f567e2a8e add document
chunhan
parents:
diff changeset
  3146
\long\def\IEEEtriggercmd#1{\long\def\@IEEEtriggercmd{#1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3147
301f567e2a8e add document
chunhan
parents:
diff changeset
  3148
% allow user a way to specify the reference number just before the
301f567e2a8e add document
chunhan
parents:
diff changeset
  3149
% command is executed
301f567e2a8e add document
chunhan
parents:
diff changeset
  3150
\def\IEEEtriggeratref#1{\@IEEEtrantmpcountA=#1%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3151
\edef\@IEEEtriggerrefnum{\the\@IEEEtrantmpcountA}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3152
301f567e2a8e add document
chunhan
parents:
diff changeset
  3153
% trigger command at the given reference
301f567e2a8e add document
chunhan
parents:
diff changeset
  3154
\def\@IEEEbibitemprefix{\@IEEEtrantmpcountA=\@IEEEtriggerrefnum\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3155
\advance\@IEEEtrantmpcountA by -1\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3156
\ifnum\c@enumiv=\@IEEEtrantmpcountA\relax\@IEEEtriggercmd\relax\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3157
301f567e2a8e add document
chunhan
parents:
diff changeset
  3158
301f567e2a8e add document
chunhan
parents:
diff changeset
  3159
\def\@biblabel#1{[#1]}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3160
301f567e2a8e add document
chunhan
parents:
diff changeset
  3161
% compsoc journals left align the reference numbers
301f567e2a8e add document
chunhan
parents:
diff changeset
  3162
\@IEEEcompsocnotconfonly{\def\@biblabel#1{[#1]\hfill}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3163
301f567e2a8e add document
chunhan
parents:
diff changeset
  3164
% controls bib item spacing
301f567e2a8e add document
chunhan
parents:
diff changeset
  3165
\def\IEEEbibitemsep{0pt plus .5pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3166
301f567e2a8e add document
chunhan
parents:
diff changeset
  3167
\@IEEEcompsocconfonly{\def\IEEEbibitemsep{1\baselineskip plus 0.25\baselineskip minus 0.25\baselineskip}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3168
301f567e2a8e add document
chunhan
parents:
diff changeset
  3169
301f567e2a8e add document
chunhan
parents:
diff changeset
  3170
\def\thebibliography#1{\section*{\refname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3171
    \addcontentsline{toc}{section}{\refname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3172
    % V1.6 add some rubber space here and provide a command trigger
301f567e2a8e add document
chunhan
parents:
diff changeset
  3173
    \footnotesize\@IEEEcompsocconfonly{\small}\vskip 0.3\baselineskip plus 0.1\baselineskip minus 0.1\baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3174
    \list{\@biblabel{\@arabic\c@enumiv}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3175
    {\settowidth\labelwidth{\@biblabel{#1}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3176
    \leftmargin\labelwidth
301f567e2a8e add document
chunhan
parents:
diff changeset
  3177
    \advance\leftmargin\labelsep\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3178
    \itemsep \IEEEbibitemsep\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3179
    \usecounter{enumiv}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3180
    \let\p@enumiv\@empty
301f567e2a8e add document
chunhan
parents:
diff changeset
  3181
    \renewcommand\theenumiv{\@arabic\c@enumiv}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3182
    \let\@IEEElatexbibitem\bibitem%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3183
    \def\bibitem{\@IEEEbibitemprefix\@IEEElatexbibitem}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3184
\def\newblock{\hskip .11em plus .33em minus .07em}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3185
% originally:
301f567e2a8e add document
chunhan
parents:
diff changeset
  3186
%   \sloppy\clubpenalty4000\widowpenalty4000%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3187
% by adding the \interlinepenalty here, we make it more
301f567e2a8e add document
chunhan
parents:
diff changeset
  3188
% difficult, but not impossible, for LaTeX to break within a reference.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3189
% IEEE almost never breaks a reference (but they do it more often with
301f567e2a8e add document
chunhan
parents:
diff changeset
  3190
% technotes). You may get an underfull vbox warning around the bibliography, 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3191
% but the final result will be much more like what IEEE will publish. 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3192
% MDS 11/2000
301f567e2a8e add document
chunhan
parents:
diff changeset
  3193
\ifCLASSOPTIONtechnote\sloppy\clubpenalty4000\widowpenalty4000\interlinepenalty100%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3194
\else\sloppy\clubpenalty4000\widowpenalty4000\interlinepenalty500\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3195
    \sfcode`\.=1000\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3196
\let\endthebibliography=\endlist
301f567e2a8e add document
chunhan
parents:
diff changeset
  3197
301f567e2a8e add document
chunhan
parents:
diff changeset
  3198
301f567e2a8e add document
chunhan
parents:
diff changeset
  3199
301f567e2a8e add document
chunhan
parents:
diff changeset
  3200
301f567e2a8e add document
chunhan
parents:
diff changeset
  3201
% TITLE PAGE COMMANDS
301f567e2a8e add document
chunhan
parents:
diff changeset
  3202
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3203
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3204
% \IEEEmembership is used to produce the sublargesize italic font used to indicate author 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3205
% IEEE membership. compsoc uses a large size sans slant font
301f567e2a8e add document
chunhan
parents:
diff changeset
  3206
\def\IEEEmembership#1{{\@IEEEnotcompsoconly{\sublargesize}\normalfont\@IEEEcompsoconly{\sffamily}\textit{#1}}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3207
 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3208
301f567e2a8e add document
chunhan
parents:
diff changeset
  3209
% \IEEEauthorrefmark{} produces a footnote type symbol to indicate author affiliation.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3210
% When given an argument of 1 to 9, \IEEEauthorrefmark{} follows the standard LaTeX footnote
301f567e2a8e add document
chunhan
parents:
diff changeset
  3211
% symbol sequence convention. However, for arguments 10 and above, \IEEEauthorrefmark{} 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3212
% reverts to using lower case roman numerals, so it cannot overflow. Do note that you 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3213
% cannot use \footnotemark[] in place of \IEEEauthorrefmark{} within \author as the footnote
301f567e2a8e add document
chunhan
parents:
diff changeset
  3214
% symbols will have been turned off to prevent \thanks from creating footnote marks.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3215
% \IEEEauthorrefmark{} produces a symbol that appears to LaTeX as having zero vertical
301f567e2a8e add document
chunhan
parents:
diff changeset
  3216
% height - this allows for a more compact line packing, but the user must ensure that
301f567e2a8e add document
chunhan
parents:
diff changeset
  3217
% the interline spacing is large enough to prevent \IEEEauthorrefmark{} from colliding
301f567e2a8e add document
chunhan
parents:
diff changeset
  3218
% with the text above.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3219
% V1.7 make this a robust command
301f567e2a8e add document
chunhan
parents:
diff changeset
  3220
\DeclareRobustCommand*{\IEEEauthorrefmark}[1]{\raisebox{0pt}[0pt][0pt]{\textsuperscript{\footnotesize\ensuremath{\ifcase#1\or *\or \dagger\or \ddagger\or%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3221
    \mathsection\or \mathparagraph\or \|\or **\or \dagger\dagger%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3222
    \or \ddagger\ddagger \else\textsuperscript{\expandafter\romannumeral#1}\fi}}}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3223
301f567e2a8e add document
chunhan
parents:
diff changeset
  3224
301f567e2a8e add document
chunhan
parents:
diff changeset
  3225
% FONT CONTROLS AND SPACINGS FOR CONFERENCE MODE AUTHOR NAME AND AFFILIATION BLOCKS
301f567e2a8e add document
chunhan
parents:
diff changeset
  3226
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3227
% The default font styles for the author name and affiliation blocks (confmode)
301f567e2a8e add document
chunhan
parents:
diff changeset
  3228
%\def\@IEEEauthorblockNstyle{\normalfont\@IEEEcompsocnotconfonly{\sffamily}\sublargesize\@IEEEcompsocconfonly{\large}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3229
%\def\@IEEEauthorblockAstyle{\normalfont\@IEEEcompsocnotconfonly{\sffamily}\@IEEEcompsocconfonly{\itshape}\normalsize\@IEEEcompsocconfonly{\large}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3230
\def\@IEEEauthorblockNstyle{\normalfont\normalsize}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3231
\def\@IEEEauthorblockAstyle{\normalfont\@IEEEcompsocnotconfonly{\sffamily}\@IEEEcompsocconfonly{\itshape}\normalsize}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3232
301f567e2a8e add document
chunhan
parents:
diff changeset
  3233
% The default if the user does not use an author block
301f567e2a8e add document
chunhan
parents:
diff changeset
  3234
\def\@IEEEauthordefaulttextstyle{\normalfont\@IEEEcompsocnotconfonly{\sffamily}\sublargesize}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3235
301f567e2a8e add document
chunhan
parents:
diff changeset
  3236
% spacing from title (or special paper notice) to author name blocks (confmode)
301f567e2a8e add document
chunhan
parents:
diff changeset
  3237
% can be negative
301f567e2a8e add document
chunhan
parents:
diff changeset
  3238
\def\@IEEEauthorblockconfadjspace{-0.25em}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3239
% compsoc conferences need more space here
301f567e2a8e add document
chunhan
parents:
diff changeset
  3240
\@IEEEcompsocconfonly{\def\@IEEEauthorblockconfadjspace{0.75\@IEEEnormalsizeunitybaselineskip}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3241
301f567e2a8e add document
chunhan
parents:
diff changeset
  3242
% spacing between name and affiliation blocks (confmode)
301f567e2a8e add document
chunhan
parents:
diff changeset
  3243
% This can be negative.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3244
% IEEE doesn't want any added spacing here, but I will leave these
301f567e2a8e add document
chunhan
parents:
diff changeset
  3245
% controls in place in case they ever change their mind.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3246
% Personally, I like 0.75ex.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3247
%\def\@IEEEauthorblockNtopspace{0.75ex}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3248
%\def\@IEEEauthorblockAtopspace{0.75ex}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3249
\def\@IEEEauthorblockNtopspace{0.0ex}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3250
\def\@IEEEauthorblockAtopspace{0.0ex}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3251
% baseline spacing within name and affiliation blocks (confmode)
301f567e2a8e add document
chunhan
parents:
diff changeset
  3252
% must be positive, spacings below certain values will make 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3253
% the position of line of text sensitive to the contents of the
301f567e2a8e add document
chunhan
parents:
diff changeset
  3254
% line above it i.e., whether or not the prior line has descenders, 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3255
% subscripts, etc. For this reason it is a good idea to keep
301f567e2a8e add document
chunhan
parents:
diff changeset
  3256
% these above 2.6ex
301f567e2a8e add document
chunhan
parents:
diff changeset
  3257
\def\@IEEEauthorblockNinterlinespace{2.6ex}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3258
\def\@IEEEauthorblockAinterlinespace{2.75ex}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3259
301f567e2a8e add document
chunhan
parents:
diff changeset
  3260
% This tracks the required strut size.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3261
% See the \@IEEEauthorhalign command for the actual default value used.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3262
\def\@IEEEauthorblockXinterlinespace{2.7ex}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3263
301f567e2a8e add document
chunhan
parents:
diff changeset
  3264
% variables to retain font size and style across groups
301f567e2a8e add document
chunhan
parents:
diff changeset
  3265
% values given here have no effect as they will be overwritten later
301f567e2a8e add document
chunhan
parents:
diff changeset
  3266
\gdef\@IEEESAVESTATEfontsize{10}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3267
\gdef\@IEEESAVESTATEfontbaselineskip{12}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3268
\gdef\@IEEESAVESTATEfontencoding{OT1}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3269
\gdef\@IEEESAVESTATEfontfamily{ptm}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3270
\gdef\@IEEESAVESTATEfontseries{m}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3271
\gdef\@IEEESAVESTATEfontshape{n}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3272
301f567e2a8e add document
chunhan
parents:
diff changeset
  3273
% saves the current font attributes
301f567e2a8e add document
chunhan
parents:
diff changeset
  3274
\def\@IEEEcurfontSAVE{\global\let\@IEEESAVESTATEfontsize\f@size%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3275
\global\let\@IEEESAVESTATEfontbaselineskip\f@baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3276
\global\let\@IEEESAVESTATEfontencoding\f@encoding%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3277
\global\let\@IEEESAVESTATEfontfamily\f@family%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3278
\global\let\@IEEESAVESTATEfontseries\f@series%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3279
\global\let\@IEEESAVESTATEfontshape\f@shape}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3280
301f567e2a8e add document
chunhan
parents:
diff changeset
  3281
% restores the saved font attributes
301f567e2a8e add document
chunhan
parents:
diff changeset
  3282
\def\@IEEEcurfontRESTORE{\fontsize{\@IEEESAVESTATEfontsize}{\@IEEESAVESTATEfontbaselineskip}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3283
\fontencoding{\@IEEESAVESTATEfontencoding}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3284
\fontfamily{\@IEEESAVESTATEfontfamily}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3285
\fontseries{\@IEEESAVESTATEfontseries}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3286
\fontshape{\@IEEESAVESTATEfontshape}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3287
\selectfont}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3288
301f567e2a8e add document
chunhan
parents:
diff changeset
  3289
301f567e2a8e add document
chunhan
parents:
diff changeset
  3290
% variable to indicate if the current block is the first block in the column
301f567e2a8e add document
chunhan
parents:
diff changeset
  3291
\newif\if@IEEEprevauthorblockincol   \@IEEEprevauthorblockincolfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  3292
301f567e2a8e add document
chunhan
parents:
diff changeset
  3293
301f567e2a8e add document
chunhan
parents:
diff changeset
  3294
% the command places a strut with height and depth = \@IEEEauthorblockXinterlinespace
301f567e2a8e add document
chunhan
parents:
diff changeset
  3295
% we use this technique to have complete manual control over the spacing of the lines
301f567e2a8e add document
chunhan
parents:
diff changeset
  3296
% within the halign environment.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3297
% We set the below baseline portion at 30%, the above
301f567e2a8e add document
chunhan
parents:
diff changeset
  3298
% baseline portion at 70% of the total length.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3299
% Responds to changes in the document's \baselinestretch
301f567e2a8e add document
chunhan
parents:
diff changeset
  3300
\def\@IEEEauthorstrutrule{\@IEEEtrantmpdimenA\@IEEEauthorblockXinterlinespace%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3301
\@IEEEtrantmpdimenA=\baselinestretch\@IEEEtrantmpdimenA%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3302
\rule[-0.3\@IEEEtrantmpdimenA]{0pt}{\@IEEEtrantmpdimenA}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3303
301f567e2a8e add document
chunhan
parents:
diff changeset
  3304
301f567e2a8e add document
chunhan
parents:
diff changeset
  3305
% blocks to hold the authors' names and affilations. 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3306
% Makes formatting easy for conferences
301f567e2a8e add document
chunhan
parents:
diff changeset
  3307
%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3308
% use real definitions in conference mode
301f567e2a8e add document
chunhan
parents:
diff changeset
  3309
% name block
301f567e2a8e add document
chunhan
parents:
diff changeset
  3310
\def\IEEEauthorblockN#1{\relax\@IEEEauthorblockNstyle% set the default text style
301f567e2a8e add document
chunhan
parents:
diff changeset
  3311
\gdef\@IEEEauthorblockXinterlinespace{0pt}% disable strut for spacer row
301f567e2a8e add document
chunhan
parents:
diff changeset
  3312
% the \expandafter hides the \cr in conditional tex, see the array.sty docs
301f567e2a8e add document
chunhan
parents:
diff changeset
  3313
% for details, probably not needed here as the \cr is in a macro
301f567e2a8e add document
chunhan
parents:
diff changeset
  3314
% do a spacer row if needed
301f567e2a8e add document
chunhan
parents:
diff changeset
  3315
\if@IEEEprevauthorblockincol\expandafter\@IEEEauthorblockNtopspaceline\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3316
\global\@IEEEprevauthorblockincoltrue% we now have a block in this column
301f567e2a8e add document
chunhan
parents:
diff changeset
  3317
%restore the correct strut value
301f567e2a8e add document
chunhan
parents:
diff changeset
  3318
\gdef\@IEEEauthorblockXinterlinespace{\@IEEEauthorblockNinterlinespace}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3319
% input the author names
301f567e2a8e add document
chunhan
parents:
diff changeset
  3320
#1%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3321
% end the row if the user did not already
301f567e2a8e add document
chunhan
parents:
diff changeset
  3322
\crcr}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3323
% spacer row for names
301f567e2a8e add document
chunhan
parents:
diff changeset
  3324
\def\@IEEEauthorblockNtopspaceline{\cr\noalign{\vskip\@IEEEauthorblockNtopspace}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3325
%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3326
% affiliation block
301f567e2a8e add document
chunhan
parents:
diff changeset
  3327
\def\IEEEauthorblockA#1{\relax\@IEEEauthorblockAstyle% set the default text style
301f567e2a8e add document
chunhan
parents:
diff changeset
  3328
\gdef\@IEEEauthorblockXinterlinespace{0pt}%disable strut for spacer row
301f567e2a8e add document
chunhan
parents:
diff changeset
  3329
% the \expandafter hides the \cr in conditional tex, see the array.sty docs
301f567e2a8e add document
chunhan
parents:
diff changeset
  3330
% for details, probably not needed here as the \cr is in a macro
301f567e2a8e add document
chunhan
parents:
diff changeset
  3331
% do a spacer row if needed
301f567e2a8e add document
chunhan
parents:
diff changeset
  3332
\if@IEEEprevauthorblockincol\expandafter\@IEEEauthorblockAtopspaceline\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3333
\global\@IEEEprevauthorblockincoltrue% we now have a block in this column
301f567e2a8e add document
chunhan
parents:
diff changeset
  3334
%restore the correct strut value
301f567e2a8e add document
chunhan
parents:
diff changeset
  3335
\gdef\@IEEEauthorblockXinterlinespace{\@IEEEauthorblockAinterlinespace}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3336
% input the author affiliations
301f567e2a8e add document
chunhan
parents:
diff changeset
  3337
#1%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3338
% end the row if the user did not already
301f567e2a8e add document
chunhan
parents:
diff changeset
  3339
\crcr}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3340
% spacer row for affiliations
301f567e2a8e add document
chunhan
parents:
diff changeset
  3341
\def\@IEEEauthorblockAtopspaceline{\cr\noalign{\vskip\@IEEEauthorblockAtopspace}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3342
301f567e2a8e add document
chunhan
parents:
diff changeset
  3343
301f567e2a8e add document
chunhan
parents:
diff changeset
  3344
% allow papers to compile even if author blocks are used in modes other
301f567e2a8e add document
chunhan
parents:
diff changeset
  3345
% than conference or peerreviewca. For such cases, we provide dummy blocks.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3346
\ifCLASSOPTIONconference
301f567e2a8e add document
chunhan
parents:
diff changeset
  3347
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3348
   \ifCLASSOPTIONpeerreviewca\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3349
      % not conference or peerreviewca mode
301f567e2a8e add document
chunhan
parents:
diff changeset
  3350
      \def\IEEEauthorblockN#1{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3351
      \def\IEEEauthorblockA#1{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3352
   \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3353
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3354
301f567e2a8e add document
chunhan
parents:
diff changeset
  3355
301f567e2a8e add document
chunhan
parents:
diff changeset
  3356
301f567e2a8e add document
chunhan
parents:
diff changeset
  3357
% we provide our own halign so as not to have to depend on tabular
301f567e2a8e add document
chunhan
parents:
diff changeset
  3358
\def\@IEEEauthorhalign{\@IEEEauthordefaulttextstyle% default text style
301f567e2a8e add document
chunhan
parents:
diff changeset
  3359
   \lineskip=0pt\relax% disable line spacing
301f567e2a8e add document
chunhan
parents:
diff changeset
  3360
   \lineskiplimit=0pt\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3361
   \baselineskip=0pt\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3362
   \@IEEEcurfontSAVE% save the current font
301f567e2a8e add document
chunhan
parents:
diff changeset
  3363
   \mathsurround\z@\relax% no extra spacing around math
301f567e2a8e add document
chunhan
parents:
diff changeset
  3364
   \let\\\@IEEEauthorhaligncr% replace newline with halign friendly one
301f567e2a8e add document
chunhan
parents:
diff changeset
  3365
   \tabskip=0pt\relax% no column spacing
301f567e2a8e add document
chunhan
parents:
diff changeset
  3366
   \everycr{}% ensure no problems here
301f567e2a8e add document
chunhan
parents:
diff changeset
  3367
   \@IEEEprevauthorblockincolfalse% no author blocks yet
301f567e2a8e add document
chunhan
parents:
diff changeset
  3368
   \def\@IEEEauthorblockXinterlinespace{2.7ex}% default interline space
301f567e2a8e add document
chunhan
parents:
diff changeset
  3369
   \vtop\bgroup%vtop box
301f567e2a8e add document
chunhan
parents:
diff changeset
  3370
   \halign\bgroup&\relax\hfil\@IEEEcurfontRESTORE\relax ##\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3371
   \hfil\@IEEEcurfontSAVE\@IEEEauthorstrutrule\cr}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3372
301f567e2a8e add document
chunhan
parents:
diff changeset
  3373
% ensure last line, exit from halign, close vbox
301f567e2a8e add document
chunhan
parents:
diff changeset
  3374
\def\end@IEEEauthorhalign{\crcr\egroup\egroup}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3375
301f567e2a8e add document
chunhan
parents:
diff changeset
  3376
% handle bogus star form
301f567e2a8e add document
chunhan
parents:
diff changeset
  3377
\def\@IEEEauthorhaligncr{{\ifnum0=`}\fi\@ifstar{\@@IEEEauthorhaligncr}{\@@IEEEauthorhaligncr}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3378
301f567e2a8e add document
chunhan
parents:
diff changeset
  3379
% test and setup the optional argument to \\[]
301f567e2a8e add document
chunhan
parents:
diff changeset
  3380
\def\@@IEEEauthorhaligncr{\@testopt\@@@IEEEauthorhaligncr\z@skip}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3381
301f567e2a8e add document
chunhan
parents:
diff changeset
  3382
% end the line and do the optional spacer
301f567e2a8e add document
chunhan
parents:
diff changeset
  3383
\def\@@@IEEEauthorhaligncr[#1]{\ifnum0=`{\fi}\cr\noalign{\vskip#1\relax}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3384
301f567e2a8e add document
chunhan
parents:
diff changeset
  3385
301f567e2a8e add document
chunhan
parents:
diff changeset
  3386
301f567e2a8e add document
chunhan
parents:
diff changeset
  3387
% flag to prevent multiple \and warning messages
301f567e2a8e add document
chunhan
parents:
diff changeset
  3388
\newif\if@IEEEWARNand
301f567e2a8e add document
chunhan
parents:
diff changeset
  3389
\@IEEEWARNandtrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  3390
301f567e2a8e add document
chunhan
parents:
diff changeset
  3391
% if in conference or peerreviewca modes, we support the use of \and as \author is a
301f567e2a8e add document
chunhan
parents:
diff changeset
  3392
% tabular environment, otherwise we warn the user that \and is invalid
301f567e2a8e add document
chunhan
parents:
diff changeset
  3393
% outside of conference or peerreviewca modes.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3394
\def\and{\relax} % provide a bogus \and that we will then override
301f567e2a8e add document
chunhan
parents:
diff changeset
  3395
301f567e2a8e add document
chunhan
parents:
diff changeset
  3396
\renewcommand{\and}[1][\relax]{\if@IEEEWARNand\typeout{** WARNING: \noexpand\and is valid only
301f567e2a8e add document
chunhan
parents:
diff changeset
  3397
                               when in conference or peerreviewca}\typeout{modes (line \the\inputlineno).}\fi\global\@IEEEWARNandfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3398
301f567e2a8e add document
chunhan
parents:
diff changeset
  3399
\ifCLASSOPTIONconference%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3400
\renewcommand{\and}[1][\hfill]{\end{@IEEEauthorhalign}#1\begin{@IEEEauthorhalign}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3401
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3402
\ifCLASSOPTIONpeerreviewca
301f567e2a8e add document
chunhan
parents:
diff changeset
  3403
\renewcommand{\and}[1][\hfill]{\end{@IEEEauthorhalign}#1\begin{@IEEEauthorhalign}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3404
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3405
301f567e2a8e add document
chunhan
parents:
diff changeset
  3406
301f567e2a8e add document
chunhan
parents:
diff changeset
  3407
% page clearing command
301f567e2a8e add document
chunhan
parents:
diff changeset
  3408
% based on LaTeX2e's \cleardoublepage, but allows different page styles
301f567e2a8e add document
chunhan
parents:
diff changeset
  3409
% for the inserted blank pages
301f567e2a8e add document
chunhan
parents:
diff changeset
  3410
\def\@IEEEcleardoublepage#1{\clearpage\if@twoside\ifodd\c@page\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3411
\hbox{}\thispagestyle{#1}\newpage\if@twocolumn\hbox{}\thispagestyle{#1}\newpage\fi\fi\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3412
301f567e2a8e add document
chunhan
parents:
diff changeset
  3413
301f567e2a8e add document
chunhan
parents:
diff changeset
  3414
% user command to invoke the title page
301f567e2a8e add document
chunhan
parents:
diff changeset
  3415
\def\maketitle{\par%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3416
  \begingroup%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3417
  \normalfont%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3418
  \def\thefootnote{}%  the \thanks{} mark type is empty
301f567e2a8e add document
chunhan
parents:
diff changeset
  3419
  \def\footnotemark{}% and kill space from \thanks within author
301f567e2a8e add document
chunhan
parents:
diff changeset
  3420
  \let\@makefnmark\relax% V1.7, must *really* kill footnotemark to remove all \textsuperscript spacing as well.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3421
  \footnotesize%       equal spacing between thanks lines
301f567e2a8e add document
chunhan
parents:
diff changeset
  3422
  \footnotesep 0.7\baselineskip%see global setting of \footnotesep for more info
301f567e2a8e add document
chunhan
parents:
diff changeset
  3423
  % V1.7 disable \thanks note indention for compsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  3424
  \@IEEEcompsoconly{\long\def\@makefntext##1{\parindent 1em\noindent\hbox{\@makefnmark}##1}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3425
  \normalsize%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3426
  \ifCLASSOPTIONpeerreview
301f567e2a8e add document
chunhan
parents:
diff changeset
  3427
     \newpage\global\@topnum\z@ \@maketitle\@IEEEstatictitlevskip\@IEEEaftertitletext%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3428
     \thispagestyle{IEEEpeerreviewcoverpagestyle}\@thanks%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3429
  \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3430
     \if@twocolumn%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3431
        \ifCLASSOPTIONtechnote%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3432
           \newpage\global\@topnum\z@ \@maketitle\@IEEEstatictitlevskip\@IEEEaftertitletext%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3433
        \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3434
           \twocolumn[\@maketitle\@IEEEdynamictitlevspace\@IEEEaftertitletext]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3435
        \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3436
     \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3437
        \newpage\global\@topnum\z@ \@maketitle\@IEEEstatictitlevskip\@IEEEaftertitletext%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3438
     \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3439
     \thispagestyle{IEEEtitlepagestyle}\@thanks%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3440
  \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3441
  % pullup page for pubid if used.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3442
  \if@IEEEusingpubid
301f567e2a8e add document
chunhan
parents:
diff changeset
  3443
     \enlargethispage{-\@IEEEpubidpullup}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3444
  \fi 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3445
  \endgroup
301f567e2a8e add document
chunhan
parents:
diff changeset
  3446
  \setcounter{footnote}{0}\let\maketitle\relax\let\@maketitle\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3447
  \gdef\@thanks{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3448
  % v1.6b do not clear these as we will need the title again for peer review papers
301f567e2a8e add document
chunhan
parents:
diff changeset
  3449
  % \gdef\@author{}\gdef\@title{}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3450
  \let\thanks\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3451
301f567e2a8e add document
chunhan
parents:
diff changeset
  3452
301f567e2a8e add document
chunhan
parents:
diff changeset
  3453
301f567e2a8e add document
chunhan
parents:
diff changeset
  3454
% V1.7 parbox to format \@IEEEcompsoctitleabstractindextext
301f567e2a8e add document
chunhan
parents:
diff changeset
  3455
\long\def\@IEEEcompsoctitleabstractindextextbox#1{\parbox{0.915\textwidth}{#1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3456
301f567e2a8e add document
chunhan
parents:
diff changeset
  3457
301f567e2a8e add document
chunhan
parents:
diff changeset
  3458
% formats the Title, authors names, affiliations and special paper notice
301f567e2a8e add document
chunhan
parents:
diff changeset
  3459
% THIS IS A CONTROLLED SPACING COMMAND! Do not allow blank lines or unintentional
301f567e2a8e add document
chunhan
parents:
diff changeset
  3460
% spaces to enter the definition - use % at the end of each line
301f567e2a8e add document
chunhan
parents:
diff changeset
  3461
\def\@maketitle{\newpage
301f567e2a8e add document
chunhan
parents:
diff changeset
  3462
\begin{center}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3463
\ifCLASSOPTIONtechnote% technotes
301f567e2a8e add document
chunhan
parents:
diff changeset
  3464
   {\bfseries\large\@IEEEcompsoconly{\sffamily}\@title\par}\vskip 1.3em{\lineskip .5em\@IEEEcompsoconly{\sffamily}\@author
301f567e2a8e add document
chunhan
parents:
diff changeset
  3465
   \@IEEEspecialpapernotice\par{\@IEEEcompsoconly{\vskip 1.5em\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3466
   \@IEEEcompsoctitleabstractindextextbox{\@IEEEcompsoctitleabstractindextext}\par
301f567e2a8e add document
chunhan
parents:
diff changeset
  3467
   \hfill\@IEEEcompsocdiamondline\hfill\hbox{}\par}}}\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3468
\else% not a technote
301f567e2a8e add document
chunhan
parents:
diff changeset
  3469
   \vskip0.2em{\Huge\@IEEEcompsoconly{\sffamily}\@IEEEcompsocconfonly{\normalfont\normalsize\vskip 0\@IEEEnormalsizeunitybaselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  3470
   \bfseries\Large}\@title\par}\vskip 1.0em\par%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3471
   % V1.6 handle \author differently if in conference mode
301f567e2a8e add document
chunhan
parents:
diff changeset
  3472
   \ifCLASSOPTIONconference%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3473
      {\@IEEEspecialpapernotice\mbox{}\vskip\@IEEEauthorblockconfadjspace%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3474
       \mbox{}\hfill\begin{@IEEEauthorhalign}\@author\end{@IEEEauthorhalign}\hfill\mbox{}\par}\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3475
   \else% peerreviewca, peerreview or journal
301f567e2a8e add document
chunhan
parents:
diff changeset
  3476
      \ifCLASSOPTIONpeerreviewca
301f567e2a8e add document
chunhan
parents:
diff changeset
  3477
         % peerreviewca handles author names just like conference mode
301f567e2a8e add document
chunhan
parents:
diff changeset
  3478
         {\@IEEEcompsoconly{\sffamily}\@IEEEspecialpapernotice\mbox{}\vskip\@IEEEauthorblockconfadjspace%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3479
          \mbox{}\hfill\begin{@IEEEauthorhalign}\@author\end{@IEEEauthorhalign}\hfill\mbox{}\par
301f567e2a8e add document
chunhan
parents:
diff changeset
  3480
          {\@IEEEcompsoconly{\vskip 1.5em\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3481
           \@IEEEcompsoctitleabstractindextextbox{\@IEEEcompsoctitleabstractindextext}\par\hfill
301f567e2a8e add document
chunhan
parents:
diff changeset
  3482
           \@IEEEcompsocdiamondline\hfill\hbox{}\par}}}\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3483
      \else% journal or peerreview
301f567e2a8e add document
chunhan
parents:
diff changeset
  3484
         {\lineskip.5em\@IEEEcompsoconly{\sffamily}\sublargesize\@author\@IEEEspecialpapernotice\par
301f567e2a8e add document
chunhan
parents:
diff changeset
  3485
          {\@IEEEcompsoconly{\vskip 1.5em\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3486
           \@IEEEcompsoctitleabstractindextextbox{\@IEEEcompsoctitleabstractindextext}\par\hfill
301f567e2a8e add document
chunhan
parents:
diff changeset
  3487
           \@IEEEcompsocdiamondline\hfill\hbox{}\par}}}\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3488
      \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3489
   \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3490
\fi\end{center}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3491
301f567e2a8e add document
chunhan
parents:
diff changeset
  3492
301f567e2a8e add document
chunhan
parents:
diff changeset
  3493
301f567e2a8e add document
chunhan
parents:
diff changeset
  3494
% V1.7 Computer Society "diamond line" which follows index terms for nonconference papers
301f567e2a8e add document
chunhan
parents:
diff changeset
  3495
\def\@IEEEcompsocdiamondline{\vrule depth 0pt height 0.5pt width 4cm\hspace{7.5pt}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3496
\raisebox{-3.5pt}{\fontfamily{pzd}\fontencoding{U}\fontseries{m}\fontshape{n}\fontsize{11}{12}\selectfont\char70}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3497
\hspace{7.5pt}\vrule depth 0pt height 0.5pt width 4cm\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3498
301f567e2a8e add document
chunhan
parents:
diff changeset
  3499
% V1.7 standard LateX2e \thanks, but with \itshape under compsoc. Also make it a \long\def
301f567e2a8e add document
chunhan
parents:
diff changeset
  3500
% We also need to trigger the one-shot footnote rule
301f567e2a8e add document
chunhan
parents:
diff changeset
  3501
\def\@IEEEtriggeroneshotfootnoterule{\global\@IEEEenableoneshotfootnoteruletrue}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3502
301f567e2a8e add document
chunhan
parents:
diff changeset
  3503
301f567e2a8e add document
chunhan
parents:
diff changeset
  3504
\long\def\thanks#1{\footnotemark
301f567e2a8e add document
chunhan
parents:
diff changeset
  3505
    \protected@xdef\@thanks{\@thanks
301f567e2a8e add document
chunhan
parents:
diff changeset
  3506
        \protect\footnotetext[\the\c@footnote]{\@IEEEcompsoconly{\itshape
301f567e2a8e add document
chunhan
parents:
diff changeset
  3507
        \protect\@IEEEtriggeroneshotfootnoterule\relax}\ignorespaces#1}}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3508
\let\@thanks\@empty
301f567e2a8e add document
chunhan
parents:
diff changeset
  3509
301f567e2a8e add document
chunhan
parents:
diff changeset
  3510
% V1.7 allow \author to contain \par's. This is needed to allow \thanks to contain \par.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3511
\long\def\author#1{\gdef\@author{#1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3512
301f567e2a8e add document
chunhan
parents:
diff changeset
  3513
301f567e2a8e add document
chunhan
parents:
diff changeset
  3514
% in addition to setting up IEEEitemize, we need to remove a baselineskip space above and
301f567e2a8e add document
chunhan
parents:
diff changeset
  3515
% below it because \list's \pars introduce blank lines because of the footnote struts.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3516
\def\@IEEEsetupcompsocitemizelist{\def\labelitemi{$\bullet$}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3517
\setlength{\IEEElabelindent}{0pt}\setlength{\parskip}{0pt}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3518
\setlength{\partopsep}{0pt}\setlength{\topsep}{0.5\baselineskip}\vspace{-1\baselineskip}\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3519
301f567e2a8e add document
chunhan
parents:
diff changeset
  3520
301f567e2a8e add document
chunhan
parents:
diff changeset
  3521
% flag for fake non-compsoc \IEEEcompsocthanksitem - prevents line break on very first item
301f567e2a8e add document
chunhan
parents:
diff changeset
  3522
\newif\if@IEEEbreakcompsocthanksitem \@IEEEbreakcompsocthanksitemfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  3523
301f567e2a8e add document
chunhan
parents:
diff changeset
  3524
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  3525
% V1.7 compsoc bullet item \thanks
301f567e2a8e add document
chunhan
parents:
diff changeset
  3526
% also, we need to redefine this to destroy the argument in \@IEEEdynamictitlevspace
301f567e2a8e add document
chunhan
parents:
diff changeset
  3527
\long\def\IEEEcompsocitemizethanks#1{\relax\@IEEEbreakcompsocthanksitemfalse\footnotemark
301f567e2a8e add document
chunhan
parents:
diff changeset
  3528
    \protected@xdef\@thanks{\@thanks
301f567e2a8e add document
chunhan
parents:
diff changeset
  3529
        \protect\footnotetext[\the\c@footnote]{\itshape\protect\@IEEEtriggeroneshotfootnoterule
301f567e2a8e add document
chunhan
parents:
diff changeset
  3530
        {\let\IEEEiedlistdecl\relax\protect\begin{IEEEitemize}[\protect\@IEEEsetupcompsocitemizelist]\ignorespaces#1\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3531
        \protect\end{IEEEitemize}}\protect\vspace{-1\baselineskip}}}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3532
\DeclareRobustCommand*{\IEEEcompsocthanksitem}{\item}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3533
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3534
% non-compsoc, allow for dual compilation via rerouting to normal \thanks
301f567e2a8e add document
chunhan
parents:
diff changeset
  3535
\long\def\IEEEcompsocitemizethanks#1{\thanks{#1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3536
% redirect to "pseudo-par" \hfil\break\indent after swallowing [] from \IEEEcompsocthanksitem[]
301f567e2a8e add document
chunhan
parents:
diff changeset
  3537
\DeclareRobustCommand{\IEEEcompsocthanksitem}{\@ifnextchar [{\@IEEEthanksswallowoptionalarg}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3538
{\@IEEEthanksswallowoptionalarg[\relax]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3539
% be sure and break only after first item, be sure and ignore spaces after optional argument
301f567e2a8e add document
chunhan
parents:
diff changeset
  3540
\def\@IEEEthanksswallowoptionalarg[#1]{\relax\if@IEEEbreakcompsocthanksitem\hfil\break
301f567e2a8e add document
chunhan
parents:
diff changeset
  3541
\indent\fi\@IEEEbreakcompsocthanksitemtrue\ignorespaces}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3542
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3543
301f567e2a8e add document
chunhan
parents:
diff changeset
  3544
301f567e2a8e add document
chunhan
parents:
diff changeset
  3545
% V1.6b define the \IEEEpeerreviewmaketitle as needed
301f567e2a8e add document
chunhan
parents:
diff changeset
  3546
\ifCLASSOPTIONpeerreview
301f567e2a8e add document
chunhan
parents:
diff changeset
  3547
\def\IEEEpeerreviewmaketitle{\@IEEEcleardoublepage{empty}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3548
\ifCLASSOPTIONtwocolumn
301f567e2a8e add document
chunhan
parents:
diff changeset
  3549
\twocolumn[\@IEEEpeerreviewmaketitle\@IEEEdynamictitlevspace]
301f567e2a8e add document
chunhan
parents:
diff changeset
  3550
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3551
\newpage\@IEEEpeerreviewmaketitle\@IEEEstatictitlevskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  3552
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3553
\thispagestyle{IEEEtitlepagestyle}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3554
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3555
% \IEEEpeerreviewmaketitle does nothing if peer review option has not been selected
301f567e2a8e add document
chunhan
parents:
diff changeset
  3556
\def\IEEEpeerreviewmaketitle{\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3557
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3558
301f567e2a8e add document
chunhan
parents:
diff changeset
  3559
% peerreview formats the repeated title like the title in journal papers.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3560
\def\@IEEEpeerreviewmaketitle{\begin{center}\@IEEEcompsoconly{\sffamily}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3561
\normalfont\normalsize\vskip0.2em{\Huge\@title\par}\vskip1.0em\par
301f567e2a8e add document
chunhan
parents:
diff changeset
  3562
\end{center}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3563
301f567e2a8e add document
chunhan
parents:
diff changeset
  3564
301f567e2a8e add document
chunhan
parents:
diff changeset
  3565
301f567e2a8e add document
chunhan
parents:
diff changeset
  3566
% V1.6 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3567
% this is a static rubber spacer between the title/authors and the main text
301f567e2a8e add document
chunhan
parents:
diff changeset
  3568
% used for single column text, or when the title appears in the first column
301f567e2a8e add document
chunhan
parents:
diff changeset
  3569
% of two column text (technotes). 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3570
\def\@IEEEstatictitlevskip{{\normalfont\normalsize
301f567e2a8e add document
chunhan
parents:
diff changeset
  3571
% adjust spacing to next text
301f567e2a8e add document
chunhan
parents:
diff changeset
  3572
% v1.6b handle peer review papers
301f567e2a8e add document
chunhan
parents:
diff changeset
  3573
\ifCLASSOPTIONpeerreview
301f567e2a8e add document
chunhan
parents:
diff changeset
  3574
% for peer review papers, the same value is used for both title pages
301f567e2a8e add document
chunhan
parents:
diff changeset
  3575
% regardless of the other paper modes
301f567e2a8e add document
chunhan
parents:
diff changeset
  3576
   \vskip 1\baselineskip plus 0.375\baselineskip minus 0.1875\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  3577
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3578
   \ifCLASSOPTIONconference% conference
301f567e2a8e add document
chunhan
parents:
diff changeset
  3579
      \vskip 1\baselineskip plus 0.375\baselineskip minus 0.1875\baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3580
   \else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3581
      \ifCLASSOPTIONtechnote% technote
301f567e2a8e add document
chunhan
parents:
diff changeset
  3582
         \vskip 1\baselineskip plus 0.375\baselineskip minus 0.1875\baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3583
      \else% journal uses more space
301f567e2a8e add document
chunhan
parents:
diff changeset
  3584
         \vskip 2.5\baselineskip plus 0.75\baselineskip minus 0.375\baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3585
      \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3586
   \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3587
\fi}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3588
301f567e2a8e add document
chunhan
parents:
diff changeset
  3589
301f567e2a8e add document
chunhan
parents:
diff changeset
  3590
% V1.6
301f567e2a8e add document
chunhan
parents:
diff changeset
  3591
% This is a dynamically determined rigid spacer between the title/authors 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3592
% and the main text. This is used only for single column titles over two 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3593
% column text (most common)
301f567e2a8e add document
chunhan
parents:
diff changeset
  3594
% This is bit tricky because we have to ensure that the textheight of the
301f567e2a8e add document
chunhan
parents:
diff changeset
  3595
% main text is an integer multiple of \baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  3596
% otherwise underfull vbox problems may develop in the second column of the
301f567e2a8e add document
chunhan
parents:
diff changeset
  3597
% text on the titlepage
301f567e2a8e add document
chunhan
parents:
diff changeset
  3598
% The possible use of \IEEEpubid must also be taken into account.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3599
\def\@IEEEdynamictitlevspace{{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3600
    % we run within a group so that all the macros can be forgotten when we are done
301f567e2a8e add document
chunhan
parents:
diff changeset
  3601
    \long\def\thanks##1{\relax}%don't allow \thanks to run when we evaluate the vbox height
301f567e2a8e add document
chunhan
parents:
diff changeset
  3602
    \long\def\IEEEcompsocitemizethanks##1{\relax}%don't allow \IEEEcompsocitemizethanks to run when we evaluate the vbox height
301f567e2a8e add document
chunhan
parents:
diff changeset
  3603
    \normalfont\normalsize% we declare more descriptive variable names
301f567e2a8e add document
chunhan
parents:
diff changeset
  3604
    \let\@IEEEmaintextheight=\@IEEEtrantmpdimenA%height of the main text columns
301f567e2a8e add document
chunhan
parents:
diff changeset
  3605
    \let\@IEEEINTmaintextheight=\@IEEEtrantmpdimenB%height of the main text columns with integer # lines
301f567e2a8e add document
chunhan
parents:
diff changeset
  3606
    % set the nominal and minimum values for the title spacer
301f567e2a8e add document
chunhan
parents:
diff changeset
  3607
    % the dynamic algorithm will not allow the spacer size to
301f567e2a8e add document
chunhan
parents:
diff changeset
  3608
    % become less than \@IEEEMINtitlevspace - instead it will be
301f567e2a8e add document
chunhan
parents:
diff changeset
  3609
    % lengthened
301f567e2a8e add document
chunhan
parents:
diff changeset
  3610
    % default to journal values
301f567e2a8e add document
chunhan
parents:
diff changeset
  3611
    \def\@IEEENORMtitlevspace{2.5\baselineskip}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3612
    \def\@IEEEMINtitlevspace{2\baselineskip}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3613
    % conferences and technotes need tighter spacing
301f567e2a8e add document
chunhan
parents:
diff changeset
  3614
    \ifCLASSOPTIONconference%conference
301f567e2a8e add document
chunhan
parents:
diff changeset
  3615
     \def\@IEEENORMtitlevspace{1\baselineskip}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3616
     \def\@IEEEMINtitlevspace{0.75\baselineskip}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3617
    \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3618
    \ifCLASSOPTIONtechnote%technote
301f567e2a8e add document
chunhan
parents:
diff changeset
  3619
      \def\@IEEENORMtitlevspace{1\baselineskip}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3620
      \def\@IEEEMINtitlevspace{0.75\baselineskip}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3621
    \fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3622
    % get the height that the title will take up
301f567e2a8e add document
chunhan
parents:
diff changeset
  3623
    \ifCLASSOPTIONpeerreview
301f567e2a8e add document
chunhan
parents:
diff changeset
  3624
       \settoheight{\@IEEEmaintextheight}{\vbox{\hsize\textwidth \@IEEEpeerreviewmaketitle}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3625
    \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3626
       \settoheight{\@IEEEmaintextheight}{\vbox{\hsize\textwidth \@maketitle}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3627
    \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3628
    \@IEEEmaintextheight=-\@IEEEmaintextheight% title takes away from maintext, so reverse sign
301f567e2a8e add document
chunhan
parents:
diff changeset
  3629
    % add the height of the page textheight
301f567e2a8e add document
chunhan
parents:
diff changeset
  3630
    \advance\@IEEEmaintextheight by \textheight%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3631
    % correct for title pages using pubid
301f567e2a8e add document
chunhan
parents:
diff changeset
  3632
    \ifCLASSOPTIONpeerreview\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3633
       % peerreview papers use the pubid on the cover page only.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3634
       % And the cover page uses a static spacer.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3635
       \if@IEEEusingpubid\advance\@IEEEmaintextheight by -\@IEEEpubidpullup\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3636
    \fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3637
    % subtract off the nominal value of the title bottom spacer
301f567e2a8e add document
chunhan
parents:
diff changeset
  3638
    \advance\@IEEEmaintextheight by -\@IEEENORMtitlevspace%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3639
    % \topskip takes away some too
301f567e2a8e add document
chunhan
parents:
diff changeset
  3640
    \advance\@IEEEmaintextheight by -\topskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3641
    % calculate the column height of the main text for lines
301f567e2a8e add document
chunhan
parents:
diff changeset
  3642
    % now we calculate the main text height as if holding
301f567e2a8e add document
chunhan
parents:
diff changeset
  3643
    % an integer number of \normalsize lines after the first
301f567e2a8e add document
chunhan
parents:
diff changeset
  3644
    % and discard any excess fractional remainder
301f567e2a8e add document
chunhan
parents:
diff changeset
  3645
    % we subtracted the first line, because the first line
301f567e2a8e add document
chunhan
parents:
diff changeset
  3646
    % is placed \topskip into the maintext, not \baselineskip like the
301f567e2a8e add document
chunhan
parents:
diff changeset
  3647
    % rest of the lines.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3648
    \@IEEEINTmaintextheight=\@IEEEmaintextheight%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3649
    \divide\@IEEEINTmaintextheight  by \baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3650
    \multiply\@IEEEINTmaintextheight  by \baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3651
    % now we calculate how much the title spacer height will
301f567e2a8e add document
chunhan
parents:
diff changeset
  3652
    % have to be reduced from nominal (\@IEEEREDUCEmaintextheight is always
301f567e2a8e add document
chunhan
parents:
diff changeset
  3653
    % a positive value) so that the maintext area will contain an integer
301f567e2a8e add document
chunhan
parents:
diff changeset
  3654
    % number of normal size lines
301f567e2a8e add document
chunhan
parents:
diff changeset
  3655
    % we change variable names here (to avoid confusion) as we no longer
301f567e2a8e add document
chunhan
parents:
diff changeset
  3656
    % need \@IEEEINTmaintextheight and can reuse its dimen register
301f567e2a8e add document
chunhan
parents:
diff changeset
  3657
    \let\@IEEEREDUCEmaintextheight=\@IEEEINTmaintextheight%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3658
    \advance\@IEEEREDUCEmaintextheight by -\@IEEEmaintextheight%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3659
    \advance\@IEEEREDUCEmaintextheight by \baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3660
    % this is the calculated height of the spacer
301f567e2a8e add document
chunhan
parents:
diff changeset
  3661
    % we change variable names here (to avoid confusion) as we no longer
301f567e2a8e add document
chunhan
parents:
diff changeset
  3662
    % need \@IEEEmaintextheight and can reuse its dimen register
301f567e2a8e add document
chunhan
parents:
diff changeset
  3663
    \let\@IEEECOMPENSATElen=\@IEEEmaintextheight%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3664
    \@IEEECOMPENSATElen=\@IEEENORMtitlevspace% set the nominal value
301f567e2a8e add document
chunhan
parents:
diff changeset
  3665
    % we go with the reduced length if it is smaller than an increase
301f567e2a8e add document
chunhan
parents:
diff changeset
  3666
    \ifdim\@IEEEREDUCEmaintextheight < 0.5\baselineskip\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3667
     \advance\@IEEECOMPENSATElen by -\@IEEEREDUCEmaintextheight%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3668
     % if the resulting spacer is too small back out and go with an increase instead
301f567e2a8e add document
chunhan
parents:
diff changeset
  3669
     \ifdim\@IEEECOMPENSATElen<\@IEEEMINtitlevspace\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3670
      \advance\@IEEECOMPENSATElen by \baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3671
     \fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3672
    \else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3673
     % go with an increase because it is closer to the nominal than a decrease
301f567e2a8e add document
chunhan
parents:
diff changeset
  3674
     \advance\@IEEECOMPENSATElen by -\@IEEEREDUCEmaintextheight%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3675
     \advance\@IEEECOMPENSATElen by \baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3676
    \fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3677
    % set the calculated rigid spacer
301f567e2a8e add document
chunhan
parents:
diff changeset
  3678
    \vspace{\@IEEECOMPENSATElen}}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3679
301f567e2a8e add document
chunhan
parents:
diff changeset
  3680
301f567e2a8e add document
chunhan
parents:
diff changeset
  3681
301f567e2a8e add document
chunhan
parents:
diff changeset
  3682
% V1.6
301f567e2a8e add document
chunhan
parents:
diff changeset
  3683
% we allow the user access to the last part of the title area
301f567e2a8e add document
chunhan
parents:
diff changeset
  3684
% useful in emergencies such as when a different spacing is needed
301f567e2a8e add document
chunhan
parents:
diff changeset
  3685
% This text is NOT compensated for in the dynamic sizer.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3686
\let\@IEEEaftertitletext=\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3687
\long\def\IEEEaftertitletext#1{\def\@IEEEaftertitletext{#1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3688
301f567e2a8e add document
chunhan
parents:
diff changeset
  3689
% V1.7 provide a way for users to enter abstract and keywords
301f567e2a8e add document
chunhan
parents:
diff changeset
  3690
% into the onecolumn title are. This text is compensated for
301f567e2a8e add document
chunhan
parents:
diff changeset
  3691
% in the dynamic sizer.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3692
\let\@IEEEcompsoctitleabstractindextext=\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3693
\long\def\IEEEcompsoctitleabstractindextext#1{\def\@IEEEcompsoctitleabstractindextext{#1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3694
% V1.7 provide a way for users to get the \@IEEEcompsoctitleabstractindextext if
301f567e2a8e add document
chunhan
parents:
diff changeset
  3695
% not in compsoc journal mode - this way abstract and keywords can be placed
301f567e2a8e add document
chunhan
parents:
diff changeset
  3696
% in their conventional position if not in compsoc mode.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3697
\def\IEEEdisplaynotcompsoctitleabstractindextext{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3698
\ifCLASSOPTIONcompsoc% display if compsoc conf
301f567e2a8e add document
chunhan
parents:
diff changeset
  3699
\ifCLASSOPTIONconference\@IEEEcompsoctitleabstractindextext\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3700
\else% or if not compsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  3701
\@IEEEcompsoctitleabstractindextext\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3702
301f567e2a8e add document
chunhan
parents:
diff changeset
  3703
301f567e2a8e add document
chunhan
parents:
diff changeset
  3704
% command to allow alteration of baselinestretch, but only if the current
301f567e2a8e add document
chunhan
parents:
diff changeset
  3705
% baselineskip is unity. Used to tweak the compsoc abstract and keywords line spacing.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3706
\def\@IEEEtweakunitybaselinestretch#1{{\def\baselinestretch{1}\selectfont
301f567e2a8e add document
chunhan
parents:
diff changeset
  3707
\global\@tempskipa\baselineskip}\ifnum\@tempskipa=\baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3708
\def\baselinestretch{#1}\selectfont\fi\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3709
301f567e2a8e add document
chunhan
parents:
diff changeset
  3710
301f567e2a8e add document
chunhan
parents:
diff changeset
  3711
% abstract and keywords are in \small, except 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3712
% for 9pt docs in which they are in \footnotesize
301f567e2a8e add document
chunhan
parents:
diff changeset
  3713
% Because 9pt docs use an 8pt footnotesize, \small
301f567e2a8e add document
chunhan
parents:
diff changeset
  3714
% becomes a rather awkward 8.5pt
301f567e2a8e add document
chunhan
parents:
diff changeset
  3715
\def\@IEEEabskeysecsize{\small}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3716
\ifx\CLASSOPTIONpt\@IEEEptsizenine
301f567e2a8e add document
chunhan
parents:
diff changeset
  3717
 \def\@IEEEabskeysecsize{\footnotesize}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3718
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3719
301f567e2a8e add document
chunhan
parents:
diff changeset
  3720
% compsoc journals use \footnotesize, compsoc conferences use normalsize
301f567e2a8e add document
chunhan
parents:
diff changeset
  3721
\@IEEEcompsoconly{\def\@IEEEabskeysecsize{\footnotesize}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3722
%\@IEEEcompsocconfonly{\def\@IEEEabskeysecsize{\normalsize}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3723
301f567e2a8e add document
chunhan
parents:
diff changeset
  3724
301f567e2a8e add document
chunhan
parents:
diff changeset
  3725
301f567e2a8e add document
chunhan
parents:
diff changeset
  3726
301f567e2a8e add document
chunhan
parents:
diff changeset
  3727
% V1.6 have abstract and keywords strip leading spaces, pars and newlines
301f567e2a8e add document
chunhan
parents:
diff changeset
  3728
% so that spacing is more tightly controlled.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3729
\def\abstract{\normalfont
301f567e2a8e add document
chunhan
parents:
diff changeset
  3730
    \if@twocolumn
301f567e2a8e add document
chunhan
parents:
diff changeset
  3731
      \@IEEEabskeysecsize\bfseries\textit{\abstractname}---\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3732
    \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3733
      \begin{center}\vspace{-1.78ex}\@IEEEabskeysecsize\textbf{\abstractname}\end{center}\quotation\@IEEEabskeysecsize
301f567e2a8e add document
chunhan
parents:
diff changeset
  3734
    \fi\@IEEEgobbleleadPARNLSP}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3735
% V1.6 IEEE wants only 1 pica from end of abstract to introduction heading when in 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3736
% conference mode (the heading already has this much above it)
301f567e2a8e add document
chunhan
parents:
diff changeset
  3737
\def\endabstract{\relax\ifCLASSOPTIONconference\vspace{1.34ex}\else\vspace{1.34ex}\fi\par\if@twocolumn\else\endquotation\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3738
    \normalfont\normalsize}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3739
301f567e2a8e add document
chunhan
parents:
diff changeset
  3740
\def\IEEEkeywords{\normalfont
301f567e2a8e add document
chunhan
parents:
diff changeset
  3741
    \if@twocolumn
301f567e2a8e add document
chunhan
parents:
diff changeset
  3742
      \@IEEEabskeysecsize\bfseries\textit{\IEEEkeywordsname}-\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3743
    \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3744
      \begin{center}\@IEEEabskeysecsize\textbf{\IEEEkeywordsname}\end{center}\quotation\@IEEEabskeysecsize
301f567e2a8e add document
chunhan
parents:
diff changeset
  3745
    \fi\@IEEEgobbleleadPARNLSP}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3746
\def\endIEEEkeywords{\relax\ifCLASSOPTIONtechnote\vspace{1.34ex}\else\vspace{0.67ex}\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3747
    \par\if@twocolumn\else\endquotation\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3748
    \normalfont\normalsize}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3749
301f567e2a8e add document
chunhan
parents:
diff changeset
  3750
% V1.7 compsoc keywords index terms
301f567e2a8e add document
chunhan
parents:
diff changeset
  3751
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  3752
  \ifCLASSOPTIONconference% compsoc conference
301f567e2a8e add document
chunhan
parents:
diff changeset
  3753
\def\abstract{\normalfont
301f567e2a8e add document
chunhan
parents:
diff changeset
  3754
      \begin{center}\@IEEEabskeysecsize\textbf{\large\abstractname}\end{center}\vskip 0.5\baselineskip plus 0.1\baselineskip minus 0.1\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  3755
      \if@twocolumn\else\quotation\fi\itshape\@IEEEabskeysecsize%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3756
      \par\@IEEEgobbleleadPARNLSP}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3757
\def\IEEEkeywords{\normalfont\vskip 1.5\baselineskip plus 0.25\baselineskip minus 0.25\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  3758
      \begin{center}\@IEEEabskeysecsize\textbf{\large\IEEEkeywordsname}\end{center}\vskip 0.5\baselineskip plus 0.1\baselineskip minus 0.1\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  3759
      \if@twocolumn\else\quotation\fi\itshape\@IEEEabskeysecsize%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3760
      \par\@IEEEgobbleleadPARNLSP}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3761
  \else% compsoc not conference
301f567e2a8e add document
chunhan
parents:
diff changeset
  3762
\def\abstract{\normalfont\@IEEEtweakunitybaselinestretch{1.15}\sffamily
301f567e2a8e add document
chunhan
parents:
diff changeset
  3763
    \if@twocolumn
301f567e2a8e add document
chunhan
parents:
diff changeset
  3764
      \@IEEEabskeysecsize\noindent\textbf{\abstractname}---\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3765
    \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3766
      \begin{center}\vspace{-1.78ex}\@IEEEabskeysecsize\textbf{\abstractname}\end{center}\quotation\@IEEEabskeysecsize%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3767
    \fi\@IEEEgobbleleadPARNLSP}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3768
\def\IEEEkeywords{\normalfont\@IEEEtweakunitybaselinestretch{1.15}\sffamily
301f567e2a8e add document
chunhan
parents:
diff changeset
  3769
    \if@twocolumn
301f567e2a8e add document
chunhan
parents:
diff changeset
  3770
      \@IEEEabskeysecsize\vskip 0.5\baselineskip plus 0.25\baselineskip minus 0.25\baselineskip\noindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  3771
      \textbf{\IEEEkeywordsname}---\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3772
    \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3773
      \begin{center}\@IEEEabskeysecsize\textbf{\IEEEkeywordsname}\end{center}\quotation\@IEEEabskeysecsize%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3774
    \fi\@IEEEgobbleleadPARNLSP}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3775
  \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3776
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3777
301f567e2a8e add document
chunhan
parents:
diff changeset
  3778
301f567e2a8e add document
chunhan
parents:
diff changeset
  3779
301f567e2a8e add document
chunhan
parents:
diff changeset
  3780
% gobbles all leading \, \\ and \par, upon finding first token that
301f567e2a8e add document
chunhan
parents:
diff changeset
  3781
% is not a \ , \\ or a \par, it ceases and returns that token
301f567e2a8e add document
chunhan
parents:
diff changeset
  3782
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3783
% used to strip leading \, \\ and \par from the input
301f567e2a8e add document
chunhan
parents:
diff changeset
  3784
% so that such things in the beginning of an environment will not
301f567e2a8e add document
chunhan
parents:
diff changeset
  3785
% affect the formatting of the text
301f567e2a8e add document
chunhan
parents:
diff changeset
  3786
\long\def\@IEEEgobbleleadPARNLSP#1{\let\@IEEEswallowthistoken=0%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3787
\let\@IEEEgobbleleadPARNLSPtoken#1%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3788
\let\@IEEEgobbleleadPARtoken=\par%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3789
\let\@IEEEgobbleleadNLtoken=\\%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3790
\let\@IEEEgobbleleadSPtoken=\ %
301f567e2a8e add document
chunhan
parents:
diff changeset
  3791
\def\@IEEEgobbleleadSPMACRO{\ }%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3792
\ifx\@IEEEgobbleleadPARNLSPtoken\@IEEEgobbleleadPARtoken%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3793
\let\@IEEEswallowthistoken=1%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3794
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3795
\ifx\@IEEEgobbleleadPARNLSPtoken\@IEEEgobbleleadNLtoken%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3796
\let\@IEEEswallowthistoken=1%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3797
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3798
\ifx\@IEEEgobbleleadPARNLSPtoken\@IEEEgobbleleadSPtoken%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3799
\let\@IEEEswallowthistoken=1%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3800
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3801
% a control space will come in as a macro
301f567e2a8e add document
chunhan
parents:
diff changeset
  3802
% when it is the last one on a line
301f567e2a8e add document
chunhan
parents:
diff changeset
  3803
\ifx\@IEEEgobbleleadPARNLSPtoken\@IEEEgobbleleadSPMACRO%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3804
\let\@IEEEswallowthistoken=1%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3805
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3806
% if we have to swallow this token, do so and taste the next one
301f567e2a8e add document
chunhan
parents:
diff changeset
  3807
% else spit it out and stop gobbling
301f567e2a8e add document
chunhan
parents:
diff changeset
  3808
\ifx\@IEEEswallowthistoken 1\let\@IEEEnextgobbleleadPARNLSP=\@IEEEgobbleleadPARNLSP\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3809
\let\@IEEEnextgobbleleadPARNLSP=#1\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3810
\@IEEEnextgobbleleadPARNLSP}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3811
301f567e2a8e add document
chunhan
parents:
diff changeset
  3812
301f567e2a8e add document
chunhan
parents:
diff changeset
  3813
301f567e2a8e add document
chunhan
parents:
diff changeset
  3814
301f567e2a8e add document
chunhan
parents:
diff changeset
  3815
% TITLING OF SECTIONS
301f567e2a8e add document
chunhan
parents:
diff changeset
  3816
\def\@IEEEsectpunct{:\ \,}  % Punctuation after run-in section heading  (headings which are
301f567e2a8e add document
chunhan
parents:
diff changeset
  3817
                            % part of the paragraphs), need little bit more than a single space
301f567e2a8e add document
chunhan
parents:
diff changeset
  3818
                            % spacing from section number to title
301f567e2a8e add document
chunhan
parents:
diff changeset
  3819
% compsoc conferences use regular period/space punctuation
301f567e2a8e add document
chunhan
parents:
diff changeset
  3820
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  3821
\ifCLASSOPTIONconference
301f567e2a8e add document
chunhan
parents:
diff changeset
  3822
\def\@IEEEsectpunct{.\ }
301f567e2a8e add document
chunhan
parents:
diff changeset
  3823
\fi\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3824
301f567e2a8e add document
chunhan
parents:
diff changeset
  3825
301f567e2a8e add document
chunhan
parents:
diff changeset
  3826
\def\@seccntformat#1{\csname the#1dis\endcsname\hskip 0.5em\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3827
301f567e2a8e add document
chunhan
parents:
diff changeset
  3828
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  3829
% compsoc journals need extra spacing
301f567e2a8e add document
chunhan
parents:
diff changeset
  3830
\ifCLASSOPTIONconference\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3831
\def\@seccntformat#1{\csname the#1dis\endcsname\hskip 1em\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3832
\fi\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3833
301f567e2a8e add document
chunhan
parents:
diff changeset
  3834
%v1.7 put {} after #6 to allow for some types of user font control
301f567e2a8e add document
chunhan
parents:
diff changeset
  3835
%and use \@@par rather than \par
301f567e2a8e add document
chunhan
parents:
diff changeset
  3836
\def\@sect#1#2#3#4#5#6[#7]#8{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3837
  \ifnum #2>\c@secnumdepth
301f567e2a8e add document
chunhan
parents:
diff changeset
  3838
     \let\@svsec\@empty
301f567e2a8e add document
chunhan
parents:
diff changeset
  3839
  \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3840
     \refstepcounter{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3841
     % load section label and spacer into \@svsec
301f567e2a8e add document
chunhan
parents:
diff changeset
  3842
     \protected@edef\@svsec{\@seccntformat{#1}\relax}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3843
  \fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3844
  \@tempskipa #5\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3845
  \ifdim \@tempskipa>\z@% tempskipa determines whether is treated as a high
301f567e2a8e add document
chunhan
parents:
diff changeset
  3846
     \begingroup #6{\relax% or low level heading
301f567e2a8e add document
chunhan
parents:
diff changeset
  3847
      \noindent % subsections are NOT indented
301f567e2a8e add document
chunhan
parents:
diff changeset
  3848
       % print top level headings. \@svsec is label, #8 is heading title
301f567e2a8e add document
chunhan
parents:
diff changeset
  3849
       % IEEE does not block indent the section title text, it flows like normal
301f567e2a8e add document
chunhan
parents:
diff changeset
  3850
       {\hskip #3\relax\@svsec}{\interlinepenalty \@M #8\@@par}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3851
     \endgroup
301f567e2a8e add document
chunhan
parents:
diff changeset
  3852
     \addcontentsline{toc}{#1}{\ifnum #2>\c@secnumdepth\relax\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3853
               \protect\numberline{\csname the#1\endcsname}\fi#7}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3854
  \else % printout low level headings
301f567e2a8e add document
chunhan
parents:
diff changeset
  3855
     % svsechd seems to swallow the trailing space, protect it with \mbox{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3856
     % got rid of sectionmark stuff
301f567e2a8e add document
chunhan
parents:
diff changeset
  3857
     \def\@svsechd{#6{\hskip #3\relax\@svsec #8\@IEEEsectpunct\mbox{}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3858
     \addcontentsline{toc}{#1}{\ifnum #2>\c@secnumdepth\relax\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3859
               \protect\numberline{\csname the#1\endcsname}\fi#7}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3860
  \fi%skip down
301f567e2a8e add document
chunhan
parents:
diff changeset
  3861
  \@xsect{#5}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3862
301f567e2a8e add document
chunhan
parents:
diff changeset
  3863
301f567e2a8e add document
chunhan
parents:
diff changeset
  3864
% section* handler
301f567e2a8e add document
chunhan
parents:
diff changeset
  3865
%v1.7 put {} after #4 to allow for some types of user font control
301f567e2a8e add document
chunhan
parents:
diff changeset
  3866
%and use \@@par rather than \par
301f567e2a8e add document
chunhan
parents:
diff changeset
  3867
\def\@ssect#1#2#3#4#5{\@tempskipa #3\relax
301f567e2a8e add document
chunhan
parents:
diff changeset
  3868
  \ifdim \@tempskipa>\z@
301f567e2a8e add document
chunhan
parents:
diff changeset
  3869
     %\begingroup #4\@hangfrom{\hskip #1}{\interlinepenalty \@M #5\par}\endgroup
301f567e2a8e add document
chunhan
parents:
diff changeset
  3870
     % IEEE does not block indent the section title text, it flows like normal
301f567e2a8e add document
chunhan
parents:
diff changeset
  3871
     \begingroup \noindent #4{\relax{\hskip #1}{\interlinepenalty \@M #5\@@par}}\endgroup
301f567e2a8e add document
chunhan
parents:
diff changeset
  3872
  % svsechd swallows the trailing space, protect it with \mbox{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3873
  \else \def\@svsechd{#4{\hskip #1\relax #5\@IEEEsectpunct\mbox{}}}\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3874
  \@xsect{#3}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3875
301f567e2a8e add document
chunhan
parents:
diff changeset
  3876
301f567e2a8e add document
chunhan
parents:
diff changeset
  3877
%% SECTION heading spacing and font
301f567e2a8e add document
chunhan
parents:
diff changeset
  3878
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3879
% arguments are: #1 - sectiontype name
301f567e2a8e add document
chunhan
parents:
diff changeset
  3880
% (for \@sect)   #2 - section level
301f567e2a8e add document
chunhan
parents:
diff changeset
  3881
%                #3 - section heading indent
301f567e2a8e add document
chunhan
parents:
diff changeset
  3882
%                #4 - top separation (absolute value used, neg indicates not to indent main text)
301f567e2a8e add document
chunhan
parents:
diff changeset
  3883
%                     If negative, make stretch parts negative too!
301f567e2a8e add document
chunhan
parents:
diff changeset
  3884
%                #5 - (absolute value used) positive: bottom separation after heading,
301f567e2a8e add document
chunhan
parents:
diff changeset
  3885
%                      negative: amount to indent main text after heading
301f567e2a8e add document
chunhan
parents:
diff changeset
  3886
%                Both #4 and #5 negative means to indent main text and use negative top separation
301f567e2a8e add document
chunhan
parents:
diff changeset
  3887
%                #6 - font control
301f567e2a8e add document
chunhan
parents:
diff changeset
  3888
% You've got to have \normalfont\normalsize in the font specs below to prevent
301f567e2a8e add document
chunhan
parents:
diff changeset
  3889
% trouble when you do something like:
301f567e2a8e add document
chunhan
parents:
diff changeset
  3890
% \section{Note}{\ttfamily TT-TEXT} is known to ... 
301f567e2a8e add document
chunhan
parents:
diff changeset
  3891
% IEEE sometimes REALLY stretches the area before a section
301f567e2a8e add document
chunhan
parents:
diff changeset
  3892
% heading by up to about 0.5in. However, it may not be a good
301f567e2a8e add document
chunhan
parents:
diff changeset
  3893
% idea to let LaTeX have quite this much rubber.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3894
\ifCLASSOPTIONconference%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3895
% IEEE wants section heading spacing to decrease for conference mode
301f567e2a8e add document
chunhan
parents:
diff changeset
  3896
\def\section{\@startsection{section}{1}{\z@}{1.5ex plus 1.5ex minus 0.5ex}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3897
{0.7ex plus 1ex minus 0ex}{\normalfont\normalsize\centering\scshape}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3898
\def\subsection{\@startsection{subsection}{2}{\z@}{1.5ex plus 1.5ex minus 0.5ex}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3899
{0.7ex plus .5ex minus 0ex}{\normalfont\normalsize\itshape}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3900
\else % for journals
301f567e2a8e add document
chunhan
parents:
diff changeset
  3901
\def\section{\@startsection{section}{1}{\z@}{3.0ex plus 1.5ex minus 1.5ex}% V1.6 3.0ex from 3.5ex
301f567e2a8e add document
chunhan
parents:
diff changeset
  3902
{0.7ex plus 1ex minus 0ex}{\normalfont\normalsize\centering\scshape}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3903
\def\subsection{\@startsection{subsection}{2}{\z@}{3.5ex plus 1.5ex minus 1.5ex}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3904
{0.7ex plus .5ex minus 0ex}{\normalfont\normalsize\itshape}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3905
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3906
301f567e2a8e add document
chunhan
parents:
diff changeset
  3907
% for both journals and conferences
301f567e2a8e add document
chunhan
parents:
diff changeset
  3908
% decided to put in a little rubber above the section, might help somebody
301f567e2a8e add document
chunhan
parents:
diff changeset
  3909
\def\subsubsection{\@startsection{subsubsection}{3}{\parindent}{0ex plus 0.1ex minus 0.1ex}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3910
{0ex}{\normalfont\normalsize\itshape}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3911
\def\paragraph{\@startsection{paragraph}{4}{2\parindent}{0ex plus 0.1ex minus 0.1ex}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3912
{0ex}{\normalfont\normalsize\itshape}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3913
301f567e2a8e add document
chunhan
parents:
diff changeset
  3914
301f567e2a8e add document
chunhan
parents:
diff changeset
  3915
% compsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  3916
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  3917
\ifCLASSOPTIONconference
301f567e2a8e add document
chunhan
parents:
diff changeset
  3918
% compsoc conference
301f567e2a8e add document
chunhan
parents:
diff changeset
  3919
\def\section{\@startsection{section}{1}{\z@}{1\baselineskip plus 0.25\baselineskip minus 0.25\baselineskip}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3920
{1\baselineskip plus 0.25\baselineskip minus 0.25\baselineskip}{\normalfont\large\bfseries}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3921
\def\subsection{\@startsection{subsection}{2}{\z@}{1\baselineskip plus 0.25\baselineskip minus 0.25\baselineskip}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3922
{1\baselineskip plus 0.25\baselineskip minus 0.25\baselineskip}{\normalfont\sublargesize\bfseries}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3923
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{1\baselineskip plus 0.25\baselineskip minus 0.25\baselineskip}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3924
{0ex}{\normalfont\normalsize\bfseries}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3925
\def\paragraph{\@startsection{paragraph}{4}{2\parindent}{0ex plus 0.1ex minus 0.1ex}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3926
{0ex}{\normalfont\normalsize}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3927
\else% compsoc journals
301f567e2a8e add document
chunhan
parents:
diff changeset
  3928
% use negative top separation as compsoc journals do not indent paragraphs after section titles
301f567e2a8e add document
chunhan
parents:
diff changeset
  3929
\def\section{\@startsection{section}{1}{\z@}{-3ex plus -2ex minus -1.5ex}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3930
{0.7ex plus 1ex minus 0ex}{\normalfont\large\sffamily\bfseries\scshape}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3931
% Note that subsection and smaller may not be correct for the Computer Society,
301f567e2a8e add document
chunhan
parents:
diff changeset
  3932
% I have to look up an example.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3933
\def\subsection{\@startsection{subsection}{2}{\z@}{-3.5ex plus -1.5ex minus -1.5ex}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3934
{0.7ex plus .5ex minus 0ex}{\normalfont\normalsize\sffamily\bfseries}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3935
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-2.5ex plus -1ex minus -1ex}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3936
{0.5ex plus 0.5ex minus 0ex}{\normalfont\normalsize\sffamily\itshape}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3937
\def\paragraph{\@startsection{paragraph}{4}{2\parindent}{-0ex plus -0.1ex minus -0.1ex}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3938
{0ex}{\normalfont\normalsize}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3939
\fi\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3940
301f567e2a8e add document
chunhan
parents:
diff changeset
  3941
301f567e2a8e add document
chunhan
parents:
diff changeset
  3942
301f567e2a8e add document
chunhan
parents:
diff changeset
  3943
301f567e2a8e add document
chunhan
parents:
diff changeset
  3944
%% ENVIRONMENTS
301f567e2a8e add document
chunhan
parents:
diff changeset
  3945
% "box" symbols at end of proofs
301f567e2a8e add document
chunhan
parents:
diff changeset
  3946
\def\IEEEQEDclosed{\mbox{\rule[0pt]{1.3ex}{1.3ex}}} % for a filled box
301f567e2a8e add document
chunhan
parents:
diff changeset
  3947
% V1.6 some journals use an open box instead that will just fit around a closed one
301f567e2a8e add document
chunhan
parents:
diff changeset
  3948
\def\IEEEQEDopen{{\setlength{\fboxsep}{0pt}\setlength{\fboxrule}{0.2pt}\fbox{\rule[0pt]{0pt}{1.3ex}\rule[0pt]{1.3ex}{0pt}}}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3949
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  3950
\def\IEEEQED{\IEEEQEDopen}   % default to open for compsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  3951
\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3952
\def\IEEEQED{\IEEEQEDclosed} % otherwise default to closed
301f567e2a8e add document
chunhan
parents:
diff changeset
  3953
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  3954
301f567e2a8e add document
chunhan
parents:
diff changeset
  3955
% v1.7 name change to avoid namespace collision with amsthm. Also add support
301f567e2a8e add document
chunhan
parents:
diff changeset
  3956
% for an optional argument.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3957
\def\IEEEproof{\@ifnextchar[{\@IEEEproof}{\@IEEEproof[\IEEEproofname]}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3958
\def\@IEEEproof[#1]{\par\noindent\hspace{2em}{\itshape #1: }}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3959
\def\endIEEEproof{\hspace*{\fill}~\IEEEQED\par}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3960
301f567e2a8e add document
chunhan
parents:
diff changeset
  3961
301f567e2a8e add document
chunhan
parents:
diff changeset
  3962
%\itemindent is set to \z@ by list, so define new temporary variable
301f567e2a8e add document
chunhan
parents:
diff changeset
  3963
\newdimen\@IEEEtmpitemindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  3964
\def\@begintheorem#1#2{\@IEEEtmpitemindent\itemindent\topsep 0pt\rmfamily\trivlist%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3965
    \item[\hskip \labelsep{\indent\itshape #1\ #2:}]\itemindent\@IEEEtmpitemindent}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3966
\def\@opargbegintheorem#1#2#3{\@IEEEtmpitemindent\itemindent\topsep 0pt\rmfamily \trivlist%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3967
% V1.6 IEEE is back to using () around theorem names which are also in italics
301f567e2a8e add document
chunhan
parents:
diff changeset
  3968
% Thanks to Christian Peel for reporting this.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3969
    \item[\hskip\labelsep{\indent\itshape #1\ #2\ (#3):}]\itemindent\@IEEEtmpitemindent}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3970
% V1.7 remove bogus \unskip that caused equations in theorems to collide with
301f567e2a8e add document
chunhan
parents:
diff changeset
  3971
% lines below.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3972
\def\@endtheorem{\endtrivlist}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3973
301f567e2a8e add document
chunhan
parents:
diff changeset
  3974
% V1.6
301f567e2a8e add document
chunhan
parents:
diff changeset
  3975
% display command for the section the theorem is in - so that \thesection
301f567e2a8e add document
chunhan
parents:
diff changeset
  3976
% is not used as this will be in Roman numerals when we want arabic.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3977
% LaTeX2e uses \def\@thmcounter#1{\noexpand\arabic{#1}} for the theorem number
301f567e2a8e add document
chunhan
parents:
diff changeset
  3978
% (second part) display and \def\@thmcountersep{.} as a separator.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3979
% V1.7 intercept calls to the section counter and reroute to \@IEEEthmcounterinsection
301f567e2a8e add document
chunhan
parents:
diff changeset
  3980
% to allow \appendix(ices} to override as needed.
301f567e2a8e add document
chunhan
parents:
diff changeset
  3981
%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3982
% special handler for sections, allows appendix(ices) to override
301f567e2a8e add document
chunhan
parents:
diff changeset
  3983
\gdef\@IEEEthmcounterinsection#1{\arabic{#1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3984
% string macro
301f567e2a8e add document
chunhan
parents:
diff changeset
  3985
\edef\@IEEEstringsection{section}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3986
301f567e2a8e add document
chunhan
parents:
diff changeset
  3987
% redefine the #1#2[#3] form of newtheorem to use a hook to \@IEEEthmcounterinsection
301f567e2a8e add document
chunhan
parents:
diff changeset
  3988
% if section in_counter is used
301f567e2a8e add document
chunhan
parents:
diff changeset
  3989
\def\@xnthm#1#2[#3]{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3990
  \expandafter\@ifdefinable\csname #1\endcsname
301f567e2a8e add document
chunhan
parents:
diff changeset
  3991
    {\@definecounter{#1}\@newctr{#1}[#3]%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3992
     \edef\@IEEEstringtmp{#3}
301f567e2a8e add document
chunhan
parents:
diff changeset
  3993
     \ifx\@IEEEstringtmp\@IEEEstringsection
301f567e2a8e add document
chunhan
parents:
diff changeset
  3994
     \expandafter\xdef\csname the#1\endcsname{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3995
     \noexpand\@IEEEthmcounterinsection{#3}\@thmcountersep
301f567e2a8e add document
chunhan
parents:
diff changeset
  3996
          \@thmcounter{#1}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3997
     \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  3998
     \expandafter\xdef\csname the#1\endcsname{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  3999
       \expandafter\noexpand\csname the#3\endcsname \@thmcountersep
301f567e2a8e add document
chunhan
parents:
diff changeset
  4000
          \@thmcounter{#1}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4001
     \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4002
     \global\@namedef{#1}{\@thm{#1}{#2}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4003
     \global\@namedef{end#1}{\@endtheorem}}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4004
301f567e2a8e add document
chunhan
parents:
diff changeset
  4005
301f567e2a8e add document
chunhan
parents:
diff changeset
  4006
301f567e2a8e add document
chunhan
parents:
diff changeset
  4007
%% SET UP THE DEFAULT PAGESTYLE
301f567e2a8e add document
chunhan
parents:
diff changeset
  4008
\ps@headings
301f567e2a8e add document
chunhan
parents:
diff changeset
  4009
\pagenumbering{arabic}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4010
301f567e2a8e add document
chunhan
parents:
diff changeset
  4011
% normally the page counter starts at 1
301f567e2a8e add document
chunhan
parents:
diff changeset
  4012
\setcounter{page}{1}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4013
% however, for peerreview the cover sheet is page 0 or page -1
301f567e2a8e add document
chunhan
parents:
diff changeset
  4014
% (for duplex printing)
301f567e2a8e add document
chunhan
parents:
diff changeset
  4015
\ifCLASSOPTIONpeerreview
301f567e2a8e add document
chunhan
parents:
diff changeset
  4016
   \if@twoside
301f567e2a8e add document
chunhan
parents:
diff changeset
  4017
      \setcounter{page}{-1}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4018
   \else
301f567e2a8e add document
chunhan
parents:
diff changeset
  4019
      \setcounter{page}{0}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4020
   \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4021
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4022
301f567e2a8e add document
chunhan
parents:
diff changeset
  4023
% standard book class behavior - let bottom line float up and down as
301f567e2a8e add document
chunhan
parents:
diff changeset
  4024
% needed when single sided
301f567e2a8e add document
chunhan
parents:
diff changeset
  4025
\ifCLASSOPTIONtwoside\else\raggedbottom\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4026
% if two column - turn on twocolumn, allow word spacings to stretch more and
301f567e2a8e add document
chunhan
parents:
diff changeset
  4027
% enforce a rigid position for the last lines
301f567e2a8e add document
chunhan
parents:
diff changeset
  4028
\ifCLASSOPTIONtwocolumn
301f567e2a8e add document
chunhan
parents:
diff changeset
  4029
% the peer review option delays invoking twocolumn
301f567e2a8e add document
chunhan
parents:
diff changeset
  4030
   \ifCLASSOPTIONpeerreview\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  4031
      \twocolumn
301f567e2a8e add document
chunhan
parents:
diff changeset
  4032
   \fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4033
\sloppy 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4034
\flushbottom
301f567e2a8e add document
chunhan
parents:
diff changeset
  4035
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4036
301f567e2a8e add document
chunhan
parents:
diff changeset
  4037
301f567e2a8e add document
chunhan
parents:
diff changeset
  4038
301f567e2a8e add document
chunhan
parents:
diff changeset
  4039
301f567e2a8e add document
chunhan
parents:
diff changeset
  4040
% \APPENDIX and \APPENDICES definitions
301f567e2a8e add document
chunhan
parents:
diff changeset
  4041
301f567e2a8e add document
chunhan
parents:
diff changeset
  4042
% This is the \@ifmtarg command from the LaTeX ifmtarg package
301f567e2a8e add document
chunhan
parents:
diff changeset
  4043
% by Peter Wilson (CUA) and Donald Arseneau
301f567e2a8e add document
chunhan
parents:
diff changeset
  4044
% \@ifmtarg is used to determine if an argument to a command
301f567e2a8e add document
chunhan
parents:
diff changeset
  4045
% is present or not.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4046
% For instance:
301f567e2a8e add document
chunhan
parents:
diff changeset
  4047
% \@ifmtarg{#1}{\typeout{empty}}{\typeout{has something}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4048
% \@ifmtarg is used with our redefined \section command if
301f567e2a8e add document
chunhan
parents:
diff changeset
  4049
% \appendices is invoked.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4050
% The command \section will behave slightly differently depending
301f567e2a8e add document
chunhan
parents:
diff changeset
  4051
% on whether the user specifies a title: 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4052
% \section{My appendix title}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4053
% or not:
301f567e2a8e add document
chunhan
parents:
diff changeset
  4054
% \section{}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4055
% This way, we can eliminate the blank lines where the title
301f567e2a8e add document
chunhan
parents:
diff changeset
  4056
% would be, and the unneeded : after Appendix in the table of
301f567e2a8e add document
chunhan
parents:
diff changeset
  4057
% contents 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4058
\begingroup
301f567e2a8e add document
chunhan
parents:
diff changeset
  4059
\catcode`\Q=3
301f567e2a8e add document
chunhan
parents:
diff changeset
  4060
\long\gdef\@ifmtarg#1{\@xifmtarg#1QQ\@secondoftwo\@firstoftwo\@nil}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4061
\long\gdef\@xifmtarg#1#2Q#3#4#5\@nil{#4}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4062
\endgroup
301f567e2a8e add document
chunhan
parents:
diff changeset
  4063
% end of \@ifmtarg defs
301f567e2a8e add document
chunhan
parents:
diff changeset
  4064
301f567e2a8e add document
chunhan
parents:
diff changeset
  4065
301f567e2a8e add document
chunhan
parents:
diff changeset
  4066
% V1.7
301f567e2a8e add document
chunhan
parents:
diff changeset
  4067
% command that allows the one time saving of the original definition
301f567e2a8e add document
chunhan
parents:
diff changeset
  4068
% of section to \@IEEEappendixsavesection for \appendix or \appendices 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4069
% we don't save \section here as it may be redefined later by other
301f567e2a8e add document
chunhan
parents:
diff changeset
  4070
% packages (hyperref.sty, etc.)
301f567e2a8e add document
chunhan
parents:
diff changeset
  4071
\def\@IEEEsaveoriginalsectiononce{\let\@IEEEappendixsavesection\section
301f567e2a8e add document
chunhan
parents:
diff changeset
  4072
\let\@IEEEsaveoriginalsectiononce\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4073
301f567e2a8e add document
chunhan
parents:
diff changeset
  4074
% neat trick to grab and process the argument from \section{argument}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4075
% we process differently if the user invoked \section{} with no
301f567e2a8e add document
chunhan
parents:
diff changeset
  4076
% argument (title)
301f567e2a8e add document
chunhan
parents:
diff changeset
  4077
% note we reroute the call to the old \section*
301f567e2a8e add document
chunhan
parents:
diff changeset
  4078
\def\@IEEEprocessthesectionargument#1{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4079
\@ifmtarg{#1}{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4080
\@IEEEappendixsavesection*{\appendixname~\thesectiondis}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4081
\addcontentsline{toc}{section}{\appendixname~\thesection}}{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4082
\@IEEEappendixsavesection*{\appendixname~\thesectiondis \\* #1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4083
\addcontentsline{toc}{section}{\appendixname~\thesection: #1}}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4084
301f567e2a8e add document
chunhan
parents:
diff changeset
  4085
% we use this if the user calls \section{} after
301f567e2a8e add document
chunhan
parents:
diff changeset
  4086
% \appendix-- which has no meaning. So, we ignore the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4087
% command and its argument. Then, warn the user.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4088
\def\@IEEEdestroythesectionargument#1{\typeout{** WARNING: Ignoring useless
301f567e2a8e add document
chunhan
parents:
diff changeset
  4089
\protect\section\space in Appendix (line \the\inputlineno).}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4090
301f567e2a8e add document
chunhan
parents:
diff changeset
  4091
301f567e2a8e add document
chunhan
parents:
diff changeset
  4092
% remember \thesection forms will be displayed in \ref calls
301f567e2a8e add document
chunhan
parents:
diff changeset
  4093
% and in the Table of Contents.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4094
% The \sectiondis form is used in the actual heading itself
301f567e2a8e add document
chunhan
parents:
diff changeset
  4095
301f567e2a8e add document
chunhan
parents:
diff changeset
  4096
% appendix command for one single appendix
301f567e2a8e add document
chunhan
parents:
diff changeset
  4097
% normally has no heading. However, if you want a 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4098
% heading, you can do so via the optional argument:
301f567e2a8e add document
chunhan
parents:
diff changeset
  4099
% \appendix[Optional Heading]
301f567e2a8e add document
chunhan
parents:
diff changeset
  4100
\def\appendix{\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4101
\renewcommand{\appendix}[1][]{\@IEEEsaveoriginalsectiononce\par
301f567e2a8e add document
chunhan
parents:
diff changeset
  4102
    % v1.6 keep hyperref's identifiers unique
301f567e2a8e add document
chunhan
parents:
diff changeset
  4103
    \gdef\theHsection{Appendix.A}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4104
    % v1.6 adjust hyperref's string name for the section
301f567e2a8e add document
chunhan
parents:
diff changeset
  4105
    \xdef\Hy@chapapp{appendix}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4106
    \setcounter{section}{0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4107
    \setcounter{subsection}{0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4108
    \setcounter{subsubsection}{0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4109
    \setcounter{paragraph}{0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4110
    \gdef\thesection{A}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4111
    \gdef\thesectiondis{}% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4112
    \gdef\thesubsection{\Alph{subsection}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4113
    \gdef\@IEEEthmcounterinsection##1{A}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4114
    \refstepcounter{section}% update the \ref counter
301f567e2a8e add document
chunhan
parents:
diff changeset
  4115
    \@ifmtarg{#1}{\@IEEEappendixsavesection*{\appendixname}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4116
                  \addcontentsline{toc}{section}{\appendixname}}{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4117
             \@IEEEappendixsavesection*{\appendixname~\\* #1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4118
             \addcontentsline{toc}{section}{\appendixname: #1}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4119
    % redefine \section command for appendix
301f567e2a8e add document
chunhan
parents:
diff changeset
  4120
    % leave \section* as is
301f567e2a8e add document
chunhan
parents:
diff changeset
  4121
    \def\section{\@ifstar{\@IEEEappendixsavesection*}{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4122
                    \@IEEEdestroythesectionargument}}% throw out the argument
301f567e2a8e add document
chunhan
parents:
diff changeset
  4123
                                                     % of the normal form
301f567e2a8e add document
chunhan
parents:
diff changeset
  4124
}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4125
301f567e2a8e add document
chunhan
parents:
diff changeset
  4126
301f567e2a8e add document
chunhan
parents:
diff changeset
  4127
301f567e2a8e add document
chunhan
parents:
diff changeset
  4128
% appendices command for multiple appendices
301f567e2a8e add document
chunhan
parents:
diff changeset
  4129
% user then calls \section with an argument (possibly empty) to
301f567e2a8e add document
chunhan
parents:
diff changeset
  4130
% declare the individual appendices
301f567e2a8e add document
chunhan
parents:
diff changeset
  4131
\def\appendices{\@IEEEsaveoriginalsectiononce\par
301f567e2a8e add document
chunhan
parents:
diff changeset
  4132
    % v1.6 keep hyperref's identifiers unique
301f567e2a8e add document
chunhan
parents:
diff changeset
  4133
    \gdef\theHsection{Appendix.\Alph{section}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4134
    % v1.6 adjust hyperref's string name for the section
301f567e2a8e add document
chunhan
parents:
diff changeset
  4135
    \xdef\Hy@chapapp{appendix}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4136
    \setcounter{section}{-1}% we want \refstepcounter to use section 0
301f567e2a8e add document
chunhan
parents:
diff changeset
  4137
    \setcounter{subsection}{0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4138
    \setcounter{subsubsection}{0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4139
    \setcounter{paragraph}{0}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4140
    \ifCLASSOPTIONromanappendices%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4141
    \gdef\thesection{\Roman{section}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4142
    \gdef\thesectiondis{\Roman{section}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4143
    \@IEEEcompsocconfonly{\gdef\thesectiondis{\Roman{section}.}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4144
    \gdef\@IEEEthmcounterinsection##1{A\arabic{##1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4145
    \else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4146
    \gdef\thesection{\Alph{section}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4147
    \gdef\thesectiondis{\Alph{section}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4148
    \@IEEEcompsocconfonly{\gdef\thesectiondis{\Alph{section}.}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4149
    \gdef\@IEEEthmcounterinsection##1{\Alph{##1}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4150
    \fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4151
    \refstepcounter{section}% update the \ref counter
301f567e2a8e add document
chunhan
parents:
diff changeset
  4152
    \setcounter{section}{0}% NEXT \section will be the FIRST appendix
301f567e2a8e add document
chunhan
parents:
diff changeset
  4153
    % redefine \section command for appendices
301f567e2a8e add document
chunhan
parents:
diff changeset
  4154
    % leave \section* as is
301f567e2a8e add document
chunhan
parents:
diff changeset
  4155
    \def\section{\@ifstar{\@IEEEappendixsavesection*}{% process the *-form
301f567e2a8e add document
chunhan
parents:
diff changeset
  4156
                    \refstepcounter{section}% or is a new section so,
301f567e2a8e add document
chunhan
parents:
diff changeset
  4157
                    \@IEEEprocessthesectionargument}}% process the argument 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4158
                                                 % of the normal form
301f567e2a8e add document
chunhan
parents:
diff changeset
  4159
}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4160
301f567e2a8e add document
chunhan
parents:
diff changeset
  4161
301f567e2a8e add document
chunhan
parents:
diff changeset
  4162
301f567e2a8e add document
chunhan
parents:
diff changeset
  4163
% \IEEEPARstart
301f567e2a8e add document
chunhan
parents:
diff changeset
  4164
% Definition for the big two line drop cap letter at the beginning of the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4165
% first paragraph of journal papers. The first argument is the first letter
301f567e2a8e add document
chunhan
parents:
diff changeset
  4166
% of the first word, the second argument is the remaining letters of the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4167
% first word which will be rendered in upper case.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4168
% In V1.6 this has been completely rewritten to:
301f567e2a8e add document
chunhan
parents:
diff changeset
  4169
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4170
% 1. no longer have problems when the user begins an environment
301f567e2a8e add document
chunhan
parents:
diff changeset
  4171
%    within the paragraph that uses \IEEEPARstart.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4172
% 2. auto-detect and use the current font family
301f567e2a8e add document
chunhan
parents:
diff changeset
  4173
% 3. revise handling of the space at the end of the first word so that
301f567e2a8e add document
chunhan
parents:
diff changeset
  4174
%    interword glue will now work as normal.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4175
% 4. produce correctly aligned edges for the (two) indented lines.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4176
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4177
% We generalize things via control macros - playing with these is fun too.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4178
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4179
% V1.7 added more control macros to make it easy for IEEEtrantools.sty users
301f567e2a8e add document
chunhan
parents:
diff changeset
  4180
% to change the font style.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4181
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4182
% the number of lines that are indented to clear it
301f567e2a8e add document
chunhan
parents:
diff changeset
  4183
% may need to increase if using decenders
301f567e2a8e add document
chunhan
parents:
diff changeset
  4184
\def\@IEEEPARstartDROPLINES{2}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4185
% minimum number of lines left on a page to allow a \@IEEEPARstart
301f567e2a8e add document
chunhan
parents:
diff changeset
  4186
% Does not take into consideration rubber shrink, so it tends to
301f567e2a8e add document
chunhan
parents:
diff changeset
  4187
% be overly cautious
301f567e2a8e add document
chunhan
parents:
diff changeset
  4188
\def\@IEEEPARstartMINPAGELINES{2}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4189
% V1.7 the height of the drop cap is adjusted to match the height of this text
301f567e2a8e add document
chunhan
parents:
diff changeset
  4190
% in the current font (when \IEEEPARstart is called).
301f567e2a8e add document
chunhan
parents:
diff changeset
  4191
\def\@IEEEPARstartHEIGHTTEXT{T}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4192
% the depth the letter is lowered below the baseline
301f567e2a8e add document
chunhan
parents:
diff changeset
  4193
% the height (and size) of the letter is determined by the sum
301f567e2a8e add document
chunhan
parents:
diff changeset
  4194
% of this value and the height of the \@IEEEPARstartHEIGHTTEXT in the current
301f567e2a8e add document
chunhan
parents:
diff changeset
  4195
% font. It is a good idea to set this value in terms of the baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  4196
% so that it can respond to changes therein.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4197
\def\@IEEEPARstartDROPDEPTH{1.1\baselineskip}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4198
% V1.7 the font the drop cap will be rendered in,
301f567e2a8e add document
chunhan
parents:
diff changeset
  4199
% can take zero or one argument.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4200
\def\@IEEEPARstartFONTSTYLE{\bfseries}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4201
% V1.7 any additional, non-font related commands needed to modify
301f567e2a8e add document
chunhan
parents:
diff changeset
  4202
% the drop cap letter, can take zero or one argument.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4203
\def\@IEEEPARstartCAPSTYLE{\MakeUppercase}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4204
% V1.7 the font that will be used to render the rest of the word,
301f567e2a8e add document
chunhan
parents:
diff changeset
  4205
% can take zero or one argument.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4206
\def\@IEEEPARstartWORDFONTSTYLE{\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4207
% V1.7 any additional, non-font related commands needed to modify
301f567e2a8e add document
chunhan
parents:
diff changeset
  4208
% the rest of the word, can take zero or one argument.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4209
\def\@IEEEPARstartWORDCAPSTYLE{\MakeUppercase}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4210
% This is the horizontal separation distance from the drop letter to the main text.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4211
% Lengths that depend on the font (e.g., ex, em, etc.) will be referenced
301f567e2a8e add document
chunhan
parents:
diff changeset
  4212
% to the font that is active when \IEEEPARstart is called. 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4213
\def\@IEEEPARstartSEP{0.15em}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4214
% V1.7 horizontal offset applied to the left of the drop cap.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4215
\def\@IEEEPARstartHOFFSET{0em}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4216
% V1.7 Italic correction command applied at the end of the drop cap.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4217
\def\@IEEEPARstartITLCORRECT{\/}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4218
301f567e2a8e add document
chunhan
parents:
diff changeset
  4219
% V1.7 compoc uses nonbold drop cap and small caps word style
301f567e2a8e add document
chunhan
parents:
diff changeset
  4220
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  4221
\def\@IEEEPARstartFONTSTYLE{\mdseries}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4222
\def\@IEEEPARstartWORDFONTSTYLE{\scshape}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4223
\def\@IEEEPARstartWORDCAPSTYLE{\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4224
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4225
301f567e2a8e add document
chunhan
parents:
diff changeset
  4226
% definition of \IEEEPARstart
301f567e2a8e add document
chunhan
parents:
diff changeset
  4227
% THIS IS A CONTROLLED SPACING AREA, DO NOT ALLOW SPACES WITHIN THESE LINES
301f567e2a8e add document
chunhan
parents:
diff changeset
  4228
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4229
% The token \@IEEEPARstartfont will be globally defined after the first use
301f567e2a8e add document
chunhan
parents:
diff changeset
  4230
% of \IEEEPARstart and will be a font command which creates the big letter
301f567e2a8e add document
chunhan
parents:
diff changeset
  4231
% The first argument is the first letter of the first word and the second
301f567e2a8e add document
chunhan
parents:
diff changeset
  4232
% argument is the rest of the first word(s).
301f567e2a8e add document
chunhan
parents:
diff changeset
  4233
\def\IEEEPARstart#1#2{\par{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4234
% if this page does not have enough space, break it and lets start
301f567e2a8e add document
chunhan
parents:
diff changeset
  4235
% on a new one
301f567e2a8e add document
chunhan
parents:
diff changeset
  4236
\@IEEEtranneedspace{\@IEEEPARstartMINPAGELINES\baselineskip}{\relax}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4237
% V1.7 move this up here in case user uses \textbf for \@IEEEPARstartFONTSTYLE
301f567e2a8e add document
chunhan
parents:
diff changeset
  4238
% which uses command \leavevmode which causes an unwanted \indent to be issued
301f567e2a8e add document
chunhan
parents:
diff changeset
  4239
\noindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  4240
% calculate the desired height of the big letter
301f567e2a8e add document
chunhan
parents:
diff changeset
  4241
% it extends from the top of \@IEEEPARstartHEIGHTTEXT in the current font
301f567e2a8e add document
chunhan
parents:
diff changeset
  4242
% down to \@IEEEPARstartDROPDEPTH below the current baseline
301f567e2a8e add document
chunhan
parents:
diff changeset
  4243
\settoheight{\@IEEEtrantmpdimenA}{\@IEEEPARstartHEIGHTTEXT}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4244
\addtolength{\@IEEEtrantmpdimenA}{\@IEEEPARstartDROPDEPTH}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4245
% extract the name of the current font in bold
301f567e2a8e add document
chunhan
parents:
diff changeset
  4246
% and place it in \@IEEEPARstartFONTNAME
301f567e2a8e add document
chunhan
parents:
diff changeset
  4247
\def\@IEEEPARstartGETFIRSTWORD##1 ##2\relax{##1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4248
{\@IEEEPARstartFONTSTYLE{\selectfont\edef\@IEEEPARstartFONTNAMESPACE{\fontname\font\space}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4249
\xdef\@IEEEPARstartFONTNAME{\expandafter\@IEEEPARstartGETFIRSTWORD\@IEEEPARstartFONTNAMESPACE\relax}}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4250
% define a font based on this name with a point size equal to the desired
301f567e2a8e add document
chunhan
parents:
diff changeset
  4251
% height of the drop letter
301f567e2a8e add document
chunhan
parents:
diff changeset
  4252
\font\@IEEEPARstartsubfont\@IEEEPARstartFONTNAME\space at \@IEEEtrantmpdimenA\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4253
% save this value as a counter (integer) value (sp points)
301f567e2a8e add document
chunhan
parents:
diff changeset
  4254
\@IEEEtrantmpcountA=\@IEEEtrantmpdimenA%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4255
% now get the height of the actual letter produced by this font size
301f567e2a8e add document
chunhan
parents:
diff changeset
  4256
\settoheight{\@IEEEtrantmpdimenB}{\@IEEEPARstartsubfont\@IEEEPARstartCAPSTYLE{#1}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4257
% If something bogus happens like the first argument is empty or the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4258
% current font is strange, do not allow a zero height.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4259
\ifdim\@IEEEtrantmpdimenB=0pt\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4260
\typeout{** WARNING: IEEEPARstart drop letter has zero height! (line \the\inputlineno)}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4261
\typeout{ Forcing the drop letter font size to 10pt.}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4262
\@IEEEtrantmpdimenB=10pt%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4263
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4264
% and store it as a counter
301f567e2a8e add document
chunhan
parents:
diff changeset
  4265
\@IEEEtrantmpcountB=\@IEEEtrantmpdimenB%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4266
% Since a font size doesn't exactly correspond to the height of the capital
301f567e2a8e add document
chunhan
parents:
diff changeset
  4267
% letters in that font, the actual height of the letter, \@IEEEtrantmpcountB,
301f567e2a8e add document
chunhan
parents:
diff changeset
  4268
% will be less than that desired, \@IEEEtrantmpcountA
301f567e2a8e add document
chunhan
parents:
diff changeset
  4269
% we need to raise the font size, \@IEEEtrantmpdimenA 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4270
% by \@IEEEtrantmpcountA / \@IEEEtrantmpcountB
301f567e2a8e add document
chunhan
parents:
diff changeset
  4271
% But, TeX doesn't have floating point division, so we have to use integer
301f567e2a8e add document
chunhan
parents:
diff changeset
  4272
% division. Hence the use of the counters.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4273
% We need to reduce the denominator so that the loss of the remainder will
301f567e2a8e add document
chunhan
parents:
diff changeset
  4274
% have minimal affect on the accuracy of the result
301f567e2a8e add document
chunhan
parents:
diff changeset
  4275
\divide\@IEEEtrantmpcountB by 200%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4276
\divide\@IEEEtrantmpcountA by \@IEEEtrantmpcountB%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4277
% Then reequalize things when we use TeX's ability to multiply by
301f567e2a8e add document
chunhan
parents:
diff changeset
  4278
% floating point values
301f567e2a8e add document
chunhan
parents:
diff changeset
  4279
\@IEEEtrantmpdimenB=0.005\@IEEEtrantmpdimenA%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4280
\multiply\@IEEEtrantmpdimenB by \@IEEEtrantmpcountA%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4281
% \@IEEEPARstartfont is globaly set to the calculated font of the big letter
301f567e2a8e add document
chunhan
parents:
diff changeset
  4282
% We need to carry this out of the local calculation area to to create the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4283
% big letter.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4284
\global\font\@IEEEPARstartfont\@IEEEPARstartFONTNAME\space at \@IEEEtrantmpdimenB%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4285
% Now set \@IEEEtrantmpdimenA to the width of the big letter
301f567e2a8e add document
chunhan
parents:
diff changeset
  4286
% We need to carry this out of the local calculation area to set the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4287
% hanging indent
301f567e2a8e add document
chunhan
parents:
diff changeset
  4288
\settowidth{\global\@IEEEtrantmpdimenA}{\@IEEEPARstartfont
301f567e2a8e add document
chunhan
parents:
diff changeset
  4289
\@IEEEPARstartCAPSTYLE{#1\@IEEEPARstartITLCORRECT}}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4290
% end of the isolated calculation environment
301f567e2a8e add document
chunhan
parents:
diff changeset
  4291
% add in the extra clearance we want
301f567e2a8e add document
chunhan
parents:
diff changeset
  4292
\advance\@IEEEtrantmpdimenA by \@IEEEPARstartSEP\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4293
% add in the optional offset
301f567e2a8e add document
chunhan
parents:
diff changeset
  4294
\advance\@IEEEtrantmpdimenA by \@IEEEPARstartHOFFSET\relax%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4295
% V1.7 don't allow negative offsets to produce negative hanging indents
301f567e2a8e add document
chunhan
parents:
diff changeset
  4296
\@IEEEtrantmpdimenB\@IEEEtrantmpdimenA
301f567e2a8e add document
chunhan
parents:
diff changeset
  4297
\ifnum\@IEEEtrantmpdimenB < 0 \@IEEEtrantmpdimenB 0pt\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4298
% \@IEEEtrantmpdimenA has the width of the big letter plus the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4299
% separation space and \@IEEEPARstartfont is the font we need to use
301f567e2a8e add document
chunhan
parents:
diff changeset
  4300
% Now, we make the letter and issue the hanging indent command
301f567e2a8e add document
chunhan
parents:
diff changeset
  4301
% The letter is placed in a box of zero width and height so that other
301f567e2a8e add document
chunhan
parents:
diff changeset
  4302
% text won't be displaced by it.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4303
\hangindent\@IEEEtrantmpdimenB\hangafter=-\@IEEEPARstartDROPLINES%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4304
\makebox[0pt][l]{\hspace{-\@IEEEtrantmpdimenA}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4305
\raisebox{-\@IEEEPARstartDROPDEPTH}[0pt][0pt]{\hspace{\@IEEEPARstartHOFFSET}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4306
\@IEEEPARstartfont\@IEEEPARstartCAPSTYLE{#1\@IEEEPARstartITLCORRECT}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4307
\hspace{\@IEEEPARstartSEP}}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4308
{\@IEEEPARstartWORDFONTSTYLE{\@IEEEPARstartWORDCAPSTYLE{\selectfont#2}}}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4309
301f567e2a8e add document
chunhan
parents:
diff changeset
  4310
301f567e2a8e add document
chunhan
parents:
diff changeset
  4311
301f567e2a8e add document
chunhan
parents:
diff changeset
  4312
301f567e2a8e add document
chunhan
parents:
diff changeset
  4313
301f567e2a8e add document
chunhan
parents:
diff changeset
  4314
301f567e2a8e add document
chunhan
parents:
diff changeset
  4315
% determines if the space remaining on a given page is equal to or greater
301f567e2a8e add document
chunhan
parents:
diff changeset
  4316
% than the specified space of argument one
301f567e2a8e add document
chunhan
parents:
diff changeset
  4317
% if not, execute argument two (only if the remaining space is greater than zero)
301f567e2a8e add document
chunhan
parents:
diff changeset
  4318
% and issue a \newpage
301f567e2a8e add document
chunhan
parents:
diff changeset
  4319
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4320
% example: \@IEEEtranneedspace{2in}{\vfill}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4321
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4322
% Does not take into consideration rubber shrinkage, so it tends to
301f567e2a8e add document
chunhan
parents:
diff changeset
  4323
% be overly cautious
301f567e2a8e add document
chunhan
parents:
diff changeset
  4324
% Based on an example posted by Donald Arseneau
301f567e2a8e add document
chunhan
parents:
diff changeset
  4325
% Note this macro uses \@IEEEtrantmpdimenB internally for calculations,
301f567e2a8e add document
chunhan
parents:
diff changeset
  4326
% so DO NOT PASS \@IEEEtrantmpdimenB to this routine
301f567e2a8e add document
chunhan
parents:
diff changeset
  4327
% if you need a dimen register, import with \@IEEEtrantmpdimenA instead
301f567e2a8e add document
chunhan
parents:
diff changeset
  4328
\def\@IEEEtranneedspace#1#2{\penalty-100\begingroup%shield temp variable
301f567e2a8e add document
chunhan
parents:
diff changeset
  4329
\@IEEEtrantmpdimenB\pagegoal\advance\@IEEEtrantmpdimenB-\pagetotal% space left
301f567e2a8e add document
chunhan
parents:
diff changeset
  4330
\ifdim #1>\@IEEEtrantmpdimenB\relax% not enough space left
301f567e2a8e add document
chunhan
parents:
diff changeset
  4331
\ifdim\@IEEEtrantmpdimenB>\z@\relax #2\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4332
\newpage%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4333
\fi\endgroup}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4334
301f567e2a8e add document
chunhan
parents:
diff changeset
  4335
301f567e2a8e add document
chunhan
parents:
diff changeset
  4336
301f567e2a8e add document
chunhan
parents:
diff changeset
  4337
% IEEEbiography ENVIRONMENT
301f567e2a8e add document
chunhan
parents:
diff changeset
  4338
% Allows user to enter biography leaving place for picture (adapts to font size)
301f567e2a8e add document
chunhan
parents:
diff changeset
  4339
% As of V1.5, a new optional argument allows you to have a real graphic!
301f567e2a8e add document
chunhan
parents:
diff changeset
  4340
% V1.5 and later also fixes the "colliding biographies" which could happen when a 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4341
% biography's text was shorter than the space for the photo.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4342
% MDS 7/2001
301f567e2a8e add document
chunhan
parents:
diff changeset
  4343
% V1.6 prevent multiple biographies from making multiple TOC entries
301f567e2a8e add document
chunhan
parents:
diff changeset
  4344
\newif\if@IEEEbiographyTOCentrynotmade
301f567e2a8e add document
chunhan
parents:
diff changeset
  4345
\global\@IEEEbiographyTOCentrynotmadetrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  4346
301f567e2a8e add document
chunhan
parents:
diff changeset
  4347
% biography counter so hyperref can jump directly to the biographies
301f567e2a8e add document
chunhan
parents:
diff changeset
  4348
% and not just the previous section
301f567e2a8e add document
chunhan
parents:
diff changeset
  4349
\newcounter{IEEEbiography}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4350
\setcounter{IEEEbiography}{0}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4351
301f567e2a8e add document
chunhan
parents:
diff changeset
  4352
% photo area size
301f567e2a8e add document
chunhan
parents:
diff changeset
  4353
\def\@IEEEBIOphotowidth{1.0in}    % width of the biography photo area
301f567e2a8e add document
chunhan
parents:
diff changeset
  4354
\def\@IEEEBIOphotodepth{1.25in}   % depth (height) of the biography photo area
301f567e2a8e add document
chunhan
parents:
diff changeset
  4355
% area cleared for photo
301f567e2a8e add document
chunhan
parents:
diff changeset
  4356
\def\@IEEEBIOhangwidth{1.14in}    % width cleared for the biography photo area
301f567e2a8e add document
chunhan
parents:
diff changeset
  4357
\def\@IEEEBIOhangdepth{1.25in}    % depth cleared for the biography photo area
301f567e2a8e add document
chunhan
parents:
diff changeset
  4358
                                  % actual depth will be a multiple of 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4359
                                  % \baselineskip, rounded up
301f567e2a8e add document
chunhan
parents:
diff changeset
  4360
\def\@IEEEBIOskipN{4\baselineskip}% nominal value of the vskip above the biography
301f567e2a8e add document
chunhan
parents:
diff changeset
  4361
301f567e2a8e add document
chunhan
parents:
diff changeset
  4362
\newenvironment{IEEEbiography}[2][]{\normalfont\@IEEEcompsoconly{\sffamily}\footnotesize%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4363
\unitlength 1in\parskip=0pt\par\parindent 1em\interlinepenalty500%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4364
% we need enough space to support the hanging indent
301f567e2a8e add document
chunhan
parents:
diff changeset
  4365
% the nominal value of the spacer
301f567e2a8e add document
chunhan
parents:
diff changeset
  4366
% and one extra line for good measure
301f567e2a8e add document
chunhan
parents:
diff changeset
  4367
\@IEEEtrantmpdimenA=\@IEEEBIOhangdepth%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4368
\advance\@IEEEtrantmpdimenA by \@IEEEBIOskipN%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4369
\advance\@IEEEtrantmpdimenA by 1\baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4370
% if this page does not have enough space, break it and lets start
301f567e2a8e add document
chunhan
parents:
diff changeset
  4371
% with a new one
301f567e2a8e add document
chunhan
parents:
diff changeset
  4372
\@IEEEtranneedspace{\@IEEEtrantmpdimenA}{\relax}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4373
% nominal spacer can strech, not shrink use 1fil so user can out stretch with \vfill
301f567e2a8e add document
chunhan
parents:
diff changeset
  4374
\vskip \@IEEEBIOskipN plus 1fil minus 0\baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4375
% the default box for where the photo goes
301f567e2a8e add document
chunhan
parents:
diff changeset
  4376
\def\@IEEEtempbiographybox{{\setlength{\fboxsep}{0pt}\framebox{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4377
\begin{minipage}[b][\@IEEEBIOphotodepth][c]{\@IEEEBIOphotowidth}\centering PLACE\\ PHOTO\\ HERE \end{minipage}}}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4378
%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4379
% detect if the optional argument was supplied, this requires the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4380
% \@ifmtarg command as defined in the appendix section above
301f567e2a8e add document
chunhan
parents:
diff changeset
  4381
% and if so, override the default box with what they want
301f567e2a8e add document
chunhan
parents:
diff changeset
  4382
\@ifmtarg{#1}{\relax}{\def\@IEEEtempbiographybox{\mbox{\begin{minipage}[b][\@IEEEBIOphotodepth][c]{\@IEEEBIOphotowidth}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4383
\centering%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4384
#1%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4385
\end{minipage}}}}% end if optional argument supplied
301f567e2a8e add document
chunhan
parents:
diff changeset
  4386
% Make an entry into the table of contents only if we have not done so before
301f567e2a8e add document
chunhan
parents:
diff changeset
  4387
\if@IEEEbiographyTOCentrynotmade%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4388
% link labels to the biography counter so hyperref will jump
301f567e2a8e add document
chunhan
parents:
diff changeset
  4389
% to the biography, not the previous section
301f567e2a8e add document
chunhan
parents:
diff changeset
  4390
\setcounter{IEEEbiography}{-1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4391
\refstepcounter{IEEEbiography}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4392
\addcontentsline{toc}{section}{Biographies}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4393
\global\@IEEEbiographyTOCentrynotmadefalse%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4394
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4395
% one more biography
301f567e2a8e add document
chunhan
parents:
diff changeset
  4396
\refstepcounter{IEEEbiography}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4397
% Make an entry for this name into the table of contents 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4398
\addcontentsline{toc}{subsection}{#2}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4399
% V1.6 properly handle if a new paragraph should occur while the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4400
% hanging indent is still active. Do this by redefining \par so
301f567e2a8e add document
chunhan
parents:
diff changeset
  4401
% that it will not start a new paragraph. (But it will appear to the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4402
% user as if it did.) Also, strip any leading pars, newlines, or spaces.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4403
\let\@IEEEBIOORGparCMD=\par% save the original \par command
301f567e2a8e add document
chunhan
parents:
diff changeset
  4404
\edef\par{\hfil\break\indent}% the new \par will not be a "real" \par
301f567e2a8e add document
chunhan
parents:
diff changeset
  4405
\settoheight{\@IEEEtrantmpdimenA}{\@IEEEtempbiographybox}% get height of biography box
301f567e2a8e add document
chunhan
parents:
diff changeset
  4406
\@IEEEtrantmpdimenB=\@IEEEBIOhangdepth%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4407
\@IEEEtrantmpcountA=\@IEEEtrantmpdimenB% countA has the hang depth
301f567e2a8e add document
chunhan
parents:
diff changeset
  4408
\divide\@IEEEtrantmpcountA by \baselineskip%  calculates lines needed to produce the hang depth
301f567e2a8e add document
chunhan
parents:
diff changeset
  4409
\advance\@IEEEtrantmpcountA by 1% ensure we overestimate
301f567e2a8e add document
chunhan
parents:
diff changeset
  4410
% set the hanging indent
301f567e2a8e add document
chunhan
parents:
diff changeset
  4411
\hangindent\@IEEEBIOhangwidth%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4412
\hangafter-\@IEEEtrantmpcountA%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4413
% reference the top of the photo area to the top of a capital T
301f567e2a8e add document
chunhan
parents:
diff changeset
  4414
\settoheight{\@IEEEtrantmpdimenB}{\mbox{T}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4415
% set the photo box, give it zero width and height so as not to disturb anything
301f567e2a8e add document
chunhan
parents:
diff changeset
  4416
\noindent\makebox[0pt][l]{\hspace{-\@IEEEBIOhangwidth}\raisebox{\@IEEEtrantmpdimenB}[0pt][0pt]{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4417
\raisebox{-\@IEEEBIOphotodepth}[0pt][0pt]{\@IEEEtempbiographybox}}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4418
% now place the author name and begin the bio text
301f567e2a8e add document
chunhan
parents:
diff changeset
  4419
\noindent\textbf{#2\ }\@IEEEgobbleleadPARNLSP}{\relax\let\par=\@IEEEBIOORGparCMD\par%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4420
% 7/2001 V1.5 detect when the biography text is shorter than the photo area
301f567e2a8e add document
chunhan
parents:
diff changeset
  4421
% and pad the unused area - preventing a collision from the next biography entry
301f567e2a8e add document
chunhan
parents:
diff changeset
  4422
% MDS
301f567e2a8e add document
chunhan
parents:
diff changeset
  4423
\ifnum \prevgraf <\@IEEEtrantmpcountA\relax% detect when the biography text is shorter than the photo
301f567e2a8e add document
chunhan
parents:
diff changeset
  4424
    \advance\@IEEEtrantmpcountA by -\prevgraf% calculate how many lines we need to pad
301f567e2a8e add document
chunhan
parents:
diff changeset
  4425
    \advance\@IEEEtrantmpcountA by -1\relax% we compensate for the fact that we indented an extra line
301f567e2a8e add document
chunhan
parents:
diff changeset
  4426
    \@IEEEtrantmpdimenA=\baselineskip% calculate the length of the padding
301f567e2a8e add document
chunhan
parents:
diff changeset
  4427
    \multiply\@IEEEtrantmpdimenA by \@IEEEtrantmpcountA%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4428
    \noindent\rule{0pt}{\@IEEEtrantmpdimenA}% insert an invisible support strut
301f567e2a8e add document
chunhan
parents:
diff changeset
  4429
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4430
\par\normalfont}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4431
301f567e2a8e add document
chunhan
parents:
diff changeset
  4432
301f567e2a8e add document
chunhan
parents:
diff changeset
  4433
301f567e2a8e add document
chunhan
parents:
diff changeset
  4434
% V1.6
301f567e2a8e add document
chunhan
parents:
diff changeset
  4435
% added biography without a photo environment
301f567e2a8e add document
chunhan
parents:
diff changeset
  4436
\newenvironment{IEEEbiographynophoto}[1]{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4437
% Make an entry into the table of contents only if we have not done so before
301f567e2a8e add document
chunhan
parents:
diff changeset
  4438
\if@IEEEbiographyTOCentrynotmade%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4439
% link labels to the biography counter so hyperref will jump
301f567e2a8e add document
chunhan
parents:
diff changeset
  4440
% to the biography, not the previous section
301f567e2a8e add document
chunhan
parents:
diff changeset
  4441
\setcounter{IEEEbiography}{-1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4442
\refstepcounter{IEEEbiography}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4443
\addcontentsline{toc}{section}{Biographies}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4444
\global\@IEEEbiographyTOCentrynotmadefalse%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4445
\fi%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4446
% one more biography
301f567e2a8e add document
chunhan
parents:
diff changeset
  4447
\refstepcounter{IEEEbiography}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4448
% Make an entry for this name into the table of contents 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4449
\addcontentsline{toc}{subsection}{#1}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4450
\normalfont\@IEEEcompsoconly{\sffamily}\footnotesize\interlinepenalty500%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4451
\vskip 4\baselineskip plus 1fil minus 0\baselineskip%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4452
\parskip=0pt\par%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4453
\noindent\textbf{#1\ }\@IEEEgobbleleadPARNLSP}{\relax\par\normalfont}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4454
301f567e2a8e add document
chunhan
parents:
diff changeset
  4455
301f567e2a8e add document
chunhan
parents:
diff changeset
  4456
% provide the user with some old font commands
301f567e2a8e add document
chunhan
parents:
diff changeset
  4457
% got this from article.cls
301f567e2a8e add document
chunhan
parents:
diff changeset
  4458
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4459
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4460
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4461
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4462
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4463
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4464
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4465
\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4466
\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4467
301f567e2a8e add document
chunhan
parents:
diff changeset
  4468
301f567e2a8e add document
chunhan
parents:
diff changeset
  4469
% SPECIAL PAPER NOTICE COMMANDS
301f567e2a8e add document
chunhan
parents:
diff changeset
  4470
% 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4471
% holds the special notice text
301f567e2a8e add document
chunhan
parents:
diff changeset
  4472
\def\@IEEEspecialpapernotice{\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4473
 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4474
% for special papers, like invited papers, the user can do:
301f567e2a8e add document
chunhan
parents:
diff changeset
  4475
% \IEEEspecialpapernotice{(Invited Paper)} before \maketitle
301f567e2a8e add document
chunhan
parents:
diff changeset
  4476
\def\IEEEspecialpapernotice#1{\ifCLASSOPTIONconference%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4477
\def\@IEEEspecialpapernotice{{\sublargesize\textit{#1}\vspace*{1em}}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4478
\else%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4479
\def\@IEEEspecialpapernotice{{\\*[1.5ex]\sublargesize\textit{#1}}\vspace*{-2ex}}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4480
\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4481
301f567e2a8e add document
chunhan
parents:
diff changeset
  4482
301f567e2a8e add document
chunhan
parents:
diff changeset
  4483
301f567e2a8e add document
chunhan
parents:
diff changeset
  4484
301f567e2a8e add document
chunhan
parents:
diff changeset
  4485
% PUBLISHER ID COMMANDS
301f567e2a8e add document
chunhan
parents:
diff changeset
  4486
% to insert a publisher's ID footer
301f567e2a8e add document
chunhan
parents:
diff changeset
  4487
% V1.6 \IEEEpubid has been changed so that the change in page size and style
301f567e2a8e add document
chunhan
parents:
diff changeset
  4488
% occurs in \maketitle. \IEEEpubid must now be issued prior to \maketitle
301f567e2a8e add document
chunhan
parents:
diff changeset
  4489
% use \IEEEpubidadjcol as before - in the second column of the title page
301f567e2a8e add document
chunhan
parents:
diff changeset
  4490
% These changes allow \maketitle to take the reduced page height into
301f567e2a8e add document
chunhan
parents:
diff changeset
  4491
% consideration when dynamically setting the space between the author 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4492
% names and the maintext.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4493
%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4494
% the amount the main text is pulled up to make room for the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4495
% publisher's ID footer
301f567e2a8e add document
chunhan
parents:
diff changeset
  4496
% IEEE uses about 1.3\baselineskip for journals, 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4497
% dynamic title spacing will clean up the fraction
301f567e2a8e add document
chunhan
parents:
diff changeset
  4498
\def\@IEEEpubidpullup{1.3\baselineskip}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4499
\ifCLASSOPTIONtechnote
301f567e2a8e add document
chunhan
parents:
diff changeset
  4500
% for technotes it must be an integer of baselineskip as there can be no
301f567e2a8e add document
chunhan
parents:
diff changeset
  4501
% dynamic title spacing for two column mode technotes (the title is in the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4502
% in first column) and we should maintain an integer number of lines in the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4503
% second column
301f567e2a8e add document
chunhan
parents:
diff changeset
  4504
% There are some examples (such as older issues of "Transactions on
301f567e2a8e add document
chunhan
parents:
diff changeset
  4505
% Information Theory") in which IEEE really pulls the text off the ID for
301f567e2a8e add document
chunhan
parents:
diff changeset
  4506
% technotes - about 0.55in (or 4\baselineskip). We'll use 2\baselineskip
301f567e2a8e add document
chunhan
parents:
diff changeset
  4507
% and call it even.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4508
\def\@IEEEpubidpullup{2\baselineskip}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4509
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4510
301f567e2a8e add document
chunhan
parents:
diff changeset
  4511
% V1.7 compsoc does not use a pullup
301f567e2a8e add document
chunhan
parents:
diff changeset
  4512
\ifCLASSOPTIONcompsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  4513
\def\@IEEEpubidpullup{0pt}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4514
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4515
301f567e2a8e add document
chunhan
parents:
diff changeset
  4516
% holds the ID text
301f567e2a8e add document
chunhan
parents:
diff changeset
  4517
\def\@IEEEpubid{\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4518
301f567e2a8e add document
chunhan
parents:
diff changeset
  4519
% flag so \maketitle can tell if \IEEEpubid was called
301f567e2a8e add document
chunhan
parents:
diff changeset
  4520
\newif\if@IEEEusingpubid
301f567e2a8e add document
chunhan
parents:
diff changeset
  4521
\global\@IEEEusingpubidfalse
301f567e2a8e add document
chunhan
parents:
diff changeset
  4522
% issue this command in the page to have the ID at the bottom
301f567e2a8e add document
chunhan
parents:
diff changeset
  4523
% V1.6 use before \maketitle
301f567e2a8e add document
chunhan
parents:
diff changeset
  4524
\def\IEEEpubid#1{\def\@IEEEpubid{#1}\global\@IEEEusingpubidtrue}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4525
301f567e2a8e add document
chunhan
parents:
diff changeset
  4526
301f567e2a8e add document
chunhan
parents:
diff changeset
  4527
% command which will pull up (shorten) the column it is executed in
301f567e2a8e add document
chunhan
parents:
diff changeset
  4528
% to make room for the publisher ID. Place in the second column of
301f567e2a8e add document
chunhan
parents:
diff changeset
  4529
% the title page when using \IEEEpubid
301f567e2a8e add document
chunhan
parents:
diff changeset
  4530
% Is smart enough not to do anything when in single column text or
301f567e2a8e add document
chunhan
parents:
diff changeset
  4531
% if the user hasn't called \IEEEpubid
301f567e2a8e add document
chunhan
parents:
diff changeset
  4532
% currently needed in for the second column of a page with the
301f567e2a8e add document
chunhan
parents:
diff changeset
  4533
% publisher ID. If not needed in future releases, please provide this
301f567e2a8e add document
chunhan
parents:
diff changeset
  4534
% command and define it as \relax for backward compatibility
301f567e2a8e add document
chunhan
parents:
diff changeset
  4535
% v1.6b do not allow command to operate if the peer review option has been 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4536
% selected because \IEEEpubidadjcol will not be on the cover page.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4537
% V1.7 do nothing if compsoc
301f567e2a8e add document
chunhan
parents:
diff changeset
  4538
\def\IEEEpubidadjcol{\ifCLASSOPTIONcompsoc\else\ifCLASSOPTIONpeerreview\else
301f567e2a8e add document
chunhan
parents:
diff changeset
  4539
\if@twocolumn\if@IEEEusingpubid\enlargethispage{-\@IEEEpubidpullup}\fi\fi\fi\fi}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4540
301f567e2a8e add document
chunhan
parents:
diff changeset
  4541
% Special thanks to Peter Wilson, Daniel Luecking, and the other
301f567e2a8e add document
chunhan
parents:
diff changeset
  4542
% gurus at comp.text.tex, for helping me to understand how best to
301f567e2a8e add document
chunhan
parents:
diff changeset
  4543
% implement the IEEEpubid command in LaTeX.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4544
301f567e2a8e add document
chunhan
parents:
diff changeset
  4545
301f567e2a8e add document
chunhan
parents:
diff changeset
  4546
301f567e2a8e add document
chunhan
parents:
diff changeset
  4547
%% Lockout some commands under various conditions
301f567e2a8e add document
chunhan
parents:
diff changeset
  4548
301f567e2a8e add document
chunhan
parents:
diff changeset
  4549
% general purpose bit bucket
301f567e2a8e add document
chunhan
parents:
diff changeset
  4550
\newsavebox{\@IEEEtranrubishbin}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4551
301f567e2a8e add document
chunhan
parents:
diff changeset
  4552
% flags to prevent multiple warning messages
301f567e2a8e add document
chunhan
parents:
diff changeset
  4553
\newif\if@IEEEWARNthanks
301f567e2a8e add document
chunhan
parents:
diff changeset
  4554
\newif\if@IEEEWARNIEEEPARstart
301f567e2a8e add document
chunhan
parents:
diff changeset
  4555
\newif\if@IEEEWARNIEEEbiography
301f567e2a8e add document
chunhan
parents:
diff changeset
  4556
\newif\if@IEEEWARNIEEEbiographynophoto
301f567e2a8e add document
chunhan
parents:
diff changeset
  4557
\newif\if@IEEEWARNIEEEpubid
301f567e2a8e add document
chunhan
parents:
diff changeset
  4558
\newif\if@IEEEWARNIEEEpubidadjcol
301f567e2a8e add document
chunhan
parents:
diff changeset
  4559
\newif\if@IEEEWARNIEEEmembership
301f567e2a8e add document
chunhan
parents:
diff changeset
  4560
\newif\if@IEEEWARNIEEEaftertitletext
301f567e2a8e add document
chunhan
parents:
diff changeset
  4561
\@IEEEWARNthankstrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  4562
\@IEEEWARNIEEEPARstarttrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  4563
\@IEEEWARNIEEEbiographytrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  4564
\@IEEEWARNIEEEbiographynophototrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  4565
\@IEEEWARNIEEEpubidtrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  4566
\@IEEEWARNIEEEpubidadjcoltrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  4567
\@IEEEWARNIEEEmembershiptrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  4568
\@IEEEWARNIEEEaftertitletexttrue
301f567e2a8e add document
chunhan
parents:
diff changeset
  4569
301f567e2a8e add document
chunhan
parents:
diff changeset
  4570
301f567e2a8e add document
chunhan
parents:
diff changeset
  4571
%% Lockout some commands when in various modes, but allow them to be restored if needed
301f567e2a8e add document
chunhan
parents:
diff changeset
  4572
%%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4573
% save commands which might be locked out
301f567e2a8e add document
chunhan
parents:
diff changeset
  4574
% so that the user can later restore them if needed
301f567e2a8e add document
chunhan
parents:
diff changeset
  4575
\let\@IEEESAVECMDthanks\thanks
301f567e2a8e add document
chunhan
parents:
diff changeset
  4576
\let\@IEEESAVECMDIEEEPARstart\IEEEPARstart
301f567e2a8e add document
chunhan
parents:
diff changeset
  4577
\let\@IEEESAVECMDIEEEbiography\IEEEbiography
301f567e2a8e add document
chunhan
parents:
diff changeset
  4578
\let\@IEEESAVECMDendIEEEbiography\endIEEEbiography
301f567e2a8e add document
chunhan
parents:
diff changeset
  4579
\let\@IEEESAVECMDIEEEbiographynophoto\IEEEbiographynophoto
301f567e2a8e add document
chunhan
parents:
diff changeset
  4580
\let\@IEEESAVECMDendIEEEbiographynophoto\endIEEEbiographynophoto
301f567e2a8e add document
chunhan
parents:
diff changeset
  4581
\let\@IEEESAVECMDIEEEpubid\IEEEpubid
301f567e2a8e add document
chunhan
parents:
diff changeset
  4582
\let\@IEEESAVECMDIEEEpubidadjcol\IEEEpubidadjcol
301f567e2a8e add document
chunhan
parents:
diff changeset
  4583
\let\@IEEESAVECMDIEEEmembership\IEEEmembership
301f567e2a8e add document
chunhan
parents:
diff changeset
  4584
\let\@IEEESAVECMDIEEEaftertitletext\IEEEaftertitletext
301f567e2a8e add document
chunhan
parents:
diff changeset
  4585
301f567e2a8e add document
chunhan
parents:
diff changeset
  4586
301f567e2a8e add document
chunhan
parents:
diff changeset
  4587
% disable \IEEEPARstart when in draft mode
301f567e2a8e add document
chunhan
parents:
diff changeset
  4588
% This may have originally been done because the pre-V1.6 drop letter
301f567e2a8e add document
chunhan
parents:
diff changeset
  4589
% algorithm had problems with a non-unity baselinestretch
301f567e2a8e add document
chunhan
parents:
diff changeset
  4590
% At any rate, it seems too formal to have a drop letter in a draft
301f567e2a8e add document
chunhan
parents:
diff changeset
  4591
% paper.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4592
\ifCLASSOPTIONdraftcls
301f567e2a8e add document
chunhan
parents:
diff changeset
  4593
\def\IEEEPARstart#1#2{#1#2\if@IEEEWARNIEEEPARstart\typeout{** ATTENTION: \noexpand\IEEEPARstart
301f567e2a8e add document
chunhan
parents:
diff changeset
  4594
 is disabled in draft mode (line \the\inputlineno).}\fi\global\@IEEEWARNIEEEPARstartfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4595
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4596
% and for technotes
301f567e2a8e add document
chunhan
parents:
diff changeset
  4597
\ifCLASSOPTIONtechnote
301f567e2a8e add document
chunhan
parents:
diff changeset
  4598
\def\IEEEPARstart#1#2{#1#2\if@IEEEWARNIEEEPARstart\typeout{** WARNING: \noexpand\IEEEPARstart
301f567e2a8e add document
chunhan
parents:
diff changeset
  4599
 is locked out for technotes (line \the\inputlineno).}\fi\global\@IEEEWARNIEEEPARstartfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4600
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4601
301f567e2a8e add document
chunhan
parents:
diff changeset
  4602
301f567e2a8e add document
chunhan
parents:
diff changeset
  4603
% lockout unneeded commands when in conference mode
301f567e2a8e add document
chunhan
parents:
diff changeset
  4604
\ifCLASSOPTIONconference
301f567e2a8e add document
chunhan
parents:
diff changeset
  4605
% when locked out, \thanks, \IEEEbiography, \IEEEbiographynophoto, \IEEEpubid,
301f567e2a8e add document
chunhan
parents:
diff changeset
  4606
% \IEEEmembership and \IEEEaftertitletext will all swallow their given text. 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4607
% \IEEEPARstart will output a normal character instead
301f567e2a8e add document
chunhan
parents:
diff changeset
  4608
% warn the user about these commands only once to prevent the console screen
301f567e2a8e add document
chunhan
parents:
diff changeset
  4609
% from filling up with redundant messages
301f567e2a8e add document
chunhan
parents:
diff changeset
  4610
\def\thanks#1{\if@IEEEWARNthanks\typeout{** WARNING: \noexpand\thanks
301f567e2a8e add document
chunhan
parents:
diff changeset
  4611
 is locked out when in conference mode (line \the\inputlineno).}\fi\global\@IEEEWARNthanksfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4612
\def\IEEEPARstart#1#2{#1#2\if@IEEEWARNIEEEPARstart\typeout{** WARNING: \noexpand\IEEEPARstart
301f567e2a8e add document
chunhan
parents:
diff changeset
  4613
 is locked out when in conference mode (line \the\inputlineno).}\fi\global\@IEEEWARNIEEEPARstartfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4614
301f567e2a8e add document
chunhan
parents:
diff changeset
  4615
301f567e2a8e add document
chunhan
parents:
diff changeset
  4616
% LaTeX treats environments and commands with optional arguments differently.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4617
% the actual ("internal") command is stored as \\commandname 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4618
% (accessed via \csname\string\commandname\endcsname )
301f567e2a8e add document
chunhan
parents:
diff changeset
  4619
% the "external" command \commandname is a macro with code to determine
301f567e2a8e add document
chunhan
parents:
diff changeset
  4620
% whether or not the optional argument is presented and to provide the 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4621
% default if it is absent. So, in order to save and restore such a command
301f567e2a8e add document
chunhan
parents:
diff changeset
  4622
% we would have to save and restore \\commandname as well. But, if LaTeX
301f567e2a8e add document
chunhan
parents:
diff changeset
  4623
% ever changes the way it names the internal names, the trick would break.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4624
% Instead let us just define a new environment so that the internal
301f567e2a8e add document
chunhan
parents:
diff changeset
  4625
% name can be left undisturbed.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4626
\newenvironment{@IEEEbogusbiography}[2][]{\if@IEEEWARNIEEEbiography\typeout{** WARNING: \noexpand\IEEEbiography
301f567e2a8e add document
chunhan
parents:
diff changeset
  4627
 is locked out when in conference mode (line \the\inputlineno).}\fi\global\@IEEEWARNIEEEbiographyfalse%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4628
\setbox\@IEEEtranrubishbin\vbox\bgroup}{\egroup\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4629
% and make biography point to our bogus biography
301f567e2a8e add document
chunhan
parents:
diff changeset
  4630
\let\IEEEbiography=\@IEEEbogusbiography
301f567e2a8e add document
chunhan
parents:
diff changeset
  4631
\let\endIEEEbiography=\end@IEEEbogusbiography
301f567e2a8e add document
chunhan
parents:
diff changeset
  4632
301f567e2a8e add document
chunhan
parents:
diff changeset
  4633
\renewenvironment{IEEEbiographynophoto}[1]{\if@IEEEWARNIEEEbiographynophoto\typeout{** WARNING: \noexpand\IEEEbiographynophoto
301f567e2a8e add document
chunhan
parents:
diff changeset
  4634
 is locked out when in conference mode (line \the\inputlineno).}\fi\global\@IEEEWARNIEEEbiographynophotofalse%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4635
\setbox\@IEEEtranrubishbin\vbox\bgroup}{\egroup\relax}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4636
301f567e2a8e add document
chunhan
parents:
diff changeset
  4637
\def\IEEEpubid#1{\if@IEEEWARNIEEEpubid\typeout{** WARNING: \noexpand\IEEEpubid 
301f567e2a8e add document
chunhan
parents:
diff changeset
  4638
 is locked out when in conference mode (line \the\inputlineno).}\fi\global\@IEEEWARNIEEEpubidfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4639
\def\IEEEpubidadjcol{\if@IEEEWARNIEEEpubidadjcol\typeout{** WARNING: \noexpand\IEEEpubidadjcol
301f567e2a8e add document
chunhan
parents:
diff changeset
  4640
 is locked out when in conference mode (line \the\inputlineno).}\fi\global\@IEEEWARNIEEEpubidadjcolfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4641
\def\IEEEmembership#1{\if@IEEEWARNIEEEmembership\typeout{** WARNING: \noexpand\IEEEmembership
301f567e2a8e add document
chunhan
parents:
diff changeset
  4642
 is locked out when in conference mode (line \the\inputlineno).}\fi\global\@IEEEWARNIEEEmembershipfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4643
\def\IEEEaftertitletext#1{\if@IEEEWARNIEEEaftertitletext\typeout{** WARNING: \noexpand\IEEEaftertitletext
301f567e2a8e add document
chunhan
parents:
diff changeset
  4644
 is locked out when in conference mode (line \the\inputlineno).}\fi\global\@IEEEWARNIEEEaftertitletextfalse}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4645
\fi
301f567e2a8e add document
chunhan
parents:
diff changeset
  4646
301f567e2a8e add document
chunhan
parents:
diff changeset
  4647
301f567e2a8e add document
chunhan
parents:
diff changeset
  4648
% provide a way to restore the commands that are locked out
301f567e2a8e add document
chunhan
parents:
diff changeset
  4649
\def\IEEEoverridecommandlockouts{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4650
\typeout{** ATTENTION: Overriding command lockouts (line \the\inputlineno).}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4651
\let\thanks\@IEEESAVECMDthanks%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4652
\let\IEEEPARstart\@IEEESAVECMDIEEEPARstart%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4653
\let\IEEEbiography\@IEEESAVECMDIEEEbiography%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4654
\let\endIEEEbiography\@IEEESAVECMDendIEEEbiography%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4655
\let\IEEEbiographynophoto\@IEEESAVECMDIEEEbiographynophoto%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4656
\let\endIEEEbiographynophoto\@IEEESAVECMDendIEEEbiographynophoto%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4657
\let\IEEEpubid\@IEEESAVECMDIEEEpubid%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4658
\let\IEEEpubidadjcol\@IEEESAVECMDIEEEpubidadjcol%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4659
\let\IEEEmembership\@IEEESAVECMDIEEEmembership%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4660
\let\IEEEaftertitletext\@IEEESAVECMDIEEEaftertitletext}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4661
301f567e2a8e add document
chunhan
parents:
diff changeset
  4662
301f567e2a8e add document
chunhan
parents:
diff changeset
  4663
301f567e2a8e add document
chunhan
parents:
diff changeset
  4664
% need a backslash character for typeout output
301f567e2a8e add document
chunhan
parents:
diff changeset
  4665
{\catcode`\|=0 \catcode`\\=12
301f567e2a8e add document
chunhan
parents:
diff changeset
  4666
|xdef|@IEEEbackslash{\}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4667
301f567e2a8e add document
chunhan
parents:
diff changeset
  4668
301f567e2a8e add document
chunhan
parents:
diff changeset
  4669
% hook to allow easy disabling of all legacy warnings
301f567e2a8e add document
chunhan
parents:
diff changeset
  4670
\def\@IEEElegacywarn#1#2{\typeout{** ATTENTION: \@IEEEbackslash #1 is deprecated (line \the\inputlineno).
301f567e2a8e add document
chunhan
parents:
diff changeset
  4671
Use \@IEEEbackslash #2 instead.}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4672
301f567e2a8e add document
chunhan
parents:
diff changeset
  4673
301f567e2a8e add document
chunhan
parents:
diff changeset
  4674
% provide for legacy commands
301f567e2a8e add document
chunhan
parents:
diff changeset
  4675
\def\authorblockA{\@IEEElegacywarn{authorblockA}{IEEEauthorblockA}\IEEEauthorblockA}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4676
\def\authorblockN{\@IEEElegacywarn{authorblockN}{IEEEauthorblockN}\IEEEauthorblockN}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4677
\def\authorrefmark{\@IEEElegacywarn{authorrefmark}{IEEEauthorrefmark}\IEEEauthorrefmark}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4678
\def\PARstart{\@IEEElegacywarn{PARstart}{IEEEPARstart}\IEEEPARstart}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4679
\def\pubid{\@IEEElegacywarn{pubid}{IEEEpubid}\IEEEpubid}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4680
\def\pubidadjcol{\@IEEElegacywarn{pubidadjcol}{IEEEpubidadjcol}\IEEEpubidadjcol}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4681
\def\QED{\@IEEElegacywarn{QED}{IEEEQED}\IEEEQED}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4682
\def\QEDclosed{\@IEEElegacywarn{QEDclosed}{IEEEQEDclosed}\IEEEQEDclosed}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4683
\def\QEDopen{\@IEEElegacywarn{QEDopen}{IEEEQEDopen}\IEEEQEDopen}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4684
\def\specialpapernotice{\@IEEElegacywarn{specialpapernotice}{IEEEspecialpapernotice}\IEEEspecialpapernotice}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4685
301f567e2a8e add document
chunhan
parents:
diff changeset
  4686
301f567e2a8e add document
chunhan
parents:
diff changeset
  4687
301f567e2a8e add document
chunhan
parents:
diff changeset
  4688
% provide for legacy environments
301f567e2a8e add document
chunhan
parents:
diff changeset
  4689
\def\biography{\@IEEElegacywarn{biography}{IEEEbiography}\IEEEbiography}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4690
\def\biographynophoto{\@IEEElegacywarn{biographynophoto}{IEEEbiographynophoto}\IEEEbiographynophoto}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4691
\def\keywords{\@IEEElegacywarn{keywords}{IEEEkeywords}\IEEEkeywords}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4692
\def\endbiography{\endIEEEbiography}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4693
\def\endbiographynophoto{\endIEEEbiographynophoto}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4694
\def\endkeywords{\endIEEEkeywords}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4695
301f567e2a8e add document
chunhan
parents:
diff changeset
  4696
301f567e2a8e add document
chunhan
parents:
diff changeset
  4697
% provide for legacy IED commands/lengths when possible
301f567e2a8e add document
chunhan
parents:
diff changeset
  4698
\let\labelindent\IEEElabelindent
301f567e2a8e add document
chunhan
parents:
diff changeset
  4699
\def\calcleftmargin{\@IEEElegacywarn{calcleftmargin}{IEEEcalcleftmargin}\IEEEcalcleftmargin}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4700
\def\setlabelwidth{\@IEEElegacywarn{setlabelwidth}{IEEEsetlabelwidth}\IEEEsetlabelwidth}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4701
\def\usemathlabelsep{\@IEEElegacywarn{usemathlabelsep}{IEEEusemathlabelsep}\IEEEusemathlabelsep}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4702
\def\iedlabeljustifyc{\@IEEElegacywarn{iedlabeljustifyc}{IEEEiedlabeljustifyc}\IEEEiedlabeljustifyc}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4703
\def\iedlabeljustifyl{\@IEEElegacywarn{iedlabeljustifyl}{IEEEiedlabeljustifyl}\IEEEiedlabeljustifyl}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4704
\def\iedlabeljustifyr{\@IEEElegacywarn{iedlabeljustifyr}{IEEEiedlabeljustifyr}\IEEEiedlabeljustifyr}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4705
301f567e2a8e add document
chunhan
parents:
diff changeset
  4706
301f567e2a8e add document
chunhan
parents:
diff changeset
  4707
301f567e2a8e add document
chunhan
parents:
diff changeset
  4708
% let \proof use the IEEEtran version even after amsthm is loaded
301f567e2a8e add document
chunhan
parents:
diff changeset
  4709
% \proof is now deprecated in favor of \IEEEproof
301f567e2a8e add document
chunhan
parents:
diff changeset
  4710
\AtBeginDocument{\def\proof{\@IEEElegacywarn{proof}{IEEEproof}\IEEEproof}\def\endproof{\endIEEEproof}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4711
301f567e2a8e add document
chunhan
parents:
diff changeset
  4712
% V1.7 \overrideIEEEmargins is no longer supported.
301f567e2a8e add document
chunhan
parents:
diff changeset
  4713
\def\overrideIEEEmargins{%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4714
\typeout{** WARNING: \string\overrideIEEEmargins \space no longer supported (line \the\inputlineno).}%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4715
\typeout{** Use the \string\CLASSINPUTinnersidemargin, \string\CLASSINPUToutersidemargin \space controls instead.}}
301f567e2a8e add document
chunhan
parents:
diff changeset
  4716
301f567e2a8e add document
chunhan
parents:
diff changeset
  4717
301f567e2a8e add document
chunhan
parents:
diff changeset
  4718
\endinput
301f567e2a8e add document
chunhan
parents:
diff changeset
  4719
301f567e2a8e add document
chunhan
parents:
diff changeset
  4720
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% End of IEEEtran.cls  %%%%%%%%%%%%%%%%%%%%%%%%%%%%
301f567e2a8e add document
chunhan
parents:
diff changeset
  4721
% That's all folks!
301f567e2a8e add document
chunhan
parents:
diff changeset
  4722