eletrotupi / tcc/ monografia/textsi.clsc692a0c9d52c9acee116fce9eb3d38e61197d011
32.1 KB | 965 lines Raw
1
%==============================================================================
2
% Identificação
3
%==============================================================================
4
\def\currversion{3/5/2014}
5

6
\typeout{^^J^^J
7
--------------------------------------------------^^J
8
CLASSE textsi^^J
9
Formatação de Documentos LaTeX do TSI^^J
10
--------------------------------------------------^^J
11
Agradecimentos^^J
12
Marilton Aguiar, pela Classe de Formatação de Documentos LaTeX da UFPEL^^J
13
Rafael Krolow, pelo esqueleto de Template para o Documento LaTeX par o TSI^^J
14
--------------------------------------------------^^J
15
Desenvolvimento por Giovane de Oliveira Torres (ggiovaneotorres@gmail.com)^^J
16
--------------------------------------------------^^J
17
Versão: \currversion^^J
18
--------------------------------------------------^^J^^J}
19

20
\NeedsTeXFormat{LaTeX2e}
21
\ProvidesClass{textsi}[\currversion]
22

23
%==============================================================================
24
% Declaração de opções
25
%==============================================================================
26

27
% Órgãos para o cabeçalho do título.
28

29
\newcommand{\ministerio}[1]{\gdef\@ministerio{#1}}
30
\ministerio{Minist{\'e}rio da Educa\c c{\~a}o}
31

32
\newcommand{\secretaria}[1]{\gdef\@secretaria{#1}}
33
\secretaria{Secretaria de Educa\c c{\~a}o Profissional e Tecnol{\'o}gica}
34

35
\newcommand{\instituto}[1]{\gdef\@instituto{#1}}
36
\instituto{Instituto Federal Sul-Rio-Grandense}
37

38
\newcommand{\campus}[1]{\gdef\@campus{#1}}
39
\campus{C{\^a}mpus Pelotas}
40

41
\newcommand{\thecurso}[1]{\gdef\@thecurso{#1}}
42
\thecurso{Curso Superior de Tecnologia em Sistemas para Internet}
43

44
\newcommand{\documento}[1]{\gdef\@documento{#1}}
45
\newcommand{\tipodocumento}[1]{\gdef\@tipodocumento{#1}}
46
\newcommand{\descricaodocumento}[1]{\gdef\@descricaodocumento{#1}}
47

48
% Para a folha de aprovação
49

50
\newcommand{\instituicaoadvisor}[1]{\gdef\@instituicaoadvisor{#1}}
51

52
\newcommand{\membroi}[1]{\gdef\@membroi{#1}}
53
\newcommand{\membroii}[1]{\gdef\@membroii{#1}}
54
\newcommand{\membroiii}[1]{\gdef\@membroiii{#1}}
55

56
\newcommand{\instituicaomembroi}[1]{\gdef\@instituicaomembroi{#1}}
57
\newcommand{\instituicaomembroii}[1]{\gdef\@instituicaomembroii{#1}}
58
\newcommand{\instituicaomembroiii}[1]{\gdef\@instituicaomembroiii{#1}}
59

60
% Para o texto
61

62
\newcommand{\source}[1]{\\ Fonte: #1}
63

64
\newcommand{\sourcecode}[1]{%
65
  \smallskip
66
  {\centering Fonte: #1\par}%
67
}
68

69
% Opções
70

71
\DeclareOption{tcc}{
72
\documento{Trabalho de Conclus{\~a}o de Curso}
73
\tipodocumento{Trabalho de Conclus{\~a}o de Curso (\@nomecurso) -- \@unidade}
74
\descricaodocumento{Trabalho de Conclus{\~a}o de Curso apresentado como requisito parcial {\`a} obten\c c{\~a}o ao t{\'i}tulo de tecn{\'o}logo em Sistemas para Internet do Instituto Federal Sul-Rio-Grandense}
75
}
76

77
\newcommand{\capa}[1]{\gdef\@capa{#1}}
78
\DeclareOption{capa}{\capa{1}}
79

80
\newcommand{\nocipinfo}[1]{\gdef\@nocipinfo{#1}}
81
\DeclareOption{nocipinfo}{\nocipinfo{1}}
82

83
\DeclareOption{english}{\@englishtrue\OptionNotUsed}\newif\if@english
84
\DeclareOption{oneside}{\AtEndOfClass{\@twosidefalse}\OptionNotUsed}
85
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
86
\ProcessOptions
87
\relax
88

89
%==============================================================================
90
% Herança da classe `report' e inclusão de pacotes e arquivos necessários
91
%==============================================================================
92
\LoadClass[12pt,a4paper,oneside]{report}
93

94
\RequirePackage[english,brazilian]{babel}
95
\RequirePackage{ulem}
96
\RequirePackage{lastpage}
97
\RequirePackage{indentfirst}
98
\RequirePackage{natbib}
99
\RequirePackage{chngcntr}
100
\RequirePackage{eso-pic}
101
\RequirePackage{xcolor}
102
\RequirePackage{setspace}
103
\RequirePackage{geometry}
104
\RequirePackage{listings}
105

106
\geometry{top=3cm,right=2cm,left=3cm,bottom=2cm}
107

108
\definecolor{laranjaufpel}{rgb}{1,0.6,0}
109
\definecolor{verdeufpel}{rgb}{0.09,0.7,0.44}
110
\definecolor{azulufpel}{rgb}{0.07,0.49,0.72}
111
\definecolor{cinzaufpel}{rgb}{0.85,0.85,0.85}
112

113
%==============================================================================
114
% Configuração de listagens de código (pacote listings)
115
%==============================================================================
116
\lstdefinelanguage{yaml}{
117
  keywords={image,build,context,file,ports,environment,volumes,depends_on,
118
            condition,healthcheck,test,interval,timeout,retries,start_period,
119
            restart,command,shm_size,user,push,tags,labels,services,options},
120
  sensitive=false,
121
  comment=[l]{\#},
122
  morestring=[b]",
123
  morestring=[b]',
124
}
125

126
\lstset{
127
  language=yaml,
128
  basicstyle=\ttfamily\small,
129
  keywordstyle=\color{azulufpel}\bfseries,
130
  commentstyle=\color{verdeufpel}\itshape,
131
  stringstyle=\color{laranjaufpel},
132
  backgroundcolor=\color{cinzaufpel!35},
133
  rulecolor=\color{azulufpel},
134
  frame=single,
135
  framerule=0.6pt,
136
  numbers=left,
137
  numberstyle=\tiny\color{black!60},
138
  numbersep=8pt,
139
  showstringspaces=false,
140
  breaklines=true,
141
  columns=fullflexible,
142
  captionpos=t,
143
  tabsize=2,
144
}
145

146
\renewcommand*{\l@lstlisting}{\@dottedtocline{1}{0em}{5.5em}}
147

148
%
149
% definições para textos em português
150
%
151
\@namedef{captionsbrazilian}{%
152
  \def\bibname{Refer{\^e}ncias}%
153
  \def\abstractname{Resumo}%
154
  \def\appendixname{Ap{\^e}ndice}%
155
  \def\appendicesname{Ap{\^e}ndices}%
156
  \def\contentsname{Sum{\'a}rio}%
157
  \def\listfigurename{Lista de Ilustra\c{c}{\~o}es}%
158
  \def\listtablename{Lista de Tabelas}%
159
  \def\figurename{Figura}%
160
  \def\tablename{Tabela}%
161
  \def\advisorname{Orientador}%
162
  \def\coadvisorname{Coorientador}%
163
  \def\collaboratorname{Colaborador}%
164
  \def\listabbrvname{Lista de Abreviaturas e Siglas}%
165
  \def\listsymbolname{Lista de S{\'\i}mbolos}%
166
  \def\annexname{Anexo}%
167
  \def\annexesname{Anexos}%
168
  \def\keywordsname{Palavras-chave}%
169
  \def\lstlistingname{C{\'o}digo}%
170
  \def\lstlistlistingname{Lista de C{\'o}digos}%
171
}
172

173
\@namedef{datebrazilian}{%
174
  \def\monthname{%
175
    \ifcase\month\or%
176
    janeiro\or fevereiro\or mar{\c{c}}o\or abril\or maio\or junho\or
177
    julho\or agosto\or setembro\or outubro\or novembro\or dezembro%
178
    \fi%
179
  }%
180
  \def\ei@date{\@publyear}%
181
  % \def\ei@date{\@publmonth\ de~\@publyear}%
182
}
183

184
%
185
% definições para textos em inglês
186
%
187
\@namedef{captionsenglish}{%
188
  \def\bibname{References}%
189
  \def\abstractname{Abstract}%
190
  \def\appendixname{Appendix}%
191
  \def\appendicesname{Appendices}%
192
  \def\contentsname{Contents}%
193
  \def\listfigurename{List of Figures}%
194
  \def\listtablename{List of Tables}%
195
  \def\figurename{Figure}%
196
  \def\tablename{Table}%
197
  \def\advisorname{Advisor}%
198
  \def\coadvisorname{Coadvisor}%
199
  \def\collaboratorname{Collaborator}%
200
  \def\listabbrvname{List of Abbreviations and Acronyms}%
201
  \def\listsymbolname{List of Symbols}%
202
  \def\annexname{Annex}%
203
  \def\annexesname{Annexes}%
204
  \def\keywordsname{Keywords}%
205
  \def\lstlistingname{Listing}%
206
  \def\lstlistlistingname{List of Listings}%
207
}
208

209
\@namedef{dateenglish}{%
210
  \def\monthname{%
211
    \ifcase\month\or%
212
    January\or February\or March\or April\or May\or June\or July\or
213
    August\or September\or October\or November\or December%
214
    \fi%
215
  }%
216
  \def\ei@date{\@publyear}%
217
  % \def\ei@date{\@publmonth~\@publyear}%
218
}
219

220
\if@english%
221
\selectlanguage{english}%
222
\AtBeginDocument{\selectlanguage{english}}%
223
\fi
224

225
%==============================================================================
226
% O uso de fonte Arial, 12 pt, é mandatório
227
%==============================================================================
228
\renewcommand*\familydefault{\sfdefault}%
229
\renewcommand{\rmdefault}{phv}%
230
\renewcommand{\sfdefault}{phv}
231

232
% Definição do espaçamento de texto
233
\setlength{\baselineskip}{1.5cm}
234

235
%----------------------------------------
236
% PARÁGRAFOS
237
%----------------------------------------
238
% Tamanho da endentação do parágrafo
239
\setlength{\parindent}{1.3cm}
240
% Espaçamento entre um parágrafo e outro
241
\setlength{\parskip}{1.5pt}
242

243

244
%==============================================================================
245
% Numeração das páginas
246
%==============================================================================
247
\def\ps@texufpel{%
248
  \let\@oddfoot\@empty%
249
  \let\@evenfoot\@empty%
250
  \def\@oddhead{\hspace*{\fill}{\small\thepage}}%
251
  \def\@evenhead{\hspace*{\fill}{\small\thepage}}%
252
}
253

254
\pagestyle{empty}%
255
\let\ps@plain\ps@empty
256

257
%==============================================================================
258
% Definição de autor(es), orientador e co-orientador
259
%==============================================================================
260
\newcounter{ei@authorcount}
261
\renewcommand{\author}[2]{
262
        \addtocounter{ei@authorcount}{1}
263
        \expandafter\gdef\csname @author\alph{ei@authorcount}last\endcsname{#1}
264
        \expandafter\gdef\csname @author\alph{ei@authorcount}first\endcsname{#2}
265
        \expandafter\gdef\csname @author\alph{ei@authorcount}\endcsname{#2 #1}
266
}
267

268
\newcounter{ei@advisorcount}
269
\DeclareRobustCommand{\advisor}[3][]{
270
        \addtocounter{ei@advisorcount}{1}
271
        \expandafter\gdef\csname @advisor\alph{ei@advisorcount}last\endcsname{#2}
272
        \expandafter\gdef\csname @advisor\alph{ei@advisorcount}first\endcsname{#3}
273
        \expandafter\gdef\csname @advisor\alph{ei@advisorcount}\endcsname{#1~#3 #2}
274
}
275

276
\newcounter{ei@coadvisorcount}
277
\DeclareRobustCommand{\coadvisor}[3][]{
278
        \addtocounter{ei@coadvisorcount}{1}
279
        \expandafter\gdef\csname @coadvisor\alph{ei@coadvisorcount}last\endcsname{#2}
280
        \expandafter\gdef\csname @coadvisor\alph{ei@coadvisorcount}first\endcsname{#3}
281
        \expandafter\gdef\csname @coadvisor\alph{ei@coadvisorcount}\endcsname{#1~#3 #2}
282
}
283

284
\newcounter{ei@collaboratorcount}
285
\DeclareRobustCommand{\collaborator}[3][]{
286
        \addtocounter{ei@collaboratorcount}{1}
287
        \expandafter\gdef\csname @collaborator\alph{ei@collaboratorcount}last\endcsname{#2}
288
        \expandafter\gdef\csname @collaborator\alph{ei@collaboratorcount}first\endcsname{#3}
289
        \expandafter\gdef\csname @collaborator\alph{ei@collaboratorcount}\endcsname{#1~#3 #2}
290
}
291

292

293
%==============================================================================
294
% Definição das palavras-chave (máx. 10)
295
%==============================================================================
296
\newcounter{kwcounter}
297
\newcommand{\keyword}[1]{
298
        \addtocounter{kwcounter}{1}
299
        \expandafter\gdef\csname keyw\alph{kwcounter}\endcsname{#1}
300
}
301

302
\newcommand{\@cipkw}{%
303
        \@ifundefined{keywa}{}{1.~\expandafter\MakeUppercase\keywa\@. }%
304
        \@ifundefined{keywb}{}{2.~\expandafter\MakeUppercase\keywb\@. }%
305
        \@ifundefined{keywc}{}{3.~\expandafter\MakeUppercase\keywc\@. }%
306
        \@ifundefined{keywd}{}{4.~\expandafter\MakeUppercase\keywd\@. }%
307
        \@ifundefined{keywe}{}{5.~\expandafter\MakeUppercase\keywe\@. }%
308
        \@ifundefined{keywf}{}{6.~\expandafter\MakeUppercase\keywf\@. }%
309
        \@ifundefined{keywg}{}{7.~\expandafter\MakeUppercase\keywg\@. }%
310
        \@ifundefined{keywh}{}{8.~\expandafter\MakeUppercase\keywh\@. }%
311
        \@ifundefined{keywi}{}{9.~\expandafter\MakeUppercase\keywi\@. }%
312
        \@ifundefined{keywj}{}{10.~\expandafter\MakeUppercase\keywj\@. }%
313
}
314

315
\newcommand{\@abstractkw}{%
316
        \@ifundefined{keywa}{}{\expandafter\MakeUppercase\keywa}%
317
        \@ifundefined{keywb}{}{, \keywb}%
318
        \@ifundefined{keywc}{}{, \keywc}%
319
        \@ifundefined{keywd}{}{, \keywd}%
320
        \@ifundefined{keywe}{}{, \keywe}%
321
        \@ifundefined{keywf}{}{, \keywf}%
322
        \@ifundefined{keywg}{}{, \keywg}%
323
        \@ifundefined{keywh}{}{, \keywh}%
324
        \@ifundefined{keywi}{}{, \keywi}%
325
        \@ifundefined{keywj}{}{, \keywj}%
326
}
327

328
%==============================================================================
329
% Redefinição da data (para ter mês e ano separados)
330
%==============================================================================
331
\renewcommand{\date}[2]{
332
        \gdef\@publmonth{#1}
333
        \gdef\@publyear{#2}
334
}
335
\date{\monthname}{\number\year}
336

337
%==============================================================================
338
% Definição padrão da folha de rosto.
339
% Os dados específicos do tipo de trabalho (dissertação, tese, etc.) são
340
% informados definindo-se o comando \titlepagespecificinfo. Veja os
341
% arquivos .def incluídos com a classe.
342
%==============================================================================
343

344
\newlength{\titlepagewinwidth}\setlength{\titlepagewinwidth}{95mm}
345
\newlength{\titlepagewinheight}\setlength{\titlepagewinheight}{64mm}
346
\newlength{\titlepagewinvoffset}\setlength{\titlepagewinvoffset}{112mm}
347

348
\newcommand{\location}[2]{
349
        \gdef\@city{#1}
350
        \gdef\@state{#2}
351
}
352

353
\location{Pelotas}{RS}
354

355
\renewcommand{\maketitle}{
356
\@ifundefined{@capa}{%
357
\begin{titlepage}
358
\thetitlepage
359
\end{titlepage}
360
\clearpage
361
\setcounter{page}{1}
362
}{%
363
\begin{titlepage}
364
\thecoverpage
365
\newpage
366
\thetitlepage
367
\end{titlepage}
368
\clearpage
369
\setcounter{page}{2}
370
}
371
}
372

373
\newcommand{\thecoverpage}{%
374
  \noindent%
375
  \parbox[b]{0.1\textwidth}{%
376
    \hspace{-2cm}%
377
    \includegraphics[width=3cm]{if}%
378
  }%
379
  \noindent%
380
    \parbox[b]{0.8\textwidth}{%
381
      \centering%
382
      \vskip 1cm%
383
      \MakeUppercase{\textbf{\@ministerio}}\\%
384
      \MakeUppercase{\textbf{\@secretaria}}\\%
385
      \MakeUppercase{\textbf{\@instituto}}\\%
386
      \MakeUppercase{\textbf{\@campus}}\\%
387
      \MakeUppercase{\textbf{\@thecurso}}\\%
388
      %\@unidade\\%
389
      %\@ifundefined{@nomecurso}{\@programa}{Curso de \@nomecurso}\\%
390
      \vskip 1cm%
391
      %\@documento\\%
392
      %\vskip 1cm%
393
    }%
394
  \parbox[b][][t]{0.1\textwidth}{%
395
    \includegraphics[scale=0.175]{tsi.png}%
396
  }%
397
  \noindent%
398
  \vskip 1cm%
399
  \noindent%
400
    \parbox[b]{\textwidth}{%
401
      \centering%
402
      \vskip .5cm%
403
      \textbf{{\@authora}\\
404
      \@ifundefined{@authorb}{}{\@authorb\\}%
405
      \@ifundefined{@authorc}{}{\@authorc\\}%
406
      \@ifundefined{@authord}{}{\@authord\\}}%
407
      \vskip .5cm%
408
    }%
409
  \vskip 3cm%
410
  \noindent%
411
    \parbox[b]{\textwidth}{%
412
      \centering%
413
      \vskip .5cm%
414
      \textbf{\@title}
415
      \vskip .5cm%
416
    }%
417
  \vskip 3cm%
418
  \noindent%
419
    \parbox[b]{\textwidth}{%
420
      \centering%
421
      \vskip .5cm%
422
      \textbf{\@documento}
423
      \vskip .5cm%
424
    }%
425
  \vfill%
426
  \noindent%
427
    \parbox[b]{\textwidth}{%
428
      \centering%
429
      \vskip .1cm%
430
      \textbf{\@city}\\
431
      \textbf{\ei@date}%
432
      \vskip .1cm%
433
    }%
434
}
435

436
\newcommand{\thetitlepage}{%
437
  \noindent%
438
  \parbox[b]{\textwidth}{%
439
    \centering%
440
    \@authora\\
441
    \@ifundefined{@authorb}{}{\@authorb\\}%
442
    \@ifundefined{@authorc}{}{\@authorc\\}%
443
    \@ifundefined{@authord}{}{\@authord\\}%
444
    \vskip 5cm%
445
    {\textbf{\@title}}%
446
  }
447
  \vskip 8cm%
448
  %\@ifundefined{titlepagespecificinfo}{}{%
449
    \hspace*{\fill}\makebox[.5\textwidth][l]{%
450
      \parbox[b]{8.5cm}{%
451
        \@descricaodocumento%
452
        \@ifundefined{@advisora}{}{%
453
          \vskip 1cm%
454
          \hspace{-0.25cm}
455
          \begin{tabular}{lp{.3675\textwidth}}
456
            \@ifundefined{@advisora}{}{
457
              \@ifundefined{@advisorb}{\advisorname:}{\advisorname es:} &
458
              \@ifundefined{@advisora}{}{\@advisora\\}
459
              \@ifundefined{@advisorb}{}{\ &}
460
              \@ifundefined{@advisorb}{}{\@advisorb\\}
461
              \@ifundefined{@advisorc}{}{\ &}
462
              \@ifundefined{@advisorc}{}{\@advisorc\\}
463
              \@ifundefined{@advisord}{}{\ &}
464
              \@ifundefined{@advisord}{}{\@advisord\\}}
465
            \@ifundefined{@coadvisora}{}{
466
               \@ifundefined{@coadvisorb}{\coadvisorname:}{\coadvisorname es:} &
467
               \@ifundefined{@coadvisora}{}{\@coadvisora\\}
468
              \@ifundefined{@coadvisorb}{}{\ &}
469
              \@ifundefined{@coadvisorb}{}{\@coadvisorb\\}
470
              \@ifundefined{@coadvisorc}{}{\ &}
471
              \@ifundefined{@coadvisorc}{}{\@coadvisorc\\}
472
              \@ifundefined{@coadvisord}{}{\ &}
473
              \@ifundefined{@coadvisord}{}{\@coadvisord\\}}
474
            \@ifundefined{@collaboratora}{}{
475
              \@ifundefined{@collaboratorb}{\collaboratorname:}{\collaboratorname es:} &
476
              \@ifundefined{@collaboratora}{}{\@collaboratora\\}
477
              \@ifundefined{@collaboratorb}{}{\ &}
478
              \@ifundefined{@collaboratorb}{}{\@collaboratorb\\}
479
              \@ifundefined{@collaboratorc}{}{\ &}
480
              \@ifundefined{@collaboratorc}{}{\@collaboratorc\\}
481
              \@ifundefined{@collaboratord}{}{\ &}
482
              \@ifundefined{@collaboratord}{}{\@collaboratord\\}}
483
          \end{tabular}
484
        }
485
      }
486
    }%
487
    \vfill%
488
  %}%
489
  \vfill%
490
  \centerline{\@city}%
491
  \centerline{\ei@date}%
492
}
493

494
\newcommand{\folhadeaprovacao}{%
495
  \clearpage%
496
  \noindent%
497
  \parbox[b]{\textwidth}{%
498
    \centering%
499
    \MakeUppercase{\@authora}\\%
500
    \vskip 5cm%
501
    \textbf{\MakeUppercase{\@title}}\\%
502
    \vskip 4cm%
503
  }
504
  \hspace*{\fill}\makebox[.5\textwidth][l]{%
505
    \parbox[b]{8.5cm}{%
506
      \@descricaodocumento%
507
      \@ifundefined{@advisora}{}{%
508
        \vskip 1cm%
509
        \hspace{-0.3cm}
510
        \begin{tabular}{lp{.3675\textwidth}}
511
          \@ifundefined{@advisora}{}{
512
            \@ifundefined{@advisorb}{\advisorname:}{\advisorname es:} &
513
            \@ifundefined{@advisora}{}{\@advisora\\}
514
            \@ifundefined{@advisorb}{}{\ &}
515
            \@ifundefined{@advisorb}{}{\@advisorb\\}
516
            \@ifundefined{@advisorc}{}{\ &}
517
            \@ifundefined{@advisorc}{}{\@advisorc\\}
518
            \@ifundefined{@advisord}{}{\ &}
519
            \@ifundefined{@advisord}{}{\@advisord\\}}
520
          \@ifundefined{@coadvisora}{}{
521
             \@ifundefined{@coadvisorb}{\coadvisorname:}{\coadvisorname es:} &
522
             \@ifundefined{@coadvisora}{}{\@coadvisora\\}
523
            \@ifundefined{@coadvisorb}{}{\ &}
524
            \@ifundefined{@coadvisorb}{}{\@coadvisorb\\}
525
            \@ifundefined{@coadvisorc}{}{\ &}
526
            \@ifundefined{@coadvisorc}{}{\@coadvisorc\\}
527
            \@ifundefined{@coadvisord}{}{\ &}
528
            \@ifundefined{@coadvisord}{}{\@coadvisord\\}}
529
          \@ifundefined{@collaboratora}{}{
530
            \@ifundefined{@collaboratorb}{\collaboratorname:}{\collaboratorname es:} &
531
            \@ifundefined{@collaboratora}{}{\@collaboratora\\}
532
            \@ifundefined{@collaboratorb}{}{\ &}
533
            \@ifundefined{@collaboratorb}{}{\@collaboratorb\\}
534
            \@ifundefined{@collaboratorc}{}{\ &}
535
            \@ifundefined{@collaboratorc}{}{\@collaboratorc\\}
536
            \@ifundefined{@collaboratord}{}{\ &}
537
            \@ifundefined{@collaboratord}{}{\@collaboratord\\}}
538
        \end{tabular}
539
      }
540
    }
541
  }
542
  \vskip 1cm%
543
  \hspace{-0.75cm}
544
  \parbox[b]{\textwidth}{%
545
    \centering
546
    Aprovado pela banca examinadora em: \uline{\hspace{0.75cm}}/\uline{\hspace{0.75cm}}/\uline{\hspace{1.5cm}}
547
  }
548
  \vfill%
549
  \hspace{-0.75cm}
550
  \parbox[b]{\textwidth}{%
551
    \centering%
552
    ~\uline{\hspace{0.75\textwidth}}~\\%
553
    \@advisora~-~\@instituicaoadvisor\\%
554
    \@ifundefined{orientadora}{Prof.\textordmasculine}{Prof.\textordfeminine}~\advisorname%
555
    \@ifundefined{@membroi}{}{
556
      \vskip 0.5cm%
557
      ~\uline{\hspace{0.75\textwidth}}~\\%
558
      \@membroi~-~\@instituicaomembroi\\%
559
      Membro titular\\%
560
    }
561
    \@ifundefined{@membroii}{}{
562
      \vskip 0.5cm%
563
      ~\uline{\hspace{0.75\textwidth}}~\\%
564
      \@membroii~-~\@instituicaomembroii\\%
565
      Membro titular\\%
566
    }
567
    \@ifundefined{@membroiii}{}{
568
      \vskip 0.5cm%
569
      ~\uline{\hspace{0.75\textwidth}}~\\%
570
      \@membroiii~-~\@instituicaomembroiii\\%
571
      Membro titular\\%
572
    }
573
  }
574
}
575

576
%==============================================================================
577
% Ajuste do sumário (nada indentado)
578
%==============================================================================
579

580
% Nível do sumário
581
\setcounter{tocdepth}{4}
582

583
\newlength{\ei@chapnumindent}\setlength{\ei@chapnumindent}{1.8em}
584

585
\renewcommand*{\l@chapter}[2]{
586
        \addpenalty{-\@highpenalty}
587
        \vskip -1ex \@plus\p@
588
        \setlength\@tempdima{1.5em}
589
        \begingroup
590
        \parindent \z@ \rightskip \@pnumwidth
591
        \parfillskip -\@pnumwidth
592
        \leavevmode\bfseries\sffamily
593
        \advance\leftskip\@tempdima
594
        \hskip -\leftskip
595
        \@dottedtocline{0}{0em}{\ei@chapnumindent}{\MakeUppercase{#1}}{#2}
596
        \penalty\@highpenalty
597
        \endgroup
598
}
599
\renewcommand*{\l@section}[2]
600
              {\@dottedtocline{1}{0em}{1.8em}{\MakeUppercase{#1}}{\hss #2}}
601

602
\renewcommand*{\l@subsection}[2]{\@dottedtocline{2}{0em}{2.5em}{\textbf{#1}}{#2}}
603

604
\renewcommand*{\l@subsubsection}[2]{\@dottedtocline{3}{0em}{3.5em}{\textit{#1}}{#2}}
605

606
\renewcommand*{\l@paragraph}[2]{\@dottedtocline{4}{0em}{4.25em}{\uline{#1}}{#2}}
607

608
\newif\if@aftertoc
609
\@aftertocfalse
610
\renewcommand{\tableofcontents}{%
611
        \chapter*{\contentsname}
612
        \@starttoc{toc}\@aftertoctrue%
613
}
614

615
%
616
% Anexos e apêndices
617
%
618

619
% Seção anexo
620
\newcounter{annex}% add counter
621
\renewcommand\theannex{\annexname~\@Alph\c@annex \space --}
622

623
\newcommand*\l@annex[2]{
624
        \addpenalty{-\@highpenalty}
625
        \vskip -1ex \@plus\p@
626
        \setlength\@tempdima{1.5em}
627
        \begingroup
628
        \parindent \z@ \rightskip \@pnumwidth
629
        \parfillskip -\@pnumwidth
630
        \leavevmode\bfseries\sffamily
631
        \advance\leftskip\@tempdima
632
        \hskip -\leftskip
633
        \@dottedtocline{0}{0em}{5.75em}{\MakeUppercase{#1}}{#2}
634
        \penalty\@highpenalty
635
        \endgroup
636
}
637

638
\newcommand\annexmark[1]{} % define header/footer
639
\newcommand\annex{
640
  \clearpage%
641
  \vspace*{50pt}%
642
  \@startsection{annex}{0}{0pt}{0pt}{42pt}{\centering\reset@font\ei@chapterfont\sffamily\bfseries\MakeUppercase}%
643
}
644

645
% Seção apêndice
646
\newcounter{append}% add counter
647
\renewcommand\theappend{\appendixname~\@Alph\c@append \space --}
648

649
\newcommand*\l@append[2]{
650
        \addpenalty{-\@highpenalty}
651
        \vskip -1ex \@plus\p@
652
        \setlength\@tempdima{1.5em}
653
        \begingroup
654
        \parindent \z@ \rightskip \@pnumwidth
655
        \parfillskip -\@pnumwidth
656
        \leavevmode\bfseries\sffamily
657
        \advance\leftskip\@tempdima
658
        \hskip -\leftskip
659
        \@dottedtocline{0}{0em}{7.25em}{\MakeUppercase{#1}}{#2}
660
        \penalty\@highpenalty
661
        \endgroup
662
}
663

664
\newcommand\appendmark[1]{} % define header/footer
665
\newcommand\append{
666
  \clearpage%
667
  \vspace*{50pt}%
668
  \@startsection{append}{0}{0pt}{0pt}{42pt}{\centering\reset@font\ei@chapterfont\sffamily\bfseries\MakeUppercase}%
669
}
670

671
%==============================================================================
672
% Folha de abertura de Anexos/Apêndices
673
%------------------------------------------------------------------------------
674
% A ABNT NBR 14724 pede que o conjunto de anexos (ou de apêndices) seja
675
% precedido por uma folha simples, contendo apenas "ANEXOS" ou "APÊNDICES"
676
% centralizado e em negrito, sem mais nada, distinta da folha de cada
677
% anexo/apêndice individual (que já leva "ANEXO A -- Título", produzida por
678
% \annex/\append). Use \annexescover ou \appendicescover uma vez, antes
679
% do primeiro \annex ou \append do grupo
680
%==============================================================================
681
\newcommand{\@ei@dividerpage}[1]{%
682
  \clearpage%
683
  \thispagestyle{empty}%
684
  \vspace*{\fill}%
685
  \begin{center}
686
    \reset@font\ei@chapterfont\sffamily\bfseries\MakeUppercase{#1}%
687
  \end{center}
688
  \vspace*{\fill}%
689
  \clearpage%
690
}
691

692
\newcommand{\annexescover}{\@ei@dividerpage{\annexesname}}
693
\newcommand{\appendicescover}{\@ei@dividerpage{\appendicesname}}
694

695
%==============================================================================
696
% Definição das listas de abreviaturas e siglas e de símbolos
697
%==============================================================================
698
\newenvironment{listofabbrv}[1]{
699
  \chapter*{\listabbrvname}
700
  \begin{list}{\textbf{??}}{%
701
      \settowidth{\labelwidth}{#1}%
702
      \setlength{\labelsep}{1em}%
703
      \setlength{\itemindent}{0mm}%
704
      \setlength{\leftmargin}{\labelwidth}%
705
      \addtolength{\leftmargin}{\labelsep}%
706
      \setlength{\rightmargin}{0mm}%
707
      \setlength{\itemsep}{.1\baselineskip}%
708
      \renewcommand{\makelabel}[1]{\makebox[\labelwidth][l]{##1}}%
709
    }
710
  }{
711
  \end{list}
712
}
713

714
\newenvironment{listofsymbols}[1]{
715
  \chapter*{\listsymbolname}
716
  \begin{list}{\textbf{??}}{%
717
      \settowidth{\labelwidth}{#1}%
718
      \setlength{\labelsep}{1em}%
719
      \setlength{\itemindent}{0mm}%
720
      \setlength{\leftmargin}{\labelwidth}%
721
      \addtolength{\leftmargin}{\labelsep}%
722
      \setlength{\rightmargin}{0mm}%
723
      \setlength{\itemsep}{.1\baselineskip}%
724
      \renewcommand{\makelabel}[1]{\makebox[\labelwidth][l]{##1}}%
725
    }
726
  }{
727
  \end{list}
728
}
729

730
%==============================================================================
731
% Resumo (abstract) e Abstract (englishabstract)
732
%==============================================================================
733
\renewenvironment{abstract}{%
734
  \chapter*{\abstractname}
735
}{%
736
  \par\vskip 0.5cm%
737
  \noindent\textbf{\keywordsname:} \@abstractkw.
738
}
739

740
\newenvironment{englishabstract}[1]{%
741
  \if@openright\cleardoublepage\else\clearpage\fi%
742
  \gdef\@englishkeywords{#1}%
743
  \iflanguage{english}{
744
    \begin{otherlanguage}{brazilian}
745
    }{
746
      \begin{otherlanguage}{english}
747
      }
748
      \chapter*{\abstractname}
749
    }{
750
      \par\vskip 0.5cm%
751
      \noindent\textbf{\keywordsname:} \@englishkeywords.
752
    \end{otherlanguage}
753
}
754

755
%==============================================================================
756
% Formatação dos capítulos.
757
% Os comandos \@chapter e \@schapter são redefinidos para que a
758
% numeração de páginas seja correta (deve aparecer somente a partir do
759
% primeiro capítulo do texto, mas não nas páginas iniciais de
760
% capítulos).
761
% Os comandos \@makechapterhead e \@makeschapterhead fazem a
762
% formatação dos títulos propriamente ditos.
763
%==============================================================================
764
\newcommand{\ei@chapterfont}{\@setfontsize\Large{16}{20}}
765
\def\@chapapp{}
766

767
\def\@chapter[#1]#2{%
768
	\onehalfspacing
769
  \refstepcounter{chapter}%
770
  \addcontentsline{toc}{chapter}{\protect\numberline{\@chapapp\thechapter}#1}%
771
  % Standard LaTeX chapter-grouping spacing in LoF/LoT: commented out to keep
772
  % uniform spacing between all entries regardless of chapter boundaries, since I
773
  % dunno if these are from TSI's guidelines or just copy-pasted from somewhere
774
  %\addtocontents{lof}{\protect\addvspace{10\p@}}%
775
  %\addtocontents{lot}{\protect\addvspace{10\p@}}%
776
  \pagestyle{texufpel}\let\ps@plain\ps@texufpel%
777
  \@makechapterhead{#2}\@afterheading%
778
}
779

780
\def\@makechapterhead#1{%
781
  \vspace*{50pt}%
782
  \reset@font\noindent{\ei@chapterfont\sffamily\textbf{\@chapapp\thechapter\hspace{1em}\MakeUppercase{#1}}\par}%
783
  \addvspace{42pt}%
784
  \thispagestyle{empty}%
785
}
786

787
\def\@schapter#1{%
788
  \if@aftertoc\addcontentsline{toc}{chapter}{#1}\fi%
789
  % Standard LaTeX chapter-grouping spacing in LoF/LoT: commented out to keep
790
  % uniform spacing between all entries regardless of chapter boundaries, since I
791
  % dunno if these are from TSI's guidelines or just copy-pasted from somewhere
792
  %\addtocontents{lof}{\protect\addvspace{10\p@}}%
793
  %\addtocontents{lot}{\protect\addvspace{10\p@}}%
794
  \@makeschapterhead{#1}\@afterheading%
795
}
796

797
\def\@makeschapterhead#1{%
798
  \vspace*{50pt}%
799
  \reset@font\centerline{\ei@chapterfont\sffamily\textbf{\MakeUppercase{#1}}}%
800
  \addvspace{42pt}%
801
}
802

803
%==============================================================================
804
% Formatação das seções
805
%==============================================================================
806
\setcounter{secnumdepth}{4}
807

808
\renewcommand{\section}{%
809
  \@startsection{section}{1}{0pt}{18pt}{9pt}{\reset@font\large\MakeUppercase}
810
}
811

812
\renewcommand{\subsection}{%
813
  \@startsection{subsection}{2}{0pt}{12pt}{6pt}{\reset@font\bfseries}
814
}
815

816
\renewcommand{\subsubsection}{%
817
  \@startsection{subsubsection}{3}{0pt}{12pt}{6pt}{\reset@font\itshape}
818
}
819

820
\renewcommand{\paragraph}{%
821
  \@startsection{paragraph}{4}{0pt}{12pt}{6pt}{\reset@font\uline}
822
}
823

824
\renewcommand{\subparagraph}{%
825
  \@startsection{subparagraph}{5}{0pt}{1ex}{-1em}{\reset@font\bfseries}
826
}
827

828
%==============================================================================
829
% Formatação das legendas
830
%==============================================================================
831
\renewcommand{\thefigure}{\@arabic\c@figure}
832
\renewcommand{\thetable}{\@arabic\c@table}
833

834
\counterwithout{figure}{chapter}
835
\counterwithout{equation}{chapter}
836
\counterwithout{table}{chapter}
837
% O pacote listings só cria o contador "lstlisting" dentro de um
838
% \AtBeginDocument próprio (ele decide o formato de numeração nesse
839
% momento verificando se a classe tem capítulos). Por isso o
840
% \counterwithout também precisa ser adiado da mesma forma, e registrado
841
% depois de \RequirePackage{listings} para entrar na fila após o hook
842
% do próprio pacote.
843
\AtBeginDocument{\counterwithout{lstlisting}{chapter}}
844

845
%==============================================================================
846
% Redefinição do conteúdo das listas de figuras e tabelas
847
%==============================================================================
848
\newif\if@captionlisting\@captionlistingtrue
849
\long\def\@caption#1[#2]#3{%
850
  \par
851
  \if@captionlisting%
852
    \addcontentsline{\csname ext@#1\endcsname}{#1}%
853
        {\protect\numberline{\csname fnum@#1\endcsname}{\ignorespaces #2}}%
854
  \fi%
855
  \begingroup
856
    \@parboxrestore
857
    \if@minipage
858
      \@setminipage
859
    \fi
860
    \normalsize
861
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
862
  \endgroup%
863
}
864

865
\renewcommand*{\l@figure}{\@dottedtocline{1}{0em}{5.5em}}
866
\let\l@table\l@figure
867
\let\l@lstlisting\l@figure
868

869
%==============================================================================
870
% Compatibilização do "longtable" com a Lista de Tabelas
871
%------------------------------------------------------------------------------
872
% O pacote longtable define seu próprio mecanismo de legenda (\LT@c@ption),
873
% que grava a entrada na Lista de Tabelas usando \thetable (só o número),
874
% em vez de \fnum@table ("Tabela"~+~número), diferentemente do \@caption
875
% padrão usado pelo ambiente "table" (redefinido acima). É por isso que uma
876
% "tabela normal" mostra o prefixo "Tabela" na lista, mas uma "longtable"
877
% mostra só o número, criando alinhamento/espaçamento diferente entre as
878
% entradas. O trecho abaixo corrige isso, trocando \thetable por
879
% \fnum@table para igualar ao comportamento das tabelas normais.
880
%==============================================================================
881
\RequirePackage{longtable}
882
\def\LT@c@ption#1[#2]#3{%
883
  \LT@makecaption#1\fnum@table{#3}%
884
  \def\@tempa{#2}%
885
  \ifx\@tempa\@empty\else
886
     {\let\\\space
887
     \addcontentsline{\ext@table}{table}{\protect\numberline{\fnum@table}{\ignorespaces #2}}}%
888
  \fi}
889

890
%==============================================================================
891
% Compatibilização do "listings" com a Lista de Códigos
892
%------------------------------------------------------------------------------
893
% Pelo mesmo motivo acima: o pacote listings grava sua própria entrada na
894
% Lista de Códigos usando apenas \thelstlisting (o número puro), sem passar
895
% pelo \@caption customizado da classe, então o prefixo "Código" definido em
896
% \lstlistingname nunca aparece nessa lista (só no corpo do texto). Aqui
897
% forçamos o prefixo também na lista, análogo ao que já ocorre com Figura/
898
% Tabela.
899
%==============================================================================
900
\let\oldlstlistoflistings\lstlistoflistings
901
\renewcommand{\lstlistoflistings}{%
902
  \begingroup
903
    \let\oldnumberline\numberline
904
    \renewcommand{\numberline}[1]{\oldnumberline{\lstlistingname\space##1}}%
905
    %\renewcommand{\numberline}[1]{\lstlistingname\space\oldnumberline{##1}}%
906
    \oldlstlistoflistings
907
  \endgroup
908
}
909

910
%==============================================================================
911
% Redefinição do formato de citações longas
912
%==============================================================================
913
\renewenvironment{quote}{%
914
  \small%
915
  \begin{list}{}{\setlength{\leftmargin}{40mm}\item\relax}
916
  }{%
917
  \end{list}
918
}
919

920
%==============================================================================
921
% Ajuste do formato das citações e referências
922
%==============================================================================
923
\setlength{\bibhang}{0pt}
924
\let\cite\citep
925

926
%
927
% Definições de seções restantes.
928
%
929

930
% Ficha catalográfica: Uma página temporária, somente indicando que é necessário ter a ficha catalográfica
931

932
\newcommand{\fichacatalografica}{%
933
  \clearpage%
934
  \mbox{}%
935
  \vfill
936
  \begin{center}
937
    \textbf{Insira AQUI a ficha catalogr\'afica\\(solicitada na p\'agina da biblioteca)}
938
\end{center}
939
\vfill%
940
}
941

942
% Seção de agradecimentos
943

944
\newenvironment{agradecimentos}{%
945
  \chapter*{Agradecimentos}%
946
}{%
947
}
948

949
% Seção de dedicatória
950

951
\newenvironment{dedicatoria}{%
952
  \clearpage%
953
  \mbox{}\vfill\begin{flushright}%
954
  }{%
955
  \end{flushright}%
956
}
957

958
% Seção de epígrafe
959

960
\newenvironment{epigrafe}{%
961
  \clearpage%
962
  \mbox{}\vfill\begin{flushright}%
963
  }{%
964
  \end{flushright}%
965
}