%
% modifications made to stanford thesis for Syracuse University thesis
% ed guy  9/25/89
% akhtar-uz-zaman ali 6/20/90
% todd heywood 8/6/91
%
% Although 1.5 is doublespacing technically, try to get away with 1.3
% (seems OK)
%
\makeatletter
\oddsidemargin 0.5in \evensidemargin 0.5in
\marginparwidth 35pt \marginparsep 10pt
\topmargin 1pt \headsep .5in
\textheight 7.8in \textwidth 6in
\brokenpenalty=10000
\renewcommand{\baselinestretch}{1.3}

\def\cl@chapter{\@elt{section}\@elt{footnote}}
\def\thefigure{\@arabic\c@figure}
\def\thetable{\@arabic\c@table}
\def\theequation{\arabic{equation}}

\def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
   \@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
      \@parmoderr\@floatpenalty\z@
    \else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
       \multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
       \@tfor \@tempa :=#2\do
                        {\if\@tempa h\advance\@tempcnta \@ne\fi
                         \if\@tempa t\advance\@tempcnta \tw@\fi
                         \if\@tempa b\advance\@tempcnta 4\relax\fi
                         \if\@tempa p\advance\@tempcnta 8\relax\fi
         }\global\count\@currbox\@tempcnta}\@fltovf\fi
    \global\setbox\@currbox\vbox\bgroup 
    \def\baselinestretch{1.3}\@normalsize
    \boxmaxdepth\z@
    \hsize\columnwidth \@parboxrestore}
