<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hello,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I started using PGF/TKIZ yesterday for drawing an unbalanced expression tree with weights. I started from examples found in the web and thus learned by doing. Later I found this very great over 1276 pages manual and started to read, and the bits started to fit together and make sense an I was able to start styling. I admit of course that I did not read all 1276 pages since yesterday evening, but searched quite a lot in the manual and via google, not finding any solution for my problem.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have an unbalanced tree of 5 levels which has a problem with overlapping nodes, trying to fix this with level based sibling sizes does not work because it either becomes too wide or the nodes overlap. The solution would be to change sibling distance for certain siblings only. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>In the example below there are 2 nodes overlapping completely in level 3. The solution would be simply to change the sibling distance between node “*” and node “B” on that level, making it smaller, as this branch stops at level 4. But I found no way to achieve this. The same way I would adjust upper levels distances for a more compact tree.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any solution available for this case?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>P.S.: please do not suggest to rearrange the tree for balancing as this is not possible in this case! <o:p></o:p></p><p class=MsoNormal>P.P.S: The red lines are not linked to this problem, they are related to the tree usage.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks,<o:p></o:p></p><p class=MsoNormal>Gaston<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'>\begin{tikzpicture}[level/.style={sibling distance=80mm},<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>                    level 1/.style={sibling distance=80mm},<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>                    level 2/.style={sibling distance=55mm},<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>                    level 3/.style={sibling distance=25mm},<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>                    level 4/.style={sibling distance=17mm},<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>                    level 5/.style={sibling distance=10mm},<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>                    swapme/.style={<->,red,thick},<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>                    every node/.style = {shape=circle,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>                      draw, align=center},<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>                    every label/.style={shape=rectangle,draw=none,fill=none,font=\tiny}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>                    ]]<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>  \node {+}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>    child{ node[label=below:41] (L1_1) {+}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>      child{ node[label=below:29] (L2_1) {+}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>        child{ node[label=below:15] (L3_1) {*}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>          child{ node[label=below:9] (L4_1) {*}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>            child{ node[label=below:4] (L5_1) {8}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>            child{ node[label=below:5] (L5_2) {A}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>          }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>          child{ node[label=below:6] (L4_2) {B}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>        }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>        child { node[label=below:14] (L3_2) {*}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>          child { node[label=below:8] (L4_3) {*}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>            child { node[label=below:6] (L5_3) {B}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>            child { node[label=below:2] (L5_4) {4}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>          }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>          child { node[label=below:6] (L4_4) {*}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>           child { node[label=below:5] (L5_5) {A}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>           child { node[label=below:1] (L5_6) {2}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>          }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>        }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>      }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>      child { node[label=below:12] (L2_2) {*}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>        child { node[label=below:6] (L3_3) {*}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>          child { node[label=below:1] (L4_5) {2}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>          child { node[label=below:5] (L4_6) {A}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>        }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>        child { node[label=below:6] (L3_4) {B}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>      }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>    }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>    child { node[label=below:14] (L1_2) {*}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>      child { node[label=below:8] (L2_3) {*}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>        child { node[label=below:3] (L3_5) {6}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>        child { node[label=below:5] (L3_6) {A}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>      }<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>      child { node[label=below:6] (L2_4) {B}}<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>    };<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>  \draw[swapme] (L5_3) -- (L5_4);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>  \draw[swapme] (L5_5) -- (L5_6);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>  \draw[swapme] (L4_1) -- (L4_2);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>  \draw[swapme] (L4_3) -- (L4_4);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>  \draw[swapme] (L3_1) -- (L3_2);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>  \draw[swapme] (L3_3) -- (L3_4);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>  \draw[swapme] (L2_1) -- (L2_2);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>  \draw[swapme] (L2_3) -- (L2_4);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>  \draw[swapme] (L1_1) -- (L1_2);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>\end{tikzpicture}<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>