718
% V1.8a compsoc font sizes
719
% compsoc font sizes use bp "Postscript" point units (1/72in)
720
% rather than the traditional pt (1/72.27)
721
\ifCLASSOPTIONcompsoc
722
% -- compsoc defaults --
723
% ** will override some of these values later **
725
\ifx\CLASSOPTIONpt\@IEEEptsizenine
726
\def\normalsize{\@setfontsize{\normalsize}{9bp}{11bp}}
727
\setlength{\@IEEEnormalsizeunitybaselineskip}{11bp}
729
\abovedisplayskip 1.5ex plus 3bp minus 1bp
730
\belowdisplayskip \abovedisplayskip
731
\abovedisplayshortskip 0bp plus 3bp
732
\belowdisplayshortskip 1.5ex plus 3bp minus 1bp
733
\def\small{\@setfontsize{\small}{8.5bp}{10bp}}
734
\def\footnotesize{\@setfontsize{\footnotesize}{8bp}{9bp}}
735
\def\scriptsize{\@setfontsize{\scriptsize}{7bp}{8bp}}
736
\def\tiny{\@setfontsize{\tiny}{5bp}{6bp}}
737
% sublargesize is the same as large - 10bp
738
\def\sublargesize{\@setfontsize{\sublargesize}{10bp}{12bp}}
739
\def\large{\@setfontsize{\large}{10bp}{12bp}}
740
\def\Large{\@setfontsize{\Large}{12bp}{14bp}}
741
\def\LARGE{\@setfontsize{\LARGE}{14bp}{17bp}}
742
\def\huge{\@setfontsize{\huge}{17bp}{20bp}}
743
\def\Huge{\@setfontsize{\Huge}{20bp}{24bp}}
747
\ifx\CLASSOPTIONpt\@IEEEptsizeten
748
\def\normalsize{\@setfontsize{\normalsize}{10bp}{12bp}}
749
\setlength{\@IEEEnormalsizeunitybaselineskip}{12bp}
751
\abovedisplayskip 1.5ex plus 4bp minus 2bp
752
\belowdisplayskip \abovedisplayskip
753
\abovedisplayshortskip 0pt plus 4bp
754
\belowdisplayshortskip 1.5ex plus 4bp minus 2bp
755
\def\small{\@setfontsize{\small}{9bp}{10bp}}
756
\def\footnotesize{\@setfontsize{\footnotesize}{8bp}{9bp}}
757
\def\scriptsize{\@setfontsize{\scriptsize}{7bp}{8bp}}
758
\def\tiny{\@setfontsize{\tiny}{5bp}{6bp}}
759
% sublargesize is a tad smaller than large - 11bp
760
\def\sublargesize{\@setfontsize{\sublargesize}{11bp}{13.5bp}}
761
\def\large{\@setfontsize{\large}{12bp}{14bp}}
762
\def\Large{\@setfontsize{\Large}{14bp}{17bp}}
763
\def\LARGE{\@setfontsize{\LARGE}{17bp}{20bp}}
764
\def\huge{\@setfontsize{\huge}{20bp}{24bp}}
765
\def\Huge{\@setfontsize{\Huge}{24bp}{28bp}}
769
\ifx\CLASSOPTIONpt\@IEEEptsizeeleven
770
\def\normalsize{\@setfontsize{\normalsize}{11bp}{13.5bp}}
771
\setlength{\@IEEEnormalsizeunitybaselineskip}{13.5bp}
773
\abovedisplayskip 1.5ex plus 5bp minus 3bp
774
\belowdisplayskip \abovedisplayskip
775
\abovedisplayshortskip 0pt plus 5bp
776
\belowdisplayshortskip 1.5ex plus 5bp minus 3bp
777
\def\small{\@setfontsize{\small}{10bp}{12bp}}
778
\def\footnotesize{\@setfontsize{\footnotesize}{9bp}{10.5bp}}
779
\def\scriptsize{\@setfontsize{\scriptsize}{8bp}{9bp}}
780
\def\tiny{\@setfontsize{\tiny}{6bp}{7bp}}
781
% sublargesize is the same as large - 12bp
782
\def\sublargesize{\@setfontsize{\sublargesize}{12bp}{14bp}}
783
\def\large{\@setfontsize{\large}{12bp}{14bp}}
784
\def\Large{\@setfontsize{\Large}{14bp}{17bp}}
785
\def\LARGE{\@setfontsize{\LARGE}{17bp}{20bp}}
786
\def\huge{\@setfontsize{\huge}{20bp}{24bp}}
787
\def\Huge{\@setfontsize{\Huge}{24bp}{28bp}}
791
\ifx\CLASSOPTIONpt\@IEEEptsizetwelve
792
\def\normalsize{\@setfontsize{\normalsize}{12bp}{14bp}}%
793
\setlength{\@IEEEnormalsizeunitybaselineskip}{14bp}%
795
\abovedisplayskip 1.5ex plus 6bp minus 4bp
796
\belowdisplayskip \abovedisplayskip
797
\abovedisplayshortskip 0pt plus 6bp
798
\belowdisplayshortskip 1.5ex plus 6bp minus 4bp
799
\def\small{\@setfontsize{\small}{10bp}{12bp}}
800
\def\footnotesize{\@setfontsize{\footnotesize}{9bp}{10.5bp}}
801
\def\scriptsize{\@setfontsize{\scriptsize}{8bp}{9bp}}
802
\def\tiny{\@setfontsize{\tiny}{6bp}{7bp}}
803
% sublargesize is the same as large - 14bp
804
\def\sublargesize{\@setfontsize{\sublargesize}{14bp}{17bp}}
805
\def\large{\@setfontsize{\large}{14bp}{17bp}}
806
\def\Large{\@setfontsize{\Large}{17bp}{20bp}}
807
\def\LARGE{\@setfontsize{\LARGE}{20bp}{24bp}}
808
\def\huge{\@setfontsize{\huge}{22bp}{26bp}}
809
\def\Huge{\@setfontsize{\Huge}{24bp}{28bp}}
812
% -- override defaults: compsoc journals use special normalsizes --
813
\ifCLASSOPTIONconference
815
% compsoc conferences
817
\ifx\CLASSOPTIONpt\@IEEEptsizenine
818
\def\normalsize{\@setfontsize{\normalsize}{9bp}{10.8bp}}
819
\setlength{\@IEEEnormalsizeunitybaselineskip}{10.8bp}
821
\abovedisplayskip 1.5ex plus 3bp minus 1bp
822
\belowdisplayskip \abovedisplayskip
823
\abovedisplayshortskip 0bp plus 3bp
824
\belowdisplayshortskip 1.5ex plus 3bp minus 1bp
827
\ifx\CLASSOPTIONpt\@IEEEptsizeten
828
\def\normalsize{\@setfontsize{\normalsize}{10bp}{11.2bp}}
829
\setlength{\@IEEEnormalsizeunitybaselineskip}{11.2bp}
831
\abovedisplayskip 1.5ex plus 4bp minus 2bp
832
\belowdisplayskip \abovedisplayskip
833
\abovedisplayshortskip 0pt plus 4bp
834
\belowdisplayshortskip 1.5ex plus 4bp minus 2bp
837
\ifx\CLASSOPTIONpt\@IEEEptsizeeleven
838
\def\normalsize{\@setfontsize{\normalsize}{11bp}{13.2bp}}
839
\setlength{\@IEEEnormalsizeunitybaselineskip}{13.2bp}
841
\abovedisplayskip 1.5ex plus 5bp minus 3bp
842
\belowdisplayskip \abovedisplayskip
843
\abovedisplayshortskip 0pt plus 5bp
844
\belowdisplayshortskip 1.5ex plus 5bp minus 3bp
847
\ifx\CLASSOPTIONpt\@IEEEptsizetwelve
848
\def\normalsize{\@setfontsize{\normalsize}{12bp}{14.4bp}}
849
\setlength{\@IEEEnormalsizeunitybaselineskip}{14.4bp}
851
\abovedisplayskip 1.5ex plus 6bp minus 4bp
852
\belowdisplayskip \abovedisplayskip
853
\abovedisplayshortskip 0pt plus 6bp
854
\belowdisplayshortskip 1.5ex plus 6bp minus 4bp
857
% compsoc nonconferences
860
\ifx\CLASSOPTIONpt\@IEEEptsizenine
861
\def\normalsize{\@setfontsize{\normalsize}{9bp}{10.8bp}}
862
\setlength{\@IEEEnormalsizeunitybaselineskip}{10.8bp}
864
\abovedisplayskip 1.5ex plus 3bp minus 1bp
865
\belowdisplayskip \abovedisplayskip
866
\abovedisplayshortskip 0bp plus 3bp
867
\belowdisplayshortskip 1.5ex plus 3bp minus 1bp
870
\ifx\CLASSOPTIONpt\@IEEEptsizeten
871
% the official spec is 9.5bp with 11.4bp leading for 10pt,
872
% but measurements of proofs suggest upto 11.723bp leading
873
% here we'll use 11.54bp which gives 61 lines per column
874
% with the standard compsoc margins
875
\def\normalsize{\@setfontsize{\normalsize}{9.5bp}{11.54bp}}
876
\setlength{\@IEEEnormalsizeunitybaselineskip}{11.54bp}
878
\abovedisplayskip 1.5ex plus 4bp minus 2bp
879
\belowdisplayskip \abovedisplayskip
880
\abovedisplayshortskip 0pt plus 4bp
881
\belowdisplayshortskip 1.5ex plus 4bp minus 2bp
884
\ifx\CLASSOPTIONpt\@IEEEptsizeeleven
885
\def\normalsize{\@setfontsize{\normalsize}{11bp}{13.2bp}}
886
\setlength{\@IEEEnormalsizeunitybaselineskip}{13.2bp}
888
\abovedisplayskip 1.5ex plus 5bp minus 3bp
889
\belowdisplayskip \abovedisplayskip
890
\abovedisplayshortskip 0pt plus 5bp
891
\belowdisplayshortskip 1.5ex plus 5bp minus 3bp
894
\ifx\CLASSOPTIONpt\@IEEEptsizetwelve
895
\def\normalsize{\@setfontsize{\normalsize}{12bp}{14.4bp}}
896
\setlength{\@IEEEnormalsizeunitybaselineskip}{14.4bp}
898
\abovedisplayskip 1.5ex plus 6bp minus 4bp
899
\belowdisplayskip \abovedisplayskip
900
\abovedisplayshortskip 0pt plus 6bp
901
\belowdisplayshortskip 1.5ex plus 6bp minus 4bp
563
908
% V1.6 The Computer Modern Fonts will issue a substitution warning for
564
% 24pt titles (24.88pt is used instead) increase the substitution
565
% tolerance to turn off this warning
566
\def\fontsubfuzz{.9pt}
567
% However, the default (and correct) Times font will scale exactly as needed.
909
% 24pt titles (24.88pt is used instead, but the default and correct
910
% Times font will scale exactly as needed) increase the substitution
911
% tolerance to turn off this warning.
913
% V1.8a, the compsoc bp font sizes can also cause bogus font substitution
914
% warnings with footnote or scriptsize math and the $\bullet$ itemized
915
% list of \IEEEcompsocitemizethanks. So, increase this to 1.5pt or more.
916
\def\fontsubfuzz{1.7bp}
570
919
% warn the user in case they forget to use the 9pt option with
1100
% -- V1.8a page setup commands --
1102
% The default sample text for calculating margins
1103
% Note that IEEE publications use \scriptsize for headers and footers.
1104
\def\IEEEdefaultsampletext{\normalfont\normalsize gT}
1105
\def\IEEEdefaultheadersampletext{\normalfont\scriptsize T}% IEEE headers default to uppercase
1106
\def\IEEEdefaultfootersampletext{\normalfont\scriptsize gT}
1110
% usage: \IEEEsettextwidth{inner margin}{outer margin}
1111
% Sets \textwidth to allow the specified inner and outer margins
1112
% for the current \paperwidth.
1113
\def\IEEEsettextwidth#1#2{\@IEEEtrantmpdimenA\paperwidth
1114
\@IEEEtrantmpdimenB#1\relax
1115
\advance\@IEEEtrantmpdimenA by -\@IEEEtrantmpdimenB
1116
\@IEEEtrantmpdimenB#2\relax
1117
\advance\@IEEEtrantmpdimenA by -\@IEEEtrantmpdimenB
1118
\textwidth\@IEEEtrantmpdimenA}
1122
% usage: \IEEEsetsidemargin{mode: i, o, c, a}{margin/offset}
1123
% Sets \oddsidemargin and \evensidemargin to yield the specified margin
1124
% of the given mode.
1125
% The available modes are:
1128
% c = centered, with the given offset
1129
% a = adjust the margins using the given offset
1130
% For the offsets, positive values increase the inner margin.
1131
% \textwidth should be set properly for the given margins before calling this
1133
\def\IEEEsetsidemargin#1#2{\@IEEEtrantmpdimenA #2\relax
1134
\@IEEEextracttoken{#1}\relax
1135
% check for mode errors
1136
\ifx\@IEEEextractedtokenmacro\@empty
1137
\@IEEEclspkgerror{Empty mode type in \string\IEEEsetsidemargin\space (line \the\inputlineno).\MessageBreak
1138
Defaulting to `i'}{Valid modes for \string\IEEEsetsidemargin\space are: i, o, c and a.}\relax
1139
\let\@IEEEextractedtoken=i\relax
1140
\def\@IEEEextractedtokenmacro{i}\relax
1142
\ifx\@IEEEextractedtokensdiscarded\@empty\else
1143
\typeout{** WARNING: \string\IEEEsetsidemargin\space mode specifiers after the first in `\@IEEEextracttokenarg' ignored (line \the\inputlineno).}\relax
1147
\if\@IEEEextractedtoken a\relax
1148
\advance\oddsidemargin by \@IEEEtrantmpdimenA\relax
1150
\if\@IEEEextractedtoken c\relax
1151
\oddsidemargin\paperwidth
1152
\advance\oddsidemargin by -\textwidth
1153
\divide\oddsidemargin by 2\relax
1154
\advance\oddsidemargin by -1in\relax
1155
\advance\oddsidemargin by \@IEEEtrantmpdimenA\relax
1157
\if\@IEEEextractedtoken o\relax
1158
\oddsidemargin\paperwidth
1159
\advance\oddsidemargin by -\textwidth
1160
\advance\oddsidemargin by -\@IEEEtrantmpdimenA
1161
\advance\oddsidemargin by -1in\relax
1163
\if\@IEEEextractedtoken i\relax
1165
\@IEEEclspkgerror{Unknown mode type `\@IEEEextractedtokenmacro' in \string\IEEEsetsidemargin\space (line \the\inputlineno).\MessageBreak
1167
{Valid modes for \string\IEEEsetsidemargin\space are: i, o, c and a.}%
1169
\oddsidemargin\@IEEEtrantmpdimenA
1170
\advance\oddsidemargin by -1in\relax
1172
% odd and even side margins both mean "inner" for single sided pages
1173
\evensidemargin\oddsidemargin
1174
% but are mirrors of each other when twosided is in effect
1176
\evensidemargin\paperwidth
1177
\advance\evensidemargin by -\textwidth
1178
\advance\evensidemargin by -\oddsidemargin
1179
% have to compensate for both the builtin 1in LaTex offset
1180
% and the fact we already subtracted this offset from \oddsidemargin
1181
\advance\evensidemargin -2in\relax
1186
% usage: \IEEEsettextheight[sample text]{top text margin}{bottom text margin}
1187
% Sets \textheight based on the specified top margin and bottom margin.
1188
% Takes into consideration \paperheight, \topskip, and (by default) the
1189
% the actual height and depth of the \IEEEdefaultsampletext text.
1190
\def\IEEEsettextheight{\@ifnextchar [{\@IEEEsettextheight}{\@IEEEsettextheight[\IEEEdefaultsampletext]}}
1191
\def\@IEEEsettextheight[#1]#2#3{\textheight\paperheight\relax
1192
\@IEEEtrantmpdimenA #2\relax
1193
\advance \textheight by -\@IEEEtrantmpdimenA% subtract top margin
1194
\@IEEEtrantmpdimenA #3\relax
1195
\advance \textheight by -\@IEEEtrantmpdimenA% subtract bottom margin
1196
\advance \textheight by \topskip% add \topskip
1197
% subtract off everything above the top, and below the bottom, baselines
1198
\settoheight{\@IEEEtrantmpdimenA}{\begingroup #1\relax\relax\relax\endgroup}\relax
1199
\advance \textheight by -\@IEEEtrantmpdimenA
1200
\settodepth{\@IEEEtrantmpdimenA}{\begingroup #1\relax\relax\relax\endgroup}\relax
1201
\advance \textheight by -\@IEEEtrantmpdimenA}
1205
\newdimen\IEEEquantizedlength
1206
\IEEEquantizedlength 0sp\relax
1207
\newdimen\IEEEquantizedlengthdiff
1208
\IEEEquantizedlengthdiff 0sp\relax
1209
\def\IEEEquantizedlengthint{0}
1211
% usage: \IEEEquantizelength{mode: d, c, i}{base unit}{length}
1212
% Sets the length \IEEEquantizedlength to be an integer multiple of the given
1213
% (nonzero) base unit such that \IEEEquantizedlength approximates the given
1215
% \IEEEquantizedlengthdiff is a length equal to the difference between the
1216
% \IEEEquantizedlength and the given length.
1217
% \IEEEquantizedlengthint is a macro containing the integer number of base units
1218
% in \IEEEquantizedlength.
1219
% i.e., \IEEEquantizedlength = \IEEEquantizedlengthint * base unit
1220
% The mode determines how \IEEEquantizedlength is quantized:
1221
% d = always decrease (always round down \IEEEquantizeint)
1222
% c = use the closest match
1223
% i = always increase (always round up \IEEEquantizeint)
1224
% In anycase, if the given length is already quantized,
1225
% \IEEEquantizedlengthdiff will be set to zero.
1226
\def\IEEEquantizelength#1#2#3{\begingroup
1227
% work in isolation so as not to externally disturb the \@IEEEtrantmp
1229
% load the argument values indirectly via \IEEEquantizedlengthdiff
1230
% in case the user refers to our \@IEEEtrantmpdimenX, \IEEEquantizedlength,
1231
% etc. in the arguments. we also will work with these as counters,
1233
% A has the base unit
1234
\IEEEquantizedlengthdiff #2\relax\relax\relax\relax
1235
\@IEEEtrantmpcountA\IEEEquantizedlengthdiff
1236
% B has the input length
1237
\IEEEquantizedlengthdiff #3\relax\relax\relax\relax
1238
\@IEEEtrantmpcountB\IEEEquantizedlengthdiff
1239
\@IEEEtrantmpdimenA\the\@IEEEtrantmpcountA sp\relax
1240
\@IEEEtrantmpdimenB\the\@IEEEtrantmpcountB sp\relax
1241
% \@IEEEtrantmpcountC will have the quantized int
1242
% \IEEEquantizedlength will have the quantized length
1243
% \@IEEEtrantmpdimenC will have the quantized diff
1244
% initialize them to zero as this is what will be
1245
% exported if an error occurs
1246
\@IEEEtrantmpcountC 0\relax
1247
\IEEEquantizedlength 0sp\relax
1248
\@IEEEtrantmpdimenC 0sp\relax
1250
\@IEEEextracttoken{#1}\relax
1251
% check for mode errors
1252
\ifx\@IEEEextractedtokenmacro\@empty
1253
\@IEEEclspkgerror{Empty mode type in \string\IEEEquantizelength\space (line \the\inputlineno).\MessageBreak
1254
Defaulting to `d'}{Valid modes for \string\IEEEquantizelength\space are: d, c and i.}\relax
1255
\let\@IEEEextractedtoken=d\relax
1256
\def\@IEEEextractedtokenmacro{d}\relax
1258
\ifx\@IEEEextractedtokensdiscarded\@empty\else
1259
\typeout{** WARNING: \string\IEEEquantizelength\space mode specifiers after the first in `\@IEEEextracttokenarg' ignored (line \the\inputlineno).}\relax
1262
% check for base unit is zero error
1263
\ifnum\@IEEEtrantmpcountA=0\relax
1264
\@IEEEclspkgerror{Base unit is zero in \string\IEEEquantizelength\space (line \the\inputlineno).\MessageBreak
1265
\string\IEEEquantizedlength\space and \string\IEEEquantizedlengthdiff\space are set to zero}{Division by zero is not allowed.}\relax
1266
\else% base unit is nonzero
1267
% \@IEEEtrantmpcountC carries the number of integer units
1268
% in the quantized length (integer length \ base)
1269
\@IEEEtrantmpcountC\@IEEEtrantmpcountB\relax
1270
\divide\@IEEEtrantmpcountC by \@IEEEtrantmpcountA\relax
1271
% \IEEEquantizedlength has the (rounded down) quantized length
1273
\IEEEquantizedlength\@IEEEtrantmpdimenA\relax
1274
\multiply\IEEEquantizedlength by \@IEEEtrantmpcountC\relax
1275
% \@IEEEtrantmpdimenC has the difference
1276
% = quantized length - length
1277
\@IEEEtrantmpdimenC\IEEEquantizedlength\relax
1278
\advance\@IEEEtrantmpdimenC by -\@IEEEtrantmpdimenB\relax
1279
% trap special case of length being already quantized
1280
% to avoid a roundup under i option
1281
\ifdim\@IEEEtrantmpdimenC=0sp\relax
1282
\else % length not is already quantized
1283
% set dimenA to carry the upper quantized (absolute value) difference:
1284
% quantizedlength + base - length
1285
\advance\@IEEEtrantmpdimenA by \IEEEquantizedlength\relax
1286
\advance\@IEEEtrantmpdimenA by -\@IEEEtrantmpdimenB\relax
1287
% set dimenB to carry the lower quantized (absolute value) difference:
1288
% length - quantizedlength
1289
\advance\@IEEEtrantmpdimenB by -\IEEEquantizedlength\relax
1291
\if\@IEEEextractedtoken c\relax
1292
% compare upper and lower amounts, select upper if lower > upper
1293
\ifdim\@IEEEtrantmpdimenB>\@IEEEtrantmpdimenA\relax
1295
\advance\IEEEquantizedlength by \the\@IEEEtrantmpcountA sp\relax
1296
\advance\@IEEEtrantmpcountC by 1\relax
1297
\@IEEEtrantmpdimenC\@IEEEtrantmpdimenA
1299
% no need to do anything for lower, use output values already setup
1302
\if\@IEEEextractedtoken i\relax
1303
% always round up under i mode
1304
\advance\IEEEquantizedlength by \the\@IEEEtrantmpcountA sp\relax
1305
\advance\@IEEEtrantmpcountC by 1\relax
1306
\@IEEEtrantmpdimenC\@IEEEtrantmpdimenA
1308
\if\@IEEEextractedtoken d\relax
1310
\@IEEEclspkgerror{Unknown mode type `\@IEEEextractedtokenmacro' in \string\IEEEquantizelength\space (line \the\inputlineno).\MessageBreak
1312
{Valid modes for \string\IEEEquantizelength\space are: d, c, and i.}\relax
1314
% no need to do anything for d, use output values already setup
1316
\fi % if length is already quantized
1317
\fi% if base unit is zero
1318
% globally assign the results to macros we use here to escape the enclosing
1319
% group without needing to call \global on any of the \@IEEEtrantmp variables.
1320
% \@IEEEtrantmpcountC has the quantized int
1321
% \IEEEquantizedlength has the quantized length
1322
% \@IEEEtrantmpdimenC has the quantized diff
1323
\xdef\@IEEEquantizedlengthintmacro{\the\@IEEEtrantmpcountC}\relax
1324
\@IEEEtrantmpcountC\IEEEquantizedlength\relax
1325
\xdef\@IEEEquantizedlengthmacro{\the\@IEEEtrantmpcountC}\relax
1326
\@IEEEtrantmpcountC\@IEEEtrantmpdimenC\relax
1327
\xdef\@IEEEquantizedlengthdiffmacro{\the\@IEEEtrantmpcountC}\relax
1329
% locally assign the outputs here from the macros
1330
\expandafter\IEEEquantizedlength\@IEEEquantizedlengthmacro sp\relax
1331
\expandafter\IEEEquantizedlengthdiff\@IEEEquantizedlengthdiffmacro sp\relax
1332
\edef\IEEEquantizedlengthint{\@IEEEquantizedlengthintmacro}\relax}
1336
\newdimen\IEEEquantizedtextheightdiff
1337
\IEEEquantizedtextheightdiff 0sp\relax
1339
% usage: \IEEEquantizetextheight[base unit]{mode: d, c, i}
1340
% Sets \textheight to be an integer multiple of the current \baselineskip
1341
% (or the optionally specified base unit) plus the first (\topskip) line.
1342
% \IEEEquantizedtextheightdiff is a length equal to the difference between
1343
% the new quantized and original \textheight.
1344
% \IEEEquantizedtextheightlpc is a macro containing the integer number of
1345
% lines per column under the quantized \textheight. i.e.,
1346
% \textheight = \IEEEquantizedtextheightlpc * \baselineskip + \topskip
1347
% The mode determines how \textheight is quantized:
1348
% d = always decrease (always round down the number of lines per column)
1349
% c = use the closest match
1350
% i = always increase (always round up the number of lines per column)
1351
% In anycase, if \textheight is already quantized, it will remain unchanged,
1352
% and \IEEEquantizedtextheightdiff will be set to zero.
1353
% Depends on: \IEEEquantizelength
1354
\def\IEEEquantizetextheight{\@ifnextchar [{\@IEEEquantizetextheight}{\@IEEEquantizetextheight[\baselineskip]}}
1355
\def\@IEEEquantizetextheight[#1]#2{\begingroup
1356
% use our \IEEEquantizedtextheightdiff as a scratch pad
1357
% we need to subtract off \topskip before quantization
1358
\IEEEquantizedtextheightdiff\textheight
1359
\advance\IEEEquantizedtextheightdiff by -\topskip\relax
1360
\IEEEquantizelength{#2}{#1}{\IEEEquantizedtextheightdiff}
1361
% add back \topskip line
1362
\advance\IEEEquantizedlength by \topskip
1363
\@IEEEtrantmpcountC\IEEEquantizedlengthint\relax
1364
\advance\@IEEEtrantmpcountC by 1\relax
1365
% globally assign the results to macros we use here to escape the enclosing
1366
% group without needing to call \global on any of the \@IEEEtrantmp variables.
1367
\xdef\@IEEEquantizedtextheightlpcmacro{\the\@IEEEtrantmpcountC}\relax
1368
\@IEEEtrantmpcountC\IEEEquantizedlength\relax
1369
\xdef\@IEEEquantizedtextheightmacro{\the\@IEEEtrantmpcountC}\relax
1370
\@IEEEtrantmpcountC\IEEEquantizedlengthdiff\relax
1371
\xdef\@IEEEquantizedtextheightdiffmacro{\the\@IEEEtrantmpcountC}\relax
1373
% locally assign the outputs here from the macros
1374
\textheight\@IEEEquantizedtextheightmacro sp\relax
1375
\IEEEquantizedtextheightdiff\@IEEEquantizedtextheightdiffmacro sp\relax
1376
\edef\IEEEquantizedtextheightlpc{\@IEEEquantizedtextheightlpcmacro}}
1380
% usage: \IEEEsettopmargin[sample text]{mode: t, b, c, a, q}{margin/offset}
1381
% Sets \topmargin based on the specified vertical margin.
1382
% Takes into consideration the base 1in offset, \headheight, \headsep,
1383
% \topskip, and (by default) the the actual height (or, for the bottom, depth)
1384
% of the \IEEEdefaultsampletext text.
1385
% The available modes are:
1388
% c = vertically centered, with the given offset
1389
% a = adjust the vertical margins using the given offset
1390
% q = adjust the margins using \IEEEquantizedtextheightdiff and the given offset
1391
% For the offsets, positive values increase the top margin.
1392
% \headheight, \headsep, \topskip and \textheight should be set properly for the
1393
% given margins before calling this function.
1394
\def\IEEEsettopmargin{\@ifnextchar [{\@IEEEsettopmargin}{\@IEEEsettopmargin[\IEEEdefaultsampletext]}}
1395
\def\@IEEEsettopmargin[#1]#2#3{\@IEEEtrantmpdimenA #3\relax
1396
\@IEEEextracttoken{#2}\relax
1397
% check for mode errors
1398
\ifx\@IEEEextractedtokenmacro\@empty
1399
\@IEEEclspkgerror{Empty mode type in \string\IEEEsettopmargin\space (line \the\inputlineno).\MessageBreak
1400
Defaulting to `t'}{Valid modes for \string\IEEEsettopmargin\space are: t, b, c, a and q.}\relax
1401
\let\@IEEEextractedtoken=t\relax
1402
\def\@IEEEextractedtokenmacro{t}\relax
1404
\ifx\@IEEEextractedtokensdiscarded\@empty\else
1405
\typeout{** WARNING: \string\IEEEsettopmargin\space mode specifiers after the first in `\@IEEEextracttokenarg' ignored (line \the\inputlineno).}\relax
1409
\if\@IEEEextractedtoken a\relax
1410
\advance\topmargin by \@IEEEtrantmpdimenA\relax
1412
\if\@IEEEextractedtoken q\relax
1413
% we need to adjust by half the \IEEEquantizedtextheightdiff value
1414
\@IEEEtrantmpdimenB\IEEEquantizedtextheightdiff\relax
1415
\divide\@IEEEtrantmpdimenB by 2\relax
1416
% a positive \IEEEquantizedtextheightdiff means we need to reduce \topmargin
1417
% because \textheight has been lenghtened
1418
\advance\topmargin by -\@IEEEtrantmpdimenB\relax
1419
\advance\topmargin by \@IEEEtrantmpdimenA\relax
1421
\if\@IEEEextractedtoken c\relax
1422
\topmargin\paperheight
1423
\advance\topmargin by -\textheight
1424
% \textheight includes \topskip, but we should not count topskip whitespace here, backout
1425
\advance \topmargin by \topskip
1426
\settoheight{\@IEEEtrantmpdimenB}{\begingroup #1\relax\relax\relax\endgroup}\relax
1427
\advance\topmargin by -\@IEEEtrantmpdimenB\relax
1428
\settodepth{\@IEEEtrantmpdimenB}{\begingroup #1\relax\relax\relax\endgroup}\relax
1429
\advance\topmargin by -\@IEEEtrantmpdimenB\relax
1430
\divide\topmargin by 2\relax
1431
\advance\topmargin by \@IEEEtrantmpdimenA\relax
1433
\if\@IEEEextractedtoken b\relax
1434
\topmargin\paperheight
1435
\advance\topmargin by -\textheight
1436
% \textheight includes \topskip, but we should not count topskip whitespace here, backout
1437
\advance \topmargin by \topskip
1438
\settodepth{\@IEEEtrantmpdimenB}{\begingroup #1\relax\relax\relax\endgroup}\relax
1439
\advance\topmargin by -\@IEEEtrantmpdimenB\relax
1440
\advance\topmargin by -\@IEEEtrantmpdimenA\relax
1442
\if\@IEEEextractedtoken t\relax
1444
\@IEEEclspkgerror{Unknown mode type `\@IEEEextractedtokenmacro' in \string\IEEEsettopmargin\space (line \the\inputlineno).\MessageBreak
1446
{Valid modes for \string\IEEEsettopmargin\space are: t, b, c, a and q.}\relax
1448
\topmargin\@IEEEtrantmpdimenA\relax
1449
\settoheight{\@IEEEtrantmpdimenB}{\begingroup #1\relax\relax\relax\endgroup}\relax
1450
\advance\topmargin by \@IEEEtrantmpdimenB\relax
1452
% convert desired top margin into actual \topmargin
1453
% this is not done for the q or a modes because they are only adjustments
1454
\advance \topmargin by -\topskip
1455
\advance \topmargin by -1in
1456
\advance \topmargin by -\headheight
1457
\advance \topmargin by -\headsep
1463
% usage: \IEEEsetheadermargin[header sample][text sample]{mode: t, b, c, a}{margin/offset}
1464
% Differentially adjusts \topmargin and \headsep (such that their sum is unchanged)
1465
% based on the specified header margin.
1466
% Takes into consideration the base 1in offset, \headheight, \topskip, and (by default)
1467
% the actual height (or depth) of the \IEEEdefaultheadersampletext and
1468
% \IEEEdefaultsampletext text.
1469
% The available modes are:
1470
% t = top margin (top of the header text to the top of the page)
1471
% b = bottom margin (bottom of the header text to the top of the main text)
1472
% c = vertically centered between the main text and the top of the page,
1473
% with the given offset
1474
% a = adjust the vertical position using the given offset
1475
% For the offsets, positive values move the header downward.
1476
% \headheight, \headsep, \topskip and \topmargin should be set properly before
1477
% calling this function.
1478
\def\IEEEsetheadermargin{\@ifnextchar [{\@IEEEsetheadermargin}{\@IEEEsetheadermargin[\IEEEdefaultheadersampletext]}}
1479
\def\@IEEEsetheadermargin[#1]{\@ifnextchar [{\@@IEEEsetheadermargin[#1]}{\@@IEEEsetheadermargin[#1][\IEEEdefaultsampletext]}}
1480
\def\@@IEEEsetheadermargin[#1][#2]#3#4{\@IEEEtrantmpdimenA #4\relax
1481
\@IEEEextracttoken{#3}\relax
1482
% check for mode errors
1483
\ifx\@IEEEextractedtokenmacro\@empty
1484
\@IEEEclspkgerror{Empty mode type in \string\IEEEsetheadermargin\space (line \the\inputlineno).\MessageBreak
1485
Defaulting to `t'}{Valid modes for \string\IEEEsetheadermargin\space are: t, b, c, and a.}\relax
1486
\let\@IEEEextractedtoken=t\relax
1487
\def\@IEEEextractedtokenmacro{t}\relax
1489
\ifx\@IEEEextractedtokensdiscarded\@empty\else
1490
\typeout{** WARNING: \string\IEEEsetheadermargin\space mode specifiers after the first in `\@IEEEextracttokenarg' ignored (line \the\inputlineno).}\relax
1494
\if\@IEEEextractedtoken a\relax
1495
% No need to do anything here and can pass through the adjustment
1496
% value as is. The end adjustment of \topmargin and \headsep will
1497
% do all that is needed
1499
\if\@IEEEextractedtoken c\relax
1500
% get the bottom margin
1501
\@IEEEtrantmpdimenB\headsep\relax
1502
\settodepth{\@IEEEtrantmpdimenC}{\begingroup #1\relax\relax\relax\endgroup}\relax
1503
\advance\@IEEEtrantmpdimenB by -\@IEEEtrantmpdimenC
1504
\advance\@IEEEtrantmpdimenB by \topskip
1505
\settoheight{\@IEEEtrantmpdimenC}{\begingroup #2\relax\relax\relax\endgroup}\relax
1506
\advance\@IEEEtrantmpdimenB by -\@IEEEtrantmpdimenC
1507
% at this point \@IEEEtrantmpdimenB has the actual header bottom margin
1508
% subtract from it the top header margin
1509
\advance\@IEEEtrantmpdimenB -1in\relax % take into consideration the system 1in offset of the top margin
1510
\advance\@IEEEtrantmpdimenB by -\topmargin
1511
\advance\@IEEEtrantmpdimenB by -\headheight
1512
\settoheight{\@IEEEtrantmpdimenC}{\begingroup #1\relax\relax\relax\endgroup}\relax
1513
\advance\@IEEEtrantmpdimenB by \@IEEEtrantmpdimenC
1514
% at this point \@IEEEtrantmpdimenB has the difference between the bottom and top margins
1515
% we need to adjust by half this amount to center the header
1516
\divide\@IEEEtrantmpdimenB by 2\relax
1518
\advance\@IEEEtrantmpdimenA by \@IEEEtrantmpdimenB
1520
\if\@IEEEextractedtoken b\relax
1521
\@IEEEtrantmpdimenB\headsep\relax
1522
\settodepth{\@IEEEtrantmpdimenC}{\begingroup #1\relax\relax\relax\endgroup}\relax
1523
\advance\@IEEEtrantmpdimenB by -\@IEEEtrantmpdimenC
1524
\advance\@IEEEtrantmpdimenB by \topskip
1525
\settoheight{\@IEEEtrantmpdimenC}{\begingroup #2\relax\relax\relax\endgroup}\relax
1526
\advance\@IEEEtrantmpdimenB by -\@IEEEtrantmpdimenC
1527
% at this point \@IEEEtrantmpdimenB has the actual header bottom margin
1528
% get the difference between the actual and the desired
1529
\advance\@IEEEtrantmpdimenB by -\@IEEEtrantmpdimenA
1530
\@IEEEtrantmpdimenA\@IEEEtrantmpdimenB
1532
\if\@IEEEextractedtoken t\relax
1534
\@IEEEclspkgerror{Unknown mode type `\@IEEEextractedtokenmacro' in \string\IEEEsetheadermargin\space (line \the\inputlineno).\MessageBreak
1536
{Valid modes for \string\IEEEsetheadermargin\space are: t, b, c and a.}\relax
1538
\@IEEEtrantmpdimenB 1in\relax % take into consideration the system 1in offset of the top margin
1539
\advance\@IEEEtrantmpdimenB by \topmargin
1540
\advance\@IEEEtrantmpdimenB by \headheight
1541
\settoheight{\@IEEEtrantmpdimenC}{\begingroup #1\relax\relax\relax\endgroup}\relax
1542
\advance\@IEEEtrantmpdimenB by -\@IEEEtrantmpdimenC
1543
% at this point \@IEEEtrantmpdimenB has the actual header top margin
1544
% get the difference between the desired and the actual
1545
\advance\@IEEEtrantmpdimenA by -\@IEEEtrantmpdimenB
1548
% advance \topmargin by the needed amount and reduce \headsep by the same
1549
% so as not to disturb the location of the main text
1550
\advance\topmargin by \@IEEEtrantmpdimenA\relax
1551
\advance\headsep by -\@IEEEtrantmpdimenA\relax
1556
% usage: \IEEEsetfootermargin[footer sample][text sample]{mode: t, b, c, a}{margin/offset}
1557
% Adjusts \footskip based on the specified footer margin.
1558
% Takes into consideration the base 1in offset, \paperheight, \headheight,
1559
% \headsep, \textheight and (by default) the actual height (or depth) of the
1560
% \IEEEdefaultfootersampletext and \IEEEdefaultsampletext text.
1561
% The available modes are:
1562
% t = top margin (top of the footer text to the bottom of the main text)
1563
% b = bottom margin (bottom of the footer text to the bottom of page)
1564
% c = vertically centered between the main text and the bottom of the page,
1565
% with the given offset
1566
% a = adjust the vertical position using the given offset
1567
% For the offsets, positive values move the footer downward.
1568
% \headheight, \headsep, \topskip, \topmargin, and \textheight should be set
1569
% properly before calling this function.
1570
\def\IEEEsetfootermargin{\@ifnextchar [{\@IEEEsetfootermargin}{\@IEEEsetfootermargin[\IEEEdefaultfootersampletext]}}
1571
\def\@IEEEsetfootermargin[#1]{\@ifnextchar [{\@@IEEEsetfootermargin[#1]}{\@@IEEEsetfootermargin[#1][\IEEEdefaultsampletext]}}
1572
\def\@@IEEEsetfootermargin[#1][#2]#3#4{\@IEEEtrantmpdimenA #4\relax
1573
\@IEEEextracttoken{#3}\relax
1574
% check for mode errors
1575
\ifx\@IEEEextractedtokenmacro\@empty
1576
\@IEEEclspkgerror{Empty mode type in \string\IEEEsetfootermargin\space (line \the\inputlineno).\MessageBreak
1577
Defaulting to `t'}{Valid modes for \string\IEEEsetfootermargin\space are: t, b, c, and a.}\relax
1578
\let\@IEEEextractedtoken=t\relax
1579
\def\@IEEEextractedtokenmacro{t}\relax
1581
\ifx\@IEEEextractedtokensdiscarded\@empty\else
1582
\typeout{** WARNING: \string\IEEEsetfootermargin\space mode specifiers after the first in `\@IEEEextracttokenarg' ignored (line \the\inputlineno).}\relax
1586
\if\@IEEEextractedtoken a\relax
1587
% No need to do anything here and can pass through the adjustment
1588
% value as is. The end adjustment of \footskip will do all that
1591
\if\@IEEEextractedtoken c\relax
1592
% calculate the bottom margin
1593
\@IEEEtrantmpdimenB 1in\relax % system 1in offset
1594
\advance\@IEEEtrantmpdimenB\topmargin\relax
1595
\advance\@IEEEtrantmpdimenB\headheight\relax
1596
\advance\@IEEEtrantmpdimenB\headsep\relax
1597
\advance\@IEEEtrantmpdimenB\textheight\relax
1598
\advance\@IEEEtrantmpdimenB\footskip\relax
1599
\settodepth{\@IEEEtrantmpdimenC}{\begingroup #1\relax\relax\relax\endgroup}\relax
1600
\advance\@IEEEtrantmpdimenC by \@IEEEtrantmpdimenB
1601
\@IEEEtrantmpdimenB\paperheight
1602
\advance\@IEEEtrantmpdimenB by -\@IEEEtrantmpdimenC
1603
% at this point \@IEEEtrantmpdimenB has the actual footer bottom margin
1604
% now subtract off the footer top margin
1605
\advance\@IEEEtrantmpdimenB -\footskip\relax
1606
\settodepth{\@IEEEtrantmpdimenC}{\begingroup #2\relax\relax\relax\endgroup}\relax
1607
\advance\@IEEEtrantmpdimenB by \@IEEEtrantmpdimenC
1608
\settoheight{\@IEEEtrantmpdimenC}{\begingroup #1\relax\relax\relax\endgroup}\relax
1609
\advance\@IEEEtrantmpdimenB by \@IEEEtrantmpdimenC
1610
% at this point \@IEEEtrantmpdimenB has the difference between the bottom
1611
% and top footer margins
1612
% our adjustment must be half this value to center the footer
1613
\divide\@IEEEtrantmpdimenB by 2\relax
1615
\advance\@IEEEtrantmpdimenA by \@IEEEtrantmpdimenB
1617
\if\@IEEEextractedtoken b\relax
1618
% calculate the bottom margin
1619
\@IEEEtrantmpdimenB 1in\relax % system 1in offset
1620
\advance\@IEEEtrantmpdimenB\topmargin\relax
1621
\advance\@IEEEtrantmpdimenB\headheight\relax
1622
\advance\@IEEEtrantmpdimenB\headsep\relax
1623
\advance\@IEEEtrantmpdimenB\textheight\relax
1624
\advance\@IEEEtrantmpdimenB\footskip\relax
1625
\settodepth{\@IEEEtrantmpdimenC}{\begingroup #1\relax\relax\relax\endgroup}\relax
1626
\advance\@IEEEtrantmpdimenC by \@IEEEtrantmpdimenB
1627
\@IEEEtrantmpdimenB\paperheight
1628
\advance\@IEEEtrantmpdimenB by -\@IEEEtrantmpdimenC
1629
% at this point \@IEEEtrantmpdimenB has the actual footer bottom margin
1630
% get the difference between the actual and the desired
1631
\advance\@IEEEtrantmpdimenB by -\@IEEEtrantmpdimenA
1632
\@IEEEtrantmpdimenA\@IEEEtrantmpdimenB
1634
\if\@IEEEextractedtoken t\relax
1636
\@IEEEclspkgerror{Unknown mode type `\@IEEEextractedtokenmacro' in \string\IEEEsetfootermargin\space (line \the\inputlineno).\MessageBreak
1638
{Valid modes for \string\IEEEsetfootermargin\space are: t, b, c and a.}\relax
1640
\@IEEEtrantmpdimenB\footskip\relax
1641
\settodepth{\@IEEEtrantmpdimenC}{\begingroup #2\relax\relax\relax\endgroup}\relax
1642
\advance\@IEEEtrantmpdimenB by -\@IEEEtrantmpdimenC
1643
\settoheight{\@IEEEtrantmpdimenC}{\begingroup #1\relax\relax\relax\endgroup}\relax
1644
\advance\@IEEEtrantmpdimenB by -\@IEEEtrantmpdimenC
1645
% at this point \@IEEEtrantmpdimenB has the actual footer top margin
1646
% get the difference between the desired and the actual
1647
\advance\@IEEEtrantmpdimenA by -\@IEEEtrantmpdimenB
1650
% advance \footskip by the needed amount
1651
\advance\footskip by \@IEEEtrantmpdimenA\relax
1654
% -- End V1.8a page setup commands --
735
1661
% LaTeX is a little to quick to use hyphenations
736
1662
% So, we increase the penalty for their use and raise
737
1663
% the badness level that triggers an underfull hbox
772
1706
\parskip 0ex plus 0.2ex minus 0.1ex
774
1708
\parindent 1.0em
1709
\ifCLASSOPTIONcompsoc
777
1713
\headheight 12pt
780
1715
% use the normal font baselineskip
781
1716
% so that \topskip is unaffected by changes in \baselinestretch
782
1717
\topskip=\@IEEEnormalsizeunitybaselineskip
1720
% V1.8 \maxdepth defaults to 4pt, but should be font size dependent
1721
\maxdepth=0.5\@IEEEnormalsizeunitybaselineskip
783
1722
\textheight 58pc % 9.63in, 696pt
784
% Tweak textheight to a perfect integer number of lines/page.
785
% The normal baselineskip for each document point size is used
786
% to determine these values.
787
\ifx\CLASSOPTIONpt\@IEEEptsizenine\textheight=63\@IEEEnormalsizeunitybaselineskip\fi % 63 lines/page
788
\ifx\CLASSOPTIONpt\@IEEEptsizeten\textheight=58\@IEEEnormalsizeunitybaselineskip\fi % 58 lines/page
789
\ifx\CLASSOPTIONpt\@IEEEptsizeeleven\textheight=52\@IEEEnormalsizeunitybaselineskip\fi % 52 lines/page
790
\ifx\CLASSOPTIONpt\@IEEEptsizetwelve\textheight=50\@IEEEnormalsizeunitybaselineskip\fi % 50 lines/page
1724
% set the default top margin to 58pt
1725
% which results in a \topmargin of -49.59pt for 10pt documents
1726
\IEEEsettopmargin{t}{58pt}
1727
% tweak textheight to a perfect integer number of lines/column.
1728
% standard is: 9pt/63 lpc; 10pt/58 lpc; 11pt/52 lpc; 12pt/50 lpc
1729
\IEEEquantizetextheight{c}
1730
% tweak top margin so that the error is shared equally at the top and bottom
1731
\IEEEsettopmargin{q}{0sp}
794
1735
\textwidth 43pc % 2 x 21pc + 1pc = 43pc
797
% the default side margins are equal
798
\if@IEEEusingAfourpaper
799
\oddsidemargin 14.32mm
800
\evensidemargin 14.32mm
802
\oddsidemargin 0.680in
803
\evensidemargin 0.680in
805
% compensate for LaTeX's 1in offset
806
\addtolength{\oddsidemargin}{-1in}
807
\addtolength{\evensidemargin}{-1in}
811
% adjust margins for conference mode
1737
% set the default side margins to center the text
1738
\IEEEsetsidemargin{c}{0pt}
1741
% adjust margins for default conference mode
812
1742
\ifCLASSOPTIONconference
814
% we retain the reserved, but unused space for headers
815
\addtolength{\topmargin}{-\headheight}
816
\addtolength{\topmargin}{-\headsep}
817
1743
\textheight 9.25in % The standard for conferences (668.4975pt)
818
% Tweak textheight to a perfect integer number of lines/page.
819
\ifx\CLASSOPTIONpt\@IEEEptsizenine\textheight=61\@IEEEnormalsizeunitybaselineskip\fi % 61 lines/page
820
\ifx\CLASSOPTIONpt\@IEEEptsizeten\textheight=56\@IEEEnormalsizeunitybaselineskip\fi % 56 lines/page
821
\ifx\CLASSOPTIONpt\@IEEEptsizeeleven\textheight=50\@IEEEnormalsizeunitybaselineskip\fi % 50 lines/page
822
\ifx\CLASSOPTIONpt\@IEEEptsizetwelve\textheight=48\@IEEEnormalsizeunitybaselineskip\fi % 48 lines/page
1744
\IEEEsettopmargin{t}{0.75in}
1745
% tweak textheight to a perfect integer number of lines/page.
1746
% standard is: 9pt/61 lpc; 10pt/56 lpc; 11pt/50 lpc; 12pt/48 lpc
1747
\IEEEquantizetextheight{c}
1748
% tweak top margin so that the error is shared equally at the top and bottom
1749
\IEEEsettopmargin{q}{0sp}
1753
% compsoc text sizes, margins and spacings
1754
\ifCLASSOPTIONcompsoc
1756
% CS specs for \textwdith are 6.875in
1757
% \textwidth 6.875in
1758
% however, measurements from proofs show they are using 3.5in columns
1760
\advance\textwidth by \columnsep
1761
% set the side margins to center the text
1762
\IEEEsetsidemargin{c}{0pt}
1763
% top/bottom margins to center
1764
% could just set \textheight to 9.75in for all the different paper sizes
1765
% and then quantize, but we'll do it the long way here to allow for easy
1766
% future per-paper size adjustments
1767
\IEEEsettextheight{0.625in}{0.625in}% 11in - 2 * 0.625in = 9.75in is the standard text height for compsoc journals
1768
\IEEEsettopmargin{t}{0.625in}
1769
\if@IEEEusingcspaper
1770
\IEEEsettextheight{0.5in}{0.5in}% 10.75in - 2 * 0.5in = 9.75in
1771
\IEEEsettopmargin{t}{0.5in}
1773
\if@IEEEusingAfourpaper
1774
\IEEEsettextheight{24.675mm}{24.675mm}% 297mm - 2 * 24.675mm = 247.650mm (9.75in)
1775
\IEEEsettopmargin{t}{24.675mm}
1777
% tweak textheight to a perfect integer number of lines/page.
1778
% standard is: 9pt/65 lpc; 10pt/61 lpc; 11pt/53 lpc; 12pt/49 lpc
1779
\IEEEquantizetextheight{c}
1780
% tweak top margin so that the error is shared equally at the top and bottom
1781
\IEEEsettopmargin{q}{0sp}
826
1783
% compsoc conference
827
\ifCLASSOPTIONcompsoc
828
\ifCLASSOPTIONconference
829
% compsoc conference use a larger value for columnsep
831
% compsoc conferences want 1in top margin, 1.125in bottom margin
833
\addtolength{\topmargin}{-6pt}% we tweak this a tad to better comply with top of line stuff
834
% we retain the reserved, but unused space for headers
835
\addtolength{\topmargin}{-\headheight}
836
\addtolength{\topmargin}{-\headsep}
837
\textheight 8.875in % (641.39625pt)
838
% Tweak textheight to a perfect integer number of lines/page.
839
\ifx\CLASSOPTIONpt\@IEEEptsizenine\textheight=58\@IEEEnormalsizeunitybaselineskip\fi % 58 lines/page
840
\ifx\CLASSOPTIONpt\@IEEEptsizeten\textheight=53\@IEEEnormalsizeunitybaselineskip\fi % 53 lines/page
841
\ifx\CLASSOPTIONpt\@IEEEptsizeeleven\textheight=48\@IEEEnormalsizeunitybaselineskip\fi % 48 lines/page
842
\ifx\CLASSOPTIONpt\@IEEEptsizetwelve\textheight=46\@IEEEnormalsizeunitybaselineskip\fi % 46 lines/page
844
% the default side margins are equal
845
\if@IEEEusingAfourpaper
846
\oddsidemargin 22.45mm
847
\evensidemargin 22.45mm
1784
\ifCLASSOPTIONconference
1785
% compsoc conference use a larger value for columnsep
1787
\IEEEsettextwidth{0.75in}{0.75in}
1788
% set the side margins to center the text (0.75in for letterpaper)
1789
\IEEEsetsidemargin{c}{0pt}
1790
% compsoc conferences want 1in top and bottom margin
1791
\IEEEsettextheight{1in}{1in}
1792
\IEEEsettopmargin{t}{1in}
1793
% tweak textheight to a perfect integer number of lines/page.
1794
% standard is: 9pt/58 lpc; 10pt/53 lpc; 11pt/48 lpc; 12pt/46 lpc
1795
\IEEEquantizetextheight{c}
1796
% tweak top margin so that the error is shared equally at the top and bottom
1797
\IEEEsettopmargin{q}{0sp}
852
% compensate for LaTeX's 1in offset
853
\addtolength{\oddsidemargin}{-1in}
854
\addtolength{\evensidemargin}{-1in}
859
1803
% draft mode settings override that of all other modes
860
1804
% provides a nice 1in margin all around the paper and extra
861
1805
% space between the lines for editor's comments
862
\ifCLASSOPTIONdraftcls
863
% want 1in from top of paper to text
864
\setlength{\topmargin}{-\headsep}%
865
\addtolength{\topmargin}{-\headheight}%
1806
\ifCLASSOPTIONdraftcls
866
1807
% we want 1in side margins regardless of paper type
870
\setlength{\textwidth}{\paperwidth}%
871
\addtolength{\textwidth}{-2.0in}%
872
\setlength{\textheight}{\paperheight}%
873
\addtolength{\textheight}{-2.0in}%
1808
\IEEEsettextwidth{1in}{1in}
1809
\IEEEsetsidemargin{c}{0pt}
1810
% want 1in top and bottom margins
1811
\IEEEsettextheight{1in}{1in}
1812
\IEEEsettopmargin{t}{1in}
874
1813
% digitize textheight to be an integer number of lines.
875
% this may cause the bottom margin to be off a tad
876
\addtolength{\textheight}{-1\topskip}%
877
\divide\textheight by \baselineskip%
878
\multiply\textheight by \baselineskip%
879
\addtolength{\textheight}{\topskip}%
1814
% this may cause the top and bottom margins to be off a tad
1815
\IEEEquantizetextheight{c}
1816
% tweak top margin so that the error is shared equally at the top and bottom
1817
\IEEEsettopmargin{q}{0sp}
2847
%% -- Command Argument Scanning Support Functions --
2850
% usage: \@IEEEstripouterbraces*{}
2851
% \@IEEEstripouterbraces fully expands its argument (which it then stores
2852
% in \@IEEEstripouterbracesarg) via \edef, then removes any outer enclosing
2853
% braces, and finally stores the result in the macro
2854
% \@IEEEstrippedouterbraces.
2857
% \@IEEEstripouterbraces{{{{ab}c}}}
2860
% \@IEEEstripouterbracesarg ==> a macro containing {{{ab}c}}
2861
% \@IEEEstrippedouterbraces ==> a macro containing {ab}c
2863
% the *-star form,\@IEEEstripouterbraces*, does not expand the argument
2864
% contents during processing
2865
\def\@IEEEstripouterbraces{\@ifstar{\let\@IEEEstripouterbracesdef=\def\@@IEEEstripouterbraces}{\let\@IEEEstripouterbracesdef=\edef\@@IEEEstripouterbraces}}
2867
\def\@@IEEEstripouterbraces#1{\@IEEEstripouterbracesdef\@IEEEstripouterbracesarg{#1}\relax
2868
% If the macro is unchanged after being acquired as a single delimited
2869
% argument, we know we have one sequence of tokens without any enclosing
2870
% braces. Loop until this is true.
2872
\expandafter\@@@IEEEstripouterbraces\@IEEEstripouterbracesarg\@IEEEgeneralsequenceDELIMITER
2873
\ifx\@IEEEstrippedouterbraces\@IEEEstripouterbracesarg
2875
\let\@IEEEstripouterbracesarg\@IEEEstrippedouterbraces
2878
\def\@@@IEEEstripouterbraces#1\@IEEEgeneralsequenceDELIMITER{\def\@IEEEstrippedouterbraces{#1}}
2882
% usage: \@IEEEextractgroup*{}
2883
% \@IEEEextractgroup fully expands its argument (which it then stores in
2884
% \@IEEEextractgrouparg) via \edef and then assigns the first "brace group"
2885
% of tokens to the macro \@IEEEextractedgroup.
2886
% The remaining groups, if any, are stored in the macro
2887
% \@IEEEextractedgroupremain. If the argument does not contain the requisite
2888
% groups, the respective macros will be defined to be empty.
2889
% There is an asymmetry in that \@IEEEextractedgroup is stripped of its first
2890
% outer grouping while \@IEEEextractedgroupremain retains even the outer
2891
% grouping (if present) that originally identified it as a group.
2894
% \@IEEEextractgroup{{{ab}}{c{de}}}
2897
% \@IEEEextractgrouparg ==> a macro containing {{ab}}{c{de}}
2898
% \@IEEEextractedgroup ==> a macro containing {ab}
2899
% \@IEEEextractedgroupremain ==> a macro containing {c{de}}
2901
% The *-star form, \@IEEEextractgroup*, does not expand its argument
2902
% contents during processing.
2903
\def\@IEEEextractgroup{\@ifstar{\let\@IEEEextractgroupdef=\def\@@IEEEextractgroup}{\let\@IEEEextractgroupdef=\edef\@@IEEEextractgroup}}
2905
\def\@@IEEEextractgroup#1{\@IEEEextractgroupdef\@IEEEextractgrouparg{#1}\relax
2906
% trap the case of an empty extracted group as this would cause problems with
2907
% \@IEEEextractgroupremain's argument acquisition
2908
\ifx\@IEEEextractgrouparg\@empty
2909
\def\@IEEEextractedgroup{}\relax
2910
\def\@IEEEextractedgroupremain{}\relax
2912
% We have to use some dirty tricks here. We want to insert {} around
2913
% whatever remains after the first group so that TeX's argument scanner
2914
% will preserve any originally enclosing braces as well as provide an
2915
% empty argument to acquire even if there isn't a second group.
2916
% In this first of two dirty tricks, we put a } at the end of the structure
2917
% we are going to extract from. The \ifnum0=`{\fi keeps TeX happy to allow
2918
% what would otherwise be an unbalanced macro definition for
2919
% \@@IEEEextractgroup to be acceptable to it.
2920
\ifnum0=`{\fi\expandafter\@IEEEextractgroupremain\@IEEEextractgrouparg}\relax
2923
% In the second part of the dirty tricks, we insert a leading { right after
2924
% the first group is acquired, but before the remainder is. Again, the
2925
% \ifnum0=`}\fi keeps TeX happy during definition time, but will disappear
2927
\def\@IEEEextractgroupremain#1{\def\@IEEEextractedgroup{#1}\expandafter\@@IEEEextractgroupremain\expandafter{\ifnum0=`}\fi}
2929
\def\@@IEEEextractgroupremain#1{\def\@IEEEextractedgroupremain{#1}}
2933
% \@IEEEextracttoken relocated at top because margin setting commands rely on it
2937
% usage: \@IEEEextracttokengroups*{}
2938
% \@IEEEextracttokengroups fully expands its argument (which it then stores
2939
% in \@IEEEextracttokengroupsarg) and then assigns the first "brace group" of
2940
% tokens (with the outermost braces removed) to the macro
2941
% \@IEEEextractedfirstgroup.
2942
% The meaning of the first nonbrace (but including the empty group) token
2943
% within this first group is assigned via \let to \@IEEEextractedfirsttoken
2944
% as well as stored in the macro \@IEEEextractedfirsttokenmacro. If a first
2945
% nonbrace token does not exist (or is an empty group), these will be \relax
2946
% and empty, respectively. Tokens that would otherwise be discarded during
2947
% the acquisition of the first token in the first group are stored in
2948
% \@IEEEextractedfirsttokensdiscarded, however their original relative brace
2949
% nesting depths are not guaranteed to be preserved.
2950
% The first group within this first group is stored in the macro
2951
% \@IEEEextractedfirstfirstgroup.
2952
% Likewise for the next group after the first: \@IEEEextractednextgroup,
2953
% \@IEEEextractednextfirstgroup, \@IEEEextractednextgroupfirsttoken,
2954
% \@IEEEextractednextgroupfirsttokenmacro, and
2955
% \@IEEEextractednextfirsttokensdiscarded.
2956
% All tokens/groups after the first group, including any enclosing braces,
2957
% are stored in the macro \@IEEEextractedafterfirstgroupremain which will
2958
% be empty if none exist.
2961
% \@IEEEextracttokengroups{{{ab}{cd}}{{ef}g}}
2964
% \@IEEEextracttokengroupsarg ==> a macro containing {{ab}{cd}}{{ef}g}
2965
% \@IEEEextractedfirstgroup ==> a macro containing {ab}{cd}
2966
% \@IEEEextractedafterfirstgroupremain ==> a macro containing {{ef}g}
2967
% \@IEEEextractedfirsttoken ==> the letter a
2968
% \@IEEEextractedfirsttokenmacro ==> a macro containing a
2969
% \@IEEEextractedfirsttokensdiscarded ==> a macro containing bcd
2970
% \@IEEEextractedfirstfirstgroup ==> a macro containing ab
2971
% \@IEEEextractednextgroup ==> a macro containing {ef}g
2972
% \@IEEEextractednextfirsttoken ==> the letter e
2973
% \@IEEEextractednextfirsttokenmacro ==> a macro containing e
2974
% \@IEEEextractednextfirsttokensdiscarded ==> a macro containing fg
2975
% \@IEEEextractednextfirstgroup ==> a macro containing ef
2977
% If given an empty argument, \@IEEEextractedfirsttoken and
2978
% \@IEEEextractednextfirsttoken will be set to \relax
2979
% and all the macros will be empty.
2980
% the *-star form, \@IEEEextracttokengroups*, does not expand its argument
2981
% contents during processing.
2983
% Depends on: \@IEEEextractgroup, \@IEEEextracttoken
2984
\def\@IEEEextracttokengroups{\@ifstar{\let\@IEEEextracttokengroupsdef=\def\@@IEEEextracttokengroups}{\let\@IEEEextracttokengroupsdef=\edef\@@IEEEextracttokengroups}}
2985
\def\@@IEEEextracttokengroups#1{\@IEEEextracttokengroupsdef\@IEEEextracttokengroupsarg{#1}\relax
2986
% begin extraction, these functions are safe with empty arguments
2988
\expandafter\@IEEEextractgroup\expandafter*\expandafter{\@IEEEextracttokengroupsarg}\relax
2989
\let\@IEEEextractedfirstgroup\@IEEEextractedgroup
2990
\let\@IEEEextractedafterfirstgroupremain\@IEEEextractedgroupremain
2991
\expandafter\@IEEEextracttoken\expandafter*\expandafter{\@IEEEextractedfirstgroup}\relax
2992
\let\@IEEEextractedfirsttoken\@IEEEextractedtoken
2993
\let\@IEEEextractedfirsttokenmacro\@IEEEextractedtokenmacro
2994
\let\@IEEEextractedfirsttokensdiscarded\@IEEEextractedtokensdiscarded
2996
\expandafter\@IEEEextractgroup\expandafter*\expandafter{\@IEEEextractedfirstgroup}\relax
2997
\let\@IEEEextractedfirstfirstgroup\@IEEEextractedgroup
2999
\expandafter\@IEEEextractgroup\expandafter*\expandafter{\@IEEEextractedafterfirstgroupremain}\relax
3000
\let\@IEEEextractednextgroup\@IEEEextractedgroup
3001
\expandafter\@IEEEextracttoken\expandafter*\expandafter{\@IEEEextractednextgroup}\relax
3002
\let\@IEEEextractednextfirsttoken\@IEEEextractedtoken
3003
\let\@IEEEextractednextfirsttokenmacro\@IEEEextractedtokenmacro
3004
\let\@IEEEextractednextfirsttokensdiscarded\@IEEEextractedtokensdiscarded
3006
\expandafter\@IEEEextractgroup\expandafter*\expandafter{\@IEEEextractednextgroup}\relax
3007
\let\@IEEEextractednextfirstgroup\@IEEEextractedgroup}
3010
%% -- End of Command Argument Scanning Support Functions --
1851
%% START OF IEEEeqnarry DEFINITIONS
3016
%% START OF IEEEeqnarray DEFINITIONS
1853
3018
%% Inspired by the concepts, examples, and previous works of LaTeX
1854
3019
%% coders and developers such as Donald Arseneau, Fred Bartlett,
1882
3044
\def\IEEEeqnarraydecl{\relax}
1883
3045
\def\IEEEeqnarrayboxdecl{\relax}
3049
% V1.8 flags to indicate that equation numbering is to persist
3050
\newif\if@IEEEeqnumpersist%
3051
\@IEEEeqnumpersistfalse
3052
\newif\if@IEEEsubeqnumpersist%
3053
\@IEEEsubeqnumpersistfalse
3055
% V1.8 flags to indicate if (sub)equation number of last line was preadvanced
3056
\newif\if@IEEEeqnumpreadv%
3057
\@IEEEeqnumpreadvfalse
3058
\newif\if@IEEEsubeqnumpreadv%
3059
\@IEEEsubeqnumpreadvfalse
3061
\newcount\@IEEEsubeqnnumrollback% saves previous value of IEEEsubequation number in case we need to restore it
1885
3063
% \yesnumber is the opposite of \nonumber
1886
3064
% a novel concept with the same def as the equationarray package
1887
3065
% However, we give IEEE versions too since some LaTeX packages such as
1888
3066
% the MDWtools mathenv.sty redefine \nonumber to something else.
3067
% This command is intended for use in non-IEEEeqnarray math environments
1889
3068
\providecommand{\yesnumber}{\global\@eqnswtrue}
1890
\def\IEEEyesnumber{\global\@eqnswtrue}
1891
\def\IEEEnonumber{\global\@eqnswfalse}
1894
\def\IEEEyessubnumber{\global\@IEEEissubequationtrue\global\@eqnswtrue%
1895
\if@IEEEeqnarrayISinner% only do something inside an IEEEeqnarray
1896
\if@IEEElastlinewassubequation\addtocounter{equation}{-1}\else\setcounter{IEEEsubequation}{1}\fi%
1897
\def\@currentlabel{\p@IEEEsubequation\theIEEEsubequation}\fi}
1899
% flag to indicate that an equation is a sub equation
1900
\newif\if@IEEEissubequation%
1901
\@IEEEissubequationfalse
3072
% V1.8 add persistant * forms
3073
% These commands can alter the type of equation an IEEEeqnarray line is.
3074
\def\IEEEyesnumber{\@ifstar{\global\@IEEEeqnumpersisttrue\global\@IEEEsubeqnumpersistfalse\@IEEEyesnumber}{\@IEEEyesnumber}}
3076
\def\@IEEEyesnumber{\global\@eqnswtrue
3077
\if@IEEEeqnarrayISinner% alter counters and label only inside an IEEEeqnarray
3078
\ifnum\c@IEEEsubequation>0\relax
3079
\stepcounter{equation}\setcounter{IEEEsubequation}{0}\gdef\@currentlabel{\p@equation\theequation}\relax
3080
\gdef\@currentHref{\@IEEEtheHrefequation}% setup hyperref label
3082
% even if we reached this eqn num via a preadv, it is legit now
3083
\global\@IEEEeqnumpreadvfalse\global\@IEEEsubeqnumpreadvfalse
3086
\def\IEEEnonumber{\@ifstar{\global\@IEEEeqnumpersistfalse\global\@IEEEsubeqnumpersistfalse\global\@eqnswfalse}{\global\@eqnswfalse}}
3089
\def\IEEEyessubnumber{\@ifstar{\global\@IEEEsubeqnumpersisttrue\@IEEEyessubnumber}{\@IEEEyessubnumber}}
3091
\def\@IEEEyessubnumber{\if@IEEEeqnarrayISinner% alter counters and label only inside an IEEEeqnarray
3092
\ifnum\c@IEEEsubequation>0\relax% if it already is a subequation, we are good to go as-is
3093
\else% if we are a regular equation we have to watch out for two cases
3094
\if@IEEEeqnumpreadv% if this equation is the result of a preadvance, backout and bump the sub eqnnum
3095
\global\advance\c@equation\m@ne\global\c@IEEEsubequation=\@IEEEsubeqnnumrollback\addtocounter{IEEEsubequation}{1}\relax
3096
\else% non-preadvanced equations just need initialization of their sub eqnnum
3097
\setcounter{IEEEsubequation}{1}\relax
3099
\fi% fi already is subequation
3100
\gdef\@currentlabel{\p@IEEEsubequation\theIEEEsubequation}\relax
3101
\gdef\@currentHref{\@IEEEtheHrefsubequation}% setup hyperref label
3102
\global\@IEEEeqnumpreadvfalse\global\@IEEEsubeqnumpreadvfalse% no longer a preadv anymore
3107
\def\IEEEnosubnumber{\@ifstar{\global\@IEEEsubeqnumpersistfalse\@IEEEnosubnumber}{\@IEEEnosubnumber}}
3109
\def\@IEEEnosubnumber{\if@IEEEeqnarrayISinner% alter counters and label only inside an IEEEeqnarray
3110
\if@eqnsw % we do nothing unless we know we will display because we play with the counters here
3111
% if it currently is a subequation, bump up to the next equation number and turn off the subequation
3112
\ifnum\c@IEEEsubequation>0\relax\addtocounter{equation}{1}\setcounter{IEEEsubequation}{0}\relax
3114
\global\@IEEEeqnumpreadvfalse\global\@IEEEsubeqnumpreadvfalse% no longer a preadv anymore
3115
\gdef\@currentlabel{\p@equation\theequation}\relax
3116
\gdef\@currentHref{\@IEEEtheHrefequation}% setup hyperref label
1903
3122
% allows users to "push away" equations that get too close to the equation numbers
1904
\def\IEEEeqnarraynumspace{\hphantom{\if@IEEEissubequation\theIEEEsubequationdis\else\theequationdis\fi}}
3123
\def\IEEEeqnarraynumspace{\hphantom{\ifnum\c@IEEEsubequation>0\relax\theIEEEsubequationdis\else\theequationdis\fi}}
1906
3125
% provides a way to span multiple columns within IEEEeqnarray environments
1907
3126
% will consider \if@advanceIEEEeqncolcnt before globally advancing the
1908
3127
% column counter - so as to work within \IEEEeqnarraybox
1909
3128
% usage: \IEEEeqnarraymulticol{number cols. to span}{col type}{cell text}
1910
\long\def\IEEEeqnarraymulticol#1#2#3{\multispan{#1}%
1911
% check if column is defined
1912
\relax\expandafter\ifx\csname @IEEEeqnarraycolDEF#2\endcsname\@IEEEeqnarraycolisdefined%
1913
\csname @IEEEeqnarraycolPRE#2\endcsname#3\relax\relax\relax\relax\relax%
1914
\relax\relax\relax\relax\relax\csname @IEEEeqnarraycolPOST#2\endcsname%
3129
\long\def\IEEEeqnarraymulticol#1#2#3{\multispan{#1}\relax
3130
% check if column is defined for the precolumn definition
3131
% We have to be careful here because TeX scans for & even within an \iffalse
3132
% where it does not expand macros. So, if we used only one \ifx and a #3
3133
% appeared in the false branch and the user inserted another alignment
3134
% structure that uses & in the \IEEEeqnarraymulticol{}, TeX will not see that
3135
% there is an inner alignment in the false branch yet still will see any &
3136
% there and will think that they apply to the outer alignment resulting in an
3137
% incomplete \ifx error.
3138
% So, here we use separate checks for the pre and post parts in order to keep
3139
% the #3 outside of all conditionals.
3140
\relax\expandafter\ifx\csname @IEEEeqnarraycolDEF#2\endcsname\@IEEEeqnarraycolisdefined\relax
3141
\csname @IEEEeqnarraycolPRE#2\endcsname
1915
3142
\else% if not, error and use default type
1916
3143
\@IEEEclspkgerror{Invalid column type "#2" in \string\IEEEeqnarraymulticol.\MessageBreak
1917
3144
Using a default centering column instead}%
1918
3145
{You must define IEEEeqnarray column types before use.}%
1919
\csname @IEEEeqnarraycolPRE@IEEEdefault\endcsname#3\relax\relax\relax\relax\relax%
1920
\relax\relax\relax\relax\relax\csname @IEEEeqnarraycolPOST@IEEEdefault\endcsname%
3146
\csname @IEEEeqnarraycolPRE@IEEEdefault\endcsname
3148
% The ten \relax are to help prevent misleading error messages in case a user
3149
% accidently inserted a macro that tries to acquire additional arguments.
3150
#3\relax\relax\relax\relax\relax\relax\relax\relax\relax\relax
3151
% check if column is defined for the postcolumn definition
3152
\expandafter\ifx\csname @IEEEeqnarraycolDEF#2\endcsname\@IEEEeqnarraycolisdefined\relax
3153
\csname @IEEEeqnarraycolPOST#2\endcsname
3154
\else% if not, use the default type
3155
\csname @IEEEeqnarraycolPOST@IEEEdefault\endcsname
1922
3157
% advance column counter only if the IEEEeqnarray environment wants it
1923
3158
\if@advanceIEEEeqncolcnt\global\advance\@IEEEeqncolcnt by #1\relax\fi}
2919
%% END OF IEEEeqnarry DEFINITIONS
4223
%% END OF IEEEeqnarray DEFINITIONS
2925
% set up the running headings, this complex because of all the different
2926
% modes IEEEtran supports
2928
\ifCLASSOPTIONtechnote
2930
\def\@oddhead{\hbox{}\scriptsize\leftmark \hfil \thepage}
2931
\def\@evenhead{\scriptsize\thepage \hfil \leftmark\hbox{}}
2932
\ifCLASSOPTIONdraftcls
2933
\ifCLASSOPTIONdraftclsnofoot
2934
\def\@oddfoot{}\def\@evenfoot{}%
2936
\def\@oddfoot{\scriptsize\@date\hfil DRAFT}
2937
\def\@evenfoot{\scriptsize DRAFT\hfil\@date}
2940
\def\@oddfoot{}\def\@evenfoot{}
2942
\else % not a technote
2944
\ifCLASSOPTIONconference
2948
\def\@oddhead{\hbox{}\scriptsize\rightmark \hfil \thepage}
2949
\def\@evenhead{\scriptsize\thepage \hfil \leftmark\hbox{}}
2951
\ifCLASSOPTIONdraftcls
2952
\def\@oddhead{\hbox{}\scriptsize\rightmark \hfil \thepage}
2953
\def\@evenhead{\scriptsize\thepage \hfil \leftmark\hbox{}}
2954
\ifCLASSOPTIONdraftclsnofoot
2955
\def\@oddfoot{}\def\@evenfoot{}%
2957
\def\@oddfoot{\scriptsize\@date\hfil DRAFT}
2958
\def\@evenfoot{\scriptsize DRAFT\hfil\@date}
2961
\def\@oddfoot{}\def\@evenfoot{}%
2966
\ifCLASSOPTIONconference
2970
\def\@oddhead{\hbox{}\scriptsize\leftmark \hfil \thepage}
2973
\ifCLASSOPTIONdraftcls
2974
\def\@oddhead{\hbox{}\scriptsize\leftmark \hfil \thepage}
2976
\ifCLASSOPTIONdraftclsnofoot
2979
\def\@oddfoot{\scriptsize \@date \hfil DRAFT}
2989
\def\ps@IEEEtitlepagestyle{\def\@oddfoot{}\def\@evenfoot{}%
4230
% set up the running headers and footers
4232
% header and footer font and size specifications
4233
\def\@IEEEheaderstyle{\normalfont\scriptsize}
4234
\def\@IEEEfooterstyle{\normalfont\scriptsize}
4236
% compsoc uses sans-serif headers and footers
4237
\ifCLASSOPTIONcompsoc
4238
\def\@IEEEheaderstyle{\normalfont\sffamily\scriptsize}
4239
\def\@IEEEfooterstyle{\normalfont\sffamily\scriptsize}
4243
% standard page style, ps@headings
4244
\def\ps@headings{% default to standard twoside headers, no footers
4245
% will change later if the mode requires otherwise
4246
\def\@oddhead{\hbox{}\@IEEEheaderstyle\rightmark\hfil\thepage}\relax
4247
\def\@evenhead{\@IEEEheaderstyle\thepage\hfil\leftmark\hbox{}}\relax
4248
\let\@oddfoot\@empty
4249
\let\@evenfoot\@empty
4250
\ifCLASSOPTIONtechnote
4252
\def\@oddhead{\hbox{}\@IEEEheaderstyle\leftmark\hfil\thepage}\relax
4253
\def\@evenhead{\@IEEEheaderstyle\thepage\hfil\leftmark\hbox{}}\relax
4255
\ifCLASSOPTIONdraftcls
4257
\def\@oddfoot{\@IEEEfooterstyle\@date\hfil DRAFT}\relax
4258
\def\@evenfoot{\@IEEEfooterstyle DRAFT\hfil\@date}\relax
4262
% standard one side headers
4263
\def\@oddhead{\hbox{}\@IEEEheaderstyle\leftmark\hfil\thepage}\relax
4264
\let\@evenhead\@empty
4265
\ifCLASSOPTIONdraftcls
4266
% oneside draft footers
4267
\def\@oddfoot{\@IEEEfooterstyle\@date\hfil DRAFT}\relax
4268
\let\@evenfoot\@empty
4271
% turn off headers for conferences
2990
4272
\ifCLASSOPTIONconference
2994
\def\@oddhead{\hbox{}\scriptsize\leftmark \hfil \thepage}%
2995
\def\@evenhead{\scriptsize\thepage \hfil \leftmark\hbox{}}%
4273
\let\@oddhead\@empty
4274
\let\@evenhead\@empty
2997
\ifCLASSOPTIONdraftcls
2998
\def\@oddhead{\hbox{}\scriptsize\leftmark \hfil \thepage}%
2999
\def\@evenhead{\scriptsize\thepage \hfil \leftmark\hbox{}}%
3000
\ifCLASSOPTIONdraftclsnofoot\else
3001
\def\@oddfoot{\scriptsize \@date\hfil DRAFT}%
3002
\def\@evenfoot{\scriptsize DRAFT\hfil \@date}%
3005
% all non-draft mode footers
3007
% for title pages that are using a pubid
3008
% do not repeat pubid if using peer review option
3009
\ifCLASSOPTIONpeerreview
3012
\ifCLASSOPTIONcompsoc
3013
\def\@oddfoot{\hss\normalfont\scriptsize\raisebox{-1.5\@IEEEnormalsizeunitybaselineskip}[0ex][0ex]{\@IEEEpubid}\hss}%
3014
\def\@evenfoot{\hss\normalfont\scriptsize\raisebox{-1.5\@IEEEnormalsizeunitybaselineskip}[0ex][0ex]{\@IEEEpubid}\hss}%
3016
\def\@oddfoot{\hss\normalfont\footnotesize\raisebox{1.5ex}[1.5ex]{\@IEEEpubid}\hss}%
3017
\def\@evenfoot{\hss\normalfont\footnotesize\raisebox{1.5ex}[1.5ex]{\@IEEEpubid}\hss}%
4276
% turn off footers for draftclsnofoot
4277
\ifCLASSOPTIONdraftclsnofoot
4278
\let\@oddfoot\@empty
4279
\let\@evenfoot\@empty
3024
% peer review cover page style
3025
\def\ps@IEEEpeerreviewcoverpagestyle{%
3026
\def\@oddhead{}\def\@evenhead{}%
3027
\def\@oddfoot{}\def\@evenfoot{}%
4283
% title page style, ps@IEEEtitlepagestyle
4284
\def\ps@IEEEtitlepagestyle{% default title page headers, no footers
4285
\def\@oddhead{\hbox{}\@IEEEheaderstyle\leftmark\hfil\thepage}\relax
4286
\def\@evenhead{\@IEEEheaderstyle\thepage\hfil\leftmark\hbox{}}\relax
4287
\let\@oddfoot\@empty
4288
\let\@evenfoot\@empty
4289
% will change later if the mode requires otherwise
3028
4290
\ifCLASSOPTIONdraftcls
3029
\ifCLASSOPTIONdraftclsnofoot\else
3030
\def\@oddfoot{\scriptsize \@date\hfil DRAFT}%
3031
\def\@evenfoot{\scriptsize DRAFT\hfil \@date}%
4292
\ifCLASSOPTIONdraftclsnofoot\else
4293
% but only if not draftclsnofoot
4294
\def\@oddfoot{\@IEEEfooterstyle\@date\hfil DRAFT}\relax
4295
\def\@evenfoot{\@IEEEfooterstyle DRAFT\hfil\@date}\relax
3034
% non-draft mode footers
4298
% all nondraft mode footers
4300
% for title pages that are using a pubid
4301
% do not repeat pubid on the title page if using a peer review cover page
4302
\ifCLASSOPTIONpeerreview\else
4303
% for noncompsoc papers, the pubid uses footnotesize and
4304
% is at the same vertical position as where the last baseline would normally be
4305
\def\@oddfoot{\hbox{}\hss\@IEEEfooterstyle\footnotesize\raisebox{\footskip}[0pt][0pt]{\@IEEEpubid}\hss\hbox{}}\relax
4306
\def\@evenfoot{\hbox{}\hss\@IEEEfooterstyle\footnotesize\raisebox{\footskip}[0pt][0pt]{\@IEEEpubid}\hss\hbox{}}\relax
3037
4307
\ifCLASSOPTIONcompsoc
3038
\def\@oddfoot{\hss\normalfont\scriptsize\raisebox{-1.5\@IEEEnormalsizeunitybaselineskip}[0ex][0ex]{\@IEEEpubid}\hss}%
3039
\def\@evenfoot{\hss\normalfont\scriptsize\raisebox{-1.5\@IEEEnormalsizeunitybaselineskip}[0ex][0ex]{\@IEEEpubid}\hss}%
3041
\def\@oddfoot{\hss\normalfont\footnotesize\raisebox{1.5ex}[1.5ex]{\@IEEEpubid}\hss}%
3042
\def\@evenfoot{\hss\normalfont\footnotesize\raisebox{1.5ex}[1.5ex]{\@IEEEpubid}\hss}%
4308
% for compsoc papers, the pubid is at the same vertical position as the normal footer
4309
\def\@oddfoot{\hbox{}\hss\@IEEEfooterstyle\raisebox{0pt}[0pt][0pt]{\@IEEEpubid}\hss\hbox{}}\relax
4310
\def\@evenfoot{\hbox{}\hss\@IEEEfooterstyle\raisebox{0pt}[0pt][0pt]{\@IEEEpubid}\hss\hbox{}}\relax
3048
% start with empty headings
3049
\def\rightmark{}\def\leftmark{}
3052
%% Defines the command for putting the header. \footernote{TEXT} is the same
3053
%% as \markboth{TEXT}{TEXT}.
4315
% turn off headers for conferences
4316
\ifCLASSOPTIONconference
4317
\let\@oddhead\@empty
4318
\let\@evenhead\@empty
4322
% peer review cover page style, ps@IEEEpeerreviewcoverpagestyle
4323
\def\ps@IEEEpeerreviewcoverpagestyle{% default peer review cover no headers, no footers
4324
\let\@oddhead\@empty
4325
\let\@evenhead\@empty
4326
\let\@oddfoot\@empty
4327
\let\@evenfoot\@empty
4328
% will change later if the mode requires otherwise
4329
\ifCLASSOPTIONdraftcls
4331
\ifCLASSOPTIONdraftclsnofoot\else
4332
% but only if not draftclsnofoot
4333
\def\@oddfoot{\@IEEEfooterstyle\@date\hfil DRAFT}\relax
4334
\def\@evenfoot{\@IEEEfooterstyle DRAFT\hfil\@date}\relax
4337
% all nondraft mode footers
4339
% for peer review cover pages that are using a pubid
4340
% for noncompsoc papers, the pubid uses footnotesize and
4341
% is at the same vertical position as where the last baseline would normally be
4342
\def\@oddfoot{\hbox{}\hss\@IEEEfooterstyle\footnotesize\raisebox{\footskip}[0pt][0pt]{\@IEEEpubid}\hss\hbox{}}\relax
4343
\def\@evenfoot{\hbox{}\hss\@IEEEfooterstyle\footnotesize\raisebox{\footskip}[0pt][0pt]{\@IEEEpubid}\hss\hbox{}}\relax
4344
\ifCLASSOPTIONcompsoc
4345
% for compsoc papers, the pubid is at the same vertical position as the normal footer
4346
\def\@oddfoot{\hbox{}\hss\@IEEEfooterstyle\raisebox{0pt}[0pt][0pt]{\@IEEEpubid}\hss\hbox{}}\relax
4347
\def\@evenfoot{\hbox{}\hss\@IEEEfooterstyle\raisebox{0pt}[0pt][0pt]{\@IEEEpubid}\hss\hbox{}}\relax
4354
%% Defines the command for putting the header.
3054
4355
%% Note that all the text is forced into uppercase, if you have some text
3055
4356
%% that needs to be in lower case, for instance et. al., then either manually
3056
4357
%% set \leftmark and \rightmark or use \MakeLowercase{et. al.} within the
3057
4358
%% arguments to \markboth.
3058
\def\markboth#1#2{\def\leftmark{\@IEEEcompsoconly{\sffamily}\MakeUppercase{#1}}%
3059
\def\rightmark{\@IEEEcompsoconly{\sffamily}\MakeUppercase{#2}}}
3060
\def\footernote#1{\markboth{#1}{#1}}
4359
%% V1.7b add \protect to work with Babel
4360
\def\markboth#1#2{\def\leftmark{\MakeUppercase{\protect#1}}%
4361
\def\rightmark{\MakeUppercase{\protect#2}}}
3062
4363
\def\today{\ifcase\month\or
3063
4364
January\or February\or March\or April\or May\or June\or
3573
% This is a dynamically determined rigid spacer between the title/authors
3574
% and the main text. This is used only for single column titles over two
3575
% column text (most common)
3576
% This is bit tricky because we have to ensure that the textheight of the
3577
% main text is an integer multiple of \baselineskip
3578
% otherwise underfull vbox problems may develop in the second column of the
3579
% text on the titlepage
3580
% The possible use of \IEEEpubid must also be taken into account.
3581
\def\@IEEEdynamictitlevspace{{%
3582
% we run within a group so that all the macros can be forgotten when we are done
3583
\long\def\thanks##1{\relax}%don't allow \thanks to run when we evaluate the vbox height
3584
\long\def\IEEEcompsocitemizethanks##1{\relax}%don't allow \IEEEcompsocitemizethanks to run when we evaluate the vbox height
3585
\normalfont\normalsize% we declare more descriptive variable names
3586
\let\@IEEEmaintextheight=\@IEEEtrantmpdimenA%height of the main text columns
3587
\let\@IEEEINTmaintextheight=\@IEEEtrantmpdimenB%height of the main text columns with integer # lines
3588
% set the nominal and minimum values for the title spacer
3589
% the dynamic algorithm will not allow the spacer size to
3590
% become less than \@IEEEMINtitlevspace - instead it will be
3592
% default to journal values
3593
\def\@IEEENORMtitlevspace{2.5\baselineskip}%
3594
\def\@IEEEMINtitlevspace{2\baselineskip}%
3595
% conferences and technotes need tighter spacing
3596
\ifCLASSOPTIONconference%conference
3597
\def\@IEEENORMtitlevspace{1\baselineskip}%
3598
\def\@IEEEMINtitlevspace{0.75\baselineskip}%
3600
\ifCLASSOPTIONtechnote%technote
3601
\def\@IEEENORMtitlevspace{1\baselineskip}%
3602
\def\@IEEEMINtitlevspace{0.75\baselineskip}%
3604
% get the height that the title will take up
3605
\ifCLASSOPTIONpeerreview
3606
\settoheight{\@IEEEmaintextheight}{\vbox{\hsize\textwidth \@IEEEpeerreviewmaketitle}}%
3608
\settoheight{\@IEEEmaintextheight}{\vbox{\hsize\textwidth \@maketitle}}%
3610
\@IEEEmaintextheight=-\@IEEEmaintextheight% title takes away from maintext, so reverse sign
3611
% add the height of the page textheight
3612
\advance\@IEEEmaintextheight by \textheight%
3613
% correct for title pages using pubid
3614
\ifCLASSOPTIONpeerreview\else
3615
% peerreview papers use the pubid on the cover page only.
3616
% And the cover page uses a static spacer.
3617
\if@IEEEusingpubid\advance\@IEEEmaintextheight by -\@IEEEpubidpullup\fi
3619
% subtract off the nominal value of the title bottom spacer
3620
\advance\@IEEEmaintextheight by -\@IEEENORMtitlevspace%
3621
% \topskip takes away some too
3622
\advance\@IEEEmaintextheight by -\topskip%
3623
% calculate the column height of the main text for lines
3624
% now we calculate the main text height as if holding
3625
% an integer number of \normalsize lines after the first
3626
% and discard any excess fractional remainder
3627
% we subtracted the first line, because the first line
3628
% is placed \topskip into the maintext, not \baselineskip like the
3629
% rest of the lines.
3630
\@IEEEINTmaintextheight=\@IEEEmaintextheight%
3631
\divide\@IEEEINTmaintextheight by \baselineskip%
3632
\multiply\@IEEEINTmaintextheight by \baselineskip%
3633
% now we calculate how much the title spacer height will
3634
% have to be reduced from nominal (\@IEEEREDUCEmaintextheight is always
3635
% a positive value) so that the maintext area will contain an integer
3636
% number of normal size lines
3637
% we change variable names here (to avoid confusion) as we no longer
3638
% need \@IEEEINTmaintextheight and can reuse its dimen register
3639
\let\@IEEEREDUCEmaintextheight=\@IEEEINTmaintextheight%
3640
\advance\@IEEEREDUCEmaintextheight by -\@IEEEmaintextheight%
3641
\advance\@IEEEREDUCEmaintextheight by \baselineskip%
3642
% this is the calculated height of the spacer
3643
% we change variable names here (to avoid confusion) as we no longer
3644
% need \@IEEEmaintextheight and can reuse its dimen register
3645
\let\@IEEECOMPENSATElen=\@IEEEmaintextheight%
3646
\@IEEECOMPENSATElen=\@IEEENORMtitlevspace% set the nominal value
3647
% we go with the reduced length if it is smaller than an increase
3648
\ifdim\@IEEEREDUCEmaintextheight < 0.5\baselineskip\relax%
3649
\advance\@IEEECOMPENSATElen by -\@IEEEREDUCEmaintextheight%
3650
% if the resulting spacer is too small back out and go with an increase instead
3651
\ifdim\@IEEECOMPENSATElen<\@IEEEMINtitlevspace\relax%
3652
\advance\@IEEECOMPENSATElen by \baselineskip%
3655
% go with an increase because it is closer to the nominal than a decrease
3656
\advance\@IEEECOMPENSATElen by -\@IEEEREDUCEmaintextheight%
3657
\advance\@IEEECOMPENSATElen by \baselineskip%
3659
% set the calculated rigid spacer
3660
\vspace{\@IEEECOMPENSATElen}}}
4965
% set the nominal and minimum values for the quantized title spacer
4966
% the quantization algorithm will not allow the spacer size to
4967
% become less than \@IEEEMINtitlevspace - instead it will be lengthened
4968
% default to journal values
4969
\def\@IEEENORMtitlevspace{2.5\baselineskip}
4970
\def\@IEEEMINtitlevspace{2\baselineskip}
4971
% conferences and technotes need tighter spacing
4972
\ifCLASSOPTIONconference% conference
4973
\def\@IEEENORMtitlevspace{1\baselineskip}
4974
\def\@IEEEMINtitlevspace{0.75\baselineskip}
4976
\ifCLASSOPTIONtechnote% technote
4977
\def\@IEEENORMtitlevspace{1\baselineskip}
4978
\def\@IEEEMINtitlevspace{0.75\baselineskip}
4983
\def\IEEEquantizevspace{\begingroup\@ifstar{\@IEEEquantizevspacestarformtrue\@IEEEquantizevspace}{\@IEEEquantizevspacestarformfalse\@IEEEquantizevspace}}
4984
% \IEEEquantizevspace[output dimen register]{object}[object decl]
4985
% {top baselineskip}
4986
% [offset][prevdepth][lineskip limit][lineskip]
4987
% {unit height}{nominal vspace}{minimum vspace}
4989
% Calculates and creates the vspace needed to make the combined height with
4990
% the given object an integer multiple of the given unit height. This command
4991
% is more general than the older \@IEEEdynamictitlevspace it replaces.
4993
% The star form has no effect at present, but is reserved for future use.
4995
% If the optional argument [output dimen register] is given, the calculated
4996
% vspace height is stored in the given output dimen (or skip) register
4997
% and no other action is taken, otherwise the object followed by a vspace*
4998
% of the appropriate height is evaluated/output.
5000
% The optional object decl (declarations) is code that is evaluated just
5001
% before the object's height is evaluated. Its intented purpose is to allow
5002
% for the alteration or disabling of code within the object during internal
5003
% height evaluation (e.g., \long\def\thanks#1{\relax} ).
5004
% This special code is not invoked if/when the object is rendered at the end.
5006
% The nominal vspace is the target value of the added vspace and the minimum
5007
% vspace is the lower allowed limit. The vspacer will be the value that achieves
5008
% integral overall height, in terms of the given unit height, that is closest
5009
% to the nominal vspace and that is not less than the specified minimum vspace.
5011
% The line spacing algorithm of TeX is somewhat involved and requires special
5012
% care with regard to the first line of a vertical list (which is indicated
5013
% when \prevdepth is -1000pt or less). top baselineskip specifies the
5014
% baselineskip or topskip used prior to the object. If the height of the
5015
% first line of the object is greater than the given top baselineskip, then
5016
% the top baselineskip is subtracted from the height of the first line and
5017
% that difference is considered along with the rest of the object height
5018
% (because the object will be shifted down by an amount =
5019
% top line height - top baselineskip). Otherwise, the height of the first line
5020
% of the object is ignored as far as the calculations are concerned.
5021
% This algorithm is adequate for objects that appear at the top of a page
5022
% (e.g., titles) where \topskip spacing is used.
5024
% However, as explained on page 78 of the TeXbook, interline spacing is more
5025
% complex when \baselineskip is being used (indicated by \prevdepth >
5026
% -1000pt). The four optional parameters offset, prevdepth, lineskip limit and
5027
% lineskip are assumed to be equal to be 0pt, \prevdepth, \lineskiplimit and
5028
% \lineskip, respectively, if they are omitted.
5030
% The prevdepth is the depth of the line before the object, the lineskip limit
5031
% specifies how close the top of the object can come to the bottom of the
5032
% previous line before \baselineskip is ignored and \lineskip is inserted
5033
% between the object and the line above it. Lineskip does not come into
5034
% play unless the first line of the object is high enough to "get too close"
5035
% (as specified by lineskiplimit) to the line before it. The the prevdepth,
5036
% lineskip limit, and lineskip optional parameters are not needed for the
5037
% first object/line on a page (i.e., prevdepth <= -1000pt) where the simplier
5038
% \topskip spacing rules are in effect.
5040
% Offset is a manual adjustment that is added to the height calculations of
5041
% object irrespective of the value of \prevdepth. It is useful when the top
5042
% baselineskip will result in a noninteger unit height object placement even
5043
% if the object itself has integral height. e.g., a footnotesize baselineskip
5044
% is used before the object, thus an offset of, say -3pt, can be given as a
5047
% Common combinations of these parameters include:
5049
% top baselineskip: (and default values for offset, prevdepth, etc.)
5050
% \topskip % for objects that appear at the top of a page
5051
% \maxdimen % always ignore the height of the top line
5052
% 0pt % always consider any positive height of the top line
5054
% for objects to appear inline in normal text:
5055
% top baselineskip = \baselineskip
5057
% set prevdepth = -1000pt and top baselineskip = 0pt to consider the
5058
% overall height of the object without any other external skip
5061
\newif\if@IEEEquantizevspacestarform % flag to indicate star form
5062
\newif\if@IEEEquantizevspaceuseoutdimenreg % flag to indicate output dimen register is to be used
5063
% Use our own private registers because the object could contain a
5064
% structure that uses the existing tmp scratch pad registers
5065
\newdimen\@IEEEquantizeheightA
5066
\newdimen\@IEEEquantizeheightB
5067
\newdimen\@IEEEquantizeheightC
5068
\newdimen\@IEEEquantizeprevdepth % need to save this early as can change
5069
\newcount\@IEEEquantizemultiple
5070
\newbox\@IEEEquantizeboxA
5073
\def\@IEEEquantizevspace{\@ifnextchar [{\@IEEEquantizevspaceuseoutdimenregtrue\@@IEEEquantizevspace}{\@IEEEquantizevspaceuseoutdimenregfalse\@@IEEEquantizevspace[]}}
5076
\long\def\@@IEEEquantizevspace[#1]#2{\relax
5078
% #1 optional output dimen register
5080
\edef\@IEEEquantizeoutdimenreg{#1}\relax
5081
% allow for object specifications that contain parameters
5082
\@IEEEtrantmptoksA={#2}\relax
5083
\long\edef\@IEEEquantizeobject{\the\@IEEEtrantmptoksA}\relax
5084
\@ifnextchar [{\@@@IEEEquantizevspace}{\@@@IEEEquantizevspace[\relax]}}
5086
\long\def\@@@IEEEquantizevspace[#1]#2{\relax
5088
% [#1] optional object decl, is \relax if not given by user
5089
% #2 top baselineskip
5090
% allow for object decl specifications that have parameters
5091
\@IEEEtrantmptoksA={#1}\relax
5092
\long\edef\@IEEEquantizeobjectdecl{\the\@IEEEtrantmptoksA}\relax
5093
\edef\@IEEEquantizetopbaselineskip{#2}\ivIEEEquantizevspace}
5095
% acquire optional argument set and store
5096
% [offset][prevdepth][lineskip limit][lineskip]
5097
\def\ivIEEEquantizevspace{\@ifnextchar [{\@vIEEEquantizevspace}{\@vIEEEquantizevspace[0pt]}}
5098
\def\@vIEEEquantizevspace[#1]{\edef\@IEEEquantizeoffset{#1}\@ifnextchar [{\@viIEEEquantizevspace}{\@viIEEEquantizevspace[\prevdepth]}}
5099
\def\@viIEEEquantizevspace[#1]{\@IEEEquantizeprevdepth=#1\relax\@ifnextchar [{\@viiIEEEquantizevspace}{\@viiIEEEquantizevspace[\lineskiplimit]}}
5100
\def\@viiIEEEquantizevspace[#1]{\edef\@IEEEquantizelineskiplimit{#1}\@ifnextchar [{\@viiiIEEEquantizevspace}{\@viiiIEEEquantizevspace[\lineskip]}}
5101
\def\@viiiIEEEquantizevspace[#1]{\edef\@IEEEquantizelineskip{#1}\@ixIEEEquantizevspace}
5104
\def\@ixIEEEquantizevspace#1#2#3{\relax
5105
\edef\@IEEEquantizeunitheight{#1}\relax
5106
\edef\@IEEEquantizenomvspace{#2}\relax
5107
\edef\@IEEEquantizeminvspace{#3}\relax
5108
% \@IEEEquantizeoutdimenreg
5109
% \@IEEEquantizeobject
5110
% \@IEEEquantizeobjectdecl
5111
% \@IEEEquantizetopbaselineskip
5112
% \@IEEEquantizeoffset
5113
% \@IEEEquantizeprevdepth
5114
% \@IEEEquantizelineskiplimit
5115
% \@IEEEquantizelineskip
5116
% \@IEEEquantizeunitheight
5117
% \@IEEEquantizenomvspace
5118
% \@IEEEquantizeminvspace
5119
% get overall height of object
5120
\setbox\@IEEEquantizeboxA\vbox{\begingroup\@IEEEquantizeobjectdecl\@IEEEquantizeobject\relax\endgroup}\relax
5121
\@IEEEquantizeheightA\ht\@IEEEquantizeboxA\relax
5122
% get height of first line of object
5123
\setbox\@IEEEquantizeboxA\vtop{\begingroup\@IEEEquantizeobjectdecl\@IEEEquantizeobject\relax\endgroup}\relax
5124
\@IEEEquantizeheightB\ht\@IEEEquantizeboxA\relax
5125
\ifdim\@IEEEquantizeprevdepth>-1000pt\relax % prevdepth > -1000pf means full baselineskip\lineskip rules in effect
5126
% lineskip spacing rule takes effect if height of top line > baselineskip - prevdepth - lineskiplimit,
5127
% otherwise the baselineskip rule is in effect and the height of the first line does not matter at all.
5128
\@IEEEquantizeheightC=\@IEEEquantizetopbaselineskip\relax
5129
\advance\@IEEEquantizeheightC-\@IEEEquantizeprevdepth\relax
5130
\advance\@IEEEquantizeheightC-\@IEEEquantizelineskiplimit\relax % this works even though \@IEEEquantizelineskiplimit is a macro because TeX allows --10pt notation
5131
\ifdim\@IEEEquantizeheightB>\@IEEEquantizeheightC\relax
5132
% lineskip spacing rule is in effect i.e., the object is going to be shifted down relative to the
5133
% baselineskip set position by its top line height (already a part of the total height) + prevdepth + lineskip - baselineskip
5134
\advance\@IEEEquantizeheightA\@IEEEquantizeprevdepth\relax
5135
\advance\@IEEEquantizeheightA\@IEEEquantizelineskip\relax
5136
\advance\@IEEEquantizeheightA-\@IEEEquantizetopbaselineskip\relax
5138
% height of first line <= \@IEEEquantizetopbaselineskip - \@IEEEquantizeprevdepth - \@IEEEquantizelineskiplimit
5139
% standard baselineskip rules are in effect, so don't consider height of first line
5140
\advance\@IEEEquantizeheightA-\@IEEEquantizeheightB\relax
5143
\else % prevdepth <= -1000pt, simplier \topskip type rules in effect
5144
\ifdim\@IEEEquantizeheightB>\@IEEEquantizetopbaselineskip
5145
% height of top line (already included in the total height) in excess of
5146
% baselineskip is the amount it will be downshifted
5147
\advance\@IEEEquantizeheightA-\@IEEEquantizetopbaselineskip\relax
5149
% height of first line is irrelevant, remove it
5150
\advance\@IEEEquantizeheightA-\@IEEEquantizeheightB\relax
5152
\fi % prevdepth <= -1000pt
5154
% adjust height for any manual offset
5155
\advance\@IEEEquantizeheightA\@IEEEquantizeoffset\relax
5156
% add in nominal spacer
5157
\advance\@IEEEquantizeheightA\@IEEEquantizenomvspace\relax
5158
% check for nonzero unitheight
5159
\@IEEEquantizeheightB=\@IEEEquantizeunitheight\relax
5160
\ifnum\@IEEEquantizeheightB=0\relax
5161
\@IEEEclspkgerror{IEEEquantizevspace unit height cannot be zero. Assuming 10pt.}%
5162
{Division by zero is not allowed.}
5163
\@IEEEquantizeheightB=10pt\relax
5165
% get integer number of lines
5166
\@IEEEquantizemultiple=\@IEEEquantizeheightA\relax
5167
\divide\@IEEEquantizemultiple\@IEEEquantizeheightB\relax
5168
% set A to contain the excess height over the \@IEEEquantizemultiple of lines
5169
% A = height - multiple*unitheight
5170
\@IEEEquantizeheightC\@IEEEquantizeheightB\relax
5171
\multiply\@IEEEquantizeheightC\@IEEEquantizemultiple\relax
5172
\advance\@IEEEquantizeheightA-\@IEEEquantizeheightC\relax
5173
% set B to contain the height short of \@IEEEquantizemultiple+1 of lines
5174
% B = unitheight - A
5175
\advance\@IEEEquantizeheightB-\@IEEEquantizeheightA\relax
5176
% choose A or B based on which is closer
5177
\@IEEEquantizeheightC\@IEEEquantizenomvspace\relax
5178
\ifdim\@IEEEquantizeheightA<\@IEEEquantizeheightB\relax
5179
% C = nomvspace - A, go with lower
5180
\advance\@IEEEquantizeheightC-\@IEEEquantizeheightA\relax
5182
% C = nomvspace + B, go with upper
5183
\advance\@IEEEquantizeheightC\@IEEEquantizeheightB\relax
5185
% if violate lower bound, use next integer bound
5186
\ifdim\@IEEEquantizeheightC<\@IEEEquantizeminvspace\relax
5187
% A + B = unitheight
5188
\advance\@IEEEquantizeheightC\@IEEEquantizeheightA\relax
5189
\advance\@IEEEquantizeheightC\@IEEEquantizeheightB\relax
5191
% export object and spacer outside of group
5192
\global\let\@IEEEquantizeobjectout\@IEEEquantizeobject\relax
5193
\global\@IEEEquantizeheightC\@IEEEquantizeheightC\relax
5195
\if@IEEEquantizevspaceuseoutdimenreg
5196
\@IEEEquantizeoutdimenreg=\@IEEEquantizeheightC\relax
5198
\@IEEEquantizeobjectout\relax
5199
\vskip\@IEEEquantizeheightC\relax
5203
% user command to disable all global assignments, possible use within object decl
5204
\def\IEEEquantizedisableglobal{\let\global\relax
5207
% user command to allow for the disabling of \thanks and other commands, possible use within object decl
5208
\def\IEEEquantizedisabletitlecmds{\long\def\thanks##1{\relax}\relax
5209
\long\def\IEEEcompsocitemizethanks##1{\relax}\def\newpage{\relax}}