Debian Codegraph @

texmf-dist/doc/latex/elsarticle/rvdtx.sty

raw
1 %
2 %
3 % File: rvdtx.sty
4 %
5 % Auxiliary package to format *.dtx documents.
6 %
7 % Copyright (c) 2008-2026 CV Radhakrishnan <[email protected]>,
8 %
9 % This file may be distributed and/or modified under the conditions
10 % of the LaTeX Project Public License, either version 1.3 of this
11 % license or (at your option) any later version. The latest version
12 % of this license is in:
13 %
14 % http://www.latex-project.org/lppl.txt
15 %
16 % and version 1.3 or later is part of all distributions of LaTeX
17 % version 1999/12/01 or later.
18 %
19 %
20 \newcounter{colorscheme}
21
22 \newif\if@xcolor \@xcolorfalse
23 \newif\if@mylogo \@mylogofalse
24
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}}
31
32 \ProcessOptions
33 \def\loadXcolor{\if@xcolor\RequirePackage[dvipsnames,svgnames]{xcolor}\fi}
34
35 \loadXcolor
36 \ifcase\thecolorscheme
37 %
38 % Orange color spec (default)
39 %
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}
47
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}
56
57 % \colorlet{arrayrulecolor}{olive!30}
58 \colorlet{seccolor}{brown}
59
60 \colorlet{toprulecolor}{orange!30}
61 \colorlet{topbgcolor}{orange!10}
62 \colorlet{topcolor}{brown!80}
63 %
64 %
65 \or% Green color specs
66 %
67 %
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}
75
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}
84
85 % \colorlet{arrayrulecolor}{olive!30}
86 \colorlet{seccolor}{OliveGreen}
87
88 \colorlet{toprulecolor}{GreenYellow!50}
89 \colorlet{topbgcolor}{GreenYellow!20}
90 \colorlet{topcolor}{GreenYellow!80}
91 \fi
92
93 \def\floatpagefraction{.99}
94 \usepackage{geometry}
95 \geometry{top=2in,
96 bottom=1in,
97 left=2in,
98 right=1in,
99 a4paper}
100
101 %\DeclareRobustCommand{\LaTeX}{L\kern-.25em%
102 % {\sbox\z@ T%
103 % \vbox to\ht\z@{%
104 % {\check@mathfonts
105 % \fontsize\sf@size\z@
106 % \math@fontsfalse\selectfont
107 % A}%
108 % \vss}%
109 % }%-.10em%
110 % \TeX
111 %}
112 \DeclareRobustCommand{\LaTeX}{L\kern-.25em%
113 {\sbox\z@ T%
114 \vbox to\ht\z@{%
115 \hbox{%
116 \check@mathfonts
117 \fontsize\sf@size\z@
118 \math@fontsfalse\selectfont
119 A}%
120 \vss}%
121 }%
122 \kern-.10em%
123 \TeX}
124
125 \RequirePackage{pdfwidgets}
126
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}
138
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=
144 }
145 \newcommand{\@DRAFTout@Test}{%
146 \ifvoid\@cclv\relax
147 \aftergroup\@DRAFTout@Output
148 \else
149 \@DRAFTout@Output
150 \fi%
151 }
152 \newcommand{\@DRAFTout@Output}{%
153 \@DRAFTout@Hook%
154 \@DRAFTout@Org@Out\box\@cclv%
155 }
156 \newcommand{\@DRAFTout@Org@Out}{}
157 \newcommand*{\@DRAFTout@Init}{%
158 \let\@DRAFTout@Org@Out\shipout
159 \let\shipout\@DRAFTout@Out
160 }
161 \newdimen\OHeight
162 \setlength\OHeight{\textheight}
163 \addtolength\OHeight{\headheight}
164 \addtolength\OHeight{\headsep}
165 \addtolength\OHeight{\footskip}
166
167
168 \newif\ifoverlay\overlayfalse
169
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
176 \else
177 \bgroup
178 \@tempdima=1in
179 \@tempcnta=\@tempdima
180 \@tempcntb=-\@tempdima
181 \advance\@tempcntb\paperheight
182 \ifoverlay
183 \global\setbox\@cclv\vbox{%
184 \box\@cclv
185 \vbox{\let\protect\relax%
186 \unitlength=1pt%
187 \pictur@(0,0)(\strip@pt\@tempdima,\strip@pt\@tempdimb)%
188 \@DraftOverlay@Hook%
189 \endpicture}}%
190 \else
191 \global\setbox\@cclv\vbox{%
192 \vbox{\let\protect\relax%
193 \unitlength=1sp%
194 \pictur@(0,0)(\@tempcnta,\@tempcntb)%
195 \@DraftOverlay@Hook%
196 \endpicture}%
197 \box\@cclv}%
198 \fi
199 \egroup
200 \fi
201 }
202
203 \definecolor{gray30}{gray}{.7}
204 \definecolor{gray20}{gray}{.8}
205 \definecolor{gray10}{gray}{.9}
206
207 \DRAFTout{\@DraftOverlay}
208 \long\def\puttext(#1)#2{\AddToDraftOverlay{%
209 \setlength{\unitlength}{1pt}\thinlines%
210 \put(#1){#2}}}
211
212 \RequirePackage{shortvrb}
213 \MakeShortVerb{\|}
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}}{}
219
220 \def\theCodelineNo{\reset@font\tiny\arabic{CodelineNo}}
221
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}%
225 {2.3ex \@plus.2ex}%
226 {\normalfont\large\bfseries\color{seccolor}}}
227 \def\subsection{\@startsection{subsection}{2}{\z@}%
228 {-2.25ex\@plus -1ex \@minus -.2ex}%
229 {1.5ex \@plus .2ex}%
230 {\normalfont\normalsize\bfseries\color{seccolor}}}
231 \def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
232 {-1.25ex\@plus -1ex \@minus -.2ex}%
233 {1.5ex \@plus .2ex}%
234 {\normalfont\normalsize\bfseries\color{seccolor}}}
235
236 %\RequirePackage[draft]{pdfdraftcopy}
237 % \draftstring{}
238 \puttext(0,36){\botstring}%
239 \puttext(0,840){\copy\topbox}
240 \if@mylogo
241 \puttext(531,829){\cvrlogo}
242 \fi
243
244 \RequirePackage{colortbl}
245 %\arrayrulecolor{arrayrulecolor}
246 \let\shline\hline
247 \def\hline{\noalign{\vskip3pt}\shline\noalign{\vskip4pt}}
248
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}
254
255 \pagestyle{empty}
256 \def\version#1{\gdef\@version{#1}}
257 \def\@version{1.0}
258 \def\contact#1{\gdef\@contact{#1}}
259 \def\author#1{\gdef\@author{#1}}
260 \def\@author{STM Document Engineering Pvt Ltd.}
261 \def\@contact{\texttt{[email protected]}}
262 \def\keywords#1{\gdef\@keywords{#1}}
263 \def\@keywords{\LaTeX, \xml}
264
265 \long\def\Hrule{\\\hspace*{-3em}%
266 {\color{quicklinkrulecolor}\rule{\linewidth}{.1pt}}\\}
267
268 \long\def\dtxmarkone[#1][#2]#3#4#5{\def\next{#1}%
269 \ifcase\next\or\Hlink{#4}{#3}\Hrule \fi}
270
271 \newcounter{dtx}
272
273 \long\def\dtxmarktwo[#1][#2]#3#4#5{\def\next{#1}%
274 % \stepcounter{dtx}\parbox{.45\linewidth}%
275 \stepcounter{dtx}\parbox[][11pt][b]{.45\linewidth}%
276 {\ifcase\next\or\Hlink{#4}{#3}\fi}%
277 \ifodd\thedtx\relax\else\Hrule\fi}
278
279 \let\dtxmark\dtxmarkone
280
281 \newbox\topbox
282 \long\def\maketitle{\global\setbox\topbox=\vbox{\hsize=\paperwidth
283 \parindent=0pt
284 \fcolorbox{toprulecolor}{topbgcolor}%
285 {\parbox[t][2in][c]{\paperwidth}%
286 {\hspace*{15mm}%
287 \parbox[c]{.35\paperwidth}{\fontsize{18pt}{20pt}%
288 \raggedright\normalfont\sffamily \selectfont
289 \color{titlecolor} \@title\\[6pt]
290 {\normalsize\rmfamily\scshape\@author}}%
291 % {\footnotesize\textsc{keywords:} \@keywords}}%
292 \hfill
293 \parbox[c][2in][c]{1mm}{\color{topverticalrule}%
294 \rule{.1pt}{2in}}%
295 \hfill
296 \parbox[c][2in][c]{.35\paperwidth}%
297 {\normalfont\footnotesize\sffamily\color{quicklinkcolor}%
298 % \advance\baselineskip-3pt%
299 \advance\baselineskip-5pt%
300 \vspace*{6pt} QUICK LINKS\Hrule
301 \IfFileExists{tmp.out}{\input tmp.out}{}%
302 }\hspace*{5mm}%
303 }%
304 }%
305 }%
306 }
307 \gdef\botstring{\fcolorbox{botrulecolor}{botbgcolor}%
308 {\parbox[t][.5in][t]{\paperwidth}%
309 {\normalfont\sffamily\footnotesize%
310 \color{botcolor}%
311 \hspace*{5mm}\parbox[c][.5in][c]{.45\paperwidth}%
312 {\raggedright \textcopyright\ \the\year, Elsevier Ltd.
313 Bugs, feature requests, suggestions and comments %\\
314 shall be mailed to \href{mailto:[email protected]}
315 {$<[email protected]$>$}.
316 }\hfill%
317 \parbox[c][.5in][c]{1cm}
318 {\centering\sffamily\mdseries
319 \fcolorbox{pgrulecolor}{pgbgcolor}{\thepage}%
320 }\hfill
321 \parbox[c][.5in][c]{.45\paperwidth}
322 {\raggedleft\begin{tabular}{rl}%
323 Version:&\@version\\
324 Date:&\@date\\
325 Contact:&\@contact
326 \end{tabular}\hspace*{5mm}%
327 }%
328 }%
329 }%
330 }
331
332 \def\MacroFont{\fontencoding\encodingdefault
333 \fontfamily\ttdefault
334 \fontseries\mddefault
335 \fontshape\updefault
336 \color{verbcolor}\small}%
337
338 \def\verbatim@font{\normalfont\color{verbcolor}\ttfamily}
339
340 \def\verb{\relax\ifmmode\hbox\else\leavevmode\null\fi
341 \bgroup
342 \verb@eol@error \let\do\@makeother \dospecials
343 \verbatim@font\@noligs
344 \@ifstar\@sverb\@verb}
345
346
347 \def\@lbr{\expandafter\@gobble\string\{}
348 \def\@rbr{\expandafter\@gobble\string\}}
349 \def\@bsl{\expandafter\@gobble\string\\}
350 \def\@Bsl#1{\texttt{\@bsl#1}\xspace}
351 \def\trics#1{\protect\@Bsl{#1}}
352 \def\onecs#1{\protect\@Bsl{#1}}
353 %\let\trics\onecs
354 \@ifundefined{c@Glossary}{}{\c@GlossaryColumns=1
355 \c@IndexColumns=2}
356
357 \def\index@prologue{\section{Index}%
358 \markboth{Index}{Index}%
359 % Numbers written in italic refer to the page
360 % where the corresponding entry is described;
361 % numbers underlined refer to the
362 % \ifcodeline@index
363 % code line of the
364 % \fi
365 % definition; numbers in roman refer to the
366 % \ifcodeline@index
367 % code lines
368 % \else
369 % pages
370 % \fi
371 % where the entry is used.
372 }
373
374 \@ifundefined{theglossary}{}{%
375 \renewenvironment{theglossary}{%
376 \glossary@prologue%][\GlossaryMin]%
377 \GlossaryParms \let\item\@idxitem \ignorespaces}%
378 {}}
379
380 \newenvironment{decl}[1][]%
381 {\par\small\addvspace{1.5ex plus 1ex}%
382 \vskip -\parskip
383 \ifx\relax#1\relax
384 \def\@decl@date{}%
385 \else
386 \def\@decl@date{\NEWfeature{#1}}%
387 \fi
388 \noindent%\hspace{-\leftmargini}%
389 \begin{tabular}{l}\hline\ignorespaces}%
390 {\\\hline\end{tabular}\nobreak\@decl@date\par\nobreak
391 \vspace{0.75ex}\vskip -\parskip\ignorespacesafterend\noindent}
392
393 \newif\ifhave@multicol
394 \newif\ifcodeline@index
395
396 \IfFileExists{multicol.sty}{\have@multicoltrue
397 \RequirePackage{multicol}%
398 }{}
399
400 \newdimen\IndexMin \IndexMin = 80pt
401 \newcount\c@IndexColumns \c@IndexColumns = 2
402 \ifhave@multicol
403 \renewenvironment{theindex}
404 {\begin{multicols}\c@IndexColumns[\index@prologue][\IndexMin]%
405 \IndexParms \let\item\@idxitem \ignorespaces}%
406 {\end{multicols}}
407 \else
408 \typeout{Can't find multicol.sty -- will use normal index layout if
409 necessary.}
410 \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
411 \columnseprule \z@ \columnsep 35\p@
412 \twocolumn[\index@prologue]%
413 \IndexParms \let\item\@idxitem \ignorespaces}
414 \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
415 \fi
416 \long\def\IndexPrologue#1{\@bsphack\def\index@prologue{#1}\@esphack}
417 \@ifundefined{index@prologue}
418 {\def\index@prologue{\section{Index}%
419 \markboth{Index}{Index}%
420 % Numbers written in italic refer to the page
421 % where the corresponding entry is described;
422 % numbers underlined refer to the
423 % \ifcodeline@index
424 % code line of the
425 % \fi
426 % definition; numbers in roman refer to the
427 % \ifcodeline@index
428 % code lines
429 % \else
430 % pages
431 % \fi
432 % where the entry is used.
433 }}{}
434 \@ifundefined{IndexParms}
435 {\def\IndexParms{%
436 \parindent \z@
437 \columnsep 15pt
438 \parskip 0pt plus 1pt
439 \rightskip 15pt
440 \mathsurround \z@
441 \parfillskip=-15pt
442 \footnotesize
443 \def\@idxitem{\par\hangindent 30pt}%
444 \def\subitem{\@idxitem\hspace*{15pt}}%
445 \def\subsubitem{\@idxitem\hspace*{25pt}}%
446 \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}%
447 }}{}
448 \def\efill{\hfill\nopagebreak}%
449 \def\dotfill{\leaders\hbox to.6em{\hss .\hss}\hskip\z@ plus 1fill}%
450 \def\dotfil{\leaders\hbox to.6em{\hss .\hss}\hfil}%
451 \def\pfill{\unskip~\dotfill\penalty500\strut\nobreak
452 \dotfil~\ignorespaces}%
453
454 \let\scan@allowedfalse\relax
455
456 \def\tlformat#1{\begingroup\Large
457 \parbox[c][1.25em][c]{1.25em}{\centering\fontfamily{phv}
458 \fontseries{m}%
459 \selectfont\color{white}\huge#1}%
460 \endgroup}
461 \def\tlFormat#1{\begingroup\Large
462 \parbox[c][1.25em][c]{1.25em}{\centering\fontfamily{phv}
463 \fontseries{m}%
464 \selectfont\color{black}\huge#1}%
465 \endgroup}
466 \def\cvrlogo{\begingroup\fboxsep=2pt
467 \colorbox{olive}{\tlformat{c}}%
468 \colorbox{blue}{\tlformat{v}}%
469 \colorbox{red}{\tlformat{r}}
470 \endgroup}
471
472
473 \endinput
474
475 %%
476 %% End of file 'rvdtx.sty'
477 %%
478