summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/asyfig/asyprocess.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-06-24 16:44:01 +0000
committerKarl Berry <karl@freefriends.org>2009-06-24 16:44:01 +0000
commitc68f9012130bdc604769e59229abefc28ac1cf04 (patch)
treed94971f342c4ea8f9cbdcf4486ec1673bde87a16 /Master/texmf-dist/tex/latex/asyfig/asyprocess.sty
parent4873be2e9722a5d9a95aa8edb9859d735853ab27 (diff)
new latex package asyfig (23jun09)
git-svn-id: svn://tug.org/texlive/trunk@13944 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/asyfig/asyprocess.sty')
-rw-r--r--Master/texmf-dist/tex/latex/asyfig/asyprocess.sty59
1 files changed, 59 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/asyfig/asyprocess.sty b/Master/texmf-dist/tex/latex/asyfig/asyprocess.sty
new file mode 100644
index 00000000000..c665b37cba0
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/asyfig/asyprocess.sty
@@ -0,0 +1,59 @@
+%% LaTeX2e file `asyprocess.sty'
+%% generated by the `filecontents' environment
+%% from source `asyfig' on 2009/06/24.
+%%
+\ProvidesPackage{asyprocess}
+\nofiles
+
+\RequirePackage{ifmtarg,ifpdf,catchfile,ifplatform,color,graphicx}
+\RequirePackage[active,tightpage]{preview}
+
+\def\@par@macro{\par}
+
+\def\asy@status{asyprocess-statusfile.txt}
+
+\edef\@tempa{\detokenize{-comp}}
+\@temptokena{\def\asy@strip@comp#1}
+\expandafter\the\expandafter\@temptokena\@tempa#2\@nil{%
+ \@ifmtarg{#2}{%
+ \errorstopmode
+ \PackageError{asyprocess}{%
+ The \string\jobname\space of this compilation must end with `-comp'%
+ }{%
+ You must set the \cmd\jobname\ with the equivalent of^^J\space\space
+ pdflatex -jobname=XYZ-comp ...%
+ }
+ }{}%
+ \edef\asy@compname{#1}}
+\expandafter\expandafter\expandafter
+ \asy@strip@comp\expandafter\jobname\@tempa\@nil
+
+\newcommand\ProcessAsy{%
+ \immediate\write18{%
+ asy -wait -inlinetex -tex \ifpdf pdf\fi latex
+ \asy@compname\space 2> \asy@status}%
+ \CatchFileDef{\@tempb}{\asy@status}{}%
+ \immediate\write18{\ifwindows del \else rm \fi \asy@status}
+ \ifx\@tempb\@par@macro
+ \expandafter\@gobble
+ \else
+ \g@addto@macro\@tempb{^^J^^J%
+ ------------ ASY ERROR ------------^^J%
+ -----------------------------------}%
+ \expandafter\@firstofone
+ \fi{%
+ \errorstopmode
+ \typeout{%
+ -----------------------------------^^J%
+ ------------ ASY ERROR ------------^^J}
+ \typeout{\expandafter\strip@prefix\meaning\@tempb}
+ \batchmode
+ \end{document}}}
+
+\newcommand\ShowAsy{%
+ \begin{preview}
+ \input{\asy@compname_}
+ \end{preview}}
+
+\AtBeginDocument{\InputIfFileExists{\asy@compname_.pre}{}{}}
+