Copied template from submodule to this repo

Signed-off-by: Marko Korhonen <marko.korhonen@reekynet.com>
This commit is contained in:
Marko Korhonen 2020-01-16 13:28:22 +02:00
parent 70345608ee
commit 6b1a928242
No known key found for this signature in database
GPG key ID: 911B85FBC6003FE5
44 changed files with 3549 additions and 4 deletions

28
tex/style/abbr.tex Normal file
View file

@ -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

24
tex/style/appendix.tex Normal file
View file

@ -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})}}

20
tex/style/biblio.tex Normal file
View file

@ -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

13
tex/style/content.tex Normal file
View file

@ -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

207
tex/style/style.tex Normal file
View file

@ -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}}

34
tex/style/title.tex Normal file
View file

@ -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

View file

@ -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}{}{}{}

13
tex/style/toc.tex Normal file
View file

@ -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