summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/upmethodology/upmethodology-frontpage.sty
blob: ded8bcfa8fe38afb687db52fab522a79ab4d8196 (plain)
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
% Front page for Unified Process Methodology
%
% Copyright (c) 2006-2009 Stephane GALLAND <galland@arakhne.org>
% 
% This program is free library; you can redistribute it and/or modify
% it under the terms of the GNU Lesser General Public License as
% published by the Free Software Foundation; either version 3 of the
% License, or any later version.
%
% This library is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
% Lesser General Public License for more details.
%
% You should have received a copy of the GNU Lesser General Public
% License along with this library; see the file COPYING.  If not,
% write to the Free Software Foundation, Inc., 59 Temple Place - Suite
% 330, Boston, MA 02111-1307, USA.
%
% Creation date: 2006-04-11
% Modifications:
%   2009-10-30   Clean code.
%   2009-10-29   Major bug fix: invert order of the \setfrontillustration parameters.
%   2009-10-27   Clean the extension API.
%   2009-10-22   Add support for front page from UPM extensions.
%   2007-07-05   Add people name formatting function.
%   2007-07-03   Force single spacing inside the title.
%   2007-03-19   Add localization.
%   2006-04-19   Add version number.
%

\global\edef\upm@package@fp@ver{2009/10/30}

\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{upmethodology-frontpage}[\upm@package@fp@ver]

\RequirePackage{upmethodology-p-common}

%-----
% Locales
\def\upm@front@lang@english{
  \gdef\upm@lang@@{\message{**** upmethodology-frontpage is using English language ****}}%
  \gdef\upm@lang@front@authors{\upm@lang@document@authors}
}
\def\upm@front@lang@french{
  \gdef\upm@lang@@{\message{**** upmethodology-frontpage is using French language ****}}%
  \gdef\upm@lang@front@authors{\upm@lang@document@authors}
}
%----------------------------------------
% OPTIONS
%----------------------------------------
\DeclareOption{french}{%
  \upm@front@lang@french
}
\DeclareOption{francais}{%
  \upm@front@lang@french
}
\DeclareOption{english}{%
  \upm@front@lang@english
}
\ExecuteOptions{english}
\ProcessOptions
\upm@lang@@

\RequirePackage{upmethodology-extension}
\RequirePackage{upmethodology-document}

% Declare the temporary dimensions
\newdimen\upm@front@tmpa
\newdimen\upm@front@tmpb

%-----
% String format
\def\upm@front@force@single@spacing#1{{\begin{singlespace}#1\end{singlespace}}}
\def\upm@front@maintitle@fmt#1{\Huge \scshape #1}
\def\upm@front@project@fmt#1{\textbf{\Large #1}}
\def\upm@front@subproject@fmt#1{\textbf{\large #1}}
\def\upm@front@document@fmt#1{\textbf{\normalsize #1}}
\def\upm@front@info@fmt#1{{\normalsize #1}}
\def\upm@front@author@fmt#1{%
	\begin{upmfontsize}{\small}#1\end{upmfontsize}%
	}

%-----
% Define the command to put the title with a classic layout
\newcommand{\upm@front@layout@classic}{%
    \message{************ USE CLASSIC FRONT COVER}
    \begin{titlepage}%
	\begin{center}

		% Illustration picture
 		\Ifelsedefined{frontillustration}{%
			\noindent\expandafter\includegraphics[width=\Get{frontillustrationsize}\expandafter\linewidth]{\Get{frontillustration}}
		}{%
			\Ifdefined{logo}{\noindent\vfill\expandafter\includegraphics[width=.4\linewidth]{\Get{logo}}}%
		}%

		% Project name
		\vspace{1cm}
		\upm@front@force@single@spacing{\upm@front@maintitle@fmt{\theupmproject}}
		\vspace{1cm}

		% Document title
		\noindent\rule{\linewidth}{1mm} \\
		\noindent\raggedleft\upm@front@project@fmt{\theupmproject} \\
		\Ifnotempty{\theupmsubproject}{\noindent\raggedleft\upm@front@subproject@fmt{\theupmsubproject}\\}
		\vspace{.5cm}
		\noindent\raggedleft\upm@front@document@fmt{\theupmdocname} \\
		\noindent\rule{\linewidth}{1mm} \\

		\vspace{1cm}

		% Document information
 		\noindent\raggedleft\begin{tabular}{rr}
			\upm@front@info@fmt{\upm@lang@docref:} & \upm@front@info@fmt{\theupmdocref} \\
			\upm@front@info@fmt{\upm@lang@version:} & \upm@front@info@fmt{\theupmversion} \\
			\upm@front@info@fmt{\upm@lang@lastupdate@short:} & \upm@front@info@fmt{\theupmdate} \\
			\upm@front@info@fmt{\upm@lang@status:} & \upm@front@info@fmt{\theupmstatus} \\
 		\end{tabular}

		\vfill
 		\Ifelsedefined{frontillustration}{%
			\Ifelsedefined{logo}{%
		 		\noindent\begin{tabularx}{\linewidth}{l>{\raggedleft}X}%
					\expandafter\includegraphics[width=.3\linewidth]{\Get{logo}} & %
					\upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\%
		 		\end{tabularx}%
			}{%
				\noindent\raggedleft\upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\%
			}%
		}{%
			\noindent\raggedleft\upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\%
		}%

	\end{center}
    \end{titlepage}
}


