SHARE
TWEET

ASU Style File

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