-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtol.sty
More file actions
169 lines (145 loc) · 4.88 KB
/
tol.sty
File metadata and controls
169 lines (145 loc) · 4.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
% This is a style file to be used in publications of the Department of Information
% Processing Science in University of Oulu (http://www.tol.oulu.fi).
% It tries to mimic the appearance of the required, official document styling,
% but is far from complete. All help is appreciated...
%
% NOTE: This is barely usable style to be used for creating documents for TOL classes.
% More style fixes coming hopefully someday.
%
% At the moment this style does the following things:
% - Change the page layout to follow the correct style
% - Change the title page to follow the correct style
% - Sets up the correct citation settings (apacite-style)
% - Translates ``et al'' to be ``ja muut''
% - Adds \citeapos to produce output like ``Foo et al (2009)''
% - Adds pagebreak before references page
%
% TODO:
% - Styling of lists, tables, image settings, ..
% -
%
% Usage:
% 1) Copy this file and oylogoe.png (rip it from the .doc file) to the directory where your tex file is
% 2) Add \usepackage{tol} to your tex document
% 3) Define \author, \email, \course, \studentno and \title, and call \hypersetupdefault
% if you want default pdf settings (with title like Course - Title and author(s) set)
% 4) Call \maketitle after beginning the document environment
% 5) Call \bibliography{yourbib} just like normally to generate reference list
% 6) ???
% 7) PROFIT!
%
% Author: Teemu Rytilahti
% Modified by: Juho Myllylahti
% Comments, ideas and patches welcome!
\usepackage[]{hyperref} %pdf output
\usepackage{graphicx} %images
\usepackage{chngpage} %changing layout per page basis, needed for title page
\usepackage{calc}
% TODO adapt to not to print chapter when not available
% FIXME are these really needed anymore?
%\renewcommand\thesection{\thechapter.\arabic{section}.}
%\renewcommand\thesubsection{\thesection\arabic{subsection}.}
%\renewcommand\thesubsubsection{\thesubsection\arabic{subsubsection}.}
%finnish language support
\usepackage[english]{babel}
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
%basic settings
\usepackage[a4paper,margin=2cm,left=4cm]{geometry}
\setlength{\parskip}{12pt} % line between paragraphs
\setlength{\parindent}{0pt} % don't indent paragraphs
%general layout
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[RE,RO]{\thepage}
\setlength{\headheight}{24pt}
%section layout
%\let\stdsection\section
%\renewcommand\section{\newpage} %\vspace*{-10pt}\stdsection}
%\let\stdsubsection\subsection
%\renewcommand\subsection{\vspace*{-10pt}\stdsubsection}
%\renewcommand\thesection{\arabic{section}.}
%\renewcommand\thesubsection{\thesection\arabic{subsection}}
%\renewcommand\thesubsubsection{.\thesubsection\arabic{subsubsection}}
%fonts
\usepackage{fontspec}
\usepackage{titlesec}
\setmainfont[Ligatures={Common},Mapping=tex-text]{Linux Libertine}
\setsansfont[Ligatures={Common},Mapping=tex-text]{Liberation Sans}
\titleformat*{\section}{\fontspec{Liberation Sans}\Large\mdseries}
\titleformat*{\subsection}{\fontspec{Liberation Sans}\large\mdseries}
\titleformat*{\subsubsection}{\fontspec{Liberation Sans}\large\mdseries}
%table of contents
\usepackage{tocloft}
% This is all for formatting and making the Table of Contents according to
% spec. Don't play with it.
%\makeatletter
%\renewcommand\l@section[2]{%
% \ifnum \c@tocdepth >\z@
% \addpenalty\@secpenalty
%\addvspace{1.0em \@plus\p@}%
%\setlength\@tempdima{1.5em}%
%\begingroup
% \parindent \z@ \rightskip \@pnumwidth
%\parfillskip -\@pnumwidth
%\leavevmode \bfseries
%\advance\leftskip\@tempdima
%\hskip -\leftskip
%#1\nobreak\
%\leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}
%\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
%\endgroup
%\fi}
%\makeatother
\setlength\cftparskip{-2pt}
\setlength\cftbeforesecskip{1pt}
\setlength\cftaftertoctitleskip{2pt}
%citations using apacite
\usepackage{apacite}
\bibliographystyle{apacite}
\def\citeapos#1{\citeauthor{#1} \citeyear{#1}}
%page break before references page
\let\stdbibliography\bibliography
\renewcommand\bibliography{\newpage\stdbibliography}
%ability to set variables for titlepage
\def\course{\def\course}
\def\email{\def\email}
\def\studentno{\def\studentno}
\def\title{\def\title}
\def\maketitle{{
\begin{titlepage}
\thispagestyle{empty}
\begin{adjustwidth}{-2cm}{0cm}
\vfill
\vspace*{4.7cm}
\begin{center}
\includegraphics[height=1.11in,width=2.44in]{oylogo.png} \\
\mbox{ }\\
\vspace*{2.5cm}
\begin{LARGE}\fontspec{Liberation Sans}\selectfont\textbf{\title}\end{LARGE} \\
\end{center}
\vfill
\begin{flushright}
\parbox[l][4cm]{7cm}{
University of Oulu \\
Department of Information Processing Science \\
\course \\
%\mbox{ }\\
\@author \\% \ (\studentno) \\
%\email \\
\@date
}
\end{flushright}
\end{adjustwidth}
\end{titlepage}}
}
\def\hypersetupdefault{
\hypersetup{
pdfauthor={\@author},
pdftitle={\course - \title},
colorlinks={false},
pdfborder={0 0 0 0},
}
}