diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-13 00:03:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-13 00:03:41 +0000 |
commit | e2249e594592b4eef09d58106109fe438e77400e (patch) | |
tree | f3304485ee604952e8ebb81cf37faa1d583e1ce8 /Master/texmf-dist/tex | |
parent | c2dc4c6bd20ac276c260045df3f1bf8b00eb7a40 (diff) |
psfrag
git-svn-id: svn://tug.org/texlive/trunk@1227 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/psfrag/psfrag.sty | 209 |
1 files changed, 209 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/psfrag/psfrag.sty b/Master/texmf-dist/tex/latex/psfrag/psfrag.sty new file mode 100644 index 00000000000..5b59e5b8ee7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/psfrag/psfrag.sty @@ -0,0 +1,209 @@ +%% +%% This is file `psfrag.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% psfrag.dtx (with options: `package') +%% +%% Copyright (c) 1996 Craig Barratt, Michael C. Grant, and David Carlisle. +%% All rights reserved. +%% +%% This file is part of the PSfrag package. +%% +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{psfrag}[1998/04/11 v3.04 PSfrag (MCG)] +\newif\ifpfg@compat +\newif\ifpfg@prepass +\newif\ifpfg@debug \pfg@debugfalse +\if@compatibility + \pfg@compattrue\pfg@prepasstrue +\else + \pfg@compatfalse\pfg@prepassfalse +\fi +\def\psfragscanon{\pfg@prepasstrue} +\def\psfragscanoff{\pfg@prepassfalse} +\def\psfragdebugon{\pfg@debugtrue} +\def\psfragdebugoff{\pfg@debugfalse} +\DeclareOption{scanall}{\pfg@prepasstrue} +\DeclareOption{2emode}{\pfg@compatfalse\pfg@prepassfalse} +\DeclareOption{209mode}{\pfg@compattrue\pfg@prepasstrue} +\DeclareOption{debugshow}{\pfg@debugtrue + \PassOptionsToPackage\CurrentOption{graphics}} +\DeclareOption*{\PassOptionsToPackage\CurrentOption{graphics}} +\ProcessOptions +\RequirePackage{graphics} +\providecommand\Gin@PS@file@header[1]{\AtBeginDvi{\special{header=#1}}} +\Gin@PS@file@header{psfrag.pro} +\def\pfg@orient{1} +\def\@tempa{dvipsone.def}\ifx\Gin@driver\@tempa\def\pfg@orient{-1}\fi% +\def\@tempa{dvips.def}\ifx\Gin@driver\@tempa\def\pfg@orient{-1}\fi% +\def\@tempa{textures.def}\ifx\Gin@driver\@tempa\def\pfg@orient{-1}\fi% +\let\pfg@epsfbox\epsfbox +\let\pfg@Ginclude@eps\Ginclude@eps +\newcount\pfg@pcount \pfg@pcount=\z@ +\newcount\pfg@scount \pfg@scount=\z@ +\def\epsfbox#1{% + \begingroup + \let\Ginclude@eps\pfg@Ginclude@eps + \let\epsfbox\pfg@epsfbox + \ifpfg@prepass\pfg@scan{#1}\fi + \ifnum\pfg@scount>\z@\pfg@hidestart\fi + \pfg@epsfbox{#1}% + \ifnum\pfg@scount>\z@\pfg@hideend\fi + \endgroup} +\def\Ginclude@eps#1{% + \begingroup + \let\Ginclude@eps\pfg@Ginclude@eps + \let\epsfbox\pfg@epsfbox + \ifpfg@prepass\pfg@scan{#1}\fi + \ifnum\pfg@scount>\z@\pfg@hidestart\fi + \pfg@Ginclude@eps{#1}% + \ifnum\pfg@scount>\z@\pfg@hideend\fi + \endgroup} +\newenvironment{psfrags}{\ignorespaces}{\global\@ignoretrue} +\ifpfg@compat +\def\psfragspecial#1#2#3#4#5#6{% + \PackageError{PSfrag}% + {\string\psfragspecial no longer implemented.}{}} +\fi +\newif\ifpfg@star +\def\psfrag{\@ifstar{\pfg@startrue\@psfraga}{\pfg@starfalse\@psfraga}} +\def\@psfraga{\begingroup + \@makeother\"\@makeother\*\@makeother\!\@makeother\~% + \@makeother\:\@makeother\\\@makeother\%\@makeother\#% + \@makeother\ \@psfragb} +\ifpfg@compat +\def\@psfragb#1{\xdef\@gtempa{#1}\endgroup + \@ifnextchar[{\@psfragc{\@gtempa}}% + {\@psfrag{\@gtempa}[bl][bl][1][0]}} +\def\@psfragc#1[#2]{\@ifnextchar [{\@psfragd{#1}[#2]}% + {\@psfrag{#1}[#2][bl][1][0]}} +\else +\def\@psfragb#1{\xdef\@gtempa{#1}\endgroup + \@ifnextchar [{\@psfragc{\@gtempa}}% + {\@psfrag{\@gtempa}[Bl][Bl][1][0]}} +\def\@psfragc#1[#2]{\@ifnextchar [{\@psfragd{#1}[#2]}% + {\@psfrag{#1}[#2][Bl][1][0]}} +\fi +\def\@psfragd#1[#2][#3]{\@ifnextchar [{\@psfrage{#1}[#2][#3]}% + {\@psfrag{#1}[#2][#3][1][0]}} +\def\@psfrage#1[#2][#3][#4]{\@ifnextchar [{\@psfrag{#1}[#2][#3][#4]}% + {\@psfrag{#1}[#2][#3][#4][0]}} +\def\pfg@newstring#1.#2{% + \@nameedef{pfg@using@#2}{#1}% + \pfg@starfalse\advance\pfg@scount\@ne} +\def\@psfrag#1{% + \@ifundefined{pfg@using@#1}% + {\expandafter\pfg@newstring\the\pfg@scount.{#1}}% + {}% + \edef\@tempa{\@nameuse{pfg@using@#1}}% + \expandafter\@@psfrag\@tempa.{#1}} +\def\@@psfrag{\expandafter\@@@psfrag\the\pfg@pcount.} +\def\@nameedef#1#2{\expandafter\edef\csname #1\endcsname{#2}} +\def\@@@psfrag#1.#2.#3[#4][#5][#6][#7]#8{% + \advance\pfg@pcount\@ne + \ifpfg@star\else\@nameedef{pfg@align@#2}{(#3)[}\fi + \@nameedef{pfg@align@#2}{\@nameuse{pfg@align@#2}[#1(#5)#6 #7]}% + \@namedef{pfg@place@#1}{\pfg@@place{#1}{#4}{#8}}\ignorespaces} +\def\pfg@align#1.{\@nameuse{pfg@align@#1}} +\def\pfg@place#1.{\@nameuse{pfg@place@#1}} +\def\pfg@hidestart{% + \def\pfg@{}\count@=\z@\loop\ifnum\count@<\pfg@scount + \toks@=\expandafter{\expandafter\pfg@align\the\count@.}% + \edef\pfg@{\pfg@\the\toks@]}% + \advance\count@ by\@ne\repeat + \Gin@PS@raw{/PSfrag where{pop\pfg@\the\pfg@scount\space + \ifpfg@debug1\else0\fi\space\pfg@orient/Begin + PSfrag}{userdict /PSfrag{pop}put}ifelse}} +\def\pfg@hideend{% + \Gin@PS@raw{/End PSfrag}% + \vbox to\z@{\vss + \Gin@PS@raw{/Hide PSfrag}% + \hbox to\z@{\hss \raisebox{\depth}{% + \underline{PSfrag replacements}}}% + \Gin@PS@raw{/Unhide PSfrag}% + \count@=\z@\loop\ifnum\count@<\pfg@pcount + \expandafter\pfg@place\the\count@.% + \advance\count@ by\@ne\repeat}} +\let\pfg@dp\leftmargini\let\pfg@wd\leftmarginii +\let\pfg@dx\leftmarginiii\let\pfg@dy\leftmarginiv +\edef\pfg@bchar{ \string{ } +\edef\pfg@echar{ \string} } +\def\pfg@@place#1#2#3{\begingroup + \sbox\z@{#3}% + \dimen@=\ht\z@ \advance\dimen@ by\dp\z@% + \pfg@wd=0.5\wd\z@\pfg@dp=0.5\dimen@ + \pfg@dx=\pfg@wd\pfg@dy=\pfg@dp + \@tfor\@tempa:=#2\do{% + \if l\@tempa \pfg@dx=\z@ \pfg@wd=\wd\z@ \else + \if r\@tempa \pfg@dx=\wd\z@ \pfg@wd=\z@ \else + \if b\@tempa \pfg@dy=\z@ \pfg@dp=\z@ \else + \if t\@tempa \pfg@dy=\dimen@\pfg@dp=\dimen@\else + \if B\@tempa \pfg@dy=\dp\z@ \pfg@dp=\dp\z@ \fi\fi\fi\fi\fi}% + \setbox\z@\hbox to\z@{\hskip-\pfg@dx\box\z@\hss}% + \setbox\z@\vbox to\z@{\vss\box\z@\vskip-\pfg@dy}% + \vbox to\dimen@{\vss\hbox to\z@{\hss + \Gin@PS@raw{\pfg@bchar}\box\z@ + \Gin@PS@raw{\pfg@echar#1/Place PSfrag}% + \hskip\pfg@wd}\vskip\pfg@dp}% + \endgroup} +\newwrite\pfg@temp +\def\pfg@scan#1{\begingroup + \@tempcnta\z@ + \loop + \ifnum\@tempcnta<\@xxxii + \catcode\@tempcnta12 \advance\@tempcnta\@ne + \repeat + \let\do\@makeother\dospecials\catcode`\ 10 % + \catcode`\{=1\catcode`\}=2\catcode127=12 % + \catcode`\\=\active\catcode\endlinechar5 % + \immediate\openout\pfg@temp=\jobname.pfg % + \immediate\openin\@inputcheck=#1 % + \ifeof\@inputcheck + \PackageWarning{psfrag}{Could not scan #1...}\endgroup + \else + \message{<psfrag:#1>}% + \@tempswatrue + \loop + \ifeof\@inputcheck + \@tempswafalse + \else + \read\@inputcheck to\@tempa + \expandafter\pfg@find\@tempa{\@nil}% + \fi + \if@tempswa + \repeat + \closein\@inputcheck + \fi + \immediate\closeout\pfg@temp + \endgroup + \@input{\jobname.pfg}} +\long\def\pfg@find#1#{\pfg@finda{#1}} +\begingroup + \lccode`\~=`\\ + \lowercase{\endgroup +\long\def\pfg@finda#1#2{% + \def\@tempa{#2}% + \ifx\@tempa\@nnil + \else + \pfg@findb#1(~~tex(~~tex% + \fi} +\long\def\pfg@findb#1(~~tex#2(~~tex#3\fi{% + \fi + \ifx\box#3\box + \else + {\let~\string + \edef\@tempb{\@tempa}% + \let~\relax + \immediate\write\pfg@temp{% + \string\psfrag\space + {\string\\tex#2{\@tempa}}#2\@percentchar + ^^J\@spaces\@spaces{\@tempb}\@percentchar}}% + \let\@tempa\@empty + \fi + \expandafter\pfg@find\@tempa} +} +\endinput +%% +%% End of file `psfrag.sty'. |