2

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.

3

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

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

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.