🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text
Article #6351

Re: postscript from mathematica and LaTeX

#6351
From: Sean W. Doyle
Date: Wed, 10 May 1989 02:16
71 lines
2632 bytes
Here's a simple (?) and crude way to print Mathematica graphics
in a LaTeX document. This works with the version of dvi2ps that
comes with the UniTeX distribution:

(1) Create a Mathematica plot and place it into the file 
    "plot.inc" with the following commands:

    In[1]:= Plot3D[Sin[x y],{x,0,Pi},{y,0,Pi}]

    Out[1]= -SurfaceGraphics-

    In[2]:= Display["!psfix>plot.inc ",%]

    Out[2]= -SurfaceGraphics-


(2) Edit the PostScript (I didn't say this was elegant, did I?)
	(a) change the dimensions of the plot:
		/Mwidth 8.5 => /Mwidth 4
		/Mheight 11 => /Mheight 4
	(b) delete:
		showpage

(3) Now include the LaTeX macros that Charlie Geyer posted to this
    group (I haven't asked his permission to re-post his macros... but
    it might be inconvenient for some people to get back postings...) They
    are short enough to re-post (I think...). 

    Thanks Charlie!
   
% ---------------------- cut here ----------------------------	
% Author: Charlie Geyer
% These macros were read off of the newsgroup comp.text on 
% March 18, 1989.
% macros for postscript files...
% 
% Includes postcript file
\def\psinc(#1,#2)#3{
\setlength{\unitlength}{1in}
\centering\begin{picture}(#1,#2)
\put(0,0){\special{#3}}
\end{picture}}
%
% Includes postcript file, places framebox around figure.
\def\framepsinc(#1,#2)#3{
\setlength{\unitlength}{1in}
\centering\begin{picture}(#1,#2)
\put(0,0){\framebox(#1,#2)[bl]{\special{#3}}}
\end{picture}}
%
\def\postscript{{\sc PostScript}}
% -------------------- end of macro file ---------------------

(4) You can then include this plot in your LaTeX document using the
    following commands:
	\begin{figure}[h]
	\psinc(4,4) {psfile=plot.inc}
	\caption{blah blah blah}
	\end{figure}
    Note that the dimesions reserved by \psinc (4,4) are the same
    size as the editing changes in step (2). 



If you have more questions about the LaTeX macros you might want to
go back to Charlie Geyer's orginal posting.

Hope this helps. If BoundingBox ever got included it would make things
easier....

Sean
Technical Details
Message-ID: <428@mqws2.fed.FRB.GOV>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!hc!lll-winken!uunet!fed!m1swd00@fed.frb.gov
References: <39584@bbn.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!hc!lll-winken!uunet!fed!m1swd00@fed.frb.gov
From: m1swd00@fed.frb.gov (Sean W. Doyle)
Newsgroups: comp.text
Subject: Re: postscript from mathematica and LaTeX
Summary: Crude, but works...
Message-ID: <428@mqws2.fed.FRB.GOV>
Date: 10 May 89 02:16:16 GMT
References: <39584@bbn.COM>
Sender: news@fed.FRB.GOV
Reply-To: m1swd00@fed.frb.gov (Sean W. Doyle)
Organization: Federal Reserve Board
Lines: 71
In-reply-to: jzavgren@bbn.com (John Zavgren)