[Tex/LaTex] do to improve the spacing in a Tikz tree

tikz-trees

I finally managed to make a genealogy tree with Tikz, but there are some spaces that I can't figure out how to increase between nodes:

\documentclass[a4paper,12pt,DIV=calc,headings=small{scrreprt}%,chapterprefix=true,numbers=noenddot
\usepackage{scrpage2}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Numbers=OldStyle]{Minion Pro}
\setsansfont[Numbers=OldStyle, Ligatures=Rare]{Minion Pro}
\setmonofont[Scale=MatchLowercase]{Consolas}
\usepackage{polyglossia}
\setmainlanguage{brazil}
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{tikz}
\usetikzlibrary{mindmap,shadows,trees}



\begin{document}


\begin{tikzpicture}[draw, every node/.style={fill=Green, rectangle, rounded     corners},sibling distance=4cm,
level 6/.style={sibling distance=6cm}
]
\node {Maomé}
child {node (fatima) {Fátima}}
child {node (ali) {1. Ali} edge from parent [draw=none]
child {node {2. Hasan}}
child {node {3. Husayn} 
child {node {4. Ali Zaynu'l-Abidin}
child {node {Zayd} child {node [fill=green!30]{Zayditas}}}
child {node {5. Muhammad al-Baqir}
child {node {6. Jaafar al-Sadiq}
child {node {7. Ismail} child {node [fill=green!30] {Califado Ismaelita Fatímida do Egito}} child {node [fill=green!30]{Xiitas Ismaelitas}}}
child {node {7. Musa al-Kazim}
child {node {8. Ali al-Rida}
child {node {9. Muhammad al-Taqi}
child {node {10. Ali al-Hadi}
child {node {11. Hasan al-Askari}
child {node {12. Imam Mahdi}
child {node [fill=green!30] {Xiitas Duodecimais}}
}}}}}}}}}}};

\draw (fatima) -- (ali);
\end{tikzpicture}




\end{document}

Which looks like this:

enter image description here

I've tried, but I can't increase space between 7-8.
Is there any way I can get a more even space between those nodes?

Best Answer

You can supply level distance=<larger value> to the child that starts the eighth level. This will influence all levels that follow, so you will need to reset it using level distance=<old value> for the next child.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{mindmap,trees}

\begin{document}
\begin{tikzpicture}[
    draw,
    every node/.style={
        fill=green!70!black,
         rectangle,
        rounded corners
    },
    sibling distance=4cm,
    level distance=12mm,
    level 6/.style={
        sibling distance=6cm
    }
]
\node {Maomé}
child {node (fatima) {Fátima}}
child {node (ali) {1. Ali} edge from parent [draw=none]
child {node {2. Hasan}}
child {node {3. Husayn} 
child {node {4. Ali Zaynu'l-Abidin}
child {node {Zayd} child {node [fill=green!30]{Zayditas}}}
child {node {5. Muhammad al-Baqir}
child {node {6. Jaafar al-Sadiq}
child {node {7. Ismail} child {node [fill=green!30] {Califado Ismaelita Fatímida do Egito}} child {node [fill=green!30]{Xiitas Ismaelitas}}}
child {node {7. Musa al-Kazim}
child [level distance=24mm] {node {8. Ali al-Rida}
child [level distance=12mm] {node {9. Muhammad al-Taqi}
child {node {10. Ali al-Hadi}
child {node {11. Hasan al-Askari}
child {node {12. Imam Mahdi}
child {node [fill=green!30] {Xiitas Duodecimais}}
}}}}}}}}}}};

\draw (fatima) -- (ali);
\end{tikzpicture}


\end{document}
Related Question