Guest User

Untitled

a guest
Jan 31st, 2018
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 13.20 KB | None | 0 0
  1. % asuthesis.cls
  2. % Gregory Gelfond
  3.  
  4. % Basic Class Declaration
  5.  
  6. \ProvidesClass{asuthesis}
  7. \NeedsTeXFormat{LaTeX2e}
  8.  
  9. % Pass along arguments to the report docment class which serves
  10. % as a foundation for this class file.
  11.  
  12. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{memoir}}
  13. \ProcessOptions \relax
  14.  
  15. % Load the memoir class
  16.  
  17. \LoadClass[12pt,oneside,letterpaper,final]{memoir}
  18.  
  19. % Font Settings
  20. % Enable Stix as a replacement for Times New Roman
  21. % According to the style guide, Times New Roman font is to be set at
  22. % 12pt in size. Babel is required so that the renaming of certain
  23. % sections wont conflict with certains defaults that babel takes over.
  24.  
  25. \RequirePackage[utf8]{inputenc}
  26. \RequirePackage[T1]{fontenc}
  27. \RequirePackage{stix}
  28. \RequirePackage[scaled=0.85]{beramono}
  29. \RequirePackage[english]{babel}
  30. \RequirePackage[kerning,spacing,babel,final]{microtype}
  31.  
  32. % require the etoolbox package
  33.  
  34. \RequirePackage{etoolbox}
  35.  
  36. % Include basic colors for editing notes
  37.  
  38. \RequirePackage[usenames,dvipsnames,svgnames,table]{xcolor}
  39.  
  40. % additional mandatory packages
  41.  
  42. \RequirePackage{amsmath}
  43. \RequirePackage{amsthm}
  44. \RequirePackage{thmtools}
  45. \RequirePackage[final]{graphicx}
  46. \RequirePackage[most]{tcolorbox}
  47. \RequirePackage[numbers,sort]{natbib}
  48.  
  49. % Theorem Styling
  50.  
  51. \declaretheorem[style=definition,qed=$\diamond$,
  52.    numberwithin=chapter]{definition}
  53. \declaretheorem[style=plain,qed=$\diamond$,
  54.    sibling=definition]{example}
  55. \declaretheorem[style=plain,numberwithin=chapter]{theorem}
  56. \declaretheorem[style=plain,numberwithin=chapter]{lemma}
  57.  
  58. % require the listings package for formatting source code
  59. % and define a new float environment for program listings
  60.  
  61. \RequirePackage{listings}
  62. \newfloat[chapter]{listing}{lol}{Listing}
  63.  
  64. % configure the format for program listings
  65.  
  66. \lstset{
  67.    basicstyle=\ttfamily\linespread{1.1}\lst@ifdisplaystyle\footnotesize\fi,
  68.    commentstyle=\ttfamily\itshape\linespread{1.1}\lst@ifdisplaystyle\footnotesize\fi,
  69.    mathescape=true,
  70.    showstringspaces=false,
  71.    keepspaces=true,
  72.    formfeed=\newpage,
  73.    tabsize=4,
  74.    columns=fullflexible,
  75.    xleftmargin=\parindent,
  76.    captionpos=b,
  77.    morecomment=[l]\%,
  78.    deletekeywords={history}
  79. }
  80.  
  81. % Basic Page Geometry
  82.  
  83. % Every page of your document must meet the margin requirements of 1.25
  84. % inches on the left and right, and 1 inch on the top and bottom. All
  85. % materials including appendices, if you choose to include them, must meet
  86. % the margin requirements.
  87.  
  88. % set the left and right margins as well as the textwidth
  89. \setlrmarginsandblock{1.25in}{1.25in}{*}
  90. \setulmarginsandblock{1.0in}{1.0in}{*}
  91. \setheaderspaces{*}{0.5\baselineskip}{*}
  92. \settrimmedsize{\stockheight}{\stockwidth}{*}
  93. \settrims{0pt}{0pt}
  94. \checkandfixthelayout[fixed]
  95. \sloppybottom
  96.  
  97. % Line Spacing
  98.  
  99. % All text must be double-spaced, except: block quotes, appendices,
  100. % table/figure captions, material in tables, footnotes, endnotes, reference
  101. % citations, and the optional biographical sketch. You must single-space
  102. % individual footnotes and reference entries, then double-space between
  103. % each note and entry.
  104.  
  105. % Set the spacing throughout the text to double space, but exclude
  106. % individual footnotes, captions, etc.
  107. \DoubleSpacing
  108.  
  109. \BeforeBeginEnvironment{quote}{\SingleSpacing}
  110. \AfterEndEnvironment{quote}{\vspace{-\baselineskip}\DoubleSpacing}
  111.  
  112. \BeforeBeginEnvironment{quotation}{\SingleSpacing}
  113. \AfterEndEnvironment{quotation}{\vspace{-\baselineskip}\DoubleSpacing}
  114.  
  115. \AtBeginEnvironment{thebibliography}{\SingleSpacing}
  116. \AtEndEnvironment{thebibliography}{\DoubleSpacing}
  117.  
  118. % Set the spacing between separate footnotes to be double spaced.
  119. \setlength{\footnotesep}{\baselineskip}
  120.  
  121. % Title Page Format
  122. %
  123. % To make the definition of the title page simpler, the class
  124. % provides the following commands to accept arguments from
  125. % within the main .tex file.
  126.  
  127. % \doctype defines the type of document (either thesis or dissertation)
  128. \newcommand{\doctype}[1]{\renewcommand{\@doctype}{#1}}
  129. \newcommand{\@doctype}{\tt$\backslash$\string doctype}
  130.  
  131. % \degree defines the type of degree being obtained
  132. \newcommand{\degreetype}[1]{\renewcommand{\@degreetype}{#1}}
  133. \newcommand{\@degreetype}{\tt$\backslash$\string degreetype}
  134.  
  135. % \defensemonth defines the month of the defense
  136. \newcommand{\defensemonth}[1]{\renewcommand{\@defensemonth}{#1}}
  137. \newcommand{\@defensemonth}{\tt$\backslash$\string defensemonth}
  138.  
  139. % \defensemonth defines the year of the defense
  140. \newcommand{\defenseyear}[1]{\renewcommand{\@defenseyear}{#1}}
  141. \newcommand{\@defenseyear}{\tt$\backslash$\string defenseyear}
  142.  
  143. % \gradmonth defines the month of graduation
  144. \newcommand{\gradmonth}[1]{\renewcommand{\@gradmonth}{#1}}
  145. \newcommand{\@gradmonth}{\tt$\backslash$\string gradmonth}
  146.  
  147. % \gradyear defines the year of graduation
  148. \newcommand{\gradyear}[1]{\renewcommand{\@gradyear}{#1}}
  149. \newcommand{\@gradyear}{\tt$\backslash$\string gradyear}
  150.  
  151. \newcommand{\chairlabel}{Chair}
  152.  
  153. % define the title page format
  154. \renewcommand\maketitle{
  155. \begin{titlingpage}
  156.    \centering
  157.    \@title \\
  158.    by \\
  159.    \@author \\
  160.    \vspace{5\baselineskip}
  161.    \begin{SingleSpace}
  162.    A \@doctype\ Presented in Partial Fulfillment\\
  163.     of the Requirement for the Degree\\
  164.     \@degreetype
  165.    \end{SingleSpace}
  166.    \vspace{5\baselineskip}
  167.    \begin{SingleSpace}
  168.    Approved \@defensemonth\ \@defenseyear\ by the\\
  169.    Graduate Supervisory Committee:\\[\baselineskip]
  170.    \renewcommand*{\do}[1]{##1, \chairlabel \\}
  171.    \dolistloop{\chairperson}
  172.    \renewcommand*{\do}[1]{##1 \\}
  173.    \dolistloop{\committeeperson}
  174.    \end{SingleSpace}
  175.    \vfill
  176.    ARIZONA STATE UNIVERSITY\\
  177.    \@gradmonth\ \@gradyear\\
  178. \end{titlingpage}
  179. }
  180.  
  181. % Copyright page
  182.  
  183. \newcommand{\copyrightpage}{
  184.    \thispagestyle{empty}
  185.    ~\\ \vfill
  186.    \begin{center}
  187.    \copyright\space\@gradyear\space\@author\\
  188.    All Rights Reserved
  189.    \end{center}
  190.    \clearpage
  191. }
  192.  
  193. % Abstract Styling
  194. %
  195. % The abstract title must be "ABSTRACT" in all caps, set in the same
  196. % font as the rest of the text.
  197.  
  198. \renewcommand{\abstractnamefont}{\normalfont}
  199.  
  200. % Acknowledgements definition and styling
  201.  
  202. \newenvironment{acknowledgments}{
  203.    \renewcommand{\abstractname}{ACKNOWLEDGMENTS}\abstract
  204. }{
  205.    \endabstract
  206. }
  207.  
  208. % Make sections and subsections numbered
  209.  
  210. \setsecnumdepth{all}
  211.  
  212. % Chapter Styling
  213.  
  214. \makechapterstyle{asu}{
  215.    \renewcommand*{\chapterheadstart}{}
  216.    \renewcommand*{\chapnamefont}{\normalfont}
  217.    \renewcommand*{\chapnumfont}{\normalfont}
  218.    \renewcommand*{\afterchapternum}{\\[\baselineskip]}
  219.    \renewcommand*{\chaptitlefont}{\normalfont}
  220.    \setlength{\afterchapskip}{\onelineskip}
  221.    \renewcommand*{\printchapternum}{
  222.        \centering \chapnumfont \thechapter
  223.    }
  224.    \renewcommand*{\printchaptertitle}[1]{
  225.        \expandafter\centering
  226.        \expandafter\chaptitlefont
  227.        \expandafter\MakeUppercase
  228.        \expandafter{##1}
  229.    }
  230. }
  231.  
  232. % Subsection Styling
  233.  
  234. \newcommand{\divisionbeforeskip}{\baselineskip}
  235. \newcommand{\divisionindent}{0.5em}
  236. \newcommand{\divisionfont}{\normalfont}
  237. \newcommand{\divisionafterskip}{\baselineskip}
  238.  
  239. \setbeforesecskip{\divisionbeforeskip}
  240. \setsecindent{\divisionindent}
  241. \setsecheadstyle{\divisionfont}
  242. \setaftersecskip{\divisionafterskip}
  243.  
  244. \setbeforesubsecskip{\divisionbeforeskip}
  245. \setsubsecindent{\divisionindent}
  246. \setsubsecheadstyle{\divisionfont}
  247. \setaftersubsecskip{\divisionafterskip}
  248.  
  249. \setbeforesubsubsecskip{\divisionbeforeskip}
  250. \setsubsubsecindent{\divisionindent}
  251. \setsubsubsecheadstyle{\divisionfont}
  252. \setaftersubsubsecskip{\divisionafterskip}
  253.  
  254. \setbeforeparaskip{\divisionbeforeskip}
  255. \setparaindent{\divisionindent}
  256. \setparaheadstyle{\divisionfont}
  257. \setafterparaskip{\divisionafterskip}
  258.  
  259. \setbeforesubparaskip{\divisionbeforeskip}
  260. \setsubparaindent{\divisionindent}
  261. \setsubparaheadstyle{\divisionfont}
  262. \setaftersubparaskip{\divisionafterskip}
  263.  
  264. % Page style
  265.  
  266. \makepagestyle{asu}
  267.    \makeevenfoot{asu}{}{\thepage}{}
  268.    \makeoddfoot{asu}{}{\thepage}{}
  269.  
  270. % Custom Section Names
  271. \AtBeginDocument{
  272.    \renewcommand{\contentsname}{TABLE OF CONTENTS}
  273.    \renewcommand{\listtablename}{LIST OF TABLES}
  274.    \renewcommand{\listfigurename}{LIST OF FIGURES}
  275.    \renewcommand{\abstractname}{ABSTRACT}
  276.    \renewcommand{\bibname}{REFERENCES}
  277.    \renewcommand{\appendixname}{APPENDIX}
  278. }
  279.  
  280. \addto\captionsenglish{
  281.    \renewcommand{\contentsname}{TABLE OF CONTENTS}
  282.    \renewcommand{\listtablename}{LIST OF TABLES}
  283.    \renewcommand{\listfigurename}{LIST OF FIGURES}
  284.    \renewcommand{\abstractname}{ABSTRACT}
  285.    \renewcommand{\bibname}{REFERENCES}
  286.    \renewcommand{\appendixname}{APPENDIX}
  287. }
  288.  
  289. % Table of Contents
  290.  
  291. \settocdepth{subparagraph}
  292. \cftpagenumbersoff{part}
  293.  
  294. % The table of contents must use the standard font and use all
  295. % capital letters for chapter titles or sections headings.
  296.  
  297. \setlength{\cftbeforepartskip}{0pt}
  298. \setlength{\cftbeforechapterskip}{0pt}
  299. \setlength{\cftbeforesectionskip}{0pt}
  300. \setlength{\cftbeforesubsectionskip}{0pt}
  301. \setlength{\cftbeforesubsubsectionskip}{0pt}
  302. \setlength{\cftbeforeparagraphskip}{0pt}
  303. \setlength{\cftbeforesubparagraphskip}{0pt}
  304. \setlength{\cftbeforefigureskip}{0pt}
  305. \setlength{\cftbeforetableskip}{0pt}
  306.  
  307. \renewcommand{\insertchapterspace}{}
  308.  
  309. \renewcommand{\chaptitlefont}{\normalfont}
  310. \renewcommand{\cftpartfont}{\normalfont\MakeUppercase}
  311. \renewcommand{\cftchapterfont}{\normalfont\MakeUppercase}
  312. \renewcommand{\cftchapterpagefont}{\normalfont}
  313. \renewcommand{\cftsectionpagefont}{\normalfont}
  314. \renewcommand{\cftsubsectionpagefont}{\normalfont}
  315. \renewcommand{\cftsubsubsectionpagefont}{\normalfont}
  316. \renewcommand{\cftsubsubsectionpagefont}{\normalfont}
  317. \renewcommand{\cftparagraphpagefont}{\normalfont}
  318. \renewcommand{\cftsubparagraphpagefont}{\normalfont}
  319. \renewcommand{\cftfigurepagefont}{\normalfont}
  320. \renewcommand{\cfttablepagefont}{\normalfont}
  321.  
  322. % level definitions for TOC
  323.  
  324. % Set indent to increase by the same amount for each level in the TOC;
  325. % don't adjust figure or table indents
  326. \newlength{\levelindentincrement}
  327. \setlength{\levelindentincrement}{2em}
  328. \newlength{\levelindent}
  329. \setlength{\levelindent}{\levelindentincrement}
  330. \setlength{\cftchapterindent}{\levelindent}
  331. \addtolength{\levelindent}{\levelindentincrement}
  332. \setlength{\cftsectionindent}{\levelindent}
  333. \addtolength{\levelindent}{\levelindentincrement}
  334. \setlength{\cftsubsectionindent}{\levelindent}
  335. \addtolength{\levelindent}{\levelindentincrement}
  336. \setlength{\cftsubsubsectionindent}{\levelindent}
  337. \addtolength{\levelindent}{\levelindentincrement}
  338. \setlength{\cftparagraphindent}{\levelindent}
  339. \addtolength{\levelindent}{\levelindentincrement}
  340. \setlength{\cftsubparagraphindent}{\levelindent}
  341. \addtolength{\levelindent}{\levelindentincrement}
  342.  
  343. % Define the pagestyle for regular TOC pages
  344. \copypagestyle{asu-toc}{asu}
  345.    \makeevenhead{asu-toc}{CHAPTER}{}{Page}
  346.    \makeoddhead{asu-toc}{CHAPTER}{}{Page}
  347.  
  348. % Define the pagestyle for the initial TOC page
  349. \copypagestyle{asu-toc-init}{asu}
  350.    \makeevenhead{asu-toc-init}{}{\printchaptertitle{\contentsname}}{}
  351.    \makeoddhead{asu-toc-init}{}{\printchaptertitle{\contentsname}}{}
  352.  
  353. \renewcommand{\tocheadstart}{}
  354. \renewcommand{\printtoctitle}[1]{}
  355.  
  356. \renewcommand{\aftertoctitle}{
  357.    \thispagestyle{asu-toc-init}
  358.    \hfill Page\par
  359. }
  360.  
  361. % List of Tables
  362.  
  363. \copypagestyle{asu-lot}{asu}
  364.    \makeevenhead{asu-lot}{Table}{}{Page}
  365.    \makeoddhead{asu-lot}{Table}{}{Page}
  366.  
  367. \copypagestyle{asu-lot-init}{asu}
  368.    \makeevenhead{asu-lot-init}{}{\printchaptertitle{\listtablename}}{}
  369.    \makeoddhead{asu-lot-init}{}{\printchaptertitle{\listtablename}}{}
  370.  
  371. \renewcommand{\lotheadstart}{}
  372. \renewcommand{\printlottitle}[1]{}
  373.  
  374. \renewcommand{\afterlottitle}{
  375.    \thispagestyle{asu-lot-init}
  376.    Table\hfill Page\par
  377. }
  378.  
  379. % List of Figures
  380.  
  381. \copypagestyle{asu-lof}{asu}
  382.    \makeevenhead{asu-lof}{Figure}{}{Page}
  383.    \makeoddhead{asu-lof}{Figure}{}{Page}
  384.  
  385. \copypagestyle{asu-lof-init}{asu}
  386.    \makeevenhead{asu-lof-init}{}{\printchaptertitle{\listfigurename}}{}
  387.    \makeoddhead{asu-lof-init}{}{\printchaptertitle{\listfigurename}}{}
  388.  
  389. \renewcommand{\lofheadstart}{}
  390. \renewcommand{\printloftitle}[1]{}
  391.  
  392. \renewcommand{\afterloftitle}{
  393.    \thispagestyle{asu-lof-init}
  394.    Figure\hfill Page\par
  395. }
  396.  
  397. % Configure the appendices
  398.  
  399. \BeforeBeginEnvironment{appendices}{
  400.    \addcontentsline{toc}{part}{Appendix}
  401.    \addtocontents{toc}{\protect\setcounter{tocdepth}{0}}
  402.    \makeatletter
  403.        \renewcommand{\memendofchapterhook}{
  404.            \clearpage
  405.            \m@mindentafterchapter
  406.            \@afterheading
  407.        }
  408.    \makeatother
  409. }
  410.  
  411. \AfterEndEnvironment{appendices}{
  412.    \makeatletter
  413.        \renewcommand{\memendofchapterhook}{
  414.        \m@mindentafterchapter
  415.        \@afterheading
  416.    }
  417.    \makeatother
  418. }
  419.  
  420. % define a command asutables to automatically generate the required
  421. % tables (LOF, LOT, and TOC) correctly
  422.  
  423. \newcommand{\asutables}{
  424.     % setup the table of contents
  425.     \clearpage
  426.     \pagestyle{asu-toc}
  427.     \tableofcontents*
  428.  
  429.     % setup the list of tables
  430.     \clearpage
  431.     \pagestyle{asu-lot}
  432.     \listoftables
  433.  
  434.     % setup the list of figures
  435.     \clearpage
  436.     \pagestyle{asu-lof}
  437.     \listoffigures
  438.  
  439.     % minor hack to get the TOC format right
  440.     \addcontentsline{toc}{part}{Chapter}
  441.    \clearpage
  442. }
Advertisement
Add Comment
Please, Sign In to add comment