Advertisement
Guest User

Untitled

a guest
Jan 31st, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 13.40 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}{
  116.    \renewcommand{\@memb@bchap}{
  117.        \part*{\bibname}%
  118.         \bibmark
  119.         \addcontentsline{toc}{part}{\bibname}
  120.        \prebibhook
  121.    }
  122. }
  123. \AtBeginEnvironment{thebibliography}{\SingleSpacing}
  124. \AtEndEnvironment{thebibliography}{\DoubleSpacing}
  125.  
  126. % Set the spacing between separate footnotes to be double spaced.
  127. \setlength{\footnotesep}{\baselineskip}
  128.  
  129. % Title Page Format
  130. %
  131. % To make the definition of the title page simpler, the class
  132. % provides the following commands to accept arguments from
  133. % within the main .tex file.
  134.  
  135. % \doctype defines the type of document (either thesis or dissertation)
  136. \newcommand{\doctype}[1]{\renewcommand{\@doctype}{#1}}
  137. \newcommand{\@doctype}{\tt$\backslash$\string doctype}
  138.  
  139. % \degree defines the type of degree being obtained
  140. \newcommand{\degreetype}[1]{\renewcommand{\@degreetype}{#1}}
  141. \newcommand{\@degreetype}{\tt$\backslash$\string degreetype}
  142.  
  143. % \defensemonth defines the month of the defense
  144. \newcommand{\defensemonth}[1]{\renewcommand{\@defensemonth}{#1}}
  145. \newcommand{\@defensemonth}{\tt$\backslash$\string defensemonth}
  146.  
  147. % \defensemonth defines the year of the defense
  148. \newcommand{\defenseyear}[1]{\renewcommand{\@defenseyear}{#1}}
  149. \newcommand{\@defenseyear}{\tt$\backslash$\string defenseyear}
  150.  
  151. % \gradmonth defines the month of graduation
  152. \newcommand{\gradmonth}[1]{\renewcommand{\@gradmonth}{#1}}
  153. \newcommand{\@gradmonth}{\tt$\backslash$\string gradmonth}
  154.  
  155. % \gradyear defines the year of graduation
  156. \newcommand{\gradyear}[1]{\renewcommand{\@gradyear}{#1}}
  157. \newcommand{\@gradyear}{\tt$\backslash$\string gradyear}
  158.  
  159. \newcommand{\chairlabel}{Chair}
  160.  
  161. % define the title page format
  162. \renewcommand\maketitle{
  163. \begin{titlingpage}
  164.    \centering
  165.    \@title \\
  166.    by \\
  167.    \@author \\
  168.    \vspace{5\baselineskip}
  169.    \begin{SingleSpace}
  170.    A \@doctype\ Presented in Partial Fulfillment\\
  171.     of the Requirement for the Degree\\
  172.     \@degreetype
  173.    \end{SingleSpace}
  174.    \vspace{5\baselineskip}
  175.    \begin{SingleSpace}
  176.    Approved \@defensemonth\ \@defenseyear\ by the\\
  177.    Graduate Supervisory Committee:\\[\baselineskip]
  178.    \renewcommand*{\do}[1]{##1, \chairlabel \\}
  179.    \dolistloop{\chairperson}
  180.    \renewcommand*{\do}[1]{##1 \\}
  181.    \dolistloop{\committeeperson}
  182.    \end{SingleSpace}
  183.    \vfill
  184.    ARIZONA STATE UNIVERSITY\\
  185.    \@gradmonth\ \@gradyear\\
  186. \end{titlingpage}
  187. }
  188.  
  189. % Copyright page
  190.  
  191. \newcommand{\copyrightpage}{
  192.    \thispagestyle{empty}
  193.    ~\\ \vfill
  194.    \begin{center}
  195.    \copyright\space\@gradyear\space\@author\\
  196.    All Rights Reserved
  197.    \end{center}
  198.    \clearpage
  199. }
  200.  
  201. % Abstract Styling
  202. %
  203. % The abstract title must be "ABSTRACT" in all caps, set in the same
  204. % font as the rest of the text.
  205.  
  206. \renewcommand{\abstractnamefont}{\normalfont}
  207.  
  208. % Acknowledgements definition and styling
  209.  
  210. \newenvironment{acknowledgments}{
  211.    \renewcommand{\abstractname}{ACKNOWLEDGMENTS}\abstract
  212. }{
  213.    \endabstract
  214. }
  215.  
  216. % Make sections and subsections numbered
  217.  
  218. \setsecnumdepth{all}
  219.  
  220. % Chapter Styling
  221.  
  222. \makechapterstyle{asu}{
  223.    \renewcommand*{\chapterheadstart}{}
  224.    \renewcommand*{\chapnamefont}{\normalfont}
  225.    \renewcommand*{\chapnumfont}{\normalfont}
  226.    \renewcommand*{\afterchapternum}{\\[\baselineskip]}
  227.    \renewcommand*{\chaptitlefont}{\normalfont}
  228.    \setlength{\afterchapskip}{\onelineskip}
  229.    \renewcommand*{\printchapternum}{
  230.        \centering \chapnumfont \thechapter
  231.    }
  232.    \renewcommand*{\printchaptertitle}[1]{
  233.        \expandafter\centering
  234.        \expandafter\chaptitlefont
  235.        \expandafter\MakeUppercase
  236.        \expandafter{##1}
  237.    }
  238. }
  239.  
  240. % Subsection Styling
  241.  
  242. \newcommand{\divisionbeforeskip}{\baselineskip}
  243. \newcommand{\divisionindent}{0.5em}
  244. \newcommand{\divisionfont}{\normalfont}
  245. \newcommand{\divisionafterskip}{\baselineskip}
  246.  
  247. \setbeforesecskip{\divisionbeforeskip}
  248. \setsecindent{\divisionindent}
  249. \setsecheadstyle{\divisionfont}
  250. \setaftersecskip{\divisionafterskip}
  251.  
  252. \setbeforesubsecskip{\divisionbeforeskip}
  253. \setsubsecindent{\divisionindent}
  254. \setsubsecheadstyle{\divisionfont}
  255. \setaftersubsecskip{\divisionafterskip}
  256.  
  257. \setbeforesubsubsecskip{\divisionbeforeskip}
  258. \setsubsubsecindent{\divisionindent}
  259. \setsubsubsecheadstyle{\divisionfont}
  260. \setaftersubsubsecskip{\divisionafterskip}
  261.  
  262. \setbeforeparaskip{\divisionbeforeskip}
  263. \setparaindent{\divisionindent}
  264. \setparaheadstyle{\divisionfont}
  265. \setafterparaskip{\divisionafterskip}
  266.  
  267. \setbeforesubparaskip{\divisionbeforeskip}
  268. \setsubparaindent{\divisionindent}
  269. \setsubparaheadstyle{\divisionfont}
  270. \setaftersubparaskip{\divisionafterskip}
  271.  
  272. % Page style
  273.  
  274. \makepagestyle{asu}
  275.    \makeevenfoot{asu}{}{\thepage}{}
  276.    \makeoddfoot{asu}{}{\thepage}{}
  277.  
  278. % Custom Section Names
  279. \AtBeginDocument{
  280.    \renewcommand{\contentsname}{TABLE OF CONTENTS}
  281.    \renewcommand{\listtablename}{LIST OF TABLES}
  282.    \renewcommand{\listfigurename}{LIST OF FIGURES}
  283.    \renewcommand{\abstractname}{ABSTRACT}
  284.    \renewcommand{\bibname}{REFERENCES}
  285.    \renewcommand{\appendixname}{APPENDIX}
  286. }
  287.  
  288. \addto\captionsenglish{
  289.    \renewcommand{\contentsname}{TABLE OF CONTENTS}
  290.    \renewcommand{\listtablename}{LIST OF TABLES}
  291.    \renewcommand{\listfigurename}{LIST OF FIGURES}
  292.    \renewcommand{\abstractname}{ABSTRACT}
  293.    \renewcommand{\bibname}{REFERENCES}
  294.    \renewcommand{\appendixname}{APPENDIX}
  295. }
  296.  
  297. % Table of Contents
  298.  
  299. \settocdepth{subparagraph}
  300. \cftpagenumbersoff{part}
  301.  
  302. % The table of contents must use the standard font and use all
  303. % capital letters for chapter titles or sections headings.
  304.  
  305. \setlength{\cftbeforepartskip}{0pt}
  306. \setlength{\cftbeforechapterskip}{0pt}
  307. \setlength{\cftbeforesectionskip}{0pt}
  308. \setlength{\cftbeforesubsectionskip}{0pt}
  309. \setlength{\cftbeforesubsubsectionskip}{0pt}
  310. \setlength{\cftbeforeparagraphskip}{0pt}
  311. \setlength{\cftbeforesubparagraphskip}{0pt}
  312. \setlength{\cftbeforefigureskip}{0pt}
  313. \setlength{\cftbeforetableskip}{0pt}
  314.  
  315. \renewcommand{\insertchapterspace}{}
  316.  
  317. \renewcommand{\chaptitlefont}{\normalfont}
  318. \renewcommand{\cftpartfont}{\normalfont\MakeUppercase}
  319. \renewcommand{\cftchapterfont}{\normalfont\MakeUppercase}
  320. \renewcommand{\cftchapterpagefont}{\normalfont}
  321. \renewcommand{\cftsectionpagefont}{\normalfont}
  322. \renewcommand{\cftsubsectionpagefont}{\normalfont}
  323. \renewcommand{\cftsubsubsectionpagefont}{\normalfont}
  324. \renewcommand{\cftsubsubsectionpagefont}{\normalfont}
  325. \renewcommand{\cftparagraphpagefont}{\normalfont}
  326. \renewcommand{\cftsubparagraphpagefont}{\normalfont}
  327. \renewcommand{\cftfigurepagefont}{\normalfont}
  328. \renewcommand{\cfttablepagefont}{\normalfont}
  329.  
  330. % level definitions for TOC
  331.  
  332. % Set indent to increase by the same amount for each level in the TOC;
  333. % don't adjust figure or table indents
  334. \newlength{\levelindentincrement}
  335. \setlength{\levelindentincrement}{2em}
  336. \newlength{\levelindent}
  337. \setlength{\levelindent}{\levelindentincrement}
  338. \setlength{\cftchapterindent}{\levelindent}
  339. \addtolength{\levelindent}{\levelindentincrement}
  340. \setlength{\cftsectionindent}{\levelindent}
  341. \addtolength{\levelindent}{\levelindentincrement}
  342. \setlength{\cftsubsectionindent}{\levelindent}
  343. \addtolength{\levelindent}{\levelindentincrement}
  344. \setlength{\cftsubsubsectionindent}{\levelindent}
  345. \addtolength{\levelindent}{\levelindentincrement}
  346. \setlength{\cftparagraphindent}{\levelindent}
  347. \addtolength{\levelindent}{\levelindentincrement}
  348. \setlength{\cftsubparagraphindent}{\levelindent}
  349. \addtolength{\levelindent}{\levelindentincrement}
  350.  
  351. % Define the pagestyle for regular TOC pages
  352. \copypagestyle{asu-toc}{asu}
  353.    \makeevenhead{asu-toc}{CHAPTER}{}{Page}
  354.    \makeoddhead{asu-toc}{CHAPTER}{}{Page}
  355.  
  356. % Define the pagestyle for the initial TOC page
  357. \copypagestyle{asu-toc-init}{asu}
  358.    \makeevenhead{asu-toc-init}{}{\printchaptertitle{\contentsname}}{}
  359.    \makeoddhead{asu-toc-init}{}{\printchaptertitle{\contentsname}}{}
  360.  
  361. \renewcommand{\tocheadstart}{}
  362. \renewcommand{\printtoctitle}[1]{}
  363.  
  364. \renewcommand{\aftertoctitle}{
  365.    \thispagestyle{asu-toc-init}
  366.    \hfill Page\par
  367. }
  368.  
  369. % List of Tables
  370.  
  371. \copypagestyle{asu-lot}{asu}
  372.    \makeevenhead{asu-lot}{Table}{}{Page}
  373.    \makeoddhead{asu-lot}{Table}{}{Page}
  374.  
  375. \copypagestyle{asu-lot-init}{asu}
  376.    \makeevenhead{asu-lot-init}{}{\printchaptertitle{\listtablename}}{}
  377.    \makeoddhead{asu-lot-init}{}{\printchaptertitle{\listtablename}}{}
  378.  
  379. \renewcommand{\lotheadstart}{}
  380. \renewcommand{\printlottitle}[1]{}
  381.  
  382. \renewcommand{\afterlottitle}{
  383.    \thispagestyle{asu-lot-init}
  384.    Table\hfill Page\par
  385. }
  386.  
  387. % List of Figures
  388.  
  389. \copypagestyle{asu-lof}{asu}
  390.    \makeevenhead{asu-lof}{Figure}{}{Page}
  391.    \makeoddhead{asu-lof}{Figure}{}{Page}
  392.  
  393. \copypagestyle{asu-lof-init}{asu}
  394.    \makeevenhead{asu-lof-init}{}{\printchaptertitle{\listfigurename}}{}
  395.    \makeoddhead{asu-lof-init}{}{\printchaptertitle{\listfigurename}}{}
  396.  
  397. \renewcommand{\lofheadstart}{}
  398. \renewcommand{\printloftitle}[1]{}
  399.  
  400. \renewcommand{\afterloftitle}{
  401.    \thispagestyle{asu-lof-init}
  402.    Figure\hfill Page\par
  403. }
  404.  
  405. % Configure the appendices
  406.  
  407. \BeforeBeginEnvironment{appendices}{
  408.    \addcontentsline{toc}{part}{Appendix}
  409.    \addtocontents{toc}{\protect\setcounter{tocdepth}{0}}
  410.    \makeatletter
  411.        \renewcommand{\memendofchapterhook}{
  412.            \clearpage
  413.            \m@mindentafterchapter
  414.            \@afterheading
  415.        }
  416.    \makeatother
  417. }
  418.  
  419. \AfterEndEnvironment{appendices}{
  420.    \makeatletter
  421.        \renewcommand{\memendofchapterhook}{
  422.        \m@mindentafterchapter
  423.        \@afterheading
  424.    }
  425.    \makeatother
  426. }
  427.  
  428. % define a command asutables to automatically generate the required
  429. % tables (LOF, LOT, and TOC) correctly
  430.  
  431. \newcommand{\asutables}{
  432.     % setup the table of contents
  433.     \clearpage
  434.     \pagestyle{asu-toc}
  435.     \tableofcontents*
  436.  
  437.     % setup the list of tables
  438.     \clearpage
  439.     \pagestyle{asu-lot}
  440.     \listoftables
  441.  
  442.     % setup the list of figures
  443.     \clearpage
  444.     \pagestyle{asu-lof}
  445.     \listoffigures
  446.  
  447.     % minor hack to get the TOC format right
  448.     \addcontentsline{toc}{part}{Chapter}
  449.    \clearpage
  450. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement