\unprotect

%%%% Fonts

\usetypescript[postscript]
\setupbodyfont[postscript,10pt]

\definefont [Title]       [Serif       at 18pt]
\definefont [AuthorList]  [Serif       at 12pt]
\definefont [Affiliation] [Serif       at 12pt]
\definefont [Heading]     [SerifCaps   at 10pt]
\definefont [Subheading]  [SerifItalic at 10pt]
\definefont [Abstract]    [SerifBold   at  9pt]

\setupbodyfontenvironment [9pt][interlinespace=10pt]
\setupbodyfontenvironment[10pt][interlinespace=12pt]
\setupbodyfontenvironment[12pt][interlinespace=14pt]
\setupbodyfontenvironment[18pt][interlinespace=22pt]


%%%% Environments

\definestartstop
  [abstract]
  [style=Abstract]


%%%% Layout

%% Papersize

\setuppapersize[letter][letter]

%% Margins

\setuplayout
  [header=0pt,
   footer=0pt,
   top=1.125in,
   bottom=1.125in,
   backspace=0.85in,
   width=middle,
   height=fit]

%% Columns

\setupcolumns
  [distance=.25in]

%% Sections

\setupsection
  [section]
  [conversion=R]

\setupsection
  [subsection]
  [conversion=A,
   previousnumber=no]

%% Headings

\setupheads
  [indentnext=yes]

\setuphead
  [section]
  [style=Heading,
   align=middle,
   numbercommand=\groupedcommand{}{.},
   before={\blank[18pt]},
   after={\blank[6pt]}]

\setuphead
  [subsection]
  [style=Subheading,
   align=right,
   numbercommand=\groupedcommand{}{.},
   before={\blank[6pt]},
   after={\blank[6pt]}]

%% Captions

\setupcaption
  [figure]
  [headstyle=,
   width=max]

\setupcaption
  [table]
  [headstyle=,
   conversion=R,
   location=top]

%% Floats

\setupfloat
  [table]
  [inner=\ss]

%% Indenting

\setupindenting[yes,0.125in]

%% Itemize

\setupitemize[each][packed,joinedup]


%%%% Document title

\definesystemvariable {dt} % DocumentTitle

\def\setuptitle
  {\dodoubleempty\dosetuptitle}

\def\dosetuptitle[#1][#2]%
  {\ifsecondargument
     \dodosetuptitle[#1][#2]%
   \else
     \dodosetuptitle[\v!content][#1]%
   \fi}

\def\dodosetuptitle[#1][#2]%
  {\def\dododosetuptitle##1%
     {\getparameters[\??dt##1][#2]}%
   \processcommalist[#1]\dododosetuptitle}

\def\placetitle
  {\startalignment[\v!middle]
   %\blank[\v!force,2*\v!big]
   \doattributes{\??dt\c!title}\c!style\c!color\@@dtcontenttitle
   \blank[6pt]
   \doattributes{\??dt\c!author}\c!style\c!color\@@dtcontentauthor
   \blank[6pt]
   \doattributes{\??dt affiliation}\c!style\c!color\@@dtcontentaffiliation
   \blank[18pt]
   \stopalignment}

\setuptitle
  [\c!title]
  [\c!style=Title,
   \c!color=]

\setuptitle
  [\c!author,affiliation]
  [\c!style=AuthorList,
   \c!color=]

\setuptitle
  [\c!title=,
   \c!author=,
   affiliation=]


%%%% Language specific settings

\setuplabeltext[en][figure={{Fig.~},{.}}]
\setuplabeltext[en][table=TABLE~]

\protect \endinput
