Skip to content
Snippets Groups Projects
Commit 0858c9ed authored by Jari-Matti Mäkelä's avatar Jari-Matti Mäkelä
Browse files

Merge branch 'docclass-biblatex' into 'master'

Add fixes and cleanups

See merge request ttweb/thesis!2
parents aa3c696f 2902d674
No related branches found
No related tags found
No related merge requests found
......@@ -8,32 +8,87 @@ stages:
- build
- test
pdflatex_builder:
template_builder:
stage: build
before_script:
- cd latex
script:
- "latexmk -pdf -output-directory=pdflatex/ thesis.tex"
- "latexmk -xelatex -output-directory=xelatex/ thesis.tex"
artifacts:
paths:
- "latex/pdflatex/thesis.pdf"
- "latex/xelatex/thesis.pdf"
template_validator:
stage: test
script:
- "pdfinfo latex/pdflatex/thesis.pdf |grep '^Pages: *13$'"
- "pdfinfo latex/xelatex/thesis.pdf |grep '^Pages: *13$'"
xelatex_builder:
stage: build
before_script:
- cd latex
- cd tests
script:
- "latexmk -xelatex -output-directory=xelatex/ thesis.tex"
- "for i in *.tex; do latexmk -xelatex -output-directory=xelatex/ $i; done"
artifacts:
paths:
- "latex/xelatex/thesis.pdf"
- tests/xelatex/test-app1.pdf
- tests/xelatex/test-app2.pdf
- tests/xelatex/test-app3.pdf
- tests/xelatex/test-app4.pdf
- tests/xelatex/test-bilingual.pdf
- tests/xelatex/test-english.pdf
- tests/xelatex/test-finnish.pdf
- tests/xelatex/test-hyperref.pdf
pdflatex_content_validator:
stage: test
pdflatex_builder:
stage: build
before_script:
- cd tests
script:
- "pdfinfo latex/pdflatex/thesis.pdf |grep '^Pages: *13$'"
- "for i in *.tex; do latexmk -pdf -output-directory=pdflatex/ $i; done"
artifacts:
paths:
- tests/pdflatex/test-app1.pdf
- tests/pdflatex/test-app2.pdf
- tests/pdflatex/test-app3.pdf
- tests/pdflatex/test-app4.pdf
- tests/pdflatex/test-bilingual.pdf
- tests/pdflatex/test-english.pdf
- tests/pdflatex/test-finnish.pdf
- tests/pdflatex/test-hyperref.pdf
xelatex_content_validator:
stage: test
before_script:
- cd tests/xelatex
- "for i in *.pdf; do pdftotext $i; done"
script:
- "pdfinfo latex/xelatex/thesis.pdf |grep '^Pages: *13$'"
- "grep '2 s., 5 liites.' test-app1.txt"
- "grep '2 s., 3 liites.' test-app2.txt"
- "grep '2 s., 1 liites.' test-app3.txt"
- "grep 'TkK -tutkielma, 2 s.$' test-app4.txt"
- "grep 'TURUN YLIOPISTO' test-finnish.txt"
- "grep 'TURUN YLIOPISTO' test-bilingual.txt"
- "grep 'UNIVERSITY OF TURKU' test-bilingual.txt"
- "grep 'UNIVERSITY OF TURKU' test-english.txt"
- "pdfinfo test-hyperref.pdf |grep 'LaTeX with hyperref package'"
pdflatex_content_validator:
stage: test
before_script:
- cd tests/pdflatex
- "for i in *.pdf; do pdftotext $i; done"
script:
- "grep '2 s., 5 liites.' test-app1.txt"
- "grep '2 s., 3 liites.' test-app2.txt"
- "grep '2 s., 1 liites.' test-app3.txt"
- "grep 'TkK -tutkielma, 2 s.$' test-app4.txt"
- "grep 'TURUN YLIOPISTO' test-finnish.txt"
- "grep 'TURUN YLIOPISTO' test-bilingual.txt"
- "grep 'UNIVERSITY OF TURKU' test-bilingual.txt"
- "grep 'UNIVERSITY OF TURKU' test-english.txt"
- "pdfinfo test-hyperref.pdf |grep 'LaTeX with hyperref package'"
......@@ -5,7 +5,7 @@
\save_transient_properties true
\origin unavailable
\textclass utuftthesis
\options a4paper,12pt,language=finnish,hidechapters=true,realtimesnewroman=false
\options a4paper,12pt,language=finnish,version=draft,hidechapters=true,includereferences=false,realtimesnewroman=false,sharelatex=false,emptyfirstpages=true
\use_default_options false
\maintain_unincluded_children false
\language finnish
......@@ -173,13 +173,18 @@ setmainfont.
\begin_layout Plain Layout
- sharelatex: true / false (default: false) don't attempt to use (c) system
fonts, instead read them from the project repository
\begin_inset Newline newline
\end_inset
\end_layout
\begin_layout Plain Layout
- emptyfirstpages: true / false (default: true) clear the headers/footers
for the 1st pages of text chapters
\end_layout
\begin_inset Newline newline
\end_inset
\begin_layout Plain Layout
\end_layout
\begin_layout Plain Layout
Traditionally the best places to learn (La)TeX are probably the manual pages
for each package http://www.ctan.org/ and http://www.ctan.org/tex-archive/info/lsho
rt/english/lshort.pdf.
......@@ -248,28 +253,10 @@ Relies on utuftthesis.cls for the document class definitions.
\begin_layout PubLab
Labran nimi
\begin_inset ERT
status open
\begin_layout Plain Layout
}{Laboratory Name
\end_layout
\end_inset
\begin_inset Note Note
status open
\begin_layout Plain Layout
looks a bit funny in LyX.
Gotta learn how to fix this..
\end_layout
\end_inset
\begin_layout PubLabEN
Laboratory Name
\end_layout
\begin_layout PubType
......@@ -295,47 +282,17 @@ filename "abstract.lyx"
\end_layout
\begin_layout Standard
\begin_inset Note Comment
status open
\begin_layout Plain Layout
\end_layout
\end_inset
\begin_inset ERT
status open
\begin_layout Plain Layout
% empty pagestyle for table of contents etc.
\end_layout
\begin_layout Plain Layout
% the redefinition of plain style works also for 1st pages of chapters,
\end_layout
\begin_layout Plain Layout
% which is the default in report class.
\end_layout
\begin_layout Plain Layout
% Just state
\backslash
thispagestyle{empty} after
\backslash
chapter{something} if you want
\end_layout
\begin_layout Plain Layout
% empty style for the 1st pages.
% otherwise you'll get simple page style with roman page numbers
\end_layout
\begin_layout Plain Layout
......@@ -347,90 +304,11 @@ pagestyle{empty}
\begin_layout Plain Layout
\backslash
fancypagestyle{plain}{
\end_layout
\begin_layout Plain Layout
\backslash
fancyhf{}
\end_layout
\begin_layout Plain Layout
\backslash
renewcommand{
\backslash
headrulewidth}{0 pt}
\end_layout
\begin_layout Plain Layout
}
\end_layout
\end_inset
\begin_inset ERT
status open
\begin_layout Plain Layout
% roman numbering for table of contents etc.
\end_layout
\begin_layout Plain Layout
\backslash
pagenumbering{roman}
\end_layout
\begin_layout Plain Layout
\end_layout
\begin_layout Plain Layout
% insert table of contents, list of figures, list of tables
\end_layout
\begin_layout Plain Layout
%
\end_layout
\begin_layout Plain Layout
% setting the counter to zero effectively removes the page number from
\end_layout
\begin_layout Plain Layout
% the toc, lof etc.
entries in the toc since there is no roman numeral
\end_layout
\begin_layout Plain Layout
% for zero ;-) (if you want them without numbering)
\end_layout
\begin_layout Plain Layout
%
\end_layout
\begin_layout Plain Layout
%
\backslash
setcounter{page}{0}
% mandatory
\end_layout
\begin_layout Plain Layout
......@@ -442,20 +320,11 @@ tableofcontents
\begin_layout Plain Layout
\backslash
clearpage
\end_layout
\begin_layout Plain Layout
\end_layout
\begin_layout Plain Layout
%
\backslash
setcounter{page}{0}
% if you want a list of figures
\end_layout
\begin_layout Plain Layout
......@@ -467,16 +336,11 @@ listoffigures
\begin_layout Plain Layout
%
\backslash
clearpage
\end_layout
\begin_layout Plain Layout
%
\backslash
setcounter{page}{0}
% if you want a list of tables
\end_layout
\begin_layout Plain Layout
......@@ -486,20 +350,18 @@ setcounter{page}{0}
listoftables
\end_layout
\end_inset
\begin_layout Plain Layout
\begin_inset ERT
status open
\end_layout
\begin_layout Plain Layout
% possibly insert 'list of acronyms'
% 'list of acronyms'
\end_layout
\begin_layout Plain Layout
%
% - you may not need this at all
\end_layout
\begin_layout Plain Layout
......@@ -555,25 +417,7 @@ input{your acronym chapter's file name}
%
\backslash
setcounter{secnumdepth}{2}
\end_layout
\end_inset
\begin_inset ERT
status open
\begin_layout Plain Layout
% setup page numbering, page counter, etc.
\end_layout
\begin_layout Plain Layout
\backslash
startpages
setcounter{secnumdepth}{2}% setup page numbering, page counter, etc.
\end_layout
\end_inset
......@@ -665,33 +509,6 @@ options "plain"
\end_inset
\begin_inset Note Comment
status open
\begin_layout Plain Layout
Don't include this if appendices are not present.
On the other hand, without this call, the appendices don't look right.
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
appendices
\end_layout
\end_inset
\end_layout
\begin_layout Standard
......
%% LyX 2.3.1 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,12pt,language=finnish,hidechapters=true,realtimesnewroman=false]{utuftthesis}
\documentclass[a4paper,12pt,language=finnish,version=draft,hidechapters=true,includereferences=false,realtimesnewroman=false,sharelatex=false,emptyfirstpages=true]{utuftthesis}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\usepackage{verbatim}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
\makeatother
\addbibresource{Bibliografia.bib}
\begin{document}
......@@ -50,8 +39,11 @@ on the system / provided in the document directory. Other fonts can
be defined with \textbackslash setmainfont.
- sharelatex: true / false (default: false) don't attempt to use (c)
system fonts, instead read them from the project repository\\
\\
system fonts, instead read them from the project repository
- emptyfirstpages: true / false (default: true) clear the headers/footers
for the 1st pages of text chapters
Traditionally the best places to learn (La)TeX are probably the manual
pages for each package http://www.ctan.org/ and http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf.
This new version (2.0) should be compatible with xelatex and biblatex
......@@ -78,7 +70,9 @@ Relies on utuftthesis.cls for the document class definitions.
\pubmonth{6}
\publab{Labran nimi}{Laboratory Name}
\publab{Labran nimi}
\publaben{Laboratory Name}
\pubtype{tkk}
\title{Name of Thesis}
......@@ -87,36 +81,21 @@ Relies on utuftthesis.cls for the document class definitions.
\maketitle
\input{abstract.tex}
\begin{comment}
\end{comment}
% empty pagestyle for table of contents etc.
% the redefinition of plain style works also for 1st pages of chapters,
% which is the default in report class.
% Just state \thispagestyle{empty} after \chapter{something} if you want
% empty style for the 1st pages.
% otherwise you'll get simple page style with roman page numbers
\pagestyle{empty}
\fancypagestyle{plain}{
\fancyhf{}
\renewcommand{\headrulewidth}{0 pt}
}% roman numbering for table of contents etc.
\pagenumbering{roman}
% insert table of contents, list of figures, list of tables
%
% setting the counter to zero effectively removes the page number from
% the toc, lof etc. entries in the toc since there is no roman numeral
% for zero ;-) (if you want them without numbering)
%
%\setcounter{page}{0}
% mandatory
\tableofcontents
\clearpage
%\setcounter{page}{0}
% if you want a list of figures
%\listoffigures
%\clearpage
%\setcounter{page}{0}
%\listoftables% possibly insert 'list of acronyms'
%
% if you want a list of tables
%\listoftables
% 'list of acronyms'
% - you may not need this at all
% - create a chapter called List Of Acronyms (or whatever), which
% should contain all your acronym definitions, e.g.
% \chapter{List Of Acronyms}
......@@ -125,8 +104,7 @@ Relies on utuftthesis.cls for the document class definitions.
%
%\setcounter{secnumdepth}{-1}
%\input{your acronym chapter's file name}
%\setcounter{secnumdepth}{2}% setup page numbering, page counter, etc.
\startpages%
%\setcounter{secnumdepth}{2}% setup page numbering, page counter, etc.%
\begin{comment}
The thesis starts here.
......@@ -148,12 +126,6 @@ Good luck!
The thesis main content ends here.
\end{comment}
\printbibliography
\begin{comment}
Don't include this if appendices are not present. On the other hand,
without this call, the appendices don't look right.
\end{comment}
\appendices
\begin{comment}
Create your appendix chapters with command \textbackslash appchapter\{some
......
This diff is collapsed.
......@@ -62,6 +62,18 @@ Style PubLab
EndFont
End
Style PubLabEN
Margin Dynamic
LatexType Command
LatexName publaben
LabelType Static
LabelString "Laboratory name (for 2nd abstract): "
Align Center
Font
Size Large
EndFont
End
Style PubType
Margin Dynamic
LatexType Command
......
@article{crawley2007write,
title={How to Write a Research Proposal and Succeed},
author={Crawley, Gerard M and O'Sullivan, Eoin},
year={2007},
publisher={World Scientific}
}
@article{puasuareanu2009survey,
title={A survey of new trends in symbolic execution for software testing and analysis},
author={P{\u{a}}s{\u{a}}reanu, Corina S and Visser, Willem},
journal={International journal on software tools for technology transfer},
volume={11},
number={4},
pages={339--353},
year={2009},
publisher={Springer}
}
\ No newline at end of file
% test document for gitlab ci tests
\documentclass[a4paper,12pt,language=finnish]{utuftthesis}
% how many levels of section numbering
\setcounter{secnumdepth}{2}
% how many levels of section numbering in the TOC
\setcounter{tocdepth}{2}
\usepackage{blindtext}
% suppress complaints about missing finnish blabla
\pretocmd{\blindtext}{\selectlanguage{english}}{}{}
\pretocmd{\Blindtext}{\selectlanguage{english}}{}{}
\addbibresource{Bibliografia.bib}
\pubyear{2018}
\pubmonth{6}
\publab{Labran nimi}
\pubtype{tkk}
\title{Tutkielma}
\author{Oma nimi}
\keywords{tähän, lista, avainsanoista}
\begin{document}
\maketitle
\begin{abstract}\blindtext\end{abstract}
\tableofcontents
\chapter{Johdanto}
\blindtext
Viitataan tähän \cite{crawley2007write}.
\chapter{Lopuksi}
\blindtext
\printbibliography
\appchapter{Liitedokumentti}
sivu 1
\appchapter{Liitedokumentti 2}
sivu 1
\newpage
sivu 2
\appchapter{Liitedokumentti 3}
\Blindtext
\end{document}
% test document for gitlab ci tests
\documentclass[a4paper,12pt,language=finnish]{utuftthesis}
% how many levels of section numbering
\setcounter{secnumdepth}{2}
% how many levels of section numbering in the TOC
\setcounter{tocdepth}{2}
\usepackage{blindtext}
% suppress complaints about missing finnish blabla
\pretocmd{\blindtext}{\selectlanguage{english}}{}{}
\pretocmd{\Blindtext}{\selectlanguage{english}}{}{}
\addbibresource{Bibliografia.bib}
\pubyear{2018}
\pubmonth{6}
\publab{Labran nimi}
\pubtype{tkk}
\title{Tutkielma}
\author{Oma nimi}
\keywords{tähän, lista, avainsanoista}
\begin{document}
\maketitle
\begin{abstract}\blindtext\end{abstract}
\tableofcontents
\chapter{Johdanto}
\blindtext
Viitataan tähän \cite{crawley2007write}.
\chapter{Lopuksi}
\blindtext
\printbibliography
\appchapter{Liitedokumentti}
sivu 1
\appchapter{Liitedokumentti 2}
sivu 1
\newpage
sivu 2
\end{document}
% test document for gitlab ci tests
\documentclass[a4paper,12pt,language=finnish]{utuftthesis}
% how many levels of section numbering
\setcounter{secnumdepth}{2}
% how many levels of section numbering in the TOC
\setcounter{tocdepth}{2}
\usepackage{blindtext}
% suppress complaints about missing finnish blabla
\pretocmd{\blindtext}{\selectlanguage{english}}{}{}
\pretocmd{\Blindtext}{\selectlanguage{english}}{}{}
\addbibresource{Bibliografia.bib}
\pubyear{2018}
\pubmonth{6}
\publab{Labran nimi}
\pubtype{tkk}
\title{Tutkielma}
\author{Oma nimi}
\keywords{tähän, lista, avainsanoista}
\begin{document}
\maketitle
\begin{abstract}\blindtext\end{abstract}
\tableofcontents
\chapter{Johdanto}
\blindtext
Viitataan tähän \cite{crawley2007write}.
\chapter{Lopuksi}
\blindtext
\printbibliography
\appchapter{Liitedokumentti}
sivu 1
\end{document}
% test document for gitlab ci tests
\documentclass[a4paper,12pt,language=finnish]{utuftthesis}
% how many levels of section numbering
\setcounter{secnumdepth}{2}
% how many levels of section numbering in the TOC
\setcounter{tocdepth}{2}
\usepackage{blindtext}
% suppress complaints about missing finnish blabla
\pretocmd{\blindtext}{\selectlanguage{english}}{}{}
\pretocmd{\Blindtext}{\selectlanguage{english}}{}{}
\addbibresource{Bibliografia.bib}
\pubyear{2018}
\pubmonth{6}
\publab{Labran nimi}
\pubtype{tkk}
\title{Tutkielma}
\author{Oma nimi}
\keywords{tähän, lista, avainsanoista}
\begin{document}
\maketitle
\begin{abstract}\blindtext\end{abstract}
\tableofcontents
\chapter{Johdanto}
\blindtext
Viitataan tähän \cite{crawley2007write}.
\chapter{Lopuksi}
\blindtext
\printbibliography
\end{document}
% test document for gitlab ci tests
\documentclass[a4paper,12pt,language=finnish]{utuftthesis}
% how many levels of section numbering
\setcounter{secnumdepth}{2}
% how many levels of section numbering in the TOC
\setcounter{tocdepth}{2}
\usepackage{blindtext}
% suppress complaints about missing finnish blabla
\pretocmd{\blindtext}{\selectlanguage{english}}{}{}
\pretocmd{\Blindtext}{\selectlanguage{english}}{}{}
\addbibresource{Bibliografia.bib}
\pubyear{2018}
\pubmonth{6}
\publab{Labran nimi}
\publaben{Laboratory Name}
\pubtype{tkk}
\supervisors{Sauronin silmä, Kalle Yylä, P. Rofessori}
\title{Name of Thesis}
\author{My Name}
\keywords{tähän, lista, avainsanoista}
\keywordstwo{here, a, list, of, keywords}
\begin{document}
\maketitle
\begin{abstract}\blindtext\end{abstract}
\begin{abstracten}\blindtext\end{abstracten}
\tableofcontents
\listoffigures
\listoftables
\chapter{Johdanto}
\Blindtext
Viitataan tähän \cite{crawley2007write}.
\chapter{Väliluku 1}
\Blindtext
\chapter{Väliluku 2}
\section{foobar}
\Blindtext
\chapter{Väliluku 3}
\section{foobar}
\Blindtext
\section{foobar}
\Blindtext
\chapter{Väliluku 4}
\section{foobar}
\Blindtext
\chapter{Väliluku 5}
\Blindtext
\chapter{Väliluku 6}
\Blindtext
\chapter{Lopuksi}
\blindtext
\printbibliography
\appchapter{Liitedokumentti}
\Blindtext
\end{document}
% test document for gitlab ci tests
\documentclass[a4paper,12pt,language=english]{utuftthesis}
% how many levels of section numbering
\setcounter{secnumdepth}{2}
% how many levels of section numbering in the TOC
\setcounter{tocdepth}{2}
\usepackage{blindtext}
% suppress complaints about missing finnish blabla
\pretocmd{\blindtext}{\selectlanguage{english}}{}{}
\pretocmd{\Blindtext}{\selectlanguage{english}}{}{}
\addbibresource{Bibliografia.bib}
\pubyear{2018}
\pubmonth{6}
\publab{Laboratory Name}
\pubtype{tkk}
\supervisors{aa 123,bb 234,cc 345}
\title{Name of Thesis}
\author{My Name}
\keywords{here, a, list, of, keywords}
\begin{document}
\maketitle
\begin{abstract}\blindtext\end{abstract}
\tableofcontents
\listoffigures
\listoftables
\chapter{Johdanto}
\Blindtext
Viitataan tähän \cite{crawley2007write}.
\chapter{Väliluku 1}
\Blindtext
\chapter{Väliluku 2}
\section{foobar}
\Blindtext
\chapter{Väliluku 3}
\section{foobar}
\Blindtext
\section{foobar}
\Blindtext
\chapter{Väliluku 4}
\section{foobar}
\Blindtext
\chapter{Väliluku 5}
\Blindtext
\chapter{Väliluku 6}
\Blindtext
\chapter{Lopuksi}
\blindtext
\printbibliography
\appchapter{Liitedokumentti}
\Blindtext
\end{document}
% test document for gitlab ci tests
\documentclass[a4paper,12pt,language=finnish]{utuftthesis}
% how many levels of section numbering
\setcounter{secnumdepth}{2}
% how many levels of section numbering in the TOC
\setcounter{tocdepth}{2}
\usepackage{blindtext}
% suppress complaints about missing finnish blabla
\pretocmd{\blindtext}{\selectlanguage{english}}{}{}
\pretocmd{\Blindtext}{\selectlanguage{english}}{}{}
\addbibresource{Bibliografia.bib}
\pubyear{2018}
\pubmonth{6}
\publab{Labran nimi}
\pubtype{tkk}
\supervisors{Sauronin silmä, Kalle Yylä, P. Rofessori}
\title{Tutkielma}
\author{Oma nimi}
\keywords{tähän, lista, avainsanoista}
\begin{document}
\maketitle
\begin{abstract}\blindtext\end{abstract}
\tableofcontents
\listoffigures
\listoftables
\chapter{Johdanto}
\Blindtext
Viitataan tähän \cite{crawley2007write}.
\chapter{Väliluku 1}
\Blindtext
\chapter{Väliluku 2}
\section{foobar}
\Blindtext
\chapter{Väliluku 3}
\section{foobar}
\Blindtext
\section{foobar}
\Blindtext
\chapter{Väliluku 4}
\section{foobar}
\Blindtext
\chapter{Väliluku 5}
\Blindtext
\chapter{Väliluku 6}
\Blindtext
\chapter{Lopuksi}
\blindtext
\printbibliography
\appchapter{Liitedokumentti}
\Blindtext
\end{document}
% test document for gitlab ci tests
\documentclass[a4paper,12pt,language=finnish]{utuftthesis}
% how many levels of section numbering
\setcounter{secnumdepth}{2}
% how many levels of section numbering in the TOC
\setcounter{tocdepth}{2}
\usepackage{hyperref}
\usepackage{blindtext}
% suppress complaints about missing finnish blabla
\pretocmd{\blindtext}{\selectlanguage{english}}{}{}
\pretocmd{\Blindtext}{\selectlanguage{english}}{}{}
\addbibresource{Bibliografia.bib}
\pubyear{2018}
\pubmonth{6}
\publab{Labran nimi}
\publaben{Laboratory Name}
\pubtype{tkk}
\supervisors{Sauronin silmä, Kalle Yylä, P. Rofessori}
\title{Name of Thesis}
\author{My Name}
\keywords{tähän, lista, avainsanoista}
\keywordstwo{here, a, list, of, keywords}
\begin{document}
\maketitle
\begin{abstract}\blindtext\end{abstract}
\begin{abstracten}\blindtext\end{abstracten}
\tableofcontents
\listoffigures
\listoftables
\chapter{Johdanto}
\Blindtext
Viitataan tähän \cite{crawley2007write}.
\chapter{Väliluku 1}
\Blindtext
\chapter{Väliluku 2}
\section{foobar}
\Blindtext
\chapter{Väliluku 3}
\section{foobar}
\Blindtext
\section{foobar}
\Blindtext
\chapter{Väliluku 4}
\section{foobar}
\Blindtext
\chapter{Väliluku 5}
\Blindtext
\chapter{Väliluku 6}
\Blindtext
\chapter{Lopuksi}
\blindtext
\printbibliography
\appchapter{Liitedokumentti}
\Blindtext
\end{document}
% version 2.2 2018/10/06 Bugfixes: Got rid of startappendices and startpages.
% various fixes. cleanups
% version 2.1 2018/10/02 Bugfixes: removed redundant tutkielma.tex, fixed issues with
% appendices, small caps, added an option to enable
% the truetype times new roman font
% version 2.0 2018/08/29 new version using document classes, xelatex, biblatex, and
% additional TeX scripting. Jari-Matti Mäkelä (jmjm@iki.fi)
% version 1.3+ 2017/10/01 - 2016/9/22 additions marked "JH:", modified for use in
% tex.soft.utu.fi, Johannes Holvitie (jjholv@utu.fi)
% version 1.3 2015/09/05 Sami Nuuttila (samnuutt@utu.fi)
% ------------------------------
% How to use? Store the file in
% 1) Windows XP C:\Documents and Settings\<user name>\texmf\tex\latex\local\
% 2) Windows Vista/7 C:\Users\<user name>\texmf\tex\latex\local\
% 3) Linux ~/texmf/tex/latex/local/
% 4) Mac OS X /Users/<user name>/Library/texmf/tex/latex/local/
% 5) Sharelatex: just copy this to the project folder
% 6) or in the same directory as the document
% ------------------------------
\NeedsTeXFormat{LaTeX2e}[2007/01/01]
\ProvidesClass{utuftthesis}[2018/10/06 UTU FT dept BSc/MSc thesis]
%% package requirements for this template
\RequirePackage{kvoptions} % keyval-options, required by this class definition
\RequirePackage{adjustbox} % front page box on the right
\RequirePackage{etoolbox} % misc. tools
\RequirePackage{ifthen} % misc. tools
\RequirePackage{ifxetex} % for xelatex/pdflatex font selection
\RequirePackage{fancyhdr} % customized headers/footers
\RequirePackage{xstring} % string operations (number of pages etc.)
\RequirePackage[page]{totalcount} % the total number of pages
\RequirePackage{comment} % LyX generated comments
%% not used by the class
% if you encounter package clashes, start by disabling these
\RequirePackage{graphicx} % \includegraphics{file}, works without file extensions
\RequirePackage{sverb} % enhanced handling of verbatim stuff
%% Custom package options
%\DeclareStringOption[00]{year}
\DeclareStringOption[draft]{version}
\DeclareStringOption[a4paper]{paper}
\DeclareStringOption[finnish]{language}
\DeclareBoolOption[true]{hidechapters}
\DeclareBoolOption[false]{includereferences}
\DeclareBoolOption[false]{realtimesnewroman}
\DeclareBoolOption[false]{sharelatex}
\DeclareBoolOption[true]{emptyfirstpages}
%% Process given options
\ProcessKeyvalOptions*
%% Fallback
%\DeclareOption*{}
% \ClassWarning{myclass}{Unknown option '\CurrentOption'}
%\ProcessOptions\relax
%\RequirePackage{ifpdf} % not used
%% automatically handle the appendix magic
%\AtEndDocument{\addtocounter{totalcount@page}{-2}}
%% Load base
\LoadClass[\utuftthesis@paper,12pt]{report}
%% Some language macros for choosing between content
%% the langchoose is now only good for \n@tivelang & english. easy to adjust
%% for swedish & english, but multiple choices requires the use of switch-case
\newcommand{\n@tivelang}{finnish}
\newcommand{\l@nguage}{\utuftthesis@language}
\newcommand{\thedoclanguage}{\utuftthesis@language}
%\newcommand{\langchoose}[3]{\expandafter\ifdefstrequal\expandafter{#1}{\n@tivelang}{#2}{#3}}
\newcommand{\langchoose}[3]{\ifthenelse{\equal{#1}{\n@tivelang}}{#2}{#3}}
\newcommand{\langfin}[2]{\langchoose{\l@nguage}{#1}{#2}}
%% Set up encoding/font/hyphenation stuff
\ifxetex
\RequirePackage{fontspec}
\RequirePackage{polyglossia}
\setmainlanguage{\utuftthesis@language}
\langfin{\setotherlanguage{english}}
\ifutuftthesis@realtimesnewroman
% can't use (C) TTF fonts when the ms corefonts are not installed
\ifutuftthesis@sharelatex
\setmainfont[BoldFont=timesbd.ttf,ItalicFont=timesi.ttf,BoldItalicFont=timesbi.ttf]{times.ttf}
\else
\setmainfont{Times New Roman}
\fi
\fi
\fi
\ifxetex
\else
% JH: modified latin to UTF-8 encoding cues to make Scandinavian characters works
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage{lmodern}
% load babel-package for automatic hyphenation
\ifdefstring{\utuftthesis@language}{english}{
\RequirePackage[english]{babel}
}{
\RequirePackage[english, \l@nguage]{babel}
}
% change default font to times-roman
\renewcommand{\sfdefault}{phv}
\renewcommand{\rmdefault}{ptm}
\renewcommand{\ttdefault}{pcr}
\fi
%% the rest of the requirements listed here as they have
%% language specific definitions etc.
\RequirePackage[style=ieee,backend=biber]{biblatex} % bibliography, new engine
\RequirePackage{listings} % handle inclusion of source code
\RequirePackage{csquotes}
\RequirePackage{amssymb,amsthm,amsmath} % load ams-packages for maths
\RequirePackage{datetime2} % month names
\RequirePackage{titlecaps} % month names
%% switch-case used to select the thesis type
\newbool{default}
\newcommand{\case}{}
\newcommand{\default}{}
\newenvironment{switch}[1]{%
\booltrue{default}
\renewcommand{\case}[2]{\ifthenelse{\equal{#1}{##1}}{%
\boolfalse{default}##2}{}}%
\renewcommand{\default}[1]{\ifbool{default}{##1}{}}
}{}
%% these are used as global variables on the magic pages
%% feel free to modify for other languages / if the info is outdated
\newcommand{\ye@r}{\the\year}
\newcommand{\m@nth}{\the\month}
\newcommand{\p@blab}{Labra}
\newcommand{\p@blaben}{Laboratory}
\newcommand{\s@pervisors}{none}
\newcommand{\k@ywords}{not set}
\newcommand{\k@ywordstwo}{not set}
\ifdefstring{\utuftthesis@version}{draft}{\newcommand{\version}{[draft]}}{\newcommand{\version}{}}
\newcommand\keywords[1]{\renewcommand\k@ywords{#1}}
\newcommand\keywordstwo[1]{\renewcommand\k@ywordstwo{#1}}
\newcommand\pubyear[1]{\renewcommand\ye@r{#1}}
\newcommand\pubmonth[1]{\renewcommand\m@nth{#1}}
\newcommand\publab[1]{\renewcommand\p@blab{#1}}
\newcommand\publaben[1]{\renewcommand\p@blaben{#1}}
\newcommand\pubtype[1]{\newcommand\p@btype{#1}}
\newcommand\supervisors[1]{\renewcommand\s@pervisors{#1}}
\newcommand{\department}[1]{\langchoose{#1}{Tulevaisuuden teknologioiden laitos}{Department of Future Technologies}}
\newcommand{\university}[1]{\langchoose{#1}{Turun yliopisto}{University of Turku}}
\newcommand{\University}[1]{\langchoose{#1}{\MakeUppercase{Turun yliopisto}}{\MakeUppercase{University of Turku}}}
\newcommand{\labname}[1]{\langchoose{#1}{\p@blab}{\p@blaben}}
\newcommand{\pagesname}[1]{\langchoose{#1}{s.}{p.}}
\newcommand{\apppagesname}[1]{\langchoose{#1}{liites.}{app. p.}}
\newcommand{\kwlabel}[1]{\langchoose{#1}{Asiasanat}{Keywords}}
\newcommand{\supervisorstext}{\langfin{Tarkastajat}{Supervisors}}
\newcommand{\runagain}[1]{\langchoose{#1}\langfin{aja LaTeX uudestaan}{please rerun LaTeX}}
\newcommand{\turnitin}{\langfin{Turun yliopiston laatujärjestelmän mukaisesti tämän julkaisun alkuperäisyys on tarkastettu Turnitin OriginalityCheck-järjestelmällä.}
{The originality of this thesis has been checked in accordance with the University of Turku quality assurance system using the Turnitin OriginalityCheck service.}}
%% needs to be implemented like this due to the initialization order
\langfin{
\newcommand{\refs}{Lähdeluettelo}
\newcommand{\appname}{Liitteet}
}{
\newcommand{\refs}{References}
\newcommand{\appname}{Appendices}
}
%% magic thesis types. more can be added
\newcommand*{\thesistype}[1]{
\begin{switch}{\p@btype}
\case{tkk}{\langchoose{#1}{TkK -tutkielma}{Bachelor's Thesis}}%
\case{luk}{\langchoose{#1}{LuK -tutkielma}{Bachelor's Thesis}}%
\case{gradu}{\langchoose{#1}{Pro gradu -tutkielma}{Master of Science Thesis}}%
\case{di}{\langchoose{#1}{Diplomityö}{Master of Science Thesis}}%
\default{\p@btype}%
\end{switch}}
\newcommand{\monthname}[1]{\csname DTM#1monthname\endcsname}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% setup document appearance
%
% fix page size
%
% - page width:
% 1inch +
% \hoffset +
% \oddsidemargin +
% \textwidth +
% \marginsep +
% \marginparwidth
%
% - page height:
% 1inch +
% \voffset +
% \topmargin +
% \headheight +
% \headsep +
% \textheight +
% \footnotesep +
% \footheigth
%
% - 1 pt == 1/72 inch == 0.35 mm
%
% page width... left margin 4cm, right 2cm
%
\setlength{\hoffset}{0mm}
\setlength{\marginparsep}{0mm}
\setlength{\marginparwidth}{0mm}
\setlength{\textwidth}{\paperwidth}
\addtolength\textwidth{-60 mm}
\setlength{\oddsidemargin}{-1 in}
\addtolength\oddsidemargin{40 mm}
% page height... textheight starts at ~4cm from top,
% i.e. 1 in + 12 pt + 24 pt = 1.5 in
%
\setlength{\voffset}{0 mm}
\setlength{\topmargin}{0 mm}
\setlength{\headheight}{14.5 pt}
\setlength{\headsep}{24 pt}
\setlength{\textheight}{230mm}
\setlength{\footnotesep}{12 pt}
% setup linespacings to suit to the (stupid) requirement of double spacing
%
% - fake 1.5 linespacing
% \renewcommand{\baselinestretch}{1.241}
%
% - fake 2 linespacing
%
\renewcommand{\baselinestretch}{1.655}
%% Modify the \printbibliography command
\defbibheading{bibliography}{
%\eofpages
% label here if we don't include references
\ifutuftthesis@includereferences
\else
\label{endofpages}
\fi
\chapter*{\refs}
\addcontentsline{toc}{chapter}{\refs}
}
\let\oldprintbibliography\printbibliography
\renewcommand{\printbibliography}{
\oldprintbibliography
% label here if we also include references
\ifutuftthesis@includereferences
\label{endofpages}
\fi
\langfin{
\selectlanguage{finnish}
}{
\selectlanguage{english}
}
}
%% Macro for hiding the chapter texts
\ifutuftthesis@hidechapters
\renewcommand{\@chapapp}{\relax}
\renewcommand{\@makechapterhead}[1]{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\huge\bfseries \@chapapp\space \thechapter\space\space
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
}}
\fi
%% entry environment
\newenvironment{entry}[1]{\begin{list}{}{%
\renewcommand{\makelabel}[1]{\textrm{##1:}\hfil}%
\settowidth{\labelwidth}{\textrm{#1:}}%
\setlength{\leftmargin}{\labelwidth}%
\addtolength{\leftmargin}{\labelsep}}}
{\end{list}}
%% the first abstract
\langfin{
\renewenvironment{abstract}{\@bstracth{finnish}}{\@bstractt{finnish}{\k@ywords}}
%% the second abstract environment
%% always in english - but can be omitted if the document uses a single language
\newenvironment{abstracten}{\@bstracth{english}}{\@bstractt{english}{\k@ywordstwo}}
}{
\renewenvironment{abstract}{\@bstracth{english}}{\@bstractt{english}{\k@ywords}}
}
%% title page, reuses the standard \maketitle
\renewcommand*{\maketitle}{%
\clearpage
\thispagestyle{empty}
\vspace*{\stretch{1}}
\vspace{3mm}
\noindent
\rule{\linewidth}{1 mm}
\renewcommand{\baselinestretch}{1.05}\normalsize
\begin{flushright}
\Huge{\@title}
\end{flushright}
\rule{\linewidth}{1 mm}
\vspace*{\stretch{4}}
\renewcommand{\baselinestretch}{1}\normalsize
\begin{adjustbox}{minipage=65mm,right}
\thesistype{\l@nguage}\\
\university{\l@nguage}\\
\department{\l@nguage}\\
\labname{\l@nguage}\\
\ye@r\\
\@author
\ifdefstring{\s@pervisors}{none}{}{\\
\\
\supervisorstext:
\expandafter\forcsvlist\expandafter\\\expandafter{\s@pervisors}
}
\end{adjustbox}
\vspace*{\stretch{1}}\\
\scriptsize \turnitin
\renewcommand{\baselinestretch}{1.655}\normalsize
\clearpage
}
%% used to detect the empty \totalpages on the first latex run
\newcommand*{\IsInteger}[3]{\IfStrEq{#1}{ }{}{\IfInteger{#1}{#2}{#3}}}
%% top part of the abstract page (since we use environments)
\newcommand{\@bstracth}[1]{%
\selectlanguage{#1}
\setlength{\headheight}{0 pt}
\setlength{\headsep}{0 pt}
\addtolength\topmargin{-0.54 cm}
\renewcommand{\baselinestretch}{1}\normalsize
\clearpage
\thispagestyle{empty}
\noindent
\begin{minipage}[\textheight]{\linewidth}
\University{#1}\\
\department{#1}
\begin{entry}{}
\item[\textsc{\@author}] \@title
\end{entry}
\thesistype{#1},
\IsInteger{\totalpages}{
\pageref{endofpages} \pagesname{#1}%
\ifnum \totalpages > 0
, \totalpages\ \apppagesname{#1} \\
\else
\\
\fi
}{ \runagain{#1} \\
}
\labname{#1}\\
\titlecap{\monthname{#1}{\m@nth}} \ye@r\\
\rule{\linewidth}{1 pt}
\\
}
%% bottom part of the abstract page
\newcommand{\@bstractt}[2]{%
\selectlanguage{#1}
\bigskip
\\
\begin{entry}{}
\item[\kwlabel{#1}] #2
\end{entry}
\end{minipage}
\clearpage
\setcounter{page}{0}
\setlength{\headheight}{12 pt}
\setlength{\headsep}{24 pt}
\setlength{\topmargin}{0 mm}
\renewcommand{\baselinestretch}{1.655}\normalsize
% roman numbering for table of contents etc.
\pagenumbering{roman}
}
%% define \figcaption and \tblcaption for use with non-floating figures and tables
\newcommand\figcaption{\def\@captype{figure}\caption}
\newcommand\tblcaption{\def\@captype{table}\caption}
%% compatible with old versions that required using \startpages
%% now optional
\newcommand{\startpages}{\initdocstyle}
%% initializes the settings for main document content
\newcommand{\initdocstyle}{%
\renewcommand{\startpages}{}
\langfin{
\selectlanguage{finnish}
}{
\selectlanguage{english}
}
\clearpage
% clear 1st page headers/footers per request
\ifutuftthesis@emptyfirstpages
\fancypagestyle{plain}{\fancyhf{}\renewcommand{\headrulewidth}{0 pt}}
\fi
\pagenumbering{arabic}
\setcounter{page}{1}
\renewcommand{\baselinestretch}{1.655}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\chaptername\ \thechapter.\ ##1}}{}}
\lhead{\leftmark}
\chead{\version}
\rhead{\thepage}
\fancyfoot{}
% the totalcount counter is only used for appendices, set a bogus value now
% fails if the document has over 1000 pages
\setcounter{totalcount@page}{-1000}
}
%% postpone the doc style through these sections
\pretocmd{\tableofcontents}{\renewcommand{\startpages}{}}{}{}
\apptocmd{\tableofcontents}{\renewcommand{\startpages}{\initdocstyle}}{}{}
\pretocmd{\listoffigures}{\renewcommand{\startpages}{}}{}{}
\apptocmd{\listoffigures}{\renewcommand{\startpages}{\initdocstyle}}{}{}
\pretocmd{\listoftables}{\renewcommand{\startpages}{}}{}{}
\apptocmd{\listoftables}{\renewcommand{\startpages}{\initdocstyle}}{}{}
%% finally initialize the main document style
\pretocmd{\chapter}{\startpages}{}{}
%% compatible with old versions that required using \appendices
%% now optional
\newcommand{\appendices}{\startappendices}
%% initializes the settings for appendices
\newcommand{\startappendices}{%
\renewcommand{\appendices}{}
\clearpage
\appendix
\addtocontents{toc}{\protect\contentsline{chapter}{\appname}{}\relax}
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\appendixname\ \thechapter.\ ##1}}{}}
\rhead{\thechapter-\arabic{page}}
\setcounter{page}{0}
\renewcommand\thepage{\thechapter-\arabic{page}}
\setcounter{totalcount@page}{0}
}
%% use in place of \chapter
\newcommand{\appchapter}[1]{%
\appendices
\addtocounter{totalcount@page}{\value{page}}
\clearpage
\setcounter{page}{1}
\chapter{#1}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment