| 1 |
tpmultiinc.sty 0000600 0003724 0003720 00000005260 07132346315 0014301 0 ustar 00hw flamelet 0000000 0000000 %% tpmultiinc.sty |
| 2 |
%% |
| 3 |
%% This package provides the command \tpmultiinc{foo} to include |
| 4 |
%% incremental graphics using Stephan Lehmke's texpower package. |
| 5 |
%% |
| 6 |
%% Call it like: \tpmultiinc[options to includegraphics]{foo} |
| 7 |
%% |
| 8 |
%% It requires that you have the graphic files in a certain order. |
| 9 |
%% foo.0 is the first file to be included. It appears at once. |
| 10 |
%% The graphic files |
| 11 |
%% foo.n with n >=1 are included step by step using the step command |
| 12 |
%% from texpower. |
| 13 |
%% The files foo.* are eps-Files, as produced by metapost. They must |
| 14 |
%% all have the same bounding box. |
| 15 |
%% |
| 16 |
%% The most convenient way to generate them is to use xfig with the |
| 17 |
%% patches provided by Klaus Guntermann to generate multiple metapost |
| 18 |
%% output. See: |
| 19 |
%% |
| 20 |
%% http://www-sp.iti.informatik.tu-darmstadt.de/software/xfig/ |
| 21 |
%% |
| 22 |
%% The [options to includegraphics] are optional. You can use them to |
| 23 |
%% scale your graphics to the proper size. |
| 24 |
%% |
| 25 |
%% Beware, no error handling is attempted. |
| 26 |
%% Beware, this is my first attempt to write something other than |
| 27 |
%% local hacks. |
| 28 |
%% Beware, this has only been tested via the latex, dvips, ps2pdf |
| 29 |
%% route. I don't know how it behaves if you use pdflatex. |
| 30 |
%% |
| 31 |
%% Author: Holger Wenzel [email protected] |
| 32 |
%% Version: 0.1b July 7, 2000 |
| 33 |
%% |
| 34 |
\RequirePackage{texpower} |
| 35 |
\RequirePackage{graphicx} |
| 36 |
\RequirePackage{ifthen} |
| 37 |
%% |
| 38 |
%% The width and the height of the included graphics |
| 39 |
\newlength{\layerwidth} |
| 40 |
\newlength{\layerheight} |
| 41 |
%% Boolean value to decide wether we have to include another |
| 42 |
%% file |
| 43 |
\newboolean{morelayers} |
| 44 |
%% |
| 45 |
%% Counter for the actual layer |
| 46 |
%% |
| 47 |
\newcounter{layer} |
| 48 |
%% |
| 49 |
%% |
| 50 |
%% |
| 51 |
\newcommand*{\tpmultiinc}[2][{}]{% |
| 52 |
%% |
| 53 |
%% First (optional) argument are the options passed to |
| 54 |
%% includegraphics. |
| 55 |
%% Second (requried) argument is the base-name of the files to be |
| 56 |
%% included. |
| 57 |
%% |
| 58 |
%% Determine the dimensions of the picture |
| 59 |
\settowidth{\layerwidth}{\includegraphics[#1]{#2.0}} |
| 60 |
\settoheight{\layerheight}{\includegraphics[#1]{#2.0}} |
| 61 |
%% initialise |
| 62 |
\setboolean{morelayers}{true} |
| 63 |
\setcounter{layer}{1} |
| 64 |
%% |
| 65 |
%% use parstepwise instead of stepwise to avoid glitches in |
| 66 |
%% the output |
| 67 |
\parstepwise{% |
| 68 |
%% |
| 69 |
%% Make room for the picture |
| 70 |
\parbox[t][\layerheight][b]{\layerwidth}{% |
| 71 |
%% |
| 72 |
%% Be sure that the files are nicely overlaid |
| 73 |
%% by anchoring them at (0,0) in a picture environment |
| 74 |
\begin{picture}(0,0) |
| 75 |
%% Include at least one file (this is foo.0) |
| 76 |
\put(0,0) {\includegraphics[#1]{#2.0}} |
| 77 |
%% |
| 78 |
%% This is the loop to include all the foo.n files |
| 79 |
%% like in the mpmulti.sty of ppower. |
| 80 |
%% |
| 81 |
\whiledo{\boolean{morelayers}} |
| 82 |
{\IfFileExists{#2.\thelayer}% |
| 83 |
{\setboolean{morelayers}{true}% |
| 84 |
\step{\put(0,0) {{\includegraphics[#1]{#2.\thelayer}}}} |
| 85 |
\stepcounter{layer}}% |
| 86 |
{\setboolean{morelayers}{false}}} |
| 87 |
\end{picture}}}% |
| 88 |
\\}% |
| 89 |
|