1. %\def\currversion{April 15, 2008}
  2. \def\currversion{October 04, 2013}
  3. %*****************************************************************%
  4. %* *%
  5. %* Prepared by Amy Hendrickson, TeXnology Inc. *%
  6. %* Copyright (C) 2004 by Amy Hendrickson, TeXnology Inc., *%
  7. %* All rights reserved. *%
  8. %* *%
  9. %* TeXnology Inc.: 617 738-8029 *%
  10. %* www.texnology.com *%
  11. %* *%
  12. %* For assistance, please contact the PNAS Editorial Office: *%
  13. %* 202-334-2679 *%
  14. %* *%
  15. %*****************************************************************%
  16. \typeout{^^J^^J
  17. Two Column Journal Style for the^^J
  18. Proceedings of the National Academy of Science
  19. J
  20. Written by Amy Hendrickson, TeXnology, Inc., 9/04^^J
  21. J
  22. This version is dated \currversion^^J^^J}
  23. \ProvidesClass{pnastwo}
  24. \newcommand\@ptsize{}
  25. \newif\if@restonecol
  26. \newif\if@titlepage
  27. \@titlepagefalse
  28. \if@compatibility\else
  29. \DeclareOption{a4paper}
  30. {\setlength\paperheight {297mm}%
  31. \setlength\paperwidth {210mm}}
  32. \DeclareOption{a5paper}
  33. {\setlength\paperheight {210mm}%
  34. \setlength\paperwidth {148mm}}
  35. \DeclareOption{b5paper}
  36. {\setlength\paperheight {250mm}%
  37. \setlength\paperwidth {176mm}}
  38. \DeclareOption{letterpaper}
  39. {\setlength\paperheight {16in}%
  40. \setlength\paperwidth {13.5in}}
  41. \DeclareOption{legalpaper}
  42. {\setlength\paperheight {14in}%
  43. \setlength\paperwidth {8.5in}}
  44. \DeclareOption{executivepaper}
  45. {\setlength\paperheight {10.5in}%
  46. \setlength\paperwidth {7.25in}}
  47. \DeclareOption{landscape}
  48. {\setlength\@tempdima {\paperheight}%
  49. \setlength\paperheight {\paperwidth}%
  50. \setlength\paperwidth {\@tempdima}}
  51. \DeclareOption{pnaspaper}
  52. {\setlength\paperheight {11.87in}%
  53. \setlength\paperwidth {9.12in}}
  54. \fi
  55. \if@compatibility
  56. \renewcommand\@ptsize{0}
  57. \else
  58. \DeclareOption{10pt}{\renewcommand\@ptsize{0}}
  59. \fi
  60. \DeclareOption{11pt}{\renewcommand\@ptsize{1}}
  61. \DeclareOption{12pt}{\renewcommand\@ptsize{2}}
  62. \if@compatibility\else
  63. \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
  64. \fi
  65. \DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
  66. \DeclareOption{draft}{\setlength\overfullrule{5pt}}
  67. \if@compatibility\else
  68. \DeclareOption{final}{\setlength\overfullrule{0pt}}
  69. \fi
  70. \DeclareOption{titlepage}{\@titlepagetrue}
  71. \if@compatibility\else
  72. \DeclareOption{notitlepage}{\@titlepagefalse}
  73. \fi
  74. \if@compatibility\else
  75. \DeclareOption{onecolumn}{\@twocolumnfalse}
  76. \fi
  77. \DeclareOption{twocolumn}{\@twocolumntrue}
  78. \DeclareOption{leqno}{\input{leqno.clo}}
  79. \DeclareOption{fleqn}{\input{fleqn.clo}}
  80. \DeclareOption{openbib}{%
  81. \AtEndOfPackage{%
  82. \renewcommand\@[email protected]{%
  83. \advance\leftmargin\bibindent
  84. \itemindent -\bibindent
  85. \listparindent \itemindent
  86. \parsep \z@
  87. }%
  88. \renewcommand\newblock{\par}}%
  89. }
  90. \ExecuteOptions{pnaspaper,twoside,onecolumn,final}
  91. \ProcessOptions
  92. \AtBeginDocument{
  93. \RequirePackage[cam,center]{crop}
  94. \paperwidth=8.125in
  95. \paperheight=10.875in
  96. \renewcommand*\CROP@horigin{-.5truein}
  97. \renewcommand*\CROP@vorigin{-.5truein}
  98. }%
  99. %% size10.clo ==>>
  100. \renewcommand\normalsize{%
  101. \@setfontsize\normalsize\@ixpt\@xpt
  102. \abovedisplayskip 8\p@ \@plus2\p@ \@minus5\p@
  103. \abovedisplayshortskip \z@ \@plus3\p@
  104. \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
  105. \belowdisplayskip \abovedisplayskip
  106. \topsep 0\p@
  107. \parsep 0\p@
  108. \let\@listi\@listI}
  109. \normalsize
  110. \topsep 0\p@
  111. \parsep 0\p@
  112. \newcommand\small{%
  113. \@setfontsize\small\@viiipt{9}%
  114. \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
  115. \abovedisplayshortskip \z@ \@plus2\p@
  116. \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
  117. \def\@listi{\leftmargin\leftmargini
  118. \topsep 0\p@
  119. \parsep 0\p@
  120. \itemsep \parsep}%
  121. \belowdisplayskip \abovedisplayskip
  122. }
  123. \newcommand\footnotesize{%
  124. \@setfontsize\footnotesize\@vipt{7}%
  125. \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
  126. \abovedisplayshortskip \z@ \@plus\p@
  127. \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
  128. \def\@listi{\leftmargin\leftmargini
  129. \topsep 3\p@ \@plus\p@ \@minus\p@
  130. \parsep 2\p@ \@plus\p@ \@minus\p@
  131. \itemsep \parsep}%
  132. \belowdisplayskip \abovedisplayskip
  133. }
  134. \newcommand\scriptsize{\@setfontsize\scriptsize\@vpt\@viipt}
  135. \newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
  136. \newcommand\large{\@setfontsize\large\@xiipt{14}}
  137. \newcommand\Large{\@setfontsize\Large\@xivpt{18}}
  138. \newcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
  139. \newcommand\huge{\@setfontsize\huge\@xxpt{25}}
  140. \newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
  141. \if@twocolumn
  142. \setlength\parindent{1em}
  143. \else
  144. \setlength\parindent{9\p@}%15\[email protected]}
  145. \fi
  146. \setlength\smallskipamount{3\p@ \@plus 1\p@ \@minus 1\p@}
  147. \setlength\medskipamount{6\p@ \@plus 2\p@ \@minus 2\p@}
  148. \setlength\bigskipamount{12\p@ \@plus 4\p@ \@minus 4\p@}
  149. \setlength\headheight{12\p@}
  150. \setlength\headsep {25\p@}
  151. \setlength\topskip {10\p@}
  152. \setlength\footskip{30\p@}
  153. \if@compatibility \setlength\maxdepth{4\p@} \else
  154. \setlength\maxdepth{.5\topskip} \fi
  155. \if@compatibility
  156. \if@twocolumn
  157. \setlength\textwidth{410\p@}
  158. \else
  159. \setlength\textwidth{345\p@}
  160. \fi
  161. \else
  162. \setlength\@tempdima{\paperwidth}
  163. \addtolength\@tempdima{-2in}
  164. \setlength\@tempdimb{345\p@}
  165. \if@twocolumn
  166. \ifdim\@tempdima>2\@tempdimb\relax
  167. \setlength\textwidth{2\@tempdimb}
  168. \else
  169. \setlength\textwidth{\@tempdima}
  170. \fi
  171. \else
  172. \ifdim\@tempdima>\@tempdimb\relax
  173. \setlength\textwidth{\@tempdimb}
  174. \else
  175. \setlength\textwidth{\@tempdima}
  176. \fi
  177. \fi
  178. \fi
  179. \if@compatibility\else
  180. \@settopoint\textwidth
  181. \fi
  182. \if@compatibility
  183. \setlength\textheight{43\baselineskip}
  184. \else
  185. \setlength\@tempdima{\paperheight}
  186. \addtolength\@tempdima{-2in}
  187. \addtolength\@tempdima{-1.5in}
  188. \divide\@tempdima\baselineskip
  189. \@tempcnta=\@tempdima
  190. \setlength\textheight{\@tempcnta\baselineskip}
  191. \fi
  192. \addtolength\textheight{\topskip}
  193. \if@twocolumn
  194. \setlength\marginparsep {10\p@}
  195. \else
  196. \setlength\marginparsep{11\p@}
  197. \fi
  198. \setlength\marginparpush{5\p@}
  199. \if@compatibility
  200. \if@twoside
  201. \setlength\oddsidemargin {44\p@}
  202. \setlength\evensidemargin {82\p@}
  203. \setlength\marginparwidth {107\p@}
  204. \else
  205. \setlength\oddsidemargin {63\p@}
  206. \setlength\evensidemargin {63\p@}
  207. \setlength\marginparwidth {90\p@}
  208. \fi
  209. \if@twocolumn
  210. \setlength\oddsidemargin {30\p@}
  211. \setlength\evensidemargin {30\p@}
  212. \setlength\marginparwidth {48\p@}
  213. \fi
  214. \else
  215. \if@twoside
  216. \setlength\@tempdima {\paperwidth}
  217. \addtolength\@tempdima {-\textwidth}
  218. \setlength\oddsidemargin {.4\@tempdima}
  219. \addtolength\oddsidemargin {-1in}
  220. \setlength\marginparwidth {.6\@tempdima}
  221. \addtolength\marginparwidth {-\marginparsep}
  222. \addtolength\marginparwidth {-0.4in}
  223. \else
  224. \setlength\@tempdima {\paperwidth}
  225. \addtolength\@tempdima {-\textwidth}
  226. \setlength\oddsidemargin {.5\@tempdima}
  227. \addtolength\oddsidemargin {-1in}
  228. \setlength\marginparwidth {.5\@tempdima}
  229. \addtolength\marginparwidth {-\marginparsep}
  230. \addtolength\marginparwidth {-0.4in}
  231. \addtolength\marginparwidth {-.4in}
  232. \fi
  233. \ifdim \marginparwidth >2in
  234. \setlength\marginparwidth{2in}
  235. \fi
  236. \@settopoint\oddsidemargin
  237. \@settopoint\marginparwidth
  238. \setlength\evensidemargin {\paperwidth}
  239. \addtolength\evensidemargin{-2in}
  240. \addtolength\evensidemargin{-\textwidth}
  241. \addtolength\evensidemargin{-\oddsidemargin}
  242. \@settopoint\evensidemargin
  243. \fi
  244. \if@compatibility
  245. \setlength\topmargin{27pt}
  246. \else
  247. \setlength\topmargin{\paperheight}
  248. \addtolength\topmargin{-3.3in}
  249. \addtolength\topmargin{-\headheight}
  250. \addtolength\topmargin{-\headsep}
  251. \addtolength\topmargin{-\textheight}
  252. \addtolength\topmargin{-\footskip} % this might be wrong!
  253. \addtolength\topmargin{-.5\topmargin}
  254. \@settopoint\topmargin
  255. \fi
  256. \setlength\footnotesep{6.65\p@}
  257. \setlength{\skip\footins}{19\p@ \@plus 4\p@ \@minus 2\p@}
  258. \setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@}
  259. \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
  260. \setlength\intextsep {12\p@ \@plus 2\p@ \@minus 2\p@}
  261. \setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@}
  262. \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}
  263. \setlength\@fptop{0\p@ \@plus 1fil}
  264. \setlength\@fpsep{8\p@ \@plus 2fil}
  265. \setlength\@fpbot{0\p@ \@plus 1fil}
  266. \setlength\@dblfptop{0\p@ \@plus 1fil}
  267. \setlength\@dblfpsep{8\p@ \@plus 2fil}
  268. \setlength\@dblfpbot{0\p@ \@plus 1fil}
  269. \setlength\partopsep{2\p@ \@plus 1\p@ \@minus 1\p@}
  270. \def\@listi{\leftmargin\leftmargini
  271. \topsep 8\p@ \@plus2\p@ \@minus4\p@
  272. }
  273. \let\@listI\@listi
  274. \@listi
  275. \def\@listii {\leftmargin\leftmarginii
  276. \labelwidth\leftmarginii
  277. \advance\labelwidth-\labelsep
  278. \topsep 4\p@ \@plus2\p@ \@minus\p@
  279. \parsep 2\p@ \@plus\p@ \@minus\p@
  280. \itemsep \parsep}
  281. \def\@listiii{\leftmargin\leftmarginiii
  282. \labelwidth\leftmarginiii
  283. \advance\labelwidth-\labelsep
  284. \topsep 2\p@ \@plus\p@\@minus\p@
  285. \parsep \z@
  286. \partopsep \p@ \@plus\z@ \@minus\p@
  287. \itemsep \topsep}
  288. \def\@listiv {\leftmargin\leftmarginiv
  289. \labelwidth\leftmarginiv
  290. \advance\labelwidth-\labelsep}
  291. \def\@listv {\leftmargin\leftmarginv
  292. \labelwidth\leftmarginv
  293. \advance\labelwidth-\labelsep}
  294. \def\@listvi {\leftmargin\leftmarginvi
  295. \labelwidth\leftmarginvi
  296. \advance\labelwidth-\labelsep}
  297. %% <<== size10.clo
  298. \setlength\lineskip{1\p@}
  299. \setlength\normallineskip{1\p@}
  300. \renewcommand\baselinestretch{}
  301. \setlength\parskip{0\p@ \@plus \p@}
  302. \@lowpenalty 51
  303. \@medpenalty 151
  304. \@highpenalty 301
  305. \setcounter{topnumber}{2}
  306. \renewcommand\topfraction{.7}
  307. \setcounter{bottomnumber}{1}
  308. \renewcommand\bottomfraction{.3}
  309. \setcounter{totalnumber}{3}
  310. \renewcommand\textfraction{.2}
  311. \renewcommand\floatpagefraction{.5}
  312. \setcounter{dbltopnumber}{2}
  313. \renewcommand\dbltopfraction{.7}
  314. \renewcommand\dblfloatpagefraction{.5}
  315. \newif\iftitlepage
  316. \def\ps@headings{%
  317. \let\@evenhead\relax
  318. \def\@oddhead{\hfill\rlap{\hskip14pt\vtop to 0pt{\vskip-1pt\makesidesquares
  319. \vss}}}%
  320. \def\@oddfoot{%
  321. %\leftnumber
  322. {\dospecialaccents%
  323. \iftitlepage\global\titlepagefalse%
  324. \footlinefont
  325. \hbox to \textwidth{\footlinefont \let\it\footlineit
  326. %\theurl\hfill\footlinefont PNAS\hskip6pt \vrule depth 2pt\hskip6pt
  327. %{\foliofont\theissuedate}\hskip6pt\vrule\hskip6pt\thevolume\hskip6pt
  328. %\vrule\hskip6pt\theissuenumber\hskip6pt \vrule\hskip6pt
  329. %{\foliofont\the\[email protected]{\footlineit--}\expandafter\ifx\csname
  330. %lastpage\endcsname\relax ??\else\lastpage\fi}
  331. }%
  332. \else
  333. \hbox to \textwidth{\footlinefont \let\it\footlineit
  334. {
  335. %\foliofont\the\[email protected]{\footlineit--}\expandafter\ifx\csname
  336. %lastpage\endcsname\relax ??\else\lastpage
  337. \fi
  338. }\hskip6pt
  339. %\vrule depth 2pt\hskip6pt PNAS\hskip6pt
  340. %\vrule\hskip6pt{\foliofont\theissuedate}\hskip6pt\vrule\hskip6pt
  341. %\thevolume\hskip6pt\vrule\hskip6pt\theissuenumber\hfill
  342. }%
  343. %\theurl}%
  344. \fi\else%
  345. %\hbox to\textwidth{{\let\it\footlineit\footlinefont\thefootlineauthor}\hfill
  346. %\footlinefont PNAS\hskip6pt\vrule depth 2pt\hskip6pt{\foliofont\theissuedate}%
  347. %\hskip6pt\vrule depth2pt\hskip6pt\thevolume\hskip6pt\vrule depth 2pt\hskip6pt\theissuenumber\hskip6pt\vrule\hskip6pt{\foliofont\the\[email protected]}
  348. %}%
  349. \else%
  350. %\hbox to\textwidth{\let\it\footlineit\footlinefont{\foliofont \the\[email protected]}%
  351. %\hskip6pt\vrule depth 2pt height 6pt\hskip6pt\theurl\hfill\thefootlineauthor}
  352. \fi\fi}
  353. }
  354. \let\@evenfoot\@oddfoot
  355. %
  356. \let\@mkboth\markboth
  357. \def\sectionmark##1{%
  358. \markboth {\MakeUppercase{%
  359. \ifnum \c@secnumdepth >\z@
  360. \thesection\quad
  361. \fi
  362. ##1}}{}}%
  363. \def\subsectionmark##1{%
  364. \markright {%
  365. \ifnum \c@secnumdepth >\@ne
  366. \thesubsection\quad
  367. \fi
  368. ##1}}}
  369. \newcount\affilcount
  370. \newcount\saveaffilcount
  371. \newcount\c@fnaffilcount
  372. \def\affil#1#2{\normalsize\affilfont\ \affilcount=#1
  373. \ifnum\affilcount>\saveaffilcount\global\saveaffilcount\affilcount\fi
  374. \expandafter\ifx\csname affil\the\affilcount\endcsname\relax
  375. \global\advance\c@footnote by1
  376. \expandafter\xdef\csname affilsymb\the\affilcount\endcsname%
  377. {\the\c@footnote}{$^{\@fnsymbol\c@footnote}$}%
  378. \expandafter\gdef\csname affil\the\affilcount\endcsname{#2}\else
  379. $^{\expandafter\@fnsymbol\csname affilsymb\the\affilcount\endcsname}$
  380. \fi\authorfont}
  381. \newcommand\maketitle{\par
  382. \global\titlepagetrue
  383. \begingroup
  384. \dospecialaccents
  385. \parindent=0pt
  386. \def\and{ and }
  387. \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
  388. \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
  389. \long\def\@makefntext##1{\parindent0pt\noindent
  390. \@textsuperscript{\normalfont\@thefnmark}##1}%
  391. \newpage
  392. \global\@topnum\z@ % Prevents figures from going at top of page.
  393. \@maketitle
  394. \@thanks
  395. % according to sample, Dec 2007, copyright no longer wanted here
  396. % \renewcommand\thefootnote{}%
  397. % \footnotetext{\vrule height 8pt width0pt\copyright \thecopyrightyear\ by The % National Academy of Sciences of the USA}
  398. \endgroup
  399. \setcounter{footnote}{0}%
  400. \global\let\thanks\relax
  401. \global\let\maketitle\relax
  402. \global\let\@maketitle\relax
  403. \global\let\@thanks\@empty
  404. \global\let\@author\@empty
  405. \global\let\@date\@empty
  406. \global\let\@title\@empty
  407. \global\let\@contributor\@empty
  408. \global\let\title\relax
  409. \global\let\date\relax
  410. \global\let\and\relax
  411. }
  412. \def\@maketitle{%
  413. \global\firsttimetrue
  414. %% To get equation numbers in square brackets and bold
  415. \gdef\tagform@##1{\maketag@@@{\bf[\hskip1pt\ignorespaces##1\unskip\@@italiccorr\hskip1pt]}}
  416. \gdef\@eqnnum{{\normalfont\bf \normalcolor [\hskip1pt\theequation\hskip1pt]}}
  417. \newpage
  418. \def\\ {\vskip1pt}
  419. \let \footnote \thanks
  420. {\hsize=\textwidth \raggedright
  421. \noindent\huge\baselineskip= 24pt\titlefont \@title \par}%
  422. \vskip6pt
  423. {\normalsize\authorfont
  424. \@author
  425. \par
  426. {\vskip4pt
  427. \raggedright
  428. \affilcount=0
  429. \footnotesize\affilfont
  430. \loop \ifnum\affilcount< \saveaffilcount
  431. \expandafter\ifx\csname affil\the\affilcount\endcsname\relax\else
  432. $^{\expandafter\@fnsymbol\csname affilsymb\the\affilcount\endcsname}$%
  433. \csname affil\the\affilcount\endcsname,\fi
  434. \global\advance\affilcount by1
  435. \repeat\ifnum\saveaffilcount=1\else\ and \fi
  436. $^{\expandafter\@fnsymbol\csname affilsymb\the\affilcount\endcsname}$%
  437. \expandafter\csname affil\the\affilcount\endcsname
  438. }}%
  439. \vskip 4pt%
  440. {\affilfont \@contributor}%
  441. \par
  442. \vskip 1.5em}
  443. \def\contributor#1{\def\@contributor{#1}}
  444. \let\@contributor\relax
  445. \contributor{Submitted to Proceedings
  446. of the National Academy of Sciences of the United States of America}
  447. \setcounter{secnumdepth}{3}
  448. \newcounter {part}
  449. \newcounter {section}
  450. \newcounter {subsection}[section]
  451. \newcounter {subsubsection}[subsection]
  452. \newcounter {paragraph}[subsubsection]
  453. \newcounter {subparagraph}[paragraph]
  454. \renewcommand \thepart {\@Roman\c@part}
  455. \renewcommand \thesection {\@arabic\c@section}
  456. \renewcommand\thesubsection {\thesection.\@arabic\c@subsection}
  457. \renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection}
  458. \renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph}
  459. \renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}
  460. \newcommand\part{%
  461. \if@noskipsec \leavevmode \fi
  462. \par
  463. \addvspace{4ex}%
  464. \@afterindentfalse
  465. \secdef\@part\@spart}
  466. \def\@part[#1]#2{%
  467. \ifnum \c@secnumdepth >\m@ne
  468. \refstepcounter{part}%
  469. \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
  470. \else
  471. \addcontentsline{toc}{part}{#1}%
  472. \fi
  473. {\parindent \z@ \raggedright
  474. \interlinepenalty \@M
  475. \normalfont
  476. \ifnum \c@secnumdepth >\m@ne
  477. \Large\bfseries \partname~\thepart
  478. \par\nobreak
  479. \fi
  480. \huge \bfseries #2%
  481. \markboth{}{}\par}%
  482. \nobreak
  483. \vskip 3ex
  484. \@afterheading}
  485. \def\@spart#1{%
  486. {\parindent \z@ \raggedright
  487. \interlinepenalty \@M
  488. \normalfont
  489. \huge \bfseries #1\par}%
  490. \nobreak
  491. \vskip 3ex
  492. \@afterheading}
  493. \def\@startsection#1#2#3#4#5#6{%
  494. \if@noskipsec \leavevmode \fi
  495. \par
  496. \@tempskipa #4\relax
  497. \@afterindenttrue
  498. \ifdim \@tempskipa <\z@
  499. \@tempskipa -\@tempskipa \@afterindentfalse
  500. \fi
  501. \if@nobreak
  502. \everypar{}%
  503. \else
  504. \addpenalty\@secpenalty\addvspace\@tempskipa
  505. \fi
  506. \@ifstar
  507. {\@ssect{#3}{#4}{#5}{#6}}%
  508. {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
  509. \def\@sect#1#2#3#4#5#6[#7]#8{%
  510. \ifnum #2>\c@secnumdepth
  511. \let\@svsec\@empty
  512. \else
  513. \refstepcounter{#1}%
  514. \protected@edef\@svsec{\@seccntformat{#1}\relax}%
  515. \fi
  516. \@tempskipa #5\relax
  517. \ifdim \@tempskipa>\z@
  518. \begingroup
  519. #6{%
  520. \@hangfrom{\hskip #3\relax\@svsec
  521. }%
  522. \interlinepenalty \@M #8\@@par}%
  523. \endgroup
  524. \csname #1mark\endcsname{#7}%
  525. \addcontentsline{toc}{#1}{%
  526. \ifnum #2>\c@secnumdepth \else
  527. \protect\numberline{\csname the#1\endcsname}%
  528. \fi
  529. #7}%
  530. \else
  531. \def\@svsechd{%
  532. #6{\hskip #3\relax
  533. \@svsec #8\ifnum#2=2.\fi}% <<==
  534. \csname #1mark\endcsname{#7}%
  535. \addcontentsline{toc}{#1}{%
  536. \ifnum #2>\c@secnumdepth \else
  537. \protect\numberline{\csname the#1\endcsname}%
  538. \fi
  539. #7}}%
  540. \fi
  541. \@xsect{#5}}
  542. \newcommand\section{\@startsection {section}{1}{\z@}%
  543. {-10pt \@plus -1ex \@minus -.2ex}%
  544. {.5ex }%
  545. {\normalfont\Large\bfseries\sectionfont}}
  546. \newcommand\subsection{\@startsection{subsection}{2}{\z@}%
  547. {10pt\@plus 1ex \@minus .2ex}%
  548. {-0.5ex \@plus .2ex}%
  549. {\normalfont\large\bfseries\subsectionfont}}
  550. \newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
  551. {-3.25ex\@plus -1ex \@minus -.2ex}%
  552. {1.5ex \@plus .2ex}%
  553. {\normalfont\normalsize\bfseries}}
  554. \newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
  555. {3.25ex \@plus1ex \@minus.2ex}%
  556. {-1em}%
  557. {\normalfont\normalsize\bfseries}}
  558. \newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
  559. {3.25ex \@plus1ex \@minus .2ex}%
  560. {-1em}%
  561. {\normalfont\normalsize\bfseries}}
  562. \setlength\leftmargini {12pt}
  563. \leftmargin \leftmargini
  564. \setlength\leftmarginii {12pt}
  565. \setlength\leftmarginiii {12pt}
  566. \setlength\leftmarginiv {12pt}
  567. \if@twocolumn
  568. \setlength\leftmarginv {.5em}
  569. \setlength\leftmarginvi {.5em}
  570. \else
  571. \setlength\leftmarginv {1em}
  572. \setlength\leftmarginvi {1em}
  573. \fi
  574. \setlength \labelsep {.5em}
  575. \setlength \labelwidth{\leftmargini}
  576. \addtolength\labelwidth{-\labelsep}
  577. \@beginparpenalty -\@lowpenalty
  578. \@endparpenalty -\@lowpenalty
  579. \@itempenalty -\@lowpenalty
  580. \renewcommand\theenumi{\@arabic\c@enumi}
  581. \renewcommand\theenumii{\@alph\c@enumii}
  582. \renewcommand\theenumiii{\@roman\c@enumiii}
  583. \renewcommand\theenumiv{\@Alph\c@enumiv}
  584. \newcommand\labelenumi{\theenumi.}
  585. \newcommand\labelenumii{(\theenumii)}
  586. \newcommand\labelenumiii{\theenumiii.}
  587. \newcommand\labelenumiv{\theenumiv.}
  588. \renewcommand\p@enumii{\theenumi}
  589. \renewcommand\p@enumiii{\theenumi(\theenumii)}
  590. \renewcommand\p@enumiv{\p@enumiii\theenumiii}
  591. \newcommand\labelitemi{\raise1.5pt\llap{\small\textbullet\hskip2pt}}
  592. \newcommand\labelitemii{\normalfont\bfseries \textendash}
  593. \newcommand\labelitemiii{\textasteriskcentered}
  594. \newcommand\labelitemiv{\textperiodcentered}
  595. \newenvironment{description}
  596. {\list{}{\labelwidth\z@ \itemindent-\leftmargin
  597. \let\makelabel\descriptionlabel}}
  598. {\endlist}
  599. \newcommand*\descriptionlabel[1]{\hspace\labelsep
  600. \normalfont\bfseries #1}
  601. \def\abstract{\bgroup
  602. \parindent=0pt
  603. \hsize=\columnwidth
  604. \font\it\helveticaboldoblique at 8pt
  605. \font\bf\helveticabold at 8pt
  606. \def\textit##1{{\it ##1}}
  607. \def\textbf##1{{\bf ##1}}
  608. \small
  609. \abstractfont\dospecialaccents}
  610. \def\endabstract{\vskip11pt
  611. \egroup}
  612. \newenvironment{verse}
  613. {\let\\\@centercr
  614. \list{}{\itemsep \z@
  615. \itemindent -1.5em%
  616. \listparindent\itemindent
  617. \rightmargin \leftmargin
  618. \advance\leftmargin 1.5em}%
  619. \item\relax}
  620. {\endlist}
  621. \newenvironment{quotation}
  622. {\list{}{\listparindent 1.5em%
  623. \itemindent \listparindent
  624. \rightmargin \leftmargin
  625. \parsep \z@ \@plus\p@}%
  626. \item\relax}
  627. {\endlist}
  628. \newenvironment{quote}
  629. {\list{}{\rightmargin\leftmargin}%
  630. \item\relax}
  631. {\endlist}
  632. \if@compatibility
  633. \newenvironment{titlepage}
  634. {%
  635. \if@twocolumn
  636. \@restonecoltrue\onecolumn
  637. \else
  638. \@restonecolfalse\newpage
  639. \fi
  640. \setcounter{page}\z@
  641. }%
  642. {\if@restonecol\twocolumn \else \newpage \fi
  643. }
  644. \else
  645. \newenvironment{titlepage}
  646. {%
  647. \if@twocolumn
  648. \@restonecoltrue\onecolumn
  649. \else
  650. \@restonecolfalse\newpage
  651. \fi
  652. \setcounter{page}\@ne
  653. }%
  654. {\if@restonecol\twocolumn \else \newpage \fi
  655. \if@twoside\else
  656. \setcounter{page}\@ne
  657. \fi
  658. }
  659. \fi
  660. \newcommand\appendix{\par
  661. \setcounter{section}{0}%
  662. \setcounter{subsection}{0}%
  663. \gdef\thesection{\@Alph\c@section}}
  664. \setlength\arraycolsep{5\p@}
  665. \setlength\tabcolsep{6\p@}
  666. \setlength\arrayrulewidth{.4\p@}
  667. \setlength\doublerulesep{2\p@}
  668. \setlength\tabbingsep{\labelsep}
  669. \skip\@mpfootins = \skip\footins
  670. \setlength\fboxsep{3\p@}
  671. \setlength\fboxrule{.4\p@}
  672. \renewcommand \theequation {\@arabic\c@equation}
  673. \newcounter{figure}
  674. \renewcommand \thefigure {\@arabic\c@figure}
  675. \def\fps@figure{tbp}
  676. \def\ftype@figure{1}
  677. \def\ext@figure{lof}
  678. \def\fnum@figure{\figurename~\thefigure}
  679. \newenvironment{figure}
  680. {\@float{figure}}
  681. {\end@float}
  682. \newenvironment{figure*}
  683. {\@dblfloat{figure}}
  684. {\end@dblfloat}
  685. \newcounter{table}
  686. \renewcommand\thetable{\@arabic\c@table}
  687. \def\fps@table{tbp}
  688. \def\ftype@table{2}
  689. \def\ext@table{lot}
  690. \def\fnum@table{\tablename~\thetable}
  691. \newenvironment{table}
  692. {\@float{table}}
  693. {\end@float}
  694. \newenvironment{table*}
  695. {\@dblfloat{table}}
  696. {\end@dblfloat}
  697. \newenvironment{xtable}
  698. {\@dblfloat{table}}
  699. {\end@dblfloat}
  700. \newenvironment{xfigure}
  701. {\@dblfloat{figure}}
  702. {\end@dblfloat}
  703. \newlength\abovecaptionskip
  704. \newlength\belowcaptionskip
  705. \setlength\abovecaptionskip{2\p@}
  706. \setlength\belowcaptionskip{4\p@}
  707. \long\def\@makecaption#1#2{%
  708. \ifx\@captype\xtable
  709. \let\currtabcaption\relax
  710. %\gdef\currtabcaption{%
  711. %\tabnumfont\relax #1.\tabtextfont\hskip8\[email protected]\relax#2\par
  712. %\vskip\belowcaptionskip
  713. %}
  714. \vskip\abovecaptionskip
  715. \sbox\@tempboxa{\tabnumfont#1.\tabtextfont\hskip8\p@\relax #2}%
  716. \ifdim \wd\@tempboxa >\hsize
  717. \tabnumfont\relax #1.\tabtextfont\hskip8\p@\relax#2\par
  718. \else
  719. \global \@minipagefalse
  720. \hb@[email protected]\hsize{\hfil\box\@tempboxa\hfil}%
  721. \fi
  722. \else
  723. \vskip\abovecaptionskip
  724. \sbox\@tempboxa{\fignumfont#1.\figtextfont\hskip8\p@\relax #2}%
  725. \ifdim \wd\@tempboxa >\hsize
  726. \fignumfont\relax #1.\figtextfont\hskip8\p@\relax#2\par
  727. \else
  728. \global \@minipagefalse
  729. \hb@[email protected]\hsize{\hfil\box\@tempboxa\hfil}%
  730. \fi
  731. \fi
  732. }
  733. \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
  734. \DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
  735. \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
  736. \DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
  737. \DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
  738. \DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
  739. \DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
  740. \DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
  741. \DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
  742. \newcommand\@pnumwidth{1.55em}
  743. \newcommand\@tocrmarg{2.55em}
  744. \newcommand\@dotsep{4.5}
  745. \setcounter{tocdepth}{3}
  746. \newcommand\tableofcontents{%
  747. \section*{\contentsname
  748. \@mkboth{%
  749. \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
  750. \@starttoc{toc}%
  751. }
  752. \newcommand*\l@part[2]{%
  753. \ifnum \c@tocdepth >-2\relax
  754. \addpenalty\@secpenalty
  755. \addvspace{2.25em \@plus\p@}%
  756. \begingroup
  757. \parindent \z@ \rightskip \@pnumwidth
  758. \parfillskip -\@pnumwidth
  759. {\leavevmode
  760. \large \bfseries #1\hfil \hb@[email protected]\@pnumwidth{\hss #2}}\par
  761. \nobreak
  762. \if@compatibility
  763. \global\@nobreaktrue
  764. \everypar{\global\@nobreakfalse\everypar{}}%
  765. \fi
  766. \endgroup
  767. \fi}
  768. \newcommand*\l@section[2]{%
  769. \ifnum \c@tocdepth >\z@
  770. \addpenalty\@secpenalty
  771. \addvspace{1.0em \@plus\p@}%
  772. \setlength\@tempdima{1.5em}%
  773. \begingroup
  774. \parindent \z@ \rightskip \@pnumwidth
  775. \parfillskip -\@pnumwidth
  776. \leavevmode \bfseries
  777. \advance\leftskip\@tempdima
  778. \hskip -\leftskip
  779. #1\nobreak\hfil \nobreak\hb@[email protected]\@pnumwidth{\hss #2}\par
  780. \endgroup
  781. \fi}
  782. \newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
  783. \newcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
  784. \newcommand*\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
  785. \newcommand*\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
  786. \newcommand\listoffigures{%
  787. \section*{\listfigurename
  788. \@mkboth{\MakeUppercase\listfigurename}%
  789. {\MakeUppercase\listfigurename}}%
  790. \@starttoc{lof}%
  791. }
  792. \newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
  793. \newcommand\listoftables{%
  794. \section*{\listtablename
  795. \@mkboth{%
  796. \MakeUppercase\listtablename}{\MakeUppercase\listtablename}}%
  797. \@starttoc{lot}%
  798. }
  799. \let\l@table\l@figure
  800. \newdimen\bibindent
  801. \setlength\bibindent{1.5em}
  802. \newskip\bibskip
  803. \bibskip=0pt plus 3pt
  804. \newenvironment{thebibliography}[1]
  805. {\endgroup\endtwocolumns\vskip24pt\twocolumns\begingroup
  806. \def\@currenvir{thebibliography}
  807. \let\savebibitem\bibitem
  808. \def\bibitem{\vskip\bibskip\savebibitem}
  809. \tiny\baselineskip=8pt\bibfont
  810. \let\it\bibitfont
  811. \let\bf\bibbffont
  812. \let\em\bibitfont
  813. \let\sc\bibfont
  814. \def\textit##1{{\bibitfont ##1}}
  815. \def\textbf##1{{\bibbffont ##1}}
  816. \list{\@biblabel{\@arabic\c@enumiv}}%
  817. {\settowidth\labelwidth{\@biblabel{#1}}%
  818. \leftmargin\labelwidth
  819. \advance\leftmargin\labelsep
  820. \usecounter{enumiv}%
  821. \let\p@enumiv\@empty
  822. \renewcommand\theenumiv{\@arabic\c@enumiv}}%
  823. \sloppy
  824. \clubpenalty4000
  825. \@clubpenalty \clubpenalty
  826. \widowpenalty4000%
  827. \sfcode`\.\@m}
  828. {\def\@noitemerr
  829. {\@[email protected]{Empty `thebibliography' environment}}%
  830. \endlist
  831. }
  832. \newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
  833. \let\@[email protected]\@empty
  834. %\renewcommand\footnoterule{%
  835. % \hrule\@width6pc%.4\columnwidth
  836. % \kern2.6\[email protected]}
  837. \renewcommand\footnoterule{%
  838. \ifx \@significancetext\@empty
  839. \kern-3\p@
  840. \hrule\@width6pc%.4\columnwidth
  841. \kern2.6\p@
  842. \else
  843. \ifnum\thepage=1
  844. \renewcommand\footnoterule{}
  845. \else
  846. \kern-3\p@
  847. \hrule\@width6pc%.4\columnwidth
  848. \kern2.6\p@
  849. \fi
  850. \fi
  851. }
  852. \newcommand\@makefntext[1]{%
  853. \parindent 1em%
  854. \noindent
  855. \hb@[email protected]{\hss\@makefnmark}#1}
  856. \newcommand\contentsname{Contents}
  857. \newcommand\listfigurename{List of Figures}
  858. \newcommand\listtablename{List of Tables}
  859. \newcommand\refname{References}
  860. \newcommand\indexname{Index}
  861. \newcommand\figurename{Fig.}
  862. \newcommand\tablename{Table}
  863. \newcommand\partname{Part}
  864. \newcommand\appendixname{Appendix}
  865. \newcommand\abstractname{Abstract}
  866. \def\today{\ifcase\month\or
  867. January\or February\or March\or April\or May\or June\or
  868. July\or August\or September\or October\or November\or December\fi
  869. \space\number\day, \number\year}
  870. \setlength\columnsep{10\p@}
  871. \setlength\columnseprule{0\p@}
  872. \pagenumbering{arabic}
  873. \if@twoside
  874. \else
  875. \raggedbottom
  876. \fi
  877. \if@twocolumn
  878. \twocolumn
  879. \sloppy
  880. \flushbottom
  881. \else
  882. \onecolumn
  883. \fi
  884. %%%%%%%%%%%%%%%%%
  885. % Additions to article.cls for PNASONE ==>>
  886. %%%%%%%%%%%%%%%%%
  887. \hoffset-.5in
  888. \pagestyle{headings}
  889. \textwidth= 42.5pc
  890. \textheight= 56.2pc
  891. \def\xrelax{\relax}
  892. %%%%%%%%%%%%%%%%%%%%%%%% For Line numbers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  893. \newcounter{cms}
  894. \def\leftnumber{\setlength{\unitlength}{1pt}
  895. \begin{picture}(0,0)
  896. \multiput(-45,688)(0,-10){68}{\addtocounter
  897. {cms}{1}{\fontsize{9}{10.5}\selectfont\arabic{cms}\par}}
  898. \end{picture}
  899. }
  900. \def\rightnumber{\setlength{\unitlength}{1pt}
  901. \begin{picture}(0,0)
  902. \multiput(6,688)(0,-10){68}{\addtocounter
  903. {cms}{1}{\fontsize{9}{10.5}\selectfont\arabic{cms}\par}}
  904. \end{picture}
  905. }
  906. %%%%%%%%%%%%%%%%%%%%%%%% For Line numbers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  907. %%%%%%%%%%
  908. %% Footnotes, endnotes
  909. \newcount\footnum
  910. \newcount\savefootnum
  911. \def\notes{
  912. {\ifnum\footnum=0\else
  913. \savefootnum=\footnum
  914. \footnum=0
  915. \noindent\loop\ifnum\savefootnum>\footnum%
  916. \global\advance\footnum by1\relax%
  917. \csname foot\the\footnum\endcsname\relax%
  918. \expandafter\gdef\csname foot\the\footnum\endcsname{\relax}\relax%
  919. \repeat\global\footnum=0\relax\fi}}
  920. \long\def\endnotes#1{\global\advance\footnum by 1\relax$^{\the\footnum}$%
  921. \long\expandafter\gdef\csname foot\the\footnum\endcsname{%
  922. \vbox{\footnotesize\everypar={\hskip-10pt\everypar={}}
  923. \leftskip=10pt\relax
  924. \noindent\hbox to10pt{\the\footnum.\hfill}{\def\@currentlabel{\the\footnum}%
  925. #1\strut\vskip1sp}}\vskip1pt}}
  926. \def\endnotetext#1{\global\advance\footnum by 1\relax
  927. \long\expandafter\gdef\csname foot\the\footnum\endcsname{%
  928. \vtop{\footnotesize%
  929. \leftskip=12pt\relax\parindent=-12pt
  930. \indent\hbox to12pt{\the\footnum.\hfill}{#1\strut\vskip1sp}}\vskip1pt}}
  931. %\let\footnote\endnotes
  932. \setlength\oddsidemargin {3\p@}
  933. \setlength\evensidemargin {-3\p@}
  934. \def\dropcap#1{\setbox1=\hbox{\dropcapfont\uppercase{#1}\hskip1pt}
  935. \hangindent=\wd1
  936. \hangafter-2
  937. \noindent\llap{\vbox to0pt{\vskip-7pt\copy1\vss}}}
  938. %%% Theorem environment %%%%%%%%%
  939. %% added \theoremfont for theorem name and number
  940. \def\@begintheorem#1#2{\trivlist
  941. \item[\hskip \labelsep{\theoremfont #1\ #2.}]\itshape}
  942. \def\@opargbegintheorem#1#2#3{\trivlist
  943. \item[\hskip \labelsep{\theoremfont #1\ #2.\ (#3)}]\itshape}
  944. \def\@endtheorem{\endtrivlist}
  945. %%%%%%
  946. %%Macros for Footline on titlepage
  947. \def\url#1{\def\theurl{#1}}
  948. \def\issuedate#1{\def\theissuedate{#1}}
  949. \def\copyrightyear#1{\def\thecopyrightyear{#1}}
  950. \def\volume#1{\def\thevolume{#1}}
  951. \def\issuenumber#1{\def\theissuenumber{#1}}
  952. \def\footlineauthor#1{\def\thefootlineauthor{\let\it\footlineit#1}}
  953. \ps@headings
  954. %% References
  955. \def\@biblabel#1{#1.}
  956. %%% code to get text in tables to extend all the way to left and right
  957. %%% of table
  958. \def\xtable{table}
  959. \def\@array[#1]#2{\tabletextfont
  960. \setbox\@arstrutbox=\hbox{\vrule
  961. height\arraystretch \ht\strutbox
  962. depth\arraystretch \dp\strutbox
  963. width\z@}\@mkpream{#2}\edef\@preamble{\halign \noexpand\@halignto
  964. \bgroup%
  965. \tabskip\z@\@arstrut\@preamble
  966. \ifx\@captype\xtable\hskip-\tabcolsep\fi%% <==== Changed
  967. \tabskip\z@ \cr}%
  968. \let\@startpbox\@@startpbox \let\@endpbox\@@endpbox%
  969. \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi%
  970. \bgroup\let\par\relax%
  971. \let\@sharp##\let\protect\relax \lineskip\z@\baselineskip\z@\@preamble}
  972. %% new
  973. \def\new@tabacol{\edef\@preamble{\@preamble\hskip0pt}}
  974. \def\@tabclassz{\ifcase \@lastchclass\@acolampacol%
  975. \or \@ampacol \or
  976. \or \or \@addamp \or \@acolampacol\or \@firstampfalse
  977. \ifx\@captype\xtable \new@tabacol\else\@tabacol \fi%
  978. \fi%
  979. \edef\@preamble{\@preamble%
  980. \ifcase \@chnum%
  981. \hfil\ignorespaces\@sharp\unskip\hfil%
  982. \or \ignorespaces\@sharp\unskip\hfil%
  983. \or \hfil\hskip\z@ \ignorespaces\@sharp\unskip\fi}}
  984. \setcounter{secnumdepth}{0}
  985. \long\def\@makefntext#1{\parindent0pt\noindent
  986. \@textsuperscript{\normalfont\@thefnmark}#1}%
  987. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  988. %% %%
  989. %% LaTeX Style for Multiple Columns with Floating Insertions %%
  990. %% %%
  991. %% Copyright 2004, Amy Hendrickson, TeXnology Inc. %%
  992. %% All rights reserved %%
  993. %% %%
  994. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  995. %%%%%%%%
  996. %%% Double column output routines,
  997. %%% with single and double column insertions,
  998. %%% to be positioned at page or column top, page or column bottom, page
  999. %%% or column center, or full page floating insertion.
  1000. %%% This code was originally based on Frank Mittlebach's multicol.sty.
  1001. %%% The concept of how to balance columns is due to Donald Knuth. The
  1002. %%% way to integrate the changed output routine into the standard LaTeX
  1003. %%% output routine is due to Frank.
  1004. %%% The method of making the single and double column insertions and the
  1005. %%% changes in the output routines to accomodate these features are mine.
  1006. %%% A.H., August 2004
  1007. %%
  1008. \newskip\abovefigcaptionskip
  1009. \newskip\abovetabcaptionskip
  1010. \newskip\abovetableskip
  1011. \newif\ifcentermultiplelines
  1012. \newif\ifcentersingleline
  1013. \newif\ifcentersingletabline
  1014. \newif\iflineabovetabcaption
  1015. \newif\iflinebelowtabcaption
  1016. \newdimen\belowtabcaptionskip
  1017. %% Parameters you can set:
  1018. \columnsep=13.5pt%16pt
  1019. \newdimen\saveparskip
  1020. \saveparskip=\parskip
  1021. %%
  1022. \newdimen\captionskip %% space between caption and figure or table
  1023. \captionskip=0pt
  1024. %%%
  1025. \newdimen\PushOneColTopFig
  1026. \newdimen\PushOneColBotFig
  1027. \PushOneColTopFig=5.5pt %% push down from top of text page
  1028. \PushOneColBotFig=-4.5pt %
  1029. %%
  1030. \newdimen\PushOneColTopTab
  1031. \newdimen\PushOneColBotTab
  1032. \PushOneColTopTab=2.5pt %% push down from top of text page
  1033. \PushOneColBotTab=0pt %% push up from bottom of text page
  1034. %%
  1035. \newdimen\PushTwoColTopFig
  1036. \newdimen\PushTwoColBotFig
  1037. \PushTwoColTopFig=2.5pt %% push down from top of text page
  1038. \PushTwoColBotFig=1.5pt %% push up from bottom of text page
  1039. %%
  1040. \newdimen\PushTwoColTopTab
  1041. \newdimen\PushTwoColBotTab
  1042. \PushTwoColTopTab=1.5pt %% push down from top of text page
  1043. \PushTwoColBotTab=1.5pt %% push up from bottom of text page
  1044. %%
  1045. \newskip\intextfloatskip
  1046. \intextfloatskip=20pt %% Space between figure or table and text.
  1047. %% (Need to subtract 4pt to get what you want)
  1048. %% Normal and Appendix Figure and Table Numbers
  1049. \def\appthefigure{\Alph{section}\the\c@appfigure\theletter}
  1050. \def\appthetable{\Alph{section}\the\c@apptable\theletter}
  1051. \def\apptheplate{\Alph{section}\the\c@appplate\theletter}
  1052. \newcount\c@appfigure
  1053. \newcount\c@apptable
  1054. \newcount\c@appplate
  1055. %% <=== end of parameters you can set
  1056. %% do one column at a time so that we can get single col
  1057. %% floats for first col.
  1058. %%% New version of \@makecol that includes dbltopins and dblbotins,
  1059. %%% insertions that span both columns at the top and bottom of text page.
  1060. %%%
  1061. \def\new@makecol{\setbox\@outputbox
  1062. \vbox{\boxmaxdepth \maxdepth
  1063. \ifdim\ht\dbltopins<1pt\else\unvbox\dbltopins\fi
  1064. \unvbox\@cclv
  1065. \ifdim\ht\dblbotins<1pt\else\unvbox\dblbotins\fi%
  1066. \ifvoid\footins\else\vskip\skip\footins\footnoterule\unvbox\footins\fi\vss}
  1067. %\global\savefigandtabnumber\figandtabnumber
  1068. %\global\advance\savefigandtabnumber by 1 %% Because loop stops one short
  1069. %% of the total number of figs
  1070. \global\savedblfigandtabnumber\dblfigandtabnumber
  1071. \xdef\@freelist{\@freelist\@midlist}\gdef\@midlist{}\@combinefloats
  1072. \setbox\@outputbox\vbox to\@colht{\boxmaxdepth\maxdepth
  1073. \@texttop\dimen128=\dp\@outputbox\unvbox\@outputbox
  1074. \vskip-\dimen128\@textbottom}%
  1075. \global\maxdepth\@maxdepth}
  1076. %%
  1077. \let\@makecol\new@makecol %%
  1078. %% Default Latex output routine, to return to after balance columns
  1079. %% This should make it possible to capture the output routine of
  1080. %% any version of 2e as well as 2.09. ==>>
  1081. \edef\curroutput{\the\output}
  1082. \let\latexoutput\curroutput
  1083. %% table* and figure* outside two columns keep default definitions.
  1084. \newif\ifnonewpage
  1085. \def\nonewpage{\global\nonewpagetrue}
  1086. %% Begin twocolumns ==>>
  1087. \newdimen\checkforspace
  1088. \def\twocolumns{\par \penalty\z@
  1089. \checkforspace=\pagegoal
  1090. \advance\checkforspace-\pagetotal
  1091. \advance\checkforspace-\ht\partialpage
  1092. \advance\checkforspace-\dp\partialpage
  1093. \advance\checkforspace by -2\ht\dbltopins
  1094. \advance\checkforspace by -2\dp\dbltopins
  1095. \advance\checkforspace by -2\ht\dblbotins
  1096. \advance\checkforspace by -2\dp\dblbotins
  1097. \ifdim\checkforspace<36pt\ifnonewpage\else\newpage\fi\fi
  1098. \begingroup
  1099. %
  1100. \expandafter\gdef\csname plate*\endcsname{\twocolplate}
  1101. \expandafter\gdef\csname endplate*\endcsname{\endtwocolfloat}
  1102. %
  1103. \expandafter\gdef\csname figure*\endcsname{\twocolfig}
  1104. \expandafter\gdef\csname endfigure*\endcsname{\endtwocolfloat}
  1105. %
  1106. \expandafter\gdef\csname table*\endcsname{\twocoltable}
  1107. \expandafter\gdef\csname endtable*\endcsname{\endtwocolfloat}
  1108. %
  1109. \let\figure\onecolfig
  1110. \let\plate\onecolplate
  1111. \let\table\onecoltable
  1112. %
  1113. \let\@makecol\new@makecol %%
  1114. %% Confines new def of \@makecol to
  1115. %% two column material, preserves normal topskip after twocolumns is
  1116. %% finished.
  1117. %%
  1118. \output={\global\setbox\partialpage=\vbox{\unvbox\@cclv}}
  1119. \vskip1sp %%
  1120. \eject
  1121. \vbadness10001 \hbadness5000
  1122. \tolerance5000
  1123. \parskip \saveparskip %plus .01pt %
  1124. %\ifjdraft
  1125. %\baselineskip=28pt\fi
  1126. \pretolerance\m@ne %keeps TeX from trying to make up paragraph
  1127. % without discretionary hyphens
  1128. \advance\@colroom-\ht\partialpage
  1129. \advance\@colroom-\dp\partialpage
  1130. \vsize=\@colroom
  1131. % Changed to \@colroom rather than 2\@colroom. Each column is output
  1132. % separately so we can find out if there are top or bottom inserts
  1133. % in first column.
  1134. %%
  1135. \hsize\textwidth \advance\hsize-\columnsep
  1136. \divide\hsize by 2
  1137. \linewidth\hsize %% particular to LaTeX
  1138. \columnwidth=\hsize
  1139. %% OR, you can substitute these lines:
  1140. %\hsize=\mycolumnwidth
  1141. %\linewidth=\hsize
  1142. %%
  1143. %% Output:
  1144. % Set output to firstcolout, which checks to see if there are inserts
  1145. % then doubles the vsize and send material back into input stream, then
  1146. % sets the next output routine to \makeuppage
  1147. %
  1148. \output={\firstcolout}
  1149. \vskip2sp\ignorespaces}
  1150. \def\galleycolumns{\par \penalty\z@
  1151. \checkforspace=\pagegoal
  1152. \advance\checkforspace-\pagetotal
  1153. \advance\checkforspace-\ht\partialpage
  1154. \advance\checkforspace-\dp\partialpage
  1155. \advance\checkforspace by -2\ht\dbltopins
  1156. \advance\checkforspace by -2\dp\dbltopins
  1157. \advance\checkforspace by -2\ht\dblbotins
  1158. \advance\checkforspace by -2\dp\dblbotins
  1159. \ifdim\checkforspace<36pt\newpage\fi
  1160. \begingroup
  1161. \expandafter\gdef\csname plate*\endcsname{\twocolplate}
  1162. \expandafter\gdef\csname endplate*\endcsname{\endtwocolfloat}
  1163. %
  1164. \expandafter\gdef\csname figure*\endcsname{\twocolfig}
  1165. \expandafter\gdef\csname endfigure*\endcsname{\endtwocolfloat}
  1166. %
  1167. \expandafter\gdef\csname table*\endcsname{\twocoltable}
  1168. \expandafter\gdef\csname endtable*\endcsname{\endtwocolfloat}
  1169. %
  1170. \let\figure\onecolfig
  1171. \let\plate\onecolplate
  1172. \let\table\onecoltable
  1173. %
  1174. \global\firstsectionfalse
  1175. \hsize=\mycolumnwidth
  1176. \linewidth=\mycolumnwidth
  1177. \vbadness10001
  1178. \hbadness5000
  1179. \tolerance5000
  1180. \widowpenalty=0 \clubpenalty=0
  1181. \parskip \saveparskip %plus .0001pt %
  1182. \vskip1sp\ignorespaces}
  1183. \def\draftcolumns{\par \penalty\z@
  1184. \begingroup
  1185. \expandafter\gdef\csname plate*\endcsname{\twocolplate}
  1186. \expandafter\gdef\csname endplate*\endcsname{\endtwocolfloat}
  1187. %
  1188. \expandafter\gdef\csname figure*\endcsname{\twocolfig}
  1189. \expandafter\gdef\csname endfigure*\endcsname{\endtwocolfloat}
  1190. %
  1191. \expandafter\def\csname table*\endcsname{\twocoltable}
  1192. \expandafter\def\csname endtable*\endcsname{\endtwocolfloat}
  1193. %
  1194. \let\figure\onecolfig
  1195. \let\plate\onecolplate
  1196. \let\table\onecoltable
  1197. %
  1198. \marginparsep=4pt
  1199. \oddsidemargin-.25in
  1200. \evensidemargin-.25in
  1201. \advance\textwidth-.5in
  1202. \hsize=\textwidth
  1203. \linewidth=\textwidth
  1204. \vbadness10001 \hbadness5000
  1205. \tolerance5000
  1206. \parskip \saveparskip
  1207. \vskip1sp\ignorespaces}
  1208. \newbox\savetopinsert
  1209. \newbox\savebotinsert
  1210. \newbox\secondsavetopinsert
  1211. \newbox\secondsavebotinsert
  1212. \newbox\firstcolbox
  1213. \newbox\secondcolbox
  1214. \newbox\thefirstbox
  1215. \newbox\thesecondbox
  1216. \newdimen\firstcol
  1217. \newdimen\secondcol
  1218. \newdimen\checkheight
  1219. \newcount\loopnum
  1220. \newcount\firstcolsavefignum
  1221. \def\firstcolout{%
  1222. %% The point of having firstcolout is to find out
  1223. %% which figures/tables have been entered in the first column:
  1224. \global\firstcolsavefignum=\figandtabnumber
  1225. \global\advance\vsize by\@colroom
  1226. \topskip=11pt %% ??
  1227. \unvbox\@cclv
  1228. \penalty\outputpenalty
  1229. \global\output={\makeuppage}}
  1230. %% This is where the floats and text are put together to make page:
  1231. \newif\iffirstpage
  1232. \newbox\footnotebox
  1233. \newdimen\ColUsed
  1234. \newdimen\FigSpace
  1235. \newbox\testdblbotins
  1236. \def\makeuppage{%
  1237. %%
  1238. \FigSpace=.9\@colroom %%
  1239. \advance\FigSpace by-\ht\testdblbotins
  1240. \advance\FigSpace by-\dp\testdblbotins
  1241. \advance\FigSpace by-\ht\dbltopins
  1242. \advance\FigSpace by-\dp\dbltopins
  1243. %
  1244. %% Save top inserts from first column: +++
  1245. \global\setbox\savetopinsert=\vbox{%
  1246. % write top figures and tables into this box
  1247. \redefiningtrue
  1248. \global\loopnum=0 \global\checkheight=0pt
  1249. \loop\ifnum\loopnum<\firstcolsavefignum
  1250. %
  1251. \expandafter\ifx\csname topfloat\the\loopnum\endcsname\empty
  1252. \else
  1253. \expandafter\ifx\csname topfloat\the\loopnum\endcsname\relax
  1254. \else
  1255. \global\advance\checkheight by
  1256. \expandafter\csname totalht\the\loopnum\endcsname\relax
  1257. \fi\fi
  1258. \ifdim\checkheight>\FigSpace \relax
  1259. \global\loopnum=10000 % jump out of loop
  1260. %
  1261. \else
  1262. \csname topfloat\the\loopnum\endcsname
  1263. \fi
  1264. %
  1265. \global\advance\loopnum by1
  1266. \repeat\relax
  1267. }
  1268. \ColUsed=\FigSpace %%
  1269. \advance\ColUsed by-\ht\savetopinsert
  1270. \advance\ColUsed by-\dp\savetopinsert
  1271. %%
  1272. \global\setbox\savebotinsert=\vbox{%
  1273. %% Write bottom figures and tables into this box
  1274. \redefiningtrue
  1275. \global\loopnum=0
  1276. \global\checkheight=0pt
  1277. \loop\ifnum\loopnum<\firstcolsavefignum
  1278. \expandafter\ifx\csname botfloat\the\loopnum\endcsname\empty
  1279. \else
  1280. \expandafter\ifx\csname botfloat\the\loopnum\endcsname\relax
  1281. \else
  1282. \global\advance\checkheight by
  1283. \expandafter\csname totalht\the\loopnum\endcsname\relax
  1284. \fi\fi
  1285. \ifdim\checkheight>\ColUsed
  1286. \global\loopnum=10000 % jump out of loop
  1287. \else%
  1288. \csname botfloat\the\loopnum\endcsname
  1289. \global\expandafter\expandafter\let\csname botfloat\the\loopnum\endcsname\relax
  1290. %% how come this reset is here and not in similar places????
  1291. \fi
  1292. %
  1293. \global\advance\loopnum by1
  1294. \repeat
  1295. } %
  1296. %
  1297. %
  1298. \iffirstpage\else
  1299. \global\setbox\secondsavetopinsert=\vbox{%
  1300. %% Write top figures and tables into this box
  1301. %
  1302. \global\loopnum=0 \global\checkheight=0pt
  1303. \redefiningtrue
  1304. \loop\ifnum\loopnum<\figandtabnumber %% ?
  1305. %
  1306. \expandafter\ifx\csname topfloat\the\loopnum\endcsname\empty
  1307. \else
  1308. \expandafter\ifx\csname topfloat\the\loopnum\endcsname\relax
  1309. \else
  1310. \global\advance\checkheight by
  1311. \expandafter\csname totalht\the\loopnum\endcsname\relax
  1312. \fi\fi
  1313. \ifdim\checkheight>\FigSpace
  1314. \global\loopnum=10000 % jump out of loop
  1315. %
  1316. \else%
  1317. \csname topfloat\the\loopnum\endcsname
  1318. \fi
  1319. %
  1320. \global\advance\loopnum by1\repeat
  1321. %% one more, because it doesn't stop when number is =, only when it
  1322. %% is less than.
  1323. \global\advance\loopnum by1
  1324. \csname topfloat\the\loopnum\endcsname
  1325. }
  1326. \fi
  1327. %
  1328. \ColUsed=\FigSpace %%
  1329. \advance\ColUsed by-\ht\secondsavetopinsert
  1330. \advance\ColUsed by-\dp\secondsavetopinsert
  1331. %
  1332. \iffirstpage\global\firstpagefalse\else
  1333. \global\setbox\secondsavebotinsert=\vbox{%
  1334. %% Write bottom figures and tables into this box
  1335. %
  1336. \redefiningtrue
  1337. \global\loopnum=0 \global\checkheight=0pt
  1338. \loop\ifnum\loopnum<\figandtabnumber
  1339. \expandafter\ifx\csname botfloat\the\loopnum\endcsname\empty
  1340. \else
  1341. \expandafter\ifx\csname botfloat\the\loopnum\endcsname\relax
  1342. \else
  1343. \global\advance\checkheight by
  1344. \expandafter\csname totalht\the\loopnum\endcsname\relax
  1345. \fi\fi
  1346. \ifdim\checkheight>\ColUsed
  1347. \global\loopnum=10000 % jump out of loop
  1348. %
  1349. \else%
  1350. \csname botfloat\the\loopnum\endcsname
  1351. \fi
  1352. %
  1353. \global\advance\loopnum by1\repeat
  1354. %% one more, because it doesn't stop when number is =, only when it
  1355. %% is less than.
  1356. \global\advance\loopnum by1
  1357. \csname botfloat\the\loopnum\endcsname
  1358. }
  1359. %
  1360. \global\dp\secondsavebotinsert=2.5pt
  1361. \global\dp\savebotinsert=2.5pt
  1362. \fi
  1363. %
  1364. \splittopskip=\topskip
  1365. \splitmaxdepth\maxdepth
  1366. \dimen@\@colroom
  1367. %% Leave space if there is a two-column wide bottom insertion:
  1368. %
  1369. \global\setbox\dblbotins=\vbox{%
  1370. \hsize=\textwidth
  1371. \linewidth=\textwidth
  1372. \captionwidth=\widecaptionwidth
  1373. \unvbox\dblbotins %% avoid eradicating this if it has anything in it
  1374. %% Write dblspan bottom figures and tables into this box
  1375. \redefiningtrue
  1376. \global\dblloopnum=0
  1377. \loop\ifnum\dblloopnum<\savedblfigandtabnumber %%
  1378. \csname dblbotfloat\the\dblloopnum\endcsname
  1379. \global\advance\dblloopnum by1\repeat
  1380. \csname dblbotfloat\the\dblloopnum\endcsname
  1381. }
  1382. \ifvoid\dblbotins \else
  1383. \advance\dimen@-\ht\dblbotins
  1384. \advance\dimen@-\dp\dblbotins
  1385. \fi
  1386. %
  1387. %% Leave space if there is a two-column wide top insertion:
  1388. \ifvoid\dbltopins\else
  1389. \advance\dimen@-\ht\dbltopins
  1390. \advance\dimen@-\dp\dbltopins
  1391. \fi
  1392. %%
  1393. %% These changes are made to cut the column size down if we need
  1394. %% to fit an insert into the column. This allows the right and
  1395. %% left column to have differing amounts of text cut from box 255,
  1396. %% called box \@cclv in LaTeX. See \vsplit below.
  1397. \firstcol=\dimen@
  1398. \ifvoid\savetopinsert\else
  1399. \ifdim\ht\savetopinsert>0pt
  1400. \advance\firstcol by-\ht\savetopinsert
  1401. \advance\firstcol by-\dp\savetopinsert\fi\fi
  1402. \ifvoid\savebotinsert\else
  1403. \ifdim\ht\savebotinsert>0pt
  1404. \advance\firstcol by-\ht\savebotinsert
  1405. \advance\firstcol by-\dp\savebotinsert\fi
  1406. \fi%
  1407. %%% KLUDGE below
  1408. \advance\firstcol by-3pt %% We need this to avoid
  1409. %% error messages about overfull boxes.
  1410. %
  1411. \secondcol=\dimen@
  1412. %%
  1413. \ifvoid\secondsavetopinsert\else
  1414. \ifdim\ht\secondsavetopinsert>0pt
  1415. \advance\secondcol by-\ht\secondsavetopinsert
  1416. \advance\secondcol by-\dp\secondsavetopinsert\fi\fi
  1417. \ifvoid\secondsavebotinsert\else
  1418. \ifdim\ht\secondsavebotinsert>0pt
  1419. \advance\secondcol by-\ht\secondsavebotinsert
  1420. \advance\secondcol by-\dp\secondsavebotinsert\fi\fi
  1421. \ifvoid\footins\else
  1422. \ifdim\ht\footins>0pt
  1423. \global\setbox\footnotebox=\vbox{\vskip\skip\footins
  1424. \footnoterule\unvbox\footins\vskip1sp}
  1425. \advance\secondcol by-\ht\footnotebox
  1426. \advance\secondcol by-\dp\footnotebox\fi\fi
  1427. %%% KLUDGE below
  1428. \advance\secondcol by-3pt %% We need this to avoid
  1429. %% error messages about overfull boxes.
  1430. %
  1431. %% Cutting the amount of text that will fit from box255:
  1432. \splittopskip=\topskip %%
  1433. \splitmaxdepth\maxdepth
  1434. \setbox\thefirstbox \vsplit\@cclv to\firstcol
  1435. \setbox\thesecondbox \vsplit\@cclv to\secondcol
  1436. %
  1437. %% Making a text box that includes the inserts, column to the left:
  1438. \setbox\firstcolbox\vbox to\dimen@{%
  1439. \ifvoid\savetopinsert\else\unvbox\savetopinsert\fi%
  1440. \box\thefirstbox%
  1441. \ifvoid\savebotinsert\else\vfill\unvbox\savebotinsert\fi%
  1442. }
  1443. %
  1444. %% Making a text box that includes the inserts, column to the right:
  1445. \setbox\secondcolbox\vbox to\dimen@{%
  1446. \ifvoid\secondsavetopinsert\else\unvbox\secondsavetopinsert\fi%
  1447. \box\thesecondbox%%
  1448. \ifvoid\secondsavebotinsert\else\vfill\unvbox\secondsavebotinsert\vskip1sp\fi%
  1449. \ifvoid\footnotebox\else\unvbox\footnotebox\fi%
  1450. }
  1451. % Put back any text material that is not used:
  1452. \ifvoid\@cclv \else
  1453. \unvbox\@cclv
  1454. \penalty\outputpenalty\fi
  1455. \setbox\@cclv\vbox{\page@sofar}%
  1456. \@makecol\@outputpage
  1457. \global\@colroom\@colht
  1458. % Changed this so that each column will be output separately,
  1459. % so we have a chance to see if there are any insertions in the first
  1460. % column.
  1461. %
  1462. %% Do Page Inserts here, so that if there are any two col top inserts
  1463. %% They will be numbered after Page Inserts.
  1464. %%
  1465. \expandafter\ifx\csname pagefloat\the\pageloopnum\endcsname\relax
  1466. \else
  1467. \expandafter\ifx\csname pagefloat\the\pageloopnum\endcsname\empty
  1468. \else
  1469. \insertpage\fi\fi
  1470. %
  1471. %** doing this now gets the numbers right.
  1472. \global\setbox\dbltopins=\vbox{%
  1473. \hsize=\textwidth
  1474. \linewidth=\textwidth
  1475. \captionwidth=\widecaptionwidth
  1476. \unvbox\dbltopins
  1477. %% Write dblspan bottom figures and tables into this box
  1478. \redefiningtrue %
  1479. \global\dblloopnum=0
  1480. \loop\ifnum\dblloopnum<\savedblfigandtabnumber
  1481. \csname dbltopfloat\the\dblloopnum\endcsname
  1482. \global\advance\dblloopnum by1\repeat
  1483. \csname dbltopfloat\the\dblloopnum\endcsname%
  1484. %Save one for next page?
  1485. %\vskip24pt
  1486. }
  1487. %**
  1488. %
  1489. %% dblfigandtabnumber rather than savedblfigandtabnumber here
  1490. \global\setbox\testdblbotins=\vbox{%
  1491. \let\c@figure\bogus
  1492. \let\c@table\bogus
  1493. \let\c@plate\bogus
  1494. \hsize=\textwidth
  1495. \linewidth=\textwidth
  1496. \captionwidth=\widecaptionwidth
  1497. \copy\dblbotins %% avoid eradicating this if it has anything in it
  1498. %% Write dblspan bottom figures and tables into this box
  1499. \redefiningfalse
  1500. \global\dblloopnum=0
  1501. \loop\ifnum\dblloopnum<\dblfigandtabnumber %%
  1502. \csname dblbotfloat\the\dblloopnum\endcsname
  1503. \global\advance\dblloopnum by1\repeat
  1504. \csname dblbotfloat\the\dblloopnum\endcsname
  1505. }
  1506. %
  1507. \ifbalancing
  1508. \global\balancingfalse
  1509. \global\vsize=2\@colroom
  1510. \else
  1511. \global\vsize\@colroom
  1512. \global\advance\vsize -\ht\dbltopins
  1513. \global\advance\vsize -\dp\dbltopins
  1514. \global\advance\vsize -\ht\testdblbotins
  1515. \global\advance\vsize -\dp\testdblbotins
  1516. \global\output={\firstcolout}%
  1517. \fi
  1518. }
  1519. \newcount\pageloopnum
  1520. \def\secondoutput{{\makeuppage }}
  1521. \newbox\endcolsavetopinsert
  1522. \newbox\endcolsavebotinsert
  1523. \newbox\testpagesize
  1524. \newif\ifbalancing
  1525. \newdimen\savelastskip
  1526. %%+++
  1527. \def\endtwocolumns{%
  1528. %\par\penalty0
  1529. \splittopskip=\topskip
  1530. \splitmaxdepth\maxdepth
  1531. \setboxesandredefine
  1532. \ifdim\ht\endcolsavetopinsert>1pt
  1533. \unvbox\endcolsavetopinsert%
  1534. \fi
  1535. \ifdim\ht\endcolsavebotinsert>1pt
  1536. \unvbox\endcolsavebotinsert%
  1537. \fi
  1538. \par\penalty\z@
  1539. \output={\global\setbox\testpagesize=\vbox{%
  1540. \unvbox\@cclv\ifdim\savelastskip>0pt \vskip-\savelastskip\fi}}\eject
  1541. %%
  1542. %% We reset output routine below to \latexoutput
  1543. %% since we had to set multicolout to be the global output routine.
  1544. %%
  1545. \dimen0=\ht\testpagesize
  1546. \advance\dimen0 by\dp\testpagesize
  1547. \unvbox\testpagesize %%
  1548. %% Above needed to see if we have more than one page worth of text.
  1549. %%
  1550. \advance\dimen0 by \topskip
  1551. \ifdim\dimen0>2\@colroom
  1552. %\typeout{^^J^^J more than 2 colroom^^J^^J}
  1553. %% More than one page of text:
  1554. %%
  1555. \balancingtrue %% need this to avoid turning on firstcolout output routine.
  1556. \global\output={\settwocolboxes\makeuppage
  1557. \global\output={\setboxesandredefine
  1558. \balance@columns\global\output={\latexoutput}}}
  1559. \else
  1560. \settwocolboxes
  1561. \advance\dimen0 by 2\ht\dbltopins
  1562. \advance\dimen0 by 2\dp\dbltopins
  1563. \ifdim\dimen0>2\@colroom
  1564. %\typeout{^^J^^J Second more than 2 colroom^^J^^J}
  1565. %%
  1566. \balancingtrue %% need this to avoid turning on firstcolout output routine.
  1567. \global\output={\makeuppage
  1568. \global\output={\balance@columns\global\output={\latexoutput}}}
  1569. \else
  1570. %\typeout{^^J^^J NOT more than 2 colroom^^J^^J}
  1571. \balancingtrue %% need this to avoid turning on firstcolout output routine.
  1572. \global\output={\balance@columns\global\output={\latexoutput}}\fi\fi
  1573. \par
  1574. \eject
  1575. \endgroup
  1576. \par\penalty\z@\relax
  1577. \hsize=\textwidth
  1578. }
  1579. %% to get rid of spurious error message when triple col is used:
  1580. %\def\@checkend#1{\def\[email protected]{#1}\ifx
  1581. % \[email protected]\@currenvir \else\iftriplecol
  1582. %\else\@badend{#1}\fi\fi}
  1583. \def\endgalley{\vskip1sp\endgroup\newpage
  1584. \vspace*{1in}
  1585. \unvbox\figinsert}
  1586. \def\enddraft{\vskip1sp\endgroup
  1587. \ifdim\ht\figinsert <2pt\else
  1588. \newpage
  1589. \vspace*{1in}
  1590. \unvbox\figinsert\fi}
  1591. \def\setboxesandredefine{%
  1592. \global\setbox\dbltopins=\vbox{%
  1593. \hsize=\textwidth
  1594. \linewidth=\textwidth
  1595. \captionwidth=\widecaptionwidth
  1596. \unvbox\dbltopins
  1597. %% Write dblspan bottom figures and tables into this box
  1598. \redefiningtrue %
  1599. \global\dblloopnum=0
  1600. \loop\ifnum\dblloopnum<\dblfigandtabnumber
  1601. \csname dbltopfloat\the\dblloopnum\endcsname
  1602. \global\advance\dblloopnum by1\repeat
  1603. \csname dbltopfloat\the\dblloopnum\endcsname%
  1604. % %Save one for next page?
  1605. \vskip3pt%% kludge
  1606. \vskip-\intextfloatskip
  1607. }
  1608. %
  1609. \global\setbox\endcolsavetopinsert=\vbox{%
  1610. %% dropping figures and tables into this box
  1611. \loopnum=0
  1612. \redefiningtrue
  1613. \loop\ifnum\loopnum<\figandtabnumber
  1614. \csname topfloat\the\loopnum\endcsname
  1615. \global\advance\loopnum by1\repeat
  1616. \csname topfloat\the\loopnum\endcsname%
  1617. }
  1618. %
  1619. \global\setbox\endcolsavebotinsert=\vbox{%
  1620. %% drop figures and tables into this box
  1621. \global\loopnum=0
  1622. \redefiningtrue
  1623. \loop\ifnum\loopnum<\figandtabnumber
  1624. \csname botfloat\the\loopnum\endcsname
  1625. \global\advance\loopnum by1\repeat
  1626. \csname botfloat\the\loopnum\endcsname}
  1627. %
  1628. \global\setbox\dblbotins=\vbox{%
  1629. \hsize=\textwidth
  1630. \linewidth=\textwidth
  1631. \captionwidth=\widecaptionwidth
  1632. \unvbox\dblbotins %% avoid eradicating this if it has anything in it
  1633. % Write dblspan bottom figures and tables into this box
  1634. \redefiningtrue
  1635. \global\dblloopnum=0
  1636. \loop\ifnum\dblloopnum<\dblfigandtabnumber %%
  1637. \csname dblbotfloat\the\dblloopnum\endcsname
  1638. \global\advance\dblloopnum by1\repeat
  1639. \csname dblbotfloat\the\dblloopnum\endcsname}%
  1640. }%% end of setboxes and redefine
  1641. \def\settwocolboxes{%
  1642. \global\setbox\dbltopins=\vbox{%
  1643. \hsize=\textwidth
  1644. \linewidth=\textwidth
  1645. \captionwidth=\widecaptionwidth
  1646. \unvbox\dbltopins
  1647. % Write dblspan bottom figures and tables into this box
  1648. \redefiningtrue %
  1649. \global\dblloopnum=0
  1650. \loop\ifnum\dblloopnum<\dblfigandtabnumber
  1651. \csname dbltopfloat\the\dblloopnum\endcsname
  1652. \global\advance\dblloopnum by1\repeat
  1653. \csname dbltopfloat\the\dblloopnum\endcsname%
  1654. %
  1655. %\global\setbox\dblbotins=\vbox
  1656. \hsize=\textwidth
  1657. \linewidth=\textwidth
  1658. \captionwidth=\widecaptionwidth
  1659. \unvbox\dblbotins %% avoid eradicating this if it has anything in it
  1660. % Write dblspan bottom figures and tables into this box
  1661. \redefiningtrue
  1662. \global\dblloopnum=0
  1663. \loop\ifnum\dblloopnum<\dblfigandtabnumber %%
  1664. \csname dblbotfloat\the\dblloopnum\endcsname
  1665. \global\advance\dblloopnum by1\repeat
  1666. \csname dblbotfloat\the\dblloopnum\endcsname%
  1667. \vskip\intextfloatskip%% new++
  1668. }}
  1669. \def\setonecolboxesandredefine{%
  1670. \global\setbox\endcolsavetopinsert=\vbox{%
  1671. %% dropping figures and tables into this box
  1672. \loopnum=0
  1673. \redefiningtrue
  1674. \loop\ifnum\loopnum<\figandtabnumber
  1675. \csname topfloat\the\loopnum\endcsname
  1676. \expandafter\ifx\csname topfloat\the\loopnum\endcsname\relax\else
  1677. \vskip12pt\goodbreak\fi
  1678. \global\advance\loopnum by1\repeat
  1679. \csname topfloat\the\loopnum\endcsname%
  1680. }
  1681. %
  1682. \global\setbox\endcolsavebotinsert=\vbox{%
  1683. %% drop figures and tables into this box
  1684. \global\loopnum=0
  1685. \redefiningtrue
  1686. \loop\ifnum\loopnum<\figandtabnumber
  1687. \csname botfloat\the\loopnum\endcsname
  1688. % we don't want a space here because it is at the bottom of a column:
  1689. %\expandafter\ifx\csname botfloat\the\loopnum\endcsname\relax\else
  1690. %\vskip12pt\goodbreak\fi
  1691. \global\advance\loopnum by1\repeat
  1692. \csname botfloat\the\loopnum\endcsname%
  1693. }
  1694. %
  1695. }%% end of setonecol boxes and redefine
  1696. \newbox\partialpage
  1697. \def\process@cols#1#2{\count@#1\relax
  1698. \loop #2%
  1699. \advance\count@\tw@
  1700. \ifnum\count@<4
  1701. \repeat}
  1702. %%% Version for balanced column output.
  1703. %% this version to get topskip right on balanced page at end of article.
  1704. \def\Bpage@sofar{
  1705. \unvbox\partialpage
  1706. %% major kludge! but it works ==>>
  1707. \null
  1708. \vskip-\topskip
  1709. \vskip-12pt
  1710. %% <<==
  1711. \process@cols\z@{\wd\count@\hsize}%
  1712. \hbox to\textwidth{%
  1713. \process@cols\tw@{\box\count@
  1714. \hss\vrule\@width\columnseprule\hss}%
  1715. \box\z@}}
  1716. %%% AH: Version for two column output. %%
  1717. \def\page@sofar{\unvbox\partialpage
  1718. \wd\firstcolbox\hsize
  1719. \wd\secondcolbox\hsize
  1720. \hbox to\textwidth{%
  1721. \box\firstcolbox
  1722. \hss\vrule\@width\columnseprule\hss
  1723. \box\secondcolbox}%%
  1724. }
  1725. %% Variant on \@outputpage to use for floating page insert:
  1726. \def\insertpage{\begingroup\catcode`\ =10
  1727. \let\-\@dischyph \let\'\@acci \let\`\@accii \let\=\@acciii
  1728. \if@twoside
  1729. \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
  1730. \let\@themargin\oddsidemargin
  1731. \else \let\@thehead\@evenhead
  1732. \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
  1733. \fi\fi
  1734. \shipout
  1735. \vbox{\normalsize \baselineskip\z@ \lineskip\z@
  1736. \let\par\@@par %%
  1737. \vskip \topmargin \moveright\@themargin
  1738. \vbox{\setbox\@tempboxa
  1739. \vbox to\headheight{\vfil \hbox to\textwidth
  1740. {\let\label\@gobble \let\index\@gobble
  1741. \@thehead}} %%
  1742. \dp\@tempboxa\z@
  1743. \box\@tempboxa
  1744. \vskip \headsep
  1745. %% change from \@outputpage below
  1746. \vbox to\textheight{\vfil
  1747. \hsize=\textwidth
  1748. \linewidth=\textwidth
  1749. \csname pagefloat\the\pageloopnum \endcsname
  1750. }
  1751. \baselineskip\footskip
  1752. \hbox to\textwidth{\let\label\@gobble
  1753. \let\index\@gobble %%
  1754. \@thefoot}}}\global\@colht\textheight
  1755. \endgroup\stepcounter{page}\let\firstmark\botmark
  1756. \global\advance\pageloopnum by1
  1757. \expandafter\ifx\csname pagefloat\the\pageloopnum\endcsname\relax\else%
  1758. \insertpage\fi%
  1759. }
  1760. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1761. \def\balance@columns{% can't throw in figs here because we
  1762. % aren't doing eject, so they will be lost
  1763. \ifdim\ht\dbltopins>1pt
  1764. \advance\@colroom-\ht\dbltopins
  1765. \advance\@colroom-\dp\dbltopins
  1766. \advance\@colroom-\baselineskip
  1767. \fi
  1768. \ifdim\ht\dblbotins>1pt
  1769. \advance\@colroom-\ht\dblbotins
  1770. \advance\@colroom-\dp\dblbotins
  1771. \fi
  1772. \setbox\z@\vbox{\unvbox\@cclv}
  1773. \dimen@\ht\z@
  1774. \advance\dimen@ 2\topskip
  1775. \advance\dimen@-2\baselineskip %% ?? was 2\baselineskip, 4 gives better
  1776. %topskip
  1777. \divide\dimen@2%
  1778. %
  1779. {\vbadness\@M
  1780. \splittopskip=\topskip
  1781. \loop{\process@cols\@ne{\global\setbox\count@
  1782. \box\voidb@x}}%
  1783. \global\setbox\@ne\copy\z@
  1784. {\process@cols\thr@@{\global\setbox\count@
  1785. \vsplit\@ne to\dimen@}}%
  1786. \ifdim\ht\@ne >\ht\thr@@
  1787. \global\advance\dimen@\p@
  1788. \repeat}
  1789. %
  1790. \dimen@\ht\thr@@
  1791. \process@cols\z@{\@tempcnta\count@
  1792. \advance\@tempcnta\@ne
  1793. \setbox\count@\vtop to\dimen@ %%
  1794. {\unvbox\@tempcnta}}%
  1795. \global\vsize\@colroom
  1796. \global\advance\vsize\ht\partialpage
  1797. \Bpage@sofar}
  1798. \@ifundefined{emergencystretch}
  1799. {\newdimen\emergencystretch}{}
  1800. \emergencystretch 1pt
  1801. \def\setemergencystretch#1#2{%
  1802. \emergencystretch 4pt
  1803. \multiply\emergencystretch#1}
  1804. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1805. %%% Figure and table captions in two column text and spanning both
  1806. %%% columns.
  1807. %%%%%%%%%%%%%%%%%%%%%%%%%
  1808. %% Single column inserts:
  1809. \let\savecaption\caption
  1810. \let\xsavecaption\savecaption
  1811. \def\onecolfig{\ifvmode\else\unskip\fi
  1812. \global\captypefigtrue
  1813. \global\captypeplatefalse
  1814. \@ifnextchar[\lookforposition{\lookforposition[e]}}
  1815. \def\onecolplate{\ifvmode\else\unskip\fi
  1816. \global\advance\c@plate -1\relax
  1817. \global\captypeplatetrue
  1818. \global\captypefigfalse
  1819. \@ifnextchar[\lookforposition{\lookforposition[e]}}
  1820. \def\onecoltable{\ifvmode\else\unskip\vskip1pt\fi\tabletextsize
  1821. \global\captypefigfalse
  1822. \global\captypeplatefalse
  1823. \@ifnextchar[\lookforposition{\lookforposition[e]}
  1824. }
  1825. %% This is used in case we get more than one letter, i.e.,
  1826. %% \begin{figure}[htp]. This macro picks up only the first letter.
  1827. \def\defone#1#2*{\def\one{#1}}
  1828. \newcount\figandtabnumber
  1829. \newbox\figandtabbox
  1830. \newif\ifcaptypefig
  1831. \newif\ifcaptypeplate
  1832. \long\def\catchcaption#1{%
  1833. \ifcaptypefig%
  1834. \expandafter\gdef\csname caption\the\figandtabnumber\endcsname{%
  1835. \def\@captype{figure}\savecaption{#1}}%
  1836. \else%
  1837. \ifcaptypeplate
  1838. \expandafter\gdef\csname caption\the\figandtabnumber\endcsname{%
  1839. \def\@captype{plate}\savecaption{#1}}%
  1840. \else
  1841. \expandafter\gdef\csname caption\the\figandtabnumber\endcsname{%
  1842. \def\@captype{table}\savecaption{#1}}%
  1843. \fi\fi}
  1844. \long\def\dblcatchcaption#1{%
  1845. \ifcaptypefig%
  1846. \expandafter\gdef\csname dblcaption\the\dblfigandtabnumber\endcsname{%
  1847. \def\@captype{figure}\savecaption{#1}}%
  1848. \else%
  1849. \ifcaptypeplate
  1850. \expandafter\gdef\csname dblcaption\the\dblfigandtabnumber\endcsname{%
  1851. \def\@captype{plate}\savecaption{#1}}%
  1852. \else
  1853. \expandafter\gdef\csname dblcaption\the\dblfigandtabnumber\endcsname{%
  1854. \def\@captype{table}\savecaption{#1}}%
  1855. \fi\fi}
  1856. \long\def\pcatchcaption#1{%
  1857. \ifcaptypefig%
  1858. \expandafter\gdef\csname pcaption\the\pagefloatnumber\endcsname{%
  1859. \def\@captype{figure}\savecaption{#1}}%
  1860. \else%
  1861. \ifcaptypeplate
  1862. \expandafter\gdef\csname pcaption\the\pagefloatnumber\endcsname{%
  1863. \def\@captype{plate}\savecaption{#1}}%
  1864. \else
  1865. \expandafter\gdef\csname pcaption\the\pagefloatnumber\endcsname{%
  1866. \def\@captype{table}\savecaption{#1}}%
  1867. \fi\fi}
  1868. %%%
  1869. \long\def\catchletteredcaption#1#2{%
  1870. \ifcaptypefig%
  1871. \expandafter\gdef\csname letteredcaption\the\figandtabnumber\endcsname{%
  1872. \def\@captype{figure}\letteredcaption{#1}{#2}}%
  1873. \else%
  1874. \ifcaptypeplate
  1875. \expandafter\gdef\csname letteredcaption\the\figandtabnumber\endcsname{%
  1876. \def\@captype{plate}\letteredcaption{#1}{#2}}%
  1877. \else
  1878. \expandafter\gdef\csname letteredcaption\the\figandtabnumber\endcsname{%
  1879. \def\@captype{table}\letteredcaption{#1}{#2}}%
  1880. \fi\fi}
  1881. \long\def\dblcatchletteredcaption#1#2{%
  1882. \ifcaptypefig%
  1883. \expandafter\gdef\csname dblletteredcaption\the\dblfigandtabnumber\endcsname{%
  1884. \def\@captype{figure}%
  1885. \letteredcaption{#1}{#2}}%
  1886. \else%
  1887. \ifcaptypeplate
  1888. \expandafter\gdef\csname dblletteredcaption\the\dblfigandtabnumber\endcsname{%
  1889. \def\@captype{plate}%
  1890. \letteredcaption{#1}{#2}}%
  1891. \else
  1892. \expandafter\gdef\csname dblletteredcaption\the\dblfigandtabnumber\endcsname{%
  1893. \def\@captype{table}%
  1894. \letteredcaption{#1}{#2}}%
  1895. \fi\fi}
  1896. \long\def\pcatchletteredcaption#1#2{%
  1897. \ifcaptypefig%
  1898. \expandafter\gdef\csname pletteredcaption\the\pagefloatnumber\endcsname{%
  1899. \def\@captype{figure}%
  1900. \letteredcaption{#1}{#2}}%
  1901. \else%
  1902. \ifcaptypeplate%
  1903. \expandafter\gdef\csname pletteredcaption\the\pagefloatnumber\endcsname{%
  1904. \def\@captype{plate}%
  1905. \letteredcaption{#1}{#2}}%
  1906. \else
  1907. \expandafter\gdef\csname pletteredcaption\the\pagefloatnumber\endcsname{%
  1908. \def\@captype{table}%
  1909. \letteredcaption{#1}{#2}}%
  1910. \fi\fi}
  1911. %%%
  1912. \long\def\catchcontinuedcaption{%
  1913. \ifcaptypefig%
  1914. \expandafter\gdef\csname continuedcaption\the\figandtabnumber\endcsname{%
  1915. \def\@captype{figure}\continuedcaption}%
  1916. \else%
  1917. \ifcaptypeplate
  1918. \expandafter\gdef\csname continuedcaption\the\figandtabnumber\endcsname{%
  1919. \def\@captype{plate}\continuedcaption}%
  1920. \else
  1921. \expandafter\gdef\csname continuedcaption\the\figandtabnumber\endcsname{%
  1922. \def\@captype{table}\continuedcaption}%
  1923. \fi\fi}
  1924. \long\def\dblcatchcontinuedcaption{%
  1925. \ifcaptypefig%
  1926. \expandafter\gdef\csname dblcontinuedcaption\the\dblfigandtabnumber\endcsname{%
  1927. \def\@captype{figure}\continuedcaption}%
  1928. \else%
  1929. \ifcaptypeplate
  1930. \expandafter\gdef\csname dblcontinuedcaption\the\dblfigandtabnumber\endcsname{%
  1931. \def\@captype{plate}\continuedcaption}%
  1932. \else
  1933. \expandafter\gdef\csname dblcontinuedcaption\the\dblfigandtabnumber\endcsname{%
  1934. \def\@captype{table}\continuedcaption}%
  1935. \fi\fi}
  1936. \long\def\pcatchcontinuedcaption{%
  1937. \ifcaptypefig%
  1938. \expandafter\gdef\csname pcontinuedcaption\the\pagefloatnumber\endcsname{%
  1939. \def\@captype{figure}\continuedcaption}%
  1940. \else%
  1941. \ifcaptypeplate
  1942. \expandafter\gdef\csname pcontinuedcaption\the\pagefloatnumber\endcsname{%
  1943. \def\@captype{plate}\continuedcaption}%
  1944. \else
  1945. \expandafter\gdef\csname pcontinuedcaption\the\pagefloatnumber\endcsname{%
  1946. \def\@captype{table}\continuedcaption}%
  1947. \fi\fi}
  1948. %%%
  1949. \long\def\catchletteredcontinuedcaption#1{%
  1950. \ifcaptypefig%
  1951. \expandafter\gdef\csname letteredcontcaption\the\figandtabnumber\endcsname{%
  1952. \def\@captype{figure}\letteredcontinuedcaption{#1}}%
  1953. \else%
  1954. \ifcaptypeplate%
  1955. \expandafter\gdef\csname letteredcontcaption\the\figandtabnumber\endcsname{%
  1956. \def\@captype{plate}\letteredcontinuedcaption{#1}}%
  1957. \else
  1958. \expandafter\gdef\csname letteredcontcaption\the\figandtabnumber\endcsname{%
  1959. \def\@captype{table}\letteredcontinuedcaption{#1}}%
  1960. \fi\fi}
  1961. \long\def\dblcatchletteredcontinuedcaption#1{%
  1962. \ifcaptypefig%
  1963. \expandafter%
  1964. \gdef\csname dblletteredcontcaption\the\dblfigandtabnumber\endcsname{%
  1965. \def\@captype{figure}\letteredcontinuedcaption{#1}}%
  1966. \else%
  1967. \ifcaptypeplate
  1968. \expandafter%
  1969. \gdef\csname dblletteredcontcaption\the\dblfigandtabnumber\endcsname{%
  1970. \def\@captype{plate}\letteredcontinuedcaption{#1}}%
  1971. \else
  1972. \expandafter%
  1973. \gdef\csname dblletteredcontcaption\the\dblfigandtabnumber\endcsname{%
  1974. \def\@captype{table}\letteredcontinuedcaption{#1}}%
  1975. \fi\fi}
  1976. \long\def\pcatchletteredcontinuedcaption#1{%
  1977. \ifcaptypefig%
  1978. \expandafter%
  1979. \gdef\csname pletteredcontcaption\the\pagefloatnumber\endcsname{%
  1980. \def\@captype{figure}\letteredcontinuedcaption{#1}}%
  1981. \else%
  1982. \ifcaptypeplate%
  1983. \expandafter%
  1984. \gdef\csname pletteredcontcaption\the\pagefloatnumber\endcsname{%
  1985. \def\@captype{plate}\letteredcontinuedcaption{#1}}%
  1986. \else
  1987. \expandafter%
  1988. \gdef\csname pletteredcontcaption\the\pagefloatnumber\endcsname{%
  1989. \def\@captype{table}\letteredcontinuedcaption{#1}}%
  1990. \fi\fi}
  1991. %%%
  1992. \newcount\pagefloatnumber
  1993. \let\savelabel\label
  1994. \def\catchlabel#1{%
  1995. \expandafter\gdef\csname label\the\figandtabnumber\endcsname{\savelabel{#1}}}
  1996. \def\pcatchlabel#1{%
  1997. \expandafter\gdef\csname plabel\the\pagefloatnumber\endcsname{\savelabel{#1}}}
  1998. \def\dblcatchlabel#1{\expandafter%
  1999. \gdef\csname dbllabel\the\dblfigandtabnumber\endcsname{\savelabel{#1}}}
  2000. %%
  2001. \def\startonecolfloat{%
  2002. \expandafter\newbox\csname figandtabbox\the\figandtabnumber\endcsname%
  2003. \global\setbox\csname figandtabbox\the\figandtabnumber\endcsname=
  2004. \vbox\bgroup%
  2005. \ifcaptypefig\else
  2006. \ifcaptypeplate\def\@captype{plate}
  2007. \else
  2008. \def\@captype{table}\centering\tabletextsize\fi\fi%
  2009. \let\continuedcaption\catchcontinuedcaption
  2010. \let\letteredcaption\catchletteredcaption
  2011. \let\letteredcontinuedcaption\catchletteredcontinuedcaption
  2012. \let\caption\catchcaption
  2013. \let\label\catchlabel}
  2014. \def\xtopfloat{topfloat}
  2015. \def\xbotfloat{botfloat}
  2016. \newif\ifredefining
  2017. \newbox\sizeoffloat
  2018. \def\endonecolfloat{%
  2019. %\ifcaptypefig\else%
  2020. %\ifnobottomtabline\global\nobottomtablinefalse\vskip-6.5pt\else
  2021. %\vskip2pt
  2022. %\thetablelines\fi\fi%
  2023. %
  2024. \egroup%
  2025. \DonormalEndcol%
  2026. %% make room in column for this insert:
  2027. \setbox\sizeoffloat=\vbox{\let\unvbox\copy
  2028. \let\c@table\bogus
  2029. \let\c@figure\bogus
  2030. \redefiningfalse \loopnum=\figandtabnumber
  2031. \expandafter\csname \toporbotfloat\the\figandtabnumber\endcsname}%
  2032. %%
  2033. \expandafter\xdef\csname totalht\the\figandtabnumber\endcsname{%
  2034. \the\ht\sizeoffloat}% <=== use before \sizeoffloat is unboxed
  2035. \global\advance\figandtabnumber by1\relax}
  2036. \newcount\bogus
  2037. \def\DonormalEndcol{%
  2038. %% top float ==>
  2039. \ifx\toporbotfloat\xtopfloat%
  2040. %% figure ==>
  2041. \ifcaptypefig%
  2042. \expandafter\gdef\csname topfloat\the\figandtabnumber\endcsname{%
  2043. \vbox{\vskip\PushOneColTopFig%
  2044. \unvbox\csname figandtabbox\the\loopnum\endcsname%
  2045. \vskip\abovefigcaptionskip%
  2046. \csname caption\the\loopnum\endcsname%
  2047. \csname letteredcaption\the\loopnum\endcsname%
  2048. \csname continuedcaption\the\loopnum\endcsname%
  2049. \csname letteredcontcaption\the\loopnum\endcsname}%
  2050. \vskip\intextfloatskip%%
  2051. \vskip-4pt %% probably an artifact of topskip??
  2052. \ifredefining%
  2053. \csname label\the\loopnum\endcsname%
  2054. \expandafter\gdef\csname topfloat\the\loopnum\endcsname{}\fi}%
  2055. \else%
  2056. %% plate ==>
  2057. \ifcaptypeplate%
  2058. \expandafter\gdef\csname topfloat\the\figandtabnumber\endcsname{%
  2059. \vbox{\vskip\PushOneColTopFig%
  2060. \unvbox\csname figandtabbox\the\loopnum\endcsname
  2061. \vskip\abovefigcaptionskip
  2062. \csname caption\the\loopnum\endcsname
  2063. \csname letteredcaption\the\loopnum\endcsname
  2064. \csname continuedcaption\the\loopnum\endcsname
  2065. \csname letteredcontcaption\the\loopnum\endcsname}
  2066. \vskip\intextfloatskip %%
  2067. \vskip-4pt %% probably an artifact of topskip??
  2068. \ifredefining
  2069. \csname label\the\loopnum\endcsname
  2070. \expandafter\gdef\csname topfloat\the\loopnum\endcsname{}\fi}%
  2071. %
  2072. \else% table ==>
  2073. \expandafter\gdef\csname topfloat\the\figandtabnumber\endcsname{%
  2074. \vbox{\vskip\PushOneColTopTab %%
  2075. \csname caption\the\loopnum\endcsname
  2076. \csname letteredcaption\the\loopnum\endcsname
  2077. \csname continuedcaption\the\loopnum\endcsname
  2078. \csname letteredcontcaption\the\loopnum\endcsname
  2079. \vskip\captionskip
  2080. \unvbox\csname figandtabbox\the\loopnum\endcsname
  2081. }\vskip\intextfloatskip %% why don't we need this?
  2082. \vskip-10pt
  2083. \ifredefining
  2084. \csname label\the\loopnum\endcsname
  2085. \expandafter\gdef\csname topfloat\the\loopnum\endcsname{}\fi}
  2086. \fi\fi%
  2087. %
  2088. \else% bottom float
  2089. %
  2090. \ifcaptypefig
  2091. \expandafter\gdef\csname botfloat\the\figandtabnumber\endcsname{%
  2092. \vskip\intextfloatskip
  2093. \vbox{\unvbox\csname figandtabbox\the\loopnum\endcsname
  2094. \vskip\abovefigcaptionskip
  2095. \csname caption\the\loopnum\endcsname
  2096. \csname letteredcaption\the\loopnum\endcsname%
  2097. \csname continuedcaption\the\loopnum\endcsname%
  2098. \csname letteredcontcaption\the\loopnum\endcsname%
  2099. \vskip\PushOneColBotFig%%
  2100. }%
  2101. \ifredefining%
  2102. %\xdef\@currentlabel{\thefigure}%
  2103. \csname label\the\loopnum\endcsname
  2104. \expandafter\gdef\csname botfloat\the\loopnum\endcsname{}\fi}%
  2105. \else
  2106. \ifcaptypeplate
  2107. \expandafter\gdef\csname botfloat\the\figandtabnumber\endcsname{%
  2108. \vskip\intextfloatskip
  2109. \vbox{\unvbox\csname figandtabbox\the\loopnum\endcsname
  2110. \vskip\abovefigcaptionskip
  2111. \csname caption\the\loopnum\endcsname
  2112. \csname letteredcaption\the\loopnum\endcsname%
  2113. \csname continuedcaption\the\loopnum\endcsname%
  2114. \csname letteredcontcaption\the\loopnum\endcsname%
  2115. \vskip\PushOneColBotFig%%
  2116. }%
  2117. \ifredefining%
  2118. %\xdef\@currentlabel{\thefigure}%
  2119. \csname label\the\loopnum\endcsname
  2120. \expandafter\gdef\csname botfloat\the\loopnum\endcsname{}\fi}%
  2121. \else% TABLE
  2122. \expandafter\gdef\csname botfloat\the\figandtabnumber\endcsname{%
  2123. \vskip\intextfloatskip
  2124. \vbox{\csname caption\the\loopnum\endcsname
  2125. \csname letteredcaption\the\loopnum\endcsname
  2126. \csname continuedcaption\the\loopnum\endcsname
  2127. \csname letteredcontcaption\the\loopnum\endcsname%
  2128. \vskip.5\intextfloatskip
  2129. \unvbox\csname figandtabbox\the\loopnum\endcsname%
  2130. \vskip\PushOneColBotTab
  2131. }%
  2132. \ifredefining%
  2133. \csname label\the\loopnum\endcsname
  2134. \expandafter\gdef\csname botfloat\the\loopnum\endcsname{}\fi}%
  2135. \fi\fi\fi}
  2136. %
  2137. \def\startpagefloat{%
  2138. \expandafter\newbox\csname pagebox\the\pagefloatnumber\endcsname%
  2139. \global\setbox\csname pagebox\the\pagefloatnumber\endcsname=\vbox\bgroup%
  2140. \hsize=\textwidth%
  2141. \linewidth=\textwidth%
  2142. \captionwidth=\widecaptionwidth
  2143. \let\label\pcatchlabel\ifcaptypefig\else\centering\fi%
  2144. \let\caption\pcatchcaption \let\letteredcaption\pcatchletteredcaption
  2145. \let\continuedcaption\pcatchcontinuedcaption
  2146. \let\letteredcontinuedcaption\pcatchletteredcontinuedcaption
  2147. }
  2148. \def\endpagefloat{\egroup
  2149. \DoNormalPage
  2150. \global\advance\pagefloatnumber by1
  2151. }
  2152. \def\DoNormalPage{\ifcaptypefig
  2153. %
  2154. \expandafter\gdef\csname pagefloat\the\pagefloatnumber\endcsname{%
  2155. \vbox{\hsize=\textwidth
  2156. \linewidth=\textwidth
  2157. \twocolfigortabtrue
  2158. \captionwidth=\widecaptionwidth
  2159. \unvbox\csname pagebox\the\pageloopnum\endcsname
  2160. \vskip\captionskip
  2161. \csname pcaption\the\pageloopnum\endcsname
  2162. \csname pletteredcaption\the\pageloopnum\endcsname
  2163. \csname pcontinuedcaption\the\pageloopnum\endcsname
  2164. \csname pletteredcontcaption\the\pageloopnum\endcsname
  2165. } \vskip\intextfloatskip %%
  2166. \xdef\@currentlabel{\thefigure}%
  2167. \csname plabel\the\pageloopnum\endcsname
  2168. \expandafter\gdef\csname pagefloat\the\pageloopnum\endcsname{}}%
  2169. \else
  2170. \ifcaptypeplate
  2171. \expandafter\gdef\csname pagefloat\the\pagefloatnumber\endcsname{%
  2172. \vbox{\hsize=\textwidth
  2173. \linewidth=\textwidth
  2174. \twocolfigortabtrue
  2175. \captionwidth=\widecaptionwidth
  2176. \unvbox\csname pagebox\the\pageloopnum\endcsname
  2177. \vskip\captionskip
  2178. \csname pcaption\the\pageloopnum\endcsname
  2179. \csname pletteredcaption\the\pageloopnum\endcsname
  2180. \csname pcontinuedcaption\the\pageloopnum\endcsname
  2181. \csname pletteredcontcaption\the\pageloopnum\endcsname
  2182. } \vskip\intextfloatskip %%
  2183. \xdef\@currentlabel{\thefigure}%
  2184. \csname plabel\the\pageloopnum\endcsname
  2185. \expandafter\gdef\csname pagefloat\the\pageloopnum\endcsname{}}%
  2186. \else
  2187. \expandafter\gdef\csname pagefloat\the\pagefloatnumber\endcsname{%
  2188. \vbox{%%
  2189. \hsize=\textwidth
  2190. \linewidth=\textwidth
  2191. \iflandscapetable
  2192. \dimen0=\textheight
  2193. \advance\dimen0 by-\textwidth
  2194. \hsize=\textheight
  2195. \linewidth=\textheight\fi%
  2196. \csname pcaption\the\pageloopnum\endcsname
  2197. \csname pletteredcaption\the\pageloopnum\endcsname
  2198. \csname pcontinuedcaption\the\pageloopnum\endcsname
  2199. \csname pletteredcontcaption\the\pageloopnum\endcsname
  2200. \vskip\intextfloatskip
  2201. \unvbox\csname pagebox\the\pageloopnum\endcsname}
  2202. \vskip\intextfloatskip %%
  2203. \csname plabel\the\pageloopnum\endcsname
  2204. \expandafter\gdef\csname pagefloat\the\pageloopnum\endcsname{}}\fi\fi}
  2205. \newif\iffirstfighere
  2206. \global\firstfigheretrue
  2207. \newif\iffirsttabhere
  2208. \global\firsttabheretrue
  2209. \def\dofigmessage{\iffirstfighere\global\firstfigherefalse
  2210. \typeout{^^J
  2211. ========================================================================
  2212. J
  2213. C A R E F U L !!!!!^^J
  2214. J
  2215. You have used \string\begin{figure}[h]\space !^^J
  2216. If there are any figures that appear earlier on the page^^J
  2217. they may be numbered incorrectly.^^J
  2218. J
  2219. Please check this and every other page on which you have used ^^J
  2220. \string\begin{figure}[h]\space !^^J
  2221. J
  2222. ========================================================================
  2223. J}
  2224. \else
  2225. \typeout{^^J^^J
  2226. C A R E F U L !! \string\begin{figure}[h] used on this page !^^J^^J}
  2227. \fi}
  2228. \def\dotabmessage{\iffirsttabhere\global\firsttabherefalse
  2229. \typeout{^^J
  2230. ========================================================================
  2231. J
  2232. C A R E F U L !!!!!^^J
  2233. J
  2234. You have used \string\begin{table}[h]\space !^^J
  2235. If there are any tables that appear earlier on the page^^J
  2236. they may be numbered incorrectly.^^J
  2237. J
  2238. Please check this and every other page on which you have used ^^J
  2239. \string\begin{table}[h]\space !^^J
  2240. J
  2241. ========================================================================
  2242. J}
  2243. \else
  2244. \typeout{^^J^^J
  2245. C A R E F U L !! \string\begin{table}[h] used on this page !^^J^^J}
  2246. \fi}
  2247. \def\lookforposition[#1]{\defone#1*%
  2248. \let\go\startonecolfloat
  2249. \let\endtable\endonecolfloat
  2250. \let\endfigure\endonecolfloat
  2251. \let\endplate\endonecolfloat
  2252. \ifgalley
  2253. \if\one p \def\one{s}
  2254. \else
  2255. \def\one{i}\fi
  2256. %\else\ifappendon\def\one{h}\fi
  2257. \fi%
  2258. \ifjdraft
  2259. \expandafter\ifx\csname setkeys\endcsname\relax\else
  2260. \setkeys{Gin}{draft=false}\fi
  2261. \if\one p \def\one{s}
  2262. \else
  2263. \def\one{i}\fi
  2264. \else%\ifappendon\def\one{h}\fi
  2265. \fi%
  2266. \if\one h
  2267. \ifcaptypeplate\else
  2268. \ifcaptypefig
  2269. \dofigmessage
  2270. \else
  2271. \dotabmessage
  2272. \fi\fi%
  2273. \let\go\doonecolfighere
  2274. \let\endtable\endonecolfighere
  2275. \let\endfigure\endonecolfighere
  2276. \let\endplate\endonecolfighere
  2277. \else%
  2278. \if\one t%
  2279. \gdef\toporbotfloat{topfloat}%
  2280. \else%
  2281. \if\one b%
  2282. \gdef\toporbotfloat{botfloat}%
  2283. \else%
  2284. \if\one p%
  2285. \let\go\startpagefloat%
  2286. \let\endtable\endpagefloat%
  2287. \let\endfigure\endpagefloat%
  2288. \let\endplate\endpagefloat%
  2289. \else%
  2290. \if\one e% for either
  2291. \ifdim\pagetotal>.6\pagegoal%
  2292. \gdef\toporbotfloat{botfloat}%
  2293. \else%
  2294. \gdef\toporbotfloat{topfloat}%
  2295. \fi%
  2296. \else%
  2297. \if\one i% for galley mode
  2298. \let\go\dofiginsert%
  2299. \let\endtable\endfiginsert%
  2300. \let\endfigure\endfiginsert%
  2301. \let\endplate\endfiginsert%
  2302. \else%
  2303. \if\one s% for special galley mode, for [p]
  2304. \let\go\dodblfiginsert%
  2305. \let\endtable\endspfiginsert%
  2306. \let\endfigure\endspfiginsert%
  2307. \let\endplate\endspfiginsert%
  2308. \else%
  2309. \doerr%
  2310. \ifdim\pagetotal>.5\pagegoal%
  2311. \gdef\toporbotfloat{botfloat}%
  2312. \else%
  2313. \gdef\toporbotfloat{topfloat}%
  2314. \fi%
  2315. \fi\fi\fi\fi\fi\fi\fi\go}
  2316. \newinsert\figinsert
  2317. \skip\figinsert=0pt % space added when figinsert is used
  2318. \count\figinsert=0 % insert magnification factor (1 to 1)
  2319. \dimen\figinsert=\maxdimen % maximum space for figures
  2320. \def\dofiginsert{\setbox0=\vbox\bgroup
  2321. \ifcaptypefig\def\@captype{figure}\else
  2322. \ifcaptypeplate\def\@captype{plate}\else
  2323. \def\@captype{table}\centering\tabletextsize\fi\fi}
  2324. \def\endfiginsert{\egroup\insert\figinsert{\vskip24pt\vbox{\unvbox0}\vskip24pt}%
  2325. \ignorespaces}
  2326. \def\endspfiginsert{\egroup\insert\figinsert{\newpage\vbox to\textheight{\vss
  2327. \unvbox0}\newpage}%
  2328. \ignorespaces}
  2329. \def\dodblfiginsert{\setbox0=\vbox\bgroup
  2330. \captionwidth=\widecaptionwidth
  2331. \hsize=\textwidth
  2332. \linewidth=\textwidth
  2333. \ifcaptypefig\def\@captype{figure}\else
  2334. \ifcaptypeplate\def\@captype{plate}\else
  2335. \def\@captype{table}\centering\fi\fi
  2336. }
  2337. \def\enddblfiginsert{\egroup\insert\figinsert{\vskip24pt\vbox{\unvbox0}\vskip24pt}}
  2338. \long\def\saveherecaption#1{\gdef\thesavedcaption{\savecaption{#1}}}
  2339. \long\def\saveherecontinuedcaption{\gdef\thesavedcaption{\continuedcaption}}
  2340. \long\def\savehereletteredcaption#1#2{\gdef\thesavedcaption{%
  2341. \gdef\theletter{#1}\savecaption{#2}}}
  2342. \long\def\savehereletteredcontinuedcaption#1{\gdef\thesavedcaption{%
  2343. \letteredcontinuedcaption{#1}}}
  2344. \long\def\saveherelabel#1{\gdef\thesavedlabel{#1}}
  2345. \saveherelabel{\relax}
  2346. \def\thesavedcaption{\relax}
  2347. \newbox\herebox
  2348. %% either figure [h] or table [h]
  2349. \newif\ifhere
  2350. \def\doonecolfighere{\vskip1sp\bgroup%
  2351. \heretrue%
  2352. \ifcaptypefig\def\@captype{figure}\else%
  2353. \ifcaptypeplate\def\@captype{plate}\else%
  2354. \def\@captype{table}\centering\fi\fi%
  2355. \setbox\herebox\vbox\bgroup%
  2356. \let\label\saveherelabel%
  2357. \let\caption\saveherecaption%
  2358. \let\letteredcaption\savehereletteredcaption%
  2359. \let\continuedcaption\saveherecontinuedcaption%
  2360. \let\letteredcontinuedcaption\savehereletteredcontinuedcaption%
  2361. }
  2362. \def\xrelax{\relax}
  2363. \def\endonecolfighere{%
  2364. \egroup%
  2365. \vskip\intextfloatskip%
  2366. \vtop{\vskip-5.5pt
  2367. %\ifappendon
  2368. %\let\thefigure\appthefigure
  2369. %\let\thetable\appthetable
  2370. %\let\theplate\apptheplate
  2371. %\let\savecaption\appcaption
  2372. %\fi
  2373. %
  2374. \ifx\thesavedcaption\xrelax
  2375. \unvbox\herebox
  2376. \else
  2377. \ifcaptypefig
  2378. \unvbox\herebox
  2379. \thesavedcaption
  2380. \else
  2381. \ifcaptypeplate
  2382. \unvbox\herebox
  2383. \thesavedcaption
  2384. %
  2385. \else
  2386. %
  2387. \thesavedcaption
  2388. \unvbox\herebox
  2389. \fi
  2390. \fi\fi
  2391. %
  2392. \gdef\thesavedcaption{\relax}
  2393. \ifx\thesavedlabel\xrelax\else%
  2394. \ifcaptypefig\else\edef\@currentlabel{\thetable}\fi
  2395. \savelabel{\thesavedlabel}
  2396. \gdef\thesavedlabel{\relax}
  2397. \fi
  2398. \gdef\theletter{\relax}
  2399. }\vskip1sp
  2400. \egroup
  2401. \vskip\intextfloatskip
  2402. }
  2403. \newbox\endfigbox
  2404. \def\doerr{%
  2405. \typeout{\space\space\space\space\space\space\space\space\space}
  2406. \typeout{Sorry!
  2407. Your choices following \string\figure\space or \string\table\space^^J%
  2408. are only [h] for `here', [t] for `top', [b] for `bottom', or [p]
  2409. for `page'.^^J%
  2410. I have ignored the [\one] and inserted the figure or table at this
  2411. point^^J%
  2412. on the page. See documentation if you need more help.}
  2413. \typeout{\space\space\space\space\space\space\space\space\space}}
  2414. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2415. %%% Inserts spanning both columns:
  2416. \newbox\spanbox
  2417. \def\centertabular{\bgroup\centering\savetabular}
  2418. \def\endcentertabular{\saveendtabular\vskip1pt\egroup}
  2419. %%%
  2420. \newbox\dbltopins
  2421. \newbox\dblbotins
  2422. \newskip\dblbotskip
  2423. \dblbotskip=12pt plus 3pt
  2424. \def\twocolfig{\global\captypefigtrue
  2425. \global\captypeplatefalse
  2426. \def\@captype{figure}
  2427. \@ifnextchar[\twolookforposition{\twolookforposition[t]}}%
  2428. \def\twocolplate{\global\captypeplatetrue
  2429. \global\captypefigfalse
  2430. \def\@captype{plate}
  2431. \@ifnextchar[\twolookforposition{\twolookforposition[t]}}%
  2432. \def\twocoltable{\vskip1pt\tabletextsize
  2433. \global\captypefigfalse
  2434. \global\captypeplatefalse
  2435. \def\@captype{table}
  2436. \@ifnextchar[\twolookforposition{\twolookforposition[t]}}%
  2437. \newcount\dblfigandtabnumber
  2438. \dblfigandtabnumber=1
  2439. \newbox\dblfigandtabbox
  2440. \def\starttwocolfloat{\ifvmode\else\unskip\fi\expandafter%
  2441. \ifx\csname dblfigandtabbox\the\dblfigandtabnumber\endcsname\relax%
  2442. \expandafter%
  2443. \newbox\csname dblfigandtabbox\the\dblfigandtabnumber\endcsname%
  2444. \fi%
  2445. \global\setbox\csname dblfigandtabbox\the\dblfigandtabnumber\endcsname=
  2446. \vbox\bgroup\let\label\dblcatchlabel%
  2447. %
  2448. \ifcaptypefig\def\@captype{figure}\else%
  2449. \ifcaptypeplate\def\@captype{plate}\else%
  2450. \def\@captype{table}\centering\tabletextsize%
  2451. \fi%
  2452. \fi%
  2453. \captionwidth=\widecaptionwidth
  2454. \hsize=\textwidth
  2455. \linewidth=\textwidth\relax
  2456. %
  2457. \let\caption\dblcatchcaption
  2458. \let\letteredcaption\dblcatchletteredcaption
  2459. \let\continuedcaption\dblcatchcontinuedcaption
  2460. \let\letteredcontinuedcaption\dblcatchletteredcontinuedcaption
  2461. \let\label\dblcatchlabel
  2462. }
  2463. \newcount\dblloopnum
  2464. \newcount\savedblfigandtabnumber
  2465. %\newcount\savefigandtabnumber
  2466. \def\xdbltopfloat{dbltopfloat}
  2467. \def\xdblbotfloat{dblbotfloat}
  2468. \def\endtwocolfloat{%
  2469. %\ifcaptypefig\else%
  2470. %\ifcaptypeplate\else%
  2471. %\ifnobottomtabline\global\nobottomtablinefalse\vskip-6.5pt\else%
  2472. %\vskip2pt
  2473. %\thetablelines\fi\fi\fi%
  2474. %
  2475. \egroup%
  2476. \ifx\dbltoporbotfloat\xdbltopfloat%
  2477. %%++
  2478. \ifcaptypefig%
  2479. \expandafter\gdef\csname dbltopfloat\the\dblfigandtabnumber\endcsname{%
  2480. \vbox{\vskip\PushTwoColTopFig%
  2481. \copy\csname dblfigandtabbox\the\dblloopnum\endcsname%
  2482. \vskip\captionskip%
  2483. \csname dblcaption\the\dblloopnum\endcsname%
  2484. \csname dblletteredcaption\the\dblloopnum\endcsname%
  2485. \csname dblcontinuedcaption\the\dblloopnum\endcsname%
  2486. \csname dblletteredcontcaption\the\dblloopnum\endcsname%
  2487. \ifredefining%
  2488. \xdef\@currentlabel{\thefigure}%
  2489. \csname dbllabel\the\dblloopnum\endcsname\fi}%
  2490. \vskip\intextfloatskip %%
  2491. \vskip-5pt% because there is a space above the top of text, from topskip?
  2492. \ifredefining%
  2493. \expandafter\gdef\csname dbltopfloat\the\dblloopnum\endcsname{}\fi}%
  2494. \else\ifcaptypeplate%
  2495. \expandafter\gdef\csname dbltopfloat\the\dblfigandtabnumber\endcsname{%
  2496. \vbox{\vskip\PushTwoColTopFig%
  2497. \copy\csname dblfigandtabbox\the\dblloopnum\endcsname%
  2498. \vskip\captionskip%
  2499. \csname dblcaption\the\dblloopnum\endcsname%
  2500. \csname dblletteredcaption\the\dblloopnum\endcsname%
  2501. \csname dblcontinuedcaption\the\dblloopnum\endcsname%
  2502. \csname dblletteredcontcaption\the\dblloopnum\endcsname%
  2503. \ifredefining%
  2504. \xdef\@currentlabel{\theplate}%
  2505. \csname dbllabel\the\dblloopnum\endcsname\fi}%
  2506. \vskip\intextfloatskip %%
  2507. \vskip-5pt% because there is a space above the top of text, from topskip?
  2508. \ifredefining%
  2509. \expandafter\gdef\csname dbltopfloat\the\dblloopnum\endcsname{}\fi}%
  2510. \else% table
  2511. \expandafter\gdef\csname dbltopfloat\the\dblfigandtabnumber\endcsname{%
  2512. \vbox{\vskip\PushTwoColTopTab%
  2513. \csname dblcaption\the\dblloopnum\endcsname%
  2514. \csname dblletteredcaption\the\dblloopnum\endcsname%
  2515. \csname dblcontinuedcaption\the\dblloopnum\endcsname%
  2516. \csname dblletteredcontcaption\the\dblloopnum\endcsname%
  2517. \vskip\captionskip%
  2518. \copy\csname dblfigandtabbox\the\dblloopnum\endcsname}%
  2519. \vskip\intextfloatskip %%
  2520. \vskip-5pt% because there is a space above the top of text, from topskip?
  2521. \ifredefining%
  2522. \csname dbllabel\the\dblloopnum\endcsname%
  2523. \expandafter\gdef\csname dbltopfloat\the\dblloopnum\endcsname{}\fi}%
  2524. %
  2525. \fi\fi%
  2526. %
  2527. \else% bottom float
  2528. %
  2529. \ifcaptypefig%
  2530. \expandafter\gdef\csname dblbotfloat\the\dblfigandtabnumber\endcsname{%
  2531. \vskip\intextfloatskip%
  2532. \vbox{\copy\csname dblfigandtabbox\the\dblloopnum\endcsname%
  2533. \vskip\captionskip%
  2534. \csname dblcaption\the\dblloopnum\endcsname%
  2535. \csname dblletteredcaption\the\dblloopnum\endcsname%
  2536. \csname dblcontinuedcaption\the\dblloopnum\endcsname%
  2537. \csname dblletteredcontcaption\the\dblloopnum\endcsname%
  2538. \ifredefining%
  2539. \csname dbllabel\the\dblloopnum\endcsname\fi%
  2540. \vskip\PushTwoColBotFig}%???
  2541. \ifredefining%
  2542. \expandafter\gdef\csname dblbotfloat\the\dblloopnum\endcsname{}\fi}%
  2543. \else%
  2544. %%
  2545. \ifcaptypeplate%
  2546. \expandafter\gdef\csname dblbotfloat\the\dblfigandtabnumber\endcsname{%
  2547. \vskip\intextfloatskip%
  2548. \vbox{\copy\csname dblfigandtabbox\the\dblloopnum\endcsname%
  2549. \vskip\captionskip%
  2550. \csname dblcaption\the\dblloopnum\endcsname%
  2551. \csname dblletteredcaption\the\dblloopnum\endcsname%
  2552. \csname dblcontinuedcaption\the\dblloopnum\endcsname%
  2553. \csname dblletteredcontcaption\the\dblloopnum\endcsname%
  2554. \ifredefining%
  2555. \csname dbllabel\the\dblloopnum\endcsname\fi%
  2556. \vskip\PushTwoColBotFig}%
  2557. \ifredefining%
  2558. \expandafter\gdef\csname dblbotfloat\the\dblloopnum\endcsname{}\fi
  2559. }%
  2560. \else% table
  2561. \expandafter\gdef\csname dblbotfloat\the\dblfigandtabnumber\endcsname{%
  2562. \vskip\intextfloatskip
  2563. \vbox{%
  2564. \csname dblcaption\the\dblloopnum\endcsname%
  2565. \csname dblletteredcaption\the\dblloopnum\endcsname%
  2566. \csname dblcontinuedcaption\the\dblloopnum\endcsname%
  2567. \csname dblletteredcontcaption\the\dblloopnum\endcsname%
  2568. \vskip\captionskip
  2569. \ifredefining%
  2570. \csname dbllabel\the\dblloopnum\endcsname\fi%
  2571. \copy\csname dblfigandtabbox\the\dblloopnum\endcsname%
  2572. \vskip\PushTwoColBotTab}%
  2573. \ifredefining%
  2574. \expandafter\gdef\csname dblbotfloat\the\dblloopnum\endcsname{}\fi}%
  2575. %
  2576. \fi\fi\fi%
  2577. %%
  2578. \global\advance\dblfigandtabnumber by1 \relax}
  2579. \newbox\dblspanherebox
  2580. \def\dodblfigurehere{\global\setbox\dblspanherebox=\vbox\bgroup
  2581. \let\label\saveherelabel
  2582. \ifcaptypefig\def\@captype{figure}\else
  2583. \ifcaptypeplate\def\@captype{plate}\else
  2584. \def\@captype{table}\centering\fi\fi
  2585. \vskip\intextfloatskip
  2586. \captionwidth=\widecaptionwidth
  2587. \hsize=\textwidth
  2588. \linewidth=\textwidth
  2589. \let\label\saveherelabel
  2590. \let\caption\saveherecaption
  2591. \let\letteredcaption\savehereletteredcaption
  2592. \let\continuedcaption\saveherecontinuedcaption
  2593. \let\letteredcontinuedcaption\savehereletteredcontinuedcaption}
  2594. \def\enddodblfigurehere{\vskip\intextfloatskip\egroup%
  2595. \aftergroup\endcolsneatly}
  2596. %%
  2597. \def\endcolsneatly{\ifdim\lastskip=2sp
  2598. \vskip-9.5pt\null\fi
  2599. \endtwocolumns
  2600. \vbox{\vskip\intextfloatskip
  2601. \captionwidth=\widecaptionwidth
  2602. \ifcaptypefig\def\@captype{figure}\else
  2603. \ifcaptypeplate\def\@captype{plate}\else
  2604. \def\@captype{table}\centering\fi\fi
  2605. %\ifappendon
  2606. %\let\thefigure\appthefigure
  2607. %\let\thetable\appthetable
  2608. %\let\theplate\apptheplate
  2609. %\let\savecaption\appcaption
  2610. %\fi
  2611. %
  2612. \ifx\thesavedcaption\xrelax
  2613. \unvbox\dblspanherebox
  2614. \vskip\intextfloatskip
  2615. \else
  2616. \ifcaptypefig
  2617. \unvbox\dblspanherebox
  2618. \thesavedcaption
  2619. \vskip\intextfloatskip
  2620. %
  2621. \else
  2622. \ifcaptypeplate
  2623. \unvbox\dblspanherebox
  2624. \thesavedcaption
  2625. \vskip\intextfloatskip
  2626. %
  2627. \else
  2628. \vskip\intextfloatskip
  2629. \thesavedcaption
  2630. \unvbox\dblspanherebox
  2631. \vskip\intextfloatskip
  2632. \fi
  2633. \fi\fi
  2634. %
  2635. \gdef\thesavedcaption{\relax}
  2636. \ifx\thesavedlabel\xrelax\else\savelabel{\thesavedlabel}
  2637. \gdef\thesavedlabel{\relax}\fi
  2638. \gdef\theletter{\relax}
  2639. \vskip\intextfloatskip}
  2640. \twocolumns\null
  2641. \vskip2sp}
  2642. \def\twolookforposition[#1]{\defone#1*%
  2643. \let\go\starttwocolfloat%
  2644. \ifgalley%
  2645. \if\one p \def\one{s}%
  2646. \else%
  2647. \def\one{i}%
  2648. \fi%
  2649. \fi%
  2650. \ifjdraft%
  2651. \expandafter\ifx\csname setkeys\endcsname\relax\else
  2652. \setkeys{Gin}{draft=false}\fi
  2653. \if\one p \def\one{s}%
  2654. \else%
  2655. \def\one{i}%
  2656. \fi%
  2657. \fi%
  2658. %\ifappendon\def\one{h}\fi%
  2659. %%
  2660. \if\one h%
  2661. \ifcaptypeplate%
  2662. \else%
  2663. \ifcaptypefig%
  2664. \dofigmessage%
  2665. \else%
  2666. \dotabmessage%
  2667. \fi%
  2668. \fi%
  2669. \ifgalley%
  2670. \gdef\dbltoporbotfloat{dbltopfloat}%
  2671. \else% not galley ==>
  2672. \let\go\dodblfigurehere%
  2673. \expandafter\gdef\csname endfigure*\endcsname{\enddodblfigurehere}%
  2674. \expandafter\gdef\csname endtable*\endcsname{\enddodblfigurehere}%
  2675. \expandafter\gdef\csname endplate*\endcsname{\enddodblfigurehere}%
  2676. \fi% end ifgalley
  2677. \else%
  2678. \if\one t%
  2679. \gdef\dbltoporbotfloat{dbltopfloat}%
  2680. \else%
  2681. \if\one b%
  2682. \gdef\dbltoporbotfloat{dblbotfloat}%
  2683. \else%
  2684. \if\one p%
  2685. \let\go\startpagefloat%
  2686. \expandafter\gdef\csname endfigure*\endcsname{\endpagefloat}
  2687. \expandafter\gdef\csname endtable*\endcsname{\endpagefloat}
  2688. \expandafter\gdef\csname endplate*\endcsname{\endpagefloat}
  2689. \else%
  2690. \if\one i% for galley mode
  2691. \let\go\dodblfiginsert%
  2692. \expandafter\gdef\csname endfigure*\endcsname{\enddblfiginsert}
  2693. \expandafter\gdef\csname endtable*\endcsname{\enddblfiginsert}
  2694. \expandafter\gdef\csname endplate*\endcsname{\enddblfiginsert}
  2695. \else%
  2696. \if\one s% for special galley mode, for [p]
  2697. \let\go\dodblfiginsert%
  2698. \expandafter\gdef\csname endfigure*\endcsname{\endspfiginsert}%
  2699. \expandafter\gdef\csname endtable*\endcsname{\endspfiginsert}
  2700. \expandafter\gdef\csname endplate*\endcsname{\endspfiginsert}
  2701. \else%
  2702. \doerr%
  2703. \fi%
  2704. \fi%
  2705. \fi%
  2706. \fi%
  2707. \fi%
  2708. \fi\go}%
  2709. \let\saveenddocument\enddocument
  2710. \def\enddocument{%
  2711. \ifdim\ht\dbltopins>0pt\vbox{\unvbox\dbltopins}\fi
  2712. \ifdim\ht\dblbotins>0pt\vbox{\unvbox\dblbotins}\fi
  2713. \ifnum\pagefloatnumber>\pageloopnum
  2714. \newpage
  2715. \insertpage{\hsize=\textwidth
  2716. \linewidth=\textwidth
  2717. \csname pagefloat\the\pageloopnum \endcsname}\fi%
  2718. \immediate\write\@auxout{\string\gdef\string\lastpage{\thepage}}
  2719. \saveenddocument}
  2720. \splittopskip=\topskip
  2721. \def~{\penalty\@M{ }}
  2722. \def\mathleftline{\vskip-\parskip
  2723. \hbox to\textwidth{\hrulefill\hskip.5\textwidth}\vskip-\abovedisplayskip}
  2724. \def\mathrightline{\hbox to\textwidth{\hskip.5\textwidth\hrulefill}\vskip18pt}
  2725. \let\topline\mathleftline
  2726. \let\botline\mathrightline
  2727. %% End Two Column Macros
  2728. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2729. \let\savefigure\figure
  2730. \let\saveendfigure\endfigure
  2731. %%%Packages installing
  2732. \RequirePackage{graphicx}
  2733. \RequirePackage{epstopdf}
  2734. \RequirePackage{amssymb}
  2735. \RequirePackage{amsfonts}
  2736. \RequirePackage{amsmath}
  2737. \RequirePackage[usenames]{xcolor}
  2738. \definecolor{signitext}{cmyk}{1,.45,0,.18}
  2739. \definecolor{signiback}{cmyk}{.15,.07,0,.03}
  2740. \gdef\significancetext#1{\gdef\@significancetext{#1}}
  2741. \let\@significancetext\@empty
  2742. \def\article{\twocolumns
  2743. \bgroup
  2744. \setlength{\fboxsep}{6pt}
  2745. \ifx \@significancetext\@empty
  2746. \renewcommand\thefootnote{}%
  2747. %\footnotetext{\vbox to 3.7cm{\significanceheadfont Reserved for Publication Footnotes\vfill}}%
  2748. \else
  2749. \renewcommand\thefootnote{}%
  2750. \footnotetext{\vbox{\fcolorbox{signitext}{signiback}{\parbox{232pt}{\par\vspace*{2pt}{\significanceheadfont \color{signitext}Significance}\par\vspace*{12pt}%
  2751. {\color{signitext}\significancefont\@significancetext}}}\par\vspace*{4.5pt}
  2752. {\vbox to 3.7cm{\significanceheadfont Reserved for Publication Footnotes\vfill}}}}
  2753. \fi
  2754. \egroup
  2755. }
  2756. \def\endarticle{\endtwocolumns\newpage
  2757. \expandafter\gdef\csname table*\endcsname{\@dblfloat{table}}
  2758. \expandafter\gdef\csname endtable*\endcsname{\end@dblfloat}
  2759. \expandafter\gdef\csname figure*\endcsname{\@dblfloat{figure}}
  2760. \expandafter\gdef\csname endfigure*\endcsname{\end@dblfloat}
  2761. \gdef\figure{\futurelet\next\lookforbrac}}
  2762. \def\lookforbrac{\if\next[
  2763. \let\go\figone\else \let\go\figtwo\fi\go}
  2764. \def\figone[#1]{\@float{figure}[#1]\hsize276pt}
  2765. \def\figtwo{\@float{figure}\hsize276pt}
  2766. \newif\ifjdraft
  2767. \newdimen\captionwidth
  2768. \newdimen\widecaptionwidth
  2769. \newif\ifgalley
  2770. \let\tabletextsize\normalsize
  2771. \def\inlinefrac#1#2{%
  2772. \mbox{\raisebox{.8mm}{%
  2773. $\textstyle #1$%
  2774. }
  2775. $\!\!\! / \!\!\!$
  2776. \raisebox{-.8mm}{$\textstyle #2$}}%
  2777. }
  2778. \newcount\tablenoteloopnum
  2779. \newcount\tablenotenum
  2780. \def\tablenote#1{\global\advance\tablenotenum by 1\relax
  2781. $^{\@fnsymbol{\the\tablenotenum}}$\expandafter\gdef\csname
  2782. tabnote\the\tablenotenum\endcsname{#1}}
  2783. \def\tablenotes{\tablenoteloopnum=\tablenotenum
  2784. \global\advance\tablenoteloopnum by 1
  2785. \tablenotenum=0
  2786. {\figtextfont
  2787. \leftskip=0pt \rightskip=\leftskip
  2788. \parfillskip=0pt plus 1 fil
  2789. \loop
  2790. \vskip2pt
  2791. \noindent
  2792. \global\advance\tablenotenum by 1
  2793. \ifnum\tablenotenum<\tablenoteloopnum
  2794. $^{\@fnsymbol{\the\tablenotenum}}$\csname
  2795. tabnote\the\tablenotenum\endcsname
  2796. \repeat}
  2797. }
  2798. %% convenient macros from author:
  2799. \def\o{\omega}
  2800. \def\pr{\partial}
  2801. \def\d{\delta}
  2802. \def\a{\alpha}
  2803. \def\p{\phi}
  2804. \def\dst{\displaystyle}
  2805. \def\chit{\tilde{\chi}}
  2806. \def\etat{\tilde{\eta}}
  2807. \def\fdb{\mathbb{R}/_{\dst{ \mathbb{Z}}}}
  2808. \def\fd{\mathbb{R}/_{\scriptstyle \mathbb{Z}}}
  2809. \def\f12{\frac{1}{2}}
  2810. \def\fr32{\frac{3}{2}}
  2811. \def\vs{\vspace{10pt}}
  2812. \def\vsm{\vspace{-10pt}}
  2813. \def\xb{\bar{x}}
  2814. \def\yb{\bar{y}}
  2815. \def\tb{\bar{t}}
  2816. \def\xt{\tilde{x}}
  2817. \def\yt{\tilde{y}}
  2818. \def\gtt{\tilde{g}}
  2819. \def\vptt{\tilde{\varphi}}
  2820. \def\htt{\tilde{h}}
  2821. \def\ktt{\tilde{k}}
  2822. \def\ub{\bar{u}}
  2823. \def\hb{\bar{h}}
  2824. \def\vep{\varepsilon}
  2825. \def\vs{\vspace{10pt}}
  2826. \def\be{\begin{equation}}
  2827. \def\ee{\end{equation}}
  2828. \newcommand{\mfrac}[2]{\frac{\displaystyle{#1}}{\displaystyle{#2}}}
  2829. \newtheorem{theorem}{Theorem}
  2830. \newtheorem{lemma}{Lemma}
  2831. \newtheorem{corollary}[theorem]{Corollary}
  2832. \newtheorem{proposition}[theorem]{Proposition}
  2833. \newtheorem{definition}{Def\,inition}
  2834. \newtheorem{claim}{Claim}
  2835. \newtheorem{conjecture}[theorem]{Conjecture}
  2836. \newtheorem{observation}[theorem]{Observation}
  2837. \newtheorem{problem}[theorem]{Problem}
  2838. \newtheorem{notation}[theorem]{Notation}
  2839. \newtheorem{alemma}{Lemma}
  2840. \newtheorem{remark}{Remark}
  2841. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2842. \def\acknowledgments{\vskip14pt\bgroup\footnotesize\baselineskip 8pt
  2843. \materialfont
  2844. \def\textit##1{{\materialitfont ##1}}
  2845. \def\it{\materialitfont}
  2846. \def\bf{\materialbffont}
  2847. \def\textbf##1{{\materialbffont ##1}}
  2848. \noindent{\bf ACKNOWLEDGMENTS.} \relax\ignorespaces}
  2849. \def\endacknowledgments{\vskip1sp\egroup}
  2850. %% Just in case author enters any of the below, it will still work correctly
  2851. \let\acknowledgment\acknowledgements
  2852. \let\endacknowledgment\endacknowledgments
  2853. \let\acknowledgement\acknowledgements
  2854. \let\endacknowledgement\endacknowledgments
  2855. \let\acknowledgements\acknowledgements
  2856. \let\endacknowledgements\endacknowledgments
  2857. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2858. %% April 25, 2006
  2859. \let\dospecialaccents\relax
  2860. \def\blackbox#1{}
  2861. % turn off side squares
  2862. \def\dosidesquare#1#2#3{}
  2863. \let\resetsidesquares\relax
  2864. \let\makesidesquares\relax
  2865. \newif\iffirsttime
  2866. \def\thanks#1{\footnotemark \protected@xdef \@thanks
  2867. {\@thanks \protect \footnotetext [\the \c@footnote ]{\hsize=247pt\relax #1}}}
  2868. %% Keywords
  2869. {\global\let\saveline|
  2870. \gdef\linewithspace{\hskip3pt$\saveline$\hskip6pt}
  2871. \catcode`|=\active
  2872. \gdef\keywords{\bgroup\catcode`|=\active\xkeywords}
  2873. \gdef\xkeywords#1{\vskip1sp\noindent{\let|=\linewithspace
  2874. \affilfont#1}\vskip11pt\egroup}
  2875. }
  2876. \def\abbreviations#1{\vskip1sp\noindent{\affilfont Abbreviations: #1}\vskip12pt}
  2877. %% Authors can change this dimension to move the
  2878. %% printed page up or down on the physical page. Making
  2879. %% the negative dimension larger will move it up on the
  2880. %% page, smaller will move it down.
  2881. \voffset-.75in
  2882. %%% Default copyright year
  2883. \copyrightyear{2007}
  2884. \def\conflictofinterest#1{{\let\@thefnmark\relax\@footnotetext{\vrule height8pt width0pt\relax\hsize=247pt
  2885. \relax\footnotesize\footnotefont #1\vrule depth 6pt width0pt}}}
  2886. \def\footcomment#1{{\let\@thefnmark\relax\@footnotetext{\vrule height8pt width0pt\relax\hsize=247pt\relax\footnotesize\footnotefont #1\vrule depth 6pt width0pt}}}
  2887. \def\track#1{\footcomment{#1}}
  2888. \url{www.pnas.org --- ---}
  2889. \issuedate{Issue Date}
  2890. \copyrightyear{2007}
  2891. \volume{Volume}
  2892. \issuenumber{Issue Number}
  2893. \setcounter{page}{2687}
  2894. \footlineauthor{Lu}
  2895. \long\def\@footnotetext#1{\insert\footins{%
  2896. \reset@font\footnotesize
  2897. \interlinepenalty\interfootnotelinepenalty
  2898. \splittopskip\footnotesep
  2899. \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
  2900. \hsize\columnwidth \@parboxrestore
  2901. \protected@edef\@currentlabel{%
  2902. \csname [email protected]\endcsname\@thefnmark
  2903. }%
  2904. \color@begingroup
  2905. \@makefntext{%
  2906. \rule\z@\footnotesep\ignorespaces\footnotefont
  2907. \hsize=247pt
  2908. #1\@finalstrut\strutbox}%
  2909. \color@endgroup}}%
  2910. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2911. %% Special Use Fonts
  2912. %%
  2913. %% Computer Modern font calls. These will be redefined
  2914. %% if PostScript fonts are used, \usepackage{pnastwof}
  2915. %% Times-Roman
  2916. \def\timesroman{cmr10 }
  2917. \def\timesbold{cmbx10 }
  2918. \def\timesitalic{cmti10 }
  2919. \def\timesbolditalic{cmbx10 }
  2920. %% Helvetica
  2921. \def\helvetica{cmss10 }
  2922. \def\helveticabold{cmssbx10 }
  2923. \def\helveticaboldoblique{cmssbx10 }
  2924. \def\helveticaoblique{cmssi10 }
  2925. \def\frutiger{cmss10 }
  2926. \def\frutigermed{cmss10 }
  2927. \def\frutigerbold{cmssbx10 }
  2928. \def\frutigerboldoblique{cmssi10 }
  2929. \def\frutigeroblique{cmssi10 }
  2930. \let\frutigerboldcondensed\helveticabold
  2931. %% Special Use Fonts ==>>
  2932. \font\footnotefont\helvetica at 6pt
  2933. \font\dropcapfont=\frutigerbold at 26pt
  2934. \font\sideboxfont= \helvetica at 6pt
  2935. %% Running feet
  2936. \font\footlinefont=\frutiger at6.5pt%7pt
  2937. \font\footlineit=\helveticaoblique at6.5pt%7pt
  2938. \font\foliofont=\frutigerbold at6.5pt%7pt
  2939. \font\titlefont=\frutigerboldcondensed at 22pt % 24pt baseline
  2940. \font\authorfont=\frutigerbold at 9pt % 11 pt baseline
  2941. \font\affilfont=\frutiger at 7pt % 8pt baseline
  2942. \font\copyrightfont=\frutiger at 6pt
  2943. \font\copyrighttextfont=\frutiger at 6pt
  2944. %% Abstract fonts
  2945. \font\xabstractfont=\frutigerbold at 8pt
  2946. \def\abstractfont{\sf\xabstractfont\dospecialaccents}
  2947. \font\abstractit=\helveticaboldoblique at 8pt
  2948. %% Section fonts
  2949. \font\sectionfont=\frutigerbold at 10pt
  2950. \font\subsectionfont=\frutigerbold at9pt
  2951. \font\significanceheadfont=\frutigerbold at 9pt
  2952. \font\significancefont=\frutigerbold at 8pt
  2953. %% Theorem fonts
  2954. \font\theoremfont=\frutigerbold at 8pt
  2955. %ok
  2956. %% Caption
  2957. \font\fignumfont=\frutigerbold at 9pt
  2958. \font\xfigtextfont=\frutiger at 7pt
  2959. \def\figtextfont{\small\dospecialaccents\xfigtextfont}
  2960. %% Table font
  2961. \font\tabletextfont=\frutiger at 9pt
  2962. \font\tabtextfont\frutigerbold at 9pt
  2963. \font\tabnumfont\frutigerbold at 9pt
  2964. %% Materials and Methods Fonts
  2965. \font\materialfont=\frutiger at 7pt
  2966. \font\materialbffont=\helveticabold at 7pt
  2967. \font\materialitfont=\helveticaboldoblique at 7pt
  2968. %% Bibliography fonts
  2969. \font\xbibfont=\frutigerbold at 6pt
  2970. \def\bibfont{\sf\xbibfont\dospecialaccents}
  2971. \font\bibitfont\helveticaboldoblique at 6pt
  2972. \font\bibbffont\helveticabold at 6pt
  2973. %% dec 4, 2006
  2974. \def\@tabular{\global\tablenotenum=0\relax
  2975. \leavevmode \hbox \bgroup $\let\@acol\@tabacol
  2976. \let\@classz\@tabclassz
  2977. \let\@classiv\@tabclassiv \let\\\@tabularcr\@tabarray}
  2978. %% dec 4, 2006
  2979. \def\@tabular{\global\tablenotenum=0\relax
  2980. \leavevmode \hbox \bgroup $\let\@acol\@tabacol
  2981. \let\@classz\@tabclassz
  2982. \let\@classiv\@tabclassiv \let\\\@tabularcr\@tabarray}
  2983. %%%%%%% Jan 2008 Changes:
  2984. \def\materials{\vskip6pt\bgroup
  2985. \parskip=8pt
  2986. \baselineskip=9pt
  2987. \materialfont
  2988. \def\textit##1{{\materialitfont ##1}}
  2989. \def\it{\materialitfont}
  2990. \def\bf{\materialbffont}
  2991. \def\textbf##1{{\materialbffont ##1}}
  2992. \def\section##1{\noindent{\materialbffont ##1. }}
  2993. \def\subsection##1{\noindent{\materialbffont ##1. }}
  2994. \noindent {\subsectionfont Materials and Methods}\\[2pt]
  2995. }
  2996. \def\endmaterials{\vskip1sp\egroup}
  2997. \def\appendix{\originalappendix
  2998. \vskip12pt\noindent{\subsectionfont Appendix}\@ifnextchar[{\xappendix}{\yappendix}}
  2999. \def\xappendix[#1]{\subsectionfont:\hskip10pt\relax #1\vskip2pt
  3000. \normalsize\noindent\ignorespaces}
  3001. \def\yappendix{\vskip2pt\normalsize\noindent\ignorespaces}
  3002. \widowpenalty=10000
  3003. \clubpenalty=10000
  3004. \newbox\tablewide
  3005. \def\endtabular{\crcr\egroup\egroup $\egroup\egroup
  3006. \centerline{\vbox{\hsize\wd\tablewide
  3007. \currtabcaption\vskip1pt
  3008. }}
  3009. \dimen0=\wd\tablewide
  3010. \centerline{\hbox{\unhbox\tablewide}}
  3011. \centerline{\vtop{\hsize=\dimen0 \tablenotes}}
  3012. \global\let\currtabcaption\relax}
  3013. \expandafter \let \csname endtabular*\endcsname = \endtabular
  3014. \def\tabular{\global\setbox\tablewide\hbox\bgroup
  3015. \let\@halignto\@empty\@tabular}
  3016. \@namedef{tabular*}#1{%
  3017. \global\setbox\tablewide\hbox\bgroup
  3018. \setlength\dimen@{#1}%
  3019. \edef\@halignto{to\the\dimen@}\@tabular}
  3020. \newcommand\originalappendix{\par
  3021. \setcounter{section}{0}%
  3022. \setcounter{subsection}{0}%
  3023. \gdef\thesection{\@Alph\c@section}}
  3024. \let\currtabcaption\relax
  3025. \def\footcomment#1{\typeout{^^J^^J The \string\footcomment{}\space command is
  3026. No Longer Used^^J^^J}}
  3027. \def\track#1{\typeout{^^J^^J The \string\track{}\space command is
  3028. No Longer Used^^J^^J}}
  3029. \def\conflictofinterest#1{\typeout{^^J^^J The \string\conflictofinterest{}\space command is
  3030. No Longer Used^^J^^J}}
  3031. %% nothing will happen, so PNAS can get info, but nothing will be printed
  3032. \def\nothanks#1{}
  3033. \let\thanks\nothanks
  3034. % substitute for \footcomment:
  3035. \def\abbreviations#1{\vskip1sp\noindent{\affilfont Abbreviations: #1}
  3036. \vskip12pt}
  3037. \endinput
  3038. Change Log:
  3039. October 18, 2006
  3040. Changed the counter used in loop in maketitle to
  3041. fix bug that prevented all affiliations from being
  3042. listed; added $\saveline$ to make line work right
  3043. in keywords
  3044. dec 4, 2006: fixed bug in table notes, by
  3045. resetting tablenotenum every time tabular
  3046. is used
  3047. %\def\currversion{October 18, 2006}
  3048. %\def\currversion{July 10, 2006}
  3049. %\def\currversion{May 1, 2006}
  3050. %\def\currversion{August 27, 2004}
Comments powered by Disqus