summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/auto-pst-pdf/auto-pst-pdf.dtx
blob: 7976b97fd4b9b7779a3d1b64bf39cbddb9b30230 (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
562
563
564
565
566
567
568
569
% \iffalse 
%<*internal>
\iffalse
%</internal>
%<*readme>
________________________
The auto-pst-pdf package
v0.4          2007/11/18

The package uses -shell-escape to execute pst-pdf. 
This makes it especially easy to integrate into the 
workflow of an editor with just "LaTeX" and "pdfLaTeX" 
buttons.

Wrappers are provided for various psfrag-related 
features so that Matlab figures via laprint, Mathematica 
figures via MathPSfrag, and regular psfrag figures can 
all be input consistently and easily.

v0.4 adds options to change the commandline flags
passed to the auxiliary programs, improves robustness
and flexibility, and simplifies the output from using 
the package.

Will Robertson  -  wspr 81 at gmail dot com
Johannes Große

Copyright 2007
Distributed under the LaTeX Project Public License
%</readme>
%<*internal>
\fi
\begingroup
%</internal>
%<*batchfile>
\input docstrip.tex
\keepsilent
\preamble
  __________________________________
  Copyright (C) 2007  Will Robertson
  License information appended.
\endpreamble
\postamble
Copyright (C) 2007 by Will Robertson & Johannes Große

Distributable under the LaTeX Project Public License,
version 1.3c or higher (your choice). The latest version of
this license is at: http://www.latex-project.org/lppl.txt

This work is "maintained" (as per LPPL maintenance status) 
by Will Robertson.

This work consists of the file  auto-pst-pdf.dtx
          and the derived files auto-pst-pdf.pdf,
                                auto-pst-pdf.sty, and 
                                auto-pst-pdf.ins.
\endpostamble
\askforoverwritefalse
\generate{\file{\jobname.sty}{\from{\jobname.dtx}{package}}}
%</batchfile>
%<batchfile>\endbatchfile
%<*internal>
\generate{\file{\jobname.ins}{\from{\jobname.dtx}{batchfile}}}
\nopreamble\nopostamble
\generate{\file{README.txt}{\from{\jobname.dtx}{readme}}}
\generate{\file{prepare.sh}{\from{\jobname.dtx}{prepare}}}
\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{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, like many others, 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{tabular}{@{}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}
%
% \noindent
% 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.
%
% The above commands all accept an optional argument 
% which is passed to the underlying \cmd\includegraphics\ macro.
%
% \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 can be controlled with the |crop| option:\par
% {\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
% 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}|}
%
% \section{Customisation}
%
% If you want to customise the auxiliary process, this package provides
% the |delay| package option that does not execute the \pkg{pst-pdf}
% processing. Then the \cmd\app@compile\ macro can be re-defined to do whatever you like
% and the macro \cmd\CompilePics\ will invoke the auxiliary process.
%
% \StopEventually{}
%
% \clearpage
%
%
% \part{\pkg{\jobname} implementation}
%\iffalse
%<*package>
%\fi
%
% \section{Setup code}
% This is the package.
%
%    \begin{macrocode}
\ProvidesPackage{auto-pst-pdf}[2007/11/18 v0.4 Wrapper for pst-pdf]
%    \end{macrocode}
%
% \PrintChanges
% \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@delay@
\newif\if@app@crop@
\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{delay}{\@app@delay@true}
\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}}}
\ExecuteOptionsX{%
    ext=tex,
    crop=on,
    latex={},
    dvips={-Ppdf},
    pspdf={},
    pdfcrop={},
    cleanup={log,aux,dvi,ps,pdf}}
\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@PackageError{Creation of #3 failed.}}}}
%    \end{macrocode}
% \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
  \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{%
    \OnlyIfFileExists{\@tempa}{\app@exe{\app@rm "\@tempa"}}}}
%    \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 
  "\let\noexpand\APPmakepictures\noexpand\empty\noexpand\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 Matlab-created \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
    \newcommand\CompilePics{%
      \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}
%    \end{macrocode}
% Execute the compilation process unless the user is daring and wishes to do so themselves:
%    \begin{macrocode}
    \if@app@delay@\else\CompilePics\fi  
  \fi
  \if@app@crop@
    \PassOptionsToPackage{notightpage}{pst-pdf}
  \fi
%    \end{macrocode}
%
% \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 induced by this package:
%    \begin{macrocode}
  \ifdefined\APPmakepictures
    \if@app@crop@
      \PassOptionsToPackage{notightpage}{pst-pdf}
    \fi
%    \end{macrocode}
% \LaTeX\ compilation from scratch (as in `|latex| \meta{document}|.tex|`) --- here the |postscript| environment does nothing and document is processed `normally':
%    \begin{macrocode}
  \else
    \PassOptionsToPackage{inactive}{pst-pdf}
  \fi
%    \end{macrocode}
% Bug fix for |pst-pdf| (apparently):
%    \begin{macrocode}
  \AtBeginDocument{%
    \gdef\ppf@other@extensions{.png,.pdf,.jpg,.jpeg,.PNG,.PDF,.JPG,.JPEG}
    \edef\Gin@extensions{\Gin@extensions,.mps}
    \DeclareGraphicsRule{.mps}{eps}{*}{}}
\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 
% (for example: SciLab, R, Maple, LabView, ... ?)
% 
% \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\includegraphics[2][]{\app@ig[#1]{##2}}
    \input{#2}
  \end{postscript}}
%    \end{macrocode}
% \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][]{%
  \begin{postscript}
    \InputIfFileExists{#2-psfrag}{}{}%
    \includegraphics[#1]{#2}%
  \end{postscript}}
%    \end{macrocode}
% Finally, input any psfrag commands associated with the document:
% (actually, does this work?!?)
%    \begin{macrocode}
\InputIfFileExists{\jobname-psfrag}{}{}
%    \end{macrocode}
% \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}

\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>
%<*prepare>
%    \begin{macrocode}
rm auto-pst-pdf.zip
mv README.txt README

zip auto-pst-pdf.zip auto-pst-pdf.dtx auto-pst-pdf.ins auto-pst-pdf.pdf README example.tex example-psfrag.tex example.eps
%    \end{macrocode}
%</prepare>
%
%\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