\typeout{Staff Report Style (v3) with Endnotes, last edited on December 20, 1996}
\typeout{Research Department, Federal Reserve Bank of Minneapolis}
\typeout{NOTICE: Research Department procedures for this style, which are documented elsewhere, must be followed in order for this style to function properly.}

% Filename: srav3.sty
% This is a modification of the original staff report style: stafrept.sty
% The primary differences between these two styles is documented elsewhere


%%%% Some basic page layout and page-numbering commands

\setlength{\topmargin}{-26bp}%
%\setlength{\topmargin}{15bp}%
\setlength{\oddsidemargin}{0in}%
\setlength{\textheight}{9in}%
\setlength{\textwidth}{6.5in}%
\setcounter{page}{0}%
\pagestyle{plain}%
\setlength{\parindent}{3em}
\newdimen\mathindent
\setlength{\mathindent}{\parindent}

%%%% Load the package 'doublesp' which allows line spacing
%%%% to be better controlled. Sets the linespacing to 2

\RequirePackage{doublesp}%
\setstretch{2}%

%%%% Load the four packages: 'ifthen', 'theorem', 'indentfi' and 'endnotes'.
%%%% 'ifthen' provides some conditioning commands which are used below.
%%%% 'theorem' allows one to customize the display of theorems.
%%%% 'indentfi' forces the first paragraph to be indented.
%%%% 'endnotes' provides commands to convert footnotes into endnotes.

\RequirePackage{ifthen,theorem,indentfi,endnotes}

%%%% The following commands by Pawel Stryszak change
%%%% the amount of paragraph indentation for endnotes,
%%%% make footnotes act as endnotes, and provides the
%%%% heading for the endnotes (with a minor modification
%%%% by GLW).

%%%% Change has been made in Version 3 to correct
%%%% the vertical positioning of the 'Notes' heading.
%%%% Similar change made in appendix code for
%%%% 'Appendix Notes'

\def\enoteformat{\rightskip\z@ \leftskip\z@ \parindent=3em
     \leavevmode\llap{\hbox{$^{\@theenmark}$}}}
\renewcommand{\footnote}{\endnote}
%\renewcommand{\notesname}{
%   \vspace{-1.3em}\normalsize\begin{center}
%      Notes\end{center}}
\def\enoteheading{\notesname
     \leavevmode\par\vskip-\baselineskip}
\renewcommand{\notesname}{
   \begin{center}
      \normalfont\bfseries Notes\end{center}\vspace{\baselineskip}}


%%%% Customize theorem-like structures.  Makes use of package 'theorem'.

\theoremheaderfont{\normalfont\scshape}%
%
{\theorembodyfont{\normalfont\itshape}%
\newtheorem{definition}{Definition}%
\newtheorem{proposition}{Proposition}%
\newtheorem{theorem}{Theorem}}%
%
{\theorembodyfont{\normalfont}%
\newtheorem{lemma}{Lemma}
\newtheorem{corollary}{Corollary}
\newtheorem{example}{\it{Example}}
\newtheorem{remark}{\it{Remark}}
\newtheorem{assumption}{Assumption}
\newtheorem{axiom}{Axiom}
\newtheorem{condition}{\it{Condition}}
\newtheorem{fact}{\it{Fact}}
\newtheorem{claim}{\it{Claim}}
\newtheorem{step}{\it{Step}}
\newtheorem{prooof}{\it{Proof.}}}%
%
\renewcommand{\thedefinition}{\arabic{definition}.}%
\renewcommand{\theproposition}{\arabic{proposition}.}%
\renewcommand{\thetheorem}{\arabic{theorem}.}%
\renewcommand{\thelemma}{\arabic{lemma}.}%
\renewcommand{\thecorollary}{\arabic{corollary}.}%
\renewcommand{\theexample}{\arabic{example}.}%
\renewcommand{\theremark}{\arabic{remark}.}%
\renewcommand{\theassumption}{\arabic{assumption}.}
\renewcommand{\theaxiom}{\arabic{axiom}.}%
\renewcommand{\thecondition}{\arabic{condition}.}
\renewcommand{\thefact}{\arabic{fact}.}
\renewcommand{\theclaim}{\arabic{claim}.}
\renewcommand{\thestep}{\arabic{step}.}
\renewcommand{\theprooof}\relax

%%%% Several variables and commands were needed to customize the
%%%% titlepage. 'Maketitle' is redefined - the original can be found
%%%% in 'article.cls'. The 'abstract' environment is also redefined.
%%%% Makes use of the package 'ifthen' as well as the 'singlespace'
%%%% environment defined in 'doublesp'.

