diff --git a/.gitmodules b/.gitmodules index 1ee75df..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "metropolia-thesis-latex"] - path = metropolia-thesis-latex - url = git@github.com:panunu/metropolia-thesis-latex.git diff --git a/metropolia-thesis-latex b/metropolia-thesis-latex deleted file mode 160000 index 2095bf3..0000000 --- a/metropolia-thesis-latex +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2095bf3956147ad9c7ec7b6d9294ab28324d0bc2 diff --git a/tex/.gitignore b/tex/.gitignore new file mode 100644 index 0000000..4d00985 --- /dev/null +++ b/tex/.gitignore @@ -0,0 +1,20 @@ +*.aux +*.log +*.synctex* +*.toc +*.bbl +*.blg +.project +.DS_Store +*.acn +*.acr +*.alg +*.fdb_latexmk +*.fls +*.glg +*.glo +*.gls +*.ist +*.out +_minted-* +*.pdf diff --git a/tex/.latex.yml b/tex/.latex.yml new file mode 100644 index 0000000..0cd2863 --- /dev/null +++ b/tex/.latex.yml @@ -0,0 +1,5 @@ +# In .latex.yml +compiler: xelatex + +# In .latex.yml +root_file: thesis.tex diff --git a/tex/CONTRIBUTING.md b/tex/CONTRIBUTING.md new file mode 100644 index 0000000..e59c7cd --- /dev/null +++ b/tex/CONTRIBUTING.md @@ -0,0 +1,5 @@ +## Editor + +### Indentation + +Use (2) spaces instead of tabs. diff --git a/tex/LICENSE b/tex/LICENSE new file mode 100644 index 0000000..0fb847e --- /dev/null +++ b/tex/LICENSE @@ -0,0 +1,395 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/tex/README.md b/tex/README.md new file mode 100644 index 0000000..0eadb2e --- /dev/null +++ b/tex/README.md @@ -0,0 +1,49 @@ +# Metropolia Thesis LaTeX Template + +## License + +Creative Commons License
Metropolia Thesis LaTeX Template by Panu Leppäniemi, Patrik Luoto and Patrick Ausderau is licensed under a Creative Commons Attribution 4.0 International License. + +Check comments in [main.tex](main.tex) for details. Especially what it means when licensing your own thesis when using this template. + +## Compiler + +Use XeLaTeX as a compiler. + +### Compilation + +Usual compilation sequence (minted package require external Python Pygments script to be installed ([check the docs](https://www.ctan.org/pkg/minted?lang=en))) + + # minted require -shell-escape to run external script. + # -8bit avoid ^^I for tabs in minted. + $ xelatex -shell-escape -8bit main + # If any change in the bibliography + $ bibtex8 main + # If any change with the abbreviation or acronym + $ makeglossaries main + #Then compile again + $ xelatex -shell-escape -8bit main + #And if still some citation or label warnings, compile once more + $ xelatex -shell-escape -8bit main + +### Using Overleaf + +1. Create an account on [Overleaf](https://www.overleaf.com?r=2c9014ea&rm=d&rs=b) (if not already have one) + +#### Using git + +Note: git version control != GitHub 😉 These instructions can be used with the Personal/Free subscription plan. While you would need the paid version of Overleaf to directly sync with GitHub. + +1. Fork this project (optional (advantage of fork is to synchronize your github and overleaf projects with your local clone)) +1. Clone your fork (or this github project) to your local computer +1. Follow the [instructions](https://www.overleaf.com/help/230-how-do-i-push-a-new-project-to-overleaf-via-git) to create a new Overleaf project from existing git repo +1. Once done, open your Overleaf project and from Menu change "LaTeX Engine" to XeLaTeX and set ``main.tex`` as the main document + +#### Create new project from Zip + +1. Download this project as zip (or fork) +1. Once logged in Overleaf, open Project section. Then New Project → Upload Project → select the zip (otherwise with the paid version you could sync with github (your fork)) +1. Once project opened: from the Menu change "compiler" to XeLaTeX and set ``main.tex`` as the main document + + + diff --git a/tex/biblio.bib b/tex/biblio.bib new file mode 100644 index 0000000..f077f6a --- /dev/null +++ b/tex/biblio.bib @@ -0,0 +1,45 @@ +%---------------------------------------------------------------------------------------- +% BOOK +%---------------------------------------------------------------------------------------- + +@book{tobias:book, +author = "{Tobias Oetiker} and {Hubert Partl} and {Irene Hyna} and {Elisabeth Schlegl}", +title = "The {N}ot {S}o {S}hort {I}ntroduction to \LaTeX{}2e", +year = "2011", +address = "Switzerland" +} +%publisher = "???", +%isbn = {1234} + +@book{kopka:guide, +author = "{Kopka, Helmut}", +title = "Guide to \LaTeX{}", +publisher = "Addison-Wesley", +year = "2004", +address = "Boston", +isbn = {0321173856} +} + +%---------------------------------------------------------------------------------------- +% ARTICLE +%---------------------------------------------------------------------------------------- + +@article{un:udhr, + author = {international community, United Nations}, + title = {The Universal Declaration of Human Rights}, + url = {http://www.un.org/en/documents/udhr}, + year = 1948 +} + +%---------------------------------------------------------------------------------------- +% WEB +%---------------------------------------------------------------------------------------- + +@online{wikibooks:latex, +title = "\LaTeX{}", +year = "2012", +publisher = "{wikibooks.org}", +url = "http://en.wikibooks.org/wiki/LaTeX", +lastchecked = "November~05, 2012" +} +%author = "{???}", \ No newline at end of file diff --git a/tex/chapters/0abbr.tex b/tex/chapters/0abbr.tex new file mode 100644 index 0000000..dfe6bad --- /dev/null +++ b/tex/chapters/0abbr.tex @@ -0,0 +1,36 @@ +% Generate the glossary +\makeglossaries + +% Acronyms, abbreviations, etc. + +\newacronym{html}{HTML}{HyperText Markup Language} +\newacronym{sql}{SQL}{Structured Query Language} +\newacronym{io}{I/O}{Input/Output} +\newacronym{ram}{RAM}{Random Access Memory} +\newacronym{php}{PHP}{Hypertext Preprocessor} + + +% Glossary entries + +\newglossaryentry{part_key}{ + name={partition key}, + description={a column or set of columns from the same table whose consolidated value decide the partition for a given data} +} +\newglossaryentry{thesis}{ + name=thesis, + description={a written essay one submitted for a university degree}, + plural=theses +} +\newglossaryentry{latex} +{ + name=\LaTeX{}, + description={Is a mark up language specially suited for scientific documents} +} + +\newglossaryentry{maths} +{ + name=mathematics, + description={Mathematics is what mathematicians do} +} + + diff --git a/tex/chapters/0abstract_en.tex b/tex/chapters/0abstract_en.tex new file mode 100644 index 0000000..356f21e --- /dev/null +++ b/tex/chapters/0abstract_en.tex @@ -0,0 +1,41 @@ +% Abstract in English +%Most probably, you only need to change the text of the abstract. Everything else comes from chapter/0info.tex +%If you do not have any appendix, you may delete \total{chapter} and replace with 0 + +\pagestyle{abstract} +\begin{otherlanguage}{english} +{\renewcommand{\arraystretch}{2}% +\begin{tabular}{ | p{4,7cm} | p{10,3cm} |} + \hline + Author(s) \newline + Title \newline\newline + Number of Pages \newline + Date + & + \makeatletter + \@author \newline + \@title \newline\newline %! if very long title over 2 lines, remove one \newline + \pageref*{LastPage} pages + \total{chapter} appendices \newline %! if no appendices, risk to count total of chapter :D + \IfLanguageName {finnish} {\foreignlanguage{english}{\longdate\@date}} {\@date} + \makeatother + \\ \hline + Degree & \metropoliadegree + \\ \hline + Degree Programme & \metropoliadegreeprogramme + \\ \hline + Professional Major & \metropoliaspecialisation + \\ \hline + Instructor(s) & \metropoliainstructors + \\ \hline + \multicolumn{2}{|p{15cm}|}{\vspace{-22pt} + Abstract content. To force newline between paragraph in the abstract, you must have both a empty line and the newline command. \newline + + beginning of second paragraph\ldots + } \\[14cm] \hline + Keywords & \metropoliakeywords + \\ \hline +\end{tabular} +} +\end{otherlanguage} +\clearpage + diff --git a/tex/chapters/0abstract_fi.tex b/tex/chapters/0abstract_fi.tex new file mode 100644 index 0000000..8ca537c --- /dev/null +++ b/tex/chapters/0abstract_fi.tex @@ -0,0 +1,41 @@ +% Abstract in Finnish +%Most probably, you only need to change the text of the abstract. Everything else comes from chapter/0info.tex +%If you do not have any appendix, you may delete \total{chapter} and replace with 0 + +\thispagestyle{tiivis} +\begin{otherlanguage}{finnish} +{\renewcommand{\arraystretch}{2}% +\begin{tabular}{ | p{4,7cm} | p{10,3cm} |} + \hline + Tekijä(t) \newline + Otsikko \newline\newline + Sivumäärä \newline + Aika + & + \makeatletter + \@author \newline + \otsikko \newline\newline %! if very long title over 2 lines, remove one \newline + \makeatother + \pageref*{LastPage} sivua + \total{chapter} liitettä \newline %! if no appendices, risk to count total of chapter :D + \pvm + \\ \hline + Tutkinto & \tutkinto + \\ \hline + Tutkinto-ohjelma & \kohjelma + \\ \hline + Ammatillinen pääaine & \suuntautumis + \\ \hline + Ohjaaja(t) & \ohjaajat + \\ \hline + \multicolumn{2}{|p{15cm}|}{\vspace{-22pt} + Tämä on tiivistelmän ensimmäinen kappale. Tiivistelmän kappaleet loppuvat komentoon newline, jotta saadaan yksi tyhjä rivi aikaiseksi. \newline + + Tämä on tiivistlemän toinen kappale. + } \\[14cm] \hline + Avainsanat & \avainsanat + \\ \hline +\end{tabular} +} +\end{otherlanguage} +\clearpage + diff --git a/tex/chapters/0acknowledgement.tex b/tex/chapters/0acknowledgement.tex new file mode 100644 index 0000000..fcdc130 --- /dev/null +++ b/tex/chapters/0acknowledgement.tex @@ -0,0 +1,13 @@ +% Acknowledgement +% If relevant give a special thanks to the people who supported you during your thesis +% writing. + +\pagestyle{empty} +\chapter*{Acknowledgement} + +Thanks to Panu Leppäniemi, Patrik Luoto and Patrick Ausderau for the \LaTeX{} ~thesis template. + +Thanks to my cat who jump on my keyboard while the text was not saved :D + +\clearpage + diff --git a/tex/chapters/0info.tex b/tex/chapters/0info.tex new file mode 100644 index 0000000..67996a8 --- /dev/null +++ b/tex/chapters/0info.tex @@ -0,0 +1,40 @@ +% Global information (title of your thesis, your name, degree programme, major, etc.) + +\def\thesislang{finnish} %change this depending on the main language of the thesis. +%\def\thesislang{english} % "english" is the only other supported language currently. If someone has the swedish, please contribute! + +\def\secondlang{english} %if the main language is Finnish (or Swedish), you must have 2 abstracts (one in Finnish (or Swedish) and one in English) +%\def\secondlang{finnish} +%If the main language is English and that you are native Finnish (or Swedish) speaker, you must have also abstract in your native language on top of the English one. + +\author{Nimi/Name} %your first name and last name +\def\thesisfi{Insinöörityö}%was Opinnäytetyö +\def\thesisen{Thesis} + +\def\alaotsikko{Alaotsikko/Subtitle} %DISABLED, seems not to be an option with the new template (2018). If you really need it, uncomment and modify style/title.tex accordingly %if you don't have subtitle, empty {} it (but don't delete that line) + +%Finnish section, for title/abstract +\def\otsikko{Opinnäytetyön otsikko} +\def\tutkinto{Tutkinto (esim. Insinööri (AMK))} % change to your needs, e.g. "YAMK", etc. +\def\kohjelma{Koulutusohjelma (esim. Tieto\textendash ja viestintätekniikka)} +\def\suuntautumis{Ammatillinen pääaine (esim. Mobile Solutions)} +\def\ohjaajat{ +Titteli Etunimi Sukunimi\newline +Titteli Etunimi Sukunimi +} +\def\avainsanat{avainsanat} +\def\pvm{\specialdate\today} + +%English section, for title/abstract +\title{Your title here} +\def\metropoliadegree {Bachelor of Engineering} % change to your needs, e.g. "master", etc. +\def\metropoliadegreeprogramme {your degree programme (e.g. Information Technology)} +\def\metropoliaspecialisation {your major option (e.g. Mobile Solutions)} +\def\metropoliainstructors { +First name Last name, Title (for example: Project Manager)\newline +First name Last name, Title (for example: Principal Lecturer) +} +\def\metropoliakeywords {Keywords} +\date{\longmonth\today} + + diff --git a/tex/chapters/0license.tex b/tex/chapters/0license.tex new file mode 100644 index 0000000..f19d4f2 --- /dev/null +++ b/tex/chapters/0license.tex @@ -0,0 +1,35 @@ +% License of your thesis +% If you wish to explain what it means. When you publish your thesis in https://theseus.fi +% you will be able to choose between some Creative Commons licenses +% https://creativecommons.org +% Adapt this example text to your taste. +% This would also be the right place to explain the license you choose for the code you +% produced for your thesis. + +\pagestyle{empty} +\chapter*{Licenses} +\vspace{-20pt} +\begin{center} + \includegraphics[width=80pt]{cc_by_sa} +\end{center}\vspace{-32pt} +This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. That means:\\ +\textbf{You are free to:} +\vspace{-17pt} \begin{itemize} +\item Share \textemdash copy and redistribute the material in any medium or format +\item Adapt \textemdash remix, transform, and build upon the material +\end{itemize}\vspace{-17pt} + +\textbf{Under the following terms:} +\vspace{-17pt} \begin{itemize} +\item Attribution \textemdash You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. +\item ShareAlike \textemdash If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. +\item No additional restrictions \textemdash You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. +\item Any of the above conditions can be waived if you get my permission +\end{itemize}%\vspace{-17pt} + + +To view a copy of this license, visit \url{http://creativecommons.org/licenses/by-sa/4.0/}. + +I decided to publish my thesis work under the Creative Commons Attribution-ShareAlike 4.0 International License because I strongly believe that you as reader deserve the freedom to copy, share and modify this work and if you do modify it, it is fair to give these same permissions to the others. A copy in electronic form of this work can be found in \url{https://some.place} with the \LaTeX{} source. + +\clearpage diff --git a/tex/chapters/conclusion.tex b/tex/chapters/conclusion.tex new file mode 100644 index 0000000..46acf7f --- /dev/null +++ b/tex/chapters/conclusion.tex @@ -0,0 +1,7 @@ +% Conclusions + +\chapter{Conclusions} + +Check Final Year Project Guide for the content of Conclusions chapter. + +\clearpage %force the next chapter to start on a new page. Keep that as the last line of your chapter! diff --git a/tex/chapters/introduction.tex b/tex/chapters/introduction.tex new file mode 100644 index 0000000..f3d8dc3 --- /dev/null +++ b/tex/chapters/introduction.tex @@ -0,0 +1,7 @@ +% Introduction + +\chapter{Introduction} + +Check Final Year Project Guide for the content of introduction chapter. + +\clearpage %force the next chapter to start on a new page. Keep that as the last line of your chapter! diff --git a/tex/chapters/methods.tex b/tex/chapters/methods.tex new file mode 100644 index 0000000..00700cd --- /dev/null +++ b/tex/chapters/methods.tex @@ -0,0 +1,7 @@ +% Material and Methods + +\chapter{Material and Methods} + +Check Final Year Project Guide for the content of Material and Methods chapter. + +\clearpage %force the next chapter to start on a new page. Keep that as the last line of your chapter! diff --git a/tex/chapters/projectSpec.tex b/tex/chapters/projectSpec.tex new file mode 100644 index 0000000..bc31fd6 --- /dev/null +++ b/tex/chapters/projectSpec.tex @@ -0,0 +1,7 @@ +% Project Specifications + +\chapter{Project Specifications} + +Check Final Year Project Guide for the content of Project Specifications chapter. + +\clearpage %force the next chapter to start on a new page. Keep that as the last line of your chapter! diff --git a/tex/chapters/solution.tex b/tex/chapters/solution.tex new file mode 100644 index 0000000..7c97ac5 --- /dev/null +++ b/tex/chapters/solution.tex @@ -0,0 +1,7 @@ +% Proposed solution + +\chapter{Proposed solution} + +Check Final Year Project Guide for the content of Proposed solution chapter. + +\clearpage %force the next chapter to start on a new page. Keep that as the last line of your chapter! diff --git a/tex/chapters/theory.tex b/tex/chapters/theory.tex new file mode 100644 index 0000000..ad352da --- /dev/null +++ b/tex/chapters/theory.tex @@ -0,0 +1,7 @@ +% Theoretical background + +\chapter{Theoretical background} + +Check Final Year Project Guide for the content of Theoretical background chapter. + +\clearpage %force the next chapter to start on a new page. Keep that as the last line of your chapter! diff --git a/tex/code/html5_sample.html b/tex/code/html5_sample.html new file mode 100755 index 0000000..144eb4c --- /dev/null +++ b/tex/code/html5_sample.html @@ -0,0 +1,10 @@ + + + + + HTML5 Document Template + + + Some text here (visible to the users) + + \ No newline at end of file diff --git a/tex/data.dat b/tex/data.dat new file mode 100644 index 0000000..58181cd --- /dev/null +++ b/tex/data.dat @@ -0,0 +1,8 @@ +c a +5 564.08 +10 661.66 +20 1329.56 +50 2659.63 +100 4653.16 +200 10614.32 +1000 53184.27 diff --git a/tex/illustration/LaTeX_cover.png b/tex/illustration/LaTeX_cover.png new file mode 100644 index 0000000..32dad80 Binary files /dev/null and b/tex/illustration/LaTeX_cover.png differ diff --git a/tex/illustration/cc_by_sa.png b/tex/illustration/cc_by_sa.png new file mode 100644 index 0000000..e76aeff Binary files /dev/null and b/tex/illustration/cc_by_sa.png differ diff --git a/tex/illustration/footer_en.png b/tex/illustration/footer_en.png new file mode 100644 index 0000000..3ecf0c9 Binary files /dev/null and b/tex/illustration/footer_en.png differ diff --git a/tex/illustration/footer_fi.png b/tex/illustration/footer_fi.png new file mode 100644 index 0000000..d346330 Binary files /dev/null and b/tex/illustration/footer_fi.png differ diff --git a/tex/illustration/metropolia_en.png b/tex/illustration/metropolia_en.png new file mode 100644 index 0000000..3cf425b Binary files /dev/null and b/tex/illustration/metropolia_en.png differ diff --git a/tex/illustration/metropolia_fi.png b/tex/illustration/metropolia_fi.png new file mode 100644 index 0000000..7cdad34 Binary files /dev/null and b/tex/illustration/metropolia_fi.png differ diff --git a/tex/main.tex b/tex/main.tex new file mode 100644 index 0000000..8ca9730 --- /dev/null +++ b/tex/main.tex @@ -0,0 +1,177 @@ +%---------------------------------------------------------------------------------------- +% Metropolia Thesis LaTeX Template +%---------------------------------------------------------------------------------------- +% License: +% This work is licensed under the Creative Commons Attribution 4.0 International License. +% To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/. +% +% However, this license apply to this template. As a template, it is supposed to be +% modified for your own needs (with your thesis content). For this reason, if you use +% this project as a template and not specifically distribute it as part of a another +% package/program, we grant the extra permission to freely copy and modify these files as +% you see fit and even to delete this copyright notice. +% In short, you are free to publish your thesis under whatever license you wish, even +% keep the all rights reserved to you. +% +% Authors: +% Panu Leppäniemi, Patrik Luoto and Patrick Ausderau +% +% Credits: +% Panu Leppäniemi: abstract, def, cleaning,... +% Patrik Luoto: title page, abstract in Finnish, abbreviation, math,... +% Patrick Ausderau: initial version, style, table of content, bibliography, figure, +% appendix, table, source code listing... +% +% Please: +% If you find mistakes, improve this template and alike, please contribute by sharing +% your improvements and/or send us your feedback there: +% https://github.com/panunu/metropolia-thesis-latex +% And of course, if you improve it, add yourself as an author. +% +% Compiler: +% Use XeLaTeX as a compiler. + +%---------------------------------------------------------------------------------------- +% THESIS INFO +%---------------------------------------------------------------------------------------- + +% All general information (main language, title, author (you), degree programme, major +% option, etc.) +% Edit the file chapters/0info.tex to change these information +\input{chapters/0info.tex} + +%---------------------------------------------------------------------------------------- +% GLOBAL STYLES +%---------------------------------------------------------------------------------------- + +% If you need extra package, etc. modify the style/style.tex file. +% If you are using Windows OS, you will need to change default font to Arial in that +% style/style.tex file (or install Liberation Sans font to your system). +% If you are using MacOS or linux, make sure you have Liberation Sans font installed. +\input{style/style.tex} +% Normally, you do not need to modify the title style. It's content comes from the +% chapters/0info.tex file. +\input{style/title.tex} + +%---------------------------------------------------------------------------------------- +% ABBREVIATION AND GLOSSARY +%---------------------------------------------------------------------------------------- + +% Add/edit all your acronyms, abbreviations, glossary entries, etc. definitions in +% chapters/0abbr.tex file. +% You can have as many as you wish. Only the ones you use in your text (inserted with +% \gls{} command) will print in the Glossary/Lyhenteet. +\input{chapters/0abbr.tex} + +%---------------------------------------------------------------------------------------- +% DOCUMENT STARTS HERE... +%---------------------------------------------------------------------------------------- + +\begin{document} +\counterwithout{listing}{chapter} + +%---------------------------------------------------------------------------------------- +% TITLE PAGE +%---------------------------------------------------------------------------------------- + +\input{style/title_headers.tex} +\maketitle +\newpage + +%---------------------------------------------------------------------------------------- +% ABSTRACT / Tiivistelmä +%---------------------------------------------------------------------------------------- + +% If you are international student writing in English, remove the Finnish abstract. +% If you are Finnish citizen, you must have 2 abstracts, one in Finnish (or Swedish +% depending on your mother tongue) and one in English regardless of the main language of +% your thesis. +\input{chapters/0abstract_fi.tex} +\input{chapters/0abstract_en.tex} + +%---------------------------------------------------------------------------------------- +% License? Acknowledgement? +%---------------------------------------------------------------------------------------- + +% Uncomment next line and edit chapters/0license.tex if you want license in your thesis. +%\input{chapters/0license.tex} + +% Uncomment next line and edit chapters/0acknowledgement.tex if you want acknowledgements. +%\input{chapters/0acknowledgement.tex} + +%---------------------------------------------------------------------------------------- +% TABLE OF CONTENTS +%---------------------------------------------------------------------------------------- + +\input{style/toc.tex} + +%list of figure, tables would come here if relevant? + +%---------------------------------------------------------------------------------------- +% Lyhenteet / Abbreviation +%---------------------------------------------------------------------------------------- + +% If you don't use abbreviations/glossary, remove the following line. +\input{style/abbr.tex} + +%---------------------------------------------------------------------------------------- +% CONTENT +%---------------------------------------------------------------------------------------- + +\input{style/content.tex}%reset page number to 1, etc. + +% Thesis content if you strictly follow the "Final Year Project guide". Of course, you +% can adapt to your specific needs (add more chapter, rename them, etc.). +\input{chapters/introduction.tex} +% uncomment what you need. +%\input{chapters/projectSpec.tex} +%\input{chapters/methods.tex} +%\input{chapters/theory.tex} +%\input{chapters/solution.tex} +%\input{chapters/conclusion.tex} + +% Sample content to demonstrate LaTeX command. You will likely delete this line and the +% next \input{sample/*} lines. You are also safe to delete the sample/ folder and its +% content once you refershed your LaTeX skills. Also check the appendix samples. +\input{sample/1content.tex} +\input{sample/2lorem.tex} +\input{sample/3graph.tex} + +%---------------------------------------------------------------------------------------- +% BIBLIOGRAPHY REFERENCES +%---------------------------------------------------------------------------------------- + +\input{style/biblio.tex} + +%---------------------------------------------------------------------------------------- +% APPENDICES +%---------------------------------------------------------------------------------------- + +\input{style/appendix.tex} +%force smaller vertical spacing in table of content +%!!! There can be some fun depending if the appendices have (sub)sections or not :D +% You will have to play with these numbers and eventually add the \vspace line before +% some \chapter and force another number. +% To add more fun, time to time the table of content get wrong after a build :( +\addtocontents{toc}{\vspace{11pt}} +\pretocmd{\chapter}{\addtocontents{toc}{\protect\vspace{-24pt}}}{}{} + +\liite{1}% This is a hack to have right page numbering for each appendix. Make sure to + % use a unique number for each appendix. +\input{sample/Xappendix1.tex}% Sample content to demonstrate appendix in LaTeX. You +% are safe to delete this lines (and the next samples) once you refreshed your LaTeX +% skills (and safe to delete the sample folder and all its file too). + +\addtocontents{toc}{\vspace{11pt}}%fix vertical space for Table of Content +\liite{2} +\input{sample/Xappendix2.tex} + +\addtocontents{toc}{\vspace{11pt}} +\liite{3} +\input{sample/X_R_example.tex} + + +%---------------------------------------------------------------------------------------- +% THIS IS THE END +%---------------------------------------------------------------------------------------- +\end{document} diff --git a/tex/sample/1content.tex b/tex/sample/1content.tex new file mode 100644 index 0000000..80da6ef --- /dev/null +++ b/tex/sample/1content.tex @@ -0,0 +1,177 @@ +%sample content to demonstrate LaTeX command. + +\chapter{Demonstration Content} + +This is a chapter to demonstrate some of the \LaTeX{} ~commands that you can use to format your text. +This should be \textbf{bold} and this \textit{italic} and finally \textbf{\textit{bolditalic}}. When one want to use an abbreviation or acronym like \gls{html} using the \textbf{\textbackslash{}gls} command in \gls{latex}, the first time, it comes with it full version and for all next uses in it short \gls{html} form. Of course, when needed, the full version is available using e.g. the \textbf{\textbackslash{}acrlong} command. + +The defined terms like \gls{maths} use the same \textbf{\textbackslash{}gls} \gls{latex} command. The Capitalized can be obtained with \textbf{\textbackslash{}Gls}. Should be avoided; but to have all the abbreviations and terms, even the non-used ones, use the \textbf{\textbackslash{}glsaddall} command before printing the list of Abbreviations. + +\section{Section with references} +Here is an example how to cite a bibliography entry \cite{kopka:guide} using the \textquotedblleft\textbackslash{}cite\textquotedblright ~\gls{latex} command ~\cite[section 4.2]{tobias:book}. Note that a paragraph is added by forcing a new line. + +And let also try the figure (see figure \vref{fig:latex-cover}) and internal reference (with label and ref or vref). The reference can be done to any label, for example why not to appendix \ref{appx:first} or to appendix \ref{appx:second}? To note, \gls{latex} will place the figure to the best place (except with forcing). Let them float till the final of final edit\ldots ~then force them to not break a paragraph.%hugly hack... I'm sorry +\begin{figure}[h] + \centering + \includegraphics[width=7.1cm]{LaTeX_cover} + \caption{\gls{latex} cover image (Copied from wikibooks.org (2012) \cite{wikibooks:latex}).} + \label{fig:latex-cover} +\end{figure} + +Let's also try a long quote: +From the Universal Declaration of Human Rights: +\begin{quote} +(1) Everyone has the right to education. Education shall be free, at least in the elementary and fundamental stages. Elementary education shall be compulsory. Technical and professional education shall be made generally available and higher education shall be equally accessible to all on the basis of merit. + +(2) Education shall be directed to the full development of the human personality and to the strengthening of respect for human rights and fundamental freedoms. It shall promote understanding, tolerance and friendship among all nations, racial or religious groups, and shall further the activities of the United Nations for the maintenance of peace. + +(3) Parents have a prior right to choose the kind of education that shall be given to their children. \cite[article 26]{un:udhr} +\end{quote} + +\textit{Quisque augue} est, \textbf{elementum ac porttitor} non, porttitor ac orci. Donec hendrerit, ligula ac luctus egestas, sem dolor pretium nunc, sed vehicula magna diam a massa. Donec mattis, arcu et tempor mattis, risus tortor ultrices metus, nec sodales sem dolor eu elit.\vspace{-17pt} +\begin{itemize} +\item \textbf{A small hack} with list +\item is to force the vertical space +\item before and after the list +\end{itemize} +\vspace{-17pt} Nullam egestas enim at odio pellentesque bibendum. + +\subsection{Subsection} +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. +\reaction{\label{eq:reaktio}$\underset{\text{+II}}{\ce{2Fe^2+}}$ + $\underset{\text{+I\;-I}}{\ce{H2O2}}$ + $\underset{\text{+I\;-II}}{\ce{2H3O^+}}$ <=> $\underset{\text{+III}}{\ce{2Fe^3+}}$ + $\underset{\text{+I\;-II}}{\ce{4H2O}}$} +Työn aluksi rauta(II)ionit hapetetaan rauta(III)ioneiksi väkevällä vetyperoksidilla, kuten reaktion~\ref{eq:reaktio} hapetusluvuista nähdään (rauta hapettuu, happi pelkistyy). +\reaction{Fe^3+( \emph{aq} ) + 3OH^-( \emph{aq} ) + $(x-1)$H2O( \emph{l} ) -> FeOOH $\cdot$ $x$(H2O)( \emph{s} )} +Rauta(III)ionit saostetaan emäksen (\ce{NH3}) avulla ja saadaan tuotteeksi kidevedellinen rauta(III)hydroksidi. Saatu saostuma pestään \ce{NH4NO3}:lla. +\reaction{FeOOH $\cdot$ $x$(H2O)( \emph{s} ) ->T[$\Delta$900-1000\celsius] Fe2O3( \emph{s} )} + +\subsection{Subsection with \Gls{maths}} +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. Tertiäärinen butyylikloridi reagoi veden kanssa oheisen reaktion mukaisesti: +\reaction{(CH3)3CCl + 2H2O -> (CH3)3COH+H3O+ +Cl-} +Kyseessä on ensimmäisen kertaluvun reaktio, joten reaktion nopeus on +\begin{align} +v=-\frac{\mathrm{d}[\tn{t-ButCl}]}{\mathrm{d}t}=\frac{\mathrm{d}[\tn{HCl}]}{\mathrm{d}t}=k[\tn{t-ButCl}] +\end{align} +Jos tarkastellaan lähtöaineen t-butyylikloridin häviämistä saadaan +\begin{align} +\frac{\mathrm{d}[\tn{t-ButCl}]}{[\tn{t-ButCl}]}&=-k\mathrm{d}t \\ +\int \frac{\mathrm{d}[\tn{t-ButCl}]}{[\tn{t-ButCl}]}&=-k \int \mathrm{d}t \\ +\ln \int_{[\tn{t-ButCl}]_0}^{[\tn{t-ButCl}]} [\tn{t-ButCl}]&=-k\int_0^t t \\ +\ln \left( \frac{[\tn{t-ButCl}]}{[\tn{t-ButCl}]_0} \right)&=-kt +\end{align} +Ionivahvuus lasketaan kaavalla. +\begin{align} +I&=\frac{1}{2}\cdot\sum z_i^2c_i \\ +z_i&= \tn{ionin varausluku} \\ +c_i&= \tn{ionin konsentraatio} +\end{align} +Aktiivisuuskerroin $\gamma_\pm$ lasketaan kaavalla. +\begin{align} +\log \gamma_\pm &= -\left|z_+\cdot z_-\right|A\cdot I^{\frac{1}{2}} \\ +A &= \tn{0,509 (lämpötilassa 25\celsius}) \\ +I &= \tn{ionivahvuus} \\ +z &= \tn{ionien varaus} +\end{align} + +\section{Section with Source Code} +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +%For sharelatex users, use space instead of tab to avoid ^^I +\begin{code} + \begin{minted}{php} + +

