summaryrefslogtreecommitdiff
path: root/support/pdfrack
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/pdfrack
Initial commit
Diffstat (limited to 'support/pdfrack')
-rw-r--r--support/pdfrack/README188
-rw-r--r--support/pdfrack/doc/BasicIdea.eps562
-rw-r--r--support/pdfrack/doc/Details.eps462
-rw-r--r--support/pdfrack/doc/pdfrack.pdfbin0 -> 239300 bytes
-rw-r--r--support/pdfrack/doc/pdfrack.tex407
-rwxr-xr-xsupport/pdfrack/pdfrack.sh429
-rw-r--r--support/pdfrack/pdfrack.sty14
-rw-r--r--support/pdfrack/testFiles/FfG.eps290
-rw-r--r--support/pdfrack/testFiles/FfG.pdfbin0 -> 5603 bytes
-rw-r--r--support/pdfrack/testFiles/OneFigure.eps143
-rw-r--r--support/pdfrack/testFiles/OneFigure.fig24
-rw-r--r--support/pdfrack/testFiles/OneFigure.pdfbin0 -> 3812 bytes
-rw-r--r--support/pdfrack/testFiles/OneFigureAgain.eps175
-rw-r--r--support/pdfrack/testFiles/OneFigureAgain.fig33
-rw-r--r--support/pdfrack/testFiles/OneFigureAgain.pdfbin0 -> 5354 bytes
-rw-r--r--support/pdfrack/testFiles/OtherFigure.eps115
-rw-r--r--support/pdfrack/testFiles/OtherFigure.fig20
-rw-r--r--support/pdfrack/testFiles/OtherFigure.pdfbin0 -> 4768 bytes
-rw-r--r--support/pdfrack/testFiles/OtherFigureAgain.eps127
-rw-r--r--support/pdfrack/testFiles/OtherFigureAgain.fig22
-rw-r--r--support/pdfrack/testFiles/OtherFigureAgain.pdfbin0 -> 5078 bytes
-rw-r--r--support/pdfrack/testFiles/aSubFile.tex15
-rw-r--r--support/pdfrack/testFiles/fR2R.eps109
-rw-r--r--support/pdfrack/testFiles/fR2R.pdfbin0 -> 3019 bytes
-rw-r--r--support/pdfrack/testFiles/makefile27
-rw-r--r--support/pdfrack/testFiles/nonidealmixture-test.tex53
-rw-r--r--support/pdfrack/testFiles/nonidealmixture.eps516
-rw-r--r--support/pdfrack/testFiles/nonidealmixture.pdfbin0 -> 7318 bytes
-rw-r--r--support/pdfrack/testFiles/nonidealmixture.pfg0
-rwxr-xr-xsupport/pdfrack/testFiles/pdfrack.sh429
-rw-r--r--support/pdfrack/testFiles/pdfrack.sty14
-rw-r--r--support/pdfrack/testFiles/pictureFile.tex7
-rw-r--r--support/pdfrack/testFiles/testDoubleImage.tex22
-rw-r--r--support/pdfrack/testFiles/testpdfrack-direct.pdfbin0 -> 16524 bytes
-rw-r--r--support/pdfrack/testFiles/testpdfrack.tex40
-rw-r--r--support/pdfrack/testFiles/toto.eps157
-rw-r--r--support/pdfrack/testFiles/toto.ps61
-rw-r--r--support/pdfrack/testFiles/withInclude.tex38
38 files changed, 4499 insertions, 0 deletions
diff --git a/support/pdfrack/README b/support/pdfrack/README
new file mode 100644
index 0000000000..429bcbf3cc
--- /dev/null
+++ b/support/pdfrack/README
@@ -0,0 +1,188 @@
+**********************************************************************
+ pdfrack = a hack for using psfrag and pdflatex
+
+ By Marc Boyer-Gandon
+ (Marc.Boyer@onera.fr)
+**********************************************************************
+
+
+pdfrack is a hack designed to help the psfrag users to be able to
+compile their documents with pdflatex.
+
+It should not be considered as a "solution" for using psfrag and
+pdftex, but as a "hack" developed for my personal use that can save
+your time also.
+
+Please, register yourself by sending me an email with [pdfrack] in the
+subject if you use it.
+
+Do not hesitate to send me an email to ask for improvements or to
+report bugs. I will fix it if I can (but I am not at all a (La)TeX
+wizard).
+
+
+ ---------------------
+ Changes
+ ---------------------
+
+
+Version: 1.0:
+ - No new feature, but stable for month, and a better documentation.
+Version: 0.5.1:
+ - Better documentation of the -a option.
+Version: 0.5:
+ - Add of the auto (-a) option
+Version: 0.4.1:
+User Changes:
+ - More files in testFile directory
+ - Removing some useless -xv at first line
+ - Fixing the noclobber bug of bash
+ - removing also .thm and .out files created by ntheorem
+Version: 0.4:
+User Changes:
+ - Add of the -M option, to handle \input, \include...
+ - Better documentation
+Version: 0.3.2.2:
+User Changes:
+ - Better documentation
+Version: 0.3.2.1:
+Implementation changes:
+ - respect of the recommandations from "LaTeX2e for class and package writers"
+Version: 0.3.2:
+User Changes:
+ - add of the 'header option'
+Version: 0.3.1.1:
+Bug fixed:
+ - a minor bug in test "testDoubleImage.tex" fixed
+Version: 0.3.1:
+User Changes:
+ - Minor messages changes
+ - automatic use of ps2eps if installed
+
+Version: 0.2
+User Changes:
+ - This version should allow you to put several pictures (with
+ includegraphics) in a single figure environment.
+ - Added the -p -e and -k options
+Implementation changes:
+ - Added a function "compileOneFigure()"
+ - Use of mktemp (if possible)
+
+
+ ---------------------
+ Table of Contents
+ ---------------------
+
+I. What does it do ?
+II. How to use it ?
+III. What is required ?
+IV. Why this name ?
+V. How to improve it ?
+VI. Temporary files
+VII. Bugs
+
+
+I. What does it do ?
+--------------------
+
+The main idea of the script is to scan your source file to find the
+figures included (with \includegraphics) and, for each figure, to make
+a single latex file with only the figure and to generate a pdf figure
+that takes into account the psfrag replacements.
+
+Then, using pdflatex, you just include the pdf figure, with the psfrag
+replacements.
+
+
+II. How to use it ?
+-------------------
+
+They are two ways to use it: the lazy automatic one (option -a), where
+all figures founds are converted, and the hand-made one, where you
+have to select the figures to be converted with the script.
+
+a) Installing it
+
+Put the script pdfrack.sh in a directory included in your path, and
+pdfrack.sty somewhere where TeX will find it.
+
+b) Your latex source files
+
+The pictures that you want to translate must be between two lines
+\begin{figure}
+\end{figure}
+and included with command \includegraphics.
+
+If you chose the lazy automatic option, do nothing.
+
+If you chose to select the figures to be translated, just
+ i) include the package pdfrack.sty
+ ii) replace \includegraphics by \pdfrackincludegraphics for all the
+ figures you want to translate.
+
+c) Running the script pdfrack.sh
+
+Then, you should run the script pdfrack.sh on your latex source
+file. It will generates the figures in pdf format.
+
+It sometimes fails :-( There could be two reasons:
+ - the translation from dvi to pdf fails, you should try
+ to put options -p and/or -e, and options -m n, with n in
+ 0..3 ; but that is not my job :-)
+ - the generated latex code is wrong, and this is my fault,
+ you can fix the script or email me
+
+Note that the '%' is is general seen as a comment, even if prefixed
+with \. So, avoid to use it.
+
+If your LaTeX code is too complex (if your figures environments are in
+included files for example), then, pdfrack will ne be able to handle
+it. Then, you should write a simpler LaTeX file, with your figure(s)
+and use this file to generate the pdf figures.
+
+d) Running pdflatex
+
+Then, you could run pdflatex on your file.
+
+
+III. What is required ?
+-----------------------
+
+The pdfrack.sh script uses a lot of other scripts and software.
+cut, dvips, epstopdf, grep, head, latex, ps2ps, ps2epsi, sort,
+tail, and, first of all, a bourne shell...
+
+Sorry for Win* users. They should install solutions like Cygwin,
+or try a Linux distribution.
+
+IV. Why this name ?
+-------------------
+
+I think a good solution for using pdflatex and psfrag should be named
+"pdfrag" or "pdffrag". I do not think that my solution is good. It is
+just a hack. Then pdfrack comes from:
+ pdf
+ + psfrag
+ + hack
+ ---------
+ pdfrack
+
+V. How to improve it ?
+----------------------
+
+You can change the code for your own purpose, and email me your
+improvement if you think it could help someone else.
+
+You can ask me some improvements, and I will try to do it.
+
+VI. Why to use it ?
+-------------------
+
+They are several other solutions (see the full documentation). This
+package tries to be simple. In run only on bash-based systems (Unix,
+Linux, MacOS).
+
+VII. Bugs
+---------
+
+It seems that there are troubles when using draftcopy and pdfdraftcopy...
diff --git a/support/pdfrack/doc/BasicIdea.eps b/support/pdfrack/doc/BasicIdea.eps
new file mode 100644
index 0000000000..b828c2fc02
--- /dev/null
+++ b/support/pdfrack/doc/BasicIdea.eps
@@ -0,0 +1,562 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: BasicIdea.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 5-alpha5
+%%CreationDate: Fri Jul 28 10:32:46 2006
+%%For: mboyer@ubu (Marc Boyer)
+%%BoundingBox: 0 0 542 605
+%Magnification: 1.0000
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+newpath 0 605 moveto 0 0 lineto 542 0 lineto 542 605 lineto closepath clip newpath
+-17.1 612.7 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+ /DrawEllipse {
+ /endangle exch def
+ /startangle exch def
+ /yrad exch def
+ /xrad exch def
+ /y exch def
+ /x exch def
+ /savematrix mtrx currentmatrix def
+ x y tr xrad yrad sc 0 0 1 startangle endangle arc
+ closepath
+ savematrix setmatrix
+ } def
+
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+$F2psBegin
+10 setmiterlimit
+0 slj 0 slc
+ 0.06000 0.06000 sc
+%
+% Fig objects follow
+%
+%
+% here starts figure with depth 50
+% Polyline
+0 slj
+0 slc
+7.500 slw
+n 2996 2100 m 3004 2100 l gs col0 s gr
+% Polyline
+n 2505 1650 m 2400 1650 2400 2445 105 arcto 4 {pop} repeat
+ 2400 2550 3495 2550 105 arcto 4 {pop} repeat
+ 3600 2550 3600 1755 105 arcto 4 {pop} repeat
+ 3600 1650 2505 1650 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+2812 2167 m
+gs 1 -1 sc (latex) col0 sh gr
+% Polyline
+n 6105 1650 m 6000 1650 6000 2445 105 arcto 4 {pop} repeat
+ 6000 2550 7095 2550 105 arcto 4 {pop} repeat
+ 7200 2550 7200 1755 105 arcto 4 {pop} repeat
+ 7200 1650 6105 1650 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+6397 2145 m
+gs 1 -1 sc (dvips) col0 sh gr
+% Polyline
+n 2400 4800 m 3600 4800 l 3600 5700 l 2400 5700 l
+ cp gs col0 s gr
+% Polyline
+n 2580 4950 m 2475 4950 2475 5145 105 arcto 4 {pop} repeat
+ 2475 5250 2745 5250 105 arcto 4 {pop} repeat
+ 2850 5250 2850 5055 105 arcto 4 {pop} repeat
+ 2850 4950 2580 4950 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 3180 4950 m 3075 4950 3075 5145 105 arcto 4 {pop} repeat
+ 3075 5250 3345 5250 105 arcto 4 {pop} repeat
+ 3450 5250 3450 5055 105 arcto 4 {pop} repeat
+ 3450 4950 3180 4950 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 2700 5025 m
+ 3300 5025 l gs col0 s gr
+% Polyline
+n 2700 5175 m
+ 3300 5100 l gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+2850 5475 m
+gs 1 -1 sc (F\(x\)) col0 sh gr
+% Ellipse
+n 4125 5100 75 75 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 4800 5100 75 75 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 3900 4800 m 5100 4800 l 5100 5700 l 3900 5700 l
+ cp gs col0 s gr
+% Polyline
+n 4680 4950 m 4575 4950 4575 5145 105 arcto 4 {pop} repeat
+ 4575 5250 4845 5250 105 arcto 4 {pop} repeat
+ 4950 5250 4950 5055 105 arcto 4 {pop} repeat
+ 4950 4950 4680 4950 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 4080 4950 m 3975 4950 3975 5145 105 arcto 4 {pop} repeat
+ 3975 5250 4245 5250 105 arcto 4 {pop} repeat
+ 4350 5250 4350 5055 105 arcto 4 {pop} repeat
+ 4350 4950 4080 4950 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 4125 5100 m
+ 4800 5100 l gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+4350 5475 m
+gs 1 -1 sc (G\(x\)) col0 sh gr
+% Polyline
+n 3255 6300 m 3150 6300 3150 7095 105 arcto 4 {pop} repeat
+ 3150 7200 4245 7200 105 arcto 4 {pop} repeat
+ 4350 7200 4350 6405 105 arcto 4 {pop} repeat
+ 4350 6300 3255 6300 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+3465 6795 m
+gs 1 -1 sc (pdfrack) col0 sh gr
+% Polyline
+n 2400 7800 m 3600 7800 l 3600 8700 l 2400 8700 l
+ cp gs col0 s gr
+% Polyline
+n 2580 7950 m 2475 7950 2475 8145 105 arcto 4 {pop} repeat
+ 2475 8250 2745 8250 105 arcto 4 {pop} repeat
+ 2850 8250 2850 8055 105 arcto 4 {pop} repeat
+ 2850 7950 2580 7950 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 3180 7950 m 3075 7950 3075 8145 105 arcto 4 {pop} repeat
+ 3075 8250 3345 8250 105 arcto 4 {pop} repeat
+ 3450 8250 3450 8055 105 arcto 4 {pop} repeat
+ 3450 7950 3180 7950 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 2700 8025 m
+ 3300 8025 l gs col0 s gr
+% Polyline
+n 2700 8175 m
+ 3300 8100 l gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+2850 8475 m
+gs 1 -1 sc (Fp\(x\)) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+2400 7650 m
+gs 1 -1 sc (F.pdf) col0 sh gr
+% Polyline
+n 3896 9750 m 3904 9750 l gs col0 s gr
+% Polyline
+n 3405 9300 m 3300 9300 3300 10095 105 arcto 4 {pop} repeat
+ 3300 10200 4395 10200 105 arcto 4 {pop} repeat
+ 4500 10200 4500 9405 105 arcto 4 {pop} repeat
+ 4500 9300 3405 9300 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+3592 9795 m
+gs 1 -1 sc (pdflatex) col0 sh gr
+% Ellipse
+n 4125 8100 75 75 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 4800 8100 75 75 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 3900 7800 m 5100 7800 l 5100 8700 l 3900 8700 l
+ cp gs col0 s gr
+% Polyline
+n 4680 7950 m 4575 7950 4575 8145 105 arcto 4 {pop} repeat
+ 4575 8250 4845 8250 105 arcto 4 {pop} repeat
+ 4950 8250 4950 8055 105 arcto 4 {pop} repeat
+ 4950 7950 4680 7950 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 4080 7950 m 3975 7950 3975 8145 105 arcto 4 {pop} repeat
+ 3975 8250 4245 8250 105 arcto 4 {pop} repeat
+ 4350 8250 4350 8055 105 arcto 4 {pop} repeat
+ 4350 7950 4080 7950 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 4125 8100 m
+ 4800 8100 l gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+4350 8475 m
+gs 1 -1 sc (Gp\(x\)) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+3900 7650 m
+gs 1 -1 sc (G.pdf) col0 sh gr
+% Polyline
+n 7800 1200 m 9000 1200 l 9000 2100 l 7800 2100 l
+ cp gs col0 s gr
+% Polyline
+n 7980 1350 m 7875 1350 7875 1545 105 arcto 4 {pop} repeat
+ 7875 1650 8145 1650 105 arcto 4 {pop} repeat
+ 8250 1650 8250 1455 105 arcto 4 {pop} repeat
+ 8250 1350 7980 1350 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 8580 1350 m 8475 1350 8475 1545 105 arcto 4 {pop} repeat
+ 8475 1650 8745 1650 105 arcto 4 {pop} repeat
+ 8850 1650 8850 1455 105 arcto 4 {pop} repeat
+ 8850 1350 8580 1350 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 8100 1425 m
+ 8700 1425 l gs col0 s gr
+% Polyline
+n 8100 1575 m
+ 8700 1500 l gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+8250 1875 m
+gs 1 -1 sc (Fp\(x\)) col0 sh gr
+% Ellipse
+n 8025 2700 75 75 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 8700 2700 75 75 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 7800 2400 m 9000 2400 l 9000 3300 l 7800 3300 l
+ cp gs col0 s gr
+% Polyline
+n 8580 2550 m 8475 2550 8475 2745 105 arcto 4 {pop} repeat
+ 8475 2850 8745 2850 105 arcto 4 {pop} repeat
+ 8850 2850 8850 2655 105 arcto 4 {pop} repeat
+ 8850 2550 8580 2550 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 7980 2550 m 7875 2550 7875 2745 105 arcto 4 {pop} repeat
+ 7875 2850 8145 2850 105 arcto 4 {pop} repeat
+ 8250 2850 8250 2655 105 arcto 4 {pop} repeat
+ 8250 2550 7980 2550 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 8025 2700 m
+ 8700 2700 l gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+8250 3075 m
+gs 1 -1 sc (Gp\(x\)) col0 sh gr
+% Polyline
+n 7500 600 m 9300 600 l 9300 3600 l 7500 3600 l
+ cp gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+7500 300 m
+gs 1 -1 sc (File.ps) col0 sh gr
+% Polyline
+n 7800 7800 m 9000 7800 l 9000 8700 l 7800 8700 l
+ cp gs col0 s gr
+% Polyline
+n 7980 7950 m 7875 7950 7875 8145 105 arcto 4 {pop} repeat
+ 7875 8250 8145 8250 105 arcto 4 {pop} repeat
+ 8250 8250 8250 8055 105 arcto 4 {pop} repeat
+ 8250 7950 7980 7950 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 8580 7950 m 8475 7950 8475 8145 105 arcto 4 {pop} repeat
+ 8475 8250 8745 8250 105 arcto 4 {pop} repeat
+ 8850 8250 8850 8055 105 arcto 4 {pop} repeat
+ 8850 7950 8580 7950 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 8100 8025 m
+ 8700 8025 l gs col0 s gr
+% Polyline
+n 8100 8175 m
+ 8700 8100 l gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+8250 8475 m
+gs 1 -1 sc (Fp\(x\)) col0 sh gr
+% Ellipse
+n 8025 9300 75 75 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 8700 9300 75 75 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 7800 9000 m 9000 9000 l 9000 9900 l 7800 9900 l
+ cp gs col0 s gr
+% Polyline
+n 8580 9150 m 8475 9150 8475 9345 105 arcto 4 {pop} repeat
+ 8475 9450 8745 9450 105 arcto 4 {pop} repeat
+ 8850 9450 8850 9255 105 arcto 4 {pop} repeat
+ 8850 9150 8580 9150 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 7980 9150 m 7875 9150 7875 9345 105 arcto 4 {pop} repeat
+ 7875 9450 8145 9450 105 arcto 4 {pop} repeat
+ 8250 9450 8250 9255 105 arcto 4 {pop} repeat
+ 8250 9150 7980 9150 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 8025 9300 m
+ 8700 9300 l gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+8250 9675 m
+gs 1 -1 sc (Gp\(x\)) col0 sh gr
+/Courier ff 135.00 scf sf
+300 2475 m
+gs 1 -1 sc (\\begin{figure}) col0 sh gr
+/Courier ff 135.00 scf sf
+300 2925 m
+gs 1 -1 sc (\\end{figure}) col0 sh gr
+/Courier ff 135.00 scf sf
+300 2700 m
+gs 1 -1 sc (\\includegraphics{G}) col0 sh gr
+% Polyline
+n 300 600 m 2100 600 l 2100 3600 l 300 3600 l
+ cp gs col0 s gr
+% Polyline
+n 3900 600 m 5700 600 l 5700 3600 l 3900 3600 l
+ cp gs col0 s gr
+% Polyline
+n 4200 1200 m 5400 1200 l 5400 2100 l 4200 2100 l
+ cp gs col0 s gr
+% Polyline
+n 4200 2400 m 5400 2400 l 5400 3300 l 4200 3300 l
+ cp gs col0 s gr
+% Polyline
+gs clippath
+5847 2130 m 6015 2130 l 6015 2070 l 5847 2070 l 5847 2070 l 5967 2100 l 5847 2130 l cp
+eoclip
+n 5700 2100 m
+ 6000 2100 l gs col0 s gr gr
+
+% arrowhead
+n 5847 2130 m 5967 2100 l 5847 2070 l col0 s
+% Polyline
+gs clippath
+6330 2703 m 6330 2535 l 6270 2535 l 6270 2703 l 6270 2703 l 6300 2583 l 6330 2703 l cp
+eoclip
+n 3000 4800 m 3000 4200 l 6300 4200 l
+ 6300 2550 l gs col0 s gr gr
+
+% arrowhead
+n 6330 2703 m 6300 2583 l 6270 2703 l col0 s
+% Polyline
+gs clippath
+6630 2778 m 6630 2610 l 6570 2610 l 6570 2778 l 6570 2778 l 6600 2658 l 6630 2778 l cp
+eoclip
+n 4500 4800 m 4500 4500 l 6600 4500 l
+ 6600 2625 l gs col0 s gr gr
+
+% arrowhead
+n 6630 2778 m 6600 2658 l 6570 2778 l col0 s
+% Polyline
+gs clippath
+3570 6147 m 3570 6315 l 3630 6315 l 3630 6147 l 3630 6147 l 3600 6267 l 3570 6147 l cp
+eoclip
+n 3000 5700 m 3000 6000 l 3600 6000 l
+ 3600 6300 l gs col0 s gr gr
+
+% arrowhead
+n 3570 6147 m 3600 6267 l 3630 6147 l col0 s
+% Polyline
+gs clippath
+3870 6147 m 3870 6315 l 3930 6315 l 3930 6147 l 3930 6147 l 3900 6267 l 3870 6147 l cp
+eoclip
+n 4500 5700 m 4500 6000 l 3900 6000 l
+ 3900 6300 l gs col0 s gr gr
+
+% arrowhead
+n 3870 6147 m 3900 6267 l 3930 6147 l col0 s
+% Polyline
+gs clippath
+2970 7647 m 2970 7815 l 3030 7815 l 3030 7647 l 3030 7647 l 3000 7767 l 2970 7647 l cp
+eoclip
+n 3600 7200 m 3600 7500 l 3000 7500 l
+ 3000 7800 l gs col0 s gr gr
+
+% arrowhead
+n 2970 7647 m 3000 7767 l 3030 7647 l col0 s
+% Polyline
+gs clippath
+4470 7647 m 4470 7815 l 4530 7815 l 4530 7647 l 4530 7647 l 4500 7767 l 4470 7647 l cp
+eoclip
+n 3900 7200 m 3900 7500 l 4500 7500 l
+ 4500 7800 l gs col0 s gr gr
+
+% arrowhead
+n 4470 7647 m 4500 7767 l 4530 7647 l col0 s
+% Polyline
+gs clippath
+2997 6780 m 3165 6780 l 3165 6720 l 2997 6720 l 2997 6720 l 3117 6750 l 2997 6780 l cp
+eoclip
+n 1200 3600 m 1200 6750 l
+ 3150 6750 l gs col0 s gr gr
+
+% arrowhead
+n 2997 6780 m 3117 6750 l 2997 6720 l col0 s
+% Polyline
+gs clippath
+3747 2130 m 3915 2130 l 3915 2070 l 3747 2070 l 3747 2070 l 3867 2100 l 3747 2130 l cp
+eoclip
+n 3600 2100 m
+ 3900 2100 l gs col0 s gr gr
+
+% arrowhead
+n 3747 2130 m 3867 2100 l 3747 2070 l col0 s
+% Polyline
+gs clippath
+3147 9780 m 3315 9780 l 3315 9720 l 3147 9720 l 3147 9720 l 3267 9750 l 3147 9780 l cp
+eoclip
+n 750 3600 m 750 9750 l
+ 3300 9750 l gs col0 s gr gr
+
+% arrowhead
+n 3147 9780 m 3267 9750 l 3147 9720 l col0 s
+% Polyline
+gs clippath
+3570 9147 m 3570 9315 l 3630 9315 l 3630 9147 l 3630 9147 l 3600 9267 l 3570 9147 l cp
+eoclip
+n 3000 8700 m 3000 9000 l 3600 9000 l
+ 3600 9300 l gs col0 s gr gr
+
+% arrowhead
+n 3570 9147 m 3600 9267 l 3630 9147 l col0 s
+% Polyline
+gs clippath
+3870 9147 m 3870 9315 l 3930 9315 l 3930 9147 l 3930 9147 l 3900 9267 l 3870 9147 l cp
+eoclip
+n 4500 8700 m 4500 9000 l 3900 9000 l
+ 3900 9300 l gs col0 s gr gr
+
+% arrowhead
+n 3870 9147 m 3900 9267 l 3930 9147 l col0 s
+% Polyline
+gs clippath
+7347 2130 m 7515 2130 l 7515 2070 l 7347 2070 l 7347 2070 l 7467 2100 l 7347 2130 l cp
+eoclip
+n 7200 2100 m
+ 7500 2100 l gs col0 s gr gr
+
+% arrowhead
+n 7347 2130 m 7467 2100 l 7347 2070 l col0 s
+% Polyline
+n 7500 7200 m 9300 7200 l 9300 10200 l 7500 10200 l
+ cp gs col0 s gr
+% Polyline
+gs clippath
+7365 8778 m 7524 8723 l 7504 8666 l 7345 8722 l 7345 8722 l 7469 8711 l 7365 8778 l cp
+eoclip
+n 4500 9750 m
+ 7500 8700 l gs col0 s gr gr
+
+% arrowhead
+n 7365 8778 m 7469 8711 l 7345 8722 l col0 s
+% Polyline
+ [60] 0 sd
+gs clippath
+2247 2130 m 2415 2130 l 2415 2070 l 2247 2070 l 2247 2070 l 2367 2100 l 2247 2130 l cp
+eoclip
+n 2100 2100 m
+ 2400 2100 l gs col0 s gr gr
+ [] 0 sd
+% arrowhead
+n 2247 2130 m 2367 2100 l 2247 2070 l col0 s
+/Times-Roman ff 180.00 scf sf
+300 300 m
+gs 1 -1 sc (File.tex) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+3900 300 m
+gs 1 -1 sc (File.dvi) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+4575 1725 m
+gs 1 -1 sc (F.eps) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+4575 2925 m
+gs 1 -1 sc (G.eps) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+2400 4650 m
+gs 1 -1 sc (F.eps) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+3900 4650 m
+gs 1 -1 sc (G.eps) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+7500 6900 m
+gs 1 -1 sc (File.pdf) col0 sh gr
+/Courier ff 135.00 scf sf
+375 1350 m
+gs 1 -1 sc (\\begin{figure}) col0 sh gr
+/Courier ff 135.00 scf sf
+375 1800 m
+gs 1 -1 sc (\\end{figure}) col0 sh gr
+/Courier ff 135.00 scf sf
+375 1575 m
+gs 1 -1 sc (\\includegraphics{F}) col0 sh gr
+% here ends figure;
+$F2psEnd
+rs
+showpage
+%%Trailer
+%EOF
diff --git a/support/pdfrack/doc/Details.eps b/support/pdfrack/doc/Details.eps
new file mode 100644
index 0000000000..2a5c974507
--- /dev/null
+++ b/support/pdfrack/doc/Details.eps
@@ -0,0 +1,462 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: Details.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 5-alpha5
+%%CreationDate: Fri Jul 28 10:32:47 2006
+%%For: mboyer@ubu (Marc Boyer)
+%%BoundingBox: 0 0 551 478
+%Magnification: 1.0000
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+newpath 0 478 moveto 0 0 lineto 551 0 lineto 551 478 lineto closepath clip newpath
+-188.3 342.7 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+ /DrawEllipse {
+ /endangle exch def
+ /startangle exch def
+ /yrad exch def
+ /xrad exch def
+ /y exch def
+ /x exch def
+ /savematrix mtrx currentmatrix def
+ x y tr xrad yrad sc 0 0 1 startangle endangle arc
+ closepath
+ savematrix setmatrix
+ } def
+
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+$F2psBegin
+10 setmiterlimit
+0 slj 0 slc
+ 0.06000 0.06000 sc
+%
+% Fig objects follow
+%
+%
+% here starts figure with depth 50
+% Polyline
+0 slj
+0 slc
+7.500 slw
+n 11100 2700 m 12300 2700 l 12300 3600 l 11100 3600 l
+ cp gs col0 s gr
+% Polyline
+n 11280 2850 m 11175 2850 11175 3045 105 arcto 4 {pop} repeat
+ 11175 3150 11445 3150 105 arcto 4 {pop} repeat
+ 11550 3150 11550 2955 105 arcto 4 {pop} repeat
+ 11550 2850 11280 2850 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 11880 2850 m 11775 2850 11775 3045 105 arcto 4 {pop} repeat
+ 11775 3150 12045 3150 105 arcto 4 {pop} repeat
+ 12150 3150 12150 2955 105 arcto 4 {pop} repeat
+ 12150 2850 11880 2850 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+gs clippath
+11847 2955 m 12015 2955 l 12015 2895 l 11847 2895 l 11847 2895 l 11967 2925 l 11847 2955 l cp
+eoclip
+n 11400 2925 m
+ 12000 2925 l gs col0 s gr gr
+
+% arrowhead
+n 11847 2955 m 11967 2925 l 11847 2895 l col0 s
+% Polyline
+gs clippath
+11851 3048 m 12018 3027 l 12011 2968 l 11844 2989 l 11844 2989 l 11967 3004 l 11851 3048 l cp
+eoclip
+n 11400 3075 m
+ 12000 3000 l gs col0 s gr gr
+
+% arrowhead
+n 11851 3048 m 11967 3004 l 11844 2989 l col0 s
+/Times-Roman ff 180.00 scf sf
+11550 3375 m
+gs 1 -1 sc (Fp\(x\)) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+11100 2550 m
+gs 1 -1 sc (F.pdf) col0 sh gr
+% Ellipse
+n 11325 4500 75 75 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 12000 4500 75 75 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 11100 4200 m 12300 4200 l 12300 5100 l 11100 5100 l
+ cp gs col0 s gr
+% Polyline
+n 11880 4350 m 11775 4350 11775 4545 105 arcto 4 {pop} repeat
+ 11775 4650 12045 4650 105 arcto 4 {pop} repeat
+ 12150 4650 12150 4455 105 arcto 4 {pop} repeat
+ 12150 4350 11880 4350 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 11280 4350 m 11175 4350 11175 4545 105 arcto 4 {pop} repeat
+ 11175 4650 11445 4650 105 arcto 4 {pop} repeat
+ 11550 4650 11550 4455 105 arcto 4 {pop} repeat
+ 11550 4350 11280 4350 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+gs clippath
+11847 4530 m 12015 4530 l 12015 4470 l 11847 4470 l 11847 4470 l 11967 4500 l 11847 4530 l cp
+eoclip
+n 11325 4500 m
+ 12000 4500 l gs col0 s gr gr
+
+% arrowhead
+n 11847 4530 m 11967 4500 l 11847 4470 l col0 s
+/Times-Roman ff 180.00 scf sf
+11550 4875 m
+gs 1 -1 sc (Gp\(x\)) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+11100 4050 m
+gs 1 -1 sc (G.pdf) col0 sh gr
+% Polyline
+n 6300 300 m 7500 300 l 7500 1200 l 6300 1200 l
+ cp gs col0 s gr
+% Polyline
+n 6480 450 m 6375 450 6375 645 105 arcto 4 {pop} repeat
+ 6375 750 6645 750 105 arcto 4 {pop} repeat
+ 6750 750 6750 555 105 arcto 4 {pop} repeat
+ 6750 450 6480 450 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 7080 450 m 6975 450 6975 645 105 arcto 4 {pop} repeat
+ 6975 750 7245 750 105 arcto 4 {pop} repeat
+ 7350 750 7350 555 105 arcto 4 {pop} repeat
+ 7350 450 7080 450 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 6600 525 m
+ 7200 525 l gs col0 s gr
+% Polyline
+n 6600 675 m
+ 7200 600 l gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+6750 975 m
+gs 1 -1 sc (F\(x\)) col0 sh gr
+% Ellipse
+n 8025 600 75 75 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 8700 600 75 75 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 7800 300 m 9000 300 l 9000 1200 l 7800 1200 l
+ cp gs col0 s gr
+% Polyline
+n 8580 450 m 8475 450 8475 645 105 arcto 4 {pop} repeat
+ 8475 750 8745 750 105 arcto 4 {pop} repeat
+ 8850 750 8850 555 105 arcto 4 {pop} repeat
+ 8850 450 8580 450 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 7980 450 m 7875 450 7875 645 105 arcto 4 {pop} repeat
+ 7875 750 8145 750 105 arcto 4 {pop} repeat
+ 8250 750 8250 555 105 arcto 4 {pop} repeat
+ 8250 450 7980 450 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 8025 600 m
+ 8700 600 l gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+8250 975 m
+gs 1 -1 sc (G\(x\)) col0 sh gr
+/Courier ff 135.00 scf sf
+3600 -1125 m
+gs 1 -1 sc (\\begin{figure}) col0 sh gr
+/Courier ff 135.00 scf sf
+3600 -675 m
+gs 1 -1 sc (\\end{figure}) col0 sh gr
+/Courier ff 135.00 scf sf
+3600 -900 m
+gs 1 -1 sc (\\includegraphics{F}) col0 sh gr
+/Courier ff 135.00 scf sf
+3600 75 m
+gs 1 -1 sc (\\begin{figure}) col0 sh gr
+/Courier ff 135.00 scf sf
+3600 525 m
+gs 1 -1 sc (\\end{figure}) col0 sh gr
+/Courier ff 135.00 scf sf
+3600 300 m
+gs 1 -1 sc (\\includegraphics{G}) col0 sh gr
+% Polyline
+n 3600 -1800 m 5400 -1800 l 5400 1200 l 3600 1200 l
+ cp gs col0 s gr
+/Times-Roman ff 180.00 scf sf
+3600 -2100 m
+gs 1 -1 sc (File.tex) col0 sh gr
+% Polyline
+n 3300 4200 m 4500 4200 l 4500 5100 l 3300 5100 l
+ cp gs col0 s gr
+% Polyline
+n 3300 2700 m 4500 2700 l 4500 3600 l 3300 3600 l
+ cp gs col0 s gr
+% Polyline
+gs clippath
+5247 3180 m 5415 3180 l 5415 3120 l 5247 3120 l 5247 3120 l 5367 3150 l 5247 3180 l cp
+eoclip
+n 4500 3150 m
+ 5400 3150 l gs col0 s gr gr
+
+% arrowhead
+n 5247 3180 m 5367 3150 l 5247 3120 l col0 s
+% Polyline
+gs clippath
+5247 4680 m 5415 4680 l 5415 4620 l 5247 4620 l 5247 4620 l 5367 4650 l 5247 4680 l cp
+eoclip
+n 4500 4650 m
+ 5400 4650 l gs col0 s gr gr
+
+% arrowhead
+n 5247 4680 m 5367 4650 l 5247 4620 l col0 s
+% Polyline
+n 5400 2700 m 6600 2700 l 6600 3600 l 5400 3600 l
+ cp gs col0 s gr
+% Polyline
+n 5400 4200 m 6600 4200 l 6600 5100 l 5400 5100 l
+ cp gs col0 s gr
+% Polyline
+gs clippath
+8199 2267 m 8351 2195 l 8325 2141 l 8173 2213 l 8173 2213 l 8295 2189 l 8199 2267 l cp
+eoclip
+n 6600 3000 m
+ 8325 2175 l gs col0 s gr gr
+
+% arrowhead
+n 8199 2267 m 8295 2189 l 8173 2213 l col0 s
+% Polyline
+gs clippath
+10946 2972 m 11102 3033 l 11124 2977 l 10968 2916 l 10968 2916 l 11069 2988 l 10946 2972 l cp
+eoclip
+n 9000 2175 m
+ 11100 3000 l gs col0 s gr gr
+
+% arrowhead
+n 10946 2972 m 11069 2988 l 10968 2916 l col0 s
+% Polyline
+n 3255 1800 m 3150 1800 3150 5595 105 arcto 4 {pop} repeat
+ 3150 5700 10695 5700 105 arcto 4 {pop} repeat
+ 10800 5700 10800 1905 105 arcto 4 {pop} repeat
+ 10800 1800 3255 1800 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+gs clippath
+7272 3105 m 7440 3105 l 7440 3045 l 7272 3045 l 7272 3045 l 7392 3075 l 7272 3105 l cp
+eoclip
+n 6600 3075 m
+ 7425 3075 l gs col0 s gr gr
+
+% arrowhead
+n 7272 3105 m 7392 3075 l 7272 3045 l col0 s
+% Polyline
+gs clippath
+8622 3105 m 8790 3105 l 8790 3045 l 8622 3045 l 8622 3045 l 8742 3075 l 8622 3105 l cp
+eoclip
+n 7875 3075 m
+ 8775 3075 l gs col0 s gr gr
+
+% arrowhead
+n 8622 3105 m 8742 3075 l 8622 3045 l col0 s
+% Polyline
+gs clippath
+10947 3105 m 11115 3105 l 11115 3045 l 10947 3045 l 10947 3045 l 11067 3075 l 10947 3105 l cp
+eoclip
+n 9300 3075 m
+ 11100 3075 l gs col0 s gr gr
+
+% arrowhead
+n 10947 3105 m 11067 3075 l 10947 3045 l col0 s
+% Polyline
+gs clippath
+7944 3524 m 8108 3557 l 8120 3498 l 7956 3466 l 7956 3466 l 8068 3519 l 7944 3524 l cp
+eoclip
+n 6600 3225 m
+ 8100 3525 l gs col0 s gr gr
+
+% arrowhead
+n 7944 3524 m 8068 3519 l 7956 3466 l col0 s
+% Polyline
+gs clippath
+10953 3203 m 11119 3177 l 11110 3118 l 10943 3143 l 10943 3143 l 11067 3155 l 10953 3203 l cp
+eoclip
+n 8700 3525 m
+ 11100 3150 l gs col0 s gr gr
+
+% arrowhead
+n 10953 3203 m 11067 3155 l 10943 3143 l col0 s
+% Polyline
+ [60] 0 sd
+gs clippath
+10947 4680 m 11115 4680 l 11115 4620 l 10947 4620 l 10947 4620 l 11067 4650 l 10947 4680 l cp
+eoclip
+n 6600 4650 m
+ 11100 4650 l gs col0 s gr gr
+ [] 0 sd
+% arrowhead
+n 10947 4680 m 11067 4650 l 10947 4620 l col0 s
+% Polyline
+gs clippath
+4470 1647 m 4470 1815 l 4530 1815 l 4530 1647 l 4530 1647 l 4500 1767 l 4470 1647 l cp
+eoclip
+n 4500 1200 m
+ 4500 1800 l gs col0 s gr gr
+
+% arrowhead
+n 4470 1647 m 4500 1767 l 4530 1647 l col0 s
+% Polyline
+gs clippath
+6870 1647 m 6870 1815 l 6930 1815 l 6930 1647 l 6930 1647 l 6900 1767 l 6870 1647 l cp
+eoclip
+n 6900 1200 m
+ 6900 1800 l gs col0 s gr gr
+
+% arrowhead
+n 6870 1647 m 6900 1767 l 6930 1647 l col0 s
+% Polyline
+gs clippath
+8370 1647 m 8370 1815 l 8430 1815 l 8430 1647 l 8430 1647 l 8400 1767 l 8370 1647 l cp
+eoclip
+n 8400 1200 m
+ 8400 1800 l gs col0 s gr gr
+
+% arrowhead
+n 8370 1647 m 8400 1767 l 8430 1647 l col0 s
+/Times-Roman ff 180.00 scf sf
+3300 2025 m
+gs 1 -1 sc (pdfrack) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+3300 2625 m
+gs 1 -1 sc (F.tex) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+3525 3150 m
+gs 1 -1 sc (figureF) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+3525 4725 m
+gs 1 -1 sc (figureG) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+3300 4125 m
+gs 1 -1 sc (G.tex) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+4800 3000 m
+gs 1 -1 sc (latex) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+4800 4500 m
+gs 1 -1 sc (latex) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+5400 2625 m
+gs 1 -1 sc (F.dvi) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+5400 4125 m
+gs 1 -1 sc (G.dvi) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+6975 3225 m
+gs 1 -1 sc 90.0 rot (dvips) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+7500 3150 m
+gs 1 -1 sc (F.ps) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+8850 3150 m
+gs 1 -1 sc (F.eps) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+8025 3000 m
+gs 1 -1 sc (ps2eps) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+9675 3000 m
+gs 1 -1 sc (eps2pdf) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+8250 3600 m
+gs 1 -1 sc (F.ps) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+8475 2250 m
+gs 1 -1 sc (F.eps) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+9600 2325 m
+gs 1 -1 sc (eps2pdf) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+9600 3600 m
+gs 1 -1 sc (ps2pdf) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+6300 150 m
+gs 1 -1 sc (F.eps) col0 sh gr
+/Times-Roman ff 180.00 scf sf
+7800 150 m
+gs 1 -1 sc (G.eps) col0 sh gr
+% here ends figure;
+$F2psEnd
+rs
+showpage
+%%Trailer
+%EOF
diff --git a/support/pdfrack/doc/pdfrack.pdf b/support/pdfrack/doc/pdfrack.pdf
new file mode 100644
index 0000000000..d2e043c385
--- /dev/null
+++ b/support/pdfrack/doc/pdfrack.pdf
Binary files differ
diff --git a/support/pdfrack/doc/pdfrack.tex b/support/pdfrack/doc/pdfrack.tex
new file mode 100644
index 0000000000..f47770f95b
--- /dev/null
+++ b/support/pdfrack/doc/pdfrack.tex
@@ -0,0 +1,407 @@
+\documentclass{article}
+\usepackage{psfrag,pdfrack}
+\usepackage{xspace}
+\usepackage{hyperref}
+\usepackage[latin1]{inputenc}
+\usepackage{srcltx}
+
+\title{The \texttt{pdfrack} manual}
+\author{Marc Boyer\\ ONERA \\ France \\
+\texttt{Marc.Boyer@onera.fr}}
+
+% Tools
+\newcommand{\pdfrack}{\texttt{pdfrack}\xspace}
+\newcommand{\pdflatex}{\texttt{pdflatex}\xspace}
+\newcommand{\Psfrag}{\texttt{psfrag}\xspace}
+\newcommand{\dvips}{\texttt{dvips}\xspace}
+% Formats
+\newcommand{\pdf}{\texttt{pdf}\xspace}
+\newcommand{\postscript}{\texttt{postscript}\xspace}
+\newcommand{\dvi}{\texttt{dvi}\xspace}
+% alias
+\newcommand{\B}{\ensuremath{\backslash}}
+\newcommand{\command}[1]{\texttt{\textbackslash{}#1}}
+
+\begin{document}
+
+\maketitle
+
+\tableofcontents
+
+
+\section{Introduction}
+
+What is \pdfrack? The \pdfrack is a \emph{hack} that allow to use
+\Psfrag and \pdflatex.
+
+The \pdfrack is not a \emph{complete} solution: it does not handle all
+\LaTeX\ files, and you will sometimes need to modify your \LaTeX\ source
+files if you want to use it. But it can help you to save time.
+
+\subsection{Why \pdfrack?}
+If you want to generate a \pdf file from a \LaTeX\ one, you either can
+do it directly, using \pdflatex, or by first generating a
+\postscript\footnote{With \LaTeX; you generate a \dvi file, and, with
+ some filter, like \texttt{dvips}, you get a \postscript one.}
+file and converting this \postscript to a \pdf file.
+
+The \Psfrag package allow the user to replace some text in a
+\postscript figure by another \LaTeX\ text. To use \Psfrag, you must
+use a filter from \dvi to \postscript. So, if you compile with
+\pdflatex, the text substutions are lost. Nevertheless, you sometimes
+want to use \pdflatex, to be
+able to add hyperlinks in your \pdf, or because your \postscript to
+\pdf filter produces a ugly text.
+
+\subsection{Basic idea}
+
+The basic idea of \pdfrack is, from your \LaTeX\ source file, to
+produce the figures in \pdf format, \emph{with the \Psfrag
+ replacements}. Then, you can compile with \pdflatex, including the
+\pdf figures.
+
+
+\begin{figure}[htbp]
+ \centering
+ \psfrag{pdflatex}[c][c][.7]{\pdflatex}
+ \psfrag{pdfrack}[c][c][.7]{\pdfrack}
+ \psfrag{dvips}[c][c][.7]{\dvips}
+ \psfrag{latex}[c][c][.7]{\texttt{latex}}
+ \psfrag{Fp(x)}{$\mathcal{F}(x)$}
+ \psfrag{Gp(x)}{$\mathcal{G}(x)$}
+ \pdfrackincludegraphics[width=\textwidth]{BasicIdea}
+ \caption{The basic idea of \pdfrack}
+ \label{fig:BasicIdea}
+\end{figure}
+
+
+\section{Using it}
+
+\subsection{Installation}
+
+Put the script \texttt{pdfrack.sh} in a directory included in your
+path, and \texttt{pdfrack.sty} somewhere where \TeX will find
+it\footnote{The variable \texttt{TEXINPUTS} defines where your \TeX
+ tool looks for inputs.}.
+
+Moreover, the \texttt{pdfrack.sh} script uses a lot of other scripts
+and software. (\texttt{cut, dvips, epstopdf, grep, head, latex,
+ ps2ps, ps2epsi, sort, tail}, and, first of all, a bourne
+shell). They all are installed with common Unix/Linux distribution,
+so, you should not have to care about it.
+
+\subsection{A very short tutorial}
+
+Assuming you have a \LaTeX\ file, with figures included using the
+following pattern:
+\begin{verbatim}
+\begin{figure}[htbp]
+ \centering
+ \psfrag{Fp(x)}{$\mathcal{F}(x)$}
+ \psfrag{Gp(x)}{$\mathcal{G}(x)$}
+ \includegraphics[width=\textwidth]{BasicIdea}
+ \caption{The basic idea of \pdfrack}
+ \label{fig:BasicIdea}
+\end{figure}
+\end{verbatim}
+
+
+They are two ways to use it: the lazy automatic one (option
+\texttt{-a}), where all figures founds are converted, and the
+hand-made one, where you have to select the figures to be converted
+with the script.
+
+\subsubsection{Lazy way}
+
+Just runs the script on your file with the \texttt{-a} option. Now,
+you can use \pdflatex (and ignore some warning messages about
+\texttt{psfrag}).
+
+That is to says, assuming that your file has name \texttt{file.tex}, just run
+\begin{verbatim}
+pdfrack.sh -a file.tex
+pdflatex file
+\end{verbatim}
+
+You have to rerun the script each time the files or the
+\texttt{psfrag} commands are modified.
+
+
+\subsubsection{Hand made way}
+
+In the hand-made one, you simply have to:
+\begin{itemize}
+\item include the \pdfrack package \verb+\usepackage{pdfrack}+
+\item replace the \verb+\includegraphics+ commands by
+ \verb+\pdfrackincludegraphics+ for all figures selected for
+ translation
+\end{itemize}
+
+Then, just run the command \texttt{pdfrack.sh} on your file. It should
+produce some output like:
+\begin{verbatim}
+----------------------------------------------
+ ---> Converting figure BasicIdea
+Using LaTeX: producting dvi
+This is e-TeX, Version 3.14159-2.1 (Web2C 7.4.5)
+entering extended mode
+Method 2: Trying conversion with dvips -|-> ps2eps -|-> eps2eps -|-> epstopdf
+Converting dvi -> ps (dvips)
+Converting ps -> eps (ps2eps)
+ Cleaning eps with eps2eps filter
+Converting eps -> pdf (epstopdf)
+Removing temporary files
+\end{verbatim}
+for each figure, and generates a standalone \pdf figure \emph{with the
+ psfrag replacements}.
+
+Then, you can run \pdflatex on your file.
+
+In the lazy automatic one, you simply have to run the command
+\texttt{pdfrack.sh} with option \texttt{-a}, and it will produce the
+same kind of output, plus some warning like \texttt{Non-PDF special
+ ignored!} when running \texttt{pdflatex}.
+
+
+\medbreak
+
+Sometimes, the bounding box of the generated file is not very good. Try
+different values for the \texttt{-m} options, and try to use or no the
+\texttt{-p} and \texttt{-e} options. If offers you 16
+possibilities. If none work, your are unlucky.
+
+See also the \texttt{README} file to have more details.
+
+\subsection{Limitations}
+
+The \pdfrack package is based on a bourne-shell script that parse the
+file to find the \verb+\begin{figure}+ and \verb+\end{figure}+
+tags. So, you must use this to way of including figure (or change the
+script).
+
+Note that the \texttt{\%} is is general seen as a comment, even if
+prefixed with $\backslash$. So, avoid to use it.
+
+If your \LaTeX\ code is too complex, then, \texttt{pdfrack} will ne be
+able to handle it. Then, you should write a simpler \LaTeX file, with
+your figure(s) and use this file to generate the pdf figures.
+
+
+\subsection{Options}
+
+
+\subsubsection{Summary}
+\label{sec:opt-sum}
+
+\begin{description}
+\item[-h] help
+\item[-m] method: integer in 0..3 (default is 2)
+ the number of the method used to convert \dvi to \pdf
+ if one method fails, try another, and add -p and/or -e options \verb+:-)+
+\item[-p] filter each postscript file with \texttt{ps2ps}
+\item[-e] filter each encapsulated postscript file with
+ \texttt{eps2eps}
+\item[-a] auto/all, translate all figures included with \verb+\includegraphics+ (avoid
+ the use of \texttt{pdfrackincludegraphics})
+\item[-i] force use of \texttt{ps2epsi} instead of \texttt{ps2eps}
+\item[-k] keep (all tempory files are keeped, usefull for debug)
+\item[-H] own header file (default is to extract from file.tex file)
+\item[-M] master file (to handle sub files)
+\end{description}
+
+
+\subsubsection{Filter options: \texttt{-m, -p, -e, -i}}
+\label{sec:opt-filter}
+
+The main source of troubles is the generation of a \pdf from the \dvi
+of \postscript file, and especially the size of the ``Bounding box''. If the
+default method fails, you should try some values of the \texttt{-m}
+option.
+
+You also can add the \texttt{-p} and \texttt{-e} options. In theory,
+they are useless, since \texttt{-p} force a \postscript to \postscript
+translation, and since \texttt{-e} does the same with encapsulated
+postscript. But in practice, it may help.
+
+In general, the filter \texttt{ps2eps} does a better job than
+\texttt{ps2epsi}. Then, by default, the script uses it. The option
+\texttt{-i} is there to force the use of \texttt{ps2epsi}.
+
+\subsubsection{Auto option}
+
+You can avoid the use of the command \texttt{pdfrackincludegraphics},
+with the option \texttt{-a}. It will generate a \pdf figure for all
+figures included with \texttt{includegraphics}, even those without any
+\psfrag replacement.
+
+\subsubsection{Other header option: \texttt{-H}}
+
+To generate the \pdf file with the \psfrag replacements, the script
+use the header of your \LaTeX\ file. But, it may be insufficient: by
+example, your \psfrag replacement can use some command defined neither
+in your header, neither in the \texttt{figure} environment. Then, you
+can write another header that will be used to generate the \pdf
+figures.
+
+\subsubsection{Handling subfiles: \texttt{-M}}
+\label{sec:opt-subfiles}
+
+If your master file made some input of some other \LaTeX\ code, with
+\command{input}, \verb+\include+ or any other command\footnote{Like the
+ \command{Input} of the \texttt{srcltx} package.}, it is not
+parsed by the \pdfrack script.
+
+You have to explicitly call the \pdfrack script on each sub file, with
+the option \texttt{-M} that specify the name of the master file, or
+the option \texttt{-H} to specify another header file.
+
+\section{How does it works?}
+
+The core of \pdfrack is a \texttt{pdfrack.sh} script that try, for
+each figure in your \LaTeX\ source, to produce a small \LaTeX\ file
+with only the figure. Then, this file is compiled with \LaTeX,
+converted into \postscript, and then, we have a \postscript figure,
+with the replacements.
+
+Now, the system should convert a \postscript file to a \pdf one, with
+the right bounding box... I am not at all a guru of \postscript
+(neither \pdf), so, I try to use some tools like \texttt{ps2ps},
+\texttt{ps2eps}, \texttt{ps2pdf} and so on. There is an option in the
+script \texttt{-m} that allow the user to chose one or the other.
+
+\begin{figure}[htbp]
+ \centering
+ \pdfrackincludegraphics[width=\textwidth]{Details}
+ \caption{Inside \pdfrack}
+\end{figure}
+
+\section{Temporary files}
+\label{sec:tmp-files}
+
+This script creates a lot of temporary files in the current directory.
+It could then overwrite an existing file. In fact, after several years
+of use, no user never complain about it, but, in case, here is a list
+a created files.
+
+If your input is called \texttt{paper.tex}, the script will create (and remove
+ if \texttt{-k} is not set) the files:
+ \texttt{paper.tex.header}
+ \texttt{paper.tex.figlines}
+ \texttt{paper.tex.figure}
+And for each figure \texttt{fig.eps} used (with
+"\texttt{pdfrackincludegraphics[..]{fig}}"), it
+will creates (and remove, if \texttt{-k} is not set)
+ \texttt{fig.tex}, \texttt{fig.log}, \texttt{fig.aux},
+ \texttt{fig.dvi}.
+
+
+\section{Knowns bugs and limitations}
+
+\begin{enumerate}
+\item \textbf{Only a subpart of my figure appears}\label{enum:subpart}
+ The main problem is the computation of the ``Bounding box'' of the
+ postscript figure. If the default method fails, try the \texttt{-m}
+ option, with different values. Adding the \texttt{-e} may also
+ help. See paragraph~\ref{sec:opt-filter}.
+\item \textbf{The figure is alone on a full page. Its seems to big.} \\
+ See item~\ref{enum:subpart}
+\item \textbf{I am a Windows user}\\
+ Neither am I\footnote{This is not always true: when I am forced to
+ write Word document, I use a Windows machine thought an
+ \texttt{rdesktop} connection.}... This solution is
+ based on some well known Unix command-line tools, like the bourne
+ shell, \texttt{ps2eps, cut, tail, grep}... To use my script on
+ windows, you should install a solution like Cygwin.
+\item \texttt{I uses two times the same file, with different
+ replacements, but only one replacement is made.} \\
+ Yes... For each \postscript file, a \pdf file is generated, with the
+ same name. Then, if the same file is used two times, with two
+ different \psfrag replacements, the same name is used twice, and
+ only one \pdf file rests. The simpler solution is to copy the
+ \postscript file, or to use some link capacity (like \texttt{ln}).
+\item \texttt{The figures in included files (with \command{include},
+ \command{input} are not taken into account}\\
+ See paragraph~\ref{sec:opt-subfiles}.
+\item \textbf{My problem is not in the known bugs list !} \\
+ Just email me.
+\end{enumerate}
+
+\section{Why this name ?}
+
+I think a good solution for using \texttt{pdflatex} and
+\texttt{psfrag} should be named \texttt{pdfrag} or \texttt{pdffrag}. I
+do not think that my solution is really good. It is just a hack. Then
+\texttt{pdfrack} comes from:
+\begin{verbatim}
+ pdf
+ + psfrag
+ + hack
+ ---------
+ pdfrack
+\end{verbatim}
+
+
+\section{Other solutions}
+
+There are, of course, other solutions:a
+\begin{description}
+\item[dvips + ps2pdf + hyperref:] Did you really need
+ \texttt{pdflatex}? Sometimes, you only want to what the "cool"
+ hyperlinks in your \pdf. In this case, just use
+ \verb+\usepackage{hyperref}+ in your code and use \texttt{dvips} and
+ \texttt{ps2pdf}.
+\item[pst-pdf, pd4pdf] See also these two packages (\texttt{ps4pdf} is
+ deprecated and replaced by \texttt{pst-pdf}). which also seem to try
+ to generate Pdf figure from Postscript code. You can get it from CTAN.
+\item[pstool] Another package, presented as ``a replacement for
+ \texttt{pst-pdf} in the r\^ole of supporting the \psfrag package
+ (which it loads) in \pdflatex''.
+\item[pdffrag] There also is a perl-based script, \texttt{pdffrag},
+ developed by Fran\c{c}ois Rouge,
+ \url{http://elessar.lautre.net/spip.php?article5}
+\item[DrawAt] Matthijs Douze (another member from ENSEEIHT) has
+ developped DrawAt, a solution for MacOS X only.
+ \url{http://www.enseeiht.fr/~douze/drawat/index.html}
+\item[unpsfrag] Félix Valado Pomarinho has developped a perl script:
+ \texttt{unpsfrag}
+\item[fragmaster] Tilman Vogel developped \texttt{fragmaster}, another
+ perl-oriented solution.
+ \url{http://www.tat.physik.uni-tuebingen.de/~vogel/fragmaster}
+\item[{pstoedit and [X]fig}] With \texttt{[X]fig}, you can already make a
+ figure and, setting the special flag to a text zone, you already can
+ put on your figures some LaTeX code, and export in the combined mode
+ either in postcript or pdf.
+
+ In the combined Postscript/LaTeX, if your file is named
+ \texttt{figure.fig}, it creates a \texttt{figure.pstex} file which
+ is the postcript version of your fig figure \emph{without the
+ special-tagged texts}, and a \texttt{figure.pstex\_t} file which
+ juste include the \texttt{figure.pstex} (with the
+ \verb+\includegraphics+ command) \emph{and} adds the LaTeX text at
+ the right place.
+
+ In the combined Pdf/LaTeX, this is the same except that
+ \texttt{figure.pstex} is named \texttt{figure.pdf} and
+ \texttt{figure.pstex\_t} is named \texttt{figure.pdf\_t} and includes
+ \texttt{figure.pdf}.
+
+ If you like to avoid the graphic
+ interface, this ca be done in command line with \texttt{fig2dev}.
+\begin{verbatim}
+fig2dev -L pstex_t figure.fig figure.pstex_t
+fig2dev -L pstex figure.fig figure.pstex
+\end{verbatim}
+
+ If you do not have a fig figure, you can transform a postcript file
+ into a fig one with \texttt{pstoedit} with command line like:
+\begin{verbatim}
+ pstoedit -dis -f fig example.eps > example.fig
+\end{verbatim}
+\item[figfrag] With \texttt{figfrag}
+ (\url{http://www.ctan.org/tex-archive/graphics/figfrag/}
+ you can use the psfrag feature in your fig picture and create a
+ standalone eps figure with the psfrag replacements.
+\end{description}
+
+
+\end{document}
diff --git a/support/pdfrack/pdfrack.sh b/support/pdfrack/pdfrack.sh
new file mode 100755
index 0000000000..8b653ae1f9
--- /dev/null
+++ b/support/pdfrack/pdfrack.sh
@@ -0,0 +1,429 @@
+#!/bin/sh -u
+# Authors: Marc Boyer
+# Esa Hyytia (header option)
+# Date : 10/6/2008
+
+# Version : 0.5
+
+# sh options
+# -u Treat unset variables as an error when substituting.
+# -v Print shell input lines as they are read.
+# -x Print commands and their arguments as they are executed.
+
+
+# Erase de LANG environment variable, because it can create bugs with
+# sed. With my "fr_FR@euro" value, some regular expression in ps2epsi
+# fail.
+LANG=
+
+# Tools
+PS2EPS=ps2epsi
+PS2EPS_CMDNAME=ps2epsi
+
+
+# Default options
+
+METHOD=2
+PS2PS_OPT=no
+EPS2EPS_OPT=no
+CLEAN_OPT="yes"
+FORCE_EPSI_OPT="no"
+OWN_HEADER_OPT=""
+MASTER_FILE_OPT=""
+AUTO="no"
+
+TMPD=/tmp
+
+
+# usage method
+usage() {
+cat <<EOF
+Usage: $0 [-h][-p][-e][-a][-m method][-H header_file.tex][-M master_file.tex] file.tex
+ -h: help
+ -m: method: integer in 0..3 (default is 2)
+ the number of the method used to convert dvi to pdf
+ if one method fails, try another, and add -p and/or -e options :-)
+ -p: filter each postscript file with ps2ps
+ -e: filter each encapsulated postscript file with eps2eps
+ -a: auto/all, translate all figures included with \includegraphics (avoid
+ the use of \pdfrackincludegraphics)
+ -i: force use of ps2epsi instead of ps2eps
+ -k: keep (all tempory files are keeped, usefull for debug)
+ -H: own header file (default is to extract from .tex file)
+ -M: master file (to handle sub files)
+
+Authors: Marc Boyer <Marc.Boyer@enseeiht.fr>
+Contributors: Esa Hyytia (header option)
+Version: 1.0
+EOF
+}
+
+
+detect_ps2eps_filter() {
+ ps2eps -V > /dev/null
+ if [ $? -ne 0 ]
+ then
+cat<<EOF
+Warning: ps2eps not found. Using ps2epsi instead
+ this should produce incorrect bounding boxes
+You can disable this warning with option -i
+You can find ps2eps at:
+ http://www.ipv6.tm.uka.de/~bless/ps2eps
+ ps2eps: (C)opyright 1998-2004 Roland Bless
+EOF
+ PS2EPS=ps2epsi
+ PS2EPS_CMDNAME=ps2epsi
+ else
+ PS2EPS=ps2eps_with_output
+ PS2EPS_CMDNAME=ps2eps
+ fi
+}
+
+
+
+cleantexfiles(){
+ if [ $CLEAN_OPT = "yes" ]
+ then
+ \rm -f ${FIGNAME}.tex ${FIGNAME}.dvi ${FIGNAME}.aux ${FIGNAME}.log ${FIGNAME}.thm
+ fi
+}
+
+cleanfiles(){
+ if [ $CLEAN_OPT = "yes" ]
+ then
+ echo "Removing temporary files"
+ cleantexfiles;
+ \rm -f $*
+ fi
+}
+
+
+detect_mktemp(){
+ mktemp /tmp/testMktemp-XXXXXX > /dev/null
+ if [ $? = "1" ]
+ then
+ echo "Warning: no mktemp foumd"
+ MKTEMP=echo
+ else
+ MKTEMP=mktemp
+ fi
+ \rm -f /tmp/testMktemp-*
+}
+
+
+# This function is "like" ps2eps except that his second argument is
+# the name of the output file
+
+ps2eps_with_output() {
+ mv $1 $1.ps
+ ps2eps -q $1.ps
+ mv $1.eps $2
+}
+
+
+# This function just runs ps2ps on its first argument, and uses
+# the second argument to store the old file, if the PS2PS_OPT is set
+# to yes
+# Classical uses are
+# ps2psFilter file.ps file.ps.bak
+# ps2psFilter file.ps file-raw.ps
+ps2psFilter(){
+ if [ ${PS2PS_OPT} = "yes" ]
+ then
+ echo " Cleaning ps with ps2ps filter"
+ mv $1 $2
+ ps2ps $2 $1
+ fi
+}
+
+# Same as ps2ps with eps
+eps2epsFilter(){
+ if [ ${EPS2EPS_OPT} = "yes" ]
+ then
+ echo " Cleaning eps with eps2eps filter"
+ mv $1 $2
+ eps2eps $2 $1
+ fi
+}
+
+# This simple version relies on dvips + ps2pdf.
+# It outputs a too wide bounding box
+dvi2pdfV0() {
+ echo "Method 0: Trying conversion with dvips -|-> ps2pdf"
+ echo "Converting dvi -> ps (dvips)"
+ FIG_DVIPS=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2ps.ps.XXXXXX`
+ FIG_DVIPS_RAW=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2ps-raw.ps.XXXXXX`
+ dvips -f -q ${FIGNAME}.dvi > ${FIG_DVIPS}
+ ps2psFilter ${FIG_DVIPS} ${FIG_DVIPS_RAW}
+ echo "Converting ps -> pdf (ps2pdf)"
+ ps2pdf ${FIG_DVIPS} ${FIGNAME}.pdf
+ cleanfiles ${FIG_DVIPS} {FIG_DVIPS_RAW};
+}
+
+
+
+# This version relies on dvips + PS2EPS + eps2pdf.
+# It often works
+dvi2pdfV1() {
+ echo "Method 1: Trying conversion with dvips -|-> "${PS2EPS_CMDNAME}" -|-> epstopdf"
+ dvi2pdfV1_noPrompt;
+}
+
+dvi2pdfV1_noPrompt() {
+ FIG_DVIPS=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2ps.ps.XXXXXX`
+ FIG_DVIPS_RAW=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2ps-raw.ps.XXXXXX`
+ FIG_DVIPS_EPS=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2ps-ps2eps.eps.XXXXXX`
+ FIG_DVIPS_EPS_RAW=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2ps-ps2eps-raw.eps.XXXXXX`
+ echo "Converting dvi -> ps (dvips)"
+ dvips -f -q ${FIGNAME}.dvi | egrep -v "^%%BoundingBox:" > ${FIG_DVIPS};
+ ps2psFilter ${FIG_DVIPS} ${FIG_DVIPS_RAW}
+ echo "Converting ps -> eps ("${PS2EPS_CMDNAME}")"
+ ${PS2EPS} ${FIG_DVIPS} ${FIG_DVIPS_EPS}
+ eps2epsFilter ${FIG_DVIPS_EPS} ${FIG_DVIPS_EPS_RAW}
+ echo "Converting eps -> pdf (epstopdf)"
+ epstopdf ${FIG_DVIPS_EPS} --outfile=${FIGNAME}.pdf
+ cleanfiles $FIG_DVIPS $FIG_DVIPS_RAW $FIG_DVIPS_EPS $FIG_DVIPS_EPS_RAW;
+}
+
+# This version relies on dvips + PS2EPS + eps2eps + eps2pdf.
+dvi2pdfV2() {
+ echo "Method 2: Trying conversion with dvips -|-> " ${PS2EPS_CMDNAME} "-|-> eps2eps -|-> epstopdf"
+ if [ $EPS2EPS_OPT = "yes" ]
+ then
+ dvi2pdfV1_noPrompt;
+ else
+ EPS2EPS_OPT="yes";
+ dvi2pdfV1_noPrompt;
+ EPS2EPS_OPT="no";
+ fi
+}
+
+
+# This version relies on dvips -E + eps2eps + eps2pdf.
+dvi2pdfV3(){
+ echo "Trying conversion with dvips -E -|-> eps2eps -|-> eps2pdf"
+ FIG_DVIEPS=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2eps.eps.XXXXXX`
+ FIG_DVIEPS_RAW=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2eps-raw.eps.XXXXXX`
+ FIG_DVIEPS_EPS=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2eps-eps2eps.eps.XXXXXX`
+ echo "Converting dvi -> eps (dvips -E)"
+ dvips -f -q -E ${FIGNAME}.dvi > ${FIG_DVIEPS}
+ echo "Tightening the bounding box (eps2eps)"
+ mv ${FIG_DVIEPS} ${FIG_DVIEPS_RAW}
+ eps2eps ${FIG_DVIEPS_RAW} ${FIG_DVIEPS_EPS}
+ echo "Converting eps -> pdf (epstopdf)"
+ epstopdf ${FIG_DVIEPS_EPS} --outfile=${FIGNAME}.pdf
+ cleanfiles $FIG_DVIEPS $FIG_DVIEPS_RAW $FIG_DVIEPS_EPS;
+}
+
+
+# Compiling one figure
+# Input: File ${MAIN}.header
+# File ${MAIN}.figure
+# ${FIGNAME}.tex
+# ${METHOD}
+compileOneFigure() {
+ echo "Using LaTeX: producting dvi"
+ cat ${MAIN}.header > ${FIGNAME}.tex
+ echo ":pagestyle{empty}:renewcommand{:caption}[1]{}" | \
+ sed 's/:/\\/g' >> ${FIGNAME}.tex
+ # There could be several pdfrackincludegraphics in the same figure
+ # environment... Then, the script should there just keep one.
+ #set -x
+ # Simple expression:
+ # grep -n "^.*\\pdfrackincludegraphics.*{${FIGNAME}}" ${MAIN}.figure
+ # More precise expression
+ KEEPED_LINE=`grep -n "^.*\\pdfrackincludegraphics\(\[[^]]*\]\)*{${FIGNAME}}" ${MAIN}.figure | cut -f1 -d:`
+ sed ${KEEPED_LINE}!s/pdfrackincludegraphics/pdfracknullcommand/ ${MAIN}.figure \
+ >> ${FIGNAME}.tex
+ echo ':end{document}' | sed 's/:/\\/g' >> ${FIGNAME}.tex
+ if [ ! -r ${FIGNAME}.tex ] ; then
+ echo "Fail: no readable file "${FIGNAME}.tex
+ return
+ fi
+ latex -interaction=batchmode ${FIGNAME}.tex
+# The main pb is: how to convert from dvi to pdf, with the right size ?
+# The option "-E" of dvips "only works [...] at marks made by
+# characters and rules, not by any included graphics".
+# So I have tried some versions, and the 2d seems to be the more
+# efficient, but, sometimes, another is better...
+ if [ -r ${FIGNAME}.dvi ]
+ then
+ case ${METHOD} in
+ 0) echo "Warning: Method 0 should produce bad size";
+ dvi2pdfV0;;
+ 1) dvi2pdfV1;;
+ 2) dvi2pdfV2;;
+ 3) dvi2pdfV3;;
+ *) echo "Unknown method "${METHOD};
+ cleantexfiles;;
+ esac
+ else
+ echo "Fail: no readable file "${FIGNAME}.dvi
+ fi
+}
+
+
+
+######################################################################
+## Main
+
+
+# Check paremetes and set options
+
+set - - `getopt ahm:H:M:peki $*`
+if [ $? != 0 ];
+then
+ usage;
+ exit;
+fi
+#echo "Options are:"$*
+for i in $*
+do
+ case $i in
+ -m) METHOD=$3; shift 2;;
+ -p) PS2PS_OPT="yes"; shift 1;;
+ -e) EPS2EPS_OPT="yes"; shift 1;;
+ -a) AUTO="yes"; shift 1;;
+ -k) CLEAN_OPT=no; shift 1;;
+ -i) FORCE_EPSI_OPT="yes"; shift 1;;
+ -H) OWN_HEADER_OPT=$3; shift 2;;
+ -M) MASTER_FILE_OPT=$3; shift 2;;
+ -h)
+ usage;
+ exit;;
+ --) shift
+ break;;
+ esac
+ # echo "Remaining options are:"$*
+ done
+ shift 1; # To drop the -- added by command set - - `getopt cho: $*`
+
+#echo "After all Remaining options are:"$*
+
+
+if [ $# -lt 1 ]
+then
+ echo "Error: No input parameter file";
+ usage;
+ exit;
+fi
+#echo "toto"
+if [ ! -f $1 -o ! -r $1 ] ; then
+ echo "Error: File $1 unreadable"
+ exit 1
+fi
+
+if [ $FORCE_EPSI_OPT = no ] ;
+then
+ detect_ps2eps_filter;
+fi
+
+if [ x$MASTER_FILE_OPT != "x" -a x$OWN_HEADER_OPT != "x" ]; then
+ echo "Error: options -M and -H are incompatible"
+ exit 1
+fi
+if [ x$MASTER_FILE_OPT != "x" ] ; then
+ if [ ! -f $MASTER_FILE_OPT -o ! -r $MASTER_FILE_OPT ]; then
+ echo "Error: file $MASTER_FILE_OPT unreadable"
+ exit 1
+ fi
+fi
+if [ x$OWN_HEADER_OPT != "x" ]; then
+ if [ ! -f $OWN_HEADER_OPT -o ! -r $OWN_HEADER_OPT ]; then
+ echo "Error: file $OWN_HEADER_OPT unreadable"
+ exit 1
+ fi
+fi
+
+
+MAIN=`basename $1 "\..*"`
+
+# Check for Dos files
+if [ `wc -l < $1` -eq 1 ] ; then
+cat <<EOF
+ Suspicious file: your file is only one line long !"
+ If your file comes from Dos/Windows world, you should"
+ try command
+ tr "\r" "\n" < MAIN > unix-MAIN
+ and then run the script on unix-MAIN
+EOF
+ echo " (with MAIN="$MAIN")"
+ exit 1
+fi
+
+# Check for bash noclober option
+if [ `basename $SHELL` = bash ] ; then
+ set +o noclobber
+fi
+
+detect_mktemp;
+
+if [ x$OWN_HEADER_OPT != "x" ]; then
+ cat $OWN_HEADER_OPT > ${MAIN}.header
+else if [ x$MASTER_FILE_OPT != "x" ]; then
+ # Extract the header of the file, is, all from first line to
+ # the "\]begin{document}"
+ HEADERSIZE=`grep -n "^[\]begin{document}" ${MASTER_FILE_OPT} | head -1 | cut -f1 -d:`
+ if [ x${HEADERSIZE} = "x" ]; then
+ echo "Error: no \\\\begin{document} found in file "${MASTER_FILE_OPT}
+ exit 1
+ fi
+ head -${HEADERSIZE} ${MASTER_FILE_OPT} > ${MAIN}.header
+else
+ HEADERSIZE=`grep -n "^[\]begin{document}" $1 | head -1 | cut -f1 -d:`
+ if [ x${HEADERSIZE} = "x" ]; then
+ echo "Error: no \\\\begin{document} found in file "$1
+ exit 1
+ fi
+ head -${HEADERSIZE} $1 > ${MAIN}.header
+fi
+fi
+
+# Create a file with the line number of the figures
+{ grep -n "^[ ]*[\]begin{figure}" $1 ; \
+ grep -n "^[ ]*[\]end{figure}" $1; } | cut -f1 -d: \
+ | sort -n > ${MAIN}.figlines
+
+# Proceedes the files
+cat ${MAIN}.figlines | while read BEGIN
+do {
+ read END
+ # Creates a file
+ DIFF=`expr ${END} - ${BEGIN} + 1`
+ head -${END} $1 | tail -${DIFF} | sed 's/^%.*$//' | \
+ sed 's/\([^\]\)%.*$/\1/'> ${MAIN}.figure
+ # Debug: grep "\pdfrackincludegraphics\[.*\]{.*}" ${MAIN}.figure
+ # Comment on the regular expression used
+ # The (extended) regular expr for egrep has 4 parts:
+ # - ^[^%] : excludes any '%' in the beginning of the line (to
+ # avoid to match a pdfrackincludegraphics in comments
+ # - \pdfrackincludegraphics : just matches the macro name
+ # - (\[[^]]*\])? : the optionnal options
+ # the (...)? means that this subpart is repeated 0 or 1 time (need egrep)
+ # the \[...\] are juste the delimiters of LaTeX option
+ # the [^]]* matches any sequence without any ']'
+ # - {[^}]*} : the name of the figure
+ # The regular expersions used by sed is quite the same, except that,
+ # - because de (...)? is not allowed, two expressions are used
+ # - there are pair of \( \) is used to capture the name of the figure
+ # - there is a .*$ used to capture the end of the line
+ if [ $AUTO = "no" ]; then
+ egrep "^[^%]*\pdfrackincludegraphics(\[[^]]*\])?{[^}]*}" ${MAIN}.figure | \
+ sed -e 's/^[^%]*\\pdfrackincludegraphics\[.*\]{\([^}]*\)}.*$/\1/' \
+ -e 's/^[^%]*\\pdfrackincludegraphics{\([^}]*\)}.*$/\1/' \
+ > ${MAIN}.fignames
+ else
+ egrep "^[^%]*\includegraphics(\[[^]]*\])?{[^}]*}" ${MAIN}.figure | \
+ sed -e 's/^[^%]*\\includegraphics\[.*\]{\([^}]*\)}.*$/\1/' \
+ -e 's/^[^%]*\\includegraphics{\([^}]*\)}.*$/\1/' \
+ > ${MAIN}.fignames
+ fi
+ for FIGNAME in `cat ${MAIN}.fignames`
+ do
+ echo "----------------------------------------------"
+ echo " ---> Converting figure $FIGNAME"
+ compileOneFigure;
+ done
+} done
+
+\rm ${MAIN}.figlines ${MAIN}.header ${MAIN}.figure ${MAIN}.fignames
diff --git a/support/pdfrack/pdfrack.sty b/support/pdfrack/pdfrack.sty
new file mode 100644
index 0000000000..971d0dad43
--- /dev/null
+++ b/support/pdfrack/pdfrack.sty
@@ -0,0 +1,14 @@
+\ProvidesPackage{pdfrack}[2007/10/15 A hack for using psfrag and pdflatex]
+\RequirePackage{psfrag}
+\RequirePackage{ifpdf}
+\RequirePackage{graphicx}
+
+\ifpdf
+ \newcommand{\pdfrackincludegraphics}[2][]{\includegraphics[]{#2}}
+\else
+ \newcommand{\pdfrackincludegraphics}[2][]{\includegraphics[#1]{#2}}
+\fi
+
+% Just a command that hide its arguments
+% It is used to ``hide'' some unexpected \pdfrackincludegraphics
+\newcommand{\pdfracknullcommand}[2][]{} \ No newline at end of file
diff --git a/support/pdfrack/testFiles/FfG.eps b/support/pdfrack/testFiles/FfG.eps
new file mode 100644
index 0000000000..5fbc0ec98d
--- /dev/null
+++ b/support/pdfrack/testFiles/FfG.eps
@@ -0,0 +1,290 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: FfG.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 5-alpha7
+%%CreationDate: Thu Jun 5 11:48:11 2008
+%%For: mboyer@ubu (Marc Boyer)
+%%BoundingBox: 0 0 433 120
+%Magnification: 1.0000
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+newpath 0 120 moveto 0 0 lineto 433 0 lineto 433 120 lineto closepath clip newpath
+-232.6 365.4 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+/reencdict 12 dict def /ReEncode { reencdict begin
+/newcodesandnames exch def /newfontname exch def /basefontname exch def
+/basefontdict basefontname findfont def /newfont basefontdict maxlength dict def
+basefontdict { exch dup /FID ne { dup /Encoding eq
+{ exch dup length array copy newfont 3 1 roll put }
+{ exch newfont 3 1 roll put } ifelse } { pop pop } ifelse } forall
+newfont /FontName newfontname put newcodesandnames aload pop
+128 1 255 { newfont /Encoding get exch /.notdef put } for
+newcodesandnames length 2 idiv { newfont /Encoding get 3 1 roll put } repeat
+newfontname newfont definefont pop end } def
+/isovec [
+8#055 /minus 8#200 /grave 8#201 /acute 8#202 /circumflex 8#203 /tilde
+8#204 /macron 8#205 /breve 8#206 /dotaccent 8#207 /dieresis
+8#210 /ring 8#211 /cedilla 8#212 /hungarumlaut 8#213 /ogonek 8#214 /caron
+8#220 /dotlessi 8#230 /oe 8#231 /OE
+8#240 /space 8#241 /exclamdown 8#242 /cent 8#243 /sterling
+8#244 /currency 8#245 /yen 8#246 /brokenbar 8#247 /section 8#250 /dieresis
+8#251 /copyright 8#252 /ordfeminine 8#253 /guillemotleft 8#254 /logicalnot
+8#255 /hyphen 8#256 /registered 8#257 /macron 8#260 /degree 8#261 /plusminus
+8#262 /twosuperior 8#263 /threesuperior 8#264 /acute 8#265 /mu 8#266 /paragraph
+8#267 /periodcentered 8#270 /cedilla 8#271 /onesuperior 8#272 /ordmasculine
+8#273 /guillemotright 8#274 /onequarter 8#275 /onehalf
+8#276 /threequarters 8#277 /questiondown 8#300 /Agrave 8#301 /Aacute
+8#302 /Acircumflex 8#303 /Atilde 8#304 /Adieresis 8#305 /Aring
+8#306 /AE 8#307 /Ccedilla 8#310 /Egrave 8#311 /Eacute
+8#312 /Ecircumflex 8#313 /Edieresis 8#314 /Igrave 8#315 /Iacute
+8#316 /Icircumflex 8#317 /Idieresis 8#320 /Eth 8#321 /Ntilde 8#322 /Ograve
+8#323 /Oacute 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply
+8#330 /Oslash 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex
+8#334 /Udieresis 8#335 /Yacute 8#336 /Thorn 8#337 /germandbls 8#340 /agrave
+8#341 /aacute 8#342 /acircumflex 8#343 /atilde 8#344 /adieresis 8#345 /aring
+8#346 /ae 8#347 /ccedilla 8#350 /egrave 8#351 /eacute
+8#352 /ecircumflex 8#353 /edieresis 8#354 /igrave 8#355 /iacute
+8#356 /icircumflex 8#357 /idieresis 8#360 /eth 8#361 /ntilde 8#362 /ograve
+8#363 /oacute 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /divide
+8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex
+8#374 /udieresis 8#375 /yacute 8#376 /thorn 8#377 /ydieresis] def
+/Times-Roman /Times-Roman-iso isovec ReEncode
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+$F2psBegin
+10 setmiterlimit
+0 slj 0 slc
+ 0.06299 0.06299 sc
+%
+% Fig objects follow
+%
+%
+% here starts figure with depth 50
+% Polyline
+2 slj
+0 slc
+7.500 slw
+n 6000 4650 m 6011 4673 l 6020 4697 l 6029 4722 l 6036 4747 l 6042 4773 l
+ 6047 4800 l 6050 4827 l 6052 4856 l 6053 4885 l 6052 4914 l
+ 6051 4944 l 6047 4975 l 6042 5006 l 6036 5038 l 6029 5069 l
+ 6019 5101 l 6009 5133 l 5997 5165 l 5984 5196 l 5969 5227 l
+ 5953 5258 l 5936 5289 l 5918 5319 l 5898 5348 l 5878 5376 l
+ 5856 5404 l 5833 5430 l 5809 5456 l 5785 5481 l 5759 5504 l
+ 5733 5527 l 5706 5549 l 5678 5569 l 5648 5589 l 5618 5607 l
+ 5588 5625 l 5557 5641 l 5526 5656 l 5493 5670 l 5460 5684 l
+ 5425 5697 l 5389 5709 l 5352 5720 l 5314 5730 l 5275 5740 l
+ 5235 5749 l 5194 5757 l 5152 5764 l 5109 5770 l 5066 5775 l
+ 5022 5780 l 4978 5783 l 4933 5786 l 4888 5787 l 4843 5788 l
+ 4798 5787 l 4753 5786 l 4709 5783 l 4665 5780 l 4621 5775 l
+ 4579 5770 l 4537 5764 l 4496 5757 l 4457 5749 l 4418 5740 l
+ 4381 5730 l 4344 5720 l 4309 5709 l 4275 5697 l 4243 5684 l
+ 4212 5670 l 4182 5656 l 4153 5641 l 4125 5625 l 4095 5606 l
+ 4067 5586 l 4040 5566 l 4014 5544 l 3989 5520 l 3965 5496 l
+ 3942 5470 l 3920 5444 l 3899 5416 l 3879 5387 l 3860 5358 l
+ 3842 5327 l 3825 5296 l 3810 5264 l 3795 5231 l 3782 5198 l
+ 3770 5165 l 3759 5131 l 3749 5097 l 3740 5064 l 3732 5030 l
+ 3725 4997 l 3719 4964 l 3715 4932 l 3711 4900 l 3708 4869 l
+ 3706 4839 l 3705 4810 l 3705 4781 l 3705 4753 l 3706 4726 l
+ 3708 4700 l 3710 4675 l 3713 4650 l 3717 4619 l 3722 4589 l
+ 3729 4559 l 3736 4531 l 3744 4503 l 3754 4476 l 3764 4449 l
+ 3776 4423 l 3789 4398 l 3803 4374 l 3818 4350 l 3834 4328 l
+ 3851 4306 l 3869 4286 l 3887 4266 l 3907 4248 l 3927 4231 l
+ 3947 4215 l 3968 4200 l 3990 4187 l 4011 4174 l 4033 4162 l
+ 4056 4152 l 4078 4142 l 4101 4133 l 4125 4125 l 4146 4118 l
+ 4167 4112 l 4189 4106 l 4212 4101 l 4236 4096 l 4260 4091 l
+ 4286 4087 l 4312 4083 l 4340 4080 l 4368 4077 l 4397 4075 l
+ 4427 4073 l 4457 4072 l 4489 4071 l 4521 4071 l 4553 4071 l
+ 4586 4072 l 4620 4073 l 4653 4075 l 4687 4077 l 4721 4080 l
+ 4755 4083 l 4788 4087 l 4822 4091 l 4856 4096 l 4890 4101 l
+ 4923 4106 l 4957 4112 l 4991 4118 l 5025 4125 l 5057 4132 l
+ 5090 4139 l 5124 4146 l 5158 4154 l 5192 4163 l 5228 4173 l
+ 5263 4183 l 5300 4193 l 5336 4205 l 5373 4217 l 5410 4230 l
+ 5447 4244 l 5484 4258 l 5521 4273 l 5558 4289 l 5594 4306 l
+ 5629 4324 l 5664 4342 l 5697 4360 l 5729 4380 l 5760 4400 l
+ 5790 4420 l 5818 4441 l 5845 4462 l 5870 4484 l 5894 4506 l
+ 5915 4529 l 5936 4552 l 5954 4576 l 5971 4600 l 5986 4625 l
+
+ cp gs col0 s gr
+% Polyline
+n 10500 4650 m 10511 4673 l 10520 4697 l 10529 4722 l 10536 4747 l 10542 4773 l
+ 10547 4800 l 10550 4827 l 10552 4856 l 10553 4885 l 10552 4914 l
+ 10551 4944 l 10547 4975 l 10542 5006 l 10536 5038 l 10529 5069 l
+ 10519 5101 l 10509 5133 l 10497 5165 l 10484 5196 l 10469 5227 l
+ 10453 5258 l 10436 5289 l 10418 5319 l 10398 5348 l 10378 5376 l
+ 10356 5404 l 10333 5430 l 10309 5456 l 10285 5481 l 10259 5504 l
+ 10233 5527 l 10206 5549 l 10178 5569 l 10148 5589 l 10118 5607 l
+ 10088 5625 l 10057 5641 l 10026 5656 l 9993 5670 l 9960 5684 l
+ 9925 5697 l 9889 5709 l 9852 5720 l 9814 5730 l 9775 5740 l
+ 9735 5749 l 9694 5757 l 9652 5764 l 9609 5770 l 9566 5775 l
+ 9522 5780 l 9478 5783 l 9433 5786 l 9388 5787 l 9343 5788 l
+ 9298 5787 l 9253 5786 l 9209 5783 l 9165 5780 l 9121 5775 l
+ 9079 5770 l 9037 5764 l 8996 5757 l 8957 5749 l 8918 5740 l
+ 8881 5730 l 8844 5720 l 8809 5709 l 8775 5697 l 8743 5684 l
+ 8712 5670 l 8682 5656 l 8653 5641 l 8625 5625 l 8595 5606 l
+ 8567 5586 l 8540 5566 l 8514 5544 l 8489 5520 l 8465 5496 l
+ 8442 5470 l 8420 5444 l 8399 5416 l 8379 5387 l 8360 5358 l
+ 8342 5327 l 8325 5296 l 8310 5264 l 8295 5231 l 8282 5198 l
+ 8270 5165 l 8259 5131 l 8249 5097 l 8240 5064 l 8232 5030 l
+ 8225 4997 l 8219 4964 l 8215 4932 l 8211 4900 l 8208 4869 l
+ 8206 4839 l 8205 4810 l 8205 4781 l 8205 4753 l 8206 4726 l
+ 8208 4700 l 8210 4675 l 8213 4650 l 8217 4619 l 8222 4589 l
+ 8229 4559 l 8236 4531 l 8244 4503 l 8254 4476 l 8264 4449 l
+ 8276 4423 l 8289 4398 l 8303 4374 l 8318 4350 l 8334 4328 l
+ 8351 4306 l 8369 4286 l 8387 4266 l 8407 4248 l 8427 4231 l
+ 8447 4215 l 8468 4200 l 8490 4187 l 8511 4174 l 8533 4162 l
+ 8556 4152 l 8578 4142 l 8601 4133 l 8625 4125 l 8646 4118 l
+ 8667 4112 l 8689 4106 l 8712 4101 l 8736 4096 l 8760 4091 l
+ 8786 4087 l 8812 4083 l 8840 4080 l 8868 4077 l 8897 4075 l
+ 8927 4073 l 8957 4072 l 8989 4071 l 9021 4071 l 9053 4071 l
+ 9086 4072 l 9120 4073 l 9153 4075 l 9187 4077 l 9221 4080 l
+ 9255 4083 l 9288 4087 l 9322 4091 l 9356 4096 l 9390 4101 l
+ 9423 4106 l 9457 4112 l 9491 4118 l 9525 4125 l 9557 4132 l
+ 9590 4139 l 9624 4146 l 9658 4154 l 9692 4163 l 9728 4173 l
+ 9763 4183 l 9800 4193 l 9836 4205 l 9873 4217 l 9910 4230 l
+ 9947 4244 l 9984 4258 l 10021 4273 l 10058 4289 l 10094 4306 l
+ 10129 4324 l 10164 4342 l 10197 4360 l 10229 4380 l 10260 4400 l
+ 10290 4420 l 10318 4441 l 10345 4462 l 10370 4484 l 10394 4506 l
+ 10415 4529 l 10436 4552 l 10454 4576 l 10471 4600 l 10486 4625 l
+
+ cp gs col0 s gr
+% Polyline
+gs clippath
+8860 4499 m 9008 4532 l 9021 4473 l 8873 4441 l 8873 4441 l 8984 4496 l 8860 4499 l cp
+eoclip
+n 4950 4500 m 4951 4500 l 4955 4499 l 4961 4498 l 4971 4496 l 4986 4493 l
+ 5006 4490 l 5030 4485 l 5061 4479 l 5097 4473 l 5139 4465 l
+ 5186 4457 l 5239 4447 l 5296 4437 l 5357 4426 l 5421 4414 l
+ 5489 4403 l 5559 4390 l 5630 4378 l 5702 4366 l 5774 4354 l
+ 5846 4342 l 5918 4330 l 5988 4318 l 6057 4307 l 6125 4297 l
+ 6190 4287 l 6254 4277 l 6316 4268 l 6376 4260 l 6433 4252 l
+ 6489 4245 l 6543 4238 l 6595 4232 l 6645 4227 l 6694 4222 l
+ 6741 4218 l 6787 4214 l 6832 4210 l 6876 4208 l 6919 4205 l
+ 6961 4203 l 7003 4202 l 7044 4201 l 7085 4200 l 7125 4200 l
+ 7169 4200 l 7213 4201 l 7257 4202 l 7301 4204 l 7345 4206 l
+ 7390 4209 l 7435 4213 l 7481 4217 l 7528 4221 l 7576 4227 l
+ 7625 4233 l 7675 4239 l 7727 4247 l 7781 4255 l 7836 4264 l
+ 7893 4273 l 7952 4283 l 8013 4294 l 8075 4305 l 8138 4317 l
+ 8203 4330 l 8268 4343 l 8334 4356 l 8400 4369 l 8465 4383 l
+ 8529 4396 l 8591 4409 l 8650 4422 l 8706 4434 l 8758 4446 l
+ 8805 4456 l 8848 4466 l 8885 4474 l 8916 4481 l 8942 4487 l
+ 8962 4491 l 8977 4495 l
+ 9000 4500 l gs col0 s gr gr
+
+% arrowhead
+0 slj
+n 8860 4499 m 8984 4496 l 8873 4441 l col0 s
+% Polyline
+2 slj
+gs clippath
+5089 4945 m 4940 4917 l 4929 4976 l 5078 5004 l 5078 5004 l 4966 4953 l 5089 4945 l cp
+eoclip
+n 9000 4950 m 8998 4950 l 8995 4951 l 8988 4953 l 8977 4955 l 8962 4959 l
+ 8942 4963 l 8916 4969 l 8885 4976 l 8848 4984 l 8805 4994 l
+ 8758 5004 l 8706 5016 l 8650 5028 l 8591 5041 l 8529 5054 l
+ 8465 5067 l 8400 5081 l 8334 5094 l 8268 5107 l 8203 5120 l
+ 8138 5133 l 8075 5145 l 8013 5156 l 7952 5167 l 7893 5177 l
+ 7836 5186 l 7781 5195 l 7727 5203 l 7675 5211 l 7625 5217 l
+ 7576 5223 l 7528 5229 l 7481 5233 l 7435 5237 l 7390 5241 l
+ 7345 5244 l 7301 5246 l 7257 5248 l 7213 5249 l 7169 5250 l
+ 7125 5250 l 7085 5250 l 7044 5249 l 7003 5248 l 6961 5247 l
+ 6919 5245 l 6876 5242 l 6832 5240 l 6787 5236 l 6741 5232 l
+ 6694 5228 l 6645 5223 l 6595 5218 l 6543 5212 l 6489 5205 l
+ 6433 5198 l 6376 5190 l 6316 5182 l 6254 5173 l 6190 5163 l
+ 6125 5153 l 6057 5143 l 5988 5132 l 5918 5120 l 5846 5108 l
+ 5774 5096 l 5702 5084 l 5630 5072 l 5559 5060 l 5489 5047 l
+ 5421 5036 l 5357 5024 l 5296 5013 l 5239 5003 l 5186 4993 l
+ 5139 4985 l 5097 4977 l 5061 4971 l 5030 4965 l 5006 4960 l
+ 4986 4957 l 4971 4954 l
+ 4950 4950 l gs col0 s gr gr
+
+% arrowhead
+0 slj
+n 5089 4945 m 4966 4953 l 5078 5004 l col0 s
+/Times-Roman-iso ff 190.50 scf sf
+6975 4050 m
+gs 1 -1 sc (f) col0 sh gr
+/Times-Roman-iso ff 190.50 scf sf
+6975 5625 m
+gs 1 -1 sc (f-inv) col0 sh gr
+/Times-Roman-iso ff 190.50 scf sf
+4275 4950 m
+gs 1 -1 sc (F) col0 sh gr
+/Times-Roman-iso ff 190.50 scf sf
+9450 4950 m
+gs 1 -1 sc (G) col0 sh gr
+% here ends figure;
+$F2psEnd
+rs
+showpage
+%%Trailer
+%EOF
diff --git a/support/pdfrack/testFiles/FfG.pdf b/support/pdfrack/testFiles/FfG.pdf
new file mode 100644
index 0000000000..f53f85fe62
--- /dev/null
+++ b/support/pdfrack/testFiles/FfG.pdf
Binary files differ
diff --git a/support/pdfrack/testFiles/OneFigure.eps b/support/pdfrack/testFiles/OneFigure.eps
new file mode 100644
index 0000000000..77187fedb6
--- /dev/null
+++ b/support/pdfrack/testFiles/OneFigure.eps
@@ -0,0 +1,143 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: OneFigure.eps
+%%Creator: fig2dev Version 3.2 Patchlevel 3d
+%%CreationDate: Wed May 14 18:20:44 2003
+%%For: mboyer@tesa22-3 (Marc Boyer)
+%%BoundingBox: 0 0 253 199
+%%Magnification: 1.0000
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+newpath 0 199 moveto 0 0 lineto 253 0 lineto 253 199 lineto closepath clip newpath
+-107.5 324.4 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+ /DrawEllipse {
+ /endangle exch def
+ /startangle exch def
+ /yrad exch def
+ /xrad exch def
+ /y exch def
+ /x exch def
+ /savematrix mtrx currentmatrix def
+ x y tr xrad yrad sc 0 0 1 startangle endangle arc
+ closepath
+ savematrix setmatrix
+ } def
+
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+$F2psBegin
+10 setmiterlimit
+ 0.06000 0.06000 sc
+%
+% Fig objects follow
+%
+7.500 slw
+% Ellipse
+n 2400 2700 600 600 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 5400 2700 600 600 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 3900 4800 600 600 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 2400 3300 m
+ 3300 4800 l gs col0 s gr
+% Polyline
+n 3000 2700 m
+ 4800 2700 l gs col0 s gr
+% Polyline
+n 4500 4800 m
+ 5400 3300 l gs col0 s gr
+/Times-Roman ff 240.00 scf sf
+2400 2700 m
+gs 1 -1 sc (CA) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+5400 2700 m
+gs 1 -1 sc (CB) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+3900 4800 m
+gs 1 -1 sc (CC) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+3600 2700 m
+gs 1 -1 sc (AB) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+4800 3900 m
+gs 1 -1 sc (BC) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+2700 3900 m
+gs 1 -1 sc (AC) col0 sh gr
+$F2psEnd
+rs
diff --git a/support/pdfrack/testFiles/OneFigure.fig b/support/pdfrack/testFiles/OneFigure.fig
new file mode 100644
index 0000000000..743e00e46e
--- /dev/null
+++ b/support/pdfrack/testFiles/OneFigure.fig
@@ -0,0 +1,24 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter
+100.00
+Single
+-2
+1200 2
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 2400 2700 600 600 2400 2700 3000 2700
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5400 2700 600 600 5400 2700 6000 2700
+1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 3900 4800 600 600 3900 4800 4500 4800
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 2400 3300 3300 4800
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 3000 2700 4800 2700
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 4500 4800 5400 3300
+4 0 0 50 0 0 16 0.0000 4 165 345 2400 2700 CA\001
+4 0 0 50 0 0 16 0.0000 4 165 330 5400 2700 CB\001
+4 0 0 50 0 0 16 0.0000 4 165 330 3900 4800 CC\001
+4 0 0 50 0 0 16 0.0000 4 165 345 3600 2700 AB\001
+4 0 0 50 0 0 16 0.0000 4 165 330 4800 3900 BC\001
+4 0 0 50 0 0 16 0.0000 4 165 345 2700 3900 AC\001
diff --git a/support/pdfrack/testFiles/OneFigure.pdf b/support/pdfrack/testFiles/OneFigure.pdf
new file mode 100644
index 0000000000..d8f6b657ee
--- /dev/null
+++ b/support/pdfrack/testFiles/OneFigure.pdf
Binary files differ
diff --git a/support/pdfrack/testFiles/OneFigureAgain.eps b/support/pdfrack/testFiles/OneFigureAgain.eps
new file mode 100644
index 0000000000..11c3bf7815
--- /dev/null
+++ b/support/pdfrack/testFiles/OneFigureAgain.eps
@@ -0,0 +1,175 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: OneFigureAgain.eps
+%%Creator: fig2dev Version 3.2 Patchlevel 3d
+%%CreationDate: Mon May 26 16:03:15 2003
+%%For: mboyer@tesa22-3 (Marc Boyer)
+%%BoundingBox: 0 0 254 190
+%%Magnification: 1.0000
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+newpath 0 190 moveto 0 0 lineto 254 0 lineto 254 190 lineto closepath clip newpath
+-107.3 319.9 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+$F2psBegin
+10 setmiterlimit
+ 0.06000 0.06000 sc
+%
+% Fig objects follow
+%
+% Polyline
+7.500 slw
+n 4500 4800 m 4200 4280 l 3600 4280 l 3300 4800 l 3600 5320 l 4200 5320 l
+
+ cp gs col0 s gr
+% Polyline
+n 6000 2705 m 5700 2185 l 5100 2185 l 4800 2705 l 5100 3225 l 5700 3225 l
+
+ cp gs col0 s gr
+% Polyline
+n 3000 2705 m 2700 2185 l 2100 2185 l 1800 2705 l 2100 3225 l 2700 3225 l
+
+ cp gs col0 s gr
+% Polyline
+2 slj
+n 3000 2700 m 3002 2698 l 3008 2694 l 3018 2686 l 3032 2675 l 3051 2661 l
+ 3074 2645 l 3100 2628 l 3128 2611 l 3157 2595 l 3185 2580 l
+ 3214 2568 l 3242 2557 l 3270 2549 l 3298 2543 l 3326 2540 l
+ 3355 2539 l 3385 2540 l 3417 2544 l 3450 2550 l 3473 2555 l
+ 3498 2561 l 3523 2568 l 3549 2575 l 3577 2584 l 3606 2593 l
+ 3635 2603 l 3666 2613 l 3697 2624 l 3730 2636 l 3763 2648 l
+ 3797 2661 l 3831 2674 l 3865 2687 l 3900 2700 l 3935 2713 l
+ 3969 2726 l 4003 2739 l 4037 2752 l 4070 2764 l 4103 2776 l
+ 4134 2787 l 4165 2797 l 4194 2807 l 4223 2816 l 4251 2825 l
+ 4277 2832 l 4302 2839 l 4327 2845 l 4350 2850 l 4383 2856 l
+ 4415 2860 l 4445 2861 l 4474 2860 l 4502 2857 l 4530 2851 l
+ 4558 2843 l 4586 2832 l 4615 2820 l 4643 2805 l 4672 2789 l
+ 4700 2772 l 4726 2755 l 4749 2739 l 4768 2725 l 4782 2714 l
+ 4792 2706 l 4798 2702 l
+ 4800 2700 l gs col0 s gr
+% Polyline
+n 5400 3225 m 5401 3228 l 5404 3234 l 5408 3246 l 5414 3264 l 5422 3288 l
+ 5432 3317 l 5443 3351 l 5455 3389 l 5467 3428 l 5478 3469 l
+ 5488 3508 l 5496 3547 l 5503 3584 l 5508 3618 l 5511 3650 l
+ 5511 3680 l 5509 3707 l 5506 3733 l 5499 3756 l 5491 3778 l
+ 5480 3799 l 5466 3819 l 5450 3838 l 5434 3853 l 5417 3869 l
+ 5398 3884 l 5377 3899 l 5355 3914 l 5331 3929 l 5305 3944 l
+ 5278 3959 l 5250 3974 l 5220 3989 l 5189 4004 l 5158 4018 l
+ 5126 4033 l 5093 4048 l 5060 4063 l 5027 4078 l 4995 4093 l
+ 4963 4107 l 4931 4122 l 4901 4136 l 4871 4150 l 4843 4165 l
+ 4816 4179 l 4790 4193 l 4765 4207 l 4742 4221 l 4720 4235 l
+ 4700 4250 l 4678 4267 l 4658 4286 l 4640 4304 l 4623 4324 l
+ 4608 4346 l 4594 4369 l 4582 4393 l 4571 4420 l 4560 4449 l
+ 4551 4480 l 4542 4513 l 4534 4547 l 4527 4583 l 4521 4619 l
+ 4516 4654 l 4511 4688 l 4508 4718 l 4505 4744 l 4503 4765 l
+ 4501 4781 l 4501 4792 l 4500 4797 l
+ 4500 4800 l gs col0 s gr
+% Polyline
+n 2400 3225 m 2399 3228 l 2396 3234 l 2392 3246 l 2386 3264 l 2378 3288 l
+ 2368 3317 l 2357 3351 l 2345 3389 l 2333 3428 l 2322 3469 l
+ 2312 3508 l 2304 3547 l 2297 3584 l 2292 3618 l 2289 3650 l
+ 2289 3680 l 2291 3707 l 2294 3733 l 2301 3756 l 2309 3778 l
+ 2320 3799 l 2334 3819 l 2350 3838 l 2366 3853 l 2383 3869 l
+ 2402 3884 l 2423 3899 l 2445 3914 l 2469 3929 l 2495 3944 l
+ 2522 3959 l 2550 3974 l 2580 3989 l 2611 4004 l 2642 4018 l
+ 2674 4033 l 2707 4048 l 2740 4063 l 2773 4078 l 2805 4093 l
+ 2837 4107 l 2869 4122 l 2899 4136 l 2929 4150 l 2957 4165 l
+ 2984 4179 l 3010 4193 l 3035 4207 l 3058 4221 l 3080 4235 l
+ 3100 4250 l 3122 4267 l 3142 4286 l 3160 4304 l 3177 4324 l
+ 3192 4346 l 3206 4369 l 3218 4393 l 3229 4420 l 3240 4449 l
+ 3249 4480 l 3258 4513 l 3266 4547 l 3273 4583 l 3279 4619 l
+ 3284 4654 l 3289 4688 l 3292 4718 l 3295 4744 l 3297 4765 l
+ 3299 4781 l 3299 4792 l 3300 4797 l
+ 3300 4800 l gs col0 s gr
+/Times-Roman ff 240.00 scf sf
+2400 2700 m
+gs 1 -1 sc (CA) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+5400 2700 m
+gs 1 -1 sc (CB) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+3900 4800 m
+gs 1 -1 sc (CC) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+3600 2700 m
+gs 1 -1 sc (AB) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+4800 3900 m
+gs 1 -1 sc (BC) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+2700 3900 m
+gs 1 -1 sc (AC) col0 sh gr
+$F2psEnd
+rs
diff --git a/support/pdfrack/testFiles/OneFigureAgain.fig b/support/pdfrack/testFiles/OneFigureAgain.fig
new file mode 100644
index 0000000000..e29fb958e4
--- /dev/null
+++ b/support/pdfrack/testFiles/OneFigureAgain.fig
@@ -0,0 +1,33 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter
+100.00
+Single
+-2
+1200 2
+2 3 0 1 0 7 50 0 -1 0.000 0 0 0 0 0 7
+ 4500 4800 4200 4280 3600 4280 3300 4800 3600 5320 4200 5320
+ 4500 4800
+2 3 0 1 0 7 50 0 -1 0.000 0 0 0 0 0 7
+ 6000 2705 5700 2185 5100 2185 4800 2705 5100 3225 5700 3225
+ 6000 2705
+2 3 0 1 0 7 50 0 -1 0.000 0 0 0 0 0 7
+ 3000 2705 2700 2185 2100 2185 1800 2705 2100 3225 2700 3225
+ 3000 2705
+3 0 0 1 0 7 50 0 -1 0.000 0 0 0 4
+ 3000 2700 3300 2400 4500 3000 4800 2700
+ 0.000 1.000 1.000 0.000
+3 0 0 1 0 7 50 0 -1 0.000 0 0 0 4
+ 5400 3225 5700 3900 4500 4200 4500 4800
+ 0.000 1.000 1.000 0.000
+3 0 0 1 0 7 50 0 -1 0.000 0 0 0 4
+ 2400 3225 2100 3900 3300 4200 3300 4800
+ 0.000 1.000 1.000 0.000
+4 0 0 50 0 0 16 0.0000 4 165 345 2400 2700 CA\001
+4 0 0 50 0 0 16 0.0000 4 165 330 5400 2700 CB\001
+4 0 0 50 0 0 16 0.0000 4 165 330 3900 4800 CC\001
+4 0 0 50 0 0 16 0.0000 4 165 345 3600 2700 AB\001
+4 0 0 50 0 0 16 0.0000 4 165 330 4800 3900 BC\001
+4 0 0 50 0 0 16 0.0000 4 165 345 2700 3900 AC\001
diff --git a/support/pdfrack/testFiles/OneFigureAgain.pdf b/support/pdfrack/testFiles/OneFigureAgain.pdf
new file mode 100644
index 0000000000..c61c1d0d31
--- /dev/null
+++ b/support/pdfrack/testFiles/OneFigureAgain.pdf
Binary files differ
diff --git a/support/pdfrack/testFiles/OtherFigure.eps b/support/pdfrack/testFiles/OtherFigure.eps
new file mode 100644
index 0000000000..27fa8ac966
--- /dev/null
+++ b/support/pdfrack/testFiles/OtherFigure.eps
@@ -0,0 +1,115 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: OtherFigure.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 3d
+%%CreationDate: Mon May 26 15:34:59 2003
+%%For: mboyer@tesa22-3 (Marc Boyer)
+%%BoundingBox: 0 0 204 110
+%%Magnification: 1.0000
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+newpath 0 110 moveto 0 0 lineto 204 0 lineto 204 110 lineto closepath clip newpath
+-197.3 198.7 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+$F2psBegin
+10 setmiterlimit
+ 0.06000 0.06000 sc
+%
+% Fig objects follow
+%
+% Polyline
+7.500 slw
+n 4200 1500 m 5700 1500 l 5700 2400 l 4200 2400 l
+ cp gs col0 s gr
+% Polyline
+n 3300 1800 m
+ 4200 1800 l gs col0 s gr
+% Polyline
+n 5700 2100 m
+ 6600 2100 l gs col0 s gr
+% Polyline
+n 4800 2400 m
+ 4800 3300 l gs col0 s gr
+/Times-Roman ff 240.00 scf sf
+3375 1725 m
+gs 1 -1 sc (IN) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+4875 3000 m
+gs 1 -1 sc (BASE) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+6150 2025 m
+gs 1 -1 sc (OUT) col0 sh gr
+$F2psEnd
+rs
diff --git a/support/pdfrack/testFiles/OtherFigure.fig b/support/pdfrack/testFiles/OtherFigure.fig
new file mode 100644
index 0000000000..0bc48f9b3d
--- /dev/null
+++ b/support/pdfrack/testFiles/OtherFigure.fig
@@ -0,0 +1,20 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter
+100.00
+Single
+-2
+1200 2
+2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
+ 4200 1500 5700 1500 5700 2400 4200 2400 4200 1500
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 3300 1800 4200 1800
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 5700 2100 6600 2100
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 4800 2400 4800 3300
+4 0 0 50 0 0 16 0.0000 4 165 255 3375 1725 IN\001
+4 0 0 50 0 0 16 0.0000 4 165 630 4875 3000 BASE\001
+4 0 0 50 0 0 16 0.0000 4 165 510 6150 2025 OUT\001
diff --git a/support/pdfrack/testFiles/OtherFigure.pdf b/support/pdfrack/testFiles/OtherFigure.pdf
new file mode 100644
index 0000000000..7e3b6dd511
--- /dev/null
+++ b/support/pdfrack/testFiles/OtherFigure.pdf
Binary files differ
diff --git a/support/pdfrack/testFiles/OtherFigureAgain.eps b/support/pdfrack/testFiles/OtherFigureAgain.eps
new file mode 100644
index 0000000000..8d07ec46a8
--- /dev/null
+++ b/support/pdfrack/testFiles/OtherFigureAgain.eps
@@ -0,0 +1,127 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: OtherFigureAgain.eps
+%%Creator: fig2dev Version 3.2 Patchlevel 3d
+%%CreationDate: Mon May 26 16:04:34 2003
+%%For: mboyer@tesa22-3 (Marc Boyer)
+%%BoundingBox: 0 0 254 123
+%%Magnification: 1.0000
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+newpath 0 123 moveto 0 0 lineto 254 0 lineto 254 123 lineto closepath clip newpath
+-170.3 198.7 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+$F2psBegin
+10 setmiterlimit
+ 0.06000 0.06000 sc
+%
+% Fig objects follow
+%
+% Polyline
+7.500 slw
+n 2955 1275 m 2850 1275 2850 1920 105 arcto 4 {pop} repeat
+ 2850 2025 4095 2025 105 arcto 4 {pop} repeat
+ 4200 2025 4200 1380 105 arcto 4 {pop} repeat
+ 4200 1275 2955 1275 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 5805 1575 m 5700 1575 5700 2220 105 arcto 4 {pop} repeat
+ 5700 2325 6945 2325 105 arcto 4 {pop} repeat
+ 7050 2325 7050 1680 105 arcto 4 {pop} repeat
+ 7050 1575 5805 1575 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 4605 2550 m 4500 2550 4500 3195 105 arcto 4 {pop} repeat
+ 4500 3300 5745 3300 105 arcto 4 {pop} repeat
+ 5850 3300 5850 2655 105 arcto 4 {pop} repeat
+ 5850 2550 4605 2550 105 arcto 4 {pop} repeat
+ cp gs col0 s gr
+% Polyline
+n 4200 1650 m
+ 5700 2025 l gs col0 s gr
+% Polyline
+n 5100 1875 m
+ 5100 2550 l gs col0 s gr
+/Times-Roman ff 240.00 scf sf
+3375 1725 m
+gs 1 -1 sc (IN) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+4875 3000 m
+gs 1 -1 sc (BASE) col0 sh gr
+/Times-Roman ff 240.00 scf sf
+6150 2025 m
+gs 1 -1 sc (OUT) col0 sh gr
+$F2psEnd
+rs
diff --git a/support/pdfrack/testFiles/OtherFigureAgain.fig b/support/pdfrack/testFiles/OtherFigureAgain.fig
new file mode 100644
index 0000000000..528a0ea23d
--- /dev/null
+++ b/support/pdfrack/testFiles/OtherFigureAgain.fig
@@ -0,0 +1,22 @@
+#FIG 3.2
+Landscape
+Center
+Inches
+Letter
+100.00
+Single
+-2
+1200 2
+2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
+ 4200 2025 4200 1275 2850 1275 2850 2025 4200 2025
+2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
+ 7050 2325 7050 1575 5700 1575 5700 2325 7050 2325
+2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5
+ 5850 3300 5850 2550 4500 2550 4500 3300 5850 3300
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 4200 1650 5700 2025
+2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
+ 5100 1875 5100 2550
+4 0 0 50 0 0 16 0.0000 4 165 255 3375 1725 IN\001
+4 0 0 50 0 0 16 0.0000 4 165 630 4875 3000 BASE\001
+4 0 0 50 0 0 16 0.0000 4 165 510 6150 2025 OUT\001
diff --git a/support/pdfrack/testFiles/OtherFigureAgain.pdf b/support/pdfrack/testFiles/OtherFigureAgain.pdf
new file mode 100644
index 0000000000..01d6298bb4
--- /dev/null
+++ b/support/pdfrack/testFiles/OtherFigureAgain.pdf
Binary files differ
diff --git a/support/pdfrack/testFiles/aSubFile.tex b/support/pdfrack/testFiles/aSubFile.tex
new file mode 100644
index 0000000000..981dd2ff0d
--- /dev/null
+++ b/support/pdfrack/testFiles/aSubFile.tex
@@ -0,0 +1,15 @@
+
+\section{In the subfile}
+And here is the subfile, with the included figure.
+
+
+\begin{figure}[htb]
+ \centering
+ \psfrag{F}{$\Fset$}
+ \psfrag{G}{$\Gset$}
+ \psfrag{f}{$f$}
+ \psfrag{f-inv}{$f^{-1}$}
+ \pdfrackincludegraphics[width=.6\linewidth]{FfG}
+ \caption{The figure in the sub-file}
+ \label{fig:indoc}
+\end{figure} \ No newline at end of file
diff --git a/support/pdfrack/testFiles/fR2R.eps b/support/pdfrack/testFiles/fR2R.eps
new file mode 100644
index 0000000000..0ee48a9df5
--- /dev/null
+++ b/support/pdfrack/testFiles/fR2R.eps
@@ -0,0 +1,109 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: fR2R.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 5-alpha7
+%%CreationDate: Thu Jun 5 11:29:00 2008
+%%For: mboyer@ubu (Marc Boyer)
+%%BoundingBox: 0 0 115 59
+%Magnification: 1.0000
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+newpath 0 59 moveto 0 0 lineto 115 0 lineto 115 59 lineto closepath clip newpath
+-169.3 227.5 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+$F2psBegin
+10 setmiterlimit
+0 slj 0 slc
+ 0.06299 0.06299 sc
+%
+% Fig objects follow
+%
+%
+% here starts figure with depth 50
+% Polyline
+0 slj
+0 slc
+7.500 slw
+n 2700 2700 m 4500 2700 l 4500 3600 l 2700 3600 l
+ cp gs col0 s gr
+/Times-Roman ff 190.50 scf sf
+3150 3150 m
+gs 1 -1 sc (f:R2R) col0 sh gr
+% here ends figure;
+$F2psEnd
+rs
+showpage
+%%Trailer
+%EOF
diff --git a/support/pdfrack/testFiles/fR2R.pdf b/support/pdfrack/testFiles/fR2R.pdf
new file mode 100644
index 0000000000..92c7f837e9
--- /dev/null
+++ b/support/pdfrack/testFiles/fR2R.pdf
Binary files differ
diff --git a/support/pdfrack/testFiles/makefile b/support/pdfrack/testFiles/makefile
new file mode 100644
index 0000000000..e08b2f64df
--- /dev/null
+++ b/support/pdfrack/testFiles/makefile
@@ -0,0 +1,27 @@
+LATEX_MASTER= nonidealmixture-test.tex \
+ testDoubleImage.tex testpdfrack.tex withInclude.tex
+
+all: ${LATEX_MASTER:tex=ps} ${LATEX_MASTER:tex=pdf} tex-clean
+
+.SUFFIXES:
+.SUFFIXES: .tex .ps .pdf
+
+withInclude.pdf: FfG.pdf
+
+FfG.pdf: FfG.eps aSubFile.tex
+ ./pdfrack.sh -M withInclude.tex aSubFile.tex
+
+.tex.ps:
+ latex $*
+ dvips $*.dvi -o $*.ps
+
+.tex.pdf:
+ ./pdfrack.sh $*.tex
+ pdflatex $*
+
+tex-clean:
+ \rm -rf ${LATEX_MASTER:tex=log} ${LATEX_MASTER:tex=toc} ${LATEX_MASTER:tex=bbl} \
+ ${LATEX_MASTER:tex=blg} ${LATEX_MASTER:tex=thm} ${LATEX_MASTER:tex=pfg}
+clean:
+ \rm -rf ${LATEX_MASTER:tex=dvi} ${LATEX_MASTER:tex=log} ${LATEX_MASTER:tex=toc} ${LATEX_MASTER:tex=bbl} \
+ ${LATEX_MASTER:tex=blg} ${LATEX_MASTER:tex=thm} ${LATEX_MASTER:tex=ps} ${LATEX_MASTER:tex=pdf} \ No newline at end of file
diff --git a/support/pdfrack/testFiles/nonidealmixture-test.tex b/support/pdfrack/testFiles/nonidealmixture-test.tex
new file mode 100644
index 0000000000..a9974ddaac
--- /dev/null
+++ b/support/pdfrack/testFiles/nonidealmixture-test.tex
@@ -0,0 +1,53 @@
+\documentclass[a4paper]{article}
+\usepackage{psfrag,pdfrack}
+\begin{document}
+Some text.
+\begin{figure}
+\begin{psfrags}%
+\psfragscanon%
+%
+% text strings:
+\psfrag{str01}[t][t]{R134a mole fraction in liquid}%
+\psfrag{str02}[B][B]{Pressure Pa}%
+\psfrag{str05}[lB][lB]{T = 300 K}%
+\psfrag{str06}[l][l]{P}%
+\psfrag{str07}[l][l]{P $x_{R134a}$}%
+\psfrag{str08}[l][l]{P $x_{R123}$}%
+%
+% xticklabels:
+\psfrag{x01}[t][t]{0}%
+\psfrag{x02}[t][t]{0.2}%
+\psfrag{x03}[t][t]{0.4}%
+\psfrag{x04}[t][t]{0.6}%
+\psfrag{x05}[t][t]{0.8}%
+\psfrag{x06}[t][t]{1}%
+%
+% yticklabels:
+\psfrag{v01}[r][r]{0}%
+\psfrag{v02}[r][r]{1}%
+\psfrag{v03}[r][r]{2}%
+\psfrag{v04}[r][r]{3}%
+\psfrag{v05}[r][r]{4}%
+\psfrag{v06}[r][r]{5}%
+\psfrag{v07}[r][r]{6}%
+\psfrag{v08}[r][r]{7}%
+\psfrag{v09}[r][r]{8\setlength{\unitlength}{1ex}%
+\begin{picture}(0,0)\put(0.5,1.5){$\times 10^{5}$}\end{picture}}%
+%
+% extra picture(s):
+\psfrag{origin1}[lb][lb]{\setlength{\unitlength}{2.14739cm}%
+\begin{picture}(1,0.54159)%
+\end{picture}%
+}%
+\psfrag{origin2}[lb][lb]{\setlength{\unitlength}{7.75000cm}%
+\begin{picture}(1,0.78871)%
+\end{picture}%
+}%
+%
+% Figure:
+\resizebox{10cm}{!}{\pdfrackincludegraphics{nonidealmixture}}%
+\end{psfrags}%
+\caption{Non-ideal binary zeotropic mixture of R134a and R123}
+\end{figure}
+\end{document}
+ \ No newline at end of file
diff --git a/support/pdfrack/testFiles/nonidealmixture.eps b/support/pdfrack/testFiles/nonidealmixture.eps
new file mode 100644
index 0000000000..396c1ef500
--- /dev/null
+++ b/support/pdfrack/testFiles/nonidealmixture.eps
@@ -0,0 +1,516 @@
+%!PS-Adobe-2.0 EPSF-1.2
+%%Creator: MATLAB, The Mathworks, Inc.
+%%Title: e:\nov\code\nonidealmixture.eps
+%%CreationDate: 11/12/02 19:19:07
+%%DocumentNeededFonts: Helvetica
+%%DocumentProcessColors: Cyan Magenta Yellow Black
+%%Extensions: CMYK
+%%Pages: 1
+%%BoundingBox: 28 25 297 245
+%%EndComments
+
+%%BeginProlog
+
+% MathWorks dictionary
+/MathWorks 160 dict begin
+
+% definition operators
+/bdef {bind def} bind def
+/ldef {load def} bind def
+/xdef {exch def} bdef
+/xstore {exch store} bdef
+
+% operator abbreviations
+/c /clip ldef
+/cc /concat ldef
+/cp /closepath ldef
+/gr /grestore ldef
+/gs /gsave ldef
+/mt /moveto ldef
+/np /newpath ldef
+/cm /currentmatrix ldef
+/sm /setmatrix ldef
+/rc {rectclip} bdef
+/rf {rectfill} bdef
+/rm /rmoveto ldef
+/rl /rlineto ldef
+/s /show ldef
+/sc {setcmykcolor} bdef
+/sr /setrgbcolor ldef
+/sg /setgray ldef
+/w /setlinewidth ldef
+/j /setlinejoin ldef
+/cap /setlinecap ldef
+
+% page state control
+/pgsv () def
+/bpage {/pgsv save def} bdef
+/epage {pgsv restore} bdef
+/bplot /gsave ldef
+/eplot {stroke grestore} bdef
+
+% orientation switch
+/portraitMode 0 def
+/landscapeMode 1 def
+
+% coordinate system mappings
+/dpi2point 0 def
+
+% font control
+/FontSize 0 def
+/FMS {
+ /FontSize xstore %save size off stack
+ findfont
+ [FontSize 0 0 FontSize neg 0 0]
+ makefont
+ setfont
+ }bdef
+
+/ISOLatin1Encoding where
+{pop
+/WindowsLatin1Encoding 256 array bdef
+ISOLatin1Encoding WindowsLatin1Encoding copy pop
+/.notdef/.notdef/quotesinglbase/florin/quotedblbase/ellipsis/dagger/daggerdbl
+/circumflex/perthousand/Scaron/guilsinglleft/OE/.notdef/.notdef/.notdef
+/.notdef/quoteleft/quoteright/quotedblleft/quotedblright/bullet/endash/emdash
+/tilde/trademark/scaron/guilsinglright/oe/.notdef/.notdef/Ydieresis
+WindowsLatin1Encoding 128 32 getinterval astore pop}
+{/WindowsLatin1Encoding StandardEncoding bdef} ifelse
+
+/reencode {
+exch dup where
+{pop load} {pop StandardEncoding} ifelse
+exch
+dup 3 1 roll
+findfont dup length dict begin
+ { 1 index /FID ne {def}{pop pop} ifelse } forall
+ /Encoding exch def
+ currentdict
+end
+definefont pop
+} bdef
+
+/isroman {
+findfont /CharStrings get
+/Agrave known
+} bdef
+
+/FMSR {
+3 1 roll 1 index
+dup isroman
+{reencode} {pop pop} ifelse
+exch FMS
+} bdef
+
+/csm {
+ 1 dpi2point div -1 dpi2point div scale
+ neg translate
+ landscapeMode eq {90 rotate} if
+ } bdef
+
+% line types: solid, dotted, dashed, dotdash
+/SO { [] 0 setdash } bdef
+/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
+/DA { [6 dpi2point mul] 0 setdash } bdef
+/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
+
+% macros for lines and objects
+/L {
+ lineto
+ stroke
+ } bdef
+/MP {
+ 3 1 roll moveto
+ 1 sub {rlineto} repeat
+ } bdef
+/AP {
+ {rlineto} repeat
+ } bdef
+/PP {
+ closepath eofill
+ } bdef
+/DP {
+ closepath stroke
+ } bdef
+/MR {
+ 4 -2 roll moveto
+ dup 0 exch rlineto
+ exch 0 rlineto
+ neg 0 exch rlineto
+ closepath
+ } bdef
+/FR {
+ MR stroke
+ } bdef
+/PR {
+ MR fill
+ } bdef
+/L1i {
+ { currentfile picstr readhexstring pop } image
+ } bdef
+
+/tMatrix matrix def
+/MakeOval {
+ newpath
+ tMatrix currentmatrix pop
+ translate scale
+ 0 0 1 0 360 arc
+ tMatrix setmatrix
+ } bdef
+/FO {
+ MakeOval
+ stroke
+ } bdef
+/PO {
+ MakeOval
+ fill
+ } bdef
+
+/PD {
+ currentlinecap 1 setlinecap 3 1 roll 2 copy moveto lineto stroke setlinecap
+ } bdef
+
+/FA {
+ newpath
+ tMatrix currentmatrix pop
+ translate scale
+ 0 0 1 5 -2 roll arc
+ tMatrix setmatrix
+ stroke
+ } bdef
+/PA {
+ newpath
+ tMatrix currentmatrix pop
+ translate 0 0 moveto scale
+ 0 0 1 5 -2 roll arc
+ closepath
+ tMatrix setmatrix
+ fill
+ } bdef
+
+/FAn {
+ newpath
+ tMatrix currentmatrix pop
+ translate scale
+ 0 0 1 5 -2 roll arcn
+ tMatrix setmatrix
+ stroke
+ } bdef
+/PAn {
+ newpath
+ tMatrix currentmatrix pop
+ translate 0 0 moveto scale
+ 0 0 1 5 -2 roll arcn
+ closepath
+ tMatrix setmatrix
+ fill
+ } bdef
+
+/MRR {
+ /vradius xdef
+ /hradius xdef
+ /lry xdef
+ /lrx xdef
+ /uly xdef
+ /ulx xdef
+ newpath
+ tMatrix currentmatrix pop
+ ulx hradius add uly vradius add translate
+ hradius vradius scale
+ 0 0 1 180 270 arc
+ tMatrix setmatrix
+ lrx hradius sub uly vradius add translate
+ hradius vradius scale
+ 0 0 1 270 360 arc
+ tMatrix setmatrix
+ lrx hradius sub lry vradius sub translate
+ hradius vradius scale
+ 0 0 1 0 90 arc
+ tMatrix setmatrix
+ ulx hradius add lry vradius sub translate
+ hradius vradius scale
+ 0 0 1 90 180 arc
+ tMatrix setmatrix
+ closepath
+ } bdef
+/FRR {
+ MRR stroke } bdef
+/PRR {
+ MRR fill } bdef
+
+/MlrRR {
+ /lry xdef
+ /lrx xdef
+ /uly xdef
+ /ulx xdef
+ /rad lry uly sub 2 div def
+ newpath
+ tMatrix currentmatrix pop
+ ulx rad add uly rad add translate
+ rad rad scale
+ 0 0 1 90 270 arc
+ tMatrix setmatrix
+ lrx rad sub lry rad sub translate
+ rad rad scale
+ 0 0 1 270 90 arc
+ tMatrix setmatrix
+ closepath
+ } bdef
+/FlrRR {
+ MlrRR stroke } bdef
+/PlrRR {
+ MlrRR fill } bdef
+
+/MtbRR {
+ /lry xdef
+ /lrx xdef
+ /uly xdef
+ /ulx xdef
+ /rad lrx ulx sub 2 div def
+ newpath
+ tMatrix currentmatrix pop
+ ulx rad add uly rad add translate
+ rad rad scale
+ 0 0 1 180 360 arc
+ tMatrix setmatrix
+ lrx rad sub lry rad sub translate
+ rad rad scale
+ 0 0 1 0 180 arc
+ tMatrix setmatrix
+ closepath
+ } bdef
+/FtbRR {
+ MtbRR stroke } bdef
+/PtbRR {
+ MtbRR fill } bdef
+
+currentdict end def
+%%EndProlog
+
+%%BeginSetup
+MathWorks begin
+
+0 cap
+
+end
+%%EndSetup
+
+%%Page: 1 1
+%%BeginPageSetup
+%%PageBoundingBox: 31 28 297 245
+MathWorks begin
+bpage
+%%EndPageSetup
+
+%%BeginObject: obj1
+bplot
+
+/dpi2point 12 def
+portraitMode 0336 2892 csm
+
+ 44 -48 3185 2603 MR c np
+85 dict begin %Colortable dictionary
+/c0 { 0 0 0 sr} bdef
+/c1 { 1 1 1 sr} bdef
+/c2 { 1 0 0 sr} bdef
+/c3 { 0 1 0 sr} bdef
+/c4 { 0 0 1 sr} bdef
+/c5 { 1 1 0 sr} bdef
+/c6 { 1 0 1 sr} bdef
+/c7 { 0 1 1 sr} bdef
+1 j
+1 sg
+ 0 0 3409 2556 PR
+6 w
+0 396 731 0 0 -396 555 685 4 MP
+PP
+-731 0 0 396 731 0 0 -396 555 685 5 MP stroke
+4 w
+DO
+SO
+6 w
+0 sg
+ 555 289 mt 1286 289 L
+ 555 685 mt 1286 685 L
+1286 685 mt 1286 289 L
+ 555 685 mt 555 289 L
+ 555 685 mt 1286 685 L
+ 555 685 mt 555 289 L
+ 555 289 mt 1286 289 L
+ 555 685 mt 1286 685 L
+1286 685 mt 1286 289 L
+ 555 685 mt 555 289 L
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 84 FMSR
+
+ 951 418 mt
+(str06) s
+gs 555 289 732 397 MR c np
+/c8 { 0.000000 0.000000 1.000000 sr} bdef
+c8
+211 0 608 388 2 MP stroke
+
+gr
+c8
+0 sg
+ 951 517 mt
+(str07) s
+gs 555 289 732 397 MR c np
+DO
+24 w
+/c9 { 0.000000 0.500000 0.000000 sr} bdef
+c9
+211 0 608 487 2 MP stroke
+SO
+6 w
+
+gr
+c9
+0 sg
+ 951 616 mt
+(str08) s
+gs 555 289 732 397 MR c np
+DA
+24 w
+/c10 { 1.000000 0.000000 0.000000 sr} bdef
+c10
+211 0 608 586 2 MP stroke
+SO
+6 w
+
+gr
+c10
+0 sg
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 24 FMSR
+
+ 555 680 mt
+(origin1) s
+1 sg
+0 2081 2640 0 0 -2081 443 2272 4 MP
+PP
+-2640 0 0 2081 2640 0 0 -2081 443 2272 5 MP stroke
+4 w
+DO
+SO
+6 w
+0 sg
+ 443 191 mt 3083 191 L
+ 443 2272 mt 3083 2272 L
+3083 2272 mt 3083 191 L
+ 443 2272 mt 443 191 L
+ 443 2272 mt 3083 2272 L
+ 443 2272 mt 443 191 L
+ 443 2272 mt 443 2246 L
+ 443 191 mt 443 217 L
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 120 FMSR
+
+ 347 2418 mt
+(x01) s
+ 971 2272 mt 971 2246 L
+ 971 191 mt 971 217 L
+ 875 2418 mt
+(x02) s
+1499 2272 mt 1499 2246 L
+1499 191 mt 1499 217 L
+1403 2418 mt
+(x03) s
+2027 2272 mt 2027 2246 L
+2027 191 mt 2027 217 L
+1931 2418 mt
+(x04) s
+2555 2272 mt 2555 2246 L
+2555 191 mt 2555 217 L
+2459 2418 mt
+(x05) s
+3083 2272 mt 3083 2246 L
+3083 191 mt 3083 217 L
+2987 2418 mt
+(x06) s
+ 443 2272 mt 469 2272 L
+3083 2272 mt 3057 2272 L
+ 215 2316 mt
+(v01) s
+ 443 2012 mt 469 2012 L
+3083 2012 mt 3057 2012 L
+ 215 2056 mt
+(v02) s
+ 443 1752 mt 469 1752 L
+3083 1752 mt 3057 1752 L
+ 215 1796 mt
+(v03) s
+ 443 1492 mt 469 1492 L
+3083 1492 mt 3057 1492 L
+ 215 1536 mt
+(v04) s
+ 443 1232 mt 469 1232 L
+3083 1232 mt 3057 1232 L
+ 215 1276 mt
+(v05) s
+ 443 971 mt 469 971 L
+3083 971 mt 3057 971 L
+ 215 1015 mt
+(v06) s
+ 443 711 mt 469 711 L
+3083 711 mt 3057 711 L
+ 215 755 mt
+(v07) s
+ 443 451 mt 469 451 L
+3083 451 mt 3057 451 L
+ 215 495 mt
+(v08) s
+ 443 191 mt 469 191 L
+3083 191 mt 3057 191 L
+ 215 235 mt
+(v09) s
+ 443 191 mt 3083 191 L
+ 443 2272 mt 3083 2272 L
+3083 2272 mt 3083 191 L
+ 443 2272 mt 443 191 L
+gs 443 191 2641 2082 MR c np
+c8
+264 -153 264 -142 264 -138 264 -137 264 -140 264 -148 264 -156 264 -170
+264 -184 264 -202 443 2017 11 MP stroke
+DO
+24 w
+c9
+264 -320 264 -281 264 -250 264 -221 264 -196 264 -170 264 -144 264 -115
+264 -82 264 -46 443 2272 11 MP stroke
+DA
+c10
+264 167 264 139 264 112 264 84 264 55 264 23 264 -13 264 -54
+264 -102 264 -156 443 2017 11 MP stroke
+
+gr
+24 w
+c10
+DA
+0 sg
+1630 2561 mt
+(str01) s
+ 160 1365 mt -90 rotate
+(str02) s
+90 rotate
+2429 333 mt
+(str05) s
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 24 FMSR
+
+ 443 2267 mt
+(origin2) s
+SO
+6 w
+
+end
+
+eplot
+%%EndObject
+
+epage
+end
+
+showpage
+
+%%Trailer
+%%EOF
diff --git a/support/pdfrack/testFiles/nonidealmixture.pdf b/support/pdfrack/testFiles/nonidealmixture.pdf
new file mode 100644
index 0000000000..d2aa5a7eae
--- /dev/null
+++ b/support/pdfrack/testFiles/nonidealmixture.pdf
Binary files differ
diff --git a/support/pdfrack/testFiles/nonidealmixture.pfg b/support/pdfrack/testFiles/nonidealmixture.pfg
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/support/pdfrack/testFiles/nonidealmixture.pfg
diff --git a/support/pdfrack/testFiles/pdfrack.sh b/support/pdfrack/testFiles/pdfrack.sh
new file mode 100755
index 0000000000..8b653ae1f9
--- /dev/null
+++ b/support/pdfrack/testFiles/pdfrack.sh
@@ -0,0 +1,429 @@
+#!/bin/sh -u
+# Authors: Marc Boyer
+# Esa Hyytia (header option)
+# Date : 10/6/2008
+
+# Version : 0.5
+
+# sh options
+# -u Treat unset variables as an error when substituting.
+# -v Print shell input lines as they are read.
+# -x Print commands and their arguments as they are executed.
+
+
+# Erase de LANG environment variable, because it can create bugs with
+# sed. With my "fr_FR@euro" value, some regular expression in ps2epsi
+# fail.
+LANG=
+
+# Tools
+PS2EPS=ps2epsi
+PS2EPS_CMDNAME=ps2epsi
+
+
+# Default options
+
+METHOD=2
+PS2PS_OPT=no
+EPS2EPS_OPT=no
+CLEAN_OPT="yes"
+FORCE_EPSI_OPT="no"
+OWN_HEADER_OPT=""
+MASTER_FILE_OPT=""
+AUTO="no"
+
+TMPD=/tmp
+
+
+# usage method
+usage() {
+cat <<EOF
+Usage: $0 [-h][-p][-e][-a][-m method][-H header_file.tex][-M master_file.tex] file.tex
+ -h: help
+ -m: method: integer in 0..3 (default is 2)
+ the number of the method used to convert dvi to pdf
+ if one method fails, try another, and add -p and/or -e options :-)
+ -p: filter each postscript file with ps2ps
+ -e: filter each encapsulated postscript file with eps2eps
+ -a: auto/all, translate all figures included with \includegraphics (avoid
+ the use of \pdfrackincludegraphics)
+ -i: force use of ps2epsi instead of ps2eps
+ -k: keep (all tempory files are keeped, usefull for debug)
+ -H: own header file (default is to extract from .tex file)
+ -M: master file (to handle sub files)
+
+Authors: Marc Boyer <Marc.Boyer@enseeiht.fr>
+Contributors: Esa Hyytia (header option)
+Version: 1.0
+EOF
+}
+
+
+detect_ps2eps_filter() {
+ ps2eps -V > /dev/null
+ if [ $? -ne 0 ]
+ then
+cat<<EOF
+Warning: ps2eps not found. Using ps2epsi instead
+ this should produce incorrect bounding boxes
+You can disable this warning with option -i
+You can find ps2eps at:
+ http://www.ipv6.tm.uka.de/~bless/ps2eps
+ ps2eps: (C)opyright 1998-2004 Roland Bless
+EOF
+ PS2EPS=ps2epsi
+ PS2EPS_CMDNAME=ps2epsi
+ else
+ PS2EPS=ps2eps_with_output
+ PS2EPS_CMDNAME=ps2eps
+ fi
+}
+
+
+
+cleantexfiles(){
+ if [ $CLEAN_OPT = "yes" ]
+ then
+ \rm -f ${FIGNAME}.tex ${FIGNAME}.dvi ${FIGNAME}.aux ${FIGNAME}.log ${FIGNAME}.thm
+ fi
+}
+
+cleanfiles(){
+ if [ $CLEAN_OPT = "yes" ]
+ then
+ echo "Removing temporary files"
+ cleantexfiles;
+ \rm -f $*
+ fi
+}
+
+
+detect_mktemp(){
+ mktemp /tmp/testMktemp-XXXXXX > /dev/null
+ if [ $? = "1" ]
+ then
+ echo "Warning: no mktemp foumd"
+ MKTEMP=echo
+ else
+ MKTEMP=mktemp
+ fi
+ \rm -f /tmp/testMktemp-*
+}
+
+
+# This function is "like" ps2eps except that his second argument is
+# the name of the output file
+
+ps2eps_with_output() {
+ mv $1 $1.ps
+ ps2eps -q $1.ps
+ mv $1.eps $2
+}
+
+
+# This function just runs ps2ps on its first argument, and uses
+# the second argument to store the old file, if the PS2PS_OPT is set
+# to yes
+# Classical uses are
+# ps2psFilter file.ps file.ps.bak
+# ps2psFilter file.ps file-raw.ps
+ps2psFilter(){
+ if [ ${PS2PS_OPT} = "yes" ]
+ then
+ echo " Cleaning ps with ps2ps filter"
+ mv $1 $2
+ ps2ps $2 $1
+ fi
+}
+
+# Same as ps2ps with eps
+eps2epsFilter(){
+ if [ ${EPS2EPS_OPT} = "yes" ]
+ then
+ echo " Cleaning eps with eps2eps filter"
+ mv $1 $2
+ eps2eps $2 $1
+ fi
+}
+
+# This simple version relies on dvips + ps2pdf.
+# It outputs a too wide bounding box
+dvi2pdfV0() {
+ echo "Method 0: Trying conversion with dvips -|-> ps2pdf"
+ echo "Converting dvi -> ps (dvips)"
+ FIG_DVIPS=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2ps.ps.XXXXXX`
+ FIG_DVIPS_RAW=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2ps-raw.ps.XXXXXX`
+ dvips -f -q ${FIGNAME}.dvi > ${FIG_DVIPS}
+ ps2psFilter ${FIG_DVIPS} ${FIG_DVIPS_RAW}
+ echo "Converting ps -> pdf (ps2pdf)"
+ ps2pdf ${FIG_DVIPS} ${FIGNAME}.pdf
+ cleanfiles ${FIG_DVIPS} {FIG_DVIPS_RAW};
+}
+
+
+
+# This version relies on dvips + PS2EPS + eps2pdf.
+# It often works
+dvi2pdfV1() {
+ echo "Method 1: Trying conversion with dvips -|-> "${PS2EPS_CMDNAME}" -|-> epstopdf"
+ dvi2pdfV1_noPrompt;
+}
+
+dvi2pdfV1_noPrompt() {
+ FIG_DVIPS=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2ps.ps.XXXXXX`
+ FIG_DVIPS_RAW=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2ps-raw.ps.XXXXXX`
+ FIG_DVIPS_EPS=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2ps-ps2eps.eps.XXXXXX`
+ FIG_DVIPS_EPS_RAW=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2ps-ps2eps-raw.eps.XXXXXX`
+ echo "Converting dvi -> ps (dvips)"
+ dvips -f -q ${FIGNAME}.dvi | egrep -v "^%%BoundingBox:" > ${FIG_DVIPS};
+ ps2psFilter ${FIG_DVIPS} ${FIG_DVIPS_RAW}
+ echo "Converting ps -> eps ("${PS2EPS_CMDNAME}")"
+ ${PS2EPS} ${FIG_DVIPS} ${FIG_DVIPS_EPS}
+ eps2epsFilter ${FIG_DVIPS_EPS} ${FIG_DVIPS_EPS_RAW}
+ echo "Converting eps -> pdf (epstopdf)"
+ epstopdf ${FIG_DVIPS_EPS} --outfile=${FIGNAME}.pdf
+ cleanfiles $FIG_DVIPS $FIG_DVIPS_RAW $FIG_DVIPS_EPS $FIG_DVIPS_EPS_RAW;
+}
+
+# This version relies on dvips + PS2EPS + eps2eps + eps2pdf.
+dvi2pdfV2() {
+ echo "Method 2: Trying conversion with dvips -|-> " ${PS2EPS_CMDNAME} "-|-> eps2eps -|-> epstopdf"
+ if [ $EPS2EPS_OPT = "yes" ]
+ then
+ dvi2pdfV1_noPrompt;
+ else
+ EPS2EPS_OPT="yes";
+ dvi2pdfV1_noPrompt;
+ EPS2EPS_OPT="no";
+ fi
+}
+
+
+# This version relies on dvips -E + eps2eps + eps2pdf.
+dvi2pdfV3(){
+ echo "Trying conversion with dvips -E -|-> eps2eps -|-> eps2pdf"
+ FIG_DVIEPS=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2eps.eps.XXXXXX`
+ FIG_DVIEPS_RAW=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2eps-raw.eps.XXXXXX`
+ FIG_DVIEPS_EPS=`${MKTEMP} ${TMPD}/${FIGNAME}-dvi2eps-eps2eps.eps.XXXXXX`
+ echo "Converting dvi -> eps (dvips -E)"
+ dvips -f -q -E ${FIGNAME}.dvi > ${FIG_DVIEPS}
+ echo "Tightening the bounding box (eps2eps)"
+ mv ${FIG_DVIEPS} ${FIG_DVIEPS_RAW}
+ eps2eps ${FIG_DVIEPS_RAW} ${FIG_DVIEPS_EPS}
+ echo "Converting eps -> pdf (epstopdf)"
+ epstopdf ${FIG_DVIEPS_EPS} --outfile=${FIGNAME}.pdf
+ cleanfiles $FIG_DVIEPS $FIG_DVIEPS_RAW $FIG_DVIEPS_EPS;
+}
+
+
+# Compiling one figure
+# Input: File ${MAIN}.header
+# File ${MAIN}.figure
+# ${FIGNAME}.tex
+# ${METHOD}
+compileOneFigure() {
+ echo "Using LaTeX: producting dvi"
+ cat ${MAIN}.header > ${FIGNAME}.tex
+ echo ":pagestyle{empty}:renewcommand{:caption}[1]{}" | \
+ sed 's/:/\\/g' >> ${FIGNAME}.tex
+ # There could be several pdfrackincludegraphics in the same figure
+ # environment... Then, the script should there just keep one.
+ #set -x
+ # Simple expression:
+ # grep -n "^.*\\pdfrackincludegraphics.*{${FIGNAME}}" ${MAIN}.figure
+ # More precise expression
+ KEEPED_LINE=`grep -n "^.*\\pdfrackincludegraphics\(\[[^]]*\]\)*{${FIGNAME}}" ${MAIN}.figure | cut -f1 -d:`
+ sed ${KEEPED_LINE}!s/pdfrackincludegraphics/pdfracknullcommand/ ${MAIN}.figure \
+ >> ${FIGNAME}.tex
+ echo ':end{document}' | sed 's/:/\\/g' >> ${FIGNAME}.tex
+ if [ ! -r ${FIGNAME}.tex ] ; then
+ echo "Fail: no readable file "${FIGNAME}.tex
+ return
+ fi
+ latex -interaction=batchmode ${FIGNAME}.tex
+# The main pb is: how to convert from dvi to pdf, with the right size ?
+# The option "-E" of dvips "only works [...] at marks made by
+# characters and rules, not by any included graphics".
+# So I have tried some versions, and the 2d seems to be the more
+# efficient, but, sometimes, another is better...
+ if [ -r ${FIGNAME}.dvi ]
+ then
+ case ${METHOD} in
+ 0) echo "Warning: Method 0 should produce bad size";
+ dvi2pdfV0;;
+ 1) dvi2pdfV1;;
+ 2) dvi2pdfV2;;
+ 3) dvi2pdfV3;;
+ *) echo "Unknown method "${METHOD};
+ cleantexfiles;;
+ esac
+ else
+ echo "Fail: no readable file "${FIGNAME}.dvi
+ fi
+}
+
+
+
+######################################################################
+## Main
+
+
+# Check paremetes and set options
+
+set - - `getopt ahm:H:M:peki $*`
+if [ $? != 0 ];
+then
+ usage;
+ exit;
+fi
+#echo "Options are:"$*
+for i in $*
+do
+ case $i in
+ -m) METHOD=$3; shift 2;;
+ -p) PS2PS_OPT="yes"; shift 1;;
+ -e) EPS2EPS_OPT="yes"; shift 1;;
+ -a) AUTO="yes"; shift 1;;
+ -k) CLEAN_OPT=no; shift 1;;
+ -i) FORCE_EPSI_OPT="yes"; shift 1;;
+ -H) OWN_HEADER_OPT=$3; shift 2;;
+ -M) MASTER_FILE_OPT=$3; shift 2;;
+ -h)
+ usage;
+ exit;;
+ --) shift
+ break;;
+ esac
+ # echo "Remaining options are:"$*
+ done
+ shift 1; # To drop the -- added by command set - - `getopt cho: $*`
+
+#echo "After all Remaining options are:"$*
+
+
+if [ $# -lt 1 ]
+then
+ echo "Error: No input parameter file";
+ usage;
+ exit;
+fi
+#echo "toto"
+if [ ! -f $1 -o ! -r $1 ] ; then
+ echo "Error: File $1 unreadable"
+ exit 1
+fi
+
+if [ $FORCE_EPSI_OPT = no ] ;
+then
+ detect_ps2eps_filter;
+fi
+
+if [ x$MASTER_FILE_OPT != "x" -a x$OWN_HEADER_OPT != "x" ]; then
+ echo "Error: options -M and -H are incompatible"
+ exit 1
+fi
+if [ x$MASTER_FILE_OPT != "x" ] ; then
+ if [ ! -f $MASTER_FILE_OPT -o ! -r $MASTER_FILE_OPT ]; then
+ echo "Error: file $MASTER_FILE_OPT unreadable"
+ exit 1
+ fi
+fi
+if [ x$OWN_HEADER_OPT != "x" ]; then
+ if [ ! -f $OWN_HEADER_OPT -o ! -r $OWN_HEADER_OPT ]; then
+ echo "Error: file $OWN_HEADER_OPT unreadable"
+ exit 1
+ fi
+fi
+
+
+MAIN=`basename $1 "\..*"`
+
+# Check for Dos files
+if [ `wc -l < $1` -eq 1 ] ; then
+cat <<EOF
+ Suspicious file: your file is only one line long !"
+ If your file comes from Dos/Windows world, you should"
+ try command
+ tr "\r" "\n" < MAIN > unix-MAIN
+ and then run the script on unix-MAIN
+EOF
+ echo " (with MAIN="$MAIN")"
+ exit 1
+fi
+
+# Check for bash noclober option
+if [ `basename $SHELL` = bash ] ; then
+ set +o noclobber
+fi
+
+detect_mktemp;
+
+if [ x$OWN_HEADER_OPT != "x" ]; then
+ cat $OWN_HEADER_OPT > ${MAIN}.header
+else if [ x$MASTER_FILE_OPT != "x" ]; then
+ # Extract the header of the file, is, all from first line to
+ # the "\]begin{document}"
+ HEADERSIZE=`grep -n "^[\]begin{document}" ${MASTER_FILE_OPT} | head -1 | cut -f1 -d:`
+ if [ x${HEADERSIZE} = "x" ]; then
+ echo "Error: no \\\\begin{document} found in file "${MASTER_FILE_OPT}
+ exit 1
+ fi
+ head -${HEADERSIZE} ${MASTER_FILE_OPT} > ${MAIN}.header
+else
+ HEADERSIZE=`grep -n "^[\]begin{document}" $1 | head -1 | cut -f1 -d:`
+ if [ x${HEADERSIZE} = "x" ]; then
+ echo "Error: no \\\\begin{document} found in file "$1
+ exit 1
+ fi
+ head -${HEADERSIZE} $1 > ${MAIN}.header
+fi
+fi
+
+# Create a file with the line number of the figures
+{ grep -n "^[ ]*[\]begin{figure}" $1 ; \
+ grep -n "^[ ]*[\]end{figure}" $1; } | cut -f1 -d: \
+ | sort -n > ${MAIN}.figlines
+
+# Proceedes the files
+cat ${MAIN}.figlines | while read BEGIN
+do {
+ read END
+ # Creates a file
+ DIFF=`expr ${END} - ${BEGIN} + 1`
+ head -${END} $1 | tail -${DIFF} | sed 's/^%.*$//' | \
+ sed 's/\([^\]\)%.*$/\1/'> ${MAIN}.figure
+ # Debug: grep "\pdfrackincludegraphics\[.*\]{.*}" ${MAIN}.figure
+ # Comment on the regular expression used
+ # The (extended) regular expr for egrep has 4 parts:
+ # - ^[^%] : excludes any '%' in the beginning of the line (to
+ # avoid to match a pdfrackincludegraphics in comments
+ # - \pdfrackincludegraphics : just matches the macro name
+ # - (\[[^]]*\])? : the optionnal options
+ # the (...)? means that this subpart is repeated 0 or 1 time (need egrep)
+ # the \[...\] are juste the delimiters of LaTeX option
+ # the [^]]* matches any sequence without any ']'
+ # - {[^}]*} : the name of the figure
+ # The regular expersions used by sed is quite the same, except that,
+ # - because de (...)? is not allowed, two expressions are used
+ # - there are pair of \( \) is used to capture the name of the figure
+ # - there is a .*$ used to capture the end of the line
+ if [ $AUTO = "no" ]; then
+ egrep "^[^%]*\pdfrackincludegraphics(\[[^]]*\])?{[^}]*}" ${MAIN}.figure | \
+ sed -e 's/^[^%]*\\pdfrackincludegraphics\[.*\]{\([^}]*\)}.*$/\1/' \
+ -e 's/^[^%]*\\pdfrackincludegraphics{\([^}]*\)}.*$/\1/' \
+ > ${MAIN}.fignames
+ else
+ egrep "^[^%]*\includegraphics(\[[^]]*\])?{[^}]*}" ${MAIN}.figure | \
+ sed -e 's/^[^%]*\\includegraphics\[.*\]{\([^}]*\)}.*$/\1/' \
+ -e 's/^[^%]*\\includegraphics{\([^}]*\)}.*$/\1/' \
+ > ${MAIN}.fignames
+ fi
+ for FIGNAME in `cat ${MAIN}.fignames`
+ do
+ echo "----------------------------------------------"
+ echo " ---> Converting figure $FIGNAME"
+ compileOneFigure;
+ done
+} done
+
+\rm ${MAIN}.figlines ${MAIN}.header ${MAIN}.figure ${MAIN}.fignames
diff --git a/support/pdfrack/testFiles/pdfrack.sty b/support/pdfrack/testFiles/pdfrack.sty
new file mode 100644
index 0000000000..971d0dad43
--- /dev/null
+++ b/support/pdfrack/testFiles/pdfrack.sty
@@ -0,0 +1,14 @@
+\ProvidesPackage{pdfrack}[2007/10/15 A hack for using psfrag and pdflatex]
+\RequirePackage{psfrag}
+\RequirePackage{ifpdf}
+\RequirePackage{graphicx}
+
+\ifpdf
+ \newcommand{\pdfrackincludegraphics}[2][]{\includegraphics[]{#2}}
+\else
+ \newcommand{\pdfrackincludegraphics}[2][]{\includegraphics[#1]{#2}}
+\fi
+
+% Just a command that hide its arguments
+% It is used to ``hide'' some unexpected \pdfrackincludegraphics
+\newcommand{\pdfracknullcommand}[2][]{} \ No newline at end of file
diff --git a/support/pdfrack/testFiles/pictureFile.tex b/support/pdfrack/testFiles/pictureFile.tex
new file mode 100644
index 0000000000..171f8e53ca
--- /dev/null
+++ b/support/pdfrack/testFiles/pictureFile.tex
@@ -0,0 +1,7 @@
+\documentclass{article}
+
+\title{An exemple with the \}
+
+\begin{document}
+
+\end{document}
diff --git a/support/pdfrack/testFiles/testDoubleImage.tex b/support/pdfrack/testFiles/testDoubleImage.tex
new file mode 100644
index 0000000000..893718f0b6
--- /dev/null
+++ b/support/pdfrack/testFiles/testDoubleImage.tex
@@ -0,0 +1,22 @@
+\documentclass[a4paper]{article}
+\usepackage{psfrag,pdfrack}
+\begin{document}
+Some text.
+\begin{figure}[htbp]
+ \begin{center}
+ \psfrag{CA}{$\mathcal{C}_A$}
+ \psfrag{CB}{$\mathcal{C}_B$}
+ \psfrag{CC}{$\mathcal{C}_C$}
+ \psfrag{AB}{$\overrightarrow{AB}$}
+ \psfrag{AC}{$\overrightarrow{AC}$}
+ \psfrag{BC}{$\overrightarrow{BC}$}
+ \pdfrackincludegraphics[width=.6\linewidth]{OneFigureAgain}
+ \psfrag{IN}{$\displaystyle \int_0^{g(t)}e^{f(x)}\mathrm{d}x$}
+ \psfrag{OUT}{$\displaystyle \int_0^{t}\Theta(x)\mathrm{d}x$}
+ \psfrag{BASE}{$t$}
+ \pdfrackincludegraphics[width=.8\linewidth]{OtherFigureAgain}
+ \end{center}
+\end{figure}
+
+\end{document}
+
diff --git a/support/pdfrack/testFiles/testpdfrack-direct.pdf b/support/pdfrack/testFiles/testpdfrack-direct.pdf
new file mode 100644
index 0000000000..16653f3129
--- /dev/null
+++ b/support/pdfrack/testFiles/testpdfrack-direct.pdf
Binary files differ
diff --git a/support/pdfrack/testFiles/testpdfrack.tex b/support/pdfrack/testFiles/testpdfrack.tex
new file mode 100644
index 0000000000..3a333abc8a
--- /dev/null
+++ b/support/pdfrack/testFiles/testpdfrack.tex
@@ -0,0 +1,40 @@
+\documentclass[a4paper]{article}
+\usepackage{psfrag,pdfrack}
+\usepackage{graphicx}
+\begin{document}
+Some text.
+\begin{figure}
+ \psfrag{CA}{$\mathcal{C}_A$}
+ \psfrag{CB}{$\mathcal{C}_B$}
+ \psfrag{CC}{$\mathcal{C}_C$}
+ \psfrag{AB}{$\overrightarrow{AB}$}
+ \psfrag{AC}{$\overrightarrow{AC}$}
+ \psfrag{BC}{$\overrightarrow{BC}$}
+ \pdfrackincludegraphics[width=.6\linewidth]{OneFigure}
+\end{figure}
+\begin{figure}
+ \psfrag{IN}{$\displaystyle \int_0^{g(t)}e^{f(x)}\mathrm{d}x$}
+ \psfrag{OUT}{$\displaystyle \int_0^{t}\Theta(x)\mathrm{d}x$}
+ \psfrag{BASE}{$t$}
+ \pdfrackincludegraphics[width=.8\linewidth]{OtherFigure}
+\end{figure}
+
+
+\begin{figure}[htbp]
+ \begin{center}
+ \psfrag{CA}{$\mathcal{C}_A$}
+ \psfrag{CB}{$\mathcal{C}_B$}
+ \psfrag{CC}{$\mathcal{C}_C$}
+ \psfrag{AB}{$\overrightarrow{AB}$}
+ \psfrag{AC}{$\overrightarrow{AC}$}
+ \psfrag{BC}{$\overrightarrow{BC}$}
+ \pdfrackincludegraphics[width=.6\linewidth]{OneFigureAgain}
+ \psfrag{IN}{$\displaystyle \int_0^{g(t)}e^{f(x)}\mathrm{d}x$}
+ \psfrag{OUT}{$\displaystyle \int_0^{t}\Theta(x)\mathrm{d}x$}
+ \psfrag{BASE}{$t$}
+ \pdfrackincludegraphics[width=.8\linewidth]{OtherFigureAgain}
+ \end{center}
+\end{figure}
+
+\end{document}
+ \ No newline at end of file
diff --git a/support/pdfrack/testFiles/toto.eps b/support/pdfrack/testFiles/toto.eps
new file mode 100644
index 0000000000..bc9605c329
--- /dev/null
+++ b/support/pdfrack/testFiles/toto.eps
@@ -0,0 +1,157 @@
+%!PS-Adobe-3.0 EPSF-3.0
+%%BoundingBox: 0 0 253 199
+%%HiResBoundingBox: 0.000000 0.000000 252.725220 198.624658
+%.........................................
+%%Creator: GNU Ghostscript 705 (epswrite)
+%%CreationDate: 2003/05/26 16:38:08
+%%DocumentData: Clean7Bit
+%%LanguageLevel: 2
+%%EndComments
+%%BeginProlog
+% This copyright applies to everything between here and the %%EndProlog:
+% Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved.
+%%BeginResource: procset GS_epswrite_2_0_1001
+/GS_epswrite_2_0_1001 80 dict dup begin
+/PageSize 2 array def/setpagesize{ PageSize aload pop 3 index eq exch
+4 index eq and{ pop pop pop}{ PageSize dup 1
+5 -1 roll put 0 4 -1 roll put dup null eq {false} {dup where} ifelse{ exch get exec}
+{ pop/setpagedevice where
+{ pop 1 dict dup /PageSize PageSize put setpagedevice}
+{ /setpage where{ pop PageSize aload pop pageparams 3 {exch pop} repeat
+setpage}if}ifelse}ifelse}ifelse} bind def
+/!{bind def}bind def/#{load def}!/N/counttomark #
+/rG{3{3 -1 roll 255 div}repeat setrgbcolor}!/G{255 div setgray}!/K{0 G}!
+/r6{dup 3 -1 roll rG}!/r5{dup 3 1 roll rG}!/r3{dup rG}!
+/w/setlinewidth #/J/setlinecap #
+/j/setlinejoin #/M/setmiterlimit #/d/setdash #/i/setflat #
+/m/moveto #/l/lineto #/c/rcurveto #
+/p{N 2 idiv{N -2 roll rlineto}repeat}!
+/P{N 0 gt{N -2 roll moveto p}if}!
+/h{p closepath}!/H{P closepath}!
+/lx{0 rlineto}!/ly{0 exch rlineto}!/v{0 0 6 2 roll c}!/y{2 copy c}!
+/re{4 -2 roll m exch dup lx exch ly neg lx h}!
+/^{3 index neg 3 index neg}!
+/f{P fill}!/f*{P eofill}!/s{H stroke}!/S{P stroke}!
+/q/gsave #/Q/grestore #/rf{re fill}!
+/Y{P clip newpath}!/Y*{P eoclip newpath}!/rY{re Y}!
+/|={pop exch 4 1 roll 1 array astore cvx 3 array astore cvx exch 1 index def exec}!
+/|{exch string readstring |=}!
+/+{dup type/nametype eq{2 index 7 add -3 bitshift 2 index mul}if}!
+/@/currentfile #/${+ @ |}!
+/B{{2 copy string{readstring pop}aload pop 4 array astore cvx
+3 1 roll}repeat pop pop true}!
+/Ix{[1 0 0 1 11 -2 roll exch neg exch neg]exch}!
+/,{true exch Ix imagemask}!/If{false exch Ix imagemask}!/I{exch Ix image}!
+/Ic{exch Ix false 3 colorimage}!
+/F{/Columns counttomark 3 add -2 roll/Rows exch/K -1/BlackIs1 true>>
+/CCITTFaxDecode filter}!/FX{<</EndOfBlock false F}!
+/X{/ASCII85Decode filter}!/@X{@ X}!/&2{2 index 2 index}!
+/@F{@ &2<<F}!/@C{@X &2 FX}!
+/$X{+ @X |}!/&4{4 index 4 index}!/$F{+ @ &4<<F |}!/$C{+ @X &4 FX |}!
+/IC{3 1 roll 10 dict begin 1{/ImageType/Interpolate/Decode/DataSource
+/ImageMatrix/BitsPerComponent/Height/Width}{exch def}forall
+currentdict end image}!
+/~{@ read {pop} if}!
+end readonly def
+%%EndResource
+/pagesave null def
+%%EndProlog
+%%Page: 1 1
+%%BeginPageSetup
+GS_epswrite_2_0_1001 begin
+/pagesave save store 197 dict begin
+0.1 0.1 scale
+%%EndPageSetup
+gsave mark
+K
+0 0 0 0 rf
+Q q
+0 0 2530 1990 re
+Y
+4.5 w
+K
+725 1624 m
+0 -198.82 -161.18 -360 -360 -360 c
+-198.82 0 -360 161.18 -360 360 c
+0 198.82 161.18 360 360 360 c
+198.82 0 360 -161.18 360 -360 c
+h
+S
+2525 1624 m
+0 -198.82 -161.18 -360 -360 -360 c
+-198.82 0 -360 161.18 -360 360 c
+0 198.82 161.18 360 360 360 c
+198.82 0 360 -161.18 360 -360 c
+h
+S
+1625 364 m
+0 -198.82 -161.18 -360 -360 -360 c
+-198.82 0 -360 161.18 -360 360 c
+0 198.82 161.18 360 360 360 c
+198.82 0 360 -161.18 360 -360 c
+h
+S
+365 1264 540 -900 S
+725 1624 1080 0 S
+1625 364 540 900 S
+364 1622 92 99 @C
+,
++Fq+hL/a%bPT\n8_@@.ZiJ0fZ(N=p-%Y=oD";l4lDNf/RDNf13U`7ctkqu&81qbP8lG$?uQiHnh
+s8W-!s1dIjs**PPlYlf-J*jH,Xo5C!CULY-D6:4SQ%l`a_eW\7L)=$#_/+jX0Z8S;K*35('>]dR
+Y99LM^]~>
+460 1624 103 97 @C
+,
+0H$Z[21Nr,EYJ^$KG[aY[9*<6]lh#,\mMpPD:`,qrjT#3l[@4\d_GYoomKsd0'_c;V13W1h-GNA
+]'c`5X08Z"?.IPLFnNK5Dn>eSoXEX.pKpu#Q9/F)p:[YFlMfDColp~>
+2164 1622 92 99 @C
+,
++Fq+hL/a%bPT\n8_@@.ZiJ0fZ(N=p-%Y=oD";l4lDNf/RDNf13U`7ctkqu&81qbP8lG$?uQiHnh
+s8W-!s1dIjs**PPlYlf-J*jH,Xo5C!CULY-D6:4SQ%l`a_eW\7L)=$#_/+jX0Z8S;K*35('>]dR
+Y99LM^]~>
+2260 1624 87 95 @C
+,
+0Ei<u?uU.:/;>-")`/&A-,I<H]a!mDmIpGNqgJG;p]'ses8W,qli6Ulde24gdbugF$#kLW\2WS9
+bJYqI6!P^H'SJip@(8C#K)@>"HoKgKn$i;Rs4dSRs8W,blhu6Ss%B3?V,3Ka/dYH6"*d/0J?pp;
+=TsJA$=Z7~>
+1264 362 92 99 @C
+,
++Fq+hL/a%bPT\n8_@@.ZiJ0fZ(N=p-%Y=oD";l4lDNf/RDNf13U`7ctkqu&81qbP8lG$?uQiHnh
+s8W-!s1dIjs**PPlYlf-J*jH,Xo5C!CULY-D6:4SQ%l`a_eW\7L)=$#_/+jX0Z8S;K*35('>]dR
+Y99LM^]~>
+1360 362 92 99 @C
+,
++Fq+hL/a%bPT\n8_@@.ZiJ0fZ(N=p-%Y=oD";l4lDNf/RDNf13U`7ctkqu&81qbP8lG$?uQiHnh
+s8W-!s1dIjs**PPlYlf-J*jH,Xo5C!CULY-D6:4SQ%l`a_eW\7L)=$#_/+jX0Z8S;K*35('>]dR
+Y99LM^]~>
+1084 1624 103 97 @C
+,
+0H$Z[21Nr,EYJ^$KG[aY[9*<6]lh#,\mMpPD:`,qrjT#3l[@4\d_GYoomKsd0'_c;V13W1h-GNA
+]'c`5X08Z"?.IPLFnNK5Dn>eSoXEX.pKpu#Q9/F)p:[YFlMfDColp~>
+1188 1624 87 95 @C
+,
+0Ei<u?uU.:/;>-")`/&A-,I<H]a!mDmIpGNqgJG;p]'ses8W,qli6Ulde24gdbugF$#kLW\2WS9
+bJYqI6!P^H'SJip@(8C#K)@>"HoKgKn$i;Rs4dSRs8W,blhu6Ss%B3?V,3Ka/dYH6"*d/0J?pp;
+=TsJA$=Z7~>
+1804 904 87 95 @C
+,
+0Ei<u?uU.:/;>-")`/&A-,I<H]a!mDmIpGNqgJG;p]'ses8W,qli6Ulde24gdbugF$#kLW\2WS9
+bJYqI6!P^H'SJip@(8C#K)@>"HoKgKn$i;Rs4dSRs8W,blhu6Ss%B3?V,3Ka/dYH6"*d/0J?pp;
+=TsJA$=Z7~>
+1900 902 92 99 @C
+,
++Fq+hL/a%bPT\n8_@@.ZiJ0fZ(N=p-%Y=oD";l4lDNf/RDNf13U`7ctkqu&81qbP8lG$?uQiHnh
+s8W-!s1dIjs**PPlYlf-J*jH,Xo5C!CULY-D6:4SQ%l`a_eW\7L)=$#_/+jX0Z8S;K*35('>]dR
+Y99LM^]~>
+544 904 103 97 @C
+,
+0H$Z[21Nr,EYJ^$KG[aY[9*<6]lh#,\mMpPD:`,qrjT#3l[@4\d_GYoomKsd0'_c;V13W1h-GNA
+]'c`5X08Z"?.IPLFnNK5Dn>eSoXEX.pKpu#Q9/F)p:[YFlMfDColp~>
+648 902 92 99 @C
+,
++Fq+hL/a%bPT\n8_@@.ZiJ0fZ(N=p-%Y=oD";l4lDNf/RDNf13U`7ctkqu&81qbP8lG$?uQiHnh
+s8W-!s1dIjs**PPlYlf-J*jH,Xo5C!CULY-D6:4SQ%l`a_eW\7L)=$#_/+jX0Z8S;K*35('>]dR
+Y99LM^]~>
+cleartomark end end pagesave restore showpage
+%%PageTrailer
+%%Trailer
+%%Pages: 1
diff --git a/support/pdfrack/testFiles/toto.ps b/support/pdfrack/testFiles/toto.ps
new file mode 100644
index 0000000000..bfd3d12872
--- /dev/null
+++ b/support/pdfrack/testFiles/toto.ps
@@ -0,0 +1,61 @@
+%!PS-Adobe-3.0
+%%Pages: (atend)
+%%BoundingBox: 0 0 0 0
+%%HiResBoundingBox: 0.000000 0.000000 0.000000 0.000000
+%%Creator: GNU Ghostscript 705 (pswrite)
+%%CreationDate: 2003/05/26 16:37:56
+%%DocumentData: Clean7Bit
+%%LanguageLevel: 2
+%%EndComments
+%%BeginProlog
+% This copyright applies to everything between here and the %%EndProlog:
+% Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved.
+%%BeginResource: procset GS_pswrite_2_0_1001
+/GS_pswrite_2_0_1001 80 dict dup begin
+/PageSize 2 array def/setpagesize{ PageSize aload pop 3 index eq exch
+4 index eq and{ pop pop pop}{ PageSize dup 1
+5 -1 roll put 0 4 -1 roll put dup null eq {false} {dup where} ifelse{ exch get exec}
+{ pop/setpagedevice where
+{ pop 1 dict dup /PageSize PageSize put setpagedevice}
+{ /setpage where{ pop PageSize aload pop pageparams 3 {exch pop} repeat
+setpage}if}ifelse}ifelse}ifelse} bind def
+/!{bind def}bind def/#{load def}!/N/counttomark #
+/rG{3{3 -1 roll 255 div}repeat setrgbcolor}!/G{255 div setgray}!/K{0 G}!
+/r6{dup 3 -1 roll rG}!/r5{dup 3 1 roll rG}!/r3{dup rG}!
+/w/setlinewidth #/J/setlinecap #
+/j/setlinejoin #/M/setmiterlimit #/d/setdash #/i/setflat #
+/m/moveto #/l/lineto #/c/rcurveto #
+/p{N 2 idiv{N -2 roll rlineto}repeat}!
+/P{N 0 gt{N -2 roll moveto p}if}!
+/h{p closepath}!/H{P closepath}!
+/lx{0 rlineto}!/ly{0 exch rlineto}!/v{0 0 6 2 roll c}!/y{2 copy c}!
+/re{4 -2 roll m exch dup lx exch ly neg lx h}!
+/^{3 index neg 3 index neg}!
+/f{P fill}!/f*{P eofill}!/s{H stroke}!/S{P stroke}!
+/q/gsave #/Q/grestore #/rf{re fill}!
+/Y{P clip newpath}!/Y*{P eoclip newpath}!/rY{re Y}!
+/|={pop exch 4 1 roll 1 array astore cvx 3 array astore cvx exch 1 index def exec}!
+/|{exch string readstring |=}!
+/+{dup type/nametype eq{2 index 7 add -3 bitshift 2 index mul}if}!
+/@/currentfile #/${+ @ |}!
+/B{{2 copy string{readstring pop}aload pop 4 array astore cvx
+3 1 roll}repeat pop pop true}!
+/Ix{[1 0 0 1 11 -2 roll exch neg exch neg]exch}!
+/,{true exch Ix imagemask}!/If{false exch Ix imagemask}!/I{exch Ix image}!
+/Ic{exch Ix false 3 colorimage}!
+/F{/Columns counttomark 3 add -2 roll/Rows exch/K -1/BlackIs1 true>>
+/CCITTFaxDecode filter}!/FX{<</EndOfBlock false F}!
+/X{/ASCII85Decode filter}!/@X{@ X}!/&2{2 index 2 index}!
+/@F{@ &2<<F}!/@C{@X &2 FX}!
+/$X{+ @X |}!/&4{4 index 4 index}!/$F{+ @ &4<<F |}!/$C{+ @X &4 FX |}!
+/IC{3 1 roll 10 dict begin 1{/ImageType/Interpolate/Decode/DataSource
+/ImageMatrix/BitsPerComponent/Height/Width}{exch def}forall
+currentdict end image}!
+/~{@ read {pop} if}!
+end readonly def
+%%EndResource
+/pagesave null def
+%%EndProlog
+%%Trailer
+%%Pages: 0
+%%EOF
diff --git a/support/pdfrack/testFiles/withInclude.tex b/support/pdfrack/testFiles/withInclude.tex
new file mode 100644
index 0000000000..ce23d9615b
--- /dev/null
+++ b/support/pdfrack/testFiles/withInclude.tex
@@ -0,0 +1,38 @@
+\documentclass{article}
+\usepackage{pdfrack}
+\usepackage{verbatim}
+\usepackage{amsfonts}
+
+\newcommand{\Rset}{\mathbb{R}}
+\newcommand{\Fset}{\mathcal{F}}
+\newcommand{\Gset}{\mathcal{G}}
+
+\title{Test and example of the handling of included file}
+
+
+\begin{document}
+
+\maketitle
+
+\section{Example}
+
+A figure in the document itself.
+
+\begin{figure}[htbp]
+ \centering
+ \psfrag{f:R2R}{$f: \Rset \mapsto \Rset$}
+ \pdfrackincludegraphics[width=.3\linewidth]{fR2R}
+ \caption{The figure in the document master file}
+ \label{fig:indoc}
+\end{figure}
+
+\input aSubFile.tex
+
+
+\clearpage
+\subsection{Code of the example}
+
+\verbatiminput{withInclude.tex}
+
+
+\end{document}