6

Can I render a figure inside another figure. For example, I want to have a big figure and showing a small one (like for zooming in) instead of the legend.

Can I do that using latex?

Thanks.

6
  • 1
    I would do it "outside" with graphic tools and simple put in one figure, that will save you a lot of trouble Jun 5, 2013 at 12:34
  • 1
    Is this what you have in mind: Magnifying part of a picture?
    – Alexander
    Jun 5, 2013 at 12:52
  • yes you can, but don't wrap them in separate figure environments. think of this more as "including two graphic objects in the same float environment". Jun 5, 2013 at 12:53
  • Related: Using Overpic and TikZ packages by JLDiaz Jun 5, 2013 at 19:52
  • @Alexander, no, I want two different figures, the zooming was just for example. But that's nice, thanks.
    – Assimiz
    Jun 30, 2013 at 20:24

1 Answer 1

5

I \llap the embedded image after setting the large image. The 2.5in is the vertical rise and the 0.2in is the leftward offset of the embedded image.

\documentclass{article}
\usepackage{graphicx}
\usepackage{mwe}
\begin{document}

Here is some text.

\begin{figure}[ht]
\includegraphics[scale=1]{example-image-1x1}
\centering
\llap{\shortstack{%
        \includegraphics[scale=.2]{example-image}\\
        \rule{0ex}{2.5in}%
      }
  \rule{0.2in}{0ex}}
\caption{This is my embedded figure}
\end{figure}

And text continues\ldots

\end{document}

enter image description here

1
  • Of course, my stackengine package can do this function directly with the \stackinset macro. Apr 10, 2018 at 13:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .