forked from NREL/latex_editing
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcorporateIdentity.sty
959 lines (830 loc) · 28.9 KB
/
corporateIdentity.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
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
% -------------------------------------------------------------
% Identification Part
% -------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{corporateIdentity}
\typeout{ }
\typeout{corporateIdentity.sty -- v1.4, Last Updated January 26, 2020}
\typeout{Format different types of document to a common corporate identity}
\typeout{ }
% -------------------------------------------------------------
% For more information
% -------------------------------------------------------------
% https://www.sharelatex.com/learn/Writing_your_own_class
% https://tex.stackexchange.com/questions/71341/base-a-class-on-another-class
% https://tex.stackexchange.com/questions/250159/how-to-pass-title-or-other-parameter-to-class-file
% -------------------------------------------------------------
% Check Loaded Packages
% -------------------------------------------------------------
\RequirePackage[l2tabu, orthodox]{nag}
% -------------------------------------------------------------
% Get and process inputs for this Class
% -------------------------------------------------------------
% see https://tex.stackexchange.com/questions/109194/boolean-switch-for-conditional-statement-after-its-definition?rq=1
\RequirePackage{xifthen}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
family = CI,
prefix = CI@
}
% read corporate styling from an external file
\input{corporateconfig.tex}
% -- default appearance--
% blackLinks; print links in black [T/F]
\newboolean{IsBlackLinks}
\DeclareBoolOption[false]{blackLinks}
% compactLayout; keep things compact [T/F]
\newboolean{IsCompactLayout}
\DeclareBoolOption[false]{compactLayout}
% draft; suppress images, add `draft' watermark [T/F]
\newboolean{IsDraft}
\DeclareBoolOption[false]{draft}
% logo; use logo [T/F]
\newboolean{IsLogo}
\DeclareBoolOption[true]{logo}
% cover page [T/F]
\newboolean{MakeFrontCover}
\DeclareBoolOption[false]{frontcover}
% -------------------------------------------------------------
% Process Options
% -------------------------------------------------------------
% execute options and set defaults
\ExecuteOptions{%
blackLinks=true,
compactLayout=false,
draft=false,
logo=true,
logoPath=logo.png,
CoverLogoPath=logo_big.png,
frontcover=false}
\ProcessKeyvalOptions{CI}
% blackLinks
\ifCI@blackLinks
\setboolean{IsBlackLinks}{true}
\else
\setboolean{IsBlackLinks}{false}
\fi
% compactLayout
\ifCI@compactLayout
\setboolean{IsCompactLayout}{true}
\else
\setboolean{IsCompactLayout}{false}
\fi
% draft
\ifCI@draft
\setboolean{IsDraft}{true}
\else
\setboolean{IsDraft}{false}
\fi
% logo
\ifCI@logo
\setboolean{IsLogo}{true}
\else
\setboolean{IsLogo}{false}
\fi
% logo path
% uses default or input value directly
% custom cover
\ifCI@frontcover
\setboolean{MakeFrontCover}{true}
\else
\setboolean{MakeFrontCover}{false}
\fi
% use the custom cover anyway on reports
\@ifclassloaded{report}{
% is report
\setboolean{MakeFrontCover}{true}
}{
% not report
}
% -------------------------------------------------------------
% Define and set some more booleans
% -------------------------------------------------------------
% check to see if we are using a document style that is based on the article class
\newif\if@tempIsArtcl
\@tempIsArtclfalse
\@ifclassloaded{article}{\@tempIsArtcltrue}{}
\@ifclassloaded{scrartcl}{\@tempIsArtcltrue}{}
\if@tempIsArtcl
\typeout{...Applying article formatting.}
\fi
% check to see if we have a document style that includes chapters
\newif\if@tempHasChapters
\@tempHasChaptersfalse
\@ifclassloaded{letter}{\@tempHasChaptersfalse}{}
\@ifclassloaded{article}{\@tempHasChaptersfalse}{}
\@ifclassloaded{scrartcl}{\@tempHasChaptersfalse}{}
\@ifclassloaded{report}{\@tempHasChapterstrue}{}
% -------------------------------------------------------------
% Sub Title
% -------------------------------------------------------------
% subtitle is defined in the scrartcl class and should be defined
% for other classes for compatibility
\providecommand{\subtitle}{}
\providecommand{\@subtitle}{}
\renewcommand\@subtitle{}
\renewcommand\subtitle[1]{\renewcommand\@subtitle{#1}}
% -------------------------------------------------------------
% Short Title
% -------------------------------------------------------------
\newcommand\@shorttitle{}
\newcommand\shorttitle[1]{\renewcommand\@shorttitle{#1}}
% -------------------------------------------------------------
% Set Document Language
% -------------------------------------------------------------
\RequirePackage[american]{babel}
% -------------------------------------------------------------
% Set Margins
% -------------------------------------------------------------
\ifthenelse{\boolean{IsCompactLayout}}%
{%true code%
\RequirePackage[head=10mm,%
top=10mm,%
bottom=20mm,%
inner=15mm,%
outer=15mm,%
headheight=26pt,%
includeheadfoot]{geometry}
% set the gap between columns
\setlength{\columnsep}{10mm}
}%
{%false code%
\RequirePackage[head=10mm,%
top=10mm,%
bottom=20mm,%
inner=20mm,%
outer=20mm,
headheight=26pt,%
includeheadfoot]{geometry}
% set the gap between columns
\setlength{\columnsep}{10mm}
}%
% -------------------------------------------------------------
% Fonts and Symbols
% -------------------------------------------------------------
% Chose font
\RequirePackage[default,scale=0.95]{opensans}
\normalfont
% set font encodings
\RequirePackage[T1]{fontenc}
% define some custom font weights and types
% using concept set out at https://tex.stackexchange.com/questions/203771/use-open-sans-light-as-a-default-font-in-moderncv
\DeclareRobustCommand\ebseries{\fontseries{eb}\selectfont} % extrabold
\DeclareRobustCommand\sbseries{\fontseries{sb}\selectfont} % semibold
\DeclareRobustCommand\ltseries{\fontseries{l}\selectfont} % light
\DeclareRobustCommand\clseries{\fontseries{cl}\selectfont} % condensed light
\DeclareTextFontCommand{\texteb}{\ebseries}
\DeclareTextFontCommand{\textsb}{\sbseries}
\DeclareTextFontCommand{\textlt}{\ltseries}
\DeclareTextFontCommand{\textcl}{\clseries}
% ams math
\RequirePackage{amsfonts,amssymb,amsmath}
% gensymb. Required for degrees symbol
\RequirePackage{textcomp}
\RequirePackage{gensymb}
% -------------------------------------------------------------
% Corporate Identity Colours
% -------------------------------------------------------------
\RequirePackage{color}
\RequirePackage{xcolor}
% see example of colors here https://tex.stackexchange.com/questions/18008/use-css-style-color-specifications-in-xcolor
% we now have to associate the colors that we defined in corporateconfig.tex
% with color names.
\definecolor{MainColor}{HTML}{\CI@MainColor}
\definecolor{AccentColorA}{HTML}{\CI@AccentColorA}
\definecolor{AccentColorB}{HTML}{\CI@AccentColorB}
% set normal text color
\definecolor{BodyTextColor}{HTML}{\CI@BodyTextColor}
\color{BodyTextColor}
% set colors for the front cover box and text
\definecolor{coverTitleBoxColor}{HTML}{\CI@CoverTitleBoxColor}
\definecolor{coverTitleBoxTextColor}{HTML}{\CI@CoverTitleBoxTextColor}
% set color for the title
\definecolor{TitleTextColor}{HTML}{\CI@TitleTextColor}
% set heading colors; note that we have to hand in the name of the color (e.g., main, acccent...), not the color itself
\definecolor{ChapterHeadingColor}{HTML}{\CI@ChapterHeadingColor}
\definecolor{SectionHeadingColor}{HTML}{\CI@SectionHeadingColor}
\definecolor{SubSectionHeadingColor}{HTML}{\CI@SubSectionHeadingColor}
\definecolor{SubSubSectionHeadingColor}{HTML}{\CI@SubSubSectionHeadingColor}
\definecolor{ParagraphHeadingColor}{HTML}{\CI@ParagraphHeadingColor}
\definecolor{SubParagraphHeadingColor}{HTML}{\CI@SubParagraphHeadingColor}
\newcommand{\headlinecolor}{\normalcolor}
% set link colors
\ifthenelse{\boolean{IsBlackLinks}}{ % true
% define the links so that they are the same color as the text
\definecolor{IntLinkColor}{HTML}{\CI@BodyTextColor}
\definecolor{ExtLinkColor}{HTML}{\CI@BodyTextColor}
}{% false
\definecolor{IntLinkColor}{HTML}{\CI@IntLinkColor}
\definecolor{ExtLinkColor}{HTML}{\CI@ExtLinkColor}
}
% Header and footer colours
\definecolor{HeaderColor}{HTML}{\CI@HeaderColor}
\definecolor{FooterColor}{HTML}{\CI@FooterColor}
% -------------------------------------------------------------
% Appearance
% -------------------------------------------------------------
% better tables
\RequirePackage{booktabs}
% For including figures, ignoring the draft status
\RequirePackage[final]{graphicx}
% To stop hyphenation in titles etc
\RequirePackage{hyphenat}
% spacing
\RequirePackage{setspace}
\RequirePackage{parskip}
% to-do notes
\RequirePackage{todonotes}
% code listings
\RequirePackage{listings}
\lstset{basicstyle=\ttfamily}
% -------------------------------------------------------------
% Bibliography
% -------------------------------------------------------------
\RequirePackage[babel]{csquotes}
\ifthenelse{\boolean{IsCompactLayout}}%
{%true code%
% Use numeric style for the bibliography
\RequirePackage[style=numeric,%
firstinits=true,
terseinits=true,
backend=bibtex,%
natbib=true,%
bibencoding=inputenc,%
sorting=nyt,%
url = false,%
doi=true,%
isbn = false,%
maxbibnames = 3,%
maxcitenames = 3]{biblatex}
% suppress page numbers in the bibliography
\AtEveryBibitem{%
\clearfield{pages}%
}
% reduce the font size in the bibliography
\renewcommand*{\bibfont}{\small}
}%
{%false code%
% Use author-date style for the bibliography
\RequirePackage[style=chicago-authordate,%
strict,%
terseinits=true,
backend=bibtex,%
natbib=true,%
bibencoding=inputenc,%
sorting=nyt,%
doi=true,%
maxbibnames = 10,%
maxcitenames = 3]{biblatex}
}%
% change the name of the bib (see http://tex.stackexchange.com/questions/82993/how-to-change-the-name-of-document-elements-like-figure-contents-bibliogr)
\DefineBibliographyStrings{american}{%
bibliography = {References},
}
% technical reports
\DeclareBibliographyAlias{techreport}{book}
% make one type of publication look like another
\DeclareBibliographyAlias{*}{misc} % map unknown bibliography entry types to the misc type
% make sure URLs in the bibliography are shown in roman fonts
\urlstyle{same}
% etoolbox (for \AfterEndPreamble}
\RequirePackage{etoolbox}
% text alignment
% Load ragged2e so \justifying and environment justify are available.
% Redefines \centering, \raggedleft, and \raggedright, and environments center flushleft and flushright to use versions made by ragged2e. Sets default alignment to ragged right. To override, use the command \justifying or the environment justify.
\RequirePackage[newcommands,document]{ragged2e}
%This changes parindent to 0
\setlength{\RaggedRightRightskip}{0pt plus 3em}
% -------------------------------------------
% Changes to TOC and list of figures/tables
% -------------------------------------------
% improved table of contents and list of figures/tables
\RequirePackage{tocloft}
% remove numbering on bibliography but still allow in TOC
\RequirePackage[nottoc,%
notlot,
notlof]{tocbibind}
% add Figure before # and a period after
\renewcommand{\cftfigfont}{Figure }
\renewcommand{\cfttabfont}{Table }
\renewcommand{\cftfigaftersnum}{.}
\renewcommand{\cfttabaftersnum}{.}
% Set the headings for the TOC to be the same colors as section or chapter headings
\if@tempHasChapters
% code for report
\renewcommand{\cfttoctitlefont}{\color{SectionHeadingColor} \raggedright \fontsize{14}{16}\sbseries}
\renewcommand{\cftloftitlefont}{\color{SectionHeadingColor} \raggedright \fontsize{14}{16}\sbseries}
\renewcommand{\cftlottitlefont}{\color{SectionHeadingColor} \raggedright \fontsize{14}{16}\sbseries}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\else
% code for article
\renewcommand{\cfttoctitlefont}{\color{SectionHeadingColor} \raggedright \fontsize{12}{14}\sbseries}
\renewcommand{\cftloftitlefont}{\color{SectionHeadingColor} \raggedright \fontsize{12}{14}\sbseries}
\renewcommand{\cftlottitlefont}{\color{SectionHeadingColor} \raggedright \fontsize{12}{14}\sbseries}
\fi
% add dotfill in toc
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
% remove indentation in the table of contents
\setlength{\cftfigindent}{0pt}
\setlength{\cfttabindent}{0pt}
% don't add extra spaces in list of figures between chapters
\newcommand*{\noaddvspace}{\renewcommand*{\addvspace}[1]{}}
\addtocontents{lof}{\protect\noaddvspace}
\addtocontents{lot}{\protect\noaddvspace}
\setlength{\cftbeforefigskip}{5pt}
\setlength{\cftbeforetabskip}{5pt}
\setlength{\cftaftertoctitleskip}{\baselineskip}
\setlength{\cftafterloftitleskip}{\baselineskip}
\setlength{\cftafterlottitleskip}{\baselineskip}
% add front matter etc
\newcommand{\frontmatter}{\textbf{Error defining front matter!}}
\newcommand{\mainmatter}{\textbf{Error defining main matter!}}
\newcommand{\backmatter}{\textbf{Error defining back matter!}}
% -------------------------------------------
% Article Title
% -------------------------------------------
\if@tempIsArtcl
% change the color of the title in the article class
\patchcmd{\@maketitle}% <cmd>
{\@title}% <search>
{\color[HTML]{\@titlecolor}\@title}% <replace>
{}{}% <success><failure>
\newcommand{\@titlecolor}{\CI@TitleTextColor}
\newcommand{\titlecolor}[1]{\renewcommand{\@titlecolor}{#1}}
\else
\fi
%-----------------------
% SECTION HEADING FORMATTING
%-----------------------
% Assign numbers to headings chapter through subparagraph
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
% Chapter Headings
\if@tempHasChapters
% code for report
\renewcommand{\@makechapterhead}[1]{%
{\color{ChapterHeadingColor} \parindent \z@ \raggedright \normalfont \interlinepenalty\@M
\ifnum \c@secnumdepth >\m@ne
\fontsize{14}{20}\sbseries
\thechapter \hspace*{1em}#1
\else
\fontsize{14}{20}\sbseries #1
\fi
\par\nobreak
\vspace*{12pt}}}
\renewcommand{\@makeschapterhead}[1]{%
{\color{ChapterHeadingColor} \parindent \z@ \raggedright \normalfont \interlinepenalty\@M
\fontsize{14}{20} \sbseries #1
\par\nobreak
\vspace*{12pt}}}
\fi
% Section Headings
\ifthenelse{\boolean{IsCompactLayout}}%
{%true code%
% Using "compactLayout". Need to reduce spacing around headings
\renewcommand{\section}{%
\@startsection{section}{1}{\z@}
{6pt}
{3pt}
{\color{SectionHeadingColor}\fontsize{12}{6}\sbseries}}
\renewcommand{\subsection}{%
\@startsection{subsection}{2}{\z@}
{3pt}
{1pt}
{\color{SubSectionHeadingColor}\normalsize\sbseries}}
\renewcommand{\subsubsection}{%
\@startsection{subsubsection}{3}{\z@}
{3pt}
{1pt}
{\color{SubSubSectionHeadingColor}\normalsize\sbseries\itshape}}
\renewcommand{\paragraph}{%
\@startsection{paragraph}{4}{\z@}
{0pt}
{-6pt}
{\color{ParagraphHeadingColor}\normalsize\itshape}}
\renewcommand{\subparagraph}{%
\@startsection{subparagraph}{5}{\z@}
{-0.25ex \@plus -1ex \@minus -.2ex}
{0.25ex \@plus .2ex}
{\color{SubParagraphHeadingColor}\normalsize\itshape}}
}%
{%false code%
% set slightly wider spacing around the section headings.
\renewcommand{\section}{%
\@startsection{section}{1}{\z@}
{12pt}
{6pt}
{\color{SectionHeadingColor}\fontsize{12}{12}\sbseries}}
\renewcommand{\subsection}{%
\@startsection{subsection}{2}{\z@}
{6pt}
{3pt}
{\color{SubSectionHeadingColor}\normalsize\sbseries}}
\renewcommand{\subsubsection}{%
\@startsection{subsubsection}{3}{\z@}
{3pt}
{3pt}
{\color{SubSubSectionHeadingColor}\normalsize\sbseries\itshape}}
\renewcommand{\paragraph}{%
\@startsection{paragraph}{4}{\z@}
{0pt}
{-6pt}
{\color{ParagraphHeadingColor}\normalsize\itshape}}
\renewcommand{\subparagraph}{%
\@startsection{subparagraph}{5}{\z@}
{-3.25ex \@plus -1ex \@minus -.2ex}
{0.25ex \@plus .2ex}
{\color{SubParagraphHeadingColor}\normalsize\itshape}}
}%
% inherit fonts etc from TOC
\let\printlottitle\printtoctitle
\let\printloftitle\printtoctitle
%-----------------------
% CAPTION FORMATTING
%-----------------------
% see e.g. http://www.peteryu.ca/tutorials/publishing/latex_captions for details of how to adjust
\RequirePackage[format=plain,
labelformat=simple,
font={small,bf},
labelfont={small,bf},
textfont={small,bf},
indention=0cm,
labelsep=period,
justification=centering,
singlelinecheck=true,
tableposition=top,
figureposition=bottom]{caption}
\RequirePackage{subcaption}
% Reports include the chapter number in figure and table labels
\if@tempHasChapters
\numberwithin{table}{chapter}
\numberwithin{figure}{chapter}
\fi
% --------------------
% FOOTNOTE FORMATTING
% --------------------
\ifthenelse{\boolean{IsCompactLayout}}%
{%true code%
% Use symbols for footnotes (conflicts with numbered citations, otherwise)
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
}%
{%false code%
}%
% ---------------
% FORMATTING IN DIFFERENT PARTS / CHAPTERS
% ---------------
% We can define \frontmatter, \mainmatter, and \backmatter for all types of document.
% There is also an appendix.
% specific formatting for different classes
\if@tempHasChapters
% Figure and table numbering should include chapter
\numberwithin{table}{chapter}
\numberwithin{figure}{chapter}
% front matter
\renewcommand{\frontmatter}{%
\pagenumbering{roman} %
\setcounter{page}{1} %
\setcounter{figure}{0} %
%\renewcommand{\thefigure}{\Alph{figure}} %
\setcounter{table}{0} %
%\renewcommand{\thetable}{\Alph{table}}
}
% main matter
\renewcommand{\mainmatter}{%
\clearpage %
\pagenumbering{arabic} %
\setcounter{figure}{0} %
\setcounter{table}{0}
}
% appendix
\renewcommand\appendix{\par
\setcounter{chapter}{0}
\setcounter{section}{0}
\setcounter{footnote}{0}
\gdef\thechapter{\@Alph\c@chapter}
% footnote formatting
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
}
% back matter
\renewcommand{\backmatter}{\par
\setcounter{section}{0}
\setcounter{footnote}{0}
\gdef\thesection{\@Alph\c@chapter}
% footnote formatting
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
}
\else
% figure and table number restarts and changes at the frontmatter, mainmatter, and backmatter.
% front matter
\renewcommand{\frontmatter}{%
\pagenumbering{roman} %
\setcounter{page}{1} %
\setcounter{figure}{0} %
\renewcommand{\thefigure}{\Alph{figure}} %
\setcounter{table}{0} %
\renewcommand{\thetable}{\Alph{table}}
}
% main matter
\renewcommand{\mainmatter}{%
\clearpage %
\pagenumbering{arabic} %
\setcounter{figure}{0} %
\setcounter{table}{0}
\renewcommand{\thefigure}{\arabic{figure}} %
\renewcommand{\thetable}{\arabic{table}}
}
% appendix
\renewcommand\appendix{\par
\setcounter{section}{0}
\setcounter{footnote}{0}
\gdef\thesection{\@Alph\c@section}
% footnote formatting
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
}
% back matter
\renewcommand{\backmatter}{\par
\setcounter{section}{0}
\setcounter{footnote}{0}
\gdef\thesection{\@Alph\c@section}
% footnote formatting
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
}
\fi
% Indenting and spacing between paragraphs
\setlength{\parindent}{0pt}
%-----------------------
% GENERAL FORMATTING
%-----------------------
% Require at least 3 characters before a hyphenation.
\lefthyphenmin=3
% Don't hyphenate the months (or any proper noun---other proper nouns must be addressed in the tex file
\hyphenation{January February April July August September October December}
% Enumerate list environment -- change the default numbering to match our style
\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\theenumii}{\Alph{enumii}}
\renewcommand{\theenumiii}{\roman{enumiii}}
\renewcommand{\theenumiv}{\alph{enumiv}}
\renewcommand{\labelenumi}{\theenumi.}
\renewcommand{\labelenumii}{\theenumii.}
\renewcommand{\labelenumiii}{\theenumiii.}
\renewcommand{\labelenumiv}{\theenumiv)}
% Draft mode
\ifthenelse{\boolean{IsDraft}}{ % tue
\RequirePackage{draftwatermark}
\SetWatermarkAngle{60}
\SetWatermarkLightness{0.875}
\SetWatermarkFontSize{6cm}
}{% False
}
% Compact lists
\ifthenelse{\boolean{IsCompactLayout}}%
{%true code%
\RequirePackage{enumitem}
\setlist{align=left,
noitemsep,
topsep= 0pt,
parsep = 0pt,
leftmargin=*,
labelindent=0mm,
partopsep=0pt}
}%
{%false code%
}%
% Enable tooltips
%\RequirePackage[linewidth = 1,%
% open = true]{pdfcomment}
% Format document links
\RequirePackage{hyperref}
\hypersetup{unicode,%
final,%
linktocpage,%
colorlinks,%
breaklinks=true,%
linktocpage=true,%
linkcolor=IntLinkColor,%
citecolor=IntLinkColor,%
menucolor=IntLinkColor,%
urlcolor=ExtLinkColor,%
pdfborder={0 0 0}}
%---------------------------------
% HEADER AND FOOTER FORMATTING
%----------------------------------
% Add page number and availability information to every page, including new chapters.
\RequirePackage{fancyhdr}
\fancypagestyle{corporateIdentity}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\color{FooterColor}\thepage} % except the center
\ifthenelse{\boolean{IsLogo}}{ % true
\fancyhead[R]{\includegraphics[height=25pt]{\@logoPath}}%
}{ %False
\fancyhead[R]{\color{HeaderColor}\today}%
}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
% note that the first page of a chapter uses "plain", so we need to redefine that to match the "corporateIdentity" page style.
\let\ps@plain\ps@corporateIdentity
\pagestyle{corporateIdentity}
\@ifclassloaded{report}{%
% use the chapter name as the running title
\fancyhead[L]{\color{HeaderColor}\leftmark}
}{}
\@ifclassloaded{article}{%
% use the short title name as the running title
\fancyhead[L]{\color{HeaderColor}\@shorttitle}
}{}
% -------------------------------------------
% Custom Cover Page
% -------------------------------------------
% start by blanking and redefining the author command
\providecommand\coverauthor{}
\newcounter{cntAuth}
% define an author command that can append names or place them in a specific location
\renewcommand\coverauthor[2][]{%
\ifstrempty{#1}{%
\stepcounter{cntAuth}%
\csdef{Author\thecntAuth}{#2}
}{%
\csdef{Author#1}{#2}
\setcounter{cntAuth}{#1}
}%
}
% get the value of the array
\newcommand\getAuthor[1]{%
\csuse{Author#1}}
% blank and redefine the existing affiliation command
\providecommand\coveraffiliation{}
\newcounter{cntAffil}
% define an affiliation command that can append values or place them in a specific location
\renewcommand\coveraffiliation[2][]{%
\ifstrempty{#1}{%
\stepcounter{cntAffil}%
\csdef{Affiliation\thecntAffil}{#2}
}{%
\csdef{Affiliation#1}{#2}
\setcounter{cntAffil}{#1}
}%
}
% get the value of the array
\newcommand\getAffil[1]{%
\csuse{Affiliation#1}}
\ifthenelse{\boolean{MakeFrontCover}}{
% Format the custom cover page
\newcommand\makecover{%
\begin{titlepage}
% Suppresses displaying the page number on the title page and the subsequent page counts as page 1
\sffamily
%------------------------------------------------
% Logo box
%------------------------------------------------
\hspace{0.05\textwidth}
\includegraphics[width=8cm]{\CI@CoverLogoPath}
% Space between the logo box and title
\vspace{1.4cm}
%------------------------------------------------
% Grey title box
%------------------------------------------------
\definecolor{grey}{rgb}{0.9,0.9,0.9} % Colour of the box surrounding the title
\colorbox{coverTitleBoxColor}{
\parbox[t]{\textwidth}{ % Outer full width box
\centering
\parbox[t]{0.9\textwidth}{ % Inner box for inner right text margin
% Title font size, the first argument is the font size and the second is the line spacing
\fontsize{36pt}{54pt}\selectfont
% Space between the start of the title and the top of the grey box
\vspace{0.7cm}
\textcolor{white}{
{\protect{\hyphenchar\font=-1}\protect\sloppy
\@title}}\par
% check for a subtitle
\ifdefempty{\@subtitle}{%
% empty
}{%
% defined
\vspace{0.35cm}
\fontsize{24pt}{36pt}\ltseries\selectfont
\textit{\@subtitle}\par}
\vspace{0.7cm} % Space between the end of the title and the bottom of the grey box
}
}
}
%------------------------------------------------
% Authors box
%------------------------------------------------
% Space between the title box and author information
\vspace{1.4cm}
% create a box to place information in
\hspace{0.05\textwidth}
\parbox[t]{0.9\textwidth}{
% create a list of authors
\newcounter{authNum}%
\setcounter{authNum}{0}
% work through the list
\whileboolexpr
{test {\ifnumcomp{\value{authNum}}{<}{\thecntAuth}} } % test to see if the column number is less than the number of authors
{% If true
\stepcounter{authNum} {\large \getAuthor{\theauthNum}}\\
} % end of true
% Space between the authors and their affiliations
\vspace{1.4cm}
%create a list of affiliations
\newcounter{affilNum}%
\setcounter{affilNum}{0}
% work through the list
\whileboolexpr{test {\ifnumcomp{\value{affilNum}}{<}{\thecntAffil}}}
% test to see if the column number is less than the number of authors
{% If true
\stepcounter{affilNum} \textsuperscript{\theaffilNum} \getAffil{\theaffilNum}\\
} % end of true
% Space after affiliations
\vspace{1.4cm}
%------------------------------------------------
% Date box
%------------------------------------------------
Published on \@date
% end of information box
}
%------------------------------------------------
% URL box
%------------------------------------------------
% push to bottom of page
\vfill
\hspace{0.05\textwidth}\href{www.example.com}{\textcolor{ExtLinkColor}{www.example.com}}
\end{titlepage}
}
}{
% else
}
% always use the custom cover in the report class
\@ifclassloaded{report}{
\let\maketitle\makecover
}{
% in other classes, use the usual title.
}
% -------------------------------------------
% Disclaimer Page
% -------------------------------------------
%% define the commands we need for the statements
\providecommand\Statement{}
\newcounter{cntStatement}
% define an Statement command that can append names or place them in a specific location
\renewcommand{\Statement}[2][]{%
\csdef{Statement#1}{#2}
\setcounter{cntStatement}{#1}
}
% get the value of the array
\newcommand\getStatement[1]{%
\csuse{Statement#1}
}
% check to see if any of these are defined; if they are, we can create a disclaimer
\newif\if@tempCanDoStatements
\@tempCanDoStatementsfalse
\ifdefempty{\@disclaimerstatement}{}{\@tempCanDoStatementstrue}
\ifdefempty{\@copyrightstatement}{}{\@tempCanDoStatementstrue}
\ifdefempty{\@usagestatement}{}{\@tempCanDoStatementstrue}
% create the disclaimer page
\newcommand{\makestatements}{
% switch to one column
\newif\if@temptwocols
\if@twocolumn
\onecolumn
\@temptwocolstrue
\fi
% start the layout
\null
\thispagestyle{corporateIdentity}
% insert padding
\vspace*{\fill}
\begin{center}
% reduce the text width
\begin{minipage}{0.65\textwidth}
% make the statements
\vspace*{\fill}
%% work through the list of statements
\newcounter{StatementNum}%
\setcounter{StatementNum}{0}
\whileboolexpr{test {\ifnumcomp{\value{StatementNum}}{<}{\thecntStatement}}}
{% If true
\stepcounter{StatementNum}
\getStatement{\theStatementNum}
} % end of true
% close the minipage
\end{minipage}
\end{center}
% insert padding
\vspace*{\fill}
% switch back to two column if required
\if@temptwocols
\twocolumn
\fi
\newpage
}
%---------------------------------
% ACTIONS AT THE START OF A DOCUMENT
%---------------------------------
\AtBeginDocument{
}
\AfterEndPreamble{
\ifthenelse{\boolean{MakeFrontCover}}{
\makecover
} {}
}