Re: un albero con tikz

#94760
Up
0
Down
::


Con forest, hai sempre la possibilità di usare TikZ. Io posizionerei a mano il nodo F che deve essere figlio di C e D: `
\documentclass{article}
\usepackage{forest}
%\usetikzlibrary{arrows}% in questo esempio non serve
%\usetikzlibrary{decorations}% in questo esempio non serve
\usetikzlibrary{calc}

\begin{document}

\begin{forest}
for tree={
child anchor=west,
parent anchor=east,
grow=east,
anchor=west,
edge path={
\noexpand\path[\forestoption{edge}]
(.child anchor) -| +(-5pt,0) — +(-5pt,0) |-
(!u.parent anchor)\forestoption{edge label};
},
pred/.style={draw},
edge=<-=triangle 45 }, [{A},pred , align=center, [{V} [C,pred,name=C] [D,pred,name=D] [E,pred] ] [V [AA,pred] ] ] ]; \node[draw](F) at ($(C.east)!0.5!(D.east)+(1,0)$){F};% posizione \draw[->](C.east)-|($(C)!0.5!(F)$)|-($(F.south west)!0.5!(F.west)$);
\draw[->](D.east)-|($(D)!0.5!(F)$)|-($(F.north west)!0.5!(F.west)$);
\end{forest}
\end{document}
` Non capisco perché non ti piaccia la sintassi [tt]\draw[/tt], ma preferisci [tt]\path[draw,..][/tt] che è identica e più lunga.

Ciao
Claudio

Go to top