I would like to break a line inside a node.
The code below does not give the desired result:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-qtree} %-----questo è il pacchetto interessante
\tikzset{edge from parent/.style=
{draw,
edge from parent path={(\tikzparentnode.south)
-- +(0,-8pt)
-| (\tikzchildnode)}}}
\begin{document}
\begin{tikzpicture}
\Tree [.CP [.NP \node(wh){what}; ]
[.C$'$ [.I did ]
[.\node[draw]{IP};
[.NP [.Det the ] [.N cat ] ]
[.VP [.V sit ]
[.PP [.P on ]
[.\node[draw]{Comunicaz\\all interesting\\denied of\\activate of....};
[.NP [.Det a ] [.N book ] ]
[.PP [.P about ] [.NP \node(t){$t$}; ] ] ] ] ] ] ] ]
\draw[semithick,->] (t)..controls +(south west:5) and +(south:5)..(wh);
\end{tikzpicture}
\end{document}
How can I obtain a normal box without extending its size to accommodate all words)?
align
can be used to activate line breaks, e.g.:\node[draw,align=left]{...}
. However, there is no place for such a large node in your diagram.text width=<some width>
if you want the lines to be broken automatically. (I'm assuming here you want manual breaks as that is what your code shows.)