1 % Package for Unified Process Methodology's documents
3 % Copyright (c) 2006-2013 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 \global\edef\upm@package@doc@ver{2013/09/29}
22 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
23 \ProvidesPackage{upmethodology-document}[\upm@package@doc@ver]
25 \RequirePackage{upmethodology-p-common}
27 %----------------------------------------
29 %----------------------------------------
30 \def\upm@document@lang@english{%
31 \gdef\upm@lang@@{\message{**** upmethodology-document is using English language ****}}%
32 \gdef\upmcurrentlang{english}%
33 \gdef\upmcurrentlangforbabel{english}%
34 \gdef\upm@lang@project{Project}%
35 \gdef\upm@lang@document{Document}%
36 \gdef\upm@lang@docref{Reference}%
37 \gdef\upm@lang@lastupdate{Last Update}%
38 \gdef\upm@lang@lastupdate@short{Updated}%
39 \gdef\upm@lang@document@summary{Document Summary}%
40 \gdef\upm@lang@status{Status}%
41 \gdef\upm@lang@document@authors{Authors}%
42 \gdef\upm@lang@document@informed{Informed People}%
43 \gdef\upm@lang@document@validators{Validators}%
44 \gdef\upm@lang@document@names{Names}%
45 \gdef\upm@lang@document@comments{Comments}%
46 \gdef\upm@lang@document@emails{Emails}%
47 \gdef\upm@lang@document@initials{Initials}%
48 \gdef\upm@lang@document@abstract{Abstract}%
49 \gdef\upm@lang@document@keywords{Key-words}%
50 \gdef\upm@lang@document@copyright@purpose{This document describes the \theupmproject\ project\Ifnotempty{\theupmsubproject}{ and its \theupmsubproject\ subproject}.}%
51 \gdef\upm@lang@document@copyright@tex{\TeX\ is a trademark of the American Mathematical Society.}%
52 \gdef\upm@lang@document@copyright@upmethodology{\texttt{tex-upmethodology} is owned by St\'ephane Galland, \arakhneorg, France.}%
53 \gdef\upm@lang@document@copyright@madewith{This document was realised with \LaTeX\ and \texttt{tex-upmethodology}.}%
54 \gdef\upm@lang@document@copyright@trademarks{This document is published by the \theupmformattedpublisher. All right reserved. No part of this publication may be reproduced, stored in a retreival system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publishers.}
55 \gdef\upm@lang@document@copyright@printedin{Printed in \theupmprintedin.}
57 \def\upm@document@lang@french{%
58 \gdef\upm@lang@@{\message{**** upmethodology-document is using French language ****}}%
59 \gdef\upmcurrentlang{french}%
60 \gdef\upmcurrentlangforbabel{frenchb}%
61 \gdef\upm@lang@project{Projet}%
62 \gdef\upm@lang@document{Document}%
63 \gdef\upm@lang@docref{R\'ef\'erence}%
64 \gdef\upm@lang@lastupdate{Derni\`ere modification}%
65 \gdef\upm@lang@lastupdate@short{Modifi\'e}%
66 \gdef\upm@lang@document@summary{Synoptique}%
67 \gdef\upm@lang@status{Statut}%
68 \gdef\upm@lang@document@authors{Auteurs}%
69 \gdef\upm@lang@document@comments{Commentaires}%
70 \gdef\upm@lang@document@informed{Pour information}%
71 \gdef\upm@lang@document@validators{Validateurs}%
72 \gdef\upm@lang@document@names{Noms}%
73 \gdef\upm@lang@document@emails{Emails}%
74 \gdef\upm@lang@document@initials{Initiales}%
75 \gdef\upm@lang@document@abstract{R\'esum\'e}%
76 \gdef\upm@lang@document@keywords{Mots-cl\'es}%
77 \gdef\upm@lang@document@copyright@purpose{Ce document d\'ecrit le projet \theupmproject\Ifnotempty{\theupmsubproject}{ et son sous-projet \theupmsubproject}.}%
78 \gdef\upm@lang@document@copyright@tex{\TeX\ et \LaTeX\ sont des marques de la Soci\'et\'e Am\'ericaine de Math\'ematiques.}%
79 \gdef\upm@lang@document@copyright@upmethodology{\texttt{tex-upmethodology} est la propri\'et\'e de St\'ephane Galland, \arakhneorg, France.}%
80 \gdef\upm@lang@document@copyright@madewith{Ce document a \'et\'e r\'ealis\'e avec \LaTeX\ et \texttt{tex-upmethodology}.}%
81 \gdef\upm@lang@document@copyright@trademarks{Ce document est publi\'e par \theupmformattedpublisher. Tous droits r\'eserv\'es. \par Le Code de la propri\'et\'e intellectuelle n'autorisant, aux termes de l'article L.122-5, 2\textdegree et 3\textdegree a), d'une part, que les ``copies ou reproductions strictement r\'eserv\'ees \`a l'usage priv\'e du copiste et non destin\'ees \`a une utilisation collective'' et, d'autre part, que les analyses et les courtes citations dans un but d'exemple et d'illustation, ``toute repr\'esentation ou reproduction int\'egrale ou partielle faite sans le consentement de l'auteur ou de ses ayants droit ou ayants cause est illicite'' (art. L.122-4). \par Cette repr\'esentation ou reproduction, par quelque proc\'ed\'e que ce soit, constiturait donc une contrefa\c{c}on sanctionn\'ee par les articles L.335-2 et suivants du Code de la propri\'et\'e intellectuelle.}
82 \gdef\upm@lang@document@copyright@printedin{Imprim\'e en \theupmprintedin.}
86 %----------------------------------------
88 %----------------------------------------
89 \DeclareOption{french}{%
90 \upm@document@lang@french
92 \DeclareOption{francais}{%
93 \upm@document@lang@french
95 \DeclareOption{english}{%
96 \upm@document@lang@english
98 \ExecuteOptions{english}
103 \RequirePackage[\upmcurrentlangforbabel]{babel}
104 \RequirePackage{vmargin}
106 \RequirePackage{upmethodology-extension}
107 \RequirePackage{upmethodology-fmt}
108 \RequirePackage{upmethodology-version}
110 %----------------------------------------
111 % Ensure that frenchb (included by babel)
112 % does not use compact versions of lists
114 %----------------------------------------
116 \newlength\listendskip
117 \listendskip=\parskip
120 %----------------------------------------
121 % DOCUMENT MANAGEMENT
122 %----------------------------------------
125 % Declare a project's document
126 %\declaredocument{project}{name}{ref}
127 \newcommand{\declaredocument}[3]{%
128 \gdef\theupmproject{#1}%
129 \gdef\theupmsubproject{}%
130 \gdef\theupmdocname{#2}%
131 \gdef\theupmdocref{#3}%
135 % Declare a project's document
136 %\declaredocumentex{project}{subproject}{name}{ref}
137 \newcommand{\declaredocumentex}[4]{%
138 \gdef\theupmproject{#1}%
139 \gdef\theupmsubproject{#2}%
140 \gdef\theupmdocname{#3}%
141 \gdef\theupmdocref{#4}%
145 % Display the summary of the document
146 %\upmdocumentsummary[width]
147 \newcommand{\upmdocumentsummary}[1][\linewidth]{%
148 \noindent\begin{mtabular}[#1]{2}{|l|X|}%
149 \tabulartitle{\upm@lang@document@summary}%
150 \upm@lang@project & \theupmproject\Ifnotempty{\theupmsubproject}{ -- \theupmsubproject} \\
151 \upm@lang@document & \theupmdocname \\
152 \upm@lang@docref & \theupmdocref \\
153 \upm@lang@version & \theupmversion \\
154 \upm@lang@lastupdate & \theupmdate \\
156 \end{mtabular}\par\vspace{.5cm}%
160 % Display the the document information on a page
162 \newcommand{\upmdocinfopage}{
163 \thispagestyle{plain}
164 \upmdocumentsummary\upmdocumentauthors\upmdocumentvalidators\upmdocumentinformedpeople\vfill\upmhistory\clearpage%
168 % Display the publication pag for the document
170 \newcommand{\upmpublicationpage}{
171 \thispagestyle{empty}%
172 \upmpublicationminipage%
174 \newcommand{\upmpublicationminipage}{
175 \if@twoside\ifodd\c@page\clearpage\fi\fi%
178 \upm@lang@document@copyright@purpose
181 \upm@lang@document@copyright@tex
183 \upm@lang@document@copyright@upmethodology
189 \upm@lang@document@copyright@madewith
192 Copyright~\copyright~\upmcopyrightdate~\theupmformattedcopyrighter.
195 \upm@lang@document@copyright@trademarks \Ifdefined{printed}{\upm@lang@document@copyright@printedin}
198 \upm@lang@docref~: \theupmdocref \\
199 \Ifnotempty{\theupmisbn}{ISBN~:~\theupmisbn\\}
200 \Ifnotempty{\theupmissn}{ISSN~:~\theupmissn\\}
201 \Ifnotempty{\theupmdoi}{DOI~:~\theupmdoi\\}
206 %Name of the project for which this document was written
207 \def\theupmproject{Arakhn\^e Project}
210 %Name of the sub-project for which this document was written
211 \def\theupmsubproject{}
214 %Name of the document
215 \def\theupmdocname{Arakhn\^e Document}
218 %Reference of the document
219 \def\theupmdocref{XXX}
224 \newcommand{\theupmsmalldoclogo}{\Get{smalllogo}}
225 \newcommand{\theupmdoclogo}{\Get{logo}}
228 % Define the name of the logo picture to use
229 \newcommand{\defupmsmalllogo}[1]{\Set{smalllogo}{#1}}
230 \newcommand{\defupmlogo}[1]{\Set{logo}{#1}}
233 %Full name of the document
234 \def\theupmfulldocname{%
236 \Ifnotempty{\theupmsubproject}{/\theupmsubproject}%
237 \Ifnotempty{\theupmdocname}{ -- \theupmdocname}%
241 % Declare a document's abstract
242 %\setdocabstract[lang]{text}
243 \newcommand{\setdocabstract}[2][\upmcurrentlang]{%
244 \ifthenelse{\equal{#1}{\upmcurrentlang}}{
245 \gdef\theupmdocabstract{#2}}{}%
246 \global\@namedef{theupmdocabstract#1}{#2}%
250 % Declare a document's key-words
251 %\setdockeywords[lang]{words}
252 \newcommand{\setdockeywords}[2][\upmcurrentlang]{%
253 \ifthenelse{\equal{#1}{\upmcurrentlang}}{
254 \gdef\theupmdockeywords{#2}}{}%
255 \global\@namedef{theupmdockeywords#1}{#2}%
259 %Abstract of the document
260 \def\theupmdocabstract{}
263 %Key-words of the document
264 \def\theupmdockeywords{}
266 %----------------------------------------
268 %----------------------------------------
270 \newif\ifupm@document@author@tab@hascomment
271 \upm@document@author@tab@hascommentfalse
272 \def\upm@document@author@tab{}
273 \def\upm@document@author@tab@commented{}
279 \newif\ifupm@document@author@isauthor
280 \gdef\upm@document@author@authornames{}
281 \newcommand{\ifdocumentauthor}[3]{%
282 \upm@document@author@isauthorfalse%
283 \@for\upm@document@author@isauthor@tmp:=\upm@document@author@authornames\do{%
284 \ifupm@document@author@isauthor%
286 \ifthenelse{\equal{#1}{\upm@document@author@isauthor@tmp}}{%
287 \upm@document@author@isauthortrue%
291 \ifupm@document@author@isauthor{#2}\else{#3}\fi%
296 %\addauthor[email]{firstname}{name}
297 %\addauthor*[email]{firstname}{name}{comment}
298 \def\addauthor{\@ifstar\upm@document@addauthorstar\upm@document@addauthor}
299 \newcommand{\upm@document@addauthor}[3][]{%
300 \lowercase{\xdef\upm@document@author@authornames{#3,\upm@document@author@authornames}}%
301 \protected@xdef\theauthorlist{\theauthorlist\protect\Ifnotempty{\theauthorlist}{,} \protect\upmmakename{#2}{#3}{~}}
303 \global\protected@edef\upm@document@author@tab@commented{\upm@document@author@tab@commented \protect\upmmakename{#2}{#3}{~} &
304 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\}
306 \ifupm@document@author@tab@hascomment\else
307 \global\protected@edef\upm@document@author@tab{\upm@document@author@tab \protect\upmmakename{#2}{#3}{~} &
308 \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\}
311 \newcommand{\upm@document@addauthorstar}[4][]{%
312 \lowercase{\xdef\upm@document@author@authornames{#3,\upm@document@author@authornames}}%
313 \global\protected@edef\theauthorlist{\theauthorlist\protect\Ifnotempty{\theauthorlist}{,} \protect\upmmakename{#2}{#3}{~}}
315 \global\let\upm@document@author@tab\relax
317 \global\protected@edef\upm@document@author@tab@commented{\upm@document@author@tab@commented \protect\upmmakename{#2}{#3}{~} &
318 #4 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\}
320 \upm@document@author@tab@hascommenttrue
324 % Display the summary of the authors
325 %\upmdocumentauthors[width]
326 \newcommand{\upmdocumentauthors}[1][\linewidth]{%
327 \ifupm@document@author@tab@hascomment%
328 \Ifnotempty{\upm@document@author@tab@commented}{%
329 \noindent\expandafter\begin{mtabular}[#1]{3}{|X|l|c|}%
330 \tabulartitle{\upm@lang@document@authors}%
331 \tabularheader{\upm@lang@document@names}{\upm@lang@document@comments}{\upm@lang@document@emails}%
332 \upm@document@author@tab@commented
334 \expandafter\end{mtabular}\par\vspace{.5cm}}%
336 \Ifnotempty{\upm@document@author@tab}{%
337 \noindent\expandafter\begin{mtabular}[#1]{2}{|X|c|}%
338 \tabulartitle{\upm@lang@document@authors}%
339 \tabularheader{\upm@lang@document@names}{\upm@lang@document@emails}%
340 \upm@document@author@tab
342 \expandafter\end{mtabular}\par\vspace{.5cm}}%
346 %----------------------------------------
347 % VALIDATOR MANAGEMENT
348 %----------------------------------------
350 \newif\ifupm@document@validator@tab@hascomment
351 \upm@document@validator@tab@hascommentfalse
352 \def\upm@document@validator@tab{}
353 \def\upm@document@validator@tab@commented{}
356 \def\thevalidatorlist{}
360 %\addvalidator[email]{firstname}{name}
361 %\addvalidator*[email]{firstname}{name}{comment}
362 \def\addvalidator{\@ifstar\upm@document@addvalidatorstar\upm@document@addvalidator}
363 \newcommand{\upm@document@addvalidator}[3][]{%
364 \global\protected@edef\thevalidatorlist{\thevalidatorlist\protect\Ifnotempty{\thevalidatorlist}{,} \protect\upmmakename{#2}{#3}{~}}
366 \global\protected@edef\upm@document@validator@tab@commented{\upm@document@validator@tab@commented \protect\upmmakename{#2}{#3}{~} &
367 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} & \protect\\}
369 \ifupm@document@validator@tab@hascomment\else
370 \global\protected@edef\upm@document@validator@tab{\upm@document@validator@tab \protect\upmmakename{#2}{#3}{~} &
371 \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} & \protect\\}
374 \newcommand{\upm@document@addvalidatorstar}[4][]{%
375 \global\protected@edef\thevalidatorlist{\thevalidatorlist\protect\Ifnotempty{\thevalidatorlist}{,} \protect\upmmakename{#2}{#3}{~}}
377 \global\let\upm@document@validator@tab\relax
379 \global\protected@edef\upm@document@validator@tab@commented{\upm@document@validator@tab@commented \protect\upmmakename{#2}{#3}{~} &
380 #4 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} & \protect\\}
382 \upm@document@validator@tab@hascommenttrue
386 % Display the summary of the validators
387 %\upmdocumentvalidators[width]
388 \newcommand{\upmdocumentvalidators}[1][\linewidth]{%
389 \ifupm@document@validator@tab@hascomment%
390 \Ifnotempty{\upm@document@validator@tab@commented}{%
391 \noindent\expandafter\begin{mtabular}[#1]{4}{|X|l|c|p{3cm}|}%
392 \tabulartitle{\upm@lang@document@validators}%
393 \tabularheader{\upm@lang@document@names}{\upm@lang@document@comments}{\upm@lang@document@emails}{\upm@lang@document@initials}%
394 \upm@document@validator@tab@commented
396 \expandafter\end{mtabular}\par\vspace{.5cm}}%
398 \Ifnotempty{\upm@document@validator@tab}{%
399 \noindent\expandafter\begin{mtabular}[#1]{3}{|X|c|p{3cm}|}%
400 \tabulartitle{\upm@lang@document@validators}%
401 \tabularheader{\upm@lang@document@names}{\upm@lang@document@emails}{\upm@lang@document@initials}%
402 \upm@document@validator@tab
404 \expandafter\end{mtabular}\par\vspace{.5cm}}%
410 %Add an author/validator
411 %\addauthorvalidator[email]{firstname}{name}
412 %\addauthorvalidator*[email]{firstname}{name}{comment}
413 \def\addauthorvalidator{\@ifstar\upm@document@addauthorvalidatorstar\upm@document@addauthorvalidator}
414 \newcommand{\upm@document@addauthorvalidator}[3][]{%
415 \addauthor[#1]{#2}{#3}\addvalidator[#1]{#2}{#3}%
417 \newcommand{\upm@document@addauthorvalidatorstar}[4][]{%
418 \addauthor*[#1]{#2}{#3}{#4}\addvalidator*[#1]{#2}{#3}{#4}%
421 %----------------------------------------
422 % INFORMED MANAGEMENT
423 %----------------------------------------
425 \newif\ifupm@document@informed@tab@hascomment
426 \upm@document@informed@tab@hascommentfalse
427 \def\upm@document@informed@tab{}
428 \def\upm@document@informed@tab@commented{}
431 \def\theinformedlist{}
435 %\addinformed[email]{firstname}{name}
436 %\addinformed*[email]{firstname}{name}{comment}
437 \def\addinformed{\@ifstar\upm@document@addinformedstar\upm@document@addinformed}
438 \newcommand{\upm@document@addinformed}[3][]{%
439 \global\protected@edef\theinformedlist{\theinformedlist\protect\Ifnotempty{\theinformedlist}{,} \protect\upmmakename{#2}{#3}{~}}
441 \global\protected@edef\upm@document@informed@tab@commented{\upm@document@informed@tab@commented \protect\upmmakename{#2}{#3}{~} &
442 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\}
444 \ifupm@document@informed@tab@hascomment\else
445 \global\protected@edef\upm@document@informed@tab{\upm@document@informed@tab \protect\upmmakename{#2}{#3}{~} &
446 \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\}
449 \newcommand{\upm@document@addinformedstar}[4][]{%
450 \global\protected@edef\theinformedlist{\theinformedlist\protect\Ifnotempty{\theinformedlist}{,} \protect\upmmakename{#2}{#3}{~}}
452 \global\let\upm@document@informed@tab\relax
454 \global\protected@edef\upm@document@informed@tab@commented{\upm@document@informed@tab@commented \protect\upmmakename{#2}{#3}{~} &
455 #4 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\}
457 \upm@document@informed@tab@hascommenttrue
461 % Display the summary of the informed people
462 %\upmdocumentinformedpeople[width]
463 \newcommand{\upmdocumentinformedpeople}[1][\linewidth]{%
464 \ifupm@document@validator@tab@hascomment%
465 \Ifnotempty{\upm@document@informed@tab@commented}{%
466 \noindent\expandafter\begin{mtabular}[#1]{3}{|X|l|c|}%
467 \tabulartitle{\upm@lang@document@informed}%
468 \tabularheader{\upm@lang@document@names}{\upm@lang@document@comments}{\upm@lang@document@emails}%
469 \upm@document@informed@tab@commented
471 \expandafter\end{mtabular}\par\vspace{.5cm}}%
473 \Ifnotempty{\upm@document@informed@tab}{%
474 \noindent\expandafter\begin{mtabular}[#1]{2}{|X|c|}%
475 \tabulartitle{\upm@lang@document@informed}%
476 \tabularheader{\upm@lang@document@names}{\upm@lang@document@emails}%
477 \upm@document@informed@tab
479 \expandafter\end{mtabular}\par\vspace{.5cm}}%
483 %----------------------------------------
484 % PUBLISHER, COPYRIGHT, PRINTING...
485 %----------------------------------------
487 \gdef\theupmcopyrighter{\Get{copyrighter}}
488 \gdef\theupmpublisher{\Get{publisher}}
489 \gdef\theupmprintedin{\Get{printedin}}
493 \gdef\theupmpublishingdate{}
495 \newcommand{\theupmformattedpublisher}{\Ifelsedefined{publisher}{\theupmpublisher}{\textcolor{red}{???}}}
496 \newcommand{\theupmformattedcopyrighter}{\Ifelsedefined{copyrighter}{\theupmcopyrighter}{\textcolor{red}{???}}}
499 %Set the publisher identity
501 \newcommand{\setpublisher}[1]{\Set{publisher}{#1}}
504 %Set the copyrighter identity
505 %\setcopyrighter{name}
506 \newcommand{\setcopyrighter}[1]{\Set{copyrighter}{#1}}
509 %Set the address where this document is printed
510 %\setprintingaddress{address}
511 \newcommand{\setprintingaddress}[1]{\Set{printedin}{#1}}
516 \newcommand{\setisbn}[1]{%
517 \gdef\theupmisbn{#1}%
523 \newcommand{\setissn}[1]{%
524 \gdef\theupmissn{#1}%
530 \newcommand{\setdoi}[1]{%
534 %----------------------------------------
536 %----------------------------------------
539 \ifthenelse{\equal{\theupmstatus}{\upmrestricted}}{
540 \edef\upm@doc@tmp@watermark{\uppercase{\upm@lang@restricted}}
541 \RequirePackage{draftwatermark}
542 \SetWatermarkText{\upm@doc@tmp@watermark}
543 \SetWatermarkScale{\Get{watermarksize}}