]> AND Private Git Repository - these_charles_emile.git/blob - upmethodology-fmt.sty
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
suppression fichiers inutiles
[these_charles_emile.git] / upmethodology-fmt.sty
1 % Layout and Pagraph Format for Unified Process Methodology
2 %
3 % Copyright (c) 2006-2009, 2012-2015 Stephane GALLAND <galland@arakhne.org>
4
5 % This program is free library; you can redistribute it and/or modify
6 % it under the terms of the GNU Lesser General Public License as
7 % published by the Free Software Foundation; either version 3 of the
8 % License, or any later version.
9 %
10 % This library is distributed in the hope that it will be useful, but
11 % WITHOUT ANY WARRANTY; without even the implied warranty of
12 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 % Lesser General Public License for more details.
14 %
15 % You should have received a copy of the GNU Lesser General Public
16 % License along with this library; see the file COPYING.  If not,
17 % write to the Free Software Foundation, Inc., 59 Temple Place - Suite
18 % 330, Boston, MA 02111-1307, USA.
19
20 \global\edef\upm@package@fmt@ver{2015/08/10}
21
22 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
23 \ProvidesPackage{upmethodology-fmt}[\upm@package@fmt@ver]
24
25 \RequirePackage{upmethodology-p-common}
26
27 \gdef\upm@fmt@force@single@spacing#1{{\begin{singlespace}#1\end{singlespace}}}
28 \gdef\upm@date@head#1/#2\@nil{#1}
29 \gdef\upm@date@tail#1/#2\@nil{#2}
30 \gdef\upm@date@first#1{{\expandafter\upm@date@head#1\expandafter\@nil}}
31 \gdef\upm@date@second#1{{\expandafter\expandafter\expandafter\upm@date@head\expandafter\upm@date@tail#1\expandafter\@nil\expandafter\expandafter\expandafter\@nil}}
32 \gdef\upm@date@third#1{{\expandafter\expandafter\expandafter\upm@date@tail\expandafter\upm@date@tail#1\expandafter\@nil\expandafter\expandafter\expandafter\@nil}}
33
34 \newif\ifupm@use@override@standard@lists
35 \global\upm@use@override@standard@liststrue
36
37 %----------------------------------------
38 % LOCALES
39 %----------------------------------------
40 \global\let\upm@format@lang@extractyear\upm@date@first%
41 \def\upm@format@lang@english{%
42   \gdef\upm@lang@@{\message{**** upmethodology-fmt is using English language ****}}%
43   \global\renewcommand{\upm@format@lang@makedate}[3]{##3\string/\two@digits{##2}\string/\two@digits{##1}}%
44   \global\let\upm@format@lang@extractyear\upm@date@first%
45   \global\let\upm@format@lang@extractmonth\upm@date@second%
46   \gdef\upm@format@lang@professor{Pr.}%
47   \gdef\upm@format@lang@doctor{Dr.}%
48   \gdef\upm@format@lang@phdoctor{Ph.D.}%
49   \gdef\upm@format@lang@scdoctor{Sc.D.}%
50   \gdef\upm@format@lang@mdoctor{M.D.}%
51   \gdef\upm@format@lang@professionalengineer{CEng.}%
52   \gdef\upm@format@lang@incorporatedengineer{IEng.}%
53 }
54 \def\upm@format@lang@french{%
55   \gdef\upm@lang@@{\message{**** upmethodology-fmt is using French language ****}}%
56   \global\renewcommand{\upm@format@lang@makedate}[3]{\two@digits{##1}\string/\two@digits{##2}\string/##3}%
57   \global\let\upm@format@lang@extractyear\upm@date@third%
58   \global\let\upm@format@lang@extractmonth\upm@date@second%
59   \global\let\upm@format@lang@extractday\upm@date@first%
60   \gdef\upm@format@lang@professor{Pr.}%
61   \gdef\upm@format@lang@doctor{Dr.}%
62   \gdef\upm@format@lang@phdoctor{Ph.D.}%
63   \gdef\upm@format@lang@scdoctor{Sc.D.}%
64   \gdef\upm@format@lang@mdoctor{M.D.}%
65   \gdef\upm@format@lang@professionalengineer{Ing.}%
66   \gdef\upm@format@lang@incorporatedengineer{Ing.}%
67 }
68 \global\providecommand{\upm@format@lang@makedate}[3]{}%
69
70 %----------------------------------------
71 % OPTIONS
72 %----------------------------------------
73 \DeclareOption{french}{%
74   \upm@format@lang@french
75   \PassOptionsToPackage{french}{varioref}
76 }
77 \DeclareOption{francais}{%
78   \upm@format@lang@french
79   \PassOptionsToPackage{french}{varioref}
80 }
81 \DeclareOption{english}{%
82   \upm@format@lang@english
83   \PassOptionsToPackage{english}{varioref}
84 }
85 \DeclareOption{standardlists}{%
86   \global\upm@use@override@standard@listsfalse
87 }
88 \ExecuteOptions{english}
89 \ProcessOptions
90 \upm@lang@@
91
92
93 \RequirePackage{graphicx}
94 \RequirePackage{subfigure}
95 \RequirePackage{tabularx}
96 \RequirePackage{multicol}
97 \RequirePackage{colortbl}
98 \RequirePackage{picinpar}
99 \RequirePackage{amsmath}
100 \RequirePackage{amsthm}
101 \RequirePackage{thmtools}
102 \RequirePackage{pifont}
103 \RequirePackage{setspace}
104 \RequirePackage{varioref}
105 \RequirePackage{txfonts}
106 \RequirePackage{relsize}
107 \RequirePackage{xkeyval}
108 \RequirePackage{hyphenat}
109 \RequirePackage{bbm}
110 \RequirePackage{environ}% for advanced environment declaration
111
112 %----------------------------------------
113 % Exponent and indice
114 %----------------------------------------
115 % Exponent
116 %\newcommand{\textsup}[1]{\ensuremath{^{\text{#1}}}\xspace}
117 \newcommand{\textsup}[1]{\upm@textsuperscript{#1}\xspace}
118 % Indice
119 %\newcommand{\textsub}[1]{\ensuremath{_{\text{#1}}}\xspace}
120 \newcommand{\textsub}[1]{\upm@textsubscript{#1}\xspace}
121
122 %----------------------------------------
123 % Major Emphazing
124 %----------------------------------------
125 \newcommand{\Emph}[1]{\textbf{#1}\xspace}
126
127 %----------------------------------------
128 % SYMBOLS
129 %----------------------------------------
130 \renewcommand{\copyright}{\Pisymbol{psy}{211}\xspace}
131 \newcommand{\trademark}{\Pisymbol{psy}{228}\xspace}
132 \newcommand{\regmark}{\Pisymbol{psy}{226}\xspace}
133 \newcommand{\smalltrade}{{\tiny\trademark}\xspace}
134 \newcommand{\smallreg}{{\tiny\regmark}\xspace}
135 \newcommand{\smallcopy}{{\tiny\copyright}\xspace}
136 \newcommand{\ust}{\textsup{st}}
137 \newcommand{\und}{\textsup{nd}}
138 \newcommand{\urd}{\textsup{rd}}
139 \newcommand{\uth}{\textsup{th}}
140
141 %----------------------------------------
142 % MATH SYMBOLS
143 %----------------------------------------
144 \newcommand{\R}{\ensuremath{\mathbb{R}}}
145 \newcommand{\N}{\ensuremath{\mathbb{N}}}
146 \newcommand{\Z}{\ensuremath{\mathbb{Z}}}
147 \newcommand{\C}{\ensuremath{\mathbb{C}}}
148 \newcommand{\Q}{\ensuremath{\mathbb{Q}}}
149 \newcommand{\powerset}{\ensuremath{\mathcal{P}}}
150
151 \DeclareMathOperator{\sgn}{sgn}
152
153 %----------------------------------------
154 % DEFAULT GRAPHICX CONFIGURATION
155 %----------------------------------------
156
157 \ifpdf
158   \DeclareGraphicsExtensions{.pdf,.png,.jpg,.jpeg,.gif}
159 \else
160   \DeclareGraphicsExtensions{.eps,.png,.jpg,.jpeg,.gif}
161 \fi
162 \graphicspath{{./}}
163
164 %----------------------------------------
165 % FIGURES
166 %----------------------------------------
167
168 \newcommand{\upm@mfigure}[5][ht]{
169         \begin{figure}[#1]%
170                 \begin{center}%
171                         \includegraphics[#2]{#3}%
172                         \caption{#4}%
173                         \label{fig:#5}%
174                 \end{center}%
175         \end{figure}%
176 }
177 \newcommand{\upm@mfigurestar}[5][ht]{
178         \begin{figure*}[#1]%
179                 \begin{center}%
180                         \includegraphics[#2]{#3}%
181                         \caption{#4}%
182                         \label{fig:#5}%
183                 \end{center}%
184         \end{figure*}%
185 }
186 %-----
187 %\mfigure[position]{options}{filename}{caption}{label}
188 \def\mfigure{\@ifstar\upm@mfigurestar\upm@mfigure}
189 %-----
190 %\figref{label}
191 \newcommand{\figref}[1]{\ref{fig:#1}}
192 %-----
193 %\figpageref{label}
194 \newcommand{\figpageref}[1]{\pageref{fig:#1}}
195
196 %-----
197 % Multi-figures
198
199 \newcounter{upm@subfigure@count}
200
201 \newcommand{\upm@beginsubfigure}[4]{
202         \let\upm@mfiguresaved\mfigure
203         %options,filename,caption,label
204         \renewcommand{\mfigure}[5][]{
205                 \xdef\upm@tmp@subfigure@label{\alph{upm@subfigure@count}}%
206                 \subfigure[##4]{%
207                         \includegraphics[##2]{##3}%
208                         \label{fig:##5}%
209                         \label{fig:#4:\upm@tmp@subfigure@label}%
210                 }%
211                 \addtocounter{upm@subfigure@count}{1}%
212         }
213         %options,filename,caption
214         \newcommand{\msubfigure}[3]{
215                 \xdef\upm@tmp@subfigure@label{\alph{upm@subfigure@count}}%
216                 \subfigure[##3]{%
217                         \includegraphics[##1]{##2}%
218                         \label{fig:#4:\upm@tmp@subfigure@label}%
219                 }%
220                 \addtocounter{upm@subfigure@count}{1}%
221         }
222         \setcounter{upm@subfigure@count}{1}
223         \gdef\upm@mfigurescaption{#3}%
224         \gdef\upm@mfigureslabel{fig:#4}%
225         \begin{#1}[#2]\centering %
226 }
227
228 \newcommand{\upm@endsubfigure}[1]{
229                 \caption{\upm@mfigurescaption}%
230                 \label{\upm@mfigureslabel}%
231         \end{#1}%
232         \let\mfigure\upm@mfiguresaved
233 }
234
235 %-----
236 %\mfigures[position]{caption}{label}
237 \newenvironment{mfigures}[3][ht]{
238         \upm@beginsubfigure{figure}{#1}{#2}{#3}%
239 }{%
240         \upm@endsubfigure{figure}%
241 }
242 %-----
243 %\mfigures*[position]{caption}{label}
244 \newenvironment{mfigures*}[3][ht]{
245         \upm@beginsubfigure{figure*}{#1}{#2}{#3}%
246 }{%
247         \upm@endsubfigure{figure*}%
248 }
249
250 %----------------------------------------
251 % IMAGES INCLUDING TeX EXPRESSIONS
252 %----------------------------------------
253
254 %
255 % This section is copied from the AutoLaTeX package
256 % http://www.arakhne.org/autolatex
257 %
258
259 %-----
260 %\DeclareGraphicsExtensionsWtex{coma separated extensions}
261 \providecommand{\DeclareGraphicsExtensionsWtex}[1]{%
262         \xdef\@autolatex@wtfig@extensions{\zap@space#1 \@empty}%
263 }
264 \ifpdf
265    \DeclareGraphicsExtensionsWtex{.pdftex_t,.pdf_tex}
266 \else
267   \DeclareGraphicsExtensionsWtex{.pstex_t,.ps_tex}
268 \fi
269
270 \providecommand{\@autolatex@wtfig@searchinpath}[1]{%
271         \IfFileExists{#1}{%
272                 \protected@edef\@autolatex@wtfig@tmp{\protect\resizebox{\@autolatex@wtfig@width}{\@autolatex@wtfig@height}{\protect\input{#1}}}%
273         }{%
274                 \@for\@autolatex@wtfig@pathtmp:=\Ginput@path\do{%
275                         \ifx\@autolatex@wtfig@tmp\relax%
276                                 \IfFileExists{\@autolatex@wtfig@pathtmp#1}{%
277                                         \protected@edef\@autolatex@wtfig@tmp{\protect\resizebox{\@autolatex@wtfig@width}{\@autolatex@wtfig@height}{\protect\input{\@autolatex@wtfig@pathtmp#1}}}%
278                                 }{}%
279                         \fi%
280                 }%
281         }%
282 }
283
284 \define@key[autolatex]{withtex}{width}{%
285         \gdef\@autolatex@wtfig@width{#1}%
286 }
287 \define@key[autolatex]{withtex}{height}{%
288         \gdef\@autolatex@wtfig@height{#1}%
289 }
290
291 %-----
292 %\includefigurewtex[width=xx,height=yy]{filename}
293 \providecommand{\includefigurewtex}[2][width=\linewidth]{%
294         \begingroup%
295         \gdef\@autolatex@wtfig@width{!}%
296         \gdef\@autolatex@wtfig@height{!}%
297         \setkeys[autolatex]{withtex}{#1}%
298         %
299         \global\let\@autolatex@wtfig@tmp\relax%
300         \global\let\@autolatex@wtfig@ext\relax%
301         \global\let\@autolatex@wtfig@path\relax%
302         \filename@parse{#2}%
303         \ifx\filename@ext\relax%
304                 \@for\@autolatex@wtfig@exttmp:=\@autolatex@wtfig@extensions\do{%
305                         \@autolatex@wtfig@searchinpath{#2\@autolatex@wtfig@exttmp}%
306                 }%
307         \else%
308                 \@autolatex@wtfig@searchinpath{#2\@autolatex@wtfig@exttmp}%
309         \fi%
310         %
311         \ifx\@autolatex@wtfig@tmp\relax%
312                 \errmessage{Package upmethodology-fmt: File not found '#2', needed for figure inclusion}%
313         \else%
314                 \@autolatex@wtfig@tmp%
315         \fi%
316         %
317         \endgroup%
318 }
319
320 \global\let\includegraphicswtex\includefigurewtex
321
322 %----------------------------------------
323 % ENVIRONMENT FOR IMAGES INCLUDING TeX EXPRESSIONS
324 %----------------------------------------
325
326 \gdef\upm@figtex@dyncaption@remove{}
327 \gdef\upm@figtex@figremove#1{%
328         \global\expandafter\let\csname FIG#1\endcsname\relax%
329 }
330 \gdef\upm@figtex@restore{%
331         \upm@figtex@dyncaption@remove%
332         \gdef\upm@figtex@dyncaption@remove{}
333 }
334 %-----
335 %\figmath{id}{content}
336 \def\figmath#1#2{%
337         \expandafter\gdef\csname FIG#1\endcsname{\ensuremath{#2}}%
338         \global\protected@edef\upm@figtex@dyncaption@remove{\upm@figtex@dyncaption@remove\protect\upm@figtex@figremove{#1}}%
339 }
340 %-----
341 %\figtext{id}{content}
342 \def\figtext#1#2{%
343         \expandafter\gdef\csname FIG#1\endcsname{#2}%
344         \global\protected@edef\upm@figtex@dyncaption@remove{\upm@figtex@dyncaption@remove\protect\upm@figtex@figremove{#1}}%
345 }
346
347 \let\upm@fmt@figtex@nil\@nil
348 \def\upm@fmt@figtex@parseparams#1=#2\upm@fmt@figtex@nil{\gdef\@tmp{#2}}
349
350 \newcommand{\upm@mfigurewtex}[5][ht]{
351         \begin{figure}[#1]%
352                 \begin{center}%
353                         % Providing an ascendent compatibility on the second parameter:
354                         % - Prefered value of the parameter: a list of key/value pairs;
355                         % - Old fashion value of the parameter: the value for the "width" key.
356                         {\upm@fmt@figtex@parseparams #2====\upm@fmt@figtex@nil}%
357                         \ifthenelse{\equal{\@tmp}{===}}{%
358                                 \includegraphicswtex[width=#2]{#3}%
359                         }{%
360                                 \includegraphicswtex[#2]{#3}%
361                         }%
362                         \caption{#4}%
363                         \label{fig:#5}%
364                 \end{center}%
365         \end{figure}%
366         \upm@figtex@restore%
367 }
368 \newcommand{\upm@mfigurewtexstar}[5][ht]{
369         \begin{figure*}[#1]%
370                 \begin{center}%
371                         % Providing an ascendent compatibility on the second parameter:
372                         % - Prefered value of the parameter: a list of key/value pairs;
373                         % - Old fashion value of the parameter: the value for the "width" key.
374                         {\upm@fmt@figtex@parseparams #2====\upm@fmt@figtex@nil}%
375                         \ifthenelse{\equal{\@tmp}{===}}{%
376                                 \includegraphicswtex[width=#2]{#3}%
377                         }{%
378                                 \includegraphicswtex[#2]{#3}%
379                         }%
380                         \caption{#4}%
381                         \label{fig:#5}%
382                 \end{center}%
383         \end{figure*}%
384         \upm@figtex@restore%
385 }
386 %-----
387 %\mfigurewtex[position]{options}{filename}{caption}{label}
388 \def\mfigurewtex{\@ifstar\upm@mfigurewtexstar\upm@mfigurewtex}
389
390
391
392 %----------------------------------------
393 % TABLES
394 %----------------------------------------
395
396 %table's colors
397 \definecolor{backtableheader}{rgb}{0.92,0.94,1}
398 \definecolor{fronttableheader}{rgb}{0.23,0.33,0.48}
399 %title of a table
400 \def\upm@fmt@table@title#1{\color{fronttableheader} \cellcolor{backtableheader} {\bfseries #1}}
401 %title of columns
402 \def\upm@fmt@table@column@title#1{\hfil{\color{fronttableheader} \cellcolor{backtableheader} {\itshape#1}}\hfil}
403
404 % Utility functions for mtabular
405 \newcounter{upm@fmt@mtabular@columnnumber}
406
407 \gdef\upm@fmt@mtabular@expandtitle#1#2{%
408         \multicolumn{#1}{|c|}{\upm@fmt@table@title{\ignorespaces#2\ignorespaces}}%
409 }
410
411 \newcommand{\tabulartitlespec}[1]{%
412         \gdef\upm@fmt@mtabular@expandtitle##1##2{%
413                 \multicolumn{##1}{#1}{\upm@fmt@table@title{\ignorespaces##2\ignorespaces}}%
414         }
415 }
416
417 %-----
418 %\mtabular[width]{ncolumns}{columns}
419 \newenvironment{mtabular}[3][\linewidth]{%
420         \newcommand{\tabulartitle}[1]{%
421                 \hline%
422                 \upm@fmt@mtabular@expandtitle{#2}{##1} \\%
423                 \hline%
424         }%
425         \newcommand{\tabulartitleinside}[1]{%
426                 \hline\hline%
427                 \upm@fmt@mtabular@expandtitle{#2}{##1} \\%
428                 \hline%
429         }%
430         \newcommand*{\upm@fmt@mtabular@column@next}[1]{%
431                 & \upm@fmt@table@column@title{\ignorespaces##1\ignorespaces}%
432                 \addtocounter{upm@fmt@mtabular@columnnumber}{-1}%
433                 \ifnum0<\value{upm@fmt@mtabular@columnnumber}%
434                         \let\upm@fmt@mtabular@column@continue\upm@fmt@mtabular@column@next%
435                 \else%
436                         \\ \hline \let\upm@fmt@mtabular@column@continue\relax%
437                 \fi%
438                 \upm@fmt@mtabular@column@continue%
439         }
440         \newcommand*{\upm@fmt@mtabular@column@first}[1]{%
441                 \upm@fmt@table@column@title{\ignorespaces##1\ignorespaces}%
442                 \addtocounter{upm@fmt@mtabular@columnnumber}{-1}%
443                 \ifnum0<\value{upm@fmt@mtabular@columnnumber}%
444                         \let\upm@fmt@mtabular@column@continue\upm@fmt@mtabular@column@next%
445                 \else%
446                         \\ \hline \let\upm@fmt@mtabular@column@continue\relax%
447                 \fi%
448                 \upm@fmt@mtabular@column@continue%
449         }
450         \newcommand{\tabularheader}{%
451                 \setcounter{upm@fmt@mtabular@columnnumber}{#2}%
452                 \upm@fmt@mtabular@column@first%
453         }%
454         \newcommand{\tabularrowheader}[1]{%
455                 \centering\upm@fmt@table@column@title{\ignorespaces##1}%
456         }%
457         \begingroup\tabularx{#1}{#3}%
458 }{%
459         \endtabularx\endgroup%
460 }
461
462 %-----
463 %\mtable[options]{width}{ncolumns}{columns}{caption}{label}
464 % size=<length>
465 \define@key[autolatex]{mtable}{size}{\gdef\@autolatex@mtable@size{#1}}
466 % position: h t b p H !
467 \define@key[autolatex]{mtable}{h}[\relax]{\gdef\@autolatex@mtable@position{[h]}}
468 \define@key[autolatex]{mtable}{t}[\relax]{\gdef\@autolatex@mtable@position{[t]}}
469 \define@key[autolatex]{mtable}{b}[\relax]{\gdef\@autolatex@mtable@position{[b]}}
470 \define@key[autolatex]{mtable}{p}[\relax]{\gdef\@autolatex@mtable@position{[p]}}
471 \define@key[autolatex]{mtable}{H}[\relax]{\gdef\@autolatex@mtable@position{[H]}}
472 \define@key[autolatex]{mtable}{ht}[\relax]{\gdef\@autolatex@mtable@position{[ht]}}
473 \define@key[autolatex]{mtable}{hb}[\relax]{\gdef\@autolatex@mtable@position{[hb]}}
474 \define@key[autolatex]{mtable}{hp}[\relax]{\gdef\@autolatex@mtable@position{[hp]}}
475 \define@key[autolatex]{mtable}{hH}[\relax]{\gdef\@autolatex@mtable@position{[hH]}}
476 \define@key[autolatex]{mtable}{h!}[\relax]{\gdef\@autolatex@mtable@position{[h!]}}
477 \define@key[autolatex]{mtable}{tb}[\relax]{\gdef\@autolatex@mtable@position{[tb]}}
478 \define@key[autolatex]{mtable}{tp}[\relax]{\gdef\@autolatex@mtable@position{[tp]}}
479 \define@key[autolatex]{mtable}{tH}[\relax]{\gdef\@autolatex@mtable@position{[tH]}}
480 \define@key[autolatex]{mtable}{t!}[\relax]{\gdef\@autolatex@mtable@position{[t!]}}
481 \define@key[autolatex]{mtable}{bp}[\relax]{\gdef\@autolatex@mtable@position{[bp]}}
482 \define@key[autolatex]{mtable}{bH}[\relax]{\gdef\@autolatex@mtable@position{[bH]}}
483 \define@key[autolatex]{mtable}{b!}[\relax]{\gdef\@autolatex@mtable@position{[b!]}}
484 \define@key[autolatex]{mtable}{pH}[\relax]{\gdef\@autolatex@mtable@position{[pH]}}
485 \define@key[autolatex]{mtable}{p!}[\relax]{\gdef\@autolatex@mtable@position{[p!]}}
486 \define@key[autolatex]{mtable}{H!}[\relax]{\gdef\@autolatex@mtable@position{[H!]}}
487 \define@key[autolatex]{mtable}{htb}[\relax]{\gdef\@autolatex@mtable@position{[htb]}}
488 \define@key[autolatex]{mtable}{htp}[\relax]{\gdef\@autolatex@mtable@position{[htp]}}
489 \define@key[autolatex]{mtable}{htH}[\relax]{\gdef\@autolatex@mtable@position{[htH]}}
490 \define@key[autolatex]{mtable}{ht!}[\relax]{\gdef\@autolatex@mtable@position{[ht!]}}
491 \define@key[autolatex]{mtable}{tbp}[\relax]{\gdef\@autolatex@mtable@position{[tbp]}}
492 \define@key[autolatex]{mtable}{tbH}[\relax]{\gdef\@autolatex@mtable@position{[tbH]}}
493 \define@key[autolatex]{mtable}{tb!}[\relax]{\gdef\@autolatex@mtable@position{[tb!]}}
494 \define@key[autolatex]{mtable}{bpH}[\relax]{\gdef\@autolatex@mtable@position{[bpH]}}
495 \define@key[autolatex]{mtable}{bp!}[\relax]{\gdef\@autolatex@mtable@position{[bp!]}}
496 \define@key[autolatex]{mtable}{pH!}[\relax]{\gdef\@autolatex@mtable@position{[pH!]}}
497 \define@key[autolatex]{mtable}{htbp}[\relax]{\gdef\@autolatex@mtable@position{[htbp]}}
498 \define@key[autolatex]{mtable}{htbH}[\relax]{\gdef\@autolatex@mtable@position{[htbH]}}
499 \define@key[autolatex]{mtable}{htb!}[\relax]{\gdef\@autolatex@mtable@position{[htb!]}}
500 \define@key[autolatex]{mtable}{tbpH}[\relax]{\gdef\@autolatex@mtable@position{[tbpH]}}
501 \define@key[autolatex]{mtable}{tbp!}[\relax]{\gdef\@autolatex@mtable@position{[tbp!]}}
502 \define@key[autolatex]{mtable}{bpH!}[\relax]{\gdef\@autolatex@mtable@position{[bph!]}}
503 \define@key[autolatex]{mtable}{htbpH}[\relax]{\gdef\@autolatex@mtable@position{[htbpH]}}
504 \define@key[autolatex]{mtable}{htbp!}[\relax]{\gdef\@autolatex@mtable@position{[htbp!]}}
505 \define@key[autolatex]{mtable}{htbpH!}[\relax]{\gdef\@autolatex@mtable@position{[htbpH!]}}
506 %
507 \newenvironment{mtable}[6][ht]{%
508         \gdef\@autolatex@mtable@position{[ht]}%
509         \gdef\@autolatex@mtable@size{\normalsize}%
510         \setkeys[autolatex]{mtable}{#1}%
511         %
512         \gdef\upm@table@caption{#5}%
513         \xdef\upm@table@label{tab:#6}%
514         \gdef\upm@table@note{}%
515         \newcommand{\captionastitle}{\tabulartitle{\upm@table@caption}}%
516         \newcommand{\tablenote}[1]{\gdef\upm@table@note{\bgroup ##1\egroup}}%
517         \expandafter\table\@autolatex@mtable@position%
518         \center\@autolatex@mtable@size%
519         \mtabular[#2]{#3}{#4}%
520 }{%
521         \endmtabular\relax%
522         \caption{\upm@table@caption}%
523         \label{\upm@table@label}%
524         \endcenter%
525         \upm@table@note%
526         \endtable%
527         \global\let\upm@table@caption\relax%
528         \global\let\upm@table@label\relax%
529         \global\let\upm@table@note\relax%
530 }
531
532 %-----
533 %\tabref{label}
534 \newcommand{\tabref}[1]{\ref{tab:#1}}
535 %-----
536 %\tabpageref{label}
537 \newcommand{\tabpageref}[1]{\pageref{tab:#1}}
538
539 %----------------------------------------
540 % PARAGRAPHS
541 %----------------------------------------
542 \setlength{\parindent}{0pt}
543 \setlength{\parskip}{.2cm}
544
545 %----------------------------------------
546 % COLORIZED SECTION'S TITLES
547 %----------------------------------------
548
549 % PRIVATE COLORS
550 \definecolor{sectiontitlecolor}{rgb}{0.93,0.41,0}
551 \definecolor{chaptertitlecolor}{rgb}{0.24,0.33,0.48}
552 \definecolor{parttitlecolor}{rgb}{0.24,0.33,0.48}
553
554 % PRIVATE FORMATTING MACROS
555 \newcounter{upm@format@section@sectionlevel}
556 \setcounter{upm@format@section@sectionlevel}{0}
557
558 \gdef\upm@format@partnum#1{\textcolor{parttitlecolor}{\expandafter\fontsize{40pt}{60pt}\selectfont#1\normalfont}}
559 \gdef\upm@format@parttitle#1{\textcolor{parttitlecolor}{\huge\scshape #1}}
560 \gdef\upm@format@chapternum#1{\textcolor{chaptertitlecolor}{\expandafter\fontsize{40pt}{60pt}\selectfont#1\normalfont}}
561 \gdef\upm@format@chaptertitle#1{\textcolor{chaptertitlecolor}{\Huge\scshape #1}}
562 \gdef\upm@format@sectionnum#1#2{\textcolor{sectiontitlecolor}{#2}}
563 \gdef\upm@format@sectiontitle#1#2{\textcolor{sectiontitlecolor}{#2}}
564
565 % PART
566 \ifupmbookformat
567         \gdef\@part[#1]#2{%
568             \ifnum \c@secnumdepth >-2\relax
569               \refstepcounter{part}%
570               \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
571             \else
572               \addcontentsline{toc}{part}{#1}%
573             \fi
574             \markboth{}{}%
575             {\huge\centering
576              \interlinepenalty \@M
577              \normalfont
578              \ifnum \c@secnumdepth >-2\relax
579                \upm@format@partnum{\thepart}
580                \par
581                \vskip 20\p@
582              \fi
583              \upm@format@parttitle{\nohyphens{#2}}\par}%
584             \@endpart}
585         \gdef\@spart#1{%
586             {\centering
587              \interlinepenalty \@M
588              \normalfont
589              \upm@format@parttitle{\nohyphens{#1}}\par}%
590             \@endpart}
591 \fi
592
593 % CHAPTER
594 \ifupmarticleformat\else
595         \newcommand{\upm@format@makechapterhead}[2]{%
596                   %\vspace*{50\p@}%
597                   {\parindent \z@ \Huge \raggedleft \normalfont
598                     \ifx\@empty#1\ifnum \c@secnumdepth >\m@ne
599                         \upm@format@chapternum{\thechapter}
600                         \par\nobreak
601                         \vskip 20\p@
602                     \fi\fi
603                     \interlinepenalty\@M
604                     %\ifupmbookformat\doublespacing\fi
605                     \upm@format@chaptertitle{\nohyphens{#2}}\par\nobreak
606                     \vskip 80\p@
607                   }
608         }
609         %internal implementation of \chapter
610         \gdef\@makechapterhead#1{\upm@format@makechapterhead{\@empty}{#1}}
611         %internal implementation of \chapter*
612         \gdef\@makeschapterhead#1{\upm@format@makechapterhead{\relax}{#1}}
613 \fi
614
615 % SECTIONS
616 \let\upm@format@sect@old\@sect
617 \let\upm@format@ssect@old\@ssect
618
619 % public implementation of sections.
620 \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}}
621 \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}}
622 \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}}
623
624 % internal implementations for sections.
625 \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}}}
626 \gdef\@ssect#1#2#3#4#5{\upm@format@ssect@old{#1}{#2}{#3}{#4}{\upm@format@sectiontitle{\theupm@format@section@sectionlevel}{#5}}}
627 \gdef\@seccntformat#1{\upm@format@sectionnum{\theupm@format@section@sectionlevel}{\csname the#1\endcsname/}\quad}
628
629 %----------------------------------------
630 % PAGE LAYOUT
631 %----------------------------------------
632
633 % Change the factors for determining the element positions
634 \renewcommand{\topfraction}{.99} % max fraction of floats at top
635 \renewcommand{\bottomfraction}{.99} % max fraction of floats at bottom
636 \renewcommand{\textfraction}{.5} % allow minimal text w. figs
637 \renewcommand{\dbltopfraction}{.66} % fit big float above 2-col. text
638 \renewcommand{\floatpagefraction}{0.99} % require fuller float pages | N.B.: floatpagefraction MUST be less than topfraction !!
639 \renewcommand{\dblfloatpagefraction}{.66} % fit big float above 2-col. text
640
641 % Update the format of the saved pages and sections
642 \renewcommand{\sectionmark}[1]{\markright{\thesection\ \textsc{#1}}}
643 \ifupmarticleformat\else
644 \renewcommand{\chaptermark}[1]{\markboth{\textsc{#1}}{}}
645 \renewcommand{\@mkboth}[2]{%
646     \let\upm@doc@MakeUppercase\MakeUppercase%
647     \gdef\MakeUppercase##1{##1}%
648     \chaptermark{#1}%
649     \let\MakeUppercase\upm@doc@MakeUppercase%
650     \let\upm@doc@MakeUppercase\relax%
651 }
652 \fi
653 % Make sure that the page before a part or
654 % a chapter title was empty
655 \renewcommand{\cleardoublepage}{%
656   \clearpage%
657   \if@twoside\ifodd\c@page%
658   \else%
659   \thispagestyle{facingtochapter}%
660   \hbox{}\newpage%
661   \if@twocolumn\hbox{}\newpage%
662   \fi\fi\fi%
663 }
664 \newcommand{\ps@facingtochapter}{\ps@empty}
665
666 %----------------------------------------
667 % ADDITIONAL SECTIONS
668 %----------------------------------------
669
670 \gdef\upm@format@newsection@alignment{}
671
672 %-----
673 % Part without number but inside the TOC
674 %\parttoc [toctitle]{title} % left-alignment inside TOC
675 %\parttoc*[toctitle]{title} % right-alignment inside TOC
676 \def\parttoc{\@ifstar%
677         {\gdef\upm@format@newsection@alignment{\protect\numberline{}}\expandafter\upm@format@newsection@part}%
678         {\gdef\upm@format@newsection@alignment{}\expandafter\upm@format@newsection@part}}
679 \def\upm@format@newsection@part{\@ifnextchar [%
680         {\expandafter\upm@format@newsection@part@opt}%
681         {\expandafter\upm@format@newsection@part@nopt}}
682 \def\upm@format@newsection@part@opt[#1]#2{%
683         \part*{#2\addcontentsline{toc}{part}{\upm@format@newsection@alignment{#1}}}%
684         \chaptermark{}%
685 }
686 \def\upm@format@newsection@part@nopt#1{%
687         \part*{#1\addcontentsline{toc}{part}{\upm@format@newsection@alignment{#1}}}%
688         \chaptermark{}%
689 }
690
691 %-----
692 % Chapter without number but inside the TOC
693 %\chaptertoc [toctitle]{title} % left-alignment inside TOC
694 %\chaptertoc*[toctitle]{title} % right-alignment inside TOC
695 \def\chaptertoc{\@ifstar%
696         {\gdef\upm@format@newsection@alignment{\protect\numberline{}}\expandafter\upm@format@newsection@chapter}%
697         {\gdef\upm@format@newsection@alignment{}\expandafter\upm@format@newsection@chapter}}
698
699 \def\upm@format@newsection@chapter{\@ifnextchar[%
700         {\upm@format@newsection@chapter@a}%
701         {\upm@format@newsection@chapter@b}%
702 }
703
704 \def\upm@format@newsection@chapter@a[#1]#2{%
705         \expandafter\chapter*[#1]{#2}%
706         \addcontentsline{toc}{chapter}{\upm@format@newsection@alignment{#1}}%
707         \@ifundefined{minitoc}{}{%
708                 \global\addtocounter{mtc}{1}%
709         }%
710 }
711
712 \def\upm@format@newsection@chapter@b#1{%
713         \expandafter\chapter*{#1}%
714         \addcontentsline{toc}{chapter}{\upm@format@newsection@alignment{#1}}%
715         \@ifundefined{minitoc}{}{%
716                 \global\addtocounter{mtc}{1}%
717         }%
718 }
719
720 %-----
721 % Section without number but inside the TOC
722 %\sectiontoc [toctitle]{title} % left-alignment inside TOC
723 %\sectiontoc*[toctitle]{title} % right-alignment inside TOC
724 \def\sectiontoc{\@ifstar%
725         {\gdef\upm@format@newsection@alignment{\protect\numberline{}}\expandafter\upm@format@newsection@section}%
726         {\gdef\upm@format@newsection@alignment{}\expandafter\upm@format@newsection@section}}
727 \def\upm@format@newsection@section{\@ifnextchar [%
728         {\expandafter\upm@format@newsection@section@opt}%
729         {\expandafter\upm@format@newsection@section@nopt}}
730 \def\upm@format@newsection@section@opt[#1]#2{%
731         \section*{#2\addcontentsline{toc}{section}{\upm@format@newsection@alignment{#1}}}%
732 }
733 \def\upm@format@newsection@section@nopt#1{%
734         \section*{#1\addcontentsline{toc}{section}{\upm@format@newsection@alignment{#1}}}%
735 }
736
737 %-----
738 % Subsection without number but inside the TOC
739 %\subsectiontoc [toctitle]{title} % left-alignment inside TOC
740 %\subsectiontoc*[toctitle]{title} % right-alignment inside TOC
741 \def\subsectiontoc{\@ifstar%
742         {\gdef\upm@format@newsection@alignment{\protect\numberline{}}\expandafter\upm@format@newsection@subsection}%
743         {\gdef\upm@format@newsection@alignment{}\expandafter\upm@format@newsection@subsection}}
744 \def\upm@format@newsection@subsection{\@ifnextchar [%
745         {\expandafter\upm@format@newsection@subsection@opt}%
746         {\expandafter\upm@format@newsection@subsection@nopt}}
747 \def\upm@format@newsection@subsection@opt[#1]#2{%
748         \subsection*{#2\addcontentsline{toc}{subsection}{\upm@format@newsection@alignment{#1}}}%
749 }
750 \def\upm@format@newsection@subsection@nopt#1{%
751         \subsection*{#1\addcontentsline{toc}{subsection}{\upm@format@newsection@alignment{#1}}}%
752 }
753
754 %-----
755 % Subsubsection without number but inside the TOC
756 %\subsubsectiontoc [toctitle]{title} % left-alignment inside TOC
757 %\subsubsectiontoc*[toctitle]{title} % right-alignment inside TOC
758 \def\subsubsectiontoc{\@ifstar%
759         {\gdef\upm@format@newsection@alignment{\protect\numberline{}}\expandafter\upm@format@newsection@subsubsection}%
760         {\gdef\upm@format@newsection@alignment{}\expandafter\upm@format@newsection@subsubsection}}
761 \def\upm@format@newsection@subsubsection{\@ifnextchar [%
762         {\expandafter\upm@format@newsection@subsubsection@opt}%
763         {\expandafter\upm@format@newsection@subsubsection@nopt}}
764 \def\upm@format@newsection@subsubsection@opt[#1]#2{%
765         \subsubsection*{#2\addcontentsline{toc}{subsubsection}{\upm@format@newsection@alignment{#1}}}%
766 }
767 \def\upm@format@newsection@subsubsection@nopt#1{%
768         \subsubsection*{#1\addcontentsline{toc}{subsubsection}{\upm@format@newsection@alignment{#1}}}%
769 }
770
771 %-----
772 % Chapter with different titles for in the TOC, the headers and on the pages
773 %\chapterfull[in toc]{on page}{in header} % with number
774 %\chapterfull*[in toc]{on page}{in header} % without number
775 \def\chapterfull{\@ifstar%
776         {\gdef\upm@format@newsection@thesectionmacro{\chapter*}\upm@format@newsection@chapterfull}%
777         {\gdef\upm@format@newsection@thesectionmacro{\chapter}\upm@format@newsection@chapterfull}%
778 }
779
780 \def\upm@format@newsection@chapterfull{\@ifnextchar[%
781         \upm@format@newsection@chapterfull@a%
782         \upm@format@newsection@chapterfull@b%
783 }
784
785 \def\upm@format@newsection@chapterfull@a[#1]#2#3{%
786         \upm@format@newsection@thesectionmacro[#1]{#2}%
787         \chaptermark{#3}%
788 }
789
790 \def\upm@format@newsection@chapterfull@b#1#2{%
791         \upm@format@newsection@thesectionmacro{#1}%
792         \chaptermark{#2}%
793 }
794
795 %-----
796 % Section with different titles for in the TOC, the headers and on the pages
797 %\sectionfull[in toc]{on page}{in header} % with number
798 %\sectionfull*[in toc]{on page}{in header} % without number
799 \def\sectionfull{\@ifstar%
800         {\gdef\upm@format@newsection@thesectionmacro{\section*}\upm@format@newsection@sectionfull}%
801         {\gdef\upm@format@newsection@thesectionmacro{\section}\upm@format@newsection@sectionfull}%
802 }
803
804 \def\upm@format@newsection@sectionfull{\@ifnextchar[%
805         \upm@format@newsection@sectionfull@a%
806         \upm@format@newsection@sectionfull@b%
807 }
808
809 \def\upm@format@newsection@sectionfull@a[#1]#2#3{%
810         \upm@format@newsection@thesectionmacro[#1]{#2}%
811         \global\sectionmark{#3}%
812 }
813
814 \def\upm@format@newsection@sectionfull@b#1#2{%
815         \upm@format@newsection@thesectionmacro{#1}%
816         \global\sectionmark{#2}%
817 }
818
819 %----------------------------------------
820 % BIBLIOGRAPHY
821 %----------------------------------------
822
823 %-----
824 %\bibsize{size}
825 \newcommand{\bibsize}[1]{\gdef\upm@bibsize{#1}}
826
827 \gdef\upm@bibsize{\small}
828
829 \gdef\@biblabel#1{{\upm@bibsize{[#1]}}}
830
831 \gdef\@lbibitem[#1]#2{\item[\@biblabel{#1}\hfill]\upm@bibsize\if@filesw{%
832         \let\protect\noexpand\immediate\write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
833
834 \gdef\@bibitem#1{\item\upm@bibsize\if@filesw%
835         \immediate\write\@auxout{\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces}
836
837
838 %----------------------------------------
839 % TABLE OF CONTENT
840 %----------------------------------------
841 \setcounter{secnumdepth}{3}
842 \setcounter{tocdepth}{3}
843
844 % Change the color of the TOC for the "dotted" lines
845 %\let\upm@format@dottedtocline@old\@dottedtocline
846 %\gdef\@dottedtocline#1#2#3#4#5{%
847 %       %{depth}{left margin}{right margin}{text}{page number}
848 %       \upm@format@dottedtocline@old{#1}{#2}{#3}{#4}{#5}%
849 %}
850
851 % Change the color of the TOC for the parts
852 \@ifundefined{l@part}{}{
853 \let\upm@format@l@part@old\l@part
854 \renewcommand*\l@part[2]{%
855         %{text}{page number}
856         \upm@format@l@part@old{\textcolor{parttitlecolor}{#1}}{\textcolor{parttitlecolor}{#2}}%
857 }
858 }
859
860 % Change the color of the TOC for the chapters
861 \@ifundefined{l@chapter}{}{
862 \let\upm@format@l@chapter@old\l@chapter
863 \renewcommand*\l@chapter[2]{%
864         %{text}{page number}
865         \upm@format@l@chapter@old{\textcolor{chaptertitlecolor}{#1}}{\textcolor{chaptertitlecolor}{#2}}%
866 }
867 }
868
869 % Overide the color and font configurations of the MINITOC package
870 \AtBeginDocument{
871         \@ifundefined{minitoc}{}{%
872                 % Chapter
873                 \gdef\mtifont{\normalfont\large\upshape\bfseries\color{chaptertitlecolor}}
874                 % Section
875                 \gdef\mtcSfont{\normalfont\small\upshape\bfseries\color{sectiontitlecolor}}
876                 % Sub-Section and SubSub-Section
877                 \gdef\mtcSSfont{\normalfont\small\upshape\mdseries\normalcolor}
878                 \global\let\mtcSSSfont\mtcSSfont
879         }
880 }
881
882 %----------------------------------------
883 % ENUMERATIONS
884 %----------------------------------------
885 \newcounter{upm@fmt@savedcounter}
886
887 \newcommand{\savecounter}[1]{%
888         \setcounter{upm@fmt@savedcounter}{\value{#1}}%
889 }
890 \newcommand{\restorecounter}[1]{%
891         \setcounter{#1}{\theupm@fmt@savedcounter}%
892 }
893
894 \ifupm@use@override@standard@lists
895         \newcommand{\saveenumcounter}{\savecounter{@upm@fmt@enumdescription@cnt@}}
896         \newcommand{\restoreenumcounter}{\restorecounter{@upm@fmt@enumdescription@cnt@}}
897         \newcommand{\setenumcounter}[1]{\setcounter{@upm@fmt@enumdescription@cnt@}{#1}}
898         \newcommand{\getenumcounter}{\the@upm@fmt@enumdescription@cnt@}
899 \else
900         \newcommand{\saveenumcounter}{\savecounter{@enumctr}}
901         \newcommand{\restoreenumcounter}{\restorecounter{@enumctr}}
902         \newcommand{\setenumcounter}[1]{\setcounter{@enumctr}{#1}\addtocounter{@enumctr}{-1}}
903         \newcommand{\getenumcounter}{\value{@enumctr}}
904 \fi
905
906 %----------------------------------------
907 % FOOTNOTE
908 %----------------------------------------
909
910 \gdef\upm@footnoteref#1{\upm@textsuperscript{#1}}
911 \gdef\upm@footnotepageref#1#2{\upm@textsuperscript{{#1\tiny(#2)}}}
912
913 \def\upm@savefootnote#1#2{%
914         \footnote{#1\label{\upm@protect{footnote:#2}}}%
915         \upm@nameundef{footnote:#2:cmd}%
916 }
917 \def\upm@savefootnotestar#1#2{%
918         \upm@namedef{footnote:#2:cmd}{\upm@savefootnote{#1}{#2}}%
919 }
920
921 \DeclareRobustCommand\savefootnote{\@ifstar\upm@savefootnotestar\upm@savefootnote}
922
923 \def\upm@reffootnote#1{%
924         \upm@ifdefinedname{footnote:#1:cmd}{%
925                 \upm@nameuse{footnote:#1:cmd}}{%
926                 \upm@footnoteref{\upm@getref{\upm@protect{footnote:#1}}}%
927         }%
928         \xspace%
929
930 \def\upm@reffootnotestar#1{%
931         \upm@ifdefinedname{footnote:#1:cmd}{%
932                 \upm@nameuse{footnote:#1:cmd}}{%
933                 \xdef\upm@tmp@tmp{\upm@protect{footnote:#1}}%
934                 \upm@footnotepageref{\expandafter\upm@getref{\upm@tmp@tmp}}{\expandafter\upm@getpageref{\upm@tmp@tmp}}%
935                 \global\let\upm@tmp@tmp\relax%
936         }%
937         \xspace%
938
939
940 \DeclareRobustCommand\reffootnote{\@ifstar\upm@reffootnotestar\upm@reffootnote}
941
942 %----------------------------------------
943 % IMAGES IN PARAGRAPHS
944 %----------------------------------------
945
946 \newenvironment{umlinpar}[2][width=.45\linewidth]{%
947 \begin{window}[0,r,{\mbox{\hspace{.5cm}\includegraphics[#1]{#2}\vspace{.5cm}}},{}]
948 }{%
949 \end{window}}
950
951 %----------------------------------------
952 % DATE
953 %----------------------------------------
954
955 %Build a date this a supported format
956 %\makedate{day}{month}{year}
957 \let\makedate\upm@format@lang@makedate
958
959 %-----
960 %Replies the year corresponding to the given supported date
961 %\extractyear{date}
962 \let\extractyear\upm@format@lang@extractyear
963
964 %-----
965 %Replies the month corresponding to the given supported date
966 %\extractmonth{date}
967 \let\extractmonth\upm@format@lang@extractmonth
968
969 %-----
970 %Replies the day corresponding to the given supported date
971 %\extractday{date}
972 \let\extractday\upm@format@lang@extractday
973
974 % Redefine the today function
975 \AtBeginDocument{\global\edef\today{\makedate{\the\day}{\the\month}{\the\year}}}
976
977 %----------------------------------------
978 % PEOPLE NAME
979 %----------------------------------------
980
981 \def\makenamespacing#1{%
982         \upm@format@makenamespacing{#1}\xspace%
983 }
984
985 \def\upm@format@makenamespacing#1{%
986         \upm@foreach.\in#1\do{%
987                 \ignorespaces\upm@foreach@term.\,%
988         }{%
989                 \ignorespaces\upm@foreach@term%
990         }%
991 }
992
993 \gdef\upm@format@people@title#1{\textsc{#1}}
994 \def\upm@format@firstname@format#1{%
995         {\smaller\textsc{\upm@format@makenamespacing{#1}}}%
996 }
997 \def\upm@format@von@format#1{\mbox{\smaller\ignorespaces#1}}
998 \def\upm@format@lastname@format#1{\textsc{\ignorespaces#1}}
999
1000 %\upmmakename[von]{firstname}{lastname}{separator}
1001 \newcommand{\upmmakename}[4][\relax]{%
1002         \ifx#1\relax%
1003                 {\upm@format@firstname@format{#2}#4\upm@format@lastname@format{#3}}%
1004         \else%
1005                 {\upm@format@firstname@format{#2}#4\upm@format@von@format{#1}#4\upm@format@lastname@format{#3}}%
1006         \fi%
1007         \xspace%
1008 }
1009
1010 %\makename[von]{firstname}{lastname}
1011 \newcommand{\makename}[3][\relax]{%
1012         \upmmakename[#1]{#2}{#3}{\ }%
1013 }
1014
1015 %\makelastname[von]{lastname}
1016 \newcommand{\makelastname}[2][\relax]{%
1017         \ifx#1\relax%
1018                 \upm@format@lastname@format{#2}%
1019         \else%
1020                 \upm@format@von@format{#1}\ \upm@format@lastname@format{#2}%
1021         \fi%
1022         \xspace%
1023 }
1024
1025 %\makefirstname{firstname}
1026 \newcommand{\makefirstname}[1]{%
1027         \upm@format@firstname@format{#1}\xspace%
1028 }
1029
1030 %\prname[von]{firstname}{lastname}
1031 %\prname*[von]{firstname}{lastname}
1032 \def\prname{\@ifstar\upm@prnamestar\upm@prname}
1033 \newcommand{\upm@prname}[3][\relax]{%
1034         \upm@format@people@title{\upm@format@lang@professor}\,\upmmakename[#1]{#2}{#3}{\ }%
1035 }
1036 \newcommand{\upm@prnamestar}[3][\relax]{%
1037         \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@professor}%
1038 }
1039
1040 %\drname[von]{firstname}{lastname}
1041 %\drname*[von]{firstname}{lastname}
1042 \def\drname{\@ifstar\upm@drnamestar\upm@drname}
1043 \newcommand{\upm@drname}[3][\relax]{%
1044         \upm@format@people@title{\upm@format@lang@doctor}\,\upmmakename[#1]{#2}{#3}{\ }%
1045 }
1046 \newcommand{\upm@drnamestar}[3][\relax]{%
1047         \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@doctor}%
1048 }
1049
1050 %\phdname[von]{firstname}{lastname}
1051 %\phdname*[von]{firstname}{lastname}
1052 \def\phdname{\@ifstar\upm@phdnamestar\upm@phdname}
1053 \newcommand{\upm@phdname}[3][\relax]{%
1054         \upm@format@people@title{\upm@format@lang@phdoctor}\,\upmmakename[#1]{#2}{#3}{\ }%
1055 }
1056 \newcommand{\upm@phdnamestar}[3][\relax]{%
1057         \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@phdoctor}%
1058 }
1059
1060 %\scdname[von]{firstname}{lastname}
1061 %\scdname*[von]{firstname}{lastname}
1062 \def\scdname{\@ifstar\upm@scdnamestar\upm@scdname}
1063 \newcommand{\upm@scdname}[3][\relax]{%
1064         \upm@format@people@title{\upm@format@lang@scdoctor}\,\upmmakename[#1]{#2}{#3}{\ }%
1065 }
1066 \newcommand{\upm@scdnamestar}[3][\relax]{%
1067         \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@scdoctor}%
1068 }
1069
1070 %\mdname[von]{firstname}{lastname}
1071 %\mdname*[von]{firstname}{lastname}
1072 \def\mdname{\@ifstar\upm@mdnamestar\upm@mdname}
1073 \newcommand{\upm@mdname}[3][\relax]{%
1074         \upm@format@people@title{\upm@format@lang@mdoctor}\,\upmmakename[#1]{#2}{#3}{\ }%
1075 }
1076 \newcommand{\upm@mdnamestar}[3][\relax]{%
1077         \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@mdoctor}%
1078 }
1079
1080 %\pengname[von]{firstname}{lastname}
1081 %\pengname*[von]{firstname}{lastname}
1082 \def\pengname{\@ifstar\upm@pengnamestar\upm@pengname}
1083 \newcommand{\upm@pengname}[3][\relax]{%
1084         \upm@format@people@title{\upm@format@lang@professionalengineer}\,\upmmakename[#1]{#2}{#3}{\ }%
1085 }
1086 \newcommand{\upm@pengnamestar}[3][\relax]{%
1087         \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@professionalengineer}%
1088 }
1089
1090 %\iengname[von]{firstname}{lastname}
1091 %\iengname*[von]{firstname}{lastname}
1092 \def\iengname{\@ifstar\upm@iengnamestar\upm@iengname}
1093 \newcommand{\upm@iengname}[3][\relax]{%
1094         \upm@format@people@title{\upm@format@lang@incorporatedengineer}\,\upmmakename[#1]{#2}{#3}{\ }%
1095 }
1096 \newcommand{\upm@iengnamestar}[3][\relax]{%
1097         \upmmakename[#1]{#2}{#3}{\ }, \upm@format@people@title{\upm@format@lang@incorporatedengineer}%
1098 }
1099
1100 %----------------------------------------
1101 % INLINE ENUMERATION
1102 %----------------------------------------
1103
1104 \newcounter{@@upm@fmt@inlineenumeration}
1105 \newcommand{\inlineenumerationlabel}[1]{(#1)}
1106 \let\upm@fmt@inlineenum@numberformat\roman
1107 \newenvironment{inlineenumeration}{%
1108         \begingroup%
1109         \let\upm@fmt@inlineenum@currentlabel\@currentlabel%
1110         \renewcommand{\item}{\xdef\@currentlabel{\upm@fmt@inlineenum@numberformat{@@upm@fmt@inlineenumeration}}{\inlineenumerationlabel{\@currentlabel}{\addtocounter{@@upm@fmt@inlineenumeration}{1}}}~}%
1111         \setcounter{@@upm@fmt@inlineenumeration}{1}%
1112 }{%
1113         \global\let\@currentlabel\upm@fmt@inlineenum@currentlabel%
1114         \endgroup%
1115 }
1116
1117 %----------------------------------------
1118 % DESCRIPTION LIST WITH NUMBERS
1119 %----------------------------------------
1120
1121 \newcounter{@upm@fmt@enumdescription@cnt@}
1122 \gdef\upm@fmt@enumdescription@savedlabel{}
1123 \gdef\upm@fmt@enumdescription@savedcounter{}
1124 \newcommand{\upm@fmt@enumdescription@fmt@}[1]{}
1125 \newcommand{\enumdescriptionlabel}[1]{\textbf{#1}}
1126 \newcommand{\enumdescriptioncounterseparator}{~-~}
1127 \newcommand{\enumdescriptionlabelseparator}{\upm@column@char}
1128 % #1: counter style.
1129 % #2: text before the counter.
1130 % #3: text after the counter.
1131 % #4: text between the counter and the description.
1132 % #5: text between the description and the rest of the text.
1133 % #6: text between the counter (no description) and the rest of the text.
1134 \newenvironment{upm@fmt@enumdescription}[6]{%
1135         \begin{list}{}{%
1136                 \renewcommand{\upm@fmt@enumdescription@savedlabel}{\@currentlabel}%
1137                 \edef\upm@fmt@enumdescription@savedcounter{\the@upm@fmt@enumdescription@cnt@}%
1138                 \setcounter{@upm@fmt@enumdescription@cnt@}{1}%
1139                 \ifthenelse{\equal{#1}{a}}{%
1140                         \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\alph{##1}#3}%
1141                 }{%
1142                         \ifthenelse{\equal{#1}{A}}{%
1143                                 \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\Alph{##1}#3}%
1144                         }{%
1145                                 \ifthenelse{\equal{#1}{i}}{%
1146                                         \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\roman{##1}#3}%
1147                                 }{%
1148                                         \ifthenelse{\equal{#1}{I}}{%
1149                                                 \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\Roman{##1}#3}%
1150                                         }{%
1151                                                 \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\arabic{##1}#3}%
1152                                         }%
1153                                 }%
1154                         }%
1155                 }%
1156                 \renewcommand{\makelabel}[1]{%
1157                         \xdef\@currentlabel{\upm@fmt@enumdescription@fmt@{@upm@fmt@enumdescription@cnt@}}%
1158                         \enumdescriptionlabel{\@currentlabel#4##1\ifthenelse{\equal{a##1}{a}}{#6}{#5}}{\addtocounter{@upm@fmt@enumdescription@cnt@}{1}}}%
1159                 \expandafter\settowidth{\labelwidth}{#2iii#3}%
1160         }
1161 }{%
1162         \global\let\@currentlabel\upm@fmt@enumdescription@savedlabel%
1163         \setcounter{@upm@fmt@enumdescription@cnt@}{\upm@fmt@enumdescription@savedcounter}%
1164         \end{list}%
1165 }
1166 \newenvironment{enumdescriptionx}[3][i]{%
1167         \begin{upm@fmt@enumdescription}{#1}{#2}{#3}{\enumdescriptioncounterseparator}{\enumdescriptionlabelseparator}{\enumdescriptionlabelseparator}%
1168 }{%
1169         \end{upm@fmt@enumdescription}%
1170 }
1171 \newenvironment{enumdescription}[1][i]{%
1172         \begin{upm@fmt@enumdescription}{#1}{}{}{\enumdescriptioncounterseparator}{\enumdescriptionlabelseparator}{\enumdescriptionlabelseparator}%
1173 }{%
1174         \end{upm@fmt@enumdescription}%
1175 }
1176
1177 %% Issue #14: enumerate behaves as enumdescription
1178 \ifupm@use@override@standard@lists
1179         
1180         \AtBeginDocument{
1181                 \message{*** Overriding the 'enumerate' environment. Pass option 'standardlists' for avoiding this override.}
1182                 \global\let\enumerate\@undefined
1183                 \global\let\endenumerate\@undefined
1184                 \global\NewEnviron{enumerate}[1][1\string.~]{%
1185                         % Parse the parameter for extracting the type of the enumeration, the prefix and the postfix
1186                         \in@{a}{#1}\ifin@
1187                                 \gdef\upm@fmt@enumerate@style{a}%
1188                                 \def\reserved@a##1a##2\@nil{%
1189                                         \def\upm@fmt@enumerate@prefix{##1}%
1190                                         \def\upm@fmt@enumerate@postfix{##2}%
1191                                 }%
1192                                 \reserved@a#1\@nil%
1193                         \else\in@{1}{#1}\ifin@
1194                                 \gdef\upm@fmt@enumerate@style{1}%
1195                                 \def\reserved@a##11##2\@nil{%
1196                                         \def\upm@fmt@enumerate@prefix{##1}%
1197                                         \def\upm@fmt@enumerate@postfix{##2}%
1198                                 }%
1199                                 \reserved@a#1\@nil%
1200                         \else\in@{A}{#1}\ifin@
1201                                 \gdef\upm@fmt@enumerate@style{A}%
1202                                 \def\reserved@a##1A##2\@nil{%
1203                                         \def\upm@fmt@enumerate@prefix{##1}%
1204                                         \def\upm@fmt@enumerate@postfix{##2}%
1205                                 }%
1206                                 \reserved@a#1\@nil%
1207                         \else\in@{i}{#1}\ifin@
1208                                 \gdef\upm@fmt@enumerate@style{i}%
1209                                 \def\reserved@a##1i##2\@nil{%
1210                                         \def\upm@fmt@enumerate@prefix{##1}%
1211                                         \def\upm@fmt@enumerate@postfix{##2}%
1212                                 }%
1213                                 \reserved@a#1\@nil%
1214                         \else\in@{I}{#1}\ifin@
1215                                 \gdef\upm@fmt@enumerate@style{I}%
1216                                 \def\reserved@a##1I##2\@nil{%
1217                                         \def\upm@fmt@enumerate@prefix{##1}%
1218                                         \def\upm@fmt@enumerate@postfix{##2}%
1219                                 }%
1220                                 \reserved@a#1\@nil%
1221                         \else%
1222                                 \errmessage{Invalid format of the enumerate counter}
1223                         \fi\fi\fi\fi\fi%
1224                         \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}{}}%
1225                         %
1226                         \upm@tmp%
1227                         %\protect\begin{upm@fmt@enumdescription}{#1}{}{\string.~}{}{\enumdescriptionlabelseparator}{}%
1228                         \BODY%
1229                         \protect\end{upm@fmt@enumdescription}%
1230                 }
1231         }
1232 \fi
1233
1234 %----------------------------------------
1235 % DESCRIPTION LIST WITH BULLETS
1236 %----------------------------------------
1237 \ifupm@use@override@standard@lists
1238         \gdef\upm@fmt@itemizeddescription@separator{\upm@column@char\ }
1239         \newcommand{\upm@fmt@itemizeddescription@formatdescription}[1]{\textbf{#1}}
1240         \newcommand{\upm@fmt@itemizeddescription@desc}[2]{%
1241                 \upm@fmt@itemizeddescription@formatdescription{#1#2}%
1242         }
1243         \let\upm@fmt@olditem\item
1244         \let\upm@item@param\upm@fmt@olditem
1245         \let\upm@item@noparam\upm@fmt@olditem
1246         \def\item{\@ifnextchar[\upm@item@param\upm@item@noparam}
1247         \AtBeginDocument{
1248                 \message{*** Overriding the 'description' environment. Pass option 'standardlists' for avoiding this override.}
1249                 \global\let\description\@undefined
1250                 \global\let\enddescription\@undefined
1251                 \global\NewEnviron{description}[1][\upm@fmt@itemizeddescription@separator]{
1252                         \begin{itemize}%
1253                         \renewcommand{\upm@item@param}[1][]{\upm@fmt@olditem \upm@fmt@itemizeddescription@desc{##1}{#1}}%
1254                         \renewcommand{\upm@item@noparam}{\upm@fmt@olditem }%
1255                         \BODY%
1256                         \end{itemize}%
1257                 }
1258         }
1259 \fi
1260
1261 %----------------------------------------
1262 % SIZE MANAGEMENT
1263 %----------------------------------------
1264 \newenvironment{upmfontsize}[1]{%
1265         \begingroup%
1266         \let\upm@Huge\Huge%
1267         \let\upm@huge\huge%
1268         \let\upm@normalsize\normalsize%
1269         \let\upm@small\small%
1270         \let\upm@scriptsize\scriptsize%
1271         \let\upm@footnotesize\footnotesize%
1272         \let\upm@tiny\tiny%
1273         %
1274         \ifx#1\Huge%
1275                 \let\Huge\upm@Huge%
1276                 \let\huge\upm@Huge%
1277                 \let\small\upm@huge%
1278                 \let\scriptsize\upm@normalsize%
1279                 \let\footnotesize\upm@small%
1280                 \let\tiny\upm@scriptsize%
1281         \else\ifx#1\huge%
1282                 \let\Huge\upm@Huge%
1283                 \let\huge\upm@Huge%
1284                 \let\small\upm@normalsize%
1285                 \let\scriptsize\upm@small%
1286                 \let\footnotesize\upm@scriptsize%
1287                 \let\tiny\upm@footnotesize%
1288         \else\ifx#1\small%
1289                 \let\Huge\upm@huge%
1290                 \let\huge\upm@normalsize%
1291                 \let\small\upm@scriptsize%
1292                 \let\scriptsize\upm@footnotesize%
1293                 \let\footnotesize\upm@tiny%
1294                 \let\tiny\upm@tiny%
1295         \else\ifx#1\scriptsize%
1296                 \let\Huge\upm@normalsize%
1297                 \let\huge\upm@small%
1298                 \let\small\upm@footnotesize%
1299                 \let\scriptsize\upm@tiny%
1300                 \let\footnotesize\upm@tiny%
1301                 \let\tiny\upm@tiny%
1302         \else\ifx#1\footnotesize%
1303                 \let\Huge\upm@small%
1304                 \let\huge\upm@scriptsize%
1305                 \let\small\upm@tiny%
1306                 \let\scriptsize\upm@tiny%
1307                 \let\footnotesize\upm@tiny%
1308                 \let\tiny\upm@tiny%
1309         \else\ifx#1\tiny%
1310                 \let\Huge\upm@scriptsize%
1311                 \let\huge\upm@footnotesize%
1312                 \let\small\upm@tiny%
1313                 \let\scriptsize\upm@tiny%
1314                 \let\footnotesize\upm@tiny%
1315                 \let\tiny\upm@tiny%
1316         \fi%
1317         \fi%
1318         \fi%
1319         \fi%
1320         \fi%
1321         \fi%
1322         #1%
1323 }{\endgroup}
1324
1325 %----------------------------------------
1326 % FRAMED MINIPAGE
1327 %----------------------------------------
1328
1329 \newsavebox{\upm@framed@minipage}
1330 %\begin{framedminipage}{width}...\end{framedminipage}
1331 \newenvironment{framedminipage}[1]{%
1332         \begin{lrbox}{\upm@framed@minipage}\begin{minipage}{#1}%
1333         }{%
1334         \end{minipage}\end{lrbox}\fbox{\usebox{\upm@framed@minipage}}}
1335
1336 %\begin{framedcolorminipage}{width}{border}{background}...\end{framedcolorminipage}
1337 \newenvironment{framedcolorminipage}[3]{%
1338         \newcommand{\upm@framed@minipage@border}{#2}%
1339         \newcommand{\upm@framed@minipage@background}{#3}%
1340         \begin{lrbox}{\upm@framed@minipage}\begin{minipage}{#1}%
1341         }{%
1342         \end{minipage}\end{lrbox}\fcolorbox{\upm@framed@minipage@border}{\upm@framed@minipage@background}{\usebox{\upm@framed@minipage}}}
1343
1344 %----------------------------------------
1345 % HIGHLIGH BOXES
1346 %----------------------------------------
1347
1348 \newsavebox{\upm@highlight@box@save}
1349
1350 \newenvironment{upm@highligh@box}[2]{%
1351         \par
1352         \vspace{.5cm}
1353         \begin{tabular}{|p{#1}|}
1354         \hline
1355         \begin{window}[0,l,{\mbox{\includegraphics[width=1cm]{#2}}},{}]
1356 }{%
1357         \end{window}\\ \hline \end{tabular}
1358         \vspace{.5cm}
1359         \par
1360 }
1361
1362 \newenvironment{upmcaution}[1][\linewidth]{%
1363         \upm@highligh@box{#1}{caution.png}%
1364 }{%
1365         \endupm@highligh@box%
1366 }
1367
1368 \newenvironment{upminfo}[1][\linewidth]{%
1369         \upm@highligh@box{#1}{info.png}%
1370 }{%
1371         \endupm@highligh@box%
1372 }
1373
1374 \newenvironment{upmquestion}[1][\linewidth]{%
1375         \upm@highligh@box{#1}{question.png}%
1376 }{%
1377         \endupm@highligh@box%
1378 }
1379
1380 %----------------------------------------
1381 % PROVIDE URL MACROS, WHICH WILL BE
1382 % OVERRIDDEN BY THE DOCUMENT CLASS
1383 %----------------------------------------
1384
1385 \newcommand{\url}[2][]{\texttt{#2}}
1386 \newcommand{\href}[3][]{\texttt{#3}}
1387
1388 %----------------------------------------
1389 % Exponents and Indices
1390 %----------------------------------------
1391 \gdef\textup#1{\textsuperscript{#1}\xspace}
1392 \def\@textsubscript#1{%
1393   {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
1394 \gdef\textsubscript#1{\@textsubscript{\selectfont#1}}
1395 \gdef\textdown#1{\textsubscript{#1}\xspace}
1396
1397
1398 %----------------------------------------
1399 % UNDERLINE
1400 %----------------------------------------
1401
1402 \let\upm@oldunderline\underline
1403 \renewcommand{\underline}[1]{\upm@oldunderline{\smash{#1}}}
1404
1405 %----------------------------------------
1406 % ENVIRONMENT FOR DEFINITIONS
1407 %----------------------------------------
1408
1409 %-----
1410 % Defining the style for the definitions
1411 \colorlet{definitionbackground}{backtableheader}
1412 \colorlet{definitionheaderforeground}{fronttableheader}
1413 \colorlet{definitionborder}{fronttableheader}
1414 \colorlet{definitiontextforeground}{fronttableheader}
1415
1416 \ifupmlang{french}{
1417         \gdef\definitionname{D\'efinition}
1418         \gdef\listdefinitionname{Liste des d\'efinitions}
1419 }{
1420         \gdef\definitionname{Definition}
1421         \gdef\listdefinitionname{List of Definitions}
1422 }
1423
1424 \gdef\upm@definition@width{.9\linewidth}
1425 \gdef\upm@definition@rule@width{\linewidth}
1426 \gdef\upm@definition@rule@height{0.4pt}
1427
1428 \newtheoremstyle{upmdefinition}% name of the style to be used
1429           {}% measure of space to leave above the theorem. E.g.: 3pt
1430           {}% measure of space to leave below the theorem. E.g.: 3pt
1431           {\normalfont}% name of font to use in the body of the theorem
1432           {}% measure of space to indent the head
1433           {\normalfont\bfseries}% name of head font
1434           {\\[-1em]{\textcolor{definitionborder}{\rule{\upm@definition@rule@width}{\upm@definition@rule@height}}}}% punctuation between head and body
1435           {\newline}% space after theorem head
1436           {\textcolor{definitionheaderforeground}{\thmname{#1}\thmnumber{~#2}\upm@column@char\thmnote{ #3}}\vspace{.25em}}% Manually specify head
1437
1438 %-----
1439 % Declare a theorem with the standard UPM style
1440 % \declareupmtheorem[theorem_style]{name}{label}{list_label}
1441 \newcommand{\declareupmtheorem}[4][upmdefinition]{%
1442         \global\declaretheorem[name={#3},style=#1]{upm#2}%
1443         \global\newenvironment{#2}[1][]{%
1444                 \par\vspace{\parsep}\centering\begin{framedcolorminipage}{\upm@definition@width}{definitionborder}{definitionbackground}%
1445                 \color{definitiontextforeground}%
1446                 \begin{upm#2}[##1]%
1447         }{%
1448                 \end{upm#2}%
1449                 \end{framedcolorminipage}\vspace{\parsep}\par%
1450         }%
1451         % Check the version of the thmtools because the TeXLive distribution
1452         % gives a too old version.
1453         \@ifpackagelater{thm-listof}{2012/05/03}{%
1454                 \global\@namedef{listof#2s}{%
1455                         \global\let\upm@definition@old@listtheoremname\listtheoremname%
1456                         \global\let\upm@definition@old@upmtheoremopt\upm@definition@upmtheoremopt%
1457                         \gdef\listtheoremname{#4}%
1458                         \renewcommand{\upm@definition@upmtheoremopt}[1]{}%
1459                         \expandafter\listoftheorems[ignoreall,show={upm#2}]%
1460                         \global\let\listtheoremname\upm@definition@old@listtheoremname%
1461                         \global\let\upm@definition@upmtheoremopt\upm@definition@old@upmtheoremopt%
1462                 }%
1463         }{%
1464                 \@latex@warning{Your version of the thmtools is too old. I recommend you to install the version 2012/05/04, or later.}
1465                 \global\@namedef{listof#2s}{%
1466                         \global\let\upm@tmp\listtheoremname%
1467                         \gdef\listtheoremname{#4}%
1468                         \listoftheorems%
1469                         \global\let\listtheoremname\upm@tmp%
1470                 }%
1471         }
1472 }
1473 \@onlypreamble\declareupmtheorem
1474
1475 \gdef\thmtformatoptarg#1{\upm@column@char\ #1}%
1476
1477 % Permits to define an part of the definition's name that is
1478 % rendered only in core part of the document, not in the
1479 % list of theorems
1480 \gdef\upm@definition@upmtheoremopt#1{#1}
1481 \gdef\upmtheoremopt#1{\protect\upm@definition@upmtheoremopt{#1}}
1482
1483 %-----
1484 % Declare the definition environment
1485 \declareupmtheorem{definition}{\definitionname}{\listdefinitionname}
1486
1487 %----------------------------------------
1488 % ENVIRONMENT FOR EMPHBOX
1489 %----------------------------------------
1490
1491 %-----
1492 % Defining the style for the emphbox
1493 \colorlet{emphboxbackground}{backtableheader}
1494 \colorlet{emphboxborder}{fronttableheader}
1495 \colorlet{emphboxtext}{fronttableheader}
1496
1497 \NewEnviron{emphbox}[1][\linewidth]{%
1498         \begin{framedcolorminipage}{#1}{emphboxborder}{emphboxbackground}%
1499                 \centering\color{emphboxtext}\BODY%
1500         \end{framedcolorminipage}%
1501 }
1502
1503 \endinput
1504