Ticket #666: romsaf.cls

File romsaf.cls, 27.9 KB (added by Ian Culverwell, 4 years ago)

romsaf.cls

Line 
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2% %
3% romsaf.cls %
4% ----------- %
5% %
6% A LaTeX class for ROM SAF documents, v0.2 [2005/10/20]. %
7% %
8% C. Marquardt, Met Office, Exeter #
9
10% Updated S Syndegaard, DMI and H Lewis Met Office [2009/10/20] v0.3
11% - use of san-serif as font default
12% - some font-size changes on the front-page
13% - inclusion of new ROM SAF logos.
14% %
15% %
16% Options and default settings %
17% ---------------------------- %
18% %
19% This class is derived from the KOMA Script classes. Thus, (nearly) all %
20% options that can be given to any KOMA class can also be given to this %
21% document class. %
22% %
23% However, some defaults are different to the KOMA Script classes. In %
24% particular, the document will be two sided; to obtain one sided output, %
25% the option %
26% %
27% oneside %
28% %
29% must be specified in the \documentclass command. Also, all headings will %
30% will be produced using the smallheadings option of KOMA Script; any other %
31% choice must be requested by giving either the %
32% %
33% bigheadings %
34% %
35% or %
36% %
37% normalheadings %
38% %
39% options to the \documentclass command. As with KOMA, the default page %
40% size is A4 (but can be changed with, e.g., the usual ...paper options). %
41% %
42% %
43% KOMA base class %
44% --------------- %
45% %
46% The default base class used by romsaf is the scrreprt document class, %
47% corresponding to the report document class in plain LaTeX. Instead, the %
48% scrartcl and scrbook classes (corresponding to the article and book classes %
49% of standard LaTeX) can be choosen by specifying the options %
50% %
51% article %
52% %
53% and %
54% %
55% book %
56% %
57% in the \documentclass command, respectively. Note that the romsaf document %
58% class has been developed with a relatively recent version of the KOMA script %
59% document classes. Therefore, it is desireable that the most recent versions %
60% of KOMA script are available in the user's TeX / LaTeX installation. %
61% %
62% %
63% Additional packages used %
64% ------------------------ %
65% %
66% This class also uses (and therefore requires) the following LaTeX packages: %
67% %
68% geometry %
69% ifthen %
70% calc %
71% %
72% Note that, as with the KOMA script classes, it is sensible to make sure %
73% that the most recent version is installed; otherwise, this document class %
74% might not work properly. %
75% %
76% %
77% Page layout, headers and footers %
78% -------------------------------- %
79% %
80% The page layout is constructed using the geometry package, but not with %
81% KOMA's own layout engine. As a consequence, the DIV and BCORR options %
82% available in KOMA have no effect, and should probably not be specified. %
83% %
84% Note that the size of the text body (including header and footer) is %
85% hardwired in this document class, and cannot be changed. Similarly, the %
86% layout of the headers and footers is not intended to be changed. The %
87% header's content can be set by the following commands provided by the %
88% romsaf class: %
89% %
90% \DocTitle{...} Title, to appear on the title page %
91% \DocShortTitle{...} Short title, to appear in the header %
92% \DocReference{...} Reference ID, to appear in the header %
93% \DocVersion{...} Document version, to appear in title and header %
94% \DocDate{...} Document date, to appear in title and header %
95% %
96% %
97% Signature and document change tables %
98% ------------------------------------ %
99% %
100% Both a Document Signature Table and a Document Change Record table will be %
101% typeset on the backtitle (i.e., the second page immediately after the %
102% title). The entries for the Document Signature Table are defined using %
103% the following two commands: %
104% %
105% \PreparedBy{<name>}{<function>} %
106% \ReviewedBy{<name>}{<function>} %
107% \ApprovedBy{<name>}{<function>} %
108% %
109% where the mandatory arguments <name> and <function> denote the author(s) %
110% or persons being involved in the relevant task (e.g., A.U. Thor) and their %
111% function (e.g., ROM SAF Project Manager). %
112% %
113% The Document Change Record table is generated through a series of the %
114% command %
115% %
116% \DocChange{<version>}{<date>}{<by>}{<description>}
117%
118% %
119% with the obvious meaning of the mandatory arguments. %
120% %
121% %
122% Continued figures and tables %
123% ---------------------------- %
124% %
125% When typesetting long tables or including several subfigures into one, %
126% the resulting table or figure may spread out over several pages. The %
127% commands %
128% %
129% \continuedtable %
130% \continuedfigure %
131% %
132% placed inside a table or figure environment and before the next \caption %
133% will reduce the table or figure counter and therefore allow the creation %
134% of 'continued' tables or figures. However, the caption text itself must %
135% be manually adapted, e.g. to include a '(cont'd)' at the end of the %
136% caption text. %
137% %
138% Note that the longtable package provides an alternative for multipage %
139% tables, although these are no longer handled as ordinary floats. %
140% %
141% %
142% Example %
143% ------- %
144% %
145% The ROPP User Guide contains the following declarations: %
146% %
147% \documentclass{romsaf} %
148% %
149% ... %
150% %
151% \DocTitle{The Radio Occultation Processing Package (ROPP)\\ %
152% User Guide} %
153% \DocAuthor{Me and Him} (optional, default the ROM SAF consortium) %
154% \DocShortTitle{ROPP User Guide} %
155% \DocReference{SAF/ROM/METO/UG/ROPP/01} %
156% \DocVersion{Version 0.1} %
157% \DocDate{22 October 2004} %
158% %
159% ... %
160% %
161% \PreparedBy{C. Marquardt}{Research Scientist} %
162% \PreparedBy{D. Offiler}{ROM SAF Project Team} %
163% \ApprovedBy{K.--B. Lauritsen}{ROM SAF Project Manager} %
164% %
165% ... %
166% %
167% \DocChange{Version 0.0}{25 Oct 2004}{Him}{Initial structure} %
168% \DocChange{Version 1.0}{29 Oct 2004}{Me}{Initial revision} %
169% %
170% ... %
171% %
172% \begin{document} %
173% %
174% ... %
175% %
176% \end{document} %
177% %
178%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179
180% 1. Formalities
181% --------------
182
183\NeedsTeXFormat{LaTeX2e}[1995/12/01]
184\ProvidesClass{romsaf}[2009/10/20 ROM SAF report class v0.3]
185
186% 2. Options
187% ----------
188
189% KOMA base class
190
191\newif\if@chapters\@chapterstrue
192\newcommand*{\komaclass}{scrreprt}
193\DeclareOption{article}{\renewcommand{\komaclass}{scrartcl}\@chaptersfalse}
194\DeclareOption{book}{\renewcommand{\komaclass}{scrbook}}
195
196% 2.0 Use san-serif as font default.
197
198\renewcommand{\familydefault}{\sfdefault}
199
200% 2.1 Make twoside the default (to be switched with oneside)
201
202\newif\if@twoside\@twosidetrue
203\DeclareOption{oneside}{\@twosidefalse}
204
205% 2.2 Make smallheadings the default
206
207\newif\if@bigheadings\@bigheadingsfalse
208\newif\if@normalheadings\@normalheadingsfalse
209\newif\if@smallheadings\@smallheadingstrue
210\DeclareOption{bigheadings}{\@smallheadingsfalse\@bigheadingstrue}
211\DeclareOption{normalheadings}{\@smallheadingsfalse\@normalheadingstrue}
212\DeclareOption{smallheadings}{\@smallheadingstrue}
213
214% 2.3 Userguide layout option
215
216\newif\if@userguide\@userguidefalse
217\DeclareOption{userguide}{\@userguidetrue}
218
219% 2.4 Pass everything else to KOMA
220
221\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\komaclass}}
222
223% 2.5 Other (hardwired) defaults
224
225\PassOptionsToClass{pointlessnumbers,cleardoublestandard,bibtotoc}{\komaclass}
226
227% 2.6 Process options
228
229\ProcessOptions\relax
230
231% 2.7 Set defaults
232
233\if@twoside
234 \PassOptionsToPackage{twoside}{geometry}
235\fi
236\if@smallheadings
237 \PassOptionsToClass{smallheadings}{\komaclass}
238\else
239 \if@normalheadings
240 \PassOptionsToClass{normalheadings}{\komaclass}
241 \fi
242\fi
243
244% 2.8 Load the KOMA class
245
246\LoadClass{\komaclass}[2004/01/07]
247
248% 2.9 Page layout package
249
250\if@userguide
251 \RequirePackage[total={17cm,27.5cm},heightrounded,includemp,
252 includeheadfoot,head=12mm,headsep=8mm,footskip=11mm,
253 dvips,bindingoffset=12mm]{geometry}
254\else
255 \RequirePackage[total={17cm,27.5cm},heightrounded,
256 includeheadfoot,head=12mm,headsep=8mm,footskip=11mm,
257 dvips,bindingoffset=12mm]{geometry}
258\fi
259
260% 2.10 Header package
261
262\RequirePackage[manualmark]{scrpage2}
263\PassOptionsToPackage{oneside}{scrpage}
264
265% 2.11 Other packages
266
267\RequirePackage{ifthen}
268\RequirePackage{calc}
269\RequirePackage{graphicx}
270\RequirePackage{colortbl}[2001/02/13]
271
272% 3. Define new commands for headers and footers
273% ----------------------------------------------
274
275\newcommand\@DocTitle{UNKNOWN}
276\newcommand\@DocAuthor{\textbf{The ROM SAF Consortium} \\
277 Danish Meteorological Institute (DMI)\\
278 European Centre for Medium-Range Weather Forecasts (ECMWF)\\
279 Institut d'Estudis Espacials de Catalunya (IEEC)\\ %%% '-hack
280 Met Office (MetO)}
281\newcommand\@DocShortTitle{UNKNOWN}
282\newcommand\@DocReference{UNKNOWN}
283\newcommand\@DocVersion{UNKNOWN}
284\newcommand\@DocDate{UNKNOWN}
285
286\newcommand\DocTitle[1]{\renewcommand\@DocTitle{#1}}
287\newcommand\DocAuthor[1]{\renewcommand\@DocAuthor{#1}}
288\newcommand\DocShortTitle[1]{\renewcommand\@DocShortTitle{#1}}
289\newcommand\DocReference[1]{\renewcommand\@DocReference{#1}}
290\newcommand\DocVersion[1]{\renewcommand\@DocVersion{#1}}
291\newcommand\DocDate[1]{\renewcommand\@DocDate{#1}}
292
293% 4. Define ROM SAF headers and footers
294% -------------------------------------
295%
296% Note: By default, the \chapter command resets the pagestyle to plain,
297% so we have to redefine the \chapterpagestyle.
298
299\newlength{\hfwidth}
300\if@userguide
301 \setheadwidth[0pt]{textwithmarginpar}
302 \setfootwidth[0pt]{textwithmarginpar}
303 \setlength{\hfwidth}{\textwidth+\marginparwidth+\marginparsep}
304\else
305 \setheadwidth[0pt]{text}
306 \setfootwidth[0pt]{text}
307 \setlength{\hfwidth}{\textwidth}
308\fi
309
310\deftripstyle{romsaf}[0.0pt][0.4pt]%
311 {\parbox[b][10mm][c]{0.27\hfwidth}%
312 {\fontsize{9pt}{10pt}\selectfont\normalfont\centering%
313 \@DocReference\\
314 \@DocVersion\\
315 \@DocDate
316 }}%
317 {\parbox[b][10mm][c]{0.4\hfwidth}%
318 {\fontsize{10pt}{11pt}\bf\centering%
319 \@DocShortTitle}\\}%
320% {\includegraphics[height=8mm]{ROMSAF_noName_Colour_Small.eps}}%%%
321 {\includegraphics[height=8mm]{ROMSAF_NoName_Colour.eps}}%%%
322 {}{\pagemark}{}
323
324
325\pagestyle{romsaf}
326
327
328\if@chapters
329 \renewcommand*{\chapterpagestyle}{romsaf}
330\fi
331
332
333% 5. Title page
334% -------------
335
336% Redefine the "empty" page style (which is used for the title page):
337%\deftripstyle{empty}{}{}{}
338% {\fontsize{10pt}{11pt}\selectfont\normalfont Ref: \@DocReference}{}{}%
339%%\defpagestyle{empty}{{}{}{}}%
340%% {{X}{\fontsize{10pt}{11pt}\selectfont\normalfont\@DocReference}{Y}}
341
342% The title page has to be named "empty".
343% Redefine using defpagestyle, which is formatted as follows:
344%\defpagestyle{empty}% (ull, ulw) even page odd page all page (lll, llw)
345% {(\textwidth,1.0pt){\centering Header X}{\centering Header Y}{\centering Header Z}(\textwidth,0.5pt)}% define header
346% {(\textwidth,0.5pt){\centering Footer X}{\centering Footer Y}{\centering Footer Z}(\textwidth,1.0pt)}% define footer
347
348\defpagestyle{empty}%
349 {(\textwidth,0pt)%
350 {}%
351 {}%
352 {}%
353 (\textwidth,0pt)%
354 }% define header
355 %
356 {(\textwidth,0.0pt)%
357 {\parbox[b][10mm][c]{\textwidth}{\centering \hfill \\ \hrulefill \\ \fontsize{10pt}{11pt}\selectfont\normalfont 2}\\}%
358 {\fontsize{10pt}{11pt}\selectfont\normalfont Ref: \@DocReference \hfill}%
359 {}%
360 (\textwidth,0pt)%
361 }% define footer
362
363\pagestyle{empty}
364
365
366\titlehead{}
367\subject{\hspace{-1cm}\includegraphics[width=0.77\textwidth]{ROMSAF_Name_Colour.eps} \vspace{2cm}}
368%\title{\fontsize{20pt}{20pt}\selectfont\bfseries {\bf EUMETSAT Satellite Application Facility \\ on Radio Occultation Meteorology} \\[2cm] \LARGE {\bf \@DocTitle}}
369\title{\fontsize{20pt}{20pt}\selectfont\bfseries \LARGE {\bf \@DocTitle}}
370%\author{\@DocVersion\let\footnotemark\relax\thanks{\@DocReference}}
371\author{\bf\LARGE \@DocVersion}
372\date{\bf\LARGE \@DocDate\\[-1cm] \ }
373%\publishers{\@DocAuthor\\[-1cm]
374%vspace{2cm}\hspace{14cm}\includegraphics[height=3cm]{romsaf_logo.eps}\vspace{-4cm}}
375\publishers{\@DocAuthor\\[-1cm]}
376
377
378% 6. The backtitle
379% ----------------
380
381% 6.1 A strut for the tables
382
383\newlength\lstrutlength
384\setlength{\lstrutlength}{\baselineskip/\baselinestretch}
385\addtolength{\lstrutlength}{1.5mm}
386\newcommand\lstrut{\rule[-2mm]{0mm}{\lstrutlength}}
387
388% 6.2 Document signature table commands
389
390\newcommand\@PreparedBy{UNKNOWN}
391\newcommand\@ReviewedBy{UNKNOWN}
392\newcommand\@ApprovedBy{UNKNOWN}
393\newcommand\@PreparedFunc{UNKNOWN}
394\newcommand\@ReviewedFunc{UNKNOWN}
395\newcommand\@ApprovedFunc{UNKNOWN}
396
397\newcommand\PreparedBy[2]{%
398 \renewcommand\@PreparedBy{#1}
399 \renewcommand\@PreparedFunc{#2}
400 }
401\newcommand\ReviewedBy[2]{%
402 \renewcommand\@ReviewedBy{#1}
403 \renewcommand\@ReviewedFunc{#2}
404 }
405\newcommand\ApprovedBy[2]{%
406 \renewcommand\@ApprovedBy{#1}
407 \renewcommand\@ApprovedFunc{#2}
408 }
409
410% \newcommand\PreparedBy[2][Signature file missing]{%
411% \ifthenelse{\equal{#1}{Signature file missing}}%
412% {\renewcommand{\@PreparedSig}{#1}}%
413% {\renewcommand{\@PreparedSig}{\raisebox{-0.4\lstrutlength}{\includegraphics[totalheight=\lstrutlength]{#1}}}}
414% \renewcommand\@PreparedBy{#2}
415% }
416% \newcommand\ApprovedBy[2][Signature file missing]{%
417% \ifthenelse{\equal{#1}{Signature file missing}}%
418% {\renewcommand{\@ApprovedSig}{#1}}%
419% {\renewcommand{\@ApprovedSig}{\raisebox{-0.4\lstrutlength}{\includegraphics[totalheight=\lstrutlength]{#1}}}}
420% \renewcommand\@ApprovedBy{#2}
421% }
422
423% 6.3 Document change record command
424
425\newcounter{dcc}\setcounter{dcc}{0}
426\newcommand\DC@rows{}
427\newcommand\DocChange[4]{%
428 \addtocounter{dcc}{1}
429 \@temptokena=\expandafter{\DC@rows}
430 \xdef\DC@rows{\the\@temptokena #1\noexpand\lstrut\protect& #2\protect&
431 #3\protect& #4\protect\tabularnewline
432 \noexpand\hline}
433 }
434
435% 6.4 The tables
436
437\uppertitleback{%
438
439 \begin{center}
440 \vspace*{-25mm}
441
442% {{\includegraphics[height=8mm]{ROMSAF_noName_Colour_Small.eps}}\hfill%
443 {{\includegraphics[height=8mm]{ROMSAF_NoName_Colour.eps}}\hfill%
444 {\parbox[b][10mm][c]{0.4\hfwidth}{\fontsize{10pt}{11pt}\bf\centering \@DocShortTitle}}\hfill%
445 {\parbox[b][10mm][c]{0.27\hfwidth}{\fontsize{9pt}{10pt}\selectfont\normalfont\centering \@DocReference\\ \@DocVersion\\ \@DocDate}}}
446
447 \vspace*{-3.5mm}
448 \noindent\makebox[\linewidth]{\rule{\textwidth}{0.4pt}}
449
450 \vspace*{1.5cm}
451
452 \begin{tabularx}{\textwidth}[c]{|>{\columncolor[gray]{0.95}}r|l|l|c|X|}
453 \multicolumn{5}{c}{\rule[-5mm]{0cm}{5mm}\bf Document Author Table} \\
454 \hline
455 \multicolumn{1}{|>{\cellcolor[gray]{0.95}}c|}{} &
456 \multicolumn{1}{|>{\cellcolor[gray]{0.95}}c|}{\bf\emph{Name}} &
457 \multicolumn{1}{>{\cellcolor[gray]{0.95}}c|}{\bf\emph{Function}} &
458 \multicolumn{1}{>{\cellcolor[gray]{0.95}}c|}{\bf\emph{Date}} &
459 \multicolumn{1}{>{\cellcolor[gray]{0.95}}c|}{\bf\emph{Comment}} \\
460 \hline
461 {\bf\emph{Prepared by:}} &
462 \@PreparedBy &
463 \@PreparedFunc &
464 \@DocDate & \\
465 \hline
466 {\bf\emph{Reviewed by:}} &
467 \@ReviewedBy &
468 \@ReviewedFunc &
469 \@DocDate & \\
470 \hline
471 {\bf\emph{Approved by:}} &
472 \@ApprovedBy &
473 \@ApprovedFunc &
474 \@DocDate & \\
475 \hline
476 \end{tabularx}
477
478 \vspace*{1cm}
479
480 \begin{tabularx}{\textwidth}[c]{|c|r|c|X|}
481 \multicolumn{4}{c}{\rule[-5mm]{0cm}{5mm}\bf Document Change Record} \\
482 \hline
483 \multicolumn{1}{|>{\cellcolor[gray]{0.95}}c|}{\bf\emph{Issue/Revision}} &
484 \multicolumn{1}{>{\cellcolor[gray]{0.95}}c|}{\bf\emph{Date}} &
485 \multicolumn{1}{>{\cellcolor[gray]{0.95}}c|}{\bf\emph{By}} &
486 \multicolumn{1}{>{\cellcolor[gray]{0.95}}c|}{\bf\emph{Description}} \\
487 \hline
488 \ifnum\value{dcc}=0
489 \lstrut & & \\
490 \else
491 \DC@rows
492 \fi
493 \hline
494 \end{tabularx}
495
496% \vfill
497% \hrulefill
498% {\hfill {\parbox[t][10mm][c]{0.27\hfwidth}{\fontsize{9pt}{10pt}\selectfont\normalfont\centering 2}} \hfill}
499
500 \end{center}
501}
502
503% 6.5 The blurb
504
505\lowertitleback{%
506
507\vspace*{0.5cm}
508
509\begin{center} {\bf ROM SAF} \\ \end{center}
510
511The Radio Occultation Meteorology Satellite Application Facility (ROM SAF) is a
512decentralised processing centre under EUMETSAT which is responsible for operational
513processing of radio occultation (RO) data from the Metop and Metop-SG satellites and radio
514occultation data from other missions. The ROM SAF delivers bending angle, refractivity,
515temperature, pressure, humidity, and other geophysical variables in near real-time for NWP
516users, as well as reprocessed Climate Data Records (CDRs) and Interim Climate Data Records
517(ICDRs) for users requiring a higher degree of homogeneity of the RO data sets. The CDRs
518and ICDRs are further processed into globally gridded monthly-mean data for use in climate
519monitoring and climate science applications.\\
520
521The ROM SAF also maintains the Radio Occultation Processing Package (ROPP) which contains
522software modules that aid users wishing to process, quality-control and assimilate radio
523occultation data from any radio occultation mission into NWP and other models.\\
524
525The ROM SAF Leading Entity is the Danish Meteorological Institute (DMI), with Cooperating
526Entities: i) European Centre for Medium-Range Weather Forecasts (ECMWF) in Reading, United
527Kingdom, ii) Institut D'Estudis Espacials de Catalunya (IEEC) in Barcelona, Spain, and
528iii) Met Office in Exeter, United Kingdom. To get access to our products or to read more
529about the ROM SAF please go to: \url{http://www.romsaf.org}.
530
531\vspace*{0.5cm}
532
533\begin{center} {\bf Intellectual Property Rights} \\ \end{center}
534
535All intellectual property rights of the ROM SAF products belong to EUMETSAT. The use of
536these products is granted to every interested user, free of charge. If you wish to use
537these products, EUMETSAT's copyright credit must be shown by displaying the words
538``copyright (year) EUMETSAT'' on each of the products used.
539}
540
541\pagestyle{romsaf} % Go back to the general page layout
542
543% 7. Switch to userguide layout and back
544% --------------------------------------
545
546\newcommand*{\userguidelayout}{%
547 \changetext{}%
548 {-\marginparwidth-\marginparsep}%
549 {}%
550 {}%
551 {}%
552 }
553\newcommand*{\standardlayout}{\changetext{}{\marginparwidth+\marginparsep}{}{}{}}
554
555% 8. Margin texts
556% ---------------
557
558\newcommand{\margintext}[1]{\mbox{}\marginpar{\raggedleft\small\hspace{0pt\emph{\color{cyan}#1}}}}
559
560% 9. Continued figures and tables
561% -------------------------------
562
563\providecommand{\continuedtable}{\addtocounter{table}{-1}}
564\providecommand{\continuedfigure}{\addtocounter{figure}{-1}}
565
566% 10. More changes to the default behaviour
567% -----------------------------------------
568
569\frenchspacing
570\setkomafont{sectioning}{\normalcolor\bfseries}
571\addtokomafont{caption}{\small}
572\newlength{\captionwidth}
573\setlength{\captionwidth}{\hsize}
574\addtolength{\captionwidth}{-2cc}
575\setcapwidth[c]{\captionwidth}
576\setcapindent{0pt}
577\renewcommand{\figurename}{Fig.}
578\renewcommand{\figureformat}{\bfseries\figurename~\thefigure\autodot}
579\renewcommand{\tablename}{Tab.}
580\renewcommand{\tableformat}{\bfseries\tablename~\thetable\autodot}