Debian Codegraph @

texmf-dist/source/latex/oberdiek/dvipscol.dtx

raw
1 % \iffalse meta-comment
2 %
3 % File: dvipscol.dtx
4 % Version: 2016/05/16 v1.3
5 % Info: Alter the usage of the dvips color stack
6 %
7 % Copyright (C)
8 % 2000, 2006, 2008 Heiko Oberdiek
9 % 2016-2019 Oberdiek Package Support Group
10 % https://github.com/ho-tex/oberdiek/issues
11 %
12 % This work may be distributed and/or modified under the
13 % conditions of the LaTeX Project Public License, either
14 % version 1.3c of this license or (at your option) any later
15 % version. This version of this license is in
16 % https://www.latex-project.org/lppl/lppl-1-3c.txt
17 % and the latest version of this license is in
18 % https://www.latex-project.org/lppl.txt
19 % and version 1.3 or later is part of all distributions of
20 % LaTeX version 2005/12/01 or later.
21 %
22 % This work has the LPPL maintenance status "maintained".
23 %
24 % The Current Maintainers of this work are
25 % Heiko Oberdiek and the Oberdiek Package Support Group
26 % https://github.com/ho-tex/oberdiek/issues
27 %
28 % This work consists of the main source file dvipscol.dtx
29 % and the derived files
30 % dvipscol.sty, dvipscol.pdf, dvipscol.ins, dvipscol.drv.
31 %
32 % Distribution:
33 % CTAN:macros/latex/contrib/oberdiek/dvipscol.dtx
34 % CTAN:macros/latex/contrib/oberdiek/dvipscol.pdf
35 %
36 % Unpacking:
37 % (a) If dvipscol.ins is present:
38 % tex dvipscol.ins
39 % (b) Without dvipscol.ins:
40 % tex dvipscol.dtx
41 % (c) If you insist on using LaTeX
42 % latex \let\install=y\input{dvipscol.dtx}
43 % (quote the arguments according to the demands of your shell)
44 %
45 % Documentation:
46 % (a) If dvipscol.drv is present:
47 % latex dvipscol.drv
48 % (b) Without dvipscol.drv:
49 % latex dvipscol.dtx; ...
50 % The class ltxdoc loads the configuration file ltxdoc.cfg
51 % if available. Here you can specify further options, e.g.
52 % use A4 as paper format:
53 % \PassOptionsToClass{a4paper}{article}
54 %
55 % Program calls to get the documentation (example):
56 % pdflatex dvipscol.dtx
57 % makeindex -s gind.ist dvipscol.idx
58 % pdflatex dvipscol.dtx
59 % makeindex -s gind.ist dvipscol.idx
60 % pdflatex dvipscol.dtx
61 %
62 % Installation:
63 % TDS:tex/latex/oberdiek/dvipscol.sty
64 % TDS:doc/latex/oberdiek/dvipscol.pdf
65 % TDS:source/latex/oberdiek/dvipscol.dtx
66 %
67 %<*ignore>
68 \begingroup
69 \catcode123=1 %
70 \catcode125=2 %
71 \def\x{LaTeX2e}%
72 \expandafter\endgroup
73 \ifcase 0\ifx\install y1\fi\expandafter
74 \ifx\csname processbatchFile\endcsname\relax\else1\fi
75 \ifx\fmtname\x\else 1\fi\relax
76 \else\csname fi\endcsname
77 %</ignore>
78 %<*install>
79 \input docstrip.tex
80 \Msg{************************************************************************}
81 \Msg{* Installation}
82 \Msg{* Package: dvipscol 2016/05/16 v1.3 Alter the usage of the dvips color stack (HO)}
83 \Msg{************************************************************************}
84
85 \keepsilent
86 \askforoverwritefalse
87
88 \let\MetaPrefix\relax
89 \preamble
90
91 This is a generated file.
92
93 Project: dvipscol
94 Version: 2016/05/16 v1.3
95
96 Copyright (C)
97 2000, 2006, 2008 Heiko Oberdiek
98 2016-2019 Oberdiek Package Support Group
99
100 This work may be distributed and/or modified under the
101 conditions of the LaTeX Project Public License, either
102 version 1.3c of this license or (at your option) any later
103 version. This version of this license is in
104 https://www.latex-project.org/lppl/lppl-1-3c.txt
105 and the latest version of this license is in
106 https://www.latex-project.org/lppl.txt
107 and version 1.3 or later is part of all distributions of
108 LaTeX version 2005/12/01 or later.
109
110 This work has the LPPL maintenance status "maintained".
111
112 The Current Maintainers of this work are
113 Heiko Oberdiek and the Oberdiek Package Support Group
114 https://github.com/ho-tex/oberdiek/issues
115
116
117 This work consists of the main source file dvipscol.dtx
118 and the derived files
119 dvipscol.sty, dvipscol.pdf, dvipscol.ins, dvipscol.drv.
120
121 \endpreamble
122 \let\MetaPrefix\DoubleperCent
123
124 \generate{%
125 \file{dvipscol.ins}{\from{dvipscol.dtx}{install}}%
126 \file{dvipscol.drv}{\from{dvipscol.dtx}{driver}}%
127 \usedir{tex/latex/oberdiek}%
128 \file{dvipscol.sty}{\from{dvipscol.dtx}{package}}%
129 }
130
131 \catcode32=13\relax% active space
132 \let =\space%
133 \Msg{************************************************************************}
134 \Msg{*}
135 \Msg{* To finish the installation you have to move the following}
136 \Msg{* file into a directory searched by TeX:}
137 \Msg{*}
138 \Msg{* dvipscol.sty}
139 \Msg{*}
140 \Msg{* To produce the documentation run the file `dvipscol.drv'}
141 \Msg{* through LaTeX.}
142 \Msg{*}
143 \Msg{* Happy TeXing!}
144 \Msg{*}
145 \Msg{************************************************************************}
146
147 \endbatchfile
148 %</install>
149 %<*ignore>
150 \fi
151 %</ignore>
152 %<*driver>
153 \NeedsTeXFormat{LaTeX2e}
154 \ProvidesFile{dvipscol.drv}%
155 [2016/05/16 v1.3 Alter the usage of the dvips color stack (HO)]%
156 \documentclass{ltxdoc}
157 \usepackage{holtxdoc}[2011/11/22]
158 \begin{document}
159 \DocInput{dvipscol.dtx}%
160 \end{document}
161 %</driver>
162 % \fi
163 %
164 %
165 %
166 % \GetFileInfo{dvipscol.drv}
167 %
168 % \title{The \xpackage{dvipscol} package}
169 % \date{2016/05/16 v1.3}
170 % \author{Heiko Oberdiek\thanks
171 % {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}}
172 %
173 % \maketitle
174 %
175 % \begin{abstract}
176 % Color support for dvips in \xfile{dvips.def} involves the
177 % color stack of dvips. The package tries to remove unnecessary
178 % uses of the stack to avoid the error ``out of coor stack space''.
179 % \end{abstract}
180 %
181 % \tableofcontents
182 %
183 % \section{Documentation}
184 %
185 % \subsection{Introduction}
186 %
187 % This package tries a solution, if the program
188 % dvips complains:
189 % \begin{quote}
190 % |! out of color stack space|
191 % \end{quote}
192 % The driver file \xfile{dvips.def} contains the
193 % low level color commands for the package \xpackage{color}.
194 % Each time a color is set, the current color is
195 % pushed on the color stack before and after the
196 % current group the old color is popped from
197 % the stack and set again (via \cs{aftergroup}).
198 % But the color stack size of dvips is limited,
199 % so a stack overflow can occur, if there are
200 % too many color setting operations in a group.
201 %
202 % Only at the bottom group level (no group),
203 % the color can be set directly without pushing
204 % the current color on the stack before, because
205 % there is no group at bottom level that can end.
206 %
207 % With \eTeX\ the group level can easily be
208 % detected (\cs{currentgrouplevel}). Alone with
209 % \TeX\ this is not possible.
210 %
211 % \subsection{Usage}
212 %
213 % \subsubsection{With \eTeX}
214 %
215 % With e-TeX the package fixes \cs{set@color}, therefore
216 % no interaction with the user is required. Just load the package:
217 % \begin{quote}
218 % |\usepackage[dvips]{color}|\\
219 % |\usepackage{dvipscol}|
220 % \end{quote}
221 %
222 % \subsubsection{Without \eTeX}
223 %
224 % \begin{quote}
225 % |\usepackage[dvips]{color}|\\
226 % |\usepackage{dvipscol}|
227 % \end{quote}
228 % Without \eTeX\ the package does not know, which \cs{color}
229 % do not need the stack. Therefore it defines \cs{nogroupcolor},
230 % that the user can use manually instead of \cs{color}.
231 % But caution: it should only be used outside of all
232 % groups, for example the following will not work:
233 % \begin{quote}
234 % |\textcolor{black}{\nogroupcolor{blue}...}|
235 % \end{quote}
236 %
237 % The use of \eTeX is strongly recommended.
238 %
239 % \StopEventually{
240 % }
241 %
242 % \section{Implementation}
243 %
244 % \begin{macrocode}
245 %<*package>
246 % \end{macrocode}
247 % Package identification.
248 % \begin{macrocode}
249 \NeedsTeXFormat{LaTeX2e}
250 \ProvidesPackage{dvipscol}%
251 [2016/05/16 v1.3 Alter the usage of the dvips color stack (HO)]
252 % \end{macrocode}
253 %
254 % \begin{macrocode}
255 \@ifundefined{[email protected]}{%
256 \PackageWarningNoLine{dvipscol}{%
257 Nothing to fix, because \string`dvips.def\string' not loaded%
258 }%
259 \endinput
260 }
261 % \end{macrocode}
262 % \begin{macrocode}
263 \CheckCommand*{\set@color}{%
264 \special{color push \current@color}%
265 \aftergroup\reset@color
266 }
267 % \end{macrocode}
268 % \begin{macro}{\nogroupcolor}
269 % \begin{macrocode}
270 \newcommand*{\nogroupcolor}{%
271 \let\saved@org@set@color\set@color
272 \def\set@color{%
273 \let\set@color\saved@org@set@color
274 \special{color \current@color}%
275 }%
276 \color
277 }
278 % \end{macrocode}
279 % \end{macro}
280 %
281 % Patch for \eTeX\ users.
282 % \begin{macrocode}
283 \ifx\currentgrouplevel\@undefined
284 \PackageWarningNoLine{dvipscol}{%
285 \string\set@color\space cannot be fixed, %
286 because the\MessageBreak
287 e-TeX extensions are not available%
288 }%
289 \expandafter\endinput
290 \fi
291 % \end{macrocode}
292 % \begin{macrocode}
293 \def\set@color{%
294 \ifcase\currentgrouplevel
295 \special{color \current@color}%
296 \else
297 \special{color push \current@color}%
298 \aftergroup\reset@color
299 \fi
300 }
301 % \end{macrocode}
302 %
303 % \begin{macrocode}
304 %</package>
305 % \end{macrocode}
306 %
307 % \section{Installation}
308 %
309 % \subsection{Download}
310 %
311 % \paragraph{Package.} This package is available on
312 % CTAN\footnote{\CTANpkg{dvipscol}}:
313 % \begin{description}
314 % \item[\CTAN{macros/latex/contrib/oberdiek/dvipscol.dtx}] The source file.
315 % \item[\CTAN{macros/latex/contrib/oberdiek/dvipscol.pdf}] Documentation.
316 % \end{description}
317 %
318 %
319 % \paragraph{Bundle.} All the packages of the bundle `oberdiek'
320 % are also available in a TDS compliant ZIP archive. There
321 % the packages are already unpacked and the documentation files
322 % are generated. The files and directories obey the TDS standard.
323 % \begin{description}
324 % \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}]
325 % \end{description}
326 % \emph{TDS} refers to the standard ``A Directory Structure
327 % for \TeX\ Files'' (\CTANpkg{tds}). Directories
328 % with \xfile{texmf} in their name are usually organized this way.
329 %
330 % \subsection{Bundle installation}
331 %
332 % \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the
333 % TDS tree (also known as \xfile{texmf} tree) of your choice.
334 % Example (linux):
335 % \begin{quote}
336 % |unzip oberdiek.tds.zip -d ~/texmf|
337 % \end{quote}
338 %
339 % \subsection{Package installation}
340 %
341 % \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
342 % \docstrip\ archive. The files are extracted by running the
343 % \xfile{.dtx} through \plainTeX:
344 % \begin{quote}
345 % \verb|tex dvipscol.dtx|
346 % \end{quote}
347 %
348 % \paragraph{TDS.} Now the different files must be moved into
349 % the different directories in your installation TDS tree
350 % (also known as \xfile{texmf} tree):
351 % \begin{quote}
352 % \def\t{^^A
353 % \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}}
354 % dvipscol.sty & tex/latex/oberdiek/dvipscol.sty\\
355 % dvipscol.pdf & doc/latex/oberdiek/dvipscol.pdf\\
356 % dvipscol.dtx & source/latex/oberdiek/dvipscol.dtx\\
357 % \end{tabular}^^A
358 % }^^A
359 % \sbox0{\t}^^A
360 % \ifdim\wd0>\linewidth
361 % \begingroup
362 % \advance\linewidth by\leftmargin
363 % \advance\linewidth by\rightmargin
364 % \edef\x{\endgroup
365 % \def\noexpand\lw{\the\linewidth}^^A
366 % }\x
367 % \def\lwbox{^^A
368 % \leavevmode
369 % \hbox to \linewidth{^^A
370 % \kern-\leftmargin\relax
371 % \hss
372 % \usebox0
373 % \hss
374 % \kern-\rightmargin\relax
375 % }^^A
376 % }^^A
377 % \ifdim\wd0>\lw
378 % \sbox0{\small\t}^^A
379 % \ifdim\wd0>\linewidth
380 % \ifdim\wd0>\lw
381 % \sbox0{\footnotesize\t}^^A
382 % \ifdim\wd0>\linewidth
383 % \ifdim\wd0>\lw
384 % \sbox0{\scriptsize\t}^^A
385 % \ifdim\wd0>\linewidth
386 % \ifdim\wd0>\lw
387 % \sbox0{\tiny\t}^^A
388 % \ifdim\wd0>\linewidth
389 % \lwbox
390 % \else
391 % \usebox0
392 % \fi
393 % \else
394 % \lwbox
395 % \fi
396 % \else
397 % \usebox0
398 % \fi
399 % \else
400 % \lwbox
401 % \fi
402 % \else
403 % \usebox0
404 % \fi
405 % \else
406 % \lwbox
407 % \fi
408 % \else
409 % \usebox0
410 % \fi
411 % \else
412 % \lwbox
413 % \fi
414 % \else
415 % \usebox0
416 % \fi
417 % \end{quote}
418 % If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's
419 % TDS installing feature, then some files can already be in the right
420 % place, see the documentation of \docstrip.
421 %
422 % \subsection{Refresh file name databases}
423 %
424 % If your \TeX~distribution
425 % (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh
426 % these. For example, \TeX\,Live\ users run \verb|texhash| or
427 % \verb|mktexlsr|.
428 %
429 % \subsection{Some details for the interested}
430 %
431 % \paragraph{Unpacking with \LaTeX.}
432 % The \xfile{.dtx} chooses its action depending on the format:
433 % \begin{description}
434 % \item[\plainTeX:] Run \docstrip\ and extract the files.
435 % \item[\LaTeX:] Generate the documentation.
436 % \end{description}
437 % If you insist on using \LaTeX\ for \docstrip\ (really,
438 % \docstrip\ does not need \LaTeX), then inform the autodetect routine
439 % about your intention:
440 % \begin{quote}
441 % \verb|latex \let\install=y\input{dvipscol.dtx}|
442 % \end{quote}
443 % Do not forget to quote the argument according to the demands
444 % of your shell.
445 %
446 % \paragraph{Generating the documentation.}
447 % You can use both the \xfile{.dtx} or the \xfile{.drv} to generate
448 % the documentation. The process can be configured by the
449 % configuration file \xfile{ltxdoc.cfg}. For instance, put this
450 % line into this file, if you want to have A4 as paper format:
451 % \begin{quote}
452 % \verb|\PassOptionsToClass{a4paper}{article}|
453 % \end{quote}
454 % An example follows how to generate the
455 % documentation with pdf\LaTeX:
456 % \begin{quote}
457 %\begin{verbatim}
458 %pdflatex dvipscol.dtx
459 %makeindex -s gind.ist dvipscol.idx
460 %pdflatex dvipscol.dtx
461 %makeindex -s gind.ist dvipscol.idx
462 %pdflatex dvipscol.dtx
463 %\end{verbatim}
464 % \end{quote}
465 %
466 % \begin{History}
467 % \begin{Version}{2000/08/31 v1.0}
468 % \item
469 % First public release created as answer to
470 % a question of Deepak Goel in \xnewsgroup{comp.text.tex}:
471 % \URL{``\link{Re: \cs{color{}} problems.\,. :Out of stack space.\,.}''}^^A
472 % {https://groups.google.com/group/comp.text.tex/msg/2d37bb1bf2939b31}
473 % \end{Version}
474 % \begin{Version}{2006/02/20 v1.1}
475 % \item
476 % DTX framework.
477 % \item
478 % Code is not changed.
479 % \item
480 % LPPL 1.3
481 % \end{Version}
482 % \begin{Version}{2008/08/11 v1.2}
483 % \item
484 % Code is not changed.
485 % \item
486 % URLs updated.
487 % \end{Version}
488 % \begin{Version}{2016/05/16 v1.3}
489 % \item
490 % Documentation updates.
491 % \end{Version}
492 % \end{History}
493 %
494 % \PrintIndex
495 %
496 % \Finale
497 \endinput