2

I'm trying to draw a tree diagram using tikzpicture, the issue is that when the distance between nodes are not wide enough the tree nodes are wrapping. As I use two column style, I need to find a way not to overlap the nodes. What might be the options?

\documentclass[border=10pt]{standalone} 
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[sibling distance=5em,
    every node/.style = {shape=rectangle, rounded corners,
        draw, align=center,
        top color=white, bottom color=white}]]
    \node {\textit{$sentence_i$}}
        child { 
        { node {Sender} 
            child { node {Name} }
            child 
            { node {Location} 
                child { node {Latitude}}
                child { node {Longitude}}
            }
        }}
        child    { node {Event}}  
        child    { node {Datetime}
            {
                child { node {Date}}
                child { node {Time}}
            }
        }      
        child    { node {Location'}
            {
                child { node {Lattitude'}}
                child { node {Longitude'}}
            }
        };
\end{tikzpicture}
\end{document}

enter image description here

prosseek
  • 6,033
  • not directly relevant to the question, but, two things. (1) most of the nodes don't have descenders, which makes the ones with "Longitude" stand out unnecessarily. since just one letter has a descender, it would be reasonable to code these with a "bottom" smash: child { node {\smash[b]{Longitude}}}; to use the [b] option, \usepackage{amsmath} is needed. (2) the modifiers are more likely intended to be primes than apostrophes; these can be entered as $'$. – barbara beeton Dec 06 '15 at 18:18

0 Answers0