Horizontal hierarchy tree in tikz-qtree: bad layout for longer node-names












8















I'm trying to set a number of hierarchy trees directly in LaTeX and found tikz-qtree quite helpful for this task.



Since the descriptions for the nodes and children are rather long words, the layout doesn't seem optimal in a vertical tree.



Additionally, I'll merge those trees in a bigger tree and then things start getting crowded.



So, I thought of a horizontal tree. They're nice, too. But I just cannot get them to work properly.



The tikz-qtree-manual is pretty short and the containing example-nodes consist of a small number of letters only.



What I'm trying to achieve is something like the first tree, but "rotated" by 90°. The titles of nodes and children will be long (sometimes several words) and it will be a total of three levels in the end.



Simply growing the first tree to the right does not suffice. :)
Where can I find documentation about the properties of the "edge from parent path"-parameter? I didn't find them in the tikz-manual either.



I looked into the regular tikz-package, too, but ran into similar issues there. tikz-qtree has a prettier syntax, so I stuck with it.. Maybe something like dirtree would be suited better?



Anyway, here's a minimal working example:



documentclass{article}

usepackage{tikz}
usepackage{tikz-qtree}

begin{document}

Nice vertical tree. Bad for lots of subcategories.
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{edge from parent/.style=
{thick, draw,
edge from parent path={(tikzparentnode.south)
-- +(0,-8pt)
-| (tikzchildnode)}}}
Tree
[. parent
[. {nice child0} ]
[. child1 ]
[. child2 ]
[. child3 ]
]
end{tikzpicture}
end{figure}

Vertical tree with different growth direction. Doesn't look quite right. o_O
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{grow'=right, edge from parent/.style=
{thick, draw,
edge from parent path={(tikzparentnode.east)
-- +(0,-8pt)
-| (tikzchildnode)}}}
tikzset{every tree node/.style={anchor=base west}}
Tree
[. parent
[. {nice child0} ]
[. child1 ]
[. child2 ]
[. child3 ]
]
end{tikzpicture}
end{figure}

