I'm trying to import figures from Matlab
into a LaTeX
document using PSFrag
. For some of the figures I'd like to be able to add little images in particular places. I thought I'd be able to just add dummy tags in Matlab
and replace them, as in
\psfrag{s14}[lt][lt]{%
\color[rgb]{0,0,0}
\setlength{\tabcolsep}{0pt}
\begin{tabular}{l}
\includegraphics[width = 0.8cm]{Simple2}
\end{tabular}}%
but for some reason it replaces the tag with the base figure (as in, the big plot I'm trying to add little images to) instead of the little image.
Any solutions greatly appreciated.
Best Answer
\includegraphics
uses a lot of internal macros and registers to record the state of the image being included and it was never designed to be recursively called during its own processing. Hence as you observe it loses track of the file being processed (and probably lots of other details). Using a box register you can avoid the need for the nested macro expansion and (amazingly enough:-) it all works out. The above showsA
in the original EPS being replaced by the rendering of the fileb.ps
.