CoCalc
Sharedwww / courses / xthesis.styOpen in CoCalc
\typeout{Document Style Option `thesis'.}

% Define the page heading to be page number only.
\newcommand{\properpagestyle}{ 
       \pagestyle{myheadings}\markboth{}{}\markright{}}

% First thing we do is make sure that report has been loaded.  A
% common error is to try to use suthesis as a documentstyle.
\@ifundefined{chapter}{\@latexerr{The `thesis' option should be used
with the `report' document style}{}}{}

% We need 1" margins except on the binding edge, where it is 1 1/2"
% Theses are single-sided, so we don't care about \evensidemargin
\oddsidemargin 0.5in \evensidemargin 0in
\marginparwidth 40pt \marginparsep 10pt
\topmargin 0pt \headsep .5in
\textheight 8.1in \textwidth 6in

% Disallow page breaks at hyphens (this will give some underfull vbox's,
% so an alternative is to use \brokenpenalty=100 and manually search
% for and fix such page breaks)
\brokenpenalty=10000

% Use 1.37 times the normal baseline-to-baseline skip
\renewcommand{\baselinestretch}{1.37}

% Redefine the macro used for floats (including figures and tables)
% so that single spacing is used.
% (Note \def\figure{\@float{figure}set single spacing} doesn't work
%  because figure has an optional argument)
\def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
   \@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
      \@parmoderr\@floatpenalty\[email protected]
    \else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
       \multiply\@tempcnta\@xxxii\advance\@tempcnta\[email protected]@n
       \@tfor \@tempa :=#2\do
            {\if\@tempa h\advance\@tempcnta \@ne\fi
             \if\@tempa t\advance\@tempcnta \[email protected]\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}\@normalsize
    \boxmaxdepth\[email protected]
    \hsize\columnwidth \@parboxrestore}

% Redefine the macro used for footnotes to use single spacing
\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{\[email protected]}{\footnotesep}\ignorespaces
      #1\strut}}}

% \author, \title are defined in report; here are the rest of the
% front matter defining macros
\def\university#1{\gdef\@university{#1}}
\def\address#1{\gdef\@address{#1}}
\def\dept#1{\gdef\@dept{#1}}
\def\submitdate#1{\gdef\@submitdate{#1}}

\def\@title{}
\def\@author{}
\def\@university{Harvard University}
\def\@address{Cambridge, Massachusetts}
\def\@dept{Mathematics}
\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}

\def\dedicate#1{\[email protected]\gdef\[email protected]{#1}}

\def\draft{\renewcommand{\properpagestyle}{\pagestyle{myheadings}
\markright{{\rm Draft Version -- \today}}}\[email protected]\properpagestyle}
\def\nobib{\[email protected]}
\def\nolistoffigures{\figurespagefalse}
\def\nolistoftables{\tablespagefalse}
\def\nofront{\[email protected]\permissionfalse\figurespagefalse\tablespagefalse}

% New if constructs:    Default conditions:
\newif\ifpermission     \permissiontrue 
\newif\iffigurespage    \figurespagetrue 
\newif\iftablespage     \tablespagetrue
\newif\[email protected]    \[email protected]
\newif\[email protected]   \[email protected]
\newif\[email protected]  \[email protected]
\newif\[email protected]   \[email protected]
\newif\[email protected]           \[email protected]
\newif\[email protected] \[email protected]
\newif\[email protected]     \[email protected]
\newif\[email protected]      \[email protected]
\newif\[email protected]     \[email protected]

\def\[email protected]#1{{\def\\{ \ignorespaces}#1}}    % disallow explicit line breaks

\def\titlep{%
    \thispagestyle{empty}%
    \[email protected]
      \begin{center} \Large DRAFT COPY\\ \large Printed \today \end{center}
    \fi
    \null\vskip0.5in
    \begin{center}
        \hyphenpenalty=10000\Large\uppercase\expandafter{\@title}
    \end{center}
    \null\vskip0.5in
    \begin{center}
        \large\rm  A SENIOR THESIS OF \\
        \@author
    \end{center}
    \null\vskip0.5in
    \begin{center}
        \footnotesize  \rm THESIS ADVISOR: WILLIAM A. STEIN \\
        \null\vskip0.3in
        \footnotesize SUBMITTED IN PARTIAL FULFILLMENT OF THE HONORS REQUIREMENTS \\
        FOR THE DEGREE OF BACHELOR OF ARTS TO THE \\
        \null\vskip0.3in 
        DEPARTMENT OF MATHEMATICS \\
        \uppercase\expandafter{\@university} \\
        \null\vskip0.3in 
        \uppercase\expandafter{\@address} \\
        \uppercase\expandafter{\@submitdate}
    \end{center}
}


\def\beforepreface{
\typeout{Most over/underfulls in first few pages are the fault of dalthesis.}
\typeout{Ignore all them.  If uncorrectable errors occur, notify staff.}
    \pagenumbering{roman}
    \pagestyle{plain}
    \titlep
%    \[email protected]\signaturepage\else\addtocounter{page}{1}\fi
%    \ifpermission\permissionpage\else\addtocounter{page}{1}\fi
    \[email protected]\[email protected]
        \newpage\begin{center}\Large\em\null\vskip1in
        \[email protected]
        \vfill\end{center}
    \fi\fi
    \[email protected]\tableofcontents\else\addtocounter{page}{1}\fi
    \newpage
    \iftablespage
        \addcontentsline{toc}{chapter}{List of Tables}\listoftables
        \newpage
    \fi
    \iffigurespage
        \addcontentsline{toc}{chapter}{List of Figures}\listoffigures
        \newpage
    \fi
    }

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

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

\newenvironment{dedication}{\newpage\begin{center}\Large\em\null\vskip1in}%
{\vfill\end{center}}


\def\afterpreface{\newpage
    \pagenumbering{arabic}
    \typeout{Dalthesis preface pages completed.}
    \properpagestyle}

% Redefine \thebibliography to go to a new page and put an entry in the
% table of contents
\let\@ldthebibliography\thebibliography
\renewcommand{\thebibliography}[1]{%
    \newpage
    \addcontentsline{toc}{chapter}{Bibliography}
    \@ldthebibliography{#1}
}

\let\@ldbibliography\bibliography
\renewcommand{\bibliography}[1]{\[email protected]\@ldbibliography{#1}\fi}

% Start out normal
\properpagestyle