-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathuathesis.sty
713 lines (679 loc) · 21.7 KB
/
uathesis.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
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
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
%
% Copyright 1999, 2007, 2009 Tomás Oliveira e Silva
% Copyright 2018, 2019, 2020, 2021, 2022, 2024 Rui Antunes
%
% LaTeX template for theses at University of Aveiro by Rui Antunes.
% /~https://github.com/ruiantunes/ua-thesis-template
%
% This code is based on the original LaTeX template created by
% professor Tomás Oliveira e Silva.
% http://sweet.ua.pt/tos/TeX.html
%
%
% Rui Antunes made the following modifications:
%
% - (2024-10-28) Regarding UA logos: the "newLogo" option was removed,
% but the new logo is still used by default. The "oldLogo" option can
% be used to employ the old logo, and now it works correctly with the
% "MAP" option.
% Now, an horizontal rule is not shown in the first pages. To show
% this rule, as in the past, we can apply the "horizontalRule" option.
%
% - (2024-06-26) The \BAR macro was updated. It is now composed of six
% colored horizontal rules so that the bar can have a single color,
% two colors, or three colors.
% The scientific areas "arts+humanities" and "misc" were added.
% The green color was added for other scientific areas.
% The RGB values of Pantone colors were slightly updated and obtained
% from: https://www.coderstool.com/pantone-rgb
%
% - (2024-06-24) The widths of the 1st and 2nd columns in the \TITLE and
% \TEXT macros were updated to 47mm and 123mm respectively. Also, in
% the \TEXT macro the 2nd column is using 10pt font size by employing
% \ua@font@size3.
%
% - (2022-07-18) Fixed an issue in the \TEXT macro regarding the font
% size. Now, \ua@font@size0 is used to make sure the font size remains
% the same in the first pages.
%
% - (2022-03-09) Added the "draftPT" and "draftEN" options to show
% respectively "DOCUMENTO PROVISÓRIO" and "DRAFT DOCUMENT" in the
% first two front pages. Note that the "draft" option has the same
% behavior as the "draftPT" option.
%
% - (2022-03-09) The RGB values of the Pantone colors were adjusted to
% slightly different new values according to the values provided by
% the UA norms.
%
% - (2021-05-29) Added vertical phantom characters after "Universidade
% de Aveiro" to make sure there is always a slight vertical space
% before the horizontal rule. Rule height changed from 0.3pt to 1.0pt.
%
% - (2021-05-29) "NODEPT" (no department) option was added to remove the
% department name from the cover and the first page.
%
% - (2021-05-29) Logos are placed in the "./img/logos/" directory.
%
% Older modifications (kept for preservity):
%
% - Choosing font sizes 10pt, 11pt, or 12pt uses a better value for the
% first vertical space added in the \HEADER macro. Using a fixed 5mm
% produced a small undesirable vertical space in the first pages that
% use the \HEADER macro. These values were adjusted manully.
% https://tex.stackexchange.com/questions/154602/what-measure-in-the-text-is-it-that-is-the-font-size
%
% - "DOCUMENTO PROVISÓRIO" was changed to "DRAFT DOCUMENT". Its position
% and font color was also altered.
%
% - Package was renamed from "uaThesis" to "uathesis".
%
% - Logo figures were renamed following the kebab-case (lowercase words
% separated by hyphens).
%
% - Code formatting of this file:
% - Maximum column width set to 72 characters.
% - Two spaces are used for indentation.
% - Comments start with uppercase letter.
%
% - The "MAP" option is allowed for MAP joint doctoral programmes. The
% logos of the University of Minho and the University of Porto are
% placed.
%
% - The scientific area is now an option specifying the color bar.
% Choose from "accounting", "arts", "economy", "education",
% "engineering", "health", "humanities", and "sciences".
%
% - RGB color values were updated.
%
% - List of departments was extended. Choose from "DAO", "DBIO", "DCM",
% "DCSPT", "DECA", "DECIVIL", "DEGEIT", "DEM", "DEMAC", "DEP", "DETI",
% "DFIS", "DGEO", "DLC", "DMAT", and "DQ".
%
% - The "final" option was changed to "draft" (symmetric behavior). The
% "draft" option puts a message warning this is a provisory document.
%
% - The comma at the end of the department names was removed.
%
% - By default the new UA logo is used.
%
% References:
%
% - The norms and models of the UA theses:
% - https://www.ua.pt/en/sga/page/12786
% - https://www.ua.pt/en/sga/page/4630
%
% - List of the UA departments:
% - https://www.ua.pt/en/departamentos-escolas
%
% - MAP joint doctoral programmes:
% - http://www.map.edu.pt
%
\ProvidesPackage{uathesis}[2024/10/28 v0.7.x UA thesis]
% \ProvidesPackage{uaThesis}[2012/05/20 v0.7 UA thesis]
\usepackage{graphicx}
\usepackage{color}
\usepackage{a4wide}
%
% University logo (by default the new logo is used).
%
\def\ua@logo{img/logos/aveiro-border.pdf}
\newif\ifua@oldLogo@\ua@oldLogo@false
\DeclareOption{oldLogo}{%
\def\ua@logo{img/logos/aveiro-old.pdf}%
\ua@oldLogo@true%
}
%
% MAP joint doctoral programme.
%
\newif\ifua@MAP@\ua@MAP@false
\DeclareOption{MAP}{%
\ifua@oldLogo@
\else
\def\ua@logo{img/logos/aveiro.pdf}
\fi
\def\um@logo{img/logos/minho.pdf}%
\def\up@logo{img/logos/porto.pdf}%
\ua@MAP@true%
}
%
% If the option "horizontalRule" is given, then an horizontal rule is
% drawn in the first pages. Otherwise, no horizontal rule is shown.
%
\newif\ifua@horizontalRule@\ua@horizontalRule@false
\DeclareOption{horizontalRule}{%
\ua@horizontalRule@true%
}
%
% Use "DOCUMENTO PROVISÓRIO" or "DRAFT DOCUMENT" (draft indication) in
% the first two front pages.
%
\newif\ifua@draft@\ua@draft@false
\DeclareOption{draft}{\ua@draft@true}
\newif\ifua@draftPT@\ua@draftPT@false
\DeclareOption{draftPT}{\ua@draftPT@true}
\newif\ifua@draftEN@\ua@draftEN@false
\DeclareOption{draftEN}{\ua@draftEN@true}
%
% List of departments.
%
\DeclareOption{DAO}{%
\def\ua@textA{}%
\def\ua@textB{Departamento de Ambiente e Ordenamento}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DBIO}{%
\def\ua@textA{}%
\def\ua@textB{Departamento de Biologia}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DCM}{%
\def\ua@textA{}%
\def\ua@textB{Departamento de Ci\^encias M\'edicas}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DCSPT}{%
\def\ua@textA{Departamento de}%
\def\ua@textB{Ci\^encias Sociais, Pol\'iticas e do Territ\'orio}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DECA}{%
\def\ua@textA{}%
\def\ua@textB{Departamento de Comunica\c c\~ao e Arte}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DECIVIL}{%
\def\ua@textA{}%
\def\ua@textB{Departamento de Engenharia Civil}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DEGEIT}{%
\def\ua@textA{Departamento de}%
\def\ua@textB{Economia, Gest\~ao, Engenharia Industrial e Turismo}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DEM}{%
\def\ua@textA{}%
\def\ua@textB{Departamento de Engenharia Mec\^anica}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DEMAC}{%
\def\ua@textA{Departamento de }%
\def\ua@textB{Engenharia de Materiais e Cer\^amica}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DEP}{%
\def\ua@textA{}%
\def\ua@textB{Departamento de Educa\c c\~ao e Psicologia}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DETI}{%
\def\ua@textA{Departamento de}%
\def\ua@textB{Eletr\'onica, Telecomunica\c c\~oes e Inform\'atica}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DFIS}{%
\def\ua@textA{}%
\def\ua@textB{Departamento de F\'\i sica}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DGEO}{%
\def\ua@textA{}%
\def\ua@textB{Departamento de Geoci\^encias}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DLC}{%
\def\ua@textA{}%
\def\ua@textB{Departamento de L\'inguas e Culturas}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DMAT}{%
\def\ua@textA{}%
\def\ua@textB{Departamento de Matem\'atica}%
\def\ua@textC{}%
\def\ua@textD{}%
}
\DeclareOption{DQ}{%
\def\ua@textA{}%
\def\ua@textB{Departamento de Qu\'imica}%
\def\ua@textC{}%
\def\ua@textD{}%
}
%
% Special option for not showing any department name.
%
\DeclareOption{NODEPT}{%
\def\ua@textA{}%
\def\ua@textB{}%
\def\ua@textC{}%
\def\ua@textD{}%
}
%
% Color of the cover page top bar.
%
% Color Pantone 115 C.
\def\ua@pantone@yellow{%
\def\ua@red{253}\def\ua@green{218}\def\ua@blue{36}}
% Color Pantone 264 C.
\def\ua@pantone@lilac{%
\def\ua@red{193}\def\ua@green{167}\def\ua@blue{226}}
% Color Pantone 301 C.
\def\ua@pantone@darkblue{%
\def\ua@red{0}\def\ua@green{75}\def\ua@blue{135}}
% Color Pantone 375 C.
\def\ua@pantone@green{%
\def\ua@red{151}\def\ua@green{215}\def\ua@blue{0}}
% Color Pantone 484 C.
\def\ua@pantone@brick{%
\def\ua@red{154}\def\ua@green{51}\def\ua@blue{36}}
% Color Pantone 1505 C.
\def\ua@pantone@orange{%
\def\ua@red{255}\def\ua@green{105}\def\ua@blue{0}}
% Color Pantone 1787 C.
\def\ua@pantone@red{%
\def\ua@red{244}\def\ua@green{54}\def\ua@blue{76}}
% Color Pantone 3105 C.
\def\ua@pantone@lightblue{%
\def\ua@red{104}\def\ua@green{210}\def\ua@blue{223}}
\def\ua@white{255}
%
% Colored bars.
%
\DeclareOption{accounting}{%
\ua@pantone@darkblue%
\let\ua@redA=\ua@red\let\ua@greenA=\ua@green\let\ua@blueA=\ua@blue%
\let\ua@redB=\ua@red\let\ua@greenB=\ua@green\let\ua@blueB=\ua@blue%
\let\ua@redC=\ua@red\let\ua@greenC=\ua@green\let\ua@blueC=\ua@blue%
\ua@pantone@red%
\let\ua@redD=\ua@red\let\ua@greenD=\ua@green\let\ua@blueD=\ua@blue%
\let\ua@redE=\ua@red\let\ua@greenE=\ua@green\let\ua@blueE=\ua@blue%
\let\ua@redF=\ua@red\let\ua@greenF=\ua@green\let\ua@blueF=\ua@blue%
}
\DeclareOption{arts}{%
\ua@pantone@lilac%
\let\ua@redA=\ua@red\let\ua@greenA=\ua@green\let\ua@blueA=\ua@blue%
\let\ua@redB=\ua@red\let\ua@greenB=\ua@green\let\ua@blueB=\ua@blue%
\let\ua@redC=\ua@red\let\ua@greenC=\ua@green\let\ua@blueC=\ua@blue%
\let\ua@redD=\ua@red\let\ua@greenD=\ua@green\let\ua@blueD=\ua@blue%
\let\ua@redE=\ua@red\let\ua@greenE=\ua@green\let\ua@blueE=\ua@blue%
\let\ua@redF=\ua@red\let\ua@greenF=\ua@green\let\ua@blueF=\ua@blue%
}
\DeclareOption{arts+humanities}{%
\ua@pantone@lilac%
\let\ua@redA=\ua@red\let\ua@greenA=\ua@green\let\ua@blueA=\ua@blue%
\let\ua@redB=\ua@red\let\ua@greenB=\ua@green\let\ua@blueB=\ua@blue%
\let\ua@redC=\ua@red\let\ua@greenC=\ua@green\let\ua@blueC=\ua@blue%
\ua@pantone@darkblue%
\let\ua@redD=\ua@red\let\ua@greenD=\ua@green\let\ua@blueD=\ua@blue%
\let\ua@redE=\ua@red\let\ua@greenE=\ua@green\let\ua@blueE=\ua@blue%
\let\ua@redF=\ua@red\let\ua@greenF=\ua@green\let\ua@blueF=\ua@blue%
}
\DeclareOption{economy}{%
\ua@pantone@red%
\let\ua@redA=\ua@red\let\ua@greenA=\ua@green\let\ua@blueA=\ua@blue%
\let\ua@redB=\ua@red\let\ua@greenB=\ua@green\let\ua@blueB=\ua@blue%
\let\ua@redC=\ua@white\let\ua@greenC=\ua@white\let\ua@blueC=\ua@white%
\let\ua@redD=\ua@white\let\ua@greenD=\ua@white\let\ua@blueD=\ua@white%
\let\ua@redE=\ua@red\let\ua@greenE=\ua@green\let\ua@blueE=\ua@blue%
\let\ua@redF=\ua@red\let\ua@greenF=\ua@green\let\ua@blueF=\ua@blue%
}
\DeclareOption{education}{%
\ua@pantone@orange%
\let\ua@redA=\ua@red\let\ua@greenA=\ua@green\let\ua@blueA=\ua@blue%
\let\ua@redB=\ua@red\let\ua@greenB=\ua@green\let\ua@blueB=\ua@blue%
\let\ua@redC=\ua@red\let\ua@greenC=\ua@green\let\ua@blueC=\ua@blue%
\let\ua@redD=\ua@red\let\ua@greenD=\ua@green\let\ua@blueD=\ua@blue%
\let\ua@redE=\ua@red\let\ua@greenE=\ua@green\let\ua@blueE=\ua@blue%
\let\ua@redF=\ua@red\let\ua@greenF=\ua@green\let\ua@blueF=\ua@blue%
}
\DeclareOption{engineering}{%
\ua@pantone@brick%
\let\ua@redA=\ua@red\let\ua@greenA=\ua@green\let\ua@blueA=\ua@blue%
\let\ua@redB=\ua@red\let\ua@greenB=\ua@green\let\ua@blueB=\ua@blue%
\let\ua@redC=\ua@red\let\ua@greenC=\ua@green\let\ua@blueC=\ua@blue%
\let\ua@redD=\ua@red\let\ua@greenD=\ua@green\let\ua@blueD=\ua@blue%
\let\ua@redE=\ua@red\let\ua@greenE=\ua@green\let\ua@blueE=\ua@blue%
\let\ua@redF=\ua@red\let\ua@greenF=\ua@green\let\ua@blueF=\ua@blue%
}
\DeclareOption{health}{%
\ua@pantone@yellow%
\let\ua@redA=\ua@red\let\ua@greenA=\ua@green\let\ua@blueA=\ua@blue%
\let\ua@redB=\ua@red\let\ua@greenB=\ua@green\let\ua@blueB=\ua@blue%
\let\ua@redC=\ua@red\let\ua@greenC=\ua@green\let\ua@blueC=\ua@blue%
\let\ua@redD=\ua@red\let\ua@greenD=\ua@green\let\ua@blueD=\ua@blue%
\let\ua@redE=\ua@red\let\ua@greenE=\ua@green\let\ua@blueE=\ua@blue%
\let\ua@redF=\ua@red\let\ua@greenF=\ua@green\let\ua@blueF=\ua@blue%
}
\DeclareOption{humanities}{%
\ua@pantone@darkblue%
\let\ua@redA=\ua@red\let\ua@greenA=\ua@green\let\ua@blueA=\ua@blue%
\let\ua@redB=\ua@red\let\ua@greenB=\ua@green\let\ua@blueB=\ua@blue%
\let\ua@redC=\ua@red\let\ua@greenC=\ua@green\let\ua@blueC=\ua@blue%
\let\ua@redD=\ua@red\let\ua@greenD=\ua@green\let\ua@blueD=\ua@blue%
\let\ua@redE=\ua@red\let\ua@greenE=\ua@green\let\ua@blueE=\ua@blue%
\let\ua@redF=\ua@red\let\ua@greenF=\ua@green\let\ua@blueF=\ua@blue%
}
\DeclareOption{misc}{%
\ua@pantone@green%
\let\ua@redA=\ua@red\let\ua@greenA=\ua@green\let\ua@blueA=\ua@blue%
\let\ua@redB=\ua@red\let\ua@greenB=\ua@green\let\ua@blueB=\ua@blue%
\let\ua@redC=\ua@red\let\ua@greenC=\ua@green\let\ua@blueC=\ua@blue%
\let\ua@redD=\ua@red\let\ua@greenD=\ua@green\let\ua@blueD=\ua@blue%
\let\ua@redE=\ua@red\let\ua@greenE=\ua@green\let\ua@blueE=\ua@blue%
\let\ua@redF=\ua@red\let\ua@greenF=\ua@green\let\ua@blueF=\ua@blue%
}
\DeclareOption{sciences}{%
\ua@pantone@lightblue%
\let\ua@redA=\ua@red\let\ua@greenA=\ua@green\let\ua@blueA=\ua@blue%
\let\ua@redB=\ua@red\let\ua@greenB=\ua@green\let\ua@blueB=\ua@blue%
\let\ua@redC=\ua@red\let\ua@greenC=\ua@green\let\ua@blueC=\ua@blue%
\let\ua@redD=\ua@red\let\ua@greenD=\ua@green\let\ua@blueD=\ua@blue%
\let\ua@redE=\ua@red\let\ua@greenE=\ua@green\let\ua@blueE=\ua@blue%
\let\ua@redF=\ua@red\let\ua@greenF=\ua@green\let\ua@blueF=\ua@blue%
}
%
% Default options.
%
\ExecuteOptions{NODEPT}
\ExecuteOptions{engineering}
\ProcessOptions
%
% Used to place a six-colored bar in the title page. The \BAR macro must
% be placed inside the first argument of the \HEADER macro.
%
% Note that the bar is composed of six colored horizontal rules so that
% the bar can have a single color, two colors, or three colors.
%
\def\BAR{%
% 1st top bar (A)
\smash{\rlap{%
\textcolor[RGB]{\ua@redA,\ua@greenA,\ua@blueA}%
{\vrule width 133mm height 12.0000mm depth -11.3333mm}}}%
% 2nd top bar (B)
\smash{\rlap{%
\textcolor[RGB]{\ua@redB,\ua@greenB,\ua@blueB}%
{\vrule width 133mm height 11.3334mm depth -10.6666mm}}}%
% 1st middle bar (C)
\smash{\rlap{%
\textcolor[RGB]{\ua@redC,\ua@greenC,\ua@blueC}%
{\vrule width 133mm height 10.6667mm depth -10.0000mm}}}%
% 2nd middle bar (D)
\smash{\rlap{%
\textcolor[RGB]{\ua@redD,\ua@greenD,\ua@blueD}%
{\vrule width 133mm height 10.0001mm depth -9.3333mm}}}%
% 1st bottom bar (E)
\smash{\rlap{%
\textcolor[RGB]{\ua@redE,\ua@greenE,\ua@blueE}%
{\vrule width 133mm height 9.3334mm depth -8.6666mm}}}%
% 2nd bottom bar (F)
\smash{\rlap{%
\textcolor[RGB]{\ua@redF,\ua@greenF,\ua@blueF}%
{\vrule width 133mm height 8.6667mm depth -8.0000mm}}}}
%
% Used to include a figure in the title page. The \FIG macro must be
% placed inside the first argument of the \HEADER macro. The text of the
% macro is typeset in the space reversed for a figure, citation, or
% whatever, and must have an height plus depth that does not exceed
% 60mm.
%
\long\def\FIG#1{\smash{\rlap{\setbox0=\hbox{#1}\dimen0=137mm%
\advance\dimen0 by\ht0\lower\dimen0\box0}}}
%
% Fixed font sizes.
%
\def\ua@font@size#1{\ifcase#1
% 11pt \normalsize
\fontsize{\@xipt}{13.6}\selectfont
\or % 11pt \Large
\fontsize{\@xivpt}{18}\selectfont
\or % 11pt \Huge
\fontsize{\@xxvpt}{30}\selectfont
\or % 11pt \small
\fontsize{\@xpt}{12.5}\selectfont
\fi}
%
% Used to put the University logo on the top of a page. Should be the
% first macro inside a \TitlePage environment. Its first argument can be
% a \BAR macro call and/or a \FIG macro call; anything else that does
% not change the horizontal and vertical positions can also be used. Its
% second argument is the year of the thesis.
%
\def\ua@above#1#2{%
\rlap{\smash{\raise 10pt\hbox{\ua@font@size0\textsf{#1}}}}%
\hbox{\ua@font@size0\textsf{#2}}}
\def\ua@below#1#2{%
\rlap{\smash{\lower 10pt\hbox{\ua@font@size0\textsf{#2}}}}%
\hbox{\ua@font@size0\textsf{#1}}}
\long\def\HEADER#1#2{%
% Original value was 5mm (default font size was 11pt).
% \vspace*{5mm}%
\ifdim\f@size pt=10pt
% Correct value for 10pt.
\vspace*{5.35mm}%
\else
\ifdim\f@size pt=10.95pt
% Correct value for 11pt.
\vspace*{5mm}%
\else
% Correct value for 12pt.
\vspace*{4.65mm}%
\fi
\fi
\noindent\ua@font@size0%
\rlap{\parbox{\textwidth}{%
\ua@font@size0\hspace*{77mm}#1%
\textsf{\textbf{Universidade de Aveiro}}%
%
% To keep a slight vertical space between the text and the hrule.
%
\vphantom{gjpqy}%
\space\space\ua@above{\ua@textA}{\ua@textB}%
\iffalse
\hrule width \textwidth height 1.0pt depth 0mm\relax%
\else
\begingroup
% pdflatex apparently draws the logo before the hrule (why?), so
% we need to split the hrule in two.
\ifua@horizontalRule@
\else
\color{white}
\fi
\ifua@MAP@
\hrule width 30mm height 1.0pt depth 0mm\relax%
\else
\hrule width 66mm height 1.0pt depth 0mm\relax%
\fi
\vskip -1.0pt%
\nointerlineskip\moveright 75.2mm%
\vbox{\hrule width 134.8mm height 1.0pt depth 0mm}%
\nointerlineskip%
\endgroup
\fi
\ua@font@size0\hspace*{77mm}%
\rlap{\ua@font@size0\textsf{\textbf{\strut #2}}}%
\hphantom{\ua@font@size0\textsf{\textbf{Universidade de Aveiro}}}%
\space\space\ua@below{\ua@textC}{\ua@textD}}%
}\par%
\ifua@MAP@
\ua@font@size0\vspace*{-8.8mm}\noindent\hspace*{32mm}%
\ifua@oldLogo@
\hskip-0.4mm\raisebox{-1.272mm}{\includegraphics[height=6.31mm]{\ua@logo}}\hspace*{2mm}%
\else
\includegraphics[height=5mm]{\ua@logo}\hspace*{2mm}%
\fi
\includegraphics[height=5mm]{\um@logo}\hspace*{2mm}%
\includegraphics[height=5mm]{\up@logo}%
\else
\ua@font@size0\vspace*{-8.8mm}\noindent\hspace*{67mm}%
\includegraphics[height=9mm]{\ua@logo}%
\fi
\ifua@draft@
\smash{%
\rlap{%
\kern -25mm%
\lower 30mm%
\hbox{%
\color{red}%
\Huge\textsf{\textbf{DOCUMENTO PROVISÓRIO}}%
}%
}%
}%
\else
\ifua@draftPT@
\smash{%
\rlap{%
\kern -25mm%
\lower 30mm%
\hbox{%
\color{red}%
\Huge\textsf{\textbf{DOCUMENTO PROVISÓRIO}}%
}%
}%
}%
\else
\ifua@draftEN@
\smash{%
\rlap{%
\kern -10mm%
\lower 30mm%
\hbox{%
\color{red}%
\Huge\textsf{\textbf{DRAFT DOCUMENT}}%
}%
}%
}%
\fi
\fi
\fi
\par\vspace*{40mm}}
%
% Used to put the thesis title in the page. Must be placed immediately
% after the \HEADER macro. The first argument is the author's name and
% the second argument is the thesis title.
%
\long\def\TITLE#1#2{%
\noindent\hspace*{15mm}%
\parbox[t]{47mm}{%
\raggedright%
\ua@font@size1\textsf{\textbf{#1}}%
}%
\hspace*{10mm}%
\parbox[t]{123mm}{%
\raggedright%
\ua@font@size1\textsf{\textbf{#2}}%
}%
\par%
}
%
% Used to put text in the page. The first argument is the left hand side
% text (may be empty) and the second argument is the right hand side
% text. Use either one \TEXT macro call per paragraph or put all
% paragraphs in one \TEXT macro call.
%
\long\def\TEXT#1#2{%
\noindent\hspace*{15mm}%
\parbox[t]{47mm}{%
\raggedright\sloppy%
\ua@font@size0\textsf{#1}%
}%
\hspace*{10mm}%
\parbox[t]{123mm}{%
\ua@font@size3\textsf{#2}%
}%
\par\medskip%
}
%
% The environment used to build a special page.
%
\def\TitlePage{\newpage\begingroup
\hoffset=-1in%
\voffset=-1in%
\oddsidemargin=0mm%
\evensidemargin=0mm%
\topmargin=0mm%
\headheight=0mm%
\headsep=0mm%
\textwidth=210mm%
% \textheight=297mm%
\paperwidth=210mm%
\paperheight=297mm%
\footskip=0mm%
\maxdepth=0mm%
\hsize=210mm%
\vsize=297mm%
\titlepage}
\def\EndTitlePage{\endtitlepage\endgroup\newpage}
%
% Used to place a 3mm grid in the page (useful for positioning things).
% This macro works correctly when the PostScript file is generated by
% dvips. Perfect for ghostscript (gv), but very bad when printed. For
% debugging purposes.
%
\iftrue\def\GRID{\special{"gsave initmatrix 72 25.4 div dup scale
0 setlinewidth 0.8 setgray newpath
0 3 210 { 0 moveto 0 297 rlineto } for
0 3 297 { 0 exch moveto 210 0 rlineto } for stroke
1 0 0 setrgbcolor newpath
15 0 moveto 15 297 lineto 77 0 moveto 77 297 lineto
0 293 moveto 210 293 lineto 0 289 moveto 210 289 lineto
0 239 moveto 210 239 lineto
0 148 moveto 210 148 lineto 0 88 moveto 210 88 lineto
77 88 moveto 77 148 lineto 137 88 moveto 137 148 lineto stroke
grestore}}
\fi
%
% Always indent the first paragraph.
%
\let\@afterindentfalse=\@afterindenttrue\@afterindenttrue
%
% Mark (or not) all horizontal overfull boxes.
%
\ifua@draft@
\setlength\overfullrule{5mm}
\else
\ifua@draftPT@
\setlength\overfullrule{5mm}
\else
\ifua@draftEN@
\setlength\overfullrule{5mm}
\else
\setlength\overfullrule{0mm}
\fi
\fi
\fi
%
% Add all chapters without numbers (\chapter*) to the table of contents.
% As a consequence, the bibliography, table of contents, list of figures
% and list of tables appear in the table of contents.
%
% Good for the report and book classes.
%
\def\@makeschapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 40\p@
% New stuff.
% To make the hyperref package do the right thing.
\refstepcounter{section}%
\addcontentsline{toc}{chapter}{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
% End of new stuff.
}}
\endinput