%
\typeout{insertplot.sty  version 1.08  08 May 1992.}
%
% Use this macro in conjunction with the Arbortext DVILASER/PS driver.
% It may be used with user-written PostScript code, DI-3000/PICSURE,
% PVI-WAVE, GEM ARTLINE, DESIGNER, AUTOSKETCH and ......
%
% Please feel free to redistribute this file to other interested users.
% I would like to hear about any improvements for eventual inclusion
% in future versions.
%
% Change History.
% (1) 25/10/89. V1.01. Added driver option 6, PS  for PVI-WAVE.
%                      Added driver option 7, EPS for PVI-WAVE.
% (2) 27/10/89. V1.02. PICSURE driver changed. Added `flip' to
%                      ensure correct orientation.
% (3) 08/02/90. V1.03. Added driver option 8, AutoSketch.
% (4) 10/04/91  V1.04. Added '\letter {} def' to the PICSURE option.
% (5) 22/10/91  V1.05. Added driver option 9, Erlangen Graphics System
% (6) 14/11/91  V1.06. Added driver option 10, IslandDraw.
% (7) 24/03/92  V1.07. Added driver option 11, MATLAB.
% (8) 08/05/92  V1.08. Added driver option 12, GNU Plot
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%   C. E. Higgs
%   Computational Physics Group
%   Paul Scherrer Institute
%   CH-5232 Villigen PSI
%   Switzerland
%   tel: + (056) 99 20 62
%   Email: HIGGS@CAGEIR5A     (Bitnet)
%          higgs@csun.psi.ch  (X.400)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% WARNING: For correct inclusion, user-written PostScript code in the
%          LANDSCAPE mode must include the following before any other
%          commands.
%
%          90 rotate   0 -600 translate
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% parameter #1: Offset from left margin.
%           #2: PostScript file name for inclusion.
%           #3: Vertical space to leave for the figure.
%           #4: Scaling factor on X-axis.
%           #5: Scaling factor on Y-axis.
%           #6: Orientation of original figure.
%           Options are:-
%               landscape = original drawing was A4-quer.
%               portrait  = original drawing was A4-hoch.
%           #7: Originating graphics package.
%           Options are:-
%               1 = user-written PostScript.
%               2 = DI-3000/PICSURE.
%               3 = GEM Artline.
%               4 = Designer.
%               5 = Buerokomm.
%               6 = PVI-WAVE (PS  driver).
%               7 = PVI-WAVE (EPS driver).
%               8 = AUTOSKETCH
%               9 = ERLANGEN GRAPHICS SYSTEM
%              10 = ISLAND_DRAW
%              11 = MATLAB
%              12 = GNU Plot
%
% Description of insertplot internal parameters.
%
% angl          rotation angle for landscape figs.
% a4            DI-3000/PICSURE.  Deactivate this.
% erasepage     DI-3000/PICSURE.  Deactivate this.
% letter        DI-3000/PICSURE.  Deactivate this.
% figsave       save
% flip          ensure same orientation for all driver options.
%               180 degree rotation upon itself.
% initgraphics  DI-3000/PICSURE.  Deactivate this.
% showpage      PostScript. Deactivate this
% slide         rotate and shift landscape figs.
% xxx           horiz. shift (in pt) for repositioning.
% yyy           vert.  shift (in pt) for repositioning.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\insertplot#1#2#3#4#5#6#7{\par\nointerlineskip       %
  \hbox{\hskip #1 \vbox to #3{\vfil                      %
  \special{ps::[asis,begin] 0 SPB  /figsave save def     %
  /showpage {} def /slide {} def /flip {} def            %
 #7 1 eq {/xxx  -100 def /yyy 600 def /angl -90 def }if  %  user written PS
 #7 2 eq {/xxx  -100 def /yyy 600 def /angl -90 def      %  DI-3000/PICSURE
      /initgraphics {} def /erasepage {} def /a4 {} def  %  DI-3000/PICSURE
      /letter {} def                                     %  DI-3000/PICSURE
%     /flip{(#6) (portrait) eq { 590 #4 mul              %  DI-3000/PICSURE
%           840 #5 mul translate 180 rotate}if}def
                                                    }if  %  DI-3000/PICSURE
 #7  3 eq {/xxx   750 def /yyy   0 def /angl +90 def }if %  GEM ARTLINE
 #7  4 eq {/xxx   750 def /yyy   0 def /angl -90 def }if %  DESIGNER
 #7  5 eq {/xxx     0 def /yyy 592 def /angl -90 def }if %  Buerokomm
 #7  6 eq {/xxx   640 def /yyy -55 def /angl +90 def }if %  PVI-WAVE (PS)
 #7  7 eq {/xxx  -100 def /yyy   0 def /angl +90 def }if %  PVI-WAVE (EPS) 
 #7  8 eq {/xxx     0 def /yyy 600 def /angl -90 def }if %  AUTOSKETCH
 #7  9 eq {/xxx   -25 def /yyy 550 def /angl -90 def }if %  EGS
 #7 10 eq {/xxx  -100 def /yyy 600 def /angl -90 def }if %  ISLAND_DRAW
 #7 11 eq {/xxx   750 def /yyy   0 def /angl +90 def }if %  MATLAB
 #7 12 eq {/xxx  -100 def /yyy 600 def /angl -90 def }if %  GNU Plot
 /slide{(#6) (landscape) eq                              %
  {xxx #4 mul yyy #5 mul translate angl rotate}if} def   %
 gsave Xpos Ypos translate slide flip #4 #5 scale}       %
 \special{ps: plotfile #2 asis} \special{ps::[asis,end]  %
 grestore figsave restore 0 SPE}}}}                      %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% That's it.