1

I'm in the process of learning tikz for creating diagrams, and wish to recreate the following (but with the text in B* rotated):

Diagram I wish to recreate

Thus far I have the following:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{chains}

\tikzset{
    big/.style={
        rectangle,
        rounded corners,
        draw=black, very thick,
        text width=10em,
        minimum height=3em,
        text centered,
        on chain,
        join
    },
    small/.style={
        rectangle,
        rounded corners,
        draw=black, very thick,
        text width=4em,
        minimum height=2em,
        text centered,
        on chain,
        rotate=-90,
        join
    },
    line/.style={draw, thick, <-},
    every join/.style={->, thick, shorten >=1pt},
}

\begin{document}

\begin{tikzpicture}[node distance=1.8cm, start chain=going below]
    \node[big] (A) {A};
    \node[small] (B1) {B1};
    \node[small, on chain=going right] (B2) {B2};
\end{tikzpicture}

\end{document}

Current progress

But as can be seen I'm stuck on the Bs. I figure the chain is redirected right but I have no clue as how to center them under A while also connecting them with unique arrows.

How should I continue?

2

Something like this?

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{chains,calc,shapes.geometric}

\tikzset{
    big/.style={
        rectangle,
        rounded corners,
        draw=black, very thick,
        text width=10em,
        minimum height=3em,
        text centered,
        %on chain,
        %join
    },
    small/.style={
        rectangle,
        rounded corners,
        draw=black, very thick,
        text width=2em,
        minimum height=4em,
        text centered,
        on chain,
        anchor=center
    },
    line/.style={draw, thick, <-},
    every join/.style={->, thick, shorten >=1pt},
}

\begin{document}

\begin{tikzpicture}[node distance=1.8cm,>=stealth]
    \begin{scope}[start chain=going right,local bounding box=B]
    \foreach \X in {1,...,4} {\node[small] (B\X) {B\X};}
    \end{scope}
    \path let \p1=($(B.east)-(B.west)$) in 
    node[big,above=of B,minimum width=\x1](A) {A};
    \begin{scope}[start chain=going below,nodes={on chain,big,join}]
    \node[below=of B,ellipse,minimum height=5em] (C){C};
    \node (D){D};
    \end{scope}
    \foreach \X in {1,...,4} {
    \draw[line] (B\X.north) -- (B\X.north|-A.south); 
    \draw[line] (C.200-44*\X) -- (B\X.south);}
\end{tikzpicture}

\end{document}

enter image description here

  • Indeed, thanks. Some questions: I see a let \p1 but no usage of it, and then usage of a \x1 which is not declared. Are they somehow related? – Tmplt Aug 24 at 12:07
  • 1
    @Tmplt This is the calc syntax. Once we say \p1=<some point>, \x1 becomes its x component. That way one can make sure that the A node has the right size. – Schrödinger's cat Aug 24 at 12:51

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.