diff options
Diffstat (limited to 'macros/latex/contrib/upmethodology/src')
16 files changed, 4125 insertions, 0 deletions
diff --git a/macros/latex/contrib/upmethodology/src/UPMVERSION.def b/macros/latex/contrib/upmethodology/src/UPMVERSION.def new file mode 100644 index 0000000000..02b668610d --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/UPMVERSION.def @@ -0,0 +1 @@ +\def\UPMVERSION{20190804} diff --git a/macros/latex/contrib/upmethodology/src/arakhne_org_logo.jpg b/macros/latex/contrib/upmethodology/src/arakhne_org_logo.jpg Binary files differnew file mode 100644 index 0000000000..b49834767c --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/arakhne_org_logo.jpg diff --git a/macros/latex/contrib/upmethodology/src/upm_caution.png b/macros/latex/contrib/upmethodology/src/upm_caution.png Binary files differnew file mode 100644 index 0000000000..892e28aad5 --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upm_caution.png diff --git a/macros/latex/contrib/upmethodology/src/upm_info.png b/macros/latex/contrib/upmethodology/src/upm_info.png Binary files differnew file mode 100644 index 0000000000..ea470f49af --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upm_info.png diff --git a/macros/latex/contrib/upmethodology/src/upm_question.png b/macros/latex/contrib/upmethodology/src/upm_question.png Binary files differnew file mode 100644 index 0000000000..a959004aa7 --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upm_question.png diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-backpage.sty b/macros/latex/contrib/upmethodology/src/upmethodology-backpage.sty new file mode 100644 index 0000000000..32df29b7fc --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upmethodology-backpage.sty @@ -0,0 +1,81 @@ +% Back page for Unified Process Methodology +% +% Copyright (c) 2009-2013 Stephane GALLAND <galland@arakhne.org> +% +% This program is free library; you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or any later version. +% +% This library is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public +% License along with this library; see the file COPYING. If not, +% write to the Free Software Foundation, Inc., 59 Temple Place - Suite +% 330, Boston, MA 02111-1307, USA. + +\global\edef\upm@package@bp@ver{2013/12/14} + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{upmethodology-backpage}[\upm@package@bp@ver] + +\RequirePackage{upmethodology-p-common} + +%----- +% Locales +\def\upm@back@lang@english{ + \gdef\upm@lang@@{\message{**** upmethodology-backpage is using English language ****}}% +} +\def\upm@back@lang@french{ + \gdef\upm@lang@@{\message{**** upmethodology-backpage is using French language ****}}% +} +%---------------------------------------- +% OPTIONS +%---------------------------------------- +\DeclareOption{french}{% + \upm@back@lang@french +} +\DeclareOption{francais}{% + \upm@back@lang@french +} +\DeclareOption{english}{% + \upm@back@lang@english +} +\ExecuteOptions{english} +\ProcessOptions +\upm@lang@@ + +\RequirePackage{upmethodology-extension} + +%---- +% Set the back page layout as the classic layout theme +%\setbackcover{layout_name} +\newcommand{\setbackcover}[1]{% + \ifthenelse{\equal{#1}{none}}{% + \global\let\makebackcover\relax% + }{% + \errmessage{invalid back layout theme: #1}% + }% +} +\newcommand{\setbacklayout}[1]{\errmessage{\string\setbacklayout\ is deprecated. Use \string\setbackcover}} + +\setbackcover{none} + +\AtEndDocument{ + \Ifdefined{backpage}{ + \gdef\makebackcover{ + \ifupmarticleformat\clearpage% + \else + \cleardoublepage% + \if@twoside\thispagestyle{empty}\mbox{}% + \vfill{\Get{backcovermessage}}\clearpage\fi + \fi + \thispagestyle{empty}\Get{backpage} + } + } +} + +\endinput diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-code.sty b/macros/latex/contrib/upmethodology/src/upmethodology-code.sty new file mode 100644 index 0000000000..470a1d3d59 --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upmethodology-code.sty @@ -0,0 +1,143 @@ +% Source Code Description for Unified Process Methodology +% +% Copyright (c) 2006-2007 Stephane GALLAND <galland@arakhne.org> +% +% This program is free library; you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or any later version. +% +% This library is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public +% License along with this library; see the file COPYING. If not, +% write to the Free Software Foundation, Inc., 59 Temple Place - Suite +% 330, Boston, MA 02111-1307, USA. +% +% Creation date: 2006-04-27 +% Modifications: +% 2009-10-30 Clean code. +% + +\global\edef\upm@package@code@ver{2009/10/30} + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{upmethodology-code}[\upm@package@code@ver] + +\RequirePackage{upmethodology-p-common} + +\def\upm@code@eat@spaces#1{#1} +\def\upm@code@makemul#1{\upm@code@eat@spaces{#1}\bgroup\textbf{s}\egroup\xspace} + +%----- +%Language +%0: UML +%1: java +%2: C++ +\newcount\upm@code@current@lang + +\DeclareOption{uml}{\upm@code@current@lang=0} +\DeclareOption{java}{\upm@code@current@lang=1} +\DeclareOption{cpp}{\upm@code@current@lang=2} + +\ExecuteOptions{uml} +\ProcessOptions + +%----- +%Language changes +\newcommand{\upmcodelang}[1]{% + \ifthenelse{\equal{#1}{java}}{% + \upm@code@current@lang=1% + }{% + \ifthenelse{\equal{#1}{cpp}}{% + \upm@code@current@lang=2% + }{% + \upm@code@current@lang=0% + }% + }% + \upm@code@declarations% +} + +\def\upm@code@declarations { +%----- +%PROTOTYPES +\gdef\jclass##1{\mbox{\textsc{##1}}\xspace} +\gdef\jinterface##1{\mbox{\textit{##1}}\xspace} +\gdef\jpackage##1{\mbox{\textsc{##1}}\xspace} +\gdef\jfunc##1{\texttt{##1}\xspace} + +%----- +%TYPES +\if\the\upm@code@current@lang 1 + %Java + \gdef\jclazz{\textbf{Class}\xspace} + \gdef\jvoid{\textbf{void}\xspace} + \gdef\jint{\textbf{int}\xspace} + \gdef\jlong{\textbf{long}\xspace} + \gdef\jfloat{\textbf{float}\xspace} + \gdef\jboolean{\textbf{boolean}\xspace} + \gdef\jdouble{\textbf{double}\xspace} + \gdef\jchar{\textbf{char}\xspace} + \gdef\jstring{\jclass{String}\xspace} + \gdef\jarray##1{{{##1}\bgroup\textbf{\string[\string]}\egroup}\xspace} + \gdef\jcollection##1{{\jclass{Collection}\textless{##1}\bgroup\textgreater\egroup}\xspace} + \gdef\jset##1{{\jclass{Set}\textless{##1}\bgroup\textgreater\egroup}\xspace} +\else\if\the\upm@code@current@lang 2 + %C++ + \gdef\jclazz{\textbf{class}\xspace} + \gdef\jvoid{\textbf{void}\xspace} + \gdef\jint{\textbf{int}\xspace} + \gdef\jlong{\textbf{long}\xspace} + \gdef\jfloat{\textbf{float}\xspace} + \gdef\jboolean{\textbf{bool}\xspace} + \gdef\jdouble{\textbf{double}\xspace} + \gdef\jchar{\textbf{char}\xspace} + \gdef\jstring{\jclass{std\string:\string:string}\xspace} + \gdef\jarray##1{{{##1}\bgroup\textbf{\string[\string]}\egroup}\xspace} + \gdef\jcollection##1{{\jclass{std\string:\string:vector}\textless{##1}\bgroup\textgreater\egroup}\xspace} + \gdef\jset##1{{\jclass{std\string:\string:set}\textless{##1}\bgroup\textgreater\egroup}\xspace} +\else + %UML + \gdef\jclazz{\textbf{class}\xspace} + \gdef\jvoid{\textbf{void}\xspace} + \gdef\jint{\textbf{integer}\xspace} + \gdef\jlong{\textbf{long integer}\xspace} + \gdef\jfloat{\textbf{float}\xspace} + \gdef\jboolean{\textbf{boolean}\xspace} + \gdef\jdouble{\textbf{double}\xspace} + \gdef\jchar{\textbf{character}\xspace} + \gdef\jstring{\textbf{string}\xspace} + \gdef\jcollection##1{{\textbf{collection of} \upm@code@makemul{##1}\bgroup\egroup}\xspace} + \gdef\jarray##1{{\textbf{array of} \upm@code@makemul{##1}\bgroup\egroup}\xspace} + \gdef\jset##1{{\textbf{set of} \upm@code@makemul{##1}\bgroup\egroup}\xspace} +\fi\fi + +%----- +%CONSTANTS +\if\the\upm@code@current@lang 1 + %Java + \gdef\jtrue{\textsc{true}\xspace} + \gdef\jfalse{\textsc{false}\xspace} +\else\if\upm@code@current@lang 2 + %C++ + \gdef\jtrue{\textsc{true}\xspace} + \gdef\jfalse{\textsc{false}\xspace} +\else + \gdef\jtrue{\textsc{true}\xspace} + \gdef\jfalse{\textsc{false}\xspace} +\fi\fi + +%----- +%OPERATIONS +\gdef\jop##1{\bgroup\jcode{##1}\egroup} +\gdef\jcall##1##2{\mbox{\jfunc{##1}\bgroup\texttt{\string({##2}\string)}\egroup}\xspace} +\gdef\jcode##1{\texttt{##1}\xspace} + +} + +\upm@code@declarations + +\endinput diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-document.cls b/macros/latex/contrib/upmethodology/src/upmethodology-document.cls new file mode 100644 index 0000000000..4385aca329 --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upmethodology-document.cls @@ -0,0 +1,288 @@ +% Document class for Unified Process Methodology +% +% Copyright (c) 2014 Stephane GALLAND <galland@arakhne.org> +% +% This program is free library; you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or any later version. +% +% This library is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public +% License along with this library; see the file COPYING. If not, +% write to the Free Software Foundation, Inc., 59 Temple Place - Suite +% 330, Boston, MA 02111-1307, USA. + +\global\edef\upm@package@docclazz@ver{2014/09/11} + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesClass{upmethodology-document}[\upm@package@docclazz@ver] + +\RequirePackage{upmethodology-p-common} + +\newif\ifupm@package@docclazz@nodocinfo +\upm@package@docclazz@nodocinfofalse +\newif\ifupm@package@docclazz@nopubpage +\upm@package@docclazz@nopubpagefalse +\newif\ifupm@package@docclazz@autofrontmatter +\upm@package@docclazz@autofrontmatterfalse +\newif\ifupm@package@docclazz@addfrontcover +\upm@package@docclazz@addfrontcovertrue +\newif\ifupm@package@docclazz@addbackcover +\upm@package@docclazz@addbackcovertrue + +\gdef\upm@package@docclazz@optionstopass{a4paper,11pt} + +\DeclareOption{twoside}{% + \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,twoside,openright}% +} +\DeclareOption{oneside}{% + \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,oneside}% +} + +\DeclareOption{french}{% + \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,french}% + \PassOptionsToPackage{french}{upmethodology-document} +} +\DeclareOption{francais}{% + \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,french}% + \PassOptionsToPackage{french}{upmethodology-document} +} +\DeclareOption{english}{% + \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,english}% + \PassOptionsToPackage{english}{upmethodology-document} +} +\DeclareOption{standardlists}{% + \message{*********** DISABLING UPMETHODOLOGY LISTS} + \PassOptionsToPackage{standardlists}{upmethodology-fmt} +} + +\DeclareOption{nodocumentinfo}{% + \global\upm@package@docclazz@nodocinfotrue% +} +\DeclareOption{documentinfo}{% + \global\upm@package@docclazz@nodocinfofalse% +} +\DeclareOption{nopubpage}{% + \global\upm@package@docclazz@nopubpagetrue% +} +\DeclareOption{pubpage}{% + \global\upm@package@docclazz@nopubpagefalse% +} +\DeclareOption{nofrontmatter}{% + \global\upm@package@docclazz@autofrontmatterfalse% +} +\DeclareOption{frontmatter}{% + \global\upm@package@docclazz@autofrontmattertrue% +} +\DeclareOption{nofrontcover}{% + \global\upm@package@docclazz@addfrontcoverfalse% +} +\DeclareOption{frontcover}{% + \global\upm@package@docclazz@addfrontcovertrue% +} +\DeclareOption{nobackcover}{% + \global\upm@package@docclazz@addbackcoverfalse% +} +\DeclareOption{backcover}{% + \global\upm@package@docclazz@addbackcovertrue% +} +\DeclareOption{book}{% + \global\upmbookformattrue + \global\upmreportformatfalse + \global\upmarticleformatfalse + \global\upm@package@docclazz@nopubpagefalse% + \global\upm@package@docclazz@nodocinfofalse% + \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,twoside,openright}% +} +\DeclareOption{report}{% + \global\upmbookformatfalse + \global\upmreportformattrue + \global\upmarticleformatfalse + \global\upm@package@docclazz@nopubpagetrue% + \global\upm@package@docclazz@nodocinfofalse% + \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,oneside}% +} +\DeclareOption{article}{% + \global\upmbookformatfalse + \global\upmreportformatfalse + \global\upmarticleformattrue + \global\upm@package@docclazz@nopubpagetrue% + \global\upm@package@docclazz@nodocinfotrue% + \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,oneside}% +} + +\DeclareOption*{% + \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,\CurrentOption}% + } +\ExecuteOptions{report} +\ProcessOptions*\relax + +\ifupmbookformat + \message{*********** UPMETHODOLOGY BOOK CLASS (WITH PART AND CHAPTER)} + \expandafter\LoadClass[\upm@package@docclazz@optionstopass]{book} +\else\ifupmreportformat + \message{*********** UPMETHODOLOGY REPORT CLASS (WITHOUT PART, WITH CHAPTER)} + \expandafter\LoadClass[\upm@package@docclazz@optionstopass]{report} +\else + \message{*********** UPMETHODOLOGY ARTICLE CLASS (WITHOUT PART AND CHAPTER)} + \expandafter\LoadClass[\upm@package@docclazz@optionstopass]{article} +\fi\fi + +\RequirePackage{a4wide} + +\RequirePackage{upmethodology-document} +\RequirePackage{upmethodology-extension} +\RequirePackage{upmethodology-frontpage} +\RequirePackage{upmethodology-backpage} +\RequirePackage{upmethodology-task} +\RequirePackage{upmethodology-code} +\RequirePackage{upmethodology-spec} + +\RequirePackage{url} +\ifpdf + \RequirePackage[pdftex, + breaklinks, %make links breakable on several lines + pageanchor=true, %put implicit anchor on each page (required for \printindex) + bookmarks=false, %hide bookmarks + hyperfigures=true, %not documented + hyperindex=true, %the page numbers in the index are links + linktocpage=true, %page numbers are used for links in TOC, LOF... + bookmarks=true, %open the bookmarks + bookmarksopen=true, %open all the bookmark's nodes by default + bookmarksnumbered=true, %section number in bookmarks + colorlinks=false, % Use a frame around links + pdfproducer={upmethodology \upm@package@docclazz@ver}, + ]{hyperref} +\else + \RequirePackage[breaklinks, %make links breakable on several lines + pageanchor=true, %put implicit anchor on each page (required for \printindex) + bookmarks=false, %hide bookmarks + hyperfigures=true, %not documented + hyperindex=true, %the page numbers in the index are links + linktocpage=true, %page numbers are used for links in TOC, LOF... + bookmarks=true, %open the bookmarks + bookmarksopen=true, %open all the bookmark's nodes by default + bookmarksnumbered=true, %section number in bookmarks + colorlinks=false, % Use a frame around links + ]{hyperref} +\fi +\urlstyle{same} + +\ifpdf + \pdfpageheight=29.7cm + \pdfpagewidth=21.0cm +\fi + +%---------------------------------------- +% HEADERS AND FOOTERS +%---------------------------------------- + +\def\upm@header@fmt#1{\textsc{\scriptsize #1}} +\def\upm@copyright@fmt#1{\textsc{\tiny #1}} + +\global\let\upm@package@docclazz@old@pagestyle\pagestyle +\gdef\pagestyle#1{% + \gdef\upm@package@docclazz@saved@pagestyle{#1}% + \upm@package@docclazz@old@pagestyle{#1}% +} +\gdef\upm@package@docclazz@saved@pagestyle{headings}% +\upm@package@docclazz@old@pagestyle{headings} + +\newdimen{\upm@smalllogo@height} +\upm@smalllogo@height=1cm + +%---------------------------------------- +% FRONT, MAIN AND BACK MATTERS +%---------------------------------------- + +\global\let\upm@package@docclazz@frontmatter\frontmatter +\gdef\frontmatter{% + \upm@package@docclazz@old@pagestyle{headings}% + \pagenumbering{roman}% + \global\let\frontmatter\relax% +} + +\global\let\upm@package@docclazz@mainmatter\mainmatter +\gdef\mainmatter{% + \upm@package@docclazz@mainmatter% + \global\let\frontmatter\relax% + \global\let\mainmatter\relax% +} + +\global\let\upm@package@docclazz@backmatter\backmatter +\gdef\backmatter{% + \global\let\frontmatter\relax% + \global\let\mainmatter\relax% + \global\let\backmatter\relax% + \upm@package@docclazz@backmatter% + \global\let\upm@package@docclazz@appendix\appendix% + \gdef\appendix{% + \upm@package@docclazz@appendix% + \global\@mainmattertrue% + }% +} + +%---------------------------------------- +% AUTO-GENERATED DOCUMENT +%---------------------------------------- + +\AtBeginDocument{% + \ifupm@package@docclazz@autofrontmatter\frontmatter\fi% + \ifupm@package@docclazz@addfrontcover\makefrontcover\fi% + \ifupm@package@docclazz@nopubpage\else\upmpublicationpage\fi% + \ifupm@package@docclazz@nodocinfo\else\upmdocinfopage\fi% + \sloppy% +} + +\AtEndDocument{% + \ifupm@package@docclazz@addbackcover\makebackcover\fi% +} + +%---------------------------------------- +% PDF COLORS +%---------------------------------------- +\gdef\upm@package@getcolor#1,#2,#3{#1 #2 #3} +\ifpdf + \renewcommand{\setpdfcolor}[1]{ + \hypersetup{ + filebordercolor={\upm@package@getcolor #1}, % frame color + linkbordercolor={\upm@package@getcolor #1}, % frame color + citebordercolor={\upm@package@getcolor #1}, % frame color + menubordercolor={\upm@package@getcolor #1}, % frame color + urlbordercolor={\upm@package@getcolor #1}, % frame color + runbordercolor={\upm@package@getcolor #1}, % frame color + } + } +\fi + +%---------------------------------------- +% SET FORBIDDEN SECTIONNING FUNCTIONS +%---------------------------------------- +\ifupmbookformat\else + \gdef\upm@package@docclazz@hidesec@a#1{% + \@ifnextchar*{\upm@package@docclazz@hidesec@d{#1}}{% + \@ifnextchar[{\upm@package@docclazz@hidesec@b{#1}}{\upm@package@docclazz@hidesec@c{#1}}% + }} + \gdef\upm@package@docclazz@hidesec@d#1#2{% + \@ifnextchar[{\upm@package@docclazz@hidesec@b{#1}}{\upm@package@docclazz@hidesec@c{#1}}} + \gdef\upm@package@docclazz@hidesec@b#1[#2]#3{\@warning{"#1" macro is skipped. Title: "#3"}} + \gdef\upm@package@docclazz@hidesec@c#1#2{\@warning{"#1" macro is skipped. Title: "#2"}} + + \gdef\part{\upm@package@docclazz@hidesec@a{\string\part}} + \gdef\partstar{\upm@package@docclazz@hidesec@a{\string\part*}} + \gdef\parttoc{\upm@package@docclazz@hidesec@a{\string\parttoc}} + +\ifupmreportformat\else + + \gdef\chapter{\upm@package@docclazz@hidesec@a{\string\part}} + \gdef\chapterstar{\upm@package@docclazz@hidesec@a{\string\part*}} + \gdef\chaptertoc{\upm@package@docclazz@hidesec@a{\string\parttoc}} + +\fi\fi + +\endinput diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-document.sty b/macros/latex/contrib/upmethodology/src/upmethodology-document.sty new file mode 100644 index 0000000000..c345e61553 --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upmethodology-document.sty @@ -0,0 +1,560 @@ +% Package for Unified Process Methodology's documents +% +% Copyright (c) 2006-2013 Stephane GALLAND <galland@arakhne.org> +% +% This program is free library; you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or any later version. +% +% This library is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public +% License along with this library; see the file COPYING. If not, +% write to the Free Software Foundation, Inc., 59 Temple Place - Suite +% 330, Boston, MA 02111-1307, USA. + +\global\edef\upm@package@doc@ver{2015/04/24} + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{upmethodology-document}[\upm@package@doc@ver] + +\RequirePackage{upmethodology-p-common} + +%---------------------------------------- +% LOCALES +%---------------------------------------- +\def\upm@document@lang@english{% + \gdef\upm@lang@@{\message{**** upmethodology-document is using English language ****}}% + \gdef\upmcurrentlang{english}% + \gdef\upmcurrentlangforbabel{english}% + \gdef\upm@lang@project{Project}% + \gdef\upm@lang@document{Document}% + \gdef\upm@lang@docref{Reference}% + \gdef\upm@lang@lastupdate{Last Update}% + \gdef\upm@lang@lastupdate@short{Updated}% + \gdef\upm@lang@document@summary{Document Summary}% + \gdef\upm@lang@status{Status}% + \gdef\upm@lang@document@authors{Authors}% + \gdef\upm@lang@document@informed{Informed People}% + \gdef\upm@lang@document@validators{Validators}% + \gdef\upm@lang@document@names{Names}% + \gdef\upm@lang@document@comments{Comments}% + \gdef\upm@lang@document@emails{Emails}% + \gdef\upm@lang@document@initials{Initials}% + \gdef\upm@lang@document@abstract{Abstract}% + \gdef\upm@lang@document@keywords{Key-words}% + \gdef\upm@lang@document@copyright@purpose{This document describes the \theupmproject\ project\Ifnotempty{\theupmsubproject}{ and its \theupmsubproject\ subproject}.}% + \gdef\upm@lang@document@copyright@tex{\TeX\ is a trademark of the American Mathematical Society.}% + \gdef\upm@lang@document@copyright@upmethodology{\texttt{tex-upmethodology} is owned by St\'ephane Galland, \arakhneorg, France.}% + \gdef\upm@lang@document@copyright@madewith{This document was realised with \LaTeX\ and \texttt{tex-upmethodology}.}% + \gdef\upm@lang@document@copyright@trademarks{This document is published by the \theupmformattedpublisher. All rights 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.} + \gdef\upm@lang@document@copyright@printedin{Printed in \theupmprintedin.} +} +\def\upm@document@lang@french{% + \gdef\upm@lang@@{\message{**** upmethodology-document is using French language ****}}% + \gdef\upmcurrentlang{french}% + \gdef\upmcurrentlangforbabel{frenchb}% + \gdef\upm@lang@project{Projet}% + \gdef\upm@lang@document{Document}% + \gdef\upm@lang@docref{R\'ef\'erence}% + \gdef\upm@lang@lastupdate{Derni\`ere modification}% + \gdef\upm@lang@lastupdate@short{Modifi\'e}% + \gdef\upm@lang@document@summary{Synoptique}% + \gdef\upm@lang@status{Statut}% + \gdef\upm@lang@document@authors{Auteurs}% + \gdef\upm@lang@document@comments{Commentaires}% + \gdef\upm@lang@document@informed{Pour information}% + \gdef\upm@lang@document@validators{Validateurs}% + \gdef\upm@lang@document@names{Noms}% + \gdef\upm@lang@document@emails{Emails}% + \gdef\upm@lang@document@initials{Initiales}% + \gdef\upm@lang@document@abstract{R\'esum\'e}% + \gdef\upm@lang@document@keywords{Mots-cl\'es}% + \gdef\upm@lang@document@copyright@purpose{Ce document d\'ecrit le projet \theupmproject\Ifnotempty{\theupmsubproject}{ et son sous-projet \theupmsubproject}.}% + \gdef\upm@lang@document@copyright@tex{\TeX\ et \LaTeX\ sont des marques de la Soci\'et\'e Am\'ericaine de Math\'ematiques.}% + \gdef\upm@lang@document@copyright@upmethodology{\texttt{tex-upmethodology} est la propri\'et\'e de St\'ephane Galland, \arakhneorg, France.}% + \gdef\upm@lang@document@copyright@madewith{Ce document a \'et\'e r\'ealis\'e avec \LaTeX\ et \texttt{tex-upmethodology}.}% + \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.} + \gdef\upm@lang@document@copyright@printedin{Imprim\'e en \theupmprintedin.} + +} + +%---------------------------------------- +% OPTIONS +%---------------------------------------- +\DeclareOption{french}{% + \upm@document@lang@french +} +\DeclareOption{francais}{% + \upm@document@lang@french +} +\DeclareOption{english}{% + \upm@document@lang@english +} +\ExecuteOptions{english} +\ProcessOptions* + +{\upm@lang@@} + +\RequirePackage[\upmcurrentlangforbabel]{babel} +\RequirePackage{vmargin} + +\RequirePackage{upmethodology-extension} +\RequirePackage{upmethodology-fmt} +\RequirePackage{upmethodology-version} + +%---------------------------------------- +% Ensure that frenchb (included by babel) +% does not use compact versions of lists +% in french mode. +%---------------------------------------- + +\newlength\listendskip +\listendskip=\parskip +\ifupmlang{french}{% + \addto\extrasfrench{% + \let\upm@document@enditemizeFB\enditemizeFB% + \def\enditemizeFB{\upm@document@enditemizeFB\vspace{\listendskip}}% + \let\upm@document@enditemizeORI\enditemizeORI% + \def\enditemizeFB{\upm@document@enditemizeORI\vspace{\listendskip}}% + }% + \addto\noextrasfrench{% + \let\upm@document@enditemizeFB\enditemizeFB% + \def\enditemizeFB{\upm@document@enditemizeFB\vspace{\listendskip}}% + \let\upm@document@enditemizeORI\enditemizeORI% + \def\enditemizeFB{\upm@document@enditemizeORI\vspace{\listendskip}}% + }% +} + +%---------------------------------------- +% DOCUMENT MANAGEMENT +%---------------------------------------- + +%----- +% Declare a project's document +%\declaredocument{project}{name}{ref} +\newcommand{\declaredocument}[3]{% + \gdef\theupmproject{#1}% + \gdef\theupmsubproject{}% + \gdef\theupmdocname{#2}% + \gdef\theupmdocref{#3}% +} + +%----- +% Declare a project's document +%\declaredocumentex{project}{subproject}{name}{ref} +\newcommand{\declaredocumentex}[4]{% + \gdef\theupmproject{#1}% + \gdef\theupmsubproject{#2}% + \gdef\theupmdocname{#3}% + \gdef\theupmdocref{#4}% +} + +%----- +% Display the summary of the document +%\upmdocumentsummary[width] +\newcommand{\upmdocumentsummary}[1][\linewidth]{% + \noindent\begin{mtabular}[#1]{2}{|l|X|}% + \tabulartitle{\upm@lang@document@summary}% + \upm@lang@project & \theupmproject\Ifnotempty{\theupmsubproject}{ -- \theupmsubproject} \\ + \upm@lang@document & \theupmdocname \\ + \upm@lang@docref & \theupmdocref \\ + \upm@lang@version & \theupmversion \\ + \upm@lang@lastupdate & \theupmdate \\ + \hline + \end{mtabular}\par\vspace{.5cm}% +} + +%----- +% Display the the document information on a page +%\upmpublicationpage +\newcommand{\upmdocinfopage}{ + \thispagestyle{plain} + \upmdocumentsummary\upmdocumentauthors\upmdocumentvalidators\upmdocumentinformedpeople\vfill\upmhistory\clearpage% +} + +%----- +% Display the publication pag for the document +%\upmpublicationpage +\newcommand{\upmpublicationpage}{ + \thispagestyle{empty}% + \upmpublicationminipage% +} +\newcommand{\upmpublicationminipage}{ + \if@twoside\ifodd\c@page\clearpage\fi\fi% + \mbox{}\vfill\small% + \par\noindent + \upm@lang@document@copyright@purpose + \vspace{.5cm} + \par\noindent + \upm@lang@document@copyright@tex + \par\noindent + \upm@lang@document@copyright@upmethodology + \vspace{.5cm} + \par\noindent + \Get{trademarks} + \vspace{4cm} + \par\noindent + \upm@lang@document@copyright@madewith + \vspace{.15cm} + \par\noindent + Copyright~\copyright~\upmcopyrightdate~\theupmformattedcopyrighter. + \vspace{.15cm} + \par\noindent + \upm@lang@document@copyright@trademarks \Ifdefined{printed}{\upm@lang@document@copyright@printedin} + \vspace{.25cm} + \par\noindent + \upm@lang@docref~: \theupmdocref \\ + \Ifnotempty{\theupmisbn}{ISBN~:~\theupmisbn\\} + \Ifnotempty{\theupmissn}{ISSN~:~\theupmissn\\} + \Ifnotempty{\theupmdoi}{DOI~:~\theupmdoi\\} + \clearpage% +} + +%----- +%Name of the project for which this document was written +\def\theupmproject{Arakhn\^e Project} + +%----- +%Name of the sub-project for which this document was written +\def\theupmsubproject{} + +%----- +%Name of the document +\def\theupmdocname{Arakhn\^e Document} + +%----- +%Reference of the document +\def\theupmdocref{XXX} + + +%----- +%Name of the logo +\newcommand{\theupmsmalldoclogo}{\Get{smalllogo}} +\newcommand{\theupmdoclogo}{\Get{logo}} + +%----- +% Define the name of the logo picture to use +\newcommand{\defupmsmalllogo}[1]{\Set{smalllogo}{#1}} +\newcommand{\defupmlogo}[1]{\Set{logo}{#1}} + +%----- +%Full name of the document +\def\theupmfulldocname{% + \theupmproject% + \Ifnotempty{\theupmsubproject}{/\theupmsubproject}% + \Ifnotempty{\theupmdocname}{ -- \theupmdocname}% +} + +%----- +% Declare a document's abstract +%\setdocabstract[lang]{text} +\newcommand{\setdocabstract}[2][\upmcurrentlang]{% + \ifthenelse{\equal{#1}{\upmcurrentlang}}{ + \gdef\theupmdocabstract{#2}}{}% + \global\@namedef{theupmdocabstract#1}{#2}% +} + +%----- +% Declare a document's key-words +%\setdockeywords[lang]{words} +\newcommand{\setdockeywords}[2][\upmcurrentlang]{% + \ifthenelse{\equal{#1}{\upmcurrentlang}}{ + \gdef\theupmdockeywords{#2}}{}% + \global\@namedef{theupmdockeywords#1}{#2}% +} + +%----- +%Abstract of the document +\def\theupmdocabstract{} + +%----- +%Key-words of the document +\def\theupmdockeywords{} + +%---------------------------------------- +% AUTHOR MANAGEMENT +%---------------------------------------- + +\newif\ifupm@document@author@tab@hascomment +\upm@document@author@tab@hascommentfalse +\def\upm@document@author@tab{} +\def\upm@document@author@tab@commented{} + +%----- +\def\theauthorlist{} + +%----- +\newif\ifupm@document@author@isauthor +\gdef\upm@document@author@authornames{} +\newcommand{\ifdocumentauthor}[3]{% + \upm@document@author@isauthorfalse% + \@for\upm@document@author@isauthor@tmp:=\upm@document@author@authornames\do{% + \ifupm@document@author@isauthor% + \else% + \ifthenelse{\equal{#1}{\upm@document@author@isauthor@tmp}}{% + \upm@document@author@isauthortrue% + }{}% + \fi% + }% + \ifupm@document@author@isauthor{#2}\else{#3}\fi% +} + +%----- +%Add an author +%\addauthor[email]{firstname}{name} +%\addauthor*[email]{firstname}{name}{comment} +\def\addauthor{\@ifstar\upm@document@addauthorstar\upm@document@addauthor} +\newcommand{\upm@document@addauthor}[3][]{% + \lowercase{\xdef\upm@document@author@authornames{#3,\upm@document@author@authornames}}% + \protected@xdef\theauthorlist{\theauthorlist\protect\Ifnotempty{\theauthorlist}{,} \protect\upmmakename{#2}{#3}{~}} + + \global\protected@edef\upm@document@author@tab@commented{\upm@document@author@tab@commented \protect\upmmakename{#2}{#3}{~} & + & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\} + + \ifupm@document@author@tab@hascomment\else + \global\protected@edef\upm@document@author@tab{\upm@document@author@tab \protect\upmmakename{#2}{#3}{~} & + \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\} + \fi +} +\newcommand{\upm@document@addauthorstar}[4][]{% + \lowercase{\xdef\upm@document@author@authornames{#3,\upm@document@author@authornames}}% + \global\protected@edef\theauthorlist{\theauthorlist\protect\Ifnotempty{\theauthorlist}{,} \protect\upmmakename{#2}{#3}{~}} + + \global\let\upm@document@author@tab\relax + + \global\protected@edef\upm@document@author@tab@commented{\upm@document@author@tab@commented \protect\upmmakename{#2}{#3}{~} & + #4 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\} + + \upm@document@author@tab@hascommenttrue +} + +%----- +% Display the summary of the authors +%\upmdocumentauthors[width] +\newcommand{\upmdocumentauthors}[1][\linewidth]{% + \ifupm@document@author@tab@hascomment% + \Ifnotempty{\upm@document@author@tab@commented}{% + \noindent\expandafter\begin{mtabular}[#1]{3}{|X|l|c|}% + \tabulartitle{\upm@lang@document@authors}% + \tabularheader{\upm@lang@document@names}{\upm@lang@document@comments}{\upm@lang@document@emails}% + \upm@document@author@tab@commented + \hline% + \expandafter\end{mtabular}\par\vspace{.5cm}}% + \else% + \Ifnotempty{\upm@document@author@tab}{% + \noindent\expandafter\begin{mtabular}[#1]{2}{|X|c|}% + \tabulartitle{\upm@lang@document@authors}% + \tabularheader{\upm@lang@document@names}{\upm@lang@document@emails}% + \upm@document@author@tab + \hline% + \expandafter\end{mtabular}\par\vspace{.5cm}}% + \fi% +} + +%---------------------------------------- +% VALIDATOR MANAGEMENT +%---------------------------------------- + +\newif\ifupm@document@validator@tab@hascomment +\upm@document@validator@tab@hascommentfalse +\def\upm@document@validator@tab{} +\def\upm@document@validator@tab@commented{} + +%----- +\def\thevalidatorlist{} + +%----- +%Add a validator +%\addvalidator[email]{firstname}{name} +%\addvalidator*[email]{firstname}{name}{comment} +\def\addvalidator{\@ifstar\upm@document@addvalidatorstar\upm@document@addvalidator} +\newcommand{\upm@document@addvalidator}[3][]{% + \global\protected@edef\thevalidatorlist{\thevalidatorlist\protect\Ifnotempty{\thevalidatorlist}{,} \protect\upmmakename{#2}{#3}{~}} + + \global\protected@edef\upm@document@validator@tab@commented{\upm@document@validator@tab@commented \protect\upmmakename{#2}{#3}{~} & + & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} & \protect\\} + + \ifupm@document@validator@tab@hascomment\else + \global\protected@edef\upm@document@validator@tab{\upm@document@validator@tab \protect\upmmakename{#2}{#3}{~} & + \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} & \protect\\} + \fi +} +\newcommand{\upm@document@addvalidatorstar}[4][]{% + \global\protected@edef\thevalidatorlist{\thevalidatorlist\protect\Ifnotempty{\thevalidatorlist}{,} \protect\upmmakename{#2}{#3}{~}} + + \global\let\upm@document@validator@tab\relax + + \global\protected@edef\upm@document@validator@tab@commented{\upm@document@validator@tab@commented \protect\upmmakename{#2}{#3}{~} & + #4 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} & \protect\\} + + \upm@document@validator@tab@hascommenttrue +} + +%----- +% Display the summary of the validators +%\upmdocumentvalidators[width] +\newcommand{\upmdocumentvalidators}[1][\linewidth]{% + \ifupm@document@validator@tab@hascomment% + \Ifnotempty{\upm@document@validator@tab@commented}{% + \noindent\expandafter\begin{mtabular}[#1]{4}{|X|l|c|p{3cm}|}% + \tabulartitle{\upm@lang@document@validators}% + \tabularheader{\upm@lang@document@names}{\upm@lang@document@comments}{\upm@lang@document@emails}{\upm@lang@document@initials}% + \upm@document@validator@tab@commented + \hline% + \expandafter\end{mtabular}\par\vspace{.5cm}}% + \else% + \Ifnotempty{\upm@document@validator@tab}{% + \noindent\expandafter\begin{mtabular}[#1]{3}{|X|c|p{3cm}|}% + \tabulartitle{\upm@lang@document@validators}% + \tabularheader{\upm@lang@document@names}{\upm@lang@document@emails}{\upm@lang@document@initials}% + \upm@document@validator@tab + \hline% + \expandafter\end{mtabular}\par\vspace{.5cm}}% + \fi% +} + + +%----- +%Add an author/validator +%\addauthorvalidator[email]{firstname}{name} +%\addauthorvalidator*[email]{firstname}{name}{comment} +\def\addauthorvalidator{\@ifstar\upm@document@addauthorvalidatorstar\upm@document@addauthorvalidator} +\newcommand{\upm@document@addauthorvalidator}[3][]{% + \addauthor[#1]{#2}{#3}\addvalidator[#1]{#2}{#3}% +} +\newcommand{\upm@document@addauthorvalidatorstar}[4][]{% + \addauthor*[#1]{#2}{#3}{#4}\addvalidator*[#1]{#2}{#3}{#4}% +} + +%---------------------------------------- +% INFORMED MANAGEMENT +%---------------------------------------- + +\newif\ifupm@document@informed@tab@hascomment +\upm@document@informed@tab@hascommentfalse +\def\upm@document@informed@tab{} +\def\upm@document@informed@tab@commented{} + +%----- +\def\theinformedlist{} + +%----- +%Add an informed +%\addinformed[email]{firstname}{name} +%\addinformed*[email]{firstname}{name}{comment} +\def\addinformed{\@ifstar\upm@document@addinformedstar\upm@document@addinformed} +\newcommand{\upm@document@addinformed}[3][]{% + \global\protected@edef\theinformedlist{\theinformedlist\protect\Ifnotempty{\theinformedlist}{,} \protect\upmmakename{#2}{#3}{~}} + + \global\protected@edef\upm@document@informed@tab@commented{\upm@document@informed@tab@commented \protect\upmmakename{#2}{#3}{~} & + & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\} + + \ifupm@document@informed@tab@hascomment\else + \global\protected@edef\upm@document@informed@tab{\upm@document@informed@tab \protect\upmmakename{#2}{#3}{~} & + \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\} + \fi +} +\newcommand{\upm@document@addinformedstar}[4][]{% + \global\protected@edef\theinformedlist{\theinformedlist\protect\Ifnotempty{\theinformedlist}{,} \protect\upmmakename{#2}{#3}{~}} + + \global\let\upm@document@informed@tab\relax + + \global\protected@edef\upm@document@informed@tab@commented{\upm@document@informed@tab@commented \protect\upmmakename{#2}{#3}{~} & + #4 & \protect\Ifnotempty{#1}{\protect\href{mailto:#1}{#1}} \protect\\} + + \upm@document@informed@tab@hascommenttrue +} + +%----- +% Display the summary of the informed people +%\upmdocumentinformedpeople[width] +\newcommand{\upmdocumentinformedpeople}[1][\linewidth]{% + \ifupm@document@validator@tab@hascomment% + \Ifnotempty{\upm@document@informed@tab@commented}{% + \noindent\expandafter\begin{mtabular}[#1]{3}{|X|l|c|}% + \tabulartitle{\upm@lang@document@informed}% + \tabularheader{\upm@lang@document@names}{\upm@lang@document@comments}{\upm@lang@document@emails}% + \upm@document@informed@tab@commented + \hline% + \expandafter\end{mtabular}\par\vspace{.5cm}}% + \else% + \Ifnotempty{\upm@document@informed@tab}{% + \noindent\expandafter\begin{mtabular}[#1]{2}{|X|c|}% + \tabulartitle{\upm@lang@document@informed}% + \tabularheader{\upm@lang@document@names}{\upm@lang@document@emails}% + \upm@document@informed@tab + \hline% + \expandafter\end{mtabular}\par\vspace{.5cm}}% + \fi% +} + +%---------------------------------------- +% PUBLISHER, COPYRIGHT, PRINTING... +%---------------------------------------- + +\gdef\theupmcopyrighter{\Get{copyrighter}} +\gdef\theupmpublisher{\Get{publisher}} +\gdef\theupmprintedin{\Get{printedin}} +\gdef\theupmisbn{} +\gdef\theupmissn{} +\gdef\theupmdoi{} +\gdef\theupmpublishingdate{} + +\newcommand{\theupmformattedpublisher}{\Ifelsedefined{publisher}{\theupmpublisher}{\textcolor{red}{???}}} +\newcommand{\theupmformattedcopyrighter}{\Ifelsedefined{copyrighter}{\theupmcopyrighter}{\textcolor{red}{???}}} + +%----- +%Set the publisher identity +%\setpublisher{name} +\newcommand{\setpublisher}[1]{\Set{publisher}{#1}} + +%----- +%Set the copyrighter identity +%\setcopyrighter{name} +\newcommand{\setcopyrighter}[1]{\Set{copyrighter}{#1}} + +%----- +%Set the address where this document is printed +%\setprintingaddress{address} +\newcommand{\setprintingaddress}[1]{\Set{printedin}{#1}} + +%----- +%Set the ISBN +%\setisbn{isbn} +\newcommand{\setisbn}[1]{% + \gdef\theupmisbn{#1}% +} + +%----- +%Set the ISSN +%\setisbn{issn} +\newcommand{\setissn}[1]{% + \gdef\theupmissn{#1}% +} + +%----- +%Set the DOI +%\setdoi{doi} +\newcommand{\setdoi}[1]{% + \gdef\theupmdoi{#1}% +} + +%---------------------------------------- +% WATERMARK +%---------------------------------------- + +\AtBeginDocument{ + \ifthenelse{\equal{\theupmstatus}{\upmrestricted}}{ + \edef\upm@doc@tmp@watermark{\uppercase{\upm@lang@restricted}} + \RequirePackage{draftwatermark} + \SetWatermarkText{\upm@doc@tmp@watermark} + \SetWatermarkScale{\Get{watermarksize}} + }{} +} + +\endinput diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-extension.sty b/macros/latex/contrib/upmethodology/src/upmethodology-extension.sty new file mode 100644 index 0000000000..8b6a2cd786 --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upmethodology-extension.sty @@ -0,0 +1,115 @@ +% Package for Unified Process Methodology's extensions +% +% Copyright (c) 2006-2009 Stephane GALLAND <galland@arakhne.org> +% +% This program is free library; you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or any later version. +% +% This library is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public +% License along with this library; see the file COPYING. If not, +% write to the Free Software Foundation, Inc., 59 Temple Place - Suite +% 330, Boston, MA 02111-1307, USA. +% + +\global\edef\upm@package@ext@ver{2017/08/08} + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{upmethodology-extension}[\upm@package@ext@ver] + +\RequirePackage{upmethodology-p-common} + +%---------------------------------------- +% TEST MACROS +%---------------------------------------- +\long\def\Ifdefined#1#2{\@ifundefined{upmext@extension@value@#1}{}{#2}} +\long\def\Ifelsedefined#1#2#3{\@ifundefined{upmext@extension@value@#1}{#3}{#2}} +\long\def\Ifundefined#1#2{\@ifundefined{upmext@extension@value@#1}{#2}{}} +\long\def\Ifelseundefined#1#2#3{\@ifundefined{upmext@extension@value@#1}{#2}{#3}} + +%---------------------------------------- +% EXTENSION MANAGEMENT +%---------------------------------------- + +\newif\ifupm@extension@savealllang\upm@extension@savealllangfalse + +\newcommand{\Get}[1]{\@nameuse{upmext@extension@value@#1}} +\newcommand{\GetLang}[2]{\@nameuse{upmext@extension@value@#1@#2}} + +\newcommand{\upm@extension@Set}[3][\upmcurrentlang]{% + % PREDEFINED FRONT PAGE + \ifthenelse{\equal{#2}{frontpage}}{% + \gdef\upmext@extension@value@frontpage{#3}% + \global\let\upmext@extension@value@frontpage@custom\relax% + }{% + % CUSTOM BACK PAGE + \ifthenelse{\equal{#2}{backpage}}{% + \ifthenelse{\equal{\upmcurrentlang}{#1}}{% + \gdef\upmext@extension@value@backpage{#3}% + }{}% + }{% + % CUSTOM FRONT PAGE + \ifthenelse{\equal{#2}{cfrontpage}}{% + \ifthenelse{\equal{\upmcurrentlang}{#1}}{% + \gdef\upmext@extension@value@frontpage{custom}% + \gdef\upmext@extension@value@frontpage@custom{#3}% + }{}% + }{% + \ifthenelse{\equal{\upmcurrentlang}{#1}}{% + \message{*** define extension value #2 ****}% + \global\@namedef{upmext@extension@value@#2}{#3}% + }{}% + \ifupm@extension@savealllang% + \global\@namedef{upmext@extension@value@#2@#1}{#3}% + \fi + }}}% +} +\let\Set\upm@extension@Set + +\newcommand{\Unset}[2][\upmcurrentlang]{% + \ifthenelse{\equal{\upmcurrentlang}{#1}}{% + \message{*** undefine extension value #2 ****}% + \global\expandafter\let\csname upmext@extension@value@#2\endcsname\@undefined% + \ifupm@extension@savealllang% + \global\expandafter\let\csname upmext@extension@value@#2@#1\endcsname\@undefined% + \fi% + }{}% +} + +\newcommand{\DeclareCopyright}[5][\upmcurrentlang]{% + \ifthenelse{\equal{\upmcurrentlang}{#1}}{% + \Set{copyright}{Copyright {(c)} #3 #4.}% + \message{*** style extension #2, \Get{copyright} ****}% + \Set{trademarks}{#5}% + }{}% +} + +\newlength{\upmext@tmp@putx} +\def\Put(#1,#2){% + \setlength{\upmext@tmp@putx}{#1\unitlength}% + \if@twoside\ifodd\c@page\else\addtolength{\upmext@tmp@putx}{28\unitlength}\fi\fi% + \put(\strip@pt\upmext@tmp@putx,#2)} + +%----- +% Use the specified extension +%\UseExtension{extension_name} +\newcommand{\UseExtension}[1]{% + \message{**** including upm extension #1 (upmext-#1.cfg) ****}% + \input{upmext-#1.cfg}% +} + +%------------ +% Default declarations +\Set{frontillustrationsize}{1} +\Set{watermarksize}{1} +\Unset{publisher} +\Unset{copyrighter} +\Unset{printedin} + +\endinput diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-fmt.sty b/macros/latex/contrib/upmethodology/src/upmethodology-fmt.sty new file mode 100644 index 0000000000..bbdd4bce1e --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upmethodology-fmt.sty @@ -0,0 +1,1527 @@ +% Layout and Pagraph Format for Unified Process Methodology +% +% Copyright (c) 2006-2009, 2012-2015 Stephane GALLAND <galland@arakhne.org> +% +% This program is free library; you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or any later version. +% +% This library is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public +% License along with this library; see the file COPYING. If not, +% write to the Free Software Foundation, Inc., 59 Temple Place - Suite +% 330, Boston, MA 02111-1307, USA. + +\global\edef\upm@package@fmt@ver{2019/08/04} + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{upmethodology-fmt}[\upm@package@fmt@ver] + +\RequirePackage{upmethodology-p-common} + +\gdef\upm@fmt@force@single@spacing#1{{\begin{singlespace}#1\end{singlespace}}} +\gdef\upm@date@head#1/#2\@nil{#1} +\gdef\upm@date@tail#1/#2\@nil{#2} +\gdef\upm@date@first#1{{\expandafter\upm@date@head#1\expandafter\@nil}} +\gdef\upm@date@second#1{{\expandafter\expandafter\expandafter\upm@date@head\expandafter\upm@date@tail#1\expandafter\@nil\expandafter\expandafter\expandafter\@nil}} +\gdef\upm@date@third#1{{\expandafter\expandafter\expandafter\upm@date@tail\expandafter\upm@date@tail#1\expandafter\@nil\expandafter\expandafter\expandafter\@nil}} + +\newif\ifupm@use@override@standard@lists +\global\upm@use@override@standard@liststrue + +%---------------------------------------- +% LOCALES +%---------------------------------------- +\global\let\upm@format@lang@extractyear\upm@date@first% +\def\upm@format@lang@english{% + \gdef\upm@lang@@{\message{**** upmethodology-fmt is using English language ****}}% + \global\renewcommand{\upm@format@lang@makedate}[3]{##3\string/\two@digits{##2}\string/\two@digits{##1}}% + \global\let\upm@format@lang@extractyear\upm@date@first% + \global\let\upm@format@lang@extractmonth\upm@date@second% + \gdef\upm@format@lang@professor{Pr.}% + \gdef\upm@format@lang@doctor{Dr.}% + \gdef\upm@format@lang@phdoctor{Ph.D.}% + \gdef\upm@format@lang@scdoctor{Sc.D.}% + \gdef\upm@format@lang@mdoctor{M.D.}% + \gdef\upm@format@lang@professionalengineer{CEng.}% + \gdef\upm@format@lang@incorporatedengineer{IEng.}% +} +\def\upm@format@lang@french{% + \gdef\upm@lang@@{\message{**** upmethodology-fmt is using French language ****}}% + \global\renewcommand{\upm@format@lang@makedate}[3]{\two@digits{##1}\string/\two@digits{##2}\string/##3}% + \global\let\upm@format@lang@extractyear\upm@date@third% + \global\let\upm@format@lang@extractmonth\upm@date@second% + \global\let\upm@format@lang@extractday\upm@date@first% + \gdef\upm@format@lang@professor{Pr.}% + \gdef\upm@format@lang@doctor{Dr.}% + \gdef\upm@format@lang@phdoctor{Ph.D.}% + \gdef\upm@format@lang@scdoctor{Sc.D.}% + \gdef\upm@format@lang@mdoctor{M.D.}% + \gdef\upm@format@lang@professionalengineer{Ing.}% + \gdef\upm@format@lang@incorporatedengineer{Ing.}% +} +\global\providecommand{\upm@format@lang@makedate}[3]{}% + +%---------------------------------------- +% OPTIONS +%---------------------------------------- +\DeclareOption{french}{% + \upm@format@lang@french + \PassOptionsToPackage{french}{varioref} +} +\DeclareOption{francais}{% + \upm@format@lang@french + \PassOptionsToPackage{french}{varioref} +} +\DeclareOption{english}{% + \upm@format@lang@english + \PassOptionsToPackage{english}{varioref} +} +\DeclareOption{standardlists}{% + \global\upm@use@override@standard@listsfalse +} +\ExecuteOptions{english} +\ProcessOptions +\upm@lang@@ + + +\RequirePackage{graphicx} +\RequirePackage{subcaption} +\RequirePackage{tabularx} +\RequirePackage{multicol} +\RequirePackage{colortbl} +\RequirePackage{picinpar} +\RequirePackage{amsmath} +\RequirePackage{amsthm} +\RequirePackage{thmtools} +\RequirePackage{pifont} +\RequirePackage{setspace} +\RequirePackage{varioref} +\RequirePackage{txfonts} +\RequirePackage{relsize} +\RequirePackage{xkeyval} +\RequirePackage{hyphenat} +\RequirePackage{bbm} +\RequirePackage{environ}% for advanced environment declaration + +%---------------------------------------- +% Exponent and indice +%---------------------------------------- +% Exponent +%\newcommand{\textsup}[1]{\ensuremath{^{\text{#1}}}\xspace} +\newcommand{\textsup}[1]{\upm@textsuperscript{#1}\xspace} +% Indice +%\newcommand{\textsub}[1]{\ensuremath{_{\text{#1}}}\xspace} +\newcommand{\textsub}[1]{\upm@textsubscript{#1}\xspace} + +%---------------------------------------- +% Major Emphazing +%---------------------------------------- +\newcommand{\Emph}[1]{\textbf{#1}\xspace} + +%---------------------------------------- +% SYMBOLS +%---------------------------------------- +\renewcommand{\copyright}{\Pisymbol{psy}{211}\xspace} +\newcommand{\trademark}{\Pisymbol{psy}{228}\xspace} +\newcommand{\regmark}{\Pisymbol{psy}{226}\xspace} +\newcommand{\smalltrade}{{\tiny\trademark}\xspace} +\newcommand{\smallreg}{{\tiny\regmark}\xspace} +\newcommand{\smallcopy}{{\tiny\copyright}\xspace} +\newcommand{\ust}{\textsup{st}} +\newcommand{\und}{\textsup{nd}} +\newcommand{\urd}{\textsup{rd}} +\newcommand{\uth}{\textsup{th}} + +%---------------------------------------- +% MATH SYMBOLS +%---------------------------------------- +\newcommand{\R}{\ensuremath{\mathbb{R}}} +\newcommand{\N}{\ensuremath{\mathbb{N}}} +\newcommand{\Z}{\ensuremath{\mathbb{Z}}} +\newcommand{\C}{\ensuremath{\mathbb{C}}} +\newcommand{\Q}{\ensuremath{\mathbb{Q}}} +\newcommand{\powerset}{\ensuremath{\mathcal{P}}} + +\DeclareMathOperator{\sgn}{sgn} + +%---------------------------------------- +% DEFAULT GRAPHICX CONFIGURATION +%---------------------------------------- + +\ifpdf + \DeclareGraphicsExtensions{.pdf,.png,.jpg,.jpeg,.gif} +\else + \DeclareGraphicsExtensions{.eps,.png,.jpg,.jpeg,.gif} +\fi +\graphicspath{{./}} + +%----------------------------------------- +% LOCAL DEFINITION OF TH GRAPHICS PATH +%----------------------------------------- + +\newenvironment{graphicspathcontext}[1]{% + \bgroup% + \let\upm@tmp@graphicspathcontext@ginputpath\Ginput@path% + \def\old{\upm@tmp@graphicspathcontext@ginputpath}% + \protected@edef\upm@tmp@graphicspathcontext@tmp{\protect\graphicspath{#1}}% + \upm@tmp@graphicspathcontext@tmp% +}{% + \egroup% +} + +%---------------------------------------- +% FIGURES +%---------------------------------------- + +\newcommand{\upm@mfigure}[5][ht]{ + \begin{figure}[#1]% + \begin{center}% + \includegraphics[#2]{#3}% + \caption{#4}% + \label{fig:#5}% + \end{center}% + \end{figure}% +} +\newcommand{\upm@mfigurestar}[5][ht]{ + \begin{figure*}[#1]% + \begin{center}% + \includegraphics[#2]{#3}% + \caption{#4}% + \label{fig:#5}% + \end{center}% + \end{figure*}% +} +%----- +%\mfigure[position]{options}{filename}{caption}{label} +\def\mfigure{\@ifstar\upm@mfigurestar\upm@mfigure} +%----- +%\figref{label} +\newcommand{\figref}[1]{\ref{fig:#1}} +%----- +%\figpageref{label} +\newcommand{\figpageref}[1]{\pageref{fig:#1}} + +%----- +% Multi-figures + +\newcounter{upm@subfigure@count} + +\newcommand{\upm@beginsubfigure}[4]{% + \let\upm@mfiguresaved\mfigure% + %options,filename,caption,label + \renewcommand{\mfigure}[5][]{% + \xdef\upm@tmp@subfigure@label{\alph{upm@subfigure@count}}% + \subcaptionbox{##4% + \label{fig:##5}% + \label{fig:#4:\upm@tmp@subfigure@label}% + }{\includegraphics[##2]{##3}}% + \addtocounter{upm@subfigure@count}{1}% + } + %options,filename,caption + \newcommand{\msubfigure}[3]{% + \xdef\upm@tmp@subfigure@label{\alph{upm@subfigure@count}}% + \subcaptionbox{##3% + \label{fig:#4:\upm@tmp@subfigure@label}% + }{\includegraphics[##1]{##2}}% + \addtocounter{upm@subfigure@count}{1}% + } + \setcounter{upm@subfigure@count}{1}% + \gdef\upm@mfigurescaption{#3}% + \gdef\upm@mfigureslabel{fig:#4}% + \begin{#1}[#2]\centering % + \begingroup% +} + +\newcommand{\upm@endsubfigure}[1]{% + \endgroup% + \caption{\upm@mfigurescaption}% + \label{\upm@mfigureslabel}% + \end{#1}% + \let\mfigure\upm@mfiguresaved +} + +%----- +%\mfigures[position]{caption}{label} +\newenvironment{mfigures}[3][ht]{ + \upm@beginsubfigure{figure}{#1}{#2}{#3}% +}{% + \upm@endsubfigure{figure}% +} +%----- +%\mfigures*[position]{caption}{label} +\newenvironment{mfigures*}[3][ht]{ + \upm@beginsubfigure{figure*}{#1}{#2}{#3}% +}{% + \upm@endsubfigure{figure*}% +} + +%---------------------------------------- +% IMAGES INCLUDING TeX EXPRESSIONS +%---------------------------------------- + +% +% This section is copied from the AutoLaTeX package +% http://www.arakhne.org/autolatex +% + +%----- +%\DeclareGraphicsExtensionsWtex{coma separated extensions} +\providecommand{\DeclareGraphicsExtensionsWtex}[1]{% + \xdef\@autolatex@wtfig@extensions{\zap@space#1 \@empty}% +} +\ifpdf + \DeclareGraphicsExtensionsWtex{.pdftex_t,.pdf_tex} +\else + \DeclareGraphicsExtensionsWtex{.pstex_t,.ps_tex} +\fi + +\providecommand{\@autolatex@wtfig@searchinpath}[1]{% + \IfFileExists{#1}{% + \protected@edef\@autolatex@wtfig@tmp{\protect\resizebox{\@autolatex@wtfig@width}{\@autolatex@wtfig@height}{\protect\input{#1}}}% + }{% + \@for\@autolatex@wtfig@pathtmp:=\Ginput@path\do{% + \ifx\@autolatex@wtfig@tmp\relax% + \IfFileExists{\@autolatex@wtfig@pathtmp#1}{% + \protected@edef\@autolatex@wtfig@tmp{\protect\resizebox{\@autolatex@wtfig@width}{\@autolatex@wtfig@height}{\protect\input{\@autolatex@wtfig@pathtmp#1}}}% + }{}% + \fi% + }% + }% +} + +\define@key[autolatex]{withtex}{width}{% + \gdef\@autolatex@wtfig@width{#1}% +} +\define@key[autolatex]{withtex}{height}{% + \gdef\@autolatex@wtfig@height{#1}% +} + +%----- +%\includefigurewtex[width=xx,height=yy]{filename} +\providecommand{\includefigurewtex}[2][width=\linewidth]{% + \begingroup% + \gdef\@autolatex@wtfig@width{!}% + \gdef\@autolatex@wtfig@height{!}% + \setkeys[autolatex]{withtex}{#1}% + % + \global\let\@autolatex@wtfig@tmp\relax% + \global\let\@autolatex@wtfig@ext\relax% + \global\let\@autolatex@wtfig@path\relax% + \filename@parse{#2}% + \ifx\filename@ext\relax% + \@for\@autolatex@wtfig@exttmp:=\@autolatex@wtfig@extensions\do{% + \@autolatex@wtfig@searchinpath{#2\@autolatex@wtfig@exttmp}% + }% + \else% + \@autolatex@wtfig@searchinpath{#2\@autolatex@wtfig@exttmp}% + \fi% + % + \ifx\@autolatex@wtfig@tmp\relax% + \errmessage{Package upmethodology-fmt: File not found '#2', needed for figure inclusion}% + \else% + \@autolatex@wtfig@tmp% + \fi% + % + \endgroup% +} + +\global\let\includegraphicswtex\includefigurewtex + +%---------------------------------------- +% ENVIRONMENT FOR IMAGES INCLUDING TeX EXPRESSIONS +%---------------------------------------- + +\gdef\upm@figtex@dyncaption@remove{} +\gdef\upm@figtex@figremove#1{% + \global\expandafter\let\csname FIG#1\endcsname\relax% +} +\gdef\upm@figtex@restore{% + \upm@figtex@dyncaption@remove% + \gdef\upm@figtex@dyncaption@remove{} +} +%----- +%\figmath{id}{content} +\def\figmath#1#2{% + \expandafter\gdef\csname FIG#1\endcsname{\ensuremath{#2}}% + \global\protected@edef\upm@figtex@dyncaption@remove{\upm@figtex@dyncaption@remove\protect\upm@figtex@figremove{#1}}% +} +%----- +%\figtext{id}{content} +\def\figtext#1#2{% + \expandafter\gdef\csname FIG#1\endcsname{#2}% + \global\protected@edef\upm@figtex@dyncaption@remove{\upm@figtex@dyncaption@remove\protect\upm@figtex@figremove{#1}}% +} + +\let\upm@fmt@figtex@nil\@nil +\def\upm@fmt@figtex@parseparams#1=#2\upm@fmt@figtex@nil{\gdef\@tmp{#2}} + +\newcommand{\upm@mfigurewtex}[5][ht]{ + \begin{figure}[#1]% + \begin{center}% + % Providing an ascendent compatibility on the second parameter: + % - Prefered value of the parameter: a list of key/value pairs; + % - Old fashion value of the parameter: the value for the "width" key. + {\upm@fmt@figtex@parseparams #2====\upm@fmt@figtex@nil}% + \ifthenelse{\equal{\@tmp}{===}}{% + \includegraphicswtex[width=#2]{#3}% + }{% + \includegraphicswtex[#2]{#3}% + }% + \caption{#4}% + \label{fig:#5}% + \end{center}% + \end{figure}% + \upm@figtex@restore% +} +\newcommand{\upm@mfigurewtexstar}[5][ht]{ + \begin{figure*}[#1]% + \begin{center}% + % Providing an ascendent compatibility on the second parameter: + % - Prefered value of the parameter: a list of key/value pairs; + % - Old fashion value of the parameter: the value for the "width" key. + {\upm@fmt@figtex@parseparams #2====\upm@fmt@figtex@nil}% + \ifthenelse{\equal{\@tmp}{===}}{% + \includegraphicswtex[width=#2]{#3}% + }{% + \includegraphicswtex[#2]{#3}% + }% + \caption{#4}% + \label{fig:#5}% + \end{center}% + \end{figure*}% + \upm@figtex@restore% +} +%----- +%\mfigurewtex[position]{options}{filename}{caption}{label} +\def\mfigurewtex{\@ifstar\upm@mfigurewtexstar\upm@mfigurewtex} + + + +%---------------------------------------- +% TABLES +%---------------------------------------- + +%table's colors +\definecolor{backtableheader}{rgb}{0.92,0.94,1} +\definecolor{fronttableheader}{rgb}{0.23,0.33,0.48} +%title of a table +\def\upm@fmt@table@title#1{\color{fronttableheader} \cellcolor{backtableheader} {\bfseries #1}} +%title of columns +\def\upm@fmt@table@column@title#1{\hfil{\color{fronttableheader} \cellcolor{backtableheader} {\itshape#1}}\hfil} + +% Utility functions for mtabular +\newcounter{upm@fmt@mtabular@columnnumber} + +\gdef\upm@fmt@mtabular@expandtitle#1#2{% + \multicolumn{#1}{|c|}{\upm@fmt@table@title{\ignorespaces#2\ignorespaces}}% +} + +\newcommand{\tabulartitlespec}[1]{% + \gdef\upm@fmt@mtabular@expandtitle##1##2{% + \multicolumn{##1}{#1}{\upm@fmt@table@title{\ignorespaces##2\ignorespaces}}% + } +} + +%----- +%\mtabular[width]{ncolumns}{columns} +\newenvironment{mtabular}[3][\linewidth]{% + \newcommand{\tabulartitle}[1]{% + \hline% + \upm@fmt@mtabular@expandtitle{#2}{##1} \\% + \hline% + }% + \newcommand{\tabulartitleinside}[1]{% + \hline\hline% + \upm@fmt@mtabular@expandtitle{#2}{##1} \\% + \hline% + }% + \newcommand*{\upm@fmt@mtabular@column@next}[1]{% + & \upm@fmt@table@column@title{\ignorespaces##1\ignorespaces}% + \addtocounter{upm@fmt@mtabular@columnnumber}{-1}% + \ifnum0<\value{upm@fmt@mtabular@columnnumber}% + \let\upm@fmt@mtabular@column@continue\upm@fmt@mtabular@column@next% + \else% + \\ \hline \let\upm@fmt@mtabular@column@continue\relax% + \fi% + \upm@fmt@mtabular@column@continue% + } + \newcommand*{\upm@fmt@mtabular@column@first}[1]{% + \upm@fmt@table@column@title{\ignorespaces##1\ignorespaces}% + \addtocounter{upm@fmt@mtabular@columnnumber}{-1}% + \ifnum0<\value{upm@fmt@mtabular@columnnumber}% + \let\upm@fmt@mtabular@column@continue\upm@fmt@mtabular@column@next% + \else% + \\ \hline \let\upm@fmt@mtabular@column@continue\relax% + \fi% + \upm@fmt@mtabular@column@continue% + } + \newcommand{\tabularheader}{% + \setcounter{upm@fmt@mtabular@columnnumber}{#2}% + \upm@fmt@mtabular@column@first% + }% + \newcommand{\tabularrowheader}[1]{% + \centering\upm@fmt@table@column@title{\ignorespaces##1}% + }% + \begingroup\tabularx{#1}{#3}% +}{% + \endtabularx\endgroup% +} + +%----- +%\mtable[options]{width}{ncolumns}{columns}{caption}{label} +% size=<length> +\define@key[autolatex]{mtable}{size}{\gdef\@autolatex@mtable@size{#1}} +% position: h t b p H ! +\define@key[autolatex]{mtable}{h}[\relax]{\gdef\@autolatex@mtable@position{[h]}} +\define@key[autolatex]{mtable}{t}[\relax]{\gdef\@autolatex@mtable@position{[t]}} +\define@key[autolatex]{mtable}{b}[\relax]{\gdef\@autolatex@mtable@position{[b]}} +\define@key[autolatex]{mtable}{p}[\relax]{\gdef\@autolatex@mtable@position{[p]}} +\define@key[autolatex]{mtable}{H}[\relax]{\gdef\@autolatex@mtable@position{[H]}} +\define@key[autolatex]{mtable}{ht}[\relax]{\gdef\@autolatex@mtable@position{[ht]}} +\define@key[autolatex]{mtable}{hb}[\relax]{\gdef\@autolatex@mtable@position{[hb]}} +\define@key[autolatex]{mtable}{hp}[\relax]{\gdef\@autolatex@mtable@position{[hp]}} +\define@key[autolatex]{mtable}{hH}[\relax]{\gdef\@autolatex@mtable@position{[hH]}} +\define@key[autolatex]{mtable}{h!}[\relax]{\gdef\@autolatex@mtable@position{[h!]}} +\define@key[autolatex]{mtable}{tb}[\relax]{\gdef\@autolatex@mtable@position{[tb]}} +\define@key[autolatex]{mtable}{tp}[\relax]{\gdef\@autolatex@mtable@position{[tp]}} +\define@key[autolatex]{mtable}{tH}[\relax]{\gdef\@autolatex@mtable@position{[tH]}} +\define@key[autolatex]{mtable}{t!}[\relax]{\gdef\@autolatex@mtable@position{[t!]}} +\define@key[autolatex]{mtable}{bp}[\relax]{\gdef\@autolatex@mtable@position{[bp]}} +\define@key[autolatex]{mtable}{bH}[\relax]{\gdef\@autolatex@mtable@position{[bH]}} +\define@key[autolatex]{mtable}{b!}[\relax]{\gdef\@autolatex@mtable@position{[b!]}} +\define@key[autolatex]{mtable}{pH}[\relax]{\gdef\@autolatex@mtable@position{[pH]}} +\define@key[autolatex]{mtable}{p!}[\relax]{\gdef\@autolatex@mtable@position{[p!]}} +\define@key[autolatex]{mtable}{H!}[\relax]{\gdef\@autolatex@mtable@position{[H!]}} +\define@key[autolatex]{mtable}{htb}[\relax]{\gdef\@autolatex@mtable@position{[htb]}} +\define@key[autolatex]{mtable}{htp}[\relax]{\gdef\@autolatex@mtable@position{[htp]}} +\define@key[autolatex]{mtable}{htH}[\relax]{\gdef\@autolatex@mtable@position{[htH]}} +\define@key[autolatex]{mtable}{ht!}[\relax]{\gdef\@autolatex@mtable@position{[ht!]}} +\define@key[autolatex]{mtable}{tbp}[\relax]{\gdef\@autolatex@mtable@position{[tbp]}} +\define@key[autolatex]{mtable}{tbH}[\relax]{\gdef\@autolatex@mtable@position{[tbH]}} +\define@key[autolatex]{mtable}{tb!}[\relax]{\gdef\@autolatex@mtable@position{[tb!]}} +\define@key[autolatex]{mtable}{bpH}[\relax]{\gdef\@autolatex@mtable@position{[bpH]}} +\define@key[autolatex]{mtable}{bp!}[\relax]{\gdef\@autolatex@mtable@position{[bp!]}} +\define@key[autolatex]{mtable}{pH!}[\relax]{\gdef\@autolatex@mtable@position{[pH!]}} +\define@key[autolatex]{mtable}{htbp}[\relax]{\gdef\@autolatex@mtable@position{[htbp]}} +\define@key[autolatex]{mtable}{htbH}[\relax]{\gdef\@autolatex@mtable@position{[htbH]}} +\define@key[autolatex]{mtable}{htb!}[\relax]{\gdef\@autolatex@mtable@position{[htb!]}} +\define@key[autolatex]{mtable}{tbpH}[\relax]{\gdef\@autolatex@mtable@position{[tbpH]}} +\define@key[autolatex]{mtable}{tbp!}[\relax]{\gdef\@autolatex@mtable@position{[tbp!]}} +\define@key[autolatex]{mtable}{bpH!}[\relax]{\gdef\@autolatex@mtable@position{[bph!]}} +\define@key[autolatex]{mtable}{htbpH}[\relax]{\gdef\@autolatex@mtable@position{[htbpH]}} +\define@key[autolatex]{mtable}{htbp!}[\relax]{\gdef\@autolatex@mtable@position{[htbp!]}} +\define@key[autolatex]{mtable}{htbpH!}[\relax]{\gdef\@autolatex@mtable@position{[htbpH!]}} +% +\newenvironment{mtable}[6][ht]{% + \gdef\@autolatex@mtable@position{[ht]}% + \gdef\@autolatex@mtable@size{\normalsize}% + \setkeys[autolatex]{mtable}{#1}% + % + \gdef\upm@table@caption{#5}% + \xdef\upm@table@label{tab:#6}% + \gdef\upm@table@note{}% + \newcommand{\captionastitle}{\tabulartitle{\upm@table@caption}}% + \newcommand{\tablenote}[1]{\gdef\upm@table@note{\bgroup ##1\egroup}}% + \expandafter\table\@autolatex@mtable@position% + \center\@autolatex@mtable@size% + \mtabular[#2]{#3}{#4}% +}{% + \endmtabular\relax% + \caption{\upm@table@caption}% + \label{\upm@table@label}% + \endcenter% + \upm@table@note% + \endtable% + \global\let\upm@table@caption\relax% + \global\let\upm@table@label\relax% + \global\let\upm@table@note\relax% +} + +%----- +%\tabref{label} +\newcommand{\tabref}[1]{\ref{tab:#1}} +%----- +%\tabpageref{label} +\newcommand{\tabpageref}[1]{\pageref{tab:#1}} + +%---------------------------------------- +% PARAGRAPHS +%---------------------------------------- +\setlength{\parindent}{0pt} +\setlength{\parskip}{.2cm} + +%---------------------------------------- +% COLORIZED SECTION'S TITLES +%---------------------------------------- + +% PRIVATE COLORS +\definecolor{sectiontitlecolor}{rgb}{0.93,0.41,0} +\definecolor{chaptertitlecolor}{rgb}{0.24,0.33,0.48} +\definecolor{parttitlecolor}{rgb}{0.24,0.33,0.48} + +% PRIVATE FORMATTING MACROS +\newcounter{upm@format@section@sectionlevel} +\setcounter{upm@format@section@sectionlevel}{0} + +\gdef\upm@format@partnum#1{\textcolor{parttitlecolor}{\expandafter\fontsize{40pt}{60pt}\selectfont#1\normalfont}} +\gdef\upm@format@parttitle#1{\textcolor{parttitlecolor}{\huge\scshape #1}} +\gdef\upm@format@chapternum#1{\textcolor{chaptertitlecolor}{\expandafter\fontsize{40pt}{60pt}\selectfont#1\normalfont}} +\gdef\upm@format@chaptertitle#1{\textcolor{chaptertitlecolor}{\Huge\scshape #1}} +\gdef\upm@format@sectionnum#1#2{\textcolor{sectiontitlecolor}{#2}} +\gdef\upm@format@sectiontitle#1#2{\textcolor{sectiontitlecolor}{#2}} +\gdef\upm@format@sectionnum@postfix{/} + +% PART +\ifupmbookformat + \gdef\@part[#1]#2{% + \ifnum \c@secnumdepth >-2\relax + \refstepcounter{part}% + \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% + \else + \addcontentsline{toc}{part}{#1}% + \fi + \markboth{}{}% + {\huge\centering + \interlinepenalty \@M + \normalfont + \ifnum \c@secnumdepth >-2\relax + \upm@format@partnum{\thepart} + \par + \vskip 20\p@ + \fi + \upm@format@parttitle{\nohyphens{#2}}\par}% + \@endpart} + \gdef\@spart#1{% + {\centering + \interlinepenalty \@M + \normalfont + \upm@format@parttitle{\nohyphens{#1}}\par}% + \@endpart} +\fi + +% CHAPTER +\ifupmarticleformat\else + \newcommand{\upm@format@makechapterhead}[2]{% + %\vspace*{50\p@}% + {\parindent \z@ \Huge \raggedleft \normalfont + \ifx\@empty#1\ifnum \c@secnumdepth >\m@ne + \upm@format@chapternum{\thechapter} + \par\nobreak + \vskip 20\p@ + \fi\fi + \interlinepenalty\@M + %\ifupmbookformat\doublespacing\fi + \upm@format@chaptertitle{\nohyphens{#2}}\par\nobreak + \vskip 80\p@ + } + } + %internal implementation of \chapter + \gdef\@makechapterhead#1{\upm@format@makechapterhead{\@empty}{#1}} + %internal implementation of \chapter* + \gdef\@makeschapterhead#1{\upm@format@makechapterhead{\relax}{#1}} +\fi + +% SECTIONS +\let\upm@format@sect@old\@sect +\let\upm@format@ssect@old\@ssect + +% public implementation of sections. +\renewcommand{\section}{\setcounter{upm@format@section@sectionlevel}{1}\@startsection{section}{1}{\z@}{-3.5ex \@plus -1ex \@minus -.2ex}{2.3ex \@plus.2ex}{\normalfont\Large\scshape}} +\renewcommand{\subsection}{\setcounter{upm@format@section@sectionlevel}{2}\@startsection{subsection}{2}{\z@}{-3.25ex\@plus -1ex \@minus -.2ex}{1.5ex \@plus .2ex}{\normalfont\large\scshape}} +\renewcommand{\subsubsection}{\setcounter{upm@format@section@sectionlevel}{3}\@startsection{subsubsection}{3}{\z@}{-3.25ex\@plus -1ex \@minus -.2ex}{1.5ex \@plus .2ex}{\normalfont\normalsize\scshape}} + +% internal implementations for sections. +\gdef\@sect#1#2#3#4#5#6[#7]#8{\upm@format@sect@old{#1}{#2}{#3}{#4}{#5}{#6}[#7]{\upm@format@sectiontitle{\theupm@format@section@sectionlevel}{#8}}} +\gdef\@ssect#1#2#3#4#5{\upm@format@ssect@old{#1}{#2}{#3}{#4}{\upm@format@sectiontitle{\theupm@format@section@sectionlevel}{#5}}} +\gdef\@seccntformat#1{\upm@format@sectionnum{\theupm@format@section@sectionlevel}{\csname the#1\endcsname\upm@format@sectionnum@postfix}\quad} + +%---------------------------------------- +% PAGE LAYOUT +%---------------------------------------- + +% Change the factors for determining the element positions +\renewcommand{\topfraction}{.99} % max fraction of floats at top +\renewcommand{\bottomfraction}{.99} % max fraction of floats at bottom +\renewcommand{\textfraction}{.5} % allow minimal text w. figs +\renewcommand{\dbltopfraction}{.66} % fit big float above 2-col. text +\renewcommand{\floatpagefraction}{0.99} % require fuller float pages | N.B.: floatpagefraction MUST be less than topfraction !! +\renewcommand{\dblfloatpagefraction}{.66} % fit big float above 2-col. text + +% Update the format of the saved pages and sections +\renewcommand{\sectionmark}[1]{\markright{\thesection\ \textsc{#1}}} +\ifupmarticleformat\else +\renewcommand{\chaptermark}[1]{\markboth{\textsc{#1}}{}} +\renewcommand{\@mkboth}[2]{% + \let\upm@doc@MakeUppercase\MakeUppercase% + \gdef\MakeUppercase##1{##1}% + \chaptermark{#1}% + \let\MakeUppercase\upm@doc@MakeUppercase% + \let\upm@doc@MakeUppercase\relax% +} +\fi +% Make sure that the page before a part or +% a chapter title was empty +\renewcommand{\cleardoublepage}{% + \clearpage% + \if@twoside\ifodd\c@page% + \else% + \thispagestyle{facingtochapter}% + \hbox{}\newpage% + \if@twocolumn\hbox{}\newpage% + \fi\fi\fi% +} +\newcommand{\ps@facingtochapter}{\ps@empty} + +%---------------------------------------- +% ADDITIONAL SECTIONS +%---------------------------------------- + +\gdef\upm@format@newsection@alignment{} + +%----- +% Part without number but inside the TOC +%\parttoc [toctitle]{title} % left-alignment inside TOC +%\parttoc*[toctitle]{title} % right-alignment inside TOC +\def\parttoc{\@ifstar% + {\gdef\upm@format@newsection@alignment{\protect\numberline{}}\expandafter\upm@format@newsection@part}% + {\gdef\upm@format@newsection@alignment{}\expandafter\upm@format@newsection@part}} +\def\upm@format@newsection@part{\@ifnextchar [% + {\expandafter\upm@format@newsection@part@opt}% + {\expandafter\upm@format@newsection@part@nopt}} +\def\upm@format@newsection@part@opt[#1]#2{% + \part*{#2\addcontentsline{toc}{part}{\upm@format@newsection@alignment{#1}}}% + \chaptermark{}% +} +\def\upm@format@newsection@part@nopt#1{% + \part*{#1\addcontentsline{toc}{part}{\upm@format@newsection@alignment{#1}}}% + \chaptermark{}% +} + +%----- +% Chapter without number but inside the TOC +%\chaptertoc [toctitle]{title} % left-alignment inside TOC +%\chaptertoc*[toctitle]{title} % right-alignment inside TOC +\def\chaptertoc{\@ifstar% + {\gdef\upm@format@newsection@alignment{\protect\numberline{}}\expandafter\upm@format@newsection@chapter}% + {\gdef\upm@format@newsection@alignment{}\expandafter\upm@format@newsection@chapter}} + +\def\upm@format@newsection@chapter{\@ifnextchar[% + {\upm@format@newsection@chapter@a}% + {\upm@format@newsection@chapter@b}% +} + +\def\upm@format@newsection@chapter@a[#1]#2{% + \expandafter\chapter*[#1]{#2}% + \addcontentsline{toc}{chapter}{\upm@format@newsection@alignment{#1}}% + \@ifundefined{minitoc}{}{% + \global\addtocounter{mtc}{1}% + }% +} + +\def\upm@format@newsection@chapter@b#1{% + \expandafter\chapter*{#1}% + \addcontentsline{toc}{chapter}{\upm@format@newsection@alignment{#1}}% + \@ifundefined{minitoc}{}{% + \global\addtocounter{mtc}{1}% + }% +} + +%----- +% Section without number but inside the TOC +%\sectiontoc [toctitle]{title} % left-alignment inside TOC +%\sectiontoc*[toctitle]{title} % right-alignment inside TOC +\def\sectiontoc{\@ifstar% + {\gdef\upm@format@newsection@alignment{\protect\numberline{}}\expandafter\upm@format@newsection@section}% + {\gdef\upm@format@newsection@alignment{}\expandafter\upm@format@newsection@section}} +\def\upm@format@newsection@section{\@ifnextchar [% + {\expandafter\upm@format@newsection@section@opt}% + {\expandafter\upm@format@newsection@section@nopt}} +\def\upm@format@newsection@section@opt[#1]#2{% + \section*{#2\addcontentsline{toc}{section}{\upm@format@newsection@alignment{#1}}}% +} +\def\upm@format@newsection@section@nopt#1{% + \section*{#1\addcontentsline{toc}{section}{\upm@format@newsection@alignment{#1}}}% +} + +%----- +% Subsection without number but inside the TOC +%\subsectiontoc [toctitle]{title} % left-alignment inside TOC +%\subsectiontoc*[toctitle]{title} % right-alignment inside TOC +\def\subsectiontoc{\@ifstar% + {\gdef\upm@format@newsection@alignment{\protect\numberline{}}\expandafter\upm@format@newsection@subsection}% + {\gdef\upm@format@newsection@alignment{}\expandafter\upm@format@newsection@subsection}} +\def\upm@format@newsection@subsection{\@ifnextchar [% + {\expandafter\upm@format@newsection@subsection@opt}% + {\expandafter\upm@format@newsection@subsection@nopt}} +\def\upm@format@newsection@subsection@opt[#1]#2{% + \subsection*{#2\addcontentsline{toc}{subsection}{\upm@format@newsection@alignment{#1}}}% +} +\def\upm@format@newsection@subsection@nopt#1{% + \subsection*{#1\addcontentsline{toc}{subsection}{\upm@format@newsection@alignment{#1}}}% +} + +%----- +% Subsubsection without number but inside the TOC +%\subsubsectiontoc [toctitle]{title} % left-alignment inside TOC +%\subsubsectiontoc*[toctitle]{title} % right-alignment inside TOC +\def\subsubsectiontoc{\@ifstar% + {\gdef\upm@format@newsection@alignment{\protect\numberline{}}\expandafter\upm@format@newsection@subsubsection}% + {\gdef\upm@format@newsection@alignment{}\expandafter\upm@format@newsection@subsubsection}} +\def\upm@format@newsection@subsubsection{\@ifnextchar [% + {\expandafter\upm@format@newsection@subsubsection@opt}% + {\expandafter\upm@format@newsection@subsubsection@nopt}} +\def\upm@format@newsection@subsubsection@opt[#1]#2{% + \subsubsection*{#2\addcontentsline{toc}{subsubsection}{\upm@format@newsection@alignment{#1}}}% +} +\def\upm@format@newsection@subsubsection@nopt#1{% + \subsubsection*{#1\addcontentsline{toc}{subsubsection}{\upm@format@newsection@alignment{#1}}}% +} + +%----- +% Chapter with different titles for in the TOC, the headers and on the pages +%\chapterfull[in toc]{on page}{in header} % with number +%\chapterfull*[in toc]{on page}{in header} % without number +\def\chapterfull{\@ifstar% + {\gdef\upm@format@newsection@thesectionmacro{\chapter*}\upm@format@newsection@chapterfull}% + {\gdef\upm@format@newsection@thesectionmacro{\chapter}\upm@format@newsection@chapterfull}% +} + +\def\upm@format@newsection@chapterfull{\@ifnextchar[% + \upm@format@newsection@chapterfull@a% + \upm@format@newsection@chapterfull@b% +} + +\def\upm@format@newsection@chapterfull@a[#1]#2#3{% + \upm@format@newsection@thesectionmacro[#1]{#2}% + \chaptermark{#3}% +} + +\def\upm@format@newsection@chapterfull@b#1#2{% + \upm@format@newsection@thesectionmacro{#1}% + \chaptermark{#2}% +} + +%----- +% Section with different titles for in the TOC, the headers and on the pages +%\sectionfull[in toc]{on page}{in header} % with number +%\sectionfull*[in toc]{on page}{in header} % without number +\def\sectionfull{\@ifstar% + {\gdef\upm@format@newsection@thesectionmacro{\section*}\upm@format@newsection@sectionfull}% + {\gdef\upm@format@newsection@thesectionmacro{\section}\upm@format@newsection@sectionfull}% +} + +\def\upm@format@newsection@sectionfull{\@ifnextchar[% + \upm@format@newsection@sectionfull@a% + \upm@format@newsection@sectionfull@b% +} + +\def\upm@format@newsection@sectionfull@a[#1]#2#3{% + \upm@format@newsection@thesectionmacro[#1]{#2}% + \global\sectionmark{#3}% +} + +\def\upm@format@newsection@sectionfull@b#1#2{% + \upm@format@newsection@thesectionmacro{#1}% + \global\sectionmark{#2}% +} + +%---------------------------------------- +% BIBLIOGRAPHY +%---------------------------------------- + +%----- +%\bibsize{size} +\newcommand{\bibsize}[1]{\gdef\upm@bibsize{#1}} + +\gdef\upm@bibsize{\small} + +\gdef\@biblabel#1{{\upm@bibsize{[#1]}}} + +\gdef\@lbibitem[#1]#2{\item[\@biblabel{#1}\hfill]\upm@bibsize\if@filesw{% + \let\protect\noexpand\immediate\write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces} + +\gdef\@bibitem#1{\item\upm@bibsize\if@filesw% + \immediate\write\@auxout{\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces} + + +%---------------------------------------- +% TABLE OF CONTENT +%---------------------------------------- +\setcounter{secnumdepth}{3} +\setcounter{tocdepth}{3} + +% Change the color of the TOC for the "dotted" lines +%\let\upm@format@dottedtocline@old\@dottedtocline +%\gdef\@dottedtocline#1#2#3#4#5{% +% %{depth}{left margin}{right margin}{text}{page number} +% \upm@format@dottedtocline@old{#1}{#2}{#3}{#4}{#5}% +%} + +% Change the color of the TOC for the parts +\@ifundefined{l@part}{}{ +\let\upm@format@l@part@old\l@part +\renewcommand*\l@part[2]{% + %{text}{page number} + \upm@format@l@part@old{\textcolor{parttitlecolor}{#1}}{\textcolor{parttitlecolor}{#2}}% +} +} + +% Change the color of the TOC for the chapters +\@ifundefined{l@chapter}{}{ +\let\upm@format@l@chapter@old\l@chapter +\renewcommand*\l@chapter[2]{% + %{text}{page number} + \upm@format@l@chapter@old{\textcolor{chaptertitlecolor}{#1}}{\textcolor{chaptertitlecolor}{#2}}% +} +} + +% Overide the color and font configurations of the MINITOC package +\AtBeginDocument{ + \@ifundefined{minitoc}{}{% + % Chapter + \gdef\mtifont{\normalfont\large\upshape\bfseries\color{chaptertitlecolor}} + % Section + \gdef\mtcSfont{\normalfont\small\upshape\bfseries\color{sectiontitlecolor}} + % Sub-Section and SubSub-Section + \gdef\mtcSSfont{\normalfont\small\upshape\mdseries\normalcolor} + \global\let\mtcSSSfont\mtcSSfont + } +} + +%---------------------------------------- +% ENUMERATIONS +%---------------------------------------- +\newcounter{upm@fmt@savedcounter} + +\newcommand{\savecounter}[1]{% + \setcounter{upm@fmt@savedcounter}{\value{#1}}% +} +\newcommand{\restorecounter}[1]{% + \setcounter{#1}{\theupm@fmt@savedcounter}% +} + +\ifupm@use@override@standard@lists + \newcommand{\saveenumcounter}{\savecounter{@upm@fmt@enumdescription@cnt@}} + \newcommand{\restoreenumcounter}{\restorecounter{@upm@fmt@enumdescription@cnt@}} + \newcommand{\setenumcounter}[1]{\setcounter{@upm@fmt@enumdescription@cnt@}{#1}} + \newcommand{\getenumcounter}{\the@upm@fmt@enumdescription@cnt@} +\else + \newcommand{\saveenumcounter}{\savecounter{@enumctr}} + \newcommand{\restoreenumcounter}{\restorecounter{@enumctr}} + \newcommand{\setenumcounter}[1]{\setcounter{@enumctr}{#1}\addtocounter{@enumctr}{-1}} + \newcommand{\getenumcounter}{\value{@enumctr}} +\fi + +%---------------------------------------- +% FOOTNOTE +%---------------------------------------- + +\gdef\upm@footnoteref#1{\upm@textsuperscript{#1}} +\gdef\upm@footnotepageref#1#2{\upm@textsuperscript{{#1\tiny(#2)}}} + +\def\upm@savefootnote#1#2{% + \footnote{#1\label{\upm@protect{footnote:#2}}}% + \upm@nameundef{footnote:#2:cmd}% +} +\def\upm@savefootnotestar#1#2{% + \upm@namedef{footnote:#2:cmd}{\upm@savefootnote{#1}{#2}}% +} + +\DeclareRobustCommand\savefootnote{\@ifstar\upm@savefootnotestar\upm@savefootnote} + +\def\upm@reffootnote#1{% + \upm@ifdefinedname{footnote:#1:cmd}{% + \upm@nameuse{footnote:#1:cmd}}{% + \upm@footnoteref{\upm@getref{\upm@protect{footnote:#1}}}% + }% + \xspace% +} +\def\upm@reffootnotestar#1{% + \upm@ifdefinedname{footnote:#1:cmd}{% + \upm@nameuse{footnote:#1:cmd}}{% + \xdef\upm@tmp@tmp{\upm@protect{footnote:#1}}% + \upm@footnotepageref{\expandafter\upm@getref{\upm@tmp@tmp}}{\expandafter\upm@getpageref{\upm@tmp@tmp}}% + \global\let\upm@tmp@tmp\relax% + }% + \xspace% +} + +\DeclareRobustCommand\reffootnote{\@ifstar\upm@reffootnotestar\upm@reffootnote} + +%---------------------------------------- +% IMAGES IN PARAGRAPHS +%---------------------------------------- + +\newenvironment{umlinpar}[2][width=.45\linewidth]{% +\begin{window}[0,r,{\mbox{\hspace{.5cm}\includegraphics[#1]{#2}\vspace{.5cm}}},{}] +}{% +\end{window}} + +%---------------------------------------- +% DATE +%---------------------------------------- + +%Build a date that has the format supported by tex-upmethodology +%\makedate{day}{month}{year} +\let\makedate\upm@format@lang@makedate + +%----- +%Replies the year corresponding to the given supported date +%\extractyear{date} +\let\extractyear\upm@format@lang@extractyear + +%----- +%Replies the month corresponding to the given supported date +%\extractmonth{date} +\let\extractmonth\upm@format@lang@extractmonth + +%----- +%Replies the day corresponding to the given supported date +%\extractday{date} +\let\extractday\upm@format@lang@extractday + +% Redefine the today function +\AtBeginDocument{\global\edef\today{\makedate{\the\day}{\the\month}{\the\year}}} + +%---------------------------------------- +% PEOPLE NAME +%---------------------------------------- + +\def\makenamespacing#1{% + \upm@format@makenamespacing{#1}\xspace% +} + +\def\upm@format@makenamespacing#1{% + \upm@foreach.\in#1\do{% + \ignorespaces\upm@foreach@term.\,% + }{% + \ignorespaces\upm@foreach@term% + }% +} + +\gdef\upm@format@people@title#1{\textsc{#1}} +\def\upm@format@firstname@format#1{% + {\smaller\textsc{\upm@format@makenamespacing{#1}}}% +} +\def\upm@format@von@format#1{\mbox{\smaller\ignorespaces#1}} +\def\upm@format@lastname@format#1{\textsc{\ignorespaces#1}} + +%\upmmakename[von]{firstname}{lastname}{separator} +\newcommand{\upmmakename}[4][\relax]{% + \ifx#1\relax% + {\upm@format@firstname@format{#2}#4\upm@format@lastname@format{#3}}% + \else% + {\upm@format@firstname@format{#2}#4\upm@format@von@format{#1}#4\upm@format@lastname@format{#3}}% + \fi% + \xspace% +} +\newcommand{\upmmakenamestar}[4][\relax]{% + \ifx#1\relax% + {\upm@format@lastname@format{#3}#4\upm@format@firstname@format{#2}}% + \else% + {\upm@format@lastname@format{#3}#4\upm@format@von@format{#1}#4\upm@format@firstname@format{#2}}% + \fi% + \xspace% +} + +%\makename[von]{firstname}{lastname} +\newcommand{\makename}[3][\relax]{% + \upmmakename[#1]{#2}{#3}{\ }% +} + +%\makelastname[von]{lastname} +\newcommand{\makelastname}[2][\relax]{% + \ifx#1\relax% + \upm@format@lastname@format{#2}% + \else% + \upm@format@von@format{#1}\ \upm@format@lastname@format{#2}% + \fi% + \xspace% +} + +%\makefirstname{firstname} +\newcommand{\makefirstname}[1]{% + \upm@format@firstname@format{#1}\xspace% +} + +%\prname[von]{firstname}{lastname} +%\prname*[von]{firstname}{lastname} +\def\prname{\@ifstar\upm@prnamestar\upm@prname} +\newcommand{\upm@prname}[3][\relax]{% + \upm@format@people@title{\upm@format@lang@professor}\,\upmmakename[#1]{#2}{#3}{\ }% +} +\newcommand{\upm@prnamestar}[3][\relax]{% + \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@professor}% +} + +%\drname[von]{firstname}{lastname} +%\drname*[von]{firstname}{lastname} +\def\drname{\@ifstar\upm@drnamestar\upm@drname} +\newcommand{\upm@drname}[3][\relax]{% + \upm@format@people@title{\upm@format@lang@doctor}\,\upmmakename[#1]{#2}{#3}{\ }% +} +\newcommand{\upm@drnamestar}[3][\relax]{% + \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@doctor}% +} + +%\phdname[von]{firstname}{lastname} +%\phdname*[von]{firstname}{lastname} +\def\phdname{\@ifstar\upm@phdnamestar\upm@phdname} +\newcommand{\upm@phdname}[3][\relax]{% + \upm@format@people@title{\upm@format@lang@phdoctor}\,\upmmakename[#1]{#2}{#3}{\ }% +} +\newcommand{\upm@phdnamestar}[3][\relax]{% + \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@phdoctor}% +} + +%\scdname[von]{firstname}{lastname} +%\scdname*[von]{firstname}{lastname} +\def\scdname{\@ifstar\upm@scdnamestar\upm@scdname} +\newcommand{\upm@scdname}[3][\relax]{% + \upm@format@people@title{\upm@format@lang@scdoctor}\,\upmmakename[#1]{#2}{#3}{\ }% +} +\newcommand{\upm@scdnamestar}[3][\relax]{% + \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@scdoctor}% +} + +%\mdname[von]{firstname}{lastname} +%\mdname*[von]{firstname}{lastname} +\def\mdname{\@ifstar\upm@mdnamestar\upm@mdname} +\newcommand{\upm@mdname}[3][\relax]{% + \upm@format@people@title{\upm@format@lang@mdoctor}\,\upmmakename[#1]{#2}{#3}{\ }% +} +\newcommand{\upm@mdnamestar}[3][\relax]{% + \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@mdoctor}% +} + +%\pengname[von]{firstname}{lastname} +%\pengname*[von]{firstname}{lastname} +\def\pengname{\@ifstar\upm@pengnamestar\upm@pengname} +\newcommand{\upm@pengname}[3][\relax]{% + \upm@format@people@title{\upm@format@lang@professionalengineer}\,\upmmakename[#1]{#2}{#3}{\ }% +} +\newcommand{\upm@pengnamestar}[3][\relax]{% + \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@professionalengineer}% +} + +%\iengname[von]{firstname}{lastname} +%\iengname*[von]{firstname}{lastname} +\def\iengname{\@ifstar\upm@iengnamestar\upm@iengname} +\newcommand{\upm@iengname}[3][\relax]{% + \upm@format@people@title{\upm@format@lang@incorporatedengineer}\,\upmmakename[#1]{#2}{#3}{\ }% +} +\newcommand{\upm@iengnamestar}[3][\relax]{% + \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@incorporatedengineer}% +} + +%---------------------------------------- +% INLINE ENUMERATION +%---------------------------------------- + +\newcounter{@@upm@fmt@inlineenumeration} +\newcommand{\inlineenumerationlabel}[1]{(#1)} +\let\upm@fmt@inlineenum@numberformat\roman +\newenvironment{inlineenumeration}{% + \begingroup% + \let\upm@fmt@inlineenum@currentlabel\@currentlabel% + \renewcommand{\item}{\xdef\@currentlabel{\upm@fmt@inlineenum@numberformat{@@upm@fmt@inlineenumeration}}{\inlineenumerationlabel{\@currentlabel}{\addtocounter{@@upm@fmt@inlineenumeration}{1}}}~}% + \setcounter{@@upm@fmt@inlineenumeration}{1}% +}{% + \global\let\@currentlabel\upm@fmt@inlineenum@currentlabel% + \endgroup% +} + +%---------------------------------------- +% DESCRIPTION LIST WITH NUMBERS +%---------------------------------------- + +\newcounter{@upm@fmt@enumdescription@cnt@} +\gdef\upm@fmt@enumdescription@savedlabel{} +\gdef\upm@fmt@enumdescription@savedcounter{} +\newcommand{\upm@fmt@enumdescription@fmt@}[1]{} +\newcommand{\enumdescriptionlabel}[1]{\textbf{#1}} +\newcommand{\enumdescriptioncounterseparator}{~-~} +\newcommand{\enumdescriptionlabelseparator}{\upm@column@char} +% #1: counter style. +% #2: text before the counter. +% #3: text after the counter. +% #4: text between the counter and the description. +% #5: text between the description and the rest of the text. +% #6: text between the counter (no description) and the rest of the text. +\newenvironment{upm@fmt@enumdescription}[6]{% + \begin{list}{}{% + \renewcommand{\upm@fmt@enumdescription@savedlabel}{\@currentlabel}% + \edef\upm@fmt@enumdescription@savedcounter{\the@upm@fmt@enumdescription@cnt@}% + \setcounter{@upm@fmt@enumdescription@cnt@}{1}% + \ifthenelse{\equal{#1}{a}}{% + \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\alph{##1}#3}% + }{% + \ifthenelse{\equal{#1}{A}}{% + \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\Alph{##1}#3}% + }{% + \ifthenelse{\equal{#1}{i}}{% + \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\roman{##1}#3}% + }{% + \ifthenelse{\equal{#1}{I}}{% + \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\Roman{##1}#3}% + }{% + \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\arabic{##1}#3}% + }% + }% + }% + }% + \renewcommand{\makelabel}[1]{% + \xdef\@currentlabel{\upm@fmt@enumdescription@fmt@{@upm@fmt@enumdescription@cnt@}}% + \enumdescriptionlabel{\@currentlabel#4##1\ifthenelse{\equal{a##1}{a}}{#6}{#5}}{\addtocounter{@upm@fmt@enumdescription@cnt@}{1}}}% + \expandafter\settowidth{\labelwidth}{#2iii#3}% + } +}{% + \global\let\@currentlabel\upm@fmt@enumdescription@savedlabel% + \setcounter{@upm@fmt@enumdescription@cnt@}{\upm@fmt@enumdescription@savedcounter}% + \end{list}% +} +\newenvironment{enumdescriptionx}[3][i]{% + \begin{upm@fmt@enumdescription}{#1}{#2}{#3}{\enumdescriptioncounterseparator}{\enumdescriptionlabelseparator}{\enumdescriptionlabelseparator}% +}{% + \end{upm@fmt@enumdescription}% +} +\newenvironment{enumdescription}[1][i]{% + \begin{upm@fmt@enumdescription}{#1}{}{}{\enumdescriptioncounterseparator}{\enumdescriptionlabelseparator}{\enumdescriptionlabelseparator}% +}{% + \end{upm@fmt@enumdescription}% +} + +%% Issue #14: enumerate behaves as enumdescription +\ifupm@use@override@standard@lists + + \AtBeginDocument{ + \message{*** Overriding the 'enumerate' environment. Pass option 'standardlists' for avoiding this override.} + \global\let\enumerate\@undefined + \global\let\endenumerate\@undefined + \global\NewEnviron{enumerate}[1][1\string.~]{% + % Parse the parameter for extracting the type of the enumeration, the prefix and the postfix + \in@{a}{#1}\ifin@ + \gdef\upm@fmt@enumerate@style{a}% + \def\reserved@a##1a##2\@nil{% + \def\upm@fmt@enumerate@prefix{##1}% + \def\upm@fmt@enumerate@postfix{##2}% + }% + \reserved@a#1\@nil% + \else\in@{1}{#1}\ifin@ + \gdef\upm@fmt@enumerate@style{1}% + \def\reserved@a##11##2\@nil{% + \def\upm@fmt@enumerate@prefix{##1}% + \def\upm@fmt@enumerate@postfix{##2}% + }% + \reserved@a#1\@nil% + \else\in@{A}{#1}\ifin@ + \gdef\upm@fmt@enumerate@style{A}% + \def\reserved@a##1A##2\@nil{% + \def\upm@fmt@enumerate@prefix{##1}% + \def\upm@fmt@enumerate@postfix{##2}% + }% + \reserved@a#1\@nil% + \else\in@{i}{#1}\ifin@ + \gdef\upm@fmt@enumerate@style{i}% + \def\reserved@a##1i##2\@nil{% + \def\upm@fmt@enumerate@prefix{##1}% + \def\upm@fmt@enumerate@postfix{##2}% + }% + \reserved@a#1\@nil% + \else\in@{I}{#1}\ifin@ + \gdef\upm@fmt@enumerate@style{I}% + \def\reserved@a##1I##2\@nil{% + \def\upm@fmt@enumerate@prefix{##1}% + \def\upm@fmt@enumerate@postfix{##2}% + }% + \reserved@a#1\@nil% + \else% + \errmessage{Invalid format of the enumerate counter} + \fi\fi\fi\fi\fi% + \protected@xdef\upm@tmp{\protect\protect\protect\begin{upm@fmt@enumdescription}{\upm@fmt@enumerate@style}{\upm@fmt@enumerate@prefix}{\upm@fmt@enumerate@postfix}{}{\protect\enumdescriptionlabelseparator}{}}% + % + \upm@tmp% + %\protect\begin{upm@fmt@enumdescription}{#1}{}{\string.~}{}{\enumdescriptionlabelseparator}{}% + \BODY% + \protect\end{upm@fmt@enumdescription}% + } + } +\fi + +%---------------------------------------- +% DESCRIPTION LIST WITH BULLETS +%---------------------------------------- +\ifupm@use@override@standard@lists + \gdef\upm@fmt@itemizeddescription@separator{\upm@column@char\ } + \newcommand{\upm@fmt@itemizeddescription@formatdescription}[1]{\textbf{#1}} + \newcommand{\upm@fmt@itemizeddescription@desc}[2]{% + \upm@fmt@itemizeddescription@formatdescription{#1#2}% + } + \let\upm@fmt@olditem\item + \let\upm@item@param\upm@fmt@olditem + \let\upm@item@noparam\upm@fmt@olditem + \def\item{\@ifnextchar[\upm@item@param\upm@item@noparam} + \AtBeginDocument{ + \message{*** Overriding the 'description' environment. Pass option 'standardlists' for avoiding this override.} + \global\let\description\@undefined + \global\let\enddescription\@undefined + \global\NewEnviron{description}[1][\upm@fmt@itemizeddescription@separator]{ + \begin{itemize}% + \renewcommand{\upm@item@param}[1][]{\upm@fmt@olditem \upm@fmt@itemizeddescription@desc{##1}{#1}}% + \renewcommand{\upm@item@noparam}{\upm@fmt@olditem }% + \BODY% + \end{itemize}% + } + } +\fi + +%---------------------------------------- +% SIZE MANAGEMENT +%---------------------------------------- +\newenvironment{upmfontsize}[1]{% + \begingroup% + \let\upm@Huge\Huge% + \let\upm@huge\huge% + \let\upm@normalsize\normalsize% + \let\upm@small\small% + \let\upm@scriptsize\scriptsize% + \let\upm@footnotesize\footnotesize% + \let\upm@tiny\tiny% + % + \ifx#1\Huge% + \let\Huge\upm@Huge% + \let\huge\upm@Huge% + \let\small\upm@huge% + \let\scriptsize\upm@normalsize% + \let\footnotesize\upm@small% + \let\tiny\upm@scriptsize% + \else\ifx#1\huge% + \let\Huge\upm@Huge% + \let\huge\upm@Huge% + \let\small\upm@normalsize% + \let\scriptsize\upm@small% + \let\footnotesize\upm@scriptsize% + \let\tiny\upm@footnotesize% + \else\ifx#1\small% + \let\Huge\upm@huge% + \let\huge\upm@normalsize% + \let\small\upm@scriptsize% + \let\scriptsize\upm@footnotesize% + \let\footnotesize\upm@tiny% + \let\tiny\upm@tiny% + \else\ifx#1\scriptsize% + \let\Huge\upm@normalsize% + \let\huge\upm@small% + \let\small\upm@footnotesize% + \let\scriptsize\upm@tiny% + \let\footnotesize\upm@tiny% + \let\tiny\upm@tiny% + \else\ifx#1\footnotesize% + \let\Huge\upm@small% + \let\huge\upm@scriptsize% + \let\small\upm@tiny% + \let\scriptsize\upm@tiny% + \let\footnotesize\upm@tiny% + \let\tiny\upm@tiny% + \else\ifx#1\tiny% + \let\Huge\upm@scriptsize% + \let\huge\upm@footnotesize% + \let\small\upm@tiny% + \let\scriptsize\upm@tiny% + \let\footnotesize\upm@tiny% + \let\tiny\upm@tiny% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + #1% +}{\endgroup} + +%---------------------------------------- +% FRAMED MINIPAGE +%---------------------------------------- + +\newsavebox{\upm@framed@minipage} +%\begin{framedminipage}{width}...\end{framedminipage} +\newenvironment{framedminipage}[1]{% + \begin{lrbox}{\upm@framed@minipage}\begin{minipage}{#1}% + }{% + \end{minipage}\end{lrbox}\fbox{\usebox{\upm@framed@minipage}}} + +%\begin{framedcolorminipage}{width}{border}{background}...\end{framedcolorminipage} +\newenvironment{framedcolorminipage}[3]{% + \newcommand{\upm@framed@minipage@border}{#2}% + \newcommand{\upm@framed@minipage@background}{#3}% + \begin{lrbox}{\upm@framed@minipage}\begin{minipage}{#1}% + }{% + \end{minipage}\end{lrbox}\fcolorbox{\upm@framed@minipage@border}{\upm@framed@minipage@background}{\usebox{\upm@framed@minipage}}} + +%---------------------------------------- +% HIGHLIGH BOXES +%---------------------------------------- + +\newsavebox{\upm@highlight@box@save} + +\newenvironment{upm@highligh@box}[2]{% + \par + \vspace{.5cm} + \begin{tabular}{|p{#1}|} + \hline + \begin{window}[0,l,{\mbox{\includegraphics[width=1cm]{#2}}},{}] +}{% + \end{window}\\ \hline \end{tabular} + \vspace{.5cm} + \par +} + +\newenvironment{upmcaution}[1][\linewidth]{% + \upm@highligh@box{#1}{upm_caution.png}% +}{% + \endupm@highligh@box% +} + +\newenvironment{upminfo}[1][\linewidth]{% + \upm@highligh@box{#1}{upm_info.png}% +}{% + \endupm@highligh@box% +} + +\newenvironment{upmquestion}[1][\linewidth]{% + \upm@highligh@box{#1}{upm_question.png}% +}{% + \endupm@highligh@box% +} + +%---------------------------------------- +% PROVIDE URL MACROS, WHICH WILL BE +% OVERRIDDEN BY THE DOCUMENT CLASS +%---------------------------------------- + +\newcommand{\url}[2][]{\texttt{#2}} +\newcommand{\href}[3][]{\texttt{#3}} + +%---------------------------------------- +% Exponents and Indices +%---------------------------------------- +\gdef\textup#1{\textsuperscript{#1}\xspace} +\def\@textsubscript#1{% + {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}} +\gdef\textsubscript#1{\@textsubscript{\selectfont#1}} +\gdef\textdown#1{\textsubscript{#1}\xspace} + + +%---------------------------------------- +% UNDERLINE +%---------------------------------------- + +\let\upm@oldunderline\underline +\renewcommand{\underline}[1]{\upm@oldunderline{\smash{#1}}} + +%---------------------------------------- +% ENVIRONMENT FOR DEFINITIONS +%---------------------------------------- + +%----- +% Defining the style for the definitions +\colorlet{definitionbackground}{backtableheader} +\colorlet{definitionheaderforeground}{fronttableheader} +\colorlet{definitionborder}{fronttableheader} +\colorlet{definitiontextforeground}{fronttableheader} + +\ifupmlang{french}{ + \gdef\definitionname{D\'efinition} + \gdef\listdefinitionname{Liste des d\'efinitions} +}{ + \gdef\definitionname{Definition} + \gdef\listdefinitionname{List of Definitions} +} + +\gdef\upm@definition@width{.9\linewidth} +\gdef\upm@definition@rule@width{\linewidth} +\gdef\upm@definition@rule@height{0.4pt} + +\newtheoremstyle{upmdefinition}% name of the style to be used + {}% measure of space to leave above the theorem. E.g.: 3pt + {}% measure of space to leave below the theorem. E.g.: 3pt + {\normalfont}% name of font to use in the body of the theorem + {}% measure of space to indent the head + {\normalfont\bfseries}% name of head font + {\\[-1em]{\textcolor{definitionborder}{\rule{\upm@definition@rule@width}{\upm@definition@rule@height}}}}% punctuation between head and body + {\newline}% space after theorem head + {\textcolor{definitionheaderforeground}{\thmname{#1}\thmnumber{~#2}\upm@column@char\thmnote{ #3}}\vspace{.25em}}% Manually specify head + +%----- +% Declare a theorem with the standard UPM style +% \declareupmtheorem[theorem_style]{name}{label}{list_label} +\newcommand{\declareupmtheorem}[4][upmdefinition]{% + \global\declaretheorem[name={#3},style=#1]{upm#2}% + \global\newenvironment{#2}[1][]{% + \par\vspace{\parsep}\centering\begin{framedcolorminipage}{\upm@definition@width}{definitionborder}{definitionbackground}% + \color{definitiontextforeground}% + \begin{upm#2}[##1]% + }{% + \end{upm#2}% + \end{framedcolorminipage}\vspace{\parsep}\par% + }% + % Check the version of the thmtools because the TeXLive distribution + % gives a too old version. + \@ifpackagelater{thm-listof}{2012/05/03}{% + \global\@namedef{listof#2s}{% + \global\let\upm@definition@old@listtheoremname\listtheoremname% + \global\let\upm@definition@old@upmtheoremopt\upm@definition@upmtheoremopt% + \gdef\listtheoremname{#4}% + \renewcommand{\upm@definition@upmtheoremopt}[1]{}% + \expandafter\listoftheorems[ignoreall,show={upm#2}]% + \global\let\listtheoremname\upm@definition@old@listtheoremname% + \global\let\upm@definition@upmtheoremopt\upm@definition@old@upmtheoremopt% + }% + }{% + \@latex@warning{Your version of the thmtools is too old. I recommend you to install the version 2012/05/04, or later.} + \global\@namedef{listof#2s}{% + \global\let\upm@tmp\listtheoremname% + \gdef\listtheoremname{#4}% + \listoftheorems% + \global\let\listtheoremname\upm@tmp% + }% + } +} +\@onlypreamble\declareupmtheorem + +\gdef\thmtformatoptarg#1{\upm@column@char\ #1}% + +% Permits to define a part of the definition's name that is +% rendered only in core part of the document, not in the +% list of theorems +\gdef\upm@definition@upmtheoremopt#1{#1} +\gdef\upmtheoremopt#1{\protect\upm@definition@upmtheoremopt{#1}} + +%----- +% Declare the definition environment +\declareupmtheorem{definition}{\definitionname}{\listdefinitionname} + +%---------------------------------------- +% ENVIRONMENT FOR EMPHBOX +%---------------------------------------- + +%----- +% Defining the style for the emphbox +\colorlet{emphboxbackground}{backtableheader} +\colorlet{emphboxborder}{fronttableheader} +\colorlet{emphboxtext}{fronttableheader} + +\NewEnviron{emphbox}[1][\linewidth]{% + \begin{framedcolorminipage}{#1}{emphboxborder}{emphboxbackground}% + \centering\color{emphboxtext}\BODY% + \end{framedcolorminipage}% +} + +\endinput + diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-frontpage.sty b/macros/latex/contrib/upmethodology/src/upmethodology-frontpage.sty new file mode 100644 index 0000000000..3033ce02fe --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upmethodology-frontpage.sty @@ -0,0 +1,251 @@ +% Front page for Unified Process Methodology +% +% Copyright (c) 2006-2015 Stephane GALLAND <galland@arakhne.org> +% +% This program is free library; you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or any later version. +% +% This library is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public +% License along with this library; see the file COPYING. If not, +% write to the Free Software Foundation, Inc., 59 Temple Place - Suite +% 330, Boston, MA 02111-1307, USA. +% + +\global\edef\upm@package@fp@ver{2017/08/08} + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{upmethodology-frontpage}[\upm@package@fp@ver] + +\RequirePackage{upmethodology-p-common} + +%---------------------------------------- +% Locales +%---------------------------------------- +\def\upm@front@lang@english{ + \gdef\upm@lang@@{\message{**** upmethodology-frontpage is using English language ****}}% + \gdef\upm@lang@front@authors{\upm@lang@document@authors} +} +\def\upm@front@lang@french{ + \gdef\upm@lang@@{\message{**** upmethodology-frontpage is using French language ****}}% + \gdef\upm@lang@front@authors{\upm@lang@document@authors} +} + +%---------------------------------------- +% OPTIONS +%---------------------------------------- +\DeclareOption{french}{% + \upm@front@lang@french +} +\DeclareOption{francais}{% + \upm@front@lang@french +} +\DeclareOption{english}{% + \upm@front@lang@english +} +\ExecuteOptions{english} +\ProcessOptions +\upm@lang@@ + +\RequirePackage{upmethodology-extension} +\RequirePackage{upmethodology-document} + +% Declare the temporary dimensions +\newdimen\upm@front@tmpa +\newdimen\upm@front@tmpb + +%---------------------------------------- +% String format +%---------------------------------------- +\def\upm@front@force@single@spacing#1{{\begin{singlespace}#1\end{singlespace}}} +\def\upm@front@maintitle@fmt#1{\Huge \scshape #1} +\def\upm@front@project@fmt#1{\textbf{\Large #1}} +\def\upm@front@subproject@fmt#1{\textbf{\large #1}} +\def\upm@front@document@fmt#1{\textbf{\normalsize #1}} +\def\upm@front@info@fmt#1{{\normalsize #1}} +\def\upm@front@author@fmt#1{% + \begin{upmfontsize}{\small}#1\end{upmfontsize}% + } + +%---------------------------------------- +% Define the command to put the title with a classic layout +%---------------------------------------- +\newcommand{\upm@front@layout@classic}{% + \message{************ USE CLASSIC FRONT COVER} + \begin{titlepage}% + \begin{center} + + % Illustration picture + \Ifelsedefined{frontillustration}{% + \noindent\expandafter\includegraphics[width=\Get{frontillustrationsize}\expandafter\linewidth]{\Get{frontillustration}} + }{% + \Ifdefined{logo}{\noindent\vfill\expandafter\includegraphics[width=.4\linewidth]{\Get{logo}}}% + }% + + % Project name + \vspace{1cm} + \upm@front@force@single@spacing{\upm@front@maintitle@fmt{\theupmproject}} + \vspace{1cm} + + % Document title + \noindent\rule{\linewidth}{1mm} \\ + \noindent\raggedleft\upm@front@project@fmt{\theupmproject} \\ + \Ifnotempty{\theupmsubproject}{\noindent\raggedleft\upm@front@subproject@fmt{\theupmsubproject}\\} + \vspace{.5cm} + \noindent\raggedleft\upm@front@document@fmt{\theupmdocname} \\ + \noindent\rule{\linewidth}{1mm} \\ + + \vspace{1cm} + + % Document information + \noindent\raggedleft\begin{tabular}{rr} + \upm@front@info@fmt{\upm@lang@docref:} & \upm@front@info@fmt{\theupmdocref} \\ + \upm@front@info@fmt{\upm@lang@version:} & \upm@front@info@fmt{\theupmversion} \\ + \upm@front@info@fmt{\upm@lang@lastupdate@short:} & \upm@front@info@fmt{\theupmdate} \\ + \upm@front@info@fmt{\upm@lang@status:} & \upm@front@info@fmt{\theupmstatus} \\ + \end{tabular} + + \vfill + \Ifelsedefined{frontillustration}{% + \Ifelsedefined{logo}{% + \noindent\begin{tabularx}{\linewidth}{l>{\raggedleft}X}% + \expandafter\includegraphics[width=.3\linewidth]{\Get{logo}} & % + \upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\% + \end{tabularx}% + }{% + \noindent\raggedleft\upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\% + }% + }{% + \noindent\raggedleft\upm@front@author@fmt{\upm@lang@front@authors:~\theauthorlist} \\% + }% + + \end{center} + \end{titlepage} +} + + +%---------------------------------------- +% Define the command to put the title with a modern layout +%---------------------------------------- +\newcommand{\upm@front@layout@modern}{% + \message{************ USE MODERN FRONT COVER} + \begin{titlepage}% + % Project name + \upm@front@maintitle@fmt{\theupmproject} \\ + \noindent\rule{\linewidth}{.5mm} \\ + + % Document title + \Ifnotempty{\theupmsubproject}{\noindent\raggedright\upm@front@subproject@fmt{\theupmsubproject}\\} + \vspace{.5cm} + \noindent\raggedright\upm@front@force@single@spacing{\upm@front@document@fmt{\theupmdocname}} + + \vfill + + \vbox{ + \begin{picture}(0,0) + \Ifelsedefined{frontillustration}{% + \put(-110,-100){% + \includegraphics[width=\Get{frontillustrationsize}\expandafter\linewidth]{\Get{frontillustration}}% + }% + }{% + } + \upm@front@tmpa=\linewidth + \advance\upm@front@tmpa-.4\linewidth + \put(\strip@pt\upm@front@tmpa,75){ + \begin{tabular*}{.4\linewidth}{lr} + \upm@front@info@fmt{\upm@lang@docref:} & \upm@front@info@fmt{\theupmdocref} \\ + \upm@front@info@fmt{\upm@lang@version:} & \upm@front@info@fmt{\theupmversion} \\ + \upm@front@info@fmt{\upm@lang@lastupdate@short:} & \upm@front@info@fmt{\theupmdate} \\ + \upm@front@info@fmt{\upm@lang@status:} & \upm@front@info@fmt{\theupmstatus} \\ + \end{tabular*} + } + \upm@front@tmpa=\linewidth + \advance\upm@front@tmpa-.3\linewidth + \Ifdefined{logo}{ + \put(\strip@pt\upm@front@tmpa,-50){ + \expandafter\includegraphics[width=.3\linewidth]{\Get{logo}}% + } + } + \end{picture} + + } + \end{titlepage} +} + +\newcommand{\upm@front@setfrontlayout}[2]{% + \ifthenelse{\equal{#1}{classic}}{% + \Set{frontillustrationsize}{.6}% + \global\let\upm@front@layout\upm@front@layout@classic% + }{% + \ifthenelse{\equal{#1}{modern}}{% + \Set{frontillustrationsize}{1} + \global\let\upm@front@layout\upm@front@layout@modern% + }{% + \ifthenelse{\equal{#1}{custom}}{#2}{\errmessage{invalid front layout theme: #1}}% + }% + }% +} + +%---------------------------------------- +% Set the front page layout as the classic layout theme +%---------------------------------------- +%\setfrontcover{layout_name} +\newcommand{\setfrontcover}[1]{% + \upm@front@setfrontlayout{#1}{\errmessage{invalid front layout theme: #1}}% +} +\newcommand{\setfrontlayout}[1]{\errmessage{"\string\setfrontlayout" is deprecated. Use "\string\setfrontcover" instead}} + +\setfrontcover{classic} + +\renewcommand{\maketitle}{% + \Ifdefined{frontpage}{ + \upm@front@setfrontlayout{\Get{frontpage}}{% + \message{************ USE CUSTOM FRONT COVER} + \gdef\upm@front@layout{% + \begin{titlepage}% + \Get{frontpage@custom}% + \end{titlepage}% + }% + }% + }% + \upm@front@layout}% +\newcommand{\makefrontcover}{\maketitle} + +%---------------------------------------- +% Set the illustration figure on the front page +%---------------------------------------- +%\setfrontillustration[size_factor]{filename} +\newcommand{\setfrontillustration}[2][1]{% + \Set{frontillustrationsize}{#1}% + \Set{frontillustration}{#2}% +} + +%---------------------------------------- +% Clear the illustration figure on the front page +%---------------------------------------- +%\clearfrontillustration +\newcommand{\clearfrontillustration}{% + \Set{frontillustrationsize}{1}% + \Unset{frontillustration}% +} + +%---------------------------------------- +% SUPPORT FOR TIKZEXTERNAL +%---------------------------------------- +% See issue #25 +\AtBeginDocument{ + \@ifundefined{tikzexternalrealjob}{}{% + \message{*** Overriding the document specification for TikZ externalizer.}% + \ifthenelse{\equal{\jobname}{\tikzexternalrealjob}}{}{% + \gdef\maketitle{}% + }% + }% +} + +\endinput diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-p-common.sty b/macros/latex/contrib/upmethodology/src/upmethodology-p-common.sty new file mode 100644 index 0000000000..166c2e0f09 --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upmethodology-p-common.sty @@ -0,0 +1,231 @@ +% Copyright (c) 2009-13 Stephane GALLAND <galland@arakhne.org> +% +% This program is free library; you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or any later version. +% +% This library is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public +% License along with this library; see the file COPYING. If not, +% write to the Free Software Foundation, Inc., 59 Temple Place - Suite +% 330, Boston, MA 02111-1307, USA. +% + +\global\edef\upm@package@private@doctype@ver{2015/04/24} + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{upmethodology-p-common}[\upm@package@private@doctype@ver] + +\RequirePackage{ifthen} +\RequirePackage{xspace} +\RequirePackage{xcolor} +\RequirePackage{ifpdf} + +%---------------------------------------- +% UPMVERSION MACRO +%---------------------------------------- +\input UPMVERSION.def +\def\upm@common@parseversion@to@tex#1#2#3#4#5#6#7#8#9\@nil{#1#2#3#4/#5#6/#7#8} +\def\upm@common@parseversion@major#1#2#3#4#5#6#7#8#9\@nil{#1#2#3#4#5#6#7#8} +\edef\ver@UPMVERSION@major{\expandafter\upm@common@parseversion@major\UPMVERSION-\relax\@nil} +\edef\ver@UPMVERSION{\expandafter\upm@common@parseversion@to@tex\UPMVERSION\@nil} +\expandafter\let\csname ver@UPMVERSION.sty\endcsname\ver@UPMVERSION +\expandafter\let\csname ver@UPMVERSION.cls\endcsname\ver@UPMVERSION + +\gdef\UPMVERSIONTEST{\ver@UPMVERSION\\\ver@UPMVERSION@major} + +%---------------------------------------- +% ARAKHNE.ORG MACRO +%---------------------------------------- +\providecommand{\arakhneorg}{{\begingroup% + {\usefont{T1}{pzc}{m}{it}\selectfont Arakhn\^e}% + {\usefont{T1}{phv}{bc}{sc}\selectfont\tiny.org}\endgroup}\xspace} + +%---------------------------------------- +% CURRENT LANGUAGE +%---------------------------------------- +\def\upmcurrentlang{english} +\def\ifupmlang#1{\ifthenelse{\equal{#1}{\upmcurrentlang}}} + +%---------------------------------------- +% TEST MACROS +%---------------------------------------- +\long\def\Ifnotempty#1{\ifthenelse{\equal{#1}{\@empty}}{}} +\long\def\Ifempty#1#2{\ifthenelse{\equal{#1}{\@empty}}{#2}{}} +\long\def\Ifelseempty#1#2#3{\ifthenelse{\equal{#1}{\@empty}}{#2}{#3}} + +%---------------------------------------- +% TOC MACROS +%---------------------------------------- +\newcommand{\newpageintoc}{\addtocontents{toc}{\protect\newpage}} + +%---------------------------------------- +% DOCUMENT TYPE +%---------------------------------------- +\newif\ifupmbookformat +\newif\ifupmreportformat +\newif\ifupmarticleformat + +\upmbookformatfalse +\upmreportformattrue +\upmarticleformatfalse + +%---------------------------------------- +% PDF COLORS +%---------------------------------------- +\newcommand{\setpdfcolor}[1]{} + +%---------------------------------------- +% CREATE COMMAND WITH ID AS NAME +%---------------------------------------- +\def\upm@protect#1{\upm@p@protect #1\relax} +\def\upm@p@protect#1#2\relax{% + \ifx\relax #1% + \relax + \else% + \string #1% + \ifx\relax #2% + \relax + \else + \upm@p@protect #2\relax% + \fi + \fi} + +\def\upm@namedef#1#2{% + \@namedef{\upm@protect{#1}}{#2}% +} + +\def\upm@nameuse#1{% + \@nameuse{\upm@protect{#1}}% +} + +\def\upm@nameundef#1{% + \expandafter\let\csname\upm@protect{#1}\endcsname\relax% +} + +\def\upm@namelet@ext#1#2{% + \expandafter\expandafter\let\expandafter\upm@tmp\csname#2\endcsname% + \global\expandafter\let\csname#1\endcsname\upm@tmp% +} + +\def\upm@ifdefinedname#1#2#3{% + \expandafter\ifx\csname\upm@protect{#1}\endcsname\relax% + #3% + \else% + #2% + \fi% +} + +\newcommand{\upm@column@char}{\ifupmlang{french}{ :}{:}} + +%---------------------------------------- +% GET THE REFERENCE ID WITHOUT \REF +%---------------------------------------- +\gdef\upm@getref#1{% + \expandafter\ifx\csname r@#1\endcsname\relax + \nfss@text{\reset@font\bfseries ??}% + \else + \expandafter\expandafter\expandafter\@car\csname r@#1\endcsname\@nil + \fi +} + +\gdef\upm@getpageref@filter#1#2#3#4#5{#2} + +\gdef\upm@getpageref#1{% + \expandafter\ifx\csname r@#1\endcsname\relax + \nfss@text{\reset@font\bfseries ??}% + \else% + \protected@xdef\upm@p@tmp@tmp{\protect\upm@getpageref@filter\csname r@#1\endcsname}% + \upm@p@tmp@tmp% + \global\let\upm@p@tmp@tmp\relax% + \fi +} + +%---------------------------------------- +% INTERNAL COMMAND FOR TEXT SUPPER/SUB SCRIPT +%---------------------------------------- + +\let\upm@textsuperscript\textsuperscript + +\def\upm@textsubscript#1{% + {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}} + + +%---------------------------------------- +% MACRO THAT PERMITS TO LOOP ON A SEPARATOR +%---------------------------------------- + +\newif\ifupm@foreach@hasseparator +\newif\ifupm@foreach@oneseparator + +\let\upm@foreach@end\relax + +\def\upm@foreach@rec#1{% + {\upm@foreach@searchseparator#1\upm@foreach@end\@nil}% + \ifupm@foreach@hasseparator% + \protected@xdef\upm@foreach@continue{\protect\upm@foreach@rec{\upm@foreach@rest}}% + \upm@foreach@body% + \upm@foreach@continue% + \else% + \ifupm@foreach@oneseparator\else% + \upm@foreach@lastbody% + \fi% + \fi% +} + +% Loop on parts of a text given a specific separator. +% In the bodies, the macros \upm@foreach@term is the current data. +% #1: is the separator to consider +% #2: is the data set +% #3: is the body to run for each loop, except the last. +% #4: is the body to run for the last loop. +\def\upm@foreach#1\in#2\do#3#4{% + \global\upm@foreach@oneseparatorfalse% + \gdef\upm@foreach@searchseparator##1#1##2\@nil{% + \gdef\upm@foreach@term{##1}% + \ifx\upm@foreach@end##2% + \global\upm@foreach@hasseparatorfalse% + \else% + \gdef\upm@foreach@rest{##2}% + \global\upm@foreach@hasseparatortrue% + \global\upm@foreach@oneseparatortrue% + \fi% + }% + \gdef\upm@foreach@body{#3}% + \gdef\upm@foreach@lastbody{#4}% + \upm@foreach@rec{#2#1}% +} + +%---------------------------------------- +% MACRO THAT PERMITS TO FIND A STRING +%---------------------------------------- +\def\upm@ifin#1#2{\begingroup\edef\upm@tmp{\endgroup\noexpand\in@{#1}{#2}}\upm@tmp\ifin@} + +%----------------------------------------- +% Option parameters +\newif\ifupm@common@optlist@needdefault +\gdef\upm@common@optlist@parseparams#1=#2\@nil{% + \ifthenelse{\equal{#2}{===}}{% + \global\upm@common@optlist@needdefaulttrue% + }{% + \global\upm@common@optlist@needdefaultfalse% + }% +} +\DeclareRobustCommand{\upm@common@optlist}[1]{% + {\upm@common@optlist@parseparams #1====\@nil}% +} +\newcommand{\upm@setkeys}[3]{% + \upm@common@optlist{#3}% + \ifupm@common@optlist@needdefault% + \expandafter\setkeys{#1}{#2=#3}% + \else% + \expandafter\setkeys{#1}{#3}% + \fi% +} + +\endinput diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-spec.sty b/macros/latex/contrib/upmethodology/src/upmethodology-spec.sty new file mode 100644 index 0000000000..0ad41328ee --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upmethodology-spec.sty @@ -0,0 +1,457 @@ +% Specification Description for Unified Process Methodology +% +% Copyright (c) 2006-2007 Stephane GALLAND <galland@arakhne.org> +% +% This program is free library; you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or any later version. +% +% This library is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public +% License along with this library; see the file COPYING. If not, +% write to the Free Software Foundation, Inc., 59 Temple Place - Suite +% 330, Boston, MA 02111-1307, USA. +% +% Creation date: 2006-04-27 +% Modifications: +% 2009-10-30 Clean code. +% 2007-03-19 Add localization. +% + +\global\edef\upm@package@spec@ver{2009/10/30} + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{upmethodology-spec}[\upm@package@spec@ver] + +\RequirePackage{upmethodology-p-common} + +\RequirePackage[normalem]{ulem} + +\RequirePackage{upmethodology-fmt} +\RequirePackage{upmethodology-code} + +%------------------------------------ +% LOCALIZATION +%------------------------------------ +\def\upm@spec@lang@english { + \gdef\upm@lang@@{\message{**** upmethodology-spec is using English language ****}}% + \gdef\upm@spec@lang@description{Description} + \gdef\upm@spec@lang@returned@values{returned value(s)} + \gdef\upm@spec@lang@except@for{Except for} + \gdef\upm@spec@lang@modifier@public{{\tiny+}} + \gdef\upm@spec@lang@modifier@protected{{\tiny\#}} + \gdef\upm@spec@lang@modifier@private{{\tiny--}} + \gdef\upm@spec@lang@modifier@static##1{{\uline{##1}}} + \gdef\upm@spec@lang@modifier@const{query} + \gdef\upm@spec@lang@modifier@final{isLeaf} + \gdef\upm@spec@lang@modifier@abstract{abstract} + \gdef\upm@spec@lang@modifier@root{isRoot} + \gdef\upm@spec@lang@modifier@inout{\ensuremath{\leftrightarrow}} + \gdef\upm@spec@lang@modifier@in{\ensuremath{\rightarrow}} + \gdef\upm@spec@lang@modifier@out{\ensuremath{\leftarrow}} +} +\def\upm@spec@lang@french { + \gdef\upm@lang@@{\message{**** upmethodology-spec is using French language ****}}% + \gdef\upm@spec@lang@description{Description} + \gdef\upm@spec@lang@returned@values{valeur(s) retourn\'ee(s)} + \gdef\upm@spec@lang@except@for{Except\'e pour} + \gdef\upm@spec@lang@modifier@public{{\tiny+}} + \gdef\upm@spec@lang@modifier@protected{{\tiny\#}} + \gdef\upm@spec@lang@modifier@private{{\tiny--}} + \gdef\upm@spec@lang@modifier@static##1{{\uline{##1}}} + \gdef\upm@spec@lang@modifier@const{requ\^ete} + \gdef\upm@spec@lang@modifier@final{estFeuille} + \gdef\upm@spec@lang@modifier@abstract{abstra\^{\i}t} + \gdef\upm@spec@lang@modifier@root{estRacine} + \gdef\upm@spec@lang@modifier@inout{\ensuremath{\leftrightarrow}} + \gdef\upm@spec@lang@modifier@in{\ensuremath{\rightarrow}} + \gdef\upm@spec@lang@modifier@out{\ensuremath{\leftarrow}} +} + +%---------------------------------------- +% OPTIONS +%---------------------------------------- +\DeclareOption{french}{% + \upm@spec@lang@french +} +\DeclareOption{francais}{% + \upm@spec@lang@french +} +\DeclareOption{english}{% + \upm@spec@lang@english +} +\ExecuteOptions{english} +\ProcessOptions +\upm@lang@@ + +%------------------------------------ +% DETAILLED SPECIFICATION +%------------------------------------ + +\newlength{\upm@spec@detailspec@description@width} +\setlength{\upm@spec@detailspec@description@width}{3cm} + +\newsavebox{\upm@spec@detailspec@savebox} +\newlength{\upm@spec@detailspec@itrn@width} + +\newcounter{upm@detailspec@return@counter} +\newcounter{upm@detailspec@function@counter} + +\newif\ifupm@spec@showdescription +\newif\ifupm@spec@showparams +\newif\ifupm@spec@showreturns +\newif\ifupm@spec@firstparam +\newif\ifupm@spec@modifier@has@static +\newif\ifupm@spec@modifier@has@const +\newif\ifupm@spec@modifier@has@final +\newif\ifupm@spec@modifier@has@abstract +\newif\ifupm@spec@modifier@has@root +\newif\ifupm@spec@modifier@has@public +\newif\ifupm@spec@modifier@has@protected +\newif\ifupm@spec@modifier@has@private +\newif\ifupm@spec@tmp@a + +\newcommand{\upm@spec@head}[2]{#1} +\newcommand{\upm@spec@tail}[2]{#2} + +%----- +%\upm@spec@func@modifiers{modifiers} +\newcommand{\upm@spec@func@modifiers}[1]{% + \global\upm@spec@modifier@has@staticfalse% + \global\upm@spec@modifier@has@constfalse% + \global\upm@spec@modifier@has@finalfalse% + \global\upm@spec@modifier@has@abstractfalse% + \global\upm@spec@modifier@has@rootfalse% + \global\upm@spec@modifier@has@publicfalse% + \global\upm@spec@modifier@has@protectedfalse% + \global\upm@spec@modifier@has@privatefalse% + \upm@spec@func@modifiers@scan{#1}% +} +\newcommand{\upm@spec@func@modifiers@scan}[1]{% + \upm@ifnotempty{#1}{% + \edef\upm@reserved@a{\upm@spec@head #1\@empty\@empty}% + \edef\upm@reserved@b{\upm@spec@tail #1\@empty\@empty}% + \ifthenelse{\equal{\upm@reserved@a}{+}}{% + %public + \global\upm@spec@modifier@has@publictrue% + \global\upm@spec@modifier@has@protectedfalse% + \global\upm@spec@modifier@has@privatefalse% + }{% + \ifthenelse{\equal{\upm@reserved@a}{=}}{% + %protected + \global\upm@spec@modifier@has@publicfalse% + \global\upm@spec@modifier@has@protectedtrue% + \global\upm@spec@modifier@has@privatefalse% + }{% + \ifthenelse{\equal{\upm@reserved@a}{\#}}{% + %protected + \global\upm@spec@modifier@has@publicfalse% + \global\upm@spec@modifier@has@protectedtrue% + \global\upm@spec@modifier@has@privatefalse% + }{% + \ifthenelse{\equal{\upm@reserved@a}{-}}{% + %protected + \global\upm@spec@modifier@has@publicfalse% + \global\upm@spec@modifier@has@protectedfalse% + \global\upm@spec@modifier@has@privatetrue% + }{% + \ifthenelse{\equal{\upm@reserved@a}{s}}{% + %static + \global\upm@spec@modifier@has@statictrue% + }{% + \ifthenelse{\equal{\upm@reserved@a}{c}}{% + %query / const + \global\upm@spec@modifier@has@consttrue% + }{% + \ifthenelse{\equal{\upm@reserved@a}{l}}{% + %isLeaf + \global\upm@spec@modifier@has@finaltrue% + }{% + \ifthenelse{\equal{\upm@reserved@a}{a}}{% + %abstract + \global\upm@spec@modifier@has@abstracttrue% + }{% + \ifthenelse{\equal{\upm@reserved@a}{r}}{% + %isRoot + \global\upm@spec@modifier@has@roottrue% + }{}}}}}}}}}% + \expandafter\upm@spec@func@modifiers@scan{\upm@reserved@b}% + }% +} + +%----- +%\upm@spec@param@modifiers{modifiers} +\newcommand{\upm@spec@param@modifiers}[1]{% + \upm@ifnotempty{#1}{% + \ifthenelse{\equal{#1}{out}}{% + %out + \upm@spec@lang@modifier@out% + }{ + \ifthenelse{\equal{#1}{inout}}{% + %inout + \upm@spec@lang@modifier@inout% + }{ + %in + \upm@spec@lang@modifier@in% + }} + }% +} + +%----- +\def\upm@spec@trim#1{#1} +\newcommand{\upm@spec@splitparams}[1]{% + \upm@ifnotempty{#1}{% + \upm@spec@firstparamtrue + \@for\reserved@a:=#1\do{% + \ifupm@spec@firstparam\upm@spec@firstparamfalse\else, \fi% + \mbox{\upm@spec@trim{\reserved@a}}% + }% + \upm@spec@trim + }% +} + +%----- +%\begin{upm@spec@detailspec}[width]{title}...\end{detailspec} +\newenvironment{upm@spec@detailspec}[2][\linewidth]{% + + \setcounter{upm@detailspec@return@counter}{0} + \setcounter{upm@detailspec@function@counter}{0} + + \gdef\upm@spec@detailspec@width{#1} + \gdef\upm@spec@detailspec@title{#2} + \gdef\upm@spec@functions{} + \gdef\upm@spec@parameters{} + \gdef\upm@spec@global@return{} + \gdef\upm@spec@local@return{} + + %----- + %\speccons[modifiers]{name}{prototype} + \newcommand{\speccons}[3][]{\specfunc[##1]{}{##2}{##3}} + + %----- + %\specget[modifiers]{return_type}{name} + \newcommand{\specget}[3][]{\specfunc[c##1]{##2}{##3}{}} + + %----- + %\specset[modifiers]{name}{prototype} + \newcommand{\specset}[3][]{\specfunc[##1]{\jvoid}{##2}{##3}{}} + + %----- + %\specfunc[modifiers]{return_type}{name}{prototype} + \newcommand{\specfunc}[4][+]{% + \addtocounter{upm@detailspec@function@counter}{1}% + \protected@xdef\upm@spec@reserved@a{\protect\csname upm@detailspec@return@ptr@\theupm@detailspec@function@counter\endcsname}% + \gdef\upm@spec@reserved@b{} + \upm@ifnotempty{##2}{\gdef\upm@spec@reserved@b{\string:\ }} + + \gdef\upm@spec@reserved@c{}% + \upm@spec@func@modifiers{##1}% + \ifupm@spec@modifier@has@private\gdef\upm@spec@reserved@c{\upm@spec@lang@modifier@private}% + \else\ifupm@spec@modifier@has@protected\gdef\upm@spec@reserved@c{\upm@spec@lang@modifier@protected}% + \else\gdef\upm@spec@reserved@c{\upm@spec@lang@modifier@public}\fi\fi% + + \gdef\upm@spec@reserved@d{##3}% + \ifupm@spec@modifier@has@static% + \protected@xdef\upm@spec@reserved@d{\protect\upm@spec@lang@modifier@static{\upm@spec@reserved@d}}% + \fi% + + \gdef\upm@spec@reserved@e{}% + \upm@spec@tmp@afalse% + \ifupm@spec@modifier@has@const\upm@spec@tmp@atrue\fi% + \ifupm@spec@modifier@has@final\upm@spec@tmp@atrue\fi% + \ifupm@spec@modifier@has@abstract\upm@spec@tmp@atrue\fi% + \ifupm@spec@modifier@has@root\upm@spec@tmp@atrue\fi% + \ifupm@spec@tmp@a% + \ifupm@spec@modifier@has@const% + \gdef\upm@spec@reserved@e{\upm@spec@lang@modifier@const}% + \fi + \ifupm@spec@modifier@has@final% + \upm@ifnotempty{\upm@spec@reserved@e}{% + \xdef\upm@spec@reserved@e{\upm@spec@reserved@e,}}% + \protected@xdef\upm@spec@reserved@e{\upm@spec@reserved@e\protect\upm@spec@lang@modifier@final}% + \fi + \ifupm@spec@modifier@has@abstract% + \upm@ifnotempty{\upm@spec@reserved@e}{% + \xdef\upm@spec@reserved@e{\upm@spec@reserved@e,}}% + \protected@xdef\upm@spec@reserved@e{\upm@spec@reserved@e\protect\upm@spec@lang@modifier@abstract}% + \fi + \ifupm@spec@modifier@has@root% + \upm@ifnotempty{\upm@spec@reserved@e}{% + \xdef\upm@spec@reserved@e{\upm@spec@reserved@e,}}% + \protected@xdef\upm@spec@reserved@e{\upm@spec@reserved@e\protect\upm@spec@lang@modifier@root}% + \fi + \protected@xdef\upm@spec@reserved@e{ \protect\{\upm@spec@reserved@e\protect\}} + \fi% + + \protected@xdef\upm@spec@functions{\upm@spec@functions {\upm@spec@reserved@c}\protect&% + {\upm@spec@reserved@d}\protect&% + \string(\protect&\protect\upm@spec@splitparams{##4}\string) {\upm@spec@reserved@b##2{\upm@spec@reserved@a}{\upm@spec@reserved@e}}\protect\\}% + + \global\let\upm@spec@reserved@a\relax + \global\let\upm@spec@reserved@b\relax + \global\let\upm@spec@reserved@c\relax + \global\let\upm@spec@reserved@d\relax + \global\let\upm@spec@reserved@e\relax + \expandafter\gdef\csname upm@detailspec@return@ptr@\theupm@detailspec@function@counter\endcsname{} + } + + %----- + %\specreturn{description} + \newcommand{\specreturn}[1]{% + \addtocounter{upm@detailspec@return@counter}{1}% + \expandafter\protected@xdef\csname upm@detailspec@return@ptr@\theupm@detailspec@function@counter\endcsname{% + {\protect\tiny\protect\ensuremath{_{\protect\string[\theupm@detailspec@return@counter\protect\string]}}}% + }% + \protected@xdef\upm@spec@local@return{\upm@spec@local@return {\protect\tiny\protect\string[\theupm@detailspec@return@counter\protect\string]} \protect& ##1 \protect\\}% + } + + %----- + %\specglobalreturn{description} + \newcommand{\specglobalreturn}[1]{\gdef\upm@spec@global@return{##1}} + + %----- + %\specparam[in|inout|out]{name}{description} + \newcommand{\specparam}[3][in]{% + \protected@xdef\upm@spec@parameters{\upm@spec@parameters \protect\upm@spec@param@modifiers{##1} \protect& {##2:} \protect& {##3} \protect\\} + } + + %----- + %\specendhline + \newcommand{\specendhline}{\gdef\upm@detailspec@end@hline{\hline}} + + %----- + %\specstarthline + \newcommand{\specstarthline}{\gdef\upm@detailspec@start@hline{\hline}} + + \setlength{\upm@spec@detailspec@itrn@width}{#1} + \addtolength{\upm@spec@detailspec@itrn@width}{-\the\upm@spec@detailspec@description@width} + \addtolength{\upm@spec@detailspec@itrn@width}{-2\tabcolsep} + + \begin{lrbox}{\upm@spec@detailspec@savebox} + \begin{minipage}[t]{\upm@spec@detailspec@itrn@width}% +}{% + \end{minipage} + \end{lrbox}% + + \gdef\upm@detailspec@separator{} + \upm@spec@showreturnsfalse% + + \ifthenelse{\equal{\upm@spec@global@return}{\@empty}}{% + \gdef\upm@detailspec@return@section{} + \upm@ifnotempty{\upm@spec@local@return}{ + \gdef\upm@detailspec@separator{ & & & \\} + \protected@xdef\upm@detailspec@return@section{\upm@spec@local@return}% + \upm@spec@showreturnstrue% + }% + }{% + \upm@ifnotempty{\upm@spec@local@return}{% + \gdef\upm@detailspec@separator{ & & & \\} + \gdef\upm@spec@reserved@a{ \upm@spec@lang@except@for:\protect\upm@spec@local@return}}% + \protected@xdef\upm@detailspec@return@section{% + \upm@spec@global@return\upm@spec@reserved@a% + }% + \upm@spec@showreturnstrue% + } + + \ifthenelse{\equal{\upm@spec@detailspec@title}{\@empty}}{ + \gdef\upm@spec@reserved@c{} + }{ + \gdef\upm@spec@reserved@c{\hline% + \multicolumn{4}{>{\columncolor{backtableheader}}l}{\color{fronttableheader}{\large\textsc{\upm@spec@detailspec@title}}} \\% + } + \gdef\upm@detailspec@start@hline{\hline}% + \upm@spec@showdescriptiontrue% + } + + \upm@spec@showparamsfalse% + + \upm@ifnotempty{\upm@spec@parameters}{% + \ifupm@spec@showdescription% + \gdef\upm@detailspec@separator{ & & & \\}% + \fi% + \upm@ifnotempty{\upm@spec@functions}{% + \gdef\upm@detailspec@separator{ & & & \\}% + }% + \upm@spec@showparamstrue% + }% + + \vspace{.5cm}\noindent\begin{tabularx}{\the\upm@spec@detailspec@width}{|clr@{}>{\raggedright\arraybackslash}X|} + \upm@spec@reserved@c% + \upm@detailspec@start@hline% + \ifupm@spec@showdescription + \multicolumn{4}{|X|}{% + \begin{tabularx}{\linewidth}{@{}lX@{}}% + \upm@spec@lang@description: & \usebox{\upm@spec@detailspec@savebox} \\% + \end{tabularx}% + } \\% + \hline% + \fi + \upm@spec@functions% + \upm@detailspec@separator% + \ifupm@spec@showparams% + \multicolumn{4}{|X|}{% + \begin{tabularx}{\linewidth}{@{}l@{}lX@{}}% + \upm@spec@parameters% + \end{tabularx}% + } \\% + \fi% + \ifupm@spec@showreturns% + \multicolumn{4}{|X|}{% + \textit{\upm@spec@lang@returned@values}: \newline% + \begin{tabularx}{\linewidth}{@{}lX@{}}% + \upm@detailspec@return@section% + \end{tabularx}% + } \\% + \fi% + \upm@detailspec@end@hline% + \end{tabularx}\vspace{.5cm}% + + \global\let\@arraycr\upm@arraycr + + \global\let\upm@spec@detailspec@width\relax% + \global\let\upm@spec@detailspec@title\relax% + \global\let\upm@spec@functions\relax% + \global\let\upm@spec@parameters\relax% + \global\let\upm@spec@global@return\relax% + \global\let\upm@spec@local@return\relax% + \global\let\upm@detailspec@return@section\relax% + \global\let\upm@spec@reserved@a\relax% + \global\let\upm@spec@reserved@b\relax% + \global\let\upm@spec@reserved@c\relax% + \global\let\upm@detailspec@separator\relax% + \global\let\upm@detailspec@start@hline\relax% + \global\let\upm@detailspec@end@hline\relax% +} + +%----- +%\begin{detailspec}}[width]{title}...\end{detailspec}.... +\newenvironment{detailspec}[2][\linewidth] +{% + \upm@spec@showdescriptiontrue% + \gdef\upm@detailspec@start@hline{\hline}% + \gdef\upm@detailspec@end@hline{\hline}% + \begin{upm@spec@detailspec}[#1]{#2}% +} +{% + \end{upm@spec@detailspec}% +} + +%----- +%\begin{detailspec}}[width]{title}...\end{detailspec}.... +\newenvironment{detailspec*}[2][\linewidth] +{% + \upm@spec@showdescriptionfalse% + \gdef\upm@detailspec@start@hline{}% + \gdef\upm@detailspec@end@hline{}% + \begin{upm@spec@detailspec}[#1]{#2}% +} +{% + \end{upm@spec@detailspec}% +} + +\endinput diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-task.sty b/macros/latex/contrib/upmethodology/src/upmethodology-task.sty new file mode 100644 index 0000000000..fdc90a712a --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upmethodology-task.sty @@ -0,0 +1,268 @@ +% Task management for Unified Process Methodology +% +% Copyright (c) 2006-2007 Stephane GALLAND <galland@arakhne.org> +% +% This program is free library; you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or any later version. +% +% This library is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public +% License along with this library; see the file COPYING. If not, +% write to the Free Software Foundation, Inc., 59 Temple Place - Suite +% 330, Boston, MA 02111-1307, USA. +% +% Creation date: 2006-04-20 +% Modifications: +% 2009-10-30 Clean code. +% 2007-03-19 Add localization. +% + +\global\edef\upm@package@task@ver{2009/10/30} + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{upmethodology-task}[\upm@package@task@ver] + +\RequirePackage{upmethodology-p-common} + +%----- LOCALIZATION +\def\upm@task@lang@english{ + \gdef\upm@lang@@{\message{**** upmethodology-task is using English language ****}}% + \gdef\upm@task@lang@task{Task} + \gdef\upm@task@lang@description{Description} + \gdef\upm@task@lang@startat{Start at} + \gdef\upm@task@lang@endat{End at} + \gdef\upm@task@lang@archieved{Archieved} + \gdef\upm@task@lang@managers{Managers} + \gdef\upm@task@lang@members{Members} + \gdef\upm@task@lang@milestones{Milestones} + \gdef\upm@task@lang@subtask{Sub-task of} +} +\def\upm@task@lang@french{ + \gdef\upm@lang@@{\message{**** upmethodology-task is using French language ****}}% + \gdef\upm@task@lang@task{T\^ache} + \gdef\upm@task@lang@description{Description} + \gdef\upm@task@lang@startat{D\'ebut le} + \gdef\upm@task@lang@endat{Fin le} + \gdef\upm@task@lang@archieved{Termin\'ee} + \gdef\upm@task@lang@managers{R\'ef\'erent} + \gdef\upm@task@lang@members{Membres} + \gdef\upm@task@lang@milestones{\'Etapes} + \gdef\upm@task@lang@subtask{Sous-t\^ache de} +} + +%----- OPTIONS +\DeclareOption{french}{% + \upm@task@lang@french +} +\DeclareOption{francais}{% + \upm@task@lang@french +} +\DeclareOption{english}{% + \upm@task@lang@english +} +\ExecuteOptions{english} +\ProcessOptions +\upm@lang@@ + +\RequirePackage{upmethodology-version} + +%----- +\newif\if@upm@task@displaydescription +\newif\if@upm@task@rebuild +\@upm@task@rebuildfalse + +\def\upm@task@define#1#2#3{% + \protected@write\@auxout{}{\string\global\string\@namedef{upm@task@#1@#2}{#3}}% + \ifthenelse{\equal{\csname upm@task@#1@#2\endcsname}{#3}}{}{\@upm@task@rebuildtrue}% + \global\@namedef{upm@task@#1@#2}{#3}% +} + +\def\upm@task@define@list#1#2#3{% + \ifthenelse{\equal{\csname upm@task@#1@#2\endcsname}{\@empty}}{% + \expandafter\xdef\csname upm@task@#1@#2\endcsname{#3}% + }{% + \expandafter\xdef\csname upm@task@#1@#2\endcsname{% + \csname upm@task@#1@#2\endcsname, #3% + }% + }% + \AtEndDocument{\protected@write\@auxout{}{\string\global\string\@namedef{upm@task@#1@#2}{\csname upm@task@#1@#2\endcsname}}} +} + +\newenvironment{upm@taskdescription}[1]{% + \global\@namedef{upm@task@#1@managers}{}% + \global\@namedef{upm@task@#1@members}{}% + \global\@namedef{upm@task@#1@milestones}{}% + + \newcommand{\taskname}[1]{\upm@task@define{#1}{name}{##1}} + \newcommand{\tasksuper}[1]{\upm@task@define{#1}{super}{##1}} + \newcommand{\taskcomment}[1]{\upm@task@define{#1}{comment}{##1}}% + \newcommand{\taskprogress}[1]{\upm@task@define{#1}{progress}{##1}}% + \newcommand{\taskstart}[1]{\upm@task@define{#1}{startat}{##1}}% + \newcommand{\taskend}[1]{\upm@task@define{#1}{endat}{##1}}% + \newcommand{\taskmanager}[1]{\upm@task@define@list{#1}{managers}{##1}} + \newcommand{\taskmember}[1]{% + \upm@task@define@list{#1}{members}{##1}% + } + \newcommand{\taskmilestone}[2]{% + \upm@task@define@list{#1}{milestones}{##1}% + \upm@task@define{#1}{ml@##1}{##2}% + %\global\@namedef{upm@task@#1@description@milestones}{\upm@task@lang@milestones: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{\thetaskmembers{#1}}} \\} + } + + + \def\upm@task@currenttask{#1} +}{% + \if@upm@task@displaydescription\thetaskdescription{\upm@task@currenttask}\fi% + \let\upm@task@currenttask\relax% +} + +%----- +%\begin{taskdescription}{id}...\end{taskdescription} +\newenvironment{taskdescription}[1]{% + \@upm@task@displaydescriptiontrue% + \upm@taskdescription{#1}% +}{% + \endupm@taskdescription% +} + +%----- +%\begin{taskdescription*}{id}...\end{taskdescription*} +\newenvironment{taskdescription*}[1]{% + \@upm@task@displaydescriptionfalse% + \upm@taskdescription{#1}% +}{% + \endupm@taskdescription% +} + +%----- +%\thetasksuper{id} +\newcommand{\thetasksuper}[1]{% + \expandafter\providecommand\csname upm@task@#1@super\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}% + \expandafter\csname upm@task@#1@super\endcsname% +} + +%----- +%\thetaskname{id} +\newcommand{\thetaskname}[1]{% + \expandafter\providecommand\csname upm@task@#1@name\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}% + \expandafter\csname upm@task@#1@name\endcsname% +} + +%----- +%\thetaskcomment{id} +\newcommand{\thetaskcomment}[1]{% + \expandafter\providecommand\csname upm@task@#1@comment\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}% + \expandafter\csname upm@task@#1@comment\endcsname% +} + +%----- +%\thetaskprogress{id} +\newcommand{\thetaskprogress}[1]{% + \expandafter\providecommand\csname upm@task@#1@progress\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}% + \expandafter\csname upm@task@#1@progress\endcsname% +} + +%----- +%\thetaskstart{id} +\newcommand{\thetaskstart}[1]{% + \expandafter\providecommand\csname upm@task@#1@startat\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}% + \expandafter\csname upm@task@#1@startat\endcsname% +} + +%----- +%\thetaskend{id} +\newcommand{\thetaskend}[1]{% + \expandafter\providecommand\csname upm@task@#1@endat\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}% + \expandafter\csname upm@task@#1@endat\endcsname% +} + +%----- +%\thetaskmanagers{id} +\newcommand{\thetaskmanagers}[1]{% + \expandafter\providecommand\csname upm@task@#1@managers\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}% + \expandafter\csname upm@task@#1@managers\endcsname% +} + +%----- +%\thetaskmembers{id} +\newcommand{\thetaskmembers}[1]{% + \expandafter\providecommand\csname upm@task@#1@members\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}% + \expandafter\csname upm@task@#1@members\endcsname% +} + +%----- +%\thetaskmilestones{id} +\newcommand{\thetaskmilestones}[1]{% + \expandafter\providecommand\csname upm@task@#1@milestones\endcsname{??\@latex@warning{The task identified by '#1' was not found.}\@upm@task@rebuildtrue}% + \expandafter\csname upm@task@#1@milestones\endcsname% +} + +%----- +%\thetaskmilestonecomment{id}{date} +\newcommand{\thetaskmilestonecomment}[2]{% + \expandafter\providecommand\csname upm@task@#1@ml@#2\endcsname{??\@latex@warning{The task milestone identified by '#1' and '#2' was not found.}\@upm@task@rebuildtrue}% + \expandafter\csname upm@task@#1@ml@#2\endcsname% +} + +\def\@upm@trim#1{#1} + +%----- +%\thetaskdescription{id} +\newcommand{\thetaskdescription}[2][\linewidth]{% + \ifthenelse{\equal{\csname upm@task@#2@members\endcsname}{\@empty}}{ + \gdef\upm@task@tmp@a{}% + }{% + \gdef\upm@task@tmp@a{\upm@task@lang@members: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{\thetaskmembers{#2}}} \\}% + }% + \ifthenelse{\equal{\csname upm@task@#2@milestones\endcsname}{\@empty}}{ + \gdef\upm@task@tmp@b{}% + }{% + \gdef\upm@task@tmp@b{\hline \upm@task@lang@milestones: &% + \multicolumn{2}{X|}{\parbox[t]{1.95\linewidth}{% + \edef\upm@task@tmp@c{\csname upm@task@#2@milestones\endcsname}% + \def\upm@task@tmp@e{}% + \@for\reserved@a:=\upm@task@tmp@c\do{% + \edef\upm@task@tmp@d{\expandafter\@upm@trim\reserved@a}% + \protected@edef\upm@task@tmp@e{\upm@task@tmp@e \protect\item[\upm@task@tmp@d~:] \protect\thetaskmilestonecomment{#2}{\upm@task@tmp@d}}% + }% + \begin{description}\upm@task@tmp@e\end{description}% + }} \\}% + }% + \vspace{.25cm}\noindent\begin{mtabular}[#1]{3}{|X|X|X|} + \tabulartitle{{\upm@task@lang@task}~\textit{#2}: \thetaskname{#2}} + \hline + %description + \upm@task@lang@description: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{\thetaskcomment{#2}}} \\ + %sub-task + \expandafter\ifx\csname upm@task@#2@super\endcsname\relax\else% + \upm@task@lang@subtask: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{{\upm@task@lang@task}~\textit{\csname upm@task@#2@super\endcsname}}} \\ + \fi + \hline + %dates + \upm@task@lang@startat: & \upm@task@lang@endat: & \upm@task@lang@archieved: \\ + \thetaskstart{#2} & \thetaskend{#2} & \thetaskprogress{#2}\% \\ + \hline + %manager + \upm@task@lang@managers: & \multicolumn{2}{X|}{\parbox[t]{1.9\linewidth}{\thetaskmanagers{#2}}} \\ + %members + \upm@task@tmp@a + %milestones + \upm@task@tmp@b + %\@nameuse{upm@task@#1@description@milestones} + \hline + \end{mtabular}\par\vspace{.5cm}% +} + +\AtEndDocument{% + \if@upm@task@rebuild% + \@latex@warning@no@line{Project Task(s) may have changed.\MessageBreak% + Rerun to get cross-references right}\fi% + +} +\endinput diff --git a/macros/latex/contrib/upmethodology/src/upmethodology-version.sty b/macros/latex/contrib/upmethodology/src/upmethodology-version.sty new file mode 100644 index 0000000000..6d3538abab --- /dev/null +++ b/macros/latex/contrib/upmethodology/src/upmethodology-version.sty @@ -0,0 +1,203 @@ +% Version management for Unified Process Methodology +% +% Copyright (c) 2006-2007 Stephane GALLAND <galland@arakhne.org> +% Copyright (c) 2013 Stephane GALLAND <galland@arakhne.org> +% +% This program is free library; you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as +% published by the Free Software Foundation; either version 3 of the +% License, or any later version. +% +% This library is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public +% License along with this library; see the file COPYING. If not, +% write to the Free Software Foundation, Inc., 59 Temple Place - Suite +% 330, Boston, MA 02111-1307, USA. +% + +\global\edef\upm@package@version@ver{2013/08/26} + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{upmethodology-version}[\upm@package@version@ver] + +\RequirePackage{upmethodology-p-common} + +%locales +\def\upm@version@lang@english{ + \gdef\upm@lang@@{\message{**** upmethodology-version is using English language ****}}% + \gdef\upm@lang@date{Date} + \gdef\upm@lang@updates{Updates} + \gdef\upm@lang@version{Version} + \gdef\upm@lang@version@history{Version History} + \gdef\upm@lang@restricted{Confidential} + \gdef\upm@lang@validable{Validable} + \gdef\upm@lang@validated{Validated} + \gdef\upm@lang@public{Public} +} +\def\upm@version@lang@french{ + \gdef\upm@lang@@{\message{**** upmethodology-version is using French language ****}}% + \gdef\upm@lang@date{Date} + \gdef\upm@lang@updates{Modifications} + \gdef\upm@lang@version{Version} + \gdef\upm@lang@version@history{Historique} + \gdef\upm@lang@restricted{Confidentiel} + \gdef\upm@lang@validable{Validable} + \gdef\upm@lang@validated{Valid\'e} + \gdef\upm@lang@public{Publique} +} + +%---------------------------------------- +% OPTIONS +%---------------------------------------- +\DeclareOption{french}{% + \upm@version@lang@french +} +\DeclareOption{francais}{% + \upm@version@lang@french +} +\DeclareOption{english}{% + \upm@version@lang@english +} +\ExecuteOptions{english} +\ProcessOptions* + +\upm@lang@@ + +\RequirePackage{upmethodology-fmt} + +%tmp counter +\newcount{\upm@tmp@a} + +% Internal information: first and last registered dates +\let\upm@thefirstdate\@undefined +\let\upm@thelastdate\@undefined + +%increment major part of version number +\def\upm@incmajorversion#1.#2{% + \upm@tmp@a=#1\advance\upm@tmp@a + 1% + \global\edef\theupmversion{\the\upm@tmp@a.0}% +} + +%increment minor part of version number +\def\upm@incminorversion#1.#2{% + \upm@tmp@a=#2\advance\upm@tmp@a + 1% + \global\edef\theupmversion{#1.\the\upm@tmp@a}% +} + +%list of updates +\def\upm@update@list{} + +%add an update to the list +\newcommand{\upm@addupdatetolist}[4]{% + \global\protected@edef\upm@update@list{% + \upm@update@list% + #1 & #2 & #3 \protect\\% + } +} + +%----- +% Available status' constants +\def\upmrestricted{\upm@lang@restricted} +\def\upmvalidable{\upm@lang@validable} +\def\upmvalidated{\upm@lang@validated} +\def\upmpublic{\upm@lang@public} + +%----- +% Replies the modification date of the given version +\newcommand{\upmdate}[1]{\@nameuse{upm@version@#1@updatedate}} + +%----- +% Replies the modification description of the given version +\newcommand{\upmdescription}[1]{\@nameuse{upm@version@#1@description}} + +%----- +% Replies the status of the given version +\newcommand{\upmstatus}[1]{\@nameuse{upm@version@#1@level}} + +%----- +\newcommand{\upm@updateversion}[4]{% + \gdef\theupmdate{#2}% + \gdef\theupmlastmodif{#3}% + \gdef\theupmstatus{#4}% + \ifx\upm@thefirstdate\@undefined + \global\edef\upm@thefirstdate{#2} + \fi + \global\edef\upm@thelastdate{#2} + \@namedef{upm@version@#1@updatedate}{#2}% + \@namedef{upm@version@#1@description}{#3}% + \@namedef{upm@version@#1@level}{#4}% + \upm@addupdatetolist{#1}{#2}{#3}{#4}% +} + +%----- +%\updateversion{new_version}{update_date}{description}{status} +\newcommand{\updateversion}[4]{% + \gdef\theupmversion{#1}% + \upm@updateversion{#1}{#2}{#3}{#4}% +} + +%----- +%\initialversion[version]{date}{description}{status} +\newcommand{\initialversion}[4][0.1]{% + \updateversion{#1}{#2}{#3}{#4}% +} + +%----- +%\incversion{update_date}{description}{status} +\newcommand{\incversion}[3]{% + \expandafter\upm@incmajorversion\theupmversion% + \upm@updateversion{\theupmversion}{#1}{#2}{#3}% +} + +%----- +%\incsubversion{update_date}{description}{status} +\newcommand{\incsubversion}[3]{% + \expandafter\upm@incminorversion\theupmversion% + \upm@updateversion{\theupmversion}{#1}{#2}{#3}% +} + +%----- +% Version variables +\def\theupmversion{0.1} +\edef\theupmdate{\today} +\def\theupmlastmodif{} +\def\theupmstatus{\upmrestricted} + +%----- +% Display the version history +%\upmhistory[width] +\newcommand{\upmhistory}[1][\linewidth]{% + \noindent\expandafter\begin{mtabular}[#1]{3}{|c|c|X|} + \tabulartitle{\upm@lang@version@history}% + \tabularheader{\upm@lang@version}{\upm@lang@date}{\upm@lang@updates}% + \upm@update@list + \hline + \expandafter\end{mtabular}\par\vspace{.5cm}% +} + +%----- +% Copyright date +%\upmcopyrightdate +\newcommand{\upmcopyrightdate}{% + \ifx\upm@thefirstdate\@undefined% + \edef\upm@tmp@copyright@a{\the\year}% + \else% + \edef\upm@tmp@copyright@a{\extractyear{\upm@thefirstdate}}% + \fi% + \ifx\upm@thelastdate\@undefined% + \def\upm@tmp@copyright@b{\the\year}% + \else% + \edef\upm@tmp@copyright@b{\extractyear{\upm@thelastdate}}% + \fi% + \ifthenelse{\equal{\upm@tmp@copyright@a}{\upm@tmp@copyright@b}}{% + \upm@tmp@copyright@a% + }{% + \upm@tmp@copyright@a-\upm@tmp@copyright@b% + }% +} + +\endinput |