eletrotupi / tcc/ monografia/textsi.clsbb846a6707c530021b78ab3a062a8b4dc7fc099b
30.9 KB | 937 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\contentsname{Sum{\'a}rio}%
156
  \def\listfigurename{Lista de Ilustra\c{c}{\~o}es}%
157
  \def\listtablename{Lista de Tabelas}%
158
  \def\figurename{Figura}%
159
  \def\tablename{Tabela}%
160
  \def\advisorname{Orientador}%
161
  \def\coadvisorname{Coorientador}%
162
  \def\collaboratorname{Colaborador}%
163
  \def\listabbrvname{Lista de Abreviaturas e Siglas}%
164
  \def\listsymbolname{Lista de S{\'\i}mbolos}%
165
  \def\annexname{Anexo}%
166
  \def\keywordsname{Palavras-chave}%
167
  \def\lstlistingname{C{\'o}digo}%
168
  \def\lstlistlistingname{Lista de C{\'o}digos}%
169
}
170

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

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

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

216
\if@english%
217
\selectlanguage{english}%
218
\AtBeginDocument{\selectlanguage{english}}%
219
\fi
220

221
%==============================================================================
222
% O uso de fonte Arial, 12 pt, é mandatório
223
%==============================================================================
224
\renewcommand*\familydefault{\sfdefault}%
225
\renewcommand{\rmdefault}{phv}%
226
\renewcommand{\sfdefault}{phv}
227

228
% Definição do espaçamento de texto
229
\setlength{\baselineskip}{1.5cm}
230

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

239

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

250
\pagestyle{empty}%
251
\let\ps@plain\ps@empty
252

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

264
\newcounter{ei@advisorcount}
265
\DeclareRobustCommand{\advisor}[3][]{
266
        \addtocounter{ei@advisorcount}{1}
267
        \expandafter\gdef\csname @advisor\alph{ei@advisorcount}last\endcsname{#2}
268
        \expandafter\gdef\csname @advisor\alph{ei@advisorcount}first\endcsname{#3}
269
        \expandafter\gdef\csname @advisor\alph{ei@advisorcount}\endcsname{#1~#3 #2}
270
}
271

272
\newcounter{ei@coadvisorcount}
273
\DeclareRobustCommand{\coadvisor}[3][]{
274
        \addtocounter{ei@coadvisorcount}{1}
275
        \expandafter\gdef\csname @coadvisor\alph{ei@coadvisorcount}last\endcsname{#2}
276
        \expandafter\gdef\csname @coadvisor\alph{ei@coadvisorcount}first\endcsname{#3}
277
        \expandafter\gdef\csname @coadvisor\alph{ei@coadvisorcount}\endcsname{#1~#3 #2}
278
}
279

280
\newcounter{ei@collaboratorcount}
281
\DeclareRobustCommand{\collaborator}[3][]{
282
        \addtocounter{ei@collaboratorcount}{1}
283
        \expandafter\gdef\csname @collaborator\alph{ei@collaboratorcount}last\endcsname{#2}
284
        \expandafter\gdef\csname @collaborator\alph{ei@collaboratorcount}first\endcsname{#3}
285
        \expandafter\gdef\csname @collaborator\alph{ei@collaboratorcount}\endcsname{#1~#3 #2}
286
}
287

288

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

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

311
\newcommand{\@abstractkw}{%
312
        \@ifundefined{keywa}{}{\expandafter\MakeUppercase\keywa}%
313
        \@ifundefined{keywb}{}{, \keywb}%
314
        \@ifundefined{keywc}{}{, \keywc}%
315
        \@ifundefined{keywd}{}{, \keywd}%
316
        \@ifundefined{keywe}{}{, \keywe}%
317
        \@ifundefined{keywf}{}{, \keywf}%
318
        \@ifundefined{keywg}{}{, \keywg}%
319
        \@ifundefined{keywh}{}{, \keywh}%
320
        \@ifundefined{keywi}{}{, \keywi}%
321
        \@ifundefined{keywj}{}{, \keywj}%
322
}
323

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

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

340
\newlength{\titlepagewinwidth}\setlength{\titlepagewinwidth}{95mm}
341
\newlength{\titlepagewinheight}\setlength{\titlepagewinheight}{64mm}
342
\newlength{\titlepagewinvoffset}\setlength{\titlepagewinvoffset}{112mm}
343

344
\newcommand{\location}[2]{
345
        \gdef\@city{#1}
346
        \gdef\@state{#2}
347
}
348

349
\location{Pelotas}{RS}
350

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

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

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

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

572
%==============================================================================
573
% Ajuste do sumário (nada indentado)
574
%==============================================================================
575

576
% Nível do sumário
577
\setcounter{tocdepth}{4}
578

579
\newlength{\ei@chapnumindent}\setlength{\ei@chapnumindent}{1em}
580

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

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

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

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

604
\newif\if@aftertoc
605
\@aftertocfalse
606
\renewcommand{\tableofcontents}{%
607
        \chapter*{\contentsname}
608
        \@starttoc{toc}\@aftertoctrue%
609
}
610

611
%
612
% Anexos e apêndices
613
%
614

615
% Seção anexo
616
\newcounter{annex}% add counter
617
\renewcommand\theannex{\annexname~\@Alph\c@annex \space --}
618

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

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

641
% Seção apêndice
642
\newcounter{append}% add counter
643
\renewcommand\theappend{\appendixname~\@Alph\c@append \space --}
644

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

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

667
%==============================================================================
668
% Definição das listas de abreviaturas e siglas e de símbolos
669
%==============================================================================
670
\newenvironment{listofabbrv}[1]{
671
  \chapter*{\listabbrvname}
672
  \begin{list}{\textbf{??}}{%
673
      \settowidth{\labelwidth}{#1}%
674
      \setlength{\labelsep}{1em}%
675
      \setlength{\itemindent}{0mm}%
676
      \setlength{\leftmargin}{\labelwidth}%
677
      \addtolength{\leftmargin}{\labelsep}%
678
      \setlength{\rightmargin}{0mm}%
679
      \setlength{\itemsep}{.1\baselineskip}%
680
      \renewcommand{\makelabel}[1]{\makebox[\labelwidth][l]{##1}}%
681
    }
682
  }{
683
  \end{list}
684
}
685

686
\newenvironment{listofsymbols}[1]{
687
  \chapter*{\listsymbolname}
688
  \begin{list}{\textbf{??}}{%
689
      \settowidth{\labelwidth}{#1}%
690
      \setlength{\labelsep}{1em}%
691
      \setlength{\itemindent}{0mm}%
692
      \setlength{\leftmargin}{\labelwidth}%
693
      \addtolength{\leftmargin}{\labelsep}%
694
      \setlength{\rightmargin}{0mm}%
695
      \setlength{\itemsep}{.1\baselineskip}%
696
      \renewcommand{\makelabel}[1]{\makebox[\labelwidth][l]{##1}}%
697
    }
698
  }{
699
  \end{list}
700
}
701

702
%==============================================================================
703
% Resumo (abstract) e Abstract (englishabstract)
704
%==============================================================================
705
\renewenvironment{abstract}{%
706
  \chapter*{\abstractname}
707
}{%
708
  \par\vskip 0.5cm%
709
  \noindent\textbf{\keywordsname:} \@abstractkw.
710
}
711

712
\newenvironment{englishabstract}[1]{%
713
  \if@openright\cleardoublepage\else\clearpage\fi%
714
  \gdef\@englishkeywords{#1}%
715
  \iflanguage{english}{
716
    \begin{otherlanguage}{brazilian}
717
    }{
718
      \begin{otherlanguage}{english}
719
      }
720
      \chapter*{\abstractname}
721
    }{
722
      \par\vskip 0.5cm%
723
      \noindent\textbf{\keywordsname:} \@englishkeywords.
724
    \end{otherlanguage}
725
}
726

727
%==============================================================================
728
% Formatação dos capítulos.
729
% Os comandos \@chapter e \@schapter são redefinidos para que a
730
% numeração de páginas seja correta (deve aparecer somente a partir do
731
% primeiro capítulo do texto, mas não nas páginas iniciais de
732
% capítulos).
733
% Os comandos \@makechapterhead e \@makeschapterhead fazem a
734
% formatação dos títulos propriamente ditos.
735
%==============================================================================
736
\newcommand{\ei@chapterfont}{\@setfontsize\Large{16}{20}}
737
\def\@chapapp{}
738

739
\def\@chapter[#1]#2{%
740
	\onehalfspacing
741
  \refstepcounter{chapter}%
742
  \addcontentsline{toc}{chapter}{\protect\numberline{\@chapapp\thechapter}#1}%
743
  % Standard LaTeX chapter-grouping spacing in LoF/LoT: commented out to keep
744
  % uniform spacing between all entries regardless of chapter boundaries, since I
745
  % dunno if these are from TSI's guidelines or just copy-pasted from somewhere
746
  %\addtocontents{lof}{\protect\addvspace{10\p@}}%
747
  %\addtocontents{lot}{\protect\addvspace{10\p@}}%
748
  \pagestyle{texufpel}\let\ps@plain\ps@texufpel%
749
  \@makechapterhead{#2}\@afterheading%
750
}
751

752
\def\@makechapterhead#1{%
753
  \vspace*{50pt}%
754
  \reset@font\noindent{\ei@chapterfont\sffamily\textbf{\@chapapp\thechapter\hspace{1em}\MakeUppercase{#1}}\par}%
755
  \addvspace{42pt}%
756
  \thispagestyle{empty}%
757
}
758

759
\def\@schapter#1{%
760
  \if@aftertoc\addcontentsline{toc}{chapter}{#1}\fi%
761
  % Standard LaTeX chapter-grouping spacing in LoF/LoT: commented out to keep
762
  % uniform spacing between all entries regardless of chapter boundaries, since I
763
  % dunno if these are from TSI's guidelines or just copy-pasted from somewhere
764
  %\addtocontents{lof}{\protect\addvspace{10\p@}}%
765
  %\addtocontents{lot}{\protect\addvspace{10\p@}}%
766
  \@makeschapterhead{#1}\@afterheading%
767
}
768

769
\def\@makeschapterhead#1{%
770
  \vspace*{50pt}%
771
  \reset@font\centerline{\ei@chapterfont\sffamily\textbf{\MakeUppercase{#1}}}%
772
  \addvspace{42pt}%
773
}
774

775
%==============================================================================
776
% Formatação das seções
777
%==============================================================================
778
\setcounter{secnumdepth}{4}
779

780
\renewcommand{\section}{%
781
  \@startsection{section}{1}{0pt}{18pt}{9pt}{\reset@font\large\MakeUppercase}
782
}
783

784
\renewcommand{\subsection}{%
785
  \@startsection{subsection}{2}{0pt}{12pt}{6pt}{\reset@font\bfseries}
786
}
787

788
\renewcommand{\subsubsection}{%
789
  \@startsection{subsubsection}{3}{0pt}{12pt}{6pt}{\reset@font\itshape}
790
}
791

792
\renewcommand{\paragraph}{%
793
  \@startsection{paragraph}{4}{0pt}{12pt}{6pt}{\reset@font\uline}
794
}
795

796
\renewcommand{\subparagraph}{%
797
  \@startsection{subparagraph}{5}{0pt}{1ex}{-1em}{\reset@font\bfseries}
798
}
799

800
%==============================================================================
801
% Formatação das legendas
802
%==============================================================================
803
\renewcommand{\thefigure}{\@arabic\c@figure}
804
\renewcommand{\thetable}{\@arabic\c@table}
805

806
\counterwithout{figure}{chapter}
807
\counterwithout{equation}{chapter}
808
\counterwithout{table}{chapter}
809
% O pacote listings só cria o contador "lstlisting" dentro de um
810
% \AtBeginDocument próprio (ele decide o formato de numeração nesse
811
% momento verificando se a classe tem capítulos). Por isso o
812
% \counterwithout também precisa ser adiado da mesma forma, e registrado
813
% depois de \RequirePackage{listings} para entrar na fila após o hook
814
% do próprio pacote.
815
\AtBeginDocument{\counterwithout{lstlisting}{chapter}}
816

817
%==============================================================================
818
% Redefinição do conteúdo das listas de figuras e tabelas
819
%==============================================================================
820
\newif\if@captionlisting\@captionlistingtrue
821
\long\def\@caption#1[#2]#3{%
822
  \par
823
  \if@captionlisting%
824
    \addcontentsline{\csname ext@#1\endcsname}{#1}%
825
        {\protect\numberline{\csname fnum@#1\endcsname}{\ignorespaces #2}}%
826
  \fi%
827
  \begingroup
828
    \@parboxrestore
829
    \if@minipage
830
      \@setminipage
831
    \fi
832
    \normalsize
833
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
834
  \endgroup%
835
}
836

837
\renewcommand*{\l@figure}{\@dottedtocline{1}{0em}{5.5em}}
838
\let\l@table\l@figure
839
\let\l@lstlisting\l@figure
840

841
%==============================================================================
842
% Compatibilização do "longtable" com a Lista de Tabelas
843
%------------------------------------------------------------------------------
844
% O pacote longtable define seu próprio mecanismo de legenda (\LT@c@ption),
845
% que grava a entrada na Lista de Tabelas usando \thetable (só o número),
846
% em vez de \fnum@table ("Tabela"~+~número), diferentemente do \@caption
847
% padrão usado pelo ambiente "table" (redefinido acima). É por isso que uma
848
% "tabela normal" mostra o prefixo "Tabela" na lista, mas uma "longtable"
849
% mostra só o número, criando alinhamento/espaçamento diferente entre as
850
% entradas. O trecho abaixo corrige isso, trocando \thetable por
851
% \fnum@table para igualar ao comportamento das tabelas normais.
852
%==============================================================================
853
\RequirePackage{longtable}
854
\def\LT@c@ption#1[#2]#3{%
855
  \LT@makecaption#1\fnum@table{#3}%
856
  \def\@tempa{#2}%
857
  \ifx\@tempa\@empty\else
858
     {\let\\\space
859
     \addcontentsline{\ext@table}{table}{\protect\numberline{\fnum@table}{\ignorespaces #2}}}%
860
  \fi}
861

862
%==============================================================================
863
% Compatibilização do "listings" com a Lista de Códigos
864
%------------------------------------------------------------------------------
865
% Pelo mesmo motivo acima: o pacote listings grava sua própria entrada na
866
% Lista de Códigos usando apenas \thelstlisting (o número puro), sem passar
867
% pelo \@caption customizado da classe, então o prefixo "Código" definido em
868
% \lstlistingname nunca aparece nessa lista (só no corpo do texto). Aqui
869
% forçamos o prefixo também na lista, análogo ao que já ocorre com Figura/
870
% Tabela.
871
%==============================================================================
872
\let\oldlstlistoflistings\lstlistoflistings
873
\renewcommand{\lstlistoflistings}{%
874
  \begingroup
875
    \let\oldnumberline\numberline
876
    \renewcommand{\numberline}[1]{\oldnumberline{\lstlistingname\space##1}}%
877
    %\renewcommand{\numberline}[1]{\lstlistingname\space\oldnumberline{##1}}%
878
    \oldlstlistoflistings
879
  \endgroup
880
}
881

882
%==============================================================================
883
% Redefinição do formato de citações longas
884
%==============================================================================
885
\renewenvironment{quote}{%
886
  \small%
887
  \begin{list}{}{\setlength{\leftmargin}{40mm}\item\relax}
888
  }{%
889
  \end{list}
890
}
891

892
%==============================================================================
893
% Ajuste do formato das citações e referências
894
%==============================================================================
895
\setlength{\bibhang}{0pt}
896
\let\cite\citep
897

898
%
899
% Definições de seções restantes.
900
%
901

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

904
\newcommand{\fichacatalografica}{%
905
  \clearpage%
906
  \mbox{}%
907
  \vfill
908
  \begin{center}
909
    \textbf{Insira AQUI a ficha catalogr\'afica\\(solicitada na p\'agina da biblioteca)}
910
\end{center}
911
\vfill%
912
}
913

914
% Seção de agradecimentos
915

916
\newenvironment{agradecimentos}{%
917
  \chapter*{Agradecimentos}%
918
}{%
919
}
920

921
% Seção de dedicatória
922

923
\newenvironment{dedicatoria}{%
924
  \clearpage%
925
  \mbox{}\vfill\begin{flushright}%
926
  }{%
927
  \end{flushright}%
928
}
929

930
% Seção de epígrafe
931

932
\newenvironment{epigrafe}{%
933
  \clearpage%
934
  \mbox{}\vfill\begin{flushright}%
935
  }{%
936
  \end{flushright}%
937
}