3

i want to create a block diagram that has multiple inputs into the next block, but do not seem to be able to get it to work at all. I would like to produce it like: enter image description here

This is what i have right now:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning,shapes.geometric}
\tikzstyle{block} = [rectangle, draw, 
text width=5em, text centered, rounded corners, minimum height=5em]
\tikzstyle{halfblock} = [rectangle, draw, 
text width=5em, text centered, rounded corners, minimum height=2em]
\tikzstyle{line} = [draw, -latex']
\begin{document}
\centering
\begin{tikzpicture}[node distance = 3cm, auto]
    % Place nodes
    \node [halfblock, yshift= 1cm] (1a) {1a};
    \node [halfblock, yshift= -1cm] (1b) {1b};
    \node [block, right of=1a, right of=1b] (2) {2};
    \node [block, right of=2] (3) {3};
    \path [line] (1a) -- (2);
    \path [line] (1b) -- (2);
    \path [line] (2) -- (3);
\end{tikzpicture}
\end{document}

enter image description here Thank you very much in advance.

1 Answer 1

4

Happy New Year!

try the following:

\documentclass[tikz, border=10pt]{standalone}
\usetikzlibrary{arrows.meta,
                positioning}

\begin{document}
    \begin{tikzpicture}[ % <--- used style are moved here 
node distance = 0mm and 5mm,
    block/.style = {draw, rounded corners, minimum height=5em, text width=5em, align=center},
halfblock/.style = {block, minimum height=2em},
     line/.style = {draw, -Latex}
                       ]
% Place nodes
\node (n1) [block]  {2};
\node (n2) [block, right=of n1] {3}; % <--- for positioning is used syntax of the positioning library
% input half boxes
\node (n1a) [halfblock, below left=of n1.north west]  {1a};
\node (n1b) [halfblock, above left=of n1.south west]  {1b};
% arrows
\path [line]    (n1)  edge (n2)
                (n1a) edge (n1.west |- n1a)
                (n1b)  --  (n1.west |- n1b);
    \end{tikzpicture}
\end{document}

enter image description here

2
  • Fantastic. Thanks very much i appreciate it! Happy new year to you too.
    – TikzHelp
    Commented Jan 1, 2019 at 15:47
  • @TikzHelp please accept the answer
    – rfabbri
    Commented Jan 22, 2019 at 16:55

You must log in to answer this question.

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