Debian Codegraph @

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

raw
1 %
2 %
3 % File: rvdtx.sty
4 %
5 % Auxiliary package to format *.dtx documents.
6 %
7 % Copyright (c) 2008, 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.2 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.2 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 \ProcessOptions
30 \def\loadXcolor{\if@xcolor\RequirePackage[dvipsnames,svgnames]{xcolor}\fi}
31
32 \loadXcolor
33 \ifcase\thecolorscheme
34 %
35 % Orange color spec (default)
36 %
37 \colorlet{itemcolor}{brown}
38 \colorlet{verbcolor}{Sepia}
39 \colorlet{botrulecolor}{orange!25}
40 \colorlet{botbgcolor}{orange!15}
41 \colorlet{botcolor}{orange!80}
42 \colorlet{pgrulecolor}{orange}
43 \colorlet{pgbgcolor}{white}
44
45 \colorlet{quicklinkrulecolor}{orange!40}
46 \colorlet{quicklinkcolor}{brown}
47 \colorlet{topverticalrule}{brown}
48 \colorlet{titlecolor}{brown}
49 \colorlet{hlinkcolor}{brown}
50 \colorlet{hlinktricolor}{orange!70}
51 \colorlet{linkcolor}{brown}
52 \colorlet{urlcolor}{brown}
53
54 \colorlet{arrayrulecolor}{olive!30}
55 \colorlet{seccolor}{brown}
56
57 \colorlet{toprulecolor}{orange!30}
58 \colorlet{topbgcolor}{orange!10}
59 \colorlet{topcolor}{brown!80}
60 %
61 %
62 \or% Green color specs
63 %
64 %
65 \colorlet{itemcolor}{OliveGreen}
66 \colorlet{verbcolor}{OliveGreen}
67 \colorlet{botrulecolor}{GreenYellow!25}
68 \colorlet{botbgcolor}{GreenYellow!30}
69 \colorlet{botcolor}{Green!80}
70 \colorlet{pgrulecolor}{GreenYellow}
71 \colorlet{pgbgcolor}{white}
72
73 \colorlet{quicklinkrulecolor}{Green!40}
74 \colorlet{quicklinkcolor}{Green}
75 \colorlet{topverticalrule}{Green}
76 \colorlet{titlecolor}{DarkOliveGreen}
77 \colorlet{hlinkcolor}{DarkOliveGreen}
78 \colorlet{hlinktricolor}{Green!70}
79 \colorlet{linkcolor}{OliveGreen}
80 \colorlet{urlcolor}{OliveGreen}
81
82 \colorlet{arrayrulecolor}{olive!30}
83 \colorlet{seccolor}{OliveGreen}
84
85 \colorlet{toprulecolor}{GreenYellow!50}
86 \colorlet{topbgcolor}{GreenYellow!20}
87 \colorlet{topcolor}{GreenYellow!80}
88 \fi
89
90 \def\floatpagefraction{.99}
91 \usepackage{geometry}
92 \geometry{top=2in,
93 bottom=1in,
94 left=1in,
95 right=1in,
96 a4paper}
97
98 \DeclareRobustCommand{\LaTeX}{L\kern-.25em%
99 {\sbox\z@ T%
100 \vbox to\ht\z@{%
101 \hbox{%
102 \check@mathfonts
103 \fontsize\sf@size\z@
104 \math@fontsfalse\selectfont
105 A}%
106 \vss}%
107 }%
108 \kern-.10em%
109 \TeX}
110
111 \IfFileExists{pdfwidgets.sty}{\RequirePackage{pdfwidgets}}{}
112
113 \RequirePackage{comment,xspace}
114 \def\xml{\textsc{xml}\xspace}
115 \def\latex{\LaTeX\xspace}
116 \def\pdf{\textsc{pdf}\xspace}
117 \def\pdfa{\textsc{pdf/a-1}b\xspace}
118 \def\pdfx{\textsc{pdf/x-1}a\xspace}
119 \def\xmp{\textsc{xmp}\xspace}
120 \def\pdftex{\textsc{pdf\TeX}\xspace}
121 \def\defmacro#1{\texttt{\@bsl#1}}
122 \def\thanh{H\`an Th\^e Th\`anh\xspace}
123 \def\gnulinux{\textsc{gnu/linux}\xspace}
124
125 \let\@DRAFTout@Hook\@empty
126 \newcommand{\DRAFTout}{\g@addto@macro\@DRAFTout@Hook}
127 \newcommand{\@DRAFTout@Out}{%
128 \afterassignment\@DRAFTout@Test
129 \global\setbox\@cclv= %
130 }
131 \newcommand{\@DRAFTout@Test}{%
132 \ifvoid\@cclv\relax
133 \aftergroup\@DRAFTout@Output
134 \else
135 \@DRAFTout@Output
136 \fi%
137 }
138 \newcommand{\@DRAFTout@Output}{%
139 \@DRAFTout@Hook%
140 \@DRAFTout@Org@Out\box\@cclv%
141 }
142 \newcommand{\@DRAFTout@Org@Out}{}
143 \newcommand*{\@DRAFTout@Init}{%
144 \let\@DRAFTout@Org@Out\shipout
145 \let\shipout\@DRAFTout@Out
146 }
147 \newdimen\OHeight
148 \setlength\OHeight{\textheight}
149 \addtolength\OHeight{\headheight}
150 \addtolength\OHeight{\headsep}
151 \addtolength\OHeight{\footskip}
152
153 \newif\ifoverlay\overlayfalse
154
155 \AtBeginDocument{\@DRAFTout@Init}
156 \newcommand{\@DraftOverlay@Hook}{}
157 \newcommand{\AddToDraftOverlay}{\g@addto@macro\@DraftOverlay@Hook}
158 \newcommand{\ClearDraftOverlay}{\let\@DraftOverlay@Hook\@empty}
159 \newcommand{\@DraftOverlay}{%
160 \ifx\@DraftOverlay@Hook\@empty
161 \else
162 \bgroup
163 \@tempdima=1in
164 \@tempcnta=\@tempdima
165 \@tempcntb=-\@tempdima
166 \advance\@tempcntb\paperheight
167 \ifoverlay
168 \global\setbox\@cclv\vbox{%
169 \box\@cclv
170 \vbox{\let\protect\relax%
171 \unitlength=1pt%
172 \pictur@(0,0)(\strip@pt\@tempdima,\strip@pt\@tempdimb)%
173 \@DraftOverlay@Hook%
174 \endpicture}}%
175 \else
176 \global\setbox\@cclv\vbox{%
177 \vbox{\let\protect\relax%
178 \unitlength=1sp%
179 \pictur@(0,0)(\@tempcnta,\@tempcntb)%
180 \@DraftOverlay@Hook%
181 \endpicture}%
182 \box\@cclv}%
183 \fi
184 \egroup
185 \fi
186 }
187
188 \definecolor{gray30}{gray}{.7}
189 \definecolor{gray20}{gray}{.8}
190 \definecolor{gray10}{gray}{.9}
191
192 \DRAFTout{\@DraftOverlay}
193 \long\def\puttext(#1)#2{\AddToDraftOverlay{%
194 \setlength{\unitlength}{1pt}\thinlines%
195 \put(#1){#2}}}
196
197 \RequirePackage{shortvrb}
198 %\MakeShortVerb{\|}
199 \RequirePackage{amsfonts,amssymb}
200 \IfFileExists{pxfonts.sty}{\RequirePackage{pxfonts}}{}
201 \IfFileExists{charter.sty}{\RequirePackage{charter}}{}
202 \IfFileExists{lfr.sty}{\RequirePackage[scaled=.85]{lfr}}{}
203 \IfFileExists{prima.sty}{\RequirePackage[scaled=.8]{prima}}{}
204
205 \def\theCodelineNo{\reset@font\tiny\arabic{CodelineNo}}
206
207 \def\@seccntformat#1{\llap{\csname the#1\endcsname.\hspace*{6pt}}}
208 \def\@seccntformat#1{{\csname the#1\endcsname.\hspace*{6pt}}}
209 \def\section{\@startsection {section}{1}{\z@}%
210 {-3.5ex \@plus -1ex \@minus -.2ex}%
211 {2.3ex \@plus.2ex}%
212 {\normalfont\large\bfseries\color{seccolor}}}
213 \def\subsection{\@startsection{subsection}{2}{\z@}%
214 {-2.25ex\@plus -1ex \@minus -.2ex}%
215 {1.5ex \@plus .2ex}%
216 {\normalfont\normalsize\bfseries\color{seccolor}}}
217 \def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
218 {-1.25ex\@plus -1ex \@minus -.2ex}%
219 {1.5ex \@plus .2ex}%
220 {\normalfont\normalsize\bfseries\color{seccolor}}}
221
222 %\RequirePackage[draft]{pdfdraftcopy}
223 % \draftstring{}
224 \puttext(0,36){\botstring}%
225 \puttext(0,840){\copy\topbox}
226 \if@mylogo
227 \puttext(531,829){\cvrlogo}
228 \fi
229
230 \RequirePackage{colortbl}
231 \arrayrulecolor{arrayrulecolor}
232 \let\shline\hline
233 \def\hline{\noalign{\vskip3pt}\shline\noalign{\vskip4pt}}
234
235 \RequirePackage[pdftex,colorlinks]{hyperref}
236 \def\Hlink#1#2{\hyperlink{#2}{\color{hlinktricolor}%
237 $\blacktriangleright$~\color{hlinkcolor}#1}}
238 \def\@linkcolor{linkcolor}
239 \def\@urlcolor{urlcolor}
240
241 \pagestyle{empty}
242 \def\version#1{\gdef\@version{#1}}
243 \def\@version{1.0}
244 \def\contact#1{\gdef\@contact{#1}}
245 \def\author#1{\gdef\@author{#1}}
246 \def\@author{River Valley Technologies}
247 \def\@contact{\texttt{[email protected]}}
248 \def\keywords#1{\gdef\@keywords{#1}}
249 \def\@keywords{\LaTeX, \xml}
250
251 \long\def\Hrule{\\[-4pt]\hspace*{-3em}%
252 {\color{quicklinkrulecolor}\rule{\linewidth}{.1pt}}\\}
253
254 \long\def\dtxmark[#1][#2]#3#4#5{\def\next{#1}%
255 \ifcase\next\or\Hlink{#4}{#3}\Hrule \fi}
256
257 \newcounter{dtx}
258
259 \long\def\ddtxmark[#1][#2]#3#4#5{\def\next{#1}%
260 \stepcounter{dtx}\parbox{.45\linewidth}%
261 {\ifcase\next\or\Hlink{#4}{#3}\fi}%
262 \ifodd\thedtx\relax\else\Hrule\fi}
263
264 %\global\let\dtxmark\ddtxmark
265
266 \newbox\topbox
267 \long\def\maketitle{\global\setbox\topbox=\vbox{\hsize=\paperwidth
268 \parindent=0pt
269 \fcolorbox{toprulecolor}{topbgcolor}%
270 {\parbox[t][1.5in][c]{\paperwidth}%
271 {\hspace*{15mm}%
272 \parbox[c]{.35\paperwidth}{\fontsize{18pt}{20pt}%
273 \raggedright\normalfont\sffamily \selectfont
274 \color{titlecolor} \@title\\[6pt]
275 {\normalsize\rmfamily\scshape\@author}}%
276 % {\footnotesize\textsc{keywords:} \@keywords}}%
277 \hfill
278 \parbox[c][1.5in][c]{1mm}{\color{topverticalrule}%
279 \rule{.1pt}{1.5in}}%
280 \hfill
281 \parbox[c][1.5in][c]{.35\paperwidth}%
282 {\normalfont\footnotesize\sffamily\color{quicklinkcolor}%
283 \vspace*{6pt} QUICK LINKS\Hrule
284 \IfFileExists{tmp.out}{\input tmp.out}{}%
285 }\hspace*{5mm}%
286 }%
287 }%
288 }%
289 }
290 \gdef\botstring{\fcolorbox{botrulecolor}{botbgcolor}%
291 {\parbox[t][.5in][t]{\paperwidth}%
292 {\normalfont\sffamily\footnotesize%
293 \color{botcolor}%
294 \hspace*{5mm}\parbox[c][.5in][c]{.45\paperwidth}%
295 {\raggedright River Valley Technologies,
296 \href{http://www.river-valley.com}{%
297 http://www.river-valley.com}\\
298 \textsc{sjp} Building, Cotton Hills, Trivandrum
299 695014, India\\ 9, Browns Court, Kennford,
300 Exeter, United Kingdom
301 }\hfill%
302 \parbox[c][.5in][c]{1cm}
303 {\centering\sffamily\mdseries
304 \fcolorbox{pgrulecolor}{pgbgcolor}{\thepage}%
305 }\hfill
306 \parbox[c][.5in][c]{.45\paperwidth}
307 {\raggedleft\tabcolsep=3pt\begin{tabular}{rl}%
308 Version:&\@version\\[1pt]
309 Date:&\@date\\[1pt]
310 Contact:&\@contact
311 \end{tabular}\hspace*{5mm}%
312 }%
313 }%
314 }%
315 }
316
317 %\RequirePackage{enumitem}
318 %\setitemize[1]{label={\small\color{itemcolor}$\blacktriangleright$},itemsep=0pt}
319 %\setitemize[2]{label={\small\color{itemcolor}$\triangleright$},itemsep=0pt}
320 %\setenumerate[1]{label={\small\color{itemcolor}\arabic*.},itemsep=0pt}
321
322 \def\MacroFont{\fontencoding\encodingdefault
323 \fontfamily\ttdefault
324 \fontseries\mddefault
325 \fontshape\updefault
326 \color{verbcolor}\small}%
327
328 \def\verbatim@font{\normalfont\color{verbcolor}\ttfamily}
329
330 \def\verb{\relax\ifmmode\hbox\else\leavevmode\null\fi
331 \bgroup
332 \verb@eol@error \let\do\@makeother \dospecials
333 \verbatim@font\@noligs
334 \@ifstar\@sverb\@verb}
335
336
337 \def\@lbr{\expandafter\@gobble\string\{}
338 \def\@rbr{\expandafter\@gobble\string\}}
339 \def\@bsl{\expandafter\@gobble\string\\}
340 \def\@Bsl#1{\texttt{\@bsl#1}\xspace}
341 \def\trics#1{\protect\@Bsl{#1}}
342 \def\onecs#1{\protect\@Bsl{#1}}
343 %\let\trics\onecs
344 \@ifundefined{c@Glossary}{}{\c@GlossaryColumns=1
345 \c@IndexColumns=2}
346
347 \def\index@prologue{\section{Index}%
348 \markboth{Index}{Index}%
349 % Numbers written in italic refer to the page
350 % where the corresponding entry is described;
351 % numbers underlined refer to the
352 % \ifcodeline@index
353 % code line of the
354 % \fi
355 % definition; numbers in roman refer to the
356 % \ifcodeline@index
357 % code lines
358 % \else
359 % pages
360 % \fi
361 % where the entry is used.
362 }
363
364 \@ifundefined{theglossary}{}{%
365 \renewenvironment{theglossary}{%
366 \glossary@prologue%][\GlossaryMin]%
367 \GlossaryParms \let\item\@idxitem \ignorespaces}%
368 {}}
369
370 \newenvironment{decl}[1][]%
371 {\par\small\addvspace{1.5ex plus 1ex}%
372 \vskip -\parskip
373 \ifx\relax#1\relax
374 \def\@decl@date{}%
375 \else
376 \def\@decl@date{\NEWfeature{#1}}%
377 \fi
378 \noindent%\hspace{-\leftmargini}%
379 \begin{tabular}{l}\hline\ignorespaces}%
380 {\\\hline\end{tabular}\nobreak\@decl@date\par\nobreak
381 \vspace{0.75ex}\vskip -\parskip\ignorespacesafterend\noindent}
382
383 \newif\ifhave@multicol
384 \newif\ifcodeline@index
385
386 \IfFileExists{multicol.sty}{\have@multicoltrue
387 \RequirePackage{multicol}%
388 }{}
389
390 \newdimen\IndexMin \IndexMin = 80pt
391 \newcount\c@IndexColumns \c@IndexColumns = 2
392 \ifhave@multicol
393 \renewenvironment{theindex}
394 {\begin{multicols}\c@IndexColumns[\index@prologue][\IndexMin]%
395 \IndexParms \let\item\@idxitem \ignorespaces}%
396 {\end{multicols}}
397 \else
398 \typeout{Can't find multicol.sty -- will use normal index layout if
399 necessary.}
400 \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
401 \columnseprule \z@ \columnsep 35\p@
402 \twocolumn[\index@prologue]%
403 \IndexParms \let\item\@idxitem \ignorespaces}
404 \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
405 \fi
406 \long\def\IndexPrologue#1{\@bsphack\def\index@prologue{#1}\@esphack}
407 \@ifundefined{index@prologue}
408 {\def\index@prologue{\section{Index}%
409 \markboth{Index}{Index}%
410 % Numbers written in italic refer to the page
411 % where the corresponding entry is described;
412 % numbers underlined refer to the
413 % \ifcodeline@index
414 % code line of the
415 % \fi
416 % definition; numbers in roman refer to the
417 % \ifcodeline@index
418 % code lines
419 % \else
420 % pages
421 % \fi
422 % where the entry is used.
423 }}{}
424 \@ifundefined{IndexParms}
425 {\def\IndexParms{%
426 \parindent \z@
427 \columnsep 15pt
428 \parskip 0pt plus 1pt
429 \rightskip 15pt
430 \mathsurround \z@
431 \parfillskip=-15pt
432 \footnotesize
433 \def\@idxitem{\par\hangindent 30pt}%
434 \def\subitem{\@idxitem\hspace*{15pt}}%
435 \def\subsubitem{\@idxitem\hspace*{25pt}}%
436 \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}%
437 }}{}
438 \def\efill{\hfill\nopagebreak}%
439 \def\dotfill{\leaders\hbox to.6em{\hss .\hss}\hskip\z@ plus 1fill}%
440 \def\dotfil{\leaders\hbox to.6em{\hss .\hss}\hfil}%
441 \def\pfill{\unskip~\dotfill\penalty500\strut\nobreak
442 \dotfil~\ignorespaces}%
443
444 \let\scan@allowedfalse\relax
445
446 \def\tlformat#1{\begingroup\Large
447 \parbox[c][1.25em][c]{1.25em}{\centering\fontfamily{phv}
448 \fontseries{m}%
449 \selectfont\color{white}\huge#1}%
450 \endgroup}
451 \def\tlFormat#1{\begingroup\Large
452 \parbox[c][1.25em][c]{1.25em}{\centering\fontfamily{phv}
453 \fontseries{m}%
454 \selectfont\color{black}\huge#1}%
455 \endgroup}
456 \def\cvrlogo{\begingroup\fboxsep=2pt
457 \colorbox{olive}{\tlformat{c}}%
458 \colorbox{blue}{\tlformat{v}}%
459 \colorbox{red}{\tlformat{r}}
460 \endgroup}
461
462
463 \endinput
464
465 %%
466 %% End of file 'rvdtx.sty'
467 %%