5 % Auxiliary package to format *.dtx documents.
7 % Copyright (c) 2008, 2009 CV Radhakrishnan <cvr@river-valley.org>,
9 % This file may be distributed and/or modified under the conditions
10 % of the LaTeX Project Public License, either version 1.2 of this
11 % license or (at your option) any later version. The latest version
12 % of this license is in:
14 % http://www.latex-project.org/lppl.txt
16 % and version 1.2 or later is part of all distributions of LaTeX
17 % version 1999/12/01 or later.
20 \newcounter{colorscheme}
22 \newif\if@xcolor \@xcolorfalse
23 \newif\if@mylogo \@mylogofalse
25 \DeclareOption{mylogo}{\global\@mylogotrue}
26 \DeclareOption{green}{\setcounter{colorscheme}{1}}
27 \DeclareOption{orange}{\setcounter{colorscheme}{0}}
28 \DeclareOption{xcolor}{\global\@xcolortrue}
29 \DeclareOption{qone}{\AtEndOfPackage{\global\let\dtxmark\dtxmarkone}}
30 \DeclareOption{qtwo}{\AtEndOfPackage{\global\let\dtxmark\dtxmarktwo}}
33 \def\loadXcolor{\if@xcolor\RequirePackage[dvipsnames,svgnames]{xcolor}\fi}
36 \ifcase\thecolorscheme
38 % Orange color spec (default)
40 \colorlet{itemcolor}{brown}
41 \colorlet{verbcolor}{Sepia}
42 \colorlet{botrulecolor}{orange!25}
43 \colorlet{botbgcolor}{orange!15}
44 \colorlet{botcolor}{orange!80}
45 \colorlet{pgrulecolor}{orange}
46 \colorlet{pgbgcolor}{white}
48 \colorlet{quicklinkrulecolor}{orange!40}
49 \colorlet{quicklinkcolor}{brown}
50 \colorlet{topverticalrule}{brown}
51 \colorlet{titlecolor}{brown}
52 \colorlet{hlinkcolor}{brown}
53 \colorlet{hlinktricolor}{orange!70}
54 \colorlet{linkcolor}{brown}
55 \colorlet{urlcolor}{brown}
57 % \colorlet{arrayrulecolor}{olive!30}
58 \colorlet{seccolor}{brown}
60 \colorlet{toprulecolor}{orange!30}
61 \colorlet{topbgcolor}{orange!10}
62 \colorlet{topcolor}{brown!80}
65 \or% Green color specs
68 \colorlet{itemcolor}{OliveGreen}
69 \colorlet{verbcolor}{OliveGreen}
70 \colorlet{botrulecolor}{GreenYellow!25}
71 \colorlet{botbgcolor}{GreenYellow!30}
72 \colorlet{botcolor}{Green!80}
73 \colorlet{pgrulecolor}{GreenYellow}
74 \colorlet{pgbgcolor}{white}
76 \colorlet{quicklinkrulecolor}{Green!40}
77 \colorlet{quicklinkcolor}{Green}
78 \colorlet{topverticalrule}{Green}
79 \colorlet{titlecolor}{DarkOliveGreen}
80 \colorlet{hlinkcolor}{DarkOliveGreen}
81 \colorlet{hlinktricolor}{Green!70}
82 \colorlet{linkcolor}{OliveGreen}
83 \colorlet{urlcolor}{OliveGreen}
85 % \colorlet{arrayrulecolor}{olive!30}
86 \colorlet{seccolor}{OliveGreen}
88 \colorlet{toprulecolor}{GreenYellow!50}
89 \colorlet{topbgcolor}{GreenYellow!20}
90 \colorlet{topcolor}{GreenYellow!80}
93 \def\floatpagefraction{.99}
101 %\DeclareRobustCommand{\LaTeX}{L\kern-.25em%
105 % \fontsize\sf@size\z@
106 % \math@fontsfalse\selectfont
112 \DeclareRobustCommand{\LaTeX}{L\kern-.25em%
118 \math@fontsfalse\selectfont
125 \RequirePackage{pdfwidgets}
127 \RequirePackage{comment,xspace}
128 \def\xml{\textsc{xml}\xspace}
129 \def\latex{\LaTeX\xspace}
130 \def\pdf{\textsc{pdf}\xspace}
131 \def\pdfa{\textsc{pdf/a-1}b\xspace}
132 \def\pdfx{\textsc{pdf/x-1}a\xspace}
133 \def\xmp{\textsc{xmp}\xspace}
134 \def\pdftex{\textsc{pdf\TeX}\xspace}
135 \def\defmacro#1{\texttt{\@bsl#1}}
136 \def\thanh{H\`an Th\^e Th\`anh\xspace}
137 \def\gnulinux{\textsc{gnu/linux}\xspace}
139 \let\@DRAFTout@Hook\@empty
140 \newcommand{\DRAFTout}{\g@addto@macro\@DRAFTout@Hook}
141 \newcommand{\@DRAFTout@Out}{%
142 \afterassignment\@DRAFTout@Test
143 \global\setbox\@cclv=
145 \newcommand{\@DRAFTout@Test}{%
147 \aftergroup\@DRAFTout@Output
152 \newcommand{\@DRAFTout@Output}{%
154 \@DRAFTout@Org@Out\box\@cclv%
156 \newcommand{\@DRAFTout@Org@Out}{}
157 \newcommand*{\@DRAFTout@Init}{%
158 \let\@DRAFTout@Org@Out\shipout
159 \let\shipout\@DRAFTout@Out
162 \setlength\OHeight{\textheight}
163 \addtolength\OHeight{\headheight}
164 \addtolength\OHeight{\headsep}
165 \addtolength\OHeight{\footskip}
168 \newif\ifoverlay\overlayfalse
170 \AtBeginDocument{\@DRAFTout@Init}
171 \newcommand{\@DraftOverlay@Hook}{}
172 \newcommand{\AddToDraftOverlay}{\g@addto@macro\@DraftOverlay@Hook}
173 \newcommand{\ClearDraftOverlay}{\let\@DraftOverlay@Hook\@empty}
174 \newcommand{\@DraftOverlay}{%
175 \ifx\@DraftOverlay@Hook\@empty
179 \@tempcnta=\@tempdima
180 \@tempcntb=-\@tempdima
181 \advance\@tempcntb\paperheight
183 \global\setbox\@cclv\vbox{%
185 \vbox{\let\protect\relax%
187 \pictur@(0,0)(\strip@pt\@tempdima,\strip@pt\@tempdimb)%
191 \global\setbox\@cclv\vbox{%
192 \vbox{\let\protect\relax%
194 \pictur@(0,0)(\@tempcnta,\@tempcntb)%
203 \definecolor{gray30}{gray}{.7}
204 \definecolor{gray20}{gray}{.8}
205 \definecolor{gray10}{gray}{.9}
207 \DRAFTout{\@DraftOverlay}
208 \long\def\puttext(#1)#2{\AddToDraftOverlay{%
209 \setlength{\unitlength}{1pt}\thinlines%
212 \RequirePackage{shortvrb}
214 \RequirePackage{amsfonts,amssymb}
215 \IfFileExists{pxfonts.sty}{\RequirePackage{pxfonts}}{}
216 %\IfFileExists{charter.sty}{\RequirePackage{charter}}{}
217 \IfFileExists{lfr.sty}{\RequirePackage[scaled=.85]{lfr}}{}
218 %\IfFileExists{prima.sty}{\RequirePackage[scaled=.8]{prima}}{}
220 \def\theCodelineNo{\reset@font\tiny\arabic{CodelineNo}}
222 \def\@seccntformat#1{\llap{\csname the#1\endcsname.\hspace*{6pt}}}
223 \def\section{\@startsection {section}{1}{\z@}%
224 {-3.5ex \@plus -1ex \@minus -.2ex}%
226 {\normalfont\large\bfseries\color{seccolor}}}
227 \def\subsection{\@startsection{subsection}{2}{\z@}%
228 {-2.25ex\@plus -1ex \@minus -.2ex}%
230 {\normalfont\normalsize\bfseries\color{seccolor}}}
231 \def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
232 {-1.25ex\@plus -1ex \@minus -.2ex}%
234 {\normalfont\normalsize\bfseries\color{seccolor}}}
236 %\RequirePackage[draft]{pdfdraftcopy}
238 \puttext(0,36){\botstring}%
239 \puttext(0,840){\copy\topbox}
241 \puttext(531,829){\cvrlogo}
244 \RequirePackage{colortbl}
245 %\arrayrulecolor{arrayrulecolor}
247 \def\hline{\noalign{\vskip3pt}\shline\noalign{\vskip4pt}}
249 \RequirePackage[pdftex,colorlinks]{hyperref}
250 \def\Hlink#1#2{\hyperlink{#2}{\color{hlinktricolor}%
251 $\blacktriangleright$~\color{hlinkcolor}#1}}
252 \def\@linkcolor{linkcolor}
253 \def\@urlcolor{urlcolor}
256 \def\version#1{\gdef\@version{#1}}
258 \def\contact#1{\gdef\@contact{#1}}
259 \def\author#1{\gdef\@author{#1}}
260 \def\@author{River Valley Technologies}
261 \def\@contact{\texttt{support@river-valley.com}}
262 \def\keywords#1{\gdef\@keywords{#1}}
263 \def\@keywords{\LaTeX, \xml}
265 \long\def\Hrule{\\[-4pt]\hspace*{-3em}%
266 {\color{quicklinkrulecolor}\rule{\linewidth}{.1pt}}\\}
268 \long\def\dtxmarkone[#1][#2]#3#4#5{\def\next{#1}%
269 \ifcase\next\or\Hlink{#4}{#3}\Hrule \fi}
273 \long\def\dtxmarktwo[#1][#2]#3#4#5{\def\next{#1}%
274 \stepcounter{dtx}\parbox{.45\linewidth}%
275 {\ifcase\next\or\Hlink{#4}{#3}\fi}%
276 \ifodd\thedtx\relax\else\Hrule\fi}
278 \let\dtxmark\dtxmarkone
281 \long\def\maketitle{\global\setbox\topbox=\vbox{\hsize=\paperwidth
283 \fcolorbox{toprulecolor}{topbgcolor}%
284 {\parbox[t][2in][c]{\paperwidth}%
286 \parbox[c]{.35\paperwidth}{\fontsize{18pt}{20pt}%
287 \raggedright\normalfont\sffamily \selectfont
288 \color{titlecolor} \@title\\[6pt]
289 {\normalsize\rmfamily\scshape\@author}}%
290 % {\footnotesize\textsc{keywords:} \@keywords}}%
292 \parbox[c][2in][c]{1mm}{\color{topverticalrule}%
295 \parbox[c][2in][c]{.35\paperwidth}%
296 {\normalfont\footnotesize\sffamily\color{quicklinkcolor}%
297 \vspace*{6pt} QUICK LINKS\Hrule
298 \IfFileExists{tmp.out}{\input tmp.out}{}%
304 \gdef\botstring{\fcolorbox{botrulecolor}{botbgcolor}%
305 {\parbox[t][.5in][t]{\paperwidth}%
306 {\normalfont\sffamily\footnotesize%
308 \hspace*{5mm}\parbox[c][.5in][c]{.45\paperwidth}%
309 {\raggedright \textcopyright\ 2009, Elsevier Ltd.
310 % \href{http://www.river-valley.com}{%
311 % http://www.river-valley.com}\\
312 % \textsc{sjp} Building, Cotton Hills, Trivandrum
313 % 695014, India\\ 9, Browns Court, Kennford,
314 % Exeter, United Kingdom
315 Bugs, feature requests, suggestions and comments\\
316 shall be mailed to \href{mailto:elsarticle@river-valley.com}
317 {$<$elsarticle@river-valley.com$>$}.
319 \parbox[c][.5in][c]{1cm}
320 {\centering\sffamily\mdseries
321 \fcolorbox{pgrulecolor}{pgbgcolor}{\thepage}%
323 \parbox[c][.5in][c]{.45\paperwidth}
324 {\raggedleft\begin{tabular}{rl}%
328 \end{tabular}\hspace*{5mm}%
334 \def\MacroFont{\fontencoding\encodingdefault
335 \fontfamily\ttdefault
336 \fontseries\mddefault
338 \color{verbcolor}\small}%
340 \def\verbatim@font{\normalfont\color{verbcolor}\ttfamily}
342 \def\verb{\relax\ifmmode\hbox\else\leavevmode\null\fi
344 \verb@eol@error \let\do\@makeother \dospecials
345 \verbatim@font\@noligs
346 \@ifstar\@sverb\@verb}
349 \def\@lbr{\expandafter\@gobble\string\{}
350 \def\@rbr{\expandafter\@gobble\string\}}
351 \def\@bsl{\expandafter\@gobble\string\\}
352 \def\@Bsl#1{\texttt{\@bsl#1}\xspace}
353 \def\trics#1{\protect\@Bsl{#1}}
354 \def\onecs#1{\protect\@Bsl{#1}}
356 \@ifundefined{c@Glossary}{}{\c@GlossaryColumns=1
359 \def\index@prologue{\section{Index}%
360 \markboth{Index}{Index}%
361 % Numbers written in italic refer to the page
362 % where the corresponding entry is described;
363 % numbers underlined refer to the
367 % definition; numbers in roman refer to the
373 % where the entry is used.
376 \@ifundefined{theglossary}{}{%
377 \renewenvironment{theglossary}{%
378 \glossary@prologue%][\GlossaryMin]%
379 \GlossaryParms \let\item\@idxitem \ignorespaces}%
382 \newenvironment{decl}[1][]%
383 {\par\small\addvspace{1.5ex plus 1ex}%
388 \def\@decl@date{\NEWfeature{#1}}%
390 \noindent%\hspace{-\leftmargini}%
391 \begin{tabular}{l}\hline\ignorespaces}%
392 {\\\hline\end{tabular}\nobreak\@decl@date\par\nobreak
393 \vspace{0.75ex}\vskip -\parskip\ignorespacesafterend\noindent}
395 \newif\ifhave@multicol
396 \newif\ifcodeline@index
398 \IfFileExists{multicol.sty}{\have@multicoltrue
399 \RequirePackage{multicol}%
402 \newdimen\IndexMin \IndexMin = 80pt
403 \newcount\c@IndexColumns \c@IndexColumns = 2
405 \renewenvironment{theindex}
406 {\begin{multicols}\c@IndexColumns[\index@prologue][\IndexMin]%
407 \IndexParms \let\item\@idxitem \ignorespaces}%
410 \typeout{Can't find multicol.sty -- will use normal index layout if
412 \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
413 \columnseprule \z@ \columnsep 35\p@
414 \twocolumn[\index@prologue]%
415 \IndexParms \let\item\@idxitem \ignorespaces}
416 \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
418 \long\def\IndexPrologue#1{\@bsphack\def\index@prologue{#1}\@esphack}
419 \@ifundefined{index@prologue}
420 {\def\index@prologue{\section{Index}%
421 \markboth{Index}{Index}%
422 % Numbers written in italic refer to the page
423 % where the corresponding entry is described;
424 % numbers underlined refer to the
428 % definition; numbers in roman refer to the
434 % where the entry is used.
436 \@ifundefined{IndexParms}
440 \parskip 0pt plus 1pt
445 \def\@idxitem{\par\hangindent 30pt}%
446 \def\subitem{\@idxitem\hspace*{15pt}}%
447 \def\subsubitem{\@idxitem\hspace*{25pt}}%
448 \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}%
450 \def\efill{\hfill\nopagebreak}%
451 \def\dotfill{\leaders\hbox to.6em{\hss .\hss}\hskip\z@ plus 1fill}%
452 \def\dotfil{\leaders\hbox to.6em{\hss .\hss}\hfil}%
453 \def\pfill{\unskip~\dotfill\penalty500\strut\nobreak
454 \dotfil~\ignorespaces}%
456 \let\scan@allowedfalse\relax
458 \def\tlformat#1{\begingroup\Large
459 \parbox[c][1.25em][c]{1.25em}{\centering\fontfamily{phv}
461 \selectfont\color{white}\huge#1}%
463 \def\tlFormat#1{\begingroup\Large
464 \parbox[c][1.25em][c]{1.25em}{\centering\fontfamily{phv}
466 \selectfont\color{black}\huge#1}%
468 \def\cvrlogo{\begingroup\fboxsep=2pt
469 \colorbox{olive}{\tlformat{c}}%
470 \colorbox{blue}{\tlformat{v}}%
471 \colorbox{red}{\tlformat{r}}
478 %% End of file 'rvdtx.sty'