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
118 \iflanguage{french}{%
119 \addto\extrasfrench{%
120 \let\upm@document@enditemizeFB\enditemizeFB%
121 \def\enditemizeFB{\upm@document@enditemizeFB\vspace{\listendskip}}%
122 \let\upm@document@enditemizeORI\enditemizeORI%
123 \def\enditemizeFB{\upm@document@enditemizeORI\vspace{\listendskip}}%
125 \addto\noextrasfrench{%
126 \let\upm@document@enditemizeFB\enditemizeFB%
127 \def\enditemizeFB{\upm@document@enditemizeFB\vspace{\listendskip}}%
128 \let\upm@document@enditemizeORI\enditemizeORI%
129 \def\enditemizeFB{\upm@document@enditemizeORI\vspace{\listendskip}}%
133 %----------------------------------------
134 % DOCUMENT MANAGEMENT
135 %----------------------------------------
138 % Declare a project's document
139 %\declaredocument{project}{name}{ref}
140 \newcommand{\declaredocument}[3]{%
141 \gdef\theupmproject{#1}%
142 \gdef\theupmsubproject{}%
143 \gdef\theupmdocname{#2}%
144 \gdef\theupmdocref{#3}%
148 % Declare a project's document
149 %\declaredocumentex{project}{subproject}{name}{ref}
150 \newcommand{\declaredocumentex}[4]{%
151 \gdef\theupmproject{#1}%
152 \gdef\theupmsubproject{#2}%
153 \gdef\theupmdocname{#3}%
154 \gdef\theupmdocref{#4}%
158 % Display the summary of the document
159 %\upmdocumentsummary[width]
160 \newcommand{\upmdocumentsummary}[1][\linewidth]{%
161 \noindent\begin{mtabular}[#1]{2}{|l|X|}%
162 \tabulartitle{\upm@lang@document@summary}%
163 \upm@lang@project & \theupmproject\Ifnotempty{\theupmsubproject}{ -- \theupmsubproject} \\
164 \upm@lang@document & \theupmdocname \\
165 \upm@lang@docref & \theupmdocref \\
166 \upm@lang@version & \theupmversion \\
167 \upm@lang@lastupdate & \theupmdate \\
169 \end{mtabular}\par\vspace{.5cm}%
173 % Display the the document information on a page
175 \newcommand{\upmdocinfopage}{
176 \thispagestyle{plain}
177 \upmdocumentsummary\upmdocumentauthors\upmdocumentvalidators\upmdocumentinformedpeople\vfill\upmhistory\clearpage%
181 % Display the publication pag for the document
183 \newcommand{\upmpublicationpage}{
184 \thispagestyle{empty}%
185 \upmpublicationminipage%
187 \newcommand{\upmpublicationminipage}{
188 \if@twoside\ifodd\c@page\clearpage\fi\fi%
191 \upm@lang@document@copyright@purpose
194 \upm@lang@document@copyright@tex
196 \upm@lang@document@copyright@upmethodology
202 \upm@lang@document@copyright@madewith
205 Copyright~\copyright~\upmcopyrightdate~\theupmformattedcopyrighter.
208 \upm@lang@document@copyright@trademarks \Ifdefined{printed}{\upm@lang@document@copyright@printedin}
211 \upm@lang@docref~: \theupmdocref \\
212 \Ifnotempty{\theupmisbn}{ISBN~:~\theupmisbn\\}
213 \Ifnotempty{\theupmissn}{ISSN~:~\theupmissn\\}
214 \Ifnotempty{\theupmdoi}{DOI~:~\theupmdoi\\}
219 %Name of the project for which this document was written
220 \def\theupmproject{Arakhn\^e Project}
223 %Name of the sub-project for which this document was written
224 \def\theupmsubproject{}
227 %Name of the document
228 \def\theupmdocname{Arakhn\^e Document}
231 %Reference of the document
232 \def\theupmdocref{XXX}
237 \newcommand{\theupmsmalldoclogo}{\Get{smalllogo}}
238 \newcommand{\theupmdoclogo}{\Get{logo}}
241 % Define the name of the logo picture to use
242 \newcommand{\defupmsmalllogo}[1]{\Set{smalllogo}{#1}}
243 \newcommand{\defupmlogo}[1]{\Set{logo}{#1}}
246 %Full name of the document
247 \def\theupmfulldocname{%
249 \Ifnotempty{\theupmsubproject}{/\theupmsubproject}%
250 \Ifnotempty{\theupmdocname}{ -- \theupmdocname}%
254 % Declare a document's abstract
255 %\setdocabstract[lang]{text}
256 \newcommand{\setdocabstract}[2][\upmcurrentlang]{%
257 \ifthenelse{\equal{#1}{\upmcurrentlang}}{
258 \gdef\theupmdocabstract{#2}}{}%
259 \global\@namedef{theupmdocabstract#1}{#2}%
263 % Declare a document's key-words
264 %\setdockeywords[lang]{words}
265 \newcommand{\setdockeywords}[2][\upmcurrentlang]{%
266 \ifthenelse{\equal{#1}{\upmcurrentlang}}{
267 \gdef\theupmdockeywords{#2}}{}%
268 \global\@namedef{theupmdockeywords#1}{#2}%
272 %Abstract of the document
273 \def\theupmdocabstract{}
276 %Key-words of the document
277 \def\theupmdockeywords{}
279 %----------------------------------------
281 %----------------------------------------
283 \newif\ifupm@document@author@tab@hascomment
284 \upm@document@author@tab@hascommentfalse
285 \def\upm@document@author@tab{}
286 \def\upm@document@author@tab@commented{}
292 \newif\ifupm@document@author@isauthor
293 \gdef\upm@document@author@authornames{}
294 \newcommand{\ifdocumentauthor}[3]{%
295 \upm@document@author@isauthorfalse%
296 \@for\upm@document@author@isauthor@tmp:=\upm@document@author@authornames\do{%
297 \ifupm@document@author@isauthor%
299 \ifthenelse{\equal{#1}{\upm@document@author@isauthor@tmp}}{%
300 \upm@document@author@isauthortrue%
304 \ifupm@document@author@isauthor{#2}\else{#3}\fi%
309 %\addauthor[email]{firstname}{name}
310 %\addauthor*[email]{firstname}{name}{comment}
311 \def\addauthor{\@ifstar\upm@document@addauthorstar\upm@document@addauthor}
312 \newcommand{\upm@document@addauthor}[3][]{%
313 \lowercase{\xdef\upm@document@author@authornames{#3,\upm@document@author@authornames}}%
314 \protected@xdef\theauthorlist{\theauthorlist\protect\Ifnotempty{\theauthorlist}{,} \protect\upmmakename{#2}{#3}{~}}
316 \global\protected@edef\upm@document@author@tab@commented{\upm@document@author@tab@commented \protect\upmmakename{#2}{#3}{~} &
317 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\}
319 \ifupm@document@author@tab@hascomment\else
320 \global\protected@edef\upm@document@author@tab{\upm@document@author@tab \protect\upmmakename{#2}{#3}{~} &
321 \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\}
324 \newcommand{\upm@document@addauthorstar}[4][]{%
325 \lowercase{\xdef\upm@document@author@authornames{#3,\upm@document@author@authornames}}%
326 \global\protected@edef\theauthorlist{\theauthorlist\protect\Ifnotempty{\theauthorlist}{,} \protect\upmmakename{#2}{#3}{~}}
328 \global\let\upm@document@author@tab\relax
330 \global\protected@edef\upm@document@author@tab@commented{\upm@document@author@tab@commented \protect\upmmakename{#2}{#3}{~} &
331 #4 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\}
333 \upm@document@author@tab@hascommenttrue
337 % Display the summary of the authors
338 %\upmdocumentauthors[width]
339 \newcommand{\upmdocumentauthors}[1][\linewidth]{%
340 \ifupm@document@author@tab@hascomment%
341 \Ifnotempty{\upm@document@author@tab@commented}{%
342 \noindent\expandafter\begin{mtabular}[#1]{3}{|X|l|c|}%
343 \tabulartitle{\upm@lang@document@authors}%
344 \tabularheader{\upm@lang@document@names}{\upm@lang@document@comments}{\upm@lang@document@emails}%
345 \upm@document@author@tab@commented
347 \expandafter\end{mtabular}\par\vspace{.5cm}}%
349 \Ifnotempty{\upm@document@author@tab}{%
350 \noindent\expandafter\begin{mtabular}[#1]{2}{|X|c|}%
351 \tabulartitle{\upm@lang@document@authors}%
352 \tabularheader{\upm@lang@document@names}{\upm@lang@document@emails}%
353 \upm@document@author@tab
355 \expandafter\end{mtabular}\par\vspace{.5cm}}%
359 %----------------------------------------
360 % VALIDATOR MANAGEMENT
361 %----------------------------------------
363 \newif\ifupm@document@validator@tab@hascomment
364 \upm@document@validator@tab@hascommentfalse
365 \def\upm@document@validator@tab{}
366 \def\upm@document@validator@tab@commented{}
369 \def\thevalidatorlist{}
373 %\addvalidator[email]{firstname}{name}
374 %\addvalidator*[email]{firstname}{name}{comment}
375 \def\addvalidator{\@ifstar\upm@document@addvalidatorstar\upm@document@addvalidator}
376 \newcommand{\upm@document@addvalidator}[3][]{%
377 \global\protected@edef\thevalidatorlist{\thevalidatorlist\protect\Ifnotempty{\thevalidatorlist}{,} \protect\upmmakename{#2}{#3}{~}}
379 \global\protected@edef\upm@document@validator@tab@commented{\upm@document@validator@tab@commented \protect\upmmakename{#2}{#3}{~} &
380 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} & \protect\\}
382 \ifupm@document@validator@tab@hascomment\else
383 \global\protected@edef\upm@document@validator@tab{\upm@document@validator@tab \protect\upmmakename{#2}{#3}{~} &
384 \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} & \protect\\}
387 \newcommand{\upm@document@addvalidatorstar}[4][]{%
388 \global\protected@edef\thevalidatorlist{\thevalidatorlist\protect\Ifnotempty{\thevalidatorlist}{,} \protect\upmmakename{#2}{#3}{~}}
390 \global\let\upm@document@validator@tab\relax
392 \global\protected@edef\upm@document@validator@tab@commented{\upm@document@validator@tab@commented \protect\upmmakename{#2}{#3}{~} &
393 #4 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} & \protect\\}
395 \upm@document@validator@tab@hascommenttrue
399 % Display the summary of the validators
400 %\upmdocumentvalidators[width]
401 \newcommand{\upmdocumentvalidators}[1][\linewidth]{%
402 \ifupm@document@validator@tab@hascomment%
403 \Ifnotempty{\upm@document@validator@tab@commented}{%
404 \noindent\expandafter\begin{mtabular}[#1]{4}{|X|l|c|p{3cm}|}%
405 \tabulartitle{\upm@lang@document@validators}%
406 \tabularheader{\upm@lang@document@names}{\upm@lang@document@comments}{\upm@lang@document@emails}{\upm@lang@document@initials}%
407 \upm@document@validator@tab@commented
409 \expandafter\end{mtabular}\par\vspace{.5cm}}%
411 \Ifnotempty{\upm@document@validator@tab}{%
412 \noindent\expandafter\begin{mtabular}[#1]{3}{|X|c|p{3cm}|}%
413 \tabulartitle{\upm@lang@document@validators}%
414 \tabularheader{\upm@lang@document@names}{\upm@lang@document@emails}{\upm@lang@document@initials}%
415 \upm@document@validator@tab
417 \expandafter\end{mtabular}\par\vspace{.5cm}}%
423 %Add an author/validator
424 %\addauthorvalidator[email]{firstname}{name}
425 %\addauthorvalidator*[email]{firstname}{name}{comment}
426 \def\addauthorvalidator{\@ifstar\upm@document@addauthorvalidatorstar\upm@document@addauthorvalidator}
427 \newcommand{\upm@document@addauthorvalidator}[3][]{%
428 \addauthor[#1]{#2}{#3}\addvalidator[#1]{#2}{#3}%
430 \newcommand{\upm@document@addauthorvalidatorstar}[4][]{%
431 \addauthor*[#1]{#2}{#3}{#4}\addvalidator*[#1]{#2}{#3}{#4}%
434 %----------------------------------------
435 % INFORMED MANAGEMENT
436 %----------------------------------------
438 \newif\ifupm@document@informed@tab@hascomment
439 \upm@document@informed@tab@hascommentfalse
440 \def\upm@document@informed@tab{}
441 \def\upm@document@informed@tab@commented{}
444 \def\theinformedlist{}
448 %\addinformed[email]{firstname}{name}
449 %\addinformed*[email]{firstname}{name}{comment}
450 \def\addinformed{\@ifstar\upm@document@addinformedstar\upm@document@addinformed}
451 \newcommand{\upm@document@addinformed}[3][]{%
452 \global\protected@edef\theinformedlist{\theinformedlist\protect\Ifnotempty{\theinformedlist}{,} \protect\upmmakename{#2}{#3}{~}}
454 \global\protected@edef\upm@document@informed@tab@commented{\upm@document@informed@tab@commented \protect\upmmakename{#2}{#3}{~} &
455 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\}
457 \ifupm@document@informed@tab@hascomment\else
458 \global\protected@edef\upm@document@informed@tab{\upm@document@informed@tab \protect\upmmakename{#2}{#3}{~} &
459 \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\}
462 \newcommand{\upm@document@addinformedstar}[4][]{%
463 \global\protected@edef\theinformedlist{\theinformedlist\protect\Ifnotempty{\theinformedlist}{,} \protect\upmmakename{#2}{#3}{~}}
465 \global\let\upm@document@informed@tab\relax
467 \global\protected@edef\upm@document@informed@tab@commented{\upm@document@informed@tab@commented \protect\upmmakename{#2}{#3}{~} &
468 #4 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\}
470 \upm@document@informed@tab@hascommenttrue
474 % Display the summary of the informed people
475 %\upmdocumentinformedpeople[width]
476 \newcommand{\upmdocumentinformedpeople}[1][\linewidth]{%
477 \ifupm@document@validator@tab@hascomment%
478 \Ifnotempty{\upm@document@informed@tab@commented}{%
479 \noindent\expandafter\begin{mtabular}[#1]{3}{|X|l|c|}%
480 \tabulartitle{\upm@lang@document@informed}%
481 \tabularheader{\upm@lang@document@names}{\upm@lang@document@comments}{\upm@lang@document@emails}%
482 \upm@document@informed@tab@commented
484 \expandafter\end{mtabular}\par\vspace{.5cm}}%
486 \Ifnotempty{\upm@document@informed@tab}{%
487 \noindent\expandafter\begin{mtabular}[#1]{2}{|X|c|}%
488 \tabulartitle{\upm@lang@document@informed}%
489 \tabularheader{\upm@lang@document@names}{\upm@lang@document@emails}%
490 \upm@document@informed@tab
492 \expandafter\end{mtabular}\par\vspace{.5cm}}%
496 %----------------------------------------
497 % PUBLISHER, COPYRIGHT, PRINTING...
498 %----------------------------------------
500 \gdef\theupmcopyrighter{\Get{copyrighter}}
501 \gdef\theupmpublisher{\Get{publisher}}
502 \gdef\theupmprintedin{\Get{printedin}}
506 \gdef\theupmpublishingdate{}
508 \newcommand{\theupmformattedpublisher}{\Ifelsedefined{publisher}{\theupmpublisher}{\textcolor{red}{???}}}
509 \newcommand{\theupmformattedcopyrighter}{\Ifelsedefined{copyrighter}{\theupmcopyrighter}{\textcolor{red}{???}}}
512 %Set the publisher identity
514 \newcommand{\setpublisher}[1]{\Set{publisher}{#1}}
517 %Set the copyrighter identity
518 %\setcopyrighter{name}
519 \newcommand{\setcopyrighter}[1]{\Set{copyrighter}{#1}}
522 %Set the address where this document is printed
523 %\setprintingaddress{address}
524 \newcommand{\setprintingaddress}[1]{\Set{printedin}{#1}}
529 \newcommand{\setisbn}[1]{%
530 \gdef\theupmisbn{#1}%
536 \newcommand{\setissn}[1]{%
537 \gdef\theupmissn{#1}%
543 \newcommand{\setdoi}[1]{%
547 %----------------------------------------
549 %----------------------------------------
552 \ifthenelse{\equal{\theupmstatus}{\upmrestricted}}{
553 \edef\upm@doc@tmp@watermark{\uppercase{\upm@lang@restricted}}
554 \RequirePackage{draftwatermark}
555 \SetWatermarkText{\upm@doc@tmp@watermark}
556 \SetWatermarkScale{\Get{watermarksize}}