1

I'm just trying to make any block diagram using LaTeX, but i get into a trouble that I don't know how to make child of a node,

enter image description here

All I want is to move the box named "Antrian" into the red position, and make the two boxes below it as its child node.

\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows, arrows.meta, calc, positioning}
\begin{document}
    \pagestyle{empty}

    % Define block styles
    \tikzstyle{block} = [rectangle, draw, 
    text width=22mm, text centered, rounded corners, minimum height=4em]
    \tikzstyle{line} = [draw, -latex']


    \begin{tikzpicture}[node distance = 2cm, auto]
    % Place nodes
    \node [block] (operasional) {Operasional};
    \node [block, right of=operasional, node distance = 3cm] (proses) {Proses};

    \node[block, right of= proses, node distance = 3cm] (antrian){Antrian};
    \node[block, below of= antrian] (kasir){Jumlah kasir yang beroperasi};
    \node[block, right of=kasir, node distance = 3cm](kedatangan){Rata-rata tingkat kedatangan};
    \coordinate[below = of $(kasir.south)!0.5!(kedatangan.south)$](temp1);
    \node[block, below of = temp1, node distance =3cm] (kinerja) {Kinerja};
    \node[block,left of= kinerja, node distance = 3cm](pelayanan){Pelayanan yang optimal};

    % Draw edges
    \path [line] (operasional) -- (proses);
    \path[line] (proses) -- (antrian);
    \path [line] (antrian.south) -| (kasir);
    \path [line] (antrian.south) -| (kedatangan);
    \path [line] (kinerja) -- (pelayanan);
    \draw   (kasir.south) |- (temp1) -| (kedatangan);
    \draw[-Latex]   (temp1) -- (kinerja);
\end{tikzpicture}
\end{document}

I really need your help, thanks very much

1

Welcome to TeX.SE! You are loading but not using positioning. I also replaced \tikzstyle by the corresponding \tikzset syntax.

\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows, arrows.meta, calc, positioning}
\begin{document}
    \pagestyle{empty}

    % Define block styles
    \tikzset{block/.style={rectangle, draw, 
    text width=22mm, text centered, rounded corners, minimum height=4em},
    line/.style={draw, -latex'}}


    \begin{tikzpicture}[node distance = 1.5cm, auto]
    % Place nodes
    \node [block] (operasional) {Operasional};
    \node [block, right=of operasional] (proses) {Proses};

    \node[block, right=of  proses] (antrian){Antrian};
    \node[block, below left=of  antrian] (kasir){Jumlah kasir yang beroperasi};
    \node[block, below right=of antrian](kedatangan){Rata-rata tingkat kedatangan};
    \coordinate[below = of $(kasir.south)!0.5!(kedatangan.south)$](temp1);
    \node[block, below of = temp1, node distance =3cm] (kinerja) {Kinerja};
    \node[block,left=of  kinerja](pelayanan){Pelayanan yang optimal};

    % Draw edges
    \path [line] (operasional) -- (proses);
    \path[line] (proses) -- (antrian);
    \path [line] (antrian.south) -- ++(0,-0.5) -| (kasir);
    \path [line] (antrian.south) -- ++(0,-0.5) -| (kedatangan);
    \path [line] (kinerja) -- (pelayanan);
    \draw   (kasir.south) |- (temp1) -| (kedatangan);
    \draw[-Latex]   (temp1) -- (kinerja);
\end{tikzpicture}
\end{document}

enter image description here

  • @SutMar Glad to hear! BTW, if the answer worked for you, could you perhaps consider accepting it by clicking on the checkmark left of it? – user121799 Oct 25 '18 at 2:12

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.