\def\srnum{???}
\def\atext{}
\def\btext{}
\def\ctext{}
\def\dtext{}
\def\aaddr{}
\def\baddr{}
\def\caddr{}
\def\daddr{}
\newcounter{authnum}
\setcounter{authnum}{0}
\def\srnumber#1{%
    \def\srnum{{#1}}}
\newcommand{\authortext}[1]{%
  \stepcounter{authnum}
  \ifthenelse{\value{authnum} = 1}
     {\renewcommand{\atext}{#1}}
     {\ifthenelse{\value{authnum} = 2}
        {\renewcommand{\btext}{#1}}
        {\ifthenelse{\value{authnum} = 3}
           {\renewcommand{\ctext}{#1}}
           {\renewcommand{\dtext}{#1}}}}}
\newcommand{\authoraddr}[1]{%
  \ifthenelse{\value{authnum} = 1}
     {\renewcommand{\aaddr}{#1}}
     {\ifthenelse{\value{authnum} = 2}
        {\renewcommand{\baddr}{#1}}
        {\ifthenelse{\value{authnum} = 3}
           {\renewcommand{\caddr}{#1}}
           {\renewcommand{\daddr}{#1}}}}}

\def\maketitle{\par\begin{singlespace}
    \begingroup
    \def\thefootnote{\fnsymbol{footnote}}
    \renewcommand{\@makefnmark}{\mbox{$^{\@thefnmark}$}}
    \renewcommand{\@makefntext}[1]%
      {\noindent\hspace{-1.8em}\makebox[1.8em][r]{\@makefnmark}##1}
    \global\@topnum\z@ \@maketitle
    \thispagestyle{empty}\@thanks
    \endgroup
    \setcounter{footnote}{0}
    \let\maketitle\relax
    \let\@maketitle\relax
    \setlength{\topskip}{0.25in}
    \gdef\@thanks{}%
    \let\thanks\relax
    \end{singlespace}
    }
\def\@maketitle{%
    \noindent Federal Reserve Bank of Minneapolis\\
    Research Department Staff Report \srnum\\[\baselineskip]
    \@date\\[0.375in]        %change from 0.625in. the next blank line is needed

    \raggedright             %this is to allow the letting in title to be loosened
    \setstretch{.85}         %specify the proportion of letting to reduce
    {\large \bf \@title \\[16pt]}
    \setstretch{1}           %restore to original setting
    {\normalsize\atext\\[7pt]}
    \small\aaddr
    \ifthenelse{\value{authnum} > 1}
       {\\[22pt]{\normalsize\btext\\[7pt]}
        \small\baddr}{}
    \ifthenelse{\value{authnum} > 2}
       {\\[22pt]{\normalsize\ctext\\[7pt]}
        \small\caddr}{}
    \ifthenelse{\value{authnum} > 3}
       {\\[22pt]{\normalsize\dtext\\[7pt]}
    \small\daddr}{}
    \vfill
    }
\renewenvironment{abstract}
  {\small
   \begin{singlespace}
    {\noindent ABSTRACT \rule[-0.02in]{5.65in}{0.2pt} \\[\baselineskip]}}
  {\end{singlespace}
   \renewcommand{\footnoterule}{\hspace{-0.5in}\rule[\baselineskip]{6.55in}{0.2pt}}
   \newpage\thispagestyle{empty}
   }


%%%% custom section counters: main arabic, sub Letter, subsub none
%%%% shrink spaces following section and subsection numbers
%%%% if shrinking causes problems when refererring to sections
%%%% see GOOSSENS p.23

\renewcommand{\thesection}{\arabic{section}.\hspace{-.7em}}
\renewcommand{\thesubsection}{\Alph{subsection}.\hspace{-.7em}}
\renewcommand{\thesubsubsection}\relax


%%%% custom size and vertical space for headings (gooss p26)

\renewcommand{\section}{\@startsection
	{section}
	{1}
	{0mm}
	{-1\baselineskip}
	{0.0001\baselineskip}
	{\setstretch{.7}\normalfont\large\bfseries}}

\renewcommand{\subsection}{\@startsection
	{subsection}
	{2}
	{0mm}
	{-1\baselineskip}
	{0.0001\baselineskip}
	{\setstretch{.7}\normalfont\normalsize\bfseries}}

\renewcommand{\subsubsection}{\@startsection
	{subsubsection}
	{3}
	{-1em}
	{-1\baselineskip}
	{0.0001\baselineskip}
	{\setstretch{.7}\normalfont\normalsize\itshape\bfseries}}


%%%% custom appendix

\renewcommand{\appendix}{\newpage\begin{center}%
				\normalsize\bfseries Appendix%
	\end{center}%
	\renewcommand{\theequation}{A\arabic{equation}}%
	\setcounter{section}{0}%
	\setcounter{equation}{0}%
	\setcounter{endnote}{0}%
	\renewcommand{\thesection}{A\arabic{section}%
		.\hspace{-.7em}}%
	\renewcommand{\thesubsection}{A\arabic{subsection}%
		.\hspace{-.7em}}%
        \renewcommand{\notesname}{
           \begin{center}
           \normalfont\bfseries Appendix Notes\end{center}\vspace{\baselineskip}}
%	\renewcommand{\notesname}{%
%		\normalsize{\vspace{-1.6em}\begin{center}%
%		Appendix Notes\end{center}}}%
	}%

%%%% Change the description environment - which is used
%%%% by SW when one selects Custom Item.  This is often
%%%% used to typeset references without reference
%%%% numbers.  This environment has been copied from
%%%% article.cls, but modified by the two \setlength
%%%% commands to fix the spacing.

\renewenvironment{description}
		{\list{}{\listparindent -\parindent
                  \let\makelabel\descriptionlabel
                  \itemsep       0pt
                  \parsep        0pt
			\itemindent    \listparindent
			\leftmargin    \parindent}}
		{\endlist}

%% Redefine Itemize to reduce space between the items.
%% This environment is not designed to handle nested item lists.

\renewenvironment{itemize}
		{\list{}{\listparindent -0.5em
                  \let\makelabel\labelitemi
                  \itemsep       0pt
                  \parsep        0pt
			\itemindent    \listparindent
			\labelsep      -1em
			\leftmargin    \parindent}}
		{\endlist}

%% Redefine Enumerate to reduce space between the items.  
%% Borrowed from Outline definition in jeep.sty

\def\enumerate{\ifnum \@enumdepth >3 \@toodeep\else
      \advance\@enumdepth \@ne 
      \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
      {\csname label\@enumctr\endcsname}{\usecounter
	{\@enumctr}\def\makelabel##1{\hss\llap{##1}}
	 \parsep \z@ \itemsep \z@ 
	 \ifnum \@enumdepth > 1 \topsep \z@ \fi}\fi}

\let\endenumerate =\endlist
