-
Notifications
You must be signed in to change notification settings - Fork 0
/
acmreport.cls
162 lines (130 loc) · 4.25 KB
/
acmreport.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
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{acmreport}[2015/09/25 ACM Report Class]
\def\baseclass{article}
% All options are passed to the base class
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}
\ProcessOptions\relax % Required to process the options
\LoadClass{\baseclass}
% Common features of all documents
\RequirePackage{acmusal}
% Basic packages
\RequirePackage{float}
\RequirePackage{hyphenat} % Used to avoid hyphenation in certain parts of the document
\RequirePackage[pdfpagemode={UseOutlines},
bookmarks=true,
bookmarksopen=true,
bookmarksopenlevel=0,
bookmarksnumbered=true,
hypertexnames=false,
colorlinks=true,
linkcolor={acmblue},
citecolor={acmblue},
urlcolor={acmblue},
anchorcolor={acmblue},
filecolor={acmblue},
pdfstartview={FitV},
unicode,
breaklinks=true]{hyperref}
%% Pages
\RequirePackage{lastpage}
\RequirePackage{fancyhdr}
\RequirePackage{wallpaper}
% Sections tweaking
\RequirePackage[explicit]{titlesec}%
\titleformat{\section}
{\Large\color{acmblue}}
{\thesection}
{1em}
{#1}
\titleformat{\subsection}
{\large\color{acmblue}}
{\thesubsection}
{1em}
{#1}
\titleformat{\subsubsection}
{\large\color{acmblue}}
{\thesubsubsection}
{1em}
{#1}
% Cover
\AtBeginDocument{
\thispagestyle{empty}
\begin{titlepage}
\ThisCenterWallPaper{1}{img/portada}
\vspace*{-5cm}
{\hspace{7cm}\parbox{80mm}{\color{acmwhite} \nohyphens {\@date}}}\\[15cm]
{\hspace{0mm}\parbox{80mm}{\color{acmwhite}\LARGE \nohyphens {\MakeUppercase \@title} \\*\vspace{1mm}}}\\
{\hspace{0mm}\parbox{80mm}{\color{acmwhite}\LARGE \nohyphens {\@author} \\* \vspace{5mm}}}
\end{titlepage}
%Colours of the TOC are different from those of the rest of the document
{
\hypersetup{linkcolor=acmorange}
\titleformat{\section}
{\Large\color{acmorange}}
{\thesection}
{1em}
{#1}
\tableofcontents
}
\clearpage
%\mainmatter
%\thispagestyle{empty}
%\tableofcontents
%\cleardoublepage
%\pagestyle{empty}
%\setcounter{page}{1}
%\pagestyle{fancy}
}
% The geometry of the page is defined after the cover.
\RequirePackage[paperwidth=210mm,paperheight=297mm,top=5.4cm,left=2.5cm, right=3.0cm, bottom=4.0cm,marginparsep=0pt%, showframe% uncomment to draw a frame showing the page layout
]{geometry}
\setlength{\headsep}{3.5cm}
\geometry{a4paper}
% Auxiliar title. Useful when a cover is not desired
\renewcommand\maketitle{
\hypersetup{pdftitle={\@title},
pdfauthor={\@authornames},
pdfproducer=XeLaTeX
}
\thispagestyle{empty}
\begin{titlepage}
\center
\vfill
\setlength{\parskip}{0pt}
{\huge \@title \par}
\bigskip
{\center \includegraphics[width=0.3\textwidth]{img/chapterlogo} \par}
\smallskip
{\large\textbf{\@acmchaptername} \par}
\smallskip
{\large\@date \par}
\par
\vfil
\end{titlepage}
\cleardoublepage
}
% Itemize uses circles instead of dots
\renewcommand{\labelitemi}{$\circ$}
\renewcommand{\labelitemii}{$\circ$}
\renewcommand{\labelitemiii}{$\circ$}
\renewcommand{\labelitemiv}{$\circ$}
% Background for the rest of the page
\CenterWallPaper{1}{img/left-page}
% Headers and footers
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}}
\lhead{\color{white} \parbox{25mm}{\nohyphens \footnotesize \leftmark}}
\rhead{\color{acmblue} \@title}
\rfoot{\color{acmblue} Página {\thepage} de \pageref{LastPage}}
\renewcommand{\footrulewidth}{0.4pt}% Line width default is 0pt
\renewcommand{\headrulewidth}{0pt}
% Header/footer bar color change
\RequirePackage{etoolbox}
\newcommand{\headrulecolor}[1]{\patchcmd{\headrule}{\hrule}{\color{#1}\hrule}{}{}}
\newcommand{\footrulecolor}[1]{\patchcmd{\footrule}{\hrule}{\color{#1}\hrule}{}{}}
%\headrulecolor{acmblue} % Uncomment to use a blue bar
\footrulecolor{acmblue}
\title{}
\date{}
\authors{}