Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a question concerning drawing something similar to a smart art feature. If I have a diagram like so:

enter image description here

The first thing I can do is draw the individual panels:

\documentclass{standalone}
\usepackage[margin = 1in]{geometry}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,calc,shapes,arrows,snakes,shapes.geometric,patterns}
\usepackage{amsmath}
\usepackage{graphicx}

\begin{document}
\begin{tikzpicture}[y = 13mm, x = 10mm,decoration = snake] % used for aspect ratio of diagram
\tikzstyle{every node}=[font=\scriptsize] % ensure all text is relatively small
\coordinate (clipping area) at (10, 5.9);% The figure is drawn a bit bigger, and then clipped:
\clip (0,0) rectangle (clipping area);

% Next reference points are relative to the lower left corner of the clipping area
\coordinate (water level) at (0, 6);
\coordinate (bottom)      at (5, 1);       % (bottom of the pit)
\coordinate (ground1)     at (0, 6);       % (left shore)
\coordinate (ground2)     at (10, 6);      % (right shore)
\coordinate (sedFlux)     at (5, 2.2);     % location where we need the sediment flux arrow

% Coordinates of the bigger area really drawn
\coordinate (lower left)  at ([xshift=-5mm, yshift=-5mm] 0,0);
\coordinate (upper right) at ([xshift=5mm,  yshift=5mm] clipping area);

% Draw the water and ripples
\draw [draw=blue!80!black, decoration={bumps, mirror, segment length=6mm}, decorate,
     bottom color=cyan!60!black, top color=blue!20!white] 
  (lower left) rectangle (water level-|upper right);

% Draw the ground
\draw [draw=white, fill=white] 
(lower left) -- (lower left|-ground1)  --
(ground1) .. controls ($(ground1)!.3!(bottom)$) and (bottom-|ground1) ..
(bottom) .. controls (bottom-|ground2) and ($(ground2)!.3!(bottom)$) .. 
(ground2) -- (ground2-|upper right) -- (lower left-|upper right) -- cycle;
\end{tikzpicture}
\end{document}

enter image description here

Is it then possible to use this diagram and others to draw something like a smart diagram where instead of having text you could gave separate diagrams? I would eventually like to end up with something like:

enter image description here

But obviously each of the panels will not be identical. Assuming that the panels are identical can anyone suggest a way of doing this?

share|improve this question
1  
You can start looking at: create-diagrams-in-latex-with-tikz –  Ignasi Nov 6 '13 at 10:59
    
Great, so I can draw each individual diagram, what is the best way to now draw them in a smart art style? –  KatyB Nov 6 '13 at 11:12
    
A TikZ approach would be to use a \matrix where you can place arbitrary TikZ code in the cells. For a smarter layout, take a look at the smartdiagram package. If you always use the same picture it would be best to store it in a box (look up \sbox and \usebox) and then you can use it in the nodes. (Nesting TikZ pictures can be a nasty business.) –  Qrrbrbirlbel Nov 6 '13 at 12:27
    
@Qrrbrbirlbel what can go wrong with nested tikz pictures? –  Bordaigorl Nov 6 '13 at 17:16

1 Answer 1

up vote 3 down vote accepted

I don't know how to use commands \sbox and \usebox suggested by Qrrbrbirlbel, but as you want to draw not identical diagrams you can easily draw them in different positions with scopes help.

Next code uses JLDiaz answer converted into a command and afterthat draws it whithin several scopes. On each scope you can add some particular modifications.

It's not the best solution but I hope it helps you to find a better one.

\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.pathmorphing,calc}

\newcommand{\mydiagram}{%
% % Define some reference points 
% The figure is drawn a bit bigger, and then clipped to the following dimensions:
\coordinate (clipping area) at (10, 7);
\clip (0,0) rectangle (clipping area);
% Next reference points are relative to the lower left corner of the clipping area
\coordinate (water level) at (0, 6);
\coordinate (bottom)      at (5, 1.3);     % (bottom of the pit)
\coordinate (ground1)     at (0, 5);       % (left shore)
\coordinate (ground2)     at (10, 5);      % (right shore)
% Coordinates of the bigger area really drawn
\coordinate (lower left)  at ([xshift=-5mm, yshift=-5mm] 0,0);
\coordinate (upper right) at ([xshift=5mm,  yshift=5mm] clipping area);
% Draw the water and ripples
\draw [draw=blue!80!black, decoration={bumps, mirror, segment length=6mm}, decorate,
     bottom color=cyan!60!black, top color=blue!20!white] 
  (lower left) rectangle (water level-|upper right);
% Draw the ground
\draw [draw=brown!30!black, fill=brown] 
  (lower left) -- (lower left|-ground1)  --
  (ground1) .. controls ($(ground1)!.3!(bottom)$) and (bottom-|ground1) ..
  (bottom) .. controls (bottom-|ground2) and ($(ground2)!.3!(bottom)$) .. 
  (ground2) -- (ground2-|upper right) -- (lower left-|upper right) -- cycle;
}

\begin{document}
\begin{tikzpicture}
\begin{scope}[shift={(-5,4)}]
\mydiagram
\node at (3,5,3,5) {A};
\end{scope}

\begin{scope}[shift={(6,-3.5)}]
\mydiagram
\node at (3,5,3,5) {B};
\end{scope}

\begin{scope}[shift={(-5,-11)}]
\mydiagram
\node at (3,5,3,5) {C};
\end{scope}

\begin{scope}[shift={(-16,-3.5)}]
\mydiagram
\node at (3,5,3,5) {D};
\end{scope}
\draw[->,red, very thick] (6,7) to[out=-10,in=100]  (11,3);
\draw[->,red, very thick] (11,-4) to[out=-100,in=10]  (6,-8);
\draw[->,red, very thick] (-6,-8) to[out=170,in=-80]  (-11,-4);
\draw[->,red, very thick] (-11,3) to[out=80,in=190]  (-6,7);
\end{tikzpicture}
\end{document}

enter image description here

share|improve this answer
    
Great, that helped a lot, thanks. –  KatyB Nov 7 '13 at 19:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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