Advertisement
Guest User

Untitled

a guest
Jun 7th, 2016
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 29.84 KB | None | 0 0
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %%
  3. %% LaTeX document class 'aaltothesis', for use with LaTeX2e.
  4. %% This is a style for typesetting theses to be submitted for
  5. %% examination to Aalto University School of Electrical Engineering,
  6. %% which may be extended for use in other Aalto schools as well.
  7. %%
  8. %% Version 2.1: The positions of the author and title have been interchanged;
  9. %% now the title is followed by the author.
  10. %% Version 2.0 onwards supports Swedish as well, in addition to the earlier
  11. %% Finnish and English.
  12. %%
  13. %% COPYRIGHT 2015, by Luis R.J. Costa, [email protected]
  14. %% Swedish translations (2014) by Elisabeth Nyberg, [email protected]
  15. %% and Henrik Wallén, [email protected]
  16. %%
  17. %% Copying of part or all of any file in the aaltothesis package is
  18. %% allowed under the following conditions only:
  19. %% (1) You may freely distribute unchanged copies of the files. Please
  20. %%     include the documentation (opinnaytetexpohja.tex) when you do
  21. %%     so.
  22. %% (2) You may modify a renamed copy of any file, but only for personal
  23. %%     use or use within an organization.
  24. %% (3) You may copy fragments from the files, for personal use or for
  25. %%     use in a macro package for distribution, as long as credit is
  26. %%     given where credit is due.
  27. %%
  28. %% You are NOT ALLOWED to take money for the distribution or use of
  29. %% these files or modified versions or fragments thereof, except for a
  30. %% nominal charge for copying etc.
  31. %%
  32. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  33. %%
  34. %%
  35. %% Adding a new language:
  36. %% 1. Add the language option using \DeclareOption as done a few lines below.
  37. %%    It's assumed your language is supported by the babel package.
  38. %% 2. Add your language to the options passed to babel
  39. %% 3. Make a corresponding short-hand macro \IfYourlang (under "Some shorthand")
  40. %% 4. Add the translations to the macros \setthesismainlangnames and
  41. %%    \setabstractlangnames.
  42. %% 5. Make the corresponding additions to the macros \L@ng and \settocabslang.
  43. %% 6. Make your language option available in the abstractpage environment.
  44. %%
  45. %%
  46. \NeedsTeXFormat{LaTeX2e}%
  47. \ProvidesClass{aaltothesis}[2015/09/24 Aalto Univ. ELEC thesis class v2.2]%
  48. \RequirePackage{ifthen}%
  49. %
  50. \newcommand*{\MainLang}{}%
  51. \DeclareOption{english}{\AtEndOfClass{\main@language{english}}%
  52.   \renewcommand*{\MainLang}{english}}%
  53. \DeclareOption{finnish}{\AtEndOfClass{\main@language{finnish}}%
  54.   \renewcommand*{\MainLang}{finnish}}%
  55. \DeclareOption{swedish}{\AtEndOfClass{\main@language{swedish}}%
  56.   \renewcommand*{\MainLang}{swedish}}%
  57. %
  58. \newboolean{CHEM}%
  59. \newboolean{BIZ}%
  60. \newboolean{ELEC}%
  61. \newboolean{ENG}%
  62. \newboolean{SCI}%
  63. \newboolean{ARTS}%
  64. \DeclareOption{chem}{\setboolean{CHEM}{true}\setboolean{BIZ}{false}%
  65.   \setboolean{ELEC}{false}\setboolean{ENG}{false}%
  66.   \setboolean{SCI}{false}\setboolean{ARTS}{false}%
  67. }%
  68. \DeclareOption{econ}{\setboolean{CHEM}{false}\setboolean{BIZ}{true}%
  69.   \setboolean{ELEC}{false}\setboolean{ENG}{false}%
  70.   \setboolean{SCI}{false}\setboolean{ARTS}{false}%
  71. }%
  72. \DeclareOption{elec}{\setboolean{CHEM}{false}\setboolean{BIZ}{false}%
  73.   \setboolean{ELEC}{true}\setboolean{ENG}{false}%
  74.   \setboolean{SCI}{false}\setboolean{ARTS}{false}%
  75. }%
  76. \DeclareOption{eng}{\setboolean{CHEM}{false}\setboolean{BIZ}{false}%
  77.   \setboolean{ELEC}{false}\setboolean{ENG}{true}%
  78.   \setboolean{SCI}{false}\setboolean{ARTS}{false}%
  79. }%
  80. \DeclareOption{sci}{\setboolean{CHEM}{false}\setboolean{BIZ}{false}%
  81.   \setboolean{ELEC}{false}\setboolean{ENG}{false}%
  82.   \setboolean{SCI}{true}\setboolean{ARTS}{false}%
  83. }%
  84. \DeclareOption{arts}{\setboolean{CHEM}{false}\setboolean{BIZ}{false}%
  85.   \setboolean{ELEC}{false}\setboolean{ENG}{false}%
  86.   \setboolean{SCI}{false}\setboolean{ARTS}{true}%
  87. }%
  88. %% Font encoding support for iso-latin-1, utf-8 and ansinew (MiKTeX):
  89. %% LC 26.9.2013
  90. \DeclareOption{latin1}{\PassOptionsToPackage{latin1}{inputenc}}%
  91. \DeclareOption{utf8}{\PassOptionsToPackage{utf8}{inputenc}}%
  92. \DeclareOption{ansinew}{\PassOptionsToPackage{ansinew}{inputenc}}%
  93. %
  94. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}%
  95. \ExecuteOptions{english,utf8}% Default package options
  96. \ProcessOptions\relax%
  97. %
  98. \LoadClass{article}%
  99. %
  100. \RequirePackage[swedish,finnish,english]{babel}%
  101. \RequirePackage[T1]{fontenc}%
  102. \RequirePackage{inputenc}% For scands in both Finnish and English input docs
  103. \RequirePackage{lmodern}%
  104. %  \RequirePackage{cmlgc} % For mac users(?), uncomment this line
  105. \RequirePackage[kerning,spacing,babel]{microtype}%
  106. %
  107. \RequirePackage{calc}%
  108. \RequirePackage{color}%
  109. \RequirePackage{chngcntr}% Allows conter dependencies to be changed for appendix
  110. %
  111. %% Set up the logo
  112. %% Note that BIZ and ARTS still (2012-08-17)
  113. %% use old logos as the aaltologo-package
  114. %% is not up-to-date. Hence there are calls to ECON and TAIK pic routines.
  115. \ifthenelse{\boolean{CHEM}}{%
  116.   \RequirePackage[CHEM,Uncoated]{aaltologo}%
  117. }{%
  118. \ifthenelse{\boolean{BIZ}}{%
  119.   \RequirePackage[ECON,Uncoated]{aaltologo}%
  120. }{%
  121. \ifthenelse{\boolean{ELEC}}{%
  122.   \RequirePackage[ELEC,Uncoated]{aaltologo}%
  123. }{%
  124. \ifthenelse{\boolean{ENG}}{%
  125.   \RequirePackage[ENG,Uncoated]{aaltologo}%
  126. }{%
  127. \ifthenelse{\boolean{SCI}}{%
  128.   \RequirePackage[SCI,Uncoated]{aaltologo}%
  129. }{%
  130. \ifthenelse{\boolean{ARTS}}{%
  131.   \RequirePackage[TAIK,Uncoated]{aaltologo}%
  132. }{%
  133. \RequirePackage[Uncoated]{aaltologo}%
  134. }}}}}}%
  135. %
  136. %%%%%%% Set up the page layout %%%%%%%
  137. %% First the horizontal dimensions %%
  138. \setlength{\hoffset}{-1in}
  139. \setlength{\oddsidemargin}{35mm}
  140. \setlength{\evensidemargin}{25mm}
  141. \setlength{\textwidth}{15cm}
  142. %% Then the vertical dimensions
  143. \setlength{\voffset}{-1in}
  144. \setlength{\headsep}{7mm}
  145. \setlength{\headheight}{1em}
  146. \setlength{\topmargin}{25mm-\headheight-\headsep}
  147. \setlength{\textheight}{23cm}
  148. %
  149. %%%%%%% Float control %%%%%%%
  150. \renewcommand{\floatpagefraction}{0.1}%
  151. \renewcommand{\textfraction}{0.1}%
  152. \renewcommand{\topfraction}{0.9}%
  153. \renewcommand{\bottomfraction}{0.9}%
  154. %
  155. %%%%%% Now come all the macros used along with all the required counter, etc.
  156. %
  157. \newcommand*{\AbstractLang}{\MainLang}%
  158. %
  159. %%%%%%% Some shorthand %%%%%%%
  160. \newcommand*{\IfEng}[3]{\ifthenelse{\equal{#1}{english}}{#2}{#3}}%
  161. \newcommand*{\IfFin}[3]{\ifthenelse{\equal{#1}{finnish}}{#2}{#3}}%
  162. \newcommand*{\IfSwe}[3]{\ifthenelse{\equal{#1}{swedish}}{#2}{#3}}%
  163. %
  164. %%%%%%% Storage of number of pages and number of abstracts %%%%%%%
  165. \newcounter{NMainPages}%
  166. \newcounter{NInitPages}%
  167. \newcommand*{\storeinipagenumber}{%
  168. \immediate\write\@auxout{\string\setcounter{NInitPages}{\arabic{page}-1}}%
  169. }%
  170. \AtEndDocument{%
  171. \immediate\write\@auxout{\string\setcounter{NMainPages}{\thepage}}%
  172. }%
  173. %
  174. %%%%%%% Default fonts: Latin Modern (LC 24.9.2015)
  175. % This is required to overwite any fonts set elsewhere. The package
  176. % aaltologo.sty sets \rmdefault to newcent, \ttdefault to txtt.
  177. \renewcommand{\rmdefault}{lmr}%
  178. \renewcommand{\ttdefault}{lmtt}%
  179. \renewcommand{\sfdefault}{lmss}%
  180. %
  181. %%%%%%
  182. %%%%%% Language-specific definitions
  183. %%%%%% First create the necessary variables.
  184. %%%%%%
  185. \newcommand*{\univ@rsity}{}%
  186. \newcommand*{\sch@@l}{}%
  187. \newcommand*{\thesissupervisorname}{}%
  188. \newcommand*{\thesissuperadvisorname}{}%
  189. \newcommand*{\thesisadvisorname}{}%
  190. \newcommand*{\thesisadvisorsname}{}%
  191. \newcommand{\covertext}{}%
  192. \newcommand*{\authorname}{}%
  193. \newcommand*{\thesisname}{}%
  194. \newcommand*{\keywordsname}{}%
  195. \newcommand*{\datename}{}%
  196. \newcommand*{\langname}{}%
  197. \newcommand*{\nofpgsname}{}%
  198. \newcommand*{\supervisorname}{}%
  199. \newcommand*{\advisorname}{}%
  200. \newcommand*{\degprogramname}{}%
  201. \newcommand*{\professorshipname}{}%
  202. \newcommand*{\codename}{}%
  203. %%
  204. \newcommand*{\absheadname}{}%
  205. \newcommand*{\tocabslang}{}%
  206. %
  207. %%%%%% Set up those values that can be set up automatically: university,
  208. % school name, logo, etc.
  209. %% Some can also be explicitly set by the user via macros like \university
  210. %% and \school defined below after the language-specific stuff.
  211. %%
  212. \newcommand{\setthesismainlangnames}{%
  213.  \IfEng{\MainLang}{%
  214.    %% Cover page stuff in English
  215.    \renewcommand*{\thesissupervisorname}{Thesis supervisor}%
  216.    \renewcommand*{\thesissuperadvisorname}{Thesis supervisor and advisor}%
  217.    \renewcommand*{\thesisadvisorname}{Thesis advisor}%
  218.    \renewcommand*{\thesisadvisorsname}{Thesis advisors}%
  219.    \renewcommand{\covertext}{%
  220.      \ifthenelse{\boolean{BSc}}{Bachelor's thesis}{}%
  221.      \ifthenelse{\boolean{MSc}}%
  222.                 {Thesis submitted for examination for the degree of %
  223.                   Master of Science in Technology.}{}%
  224.      \ifthenelse{\boolean{Lic}}%
  225.                 {Thesis submitted for examination for the degree of %
  226.                  Licentiate of Science in Technology.}{}%
  227.    }%
  228.    \renewcommand*{\abstractname}{Abstract}%
  229.  }{}% end if English
  230.  \IfFin{\MainLang}{%
  231.    %% Cover page stuff in Finnish
  232.    \renewcommand*{\thesissupervisorname}{%
  233.      \ifthenelse{\boolean{BSc}}{Vastuuopettaja}{Ty\"on valvoja}%
  234.    }%
  235.    \renewcommand*{\thesissuperadvisorname}{%
  236.      \ifthenelse{\boolean{BSc}}%
  237.                 {Vastuuopettaja ja ohjaaja}{Ty\"on valvoja ja ohjaaja}%
  238.    }%
  239.    \renewcommand*{\thesisadvisorname}{Ty\"on ohjaaja}%
  240.    \renewcommand*{\thesisadvisorsname}{Ty\"on ohjaajat}%
  241.    \renewcommand{\covertext}{%
  242.      \ifthenelse{\boolean{BSc}}{Kandidaatinty\"o}{}%
  243.      \ifthenelse{\boolean{MSc}}%
  244.        {Diplomity\"o, joka on j\"atetty opinn\"aytteen\"a tarkastettavaksi %
  245.         diplomi-insin\"o\"orin tutkintoa varten Espoossa \D@te{}.}{}%
  246.      \ifthenelse{\boolean{Lic}}%
  247.        {Lisensiaatintutkimus, joka on j\"atetty opinn\"aytteen\"a tarkastettavaksi %
  248.         tekniikan lisensiaatin tutkintoa varten Espoossa \D@te{}.}{}%
  249.    }%
  250.    \renewcommand*{\abstractname}{Tiivistelm\"a}%
  251.    \renewcommand{\contentsname}{Sis\"allysluettelo}%
  252.  }{}% end if Finnish
  253.  \IfSwe{\MainLang}{%
  254.    %% Cover page stuff in Swedish
  255.    \renewcommand*{\thesissupervisorname}{%
  256.      \ifthenelse{\boolean{BSc}}{Ansvarsl\"arare}{\"Overvakare}%
  257.    }%
  258.    \renewcommand*{\thesissuperadvisorname}{%
  259.      \ifthenelse{\boolean{BSc}}%
  260.        {Ansvarsl\"arare och handledare}{Arbetets \"overvakare och handledare}%
  261.    }%
  262.    \renewcommand*{\thesisadvisorname}{Handledare}%
  263.    \renewcommand*{\thesisadvisorsname}{Handledare}%
  264.    \renewcommand{\covertext}{%
  265.      \ifthenelse{\boolean{BSc}}{Kandidatexamen}{}%
  266.      \ifthenelse{\boolean{MSc}}%
  267.        {Diplomarbete, som inl\"amnats f\"or granskning som l\"ardomsprov
  268.        f\"or avl\"aggande av diplomingenj\"orsexamen i Esbo den \D@te{}.}{}%
  269.      \ifthenelse{\boolean{Lic}}%
  270.        {Licentiatavhandling, som inl\"amnats f\"or granskning som l\"ardomsprov
  271.        f\"or avl\"aggande av licentiatexamen i Esbo den \D@te{}.}{}%
  272.    }%
  273.    \renewcommand*{\abstractname}{Sammandrag}%
  274.    \renewcommand{\contentsname}{Inneh\aa llsf\"orteckning}%
  275.  }{}% end if Swedish
  276. }%
  277. %
  278. \newcommand*{\setabstractlangnames}{%
  279. % Define the the headers, the names of fields in the language of the abstract,
  280. % and set up some lengths used in the abstract.
  281.  \IfEng{\AbstractLang}{%
  282.    %% School is common to cover page and abstract (English)
  283.    \ifthenelse{\boolean{ARTS}}{%
  284.      \renewcommand*{\sch@@l}{School of Arts, Design and Architecture}%
  285.    }{}%
  286.    \ifthenelse{\boolean{BIZ}}{%
  287.      \renewcommand*{\sch@@l}{School of Business}%
  288.    }{}%
  289.    \ifthenelse{\boolean{CHEM}}{%
  290.      \renewcommand*{\sch@@l}{School of Chemical Technology}%
  291.    }{}%
  292.    \ifthenelse{\boolean{ELEC}}{%
  293.      \renewcommand*{\sch@@l}{School of Electrical Engineering}%
  294.    }{}%
  295.    \ifthenelse{\boolean{ENG}}{%
  296.      \renewcommand*{\sch@@l}{School of Engineering}%
  297.    }{}%
  298.    \ifthenelse{\boolean{SCI}}{%
  299.      \renewcommand*{\sch@@l}{School of Science}%
  300.    }{}%
  301.    %% Abstract header and field names in English
  302.    \renewcommand*{\univ@rsity}{aalto university}%
  303.    \renewcommand*{\authorname}{Author}%
  304.    \renewcommand*{\thesisname}{Title}%
  305.    \renewcommand*{\keywordsname}{Keywords}%
  306.    \renewcommand*{\datename}{Date}%
  307.    \renewcommand*{\langname}{Language}%
  308.    \renewcommand*{\nofpgsname}{Number of pages}%
  309.    \renewcommand*{\supervisorname}{%
  310.      \ifthenelse{\value{advisors}=0}{Supervisor and advisor}{Supervisor}%
  311.    }%
  312.    \renewcommand*{\advisorname}{%
  313.      \ifthenelse{\value{advisors}=0}{}{%
  314.        \ifthenelse{\value{advisors}=1}{Advisor}{%
  315.          \ifthenelse{\value{advisors}>1}{Advisors}{%
  316.      }}}%%%
  317.    }%
  318.    \renewcommand*{\degprogramname}{Degree programme}%
  319.    \renewcommand*{\professorshipname}{Professorship}%
  320.    \renewcommand*{\codename}{Code}%
  321.    %
  322.    \ifthenelse{\boolean{BSc}}{%
  323.      \renewcommand*{\absheadname}{abstract of the bachelor's thesis}%
  324.      \settowidth{\absheadlen}{BACHELOR'S THESIS}%
  325.    }{}%
  326.    \ifthenelse{\boolean{MSc}}{%
  327.      \renewcommand*{\absheadname}{abstract of the master's thesis}%
  328.      \settowidth{\absheadlen}{MASTER'S THESIS}%
  329.    }{}%
  330.    \ifthenelse{\boolean{Lic}}{%
  331.      \renewcommand*{\absheadname}{abstract of the licentiate's thesis}%
  332.      \settowidth{\absheadlen}{LICENTIATE'S THESIS}%
  333.    }{}%
  334.  }{}% end if English
  335.  \IfFin{\AbstractLang}{%
  336.    %% School is common to cover page and abstract (Finnish)
  337.    \ifthenelse{\boolean{ARTS}}{%
  338.      \renewcommand*{\sch@@l}{Taiteiden ja suunnittelun korkeakoulu}%
  339.    }{}%
  340.    \ifthenelse{\boolean{BIZ}}{%
  341.      \renewcommand*{\sch@@l}{Kauppakorkeakoulu}%
  342.    }{}%
  343.    \ifthenelse{\boolean{CHEM}}{%
  344.      \renewcommand*{\sch@@l}{Kemian tekniikan korkeakoulu}%
  345.    }{}%
  346.    \ifthenelse{\boolean{ELEC}}{%
  347.      \renewcommand*{\sch@@l}{S\"ahk\"otekniikan korkeakoulu}%
  348.    }{}%
  349.    \ifthenelse{\boolean{ENG}}{%
  350.      \renewcommand*{\sch@@l}{Insin\"o\"oritieteiden korkeakoulu}%
  351.    }{}%
  352.    \ifthenelse{\boolean{SCI}}{%
  353.      \renewcommand*{\sch@@l}{Perustieteiden korkeakoulu}%
  354.    }{}%
  355.    %% Abstract header and field names in Finnish
  356.    \renewcommand*{\univ@rsity}{aalto-yliopisto}%
  357.    \renewcommand*{\authorname}{Tekij\"a}%
  358.    \renewcommand*{\thesisname}{Ty\"on nimi}%
  359.    \renewcommand*{\keywordsname}{Avainsanat}%
  360.    \renewcommand*{\datename}{P\"aiv\"am\"a\"ar\"a}%
  361.    \renewcommand*{\langname}{Kieli}%
  362.    \renewcommand*{\nofpgsname}{Sivum\"a\"ar\"a}%
  363.    \renewcommand*{\supervisorname}{%
  364.      \ifthenelse{\value{advisors}=0}{%
  365.        \ifthenelse{\boolean{BSc}}%
  366.                   {Vastuuopettaja ja ohjaaja}{Ty\"on valvoja ja ohjaaja}%
  367.      }{%
  368.        \ifthenelse{\boolean{BSc}}{Vastuuopettaja}{Ty\"on valvoja}%
  369.      }%
  370.    }%
  371.    \renewcommand*{\advisorname}{%
  372.      \ifthenelse{\value{advisors}=0}{}{%
  373.        \ifthenelse{\value{advisors}=1}{Ty\"on ohjaaja}{%
  374.          \ifthenelse{\value{advisors}>1}{Ty\"on ohjaajat}{%
  375.      }}}%%%
  376.    }%
  377.    \renewcommand*{\degprogramname}{Koulutusohjelma}%
  378.    \renewcommand*{\professorshipname}{Professuuri}%
  379.    \renewcommand*{\codename}{Koodi}%
  380.    \ifthenelse{\boolean{BSc}}{%
  381.      \renewcommand*{\absheadname}{kandidaatinty\"on tiivistelm\"a}%
  382.      \settowidth{\absheadlen}{KANDIDAATINTYON}%
  383.    }{}%
  384.    \ifthenelse{\boolean{MSc}}{%
  385.      \renewcommand*{\absheadname}{diplomity\"on tiivistelm\"a}{}%
  386.      \settowidth{\absheadlen}{DIPLOMITYON}%
  387.    }{}%
  388.    \ifthenelse{\boolean{Lic}}{%
  389.      \renewcommand*{\absheadname}{lisensiaatintutkimuksen tiivistelm\"a}{}%
  390.      \settowidth{\absheadlen}{LISENSIAATINTUTKIMUKSEN}%
  391.    }{}%
  392.  }{}% end if Finnish
  393.  \IfSwe{\AbstractLang}{%
  394.    %% School is common to cover page and abstract (Swedish)
  395.    \ifthenelse{\boolean{ARTS}}{%
  396.      \renewcommand*{\sch@@l}{H\"ogskolan f\"or konst, design och arkitektur}%
  397.    }{}%
  398.    \ifthenelse{\boolean{BIZ}}{%
  399.      \renewcommand*{\sch@@l}{Handelsh\"ogskolan}%
  400.    }{}%
  401.    \ifthenelse{\boolean{CHEM}}{%
  402.      \renewcommand*{\sch@@l}{H\"ogskolan f\"or kemiteknik}%
  403.    }{}%
  404.    \ifthenelse{\boolean{ELEC}}{%
  405.      \renewcommand*{\sch@@l}{H\"ogskolan f\"or elektroteknik}%
  406.    }{}%
  407.    \ifthenelse{\boolean{ENG}}{%
  408.      \renewcommand*{\sch@@l}{H\"ogskolan f\"or ingenj\"orsvetenskaper}%
  409.    }{}%
  410.    \ifthenelse{\boolean{SCI}}{%
  411.      \renewcommand*{\sch@@l}{H\"ogskolan f\"or teknikvetenskaper}%
  412.    }{}%
  413.    %% Abstract header and field names in Swedish
  414.    \renewcommand*{\univ@rsity}{aalto-universitetet}%
  415.    \renewcommand*{\authorname}{F\"orfattare}%
  416.    \renewcommand*{\thesisname}{Titel}%
  417.    \renewcommand*{\keywordsname}{Nyckelord}%
  418.    \renewcommand*{\datename}{Datum}%
  419.    \renewcommand*{\langname}{Spr\aa k}%
  420.    \renewcommand*{\nofpgsname}{Sidantal}%
  421.    \renewcommand*{\supervisorname}{%
  422.      \ifthenelse{\value{advisors}=0}{%
  423.        \ifthenelse{\boolean{BSc}}%
  424.                   {Ansvarsl\"arare}{\"Overvakare och handledare}%
  425.      }{%
  426.        \ifthenelse{\boolean{BSc}}{Ansvarsl\"arare}{\"Overvakare}%
  427.      }%
  428.    }%
  429.    \renewcommand*{\advisorname}{%
  430.      \ifthenelse{\value{advisors}=0}{}{%
  431.        \ifthenelse{\value{advisors}=1}{Handledare}{%
  432.          \ifthenelse{\value{advisors}>1}{Handledare}{%
  433.      }}}%%%
  434.    }%
  435.    \renewcommand*{\degprogramname}{Utbildningsprogram}%
  436.    \renewcommand*{\professorshipname}{Professur}%
  437.    \renewcommand*{\codename}{Kod}%
  438.    \ifthenelse{\boolean{BSc}}{%
  439.      \renewcommand*{\absheadname}{sammandrag av kandidatarbetet}%
  440.      \settowidth{\absheadlen}{KANDIDATARBETET}%
  441.    }{}%
  442.    \ifthenelse{\boolean{MSc}}{%
  443.      \renewcommand*{\absheadname}{sammandrag av diplomarbetet}%
  444.      \settowidth{\absheadlen}{DIPLOMARBETET}%
  445.    }{}%
  446.    \ifthenelse{\boolean{Lic}}{%
  447.      \renewcommand*{\absheadname}{sammandrag av licentiatavhandlingen}{}%
  448.      \settowidth{\absheadlen}{LICENTIATAVHANDLINGEN}%
  449.    }{}%
  450.  }{}% end if Swedish
  451. }%
  452. %
  453. \newcommand*{\L@ng}[1]{% internal macro:
  454. % Determine the language of the thesis and write it into the abstract in the.
  455. % appropriate field. The supplied (language) parameter is supplied from the
  456. % abstract environment, which is specified by the user to the abstract
  457. % environment.
  458.  \IfEng{#1}{%
  459.    \ifthenelse{\equal{\MainLang}{english}}{English}{}
  460.   \ifthenelse{\equal{\MainLang}{finnish}}{Finnish}{}
  461.   \ifthenelse{\equal{\MainLang}{swedish}}{Swedish}{}
  462. }{}%
  463.  \IfFin{#1}{%
  464.    \ifthenelse{\equal{\MainLang}{english}}{Englanti}{}
  465.   \ifthenelse{\equal{\MainLang}{finnish}}{Suomi}{}
  466.   \ifthenelse{\equal{\MainLang}{swedish}}{Ruotsi}{}
  467. }{}%
  468.  \IfSwe{#1}{%
  469.    \ifthenelse{\equal{\MainLang}{english}}{Engelska}{}
  470.   \ifthenelse{\equal{\MainLang}{finnish}}{Finska}{}
  471.   \ifthenelse{\equal{\MainLang}{swedish}}{Svenska}{}
  472. }{}%
  473. }%
  474. %
  475. \newcommand{\settocabslang}{% internal macro:
  476. % Sets value of \tocabslang, the extra text that goes into the toc when
  477. % there are more abstracts than one. The value of \tocabslang has to be set
  478. % explicitly prior to use, since it is used in \addcontentsline in the
  479. % abstractpage environment, and so it may not contain any \ifthenelse commands.
  480. % Thus making \tocabslang decide with an \ifthenelse results in an error since
  481. % it is part of the argument of \addcontentsline
  482.  \ifthenelse{\equal{\MainLang}{\AbstractLang}}{%
  483.    \renewcommand*{\tocabslang}{}%
  484.  }{%
  485.  \IfEng{\MainLang}{%
  486.     \IfFin{\AbstractLang}{\renewcommand*{\tocabslang}{(in Finnish)}}{%
  487.       \IfSwe{\AbstractLang}{\renewcommand*{\tocabslang}{(in Swedish)}}{}}%
  488.   }{}%
  489.   \IfFin{\MainLang}{%
  490.     \IfEng{\AbstractLang}{\renewcommand*{\tocabslang}{(englanniksi)}}{%
  491.       \IfSwe{\AbstractLang}{\renewcommand*{\tocabslang}{(ruotsiksi)}}{}}%
  492.   }{}%
  493.   \IfSwe{\MainLang}{%
  494.     \IfEng{\AbstractLang}{\renewcommand*{\tocabslang}{(p\aa{} engelska)}}{%
  495.       \IfFin{\AbstractLang}{\renewcommand*{\tocabslang}{(p\aa{} finska)}}{}}%
  496.    }{}%
  497.  }{}%
  498. }%
  499. %
  500. %% This ends the definitions of language-specific variables
  501. %
  502. \AtBeginDocument{\setthesismainlangnames\setabstractlangnames}%
  503. %
  504. %%%%%% Interface commands: parameters specified by user (+ necessary variables).
  505. %% Some have been automatically set up in the language-specific part but can
  506. %% be overrun by the user via these macros.
  507. %% First the straightforward ones:
  508. %
  509. \newcommand*{\@uth@r}{}% variable
  510. \renewcommand*{\author}[1]{\renewcommand*{\@uth@r}{#1}}% User command
  511. %
  512. \newcommand{\th@sistitl@}{}% variable
  513. \newcommand{\thesistitle}[1]{ \renewcommand{\th@sistitl@}{#1}}% User command
  514. %
  515. \newcommand*{\D@te}{}% variable
  516. \renewcommand*{\date}[1]{\renewcommand*{\D@te}{#1}}% User command
  517. %
  518. \newcommand*{\pl@ce}{}% variable
  519. \newcommand*{\place}[1]{\renewcommand{\pl@ce}{#1}}% User command
  520. %
  521. \newcommand*{\dateandplace}{\pl@ce{} \D@te{}}% Internal macro
  522. %
  523. \newcommand*{\university}[1]{\renewcommand*{\univ@rsity}{#1}}% User command
  524. %
  525. \newcommand*{\school}[1]{\renewcommand*{\sch@@l}{#1}}% User command
  526. %
  527. \newcommand*{\d@gpr@g}{}% variable
  528. \newcommand*{\degreeprogram}[1]{\renewcommand*{\d@gpr@g}{#1}}% User command
  529. %
  530. \newcommand*{\sup@rvis@r}{}% variable
  531. \newcommand*{\supervisor}[1]{\renewcommand*{\sup@rvis@r}{#1}}% User command
  532. %
  533. % user interface for logo used on the cover page
  534. \newcommand*{\@@ltologo}{}% variable
  535. \newcommand{\uselogo}[2]{%
  536.   \renewcommand*{\@@ltologo}{\AaltoLogoSmall{1}{#2}{#1}}%
  537. }%
  538. %
  539. % User commands for M.Sc. and Lic. only
  540. \newcommand*{\pr@fshp}{}% variable
  541. \newcommand*{\professorship}[1]{\renewcommand*{\pr@fshp}{#1}}%
  542. %
  543. \newcommand*{\Cod@}{}% variable
  544. \newcommand*{\code}[1]{\renewcommand{\Cod@}{#1}}% User command
  545. %
  546. \newcommand*{\dep@rtment}{}% variable
  547. \newcommand*{\department}[1]{\renewcommand*{\dep@rtment}{#1}}% User command
  548. %
  549. % Then come the more complex macros:
  550. % First some boolean flags
  551. \newboolean{BSc}%
  552. \setboolean{BSc}{false}%
  553. \newboolean{MSc}%
  554. \setboolean{MSc}{false}%
  555. \newboolean{Lic}%
  556. \setboolean{Lic}{false}%
  557. \newcommand*{\univdegree}[1]{% User command
  558.  \ifthenelse{\equal{#1}{BSc}}{%
  559.   \setboolean{BSc}{true}\setboolean{MSc}{false}\setboolean{Lic}{false}%
  560.  }{%
  561.  \ifthenelse{\equal{#1}{MSc}}{%
  562.   \setboolean{BSc}{false}\setboolean{MSc}{true}\setboolean{Lic}{false}%
  563.  }{%
  564.  \ifthenelse{\equal{#1}{Lic}}{%
  565.   \setboolean{BSc}{false}\setboolean{MSc}{false}\setboolean{Lic}{true}%
  566. }{%
  567.   \PackageError{aaltothesis}%
  568.            {Only BSc, MSc or Lic is allowed as parameter for degree.}%
  569.            {Use BSc, MSc or Lic.}%
  570.  }}}%
  571. }%
  572. %
  573. \newcounter{advisors}%
  574. \newcommand*{\advis@rA}{}%
  575. \newcommand*{\advis@rB}{}%
  576. \newcommand*{\advisor}[1]{% User command
  577.  \stepcounter{advisors}%
  578.  \ifthenelse{\value{advisors}=1}{%
  579.    \renewcommand*{\advis@rA}{#1}%
  580.  }{%
  581.  \ifthenelse{\value{advisors}=2}{%
  582.    \renewcommand*{\advis@rB}{#1}%
  583.  }{\PackageError{aaltothesis}{Only 2 advisors are allowed.}%
  584.    {Give at most 2 advisors or hack the code.}}%
  585.  }%
  586. }%
  587. \newcommand*{\Advis@r}[1]{% internal macro
  588.  \ifthenelse{\equal{#1}{1}}{% One advisor
  589.    \advis@rA{}%
  590.  }{%
  591.  \ifthenelse{\equal{#1}{2}}{% Two advisors
  592.    \advis@rB{}%
  593.  }{%
  594.    \PackageError{aaltothesis}{Only 2 advisors are allowed.}%
  595.                 {Give at most 2 advisors or hack the code.}}%
  596.  }%
  597. }%
  598. %
  599. %%
  600. %% Two cover-related internal macros
  601. %%
  602. \newcommand*{\cov@rsup@rvisor}{%
  603.  \ifthenelse{\equal{\sup@rvis@r}{\advis@rA}}% same supervisor & instructor
  604.    {\setcounter{advisors}{0}%
  605.     \thesissuperadvisorname:%
  606.    }{%
  607.      \thesissupervisorname:%
  608.    }%
  609. }%
  610. %
  611. \newcommand*{\cov@radvisor}{%
  612.  \ifthenelse{\value{advisors}=0}{}{%
  613.  \ifthenelse{\value{advisors}=1}{\thesisadvisorname:}{%
  614.  \ifthenelse{\value{advisors}>1}{\thesisadvisorsname:}%
  615.  }}%
  616. }%
  617. %
  618. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  619. %%%%%%%%%%%%%%%% Do the cover page layout %%%%%%%%%%%%%%%%
  620. \pagenumbering{roman}%
  621. \newlength{\coverpageindent}%
  622. \setlength{\coverpageindent}{10mm}%
  623. \newlength{\coverindent}%
  624. \setlength{\coverindent}{5cm}%
  625. \newcommand{\makecoverpage}{%
  626.  \pagestyle{empty}%
  627.  \noindent% Position the title and author
  628.  % The title and author, each in their own box, are place in an enclosing
  629.  % box with its height limited so as to
  630.  % 1. fix the position of the text that follows on the page and
  631.  % 2. to prevent unnecessarily long titles.
  632.  % The vertical space for the title is 120pt, followed by a 6-mm blank
  633.  % space, and the author's name is typeset in a 12-pt high font.
  634.  \hspace*{\coverpageindent}%
  635.  \parbox[t][132pt+6mm]{0.75\textwidth-\coverpageindent}{%
  636.    \noindent% First position the title
  637.    \parbox[t]{0.75\textwidth-\coverpageindent}{\raggedright%
  638.      \usefont{T1}{phv}{b}{n}\fontsize{15}{15}\selectfont{\th@sistitl@}}\par%
  639.    \vspace{6mm}%
  640.    \noindent% followed by the author
  641.    \parbox{0.75\textwidth-\coverpageindent}{\textbf{\@uth@r}}\par%
  642.  }\par
  643.  \vspace{20mm}%
  644.  \noindent%
  645.  \hspace*{\coverpageindent}%
  646.  \parbox{0.75\textwidth-\coverpageindent}{\raggedright\small%
  647.   {\usefont{T1}{phv}{b}{n}\fontsize{9}{11.1}%
  648.    \selectfont{\textcolor{black}{\sch@@l}}}\\[1em]% Position the school
  649.   \covertext% Position the degree-work text
  650.  }\par%
  651.  \vspace{1ex}%
  652.  \noindent%
  653.  \hspace*{\coverpageindent}%
  654.  \parbox{0.75\textwidth-\coverpageindent}{%
  655.   \raggedright%
  656.   \small%
  657.  % Place the date and place; only for the BSc text and text in English
  658.   \ifthenelse{\boolean{BSc}\or\equal{\MainLang}{english}}{\dateandplace\par}{}%
  659.   \vspace{23mm}%
  660.   \noindent%
  661.   \textbf{\cov@rsup@rvisor}\par%
  662.   \vspace{1em}%
  663.   \hspace{\coverindent}\sup@rvis@r\par%
  664.   \ifthenelse{\value{advisors}>0}{%
  665.    \vspace{2em}%
  666.    \noindent%
  667.    \textbf{\cov@radvisor}\par%
  668.    \vspace{1em}%
  669.    \hspace{\coverindent}\Advis@r{1}%
  670.   }{}%
  671.   \ifthenelse{\value{advisors}>1}{%
  672.    \par%
  673.    \vspace{4em}%
  674.    \hspace{\coverindent}\Advis@r{2}%
  675.   }{}%
  676.  }%
  677.  \vfill%
  678.  \noindent%
  679.  \hspace{\coverpageindent}%
  680.  \@@ltologo%
  681.  \cleardoublepage%
  682.  \pagestyle{myheadings}%
  683. }%
  684. %%%%%%%%%%%%%% End of the cover page layout %%%%%%%%%%%%%%
  685. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  686. %
  687. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  688. %%%%%%%%%%%%%%% Abstract stuff begins here %%%%%%%%%%%%%%%
  689. %% First some lengths and internal macros
  690. \newlength{\absheadlen}% Sets width of 2nd column of the abstract header
  691. \newlength{\abstractwidth}%
  692. \AtBeginDocument{\setlength{\abstractwidth}{\textwidth-\columnsep}}%
  693. \newlength{\rowsep}%
  694. \setlength{\rowsep}{-\columnsep}%
  695. \newlength{\keywdparheight}%
  696. \setlength{\keywdparheight}{3\baselineskip}%
  697. \newlength{\auxwidth}%
  698. %
  699. \newcommand*{\@bsbre@k}{\\\\[\rowsep]\hline\\[\rowsep]}%
  700. \newcommand{\@bsbox}[2]{\parbox[t][#1]{\abstractwidth}{#2}\@bsbre@k}%
  701. %
  702. \newcommand{\@bsfield}[3][]{%
  703.  \settowidth{\auxwidth}{#2: }%
  704.  \parbox[t][#1]{\auxwidth}{#2: }%
  705.  \parbox[t][#1]{\abstractwidth-\auxwidth-\columnsep}{#3}%
  706. }%
  707. %
  708. \newcommand{\@bs@uthor}[1]{\@bsfield{\authorname}{#1}\vfill}%
  709. \newcommand{\@bstitlen@me}[1]{\@bsfield{\thesisname}{\raggedright#1}\vfill}%
  710. \newcommand*{\k@yw@rds}{}%
  711. \newcommand{\keywords}[1]{\renewcommand*{\k@yw@rds}{#1}}%
  712. %
  713. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  714. %%%%%%%%%%%%%%%% The abstract page layout %%%%%%%%%%%%%%%%
  715. \newenvironment{abstractpage}[1][\MainLang]{%
  716.  \IfEng{#1}{\renewcommand*{\AbstractLang}{english}%
  717.  }{%
  718.  \IfFin{#1}{\renewcommand*{\AbstractLang}{finnish}%
  719.  }{%
  720.  \IfSwe{#1}{\renewcommand*{\AbstractLang}{swedish}%
  721.  }{%
  722.    \PackageError{aaltothesis}%
  723.      {Only english, finnish or swedish is allowed as optional parameter.}%
  724.      {Use english, finnish or swedish.}%
  725.  }}}%
  726.  \setabstractlangnames%
  727.  \phantomsection%
  728.  \settocabslang%
  729.  \addcontentsline{toc}{section}{\abstractname{} \tocabslang}%
  730.  \thispagestyle{empty}%
  731.  \enlargethispage{5mm}%
  732.  \noindent%
  733.  \begin{tabular}{@{}p{\abstractwidth-\absheadlen}p{\absheadlen}@{}}%
  734.   \parbox[t]{\abstractwidth-\absheadlen}{%
  735.     \textsc{\MakeLowercase{\univ@rsity}\\\MakeLowercase{\sch@@l}}}%
  736.   & \parbox[t]{\absheadlen}{\raggedleft\textsc{\absheadname}}\\%
  737.   &\\[-2mm]%
  738.  \end{tabular}%
  739.  \par%
  740.  \noindent%
  741.  \begin{tabular}{|l|}%
  742.    \hline\\[\rowsep]%
  743.    \@bsbox{26mm}{\@bs@uthor{\@uth@r}\@bstitlen@me{\th@sistitl@{}}%
  744.      \datename: \D@te{} \hfill \langname: \L@ng{#1} \hfill \nofpgsname: %
  745.      \arabic{NInitPages}+\arabic{NMainPages}}%
  746.    \ifthenelse{\boolean{BSc}}{%
  747.      \@bsbox{5mm}{\degprogramname: \d@gpr@g{}\par\vfill}%
  748.      \ifthenelse{\value{advisors}=0}{%
  749.        \@bsbox{5mm}{\supervisorname: \sup@rvis@r{}%
  750.        }%
  751.      }{%
  752.        \@bsbox{12mm}{\supervisorname: \sup@rvis@r{}\par\vfill%
  753.          \advisorname: \Advis@r{1}%
  754.          \ifthenelse{\value{advisors}>1}{, \Advis@r{2}}{}}%
  755.      }%
  756.    }{%
  757.      \@bsbox{12mm}{%
  758.        \dep@rtment{}\par\vfill%
  759. %       \professorshipname: \pr@fshp{}}\hfill\codename: \Cod@}%
  760.        \professorshipname: \pr@fshp{}}%
  761.      \ifthenelse{\value{advisors}=0}{%
  762.        \@bsbox{5mm}{\supervisorname: \sup@rvis@r{}%
  763.        }%
  764.      }{%
  765.        \@bsbox{12mm}{\supervisorname: \sup@rvis@r{}\par\vfill%
  766.          \advisorname: \Advis@r{1}%
  767.          \ifthenelse{\value{advisors}>1}{, \Advis@r{2}}{}%
  768.        }%
  769.      }%
  770.    }%
  771.    \begin{minipage}[t][133mm]{\abstractwidth}%
  772.    \ifthenelse{\equal{\MainLang}{\AbstractLang}}{}{\begin{otherlanguage*}{#1}}%
  773. }{%
  774.    \ifthenelse{\equal{\MainLang}{\AbstractLang}}{}{\end{otherlanguage*}}%
  775.    \end{minipage}%
  776.    \@bsbre@k\@bsfield[\keywdparheight]{\keywordsname}{\k@yw@rds}\\\hline%
  777.   \end{tabular}%
  778.   \setcounter{advisors}{0}%
  779.   \clearpage%
  780. }%
  781. %%%%%% Abstract stuff ends here %%%%%%
  782. %
  783. %% A few more macros
  784. %%
  785. %% \phantomsection is the command used by hyperref to set a bookmark to
  786. %% starred sections so that links have the right target, e.g. in a toc.
  787. %% \phantomsection is a dummy command without the hyperref package.
  788. \AtBeginDocument{\providecommand*{\phantomsection}{}}%
  789. %
  790. \newcommand*{\mysection}[1]{%
  791. \newpage%
  792. \section*{#1}%
  793. \addcontentsline{toc}{section}{#1}%
  794. }%
  795. %
  796. \newcommand{\thesistableofcontents}{%
  797. \phantomsection%
  798. \addcontentsline{toc}{section}{\contentsname}%
  799. \tableofcontents%
  800. }%
  801. %
  802. \newcommand{\thesisappendix}{%
  803. \appendix
  804. %\phantomsection
  805. %% Adds the word "Appendices" to the table of contents
  806. %\addcontentsline{toc}{section}{Liiteet}
  807. %\addcontentsline{toc}{section}{Appendices}
  808. \counterwithin{equation}{section}%
  809. \renewcommand{\theequation}{\thesection\arabic{equation}}%
  810. \counterwithin{figure}{section}%
  811. \renewcommand{\thefigure}{\thesection\arabic{figure}}%
  812. \renewcommand{\theHfigure}{\thesection\arabic{figure}}% for hyperref
  813. \counterwithin{table}{section}%
  814. \renewcommand{\thetable}{\thesection\arabic{table}}%
  815. \renewcommand{\theHtable}{\thesection\arabic{table}}% for hyperref
  816. }%
  817. %
  818. \newcommand*{\thesisbibliography}{%
  819. \phantomsection%
  820. \addcontentsline{toc}{section}{\refname}%
  821. }
  822. %
  823. \AtBeginDocument{\pagestyle{myheadings}}%
  824. %
  825. \endinput
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement