-
Notifications
You must be signed in to change notification settings - Fork 0
/
fitthesis.cls
474 lines (400 loc) · 15.9 KB
/
fitthesis.cls
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
% ----------------------------------------------------------------------------
% FIT thesis
% ----------------------------------------------------------------------------
% (C) 2007 Zdenek Vasicek, 2008 Michal Bidlo
% vim: set syntax=tex encoding=latin2:
% ----------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{fitthesis}[2007/04/13 Sablona pro BP/DP]
%Vychozi hodnoty parametru
\newif\ifczech \let\ifczech\iftrue
\newif\ifcover \let\ifcover\iffalse
\newif\ifPrint \let\ifPrint\iffalse
\newif\ifWis \let\ifWis\iftrue
%-----------------------------------------------------------------------------
%Parametry tridy
%-----------------------------------------------------------------------------
\DeclareOption{english}{\let\ifczech\iffalse}
\DeclareOption{cover}{\let\ifcover\iftrue}
\DeclareOption{print}{\let\ifWis\iffalse \let\ifPrint\iftrue}
\DeclareOption*{}
\ProcessOptions\relax
%Jako vychozi pouzijeme tridu REPORT
\ifx\pdfoutput\undefined % nejedeme pod pdftexem
\LoadClass[a4paper,oneside,onecolumn,11pt]{report}
\else
\LoadClass[pdftex,a4paper,oneside,onecolumn,11pt]{report}
\fi
%-----------------------------------------------------------------------------
%Balicky
%-----------------------------------------------------------------------------
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[czech,english]{babel}
\usepackage[utf8]{inputenc} %kodovani
\ifczech
\main@language{czech}
\else
\main@language{english}
\fi
\ifx\pdfoutput\undefined % nejedeme pod pdftexem
\usepackage{graphics}
\usepackage{epsfig}
\else % je to pdftex !
\usepackage[pdftex]{graphicx}
\fi
%-----------------------------------------------------------------------------
%Sazebni obrazec
%-----------------------------------------------------------------------------
\setlength{\hoffset}{-0.7cm}
\setlength{\voffset}{-1.5cm}
\setlength{\textheight}{23.0cm}
\setlength{\textwidth}{15.2cm}
%-----------------------------------------------------------------------------
%Texty
%-----------------------------------------------------------------------------
\def\@vut@CS{Vysoké učení technické v~Brně}
\def\@vut@EN{Brno University of Technology}
\def\@fit@CS{Fakulta informačních technologií}
\def\@fit@EN{Faculty of Information Technology}
\def\@author@CS{Autor práce}
\def\@author@EN{Author}
\def\@supervisor@CS{Vedoucí práce}
\def\@supervisor@EN{Supervisor}
\def\@dep@CS{Ústav}
\def\@dep@EN{Department of}
\def\@abstract@CS{Abstrakt}
\def\@abstract@EN{Abstract}
\def\@keywords@CS{Klíčová slova}
\def\@keywords@EN{Keywords}
\def\@cite@CS{Citace}
\def\@copyright@CS{Tato práce vznikla jako školní dílo na Vysokém učení technickém v Brně, Fakultě informačních technologií.
Práce je chráněna autorským zákonem a její užití bez udělení oprávnění autorem je nezákonné, s výjimkou zákonem definovaných případů.}
\def\@tdecl@CS{Prohlášení}
\def\@tackn@CS{Poděkování}
\newif\ifnasel
\def\ifEqString#1#2#3#4{\def\testa{#1}\def\testb{#2}%
\ifx\testa\testb \def#4{#3} \naseltrue \fi%
}
%Vyber typu projektu
\newcommand{\set@project}[1]{%
\naselfalse
\ifEqString{#1}{BP}{Bakalářská práce}{\@projecttype@CS}%
\ifEqString{#1}{BP}{Bachelor's thesis}{\@projecttype@EN}%
\ifEqString{#1}{SP}{Semestrální projekt}{\@projecttype@CS}%
\ifEqString{#1}{SP}{Term project}{\@projecttype@EN}%
\ifEqString{#1}{DP}{Diplomová práce}{\@projecttype@CS}%
\ifEqString{#1}{DP}{Master's thesis}{\@projecttype@EN}%
\ifEqString{#1}{DR}{Disertační práce}{\@projecttype@CS}%
\ifEqString{#1}{DR}{PhD thesis}{\@projecttype@EN}%
\ifnasel
\else
\typeout{Spatny typ projektu! Moznosti: BP, SP, DP, DR}\set@project{BP}
\fi
}
%Vyber ustavu
\newcommand{\set@department}[1]{%
\naselfalse
\ifEqString{#1}{UIFS}{informačních systémů}{\@department@CS}%
\ifEqString{#1}{UIFS}{Information Systems}{\@department@EN}%
\ifEqString{#1}{UPSY}{počítačových systémů}{\@department@CS}%
\ifEqString{#1}{UPSY}{Computer Systems}{\@department@EN}%
\ifEqString{#1}{UITS}{inteligentních systémů}{\@department@CS}%
\ifEqString{#1}{UITS}{Intelligent Systems}{\@department@EN}%
\ifEqString{#1}{UPGM}{počítačové grafiky a multimédií}{\@department@CS}%
\ifEqString{#1}{UPGM}{Computer Graphics and Multimedia}{\@department@EN}%
\ifnasel
\else
\typeout{Spatny ustav! Moznosti: UPSY, UIFS, UITS, UPGM}\set@department{UIFS}
\fi
}
%Nazev ustavu (CS, EN)
\def\@departmentname@CS{\@dep@CS\ \@department@CS}
\def\@departmentname@EN{\@dep@EN\ \@department@EN}
%Nazev prace (v jazyce prace)
\def\@title{\ifczech\@title@CS\else\@title@EN\fi}
%Jmeno, prijmeni, tituly autora
\def\get@author{\ifx\undefined\@author@tp\else%
\@author@tp~\fi\MakeUppercase{\@author}\ifx\undefined\@author@ta\else,~\@author@ta\fi}
%Jmeno, prijmeni, tituly vedouciho
\def\get@supervisor{\ifx\undefined\@supervisor@tp\else%
\@supervisor@tp~\fi\MakeUppercase{\@supervisor}\ifx\undefined\@supervisor@ta\else,~\@supervisor@ta\fi}
%-----------------------------------------------------------------------------
% Projectinfo - parametrizace sablony
%-----------------------------------------------------------------------------
%Parametry
\define@key{projinfo}{title.cs}{\global\def\@title@CS{#1}}
\define@key{projinfo}{title.en}{\global\def\@title@EN{#1}}
\define@key{projinfo}{department}{\set@department{#1}}
\define@key{projinfo}{project}{\set@project{#1}}
\define@key{projinfo}{year}{\def\@year{#1}}
\define@key{projinfo}{date}{\def\@date{#1}}
\define@key{projinfo}{author}{\def\@author{#1}}
\define@key{projinfo}{author.title.a}{\def\@author@ta{#1}}
\define@key{projinfo}{author.title.p}{\def\@author@tp{#1}}
\define@key{projinfo}{supervisor}{\def\@supervisor{#1}}
\define@key{projinfo}{supervisor.title.a}{\def\@supervisor@ta{#1}}
\define@key{projinfo}{supervisor.title.p}{\def\@supervisor@tp{#1}}
\define@key{projinfo}{keywords.cs}{\def\@tkeywords@CS{#1}}
\define@key{projinfo}{keywords.en}{\def\@tkeywords@EN{#1}}
\define@key{projinfo}{abstract.cs}{\def\@tabstract@CS{#1}}
\define@key{projinfo}{abstract.en}{\def\@tabstract@EN{#1}}
\define@key{projinfo}{declaration}{\def\@declaration{#1}}
\define@key{projinfo}{acknowledgment}{\def\@acknowledgment{#1}}
%Vychozi hodnoty
\setkeys{projinfo}{
title.cs={Název práce (česky)},title.en={Název práce(anglicky)},
date=\today, project=BP, department=UIFS, declaration=,
abstract.cs=, abstract.en=, keywords.cs=, keywords.en=,
author=Jmeno Prijmeni, supervisor=Jmeno Prijmeni
}%
\def\projectinfo{\setkeys{projinfo}}
%Prohlaseni
\newcommand{\declaration}[1]{\def\@declaration{#1}}
%Podekovani
\newcommand{\acknowledgment}[1]{\def\@acknowledgment{#1}}
%Abstrakt
\renewcommand{\abstract}[2][cs]{%
\ifEqString{#1}{cs}{#2}{\@tabstract@CS}%
\ifEqString{#1}{en}{#2}{\@tabstract@EN}%
}
%Klicova slova
\newcommand{\keywords}[2][cs]{%
\ifEqString{#1}{cs}{#2}{\@tkeywords@CS}%
\ifEqString{#1}{en}{#2}{\@tkeywords@EN}%
}
\newlength{\mkspc}
\setlength{\mkspc}{2pt}
\def\setfontsize#1{\renewcommand{\baselinestretch}{1.5}\fontsize{#1}{\f@baselineskip}\selectfont}
%text
\newcommand{\mktxt}[2]{\vbox{\setfontsize{#1}\noindent#2}\vspace\mkspc}
%bold
\newcommand{\mktxt@b}[2]{\vbox{\setfontsize{#1}\noindent\bf#2}\vspace\mkspc}
\newcommand{\mkuctxt}[2]{\vbox{\setfontsize{#1}\noindent\MakeUppercase{#2}}\vspace\mkspc}
%-----------------------------------------------------------------------------
%Desky \makecover
%-----------------------------------------------------------------------------
\newcommand\makecover{\thispagestyle{empty}\null%
%===================================================
\fontfamily{phv}\selectfont%
%
\mkuctxt{24}{\@vut@CS}
\mkuctxt{11}{\@vut@EN}
\vspace{12mm}
\mkuctxt{14}{\@fit@CS}
\mkuctxt{14}{\@departmentname@CS}
\vspace{4mm}
\mkuctxt{11}{\@fit@EN}
\mkuctxt{11}{\@departmentname@EN}
\vfill
\mkuctxt{18}{\@title} %Nazev prace v jazyce v jakem je napsana
\vfill
\mkuctxt{14}{\@projecttype@CS}
\mkuctxt{10}{\@projecttype@EN}
\vspace{5mm}
\mktxt{14}{\MakeUppercase{\@author@CS} \hfill \get@author}
\mkuctxt{10}{\@author@EN}
\vspace{10mm}
\mktxt{11}{BRNO \@year}
%===================================================
\newpage\fontfamily{\familydefault}\selectfont%
}
%-----------------------------------------------------------------------------
%Abstrakt, klicovaslova \makeabstract
%-----------------------------------------------------------------------------
\newcommand\makeabstract{%
\thispagestyle{empty}\null%
\mktxt@b{16}{\@abstract@CS}\noindent\@tabstract@CS
\vfill
\mktxt@b{16}{\@abstract@EN}\noindent\@tabstract@EN
\vfill
\mktxt@b{16}{\@keywords@CS}\noindent\@tkeywords@CS
\vfill
\mktxt@b{16}{\@keywords@EN}\noindent\@tkeywords@EN
\vfill
\mktxt@b{16}{\@cite@CS}
\noindent\@author: \@title, \MakeLowercase{\@projecttype@CS}, Brno, FIT VUT v~Brně, \@year
%===================================================
\newpage
}
%-----------------------------------------------------------------------------
%Prohlaseni, podekovani \makedeclaration
%-----------------------------------------------------------------------------
\newcommand\makedeclaration{
\thispagestyle{empty}%
\mktxt@b{18}{\@title}
\vspace{10mm}
\mktxt@b{16}{\@tdecl@CS}
\noindent\@declaration
\begin{flushright}
\makebox[4cm]{\dotfill} \\
\@author\\
\@date
\end{flushright}
\ifx\undefined\@acknowledgment
\else
\vspace{20mm}
\mktxt@b{16}{\@tackn@CS}
\noindent\@acknowledgment
\fi
\vfill
\noindent\copyright\ \@author, \@year.\newline
{\em \@copyright@CS}
%===================================================
\newpage
}
%-----------------------------------------------------------------------------
%Uvodni stranky \maketitle
%-----------------------------------------------------------------------------
\renewcommand\maketitle{%
\ifcover\makecover\fi%
\thispagestyle{empty}\null%
%=====================================================
\fontfamily{phv}\selectfont%
\newsavebox{\@obrlogo}\newsavebox{\@rtext}\newlength{\@vyskartext}\newlength{\@vyskaobr}%
\savebox{\@obrlogo}{\includegraphics[width=3.5cm,keepaspectratio]{fig/vut-zp2}}%logo VUT
\savebox{\@rtext}{\vbox{\mkuctxt{18}{\@vut@CS}\mkuctxt{11}{\@vut@EN}}}%text VUT
\settoheight{\@vyskaobr}{\makebox{\usebox{\@obrlogo}}}% vyska loga
\settoheight{\@vyskartext}{\makebox{\usebox{\@rtext}}}% vyska textu
\addtolength{\@vyskaobr}{-\@vyskartext}%odecteme od vysky loga vysku textu
\noindent\usebox{\@obrlogo}\raisebox{\@vyskaobr}{\hspace{10pt}\usebox{\@rtext}}%zvedneme box s textem
\vspace{5mm}
\savebox{\@obrlogo}{\includegraphics[width=3.5cm,keepaspectratio]{fig/fit-zp2}}%logo FIT
\savebox{\@rtext}{%text FIT, USTAV
\vbox{\mkuctxt{14}{\@fit@CS}\mkuctxt{14}{\@departmentname@CS}
\vspace{3mm}
\mkuctxt{11}{\@fit@EN}\mkuctxt{11}{\@departmentname@EN}}}%
\settoheight{\@vyskaobr}{\makebox{\usebox{\@obrlogo}}}% vyska loga
\settoheight{\@vyskartext}{\makebox{\usebox{\@rtext}}}% vyska textu
\addtolength{\@vyskaobr}{-\@vyskartext}%odecteme od vysky loga vysku textu
\noindent\usebox{\@obrlogo}\raisebox{\@vyskaobr}{\hspace{10pt}\usebox{\@rtext}}%zvedneme box s textem
\vfill
\mkuctxt{18}{\@title@CS}
\mkuctxt{10}{\@title@EN}
\vfill
\mkuctxt{14}{\@projecttype@CS}
\mkuctxt{10}{\@projecttype@EN}
\vspace{5mm}
\mktxt{14}{\MakeUppercase{\@author@CS} \hfill \get@author}
\mkuctxt{10}{\@author@EN}
\vspace{5mm}
\mktxt{14}{\MakeUppercase{\@supervisor@CS} \hfill \get@supervisor}
\mkuctxt{10}{\@supervisor@EN}
\vspace{10mm}
\mktxt{11}{BRNO \@year}
\newpage\fontfamily{\familydefault}\selectfont%
%=================================================================================
\makeabstract\makedeclaration
\clearpage
\setcounter{tocdepth}{2}\setcounter{page}{1}
}
%-----------------------------------------------------------------------------
\def\uv#1{\iflanguage{english}{``#1''}%
{\quotedblbase #1\textquotedblleft}}%
%\catcode`\"=\active
%\def"{\bgroup
% \iflanguage{english}%
% {``\def"{''\egroup}}%
% {\quotedblbase\def"{\textquotedblleft\egroup}}}
% Now, switch on what is appropriate for czech:
% czech quotation marks
% \bq - begin quotation, \eq - end quotation
\def\bq{\mbox{\kern.1ex\protect\raisebox{-1.3ex}[0pt][0pt]{''}\kern-.1ex}}
\def\eq{\mbox{\kern-.1ex``\kern.1ex}}
%\setlanguage{\czech}
{% % Begin a group for which " is active
\catcode`\"=\active % Make " an active character
\catcode`\@=11 % Make @ an active character
%
% \csdoublequoteson
%
% This macro makes " an active character, resets the control sequence
% \dblqu@te to L (left), and defines \dq as a replacement for ".
%
\gdef\csdoublequoteson{% % \csdoublequoteson enables "
\gdef"{\czechquotes}% % Define " as \czechquotes
\global\catcode`\"=\active% % Make " an active character
\global\chardef\dq=`\"% % Double-quote char. via \dq
\global\let\dblqu@te=L% % Always start with a left double-quote
} % End of macro
%
% \bq, \eq
%
% These macros define default characters for czech left and right
% double quotes. Czech opening quote is created from two commas with
% kerning depending on fontdimen four parameter of current font.
% Better solution should be specially designed character with
% proper kernings; if you have such characters in fonts
% (e.g. in DC-fonts), use it instead. (e.g. define
% macros \bq and \eq e.g. \def\bq{\char"130 }
% in your document/style file-- not in csquote.sty!)
% Similar solution is used for czech right quote.
%
% \cs existence test, stolen from TeXbook exercise 7.7
\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax }%
%
% another macro to be more efficient in time and space
\global\chardef\f@@r=4
%
\ifundefined{bq}%
\gdef\bq{\kern-.25\fontdimen\f@@r\font,\kern-.8\fontdimen\f@@r\font,%
\kern-.35\fontdimen\f@@r\font}%
\fi
\ifundefined{eq}%
\gdef\eq{\kern-.35\fontdimen\f@@r\font`\kern-.8\fontdimen\f@@r\font`%
\kern-.25\fontdimen\f@@r\font}
\fi
%
% Macro \uv for other usage of \bq and \eq.
%
\ifundefined{uv}\iflanguage{czech}%
\gdef\uv#1{\bq #1\eq}
\fi
%
% \testquotes macro gives warning if citation span this place
%
\gdef\testquotes{\if R\dblqu@te
\message{Warning: You forgot right double quote!}%
\let\dblqu@te=L\fi}
%
% Define the macro that will be executed whenever " is encountered.
%
\gdef\czechquotes{\protect\czechqu@tes}
\gdef\czechqu@tes{%
% If the double-quote is the first character in a new paragraph,
% make sure it becomes a left double-quote. This case can be
% detected by checking to see if TeX is currently in vertical mode.
% If so, the double-quote is at the beginning of the paragraph
% (since " hasn't actually generated any horizontal mode tokens
% yet, TeX is still in vertical mode). If the mode is vertical,
% set \dblqu@te equal to L.
%
\ifinner\else\ifvmode\testquotes\fi\fi%
%
% Now insert the appropriate left or right double-quote.
%
% If \dblqu@te is L, insert an opening quote and set \dblqu@te to R.
%
\if L\dblqu@te\bq\global\let\dblqu@te=R%
%
% Otherwise, save the current \spacefactor, insert '', set \dblqu@te
% to L, and reset the original \spacefactor.
%
\else%
\let\xxx=\spacefactor% % Save the \spacefactor
\eq% % Insert ending quote
\global\let\dblqu@te=L% % and reset \dblqu@te
\spacefactor\xxx% % Reset the \spacefactor
\fi% % End of \if L\dblqu@te...
} % End of " macro
} % End of group
\gdef\csdoublequotesoff{%
\catcode`\"=12% % Set " back to other
}
%
% Czech quotes are default
%
\csdoublequoteson
\endinput
%%
%% End of file `fitthesis.cls'.