forked from SoftwareHeritage/swhapguide
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathswhap.sty
More file actions
191 lines (163 loc) · 4.5 KB
/
swhap.sty
File metadata and controls
191 lines (163 loc) · 4.5 KB
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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{swhap}[2019/09/04 SWH Report Style]
\RequirePackage{fancyhdr}
\RequirePackage{color}
\RequirePackage{hyperref}
\RequirePackage{url}
\RequirePackage{graphicx}
\RequirePackage{wallpaper}
%
% Example Options Declaration
%
%\DeclareOption{foo}{\typeout{Saw foo.}}
%\DeclareOption{baz}{\typeout{Saw baz.}}
%\DeclareOption*{\typeout{What's \CurrentOption?}}
%\ProcessOptions\relax
%
% Bail out if necessary graphic files are missing
%
\newcommand{\@checkgr}[1]{%
\IfFileExists{logos/#1.png}
{}
{\IfFileExists{logos/#1.jpg}
{}
{\IfFileExists{logos/#1.pdf}
{}
{\PackageError{swh}{Missing logos/#1.{png,jpg,pdf}!}{Copy/link the 'logos' directory!}
}
}
}
}
\@checkgr{SWH}
\@checkgr{SWHbaseline}
\@checkgr{inria-logo-new-resized}
\@checkgr{swhbg}
%
% SWH colors
%
\definecolor{SWHRed}{RGB}{241,79,36}
\definecolor{SWH@lightred}{RGB}{108,144,197}
\definecolor{SWH@mediumred}{RGB}{43,131,192}
\definecolor{SWH@darkred}{RGB}{24,58,141}
%
% Parameters for the title page
%
%
% Default values
%
\def\@reportdate{\today}
\def\@reporttitle{Use reporttitle to define title!}
\def\@shortreporttitle{SWH}
\def\@reportkind{Report}
\def\@reportdistr{Public}
\def\@reportauthorlist{Please define & reportauthorlist!\\}
\def\@reportversion{1.0}
\def\@reportabstract{FILL WITH ABSTRACT}
%
% Define macros to change the default values
%
\DeclareRobustCommand*{\reportdate}[1]{\def\@reportdate{#1}}
\DeclareRobustCommand*{\reporttitle}[1]{\def\@reporttitle{#1}}
\DeclareRobustCommand*{\shortreporttitle}[1]{\def\@shortreporttitle{#1}}
\DeclareRobustCommand*{\reportkind}[1]{\def\@reportkind{#1}}
\DeclareRobustCommand*{\reportdistr}[1]{\def\@reportdistr{#1}}
\DeclareRobustCommand*{\reportauthorlist}[1]{\def\@reportauthorlist{#1}}
\DeclareRobustCommand*{\reportversion}[1]{\def\@reportversion{#1}}
\DeclareRobustCommand*{\reportabstract}[1]{\def\@reportabstract{#1}}
%
% Page layout (geometry)
%
%\setlength\voffset{-1in}
%\setlength\hoffset{-1in}
%\setlength\topmargin{1in}
\setlength\oddsidemargin{0.1in}
\setlength\textheight{8.5in}
\setlength\textwidth{6.2995996in}
\setlength\footskip{1.0cm}
\setlength\headheight{0.5cm}
\setlength\headsep{1.5cm}
% Footnote rule
\setlength{\skip\footins}{0.0469in}
% Pages styles
%\setlength\tabcolsep{1mm}
%
% Set up the fancy headers
%
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LO]{
\begin{picture}(0,0)
% \put(160,0){\includegraphics*[width=5cm]{logos/SWH}}
\put(0,-8){\includegraphics[width=16cm]{logos/line}}
\end{picture}
}
\fancyhead[RO]{\small \makeatletter \@date \makeatother}
\fancyhead[LE]{
{\small \today}\\[-1em]
\begin{picture}(0,0)
\put(160,0){\includegraphics*[width=5cm]{logos/SWH}}
\put(0,-8){\includegraphics[width=16cm]{logos/lineeven}}
\end{picture}
}
\fancyhead[RE]{}
\setlength{\headsep}{20pt}
\setcounter{tocdepth}{3}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[LE]{
\begin{picture}(0,0)
\put(0,12){\includegraphics[width=16cm]{logos/lineeven}}
\end{picture}
}
\fancyfoot[LO]{
\begin{picture}(0,0)
\put(0,12){\includegraphics[width=16cm]{logos/line}}
\end{picture}
}
\fancyfoot[cO]{\small \@reportkind~(v. \@reportversion) \hfill page \thepage\ of \pageref{LastPage}}
\fancyfoot[cE]{\small page \thepage\ of \pageref{LastPage} \hfill \@reportkind~(v. \@reportversion) }
%
% Definition of the fancy title page
%
%
% Use hints from http://tex.stackexchange.com/questions/46280/how-to-create-a-background-image-on-title-page-with-latex
%
\DeclareRobustCommand{\makeswhtitle}%
{%
\begin{titlepage}
%
% Background picture with logos
%
\ThisULCornerWallPaper{1}{logos/PracticalGuide_FP.pdf}
\mbox{}
% uncomment line below if you want the version number to be printed on top of pdf frontpage
% \textcolor{SWHRed}{\hfill \Large \bf Version \@reportversion\hspace{2em}}
\end{titlepage}
%
% Add the list of authors
%
\begin{center}
List of the authors
\end{center}
\begin{flushright}
\begin{tabular}{|l|l|}
\hline
\bf{Short title} & \@shortreporttitle\\\hline
\bf{Full title} & \@reporttitle \\\hline
\@reportauthorlist
\hline
\bf{Date} & \@reportdate\\\hline
\bf{Contact} & Roberto Di Cosmo
$\langle${\tt roberto@dicosmo.org}$\rangle$\\\hline
\end{tabular}
\end{flushright}
\vskip 5em
\begin{abstract}
\@reportabstract
\end{abstract}
\clearpage
}
%
% Catch the old maketitle
%
\renewcommand{\maketitle}{\makeswhtitle}