Nice horizontal tree. Good for lots of subcategories, but `wrong' edges.
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{grow'=right,level distance=32pt}
tikzset{execute at begin node=strut}
tikzset{every tree node/.style={anchor=base west}}
Tree
[.p
[.c0 ]
[.c1 ]
[.c2 ]
[.c3 ]
]
end{tikzpicture}
end{figure}

Almost identical horizontal tree as above, but messed up layout for longer node-names.
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{grow'=right,level distance=32pt}
tikzset{execute at begin node=strut}
tikzset{every tree node/.style={anchor=base west}}
Tree
[.parent
[.c1 ]
[.c2 ]
]
end{tikzpicture}
end{figure}

end{document}


Thank you guys for any pointers and your help!










share|improve this question























  • Okay, I played around with dirtree now. It makes things look pretty, but it really is not suited for several categories next to each other. Additionally, it does not allow the drawing of borders around nodes. Hm, tikz looks so close, but I cannot get it to work. The TikZ-manual is a bit cryptic about the usage of the edges from nodes, too.

    – dhst
    Jan 18 '12 at 19:29








  • 1





    There's a couple of solutions here Drawing a directory listing a la the tree command in TikZ that might be helpful.

    – Alan Munn
    Jan 18 '12 at 21:48











  • I saw this solution, but it's not really what I'm looking for. Besides, dirtree makes exactly those trees, but a whole lot easier (and prettier). I'll make a quick mock-up tomorrow to make things a bit more clear. Thank you for your reply, Alan!

    – dhst
    Jan 19 '12 at 0:33











  • It took a while, but I fired up Visio 2010 yesterday and clicked together a vertical Org-Chart that has a good layout. That said, it was pain to to this in Visio and the .pdf-output messes things up quite a bit. Anyway, here it goes: i.imgur.com/NdK0t.png Visio however is not capable of making those org-chart vertically in a nice fashion, so I used OmniGraffle for this. It looks like this: i.imgur.com/wEcpe.png Any treexperts out there? Thank you!

    – dhst
    Jan 25 '12 at 17:50
















8















I'm trying to set a number of hierarchy trees directly in LaTeX and found tikz-qtree quite helpful for this task.



Since the descriptions for the nodes and children are rather long words, the layout doesn't seem optimal in a vertical tree.



Additionally, I'll merge those trees in a bigger tree and then things start getting crowded.



So, I thought of a horizontal tree. They're nice, too. But I just cannot get them to work properly.



The tikz-qtree-manual is pretty short and the containing example-nodes consist of a small number of letters only.



What I'm trying to achieve is something like the first tree, but "rotated" by 90°. The titles of nodes and children will be long (sometimes several words) and it will be a total of three levels in the end.



Simply growing the first tree to the right does not suffice. :)
Where can I find documentation about the properties of the "edge from parent path"-parameter? I didn't find them in the tikz-manual either.



I looked into the regular tikz-package, too, but ran into similar issues there. tikz-qtree has a prettier syntax, so I stuck with it.. Maybe something like dirtree would be suited better?



Anyway, here's a minimal working example:



documentclass{article}

usepackage{tikz}
usepackage{tikz-qtree}

begin{document}

Nice vertical tree. Bad for lots of subcategories.
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{edge from parent/.style=
{thick, draw,
edge from parent path={(tikzparentnode.south)
-- +(0,-8pt)
-| (tikzchildnode)}}}
Tree
[. parent
[. {nice child0} ]
[. child1 ]
[. child2 ]
[. child3 ]
]
end{tikzpicture}
end{figure}

Vertical tree with different growth direction. Doesn't look quite right. o_O
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{grow'=right, edge from parent/.style=
{thick, draw,
edge from parent path={(tikzparentnode.east)
-- +(0,-8pt)
-| (tikzchildnode)}}}
tikzset{every tree node/.style={anchor=base west}}
Tree
[. parent
[. {nice child0} ]
[. child1 ]
[. child2 ]
[. child3 ]
]
end{tikzpicture}
end{figure}

Nice horizontal tree. Good for lots of subcategories, but `wrong' edges.
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{grow'=right,level distance=32pt}
tikzset{execute at begin node=strut}
tikzset{every tree node/.style={anchor=base west}}
Tree
[.p
[.c0 ]
[.c1 ]
[.c2 ]
[.c3 ]
]
end{tikzpicture}
end{figure}

Almost identical horizontal tree as above, but messed up layout for longer node-names.
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{grow'=right,level distance=32pt}
tikzset{execute at begin node=strut}
tikzset{every tree node/.style={anchor=base west}}
Tree
[.parent
[.c1 ]
[.c2 ]
]
end{tikzpicture}
end{figure}

end{document}


Thank you guys for any pointers and your help!










share|improve this question























  • Okay, I played around with dirtree now. It makes things look pretty, but it really is not suited for several categories next to each other. Additionally, it does not allow the drawing of borders around nodes. Hm, tikz looks so close, but I cannot get it to work. The TikZ-manual is a bit cryptic about the usage of the edges from nodes, too.

    – dhst
    Jan 18 '12 at 19:29








  • 1





    There's a couple of solutions here Drawing a directory listing a la the tree command in TikZ that might be helpful.

    – Alan Munn
    Jan 18 '12 at 21:48











  • I saw this solution, but it's not really what I'm looking for. Besides, dirtree makes exactly those trees, but a whole lot easier (and prettier). I'll make a quick mock-up tomorrow to make things a bit more clear. Thank you for your reply, Alan!

    – dhst
    Jan 19 '12 at 0:33











  • It took a while, but I fired up Visio 2010 yesterday and clicked together a vertical Org-Chart that has a good layout. That said, it was pain to to this in Visio and the .pdf-output messes things up quite a bit. Anyway, here it goes: i.imgur.com/NdK0t.png Visio however is not capable of making those org-chart vertically in a nice fashion, so I used OmniGraffle for this. It looks like this: i.imgur.com/wEcpe.png Any treexperts out there? Thank you!

    – dhst
    Jan 25 '12 at 17:50














8












8








8


1






I'm trying to set a number of hierarchy trees directly in LaTeX and found tikz-qtree quite helpful for this task.



Since the descriptions for the nodes and children are rather long words, the layout doesn't seem optimal in a vertical tree.



Additionally, I'll merge those trees in a bigger tree and then things start getting crowded.



So, I thought of a horizontal tree. They're nice, too. But I just cannot get them to work properly.



The tikz-qtree-manual is pretty short and the containing example-nodes consist of a small number of letters only.



What I'm trying to achieve is something like the first tree, but "rotated" by 90°. The titles of nodes and children will be long (sometimes several words) and it will be a total of three levels in the end.



Simply growing the first tree to the right does not suffice. :)
Where can I find documentation about the properties of the "edge from parent path"-parameter? I didn't find them in the tikz-manual either.



I looked into the regular tikz-package, too, but ran into similar issues there. tikz-qtree has a prettier syntax, so I stuck with it.. Maybe something like dirtree would be suited better?



Anyway, here's a minimal working example:



documentclass{article}

usepackage{tikz}
usepackage{tikz-qtree}

begin{document}

Nice vertical tree. Bad for lots of subcategories.
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{edge from parent/.style=
{thick, draw,
edge from parent path={(tikzparentnode.south)
-- +(0,-8pt)
-| (tikzchildnode)}}}
Tree
[. parent
[. {nice child0} ]
[. child1 ]
[. child2 ]
[. child3 ]
]
end{tikzpicture}
end{figure}

Vertical tree with different growth direction. Doesn't look quite right. o_O
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{grow'=right, edge from parent/.style=
{thick, draw,
edge from parent path={(tikzparentnode.east)
-- +(0,-8pt)
-| (tikzchildnode)}}}
tikzset{every tree node/.style={anchor=base west}}
Tree
[. parent
[. {nice child0} ]
[. child1 ]
[. child2 ]
[. child3 ]
]
end{tikzpicture}
end{figure}

Nice horizontal tree. Good for lots of subcategories, but `wrong' edges.
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{grow'=right,level distance=32pt}
tikzset{execute at begin node=strut}
tikzset{every tree node/.style={anchor=base west}}
Tree
[.p
[.c0 ]
[.c1 ]
[.c2 ]
[.c3 ]
]
end{tikzpicture}
end{figure}

Almost identical horizontal tree as above, but messed up layout for longer node-names.
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{grow'=right,level distance=32pt}
tikzset{execute at begin node=strut}
tikzset{every tree node/.style={anchor=base west}}
Tree
[.parent
[.c1 ]
[.c2 ]
]
end{tikzpicture}
end{figure}

end{document}


Thank you guys for any pointers and your help!










share|improve this question














I'm trying to set a number of hierarchy trees directly in LaTeX and found tikz-qtree quite helpful for this task.



Since the descriptions for the nodes and children are rather long words, the layout doesn't seem optimal in a vertical tree.



Additionally, I'll merge those trees in a bigger tree and then things start getting crowded.



So, I thought of a horizontal tree. They're nice, too. But I just cannot get them to work properly.



The tikz-qtree-manual is pretty short and the containing example-nodes consist of a small number of letters only.



What I'm trying to achieve is something like the first tree, but "rotated" by 90°. The titles of nodes and children will be long (sometimes several words) and it will be a total of three levels in the end.



Simply growing the first tree to the right does not suffice. :)
Where can I find documentation about the properties of the "edge from parent path"-parameter? I didn't find them in the tikz-manual either.



I looked into the regular tikz-package, too, but ran into similar issues there. tikz-qtree has a prettier syntax, so I stuck with it.. Maybe something like dirtree would be suited better?



Anyway, here's a minimal working example:



documentclass{article}

usepackage{tikz}
usepackage{tikz-qtree}

begin{document}

Nice vertical tree. Bad for lots of subcategories.
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{edge from parent/.style=
{thick, draw,
edge from parent path={(tikzparentnode.south)
-- +(0,-8pt)
-| (tikzchildnode)}}}
Tree
[. parent
[. {nice child0} ]
[. child1 ]
[. child2 ]
[. child3 ]
]
end{tikzpicture}
end{figure}

Vertical tree with different growth direction. Doesn't look quite right. o_O
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{grow'=right, edge from parent/.style=
{thick, draw,
edge from parent path={(tikzparentnode.east)
-- +(0,-8pt)
-| (tikzchildnode)}}}
tikzset{every tree node/.style={anchor=base west}}
Tree
[. parent
[. {nice child0} ]
[. child1 ]
[. child2 ]
[. child3 ]
]
end{tikzpicture}
end{figure}

Nice horizontal tree. Good for lots of subcategories, but `wrong' edges.
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{grow'=right,level distance=32pt}
tikzset{execute at begin node=strut}
tikzset{every tree node/.style={anchor=base west}}
Tree
[.p
[.c0 ]
[.c1 ]
[.c2 ]
[.c3 ]
]
end{tikzpicture}
end{figure}

Almost identical horizontal tree as above, but messed up layout for longer node-names.
begin{figure}[h!]
centering
begin{tikzpicture}
tikzset{grow'=right,level distance=32pt}
tikzset{execute at begin node=strut}
tikzset{every tree node/.style={anchor=base west}}
Tree
[.parent
[.c1 ]
[.c2 ]
]
end{tikzpicture}
end{figure}

end{document}


Thank you guys for any pointers and your help!







tikz-trees tikz-qtree






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 18 '12 at 14:04









dhstdhst

758719




758719













  • Okay, I played around with dirtree now. It makes things look pretty, but it really is not suited for several categories next to each other. Additionally, it does not allow the drawing of borders around nodes. Hm, tikz looks so close, but I cannot get it to work. The TikZ-manual is a bit cryptic about the usage of the edges from nodes, too.

    – dhst
    Jan 18 '12 at 19:29








  • 1





    There's a couple of solutions here Drawing a directory listing a la the tree command in TikZ that might be helpful.

    – Alan Munn
    Jan 18 '12 at 21:48











  • I saw this solution, but it's not really what I'm looking for. Besides, dirtree makes exactly those trees, but a whole lot easier (and prettier). I'll make a quick mock-up tomorrow to make things a bit more clear. Thank you for your reply, Alan!

    – dhst
    Jan 19 '12 at 0:33











  • It took a while, but I fired up Visio 2010 yesterday and clicked together a vertical Org-Chart that has a good layout. That said, it was pain to to this in Visio and the .pdf-output messes things up quite a bit. Anyway, here it goes: i.imgur.com/NdK0t.png Visio however is not capable of making those org-chart vertically in a nice fashion, so I used OmniGraffle for this. It looks like this: i.imgur.com/wEcpe.png Any treexperts out there? Thank you!

    – dhst
    Jan 25 '12 at 17:50



















  • Okay, I played around with dirtree now. It makes things look pretty, but it really is not suited for several categories next to each other. Additionally, it does not allow the drawing of borders around nodes. Hm, tikz looks so close, but I cannot get it to work. The TikZ-manual is a bit cryptic about the usage of the edges from nodes, too.

    – dhst
    Jan 18 '12 at 19:29








  • 1





    There's a couple of solutions here Drawing a directory listing a la the tree command in TikZ that might be helpful.

    – Alan Munn
    Jan 18 '12 at 21:48











  • I saw this solution, but it's not really what I'm looking for. Besides, dirtree makes exactly those trees, but a whole lot easier (and prettier). I'll make a quick mock-up tomorrow to make things a bit more clear. Thank you for your reply, Alan!

    – dhst
    Jan 19 '12 at 0:33











  • It took a while, but I fired up Visio 2010 yesterday and clicked together a vertical Org-Chart that has a good layout. That said, it was pain to to this in Visio and the .pdf-output messes things up quite a bit. Anyway, here it goes: i.imgur.com/NdK0t.png Visio however is not capable of making those org-chart vertically in a nice fashion, so I used OmniGraffle for this. It looks like this: i.imgur.com/wEcpe.png Any treexperts out there? Thank you!

    – dhst
    Jan 25 '12 at 17:50

















Okay, I played around with dirtree now. It makes things look pretty, but it really is not suited for several categories next to each other. Additionally, it does not allow the drawing of borders around nodes. Hm, tikz looks so close, but I cannot get it to work. The TikZ-manual is a bit cryptic about the usage of the edges from nodes, too.

– dhst
Jan 18 '12 at 19:29







Okay, I played around with dirtree now. It makes things look pretty, but it really is not suited for several categories next to each other. Additionally, it does not allow the drawing of borders around nodes. Hm, tikz looks so close, but I cannot get it to work. The TikZ-manual is a bit cryptic about the usage of the edges from nodes, too.

– dhst
Jan 18 '12 at 19:29






1




1





There's a couple of solutions here Drawing a directory listing a la the tree command in TikZ that might be helpful.

– Alan Munn
Jan 18 '12 at 21:48





There's a couple of solutions here Drawing a directory listing a la the tree command in TikZ that might be helpful.

– Alan Munn
Jan 18 '12 at 21:48













I saw this solution, but it's not really what I'm looking for. Besides, dirtree makes exactly those trees, but a whole lot easier (and prettier). I'll make a quick mock-up tomorrow to make things a bit more clear. Thank you for your reply, Alan!

– dhst
Jan 19 '12 at 0:33





I saw this solution, but it's not really what I'm looking for. Besides, dirtree makes exactly those trees, but a whole lot easier (and prettier). I'll make a quick mock-up tomorrow to make things a bit more clear. Thank you for your reply, Alan!

– dhst
Jan 19 '12 at 0:33













It took a while, but I fired up Visio 2010 yesterday and clicked together a vertical Org-Chart that has a good layout. That said, it was pain to to this in Visio and the .pdf-output messes things up quite a bit. Anyway, here it goes: i.imgur.com/NdK0t.png Visio however is not capable of making those org-chart vertically in a nice fashion, so I used OmniGraffle for this. It looks like this: i.imgur.com/wEcpe.png Any treexperts out there? Thank you!

– dhst
Jan 25 '12 at 17:50





It took a while, but I fired up Visio 2010 yesterday and clicked together a vertical Org-Chart that has a good layout. That said, it was pain to to this in Visio and the .pdf-output messes things up quite a bit. Anyway, here it goes: i.imgur.com/NdK0t.png Visio however is not capable of making those org-chart vertically in a nice fashion, so I used OmniGraffle for this. It looks like this: i.imgur.com/wEcpe.png Any treexperts out there? Thank you!

– dhst
Jan 25 '12 at 17:50










1 Answer
1






active

oldest

votes


















9














Here's a solution using tikz-qtree plus the TikZ trees library, which offers a pre-made edge from parent fork right path for such trees.



documentclass{article}

usepackage{tikz}
usepackage{tikz-qtree}
usetikzlibrary{trees} % this is to allow the fork right path

begin{document}

begin{tikzpicture}[grow'=right,level distance=1.25in,sibling distance=.25in]
tikzset{edge from parent/.style=
{thick, draw, edge from parent fork right},
every tree node/.style=
{draw,minimum width=1in,text width=1in,align=center}}
Tree
[. parent
[.{nice child0}
[.{grandchild0-0 } ]
[.{grandchild0-1 } ]
[.{grandchild0-2 } ]
[.{grandchild0-3 } ]
]
[.child1
[.{grandchild1-0 } ]
[.{grandchild1-1 } ]
[.{grandchild1-2 } ]
]
[.child2 ]
[.child3 ]
]
end{tikzpicture}
end{document}


output of code






share|improve this answer


























  • It is perfect. Is it possible to show Verizontal tree (mean your tree will be rotated it clockwise 90 degree

    – Jame
    Mar 4 '16 at 1:44











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f41490%2fhorizontal-hierarchy-tree-in-tikz-qtree-bad-layout-for-longer-node-names%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









9














Here's a solution using tikz-qtree plus the TikZ trees library, which offers a pre-made edge from parent fork right path for such trees.



documentclass{article}

usepackage{tikz}
usepackage{tikz-qtree}
usetikzlibrary{trees} % this is to allow the fork right path

begin{document}

begin{tikzpicture}[grow'=right,level distance=1.25in,sibling distance=.25in]
tikzset{edge from parent/.style=
{thick, draw, edge from parent fork right},
every tree node/.style=
{draw,minimum width=1in,text width=1in,align=center}}
Tree
[. parent
[.{nice child0}
[.{grandchild0-0 } ]
[.{grandchild0-1 } ]
[.{grandchild0-2 } ]
[.{grandchild0-3 } ]
]
[.child1
[.{grandchild1-0 } ]
[.{grandchild1-1 } ]
[.{grandchild1-2 } ]
]
[.child2 ]
[.child3 ]
]
end{tikzpicture}
end{document}


output of code






share|improve this answer


























  • It is perfect. Is it possible to show Verizontal tree (mean your tree will be rotated it clockwise 90 degree

    – Jame
    Mar 4 '16 at 1:44
















9














Here's a solution using tikz-qtree plus the TikZ trees library, which offers a pre-made edge from parent fork right path for such trees.



documentclass{article}

usepackage{tikz}
usepackage{tikz-qtree}
usetikzlibrary{trees} % this is to allow the fork right path

begin{document}

begin{tikzpicture}[grow'=right,level distance=1.25in,sibling distance=.25in]
tikzset{edge from parent/.style=
{thick, draw, edge from parent fork right},
every tree node/.style=
{draw,minimum width=1in,text width=1in,align=center}}
Tree
[. parent
[.{nice child0}
[.{grandchild0-0 } ]
[.{grandchild0-1 } ]
[.{grandchild0-2 } ]
[.{grandchild0-3 } ]
]
[.child1
[.{grandchild1-0 } ]
[.{grandchild1-1 } ]
[.{grandchild1-2 } ]
]
[.child2 ]
[.child3 ]
]
end{tikzpicture}
end{document}


output of code






share|improve this answer


























  • It is perfect. Is it possible to show Verizontal tree (mean your tree will be rotated it clockwise 90 degree

    – Jame
    Mar 4 '16 at 1:44














9












9








9







Here's a solution using tikz-qtree plus the TikZ trees library, which offers a pre-made edge from parent fork right path for such trees.



documentclass{article}

usepackage{tikz}
usepackage{tikz-qtree}
usetikzlibrary{trees} % this is to allow the fork right path

begin{document}

begin{tikzpicture}[grow'=right,level distance=1.25in,sibling distance=.25in]
tikzset{edge from parent/.style=
{thick, draw, edge from parent fork right},
every tree node/.style=
{draw,minimum width=1in,text width=1in,align=center}}
Tree
[. parent
[.{nice child0}
[.{grandchild0-0 } ]
[.{grandchild0-1 } ]
[.{grandchild0-2 } ]
[.{grandchild0-3 } ]
]
[.child1
[.{grandchild1-0 } ]
[.{grandchild1-1 } ]
[.{grandchild1-2 } ]
]
[.child2 ]
[.child3 ]
]
end{tikzpicture}
end{document}


output of code






share|improve this answer















Here's a solution using tikz-qtree plus the TikZ trees library, which offers a pre-made edge from parent fork right path for such trees.



documentclass{article}

usepackage{tikz}
usepackage{tikz-qtree}
usetikzlibrary{trees} % this is to allow the fork right path

begin{document}

begin{tikzpicture}[grow'=right,level distance=1.25in,sibling distance=.25in]
tikzset{edge from parent/.style=
{thick, draw, edge from parent fork right},
every tree node/.style=
{draw,minimum width=1in,text width=1in,align=center}}
Tree
[. parent
[.{nice child0}
[.{grandchild0-0 } ]
[.{grandchild0-1 } ]
[.{grandchild0-2 } ]
[.{grandchild0-3 } ]
]
[.child1
[.{grandchild1-0 } ]
[.{grandchild1-1 } ]
[.{grandchild1-2 } ]
]
[.child2 ]
[.child3 ]
]
end{tikzpicture}
end{document}


output of code







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 4 '12 at 1:16

























answered Mar 3 '12 at 23:58









Alan MunnAlan Munn

163k28432711




163k28432711













  • It is perfect. Is it possible to show Verizontal tree (mean your tree will be rotated it clockwise 90 degree

    – Jame
    Mar 4 '16 at 1:44



















  • It is perfect. Is it possible to show Verizontal tree (mean your tree will be rotated it clockwise 90 degree

    – Jame
    Mar 4 '16 at 1:44

















It is perfect. Is it possible to show Verizontal tree (mean your tree will be rotated it clockwise 90 degree

– Jame
Mar 4 '16 at 1:44





It is perfect. Is it possible to show Verizontal tree (mean your tree will be rotated it clockwise 90 degree

– Jame
Mar 4 '16 at 1:44


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f41490%2fhorizontal-hierarchy-tree-in-tikz-qtree-bad-layout-for-longer-node-names%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?