3

I want to create a figure with a magnified subfigure. I know this can be done with tikz (link) however I want to do it without tikz. Can this be done?

Example: enter image description here

My early attempt:

\documentclass{article}

\usepackage{subfig,graphicx}

\begin{document}

\begin{figure}
    \subfloat[]{\includegraphics[width=0.6\textwidth]{example-image-a}}
    \hspace*{0.5em}
    \subfloat[]{\includegraphics[trim=5cm 0cm 5cm 5cm, clip=true, width=0.2\textwidth]{example-image-a}}
\end{figure}

\end{document}
  • 5
    without TikZ you would be doing exactly the same boxing/unboxing or clipping as TikZ does only without TikZ. – percusse Feb 23 '16 at 12:43
  • @percusse Can you provide an example? – Mowing Bar Feb 23 '16 at 14:31
  • 1
    You have the the example in the link no? – percusse Feb 23 '16 at 15:03
  • What tag can be put? {no-tikz-pgf}? ;-) Note: I removed the {tikz-pgf} tag... – Paul Gaborit Feb 23 '16 at 16:05
  • 1
    I'm somewhat curious as to why you don't want to use TikZ. Is this a puzzle (i.e. you have a good idea how to do it in TikZ)? Is it because you want to submit your source in some circumstance where TikZ is not allowed? Do you want to avoid learning TikZ? Would some other package like pstricks be acceptable? If you can't use TikZ for compatibility reasons, you could use the standalone package to create an image that already contains the magnification. Also, the example in the linked question would be easy with \includegraphics and basic TeX commands. The dashed diagonal lines are harder. – wrtlprnft Mar 24 '16 at 17:19
  • Oh, and since you technically didn't exclude this possibility: can we use pgf? – wrtlprnft Mar 24 '16 at 17:22
  • @wrtlprnft Didn't want to use tikz because I have never used it before. Couldn't accomplish what I wanted with \includegraphics so I used tikz in the end. – Mowing Bar Mar 26 '16 at 09:05

1 Answers1

2

If you don't apply height or width, you can use scale combined with trim and clip.

\documentclass{article}

\usepackage{subfig,graphicx}

\begin{document}

\begin{figure}
    \subfloat[]{\includegraphics[width=0.6\textwidth]{example-image-a}}
    \hspace*{0.5em}
    \subfloat[]{\includegraphics[scale=3,trim=6cm 5cm 6cm 5cm, clip=true,]{example-image-a}}
\end{figure}

\end{document}

enter image description here

Ignasi
  • 136,588