diff options
-rw-r--r-- | cmuthesis.cls | 205 | ||||
-rw-r--r-- | cmuthesis_template.tex | 52 |
2 files changed, 96 insertions, 161 deletions
diff --git a/cmuthesis.cls b/cmuthesis.cls index 285e043..af2dbe2 100644 --- a/cmuthesis.cls +++ b/cmuthesis.cls @@ -1,11 +1,18 @@ %% dkoes 5/10/2006 -\LoadClassWithOptions{book} +\LoadClassWithOptions{amsbook} +% pass tells geometry not to mess with amsbook's defaults, +% but instead to use them as the default. +\PassOptionsToPackage{pass}{geometry} +\RequirePackage{geometry} %% dkoes - Here's a bunch of stuff taken from mjz-titlepage.sty that makes % a pretty CMU techreport acceptable title page +%% rak - Updated in 2020 to use the amsbook class and to simplify some of +% the LaTeX code. + %% titlepage parameters %% required: title, author, date, Year, trnumber, committee %% optional: permission, support, disclaimer, keywords @@ -25,9 +32,14 @@ %\def\@copyrightnotice#1{{\small\sbox{\@copyrightbox}{#1}\ifthenelse{\lengthtest{\wd\@copyrightbox > \linewidth}}{\noindent #1 \par}{\begin{center} #1 \end{center}}}} \def\@copyrightnotice#1{{\small\sbox{\@copyrightbox}{#1}\ifdim\wd\@copyrightbox>\linewidth \noindent #1 \par\else\begin{center} #1 \end{center}\fi}} -\def\maketitle{ +\def\@maketitle{ \thispagestyle{empty} +%% Centered things on the title page must be *physically* centered +%% on the page, so they line up with the cut-out window. So we hardwire +%% the margins for the title page so that left margin = right margin. +\newgeometry{hmargin={0cm, 0cm}} + % calculate skip needed to ensure that title appears in the cut-out \newlength{\@cutoutvskip} \setlength{\@cutoutvskip}{2.1875 true in} % position of cut-out @@ -36,15 +48,6 @@ \addtolength{\@cutoutvskip}{-\headheight} \addtolength{\@cutoutvskip}{-\headsep} -%% Centered things on the title page must be *physically* centered -%% on the page, so they line up with the cut-out window. So we hardwire -%% the margins for the title page so that left margin = right margin: -%% left margin = (8.5in - textwidth)/2 -\oddsidemargin=8.5in -\advance\oddsidemargin by -\textwidth -\oddsidemargin=.5\oddsidemargin -\advance\oddsidemargin by -1in % TeX sux -% \let\footnoterule\relax \vglue\@cutoutvskip \begin{center} @@ -72,7 +75,7 @@ Carnegie Mellon University \\ Pittsburgh, PA 15213 \end{center} - +\vskip 1em \begin{center} {\bf Thesis Committee:} \\ \@committee @@ -96,110 +99,25 @@ % keywords go at bottom of page ii (the rear of the titlepage) % if keywords are omitted, this page is blank -\clearpage -\thispagestyle{empty} -\@ifundefined{@keywords}{}{\vspace*{\fill} {\bf Keywords:} \@keywords} -\cleardoublepage -} - -\newenvironment{dedication} - {\cleardoublepage \thispagestyle{empty} \vspace*{\stretch{1}} \begin{center} \em} - {\end{center} \vspace*{\stretch{3}} \clearpage} - - -\newenvironment{psuedochapter}[1] - {\cleardoublepage - \thispagestyle{empty} - \vspace*{\stretch{1}} - \begin{center} \large {\bf #1} \end{center} -% \addcontentsline{toc}{chapter}{\numberline{}#1} --not yet mjz - \begin{quotation}} - {\end{quotation} - \vspace*{\stretch{3}} - \clearpage} - -\newenvironment{abstract} - {\begin{psuedochapter}{Abstract}}{\end{psuedochapter}} - -\newenvironment{acknowledgments} - {\begin{psuedochapter}{Acknowledgments}}{\end{psuedochapter}} - - - - - -%% dkoes - what follows is just a result of my personal style preferences -% most things are shamelessly ripped from various conference class files - -% Utilities -% --------- - - -\newcommand{\centeroncapheight}[1]{% - {\setbox\@tempboxa = \hbox{#1}% - \@measurecapheight{\@tempdima}% % Calculate ht(CAP) - ht(text) - \advance \@tempdima by -\ht\@tempboxa % ------------------ - \divide \@tempdima by 2 % 2 - \raise \@tempdima \box\@tempboxa}} - -\newbox{\@measbox} - -\def \@measurecapheight #1{% {\dimen} - \setbox\@measbox = \hbox{ABCDEFGHIJKLMNOPQRSTUVWXYZ}% - #1 = \ht\@measbox} - -\long\def \@titlefootnote #1#2{% - \insert\footins{% - \reset@font\footnotesize - \interlinepenalty\interfootnotelinepenalty - \splittopskip\footnotesep - \splitmaxdepth \dp\strutbox \floatingpenalty \@MM - \hsize\columnwidth \@parboxrestore -%%% \protected@edef\@currentlabel{% -%%% \csname p@footnote\endcsname\@thefnmark}% - \color@begingroup - \def \@makefnmark {$^{#1}$}% - \@makefntext{% - \rule\z@\footnotesep\ignorespaces#2\@finalstrut\strutbox}% - \color@endgroup}} - -% Lists -% ----- - -\setlength{\topsep}{1pt} - \setlength{\itemsep}{1pt} -\setlength{\parsep}{3pt} - -\renewcommand{\labelitemi}{{\small \centeroncapheight{\textbullet}}} -\renewcommand{\labelitemii}{\centeroncapheight{\rule{2.5pt}{2.5pt}}} -\renewcommand{\labelitemiii}{$-$} -\renewcommand{\labelitemiv}{{\Large \textperiodcentered}} - -\renewcommand{\@listi}{% - \leftmargin = \leftmargini - \listparindent = 0pt} - -\let \@listI = \@listi - -\renewcommand{\@listii}{% - \leftmargin = \leftmarginii - \topsep = 1pt - \labelwidth = \leftmarginii - \advance \labelwidth by -\labelsep - \listparindent = \parindent} - -\renewcommand{\@listiii}{% - \leftmargin = \leftmarginiii - \labelwidth = \leftmarginiii - \advance \labelwidth by -\labelsep - \listparindent = \parindent} - -\renewcommand{\@listiv}{% - \leftmargin = \leftmarginiv - \labelwidth = \leftmarginiv - \advance \labelwidth by -\labelsep - \listparindent = \parindent} +% amsbook default textwidth / textheight is 30pc / 50.5pc (p. 10 +% of amsclass manual). To save Catherine paper (and to allow us +% slightly wider inference rule displays), we increase the width +% by two pica and scale the height accordingly. +% Then call \calclayout to have AMS recalculate whatever it needs +% to recalculate (p. 80 of manual). +% positioning of subjclass, keywords, and abstract based on p.61 +% of manual. +\restoregeometry\thispagestyle{empty} +%\newgeometry{textwidth=32pc,textheight=53.9pc}\thispagestyle{empty} +\calclayout +\begin{center} + \ifx\@empty\@subjclass\else\@setsubjclass\fi + \ifx\@empty\@keywords\else\@setkeywords\fi +\end{center} +\vfil +\@setabstract +} % A simple style file to provide a draft marking in the background of % a file @@ -219,25 +137,40 @@ %usage: \draftstamp{date}{label} \newcommand{\draftstamp}[2]{\definecolor{DraftGrey}{gray}{0.7} \ClearShipoutPicture\AddToShipoutPicture{ - \begin{minipage}[b][0.11\paperheight][t]{\paperwidth} - \centering - \vspace{.4in} - \textcolor{DraftGrey}{\renewcommand{\baselinestretch}{1.0}\normalsize - \begin{tabular}{c} - #1 \\ - #2 - \end{tabular} - } - + \begin{minipage}[b][0.11\paperheight][t]{\paperwidth} + \centering + \vspace{.5in} + \textcolor{DraftGrey}{\renewcommand{\baselinestretch}{1.0}\normalsize + \begin{tabular}{c} + #1 \\ + #2 + \end{tabular} + } + \end{minipage} -}} - -% mainmatter is ignoring openany, fix -\renewcommand\mainmatter{% - \if@openright - \cleardoublepage - \else - \clearpage - \fi - \@mainmattertrue - \pagenumbering{arabic}} + }} + +\newenvironment{dedication} + {\cleardoublepage \thispagestyle{empty} \vspace*{\stretch{1}} \begin{center} \em} + {\end{center} \vspace*{\stretch{3}} \clearpage} + + +\newenvironment{psuedochapter}[1] + {\cleardoublepage + \thispagestyle{empty} + \vspace*{\stretch{1}} + \begin{center} \large {\bf #1} \end{center} +% \addcontentsline{toc}{chapter}{\numberline{}#1} --not yet mjz + \begin{quotation}} + {\end{quotation} + \vspace*{\stretch{3}} + \clearpage} + + \newenvironment{acknowledgments} + {\begin{psuedochapter}{Acknowledgments}} + {\end{psuedochapter}} + + + \setlength{\textwidth}{32pc} + \setlength{\textheight}{53.9pc} + \calclayout
\ No newline at end of file diff --git a/cmuthesis_template.tex b/cmuthesis_template.tex index e16548a..0dc1949 100644 --- a/cmuthesis_template.tex +++ b/cmuthesis_template.tex @@ -2,7 +2,7 @@ %starting all chapters on odd numbered pages \documentclass[12pt]{cmuthesis} -% This is a template for a CMU thesis. It is 18 pages without any content :-) +% This is a template for a CMU thesis. It is 16 pages without any content :-) % The source for this is pulled from a variety of sources and people. % Here's a partial list of people who may or may have not contributed: % @@ -10,6 +10,7 @@ % caruana = Rich Caruana % colohan = Chris Colohan % comar = Cyrus Omar +% dkoes = David Koes % jab = Justin Boyan % josullvn = Joseph O'Sullivan % jrs = Jonathan Shewchuk @@ -17,15 +18,14 @@ % mjz = Matt Zekauskas (mattz@cs) % pdinda = Peter Dinda % pfr = Patrick Riley -% dkoes = David Koes (me) +% rak = Ryan Kavanagh -% My main contribution is putting everything into a single class files and small -% template since I prefer this to some complicated sprawling directory tree with -% makefiles. +% dkoes: My main contribution is putting everything into a single class files and small template since I prefer this to some complicated sprawling directory tree with makefiles. + +% rak: I ported it to use the "amsbook" class instead of the plain "book" class. % some useful packages \usepackage{times} -\usepackage{fullpage} \usepackage{graphicx} \usepackage{amsmath} \usepackage[numbers,sort]{natbib} @@ -37,17 +37,15 @@ % Approximately 1" margins, more space on binding side %\usepackage[letterpaper,twoside,vscale=.8,hscale=.75,nomarginpar]{geometry} %for general printing (not binding) -\usepackage[letterpaper,twoside,vscale=.8,hscale=.75,nomarginpar,hmarginratio=1:1]{geometry} +\PassOptionsToPackage{twoside}{geometry} +\PassOptionsToPackage{vscale=.8}{geometry} +\PassOptionsToPackage{hscale=.8}{geometry} +\PassOptionsToPackage{nomarginpar}{geometry} +\PassOptionsToPackage{hmarginratio=1:1}{geometry} % Provides a draft mark at the top of the document. \draftstamp{\today}{DRAFT} -\begin {document} -\frontmatter - -%initialize page style, so contents come out right (see bot) -mjz -\pagestyle{empty} - \title{ %% {\it \huge Thesis Proposal}\\ {\bf Awesome Work in Computer Science}} \author{Me} @@ -70,29 +68,33 @@ Someone from a strange and faraway land \keywords{Stuff, More Stuff} -\maketitle - -\begin{dedication} -For my dog -\end{dedication} +\begin{document} -\pagestyle{plain} % for toc, was empty +\frontmatter -%% Obviously, it's probably a good idea to break the various sections of your thesis -%% into different files and input them into this file... +% The maketitle command also prints your abstract. For this reason, +% the abstract needs to come before \maketitle. \begin{abstract} -A short summary. + A short summary. \end{abstract} -\begin{acknowledgments} -My advisor is cool. -\end{acknowledgments} +\frontmatter +\maketitle + +\begin{dedication} + For my dog +\end{dedication} +\begin{acknowledgments} + My advisor is cool. +\end{acknowledgments} \tableofcontents + \listoffigures + \listoftables \mainmatter |