On 05/09/2010 9:58 AM, Diego Gruber wrote:
Hello,
I am trying to combine two images (fig_densities.eps
and fig_densities_zoom.eps) into one by slightly superimposing one on top of
the other. Now I managed to produce what I wanted using PSTricks, running my
script on TexShop, but when I run the same code within LyX a blank space
appears on top of the caption, no image at all. Here's the code I'm using
(I've left only one psfrag command per image to reduce the clutter):
\begin{pspicture}(-0.3\linewidth,-0.15\textheight)(0.3\linewidth,0.2\textheight)
\rput[cm](0,.4){
\psfrag{xlabel}[][][1][0]{}
\includegraphics[width=.48\textwidth]{fig_densities.eps}
}
\rput[cm](4,0){
\psfrag{xlabel}[][][.9][0]{}
\includegraphics[width=.23\textwidth]{fig_densities_zoom.eps}
}
\end{pspicture}
In LyX I am placing this code in a "TeX box" within a figure float. In order
for psfrag to work properly in LyX I've had to use ps2pdf typesetting, but I
also tried other forms of typesetting included in LyX and all of them return
a blank space where i want my figure.
I am running version 1.6.5 on OS X 10.6.
Is there an easy way to make this work in LyX? Perhaps I shouldn't be using
PSTricks at all? Thanks in advance for any advice!
Diego
Hi Diego,
If it works in LaTeX, it should work in LyX too. The problem I see with
your approach, is that LyX compiles the document in a temporary
directory, by first copying any necessary files, such as graphics, to
this directory. But... in this case since the \includegraphics commands
are in TeX mode, LyX isn't smart enough to copy those files too.
The solution is to include those graphics in the LyX's way, using Insert
> Graphics. Then, wrap the two figures with your TeX code. Since you
are using psfrag commands, you will have no choice but to use one of the
postscript output (ps or ps2pdf). Try and please comment back if this
works for you or not.
Best,
Julien