# Centre child node next to two parents on the same height as grandparents

So I am making a tree for my thesis with the following code. I could not find a lot of answers on find how to link a child ("niveaus") to two parents ("soft skills" and "hard skills"), so I solved it this way (see code). My problem is that the node "niveaus" has to be on the same height as the nodes "profiel" en "competenties". How should I do that?

P.S. I know my code is horrible, but I am quite new to LaTeX and I have never used Tikz before.

\begin{tikzpicture}[
sibling distance=8em,level distance=10em, every node/.style={shape=rectangle,draw,align=center,rounded corners,}, ->, grow=right, edge from parent/.style={draw,-latex}
]

\node{profiel}
child {node {competenties}
child{node(sk){soft skills}
child{node[above right](n){niveaus}}
}
child{node(hs){hard skills}
child[missing] {
node(n) {niveaus}
}
}
};
\draw (hs) [-latex]-- (n);
\end{tikzpicture}

• Hi and welcome. Please, give a fully compilable code. Jun 28, 2020 at 19:59

Using the forestpackage:

\documentclass[border=3mm]{standalone}
\usepackage{forest}
\usetikzlibrary{arrows.meta}

\begin{document}
\begin{forest}
for tree = {
% nodes
draw,
rounded corners,
text depth=0.25ex,
% tree
grow=0,
anchor=east,
s sep=11mm,
% edges
edge={-Stealth},
}
[profiel
[competenties
[soft skills, name=sf]
[,coordinate,no edge [niveaus, name=n,no edge]]
[hard skills, name=hs]
]
]
\draw[-Stealth] (sf) edge (n)
(hs) edge (n);
\end{forest}
\end{document}


• This one worked perfectly, thanks so much! Only one question: how can I make the arrow from the node "profiel" to the node "competenties" a bit longer? Jun 29, 2020 at 8:16

\begin{tikzpicture}[
sibling distance=8em,
level distance=10em,
every node/.style={
shape=rectangle,
draw,
align=center,
rounded corners,
},
grow=right,
edge from parent/.style={
draw,
-latex
}
]

\node{profiel}child {node {competenties}
child{node(sk){soft skills}
}child{node[xshift =3cm](n) {niveaus}edge from parent[draw=none]}
child{node(hs){hard skills}
}
};
\draw (hs) [-latex]-- (n);
\draw (sk) [-latex]-- (n);
\end{tikzpicture}

• Why you provide only code fragment and not an MWE? Jun 29, 2020 at 3:32
• same language that the OP understands is better Jun 29, 2020 at 3:36
• well, your answer is not only for OP, but should help to all others with similar problem. BTW, MWE provide (far) more information as a code fragment, which can gives different result at different documentclass and preamble. well, it is up tp you haw you convinced what is better for OP. Jun 29, 2020 at 3:49