Advertisement
Guest User

univpmphdthesis.cls

a guest
Jan 27th, 2015
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 12.65 KB | None | 0 0
  1. %%
  2. %% This is file `univpmphdthesis.cls',
  3. %% generated with the docstrip utility.
  4. %%
  5. %% The original source files were:
  6. %%
  7. %% univpmphdthesis.dtx  (with options: `class')
  8. %% _______________________________________________________________
  9. %%
  10. %% The univpmphdthesis class for typesetting the PhD
  11. %% thesis of Università Politecnica delle Marche.
  12. %%
  13. %% Copyright (C) 2011-2012 by Marco Giammarini
  14. %%
  15. %% This work may be distributed and/or modified under the
  16. %% conditions of the LaTeX Project Public License, either
  17. %% version 1.3 of this license or (at your option) any later
  18. %% version. The latest version of this license is in
  19. %%
  20. %%   http://www.latex-project.org/lppl.txt
  21. %%
  22. %% and version 1.3 or later is part of all distributions of LaTeX
  23. %% version 2005/12/01 or later.
  24. %%
  25. %% This work has the LPPL maintenance status `author-maintained'.
  26. %%
  27. %% The Current Maintainer of this work is:
  28. %%   Marco Giammarini <m.giammarini@warcomeb.it>
  29. %% _______________________________________________________________
  30. %%
  31. \NeedsTeXFormat{LaTeX2e}
  32. \ProvidesClass{univpmphdthesis}%
  33.   [2011/20/10 v.1.0 Template for PhD thesis of Universita' Politecnica delle Marche]
  34. \errorcontextlines=9
  35. %% Carico ifthen e dichiaro i booleani per le opzioni
  36. \RequirePackage{ifthen,etoolbox}
  37.  
  38. \newif\ifunivpm@aquattroprint \univpm@aquattroprintfalse
  39. \newif\ifunivpm@english       \univpm@englishfalse
  40. \newif\ifunivpm@italian       \univpm@italianfalse
  41. \newif\ifunivpm@lof           \univpm@loffalse
  42. \newif\ifunivpm@lot           \univpm@lotfalse
  43.  
  44. %% Dichiaro le opzioni
  45. \DeclareOption{a4print}{\univpm@aquattroprinttrue}
  46. \DeclareOption{english}{\univpm@englishtrue}
  47. \DeclareOption{italian}{\univpm@italiantrue}
  48. \DeclareOption{lof}{\univpm@loftrue}
  49. \DeclareOption{lot}{\univpm@lottrue}
  50.  
  51. \DeclareOption*{
  52.  \ClassError{univpmphdthesis}%
  53.     {L'opzione \CurrentOption\space non e' valida}%
  54.     {Premi X per terminare e correggi}%
  55. }
  56.  
  57. %% Carico la classe
  58. \ProcessOptions\relax
  59.  
  60. \LoadClass[10pt,%
  61.            twoside=true,%
  62.            open=right,%
  63.            cleardoublepage=empty,%
  64.            chapterprefix=true]{scrbook}
  65.  
  66. %% Gestisco la selezione della lingua
  67. \ifthenelse{\boolean{univpm@english}\AND%
  68.             \boolean{univpm@italian}}%
  69. {%
  70.   \ClassError{univpmphdthesis}%
  71.     {Non puoi definire due lingue!}%
  72.     {Premi X per terminare e correggi l'errore!}%
  73. }%
  74. {\relax}
  75.  
  76. \ifthenelse{\(\NOT\boolean{univpm@english}\)\AND%
  77.             \(\NOT\boolean{univpm@italian}\)}%
  78. {%
  79.   \ClassError{univpmphdthesis}%
  80.     {Devi definire una lingua!}%
  81.     {Premi X per terminare e correggi l'errore!}%
  82. }%
  83. {\relax}
  84.  
  85. \typeout{**************************************************}
  86. \ifunivpm@english\typeout{* Hai selezionato: INGLESE}\fi
  87. \ifunivpm@italian\typeout{* Hai selezionato: ITALIANO}\fi
  88. \typeout{**************************************************}
  89.  
  90. %% \RequirePackage[utf8]{inputenc}
  91. %% \RequirePackage[T1]{fontenc}
  92.  
  93. \RequirePackage[english,italian]{babel}
  94.  
  95. \ifunivpm@english
  96.  \AtBeginDocument{\selectlanguage{english}}
  97. \fi
  98.  
  99. \ifunivpm@italian
  100.  \AtBeginDocument{\selectlanguage{italian}}
  101.  \RequirePackage{indentfirst}
  102. \fi
  103.  
  104. \addto\captionsitalian{\def\acknowledgename{Ringraziamenti}}
  105. \addto\captionsenglish{\def\acknowledgename{Acknowledgments}}
  106.  
  107. \addto\captionsitalian{\def\dedicationname{Dedica}}
  108. \addto\captionsenglish{\def\dedicationname{Dedication}}
  109.  
  110. %% Richiedo il pacchetto per le immagini
  111. \RequirePackage{graphicx}
  112.  
  113. %% Richiedo il pacchetto per l'interlinea
  114. \RequirePackage{setspace}
  115. \setstretch{1.15}
  116.  
  117. %% Imposto le dimensioni della pagina
  118. \RequirePackage[twoside]{geometry}
  119. \geometry{%
  120.   papersize={160mm,240mm},
  121.  text={120mm,200mm},
  122.  marginratio=1:1,
  123.  bindingoffset=4mm
  124. }
  125. \addtolength{\footskip}{-0.5cm}
  126.  
  127. %% Carico hyperref a seconda del driver usato
  128. \RequirePackage{ifpdf}
  129. \ifpdf
  130.  \RequirePackage[pdfpagelabels]{hyperref}
  131. \else
  132.  \RequirePackage{hyperref}
  133. \fi
  134.  
  135. \ifunivpm@aquattroprint%
  136.   \RequirePackage[a4,
  137.                  center,
  138.                  cam]{crop}
  139. \fi
  140.  
  141. %% Città dell'autore
  142. \newcommand{\phdlocation}[1]{\def\univpm@phdlocation{#1}}
  143. %% Data di stampa (in qualsiasi formato)
  144. \newcommand{\phdtime}[1]{\def\univpm@phdtime{#1}}
  145. %% Definizione dei comandi per le label in inglese
  146. \newcommand{\authorlabelEN}[1]{\def\univpm@authorlabelEN{#1}}
  147. \newcommand{\advisorlabelEN}[1]{\def\univpm@advisorlabelEN{#1}}
  148. \newcommand{\coadvisorlabelEN}[1]{\def\univpm@coadvisorlabelEN{#1}}
  149. \newcommand{\curriculumadvisorlabelEN}[1]%
  150.   {\def\univpm@curriculumadvisorlabelEN{#1}}
  151. \newcommand{\directorlabelEN}[1]{\def\univpm@directorlabelEN{#1}}
  152. \newcommand{\cyclelabelEN}[1]{\def\univpm@cyclelabelEN{#1}}
  153. %% Label inglesi
  154. \authorlabelEN{Ph.D. Dissertation of:}
  155. \advisorlabelEN{Advisor:}
  156. \coadvisorlabelEN{Coadvisor:}
  157. \curriculumadvisorlabelEN{Curriculum Supervisor:}
  158. \directorlabelEN{Ph.D. School Supervisor:}
  159. \cyclelabelEN{edition - new series}
  160.  
  161. %% Definizione dei comandi per le label in italiano
  162. \newcommand{\authorlabelIT}[1]{\def\univpm@authorlabelIT{#1}}
  163. \newcommand{\advisorlabelIT}[1]{\def\univpm@advisorlabelIT{#1}}
  164. \newcommand{\coadvisorlabelIT}[1]{\def\univpm@coadvisorlabelIT{#1}}
  165. \newcommand{\curriculumadvisorlabelIT}[1]%
  166.   {\def\univpm@curriculumadvisorlabelIT{#1}}
  167. \newcommand{\directorlabelIT}[1]{\def\univpm@directorlabelIT{#1}}
  168. \newcommand{\cyclelabelIT}[1]{\def\univpm@cyclelabelIT{#1}}
  169. %% Label italiane
  170. \authorlabelIT{Tesi di Dottorato di:}
  171. \advisorlabelIT{Tutor:}
  172. \coadvisorlabelIT{Co-Tutor:}
  173. \curriculumadvisorlabelIT{Coordinatore del Curriculum:}
  174. \directorlabelIT{Coordinatore della Scuola di Dottorato:}
  175. \cyclelabelIT{ciclo - nuova serie}
  176.  
  177. %% Definizione dei comandi per le label che verranno usate
  178. \newcommand{\authorlabel}[1]{\def\univpm@authorlabel{#1}}
  179. \newcommand{\advisorlabel}[1]{\def\univpm@advisorlabel{#1}}
  180. \newcommand{\coadvisorlabel}[1]{\def\univpm@coadvisorlabel{#1}}
  181. \newcommand{\curriculumadvisorlabel}[1]%
  182.   {\def\univpm@curriculumadvisorlabel{#1}}
  183. \newcommand{\directorlabel}[1]{\def\univpm@directorlabel{#1}}
  184. \newcommand{\cyclelabel}[1]{\def\univpm@cyclelabel{#1}}
  185.  
  186. %% Scelgo la label giusta in base alla lingua selezionata
  187. \ifunivpm@english%
  188.   \authorlabel{\univpm@authorlabelEN}
  189.  \advisorlabel{\univpm@advisorlabelEN}
  190.  \coadvisorlabel{\univpm@coadvisorlabelEN}
  191.  \curriculumadvisorlabel{\univpm@curriculumadvisorlabelEN}
  192.  \directorlabel{\univpm@directorlabelEN}
  193.  \cyclelabel{\univpm@cyclelabelEN}
  194. \fi
  195.  
  196. \ifunivpm@italian%
  197.   \authorlabel{\univpm@authorlabelIT}
  198.  \advisorlabel{\univpm@advisorlabelIT}
  199.  \coadvisorlabel{\univpm@coadvisorlabelIT}
  200.  \curriculumadvisorlabel{\univpm@curriculumadvisorlabelIT}
  201.  \directorlabel{\univpm@directorlabelIT}
  202.  \cyclelabel{\univpm@cyclelabelIT}
  203. \fi
  204.  
  205. %% Nome dell'Università
  206. \newcommand{\univpm}[1]{\def\univpm@univpm{#1}}
  207. \univpm{Universit\`{a} Politecnica delle Marche}
  208. %% Indirizzo dell'Università
  209. \newcommand{\facultyaddress}[1]{\def\univpm@facultyaddress{#1}}
  210. \facultyaddress{Via Brecce Bianche -- 60131 Ancona (AN), Italy}
  211. %% Logo dell'Università
  212. \def\univpm@logo{figures/logoUNIVPM}
  213. %%  Nome della scuola di dottorato
  214. \newcommand{\phdschool}[1]{\def\univpm@phdschool{#1}}
  215. %%  Facoltà della scuola di dottorato
  216. \newcommand{\phdfaculty}[1]{\def\univpm@phdfaculty{#1}}
  217. %% Nome del curriculum
  218. \newcommand{\phdcurriculum}[1]{\def\univpm@phdcurriculum{#1}}
  219. %% Titolo della tesi
  220. \newcommand{\phdtitle}[1]{\def\univpm@phdtitle{#1}}
  221. %% Sotto titolo della tesi
  222. \newcommand{\phdsubtitle}[1]{\def\univpm@phdsubtitle{#1}}
  223. %% Autore della tesi
  224. \newcommand{\phdauthor}[1]{\def\univpm@phdauthor{#1}}
  225. %% Tutor del dottorando
  226. \newcommand{\phdadvisor}[1]{\def\univpm@phdadvisor{#1}}
  227. %% Co-Tutor del dottorando
  228. \newcommand{\phdcoadvisor}[1]{\def\univpm@phdcoadvisor{#1}}
  229. %% Coordinatore del curriculum
  230. \newcommand{\phdcurriculumadvisor}[1]%
  231.   {\def\univpm@phdcurriculumadvisor{#1}}
  232.  
  233. %% Comando per la gestione del ciclo di dottorato
  234. \newcounter{univpm@phdcyclenumber}
  235. \newcommand{\phdcycle}[1]%
  236. {%
  237.   \setcounter{univpm@phdcyclenumber}{#1}
  238.   \def\univpm@phdcycle{%
  239.     \Roman{univpm@phdcyclenumber} \univpm@cyclelabel}
  240. }
  241. %% Comando per la gestione della dedica
  242. \newcommand{\thesisdedication}[1]%
  243. {%
  244.   \def\univpm@dedication{#1}
  245. }
  246. %% Comando per la gestione dell'hardcover
  247. \newcommand{\hscover}%
  248. {%
  249. %% Logo e nomi dell'Università
  250.   \begin{minipage}[t]{\textwidth}
  251.    \begin{center}
  252.      \includegraphics[scale=.3]{\univpm@logo}\par
  253.      \small{
  254.        \textsc{\univpm@univpm}\par
  255.        \textsc{\univpm@phdschool}\par
  256.        \textsc{\univpm@phdcurriculum}\par
  257.      }
  258.      \vspace{1em}
  259.      \hrule
  260.    \end{center}
  261.  \end{minipage}
  262.  
  263.  \vspace{3em}
  264.  
  265. %% Titolo
  266.   \begin{minipage}[t]{\textwidth}
  267.    \begin{center}
  268.      \huge\usekomafont{title}{\univpm@phdtitle}\par
  269.      \ifdefined\univpm@phdsubtitle
  270.        \vspace{2em}
  271.        \large\usekomafont{title}{\univpm@phdsubtitle}\par
  272.      \fi
  273.    \end{center}
  274.  \end{minipage}
  275.  
  276.   \vfill
  277.  
  278. %% Autore, tutor e cordinatore
  279.   \begin{minipage}[t]{\textwidth}
  280.    \begin{flushright}
  281.       \large{%
  282.         \univpm@authorlabel\par
  283.       \textbf{\univpm@phdauthor}\par
  284.      }
  285.    \end{flushright}
  286.    \vspace{1em}
  287.    \univpm@advisorlabel\par
  288.    \textbf{\univpm@phdadvisor}\par
  289.    \vspace{2em}
  290.    \ifdefined\univpm@phdcoadvisor
  291.      \univpm@coadvisorlabel\par
  292.      \textbf{\univpm@phdcoadvisor}\par
  293.      \vspace{2em}
  294.    \fi
  295.    \univpm@curriculumadvisorlabel\par
  296.  \textbf{\univpm@phdcurriculumadvisor}\par
  297.  \end{minipage}
  298.  
  299.  \vspace{2em}
  300.  
  301. %% Numero di ciclo
  302.   \begin{minipage}[t]{\textwidth}
  303.    \begin{center}
  304.      \univpm@phdcycle\par
  305.    \end{center}
  306.  \end{minipage}
  307. }
  308.  
  309. %% Comando per la gestione del colophon
  310. \newcommand{\colophon}%
  311. {%
  312.   \hfill\vfill
  313.   \noindent\begin{minipage}[t]{\textwidth}
  314.    \hrule
  315.    \vspace{1em}
  316.    \begin{center}
  317.      \small{
  318.        \textsc{\univpm@univpm}\par
  319.        \textsc{\univpm@phdschool}\par
  320.        \textsc{\univpm@phdfaculty}\par
  321.        \univpm@facultyaddress\par
  322.      }
  323.    \end{center}
  324.  \end{minipage}
  325. }
  326. %% Viene ridefinito il comando maketitle
  327. \renewcommand*\maketitle{%
  328. %% Doppia pagina vuota
  329.   \hfill\vfill
  330.   \cleardoublepage\thispagestyle{empty}
  331. %% Hardcover e pagina vuota
  332.   \ifpdf\pdfbookmark{Hardcover}{Hardcover}\fi
  333.  \hscover
  334.  \cleardoublepage\thispagestyle{empty}
  335. %% Softcover e colophon
  336.   \ifpdf\pdfbookmark{Softcover}{Softcover}\fi
  337.  \hscover
  338.  \clearpage\thispagestyle{empty}
  339.   \colophon
  340. %% Dedica, se presente
  341.   \ifdefined\univpm@dedication
  342.     \cleardoublepage\thispagestyle{empty}
  343.    \ifpdf\pdfbookmark{\dedicationname}{\dedicationname}\fi
  344.    \hfill\vfill
  345.    \begin{flushright}
  346.      \large\textit{\univpm@dedication}
  347.    \end{flushright}
  348.    \vfill
  349.  \fi
  350. }
  351. %% Ambiente per gestire i ringraziamenti
  352. \newenvironment{thesisacknowledge}[1][]%
  353. {%
  354. %% In base alla lingua selezionata creo titolo e testo
  355. %%  \selectlanguage{#1}
  356.   \ifblank{#1}{}{\begin{otherlanguage}{#1}}
  357.    \chapter*{\acknowledgename}
  358.    \ifpdf
  359.      \pdfbookmark{\acknowledgename}{\acknowledgename}
  360.    \fi
  361.  \ifblank{#1}{}{\end{otherlanguage}}
  362. }%
  363. {%
  364. %% Stampo data e firma dell'autore
  365.     \ifdefined\univpm@phdlocation
  366.       \ifdefined\univpm@phdtime
  367.         \bigskip\par
  368.         \noindent\textit{\univpm@phdlocation, \univpm@phdtime}\par
  369.        \hfill\univpm@phdauthor\par
  370.      \else
  371.        \ClassError{univpmphdthesis}%
  372.           {Devi definire la data di stampa!}%
  373.           {Premi X per terminare e correggi l'errore!}%
  374.       \fi
  375.     \else
  376.       \ClassError{univpmphdthesis}%
  377.         {Devi definire il luogo di stampa!}%
  378.         {Premi X per terminare e correggi l'errore!}%
  379.     \fi
  380. %% Ripristino la lingua
  381. %%  \ifunivpm@english
  382. %%    \selectlanguage{english}
  383. %%  \fi
  384.  
  385. %%  \ifunivpm@italian
  386. %%    \selectlanguage{italian}
  387. %%  \fi
  388. }
  389. %% Ambiente per gestire l'abstract
  390. \newenvironment{thesisabstract}[1][]%
  391. {%
  392. %% In base alla lingua selezionata creo titolo e testo
  393. %%  \selectlanguage{#1}
  394.   \ifblank{#1}{}{\begin{otherlanguage}{#1}}
  395.    \chapter*{\abstractname}
  396.    \ifpdf\pdfbookmark{\abstractname}{\abstractname}\fi
  397.  \ifblank{#1}{}{\end{otherlanguage}}
  398. }
  399. {%
  400. %% Ripristino la lingua
  401. %%  \ifunivpm@english
  402. %%    \selectlanguage{english}
  403. %%  \fi
  404.  
  405. %%  \ifunivpm@italian
  406. %%    \selectlanguage{italian}
  407. %%  \fi
  408. \relax}
  409. %% Ambiente per gestire i ringraziamenti
  410. \newcommand{\thesistoc}%
  411. {%
  412.   \cleardoublepage
  413.   \ifpdf\pdfbookmark{\contentsname}{\contentsname}\fi
  414.   \tableofcontents
  415.  
  416.   \ifunivpm@lof%
  417.     \cleardoublepage
  418.     \ifpdf\pdfbookmark{\listfigurename}{\listfigurename}\fi
  419.     \listoffigures
  420.   \fi
  421.  
  422.   \ifunivpm@lot%
  423.     \cleardoublepage
  424.     \ifpdf\pdfbookmark{\listtablename}{\listtablename}\fi
  425.    \listoftables
  426.  \fi
  427. }
  428.  
  429. \endinput
  430. %%
  431. %% End of file `univpmphdthesis.cls'.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement