Advertisement
mago_nick

thesis.cls

Jul 1st, 2015
522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 16.95 KB | None | 0 0
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. % Thesis LaTeX Template - THESIS CLASS FILE
  3. %
  4. % This template has been downloaded from:
  5. % http://www.latextemplates.com
  6. %
  7. % This class file defines the structure and design of the template.
  8. %
  9. % There is one part of this file that needs to be filled out - the variables
  10. % dictating the document particulars such as the author name, university
  11. % name, etc. You will find these in the commented "DOCUMENT VARIABLES"
  12. % section below.
  13. %
  14. % The other two easily-editable sections are the margin sizes and abstract.
  15. % These have both been commented for easy editing. Advanced LaTeX
  16. % users will have no trouble editing the rest of the document to their liking.
  17. %
  18. % Original header:
  19. %% This is file `Thesis.cls', based on 'ECSthesis.cls', by Steve R. Gunn
  20. %% generated with the docstrip utility.
  21. %%
  22. %% Created by Steve R. Gunn, modified by Sunil Patel: www.sunilpatel.co.uk
  23. %% Further modified by www.latextemplates.com
  24. %
  25. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  26.  
  27. \NeedsTeXFormat{LaTeX2e}[1996/12/01]
  28. \ProvidesClass{Thesis}
  29.              [2007/22/02 v1.0
  30.   LaTeX document class]
  31. \def\baseclass{book}
  32. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}
  33. \def\@checkoptions#1#2{
  34.  \edef\@curroptions{\@ptionlist{\@currname.\@currext}}
  35.  \@tempswafalse
  36.  \@tfor\@this:=#2\do{
  37.    \@expandtwoargs\in@{,\@this,}{,\@curroptions,}
  38.    \ifin@ \@tempswatrue \@break@tfor \fi}
  39.  \let\@this\@empty
  40.  \if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi
  41. }
  42. \@checkoptions{11pt}{{10pt}{11pt}{12pt}}
  43. \PassOptionsToClass{a4paper}{\baseclass}
  44. \ProcessOptions\relax
  45. \LoadClass{\baseclass}
  46. \newcommand\bhrule{\typeout{------------------------------------------------------------------------------}}
  47.  
  48. \newcommand\Declaration[1]{
  49. \btypeout{Declaration of Authorship}
  50. \addtotoc{Declaration of Authorship}
  51. \thispagestyle{plain}
  52. \null\vfil
  53. %\vskip 60\p@
  54. \begin{center}{\huge\bf Declaration of Authorship\par}\end{center}
  55. %\vskip 60\p@
  56. {\normalsize #1}
  57. \vfil\vfil\null
  58. %\cleardoublepage
  59. }
  60.  
  61. \newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule}
  62. \def\today{\ifcase\month\or
  63.  January\or February\or March\or April\or May\or June\or
  64.  July\or August\or September\or October\or November\or December\fi
  65.  \space \number\year}
  66. \usepackage{setspace}
  67. \onehalfspacing
  68. \setlength{\parindent}{15pt}
  69. \setlength{\parskip}{0.0ex plus0.5ex minus0.2ex}
  70. \usepackage{vmargin}
  71.  
  72. \RequirePackage[utf8]{inputenc} % Allows the use of international characters (e.g. Umlauts)
  73.  
  74. %----------------------------------------------------------------------------------------
  75. %   MARGINS
  76. %----------------------------------------------------------------------------------------
  77. \setmarginsrb  { 1.5in}  % left margin
  78.                         { 0.6in}  % top margin
  79.                         { 1.0in}  % right margin
  80.                         { 0.8in}  % bottom margin
  81.                         {  20pt}  % head height
  82.                         {0.25in}  % head sep
  83.                         {   9pt}  % foot height
  84.                         { 0.3in}  % foot sep
  85. %----------------------------------------------------------------------------------------
  86. \raggedbottom
  87. \setlength{\topskip}{1\topskip \@plus 5\p@}
  88. \doublehyphendemerits=10000       % No consecutive line hyphens.
  89. \brokenpenalty=10000              % No broken words across columns/pages.
  90. \widowpenalty=9999                % Almost no widows at bottom of page.
  91. \clubpenalty=9999                 % Almost no orphans at top of page.
  92. \interfootnotelinepenalty=9999    % Almost never break footnotes.
  93. \usepackage{fancyhdr}
  94. %\lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}}
  95. %\rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage}
  96. %\chead{}
  97. %\lfoot{}
  98. %\rfoot{}
  99. %\cfoot{}
  100. %\pagestyle{fancy}
  101. \renewcommand{\chaptermark}[1]{\btypeout{\thechapter\space #1}\markboth{\@chapapp\ \thechapter\ #1}{\@chapapp\ \thechapter\ #1}}
  102. \renewcommand{\sectionmark}[1]{}
  103. \renewcommand{\subsectionmark}[1]{}
  104. \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
  105. \hbox{}
  106. \thispagestyle{empty}
  107. \newpage
  108. \if@twocolumn\hbox{}\newpage\fi\fi\fi}
  109. \usepackage{amsmath,amsfonts,amssymb,amscd,amsthm,xspace}
  110. \theoremstyle{plain}
  111. \newtheorem{example}{Example}[chapter]
  112. \newtheorem{theorem}{Theorem}[chapter]
  113. \newtheorem{corollary}[theorem]{Corollary}
  114. \newtheorem{lemma}[theorem]{Lemma}
  115. \newtheorem{proposition}[theorem]{Proposition}
  116. \newtheorem{axiom}[theorem]{Axiom}
  117. \theoremstyle{plain}
  118. \newtheorem{definition}[theorem]{Definition}
  119. \theoremstyle{remark}
  120. \newtheorem{remark}[theorem]{Remark}
  121. \usepackage[small,bf,format=plain,indention=0pt,labelsep=quad]{caption}
  122. \setlength{\captionmargin}{20pt}
  123. \newcommand{\fref}[1]{Figure~\ref{#1}}
  124. \newcommand{\tref}[1]{Table~\ref{#1}}
  125. \newcommand{\eref}[1]{Equation~\ref{#1}}
  126. \newcommand{\cref}[1]{Chapter~\ref{#1}}
  127. \newcommand{\sref}[1]{Section~\ref{#1}}
  128. \newcommand{\aref}[1]{Appendix~\ref{#1}}
  129. \renewcommand{\topfraction}{0.85}
  130. \renewcommand{\bottomfraction}{.85}
  131. \renewcommand{\textfraction}{0.1}
  132. \renewcommand{\dbltopfraction}{.85}
  133. \renewcommand{\floatpagefraction}{0.75}
  134. \renewcommand{\dblfloatpagefraction}{.75}
  135. \setcounter{topnumber}{9}
  136. \setcounter{bottomnumber}{9}
  137. \setcounter{totalnumber}{20}
  138. \setcounter{dbltopnumber}{9}
  139. \usepackage{graphicx}
  140. \usepackage{epstopdf}
  141. \usepackage[scriptsize]{subfigure}
  142. \usepackage{booktabs}
  143. \usepackage{rotating}
  144. \usepackage{listings}
  145. \usepackage{lstpatch}
  146. \lstset{captionpos=b,
  147.        frame=tb,
  148.        basicstyle=\scriptsize\ttfamily,
  149.        showstringspaces=false,
  150.        keepspaces=true}
  151. \lstdefinestyle{matlab} {
  152.        language=Matlab,
  153.        keywordstyle=\color{blue},
  154.        commentstyle=\color[rgb]{0.13,0.55,0.13}\em,
  155.        stringstyle=\color[rgb]{0.7,0,0} }
  156. \usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,
  157.   bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=false,
  158.   colorlinks,linkcolor={black},citecolor={black},urlcolor={red},
  159.   pdfstartview={FitV},unicode,breaklinks=true]{hyperref}
  160. \pdfstringdefDisableCommands{
  161.   \let\\\space
  162. }
  163. \newcommand*{\supervisor}[1]{\def\supname{#1}}
  164. \newcommand*{\thesistitle}[1]{\def\ttitle{#1}}
  165. \newcommand*{\examiner}[1]{\def\examname{#1}}
  166. \newcommand*{\degree}[1]{\def\degreename{#1}}
  167. \newcommand*{\authors}[1]{\def\authornames{#1}}
  168. \newcommand*{\addresses}[1]{\def\addressnames{#1}}
  169. \newcommand*{\university}[1]{\def\univname{#1}}
  170. \newcommand*{\UNIVERSITY}[1]{\def\UNIVNAME{#1}}
  171. \newcommand*{\department}[1]{\def\deptname{#1}}
  172. \newcommand*{\DEPARTMENT}[1]{\def\DEPTNAME{#1}}
  173. \newcommand*{\group}[1]{\def\groupname{#1}}
  174. \newcommand*{\GROUP}[1]{\def\GROUPNAME{#1}}
  175. \newcommand*{\faculty}[1]{\def\facname{#1}}
  176. \newcommand*{\FACULTY}[1]{\def\FACNAME{#1}}
  177. \newcommand*{\subject}[1]{\def\subjectname{#1}}
  178. \newcommand*{\keywords}[1]{\def\keywordnames{#1}}
  179.  
  180. %----------------------------------------------------------------------------------------
  181. %   DOCUMENT VARIABLES
  182. %   Fill in the lines below to update the thesis template
  183. %   If you wish to cite each of the variables defined below, look at the
  184. %   section above for the citation command e.g. \examiner{} below is
  185. %   defined as \examname above so you cite it as \examname
  186. %----------------------------------------------------------------------------------------
  187.  
  188. \thesistitle{Thesis Title}
  189. % Your thesis title - this is used in the title and abstract
  190. %-------------------------------------------------  
  191. \supervisor{Prof. \textsc{Giuseppe Oriolo}} % You supervisor's name - this is used in the title page
  192. %-------------------------------------------------  
  193. \examiner{} % Your examiner's name - this is not currently used anywhere in the template, cite it with \examname if you want it
  194. %-------------------------------------------------  
  195. \degree{Master in Artificial Intelligence and Robotics}
  196. % Your degree name - this is currently used in the title page and abstract
  197. %-------------------------------------------------  
  198. \authors{\textsc{Andrea Nicastro}} % Your name - this is used in the title page and abstract
  199. %-------------------------------------------------  
  200. \addresses{} % Your address - this is not currently used anywhere in the template, cite it with \addressnames if you want it
  201. %-------------------------------------------------  
  202. \subject{} % Your subject area - this is not currently used anywhere in the template, cite it with \subjectname if you want it
  203. %-------------------------------------------------  
  204. \keywords{} % Keywords for your thesis - this is not currently used anywhere in the template, cite it with \keywordnames if you want it
  205. %-------------------------------------------------  
  206. \university{\texorpdfstring{%\href{http://www.uniroma1.it} % Your university's URL
  207.                 {Sapienza University of Rome}} % Your university's name - this is currently used in the title page
  208.                 {University Name}}
  209. %-------------------------------------------------  
  210. \UNIVERSITY{\texorpdfstring{\href{University Web Site URL Here (include http://)} % Your university's URL
  211.                 {SAPIENZA UNIVERSITY OF ROME}} % Your university's name in capitals - this is currently used in the abstract page
  212.                 {UNIVERSITY NAME (IN BLOCK CAPITALS)}}
  213. %-------------------------------------------------                
  214. \department{\texorpdfstring{%\href{Department or School Web Site URL Here (include http://)} % Your department's URL
  215.                 {Dipartimento di Ingegneria Informatica\\Automatica e Gestionale Antonio Ruberti}}
  216.                 % Your department's name - used in the title page and abstract
  217.                 {Department or School Name}}
  218. %-------------------------------------------------                
  219. \DEPARTMENT{\texorpdfstring{\href{Department or School Web Site URL Here (include http://)} % Your department's URL
  220.                 {DIPARTIMENTO DI INGENGNERIA INFORMATICA\\ AUTOMATICA E GESTIONALE}} % Your department's name in capitals - this is not currently used anywhere in the template, cite it with \DEPTNAME if you want it
  221.                 {DEPARTMENT OR SCHOOL NAME (IN BLOCK CAPITALS)}}
  222. %-------------------------------------------------                
  223. \group{\texorpdfstring{%\href{Research Group Web Site URL Here (include http://)} % Your research group's URL
  224.                 {Laboratorio di Robotica}} % Your research group's name - this is currently used in the title page
  225.                 {Research Group Name}}
  226. %-------------------------------------------------                
  227. \GROUP{\texorpdfstring{\href{Research Group Web Site URL Here (include http://)} % Your research group's URL
  228.                 {RESEARCH GROUP NAME (IN BLOCK CAPITALS)}} % Your research group's name in capitals - this is not currently used anywhere in the template, cite it with \GROUPNAME if you want it
  229.                 {RESEARCH GROUP NAME (IN BLOCK CAPITALS)}}
  230. %-------------------------------------------------                
  231. \faculty{\texorpdfstring{\href{Faculty Web Site URL Here (include http://)} % Your faculty's URL
  232.                 {Faculty Name}} % Your faculty's name - this is currently used in the abstract page
  233.                 {Faculty Name}}
  234. %-------------------------------------------------                
  235. \FACULTY{\texorpdfstring{\href{Faculty Web Site URL Here (include http://)} % Your faculty's URL
  236.                 {FACULTY NAME (IN BLOCK CAPITALS)}} % Your faculty's name in capitals - this is not currently used anywhere in the template, cite it with \FACNAME if you want it
  237.                 {FACULTY NAME (IN BLOCK CAPITALS)}}
  238. %----------------------------------------------------------------------------------------    
  239.  
  240. % The default title page, this is not used in this www.latextemplates.com version            
  241. \renewcommand\maketitle{
  242.  \btypeout{Title Page}
  243.  \hypersetup{pdftitle={\@title}}
  244.  \hypersetup{pdfsubject=\subjectname}
  245.  \hypersetup{pdfauthor=\authornames}
  246.  \hypersetup{pdfkeywords=\keywordnames}
  247.  \thispagestyle{empty}
  248.  \begin{titlepage}
  249.    \let\footnotesize\small
  250.    \let\footnoterule\relax
  251.    \let \footnote \thanks
  252.    \setcounter{footnote}{0}
  253.    \null\vfil
  254.    \vskip 60\p@
  255.    \begin{center}
  256.      \setlength{\parskip}{0pt}
  257.      {\large\textbf{\UNIVNAME}\par}
  258.      \vfill
  259.      {\huge \bf \@title \par}
  260.      \vfill
  261.      {\LARGE by \par}
  262.      \smallskip
  263.      {\LARGE \authornames \par}
  264.      \vfill
  265.      {\large A thesis submitted in partial fulfillment for the \par}
  266.      {\large degree of \degreename \par}
  267.      \bigskip
  268.      \bigskip
  269.      {\large in the \par}
  270.      {\large \facname \par}
  271.      {\large \deptname \par}
  272.      \bigskip
  273.      \bigskip
  274.      \bigskip
  275.      {\Large \@date \par}
  276.      \bigskip
  277.    \end{center}
  278.    \par
  279.    \@thanks
  280.    \vfil\null
  281.  \end{titlepage}
  282.  \setcounter{footnote}{0}%
  283.   \global\let\thanks\relax
  284.   \global\let\maketitle\relax
  285.   \global\let\@thanks\@empty
  286.   \global\let\@author\@empty
  287.   \global\let\@date\@empty
  288.   \global\let\@title\@empty
  289.   \global\let\title\relax
  290.   \global\let\author\relax
  291.   \global\let\date\relax
  292.   \global\let\and\relax
  293.   \cleardoublepage
  294. }
  295. %----------------------------------------------------------------------------------------
  296. %   ABSTRACT PAGE DESIGN
  297. %----------------------------------------------------------------------------------------
  298. \newenvironment{abstract}
  299. {
  300.  \btypeout{Abstract Page}
  301.  \thispagestyle{empty}
  302.  \null\vfil
  303.  \begin{center}
  304.    \setlength{\parskip}{0pt}
  305.    {\normalsize \UNIVNAME \par} % University name in capitals
  306.     \bigskip
  307.     {\huge{\textit{Abstract}} \par}
  308.    \bigskip
  309.    {\normalsize \facname \par} % Faculty name
  310.     {\normalsize \deptname \par} % Department name
  311.     \bigskip
  312.     {\normalsize \degreename\par} % Degree name
  313.     \bigskip
  314.     {\normalsize\bf \@title \par} % Thesis title
  315.     \medskip
  316.     {\normalsize by \authornames \par} % Author name
  317.     \bigskip
  318.   \end{center}
  319. }
  320. %----------------------------------------------------------------------------------------
  321. {
  322.  \vfil\vfil\vfil\null
  323.  \cleardoublepage
  324. }
  325. \addtocounter{secnumdepth}{1}
  326. \setcounter{tocdepth}{6}
  327. \newcounter{dummy}
  328. \newcommand\addtotoc[1]{
  329. \refstepcounter{dummy}
  330. \addcontentsline{toc}{chapter}{#1}}
  331. \renewcommand\tableofcontents{
  332. \btypeout{Table of Contents}
  333. \addtotoc{Contents}
  334. \begin{spacing}{1}{
  335.    \setlength{\parskip}{1pt}
  336.    \if@twocolumn
  337.      \@restonecoltrue\onecolumn
  338.    \else
  339.      \@restonecolfalse
  340.    \fi
  341.    \chapter*{\contentsname
  342.        \@mkboth{
  343.           \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
  344.    \@starttoc{toc}
  345.    \if@restonecol\twocolumn\fi
  346.   \cleardoublepage
  347. }\end{spacing}
  348. }
  349. \renewcommand\listoffigures{
  350. \btypeout{List of Figures}
  351. \addtotoc{List of Figures}
  352. \begin{spacing}{1}{
  353.    \setlength{\parskip}{1pt}
  354.    \if@twocolumn
  355.      \@restonecoltrue\onecolumn
  356.    \else
  357.      \@restonecolfalse
  358.    \fi
  359.    \chapter*{\listfigurename
  360.      \@mkboth{\MakeUppercase\listfigurename}
  361.              {\MakeUppercase\listfigurename}}
  362.    \@starttoc{lof}
  363.    \if@restonecol\twocolumn\fi
  364.    \cleardoublepage
  365. }\end{spacing}
  366. }
  367. \renewcommand\listoftables{
  368. \btypeout{List of Tables}
  369. \addtotoc{List of Tables}
  370. \begin{spacing}{1}{
  371.    \setlength{\parskip}{1pt}
  372.    \if@twocolumn
  373.      \@restonecoltrue\onecolumn
  374.    \else
  375.      \@restonecolfalse
  376.    \fi
  377.    \chapter*{\listtablename
  378.      \@mkboth{
  379.          \MakeUppercase\listtablename}{\MakeUppercase\listtablename}}
  380.    \@starttoc{lot}
  381.    \if@restonecol\twocolumn\fi
  382.    \cleardoublepage
  383. }\end{spacing}
  384. }
  385. \newcommand\listsymbolname{Abbreviations}
  386. \usepackage{longtable}
  387. \newcommand\listofsymbols[2]{
  388. \btypeout{\listsymbolname}
  389. \addtotoc{\listsymbolname}
  390.    \chapter*{\listsymbolname
  391.      \@mkboth{
  392.          \MakeUppercase\listsymbolname}{\MakeUppercase\listsymbolname}}
  393. \begin{longtable}[c]{#1}#2\end{longtable}\par
  394.    \cleardoublepage
  395. }
  396. \newcommand\listconstants{Physical Constants}
  397. \usepackage{longtable}
  398. \newcommand\listofconstants[2]{
  399. \btypeout{\listconstants}
  400. \addtotoc{\listconstants}
  401.    \chapter*{\listconstants
  402.      \@mkboth{
  403.          \MakeUppercase\listconstants}{\MakeUppercase\listconstants}}
  404. \begin{longtable}[c]{#1}#2\end{longtable}\par
  405.    \cleardoublepage
  406. }
  407. \newcommand\listnomenclature{Symbols}
  408. \usepackage{longtable}
  409. \newcommand\listofnomenclature[2]{
  410. \btypeout{\listnomenclature}
  411. \addtotoc{\listnomenclature}
  412.    \chapter*{\listnomenclature
  413.      \@mkboth{
  414.          \MakeUppercase\listnomenclature}{\MakeUppercase\listnomenclature}}
  415. \begin{longtable}[c]{#1}#2\end{longtable}\par
  416.    \cleardoublepage
  417. }
  418. \newcommand\acknowledgements[1]{
  419. \btypeout{Acknowledgements}
  420. \addtotoc{Acknowledgements}
  421. \thispagestyle{plain}
  422. \begin{center}{\huge{\textit{Acknowledgements}} \par}\end{center}
  423. {\normalsize #1}
  424. \vfil\vfil\null
  425.  
  426. }
  427. \newcommand\dedicatory[1]{
  428. \btypeout{Dedicatory}
  429. \thispagestyle{plain}
  430. \null\vfil
  431. \vskip 60\p@
  432. \begin{center}{\Large \sl #1}\end{center}
  433. \vfil\null
  434. \cleardoublepage
  435. }
  436. \renewcommand\backmatter{
  437.  \if@openright
  438.    \cleardoublepage
  439.  \else
  440.    \clearpage
  441.  \fi
  442.  \addtotoc{\bibname}
  443.  \btypeout{\bibname}
  444.  \@mainmatterfalse}
  445. \endinput
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement