]> AND Private Git Repository - these_kahina.git/blob - upmethodology-document.cls
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
suppression thesis.pdf
[these_kahina.git] / upmethodology-document.cls
1 % Document class for Unified Process Methodology
2 %
3 % Copyright (c) 2014 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@docclazz@ver{2014/09/11}
21
22 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
23 \ProvidesClass{upmethodology-document}[\upm@package@docclazz@ver]
24
25 \RequirePackage{upmethodology-p-common}
26
27 \newif\ifupm@package@docclazz@nodocinfo
28 \upm@package@docclazz@nodocinfofalse
29 \newif\ifupm@package@docclazz@nopubpage
30 \upm@package@docclazz@nopubpagefalse
31 \newif\ifupm@package@docclazz@autofrontmatter
32 \upm@package@docclazz@autofrontmatterfalse
33 \newif\ifupm@package@docclazz@addfrontcover
34 \upm@package@docclazz@addfrontcovertrue
35 \newif\ifupm@package@docclazz@addbackcover
36 \upm@package@docclazz@addbackcovertrue
37
38 \gdef\upm@package@docclazz@optionstopass{a4paper,11pt}
39
40 \DeclareOption{twoside}{%
41   \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,twoside,openright}%
42 }
43 \DeclareOption{oneside}{%
44   \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,oneside}%
45 }
46
47 \DeclareOption{french}{%
48   \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,french}%
49   \PassOptionsToPackage{french}{upmethodology-document}
50 }
51 \DeclareOption{francais}{%
52   \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,french}%
53   \PassOptionsToPackage{french}{upmethodology-document}
54 }
55 \DeclareOption{english}{%
56   \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,english}%
57   \PassOptionsToPackage{english}{upmethodology-document}
58 }
59 \DeclareOption{standardlists}{%
60         \message{*********** DISABLING UPMETHODOLOGY LISTS}
61         \PassOptionsToPackage{standardlists}{upmethodology-fmt}
62 }
63
64 \DeclareOption{nodocumentinfo}{%
65         \global\upm@package@docclazz@nodocinfotrue%
66 }
67 \DeclareOption{documentinfo}{%
68         \global\upm@package@docclazz@nodocinfofalse%
69 }
70 \DeclareOption{nopubpage}{%
71         \global\upm@package@docclazz@nopubpagetrue%
72 }
73 \DeclareOption{pubpage}{%
74         \global\upm@package@docclazz@nopubpagefalse%
75 }
76 \DeclareOption{nofrontmatter}{%
77         \global\upm@package@docclazz@autofrontmatterfalse%
78 }
79 \DeclareOption{frontmatter}{%
80         \global\upm@package@docclazz@autofrontmattertrue%
81 }
82 \DeclareOption{nofrontcover}{%
83         \global\upm@package@docclazz@addfrontcoverfalse%
84 }
85 \DeclareOption{frontcover}{%
86         \global\upm@package@docclazz@addfrontcovertrue%
87 }
88 \DeclareOption{nobackcover}{%
89         \global\upm@package@docclazz@addbackcoverfalse%
90 }
91 \DeclareOption{backcover}{%
92         \global\upm@package@docclazz@addbackcovertrue%
93 }
94 \DeclareOption{book}{%
95         \global\upmbookformattrue
96         \global\upmreportformatfalse
97         \global\upmarticleformatfalse
98         \global\upm@package@docclazz@nopubpagefalse%
99         \global\upm@package@docclazz@nodocinfofalse%
100         \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,twoside,openright}%
101 }
102 \DeclareOption{report}{%
103         \global\upmbookformatfalse
104         \global\upmreportformattrue
105         \global\upmarticleformatfalse
106         \global\upm@package@docclazz@nopubpagetrue%
107         \global\upm@package@docclazz@nodocinfofalse%
108         \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,oneside}%
109 }
110 \DeclareOption{article}{%
111         \global\upmbookformatfalse
112         \global\upmreportformatfalse
113         \global\upmarticleformattrue
114         \global\upm@package@docclazz@nopubpagetrue%
115         \global\upm@package@docclazz@nodocinfotrue%
116         \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,oneside}%
117 }
118
119 \DeclareOption*{%
120         \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,\CurrentOption}%
121         }
122 \ExecuteOptions{report}
123 \ProcessOptions*\relax
124
125 \ifupmbookformat
126         \message{*********** UPMETHODOLOGY BOOK CLASS (WITH PART AND CHAPTER)}
127         \expandafter\LoadClass[\upm@package@docclazz@optionstopass]{book}
128 \else\ifupmreportformat
129         \message{*********** UPMETHODOLOGY REPORT CLASS (WITHOUT PART, WITH CHAPTER)}
130         \expandafter\LoadClass[\upm@package@docclazz@optionstopass]{report}
131 \else
132         \message{*********** UPMETHODOLOGY ARTICLE CLASS (WITHOUT PART AND CHAPTER)}
133         \expandafter\LoadClass[\upm@package@docclazz@optionstopass]{article}
134 \fi\fi
135
136 \RequirePackage{a4wide}
137
138 \RequirePackage{upmethodology-document}
139 \RequirePackage{upmethodology-extension}
140 \RequirePackage{upmethodology-frontpage}
141 \RequirePackage{upmethodology-backpage}
142 \RequirePackage{upmethodology-task}
143 \RequirePackage{upmethodology-code}
144 \RequirePackage{upmethodology-spec}
145
146 \RequirePackage{url}
147 \ifpdf
148         \RequirePackage[pdftex,
149                         breaklinks, %make links breakable on several lines
150                         pageanchor=true, %put implicit anchor on each page (required for \printindex)
151                         bookmarks=false, %hide bookmarks
152                         hyperfigures=true, %not documented
153                         hyperindex=true, %the page numbers in the index are links
154                         linktocpage=true, %page numbers are used for links in TOC, LOF...
155                         bookmarks=true, %open the bookmarks
156                         bookmarksopen=true, %open all the bookmark's nodes by default
157                         bookmarksnumbered=true, %section number in bookmarks
158                         colorlinks=false, % Use a frame around links
159                         pdfproducer={upmethodology \upm@package@docclazz@ver},
160                         ]{hyperref}
161 \else
162         \RequirePackage[breaklinks, %make links breakable on several lines
163                         pageanchor=true, %put implicit anchor on each page (required for \printindex)
164                         bookmarks=false, %hide bookmarks
165                         hyperfigures=true, %not documented
166                         hyperindex=true, %the page numbers in the index are links
167                         linktocpage=true, %page numbers are used for links in TOC, LOF...
168                         bookmarks=true, %open the bookmarks
169                         bookmarksopen=true, %open all the bookmark's nodes by default
170                         bookmarksnumbered=true, %section number in bookmarks
171                         colorlinks=false, % Use a frame around links
172                         ]{hyperref}
173 \fi
174 \urlstyle{same}
175
176 \ifpdf
177   \pdfpageheight=29.7cm
178   \pdfpagewidth=21.0cm
179 \fi
180
181 %----------------------------------------
182 % HEADERS AND FOOTERS
183 %----------------------------------------
184
185 \def\upm@header@fmt#1{\textsc{\scriptsize #1}}
186 \def\upm@copyright@fmt#1{\textsc{\tiny #1}}
187
188 \global\let\upm@package@docclazz@old@pagestyle\pagestyle
189 \gdef\pagestyle#1{%
190         \gdef\upm@package@docclazz@saved@pagestyle{#1}%
191         \upm@package@docclazz@old@pagestyle{#1}%
192 }
193 \gdef\upm@package@docclazz@saved@pagestyle{headings}%
194 \upm@package@docclazz@old@pagestyle{headings}
195
196 \newdimen{\upm@smalllogo@height}
197 \upm@smalllogo@height=1cm
198
199 %----------------------------------------
200 % FRONT, MAIN AND BACK MATTERS
201 %----------------------------------------
202
203 \global\let\upm@package@docclazz@frontmatter\frontmatter
204 \gdef\frontmatter{%
205         \upm@package@docclazz@old@pagestyle{headings}%
206         \pagenumbering{roman}%
207         \global\let\frontmatter\relax%
208 }
209
210 \global\let\upm@package@docclazz@mainmatter\mainmatter
211 \gdef\mainmatter{%
212         \upm@package@docclazz@mainmatter%
213         \global\let\frontmatter\relax%
214         \global\let\mainmatter\relax%
215 }
216
217 \global\let\upm@package@docclazz@backmatter\backmatter
218 \gdef\backmatter{%
219         \global\let\frontmatter\relax%
220         \global\let\mainmatter\relax%
221         \global\let\backmatter\relax%
222         \upm@package@docclazz@backmatter%
223         \global\let\upm@package@docclazz@appendix\appendix%
224         \gdef\appendix{%
225                 \upm@package@docclazz@appendix%
226                 \global\@mainmattertrue%
227         }%
228 }
229
230 %----------------------------------------
231 % AUTO-GENERATED DOCUMENT
232 %----------------------------------------
233
234 \AtBeginDocument{%
235         \ifupm@package@docclazz@autofrontmatter\frontmatter\fi%
236         \ifupm@package@docclazz@addfrontcover\makefrontcover\fi%
237         \ifupm@package@docclazz@nopubpage\else\upmpublicationpage\fi%
238         \ifupm@package@docclazz@nodocinfo\else\upmdocinfopage\fi%
239         \sloppy%
240 }
241
242 \AtEndDocument{%
243         \ifupm@package@docclazz@addbackcover\makebackcover\fi%
244 }
245
246 %----------------------------------------
247 % PDF COLORS
248 %----------------------------------------
249 \gdef\upm@package@getcolor#1,#2,#3{#1 #2 #3}
250 \ifpdf
251         \renewcommand{\setpdfcolor}[1]{
252                 \hypersetup{
253                         filebordercolor={\upm@package@getcolor #1}, % frame color
254                         linkbordercolor={\upm@package@getcolor #1}, % frame color
255                         citebordercolor={\upm@package@getcolor #1}, % frame color
256                         menubordercolor={\upm@package@getcolor #1}, % frame color
257                         urlbordercolor={\upm@package@getcolor #1}, % frame color
258                         runbordercolor={\upm@package@getcolor #1}, % frame color
259                 }
260         }
261 \fi
262
263 %----------------------------------------
264 % SET FORBIDDEN SECTIONNING FUNCTIONS
265 %----------------------------------------
266 \ifupmbookformat\else
267         \gdef\upm@package@docclazz@hidesec@a#1{%
268                 \@ifnextchar*{\upm@package@docclazz@hidesec@d{#1}}{%
269                 \@ifnextchar[{\upm@package@docclazz@hidesec@b{#1}}{\upm@package@docclazz@hidesec@c{#1}}%
270                 }}
271         \gdef\upm@package@docclazz@hidesec@d#1#2{%
272                 \@ifnextchar[{\upm@package@docclazz@hidesec@b{#1}}{\upm@package@docclazz@hidesec@c{#1}}}
273         \gdef\upm@package@docclazz@hidesec@b#1[#2]#3{\@warning{"#1" macro is skipped. Title: "#3"}}
274         \gdef\upm@package@docclazz@hidesec@c#1#2{\@warning{"#1" macro is skipped. Title: "#2"}}
275
276         \gdef\part{\upm@package@docclazz@hidesec@a{\string\part}}
277         \gdef\partstar{\upm@package@docclazz@hidesec@a{\string\part*}}
278         \gdef\parttoc{\upm@package@docclazz@hidesec@a{\string\parttoc}}
279
280 \ifupmreportformat\else
281
282         \gdef\chapter{\upm@package@docclazz@hidesec@a{\string\part}}
283         \gdef\chapterstar{\upm@package@docclazz@hidesec@a{\string\part*}}
284         \gdef\chaptertoc{\upm@package@docclazz@hidesec@a{\string\parttoc}}
285
286 \fi\fi
287
288 \endinput