Debian Codegraph @

texmf-dist/source/latex/pdfx/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 \DeclareOption{red}{\setcounter{colorscheme}{0}}
23 \DeclareOption{green}{\setcounter{colorscheme}{2}}
24 \DeclareOption{orange}{\setcounter{colorscheme}{1}}
25 \ProcessOptions
26
27 \RequirePackage[dvipsnames,svgnames]{xcolor}
28
29 \ifcase\thecolorscheme
30 %
31 % Red color spec (default)
32 %
33 \colorlet{itemcolor}{DarkRed}
34 \colorlet{verbcolor}{Sepia}
35 \colorlet{botrulecolor}{DarkRed}
36 \colorlet{botbgcolor}{DarkRed}
37 \colorlet{botcolor}{white}
38 \colorlet{pgrulecolor}{DarkRed!10}
39 \colorlet{pgbgcolor}{DarkRed!50}
40
41 \colorlet{quicklinkrulecolor}{white}
42 \colorlet{quicklinkcolor}{white}
43 \colorlet{topverticalrule}{white}
44 \colorlet{titlecolor}{white}
45 \colorlet{hlinkcolor}{white}
46 \colorlet{hlinktricolor}{white}
47 \colorlet{linkcolor}{orange}
48 \colorlet{urlcolor}{orange}
49
50 \colorlet{arrayrulecolor}{olive!30}
51 \colorlet{seccolor}{brown}
52
53 \colorlet{toprulecolor}{DarkRed}
54 \colorlet{topbgcolor}{DarkRed}
55 \colorlet{topcolor}{orange}
56 \or
57 %
58 % Orange color spec (default)
59 %
60 \colorlet{itemcolor}{brown}
61 \colorlet{verbcolor}{Sepia}
62 \colorlet{botrulecolor}{orange!25}
63 \colorlet{botbgcolor}{orange!15}
64 \colorlet{botcolor}{orange!80}
65 \colorlet{pgrulecolor}{orange}
66 \colorlet{pgbgcolor}{white}
67
68 \colorlet{quicklinkrulecolor}{orange!40}
69 \colorlet{quicklinkcolor}{brown}
70 \colorlet{topverticalrule}{brown}
71 \colorlet{titlecolor}{brown}
72 \colorlet{hlinkcolor}{brown}
73 \colorlet{hlinktricolor}{orange!70}
74 \colorlet{linkcolor}{brown}
75 \colorlet{urlcolor}{brown}
76
77 \colorlet{arrayrulecolor}{olive!30}
78 \colorlet{seccolor}{brown}
79
80 \colorlet{toprulecolor}{orange!30}
81 \colorlet{topbgcolor}{orange!10}
82 \colorlet{topcolor}{brown!80}
83 %
84 %
85 \or% Green color specs
86 %
87 %
88 \colorlet{itemcolor}{OliveGreen}
89 \colorlet{verbcolor}{OliveGreen}
90 \colorlet{botrulecolor}{GreenYellow!25}
91 \colorlet{botbgcolor}{GreenYellow!30}
92 \colorlet{botcolor}{Green!80}
93 \colorlet{pgrulecolor}{GreenYellow}
94 \colorlet{pgbgcolor}{white}
95
96 \colorlet{quicklinkrulecolor}{Green!40}
97 \colorlet{quicklinkcolor}{Green}
98 \colorlet{topverticalrule}{Green}
99 \colorlet{titlecolor}{DarkOliveGreen}
100 \colorlet{hlinkcolor}{DarkOliveGreen}
101 \colorlet{hlinktricolor}{Green!70}
102 \colorlet{linkcolor}{OliveGreen}
103 \colorlet{urlcolor}{OliveGreen}
104
105 \colorlet{arrayrulecolor}{olive!30}
106 \colorlet{seccolor}{OliveGreen}
107
108 \colorlet{toprulecolor}{GreenYellow!50}
109 \colorlet{topbgcolor}{GreenYellow!20}
110 \colorlet{topcolor}{GreenYellow!80}
111 \fi
112 %
113 \def\floatpagefraction{.99}
114 \usepackage{geometry}
115 \geometry{top=2in,
116 bottom=1in,
117 left=2in,
118 right=1in,
119 a4paper}
120
121 \RequirePackage{comment,xspace}
122 \def\pdftex{pdf\TeX\xspace}
123 \def\defmacro#1{\texttt{\@bsl#1}}
124 \def\thanh{H\`an Th\^e Th\`anh\xspace}
125 \def\Thanh{H\`an Th\'{\^e} Th\`anh\xspace}
126
127 \let\@DRAFTout@Hook\@empty
128 \newcommand{\DRAFTout}{\g@addto@macro\@DRAFTout@Hook}
129 \newcommand{\@DRAFTout@Out}{%
130 \afterassignment\@DRAFTout@Test
131 \global\setbox\@cclv= %
132 }
133 \newcommand{\@DRAFTout@Test}{%
134 \ifvoid\@cclv\relax
135 \aftergroup\@DRAFTout@Output
136 \else
137 \@DRAFTout@Output
138 \fi%
139 }
140 \newcommand{\@DRAFTout@Output}{%
141 \@DRAFTout@Hook%
142 \@DRAFTout@Org@Out\box\@cclv%
143 }
144 \newcommand{\@DRAFTout@Org@Out}{}
145 \newcommand*{\@DRAFTout@Init}{%
146 \let\@DRAFTout@Org@Out\shipout
147 \let\shipout\@DRAFTout@Out
148 }
149 \newdimen\OHeight
150 \setlength\OHeight{\textheight}
151 \addtolength\OHeight{\headheight}
152 \addtolength\OHeight{\headsep}
153 \addtolength\OHeight{\footskip}
154
155 \newif\ifoverlay\overlayfalse
156
157 \AtBeginDocument{\@DRAFTout@Init}
158 \newcommand{\@DraftOverlay@Hook}{}
159 \newcommand{\AddToDraftOverlay}{\g@addto@macro\@DraftOverlay@Hook}
160 \newcommand{\ClearDraftOverlay}{\let\@DraftOverlay@Hook\@empty}
161 \newcommand{\@DraftOverlay}{%
162 \ifx\@DraftOverlay@Hook\@empty
163 \else
164 \bgroup
165 \@tempdima=1in
166 \@tempcnta=\@tempdima
167 \@tempcntb=-\@tempdima
168 \advance\@tempcntb\paperheight
169 \ifoverlay
170 \global\setbox\@cclv\vbox{%
171 \box\@cclv
172 \vbox{\let\protect\relax%
173 \unitlength=1pt%
174 \pictur@(0,0)(\strip@pt\@tempdima,\strip@pt\@tempdimb)%
175 \@DraftOverlay@Hook%
176 \endpicture}}%
177 \else
178 \global\setbox\@cclv\vbox{%
179 \vbox{\let\protect\relax%
180 \unitlength=1sp%
181 \pictur@(0,0)(\@tempcnta,\@tempcntb)%
182 \@DraftOverlay@Hook%
183 \endpicture}%
184 \box\@cclv}%
185 \fi
186 \egroup
187 \fi
188 }
189
190 \definecolor{gray30}{gray}{.7}
191 \definecolor{gray20}{gray}{.8}
192 \definecolor{gray10}{gray}{.9}
193
194 \DRAFTout{\@DraftOverlay}
195 \long\def\puttext(#1)#2{\AddToDraftOverlay{%
196 \setlength{\unitlength}{1pt}\thinlines%
197 \put(#1){#2}}}
198
199 \MakeShortVerb{\|}
200
201 \IfFileExists{libertine.sty}{\RequirePackage[osf,tt]{libertine}}{}
202 \IfFileExists{sourcesanspro.sty}
203 {\RequirePackage[osf,light,semibold]{sourcesanspro}}{}
204 \IfFileExists{inconsolata.sty}{\RequirePackage[scaled=.95]{inconsolata}
205 %\IfFileExists{inconsolata.sty}{\RequirePackage[scaled=.95,noupquote]{inconsolata}
206 \def\ttdefault{zi4}}{\def\ttdefault{cmtt}}
207
208 \def\theCodelineNo{\reset@font\tiny\arabic{CodelineNo}}
209
210 \def\@seccntformat#1{\llap{\csname the#1\endcsname.\hspace*{6pt}}}
211 \def\section{\@startsection {section}{1}{\z@}%
212 {-3.5ex \@plus -1ex \@minus -.2ex}%
213 {2.3ex \@plus.2ex}%
214 {\normalfont\large\bfseries\color{seccolor}}}
215 \def\subsection{\@startsection{subsection}{2}{\z@}%
216 {-3.25ex\@plus -1ex \@minus -.2ex}%
217 {1.5ex \@plus .2ex}%
218 {\normalfont\normalsize\bfseries\color{seccolor}}}
219 \def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
220 {-3.25ex\@plus -1ex \@minus -.2ex}%
221 {1.5ex \@plus .2ex}%
222 {\normalfont\normalsize\bfseries\color{seccolor}}}
223
224 \let\sv@section\section
225
226 \newwrite\qlinkwrite
227 \immediate\openout\qlinkwrite=\jobname.links
228 \renewcommand\section{\@ifstar{\star@section}{\normal@section}}
229 \def\star@section#1{\def\next{#1}
230 \sv@section*{#1}%
231 \immediate\write\qlinkwrite{\string\fxmark{section.\thesection}%
232 {\expandafter\strip@prefix\meaning\next}}%
233 }
234
235 \newcommand\normal@section[2][]{\def\next{#1}
236 \ifx\next\@empty\def\next{#2}\else\if#1*\def\next{#1}\fi\fi
237 \sv@section[#1]{#2}%
238 \immediate\write\qlinkwrite{\string\fxmark{section.\thesection}%
239 {\expandafter\strip@prefix\meaning\next}}%
240 }
241
242 %\RequirePackage[draft]{pdfdraftcopy}
243 % \draftstring{}
244 \puttext(0,36){\botstring}%
245 \puttext(0,842){\copy\topbox}
246
247 \RequirePackage{colortbl}
248 \arrayrulecolor{arrayrulecolor}
249 \let\shline\hline
250 \def\hline{\noalign{\vskip3pt}\shline\noalign{\vskip4pt}}
251
252 \RequirePackage{hyperref}
253 \hypersetup{pdftex,colorlinks}
254 \def\Hlink#1#2{\hyperlink{#2}{\color{hlinktricolor}%
255 $\blacktriangleright$~\color{hlinkcolor}#1}}
256 \def\@linkcolor{linkcolor}
257 \def\@urlcolor{urlcolor}
258
259 \pagestyle{empty}
260 \def\version#1{\gdef\@version{#1}}
261 \def\@version{1.0}
262 \def\contact#1{\gdef\@contact{\texttt{#1}}}
263 \def\author#1{\gdef\@author{#1}}
264 \def\@author{River Valley Technologies}
265 \def\@contact{\texttt{[email protected]}}
266 \def\keywords#1{\gdef\@keywords{#1}}
267 \def\@keywords{\LaTeX, \xml}
268
269 \long\def\Hrule{\\[-4pt]\hspace*{-3em}%
270 {\color{quicklinkrulecolor}\rule{\linewidth}{0pt}}\\}
271
272 \long\def\fxmark#1#2{\Hlink{#2}{#1}\Hrule}
273
274 \newbox\topbox
275 \long\def\maketitle{\global\setbox\topbox=\vbox{\hsize=\paperwidth
276 \parindent=0pt
277 \fcolorbox{toprulecolor}{topbgcolor}%
278 {\parbox[t][1.5in][c]{\paperwidth}%
279 {\hspace*{15mm}%
280 \parbox[c]{.475\paperwidth}{\fontsize{18pt}{20pt}%
281 \raggedright\normalfont\sffamily \selectfont
282 \color{titlecolor} \@title\\[12pt]
283 \parbox{\linewidth}{\fontsize{12}{13.5}\fontseries{m}%
284 \sffamily\upshape\selectfont\@author\strut}%
285 }%
286 \hfill
287 \parbox[c][1.5in][c]{1mm}{\color{topverticalrule}%
288 \rule{.1pt}{1.5in}}%
289 \hfill
290 \parbox[c][1.5in][c]{.35\paperwidth}%
291 {\normalfont\footnotesize\sffamily\color{quicklinkcolor}%
292 \raggedcolumns\sffamily\fontsize{7.5}{8}\fontseries{m}\selectfont
293 \begin{multicols}{2}[QUICK LINKS]
294 \IfFileExists{tmp.links}{\input tmp.links}{}%
295 \end{multicols}%
296 }\hspace*{5mm}%
297 }%
298 }%
299 }%
300 }
301 \gdef\botstring{\fcolorbox{botrulecolor}{botbgcolor}%
302 {\parbox[t][.5in][t]{\paperwidth}%
303 {\normalfont\sffamily\fontseries{m}\footnotesize\selectfont%
304 \color{botcolor}%
305 \hspace*{5mm}\parbox[c][.5in][c]{.45\paperwidth}%
306 {\raggedright River Valley Technologies,
307 \href{http://www.river-valley.com}{%
308 \texttt{http://www.river-valley.com}}\\
309 \textsc{jwra} 34, Jagathy, Trivandrum
310 695014, India
311 }\hfill%
312 \parbox[c][.5in][c]{1cm}
313 {\centering\sffamily\fontseries{m}\selectfont
314 \fcolorbox{pgrulecolor}{pgbgcolor}{\thepage}%
315 }\hfill
316 \parbox[c][.5in][c]{.45\paperwidth}
317 {\raggedleft\sffamily\fontsize{7.5}{8}\fontseries{m}\selectfont
318 \begin{tabular}{rl}%
319 Version:&\@version/\@date\\[3pt]
320 Contacts:&\parbox{.3\paperwidth}{\@contact}
321 \end{tabular}\hspace*{5mm}%
322 }%
323 }%
324 }%
325 }
326
327 \RequirePackage{enumitem,amsfonts,amssymb}
328
329 \setitemize[1]{label={\small\color{itemcolor}$\blacktriangleright$},itemsep=0pt}
330 \setitemize[2]{label={\small\color{itemcolor}$\triangleright$},itemsep=0pt}
331 \setenumerate[1]{label={\small\color{itemcolor}\arabic*.},itemsep=0pt}
332
333 \def\MacroFont{\fontencoding\encodingdefault
334 \fontfamily\ttdefault
335 \fontseries\mddefault
336 \fontshape\updefault
337 \color{verbcolor}\selectfont}%
338
339 \def\verbatim@font{\normalfont\color{verbcolor}\fontfamily{zi4}\selectfont}
340
341 \def\verb{\relax\ifmmode\hbox\else\leavevmode\null\fi
342 \bgroup
343 \verb@eol@error \let\do\@makeother \dospecials
344 \verbatim@font\@noligs
345 \@ifstar\@sverb\@verb}
346
347
348 \def\@lbr{\expandafter\@gobble\string\{}
349 \def\@rbr{\expandafter\@gobble\string\}}
350 \def\@bsl{\expandafter\@gobble\string\\}
351 \def\@Bsl#1{\texttt{\@bsl#1}\xspace}
352 \def\trics#1{\protect\@Bsl{#1}}
353 \def\onecs#1{\protect\@Bsl{#1}}
354 %\let\trics\onecs
355
356 \c@GlossaryColumns=1
357 \c@IndexColumns=2
358
359 \def\index@prologue{\section[Index]{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
364 \ifcodeline@index
365 code line of the
366 \fi
367 definition; numbers in roman refer to the
368 \ifcodeline@index
369 code lines
370 \else
371 pages
372 \fi
373 where the entry is used.
374 }
375
376 \renewcommand\glossary@prologue{%
377 \section[Change History]{Change History}\markboth {{Change History}}{{Change History}}
378 }
379 \renewenvironment{theglossary}{%
380 \glossary@prologue%][\GlossaryMin]%
381 \GlossaryParms \let\item\@idxitem \ignorespaces}%
382 {}
383
384 \newenvironment{decl}[1][]%
385 {\par\small\addvspace{1.5ex plus 1ex}%
386 \vskip -\parskip
387 \ifx\relax#1\relax
388 \def\@decl@date{}%
389 \else
390 \def\@decl@date{\NEWfeature{#1}}%
391 \fi
392 \noindent%\hspace{-\leftmargini}%
393 \begin{tabular}{l}\hline\ignorespaces}%
394 {\\\hline\end{tabular}\nobreak\@decl@date\par\nobreak
395 \vspace{0.75ex}\vskip -\parskip\ignorespacesafterend\noindent}
396
397 \def\Small{\fontsize{8.5}{9.5}\selectfont}
398 \def\PDF{\@ifnextchar/{\@PDF}{\@@PDF}}
399 \def\@PDF/#1{{\Small PDF/#1}}
400 \def\PDFVT{{\Small PDF/VT}\xspace}
401 \def\@@PDF{{\Small PDF}\xspace}
402 \def\ISO{{\Small ISO}\xspace}
403 \def\tsc#1{{\Small#1}\xspace}
404
405 \endinput
406
407 %%
408 %% End of file 'rvdtx.sty'
409 %%