comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: EPS fragment output for latex font interpretation?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: EPS fragment output for latex font interpretation? [message #54941 is a reply to message #54939] Wed, 25 July 2007 03:25 Go to previous messageGo to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
Gernot Hassenpflug wrote:
> Hello all,
>
> I have used IDL to output EPS figures with whatever fonts IDL has
> built-in. Now I would like to use IDL to output EPS fragments (in
> vector format) with markers for the text information, and .tex files
> containing the text corresponding to the markers, with both files to
> be later interpreted by LaTeX with an \input statement. With matlab,
> which I do not currently have a licence to, this was possible using
> the user-contributed laprint program.
>
> With such a splitting of the tasks, it is easy to adjust text size and
> font to what is required in the LaTeX document.
>
> Is there any way to do such a task in IDL (I have 6.2 and 6.3 licences
> at my workplace).
>
> Alternatively, if there is a way to use Computer Modern fonts with
> IDL, I could try to use those in the EPS file directly (then output in
> binary format is fine too).
>
> Many thanks
> Gernot


I've done so in a few occasion, and it worked out fine.
Here's an example with IDL, LaTeX and unix commands, which
I put together with some help from this newsgroup a while ago:

IDL commands to generate a figure with b and t as text markers:

N=1000

x=findgen(N)/(N-1)*10-5

mu=0.
sigma=1.

y=total(exp(-(x-mu)^2/(2*sigma^2)),/cumulative)*(x[1]-x[0])

set_plot,'PS'
device,filename='fig1.eps',/encapsulated,xsize=12.,ysize=8.
!p.font=0

plot,x,y,yrange=[0.,3.],thick=4,/xstyle,xrange=[-5,5],xtitle ='x',ytitle='y'
oplot,!X.crange,sqrt(2*!Pi)*sigma*[1,1],linestyle=2

xyouts,0.,1.,'t',/data
xyouts,-3,2.65,'b'
device,/close
set_plot,'X'


;END IDL

LaTeX file:

\documentclass{article}
\usepackage{geometry}
\usepackage{graphicx}
\usepackage{psfrag}
\pagestyle{empty}
\geometry{paperwidth=12.1cm,paperheight=8.1cm,margin=0pt}
\begin{document}
\psfrag{t}[l][][1.35]{$\displaystyle y=\int_{-\infty}^x
e^{-\left(\frac{t-\mu}{\sqrt{2}\sigma}\right)^2}\,\mathrm{d} t$}
\psfrag{x}[c][][1.75]{$x$}
\psfrag{y}[c][][1.75]{$y$}
\psfrag{b}[c][][1.35]{$\displaystyle y=\sqrt{2\pi}\sigma$}
\includegraphics[width=11.9cm,height=7.9cm]{fig1.eps}
\end{document}

%end latex


Linux command to TEX and transform into eps:

latex doc.tex
dvips -o fignew.ps doc.dvi
ps2epsi fignew.ps fignew.epsi
perl -ne 'print unless /^%%BeginPreview/../^%%EndPreview/' < fignew.epsi > fignew.eps
rm fignew.epsi

Now you should have an eps file with equations rather than "t" and "b" labels...

Hope this helps,
Paolo Grigis
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CW_BGROUP and scrolling
Next Topic: Re: array subscript conversion

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Mon Dec 01 04:45:15 PST 2025

Total time taken to generate the page: 1.36230 seconds