%-----
% Define the command to put the title with a classic layout
\newcommand{\upm@front@layout@modern}{%
    \message{************ USE MODERN FRONT COVER}
    \begin{titlepage}%
	% Project name
	\upm@front@maintitle@fmt{\theupmproject} \\
	\noindent\rule{\linewidth}{.5mm} \\

	% Document title
	\Ifnotempty{\theupmsubproject}{\noindent\raggedright\upm@front@subproject@fmt{\theupmsubproject}\\}
	\vspace{.5cm}
	\noindent\raggedright\upm@front@force@single@spacing{\upm@front@document@fmt{\theupmdocname}}

	\vfill

	\vbox{
		\begin{picture}(0,0)
		\Ifelsedefined{frontillustration}{%
			\put(-110,-100){%
				\includegraphics[width=\Get{frontillustrationsize}\expandafter\linewidth]{\Get{frontillustration}}%
			}%
		}{%
		}
		\upm@front@tmpa=\linewidth
		\advance\upm@front@tmpa-.4\linewidth
		\put(\strip@pt\upm@front@tmpa,75){
			\begin{tabular*}{.4\linewidth}{lr}
			\upm@front@info@fmt{\upm@lang@docref:} & \upm@front@info@fmt{\theupmdocref} \\
			\upm@front@info@fmt{\upm@lang@version:} & \upm@front@info@fmt{\theupmversion} \\
			\upm@front@info@fmt{\upm@lang@lastupdate@short:} & \upm@front@info@fmt{\theupmdate} \\
			\upm@front@info@fmt{\upm@lang@status:} & \upm@front@info@fmt{\theupmstatus} \\
			\end{tabular*}
		}
		\upm@front@tmpa=\linewidth
		\advance\upm@front@tmpa-.3\linewidth
		\Ifdefined{logo}{
			\put(\strip@pt\upm@front@tmpa,-50){
				\expandafter\includegraphics[width=.3\linewidth]{\Get{logo}}%
			}
		}
		\end{picture}

	}
    \end{titlepage}
}

\newcommand{\upm@front@setfrontlayout}[2]{%
	\ifthenelse{\equal{#1}{classic}}{%
		\Set{frontillustrationsize}{.6}%
		\global\let\upm@front@layout\upm@front@layout@classic%
	}{%
		\ifthenelse{\equal{#1}{modern}}{%
			\Set{frontillustrationsize}{1}
			\global\let\upm@front@layout\upm@front@layout@modern%
		}{%
			\ifthenelse{\equal{#1}{custom}}{#2}{\errmessage{invalid front layout theme: #1}}%
		}%
	}%
}

%----
% Set the front page layout as the classic layout theme
%\setfrontcover{layout_name}
\newcommand{\setfrontcover}[1]{%
	\upm@front@setfrontlayout{#1}{\errmessage{invalid front layout theme: #1}}%
}
\newcommand{\setfrontlayout}[1]{\errmessage{"\string\setfrontlayout" is deprecated. Use "\string\setfrontcover" insteed}}

\setfrontcover{classic}

\renewcommand{\maketitle}{%
	\Ifdefined{frontpage}{
		\upm@front@setfrontlayout{\Get{frontpage}}{%
    			\message{************ USE CUSTOM FRONT COVER}
			\gdef\upm@front@layout{%
				\begin{titlepage}%
				\Get{frontpage@custom}%
				\end{titlepage}%
			}%
		}%
	}%
	\upm@front@layout}%
\newcommand{\makefrontcover}{\maketitle}

%----
% Set the illustration figure on the front page
%\setfrontillustration[size_factor]{filename}
\newcommand{\setfrontillustration}[2][1]{%
	\Set{frontillustrationsize}{#1}%
	\Set{frontillustration}{#2}%
}

%----
% Clear the illustration figure on the front page
%\clearfrontillustration
\newcommand{\clearfrontillustration}{%
	\Set{frontillustrationsize}{1}%
	\Unset{frontillustration}%
}

\endinput