0

I have a question for you. I have some images in my latex file and I would like to connect some of them with arrows. For example something like this:

Image1 --------> Image2

Image3 --------> Image4 --------> Image5

(In the second example I have an image connected with 2 different images: images3 with images4 and images5 separately) Hope you can help me, thanks.

0

1 Answer 1

1

One way is to use TikZ.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains}
\begin{document}
\begin{figure}[htb]
\centering
\begin{tikzpicture}[start chain=going right,nodes={on chain,join},
    every join/.style={-latex},node distance=2em]
 \node{\includegraphics[width=4cm]{example-image-a}};
 \node{\includegraphics[width=4cm]{example-image-b}};
\end{tikzpicture}
\caption{Two graphics.}
\end{figure}

\begin{figure}[htb]
\centering
\begin{tikzpicture}[start chain=going right,nodes={on chain,join},
    every join/.style={-latex},node distance=2em]
 \node{\includegraphics[width=3cm]{example-image-a}};
 \node{\includegraphics[width=3cm]{example-image-b}};
 \node{\includegraphics[width=3cm]{example-image-duck}};
\end{tikzpicture}
\caption{Three graphics.}
\end{figure}

\end{document}

enter image description here

Or with a different layout.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{figure}[htb]
\centering
\begin{tikzpicture}[>=latex,node distance=2em]
 \node(a){\includegraphics[width=4cm]{example-image-a}};
 \node[right=of a](b){\includegraphics[width=4cm]{example-image-b}};
 \draw[->] (a) -- (b);
\end{tikzpicture}
\caption{Two graphics.}
\end{figure}

\begin{figure}[htb]
\centering
\begin{tikzpicture}[>=latex,node distance=2em]
 \node(a){\includegraphics[width=3cm]{example-image-a}};
 \matrix[right=of a,row sep=2em] {
 \node(b){\includegraphics[width=3cm]{example-image-b}};\\
 \node(c){\includegraphics[width=3cm]{example-image-duck}};\\
 };
 \draw[->] (a) -- (b);
 \draw[->] (a) -- (c);
\end{tikzpicture}
\caption{Three graphics.}
\end{figure}
\end{document}

enter image description here

12
  • Ok thanks, but in the second figure what I really would like to do is connect the first image to the second and the third, not in chain like you did, so there is "A" connected to "B" and "A" conntected to the duck
    – Simo
    Feb 7, 2020 at 10:31
  • @Simo I am confused. Your question has Image3 --------> Image4 --------> Image5, and this is what the answer does. Please edit the question to show clearly what you want.
    – user194703
    Feb 7, 2020 at 15:24
  • In the parenthesis in the original post I tried to explain it, but I will try again better. I want that in the second example from figure A starts 2 arrows: one that goes to figure B and the other that goes to the last one
    – Simo
    Feb 7, 2020 at 15:41
  • @Simo That's all easy to do if it is clear how B and C are arranged relative to each other, and relative to A. Should B and C be on top of each other, and A left of them? Or B and C side by side, and A above them?
    – user194703
    Feb 7, 2020 at 15:57
  • Yes, B and C on top of each other and A on the left.
    – Simo
    Feb 7, 2020 at 16:04

You must log in to answer this question.

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