Hello !

+

your message got received.

+ +\end{minted} + \captionof{listing}{Descriptive Caption Text (e.g. this code do blah)} + \label{code:testphp} +\end{code} + + +As see in listing \ref{code:testphp}, blah. It is also possible to have code inline, for example \mintinline{sql}{SELECT * FROM user WHERE age >= 18} that was SQL. +The lisings \ref{code:htmlfull} and \ref{code:htmlpart} show how to load code from an external source file. In the case of listing \ref{code:htmlpart} it only take few line out of the source code file. + +\begin{code} + \inputminted{html}{code/html5_sample.html} + \captionof{listing}{Some html code} + \label{code:htmlfull} +\end{code} + Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. + + \begin{code} + \inputminted[firstline=3,lastline=6]{html}{code/html5_sample.html} + \captionof{listing}{The \mintinline{html}{} section of an html page} + \label{code:htmlpart} +\end{code} + + + Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + + +\section{Section with Table} +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +\begin{table}[h] + \centering + \caption{Some data} + %IMPORTANT the caption must be before the tabular, so it will be on top of the table (there are other tricks to force it on top; but this one is straitforward). + \begin{tabular}{| l | >{\centering\arraybackslash}p{.5\textwidth} |} + \hline + Test 1 & test 1234 test \\ + \hline + Some more date comes here & with more values and if the text is very long it will disappear out of the box unless you force the column size :( \\ + \hline + \end{tabular} + \label{table:some_data} +\end{table} + + +As presented in table \ref{table:some_data}: Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +\begin{table}[h] + \centering + \caption{Another table with tabularx} + \begin{tabularx}{.95\textwidth}{| l | >{\centering\arraybackslash} X |} + \hline + Test 1 & test 1234 test \\ + \hline + Some more date comes here & with more values and if the text is very long it will disappear out of the box unless you force the table size :( \\ + \hline + \end{tabularx} + \label{table:some_data2} +\end{table} + +As presented in table \ref{table:some_data2}: Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +\begin{table}[htbp] + \centering + \caption{Booktabs example} + \begin{tabular}{rrrr} + \toprule + t (s) & [HCl] & [t-ButCl] & $\ln\frac{[t-ButCl]}{[t-ButCl]_0}$ \\ + \midrule + 0 & 4,02 & 160,88 & 0,00 \\ + 10 & 63 & 101,9 & -0,46 \\ + 20 & 115,2 & 49,7 & -1,17 \\ + 30 & 141,3 & 23,6 & -1,92 \\ + 40 & 157,9 & 7 & -3,13 \\ + 50 & 161 & 3,9 & -3,72 \\ + 60 & 164,3 & 0,6 & -5,59 \\ + 70 & 163,5 & 1,4 & -4,74 \\ + 80 & 163,8 & 1,1 & -4,99 \\ + 90 & 164,1 & 0,8 & -5,30 \\ + 100 & 164,3 & 0,6 & -5,59 \\ + \bottomrule + \end{tabular} + \label{tab:thisislabel} +\end{table} + +As presented in table \ref{tab:thisislabel}: Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +\clearpage %force the next chapter to start on a new page. Keep that as the last line of your chapter! diff --git a/tex/sample/2lorem.tex b/tex/sample/2lorem.tex new file mode 100644 index 0000000..2293c0f --- /dev/null +++ b/tex/sample/2lorem.tex @@ -0,0 +1,11 @@ +%Dummy content to use some space... + +\chapter{Dummy Content} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam aliquam purus, in ornare nulla imperdiet molestie. Nam tempus erat eu dui rhoncus et vestibulum mi elementum. Ut porttitor elit sit amet justo dignissim sit amet sagittis massa egestas. Mauris sed dolor eget dui fermentum sodales ut eu nibh. + +Quisque augue est, elementum ac porttitor non, porttitor ac orci. Donec hendrerit, ligula ac luctus egestas, sem dolor pretium nunc, sed vehicula magna diam a massa. Donec mattis, arcu et tempor mattis, risus tortor ultrices metus, nec sodales sem dolor eu elit. Nullam egestas enim at odio pellentesque bibendum. + +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +\clearpage %force the next chapter to start on a new page. Keep that as the last line of your chapter! diff --git a/tex/sample/3graph.tex b/tex/sample/3graph.tex new file mode 100644 index 0000000..ec72bbe --- /dev/null +++ b/tex/sample/3graph.tex @@ -0,0 +1,67 @@ +% Sample content to demonstrate tikzpicture + +\chapter{Graph} + +Data to plot the graph \ref{fig:stdplot} are in data.dat file. +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam aliquam purus, in ornare nulla imperdiet molestie. Nam tempus erat eu dui rhoncus et vestibulum mi elementum. Ut porttitor elit sit amet justo dignissim sit amet sagittis massa egestas. Mauris sed dolor eget dui fermentum sodales ut eu nibh. +\begin{figure}[htbp] + \centering + \begin{tikzpicture} + \pgfplotsset{width=12cm, + compat=1.3, + legend style={font=\footnotesize}} + \begin{axis}[ + xlabel={c (mg/l)}, + ylabel={A}, + legend pos=north west, + ymajorgrids=true, + grid style=dashed +] + +\addplot [only marks, blue] table {data.dat}; +\addplot [no markers, thick, red] table[ +x=c, +y={create col/linear regression}] {data.dat}; +\addlegendentry{data} +\addlegendentry{% +$\pgfmathprintnumber{\pgfplotstableregressiona}x +\pgfmathprintnumber[print sign]{\pgfplotstableregressionb}$} +\end{axis} +\end{tikzpicture} +\caption{Simple linear regression plot (cannot get $r^2$ value)} +\label{fig:stdplot} +\end{figure} + +Quisque augue est, as seen in figure \ref{fig:stdplot} elementum ac porttitor non, porttitor ac orci. Donec hendrerit, ligula ac luctus egestas, sem dolor pretium nunc, sed vehicula magna diam a massa. Donec mattis, arcu et tempor mattis, risus tortor ultrices metus, nec sodales sem dolor eu elit. Nullam egestas enim at odio pellentesque bibendum. + +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +\section{Section} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam aliquam purus, in ornare nulla imperdiet molestie. Nam tempus erat eu dui rhoncus et vestibulum mi elementum. +\tikzstyle{palikka} = [rectangle, rounded corners, minimum width=1cm, minimum height=1cm, text centered, text width=2cm, draw=black, fill=red!30] +\tikzstyle{arrow} = [thick,->,>=stealth] +\begin{figure}[htbp] +\centering +\begin{tikzpicture}[node distance=2.75cm] +\node[label=90:Label] (yksi) [palikka] {Lorem}; +\node (kaksi) [palikka, right of=yksi] {ipsum}; +\node (kolme) [palikka, below of=kaksi, yshift=1cm] {dolor}; +\node (neljä) [palikka, left of=kolme] {sit}; +\node (viisi) [palikka, below of=neljä, yshift=1cm] {amet}; +\draw [arrow] (yksi) -- (kaksi); +\draw [arrow] (kaksi) -- node[anchor=west] {tekstiä} (kolme); +\draw [arrow] (kolme) -- (neljä); +\draw [arrow] (neljä) -- (viisi); +\end{tikzpicture} +\caption{Example tikz-picture} +\label{fig:tikz} +\end{figure} + +As seen in figure \ref{fig:tikz}, ut porttitor elit sit amet justo dignissim sit amet sagittis massa egestas. Mauris sed dolor eget dui fermentum sodales ut eu nibh. + +\section{Section} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam aliquam purus, in ornare nulla imperdiet molestie. Nam tempus erat eu dui rhoncus et vestibulum mi elementum. Ut porttitor elit sit amet justo dignissim sit amet sagittis massa egestas. Mauris sed dolor eget dui fermentum sodales ut eu nibh. + +\clearpage %force the next chapter to start on a new page. Keep that as the last line of your chapter! diff --git a/tex/sample/X_R_example.tex b/tex/sample/X_R_example.tex new file mode 100644 index 0000000..6b0a167 --- /dev/null +++ b/tex/sample/X_R_example.tex @@ -0,0 +1,7 @@ +% Appendix to demonstrate R integration + +\chapter{R examples} + +TODO + +\clearpage %force the next chapter/appendix to start on a new page. Keep that as the last line of your appendix! diff --git a/tex/sample/Xappendix1.tex b/tex/sample/Xappendix1.tex new file mode 100644 index 0000000..79ca85c --- /dev/null +++ b/tex/sample/Xappendix1.tex @@ -0,0 +1,29 @@ +% Appendix +% And demonstrate text references and bibliography references in appendix + +\chapter{Some Appendix}\label{appx:first} + +Note that every appendix will be a chapter. + +Sorry for the ugly hack on how to count the total pages per appendix. + + +Of course with section and subsection. + +\section{Appendix Section} + +And you can cite \cite{tobias:book} stuff, it will go into the main bibliography. + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam aliquam purus, in ornare nulla imperdiet molestie. Nam tempus erat eu dui rhoncus et vestibulum mi elementum. Ut porttitor elit sit amet justo dignissim sit amet sagittis massa egestas. Mauris sed dolor eget dui fermentum sodales ut eu nibh. + +Quisque augue est, elementum ac porttitor non, porttitor ac orci. Donec hendrerit, ligula ac luctus egestas, sem dolor pretium nunc, sed vehicula magna diam a massa. Donec mattis, arcu et tempor mattis, risus tortor ultrices metus, nec sodales sem dolor eu elit. Nullam egestas enim at odio pellentesque bibendum. + +\subsection{With a Subsection} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam aliquam purus, in ornare nulla imperdiet molestie. Nam tempus erat eu dui rhoncus et vestibulum mi elementum. Ut porttitor elit sit amet justo dignissim sit amet sagittis massa egestas. Mauris sed dolor eget dui fermentum sodales ut eu nibh. + +Quisque augue est, elementum ac porttitor non, porttitor ac orci. Donec hendrerit, ligula ac luctus egestas, sem dolor pretium nunc, sed vehicula magna diam a massa. Donec mattis, arcu et tempor mattis, risus tortor ultrices metus, nec sodales sem dolor eu elit. Nullam egestas enim at odio pellentesque bibendum. + +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +\clearpage %force the next chapter/appendix to start on a new page. Keep that as the last line of your appendix! diff --git a/tex/sample/Xappendix2.tex b/tex/sample/Xappendix2.tex new file mode 100644 index 0000000..946d6ea --- /dev/null +++ b/tex/sample/Xappendix2.tex @@ -0,0 +1,43 @@ +% Appendix +% Just to have more appendices and more content + +\chapter{Dummy Appendix}\label{appx:second} + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam aliquam purus, in ornare nulla imperdiet molestie. Nam tempus erat eu dui rhoncus et vestibulum mi elementum. Ut porttitor elit sit amet justo dignissim sit amet sagittis massa egestas. Mauris sed dolor eget dui fermentum sodales ut eu nibh. + +Quisque augue est, elementum ac porttitor non, porttitor ac orci. Donec hendrerit, ligula ac luctus egestas, sem dolor pretium nunc, sed vehicula magna diam a massa. Donec mattis, arcu et tempor mattis, risus tortor ultrices metus, nec sodales sem dolor eu elit. Nullam egestas enim at odio pellentesque bibendum. + +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam aliquam purus, in ornare nulla imperdiet molestie. Nam tempus erat eu dui rhoncus et vestibulum mi elementum. Ut porttitor elit sit amet justo dignissim sit amet sagittis massa egestas. Mauris sed dolor eget dui fermentum sodales ut eu nibh. + +Quisque augue est, elementum ac porttitor non, porttitor ac orci. Donec hendrerit, ligula ac luctus egestas, sem dolor pretium nunc, sed vehicula magna diam a massa. Donec mattis, arcu et tempor mattis, risus tortor ultrices metus, nec sodales sem dolor eu elit. Nullam egestas enim at odio pellentesque bibendum. + +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam aliquam purus, in ornare nulla imperdiet molestie. Nam tempus erat eu dui rhoncus et vestibulum mi elementum. Ut porttitor elit sit amet justo dignissim sit amet sagittis massa egestas. Mauris sed dolor eget dui fermentum sodales ut eu nibh. + +Quisque augue est, elementum ac porttitor non, porttitor ac orci. Donec hendrerit, ligula ac luctus egestas, sem dolor pretium nunc, sed vehicula magna diam a massa. Donec mattis, arcu et tempor mattis, risus tortor ultrices metus, nec sodales sem dolor eu elit. Nullam egestas enim at odio pellentesque bibendum. + +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam aliquam purus, in ornare nulla imperdiet molestie. Nam tempus erat eu dui rhoncus et vestibulum mi elementum. Ut porttitor elit sit amet justo dignissim sit amet sagittis massa egestas. Mauris sed dolor eget dui fermentum sodales ut eu nibh. + +Quisque augue est, elementum ac porttitor non, porttitor ac orci. Donec hendrerit, ligula ac luctus egestas, sem dolor pretium nunc, sed vehicula magna diam a massa. Donec mattis, arcu et tempor mattis, risus tortor ultrices metus, nec sodales sem dolor eu elit. Nullam egestas enim at odio pellentesque bibendum. + +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam aliquam purus, in ornare nulla imperdiet molestie. Nam tempus erat eu dui rhoncus et vestibulum mi elementum. Ut porttitor elit sit amet justo dignissim sit amet sagittis massa egestas. Mauris sed dolor eget dui fermentum sodales ut eu nibh. + +Quisque augue est, elementum ac porttitor non, porttitor ac orci. Donec hendrerit, ligula ac luctus egestas, sem dolor pretium nunc, sed vehicula magna diam a massa. Donec mattis, arcu et tempor mattis, risus tortor ultrices metus, nec sodales sem dolor eu elit. Nullam egestas enim at odio pellentesque bibendum. + +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam aliquam aliquam purus, in ornare nulla imperdiet molestie. Nam tempus erat eu dui rhoncus et vestibulum mi elementum. Ut porttitor elit sit amet justo dignissim sit amet sagittis massa egestas. Mauris sed dolor eget dui fermentum sodales ut eu nibh. + +Quisque augue est, elementum ac porttitor non, porttitor ac orci. Donec hendrerit, ligula ac luctus egestas, sem dolor pretium nunc, sed vehicula magna diam a massa. Donec mattis, arcu et tempor mattis, risus tortor ultrices metus, nec sodales sem dolor eu elit. Nullam egestas enim at odio pellentesque bibendum. + +Donec et sapien ac leo condimentum vulputate id et tellus. Maecenas hendrerit malesuada interdum. Aenean dignissim sem faucibus elit congue faucibus id non risus. Morbi at dui non tortor pellentesque consequat non eget urna. Cras in sapien dui, a tincidunt velit. + + +\clearpage %force the next chapter/appendix to start on a new page. Keep that as the last line of your appendix! diff --git a/tex/style/abbr.tex b/tex/style/abbr.tex new file mode 100644 index 0000000..6bea215 --- /dev/null +++ b/tex/style/abbr.tex @@ -0,0 +1,28 @@ +% Abbreviation and Glossary +% Normally, you don't have to modify this file. Your abbreviations, etc. goes in +% ../chapters/0abbr.tex file. + +\begin{singlespacing} + +% \gsladdall would add all terms even if not used in your text. +%\glsaddall + \addtocontents{toc}{\cftpagenumbersoff{chapter}} +{ + \titleformat{\section} + {\fontsize{13pt}{13pt}\bfseries\linespread{1}} + {\thesection}{.5cm}{} + %Adapt labelwidth (sorry for the ugly hack) + \setlist[description]{leftmargin=!, labelwidth=4em} + \IfLanguageName {finnish} { + \printacronyms[title=Lyhenteet] + }{ + \printacronyms[title=List of Abbreviations] + } + \setlist[description]{leftmargin=!, labelwidth=7em} + \printglossary + \setlist[description]{style=standard} % reset settings back to default +} +\addtocontents{toc}{\cftpagenumberson{chapter}} +\end{singlespacing} + +\clearpage diff --git a/tex/style/appendix.tex b/tex/style/appendix.tex new file mode 100644 index 0000000..bbd8964 --- /dev/null +++ b/tex/style/appendix.tex @@ -0,0 +1,24 @@ +% Appendix +% Normally, you do not have to edit this file. + +%start appendix +\appendix +%no page number for appendix in table of content +\addtocontents{toc}{\cftpagenumbersoff{chapter}} +%appendix sections and subsections not in table of content +\settocdepth{chapter} +%add "Appendices" in the table of content +\addappheadtotoc +%have Appendix 1 (instead of Appendix A) +\renewcommand{\thechapter}{\arabic{chapter}} + +\newcommand\liite[1]{ +%each appendix restart page num to one +\setcounter{page}{1} +%special counter for appendix TODO: this is a ugly quick hack :( Should find a better way to count the page per appendix. +\newtotcounter{appx#1} +%overwrite the header +\makeevenhead{plain}{}{}{\appname \thechapter \\ \thepage\,(\stepcounter{appx#1}\total{appx#1})} +\makeoddhead{plain}{}{}{\appname \thechapter \\ \thepage\,(\stepcounter{appx#1}\total{appx#1})}} + + diff --git a/tex/style/biblio.tex b/tex/style/biblio.tex new file mode 100644 index 0000000..9ed0492 --- /dev/null +++ b/tex/style/biblio.tex @@ -0,0 +1,20 @@ +% Bibliography. +% Normally you do not edit this file. +% To add bibliography in your text, add them first in the biblio.bib file and +% reference them with the \cite{} command in your text. + +\IfLanguageName{finnish}{\bibliographystyle{vancouver_fi}}{\bibliographystyle{vancouver}} +%line space +%\singlespacing %removed otherwise the appendix are also single space +\begin{flushleft} +\begin{singlespacing} +\bibliography{biblio} +\end{singlespacing} +\end{flushleft} + +%for conting the pages +\label{LastPage}~ + +%avoid that the last page of bib get appendix header +\clearpage + diff --git a/tex/style/content.tex b/tex/style/content.tex new file mode 100644 index 0000000..bffd1a1 --- /dev/null +++ b/tex/style/content.tex @@ -0,0 +1,13 @@ +% Style for the main thesis content. +% Normally, you should not edit this file. + +%page number always on top right; also for chapter "title" page +\pagestyle{plain} +\makeevenhead{plain}{}{}{\thepage} +\makeoddhead{plain}{}{}{\thepage} + +\setcounter{page}{1} %page 1 should be Introduction + +\sloppy % enforce alignment to fully justified + + diff --git a/tex/style/style.tex b/tex/style/style.tex new file mode 100644 index 0000000..286dce2 --- /dev/null +++ b/tex/style/style.tex @@ -0,0 +1,207 @@ +% Global style. Normally should not be edited. +% If you use windows OS, eventually change \setmainfont to Arial +% Check around commit https://github.com/panunu/metropolia-thesis-latex/commit/a0c15ac77bab1a52c59c517a18080938e57bf5ef +% to see how the font files were manually added (after downloading them: https://pagure.io/liberation-fonts/ ) + +\documentclass[11pt,a4paper,oneside,article]{memoir} +\usepackage[\secondlang,\thesislang]{babel}% finnish english swedish +\usepackage{iflang} +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{amssymb} +\usepackage{fontspec} +\usepackage{tocloft} +\usepackage{titlesec} +\usepackage[hyphens]{url} +\usepackage{mathtools} +\usepackage{wallpaper} +\usepackage{datetime} +\usepackage[bookmarksdepth=subsection]{hyperref} % for automagic pdf links for toc, refs, etc. +\usepackage[amssymb]{SIunits} +\usepackage[version=3]{mhchem} +\usepackage{pgfplots} %simple plots etc +\usepackage{pgfplotstable} +\usepackage{tikz} % mindmaps, flowcharts, piecharts, examples at http://www.texample.net/tikz/examples/ +\usetikzlibrary{shapes.geometric, arrows} + + +\renewcommand{\dateseparator}{.} +%condition for adding or not space in TOC +\usepackage{etoolbox} +%for compact list +\usepackage{enumitem} +%for block comment +\usepackage{verbatim} +%for "easier" references +\usepackage{varioref} +%forcing single line spacing in bibliography +\DisemulatePackage{setspace} +\usepackage{setspace} +%including figure (image) +\usepackage{graphicx} +%change the numbering for figure +\usepackage{chngcntr} +%strike trough +\usepackage{ulem} +%euro symbol +\usepackage{eurosym} +%try to count +\usepackage{totcount} +%insert source code +%\usepackage{listings} +%require -8bit -shell-escape in the xelatex compile command +%if compiling locally, consider options cachedir=minted,outputdir=~/.tex +\usepackage[newfloat]{minted} +\setminted{tabsize=2,linenos,breaklines,breaksymbolleft={\quad},baselinestretch=1} +\setmintedinline{breaklines} +\usepackage[justification=justified,singlelinecheck=false,font=small]{caption} +\usepackage{color} +%force the width of a table instead of column +\usepackage{tabularx} +\usepackage{booktabs} %why not booktabs? :3 +% Abbreviations, acronym and glossary +\usepackage[acronym,toc,nonumberlist,section=chapter]{glossaries}%xindy,%toc, ,nomain +\renewcommand*{\glsclearpage}{} + +\usepackage{float} % For forced figure location with modifier H (\begin{figure}[H]) +\usepackage{cite} % Make citations to match Metropolia thesis guide + +% change font of links in bibliography to same as other text +\usepackage{url} +\urlstyle{same} + +% change punctuation of multiple cites to semicolon instead of comma: [1; 2; 3] +\renewcommand\citepunct{; } + +% citep-macro for reference with period inside square brackets [1.] +\newcommand{\citep}[1]{ + \renewcommand\citeright{.]} + \cite{#1} + \renewcommand\citeright{]} +} + +%set date format to D.M.YYYY +\newdateformat{specialdate}{\THEDAY.\THEMONTH.\THEYEAR} +%set date format to D Month YYYY +\newdateformat{longmonth}{\THEDAY~\monthname[\THEMONTH] \THEYEAR} + +\newcommand\tn[1]{\textnormal{#1}} %use \tn instead of \textnormal +\newcommand\reaction[1]{\begin{equation}\ce{#1}\end{equation}} %\reaction{} for chemical reactions + +%NORMAL TEXT +%all text, title, etc. in the same font: Arial +%NOTE: fontname is case-sensitive +\setmainfont{Liberation Sans} +%line space +\linespread{1.5} +\AtBeginEnvironment{tabular}{\singlespacing} +%\doublespacing +%margin +\usepackage[top=2.5cm, bottom=3cm, left=4cm, right=2cm, nofoot]{geometry} +\setlength{\parindent}{0pt} %first line of paragraph not indented +\setlength{\parskip}{16.5pt} %one empty line to separate paragraph +%list with small line space separation +\tightlists + +%IMAGE - FIGURE +%the figures should be placed in the "illustration" folder +\graphicspath{{illustration/}} +%figure number without chapter (1.1, 1.2, 2.1) to (1, 2, 3) +\counterwithout{figure}{chapter} +%border around images +\setlength\fboxsep{0pt} +\setlength\fboxrule{0.5pt} +%space after figure caption (and other float elements) +\setlength{\belowcaptionskip}{-7pt} + +%TABLE +\counterwithout{table}{chapter} + +%SOURCE CODE +\newenvironment{code}{\captionsetup{type=listing}}{} +\IfLanguageName {finnish} {\SetupFloatingEnvironment{listing}{name=Koodiesimerkki}} {}%was Listaus +%\counterwithout{lstlisting}{chapter} +%moved after begin document, otherwise does not compile + +%% set this format as the default for lstlisting +%\DeclareCaptionFormat{empty}{} +%\captionsetup[lstlisting]{format=empty} + +%TOC +%change toc title +\IfLanguageName {finnish} {\addto{\captionsfinnish}{\renewcommand*{\contentsname}{Sisällys}}} {} +%remove dots +\renewcommand*{\cftdotsep}{\cftnodots} +%chapter title and page number not in bold +\renewcommand{\cftchapterfont}{} +\renewcommand{\cftchapterpagefont}{} +%sub section in toc +\setcounter{tocdepth}{2} +%subsection numbered +\setcounter{secnumdepth}{2} +\renewcommand{\tocheadstart}{\vspace*{-15pt}} +\renewcommand{\printtoctitle}[1]{\fontsize{13pt}{13pt}\bfseries #1} +%\renewcommand{\aftertoctitle}{\vspace*{-22pt}\afterchaptertitle} +%spacing afer a chapter in toc +\preto\section{% + \ifnum\value{section}=0\addtocontents{toc}{\vskip11pt}\fi +} +%spacing afer a section in toc +\renewcommand{\cftsectionaftersnumb}{\vspace*{-3pt}} +%spacing afer a subsection in toc +\renewcommand{\cftsubsectionaftersnumb}{\vspace*{-1pt}} +%appendix in toc with "Appendix " + num +\IfLanguageName {finnish} { + \renewcommand*{\cftappendixname}{Liite\space} + \renewcommand{\appendixtocname}{Liitteet} +}{\renewcommand*{\cftappendixname}{Appendix\space}} +%appendix header +\IfLanguageName {finnish} {\def\appname{Liite\space}}{\def\appname{Appendix\space}} + +%TITLES +%chapter title +%\clearforchapter{\clearpage} +\titleformat{\chapter} +{\fontsize{13pt}{13pt}\bfseries\linespread{1}}%\clearpage +{\thechapter}{.5cm}{} +\titlespacing*{\chapter}{0pt}{.32cm}{9pt} +\titleformat{\section} +{\fontsize{12pt}{12pt}\linespread{1}} +{\thesection}{.5cm}{} +\titlespacing*{\section}{0pt}{14pt}{6pt} +\titleformat{\subsection} +{\fontsize{12pt}{12pt}\linespread{1}} +{\thesubsection}{.5cm}{} +\titlespacing*{\subsection}{0pt}{14pt}{6pt} + + +%QUOTE +\renewenvironment{quote} + {\list{}{\rightmargin=0pt\leftmargin=1cm\topsep=-10pt}% + \item\relax\fontsize{10pt}{10pt}\singlespacing} + {\endlist} + +%BIBLIOGRAPHY +%bibliography title to be "references" +%IF THE TITLE DON'T GET RENAMED PROPERLY, move that line after the \begin{document} +\IfLanguageName {finnish} {\addto{\captionsfinnish}{\renewcommand*{\bibname}{Lähteet}}} {\renewcommand\bibname{References}} +\makeatletter %reference list option change +\renewcommand\@biblabel[1]{#1\hspace{1cm}} %from [1] to 1 with 1cm gap +\makeatother % +\setlength{\bibitemsep}{11pt} + +%count the appendices (since the chapter counter is reset after \appendix). +%! require to complie 2 times +\regtotcounter{chapter} + + +\makepagestyle{tiivis} +\makeevenhead{tiivis}{}{}{Tiivistelmä} +\makeoddhead{tiivis}{}{}{Tiivistelmä} + +\makepagestyle{abstract} +\makeevenhead{abstract}{}{}{Abstract} +\makeoddhead{abstract}{}{}{Abstract} + +%footer on every pages +\LLCornerWallPaper{1}{\IfLanguageName{finnish}{footer_fi}{footer_en}} diff --git a/tex/style/title.tex b/tex/style/title.tex new file mode 100644 index 0000000..68d034a --- /dev/null +++ b/tex/style/title.tex @@ -0,0 +1,34 @@ +% TITLE PAGE +% Normally, you should not edit this file. + +\makeatletter +\renewcommand{\maketitle}{ +\newgeometry{left=4.5cm} +\thispagestyle{empty} +\ThisULCornerWallPaper{1}{\IfLanguageName{finnish}{metropolia_fi}{metropolia_en}} +% +\vspace*{12.8cm} +\tn{\Large\@author\\[1cm]\Huge\IfLanguageName {finnish}{\color[RGB]{155,50,35}\otsikko}{\color[RGB]{31,73,125}\@title}}%\\[22pt]\LARGE\alaotsikko\\[1.75cm]} + +\null\vfill +\parbox{.7\linewidth}{ +\IfLanguageName {finnish}{ + Metropolia Ammattikorkeakoulu\\ + \tutkinto \\ + \kohjelma \\ + \thesisfi\\ + \pvm +} { + Helsinki Metropolia University of Applied Sciences\\ + \metropoliadegree \\ + \metropoliadegreeprogramme \\ + \thesisen\\ + \IfLanguageName {finnish}{\pvm}{\@date} % D.M.YYYY date format for Finnish. D Month YYYY for English +} +} +\vspace*{-1.5cm} +\clearpage +\restoregeometry +} +\makeatother + diff --git a/tex/style/title_headers.tex b/tex/style/title_headers.tex new file mode 100644 index 0000000..c29a315 --- /dev/null +++ b/tex/style/title_headers.tex @@ -0,0 +1,10 @@ +% Title header. You should not edit that file. + +%page number always on the top right, clear the "chapter/section" head +\pagestyle{myheadings} +\markright{} +%clear chapter "title" foot page +\makeevenfoot{plain}{}{}{} +\makeoddfoot{plain}{}{}{} + + diff --git a/tex/style/toc.tex b/tex/style/toc.tex new file mode 100644 index 0000000..f2518f2 --- /dev/null +++ b/tex/style/toc.tex @@ -0,0 +1,13 @@ +% Table of Content +% Normally, you don't have to modify this file. +% In case spacing of appendix/liite goes crazy, look in ../thesis.tex and look +% for the hack described in APPENDICES. + +\makeevenhead{plain}{}{}{} +\makeoddhead{plain}{}{}{} +\pagestyle{empty} %remove page number in toc (if longer than 2 pages) +\tableofcontents* +\pagestyle{empty} %remove page number in toc (if longer than 1 pages) + +\clearpage + diff --git a/tex/vancouver_fi.bst b/tex/vancouver_fi.bst new file mode 100644 index 0000000..3a060f8 --- /dev/null +++ b/tex/vancouver_fi.bst @@ -0,0 +1,1904 @@ +%% +%% This `vancouver.bst' bibliographic style file (for LaTeX/BibTeX) is +%% generated with the docstrip utility and modified manually to meet the +%% ``Uniform Requirements for Manuscripts Submitted to Biomedical Journals'' +%% as published in N Engl J Med 1997;336:309-315. +%% (also known as the Vancouver style) +%% This specification may be found on the web page of the +%% International Committe of Medical Journal Editors: +%% +%% http://www.icmje.org +%% +%%------------------------------------------------------------------- +%% +%% Copyright 2004 Folkert van der Beek +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Folkert van der Beek. +%% +%% Complaints, suggestions and comments may be sent to +%% +%% Folkert van der Beek +%% +%%------------------------------------------------------------------- +%% +%% This bibliography style file is intended for texts in ENGLISH +%% This is a numerical citation style, and as such is standard LaTeX. +%% It requires no extra package to interface to the main text. +%% The form of the \bibitem entries is +%% \bibitem{key}... +%% Usage of \cite is as follows: +%% \cite{key} ==>> [#] +%% \cite[chap. 2]{key} ==>> [#, chap. 2] +%% where # is a number determined by the ordering in the reference list. +%% The order in the reference list is that by which the works were originally +%% cited in the text, or that in the database. + % +%% To change the reference numbering system from [1] to 1, +%% put the following code in the preamble: +%% \makeatletter % Reference list option change +%% \renewcommand\@biblabel[1]{#1} % from [1] to 1 +%% \makeatother % +%% +%%--------------------------------------------------------------------- + +%% List of all possible fields +ENTRY + { title + address + assignee % for patents + author + booktitle % for articles in books + chapter % for incollection, esp. internet documents + cartographer % for maps + day + edition + editor + howpublished + institution % for technical reports + inventor % for patents + journal + key + month + note + number + organization + pages + part + publisher + school + series + type + volume + word + year + eprint % urlbst + doi % urlbst + url % urlbst + lastchecked % urlbst + updated % urlbst + } + {} + { label } +%% Declaration of integer variables +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl } % urlbst... +INTEGERS { hrefform addeprints adddoiresolver } +% Following constants may be adjusted by hand, if desired +FUNCTION {init.config.constants} +{ + %"Saatavilla: " 'urlintro := % prefix before URL + "" 'urlintro := % prefix before URL + "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref + "arXiv:" 'eprintprefix := % text prefix printed before eprint ref + "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI + "doi:" 'doiprefix := % text prefix printed before DOI ref + #0 'addeprints := % 0=no eprints; 1=include eprints + #0 'adddoiresolver := % 0=no DOI resolver; 1=include it + #0 'hrefform := % 0=no crossrefs; 1=hypertex xrefs; 2=hyperref refs +} +INTEGERS { + bracket.state + outside.brackets + open.brackets + within.brackets + close.brackets +} +% ...urlbst to here +FUNCTION {init.state.consts} +{ #0 'outside.brackets := % urlbst + #1 'open.brackets := + #2 'within.brackets := + #3 'close.brackets := + + #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +%% Declaration of string variables +STRINGS { s t} + +% urlbst +FUNCTION {output.nonnull.original} +{ 's := + output.state mid.sentence = + { ". " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} + +% urlbst... +FUNCTION {output.nonnull} +{ % Save the thing we've been asked to output + 's := + % If the bracket-state is close.brackets, then add a close-bracket to + % what is currently at the top of the stack, and set bracket.state + % to outside.brackets + bracket.state close.brackets = + { "]" * + outside.brackets 'bracket.state := + } + 'skip$ + if$ + bracket.state outside.brackets = + { % We're outside all brackets -- this is the normal situation. + % Write out what's currently at the top of the stack, using the + % original output.nonnull function. + s + output.nonnull.original + } + { % Still in brackets. Add open-bracket or (continuation) comma, add the + % new text (in s) to the top of the stack, and move to the close-brackets + % state, ready for next time (unless inbrackets resets it). If we come + % into this branch, then output.state is carefully undisturbed. + bracket.state open.brackets = + { " [" * } + { ", " * } % bracket.state will be within.brackets + if$ + s * + close.brackets 'bracket.state := + } + if$ +} + +% Call this function just before adding something which should be presented in +% brackets. bracket.state is handled specially within output.nonnull. +FUNCTION {inbrackets} +{ bracket.state close.brackets = + { within.brackets 'bracket.state := } % reset the state: not open nor closed + { open.brackets 'bracket.state := } + if$ +} + +FUNCTION {format.lastchecked} +{ lastchecked empty$ + { "" } + { updated empty$ + { "Luettu " lastchecked * } + { "Päivitetty " updated * "; Luettu " * lastchecked * } + if$ + } + if$ +} +% ...urlbst to here + +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} + +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} + +FUNCTION {fin.entry} +{ + bracket.state close.brackets = % urlbst + { "]" * } + 'skip$ + if$ + add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} + +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} + +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {no.blank.or.punct} +{ "" * before.all 'output.state := +} + +FUNCTION {add.semicolon} +{ + ";" * + no.blank.or.punct +} + +FUNCTION {date.block} +{ + "." * + no.blank.or.punct +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% LOGICAL `NOT', `AND', AND `OR' % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Logical 'not': +% If the first element on the stack is A then this function +% does the following: +% push { #0 } +% push { #1 } +% So now the first 3 elements of the stack are +% { #1 } { #0 } A +% The first 3 are popped and subjected to 'if': +% If A > 0 then { #0 } is executed, else { #1 } is executed: +% if A > 0 +% then 0 +% else 1 +% So consider integers as logicals, where 1 = true and 0 = false, +% then this does +% (if A then false else true) +% which is a logical 'not'. + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Logical 'and': +% If the first 2 elements on the stack are A B +% then this function does the following: +% push 'skip$ +% push { pop$ #0 } +% So now first 4 elements are +% { pop$ #0 } 'skip$ A B +% The first 3 are popped and subjected to 'if' (B is on top of +% the stack): +% If A > 0 then 'skip$ is executed, else { pop$ #0 } is executed: +% if A > 0 +% then (B stays on top of stack) +% else (B is popped and #0 is pushed) +% So consider integers as logicals, where 1 = true and 0 = false, +% then this does +% (if A then B else false) +% which is a logical 'and'. + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Logical 'or': +% If the first 2 elements on the stack are A B +% then this function does the following: +% push { pop$ #1 } +% push 'skip$ +% So now first 4 elements are +% 'skip$ { pop$ #1 } A B +% The first 3 are popped and subjected to 'if' (B is on top of +% the stack): +% If A > 0 then { pop$ #1 } is executed, else 'skip$ is executed: +% if A > 0 +% then (B is popped and #1 is pushed) +% else (B stays on top of stack) +% So consider integers as logicals, where 1 = true and 0 = false, +% then this does +% (if A then true else B) +% which is a logical 'or'. + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% GENERAL PURPOSE FUNCTIONS FOR FORMATTING % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% issues warning if field is empty +% call with +% "field" field warning.if.empty +% Note that the first field must be between quotes +% because it is the fieldname for use in the warning message. +% + +FUNCTION {warning.if.empty} +{ empty$ + { "No " swap$ * " in " * cite$ * warning$ } + { pop$ } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % encloses string in pre- and postfix string + % call with + % prefix postfix S enclose.check + % delivers empty string if S empty + % +FUNCTION {enclose.check} +{ duplicate$ empty$ + { pop$ pop$ pop$ + "" + } + { swap$ * * } + if$ +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% emphasizes top of stack +% call with +% string" emphasize.check +% + +FUNCTION {emphasize.check} +{ "\Bem{" swap$ + "}" swap$ + enclose.check +} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % brackets top of stack + % call with + % "string" bracket.check + % +FUNCTION {bracket.check} +{ "[" swap$ + "]" swap$ + enclose.check +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % + % parenthesizes top of stack + % call with + % "string" parenthesize + % +FUNCTION {parenthesize.check} +{ "(" swap$ + ")" swap$ + enclose.check +} + +STRINGS {z} + +FUNCTION {remove.dots} +{ 'z := % expects string on top of the stack, pops the string and assigns it to variable z + "" % push empty string + { z empty$ not } % returns 0 if variable z is empty + { z #1 #1 substring$ % push the first character of variable z + z #2 global.max$ substring$ 'z := % assigns the 2nd to last character of variable z to variable z + duplicate$ "\" = % pushes 1 if the last character is "\", otherwise 0 + { * % concatenates the last 2 literals + z #1 #1 substring$ % push the first character of variable z + z #2 global.max$ substring$ 'z := % assigns the 2nd to last character of variable z to variable z + * % concatenates the last 2 literals, i.e. every character, even a dot, following a "\" will be printed + } + { duplicate$ "." = % pushes 1 if the last character is ".", otherwise 0 + 'pop$ % pushes the pop$ function + { * } % concatenates the last 2 literals + if$ % pops the last character if it is a dot, otherwise concatenates it with the string on top of the stack + } + if$ + } + while$ +} + +INTEGERS {l} +FUNCTION{string.length} +{ + #1 'l := + { duplicate$ duplicate$ #1 l substring$ = not } + { l #1 + 'l := } + while$ + pop$ l +} + +STRINGS {replace find text} +INTEGERS {find_length} +FUNCTION {find.replace} +{ + 'replace := + 'find := + 'text := + find string.length 'find_length := + "" + { text empty$ not } + { text #1 find_length substring$ find = + { + replace * + text #1 find_length + global.max$ substring$ 'text := + } + { text #1 #1 substring$ * + text #2 global.max$ substring$ 'text := + } + if$ + } + while$ +} + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ skip$ } + +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH + +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.editors} +{ "editors" } + +FUNCTION {bbl.editor} +{ "editor" } + +FUNCTION {bbl.cartographers} +{ "cartographers" } + +FUNCTION {bbl.cartographer} +{ "cartographer" } + +FUNCTION {bbl.inventors} +{ "inventors" } + +FUNCTION {bbl.inventor} +{ "inventor" } + +FUNCTION {bbl.assignees} +{ "assignees" } + +FUNCTION {bbl.assignee} +{ "assignee" } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "ed." } + +FUNCTION {bbl.volume} +{ "vol." } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "no." } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "p." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.chapter} +{ "chap." } + +FUNCTION {bbl.techrep} +{ "Tech. Rep." } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +FUNCTION {bbl.first} +{ "1st" } + +FUNCTION {bbl.second} +{ "2nd" } + +FUNCTION {bbl.third} +{ "3rd" } + +FUNCTION {bbl.fourth} +{ "4th" } + +FUNCTION {bbl.fifth} +{ "5th" } + +FUNCTION {bbl.st} +{ "st" } + +FUNCTION {bbl.nd} +{ "nd" } + +FUNCTION {bbl.rd} +{ "rd" } + +FUNCTION {bbl.th} +{ "th" } + +MACRO {jan} {"Jan."} + +MACRO {feb} {"Feb."} + +MACRO {mar} {"Mar."} + +MACRO {apr} {"Apr."} + +MACRO {may} {"May"} + +MACRO {jun} {"Jun."} + +MACRO {jul} {"Jul."} + +MACRO {aug} {"Aug."} + +MACRO {sep} {"Sep."} + +MACRO {oct} {"Oct."} + +MACRO {nov} {"Nov."} + +MACRO {dec} {"Dec."} + +FUNCTION {eng.ord} +{ duplicate$ "1" swap$ * + #-2 #1 substring$ "1" = + { bbl.th * } + { duplicate$ #-1 #1 substring$ + duplicate$ "1" = + { pop$ bbl.st * } + { duplicate$ "2" = + { pop$ bbl.nd * } + { "3" = + { bbl.rd * } + { bbl.th * } + if$ + } + if$ + } + if$ + } + if$ +} + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} + +STRINGS { bibinfo} +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + "." ". " find.replace 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}{ f{}}{ jj}" + format.name$ + remove.dots + bibinfo bibinfo.check + 't := + nameptr #1 > + { + nameptr #6 + #1 + = + numnames #6 + > and + { "others" 't := + #1 'namesleft := } + 'skip$ + if$ + namesleft #1 > + { ", " * t * } + { + "," * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} + +FUNCTION {format.names.org} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ff~}{vv~}{ll}" + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { "; " * t * } + { + ";" * + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { " " * t * } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} + +FUNCTION {format.names.ed} +{ + format.names +} + +FUNCTION {format.authors} +{ + %%author "author" format.names + author "author" bibinfo.check + %%"." " " "author" find.replace format.names +} + +FUNCTION {format.publishers} +{ + publisher "publisher" bibinfo.check + %%"." " " "author" find.replace format.names +} + +FUNCTION {format.organizations} +{ organization "organization" format.names.org +} + +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {get.bbl.cartographer} +{ cartographer num.names$ #1 > 'bbl.cartographers 'bbl.cartographer if$ } + +FUNCTION {get.bbl.inventor} +{ inventor num.names$ #1 > 'bbl.inventors 'bbl.inventor if$ } + +FUNCTION {get.bbl.assignee} +{ assignee num.names$ #1 > 'bbl.assignees 'bbl.assignee if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.editor + * + } + if$ +} + +FUNCTION {format.assignees} +{ assignee "assignee" format.names.org duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.assignee + * + } + if$ +} + +FUNCTION {format.cartographers} +{ cartographer "cartographer" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.cartographer + * + } + if$ +} + +FUNCTION {format.inventors} +{ inventor "inventor" format.names duplicate$ empty$ 'skip$ + { + "," * + " " * + get.bbl.inventor + * + } + if$ +} + +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + "title" bibinfo.check +} + +FUNCTION {format.type} +{ type empty$ + 'skip$ + { type } + %%{ add.blank "[" type * "]" * } + if$ +} + +FUNCTION {output.bibitem} +{ outside.brackets 'bracket.state := % urlbst + newline$ + "\bibitem{" write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in capitalize + ":" * + " " * } + +FUNCTION {format.journal.date} +{ + month "month" bibinfo.check + duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { + swap$ 'skip$ + { "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { swap$ 'skip$ + { + " " * swap$ + } + if$ + * + remove.dots + } + if$ + duplicate$ empty$ + 'skip$ + { + before.all 'output.state := + after.sentence 'output.state := + } + if$ +} + +FUNCTION {format.date} +{ + no.blank.or.punct + "." + duplicate$ empty$ + year "year" bibinfo.check duplicate$ empty$ + { swap$ 'skip$ + { "there's a month but no year in " cite$ * warning$ } + if$ + * + } + { swap$ 'skip$ + { + swap$ + " " * swap$ + } + if$ + * + } + if$ +} + +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + } + if$ +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ bbl.of space.word * swap$ + emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {is.num} +{ chr.to.int$ + duplicate$ "0" chr.to.int$ < not + swap$ "9" chr.to.int$ > not and +} + +FUNCTION {extract.num} +{ duplicate$ 't := + "" 's := + { t empty$ not } + { t #1 #1 substring$ + t #2 global.max$ substring$ 't := + duplicate$ is.num + { s swap$ * 's := } + { pop$ "" 't := } + if$ + } + while$ + s empty$ + 'skip$ + { pop$ s } + if$ +} + +FUNCTION {convert.edition} +{ extract.num "l" change.case$ 's := + s "first" = s "1" = or + { bbl.first 't := } + { s "second" = s "2" = or + { bbl.second 't := } + { s "third" = s "3" = or + { bbl.third 't := } + { s "fourth" = s "4" = or + { bbl.fourth 't := } + { s "fifth" = s "5" = or + { bbl.fifth 't := } + { s #1 #1 substring$ is.num + { s eng.ord 't := } + { edition 't := } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + } + if$ + t +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + convert.edition + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} + +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} + +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ":" * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} + +FUNCTION {format.vol.num} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * +} + +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * + format.journal.pages +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ + } + + FUNCTION {format.booktitle} + { + booktitle "booktitle" bibinfo.check + } + + FUNCTION {format.in.ed.booktitle} + { format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + "," * + " " * + get.bbl.editor + ". " * + * swap$ + * } + if$ + word.in swap$ * + } + if$ + } + + FUNCTION {format.in.ed.title} + { format.title duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + "," * + " " * + get.bbl.editor + ". " * + * swap$ + * } + if$ + word.in swap$ * + } + if$ + } + + FUNCTION {empty.misc.check} + { author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ + } + FUNCTION {format.thesis.type} + { type duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ + number "number" bibinfo.check + %%type duplicate$ empty$ + %%{ pop$ bbl.techrep } + %%'skip$ + %%if$ + %%"type" bibinfo.check + %%swap$ duplicate$ empty$ + %%{ pop$ "t" change.case$ } + %%{ tie.or.space.prefix * * } + %%if$ +} + +FUNCTION {format.org.or.pub} +{ 't := + "" + address empty$ t empty$ and + 'skip$ + { + address "address" bibinfo.check * + t empty$ + 'skip$ + { address empty$ + 'skip$ + { ": " * } + if$ + t * + } + if$ + } + if$ +} + +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + +FUNCTION {format.institution.address} +{ institution "institution" bibinfo.check format.org.or.pub +} + + +% urlbst... +% Functions for making hypertext links. +% In all cases, the stack has (link-text href-url) +% +% make 'null' specials +FUNCTION {make.href.null} +{ + pop$ +} +% make hypertex specials +FUNCTION {make.href.hypertex} +{ + "\special {html: }" * swap$ * + "\special {html:}" * +} +% make hyperref specials +FUNCTION {make.href.hyperref} +{ + "\href {" swap$ * "} {" * swap$ * "}" * +} +FUNCTION {make.href} +{ hrefform #2 = + 'make.href.hyperref % hrefform = 2 + { hrefform #1 = + 'make.href.hypertex % hrefform = 1 + 'make.href.null % hrefform = 0 (or anything else) + if$ + } + if$ +} + +FUNCTION {format.url} +{ url empty$ + { "" } + { hrefform #1 = + { % special case -- add HyperTeX specials + urlintro "<\url{" url * "}>" * url make.href.hypertex * } + { urlintro "<\url{" * url * "}>" * } + if$ + } + if$ +} + +FUNCTION {format.eprint} +{ eprint empty$ + { "" } + { eprintprefix eprint * eprinturl eprint * make.href } + if$ +} + +FUNCTION {format.doi} +{ doi empty$ + { "" } + { doiprefix doi * doiurl doi * make.href } + if$ +} + +% Output a URL. We can't use the more normal idiom (something like +% `format.url output'), because the `inbrackets' within +% format.lastchecked applies to everything between calls to `output', +% so that `format.url format.lastchecked * output' ends up with both +% the URL and the lastchecked in brackets. +FUNCTION {output.url} +{ url empty$ + 'skip$ + { new.block + format.url output + format.lastchecked output + } + if$ +} + +FUNCTION {output.web.refs} +{ + new.block + output.url + addeprints eprint empty$ not and + { format.eprint output.nonnull } + 'skip$ + if$ + adddoiresolver doi empty$ not and + { format.doi output.nonnull } + 'skip$ + if$ +% addeprints +% { eprint empty$ +% 'skip$ +% { format.eprint output.nonnull } +% if$ +% } +% 'skip$ +% if$ +} + +% Webpage entry type. +% Title and url fields required; +% author, note, year, month, and lastchecked fields optional +STRINGS {database} +FUNCTION {webpage} +{ output.bibitem + author empty$ + { editor empty$ + 'skip$ % author and editor both optional + { format.editors output.nonnull } + if$ + } + { editor empty$ + { format.authors output.nonnull } + { "can't use both author and editor fields in " cite$ * warning$ } + if$ + } + if$ +% author empty$ +% 'skip$ +% { format.authors output.nonnull } +% if$ + new.block + format.title "title" output.check + journal empty$ + { + format.type "type" output.check + publisher empty$ + 'skip$ + { format.publisher.address output } + if$ + "database on the Internet" 'database := + type database = + { format.journal.date "year" output.check } + { format.date "year" output.check } + if$ + lastchecked empty$ + 'skip$ + { format.lastchecked output } + if$ + new.block + part empty$ + 'skip$ + { part output } + if$ + pages empty$ + 'skip$ + { pages bracket.check output } + if$ + } + { journal + remove.dots + "journal" bibinfo.check + "journal" output.check + format.type "type" output.check + format.journal.date "year" output.check + lastchecked empty$ + 'skip$ + { format.lastchecked output + ";" no.blank.or.punct output + } + if$ + no.blank.or.punct format.vol.num output + pages empty$ + 'skip$ + { ":" no.blank.or.punct output + no.blank.or.punct pages bracket.check output + } + if$ + new.block + } + if$ + format.url "url" output.check + new.block + note output + fin.entry +} +% ...urlbst to here + +FUNCTION {misc} +{ output.bibitem + format.title "title" output.check + format.date "year" output.check + format.authors "author" output.check + format.editors "author and editor" output.check + type missing$ + { skip$ } + { format.type "type" output.check } + %%{ inbrackets type output } + if$ + new.block + format.publisher.address output + new.block + format.note output + new.block + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + output.web.refs % urlbst + fin.entry + empty.misc.check +} + +FUNCTION {online} +{ output.bibitem + + author empty$ + { format.title "title" output.check output + format.date "year" output.check output + } + { format.authors "author" output.check output + format.date "year" output.check output + format.title "title" output.check output + } + if$ + + + format.type "Verkkodokumentti" output + format.publishers "publisher" output.check + new.block + format.note output + new.block + howpublished new.block.checka + howpublished "howpublished" bibinfo.check output + output.web.refs % urlbst + fin.entry + empty.misc.check +} + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + organization empty$ + 'skip$ + { author empty$ + { + format.organizations "organization" output.check + } + { + "; " * + no.blank.or.punct + format.organizations "organization" output.check + } + if$ + } + if$ + new.block + format.title "title" output.check + type missing$ + { skip$ } + { format.type "type" output.check } + if$ + new.block + journal + remove.dots + "journal" bibinfo.check + "journal" output.check + format.journal.date "year" output.check + add.semicolon + format.vol.num.pages output + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {book} +{ output.bibitem + author empty$ + { editor empty$ + { format.organizations "organization" output.check } + { format.editors "author and editor" output.check } + if$ + } + { format.authors output.nonnull + "author and editor" editor either.or.check + } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + new.block + format.edition output + new.sentence + author empty$ not + editor empty$ not + and + { format.editors "author and editor" output.check } + 'skip$ + if$ + format.number.series output + format.publisher.address output + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {booklet} +{ misc } + +FUNCTION {dictionary} +{ output.bibitem + format.booktitle "booktitle" output.check + format.bvolume output + new.block + format.edition output + new.sentence + format.publisher.address output + format.date "year" output.check + format.btitle "title" output.check + add.semicolon + add.blank + format.pages "pages" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + format.authors "author" output.check + new.block + chapter "chapter" output.check + new.block + format.in.ed.title "title" output.check + format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + format.date "year" output.check + date.block + add.blank + format.pages "pages" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.edition output + new.sentence + format.number.series output + format.publisher.address output + format.date "year" output.check + date.block + add.blank + format.pages "pages" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.in.ed.booktitle "booktitle" output.check + format.bvolume output + new.sentence + format.number.series output + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.date "year" output.check + date.block + add.blank + format.pages "pages" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {conference} +{inproceedings} + +FUNCTION {manual} +{misc} + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + new.block + format.btitle + "title" output.check + format.type "type" output.check + new.block + school "school" bibinfo.warn output + address "address" bibinfo.check output + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {mastersthesis} +{phdthesis} + +FUNCTION {proceedings} +{ output.bibitem + editor empty$ + { organization "organization" bibinfo.check output + } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + editor empty$ + { publisher empty$ + 'skip$ + { + new.sentence + format.number.series output + format.publisher.address output + } + if$ + } + { publisher empty$ + { + new.sentence + format.organization.address output } + { + new.sentence + organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + } + if$ + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + new.block + format.title + "title" output.check + new.block + format.institution.address output + format.date "year" output.check + format.tr.number output.nonnull + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {map} +{ output.bibitem + format.cartographers "cartographer" output.check + new.block + format.title + "title" output.check + format.type "type" output.check + new.block + format.publisher.address output + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {patent} +{ output.bibitem + format.inventors "inventor" output.check + "; " * + no.blank.or.punct + format.assignees "assignee" output.check + new.block + format.title + "title" output.check + new.block + format.tr.number output.nonnull + format.date "year" output.check + new.block + format.note output + output.web.refs % urlbst + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + new.block + format.title "title" output.check + format.date output + new.block + format.note "note" output.check + output.web.refs % urlbst + fin.entry +} + +FUNCTION {default.type} { misc } +READ +STRINGS { longest.label } +INTEGERS { number.label longest.label.width } +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} +EXECUTE {initialize.longest.label} +ITERATE {longest.label.pass} +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" longest.label * "}" * + write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.config.constants} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `vancouver.bst'.