-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
ufscthesisx.cls
2792 lines (2336 loc) · 103 KB
/
ufscthesisx.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
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
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%% setup/ufscthesisx.sty
%%
%% Copyright 2017 Evandro Coan
%% Copyright 2012-2016 by abnTeX2 group at https://www.abntex.net.br/
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%% The Current Maintainer of this work is the Evandro Coan.
%%
%% The last Maintainer of this work was the abnTeX2 team, led
%% by Lauro César Araujo. Further information are available on
%% https://www.abntex.net.br/
%%
%% This work consists of the file `abntex2-ufsc.sty` renamed as follows:
%% Renamed the `abntex2.cls, v-1.9.6 laurocesar` to `setup/ufscthesisx.sty`
%%
% Define versão necessária do LaTeX
\NeedsTeXFormat{LaTeX2e}
% https://tex.stackexchange.com/questions/83484/missing-number-treated-as-zero-what-is-wrong-in-here
\errorcontextlines 10000
\makeatletter
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS BEFORE LOADING abntex2
%----------------------------------------------------------------------------------------
% For web links and paths with \path{..} and \url{https://www.python.org/downloads/}
% ftp://tug.ctan.org/pub/tex-archive/macros/latex/contrib/hyperref/doc/options.pdf
% https://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
% https://tex.stackexchange.com/questions/124049/applying-options-to-already-loaded-package
\PassOptionsToPackage{hyphens}{url}
% Use its macro adjustwidth* to extend tables out of outer text border.
% https://tex.stackexchange.com/questions/366155/how-to-write-a-table-a-little-larger-than-the-paragraphs-with-centered-columns
\PassOptionsToPackage{strict}{changepage}
% Linked footnotes are not supported inside environment `tabularx', because they
% uses the optional argument of \footnotetext
% http://ctan.sharelatex.com/tex-archive/macros/latex/contrib/hyperref/README.pdf
\PassOptionsToPackage{hyperfootnotes=false}{hyperref}
% The class `abntex2` loads the `enumitem` package with options.
% With the package option shortlabels you can use an enumerate-like syntax, where A, a, I, i and 1
% stand for \Alph*, \alph*, \Roman*, \roman* and \arabic*. This is intended mainly as a sort of
% compatibility mode with the enumerate package, and therefore the following special rule applies:
% if the very first option (at any level) is not recognized as a valid key, then it will be
% considered a label with the enumerate-like syntax.
% https://tex.stackexchange.com/questions/119919/no-spacing-between-enumerated-items-with-usepackageenumerate
\PassOptionsToPackage{shortlabels}{enumitem}
% Fixes `pdfTeX warning (ext4): destination with the same identifier (name{figure.1.1}) has been
% already used, duplicate ignored`.
%
% The `abntex2` package loads the `hyperref` package, however there are several packages which are
% required to be loaded after and before `hyperref`.
%
% https://tex.stackexchange.com/questions/1863/which-packages-should-be-loaded-after-hyperref-instead-of-before
% https://tex.stackexchange.com/questions/50846/hyperref-is-loaded-by-the-class-and-i-need-to-load-packages-that-are-supposed-t
% https://tex.stackexchange.com/questions/51094/using-beforepackage-to-load-a-package-before-hyperref-does-not-work
\RequirePackage{scrlfile}
\AfterClass{memoir}
{
\RequirePackage{float}
}
% The class `abntex2` loads the package `enumitem`, but `paralist` must be loaded before it
% https://tex.stackexchange.com/questions/162799/compilation-error-when-including-enumitem-and-paralist-packages
\AfterClass{memoir}
{
% How to make horizontal lists?
% https://tex.stackexchange.com/questions/146306/how-to-make-horizontal-lists
\RequirePackage{paralist}
}
% https://tex.stackexchange.com/questions/6529/newline-linebreak-in-message
% https://tex.stackexchange.com/questions/383054/biblatex-error-incompatible-backref-package
% https://tex.stackexchange.com/questions/115828/backreferencing-in-classicthesis-package-does-not-work
% https://tex.stackexchange.com/questions/390349/why-my-biblatex-document-is-not-accepting-utf-8-on-the-bibliography
% https://tex.stackexchange.com/questions/55478/how-to-print-out-to-log-without-affecting-anything-else-lua-print-equiv
% https://tex.stackexchange.com/questions/483570/how-to-detect-whether-passoptionstopackage-was-already-called
\ifcsname [email protected]\endcsname
\message{Have options been passed for biblatex? YES!^^J}
\else
\message{Have options been passed for biblatex? NO!^^J}
\PassOptionsToPackage{style=abnt,backend=biber,repeatfields=true,backref=true,citecounter=true}{biblatex}
\fi
\AfterClass{memoir}
{
\RequirePackage{biblatex}
}
% Package longtable must be put before hyperref and arydshln, hyperref after arydshln generates an error
% http://ctan.sharelatex.com/tex-archive/macros/latex/contrib/hyperref/README.pdf
\AfterClass{memoir}
{
\RequirePackage{longtable}
}
% https://tex.stackexchange.com/questions/391993/how-to-silence-memoir-class-warning-against-the-use-of-caption-package
\RequirePackage{silence}
\WarningFilter*{memoir}{You are using the caption package with the memoir class}
% https://tex.stackexchange.com/questions/402676/can-i-silence-a-warning-which-is-coming-from-a-file-like-bigfoot-sty
\WarningFilter*{hyperref}{Option `hyperfootnotes' has already been used}
% Prove acesso a classe 'ufscthesisx'
\ProvidesClass{setup/ufscthesisx}[2016/11/15 1.0.0 setup/ufscthesisx]
% How can I properly resolve relative paths in `\usepackage`?
% https://tex.stackexchange.com/questions/123999/how-can-i-properly-resolve-relative-paths-in-usepackage
%
% Commenting this allow to use this as a relative package, with no warnings.
% \ProvidesPackage{ufscthesisx}[2017/08/28 v0.0.1 Evandro]
%
% Repassa todos os parâmetros a classe abntex2,
\DeclareOption*{%
\PassOptionsToClass{\CurrentOption}{setup/abntex2}%
}
% https://en.wikibooks.org/wiki/LaTeX/Creating_Packages
% https://tex.stackexchange.com/questions/61487/processoptions-and-processkeyvaloptions
% https://tex.stackexchange.com/questions/12933/new-options-and-loaded-class-options-bug
% Now we'll execute any options passed in
\ProcessOptions\relax
\LoadClass{setup/abntex2}
% https://github.com/evandrocoan/ufscthesisx-light/runs/915876094?check_suite_focus=true#step:5:658
\RequirePackage{ifthen} % https://tex.stackexchange.com/questions/13866/why-is-the-ifthen-package-obsolete
\RequirePackage{ifplatform}
\RequirePackage{shellesc}
\RequirePackage{xstring}
% https://tex.stackexchange.com/questions/380799/warning-when-adding-package-minted
\StrSubstitute{\jobname}{ }{_}[\mintedjobname]
\StrSubstitute{\mintedjobname}{*}{_}[\mintedjobname]
\StrSubstitute{\mintedjobname}{"}{}[\mintedjobname]
\StrSubstitute{\mintedjobname}{'}{_}[\mintedjobname]
\ifwindows
\providecommand{\DeleteFile}[2][]{%
\ifthenelse{\equal{#1}{}}%
{\IfFileExists{#2}{\ShellEscape{del #2}}{}}%
{\IfFileExists{#1/#2}{%
\StrSubstitute{#1}{/}{\@backslashchar}[\mintedwindir]
\ShellEscape{del \mintedwindir\@backslashchar #2}}{}}}
\else
\providecommand{\DeleteFile}[2][]{%
\ifthenelse{\equal{#1}{}}%
{\IfFileExists{#2}{\ShellEscape{rm #2}}{}}%
{\IfFileExists{#1/#2}{\ShellEscape{rm #1/#2}}{}}}
\fi
\newboolean{AppMotherFuckerExists}
\newread\mintedappexistsfile
\newcommand{\TestAppMotherfuckerExists}[1]{
\ifwindows
\DeleteFile{\mintedjobname.aex}
\ShellEscape{@echo off
for \string^\@percentchar i in (#1.exe #1.bat #1.cmd)
do set > \mintedjobname.aex <nul: /p
x=\string^\@percentchar \string~$PATH:i>> \mintedjobname.aex}
%$ <- balance syntax highlighting
\immediate\openin\mintedappexistsfile\mintedjobname.aex
\expandafter\def\expandafter\@tmp@cr\expandafter{\the\endlinechar}
\endlinechar=-1\relax
\readline\mintedappexistsfile to \mintedapppathifexists
\endlinechar=\@tmp@cr
\ifthenelse{\equal{\mintedapppathifexists}{}}
{\AppMotherFuckerExistsfalse}
{\AppMotherFuckerExiststrue}
\immediate\closein\mintedappexistsfile
\DeleteFile{\mintedjobname.aex}
\else
\ShellEscape{which #1 > /dev/null 2>&1 && touch \mintedjobname.aex}
\IfFileExists{\mintedjobname.aex}
{\AppMotherFuckerExiststrue
\DeleteFile{\mintedjobname.aex}}
{\AppMotherFuckerExistsfalse}
\fi
}
\TestAppMotherfuckerExists{pygmentize}
\ifAppMotherFuckerExists
% https://tex.stackexchange.com/questions/110292/testing-for-a-documentclass-option
% https://tex.stackexchange.com/questions/514711/package-minted-warning-unexpected-value-for-option-chapterminted-is-ignored
\@ifclasswith{setup/ufscthesisx}{chapter=TITLE}{
\begingroup
\def\x#1chapter=TITLE,#2\@nil{%
\endgroup\def\@classoptionslist{#1#2}%
}\expandafter\x\@classoptionslist\@nil
}{}
\@ifclasswith{setup/ufscthesisx}{section=TITLE}{
\begingroup
\def\x#1section=TITLE,#2\@nil{%
\endgroup\def\@classoptionslist{#1#2}%
}\expandafter\x\@classoptionslist\@nil
}
\else
\PackageWarning{minted}{You must have `pygmentize' installed to use the minted package}
% \PackageError{minted}{You must have `pygmentize' installed to use the minted package}{Minted Error}
\fi
% Custom list throw LaTeX Error: Command \mycustomfiction already defined?
% https://tex.stackexchange.com/questions/388489/custom-list-throw-latex-error-command-mycustomfiction-already-defined
\RequirePackage{morewrites}
% Package csquotes Warning: Load 'inputenc' before 'csquotes'
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
% Indent the first section paragraphs
% https://tex.stackexchange.com/questions/39227/no-indent-in-the-first-paragraph-in-a-section
\RequirePackage{indentfirst}
% Is it possible to keep my translation together with original text?
% https://tex.stackexchange.com/questions/5076/is-it-possible-to-keep-my-translation-together-with-original-text
\RequirePackage{comment}
% Please tutor the usage of patchcmd and xpatch
% https://tex.stackexchange.com/questions/152773/please-tutor-the-usage-of-patchcmd-and-xpatch
\RequirePackage{xpatch}
% Why the environment ttfamily is hyphenated, but macro ttfamily is not hyphenating?
% https://tex.stackexchange.com/questions/387678/why-the-environment-ttfamily-is-hyphenated-but-macro-ttfamily-is-not-hyphenatin
\RequirePackage{letltxmacro}
% Theorem packages: which to use, which conflict?
% https://tex.stackexchange.com/questions/5599/theorem-packages-which-to-use-which-conflict
\RequirePackage{amsthm}
% Why is the ifthen package obsolete? (It is used by the abntex2 class)
% https://tex.stackexchange.com/questions/13866/why-is-the-ifthen-package-obsolete
\RequirePackage{ifthen}
% How to make section name uppercase in ToC?
% https://tex.stackexchange.com/questions/156916/how-to-make-section-name-uppercase-in-toc
\RequirePackage{textcase}
% https://tex.stackexchange.com/questions/482886/how-to-add-babel-captions-to-newfloat-package-environments
\RequirePackage{newfloat}
\RequirePackage{caption}
% How to auto adjust my last table column width, and why is there Underfull \vbox badness on this table?
% https://tex.stackexchange.com/questions/387238/how-to-auto-adjust-my-last-table-column-width-and-why-is-there-underfull-vbox/387251
%
% Why ltablex package breaks the changepage package?
% https://tex.stackexchange.com/questions/404339/why-ltablex-package-breaks-the-changepage-package
\RequirePackage{ltablex}\keepXColumns
% CONFIGURAÇÕES DE PACOTES
\newcommand{\ifnotempty}[2]{\ifthenelse{\not\equal{#1}{}}{#2}{}}
\newcommand{\ifnotdefined}[3]{\ifdefined #1 #3 \else #2 \fi}
% Comandos de dados - programa
\providecommand{\imprimirprograma}{}
\newcommand{\programa}[1]{\renewcommand{\imprimirprograma}{#1}}
\providecommand{\imprimirformacao}{}
\newcommand{\formacao}[1]{\renewcommand{\imprimirformacao}{#1}}
\providecommand{\imprimirarea}{}
\newcommand{\area}[1]{\renewcommand{\imprimirarea}{#1}}
\providecommand{\imprimirbiblioteca}{}
\newcommand{\biblioteca}[1]{\renewcommand{\imprimirbiblioteca}{#1}}
\providecommand{\imprimirinstituicaosigla}{}
\newcommand{\instituicaosigla}[1]{\renewcommand{\imprimirinstituicaosigla}{#1}}
\providecommand{\imprimirano}{}
\newcommand{\ano}[1]{\renewcommand{\imprimirano}{#1}}
\newcommand{\covername}{Capa}
% Comandos de dados - Coordenador
\newcommand{\coordenadorname}{Coordenador}
\providecommand{\imprimircoordenadorRotulo}{}
\providecommand{\imprimircoordenador}{}
\newcommand{\coordenador}[2][\coordenadorname]%
{\renewcommand{\imprimircoordenadorRotulo}{#1}%
\renewcommand{\imprimircoordenador}{#2}}
% inclui subtitulo na capa, folha de rosto e ficha catalografica
% https://github.com/lrsantos11/abntex2-ufsc/commit/fd30245353dcc49e193d281c78104afe54df9fe7
%
% Cria o comando \subtitulo. A norma define que o TITULO deve ser em caixa alta
% negrito, mas o subtitulo deve ser em caixa baixa.
\providecommand{\imprimirsubtitulo}{}
\newcommand{\subtitulo}[1]{\renewcommand{\imprimirsubtitulo}{#1}}
\newcounter{ufscthesisx@assuntos}
\providecommand{\listaassuntos}{}
\providecommand{\imprimirassuntos}
{%
\setcounter{ufscthesisx@assuntos}{1}
\@for\assunto:={\listaassuntos}\do
{%
\arabic{ufscthesisx@assuntos}.\assunto. %
\addtocounter{ufscthesisx@assuntos}{1}
}
}
\newcommand{\assuntos}[1]{\renewcommand{\listaassuntos}{#1}}
\providecommand{\imprimircentro}{}
\newcommand{\centro}[1]{\renewcommand{\imprimircentro}{#1}}
\providecommand{\imprimircampus}{}
\newcommand{\campus}[1]{\renewcommand{\imprimircampus}{#1}}
\newtheorem{axioma}{Axioma}[chapter]
\newtheorem{postulado}{Postulado}[chapter]
\newtheorem{teorema}{Teorema}[chapter]
\newtheorem{conjectura}{Conjectura}[chapter]
\newtheorem{corolario}[teorema]{Corol\'ario}
\newtheorem{lema}[teorema]{Lema}
\newtheorem{proposicao}[teorema]{Proposi\c{c}\~ao}
% Commonly used in definitions, conditions, problems and examples.
\theoremstyle{definition}
\newtheorem{definicao}{Defini\c{c}\~ao}[chapter]
\newtheorem{exemplo}{Exemplo}[section]
\newtheorem{exercicio}{Exerc\'icio}[section]
\newtheorem{condicao}{Condi\c{c}\~ao}[chapter]
\theoremstyle{remark}
\newtheorem{observacao}{Observa\c{c}\~ao}
\renewcommand{\qedsymbol}{$\blacksquare$}
% Margens
% https://tex.stackexchange.com/questions/378119/how-to-set-margins-in-memoir-class
\setlrmarginsandblock{3cm}{2cm}{*}
\setulmarginsandblock{3cm}{2cm}{*}
\checkandfixthelayout
% Fontes dos títulos e seções
% Tamanho da fonte padrão do 'ABNTEX'
% https://tex.stackexchange.com/questions/460835/set-font-size-and-line-spacing
% Set the default font size as 12pt with 1.5cm spacing between lines, 12/2 = 6, 12+6 = 18, i.e., one half spacing
% \renewcommand{\normalsize}{\fontsize{12pt}{16pt}\selectfont}
% \renewcommand{\normalsize}{\fontsize{12.0pt}{18.0pt}\selectfont}
% Caption package and Memoir
% https://groups.google.com/forum/#!topic/comp.text.tex/RzpI2ATMev0
% https://tex.stackexchange.com/questions/18931/memoir-class-with-subcaption-and-hyperref-packages
\DeclareCaptionFont{small}{\fontsize{10pt}{12pt}\selectfont}
\renewcommand{\footnotesize}{\fontsize{10pt}{12pt}\selectfont}
% Set caption font size in memoir
% https://tex.stackexchange.com/questions/58943/set-caption-font-size-in-memoir
% https://tex.stackexchange.com/questions/103566/controlling-the-spacing-between-lines-with-fontsize-selectfont
\newcommand{\ufsccaptionsize}{\fontsize{10pt}{12pt}\selectfont}
% https://latex.org/forum/viewtopic.php?t=22437
% https://tex.stackexchange.com/questions/346411/how-does-footnotesep-work-anyway
% https://tex.stackexchange.com/questions/133008/make-footnotesep-same-as-line-spacing-using-custom-thesis-class
% https://tex.stackexchange.com/questions/514592/how-can-i-see-the-line-spacing-between-lines
% https://tex.stackexchange.com/questions/514682/how-to-get-the-normalsize-or-small-font-baselineskip-size
\setlength{\footnotesep}{\f@baselineskip}
% https://tex.stackexchange.com/questions/327843/how-to-put-figure-caption-on-top
\captionnamefont{\ufsccaptionsize}
\captiontitlefont{\ufsccaptionsize}
% Paragraph size is given by
% Default value for UFSC 1.5cm
\setlength{\parindent}{1.5cm}
% Package setspace must be put before hyperref
% http://ctan.sharelatex.com/tex-archive/macros/latex/contrib/hyperref/README.pdf
% https://tex.stackexchange.com/questions/270557/undefined-control-sequence-on-onehalfspacing
% https://tex.stackexchange.com/questions/374401/setting-text-in-onehalfspacing-footnotes-singlespacing-with-memoir
\@ifclassloaded{memoir}{}{
% \SingleSpacing
\OnehalfSpacing
% \DoubleSpacing
}
% Set the UFSC epigrafe font size
% Changing font size in an example environment
% https://tex.stackexchange.com/questions/123528/changing-font-size-in-an-example-environment
\expandafter\def\expandafter\epigrafe\expandafter{\epigrafe\ufsccaptionsize}
% Selects a roman (i.e., serifed) font family
% \renewcommand{\rmdefault}{cmr}
% https://tex.stackexchange.com/questions/517223/renewcommand-familydefault-sfdefault-is-causing-%e2%86%92-to-throw-package-textcomp
\renewcommand{\familydefault}{\sfdefault}
% Fontes padroes de part, chapter, section, subsection e subsubsection
\renewcommand{\ABNTEXfontereduzida}{\fontsize{10pt}{12pt}\selectfont}
\renewcommand{\ABNTEXchapterfont}{\sffamily\fontseries{bx}\fontshape{n}\selectfont}
\renewcommand{\ABNTEXchapterfontsize}{\normalsize\selectfont}
\renewcommand{\ABNTEXpartfont}{\sffamily\fontseries{bx}\fontshape{n}\selectfont}
\renewcommand{\ABNTEXpartfontsize}{\Huge\selectfont}
\renewcommand{\ABNTEXsectionfont}{\sffamily\fontseries{m}\fontshape{n}\selectfont}
\renewcommand{\ABNTEXsectionfontsize}{\normalsize\selectfont}
\renewcommand{\ABNTEXsubsectionfont}{\sffamily\fontseries{b}\fontshape{n}\selectfont}
\renewcommand{\ABNTEXsubsectionfontsize}{\normalsize\selectfont}
\renewcommand{\ABNTEXsubsubsectionfont}{\sffamily\fontseries{m}\fontshape{n}\selectfont}
\renewcommand{\ABNTEXsubsubsectionfontsize}{\normalsize\selectfont}
\renewcommand{\ABNTEXsubsubsubsectionfont}{\sffamily\fontseries{m}\fontshape{it}\selectfont}
\renewcommand{\ABNTEXsubsubsubsectionfontsize}{\normalsize\selectfont}
% Tamanho da fonte para a epígrafe UFSC
\expandafter\def\expandafter\epigrafe\expandafter{\epigrafe\ABNTEXfontereduzida}
% Comando que simula a finalizacao de uma parte no bookmark e
% adiciona espaco de \part no sumario
\renewcommand{\phantompart}
{%
\bookmarksetup{startatroot}%
\phantomsection%
\addtocontents{toc}{\vspace{0em}}
}
% TOC Spacing in Memoir
% https://tex.stackexchange.com/questions/60317/toc-spacing-in-memoir
\setlength{\cftbeforechapterskip}{12pt}
% Fontes das entradas do sumario
% https://tex.stackexchange.com/questions/399828/how-to-make-the-table-of-contents-section-title-upper-case-without-messing-with
% https://tex.stackexchange.com/questions/156916/how-to-make-section-name-uppercase-in-toc
\let\oldcontentsline\contentsline
\def\contentsline#1#2{%
\expandafter\ifx\csname l@#1\endcsname\l@section
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
{%
\oldcontentsline{#1}{\MakeTextUppercase{#2}}%
}{%
\oldcontentsline{#1}{#2}%
}%
}
% No caso de Sumario (TOC) UFSC
%
% Memoir has another mechanism for the job: \cftsetindents{‹kind›}{indent}{numwidth}. Here kind is
% chapter, section, or whatever; the indent specifies the ‘margin’ before the entry starts; and the
% width is of the box into which the number is typeset (so needs to be wide enough for the largest
% number, with the necessary spacing to separate it from what comes after it in the line.
% http://www.tex.ac.uk/FAQ-tocloftwrong.html
%
% memoir: indentation of unnumbered sections in table of contents
% https://tex.stackexchange.com/questions/264668/memoir-indentation-of-unnumbered-sections-in-table-of-contents
%
% Memoir ToC: indent the second line by number+space width in the previous line OR set standard
% https://tex.stackexchange.com/questions/394227/memoir-toc-indent-the-second-line-by-numberspace
% `\cftlastnumwidth` and these `\cftsetindents` are defined by the abntex2 class,
% obeying the `ABNTEXsumario-abnt-6027-2012`. \newlength{\cftlastnumwidth}
\setlength{\cftlastnumwidth}{\cftsubsubsectionnumwidth}
\addtolength{\cftlastnumwidth}{1em}
% http://www.tex.ac.uk/FAQ-tocloftwrong.html
% Use \setlength\cftsectionnumwidth{4em} to override all these values
\cftsetindents{part} {0em}{\cftlastnumwidth}
\cftsetindents{chapter} {0em}{\cftlastnumwidth}
\cftsetindents{section} {0em}{\cftlastnumwidth}
\cftsetindents{subsection} {0em}{\cftlastnumwidth}
\cftsetindents{subsubsection}{0em}{\cftlastnumwidth}
\cftsetindents{paragraph} {0em}{\cftlastnumwidth}
\cftsetindents{subparagraph} {0em}{\cftlastnumwidth}
\newlength{\cftnumberboxnumberwidth}
\setlength{\cftnumberboxnumberwidth}{2em}
\renewcommand{\tocprintchapter}
{%
\addtocontents{toc}{\cftsetindents{chapter}{0em}{\cftlastnumwidth}}
}
%
\renewcommand{\tocinnonumchapter}
{%
\addtocontents{toc}{\cftsetindents{chapter}{\cftlastnumwidth}{\cftnumberboxnumberwidth}}%
\cftinserthook{toc}{A}
}
\renewcommand{\tocprintchapternonum}
{%
\addtocontents{toc}{\cftsetindents{chapter}{\cftlastnumwidth}{\cftnumberboxnumberwidth}}
}
%
\renewcommand{\tocpartapendices}
{%
\addtocontents{toc}{\cftsetindents{chapter}{\cftlastnumwidth}{\cftnumberboxnumberwidth}}
\cftinserthook{toc}{A}
}
%
\renewcommand{\tocpartanexos}
{%
\addtocontents{toc}{\cftsetindents{chapter}{\cftlastnumwidth}{\cftnumberboxnumberwidth}}
\cftinserthook{toc}{A}
}
\renewcommand{\cftpartfont}{\ABNTEXpartfont}
\renewcommand{\cftpartpagefont}{\cftpartfont}
\renewcommand{\cftchapterfont}{\ABNTEXchapterfont}
\renewcommand{\cftchapterpagefont}{\cftchapterfont}
\renewcommand{\cftsectionfont}{\ABNTEXsectionfont}
\renewcommand{\cftsectionpagefont}{\cftsectionfont}
\renewcommand{\cftsubsectionfont}{\ABNTEXsubsectionfont}
\renewcommand{\cftsubsectionpagefont}{\cftsubsectionfont}
\renewcommand{\cftsubsubsectionfont}{\ABNTEXsubsubsectionfont}
\renewcommand{\cftsubsubsectionpagefont}{\cftsubsubsectionfont}
\renewcommand{\cftparagraphfont}{\ABNTEXsubsubsubsectionfont}
\renewcommand{\cftparagraphpagefont}{\cftparagraphfont}
% Ajusta entrada Referencias
\renewcommand{\bibsection}
{%
\chapter*{\bibname}
\bibmark
\ifnobibintoc\else
\phantomsection
\addcontentsline{toc}{chapter}{\uppercase{\bibname}}
\fi
\prebibhook
}
% Espaçamento depois do título
\setlength{\afterchapskip}{0.38cm}
% Controle do espaçamento entre um parágrafo e outro. Tente também \onelineskip
\setlength{\parskip}{0.0cm}
% O tamanho do parágrafo é dado por
\setlength{\parindent}{1.0cm}
% Recuo citação
\setlength{\ABNTEXcitacaorecuo}{3cm} %4, mas abntex2 está somando 1cm
% Comando para inverter sobrenome e nome
\newcommand{\ufscthesisx@inverter}[1]
{%
\StrBehind{#1}{{}},
\StrBefore{#1}{{}}
}
% Comandos auxiliares
% https://tex.stackexchange.com/questions/514592/how-can-i-see-the-line-spacing-between-lines
\newcommand{\showfont}
{%
(\foreignlanguage{english}
{%
encoding: \f@encoding{},
family: \f@family{},
series: \f@series{},
shape: \f@shape{},
size: \f@size{},
baseline: \f@baselineskip{},
linespread: \f@linespread{},
linespacing: \the\baselineskip{}%
})%
}
% Comandos auxiliares
\newcommand{\justshowfont}
{%
(\foreignlanguage{english}
{%
\f@encoding{},
\f@family{},
\f@series{},
\f@shape{},
\f@size{},
\f@baselineskip{},%
\f@linespread{},
\the\baselineskip{}%
})%
}
%Numeração dos floats por capítulo
\counterwithin{figure}{chapter}
\counterwithin{table}{chapter}
% Macros for Cross-reference
\newcommand{\figref}[1]{Figura~\ref{#1}} % Cross-reference of figures
\newcommand{\tabref}[1]{Tabela~\ref{#1}} % Cross-reference of tables
\newcommand{\eqnref}[1]{\eqref{#1}} % Cross-reference of equations
\newcommand{\secref}[1]{Seção~\ref{#1}} % Cross-reference of equations
\newcommand{\defref}[1]{Definição~\ref{#1}} %
\renewenvironment{resumo}[1][\resumoname]
{%
% Fixed double bookmark entries as `\pretextualchapter` bellow is already calling `\PRIVATEbookmarkthis`
% \PRIVATEbookmarkthis{#1}
% \renewcommand{\abstractnamefont}{\chaptitlefont}
% \renewcommand{\abstractname}{\ABNTEXchapterupperifneeded{#1}}
\pretextualchapter{#1}
}
{%
\PRIVATEclearpageifneeded
}
% Fix the resumo environment, which does not accept paragraphs on ufscthesisx
%
% Changing font size in an example environment
% https://tex.stackexchange.com/questions/123528/changing-font-size-in-an-example-environment
%
% How to disable automatic indentation on new paragraphs?
% https://tex.stackexchange.com/questions/14375/how-to-disable-automatic-indentation-on-new-paragraphs
%
% How to disable paragraphs inside my environment with \let\par\relax?
% https://tex.stackexchange.com/questions/388369/how-to-disable-paragraphs-inside-my-environment-with-let-par-relax
\xapptocmd{\resumo}{\setlength{\parindent}{0pt}\SingleSpacing\let\parOriginal\par\let\par\relax}{}{}
\xpretocmd{\endresumo}{\endgraf}{}{}
% \imprimirpalavraschave{Palavras-chaves}{latex. abntex. editoração de texto.}
\newcommand{\imprimirpalavraschave}[2]{%
\@ifundefined{parOriginal}{}{\parOriginal}\vspace{\onelineskip}\textbf{#1}: #2
}
% Create a list of things like (\usepackage{paralist})
% \palavraschaveufsc{englishkeywordslist}{keyword 1}
% \palavraschaveufsc{englishkeywordslist}{keyword 2}
% \begin{inparaitem}[]\englishkeywordslist\end{inparaitem}
% \begin{inparaenum}\englishkeywordslist\end{inparaenum}
%
% https://tex.stackexchange.com/questions/61811/how-to-define-inparaenum-in-the-preamble
% https://tex.stackexchange.com/questions/468862/lonely-item-perhaps-a-missing-list-environment-missing-package
% https://tex.stackexchange.com/questions/188476/how-do-you-define-one-macro-with-arguments-inside-another
% https://tex.stackexchange.com/questions/191266/defining-macros-with-arguments
% https://tex.stackexchange.com/questions/65780/macro-defining-macro
% https://tex.stackexchange.com/questions/20456/removing-a-backslash-when-passing-arguments-to-newcommand
\newcommand{\palavraschaveufsc}[2]{%
\@ifundefined{#1}{%
\message{^^JNotice palavraschaveufsc: #1 is undefined with '#2'^^J}
\expandafter\newcommand\csname#1\endcsname{}
}{\message{^^JNotice palavraschaveufsc: #1 is defined with '#2'^^J}}
{\expandafter\g@addto@macro\csname#1\endcsname{\item #2. }}
\@ifundefined{#1comvirgula}{%
\message{^^JNotice palavraschaveufsc: #1 is undefined with '#2'^^J}
\expandafter\newcommand\csname#1comvirgula\endcsname{}
}{\message{^^JNotice palavraschaveufsc: #1 is defined with '#2'^^J}}
{\expandafter\g@addto@macro\csname#1comvirgula\endcsname{\item #2, }}
\@ifundefined{#1semitem}{%
\message{^^JNotice palavraschaveufsc: #1 is undefined with '#2'^^J}
\expandafter\newcommand\csname#1semitem\endcsname{}
}{\message{^^JNotice palavraschaveufsc: #1 is defined with '#2'^^J}}
{\expandafter\g@addto@macro\csname#1semitem\endcsname{#2. }}
}
% ------------------------------------------------------------------------
% ------------------------------------------------------------------------
% Configura layout
% ------------------------------------------------------------------------
% ------------------------------------------------------------------------
% ------------------------------------------------------------------------
%% criar um novo estilo incluindo logos da UFSC
% ------------------------------------------------------------------------
% Configura layout para elementos textuais, redefining the ABNT command `\textual`.
% Delete his to restore the ABNT default behavior.
\renewcommand{\textual}
{%
% Estilo original do Abntex2
\pagestyle{abntheadings}
% Remove a numeração das páginas no início dos capítulos.
% ABNT default value `{chapter}{abntchapfirst}`
\aliaspagestyle{chapter}{empty}
\nouppercaseheads
\bookmarksetup{startatroot}
}
% ------------------------------------------------------------------------
% ------------------------------------------------------------------------
% Comandos e ambientes de editoracao APENDICES e ANEXOS
% ------------------------------------------------------------------------
% ------------------------------------------------------------------------
% ---
% Imprime uma pagina de divisao no estilo parte
\renewcommand{\partpage}
{%
% \phantomsection
% \addcontentsline{toc}{part}{\appendixtocname}
\appendixpage*
}
% ---
% Impressão da Capa
\renewcommand{\imprimircapa}
{%
\begin{capa}%
\center
{%
% https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions
\includegraphics[width=1.84cm,keepaspectratio]{setup/UFSC_sigla_fundo_claro.png}
% https://tex.stackexchange.com/questions/103566/controlling-the-spacing-between-lines-with-fontsize-selectfont
{\OnehalfSpacing
\MakeTextUppercase{\imprimirinstituicao}\par
\MakeTextUppercase{\imprimircampus}\par
\MakeTextUppercase{\imprimirprograma}\par
}
}
\vfill
{\imprimirautor}
\vfill
{%
\center
{\ABNTEXchapterfont\MakeUppercase{\imprimirtitulo}}%
\ifnotempty{\imprimirsubtitulo}{{\ABNTEXchapterfont:} \par \imprimirsubtitulo}
}
\vfill
{%
\imprimirlocal\par
\imprimirano\par
}
\vspace*{1cm}
\end{capa}
}
% ---
% Conteúdo padrao da Folha de Rosto
%
% Underfull \hbox (badness 10000) message
% https://tex.stackexchange.com/questions/199635/underfull-hbox-badness-10000-message
%
% Underfull \hbox (badness …) in paragraph at lines x-y
% https://tex.stackexchange.com/questions/356110/underfull-hbox-badness-in-paragraph-at-lines-x-y
%
% How to add an empty line between paragraphs?
% https://tex.stackexchange.com/questions/135134/how-to-add-an-empty-line-between-paragraphs
\renewcommand{\folhaderostocontent}
{%
\begin{center}
{\imprimirautor}
\vspace*{\fill}\vspace*{\fill}
\begin{center}
{\ABNTEXchapterfont\MakeUppercase{\imprimirtitulo}}
\abntex@ifnotempty{\imprimirsubtitulo}{{\ABNTEXchapterfont\!:} \\ \imprimirsubtitulo}
\end{center}
\vspace*{\fill}
\abntex@ifnotempty{\imprimirpreambulo}
{%
\hspace{\textwidth}
\begin{adjustwidth*}{8cm}{}%8.5
\SingleSpacing
{\ufsccaptionsize\imprimirpreambulo}
{
\ufsccaptionsize\textbf{\imprimirorientadorRotulo:}~\imprimirorientador\par
\abntex@ifnotempty{\imprimircoorientador}
{
{\textbf{\imprimircoorientadorRotulo:}~\imprimircoorientador}%
}
}
\end{adjustwidth*}
}
\vspace*{\fill}
{%
\imprimirlocal\par
\imprimirano\par
}
\end{center}
}
% If document class is equal to something then do not use package
% https://tex.stackexchange.com/questions/46223/if-document-class-is-equal-to-something-then-do-not-use-package
\@ifclassloaded{setup/abntex2}
{
% Package hyperref Warning: Token not allowed in a PDF string?
% https://tex.stackexchange.com/questions/384885/package-hyperref-warning-token-not-allowed-in-a-pdf-string
\pdfstringdefDisableCommands{\let\uppercase\relax}
}{}
% Backward compatibility with `abntex2cite` package `\citeonline` command with the new `biblatex` package
% https://tex.stackexchange.com/questions/655/what-is-the-difference-between-def-and-newcommand
\let\citeonline\textcite
% https://tex.stackexchange.com/questions/123104/inline-citations-with-only-author-title-and-year
\DeclareCiteCommand{\citeauthortitleyear}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex
{\indexnames{labelname}%
\indexfield{indextitle}}
{}%
\printfield{labeltitle}%
\setunit{\addcomma\space}%
\printtext[bibhyperref]{%
\printnames{labelname}%
\space%
(\printfield{year})%
}%
}
{\multicitedelim}
{\usebibmacro{postnote}}
% https://tex.stackexchange.com/questions/443603/how-to-appear-subsubsection-in-chapter-in-my-list-of-contents
\setcounter{secnumdepth}{6}
\setcounter{tocdepth}{6}
%% README.md
%% Copyright 2017 Evandro Coan
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is M. Y. Name.
%
% This work consists of the files:
% 1. `README.md`,
% 2. `basic.tex`,
% 3. `commands.tex`,
% 4. `commands_list.tex`
% 5. `programming.tex`
% 6. `badboxes.tex`
% Please tutor the usage of patchcmd and xpatch
% https://tex.stackexchange.com/questions/152773/please-tutor-the-usage-of-patchcmd-and-xpatch
\usepackage{xpatch}
% Incompatible color definition when using tikz with color package
% https://tex.stackexchange.com/questions/150369/incompatible-color-definition-when-using-tikz-with-color-package
\usepackage{xcolor}
% RGB colors in absolute values from 0 to 255 by using `RGB` tag
\definecolor{darkblue}{RGB}{26,13,178}
% RGB colors in percentage notation by using `rgb` tag
\definecolor{darkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
% Increase the space around the hyphen or dash - on the table of contents
% APÊNDICE A –- SOMETHING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
%
% https://tex.stackexchange.com/questions/512916/how-to-increase-memoir-table-of-contents-spacing-between-appendix-and-its-hyphen
% https://tex.stackexchange.com/questions/49905/word-appendix-in-toc-with-memoir-class
% https://tex.stackexchange.com/questions/152773/please-tutor-the-usage-of-patchcmd-and-xpatch
% https://texfaq.org/FAQ-protect
\xpretocmd{\l@appendix}{\def\@chapapp@extrahyphenspaces{~}}
{\message{^^J^^JChapterformat patch 1 for chapternumberline could SUCCESSFULLY!^^J
% ^^J^^J^^J
}}
{\message{^^J^^JChapterformat patch 1 for chapternumberline could NOT be applied!^^J^^J^^J^^J
}}
\xpretocmd{\l@chapter}{\def\@chapapp@extrahyphenspaces{}}
{\message{^^J^^JChapterformat patch 2 for chapternumberline could SUCCESSFULLY!^^J
% ^^J^^J^^J
}}
{\message{^^J^^JChapterformat patch 2 for chapternumberline could NOT be applied!^^J^^J^^J^^J
}}
\patchcmd{\chapternumberline}{\@cftasnum}{%
\@chapapp@extrahyphenspaces%
\@chapapp@extrahyphenspaces%
\@cftasnum%
\@chapapp@extrahyphenspaces%
}
{\message{^^J^^JChapterformat patch 3 for chapternumberline could SUCCESSFULLY!^^J
% ^^J^^J^^J
}}
{\message{^^J^^JChapterformat patch 3 for chapternumberline could NOT be applied!^^J^^J^^J^^J
}}
\patchcmd{\chapternumberline}{\@cftasnumb}{%
\@cftasnumb%
\@chapapp@extrahyphenspaces%
}
{\message{^^J^^JChapterformat patch 4 for chapternumberline could SUCCESSFULLY!^^J
% ^^J^^J^^J
}}
{\message{^^J^^JChapterformat patch 4 for chapternumberline could NOT be applied!^^J^^J^^J^^J
}}
% https://tex.stackexchange.com/questions/512898/the-appendix-word-disappears-from-the-table-of-contents-when-using-include
% https://tex.stackexchange.com/questions/1050/whats-the-difference-between-newcommand-and-newcommand
\@ifclassloaded{setup/abntex2}{
\renewcommand*{\cftappendixname}{\apendicename\space\space}
}{}
% Allows putting an [H] in \begin{figure} to specify the exact location of the figure
% https://tex.stackexchange.com/questions/8625/force-figure-placement-in-text
%
% Package float must be put before hyperref
% http://ctan.sharelatex.com/tex-archive/macros/latex/contrib/hyperref/README.pdf
\usepackage{float}
% bigfoot.sty:61: Package hyperref Warning: Option `hyperfootnotes' has already been used
% https://tex.stackexchange.com/questions/402652/bigfoot-sty61-package-hyperref-warning-option-hyperfootnotes-has-already-be
\@ifpackageloaded{hyperref}{\hypersetup{hyperfootnotes=false}}{\PassOptionsToPackage{hyperfootnotes=false}{hyperref}}
\usepackage{hyperref}
% \lettrine{O}{nce} upon a time...
% \lettrine[findent=2pt]{\fbox{\textbf{T}}}{ }his thesis deals with...
%
% https://tex.stackexchange.com/questions/164298/starting-a-paragraph-with-a-big-letter
\usepackage{lettrine}
% Allows in-line images such as the example fish picture
\usepackage{wrapfig}
% How to automatically force latex to not justify the text when it is not wise?
% https://tex.stackexchange.com/questions/365801/how-to-automatically-force-latex-to-not-justify-the-text-when-it-is-not-wise
\usepackage{array,ragged2e}
% Use its macro adjustwidth* to extend tables out of outer text border.
% https://tex.stackexchange.com/questions/366155/how-to-write-a-table-a-little-larger-than-the-paragraphs-with-centered-columns
%
% The `memoir` class emulates this package, so not try to load it when using `memoir`, ifpackageloaded question
% https://tex.stackexchange.com/questions/70212/ifpackageloaded-question