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

Private GIT Repository
RCE : Update du 9/1/2016
[these_charles_emile.git] / upmethodology-extension.sty
1 % Package for Unified Process Methodology's extensions
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 % Creation date: 2009-10-24
21 % Modifications:
22 %   2012-09-21   "(c)" -> "\copyright"
23 %   2009-11-03   \If* are marked as \long.
24 %   2006-10-30   Bug fix: provides "upmethodology-extension" insteed of "upmethodology-document".
25 %   2006-10-29   Allow to override the default font.
26 %   2006-10-27   Clean the API
27 %
28
29 \global\edef\upm@package@ext@ver{2012/09/21}
30
31 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
32 \ProvidesPackage{upmethodology-extension}[\upm@package@ext@ver]
33
34 \RequirePackage{upmethodology-p-common}
35
36 %----------------------------------------
37 % TEST MACROS
38 %----------------------------------------
39 \long\def\Ifdefined#1#2{\@ifundefined{upmext@extension@value@#1}{}{#2}}
40 \long\def\Ifelsedefined#1#2#3{\@ifundefined{upmext@extension@value@#1}{#3}{#2}}
41 \long\def\Ifundefined#1#2{\@ifundefined{upmext@extension@value@#1}{#2}{}}
42 \long\def\Ifelseundefined#1#2#3{\@ifundefined{upmext@extension@value@#1}{#2}{#3}}
43
44 %----------------------------------------
45 % EXTENSION MANAGEMENT
46 %----------------------------------------
47
48 \newif\ifupm@extension@savealllang\upm@extension@savealllangfalse
49
50 \newcommand{\Get}[1]{\@nameuse{upmext@extension@value@#1}}
51 \newcommand{\GetLang}[2]{\@nameuse{upmext@extension@value@#1@#2}}
52
53 \newcommand{\upm@extension@Set}[3][\upmcurrentlang]{%
54         % PREDEFINED FRONT PAGE
55         \ifthenelse{\equal{#2}{frontpage}}{%
56                 \gdef\upmext@extension@value@frontpage{#3}%
57                 \global\let\upmext@extension@value@frontpage@custom\relax%
58         }{%                     
59         % CUSTOM BACK PAGE
60         \ifthenelse{\equal{#2}{backpage}}{%
61                 \ifthenelse{\equal{\upmcurrentlang}{#1}}{%
62                         \gdef\upmext@extension@value@backpage{#3}%
63                 }{}%
64         }{%                     
65         % CUSTOM FRONT PAGE
66         \ifthenelse{\equal{#2}{cfrontpage}}{%
67                 \ifthenelse{\equal{\upmcurrentlang}{#1}}{%
68                         \gdef\upmext@extension@value@frontpage{custom}%
69                         \gdef\upmext@extension@value@frontpage@custom{#3}%
70                 }{}%
71         }{%                     
72                 \ifthenelse{\equal{\upmcurrentlang}{#1}}{%
73                         \message{*** define extension value #2 ****}%
74                         \global\@namedef{upmext@extension@value@#2}{#3}%
75                         }{}%
76                 \ifupm@extension@savealllang%
77                         \global\@namedef{upmext@extension@value@#2@#1}{#3}%
78                 \fi
79         }}}%
80 }
81 \let\Set\upm@extension@Set
82
83 \newcommand{\Unset}[2][\upmcurrentlang]{%
84         \ifthenelse{\equal{\upmcurrentlang}{#1}}{%
85                 \message{*** undefine extension value #2 ****}%
86                 \global\expandafter\let\csname upmext@extension@value@#2\endcsname\@undefined%
87                 \ifupm@extension@savealllang%
88                         \global\expandafter\let\csname upmext@extension@value@#2@#1\endcsname\@undefined%
89                 \fi%
90         }{}%
91 }
92
93 \newcommand{\DeclareCopyright}[5][\upmcurrentlang]{%
94         \ifthenelse{\equal{\upmcurrentlang}{#1}}{%
95                 \Set{copyright}{Copyright {(c)} #3 #4.}%
96                 \message{*** style extension #2, \Get{copyright} ****}%
97                 \Set{trademarks}{#5}%
98         }{}%
99 }
100
101 \newlength{\upmext@tmp@putx}
102 \def\Put(#1,#2){%
103         \setlength{\upmext@tmp@putx}{#1\unitlength}%
104         \if@twoside\ifodd\c@page\else\addtolength{\upmext@tmp@putx}{28\unitlength}\fi\fi%
105         \put(\strip@pt\upmext@tmp@putx,#2)}
106
107 %-----
108 % Use the specified extension
109 %\UseExtension{extension_name}
110 \newcommand{\UseExtension}[1]{%
111         \message{**** including upm extension #1 (upmext-#1.cfg) ****}%
112         \input{upmext-#1.cfg}%
113 }
114
115 %------------
116 % Default declarations
117 \Set{frontillustrationsize}{1}
118 \Set{watermarksize}{1}
119 \Unset{publisher}
120 \Unset{copyrighter}
121 \Unset{printedin}
122
123 \endinput