2

Can anybody help me to draw this diagram in latex?

enter image description here

\begin{figure*}
\def\tabularxcolumn#1{m{#1}}
\begin{tabularx}{\linewidth}{@{}cXX@{}}
%
\begin{tabular}{cc}

   & \subfloat[B]{\includegraphics[width=2cm]{Image}}\\
\subfloat[C]{\includegraphics[width=2cm]{logo}} 
   & \subfloat[D]{\includegraphics[width=2cm]{Image}}\\

   & \subfloat[F]{\includegraphics[width=2cm]{Image}}\\
\end{tabular}
&

\subfloat[G]{\includegraphics[width=2cm]{image}}


&
\begin{tabular}{ccc}
\subfloat[H]{\includegraphics[width=2cm]{image}}\\
\subfloat[I]{\includegraphics[width=2cm]{image}}
\end{tabular}

\end{tabularx}

\caption{Many figures}\label{foo}
\end{figure*}
5

result B

Solution usint TikZ and \includegraphics directives inside of nodes. The image is \includegraphicsd is an external file, of course. See p.182 and onwards for more information on TikZ arrows if you want to change the arrow style (I used stealth here -- others are available, if so desired).

You can either compile the standalone pdf:

\begin{figure}
    \includegraphics{path-to-standalone.pdf}
    \caption{my fancy diagram}
    \label{fig:fancy_diagram}
\end{figure}

or remove the preamble (and \begin{document} and \end{document}) of my solution (and add the\usetikzlibrary` directives to your main preamble, of course),

\begin{figure}
    \input{mytikzpicture.tex}
    \caption{a caption for the fancy drawing}
    \label{fig:my_fancy_drawing}
\end{figure)

As for the actual diagram itself:

\documentclass[tikz]{standalone}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{calc}
\begin{document}

\begin{tikzpicture}[
        textnode/.style={
            draw,
            rectangle split,
            rectangle split horizontal,
            rectangle split parts=2,
        }
    ]
    \path (0, 0) node (a) {\includegraphics{image}}
          (2,0)  coordinate (ab)
          (4, 2) node (b) {\includegraphics{image}}
          (4, 0) node (c) {\includegraphics{image}}
          (4,-2) node (d) {\includegraphics{image}}

          (7, 2) node[textnode] (e) {Text \nodepart{two} Text}
          (7, 0) node[textnode] (f) {Text \nodepart{two} Text}
          (7,-2) node[textnode] (g) {Text \nodepart{two} Text}

          (9,0) coordinate (fj)

          (4, 4) node[draw] (h) {Text}
          (7, 4) node[draw] (i) {Data (Text)}
          (10, 0) node[draw] (j) {Text}

          (11  ,4)  node (k) {\includegraphics[width=2cm]{image}}
          (10.5,3.5) node (l) {\includegraphics[width=2cm]{image}}
          (10.0,3.0) node (m) {\includegraphics[width=2cm]{image}}

          (11  ,-3.0) node (n) {\includegraphics[width=2cm]{image}}
          (10.5,-3.5) node (o) {\includegraphics[width=2cm]{image}}
          (10.0,-4.0) node (p) {\includegraphics[width=2cm]{image}}

          (13,3) node[draw] (q) {text}

          (10,-6) node[draw,minimum width=2cm] (r) {text}
    ;

    % Stealth is the arrow style. Other options: >, latex, etc.
    \draw[-stealth] (a)  -- (c);
    \draw[-stealth] (ab) |- (b);
    \draw[-stealth] (ab) |- (d);

    \draw[-stealth,shorten >=3pt] (b) -- (e);
    \draw[-stealth,shorten >=3pt] (c) -- (f);
    \draw[-stealth,shorten >=3pt] (d) -- (g);

    % place arrows midway-ish
    \begin{scope}[decoration={
            markings,
            mark=at position 0.75 with {\arrow{latex}}
        },
        shorten <= 3pt,
    ]
        \draw[postaction=decorate] (e) -| (fj);
        \draw[postaction=decorate] (g) -| (fj);
    \end{scope}

    \draw[-stealth,shorten <= 3pt,shorten >=3pt] (f) -- (j);

    \draw[-stealth,shorten >=3pt] (m) -- (j);
    \draw[-stealth,shorten <=3pt] (j) -- ($(p) + (0,2.0)$);

\end{tikzpicture}

\end{document}

As always with TeX, there are many possibilities for doing things differently and/or better, but it's a start.

  • Thank you so much for the answer. But the problem is if I change the images I need to manually adjust the arrows. Is there any other alternative way to adjust automatically? Instead of adding regular text how do add a caption for overlapped images? – LIsa Jan 16 '18 at 15:16
  • @LIsa Terribly sorry for the delay -- real-life events intervened and I didn't have much time in the past few weeks to spend online. I presume you've solved/circumvented this problem by now, but just in case not, you could try the capt-of package. You can then use a \captionof{figure}{...} command instead of Text. I'm not entirely sure how well this approach would work though, or if it might not make more sense to rethink the overall approach. Again, sorry for the delay. – alpenwasser Feb 16 '18 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.