summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/auto-pst-pdf/auto-pst-pdf.dtx
blob: 1853b12f4a2fcea841baebde681ccf5f551148a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
% \iffalse
%<*internal>
\begingroup
\input docstrip.tex
\keepsilent\askforoverwritefalse
\nopreamble\nopostamble
\generate{\file{dtx-style.sty}{\from{\jobname.dtx}{dtx-style}}}
\endgroup
\immediate\write18{makeindex -s gind.ist -o \jobname.ind  \jobname.idx}
\immediate\write18{makeindex -s gglo.ist -o \jobname.gls  \jobname.glo}
%</internal>
%
%<*driver>
\documentclass{ltxdoc}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
%\OnlyDescription
\usepackage{dtx-style}
\begin{document}
  \DocInput{auto-pst-pdf.dtx}
\end{document}
%</driver>
%
%
% \fi
%
% \GetFileInfo{\jobname.sty}
% \CheckSum{0}
% \makeatletter
%
% \title{The \pkg{auto-pst-pdf} package}
% \author{Will Robertson \& Johannes Gro\ss{}e\\
%         \texttt{\color{gray}wspr 81 at gmail dot com}}
% \date{\filedate \qquad \fileversion}
%
% \maketitle
%
% \section{Future plans}
% This package is no longer being actively developed
% (although I'm happy to add small features and fix bugs). I (Will Robertson) first
% wrote \pkg{auto-pst-pdf} to aid the use of \pkg{psfrag} in pdf\LaTeX\ documents. The newer
% \pkg{pstool} package does this in a more efficient and convenient manner,
% and I suggest using that package instead if that's what you're using this package for.
% However, \pkg{pstool} does not yet support full \pkg{pst-pdf} usage, so \pkg{auto-pst-pdf}
% is certainly not deprecated yet.
%
% \section{Basic usage}
% This package provides a wrapper around \pkg{pst-pdf} to automatically
% accomodate for typesetting either with \DVI\ or \PDF\ output. With
% default package option |[on]|, typesetting under pdf\/\LaTeX\ will
% automatically initiate an auxiliary compilation of \LaTeX $\to$ |dvips|
% $\to$ |ps2pdf| $\to$ |pdfcrop| to generate the required \PDF\ figures for the document.
%
% After this has been done and the figures no longer need to be
% re-generated, the package can be given the |[off]| option to save
% compilation time:\par
% {\color{gray}|\usepackage[|\color{niceblue}|off|\color{gray}|]{auto-pst-pdf}|}
%
% \noindent
% If the extension of your \LaTeX\ document is not |.tex|, then it must be declared when the package is loaded (\eg, I like to use |.ltx| to distinguish between Plain \TeX\ and \LaTeX\ files):\par
% {\color{gray}|\usepackage[|\color{niceblue}|ext=ltx|\color{gray}|]{auto-pst-pdf}|}
%
% \section{Requirements}
% pdf\TeX\ must be called with the |-shell-escape| option.
% Requires the following packages: \pkg{ifplatform}, \pkg{pst-pdf}, \pkg{xkeyval}.
%
% Heiko Oberdiek's |pdfcrop| Perl script
%  \note{\url{http://www.ctan.org/tex-archive/support/pdfcrop/}}
% must be installed for the default {\color{niceblue}|crop=on|} option (see section~\ref{sec:opt}).
% Under Windows, a Perl installation
%   \note{Freely available: \url{http://www.activestate.com/Products/activeperl/index.plex}}
% will also need to be installed even though |pdfcrop| itself is part of MiK\TeX.
%
% \section{Provided macros for including graphics}
% Macros are provided to easily facilitate figures created by the
% \textsc{Matlab} package \pkg{laprint}
%  \note{\url{http://www.uni-kassel.de/fb16/rat/matlab/laprint/}}
% and the Mathematica package \pkg{MathPSfrag}
%  \note{\url{http://wwwth.mppmu.mpg.de/members/jgrosse/mathpsfrag/}}. Also,
% a generic \pkg{psfrag}
%  \note{\url{http://www.ctan.org/tex-archive/help/Catalogue/entries/psfrag.html}}
% wrapper is provided.
%
% \begin{trivlist}\item[]
% \begin{tabular}{@{\hskip 2em}lp{7cm}}
%  \cmd\mathfig\marg{filename}   & \raggedright
%    insert a Mathematica graphic from \pkg{MathPSfrag}
%    (without |-psfrag| suffix)\arraybackslash \\
%  \cmd\matlabfig\marg{filename} &
%    insert a \textsc{Matlab} graphic from \pkg{laprint} \\
%  \cmd\psfragfig\marg{filename} &
%    insert an \EPS\ with \pkg{psfrag}
% \end{tabular}
% \end{trivlist}
%
% \noindent The above commands all accept an optional argument
% which is passed to the underlying \cmd\includegraphics\ macro.
%
% The \cmd\matlabfig\ command meddles slightly with the output of
% \pkg{laprint}; the font sizes in the figure will always be as
% originally defined. (This is unavoidable I'm afraid.)
%
% For the \cmd\psfragfig\ command, \pkg{psfrag} statements are input
% from either or both of the files \meta{document}|-psfrag.tex| and
% \meta{filename}|-psfrag.tex| if they exist. Furthermore, supplementary
% \cmd\psfrag\ statements can be added in a trailing optional argument:
%
% |\psfragfig|\oarg{graphics options}\marg{filename}\oarg{psfrag statements}
%
% \noindent Manual \cmd\psfrag s override those in \meta{filename}|-psfrag.tex|
% which in turn override those in \meta{document}|-psfrag.tex|.
%
%
% \section{Advanced package options}\label{sec:opt}
%
% Better results are obtained by using |pdfcrop| in the auxiliary compilation process, and this is used by default. It is not installed by default, however, and will not always be required. Cropping with this tool can be controlled with the |crop| option:
%
% {\color{gray}|\usepackage[|\color{niceblue}|crop=off|\color{gray}|]{auto-pst-pdf}|}
%
% \bigskip\noindent
% The package automatically deletes the files generated during the auxiliary \LaTeX\ compilation. Which files are deleted are chosen by passing a list of file extensions to the |cleanup| option (no error message or warning is produced if a file is specified that does not exist). The default list is:\par
% {\color{gray}|\usepackage[|\color{niceblue}|cleanup={log,aux,dvi,ps,pdf}|\color{gray}|]{auto-pst-pdf}|}
%
% \bigskip\noindent
% If you're using cross-references of any kind within the graphics being processed by
% \pkg{pst-pdf}, it will be necessary to perform the auxiliary compilation more than once
% to resolve them. The exact number will vary by exact application, and must be set explicitly:\par
% {\color{gray}|\usepackage[|\color{niceblue}|runs=2|\color{gray}|]{auto-pst-pdf}|}
%
% \bigskip\noindent
% The options passed individually to |latex|, |dvips|, |ps2pdf|, and |pdfcrop| in the auxiliary compilation process may all be customised, if you know what you're doing. The defaults for the latter three are\par
% {\color{gray}|\usepackage[|{\color{niceblue}|dvips={-o -Ppdf}|}|,|}\par
% {\color{white}|\usepackage[|{\color{niceblue}|pspdf={-dAutoRotatePages=/None}}|}\color{gray}|,|}\par
% {\color{white}|\usepackage[|\color{niceblue}|pdfcrop={}|\color{gray}|]{auto-pst-pdf}|}
%
% \bigskip\noindent
% The \LaTeX\ auxiliary compilation has some hard-coded options (see the source if you're interested), and further options can be appended if you wish. For example, to run the auxiliary compilation with more information written to the console, use the following package option:
%
% {\color{gray}|\usepackage[|\color{niceblue}|latex={-interaction=nonstopmode}|\color{gray}|]{auto-pst-pdf}|}
%
% \bigskip\noindent
% Any package options that are not recognised are passed on to \pkg{pst-pdf}. As an example,
%
% {\color{gray}|\usepackage[|\color{niceblue}|final|\color{gray}|]{auto-pst-pdf}|}
%
% \noindent will load \pkg{pst-pdf} with the \texttt{final} package option, possibly overriding
% a global \texttt{draft} option from the class loading.
%
% \section{Acknowledgements}
%
% Many thanks to the authors of \pkg{pst-pdf}, \pkg{psfrag}, \pkg{laprint}, \pkg{MathPSfrag}, and \pkg{pdfcrop}. This package could not exist without their combined efforts over many years. Finally, Gernot \textsc{Hassenfplug} deserves special mention for extensive testing, feature suggestions, and moral support |:)| Thanks, mate.
%
% \StopEventually{}
%
% \clearpage
%
%
% \part{\pkg{\jobname} implementation}
%\iffalse
%<*package>
%\fi
%
% \section{Setup code}
% This is the package.
%
%    \begin{macrocode}
\ProvidesPackage{auto-pst-pdf}[2020/10/08 v0.7 Wrapper for pst-pdf]
%    \end{macrocode}
%
% \PrintChanges
% \changes{v0.7}{2020/10/07}{Security fix for Windows.}
% \changes{v0.6}{2009/04/26}{Pass unknown options to \pkg{pst-pdf}.}
% \changes{v0.6}{2009/04/26}{\texttt{runs} option added (thanks Joseph!!)}
% \changes{v0.5}{2007/11/22}{\texttt{delay} option removed. Keep it simple, stupid!!}
% \changes{v0.4}{2007/11/11}{Will sorted it all out.}
% \changes{v0.4}{2007/11/09}{Johannes tinkered with the code. Will will improve. :-)}
% \changes{v0.3}{2007/11/09}{Too many changes to list. Command execution totally re-written.}
%
% \paragraph{Required packages}
% \pkg{pst-pdf} is loaded later on.
%    \begin{macrocode}
\RequirePackage{ifpdf,xkeyval,ifplatform}
%    \end{macrocode}
%
% \paragraph{Things we need}
%    \begin{macrocode}
\newif\if@app@off@
\newif\if@app@crop@
\newcounter{app@runs}
\def\app@suffix{autopp}
\edef\app@jobname{\jobname-\app@suffix}
\edef\app@pics{\jobname-pics.pdf}
%    \end{macrocode}
%
% \paragraph{Option processing}
%    \begin{macrocode}
\DeclareOptionX{off}[]{\@app@off@true}
\define@choicekey{auto-pst-pdf.sty}{crop}[\@tempa\@tempb]{on,off}{%
  \ifcase\@tempb\relax
    \@app@crop@true
  \or
    \@app@crop@false
  \fi}
\DeclareOptionX{on}[]{\@app@off@false}
\DeclareOptionX{ext}{\def\app@ext{#1}}
\DeclareOptionX{latex}{%
  \def\app@latex@opts{%
    \ifwindows
      -disable-write18
    \else
      -no-shell-escape
    \fi
    -jobname="\app@jobname"
    -interaction=batchmode
    #1}}
\DeclareOptionX{dvips}{\def\app@dvips@opts{#1}}
\DeclareOptionX{pspdf}{\def\app@pspdf@opts{#1}}
\DeclareOptionX{pdfcrop}{\def\app@pdfcrop@opts{#1}}

\DeclareOptionX{cleanup}{%
  \let\app@rm@files\@empty
  \@for\@ii:=#1\do{%
    \edef\app@rm@files{\app@rm@files,\app@jobname.\@ii}}}

\DeclareOptionX{runs}{%
  \setcounter{app@runs}{#1}% support calc
  \ifnum\c@app@runs > \z@
  \else
    \app@PackageWarning{The number of runs must be at least one.}%
    \c@app@runs\@ne
  \fi}

\DeclareOptionX*{\PassOptionsToPackage{\CurrentOption}{pst-pdf}}

\ExecuteOptionsX{%
    ext=tex,
    crop=on,
    latex={},
    dvips={-Ppdf},
    pdfcrop={},
    cleanup={log,aux,dvi,ps,pdf},
    runs=1
}
\ifwindows
  \ExecuteOptionsX{pspdf={}}
\else
  \ExecuteOptionsX{pspdf={-dAutoRotatePages=/None}}
\fi
\ProcessOptionsX
%    \end{macrocode}
%
% \paragraph{Shorthands}
%    \begin{macrocode}
\def\app@exe{\immediate\write18}
\def\app@nl{^^J\space\space\space\space}
\newcommand\app@PackageError[2]{%
  \PackageError{auto-pst-pdf}{\app@nl #1^^J}{#2}}
\newcommand\app@PackageWarning[1]{%
  \PackageWarning{auto-pst-pdf}{\app@nl #1^^JThis warning occured}}
\newcommand\app@PackageInfo[1]{\PackageInfo{auto-pst-pdf}{#1}}
%    \end{macrocode}
%
% These are cute:
%    \begin{macrocode}
\newcommand\OnlyIfFileExists[2]{\IfFileExists{#1}{#2}{}}
\newcommand\NotIfFileExists[2]{\IfFileExists{#1}{}{#2}}
%    \end{macrocode}
%
% \begin{macro}{\app@convert}
% \darg{command name}
% \darg{source file}
% \darg{destination file}
% Check if the source file exists and calls the command to generate the destination file. If the final file is not created, generate an error.
%    \begin{macrocode}
\def\app@convert#1#2#3{%
  \OnlyIfFileExists{#2}{%
    \app@exe{\csname app@cmd@#1\endcsname{#2}{#3}}%
    \NotIfFileExists{#3}{\app@PackageWarning{Creation of #3 failed.}}}}
%    \end{macrocode}
% \changes{v0.5}{2007/11/21}{Fix PackageError (should have been a warning).}
% \end{macro}
%
% \begin{macro}{\app@compile}
% First we define the entire |latex| $\to$ |dvips| $\to$ |ps2pdf| ($\to$ |pdfcrop|) command sequence. The actual call to the compilation macro follows thereafter. This macro contains the actual creation of the pdf container. Each processing step is in a separate macro to allow simple modification.
%    \begin{macrocode}
\def\app@compile{%
  \app@cleanup
  \app@remove@container
  \loop\ifnum\c@app@runs > \@ne
     \app@convert{extralatex}{\jobname.\app@ext}{\app@jobname.dvi}%
     \advance\c@app@runs\m@ne
  \repeat
  \app@convert{latex}{\jobname.\app@ext}{\app@jobname.dvi}%
  \app@convert{dvips}{\app@jobname.dvi}{\app@jobname.ps}%
  \if@app@crop@
    \app@convert{pstopdf}{\app@jobname.ps}{\app@jobname.pdf}%
    \app@convert{pdfcrop}{\app@jobname.pdf}{\app@pics}%
  \else
    \app@convert{pstopdf}{\app@jobname.ps}{\app@pics}%
  \fi
  \IfFileExists{\app@pics}
    {\app@cleanup}
    {\app@PackageWarning{Could not create \app@pics.
      Auxiliary files not deleted.}}}
%    \end{macrocode}
% \end{macro}
%
% Command-line program to delete files:
%    \begin{macrocode}
\edef\app@rm{\ifwindows del \else rm -- \fi}
%    \end{macrocode}
%
% \begin{macro}{\app@try@rm}
% Macro to delete files (comma-separated) if they exist:
%    \begin{macrocode}
\newcommand\app@try@rm[1]{%
  \@for\@tempa:=#1\do{%
    \edef\@tempa{\@tempa}%
    \ifx\@tempa\@empty\else
      \OnlyIfFileExists{\@tempa}{\app@exe{\app@rm "\@tempa"}}%
    \fi
  }}
%    \end{macrocode}
% \end{macro}
%
% Remove pdf picture container:
%    \begin{macrocode}
\def\app@remove@container{\app@try@rm{\app@pics}}
%    \end{macrocode}
% Clean up auxiliary files: (\cmd\app@rm@files\ defined by the |cleanup| package option)
%    \begin{macrocode}
\def\app@cleanup{\app@try@rm{\app@rm@files}}
%    \end{macrocode}
% \LaTeX:
%    \begin{macrocode}
\def\app@cmd@latex#1#2{latex \app@latex@opts\space
  "\unexpanded{\let\APPmakepictures\empty\input} #1"}
\def\app@cmd@extralatex#1#2{latex \app@latex@opts\space
  "\unexpanded{\let\APPmakepictures\undefined\input} #1"}
%    \end{macrocode}
% |dvips|:
%    \begin{macrocode}
\def\app@cmd@dvips#1#2{dvips \app@dvips@opts\space -o "#2" "#1"}
%    \end{macrocode}
% |ps2pdf|:
%    \begin{macrocode}
\def\app@cmd@pstopdf#1#2{ps2pdf \app@pspdf@opts\space "#1" "#2"}
%    \end{macrocode}
% |pdfcrop|:
%    \begin{macrocode}
\def\app@cmd@pdfcrop#1#2{pdfcrop \app@pdfcrop@opts\space "#1" "#2"}
%    \end{macrocode}
%
% \begin{subsection}{Base functionality}
%
% For compilation, we use the |[notightpage]| option of |pst-pdf| and the
% |pdfcrop| Perl script because \EPS\ figures can have elements
% that extend ouside their bounding boxes, and end up with clipped
% content after |ps2pdf|. Otherwise the script |ps4pdf| would be sufficient.
%
% \paragraph{pdf\LaTeX\ compilation}
% Requires supplementary processing with \pkg{pst-pdf}:
%    \begin{macrocode}
\ifpdf
  \if@app@off@\else
    \ifshellescape
      \app@exe{echo "  "}
      \app@exe{echo "-------------------------------------------------"}
      \app@exe{echo "auto-pst-pdf: Auxiliary LaTeX compilation"}
      \app@exe{echo "-------------------------------------------------"}
      \app@compile
      \app@exe{echo "-------------------------------------------------"}
      \app@exe{echo "auto-pst-pdf: End auxiliary LaTeX compilation"}
      \app@exe{echo "-------------------------------------------------"}
    \else
      \app@PackageError{%
        "shell escape" (or "write18") is not enabled:\app@nl
        auto-pst-pdf will not work!}
       {You need to run LaTeX with the equivalent of
        "pdflatex -shell-escape"\app@nl
        Or turn off auto-pst-pdf.}%
    \fi
  \fi
  \if@app@crop@
    \PassOptionsToPackage{notightpage}{pst-pdf}
  \fi
%    \end{macrocode}
% \changes{v0.5}{2008/03/14}{Removed mucking about with image extensions.}
%
% \paragraph{\LaTeX\ compilation}
% Either we're calling |latex| from within a pdf\LaTeX\ run (see above) or the document is being compiled as usual.
%    \begin{macrocode}
\else
%    \end{macrocode}
% \LaTeX\ compilation from scratch (as in `|latex| \meta{document}|.tex|`) --- here the |postscript| environment does nothing and document is processed `normally':
% \changes{v0.5}{2007/11/22}{Removed \cs{ifdefined} to avoid e-\TeX.}
%    \begin{macrocode}
  \ifx\APPmakepictures\@undefined
    \PassOptionsToPackage{inactive}{pst-pdf}
%    \end{macrocode}
% \LaTeX\ compilation induced by this package:
%    \begin{macrocode}
  \else
    \if@app@crop@
      \PassOptionsToPackage{notightpage}{pst-pdf}
    \fi
  \fi
\fi
%    \end{macrocode}
%
% After the requisite package options have been declared depending on the execution mode, it's now time to load the package:
%    \begin{macrocode}
\RequirePackage{pst-pdf}
%    \end{macrocode}
%
% \end{subsection}
%
% \begin{subsection}{Extras for external packages}
%
% Commands are provided that mirror \cmd\includegraphics\ (and similarly
% accept an optional argument) for the output of different
% psfrag-related packages. This provides a consistent and easy way to
% include such figures in the document.
%
% Please suggest wrappers for other packages that output psfrag figures
% (for example: SciLab, R, Maple, LabView, Sage, ... ?)
%
% \begin{macro}{\matlabfig}
% We need to disable the scaling that laprint applies
% to \cmd\includegraphics\ in here, because otherwise labels that extend
% outside the bounding box of the generated PostScript file will
% change the intended width of the graphic.
%    \begin{macrocode}
\let\app@ig\includegraphics
\newcommand\matlabfig[2][]{%
  \begin{postscript}
    \renewcommand\resizebox[3]{##3}%
    \renewcommand\includegraphics[2][]{\app@ig[#1]{##2}}%
    \input{#2}%
  \end{postscript}}
%    \end{macrocode}
% \changes{v0.5}{2007/11/21}{Redefine \cmd\resizebox\ for \texttt{laprint}.}
% \end{macro}
%
% \begin{macro}{\mathfig}
% For Mathematica's \pkg{MathPSfrag} output
%    \begin{macrocode}
\newcommand\mathfig[2][]{%
  \begin{postscript}
    \input{#2-psfrag}%
    \includegraphics[#1]{#2-psfrag}%
  \end{postscript}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\psfragfig}
% \EPS\ graphics via \pkg{psfrag}.
% Include your psfrag commands in the files \meta{document}-psfrag.tex
% and/or \meta{figname}-psfrag.tex, where \meta{document} is the filename of the
% main document and \meta{figname} is the filename of the graphics
% inserted.
%    \begin{macrocode}
\newcommand\psfragfig[2][]{%
  \@ifnextchar[
    {\app@psfragfig[#1]{#2}}
    {\app@psfragfig[#1]{#2}[]}}
\def\app@psfragfig[#1]#2[#3]{%
  \begin{postscript}
    \InputIfFileExists{#2-psfrag}{}{}%
    #3
    \includegraphics[#1]{#2}%
  \end{postscript}}
%    \end{macrocode}
% Finally, input any psfrag commands associated with the document:
%    \begin{macrocode}
\InputIfFileExists{\jobname-psfrag}{}{}
%    \end{macrocode}
% \changes{v0.5}{2007/11/21}{Extend \cmd\psfragfig\ to accept arbitrary input for extra \cmd\psfrag\ commands.}
% \end{macro}
%
% \end{subsection}
%
%\iffalse
%</package>
%<*dtx-style>
%    \begin{macrocode}
\ProvidesPackage{dtx-style}
\errorcontextlines=999

\setcounter{IndexColumns}{2}
\renewenvironment{theglossary}
  {\small\list{}{}
     \item\relax
     \glossary@prologue\GlossaryParms
     \let\item\@idxitem \ignorespaces
     \def\pfill{\hspace*{\fill}}}
  {\endlist}

\usepackage[svgnames]{xcolor}
\usepackage{array,booktabs,calc,enumitem,fancyvrb,hyperref}
\usepackage[off]{auto-pst-pdf}
\usepackage[sc,osf]{mathpazo}

\hypersetup{colorlinks,linkcolor=black,urlcolor=black}

\linespread{1.1}      % A bit more space between lines
\frenchspacing         % Remove ugly extra space after punctuation

\definecolor{niceblue}{rgb}{0.2,0.4,0.8}
\def\theCodelineNo{\textcolor{niceblue}{\sffamily\tiny\arabic{CodelineNo}}}

\newcommand*\name[1]{{#1}}
\newcommand*\pkg[1]{\textsf{#1}}
\newcommand*\feat[1]{\texttt{#1}}
\newcommand*\opt[1]{\texttt{#1}}

\newcommand\note{\unskip\footnote}

\let\latin\textit
\def\eg{\latin{e.g.}}
\def\Eg{\latin{E.g.}}
\def\ie{\latin{i.e.}}
\def\etc{\@ifnextchar.{\latin{etc}}{\latin{etc.}\@}}

\def\DVI{\textsc{dvi}}
\def\PDF{\textsc{pdf}}
\def\EPS{\textsc{eps}}

\def\MacOSX{Mac~OS~X}
\def\ascii{\textsc{ascii}}
\def\CTAN{\textsc{ctan}}

\newcounter{argument}
\g@addto@macro\endmacro{\setcounter{argument}{0}}
\newcommand*\darg[1]{%
  \stepcounter{argument}%
  {\ttfamily\char`\#\theargument~:~}#1\par\noindent\ignorespaces}
\newcommand*\doarg[1]{%
  \stepcounter{argument}%
  {\ttfamily\makebox[0pt][r]{[}\char`\#\theargument]:~}#1\par\noindent\ignorespaces}

\def\codeline{\par\hspace{\parindent}}% two \indents in total

\setlength\parindent{2em}
\hfuzz2pt
%    \end{macrocode}
%</dtx-style>
%
%\fi
%
% \typeout{*************************************************************}
% \typeout{*}
% \typeout{* To finish the installation you have to move the following}
% \typeout{* file into a directory searched by XeTeX:}
% \typeout{*}
% \typeout{* \space\space\space auto-pst-pdf.sty}
% \typeout{*}
% \typeout{*************************************************************}
%
\endinput