\ProvidesPackage{mythesis}[2003/05/13 Thesis customizations] \RequirePackage{doublespace} \RequirePackage{float} \RequirePackage{roundflt} \RequirePackage{subfigure} \RequirePackage{mytools} \RequirePackage{amsthm} \normalfont \headheight\z@ \headsep\z@ \topmargin\z@ \textheight 8.9in \advance\textheight0.5\baselineskip \@roundlen\textheight \textwidth 6in \oddsidemargin 0.5in \evensidemargin 0.5in %\RequirePackage{geometry} % % BASIC STYLE CONFIGURATION % % DESIGN: % % The idea is that we have three types of text: % % heading: titles, section titles % run-in: run-in titles, figure/table labels % text: everything else % % These three should be independently changeable automatically in groups. % However, each separate component should be able to override and/or augment the % style settings. % % INTERFACE: % % For headings that get their own line, there is \headingstyle to change all of % them. For run-in headings there is \runinstyle. Initially \headingstyle=\relax % and \runinstyle=\headingstyle. % % Then, for each section type, there is the individual section style command. % For \section there is \sectionstyle, for example. % % For each section, first \headingstyle is applied, then \sectionstyle. % \let\headingstyle\@empty \def\runinstyle{\headingstyle} % % Floats style % \def\@fs@cfont#1{\runinstyle{\captionstyle{#1}}} \def\captionstyle{\bfseries\scshape\MakeLowercase} \newcommand\floatc@myruled[2]{{\@fs@cfont{#1}}\quad#2\par} \newcommand\fs@myruled{% \let\@fs@capt\floatc@myruled \def\@fs@pre{\hrule height.8pt depth0pt \kern2pt}% \def\@fs@post{\kern2pt\hrule\relax}% \def\@fs@mid{\kern2pt\hrule\kern2pt}% \let\@fs@iftopcapt\iftrue} \floatstyle{myruled} \restylefloat{table} \restylefloat{figure} % Float appearance parameters \textfloatsep 20\p@ \@plus 0.5\baselineskip \@minus 0.5\baselineskip \skip\footins 12pt \@plus 0.8\baselineskip \@minus 0.3\baselineskip % % We must redefine \normalsize here to get the equations to stretch correctly. \renewcommand\normalsize{% \@setfontsize\normalsize\@xiipt{14.5}% \abovedisplayskip 15\p@ \@plus6\p@ \@minus7\p@ \abovedisplayshortskip \z@ \@plus6\p@ \belowdisplayshortskip 10\p@ \@plus6\p@ \@minus5\p@ \belowdisplayskip \abovedisplayskip \let\@listi\@listI} \everydisplay{} % % Subfigure style % \renewcommand\thesubfigure{\textsc{\alph{subfigure}}} \renewcommand\@thesubfigure{{\subcaplabelfont(\thesubfigure)} } % % Titling style % % Gets just the name of the author, no e-mail etc. \def\author#1{% \gdef\@author{#1}% \@processauthor#1\\\@stop } \def\@processauthor#1\\#2\@stop{\gdef\@authorname{#1}} % Forms the Harvard University title page. \newcommand\harvardtitlepage{% \begin{centeredpage} \singlespace \def\sp{\vskip\normalbaselineskip}% \setbox\@tempboxa\hbox{in partial fulfillment of the honors requirements}% \hsize\wd\@tempboxa \parskip0.5\normalbaselineskip \centering {% \large \leftskip=\z@\@plus0.5\hsize\rightskip\leftskip \@title\par }% \sp\sp A Thesis presented\par by\par \sp \@authorname\par \sp to\par Computer Science\par \sp \unhbox\@tempboxa\par for the degree of\par Bachelor of Arts\par \sp Harvard College\par Cambridge, Massachusetts\par \sp \today\par \end{centeredpage}% } \newcommand\thesistitlepage{% \begin{centeredpage*} \singlespace \vskip\z@\@plus1fil {\raggedleft\leftskip0.3\hsize\@plus0.7\hsize {\Large\bfseries\@title\par}\vskip\normalbaselineskip {\let\\\par\large\@author\par}% }% \vskip\z@\@plus1.2fil {\raggedright \large A Thesis Presented to the\par Department of Computer Science\par of Harvard College\hfill \today\par }% \vskip\z@\@plus1fil \end{centeredpage*} } \renewcommand\maketitle{\harvardtitlepage\thesistitlepage} % I don't like my paragraphs being stretched at _all_ \parskip\z@ % % Section header styles, taken from SOSP, taken from ACM. % % \providecommand{\lnstyle}{} \newdimen\chapterheight \chapterheight 0.4\textheight \@roundlen\chapterheight \def\@makechapterhead#1{% \vbox to \chapterheight{% \vfil \def\baselinestretch{}% \parindent \z@ \raggedleft \advance\leftskip0.3\textwidth \normalfont \lnstyle \Large\bfseries \ifnum \c@secnumdepth >\m@ne \@chapapp\space \thechapter \par\nobreak \vskip \z@\@plus0.5fil\relax \fi \interlinepenalty\@M #1\par \vfil }\nobreak \@afterindenttrue } \newdimen\schapterheight \schapterheight 0.2\textheight \@roundlen\schapterheight \def\@makeschapterhead#1{% \vbox to \schapterheight{% \vfil \def\baselinestretch{}% \parindent \z@ \raggedleft \advance\leftskip0.3\textwidth \normalfont \lnstyle \Large\bfseries \interlinepenalty\@M #1\par \vfil }\nobreak \@afterindenttrue } \def\section{% \@startsection{section}{1}{\z@}{10\p@ \@plus 6\p@ \@minus 2\p@}% GM {4\p@ \@plus 1\p@ \@minus 5\p@}{\@sectionstyle}% } \def\@sectionstyle#1{\headingstyle\sectionstyle{#1}} \def\sectionstyle{\bfseries\large} \def\subsection{% \@startsection{subsection}{2}{\z@}{6\p@ \@plus 6\p@ \@minus 4\p@} {4\p@ \@plus 1\p@ \@minus 5\p@}{\@subsectionstyle}% } \def\@subsectionstyle#1{\headingstyle\subsectionstyle{#1}} \def\subsectionstyle{\bfseries\itshape\large} \def\subsubsection{% \@startsection{subsubsection}{3}{\z@}{5\p@ \@plus 5\p@ \@minus 4\p@}% {4\p@ \@plus 1\p@ \@minus 1\p@}{\@subsubsectionstyle}% } \def\@subsubsectionstyle#1{\headingstyle\subsubsectionstyle{#1}} \def\subsubsectionstyle{\itshape} \def\paragraph{% \@startsection{paragraph}{5}{\z@}{0.5\baselineskip}% {-1em}{\@paragraphstyle}% } \def\@paragraphstyle#1{\runinstyle{\paragraphstyle{#1}}} \def\paragraphstyle{\bfseries} % Use flushpar on the paragraphs. We do that by fudging the \@hangfrom macro. \def\@hangfrom#1{\setbox\@tempboxa\hbox{{#1}}% \hangindent \wd\@tempboxa\noindent \rightskip=\z@\@plus0.5\hsize \parfillskip=\z@\@plus0.5\hsize \box\@tempboxa} % % Abstract % \def\abstractstyle{\bfseries\Large} \def\@abstractstyle#1{\headingstyle\abstractstyle{#1}} \newenvironment{centeredsection}[1]{% \begin{centeredpage} {\raggedleft \@abstractstyle{#1}\par} \vskip3\normalbaselineskip }{% \thispagestyle{plain} \end{centeredpage} \stepcounter{page}% \ignorespacesafterend } \renewenvironment{abstract}{% \chapter*{\abstractname}% }{% \clearpage \ignorespacesafterend } % % Tables: I like making "header columns" for tables. Here's a macro to do it % quickly. % \newcommand*\thstyle{\bfseries} \newcommand*\thead{\runinstyle{\relax}\thstyle{\relax}} \newcommand\textth[1]{\runinstyle{\thstyle{#1}}} % % Chapter breaks. % \newcommand\bigpagebreak{\clearpage\vspace*{0.33\textheight}} % % Single-space the table of contents % \let\@oldstarttoc\@starttoc \def\@starttoc#1{\begin{singlespace}\@oldstarttoc{#1}\end{singlespace}} % Produces "Section" or "Chapter" based on whichever is appropriate for a % reference. \def\secref#1{\expandafter\@secref\csname r@#1\endcsname{#1}} \def\@secref#1#2{% \ifx#1\relax \protect\G@refundefinedtrue \nfss@text{\reset@font\bfseries ??}% \@latex@warning{Reference `#2' on page \thepage \space undefined}% \else \edef\reserved@a{\expandafter\@firstoftwo#1}% \expandafter\@chaporsec\reserved@a.\@stop~\reserved@a \fi } \def\@chaporsec#1.#2\@stop{% \begingroup \def\reserved@a{#2}% \ifx\reserved@a\@empty \chaptername \else Section\fi \endgroup } \def\onehalfspace{% \vskip\parskip% \vskip\baselineskip% \def\baselinestretch{1.5}% \ifx\undefined\selectfont %then new font selection scheme not invoked-MAR \ifx\@currsize\normalsize\@normalsize\else\@currsize\fi% \else %else new font selection scheme is invoked-MAR \@newbaseline %include new baselinestretch-MAR \fi %-MAR \vskip-\parskip% \vskip-\baselineskip% } \def\endonehalfspace{\par} % Theorems \def\th@mine{% %% \let\thm@indent\noindent % no indent \thm@headfont{\bfseries\scshape}% heading font is bold %% \thm@notefont{}% same as heading font %% \thm@headpunct{.}% add period after heading %% \let\thm@swap\@gobble \thm@preskip 0.5\normalbaselineskip \@plus 0.25\normalbaselineskip \@minus 0.5\normalbaselineskip \thm@postskip 0pt \itshape % body font } \newcommand\closedbox{\leavevmode \hbox to 0.77778em{% \hfil\vrule width 0.6em height 0.6em \hfil }% } \let\qedsymbol\closedbox \theoremstyle{mine} \newtheorem{theorem}{theorem} \endinput