% UP-METHODOLOGY EXTENSION FOR THE CIAD LABORATORY (UTBM PART)
% Author: Stephane GALLAND
% 2009-2026 (c) Stéphane Galland <galland@arakhne.org>

\DeclareCopyright[english]{utbmciad}{2009-26}{St\'ephane GALLAND}{UTBM and all UTBM-related trademarks and logos are trademarks or registered trademarks of Universit\'e de Technologie de Belfort-Montb\'eliard in the France, other countries, or both. UB and all UB-related trademarks and logos are trademarks or registered trademarks of Universit\'e de Bourgogne in the France, other countries, or both. iC and all iC-related trademarks and logos are trademarks or registered trademarks of Institut Carnot in the France, other countries, or both.}
\DeclareCopyright[french]{utbmciad}{2009-26}{St\'ephane GALLAND}{Les noms des cit\'es, les marques cit\'ees ainsi que les logos correspondants sont la propri\'et\'e de leurs auteurs ou de leurs ayant-droits. Toute reproduction, m\^eme partielle des \'el\'ements de ce document donnera syst\'ematiquement lieu \`a des poursuites judiciaires. L'acronyme UTBM est la propri\'et\'e de l'Universit\'e de Technologie de Belfort-Montb\'eliard, France. Les acronymes UB et LE2I sont la propri\'et\'e de l'Universit\'e de Bourgogne, France. L'acronyme iC est la propri\'et\'e de l'Institut Carnot, France.}

% Use Helvet font family
\usepackage{helvet}
% Use phone and email symbols
\usepackage{wasysym}
% Use Sans-Serif font style, by default
\renewcommand{\familydefault}{\sfdefault}

\usepackage{hyphenat}
\usepackage{textcomp}

% Official colors for CIAD
\definecolor{CIADgreen}{RGB}{149,188,15}
\definecolor{CIADdarkergreen}{RGB}{100,127,10}
\definecolor{CIADdarkgreen}{RGB}{75,94,8}
\definecolor{CIADlightgreen}{RGB}{214,244,112}
\definecolor{CIADlightestgreen}{RGB}{235,250,184}
\definecolor{CIADmorelightestgreen}{RGB}{243,250,218}

\definecolor{CIADblue}{RGB}{0,41,75}

\definecolor{CIADmagenta}{RGB}{153,30,102}
\definecolor{CIADdarkmagenta}{RGB}{77,15,51}
\definecolor{CIADlightmagenta}{RGB}{204,122,170}
\definecolor{CIADlightestmagenta}{RGB}{250,240,246}

\definecolor{CIADdarkestgray}{RGB}{14,18,7}
\definecolor{CIADdarkgray}{RGB}{100,100,100}
\definecolor{CIADgray}{RGB}{168,168,168}
\definecolor{CIADlightgray}{RGB}{236,236,236}

\definecolor{UTBMblue}{RGB}{0,143,176}
\definecolor{UTBMorange}{RGB}{236,103,7}

% Front page colors
% --- foreground for the address text
\colorlet{frontpage_foreground_address}{white}
% --- foreground for the title box
\colorlet{frontpage_foreground_title}{white}
% --- foreground for the subproject box
\colorlet{frontpage_foreground_subproject}{white}
% --- foreground for the subtitle box
\colorlet{frontpage_foreground_subtitle}{white}
% --- foreground for the author box
\colorlet{frontpage_foreground_authors}{white}
% --- foreground for the document reference box
\colorlet{frontpage_foreground_docreference}{white}
% --- foreground for the labels in document reference box
\colorlet{frontpage_foreground_docreference_label}{lightgray}

% Back page colors
% --- foreground for the address text
\colorlet{backpage_foreground_address}{black}
% --- foreground for the description text
\colorlet{backpage_foreground_description}{white}
% --- foreground for the annex text
\colorlet{backpage_foreground_annex}{black}
% --- foreground for the labels in document reference box
\colorlet{backpage_foreground_docreference_label}{frontpage_foreground_docreference_label}
% --- foreground for the labels in contact box
\colorlet{backpage_foreground_contact_label}{backpage_foreground_docreference_label}
% --- background for the description part
\colorlet{backpage_background_description}{CIADdarkgray}
% --- background for the reference part
\colorlet{backpage_background_reference}{white}

% --- foreground for the labels in document reference box
\colorlet{default_foreground_title}{CIADdarkgreen}

% Color of the titles (overriding of the UPM colors)
\colorlet{titlecolor}{default_foreground_title}
\colorlet{maintitlecolor}{default_foreground_title}

% Color for the lettrine
\colorlet{lettrinecolor}{CIADlightgray}

% Color of the sections (overriding of the UPM colors)
\colorlet{parttitlecolor}{default_foreground_title}
\colorlet{chaptertitlenumcolor}{CIADlightgray}
\colorlet{chaptertitlecolor}{CIADdarkgreen}
\colorlet{sectiontitlecolor}{CIADdarkgreen}
\colorlet{sectiontitlenumcolor}{CIADdarkgreen}
\colorlet{sectiontitleboxcolor}{CIADgray}
\colorlet{subsectiontitlenumcolor}{CIADgray}
\colorlet{subsectiontitlecolor}{CIADdarkgreen}
\colorlet{subsubsectiontitlecolor}{CIADdarkgreen}
\colorlet{paragraphtitlecolor}{black}
\colorlet{subparagraphtitlecolor}{gray}

% Color of the tables (overriding of the UPM colors)
\colorlet{tableheaderbackground}{CIADdarkgray}
\colorlet{tableheaderforeground}{white}
\colorlet{tablebackground}{white}
\colorlet{tableforeground}{black}
\colorlet{tablerule}{tableheaderbackground}

% Color of the definitions (overriding of the UPM colors)
\colorlet{definitionbackground}{CIADmorelightestgreen}
\colorlet{definitionheaderforeground}{black}
\colorlet{definitionborder}{black}
\colorlet{definitiontextforeground}{CIADdarkestgray}

% Color of the highlight boxes (overriding of the UPM colors)
\colorlet{highlightboxbackground_caution}{CIADlightestgreen}
\colorlet{highlightboxforeground_caution}{UTBMorange}
\colorlet{highlightboxborder_caution}{UTBMorange}
\colorlet{highlightboxbackground_info}{CIADlightestgreen}
\colorlet{highlightboxforeground_info}{CIADblue}
\colorlet{highlightboxborder_info}{CIADblue}
\colorlet{highlightboxbackground_question}{CIADlightestgreen}
\colorlet{highlightboxforeground_question}{CIADdarkmagenta}
\colorlet{highlightboxborder_question}{CIADdarkmagenta}
\colorlet{highlightboxbackground_note}{CIADlightestgreen}
\colorlet{highlightboxforeground_note}{CIADblue}
\colorlet{highlightboxborder_note}{CIADblue}
\colorlet{highlightboxbackground_action}{CIADlightestgreen}
\colorlet{highlightboxforeground_action}{CIADblue}
\colorlet{highlightboxborder_action}{CIADblue}

\colorlet{emphboxbackground}{CIADgreen!10}
\colorlet{emphboxborder}{CIADgreen!40}
\colorlet{emphboxtext}{CIADgreen}
\colorlet{emphboxbackgroundb}{CIADblue!10}
\colorlet{emphboxbackgroundc}{CIADmagenta!10}

% Color for the bibliography
\colorlet{bibemphemphtextcolor}{CIADdarkgreen}

% Color in the PDF
%\setpdfcolor{0.0,0.16,0.29}% CIAD blue
\setpdfcolor{0.0,0.56,0.69}% UTBM blue
%\setpdfcolor{0.93,0.4,0.03}% UTBM orange

% Declare the images
\pgfdeclareimage[width=\paperwidth]{ciad-frontbackground}{utbmciadreport-ciad-frontbackground}
\IfFileExists{utbmciadreport-utbmlogo.pdf}{
	\pgfdeclareimage[width=.1\paperwidth]{frenchrepublic-frontbackground}{utbmciadreport-frenchrepublic}
}{
	\pgfdeclareimage[width=.1\paperwidth]{frenchrepublic-frontbackground}{utbmciadreport-nologo}
}

% Define the logos (UTBM, UTS, CIAD, Sayens, IC-ARTS)
\IfFileExists{utbmciadreport-utbmlogo.pdf}{
	\Set{utbmlogo}{utbmciadreport-utbmlogo}
}{
	\Set{utbmlogo}{utbmciadreport-nologo}
}
\IfFileExists{utbmciadreport-utslogo.pdf}{
	\Set{utslogo}{utbmciadreport-utslogo}
}{
	\Set{utslogo}{utbmciadreport-nologo}
}
\IfFileExists{utbmciadreport-ciadlogo.pdf}{
	\Set{ciadlogo}{logos/utbmciadreport-ciadlogo}
}{
	\Set{ciadlogo}{utbmciadreport-nologo}
}
\IfFileExists{utbmciadreport-sayenslogo.pdf}{
	\Set{sayenslogo}{utbmciadreport-sayenslogo}
}{
	\Set{sayenslogo}{utbmciadreport-nologo}
}
\IfFileExists{utbmciadreport-icartslogo.pdf}{
	\Set{icartslogo}{utbmciadreport-icartslogo}
}{
	\Set{icartslogo}{utbmciadreport-nologo}
}

% define the logos used by the UPM document class
\Set{logo}{ciadlogo}

% Size and color of the water marks
\Set{watermarksize}{1}
\colorlet{watermarkcolor}{UTBMorange!15}

% The default base line
\renewcommand{\baselinestretch}{1.25} 

% Name to put after the copyrights
\Set[french]{copyrighter}{Universit\'e de Technologie de Belfort-Montb\'eliard, France}
\Set[english]{copyrighter}{Universit\'e de Technologie de Belfort-Montb\'eliard, France}

% Location where the document was printed (put after the copyright)
\Set{printedin}{France}

% Name of the publisher of the document
\Set[french]{publisher}{l'Universit\'e de Technologie de Belfort-Montb\'eliard, France}
\Set[english]{publisher}{Universit\'e de Technologie de Belfort-Montb\'eliard, France}

% Name of the UTBM
\Set[french]{utbm}{Universit\'e de Technologie de Belfort-Montb\'eliard}
\Set[english]{utbm}{Universit\'e de Technologie de Belfort-Montb\'eliard}

% Name of the CIAD
\Set[french]{ciad}{Laboratoire Connaissance et Intelligence Artificielle Distribu\'ees}
\Set[english]{ciad}{Laboratoire Connaissance et Intelligence Artificielle Distribu\'ees}
\Set[french]{ciadshort}{Laboratoire CIAD}
\Set[english]{ciadshort}{Laboratoire CIAD}

% Address of the laboratory
\Set[french]{ciadaddressa}{13, rue Ernest Thierry-Mieg}
\Set[english]{ciadaddressa}{13, rue Ernest Thierry-Mieg}
\Set[french]{ciadaddressb}{90010 Belfort cedex, France}
\Set[english]{ciadaddressb}{90010 Belfort cedex, France}

% Styles
\Set{style_frontpage_title}{\sffamily\bfseries\Huge}
\Set{style_frontpage_subproject}{\sffamily\Huge}
\Set{style_frontpage_subtitle}{\sffamily\huge}
\Set{style_frontpage_authors}{\sffamily\Large}
\Set{style_frontpage_docreference}{\sffamily\scriptsize}
\Set{style_frontpage_address}{\sffamily\footnotesize}
\Set{style_backpage_address}{\sffamily\tiny}
\Set{style_backpage_address_institution}{\bfseries}
\Set{style_backpage_description}{}
\Set{style_backpage_description_keywords}{\bfseries}
\Set{style_backpage_description_abstract}{\bfseries}
\Set{style_backpage_annex}{\small}

% Definition of several labels
\Set[french]{reference}{ref\;:}
\Set[english]{reference}{ref:}
\Set[french]{version}{ver.\;:}
\Set[english]{version}{ver:}
\Set[french]{date}{date\;:}
\Set[english]{date}{date:}
\Set[french]{abstract}{R\'esum\'e\;:}
\Set[english]{abstract}{Abstract:}
\Set[french]{keywords}{Mots-cl\'es~:}
\Set[english]{keywords}{Key-words:}
\Set[french]{contact}{contact\;:}
\Set[english]{contact}{contact:}

%
% BIBLIOGRAPHY: macros for the "utbmciad.bst" style
%
\newcommand{\underlineifauthor}[2]{%
	\ifdocumentauthor{#1}{\underline{#2}}{#2}%
}
\newcommand{\utbmciadbibemph}[1]{\textit{#1}}
\newcommand{\utbmciadbibEmph}[1]{\textcolor{bibemphemphtextcolor}{\textbf{#1}}}
\newcommand{\utbmciadbibkeyemph}[1]{\textbf{#1}}
% Translation of words
\ifthenelse{\equal{french}{\upmcurrentlang}}{
	\gdef\utbmciadbiband{et\xspace}
	\gdef\utbmciadbibetal{et~al.}
	\gdef\utbmciadbibeditors{\'editeurs\xspace}
	\gdef\utbmciadbibeditor{\'editeur\xspace}
	\gdef\utbmciadbibvolume{volume\xspace}
	\gdef\utbmciadbibVolume{Volume\xspace}
	\gdef\utbmciadbibof{de\xspace}
	\gdef\utbmciadbibvolumenumber{volume et num\'ero\xspace}
	\gdef\utbmciadbibnumber{num\'ero\xspace}
	\gdef\utbmciadbibNumber{Num\'ero\xspace}
	\gdef\utbmciadbibin{dans\xspace}
	\gdef\utbmciadbibIn{Dans\xspace}
	\gdef\utbmciadbibedition{\'edition\xspace}
	\gdef\utbmciadbibpages{pages\xspace}
	\gdef\utbmciadbibpage{page\xspace}
	\gdef\utbmciadbibchapter{chapitre\xspace}
	\gdef\utbmciadbibtechnicalreport{Rapport technique\xspace}
	\gdef\utbmciadbibJanuary{Janvier\xspace}
	\gdef\utbmciadbibFebruary{F\'evrier\xspace}
	\gdef\utbmciadbibMarch{Mars\xspace}
	\gdef\utbmciadbibApril{Avril\xspace}
	\gdef\utbmciadbibMay{Mai\xspace}
	\gdef\utbmciadbibJune{Juin\xspace}
	\gdef\utbmciadbibJuly{Juillet\xspace}
	\gdef\utbmciadbibAugust{Ao\^ut\xspace}
	\gdef\utbmciadbibSeptember{Septembre\xspace}
	\gdef\utbmciadbibOctober{Octobre\xspace}
	\gdef\utbmciadbibNovember{Novembre\xspace}
	\gdef\utbmciadbibDecember{D\'ecembre\xspace}
}{%
	\gdef\utbmciadbiband{et\xspace}
	\gdef\utbmciadbibetal{et~al.}
	\gdef\utbmciadbibeditors{editors\xspace}
	\gdef\utbmciadbibeditor{editor\xspace}
	\gdef\utbmciadbibvolume{volume\xspace}
	\gdef\utbmciadbibVolume{Volume\xspace}
	\gdef\utbmciadbibof{of\xspace}
	\gdef\utbmciadbibvolumenumber{volume and number\xspace}
	\gdef\utbmciadbibnumber{number\xspace}
	\gdef\utbmciadbibNumber{Number\xspace}
	\gdef\utbmciadbibin{in\xspace}
	\gdef\utbmciadbibIn{In\xspace}
	\gdef\utbmciadbibedition{edition\xspace}
	\gdef\utbmciadbibpages{pages\xspace}
	\gdef\utbmciadbibpage{page\xspace}
	\gdef\utbmciadbibchapter{chapter\xspace}
	\gdef\utbmciadbibtechnicalreport{Technical Report\xspace}
	\gdef\utbmciadbibJanuary{January\xspace}
	\gdef\utbmciadbibFebruary{February\xspace}
	\gdef\utbmciadbibMarch{March\xspace}
	\gdef\utbmciadbibApril{April\xspace}
	\gdef\utbmciadbibMay{May\xspace}
	\gdef\utbmciadbibJune{June\xspace}
	\gdef\utbmciadbibJuly{July\xspace}
	\gdef\utbmciadbibAugust{August\xspace}
	\gdef\utbmciadbibSeptember{September\xspace}
	\gdef\utbmciadbibOctober{October\xspace}
	\gdef\utbmciadbibNovember{November\xspace}
	\gdef\utbmciadbibDecember{December\xspace}
}

% Default bibliography style
\bibliographystyle{utbmciad}

% Default page style
\pagestyle{headings}

%
% FONT PAGE DEFINITION
%
\Set{cfrontpage}{
	\begin{picture}(0,0)
	\put(-85,45){\pgfuseimage{frenchrepublic-frontbackground}}%
	\Ifelsedefined{partnerlogo}{%
		\put(-85,-47){%
		\parbox[b][5cm][b]{20cm}{\noindent{\mbox{}\hfill%
			\includegraphics[height=4.5cm]{\Get{partnerlogo}}%
		\hfill\mbox{}}}}%
	}{}%
	\put(-85,-130){%
		\parbox[b][1.75cm][b]{10cm}{\noindent{%
			\ifshowUTBMlogo%
				\includegraphics[height=1.25cm]{\Get{utbmlogo}}%
			\fi%
		}\hfill\mbox{}}%
	}%
	\put(50,-130){%
		\parbox[b][1.75cm][b]{15cm}{\noindent{%
			\mbox{}\hfill%
			\ifshowSayenslogo%
				\includegraphics[height=1.25cm]{\Get{sayenslogo}}%
			\fi%
			\ifshowICARTSlogo%
				\ifshowSayenslogo\hspace{.5cm}\fi%
				\includegraphics[height=1.25cm]{\Get{icartslogo}}%
			\fi%
			\ifshowFundingSchemelogo%
				\utbmciadfundingschemeslogos%
			\fi%
		}}%
	}%
	\put(-100,-735){\pgfuseimage{ciad-frontbackground}}%
	\ifshowCIADlogo%
		\IfFileExists{utbmciadreport-ciadlogo_dark_background.pdf}{%
			\put(-10,-260){\includegraphics[height=4cm]{utbmciadreport-ciadlogo_dark_background}}%
		}{}
	\fi%
	\put(190,-735){\parbox[b][5cm][b]{10cm}{%
		\Get{style_frontpage_address}\begin{flushright}%
		\textcolor{frontpage_foreground_address}{\Get{utbm}}\\%
		\textcolor{frontpage_foreground_address}{\Get{ciad}}\\%
		\textcolor{frontpage_foreground_address}{\Get{ciadaddressa}}\\%
		\textcolor{frontpage_foreground_address}{\Get{ciadaddressb}}%
		\end{flushright}}}%
	\put(-78,-670){%
		\parbox[b][10cm][b]{19cm}{\noindent{\begin{flushleft}%
			% Main title
			\textcolor{frontpage_foreground_title}{\Get{style_frontpage_title}\nohyphens{\theupmproject}}%
			% Sub project
			\Ifnotempty\theupmsubproject{%
				\\[10\lineskip]%
				\noindent{\textcolor{frontpage_foreground_subproject}{%
					\Get{style_frontpage_subproject}\nohyphens{\theupmsubproject}}}%
			}%
			% Sub title
			\\[10\lineskip]%
			\textcolor{frontpage_foreground_title}{%
				\Get{style_frontpage_subtitle}\nohyphens{\theupmdocname}%
			}%
			% Authors
			\Ifnotempty\theauthorlist{%
				\\[10\lineskip]%
				\noindent{\textcolor{frontpage_foreground_authors}{%
					\Get{style_frontpage_authors}\nohyphens{\theauthorlist}%
				}}%
			}%
		\end{flushleft}}}}%
	\ifshowDocRefOnFront%
		\put(-78,-723){%
			\textcolor{frontpage_foreground_docreference}{\parbox[b][1.5cm][b]{9cm}{\raggedright\Get{style_frontpage_docreference}%
				\Ifnotempty\theupmdocref{\textcolor{frontpage_foreground_docreference_label}{\Get{reference}} \theupmdocref}\\%
				\Ifnotempty\theupmversion{\textcolor{frontpage_foreground_docreference_label}{\Get{version}} \theupmversion}\\%
				\Ifnotempty\theupmdate{\textcolor{frontpage_foreground_docreference_label}{\Get{date}} \theupmdate}%
			}}%
		}%
	\fi%
	\end{picture}
}


%
% BACK PAGE DEFINITION
%
\newlength{\utbmciadlineskip}
\Set{backpage}{
	\begin{picture}(0,0)%
	\setlength{\utbmciadlineskip}{15\unitlength}\addtolength{\utbmciadlineskip}{-\baselineskip}%
	% Description zone
	\Put(-100,-660){\colorbox{backpage_background_description}{\makebox(450,770){}}}
	% Annex zone
	\Put(342,-660){\colorbox{backpage_background_reference}{\makebox(150,770){}}}
	% Logos at the bottom
	\Put(-75,-720){%
		\ifshowUTBMlogo%
			\includegraphics[height=1.5cm]{\Get{utbmlogo}}\hspace{.5cm}%
		\fi%
		\ifshowUTlogo%
			\includegraphics[height=1.5cm]{\Get{utslogo}}%
		\fi%
	}%
	% Content of the description zone
	\Put(280,-712.5){\parbox[b][1cm][b]{7cm}{%
		\Get{style_backpage_address}\raggedleft%
		\textcolor{backpage_foreground_address}{\Get{style_backpage_address_institution}\Get{utbm}}\\%
		\textcolor{backpage_foreground_address}{\Get{ciad}}\\%
		\textcolor{backpage_foreground_address}{\Get{ciadaddressa}}\\%
		\textcolor{backpage_foreground_address}{\Get{ciadaddressb}}%
		}}%
	\Put(-80,80){\textcolor{backpage_foreground_description}{\parbox[t][25.5cm][t]{14cm}{%
			\Get{style_backpage_description}%
			% Keywords
			\Ifnotempty\theupmdockeywords{%
				{\Get{style_backpage_description_keywords}\Get{keywords}}\ \nohyphens{\theupmdockeywords}\\[10\lineskip]%
			}%
			% Abstract
			\Ifnotempty\theupmdockeywords{%
				{\Get{style_backpage_description_abstract}\Get{abstract}}\\\nohyphens{\theupmdocabstract}%
			}%
		}}}%
	% Document reference
	\Put(350,80){\textcolor{backpage_foreground_annex}{\parbox[t][25.5cm][t]{4.6cm}{%
		\Get{style_backpage_annex}%
		\ifshowDocRefOnBack%
			\Ifnotempty\theupmdocref{%
				\textcolor{backpage_foreground_docreference_label}{\Get{reference}} \theupmdocref \\%
			}%
			\Ifnotempty\theupmversion{%
				\textcolor{backpage_foreground_docreference_label}{\Get{version}} \theupmversion \\%
			}%
			\Ifnotempty\theupmdate{%
				\textcolor{backpage_foreground_docreference_label}{\Get{date}} \theupmdate \\%
			}%
		\fi%
		\ifshowContactOnBack%
			\Ifdefined{contactname}{%
				\ifshowDocRefOnBack%
					\\%
				\fi%
				\textcolor{backpage_foreground_contact_label}{\Get{contact}} \\%
				\textbf{\varhexstar}~\Get{contactname} \\%
			}%
			\Ifdefined{contactemail}{%
				\textbf{@}~\expandafter\href{mailto:\Get{contactemail}}{\Get{contactemail}} \\%
			}%
			\Ifdefined{contactphone}{%
				\phone~\Get{contactphone} \\%
			}%
		\fi%
	}}}%
	\end{picture}
}

\endinput
