liuthesis.cls 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  1. %%% liuthesis.cls ---
  2. %%
  3. %% Filename: liuthesis.cls
  4. %% Description:
  5. %% Author: Ola Leifler
  6. %% Maintainer:
  7. %% Created: Fri Mar 20 08:25:23 2009 (CET)
  8. %% Version:
  9. %% Last-Updated: Mon Apr 16 15:04:30 2018 (+0200)
  10. %% By: Ola Leifler
  11. %% Update #: 1560
  12. %% URL:
  13. %% Keywords:
  14. %% Compatibility:
  15. %%
  16. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  17. %%
  18. %%% Commentary:
  19. %%
  20. %% Read the README instead...
  21. %%
  22. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  23. %%
  24. %%% Change log:
  25. %%
  26. %%
  27. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  28. %%
  29. %% This program is free software; you can redistribute it and/or
  30. %% modify it under the terms of the GNU General Public License as
  31. %% published by the Free Software Foundation; either version 3, or
  32. %% (at your option) any later version.
  33. %%
  34. %% This program is distributed in the hope that it will be useful,
  35. %% but WITHOUT ANY WARRANTY; without even the implied warranty of
  36. %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  37. %% General Public License for more details.
  38. %%
  39. %% You should have received a copy of the GNU General Public License
  40. %% along with this program; see the file COPYING. If not, write to
  41. %% the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  42. %% Floor, Boston, MA 02110-1301, USA.
  43. %%
  44. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  45. %%
  46. %%% Code:
  47. \NeedsTeXFormat{LaTeX2e}
  48. \ProvidesClass{liuthesis} [2017/04/20 Thesis class for LiU]
  49. \typeout{Undergraduate and graduate thesis class for LiU by Ola Leifler - v 1.1}
  50. \def\createvariable#1{%
  51. \expandafter\def\csname #1\endcsname{\expandafter\gdef\csname @#1\endcsname}
  52. \csname #1\endcsname{\texttt{\textbackslash #1}}
  53. }
  54. % \def\createconditionalvariable#1{
  55. % \expandafter\newif\csname if#1\endcsname
  56. % \csname #1 false\endcsname
  57. % \def\csname#1\endcsname
  58. % }
  59. \RequirePackage{xkeyval}
  60. \RequirePackage{ifxetex}
  61. \ifxetex
  62. \else
  63. \RequirePackage[utf8]{inputenc}
  64. \fi
  65. \RequirePackage[absolute]{textpos}
  66. % For conditionally including lists of tables and figures
  67. \RequirePackage[figure,table]{totalcount}
  68. \createvariable{edition}
  69. \createvariable{presentationroom}
  70. \createvariable{presentationbuilding}
  71. \createvariable{presentationcampus}
  72. \createvariable{presentationdate}
  73. \createvariable{presentationdateenglish}
  74. \createvariable{presentationtime}
  75. \createvariable{thesislanguage}
  76. \createvariable{faculty}
  77. \createvariable{issn}
  78. \createvariable{degreeprefix}
  79. \createvariable{degreesuffix}
  80. \createvariable{exhibittext}
  81. \createvariable{exhibittextswedish}
  82. \createvariable{opponenttitle}
  83. \createvariable{opponentname}
  84. \createvariable{opponentuniversity}
  85. \createvariable{opponentcountry}
  86. \createvariable{thesisnumber}
  87. \createvariable{subseries}
  88. \createvariable{subseriesnumber}
  89. \newif\ifsubseries
  90. \subseriesfalse
  91. \createvariable{currentyearthesisnumber}
  92. \createvariable{supportedby}
  93. \createvariable{publicationyear}
  94. \createvariable{publicationmonth}
  95. \createvariable{isbn}
  96. \createvariable{supervisor}
  97. \createvariable{examiner}
  98. \createvariable{titleenglish}
  99. \createvariable{titleswedish}
  100. \createvariable{keywords}
  101. \createvariable{keywordsswedish}
  102. \createvariable{department}
  103. \createvariable{departmentenglish}
  104. \createvariable{departmentshort}
  105. \createvariable{division}
  106. \createvariable{divisionshort}
  107. \createvariable{dateofpublication}
  108. \createvariable{publicationseries}
  109. % Undergrad specific
  110. \createvariable{area}
  111. \createvariable{level}
  112. \createvariable{thesistypenameswedish}
  113. \createvariable{thesistypenameenglish}
  114. \createvariable{thesiscredits}
  115. \createvariable{thesissubject}
  116. \createvariable{thesissubjectenglish}
  117. \newif\ifsubtitleswedish
  118. \subtitleswedishfalse
  119. \def\subtitleswedish#1{\subtitleswedishtrue\gdef\@subtitleswedish{#1}}
  120. \newif\ifsubtitleenglish
  121. \subtitleenglishfalse
  122. \def\subtitleenglish#1{\subtitleenglishtrue\gdef\@subtitleenglish{#1}}
  123. \newif\ifdedication
  124. \dedicationfalse
  125. \def\dedication#1{\dedicationtrue\gdef\@dedication{#1}}
  126. \newif\ifexternalsupervisor
  127. \externalsupervisorfalse
  128. \def\externalsupervisor#1{\externalsupervisortrue\gdef\@externalsupervisor{#1}}
  129. \createvariable{divanumber}
  130. % Include the abstract
  131. \gdef\@abstract{\input{abstract}}
  132. \gdef\@sammanfattning{\input{sammanfattning.tex}}
  133. \gdef\@acknowledgments{\input{acknowledgments.tex}}
  134. \newif\iflith
  135. \lithtrue
  136. \newif\ifhu
  137. \newif\iffilfak
  138. \newif\ifphd
  139. % \phdtrue
  140. \newif\iflic
  141. \licfalse
  142. \newif\ifstudent
  143. \studenttrue
  144. \newif\ifprinterfriendly
  145. \printerfriendlyfalse
  146. \DeclareOption{hu}{%
  147. \hutrue
  148. \lithfalse
  149. \filfakfalse
  150. \faculty{Faculty of Health Sciences}
  151. \gdef\@facultyshort{HU}
  152. \gdef\@facultyshortlogo{hu}
  153. \publicationseries{Linköping University Medical Dissertations}
  154. \degreeprefix{medicine}
  155. }
  156. \DeclareOption{lith}{%
  157. \lithtrue
  158. \hufalse
  159. \filfakfalse
  160. \faculty{Institute of Technology}
  161. \publicationseries{Linköping Studies in Science and Technology}
  162. \degreeprefix{teknologie}
  163. \gdef\@facultyshort{Tek}
  164. \gdef\@facultyshortlogo{lith}
  165. \gdef\@area{LITH}
  166. }
  167. \DeclareOption{filfak}{%
  168. \filfaktrue
  169. \lithfalse
  170. \hufalse
  171. \faculty{Philosophical faculty}
  172. \gdef\@facultyshort{FilFak}
  173. \gdef\@facultyshortlogo{filfak}
  174. \publicationseries{Linköping Studies in Arts and Sciences}
  175. \degreeprefix{filosofie}
  176. % \gdef\@area{FFK-UP}
  177. }
  178. \DeclareOption{msc}{%
  179. \studenttrue
  180. \phdfalse
  181. \licfalse
  182. \level{A}
  183. \gdef\@thesistypenameenglish{Master's}
  184. \gdef\@thesistypenameswedish{avancerad nivå}
  185. \thesiscredits{30}
  186. \PassOptionsToClass{oneside}{memoir}
  187. }
  188. \DeclareOption{bachelor}{%
  189. \studenttrue
  190. \phdfalse
  191. \licfalse
  192. \level{ET}
  193. \gdef\@thesistypenameenglish{Bachelor's}
  194. \gdef\@thesistypenameswedish{grundnivå}
  195. \thesiscredits{16}
  196. \PassOptionsToClass{oneside}{memoir}
  197. }
  198. \DeclareOption{lic}{%
  199. \lictrue
  200. \phdfalse
  201. \studentfalse
  202. }
  203. \DeclareOption{phd}{%
  204. \licfalse
  205. \studentfalse
  206. \phdtrue
  207. }
  208. \DeclareOption{printerfriendly}{%
  209. \printerfriendlytrue
  210. }
  211. \DeclareOption{swedish}{%
  212. \thesislanguage{swedish}
  213. }
  214. \DeclareOption{english}{%
  215. \thesislanguage{english}
  216. }
  217. \newif\ifexhibitpage
  218. \exhibitpagefalse
  219. \DeclareOption{exhibitpage}{%
  220. \exhibitpagetrue
  221. \PassOptionsToClass{oneside}{memoir}
  222. }
  223. % % % Add the necessary biblatex options to the class options
  224. % \DeclareOptionX{biblatexoptions}{%
  225. % \gdef\@biblatexoptions{#1}
  226. % \PassOptionsToPackage{\@biblatexoptions}{biblatex}
  227. % }
  228. % \DeclareOptionX{memoiroptions}{%
  229. % \PassOptionsToClass{#1}{memoir}
  230. % }
  231. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{memoir}}
  232. \ExecuteOptions{english,phd,lith,a4paper}
  233. \ProcessOptions*
  234. %% There is a special exception to the rule that publication series
  235. %% are defined by the faculty, and that is the philosophical faculty
  236. %% that uses a special series for licentiate theses
  237. \iflic
  238. \iffilfak
  239. \publicationseries{Faculty of Arts and Sciences}
  240. \fi
  241. \fi
  242. \LoadClass{memoir}
  243. \RequirePackage{color}
  244. \RequirePackage[svgnames]{xcolor}
  245. \RequirePackage{pdfpages}
  246. \RequirePackage{tikz}
  247. \RequirePackage{pbox}
  248. \RequirePackage{ifthen}
  249. \RequirePackage{geometry}
  250. \RequirePackage[pdfusetitle]{hyperref}
  251. \RequirePackage{amssymb}
  252. \RequirePackage{amsmath}
  253. \RequirePackage{etoolbox}
  254. % Set up input encoding and font handling
  255. \ifxetex
  256. \RequirePackage[MnSymbol]{mathspec}
  257. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  258. % Some versions of latex have issues with mathspec, see
  259. % https://tex.stackexchange.com/questions/85696/what-causes-this-strange-interaction-between-glossaries-and-amsmath
  260. \let\RequirePackage\original@RequirePackage
  261. \let\usepackage\RequirePackage
  262. % End workaround
  263. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  264. \RequirePackage{xltxtra}
  265. \defaultfontfeatures{Mapping=tex-text}
  266. \else
  267. \RequirePackage{graphicx}
  268. \RequirePackage{palatino}
  269. \RequirePackage{mathabx}
  270. \RequirePackage{mathpazo}
  271. \RequirePackage[T1]{fontenc}
  272. \fi
  273. \ifphd
  274. \gdef\@degreetype{\@degreeprefix {} doktorsexamen}
  275. \gdef\@degreetypeenglish{Doctor of \@degreesuffix}
  276. \else
  277. \iflic
  278. \gdef\@degreetype{\@degreeprefix {} licentiatexamen}
  279. \gdef\@degreetypeenglish{Licentiate degree in \@degreesuffix}
  280. \fi
  281. \fi
  282. \iflith
  283. \iflic
  284. \issn{0280-7971}
  285. \fi
  286. \ifphd
  287. \issn{0345-7524}
  288. \fi
  289. \fi
  290. % We use the same series for lic and PhD at Filfak/HU
  291. \ifhu
  292. % \ifphd
  293. \issn{0345-0082}
  294. % \fi
  295. % \iflic
  296. % \typeout{Please define the ISSN by issuing a \textbackslash issn command}
  297. % \issn{\textbackslash\texttt{issn}}
  298. % \fi
  299. \fi
  300. \iffilfak
  301. % \ifphd
  302. \issn{0282-9800}
  303. % \fi
  304. % \iflic
  305. % \typeout{Please define the ISSN by issuing a \textbackslash issn command}
  306. % \issn{\textbackslash\texttt{issn}}
  307. % \fi
  308. \fi
  309. \newcommand{\swedishenglish}[2]{
  310. \ifthenelse{\equal{\@thesislanguage}{swedish}}{#1}{#2}
  311. }
  312. \RequirePackage{csquotes}
  313. \ifxetex
  314. \RequirePackage{polyglossia}
  315. \swedishenglish{
  316. \setmainlanguage{swedish}
  317. \setotherlanguages{english}
  318. }{
  319. \setmainlanguage{english}
  320. \setotherlanguages{swedish}
  321. }
  322. \else
  323. \swedishenglish{
  324. \RequirePackage[swedish]{babel}
  325. }{
  326. \RequirePackage[english]{babel}
  327. }
  328. \fi
  329. %% Include articles
  330. \RequirePackage{calc}
  331. \RequirePackage{ragged2e}
  332. \definecolor{nicered}{rgb}{.647,.129,.149}
  333. \newsavebox{\feline@article}
  334. \newcommand\feline@article@marker[1][4cm]{%
  335. \sbox\feline@article{%
  336. \resizebox{!}{#1}{\fboxsep=1pt%
  337. \colorbox{nicered}{\color{white}\bfseries\thearticle\phantom{.}}%
  338. }}%
  339. \rotatebox{90}{%
  340. \resizebox{%
  341. \heightof{\usebox{\feline@article}}+\depthof{\usebox{\feline@article}}}%
  342. {!}{{\scshape \MakeUppercase Paper}}}\quad%
  343. \raisebox{\depthof{\usebox{\feline@article}}}{\usebox{\feline@article}}%
  344. }
  345. \newcommand\feline@chm[1][4cm]{%
  346. \sbox\feline@article{\feline@article@marker[#1]}%
  347. \makebox[0pt][l]{% aka \rlap
  348. \makebox[\spinemargin][r]{
  349. \usebox\feline@article
  350. }
  351. }
  352. }
  353. \newcounter{article}
  354. \setcounter{article}{0}
  355. \renewcommand{\thearticle}{\Roman{article}}
  356. \includepdfset{pages=-}
  357. \setlength{\TPVertModule}{2cm}
  358. \setlength{\TPHorizModule}{\paperwidth - 4.3cm}
  359. \newcommand{\papermark}{Paper \thearticle}
  360. \newcommand{\includearticle}[2][pages=-]{%
  361. \@twosidetrue
  362. \refstepcounter{article}%
  363. \cleartorecto%
  364. \thispagestyle{empty}
  365. \mbox{}%
  366. \vspace*{\fill}
  367. \begin{center}%
  368. {\hfill \feline@chm[2.5cm]\\[2\baselineskip]}
  369. {\fullcite{#2}}
  370. \end{center}%
  371. \vspace*{\fill}%
  372. \cleartorecto%
  373. \label{art:#2}%
  374. \addcontentsline{toc}{chapter}{\papermark}%
  375. \includepdf[#1]{#2}%
  376. }
  377. \newenvironment{papers}{
  378. \makeevenhead{ruled}{\papermark}{}{}
  379. \renewcommand*{\thechapter}{\thearticle}
  380. \newlength{\numberheight}
  381. \makechapterstyle{paperstyle}{%
  382. \setlength{\afterchapskip}{40pt}
  383. \setlength{\numberheight}{10mm}
  384. \renewcommand*{\chapterheadstart}{\vspace*{40pt}}
  385. \renewcommand*{\afterchapternum}{\par\nobreak\vskip 25pt}
  386. \renewcommand*{\chapnamefont}{\normalfont\LARGE\flushright}
  387. \renewcommand*{\chapnumfont}{\normalfont\HUGE}
  388. \renewcommand*{\chaptitlefont}{\normalfont\Huge\bfseries\flushright}
  389. \renewcommand*{\printchaptername}{%
  390. }
  391. \renewcommand*{\chapternamenum}{}
  392. \renewcommand*{\printchapternum}{%
  393. }%
  394. \makeoddfoot{plain}{}{}{\thepage}}
  395. \renewcommand{\@chapapp}{\papermark}
  396. \chapterstyle{paperstyle}
  397. }{}
  398. \newcommand{\includearticletex}[1]{%
  399. \stepcounter{article}%
  400. \cleartorecto%
  401. \thispagestyle{empty}
  402. \mbox{}%
  403. \vspace*{\fill}
  404. \begin{center}%
  405. {\hfill \feline@chm[2.5cm]\\[2\baselineskip]}
  406. {\fullcite{#1}}
  407. \end{center}%
  408. \vspace*{\fill}%
  409. \clearpage{}
  410. \chapter[\papermark][\papermark]{\citetitle{#1}}
  411. \label{art:#1}
  412. \input{papers/#1}%
  413. }
  414. \ifx\pdfoutput\undefined
  415. \else
  416. \pdfoutput=1
  417. \DeclareGraphicsExtensions{.pdf,.jpg,.png}
  418. \fi
  419. \graphicspath{{figures/}}
  420. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  421. % %
  422. % font selection, based on availability %
  423. % %
  424. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  425. \ifxetex
  426. \newcommand*{\@makefont}[2]{
  427. \ClassInfo{liuthesis}{Searching font candidates for \string#1}
  428. \forcsvlist{\listadd\@args}{#2}
  429. \edef\@restore{
  430. \suppressfontnotfounderror=\the\suppressfontnotfounderror\relax
  431. \interactionmode=\the\interactionmode\relax
  432. }
  433. \renewcommand*{\do}[1]{ % Loop body
  434. \ifdefmacro{##1}{
  435. \ifdefvoid{##1}{}{ % else
  436. \let#1##1
  437. \ClassInfo{liuthesis}{\string##1 selected}
  438. \listbreak
  439. }
  440. }{
  441. \batchmode
  442. \suppressfontnotfounderror=1
  443. \ifdef{\IfFontExistsTF}{
  444. \IfFontExistsTF{##1}{
  445. \@restore
  446. \newfontfamily{#1}{##1}
  447. \ClassInfo{liuthesis}{Font ##1 selected}
  448. \listbreak
  449. }{
  450. \@restore
  451. \ClassWarning{liuthesis}{Font ##1 not available}
  452. }
  453. }{
  454. \font\bodyfont="##1"\space at 10pt
  455. \@restore
  456. \ifdefequal{\bodyfont}{\nullfont}{
  457. \ClassWarning{liuthesis}{Font ##1 not available}
  458. }{
  459. \newfontfamily{#1}{##1}
  460. \ClassInfo{liuthesis}{Font ##1 selected}
  461. \listbreak
  462. }
  463. }
  464. }
  465. }
  466. \dolistloop{\@args} % Execute loop
  467. \let\@args\undefined % Clear list
  468. \ifundef{#1}{
  469. \ClassError{liuthesis}{Font for \string#1 not found}{}
  470. \newcommand*{#1}{} % Avoid undefined control sequence errors
  471. }{}
  472. }
  473. \AtBeginDocument{
  474. \@makefont{\@calibri}{Calibri,Carlito}
  475. \ifexhibitpage\iflith\relax\else
  476. \@makefont{\@korolev}{KorolevLiU,\@calibri}
  477. \fi\fi
  478. }
  479. \else
  480. \ClassWarning{liuthesis}{Please use XeTeX and install Calibri for correct typesetting}
  481. \AtBeginDocument{
  482. \IfFileExists{carlito.sty}{
  483. \let\old@sf\sfdefault
  484. \RequirePackage{carlito} % Changes \sfdefault to \carlito
  485. \let\sfdefault\old@sf
  486. \newcommand*{\@calibri}{\carlito}
  487. }{
  488. \ClassWarning{liuthesis}{Package "carlito" not found}
  489. \newcommand*{\@calibri}{}
  490. }
  491. \ifexhibitpage\iflith\relax\else
  492. \let\@korolev\@calibri
  493. \fi\fi
  494. }
  495. \fi % end ifxetex
  496. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  497. % %
  498. % The exhibit page %
  499. % %
  500. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  501. \newcommand{\exhibitpagelith}{%
  502. \@calibri
  503. \copypagestyle{exhibitpagestyle}{plain}
  504. \makeevenfoot{exhibitpagestyle}{ISBN \@isbn}{}{ISSN \@issn}
  505. \makeoddfoot{exhibitpagestyle}{ISBN \@isbn}{}{ISSN \@issn}
  506. \thispagestyle{exhibitpagestyle}
  507. \begin{center}
  508. {\footnotesize \@publicationseries}\\
  509. {\footnotesize \ifphd Dissertations,\else Licentiate Thesis\fi {} No. \@thesisnumber}\\[15mm]
  510. {\Large\bfseries\swedishenglish{\@titleswedish}{\@titleenglish}}\\[5mm]
  511. by\\[5mm]
  512. {\Large\bfseries\@author}
  513. \vfill
  514. {\small\textbf{Akademisk avhandling}\\
  515. som för framläggande av \@degreetype{} i \@thesissubject{}
  516. vid Linköpings universitet kommer att offentligt försvaras i sal
  517. \@presentationroom, hus \@presentationbuilding, universitetsområde
  518. \@presentationcampus, \@presentationdate{} kl. \@presentationtime}\\[2\baselineskip]
  519. \textbf{Fakultetsopponent}\\
  520. \@opponenttitle{} \@opponentname\\
  521. \@opponentuniversity\\
  522. \@opponentcountry
  523. \\[15mm]
  524. \vfill
  525. \includegraphics[width=35mm]{liu_primary_black_en}
  526. \\[15mm]
  527. Linköping University\\
  528. \@departmentenglish\\
  529. \@division\\
  530. SE--581 83 Linköping\\[5mm]
  531. Linköping \@publicationyear\\
  532. \vspace*{1mm}
  533. \end{center}
  534. \clearpage{}
  535. \@calibri
  536. \small \textbf{Abstract}\\
  537. \@abstract
  538. \vfill
  539. \footnotesize
  540. \begin{flushleft}
  541. Keywords: \@keywords\\[3mm]
  542. \@supportedby\mbox{}\\[3mm]
  543. URL: \texttt{http://urn.kb.se/resolve?urn=urn:nbn:se:liu:diva-\@divanumber}\\[3mm]
  544. \end{flushleft}
  545. }
  546. \newcommand{\exhibitpagefilfak}{%
  547. \begin{center}
  548. \@korolev
  549. \@publicationseries{} No. \@thesisnumber
  550. \ifsubseries
  551. \\\@subseries{} No. \@subseriesnumber
  552. \fi
  553. \\[3\baselineskip]
  554. {\Large\@titleswedish\\
  555. \@subtitleswedish}\\[5mm]\fi
  556. \small
  557. {\bfseries\@author}\\[5mm]
  558. {\bfseries Akademisk avhandling}\\
  559. som för framläggande av \@degreetype{} i \@thesissubject{}
  560. vid Filosofiska fakulteten kommer att offentligt försvaras i sal
  561. \@presentationroom, hus \@presentationbuilding, universitetsområde
  562. \@presentationcampus, \@presentationdate{} kl. \@presentationtime\\[2\baselineskip]
  563. {\bfseries Sammanfattning}\\
  564. \@exhibittextswedish\\[6mm]
  565. \vfill
  566. \begin{flushleft}
  567. Nyckelord: \@keywordsswedish\\[3mm]
  568. URL: \texttt{http://urn.kb.se/resolve?urn=urn:nbn:se:liu:diva-\@divanumber}
  569. \end{flushleft}
  570. \includegraphics[width=35mm]{liu_primary_black_sv}\\
  571. \@department\\
  572. Linköpings universitet, 581 83 Linköping\\[5mm]
  573. ISBN \@isbn{} ISSN \@issn
  574. \clearpage{}
  575. \normalsize
  576. {\@publicationseries{} No. \@thesisnumber
  577. \ifsubseries
  578. \\\@subseries{} No. \@subseriesnumber
  579. \fi}
  580. \\[3\baselineskip]
  581. {\Large\@titleenglish\\
  582. \@subtitleenglish}\\[5mm]
  583. \small
  584. {\bfseries\@author}\\[5mm]
  585. {\textbf{Academic dissertation}\\
  586. Academic dissertation for the Degree of \@degreetypeenglish{} in \@thesissubjectenglish{}
  587. at the Faculty of Arts and Sciences to be publicly defended on
  588. \@presentationdateenglish{} at \@presentationtime{} in room
  589. \@presentationroom, building \@presentationbuilding, campus
  590. \@presentationcampus{} by \@author}
  591. \\[2\baselineskip]
  592. {\bfseries Abstract}\\
  593. \@abstract
  594. \vfill
  595. \begin{flushleft}
  596. Keywords: \@keywords\\[3mm]
  597. URL: \texttt{http://urn.kb.se/resolve?urn=urn:nbn:se:liu:diva-\@divanumber}
  598. \end{flushleft}
  599. \includegraphics[width=35mm]{liu_primary_black_en} \\
  600. \@departmentenglish\\
  601. Linköping University, SE--581 83 Linköping\\[5mm]
  602. ISBN \@isbn{} ISSN \@issn
  603. \end{center}
  604. \clearpage{}
  605. }
  606. \newcommand{\gettitle}{\swedishenglish{\@titleswedish}{\@titleenglish}}
  607. \iflic
  608. \newcommand{\isrn}{LIU-\@facultyshort{}-Lic-{}-\@publicationyear:\@currentyearthesisnumber}
  609. \fi
  610. \ifstudent
  611. %\newcommand{\isrn}{LIU-\@departmentshort{}/\@area{}-EX-\@level{}-{}-\@publicationyear/\@currentyearthesisnumber-{}-SE}
  612. \newcommand{\isrn}{LiTH-\@departmentshort{}-EX-\@level{}-{}-\@publicationyear/\@currentyearthesisnumber-{}-SE}
  613. \fi
  614. \newcommand\makeundergraduatetitle{%
  615. {\@calibri
  616. {\raggedleft%
  617. \sffamily%
  618. \swedishenglish{%
  619. \begin{large}%
  620. Linköpings universitet | \@department\par
  621. Examensarbete på \@thesistypenameswedish, \@thesiscredits hp | \@thesissubject\par%
  622. \@dateofpublication\ | \isrn\par%
  623. \end{large}%
  624. }{%
  625. \begin{large}%
  626. Linköping University | \@departmentenglish\par
  627. \@thesistypenameenglish{} thesis, \@thesiscredits{} ECTS | \@thesissubject\par%
  628. \@dateofpublication\ | \isrn\par%
  629. \end{large}%
  630. }%
  631. }%
  632. \vspace*{50mm}%
  633. \swedishenglish{%
  634. \hspace*{36mm}%
  635. }{%
  636. \hspace*{38mm}%
  637. }%
  638. \newlength{\thesiswidth}%
  639. \swedishenglish{%
  640. \setlength{\thesiswidth}{\paperwidth-86mm}%
  641. }{%
  642. \setlength{\thesiswidth}{\paperwidth-88mm}%
  643. }%
  644. \begin{minipage}[t]{\thesiswidth}
  645. {\fontsize{25pt}{30pt}\selectfont\swedishenglish{\@titleswedish}{\@titleenglish}\par}%
  646. \swedishenglish{\ifsubtitleswedish}{\ifsubtitleenglish} -- {\fontsize{13pt}{15pt}\selectfont\swedishenglish{\@subtitleswedish}{\@subtitleenglish}\par}\fi%
  647. \hrulefill{}
  648. \\{}
  649. {\@calibri{%
  650. \fontsize{13pt}{15pt}\selectfont%
  651. \textit{\swedishenglish{\@titleenglish}{\@titleswedish}}\par}%
  652. \swedishenglish{\ifsubtitleenglish}{\ifsubtitleswedish}--
  653. {\fontsize{13pt}{15pt}\textit{\selectfont\swedishenglish{\@subtitleenglish}{\@subtitleswedish}}\par}
  654. \fi}%
  655. \vspace*{10mm}%
  656. {\@calibri\fontsize{12pt}{13pt}\selectfont\textbf{\@author}\par
  657. }%
  658. \vspace*{10mm}%
  659. {\@calibri\fontsize{10pt}{11pt}\selectfont
  660. \parbox{\textwidth}{\swedishenglish{Handledare}{Supervisor}: \@supervisor\\
  661. \swedishenglish{Examinator}{Examiner}: \@examiner\\[2\baselineskip]
  662. \ifexternalsupervisor \swedishenglish{Extern
  663. handledare}{External supervisor}: \@externalsupervisor\fi}}%
  664. \end{minipage}
  665. \vfill{}
  666. \begin{textblock*}{\textwidth}(2cm,\paperheight-4cm)
  667. \swedishenglish{\gdef\@langlogo{sv}}{\gdef\@langlogo{en}}
  668. \parbox{0.4\textwidth}{\includegraphics[width=85mm]{liu_primary_black_\@langlogo}}%
  669. \hspace*{32mm}
  670. \parbox{0.5\textwidth}{\raggedleft%
  671. \vspace*{4mm}
  672. Linköpings universitet\\
  673. SE--581 83 Linköping\\
  674. \swedishenglish{013-28 10 00}{+46 13 28 10 00}, \href{http://www.liu.se}{www.liu.se}}
  675. \end{textblock*}
  676. }
  677. }
  678. \newcommand{\makegraduatetitle}{
  679. \@calibri
  680. {\center
  681. {\footnotesize\centerline\@publicationseries{}%\\
  682. \ifphd
  683. Dissertations,
  684. \else
  685. Licentiate Thesis
  686. \fi No. \@thesisnumber
  687. \ifsubseries
  688. \\\@subseries{} No. \@subseriesnumber
  689. \fi}
  690. \\[25mm]
  691. {\LARGE\bfseries\gettitle}\\[20mm]
  692. {\Large\bfseries\@author}\\
  693. \vfill
  694. \swedishenglish{\gdef\@langlogo{sv}}{\gdef\@langlogo{en}}
  695. \includegraphics[width=60mm]{liu_primary_black_\@langlogo}
  696. \\[12mm]
  697. {\footnotesize
  698. \swedishenglish{%
  699. \iflic
  700. Framlagd vid \@faculty{} vid Linköpings universitet som del av fordringarna för \@degreetype\\[6mm]
  701. \fi
  702. \@department \\
  703. Linköping universitet\\
  704. 581 83 Linköping
  705. }{%
  706. Linköping University\\
  707. \@departmentenglish\\
  708. \@division\\
  709. SE-581 83 Linköping, Sweden\\
  710. }
  711. \vspace*{5mm}
  712. Linköping \@publicationyear\\
  713. }
  714. }
  715. }
  716. \ifstudent
  717. \renewcommand{\maketitle}{\makeundergraduatetitle}
  718. \else
  719. \renewcommand{\maketitle}{\makegraduatetitle}
  720. \fi
  721. \newcommand{\abstractpages}{%
  722. \ifphd
  723. \vspace*{6mm}
  724. \ifxetex
  725. \begin{swedish}
  726. \else
  727. \selectlanguage{swedish}
  728. \fi
  729. \setlength{\parindent}{0mm}
  730. \setlength\parskip{8pt}\centerline{POPULÄRVETENSKAPLIG SAMMANFATTNING}
  731. \vspace{3mm}
  732. \footnotesize{\@sammanfattning}
  733. \ifxetex
  734. \end{swedish}
  735. \else
  736. \swedishenglish
  737. {
  738. }
  739. {
  740. \selectlanguage{english}
  741. }
  742. \fi
  743. \fi
  744. \newpage
  745. \vspace*{6mm}
  746. { \setlength{\parindent}{0mm}
  747. \setlength\parskip{8pt}\centerline{ABSTRACT}
  748. \vspace{3mm}
  749. \footnotesize{\@abstract}
  750. }
  751. }
  752. \newcommand{\makepermissionpage}{
  753. \mbox{}
  754. \iffilfak
  755. \ifphd
  756. \hspace{-\parindent}
  757. At the Faculty of Arts and Sciences at Linköping University,
  758. research and doctoral studies are carried out within broad problem
  759. areas. Research is organized in interdisciplinary research
  760. environments and doctoral studies mainly in graduate
  761. schools. Jointly, they publish the series Linköping Studies in Arts
  762. and Sciences. This thesis comes from \@division{} at the \@departmentenglish.
  763. \fi
  764. \fi
  765. \iflic
  766. \vfill
  767. \begin{center}
  768. {\footnotesize
  769. This is a Swedish Licentiate’s Thesis\\[0.8\baselineskip]
  770. Swedish postgraduate education leads to a doctor’s degree and/or a
  771. licentiate’s degree.\\
  772. A doctor’s degree comprises 240 ECTS credits
  773. (4 years of full-time studies).\\
  774. \vspace{-0.3\baselineskip}
  775. A licentiate’s degree comprises 120 ECTS credits.}
  776. \end{center}
  777. \fi
  778. \vfill
  779. \begin{flushleft}
  780. Edition \@edition\\[5mm]
  781. \copyright{} \@author, \@publicationyear\\
  782. ISBN \@isbn\\
  783. ISSN \@issn\\
  784. {\footnotesize URL \texttt{http://urn.kb.se/resolve?urn=urn:nbn:se:liu:diva-\@divanumber}}\\[1cm]
  785. Published articles have been reprinted with permission from the
  786. respective
  787. copyright holder.\\
  788. % Paper III \copyright{} XXX\\
  789. Typeset using \ifxetex\XeTeX\else\LaTeX\fi\\[1cm]
  790. Printed by LiU-Tryck, Linköping \@publicationyear
  791. \end{flushleft}
  792. \clearpage}
  793. % Intro page for MSC theses
  794. \newcommand{\makeinsidepage}{
  795. \thispagestyle{empty}
  796. {\@calibri\selectfont
  797. \vspace*{2cm}
  798. \section*{Upphovsrätt}
  799. \label{sec:upphovsratt}
  800. Detta dokument hålls tillgängligt på Internet - eller dess framtida ersättare
  801. - under 25 år från publiceringsdatum under förutsättning att inga extraordinära
  802. omständigheter uppstår.
  803. Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner,
  804. skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat för
  805. ickekommersiell forskning och för undervisning. Överföring av upphovsrätten vid
  806. en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av
  807. dokumentet kräver upphovsmannens medgivande. För att garantera äktheten,
  808. säkerheten och tillgängligheten finns lösningar av teknisk och administrativ
  809. art.
  810. Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i den
  811. omfattning som god sed kräver vid användning av dokumentet på ovan beskrivna
  812. sätt samt skydd mot att dokumentet ändras eller presenteras i sådan form eller i
  813. sådant sammanhang som är kränkande för upphovsmannens litterära eller
  814. konstnärliga anseende eller egenart.
  815. För ytterligare information om Linköping University Electronic Press se
  816. förlagets hemsida
  817. \href{http://www.ep.liu.se/}{\texttt{http://www.ep.liu.se/}}.
  818. \vspace*{2cm}
  819. \section*{Copyright}
  820. \label{sec:copyright}
  821. The publishers will keep this document online on the Internet - or its possible
  822. replacement - for a period of 25 years starting from the date of publication
  823. barring exceptional circumstances.
  824. The online availability of the document implies permanent permission for anyone
  825. to read, to download, or to print out single copies for his/hers own use and to
  826. use it unchanged for non-commercial research and educational purpose. Subsequent
  827. transfers of copyright cannot revoke this permission. All other uses of the
  828. document are conditional upon the consent of the copyright owner. The publisher
  829. has taken technical and administrative measures to assure authenticity, security
  830. and accessibility.
  831. According to intellectual property law the author has the right to be mentioned
  832. when his/her work is accessed as described above and to be protected against
  833. infringement.
  834. For additional information about the Linköping University Electronic Press and
  835. its procedures for publication and for assurance of document integrity, please
  836. refer to its www home page:
  837. \href{http://www.ep.liu.se/}{\texttt{http://www.ep.liu.se/}}.
  838. \vfill{}
  839. \copyright{} \@author
  840. \vfill{}
  841. }
  842. }
  843. \newcommand{\makededicationpage}{
  844. \mbox{}
  845. \vfill
  846. \begin{center}
  847. \@dedication\\
  848. \end{center}
  849. \vfill
  850. }
  851. %%%%%%%%%%%%%%%%%
  852. %
  853. % Page size and layout
  854. %
  855. %%%%%%%%%%%%%%%%%
  856. \clubpenalty=10000
  857. \widowpenalty=10000
  858. \raggedbottom
  859. \midsloppy
  860. \newlength{\mylen} % a length
  861. \newcommand{\alphabet}{abcdefghijklmnopqrstuvwxyzåäö} % the lowercase
  862. % alphabet
  863. \begingroup
  864. % keep font change local
  865. % font specification e.g.,
  866. % \Large\sffamily
  867. \settowidth{\mylen}{\alphabet}
  868. % The length of this alphabet is
  869. % \the\mylen.
  870. \typeout{The length of the alphabet is \the\mylen}
  871. % put in log file
  872. % end the grouping
  873. \endgroup
  874. % Tryckmaterialets storlek
  875. \setstocksize{297mm}{210mm}
  876. %
  877. \ifstudent
  878. \settrimmedsize{290mm}{205mm}{*}
  879. \settypeblocksize{*}{34pc}{1.618} % golden ratio
  880. \else
  881. % LiU-specific definition of the S5 format
  882. \settrimmedsize {240mm}{165mm}{*}
  883. \settypeblocksize{*}{28pc}{1.618}
  884. \fi
  885. \newcommand{\resetlayout}{
  886. \setlength{\trimtop}{\stockheight} % \trimtop = \stockheight - \paperheight
  887. \addtolength{\trimtop}{-\paperheight} %
  888. \setlength{\trimedge}{\stockwidth} % \trimedge = \stockwidth - \paperwidth
  889. \addtolength{\trimedge}{-\paperwidth} %
  890. % Beskär endast höger- och nederkanten på respektive papper
  891. % \settrims{0pt}{0pt}
  892. % Beskär runt om: Centrera tryckytan på pappret
  893. \settrims{0.5\trimtop}{0.5\trimedge}
  894. % Inner margin 2cm
  895. \ifprinterfriendly
  896. \renewcommand{\clearforchapter}{\cleartooddpage}
  897. \fi
  898. \ifstudent
  899. \setlrmargins{*}{*}{1}
  900. \else
  901. \setlrmargins{*}{*}{1.5}
  902. \fi
  903. % Övre marginal 2cm, den undre automatiskt beräknad
  904. \setulmargins{2cm}{*}{*}
  905. }
  906. %
  907. % Common layout settings
  908. % Variables and page layout
  909. \linespread{1.05}
  910. \typeout{******** LiU thesis layout ********}
  911. \typeoutlayout
  912. \typeout{******** Standard memoir layout ********}
  913. \typeoutstandardlayout
  914. %% Load user settings from the file settings.tex
  915. \AtBeginDocument{%
  916. \resetlayout
  917. \checkandfixthelayout
  918. \pagestyle{empty}
  919. \ifexhibitpage
  920. \iflith
  921. \exhibitpagelith
  922. \else
  923. \exhibitpagefilfak
  924. \fi
  925. \end{document}%
  926. \endinput%
  927. \fi
  928. \pagenumbering{roman}
  929. \begin{adjustwidth}{-1cm}{-1cm}
  930. \maketitle
  931. \newpage
  932. \end{adjustwidth}
  933. \ifstudent
  934. \makeinsidepage
  935. \else
  936. \pagestyle{plain}
  937. \makepermissionpage
  938. \fi
  939. \ifdedication
  940. \makededicationpage
  941. \fi
  942. \cleartorecto%
  943. \phantomsection
  944. \swedishenglish{\addcontentsline{toc}{chapter}{Sammanfattning}}
  945. {\addcontentsline{toc}{chapter}{Abstract}}
  946. \cleardoublepage
  947. \ifstudent
  948. \begin{abstract}
  949. \@abstract
  950. \end{abstract}
  951. \else
  952. \abstractpages
  953. \fi
  954. \cleardoublepage
  955. \newpage
  956. \@acknowledgments
  957. \swedishenglish{\addcontentsline{toc}{chapter}{Författarens tack}}
  958. {\addcontentsline{toc}{chapter}{Acknowledgments}}
  959. \cleardoublepage
  960. {\pagestyle{plain}\tableofcontents\relax\cleardoublepage}
  961. \iftotalfigures {\pagestyle{plain}\listoffigures\relax\cleardoublepage}\fi
  962. \iftotaltables {\pagestyle{plain}\listoftables\relax\cleardoublepage}\fi
  963. \@ifpackageloaded{todonotes}{\pagestyle{plain}\listoftodos\relax\cleardoublepage}{}
  964. \ifprinterfriendly
  965. \cleartooddpage
  966. \else
  967. \cleartorecto
  968. \fi
  969. \pagenumbering{arabic}
  970. \pagestyle{ruled}
  971. }
  972. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  973. %%% liuthesis.cls ends here