1 % Package for Unified Process Methodology's extensions
3 % Copyright (c) 2006-2009 Stephane GALLAND <galland@arakhne.org>
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.
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.
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.
20 % Creation date: 2009-10-24
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
29 \global\edef\upm@package@ext@ver{2012/09/21}
31 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
32 \ProvidesPackage{upmethodology-extension}[\upm@package@ext@ver]
34 \RequirePackage{upmethodology-p-common}
36 %----------------------------------------
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}}
44 %----------------------------------------
45 % EXTENSION MANAGEMENT
46 %----------------------------------------
48 \newif\ifupm@extension@savealllang\upm@extension@savealllangfalse
50 \newcommand{\Get}[1]{\@nameuse{upmext@extension@value@#1}}
51 \newcommand{\GetLang}[2]{\@nameuse{upmext@extension@value@#1@#2}}
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%
60 \ifthenelse{\equal{#2}{backpage}}{%
61 \ifthenelse{\equal{\upmcurrentlang}{#1}}{%
62 \gdef\upmext@extension@value@backpage{#3}%
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}%
72 \ifthenelse{\equal{\upmcurrentlang}{#1}}{%
73 \message{*** define extension value #2 ****}%
74 \global\@namedef{upmext@extension@value@#2}{#3}%
76 \ifupm@extension@savealllang%
77 \global\@namedef{upmext@extension@value@#2@#1}{#3}%
81 \let\Set\upm@extension@Set
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%
93 \newcommand{\DeclareCopyright}[5][\upmcurrentlang]{%
94 \ifthenelse{\equal{\upmcurrentlang}{#1}}{%
95 \Set{copyright}{Copyright {(c)} #3 #4.}%
96 \message{*** style extension #2, \Get{copyright} ****}%
101 \newlength{\upmext@tmp@putx}
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)}
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}%
116 % Default declarations
117 \Set{frontillustrationsize}{1}
118 \Set{watermarksize}{1}