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

Private GIT Repository
RCE : Nouvelle version de la these
[these_charles_emile.git] / upmethodology-frontpage.sty
1 % Front page for Unified Process Methodology
2 %
3 % Copyright (c) 2006-2015 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{2015/06/26}
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 %----------------------------------------
31 \def\upm@front@lang@english{
32   \gdef\upm@lang@@{\message{**** upmethodology-frontpage is using English language ****}}%
33   \gdef\upm@lang@front@authors{\upm@lang@document@authors}
34 }
35 \def\upm@front@lang@french{
36   \gdef\upm@lang@@{\message{**** upmethodology-frontpage is using French language ****}}%
37   \gdef\upm@lang@front@authors{\upm@lang@document@authors}
38 }
39
40 %----------------------------------------
41 % OPTIONS
42 %----------------------------------------
43 \DeclareOption{french}{%
44   \upm@front@lang@french
45 }
46 \DeclareOption{francais}{%
47   \upm@front@lang@french
48 }
49 \DeclareOption{english}{%
50   \upm@front@lang@english
51 }
52 \ExecuteOptions{english}
53 \ProcessOptions
54 \upm@lang@@
55
56 \RequirePackage{upmethodology-extension}
57 \RequirePackage{upmethodology-document}
58
59 % Declare the temporary dimensions
60 \newdimen\upm@front@tmpa
61 \newdimen\upm@front@tmpb
62
63 %----------------------------------------
64 % String format
65 %----------------------------------------
66 \def\upm@front@force@single@spacing#1{{\begin{singlespace}#1\end{singlespace}}}
67 \def\upm@front@maintitle@fmt#1{\Huge \scshape #1}
68 \def\upm@front@project@fmt#1{\textbf{\Large #1}}
69 \def\upm@front@subproject@fmt#1{\textbf{\large #1}}
70 \def\upm@front@document@fmt#1{\textbf{\normalsize #1}}
71 \def\upm@front@info@fmt#1{{\normalsize #1}}
72 \def\upm@front@author@fmt#1{%
73         \begin{upmfontsize}{\small}#1\end{upmfontsize}%
74         }
75
76 %----------------------------------------
77 % Define the command to put the title with a classic layout
78 %----------------------------------------
79 \newcommand{\upm@front@layout@classic}{%
80     \message{************ USE CLASSIC FRONT COVER}
81     \begin{titlepage}%
82         \begin{center}
83
84                 % Illustration picture
85                 \Ifelsedefined{frontillustration}{%
86                         \noindent\expandafter\includegraphics[width=\Get{frontillustrationsize}\expandafter\linewidth]{\Get{frontillustration}}
87                 }{%
88                         \Ifdefined{logo}{\noindent\vfill\expandafter\includegraphics[width=.4\linewidth]{\Get{logo}}}%
89                 }%
90
91                 % Project name
92                 \vspace{1cm}
93                 \upm@front@force@single@spacing{\upm@front@maintitle@fmt{\theupmproject}}
94                 \vspace{1cm}
95
96                 % Document title
97                 \noindent\rule{\linewidth}{1mm} \\
98                 \noindent\raggedleft\upm@front@project@fmt{\theupmproject} \\
99                 \Ifnotempty{\theupmsubproject}{\noindent\raggedleft\upm@front@subproject@fmt{\theupmsubproject}\\}
100                 \vspace{.5cm}
101                 \noindent\raggedleft\upm@front@document@fmt{\theupmdocname} \\
102                 \noindent\rule{\linewidth}{1mm} \\
103
104                 \vspace{1cm}
105
106                 % Document information
107                 \noindent\raggedleft\begin{tabular}{rr}
108                         \upm@front@info@fmt{\upm@lang@docref:} & \upm@front@info@fmt{\theupmdocref} \\
109                         \upm@front@info@fmt{\upm@lang@version:} & \upm@front@info@fmt{\theupmversion} \\
110                         \upm@front@info@fmt{\upm@lang@lastupdate@short:} & \upm@front@info@fmt{\theupmdate} \\
111                         \upm@front@info@fmt{\upm@lang@status:} & \upm@front@info@fmt{\theupmstatus} \\
112                 \end{tabular}
113
114                 \vfill
115                 \Ifelsedefined{frontillustration}{%
116                         \Ifelsedefined{logo}{%
117                                 \noindent\begin{tabularx}{\linewidth}{l>{\raggedleft}X}%
118                                         \expandafter\includegraphics[width=.3\linewidth]{\Get{logo}} & %
119                                         \upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\%
120                                 \end{tabularx}%
121                         }{%
122                                 \noindent\raggedleft\upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\%
123                         }%
124                 }{%
125                         \noindent\raggedleft\upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\%
126                 }%
127
128         \end{center}
129     \end{titlepage}
130 }
131
132
133 %----------------------------------------
134 % Define the command to put the title with a classic layout
135 %----------------------------------------
136 \newcommand{\upm@front@layout@modern}{%
137     \message{************ USE MODERN FRONT COVER}
138     \begin{titlepage}%
139         % Project name
140         \upm@front@maintitle@fmt{\theupmproject} \\
141         \noindent\rule{\linewidth}{.5mm} \\
142
143         % Document title
144         \Ifnotempty{\theupmsubproject}{\noindent\raggedright\upm@front@subproject@fmt{\theupmsubproject}\\}
145         \vspace{.5cm}
146         \noindent\raggedright\upm@front@force@single@spacing{\upm@front@document@fmt{\theupmdocname}}
147
148         \vfill
149
150         \vbox{
151                 \begin{picture}(0,0)
152                 \Ifelsedefined{frontillustration}{%
153                         \put(-110,-100){%
154                                 \includegraphics[width=\Get{frontillustrationsize}\expandafter\linewidth]{\Get{frontillustration}}%
155                         }%
156                 }{%
157                 }
158                 \upm@front@tmpa=\linewidth
159                 \advance\upm@front@tmpa-.4\linewidth
160                 \put(\strip@pt\upm@front@tmpa,75){
161                         \begin{tabular*}{.4\linewidth}{lr}
162                         \upm@front@info@fmt{\upm@lang@docref:} & \upm@front@info@fmt{\theupmdocref} \\
163                         \upm@front@info@fmt{\upm@lang@version:} & \upm@front@info@fmt{\theupmversion} \\
164                         \upm@front@info@fmt{\upm@lang@lastupdate@short:} & \upm@front@info@fmt{\theupmdate} \\
165                         \upm@front@info@fmt{\upm@lang@status:} & \upm@front@info@fmt{\theupmstatus} \\
166                         \end{tabular*}
167                 }
168                 \upm@front@tmpa=\linewidth
169                 \advance\upm@front@tmpa-.3\linewidth
170                 \Ifdefined{logo}{
171                         \put(\strip@pt\upm@front@tmpa,-50){
172                                 \expandafter\includegraphics[width=.3\linewidth]{\Get{logo}}%
173                         }
174                 }
175                 \end{picture}
176
177         }
178     \end{titlepage}
179 }
180
181 \newcommand{\upm@front@setfrontlayout}[2]{%
182         \ifthenelse{\equal{#1}{classic}}{%
183                 \Set{frontillustrationsize}{.6}%
184                 \global\let\upm@front@layout\upm@front@layout@classic%
185         }{%
186                 \ifthenelse{\equal{#1}{modern}}{%
187                         \Set{frontillustrationsize}{1}
188                         \global\let\upm@front@layout\upm@front@layout@modern%
189                 }{%
190                         \ifthenelse{\equal{#1}{custom}}{#2}{\errmessage{invalid front layout theme: #1}}%
191                 }%
192         }%
193 }
194
195 %----------------------------------------
196 % Set the front page layout as the classic layout theme
197 %----------------------------------------
198 %\setfrontcover{layout_name}
199 \newcommand{\setfrontcover}[1]{%
200         \upm@front@setfrontlayout{#1}{\errmessage{invalid front layout theme: #1}}%
201 }
202 \newcommand{\setfrontlayout}[1]{\errmessage{"\string\setfrontlayout" is deprecated. Use "\string\setfrontcover" insteed}}
203
204 \setfrontcover{classic}
205
206 \renewcommand{\maketitle}{%
207         \Ifdefined{frontpage}{
208                 \upm@front@setfrontlayout{\Get{frontpage}}{%
209                         \message{************ USE CUSTOM FRONT COVER}
210                         \gdef\upm@front@layout{%
211                                 \begin{titlepage}%
212                                 \Get{frontpage@custom}%
213                                 \end{titlepage}%
214                         }%
215                 }%
216         }%
217         \upm@front@layout}%
218 \newcommand{\makefrontcover}{\maketitle}
219
220 %----------------------------------------
221 % Set the illustration figure on the front page
222 %----------------------------------------
223 %\setfrontillustration[size_factor]{filename}
224 \newcommand{\setfrontillustration}[2][1]{%
225         \Set{frontillustrationsize}{#1}%
226         \Set{frontillustration}{#2}%
227 }
228
229 %----------------------------------------
230 % Clear the illustration figure on the front page
231 %----------------------------------------
232 %\clearfrontillustration
233 \newcommand{\clearfrontillustration}{%
234         \Set{frontillustrationsize}{1}%
235         \Unset{frontillustration}%
236 }
237
238 %----------------------------------------
239 % SUPPORT FOR TIKZEXTERNAL
240 %----------------------------------------
241 % See issue #25
242 \AtBeginDocument{
243         \@ifundefined{tikzexternalrealjob}{}{%
244                 \message{*** Overriding the document specification for TikZ externalizer.}%
245                 \ifthenelse{\equal{\jobname}{\tikzexternalrealjob}}{}{%
246                         \gdef\maketitle{}%
247                 }%
248         }%
249 }
250
251 \endinput