elsarticle/elsarticle.dtx
author Madarasi Peter
Wed, 30 Nov 2016 16:52:36 +0100
changeset 22 1a4874982d84
permissions -rw-r--r--
outline, fine tune
     1 % \iffalse meta-comment
     2 %
     3 % Copyright (C) 2007, 2008, 2009 by Elsevier Ltd
     4 % -----------------------------------------------
     5 % 
     6 % This file may be distributed and/or modified under the
     7 % conditions of the LaTeX Project Public License, either version 1.2
     8 % of this license or (at your option) any later version.
     9 % The latest version of this license is in:
    10 %
    11 %    http://www.latex-project.org/lppl.txt
    12 %
    13 % and version 1.2 or later is part of all distributions of LaTeX 
    14 % version 1999/12/01 or later.
    15 %
    16 % \fi
    17 % \CheckSum{2196}
    18 %
    19 % \iffalse
    20 %<*driver>
    21 \documentclass{ltxdoc}
    22 \EnableCrossrefs         
    23 \CodelineIndex
    24 \RecordChanges
    25 \usepackage{comment}
    26 \begin{document}
    27   \DocInput{elsarticle.dtx}
    28   \PrintChanges
    29   \PrintIndex
    30 \end{document}
    31 %</driver>
    32 % \fi
    33 %
    34 % \CharacterTable
    35 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
    36 %   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
    37 %   Digits        \0\1\2\3\4\5\6\7\8\9
    38 %   Exclamation   \!     Double quote  \"     Hash (number) \#
    39 %   Dollar        \$     Percent       \%     Ampersand     \&
    40 %   Acute accent  \'     Left paren    \(     Right paren   \)
    41 %   Asterisk      \*     Plus          \+     Comma         \,
    42 %   Minus         \-     Point         \.     Solidus       \/
    43 %   Colon         \:     Semicolon     \;     Less than     \<
    44 %   Equals        \=     Greater than  \>     Question mark \?
    45 %   Commercial at \@     Left bracket  \[     Backslash     \\
    46 %   Right bracket \]     Circumflex    \^     Underscore    \_
    47 %   Grave accent  \`     Left brace    \{     Vertical bar  \|
    48 %   Right brace   \}     Tilde         \~}
    49 %
    50 %
    51 % \changes{v1.1}{2008/09/25}{Initial version}
    52 %
    53 %
    54 % \changes{v1.2}{2009/09/17}{Documentation, templates, and *.bst
    55 %    has been seperated from this .dtx. Incompatibility problems
    56 %    with amsref.sty, fncylab.sty have been fixed. Some bugs related
    57 %    to author/affiliation part have been fixed.}
    58 %
    59 % \GetFileInfo{elsarticle.dtx}
    60 %
    61 % \DoNotIndex{\newcommand,\newenvironment}
    62 % 
    63 %
    64 % \title{The \textsf{elsarticle.cls} -- Implimentation}
    65 % \author{Elsevier Ltd}
    66 %
    67 % \maketitle
    68 %
    69 % \StopEventually{}
    70 %
    71 % \section{Implementation}
    72 %
    73 %    \begin{macrocode}
    74 %<*class>
    75 %% 
    76 %% $Id: elsarticle.cls,v 1.20 2008-10-13 04:24:12 cvr Exp $
    77 %%
    78  \def\RCSfile{elsarticle}%
    79  \def\RCSversion{1.2.0}%
    80  \def\RCSdate{2009/09/17}%
    81  \def\@shortjnl{\relax}
    82  \def\@journal{Elsevier Ltd} \def\@company{Elsevier Ltd}
    83  \def\@issn{000-0000}
    84  \def\@shortjid{elsarticle}
    85 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
    86 \ProvidesClass{\@shortjid}[\RCSdate, \RCSversion: \@journal]
    87 \def\ABD{\AtBeginDocument}
    88 \newif\ifpreprint \preprintfalse
    89 \newif\iflongmktitle \longmktitlefalse
    90 
    91 \def\@blstr{1}
    92 \newdimen\@bls
    93 \@bls=\baselineskip
    94 
    95 \def\@finalWarning{%
    96   *****************************************************\MessageBreak
    97    This document is typeset in the CRC style which\MessageBreak
    98    is not suitable for submission.\MessageBreak
    99    \MessageBreak
   100    Please typeset again using 'preprint' option\MessageBreak
   101    for creating PDF suitable for submission.\MessageBreak
   102   ******************************************************\MessageBreak
   103 }
   104 
   105 \DeclareOption{preprint}{\global\preprinttrue
   106   \gdef\@blstr{1}\xdef\jtype{0}%
   107    \AtBeginDocument{\@twosidefalse\@mparswitchfalse}}
   108 \DeclareOption{final}{\gdef\@blstr{1}\global\preprintfalse}
   109 \DeclareOption{review}{\global\preprinttrue\gdef\@blstr{1.5}}
   110 \DeclareOption{authoryear}{\xdef\@biboptions{round,authoryear}}
   111 \DeclareOption{number}{\xdef\@biboptions{numbers}}
   112 \DeclareOption{numbers}{\xdef\@biboptions{numbers}}
   113 \DeclareOption{longtitle}{\global\longmktitletrue}
   114 \DeclareOption{5p}{\xdef\jtype{5}\global\preprintfalse
   115   \ExecuteOptions{twocolumn}}
   116   \def\jtype{0}
   117 \DeclareOption{3p}{\xdef\jtype{3}\global\preprintfalse}
   118 \DeclareOption{1p}{\xdef\jtype{1}\global\preprintfalse
   119   \AtBeginDocument{\@twocolumnfalse}}
   120 \DeclareOption{times}{\IfFileExists{txfonts.sty}%
   121   {\AtEndOfClass{\RequirePackage{txfonts}%
   122   \gdef\ttdefault{cmtt}%
   123    \let\iint\relax
   124   \let\iiint\relax
   125   \let\iiiint\relax
   126   \let\idotsint\relax
   127   \let\openbox\relax}}{\RequirePackage{times}}}
   128 \ExecuteOptions{a4paper,10pt,oneside,onecolumn,number,preprint}
   129 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
   130 \ProcessOptions
   131 \LoadClass{article}
   132 \RequirePackage{graphicx}
   133 %    \end{macrocode}
   134 % 
   135 % \section{Preamble}
   136 %
   137 %    \begin{macrocode}
   138 \let\comma\@empty
   139 \let\tnotesep\@empty
   140 \def\title#1{\gdef\@title{#1}}
   141 \let\@title\@empty
   142 
   143 \def\elsLabel#1{\@bsphack\protected@write\@auxout{}%
   144          {\string\Newlabel{#1}{\@currentlabel}}\@esphack}
   145 \def\Newlabel#1#2{\expandafter\xdef\csname X@#1\endcsname{#2}}
   146 
   147 \def\elsRef#1{\@ifundefined{X@#1}{0}{\csname X@#1\endcsname}%
   148 }
   149 
   150 \def\tnotemark[#1]{\textsuperscript{\@for\@@tmark:=#1\do{%
   151       \edef\tnotenum{\@ifundefined{X@\@@tmark}{1}{\elsRef{\@@tmark}}}%
   152       \ifcase\tnotenum\or\ding{73}\or,\ding{73}\ding{73}\fi}}%
   153 }
   154 \let\@tnotemark\@empty
   155 
   156 \let\@tnotes\@empty
   157 \RequirePackage{pifont}
   158 \newcounter{tnote}
   159 \def\tnotetext[#1]#2{\g@addto@macro\@tnotes{%
   160   \refstepcounter{tnote}\elsLabel{#1}%
   161    \def\thefootnote{\ifcase\c@tnote\or\ding{73}\or\ding{73}\ding{73}\fi}%
   162     \footnotetext{#2}}}
   163 
   164 \let\@nonumnotes\@empty
   165 \def\nonumnote#1{\g@addto@macro\@nonumnotes{%
   166      \let\thefootnote\relax\footnotetext{#1}}}
   167 
   168 \newcounter{fnote}
   169 \def\fnmark[#1]{\let\comma\@empty
   170     \def\@fnmark{\@for\@@fnmark:=#1\do{%
   171     \edef\fnotenum{\@ifundefined{X@\@@fnmark}{1}{\elsRef{\@@fnmark}}}%
   172   \unskip\comma\fnotenum\let\comma,}}%
   173 }
   174 
   175 \let\@fnotes\@empty\let\@fnmark\@empty
   176 \def\fntext[#1]#2{\g@addto@macro\@fnotes{%
   177      \refstepcounter{fnote}\elsLabel{#1}%
   178    \def\thefootnote{\thefnote}%
   179    \global\setcounter{footnote}{\thefnote}%
   180    \footnotetext{#2}}}
   181 
   182 \def\cormark[#1]{\edef\cnotenum{\elsRef{#1}}%
   183     \unskip\textsuperscript{\sep\ifcase\cnotenum\or
   184        $\ast$\or$\ast\ast$\fi\hspace{-1pt}}\let\sep=,}
   185 
   186 \let\@cormark\@empty
   187 \let\@cornotes\@empty
   188 \newcounter{cnote}
   189 \def\cortext[#1]#2{\g@addto@macro\@cornotes{%
   190     \refstepcounter{cnote}\elsLabel{#1}%
   191     \def\thefootnote{\ifcase\thecnote\or$\ast$\or
   192     $\ast\ast$\fi}%
   193     \footnotetext{#2}}}
   194 
   195 \let\@corref\@empty
   196 %\def\corref#1{\cormark[#1]}
   197 \def\corref#1{\edef\cnotenum{\elsRef{#1}}%
   198     \edef\@corref{\ifcase\cnotenum\or
   199          $\ast$\or$\ast\ast$\fi\hskip-1pt}}
   200 
   201 \def\fnref#1{\fnmark[#1]}
   202 \def\tnoteref#1{\tnotemark[#1]}
   203 
   204 \def\resetTitleCounters{\c@cnote=0
   205    \c@fnote=0 \c@tnote=0 \c@footnote=0}
   206 
   207 \let\eadsep\@empty
   208 \let\@elseads\@empty
   209 \let\@elsuads\@empty
   210 \let\@cormark\@empty
   211 \def\hashchar{\expandafter\@gobble\string\~}
   212 \def\underscorechar{\expandafter\@gobble\string\_}
   213 \def\lbracechar{\expandafter\@gobble\string\{}
   214 \def\rbracechar{\expandafter\@gobble\string\}}
   215 
   216 \def\ead{\@ifnextchar[{\@uad}{\@ead}}
   217 \gdef\@ead#1{\bgroup\def\_{\string\underscorechar\space}%
   218   \def\{{\string\lbracechar\space}%
   219    \def~{\hashchar\space}%
   220    \def\}{\string\rbracechar\space}%
   221    \edef\tmp{\the\@eadauthor}
   222    \immediate\write\@auxout{\string\emailauthor
   223      {#1}{\expandafter\strip@prefix\meaning\tmp}}%
   224   \egroup
   225 }
   226 \newcounter{ead}
   227 \gdef\emailauthor#1#2{\stepcounter{ead}%
   228      \g@addto@macro\@elseads{\raggedright%
   229       \let\corref\@gobble
   230       \eadsep\texttt{#1} (#2)\def\eadsep{\unskip,\space}}%
   231 }
   232 \gdef\@uad[#1]#2{\bgroup
   233   \def~{\string\hashchar\space}%
   234   \def\_{\string\underscorechar\space}%
   235    \edef\tmp{\the\@eadauthor}
   236    \immediate\write\@auxout{\string\urlauthor
   237      {#2}{\expandafter\strip@prefix\meaning\tmp}}%
   238   \egroup
   239 }
   240 \def\urlauthor#1#2{\g@addto@macro\@elsuads{\let\corref\@gobble%
   241      \raggedright\eadsep\texttt{#1}\space(#2)%
   242      \def\eadsep{\unskip,\space}}%
   243 }
   244 
   245 \def\elsauthors{}
   246 \def\pprinttitle{}
   247 \let\authorsep\@empty
   248 \let\sep\@empty
   249 \newcounter{author}
   250 \def\author{\@ifnextchar[{\@@author}{\@author}}
   251 
   252 \newtoks\@eadauthor
   253 \def\@@author[#1]#2{\g@addto@macro\elsauthors{%
   254     \def\baselinestretch{1}%
   255     \authorsep#2\unskip\textsuperscript{%#1%
   256       \@for\@@affmark:=#1\do{%
   257        \edef\affnum{\@ifundefined{X@\@@affmark}{1}{\elsRef{\@@affmark}}}%
   258      \unskip\sep\affnum\let\sep=,}%
   259       \ifx\@fnmark\@empty\else\unskip\sep\@fnmark\let\sep=,\fi
   260       \ifx\@corref\@empty\else\unskip\sep\@corref\let\sep=,\fi
   261       }%
   262     \def\authorsep{\unskip,\space}%
   263     \global\let\sep\@empty\global\let\@corref\@empty
   264     \global\let\@fnmark\@empty}%
   265     \@eadauthor={#2}
   266 }
   267 
   268 \def\@author#1{\g@addto@macro\elsauthors{\normalsize%
   269     \def\baselinestretch{1}%
   270     \upshape\authorsep#1\unskip\textsuperscript{%
   271       \ifx\@fnmark\@empty\else\unskip\sep\@fnmark\let\sep=,\fi
   272       \ifx\@corref\@empty\else\unskip\sep\@corref\let\sep=,\fi
   273       }%
   274     \def\authorsep{\unskip,\space}%
   275     \global\let\@fnmark\@empty
   276     \global\let\sep\@empty}%
   277     \@eadauthor={#1}
   278 }
   279 
   280 \def\elsaddress{}
   281 \def\addsep{\par\vskip6pt}
   282 \def\address{\@ifnextchar[{\@@address}{\@address}}
   283 
   284 \def\@alph#1{%
   285   \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or
   286   l\or m\or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or
   287   y\or z%
   288   \or aa\or ab\or ac\or ad\or ae\or af\or ag\or ah\or ai\or aj\or
   289   ak\or al\or am\or an\or ao\or ap\or aq\or ar\or as\or at\or au\or
   290   av\or aw\or ax\or ay\or az%
   291   \or ba\or bb\or bc\or bd\or be\or bf\or bg\or bh\or bi\or bj\or
   292   bk\or bl\or bm\or bn\or bo\or bp\or bq\or br\or bs\or bt\or bu\or
   293   bv\or bw\or bx\or by\or bz%
   294   \or ca\or cb\or cc\or cd\or ce\or cf\or cg\or ch\or ci\or cj\or
   295   ck\or cl\or cm\or cn\or co\or cp\or cq\or cr\or cs\or ct\or cu\or
   296   cv\or cw\or cx\or cy\or cz%
   297   \or da\or db\or dc\or dd\or de\or df\or dg\or dh\or di\or dj\or
   298   dk\or dl\or dm\or dn\or do\or dp\or dq\or dr\or ds\or dt\or du\or
   299   dv\or dw\or dx\or dy\or dz%
   300   \or ea\or eb\or ec\or ed\or ee\or ef\or eg\or eh\or ei\or ej\or
   301   ek\or el\or em\or en\or eo\or ep\or eq\or er\or es\or et\or eu\or
   302   ev\or ew\or ex\or ey\or ez%
   303   \or fa\or fb\or fc\or fd\or fe\or ff\or fg\or fh\or fi\or fj\or
   304   fk\or fl\or fm\or fn\or fo\or fp\or fq\or fr\or fs\or ft\or fu\or
   305   fv\or fw\or fx\or fy\or fz%
   306   \or ga\or gb\or gc\or gd\or ge\or gf\or gg\or gh\or gi\or gj\or
   307   gk\or gl\or gm\or gn\or go\or gp\or gq\or gr\or gs\or gt\or gu\or
   308   gv\or gw\or gx\or gy\or gz%
   309   \else\@ctrerr\fi}
   310 
   311 \newcounter{affn}
   312 \renewcommand\theaffn{\alph{affn}}
   313 
   314 \long\def\@@address[#1]#2{\g@addto@macro\elsaddress{%
   315     \def\baselinestretch{1}%
   316      \refstepcounter{affn}
   317      \xdef\@currentlabel{\theaffn}
   318      \elsLabel{#1}%
   319     \textsuperscript{\theaffn}#2\par}}
   320 
   321 \long\def\@address#1{\g@addto@macro\elsauthors{%
   322     \def\baselinestretch{1}%
   323     \addsep\footnotesize\itshape#1\def\addsep{\par\vskip6pt}%
   324     \def\authorsep{\par\vskip8pt}}}
   325 
   326 \newbox\absbox
   327 \renewenvironment{abstract}{\global\setbox\absbox=\vbox\bgroup
   328   \hsize=\textwidth\def\baselinestretch{1}%
   329   \noindent\unskip\textbf{Abstract}
   330  \par\medskip\noindent\unskip\ignorespaces}
   331  {\egroup}
   332 
   333 \newbox\keybox
   334 \def\keyword{%
   335   \def\sep{\unskip, }%
   336  \def\MSC{\@ifnextchar[{\@MSC}{\@MSC[2000]}}
   337   \def\@MSC[##1]{\par\leavevmode\hbox {\it ##1~MSC:\space}}%
   338   \def\PACS{\par\leavevmode\hbox {\it PACS:\space}}%
   339   \def\JEL{\par\leavevmode\hbox {\it JEL:\space}}%
   340   \global\setbox\keybox=\vbox\bgroup\hsize=\textwidth
   341   \normalsize\normalfont\def\baselinestretch{1}
   342   \parskip\z@
   343   \noindent\textit{Keywords: }
   344   \raggedright                         % Keywords are not justified.
   345   \ignorespaces}
   346 \def\endkeyword{\par \egroup}
   347 
   348 \newdimen\Columnwidth
   349 \Columnwidth=\columnwidth
   350 
   351 \def\printFirstPageNotes{%
   352   \iflongmktitle
   353    \let\columnwidth=\textwidth\fi
   354   \ifx\@tnotes\@empty\else\@tnotes\fi
   355   \ifx\@nonumnotes\@empty\else\@nonumnotes\fi
   356   \ifx\@cornotes\@empty\else\@cornotes\fi
   357   \ifx\@elseads\@empty\relax\else
   358    \let\thefootnote\relax
   359    \footnotetext{\ifnum\theead=1\relax
   360       \textit{Email address:\space}\else
   361       \textit{Email addresses:\space}\fi
   362      \@elseads}\fi
   363   \ifx\@elsuads\@empty\relax\else
   364    \let\thefootnote\relax
   365    \footnotetext{\textit{URL:\space}%
   366      \@elsuads}\fi
   367   \ifx\@fnotes\@empty\else\@fnotes\fi
   368   \iflongmktitle\if@twocolumn
   369    \let\columnwidth=\Columnwidth\fi\fi
   370 }
   371 
   372 \long\def\pprintMaketitle{\clearpage
   373   \iflongmktitle\if@twocolumn\let\columnwidth=\textwidth\fi\fi
   374   \resetTitleCounters
   375   \def\baselinestretch{1}%
   376   \printFirstPageNotes
   377   \begin{center}%
   378  \thispagestyle{pprintTitle}%
   379    \def\baselinestretch{1}%
   380     \Large\@title\par\vskip18pt
   381     \normalsize\elsauthors\par\vskip10pt
   382     \footnotesize\itshape\elsaddress\par\vskip36pt
   383     \hrule\vskip12pt
   384     \ifvoid\absbox\else\unvbox\absbox\par\vskip10pt\fi
   385     \ifvoid\keybox\else\unvbox\keybox\par\vskip10pt\fi
   386     \hrule\vskip12pt
   387     \end{center}%
   388   \gdef\thefootnote{\arabic{footnote}}%
   389   }
   390 
   391 \def\printWarning{%
   392      \mbox{}\par\vfill\par\bgroup
   393      \fboxsep12pt\fboxrule1pt
   394      \hspace*{.18\textwidth}
   395      \fcolorbox{gray50}{gray10}{\box\warnbox}
   396      \egroup\par\vfill\thispagestyle{empty}
   397      \setcounter{page}{0}
   398      \clearpage}
   399 
   400 \long\def\finalMaketitle{%
   401   \resetTitleCounters
   402   \def\baselinestretch{1}%
   403    \MaketitleBox
   404    \thispagestyle{pprintTitle}%
   405   \gdef\thefootnote{\arabic{footnote}}%
   406   }
   407 
   408 \long\def\MaketitleBox{%
   409   \resetTitleCounters
   410   \def\baselinestretch{1}%
   411   \begin{center}%
   412    \def\baselinestretch{1}%
   413     \Large\@title\par\vskip18pt
   414     \normalsize\elsauthors\par\vskip10pt
   415     \footnotesize\itshape\elsaddress\par\vskip36pt
   416     \hrule\vskip12pt
   417     \ifvoid\absbox\else\unvbox\absbox\par\vskip10pt\fi
   418     \ifvoid\keybox\else\unvbox\keybox\par\vskip10pt\fi
   419     \hrule\vskip12pt
   420     \end{center}%
   421   }
   422 
   423 \def\FNtext#1{\par\bgroup\footnotesize#1\egroup}
   424 \newdimen\space@left
   425 \def\alarm#1{\typeout{******************************}%
   426              \typeout{#1}%
   427              \typeout{******************************}%
   428 }
   429 \long\def\getSpaceLeft{%\global\@twocolumnfalse%
   430    \global\setbox0=\vbox{\hsize=\textwidth\MaketitleBox}%
   431    \global\setbox1=\vbox{\hsize=\textwidth
   432     \let\footnotetext\FNtext
   433     \printFirstPageNotes}%
   434     \xdef\noteheight{\the\ht1}%
   435     \xdef\titleheight{\the\ht0}%
   436     \@tempdima=\vsize
   437     \advance\@tempdima-\noteheight
   438     \advance\@tempdima-1\baselineskip
   439 }
   440 
   441   \skip\footins=24pt
   442 
   443 \newbox\els@boxa
   444 \newbox\els@boxb
   445 
   446 \ifpreprint
   447   \def\maketitle{\pprintMaketitle}
   448   \else
   449    \ifnum\jtype=1
   450     \def\maketitle{%
   451       \iflongmktitle\getSpaceLeft
   452        \global\setbox\els@boxa=\vsplit0 to \@tempdima
   453        \box\els@boxa\par\resetTitleCounters
   454        \thispagestyle{pprintTitle}%
   455        \printFirstPageNotes
   456        \box0%
   457       \else
   458        \finalMaketitle\printFirstPageNotes
   459       \fi
   460     \gdef\thefootnote{\arabic{footnote}}}%
   461   \else
   462  \ifnum\jtype=5
   463     \def\maketitle{%
   464       \iflongmktitle\getSpaceLeft
   465        \global\setbox\els@boxa=\vsplit0 to \@tempdima
   466        \box\els@boxa\par\resetTitleCounters
   467        \thispagestyle{pprintTitle}%
   468        \printFirstPageNotes
   469        \twocolumn[\box0]%\printFirstPageNotes
   470       \else
   471        \twocolumn[\finalMaketitle]\printFirstPageNotes
   472      \fi
   473      \gdef\thefootnote{\arabic{footnote}}}
   474   \else
   475   \if@twocolumn
   476     \def\maketitle{%
   477       \iflongmktitle\getSpaceLeft
   478        \global\setbox\els@boxa=\vsplit0 to \@tempdima
   479        \box\els@boxa\par\resetTitleCounters
   480        \thispagestyle{pprintTitle}%
   481        \printFirstPageNotes
   482        \twocolumn[\box0]%
   483       \else
   484        \twocolumn[\finalMaketitle]\printFirstPageNotes
   485       \fi
   486      \gdef\thefootnote{\arabic{footnote}}}%
   487    \else
   488     \def\maketitle{%
   489       \iflongmktitle\getSpaceLeft
   490        \global\setbox\els@boxa=\vsplit0 to \@tempdima
   491        \box\els@boxa\par\resetTitleCounters
   492        \thispagestyle{pprintTitle}%
   493        \printFirstPageNotes
   494        \box0%
   495      \else
   496        \finalMaketitle\printFirstPageNotes
   497       \fi
   498     \gdef\thefootnote{\arabic{footnote}}}%
   499    \fi
   500   \fi
   501  \fi
   502 \fi
   503 %    \end{macrocode}
   504 %    
   505 %\section{Headers/footers}
   506 %
   507 %    \begin{macrocode}
   508 \def\ps@pprintTitle{%
   509      \let\@oddhead\@empty
   510      \let\@evenhead\@empty
   511      \def\@oddfoot{\footnotesize\itshape
   512        Preprint submitted to \ifx\@journal\@empty Elsevier
   513        \else\@journal\fi\hfill\today}%
   514      \let\@evenfoot\@oddfoot}
   515 %    \end{macrocode}
   516 %
   517 % \section{Section headings}
   518 %
   519 %    \begin{macrocode}
   520 \def\@seccntDot{.}
   521 \def\@seccntformat#1{\csname the#1\endcsname\@seccntDot\hskip 0.5em}
   522 
   523 \renewcommand\section{\@startsection {section}{1}{\z@}%
   524            {18\p@ \@plus 6\p@ \@minus 3\p@}%
   525            {9\p@ \@plus 6\p@ \@minus 3\p@}%
   526            {\normalsize\bfseries\boldmath}}
   527 \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
   528            {12\p@ \@plus 6\p@ \@minus 3\p@}%
   529            {3\p@ \@plus 6\p@ \@minus 3\p@}%
   530            {\normalfont\normalsize\itshape}}
   531 \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
   532            {12\p@ \@plus 6\p@ \@minus 3\p@}%
   533            {\p@}%
   534            {\normalfont\normalsize\itshape}}
   535 
   536 \def\paragraph{\secdef{\els@aparagraph}{\els@bparagraph}}
   537 \def\els@aparagraph[#1]#2{\elsparagraph[#1]{#2.}}
   538 \def\els@bparagraph#1{\elsparagraph*{#1.}}
   539 
   540 \newcommand\elsparagraph{\@startsection{paragraph}{4}{0\z@}%
   541            {10\p@ \@plus 6\p@ \@minus 3\p@}%
   542            {-6\p@}%
   543            {\normalfont\itshape}}
   544 %    \end{macrocode}
   545 %
   546 %\section{List environment}
   547 %
   548 %    \begin{macrocode}
   549 \newdimen\leftMargin
   550 \leftMargin=2em
   551 \newtoks\@enLab  %\newtoks\@enfont
   552 \def\@enQmark{?}
   553 \def\@enLabel#1#2{%
   554   \edef\@enThe{\noexpand#1{\@enumctr}}%
   555   \@enLab\expandafter{\the\@enLab\csname the\@enumctr\endcsname}%
   556   \@enloop}
   557 \def\@enSpace{\afterassignment\@enSp@ce\let\@tempa= }
   558 \def\@enSp@ce{\@enLab\expandafter{\the\@enLab\space}\@enloop}
   559 \def\@enGroup#1{\@enLab\expandafter{\the\@enLab{#1}}\@enloop}
   560 \def\@enOther#1{\@enLab\expandafter{\the\@enLab#1}\@enloop}
   561 \def\@enloop{\futurelet\@entemp\@enloop@}
   562 \def\@enloop@{%
   563   \ifx A\@entemp         \def\@tempa{\@enLabel\Alph  }\else
   564   \ifx a\@entemp         \def\@tempa{\@enLabel\alph  }\else
   565   \ifx i\@entemp         \def\@tempa{\@enLabel\roman }\else
   566   \ifx I\@entemp         \def\@tempa{\@enLabel\Roman }\else
   567   \ifx 1\@entemp         \def\@tempa{\@enLabel\arabic}\else
   568   \ifx \@sptoken\@entemp \let\@tempa\@enSpace         \else
   569   \ifx \bgroup\@entemp   \let\@tempa\@enGroup         \else
   570   \ifx \@enum@\@entemp   \let\@tempa\@gobble          \else
   571                          \let\@tempa\@enOther
   572              \fi\fi\fi\fi\fi\fi\fi\fi
   573   \@tempa}
   574 \newlength{\@sep} \newlength{\@@sep}
   575 \setlength{\@sep}{.5\baselineskip plus.2\baselineskip
   576             minus.2\baselineskip}
   577 \setlength{\@@sep}{.1\baselineskip plus.01\baselineskip
   578             minus.05\baselineskip}
   579 \providecommand{\sfbc}{\rmfamily\upshape}
   580 \providecommand{\sfn}{\rmfamily\upshape}
   581 \def\@enfont{\ifnum \@enumdepth >1\let\@nxt\sfn \else\let\@nxt\sfbc \fi\@nxt}
   582 \def\enumerate{%
   583    \ifnum \@enumdepth >3 \@toodeep\else
   584       \advance\@enumdepth \@ne
   585       \edef\@enumctr{enum\romannumeral\the\@enumdepth}\fi
   586    \@ifnextchar[{\@@enum@}{\@enum@}}
   587 \def\@@enum@[#1]{%
   588   \@enLab{}\let\@enThe\@enQmark
   589   \@enloop#1\@enum@
   590   \ifx\@enThe\@enQmark\@warning{The counter will not be printed.%
   591    ^^J\space\@spaces\@spaces\@spaces The label is: \the\@enLab}\fi
   592   \expandafter\edef\csname label\@enumctr\endcsname{\the\@enLab}%
   593   \expandafter\let\csname the\@enumctr\endcsname\@enThe
   594   \csname c@\@enumctr\endcsname7
   595   \expandafter\settowidth
   596             \csname leftmargin\romannumeral\@enumdepth\endcsname
   597             {\the\@enLab\hskip\labelsep}%
   598   \@enum@}
   599 \def\@enum@{\list{{\@enfont\csname label\@enumctr\endcsname}}%
   600            {\usecounter{\@enumctr}\def\makelabel##1{\hss\llap{##1}}%
   601      \ifnum \@enumdepth>1\setlength{\topsep}{\@@sep}\else
   602            \setlength{\topsep}{\@sep}\fi
   603      \ifnum \@enumdepth>1\setlength{\itemsep}{0pt plus1pt minus1pt}%
   604       \else \setlength{\itemsep}{\@@sep}\fi
   605      %\setlength\leftmargin{\leftMargin}%%%{1.8em}
   606      \setlength{\parsep}{0pt plus1pt minus1pt}%
   607      \setlength{\parskip}{0pt plus1pt minus1pt}
   608                    }}
   609 
   610 \def\endenumerate{\par\ifnum \@enumdepth >1\addvspace{\@@sep}\else
   611            \addvspace{\@sep}\fi \endlist}
   612 
   613 \def\sitem{\@noitemargtrue\@item[\@itemlabel *]}
   614 
   615 \def\itemize{\@ifnextchar[{\@Itemize}{\@Itemize[]}}
   616 
   617 \def\@Itemize[#1]{\def\next{#1}%
   618   \ifnum \@itemdepth >\thr@@\@toodeep\else
   619    \advance\@itemdepth\@ne
   620   \ifx\next\@empty\else\expandafter\def\csname
   621    labelitem\romannumeral\the\@itemdepth\endcsname{#1}\fi%
   622   \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
   623   \expandafter\list\csname\@itemitem\endcsname
   624   {\def\makelabel##1{\hss\llap{##1}}}%
   625  \fi}
   626 %    \end{macrocode}
   627 %
   628 %\section{Theorem environment}
   629 %
   630 %    \begin{macrocode}
   631 \def\newdefinition#1{%
   632   \@ifnextchar[{\@odfn{#1}}{\@ndfn{#1}}}%]
   633 \def\@ndfn#1#2{%
   634   \@ifnextchar[{\@xndfn{#1}{#2}}{\@yndfn{#1}{#2}}}
   635 \def\@xndfn#1#2[#3]{%
   636   \expandafter\@ifdefinable\csname #1\endcsname
   637     {\@definecounter{#1}\@newctr{#1}[#3]%
   638      \expandafter\xdef\csname the#1\endcsname{%
   639        \expandafter\noexpand\csname the#3\endcsname \@dfncountersep
   640           \@dfncounter{#1}}%
   641      \global\@namedef{#1}{\@dfn{#1}{#2}}%
   642      \global\@namedef{end#1}{\@enddefinition}}}
   643 \def\@yndfn#1#2{%
   644   \expandafter\@ifdefinable\csname #1\endcsname
   645     {\@definecounter{#1}%
   646      \expandafter\xdef\csname the#1\endcsname{\@dfncounter{#1}}%
   647      \global\@namedef{#1}{\@dfn{#1}{#2}}%
   648      \global\@namedef{end#1}{\@enddefinition}}}
   649 \def\@odfn#1[#2]#3{%
   650   \@ifundefined{c@#2}{\@nocounterr{#2}}%
   651     {\expandafter\@ifdefinable\csname #1\endcsname
   652     {\global\@namedef{the#1}{\@nameuse{the#2}}
   653   \global\@namedef{#1}{\@dfn{#2}{#3}}%
   654   \global\@namedef{end#1}{\@enddefinition}}}}
   655 \def\@dfn#1#2{%
   656   \refstepcounter{#1}%
   657   \@ifnextchar[{\@ydfn{#1}{#2}}{\@xdfn{#1}{#2}}}
   658 \def\@xdfn#1#2{%
   659   \@begindefinition{#2}{\csname the#1\endcsname}\ignorespaces}
   660 \def\@ydfn#1#2[#3]{%
   661   \@opargbegindefinition{#2}{\csname the#1\endcsname}{#3}\ignorespaces}
   662 \def\@dfncounter#1{\noexpand\arabic{#1}}
   663 \def\@dfncountersep{.}
   664 \def\@begindefinition#1#2{\trivlist
   665    \item[\hskip\labelsep{\bfseries #1\ #2.}]\upshape}
   666 \def\@opargbegindefinition#1#2#3{\trivlist
   667       \item[\hskip\labelsep{\bfseries #1\ #2\ (#3).}]\upshape}
   668 \def\@enddefinition{\endtrivlist}
   669 
   670 \def\@begintheorem#1#2{\trivlist
   671   \let\baselinestretch\@blstr
   672    \item[\hskip \labelsep{\bfseries #1\ #2.}]\itshape}
   673 \def\@opargbegintheorem#1#2#3{\trivlist
   674   \let\baselinestretch\@blstr
   675       \item[\hskip \labelsep{\bfseries #1\ #2\ (#3).}]\itshape}
   676 
   677 \def\newproof#1{%
   678   \@ifnextchar[{\@oprf{#1}}{\@nprf{#1}}}
   679 \def\@nprf#1#2{%
   680   \@ifnextchar[{\@xnprf{#1}{#2}}{\@ynprf{#1}{#2}}}
   681 \def\@xnprf#1#2[#3]{%
   682   \expandafter\@ifdefinable\csname #1\endcsname
   683     {\@definecounter{#1}\@newctr{#1}[#3]%
   684      \expandafter\xdef\csname the#1\endcsname{%
   685        \expandafter\noexpand\csname the#3\endcsname \@prfcountersep
   686           \@prfcounter{#1}}%
   687      \global\@namedef{#1}{\@prf{#1}{#2}}%
   688      \global\@namedef{end#1}{\@endproof}}}
   689 \def\@ynprf#1#2{%
   690   \expandafter\@ifdefinable\csname #1\endcsname
   691     {\@definecounter{#1}%
   692      \expandafter\xdef\csname the#1\endcsname{\@prfcounter{#1}}%
   693      \global\@namedef{#1}{\@prf{#1}{#2}}%
   694      \global\@namedef{end#1}{\@endproof}}}
   695 \def\@oprf#1[#2]#3{%
   696   \@ifundefined{c@#2}{\@nocounterr{#2}}%
   697     {\expandafter\@ifdefinable\csname #1\endcsname
   698     {\global\@namedef{the#1}{\@nameuse{the#2}}%
   699   \global\@namedef{#1}{\@prf{#2}{#3}}%
   700   \global\@namedef{end#1}{\@endproof}}}}
   701 \def\@prf#1#2{%
   702   \refstepcounter{#1}%
   703   \@ifnextchar[{\@yprf{#1}{#2}}{\@xprf{#1}{#2}}}
   704 \def\@xprf#1#2{%
   705   \@beginproof{#2}{\csname the#1\endcsname}\ignorespaces}
   706 \def\@yprf#1#2[#3]{%
   707   \@opargbeginproof{#2}{\csname the#1\endcsname}{#3}\ignorespaces}
   708 \def\@prfcounter#1{\noexpand\arabic{#1}}
   709 \def\@prfcountersep{.}
   710 \def\@beginproof#1#2{\trivlist\let\baselinestretch\@blstr
   711    \item[\hskip \labelsep{\scshape #1.}]\rmfamily}
   712 \def\@opargbeginproof#1#2#3{\trivlist\let\baselinestretch\@blstr
   713       \item[\hskip \labelsep{\scshape #1\ (#3).}]\rmfamily}
   714 \def\@endproof{\endtrivlist}
   715 \newcommand*{\qed}{\hbox{}\hfill$\Box$}
   716 
   717 \@ifundefined{@biboptions}{\xdef\@biboptions{numbers}}{}
   718 \InputIfFileExists{\jobname.spl}{}{}
   719 \RequirePackage[\@biboptions]{natbib}
   720 
   721 \newwrite\splwrite
   722 \immediate\openout\splwrite=\jobname.spl
   723 \def\biboptions#1{\def\next{#1}\immediate\write\splwrite{%
   724    \string\g@addto@macro\string\@biboptions{%
   725     ,\expandafter\strip@prefix\meaning\next}}}
   726 
   727 \let\baselinestretch=\@blstr
   728 
   729 %    \end{macrocode}
   730 %
   731 %\section{Page dimensions and margins for final form}
   732 %
   733 %\subsection{Option 1p}
   734 %
   735 %    \begin{macrocode}
   736 \ifnum\jtype=1
   737  \RequirePackage{geometry}
   738  \geometry{twoside,
   739   paperwidth=210mm,
   740   paperheight=297mm,
   741   textheight=562pt,
   742   textwidth=384pt,
   743   centering,
   744   headheight=50pt,
   745   headsep=12pt,
   746   footskip=12pt,
   747   footnotesep=24pt plus 2pt minus 12pt,
   748  }
   749  \global\let\bibfont=\footnotesize
   750  \global\bibsep=0pt
   751  \if@twocolumn\global\@twocolumnfalse\fi
   752 %
   753 %    \end{macrocode}
   754 %
   755 %\subsection{Option '3p'}
   756 %
   757 %    \begin{macrocode}
   758 \else\ifnum\jtype=3
   759  \RequirePackage{geometry}
   760  \geometry{twoside,
   761   paperwidth=210mm,
   762   paperheight=297mm,
   763   textheight=622pt,
   764   textwidth=468pt,
   765   centering,
   766   headheight=50pt,
   767   headsep=12pt,
   768   footskip=18pt,
   769   footnotesep=24pt plus 2pt minus 12pt,
   770   columnsep=2pc
   771  }
   772  \global\let\bibfont=\footnotesize
   773  \global\bibsep=0pt
   774  \if@twocolumn\input{fleqn.clo}\fi
   775 %    \end{macrocode}
   776 %
   777 %\subsection{Option '5p'}
   778 %
   779 %    \begin{macrocode}
   780 \else\ifnum\jtype=5
   781  \RequirePackage{geometry}
   782  \geometry{twoside,
   783   paperwidth=210mm,
   784   paperheight=297mm,
   785   textheight=682pt,
   786   textwidth=522pt,
   787   centering,
   788  headheight=50pt,
   789   headsep=12pt,
   790   footskip=18pt,
   791   footnotesep=24pt plus 2pt minus 12pt,
   792   columnsep=18pt
   793  }%
   794  \global\let\bibfont=\footnotesize
   795  \global\bibsep=0pt
   796  \input{fleqn.clo}
   797  \global\@twocolumntrue
   798 %%
   799 %% End of option '5p'
   800 %%
   801 \fi\fi\fi
   802 %    \end{macrocode}
   803 %
   804 %\section{Other items}
   805 %
   806 %    \begin{macrocode}
   807 \def\journal#1{\gdef\@journal{#1}}
   808  \let\@journal\@empty
   809 \newenvironment{frontmatter}{}{\maketitle}
   810 
   811 \long\def\@makecaption#1#2{%
   812   \vskip\abovecaptionskip\footnotesize
   813   \sbox\@tempboxa{#1: #2}%
   814   \ifdim \wd\@tempboxa >\hsize
   815     #1: #2\par
   816   \else
   817     \global \@minipagefalse
   818     \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
   819   \fi
   820   \vskip\belowcaptionskip}
   821 
   822 \AtBeginDocument{\@ifpackageloaded{hyperref}
   823   {\def\@linkcolor{blue}
   824    \def\@anchorcolor{blue}
   825    \def\@citecolor{blue}
   826    \def\@filecolor{blue}
   827    \def\@urlcolor{blue}
   828    \def\@menucolor{blue}
   829    \def\@pagecolor{blue}
   830 \begingroup
   831   \@makeother\`%
   832   \@makeother\=%
   833   \edef\x{%
   834     \edef\noexpand\x{%
   835       \endgroup
   836       \noexpand\toks@{%
   837         \catcode 96=\noexpand\the\catcode`\noexpand\`\relax
   838         \catcode 61=\noexpand\the\catcode`\noexpand\=\relax
   839       }%
   840     }%
   841     \noexpand\x
   842   }%
   843 \x
   844 \@makeother\`
   845 \@makeother\=
   846 }{}}
   847 %%
   848 \renewcommand\appendix{\par
   849   \setcounter{section}{0}%
   850   \setcounter{subsection}{0}%
   851   \setcounter{equation}{0}
   852   \gdef\thefigure{\@Alph\c@section.\arabic{figure}}%
   853   \gdef\thetable{\@Alph\c@section.\arabic{table}}%
   854   \gdef\thesection{\appendixname\@Alph\c@section}%
   855   \@addtoreset{equation}{section}%
   856   \gdef\theequation{\@Alph\c@section.\arabic{equation}}%
   857 }
   858 \def\appendixname{Appendix }
   859 
   860 %% Added for work with amsrefs.sty
   861 
   862 \@ifpackageloaded{amsrefs}%
   863   {}
   864   {\let\bibsection\relax%
   865   \AtBeginDocument{\def\cites@b#1#2,#3{%
   866     \begingroup[%
   867         \toks@{\InnerCite{#2}#1}%
   868         \ifx\@empty#3\@xp\@gobble\fi
   869         \cites@c#3%
   870 }}}
   871 %
   872 %%
   873 %</class>
   874 %
   875 %    \end{macrocode}
   876 % \Finale
   877 \endinput
   878 
   879 %%
   880 %% End of file 'elsarticle.dtx'
   881 %%
   882