Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Can anybody help me on overlay two eps figures?

1,313 views
Skip to first unread message
Message has been deleted

Scott Pakin

unread,
Feb 27, 2008, 7:17:08 PM2/27/08
to
Weiwei wrote:
> I have tried very hard on google to find command to overlay two eps
> figures in LaTeX, but I couldn't dig out the right info. I tried the
> below way try to overlay TEGraphic and TEGraphic_zoom, but actually
> what happens is TEGraphic_zoom shows before TEGraphic, no overlap. Can
> anybody give me a clue on how to do it? I think it should be very
> easy, but somehow I just can't get the job done. Thanks!
>
> \begin{figure}
> \centering
> \includegraphics{TEGraphic}
> \end{figure}
>
> \vspace*{-0.1in}
>
> \begin{figure}
> \centering
> \includegraphics{TEGraphic_zoom}
> \end{figure}

Figures are allowed to float; you can't assume anything about their final
positions. Try putting the two \includegraphics commands within the same figure.

-- Scott

Gernot Hassenpflug

unread,
Feb 27, 2008, 8:06:14 PM2/27/08
to
Weiwei <shuw...@gmail.com> writes:

> Dear All,


>
> I have tried very hard on google to find command to overlay two eps
> figures in LaTeX, but I couldn't dig out the right info. I tried the
> below way try to overlay TEGraphic and TEGraphic_zoom, but actually
> what happens is TEGraphic_zoom shows before TEGraphic, no overlap. Can
> anybody give me a clue on how to do it? I think it should be very
> easy, but somehow I just can't get the job done. Thanks!
>
> \begin{figure}
> \centering
> \includegraphics{TEGraphic}
> \end{figure}
>
> \vspace*{-0.1in}
>
> \begin{figure}
> \centering
> \includegraphics{TEGraphic_zoom}
> \end{figure}
>
>

> Weiwei

Maybe you can try to embed one in a box of zero size? Then TeX may
typeset the next over the same place.
--
BOFH excuse #211:

Lightning strikes.

vvvv

unread,
Feb 27, 2008, 10:59:17 PM2/27/08
to
There are a couple considerations. Are you trying to overlay a
transparency or just put a small picture over the corner of a bigger
picture? If you are working with transparencies, be sure that the
image is structured to be a transparency by using GIMP or Photoshop
(see this post: http://groups.google.com/group/comp.text.tex/browse_thread/thread/a94bb35fabd7ab4f/8240746bcc8e79aa?lnk=gst)
I'm not sure if the .eps format handles transparencies, you can
experiment or use .png.

After you get the transparency working, you can physically overlay one
image on top of another by EITHER mixing the images in an image editor
so you have one image that contains what you want to see or OVERLAY
them using something like this:

\documentclass{article}
%
% COMPILE THIS WITH PSLATEX as opposed
% to pdflatex or "latex" programs because of the eps input
%
% This is a test of graphic overlay per

% The dvips option below is used if you compile with pslatex.
% If you use graphicx with pdflatex, use the option: pdftex
% or read:
% http://ctan.org/get/macros/latex/required/graphics/grfguide.pdf
\usepackage[dvips]{graphicx}
\begin{document}
%
% If you don't use the height and width options,
% be sure you know how big the image is on the page:
\includegraphics[width=3in,height=3in]%
{/Examples/Crosstab01e.eps}
\vskip-3in
\hbox to 3in{%
% the hfil inside the hbox pushes the image to the right
\hfil%
\includegraphics[width=1in,height=1in]%
{/Examples/junk.eps}%
}
\end{document}

Martin Heller

unread,
Feb 28, 2008, 6:02:18 AM2/28/08
to
Weiwei skrev:

> I have tried very hard on google to find command to overlay two eps
> figures in LaTeX, but I couldn't dig out the right info.

\documentclass[demo]{article}
\usepackage{overpic,color}

\begin{document}

\begin{figure}
\begin{overpic}[width=\textwidth]{TEGraphic}
\put(0,0){\color{red}% just for demo
\includegraphics[%
width=3cm,
height=2cm]{TEGraphic_zoom}%
}
\end{overpic}
\end{figure}

\end{document}

0 new messages