1 % Document class for Unified Process Methodology
3 % Copyright (c) 2014 Stephane GALLAND <galland@arakhne.org>
5 % This program is free library; you can redistribute it and/or modify
6 % it under the terms of the GNU Lesser General Public License as
7 % published by the Free Software Foundation; either version 3 of the
8 % License, or any later version.
10 % This library is distributed in the hope that it will be useful, but
11 % WITHOUT ANY WARRANTY; without even the implied warranty of
12 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 % Lesser General Public License for more details.
15 % You should have received a copy of the GNU Lesser General Public
16 % License along with this library; see the file COPYING. If not,
17 % write to the Free Software Foundation, Inc., 59 Temple Place - Suite
18 % 330, Boston, MA 02111-1307, USA.
20 \global\edef\upm@package@docclazz@ver{2014/09/11}
22 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
23 \ProvidesClass{upmethodology-document}[\upm@package@docclazz@ver]
25 \RequirePackage{upmethodology-p-common}
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
38 \gdef\upm@package@docclazz@optionstopass{a4paper,11pt}
40 \DeclareOption{twoside}{%
41 \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,twoside,openright}%
43 \DeclareOption{oneside}{%
44 \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,oneside}%
47 \DeclareOption{french}{%
48 \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,french}%
49 \PassOptionsToPackage{french}{upmethodology-document}
51 \DeclareOption{francais}{%
52 \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,french}%
53 \PassOptionsToPackage{french}{upmethodology-document}
55 \DeclareOption{english}{%
56 \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,english}%
57 \PassOptionsToPackage{english}{upmethodology-document}
59 \DeclareOption{standardlists}{%
60 \message{*********** DISABLING UPMETHODOLOGY LISTS}
61 \PassOptionsToPackage{standardlists}{upmethodology-fmt}
64 \DeclareOption{nodocumentinfo}{%
65 \global\upm@package@docclazz@nodocinfotrue%
67 \DeclareOption{documentinfo}{%
68 \global\upm@package@docclazz@nodocinfofalse%
70 \DeclareOption{nopubpage}{%
71 \global\upm@package@docclazz@nopubpagetrue%
73 \DeclareOption{pubpage}{%
74 \global\upm@package@docclazz@nopubpagefalse%
76 \DeclareOption{nofrontmatter}{%
77 \global\upm@package@docclazz@autofrontmatterfalse%
79 \DeclareOption{frontmatter}{%
80 \global\upm@package@docclazz@autofrontmattertrue%
82 \DeclareOption{nofrontcover}{%
83 \global\upm@package@docclazz@addfrontcoverfalse%
85 \DeclareOption{frontcover}{%
86 \global\upm@package@docclazz@addfrontcovertrue%
88 \DeclareOption{nobackcover}{%
89 \global\upm@package@docclazz@addbackcoverfalse%
91 \DeclareOption{backcover}{%
92 \global\upm@package@docclazz@addbackcovertrue%
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}%
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}%
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}%
120 \xdef\upm@package@docclazz@optionstopass{\upm@package@docclazz@optionstopass,\CurrentOption}%
122 \ExecuteOptions{report}
123 \ProcessOptions*\relax
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}
132 \message{*********** UPMETHODOLOGY ARTICLE CLASS (WITHOUT PART AND CHAPTER)}
133 \expandafter\LoadClass[\upm@package@docclazz@optionstopass]{article}
136 \RequirePackage{a4wide}
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}
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},
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
177 \pdfpageheight=29.7cm
181 %----------------------------------------
182 % HEADERS AND FOOTERS
183 %----------------------------------------
185 \def\upm@header@fmt#1{\textsc{\scriptsize #1}}
186 \def\upm@copyright@fmt#1{\textsc{\tiny #1}}
188 \global\let\upm@package@docclazz@old@pagestyle\pagestyle
190 \gdef\upm@package@docclazz@saved@pagestyle{#1}%
191 \upm@package@docclazz@old@pagestyle{#1}%
193 \gdef\upm@package@docclazz@saved@pagestyle{headings}%
194 \upm@package@docclazz@old@pagestyle{headings}
196 \newdimen{\upm@smalllogo@height}
197 \upm@smalllogo@height=1cm
199 %----------------------------------------
200 % FRONT, MAIN AND BACK MATTERS
201 %----------------------------------------
203 \global\let\upm@package@docclazz@frontmatter\frontmatter
205 \upm@package@docclazz@old@pagestyle{headings}%
206 \pagenumbering{roman}%
207 \global\let\frontmatter\relax%
210 \global\let\upm@package@docclazz@mainmatter\mainmatter
212 \upm@package@docclazz@mainmatter%
213 \global\let\frontmatter\relax%
214 \global\let\mainmatter\relax%
217 \global\let\upm@package@docclazz@backmatter\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%
225 \upm@package@docclazz@appendix%
226 \global\@mainmattertrue%
230 %----------------------------------------
231 % AUTO-GENERATED DOCUMENT
232 %----------------------------------------
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%
243 \ifupm@package@docclazz@addbackcover\makebackcover\fi%
246 %----------------------------------------
248 %----------------------------------------
249 \gdef\upm@package@getcolor#1,#2,#3{#1 #2 #3}
251 \renewcommand{\setpdfcolor}[1]{
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
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}}%
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"}}
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}}
280 \ifupmreportformat\else
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}}