summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/upmethodology/upmethodology-frontpage.sty
blob: 0f35ac7e19d090b9c41118a1c0e9b5163350ac79 (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
% Front page for Unified Process Methodology
%
% Copyright (c) 2006-2007 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:
%   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{2007/07/04}

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

%-----
% 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{xspace}
\RequirePackage{tabularx}
\RequirePackage{graphicx}
\RequirePackage{setspace}

\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}{%
    \begin{titlepage}%
	\begin{center}

		% Illustration picture
 		\ifx\upm@front@illustration\relax
 		\noindent\vfill\includegraphics[width=.4\linewidth]{\theupmdoclogo}
 		\else
 		\noindent\expandafter\includegraphics[width=\upm@front@illustration@size\expandafter\linewidth]{\upm@front@illustration}
 		\fi

		% 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} \\
		\upm@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
 		\ifx\upm@front@illustration\relax
		\noindent\raggedleft\upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\
 		\else
 		\noindent\begin{tabularx}{\linewidth}{l>{\raggedleft}X}
			\includegraphics[width=.3\linewidth]{\theupmdoclogo} & 
			\upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\
 		\end{tabularx}
 		\fi

	\end{center}
    \end{titlepage}
}


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

	% Document title
	\upm@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)
		\ifx\upm@front@illustration\relax
		\else
		\put(-110,-100){
			\includegraphics[width=\upm@front@illustration@size\expandafter\linewidth]{\upm@front@illustration}
		}
		\fi
		\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
		\put(\strip@pt\upm@front@tmpa,-50){
			\includegraphics[width=.3\linewidth]{\theupmdoclogo}%
		}
		\end{picture}

	}
    \end{titlepage}
}

%----
% Set the front page layout as the classic layout theme
%\setfrontlayout{layout_name}
\newcommand{\setfrontlayout}[1]{%
	\ifthenelse{\equal{#1}{classic}}{%
		\gdef\upm@front@illustration@size{.6}
		\global\let\upm@front@layout\upm@front@layout@classic%
	}{%
		\ifthenelse{\equal{#1}{modern}}{%
			\gdef\upm@front@illustration@size{1}
			\global\let\upm@front@layout\upm@front@layout@modern%
		}{%
			\errmessage{invalid front layout theme: #1}%
		}%
	}%
}

\setfrontlayout{classic}

\AtBeginDocument{%
	\renewcommand{\maketitle}{\upm@front@layout}%
}

\let\upm@front@illustration\relax

%----
% Set the illustration figure on the front page
%\setfrontillustration[size_factor]{filename}
\newcommand{\setfrontillustration}[2][1]{%
	\gdef\upm@front@illustration{#2}%
	\gdef\upm@front@illustration@size{#1}%
}

\endinput