\long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\footnotesize
    \interlinepenalty\interfootnotelinepenalty 
    \splittopskip\footnotesep
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth \@parboxrestore
   \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext
    {\rule{\z@}{\footnotesep}\ignorespaces
      #1\strut}}}


\def\dept#1{\gdef\@dept{#1}}
\def\submitdate#1{\gdef\@submitdate{#1}}
\def\copyrightyear#1{\gdef\@copyrightyear{#1}} % \author, \title in report
\def\@title{}\def\@author{}\def\@dept{Computer and Information Science}

% etg 8/14/89 
\def\@previousdegrees{\ }  
\def\previousdegrees#1{\gdef\@previousdegrees{#1}}
\def\@typeofthesis{Dissertation} 
\def\typeofthesis#1{\gdef\@typeofthesis{#1}}
\def\thetypeofthesis{\@typeofthesis}
\def\@typeofabstract{Abstract of Dissertation} 
\def\typeofabstract#1{\gdef\@typeofabstract{#1}}
\def\thetypeofabstract{\@typeofabstract}
\def\@degreelevel{Doctor of Philosophy} 
\def\degreelevel#1{\gdef\@degreelevel{#1}}
\def\@abstractfile{abstract}
\def\abstractfile#1{\gdef\@abstractfile{#1}}
%
% \facts are useful during for sourcing statements.
%        it produces numbered margin notes starting with "Fact"
%        the default reference is G.A. for generally accepted
%        \fact[ref] will replace G.A. with ref
% \conjecture works the same way,  its default reference is "Mine"
%        margin notes start with "conj"
% \linesourcefalse (the default) causes these notes to be ignored
% \linesourcetrue  turns them on.
%
%
% \joke{a funny thing happened to me on the way to the campus}
%        is a way for the writer to humor himself and his early 
%        readers.  
% \jokestrue (the default) causes these jokes to be included
% \jokesfalse          turns them off.
%
\newif\ifjokes       \jokestrue                  %Include Jokes and Wise remarks
\newif\iflinesource  \linesourcefalse            %Classify each line's source 
\def\joke#1{\ifjokes #1 \fi}
\newcounter{marginnotectr}
\def\fact{\@ifnextchar[{\@fact{Fact}}{\@fact{Fact}[G.A.]}}
\def\conjecture{\@ifnextchar[{\@fact{Conj}}{\@fact{Conj}[Mine]}}
\def\@fact#1[#2]{
    \iflinesource
        \ifnum\value{marginnotectr}=0    %is it the first one?
            %increased margin size doesn't work !!!
            \addtolength{\textwidth}{-.5in}
            \message{increased right margin size}
        \fi
        \stepcounter{marginnotectr}
        \marginpar{\tiny \arabic{marginnotectr} #1 #2}
        $^{\arabic{marginnotectr}:}$ 
%    \else       
    \fi
}


\def\@submitdate{\ifcase\the\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space \number\the\year}
\ifnum\month=12
    \@tempcnta=\year \advance\@tempcnta by 1
    \edef\@copyrightyear{\number\the\@tempcnta}
\else
    \def\@copyrightyear{\number\the\year}
\fi
\newif\ifcopyright \newif\iffigurespage \newif\iftablespage 
\copyrighttrue \figurespagetrue \tablespagetrue 

\def\abtitlep{%
	\thispagestyle{empty}%
	\null%\vskip1in%
	\begin{center}
		{\large \sc \expandafter \@title}
	\end{center}
	\vfill
	\begin{center}
		\rm by\\
		{\sc \@author}
	\end{center}
	\vfill
	\begin{center}
            \expandafter{\sc \@typeofabstract}  \\
		\@submitdate\\
	\end{center}
        \vfill
        \input{\@abstractfile}
        \newpage}
\def\titlep{%
\newpage
	\thispagestyle{empty}%
        \setcounter{page}{1}
        \null%\vskip1in%
	\begin{center}
		{\Large \sc \expandafter \@title}
	\end{center}
	\vfill
	\begin{center}
		\rm by\\
		{\sc \@author}\\
                \@previousdegrees\\
	\end{center}
	\vfill
	\begin{center}
            \expandafter{\sc \@typeofthesis}  \\ \ \\  
               Submitted in partial fulfillment of the requirements for the 
               degree of \\
               \@degreelevel\ in  \expandafter{\@dept}\ \\
               in the Graduate School of Syracuse University \\ \ \\
		\@submitdate\\
	\end{center}
        \vfill
        \begin{flushright}
               \begin{minipage}{0.5\textwidth}
               Approved\ \hrulefill \\
               Date\ \hrulefill \\
               \end{minipage}
        \end{flushright}
        \vskip.5in
        \ifjokes \footnote{ Caution: /jokestrue version}\fi
        \newpage}

\def\copyrightpage{%
	\thispagestyle{empty}%
	\null\vfill
	\begin{center}
	\copyright\ Copyright \@copyrightyear\\
		\@author\\ \ \\
	\end{center}
	\vfill\newpage}
\def\prefacetop{
	\pagestyle{empty}
        \abtitlep}
\def\beforepreface{
	\pagenumbering{roman}
	\pagestyle{plain}
	\titlep
	\ifcopyright\copyrightpage\fi}



\def\prefacesection#1{%
	\chapter*{#1}
	\addcontentsline{toc}{chapter}{#1}}

\def\afterpreface{\newpage
	\tableofcontents
	\newpage
	\iftablespage
		{\addvspace{10pt}
		\let\saveaddvspace=\addvspace
		\def\addvspace##1{}
		\addcontentsline{toc}{chapter}{List of Tables}
		\listoftables
		\let\addvspace=\saveaddvspace}
		\newpage
	\fi
	\iffigurespage
		{\addvspace{10pt}
		\let\saveaddvspace=\addvspace
		\def\addvspace##1{}
		\addcontentsline{toc}{chapter}{List of Figures}
		\listoffigures
		\let\addvspace=\saveaddvspace}
		\newpage
	\fi}
\def\thesisbody{
	\pagenumbering{arabic}
	\pagestyle{headings}}





\def\biopage{
	\chapter*{Biographical Data}
}
\def\bioitem#1#2{ 
          \begin{minipage}[t]{0.5\textwidth}
           \begin{flushleft}
	    #1
           \end{flushleft}
          \end{minipage}
          \begin{minipage}[t]{0.49\textwidth}
           \begin{flushleft}
            #2
           \end{flushleft}
          \end{minipage}
          \ \ \\ 
}

% Start with pagestyle{headings} in case front matter isn't processed
\pagestyle{headings}
\makeatother

