]> AND Private Git Repository - these_kahina.git/blob - upmethodology-frontpage.sty
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
suppression thesis.pdf
[these_kahina.git] / upmethodology-frontpage.sty
1 % Front page for Unified Process Methodology
2 %
3 % Copyright (c) 2006-2009 Stephane GALLAND <galland@arakhne.org>
4
5 % This program is free library; you can redistribute it and/or modify
6 % it under the terms of the GNU Lesser General Public License as
7 % published by the Free Software Foundation; either version 3 of the
8 % License, or any later version.
9 %
10 % This library is distributed in the hope that it will be useful, but
11 % WITHOUT ANY WARRANTY; without even the implied warranty of
12 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 % Lesser General Public License for more details.
14 %
15 % You should have received a copy of the GNU Lesser General Public
16 % License along with this library; see the file COPYING.  If not,
17 % write to the Free Software Foundation, Inc., 59 Temple Place - Suite
18 % 330, Boston, MA 02111-1307, USA.
19 %
20
21 \global\edef\upm@package@fp@ver{2009/10/30}
22
23 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
24 \ProvidesPackage{upmethodology-frontpage}[\upm@package@fp@ver]
25
26 \RequirePackage{upmethodology-p-common}
27
28 %-----
29 % Locales
30 \def\upm@front@lang@english{
31   \gdef\upm@lang@@{\message{**** upmethodology-frontpage is using English language ****}}%
32   \gdef\upm@lang@front@authors{\upm@lang@document@authors}
33 }
34 \def\upm@front@lang@french{
35   \gdef\upm@lang@@{\message{**** upmethodology-frontpage is using French language ****}}%
36   \gdef\upm@lang@front@authors{\upm@lang@document@authors}
37 }
38 %----------------------------------------
39 % OPTIONS
40 %----------------------------------------
41 \DeclareOption{french}{%
42   \upm@front@lang@french
43 }
44 \DeclareOption{francais}{%
45   \upm@front@lang@french
46 }
47 \DeclareOption{english}{%
48   \upm@front@lang@english
49 }
50 \ExecuteOptions{english}
51 \ProcessOptions
52 \upm@lang@@
53
54 \RequirePackage{upmethodology-extension}
55 \RequirePackage{upmethodology-document}
56
57 % Declare the temporary dimensions
58 \newdimen\upm@front@tmpa
59 \newdimen\upm@front@tmpb
60
61 %-----
62 % String format
63 \def\upm@front@force@single@spacing#1{{\begin{singlespace}#1\end{singlespace}}}
64 \def\upm@front@maintitle@fmt#1{\Huge \scshape #1}
65 \def\upm@front@project@fmt#1{\textbf{\Large #1}}
66 \def\upm@front@subproject@fmt#1{\textbf{\large #1}}
67 \def\upm@front@document@fmt#1{\textbf{\normalsize #1}}
68 \def\upm@front@info@fmt#1{{\normalsize #1}}
69 \def\upm@front@author@fmt#1{%
70         \begin{upmfontsize}{\small}#1\end{upmfontsize}%
71         }
72
73 %-----
74 % Define the command to put the title with a classic layout
75 \newcommand{\upm@front@layout@classic}{%
76     \message{************ USE CLASSIC FRONT COVER}
77     \begin{titlepage}%
78         \begin{center}
79
80                 % Illustration picture
81                 \Ifelsedefined{frontillustration}{%
82                         \noindent\expandafter\includegraphics[width=\Get{frontillustrationsize}\expandafter\linewidth]{\Get{frontillustration}}
83                 }{%
84                         \Ifdefined{logo}{\noindent\vfill\expandafter\includegraphics[width=.4\linewidth]{\Get{logo}}}%
85                 }%
86
87                 % Project name
88                 \vspace{1cm}
89                 \upm@front@force@single@spacing{\upm@front@maintitle@fmt{\theupmproject}}
90                 \vspace{1cm}
91
92                 % Document title
93                 \noindent\rule{\linewidth}{1mm} \\
94                 \noindent\raggedleft\upm@front@project@fmt{\theupmproject} \\
95                 \Ifnotempty{\theupmsubproject}{\noindent\raggedleft\upm@front@subproject@fmt{\theupmsubproject}\\}
96                 \vspace{.5cm}
97                 \noindent\raggedleft\upm@front@document@fmt{\theupmdocname} \\
98                 \noindent\rule{\linewidth}{1mm} \\
99
100                 \vspace{1cm}
101
102                 % Document information
103                 \noindent\raggedleft\begin{tabular}{rr}
104                         \upm@front@info@fmt{\upm@lang@docref:} & \upm@front@info@fmt{\theupmdocref} \\
105                         \upm@front@info@fmt{\upm@lang@version:} & \upm@front@info@fmt{\theupmversion} \\
106                         \upm@front@info@fmt{\upm@lang@lastupdate@short:} & \upm@front@info@fmt{\theupmdate} \\
107                         \upm@front@info@fmt{\upm@lang@status:} & \upm@front@info@fmt{\theupmstatus} \\
108                 \end{tabular}
109
110                 \vfill
111                 \Ifelsedefined{frontillustration}{%
112                         \Ifelsedefined{logo}{%
113                                 \noindent\begin{tabularx}{\linewidth}{l>{\raggedleft}X}%
114                                         \expandafter\includegraphics[width=.3\linewidth]{\Get{logo}} & %
115                                         \upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\%
116                                 \end{tabularx}%
117                         }{%
118                                 \noindent\raggedleft\upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\%
119                         }%
120                 }{%
121                         \noindent\raggedleft\upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\%
122                 }%
123
124         \end{center}
125     \end{titlepage}
126 }
127
128
129 %-----
130 % Define the command to put the title with a classic layout
131 \newcommand{\upm@front@layout@modern}{%
132     \message{************ USE MODERN FRONT COVER}
133     \begin{titlepage}%
134         % Project name
135         \upm@front@maintitle@fmt{\theupmproject} \\
136         \noindent\rule{\linewidth}{.5mm} \\
137
138         % Document title
139         \Ifnotempty{\theupmsubproject}{\noindent\raggedright\upm@front@subproject@fmt{\theupmsubproject}\\}
140         \vspace{.5cm}
141         \noindent\raggedright\upm@front@force@single@spacing{\upm@front@document@fmt{\theupmdocname}}
142
143         \vfill
144
145         \vbox{
146                 \begin{picture}(0,0)
147                 \Ifelsedefined{frontillustration}{%
148                         \put(-110,-100){%
149                                 \includegraphics[width=\Get{frontillustrationsize}\expandafter\linewidth]{\Get{frontillustration}}%
150                         }%
151                 }{%
152                 }
153                 \upm@front@tmpa=\linewidth
154                 \advance\upm@front@tmpa-.4\linewidth
155                 \put(\strip@pt\upm@front@tmpa,75){
156                         \begin{tabular*}{.4\linewidth}{lr}
157                         \upm@front@info@fmt{\upm@lang@docref:} & \upm@front@info@fmt{\theupmdocref} \\
158                         \upm@front@info@fmt{\upm@lang@version:} & \upm@front@info@fmt{\theupmversion} \\
159                         \upm@front@info@fmt{\upm@lang@lastupdate@short:} & \upm@front@info@fmt{\theupmdate} \\
160                         \upm@front@info@fmt{\upm@lang@status:} & \upm@front@info@fmt{\theupmstatus} \\
161                         \end{tabular*}
162                 }
163                 \upm@front@tmpa=\linewidth
164                 \advance\upm@front@tmpa-.3\linewidth
165                 \Ifdefined{logo}{
166                         \put(\strip@pt\upm@front@tmpa,-50){
167                                 \expandafter\includegraphics[width=.3\linewidth]{\Get{logo}}%
168                         }
169                 }
170                 \end{picture}
171
172         }
173     \end{titlepage}
174 }
175
176 \newcommand{\upm@front@setfrontlayout}[2]{%
177         \ifthenelse{\equal{#1}{classic}}{%
178                 \Set{frontillustrationsize}{.6}%
179                 \global\let\upm@front@layout\upm@front@layout@classic%
180         }{%
181                 \ifthenelse{\equal{#1}{modern}}{%
182                         \Set{frontillustrationsize}{1}
183                         \global\let\upm@front@layout\upm@front@layout@modern%
184                 }{%
185                         \ifthenelse{\equal{#1}{custom}}{#2}{\errmessage{invalid front layout theme: #1}}%
186                 }%
187         }%
188 }
189
190 %----
191 % Set the front page layout as the classic layout theme
192 %\setfrontcover{layout_name}
193 \newcommand{\setfrontcover}[1]{%
194         \upm@front@setfrontlayout{#1}{\errmessage{invalid front layout theme: #1}}%
195 }
196 \newcommand{\setfrontlayout}[1]{\errmessage{"\string\setfrontlayout" is deprecated. Use "\string\setfrontcover" insteed}}
197
198 \setfrontcover{classic}
199
200 \renewcommand{\maketitle}{%
201         \Ifdefined{frontpage}{
202                 \upm@front@setfrontlayout{\Get{frontpage}}{%
203                         \message{************ USE CUSTOM FRONT COVER}
204                         \gdef\upm@front@layout{%
205                                 \begin{titlepage}%
206                                 \Get{frontpage@custom}%
207                                 \end{titlepage}%
208                         }%
209                 }%
210         }%
211         \upm@front@layout}%
212 \newcommand{\makefrontcover}{\maketitle}
213
214 %----
215 % Set the illustration figure on the front page
216 %\setfrontillustration[size_factor]{filename}
217 \newcommand{\setfrontillustration}[2][1]{%
218         \Set{frontillustrationsize}{#1}%
219         \Set{frontillustration}{#2}%
220 }
221
222 %----
223 % Clear the illustration figure on the front page
224 %\clearfrontillustration
225 \newcommand{\clearfrontillustration}{%
226         \Set{frontillustrationsize}{1}%
227         \Unset{frontillustration}%
228 }
229
230 \endinput