-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmystyle.sty
191 lines (158 loc) · 7.08 KB
/
mystyle.sty
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
\ProvidesPackage{mystyle}
% A package for setting layout and margins for your thesis
\usepackage[a4paper]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% Typeset text in Times Roman instead of Computer Modern (EC)
\usepackage{times}
% Suggested packages:
\usepackage{microtype} %towards typographic perfection...
\usepackage{inconsolata} %nicer font for code listings. (Use \ttfamily for lstinline bastype)
\usepackage[english, estonian]{babel} %the thesis is in Estonian
% Change Babel document elements
\addto\captionsestonian{%
\renewcommand{\refname}{Viidatud kirjandus}%
\renewcommand{\appendixname}{Lisa}%
\renewcommand{\appendixtocname}{Lisad}%
\renewcommand{\appendixpagename}{Lisad}%
}
\usepackage[autostyle=true]{csquotes}
\DeclareQuoteAlias{german}{estonian}
% If you have problems with Estonian keywords in the bibliography
\usepackage[backend=biber,style=numeric-ut,sorting=none,autolang=other]{biblatex}
\DeclareLanguageMapping{estonian}{estonian-ut}
\addbibresource{./bib/thesis.bib}
% General packages for math in general, theorems and symbols
% Read ftp://ftp.ams.org/ams/doc/amsmath/short-math-guide.pdf for further information
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{stmaryrd} % \bigsqcap
% widen, narrow - https://tex.stackexchange.com/a/203931, https://tex.stackexchange.com/q/50057
% this looks weird with partially thicker overlapping lines...
\usepackage{scalerel}
\def\widen{\mathrel{\ThisStyle{\stretchrel*{\ooalign{%
\raise0.2\LMex\hbox{$\SavedStyle\sqcup$}\cr%
\raise-0.2\LMex\hbox{$\SavedStyle\sqcup$}}}{\sqcup}}}}
\def\narrow{\mathrel{\ThisStyle{\stretchrel*{\ooalign{%
\raise0.2\LMex\hbox{$\SavedStyle\sqcap$}\cr%
\raise-0.2\LMex\hbox{$\SavedStyle\sqcap$}}}{\sqcap}}}}
% Optional calligraphic fonts
% \usepackage[mathscr]{eucal}
% Print a dot instead of colon in table or figure captions
\usepackage[labelsep=period]{caption}
\usepackage{subcaption}
% Packages for building tables and tabulars
\usepackage{array}
\usepackage{tabu} % Wide lines in tables
\usepackage{xspace} % Non-eatable spaces in macros
\usepackage{multirow}
\usepackage{rotfloat}
% \usepackage[section]{placeins} % keep floats in their section
\usepackage{flafter} % floats must appear after definition
% Including graphical images and setting the figure directory
\usepackage{graphicx}
\graphicspath{{img/}}
% Packages for getting clickable links in PDF file
\usepackage[bookmarksnumbered]{hyperref}
%\usepackage[hidelinks]{hyperref} %hide red (blue,green) boxes around links
% pdfusetitle alternative for my commands (defined later in mymacros)
\AtBeginDocument{\hypersetup{pdftitle={\mytitle},pdfauthor={\myauthor},pdfkeywords={\mykeywords}}}
\usepackage[all]{hypcap}
% overrides hyperref bookmarks
\usepackage[numbered,open]{bookmark}
% Packages for defining colourful text together with some colours
\usepackage{color}
\usepackage{xcolor}
%\definecolor{dkgreen}{rgb}{0,0.6,0}
%\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
% Standard package for drawing algorithms
% Since the thesis in article format we must define \chapter for
% the package algorithm2e (otherwise obscure errors occur)
%\let\chapter\section
\usepackage[ruled, vlined, linesnumbered]{algorithm2e}
% Fix a set of keywords which you use inside algorithms
\SetKw{True}{true}
\SetKw{False}{false}
\SetKwData{typeInt}{Int}
\SetKwData{typeRat}{Rat}
\SetKwData{Defined}{Defined}
\SetKwFunction{parseStatement}{parseStatement}
% Nice todo notes
\usepackage[obeyFinal]{todonotes}
% comments and verbatim text (code)
\usepackage{verbatim}
% Proper way to create coloured code listings
\usepackage{listings}
\lstset{
%language=python, % the language of the code
language=C++,
basicstyle=\footnotesize, % the size of the fonts that are used for the code
%numbers=left, % where to put the line-numbers
%numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
numberstyle=\tiny\color{gray},
stepnumber=1, % the step between two line-numbers. If it's 1, each line
% will be numbered
numbersep=5pt, % how far the line-numbers are from the code
backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
showspaces=false, % show spaces adding particular underscores
showstringspaces=false, % underline spaces within strings
showtabs=false, % show tabs within strings adding particular underscores
frame = lines,
%frame=single, % adds a frame around the code
rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within
% not-black text (e.g. commens (green here))
tabsize=2, % sets default tabsize to 2 spaces
captionpos=b, % sets the caption-position to bottom
breaklines=true, % sets automatic line breaking
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
%title=\lstname, % show the filename of files included with \lstinputlisting;
% also try caption instead of title
keywordstyle=\color{blue}, % keyword style
commentstyle=\color{dkgreen}, % comment style
stringstyle=\color{mauve}, % string literal style
escapeinside={\%*}{*)}, % if you want to add a comment within your code
morekeywords={*,game, fun} % if you want to add more keywords to the set
}
\usepackage[cache=false,outputdir=build]{minted}
\setminted{
autogobble=true,
tabsize=4
}
% \RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{} % center all minted - https://tex.stackexchange.com/a/161128
\usepackage{xpatch,letltxmacro}
\LetLtxMacro{\bminted}{\minted}
\let\endbminted\endminted
\xpretocmd{\bminted}{\RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}}{}{}
% BVerbatim removes margins (https://tex.stackexchange.com/q/142444) and doesn't support frame
% If you really want to draw figures in LaTeX use packages tikz or pstricks
% However, getting a corresponding illustrations is really painful
\usepackage{tikz}
\usetikzlibrary{positioning,automata,arrows,fit,calc}
% Nice Todo box
\newcommand{\TODO}{\todo[inline]}
% A way to define theorems and lemmata
\theoremstyle{plain}
\newtheorem{theorem}{Teoreem}
\newtheorem{lemma}[theorem]{Lemma}
\theoremstyle{definition}
\newtheorem{definition}{Definitsioon}
% Modular documents
\usepackage{subfiles}
\usepackage[toc,page]{appendix}
\usepackage{titlesec}
\newcommand{\sectionbreak}{\clearpage\phantomsection}
% https://tex.stackexchange.com/a/10689
\usepackage{enumitem}
% https://tex.stackexchange.com/a/352622
\usepackage{etoolbox}
%\AtBeginEnvironment{definition}{\renewcommand\em{\bfseries}}
\renewcommand{\em}{\bfseries} % always bold emphasis
% https://tex.stackexchange.com/a/296150
\makeatletter
\renewrobustcmd*{\mkbibemph}{\mkbibitalic}
\protected\long\def\blx@imc@mkbibemph#1{\blx@imc@mkbibitalic{#1}}
\makeatother
\usepackage{textpos}