Horizontal hierarchy tree in tikz-qtree: bad layout for longer node-namesDrawing a directory listing a la the...

They call me Inspector Morse

Was Luke Skywalker the leader of the Rebel forces on Hoth?

How to draw cubes in a 3 dimensional plane

Virginia employer terminated employee and wants signing bonus returned

Bash script should only kill those instances of another script's that it has launched

Could you please stop shuffling the deck and play already?

Accepted offer letter, position changed

Intuition behind counterexample of Euler's sum of powers conjecture

How to secure an aircraft at a transient parking space?

Doesn't allowing a user mode program to access kernel space memory and execute the IN and OUT instructions defeat the purpose of having CPU modes?

Contract Factories

Why the color red for the Republican Party

How is the wildcard * interpreted as a command?

Do I really need to have a scientific explanation for my premise?

What does "the touch of the purple" mean?

Reversed Sudoku

Why does liquid water form when we exhale on a mirror?

How are showroom/display vehicles prepared?

How can I ensure my trip to the UK will not have to be cancelled because of Brexit?

Word for a person who has no opinion about whether god exists

Vocabulary for giving just numbers, not a full answer

meaning and function of 幸 in "则幸分我一杯羹"

List elements digit difference sort

Does the nature of the Apocalypse in The Umbrella Academy change from the first to the last episode?



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


Drawing a directory listing a la the tree command in TikZTools for tree diagramHow to align parent nodes to the left/top in a treeTrees in latex : Depth of 4 nodesHorizontal chart-style arrows between nodesCreate horizontal hierarchy tree SmartArtTikZ-tree: edge-alignment in horizontal org-chartChanging the indentation of a Tikz treeTikz-Tree: Arrow-style depending on parent nodeAdding text above a node in Tikzpicture tree diagramTikZ align nodes with different heightsMake TikZ nodes connect to TikZ tree edgesForest for linguistics - proportional alignment like in qtreeforest: Draw a roof over multiple children in forest?Coordinate shift in horizontal Tikz tree relative to left edge of nodeSkip generation in a tikz tree













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










2 Answers
2






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



















0














how do you expand the grandchild boxes so they fit text? Thank you.






share|improve this answer








New contributor




Duyen Tran is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

    – Werner
    10 mins ago











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

























2 Answers
2






active

oldest

votes








2 Answers
2






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

162k28432708




162k28432708













  • 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











0














how do you expand the grandchild boxes so they fit text? Thank you.






share|improve this answer








New contributor




Duyen Tran is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

    – Werner
    10 mins ago
















0














how do you expand the grandchild boxes so they fit text? Thank you.






share|improve this answer








New contributor




Duyen Tran is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

    – Werner
    10 mins ago














0












0








0







how do you expand the grandchild boxes so they fit text? Thank you.






share|improve this answer








New contributor




Duyen Tran is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










how do you expand the grandchild boxes so they fit text? Thank you.







share|improve this answer








New contributor




Duyen Tran is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer






New contributor




Duyen Tran is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered 33 mins ago









Duyen TranDuyen Tran

1




1




New contributor




Duyen Tran is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Duyen Tran is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Duyen Tran is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1





    This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

    – Werner
    10 mins ago














  • 1





    This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

    – Werner
    10 mins ago








1




1





This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

– Werner
10 mins ago





This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

– Werner
10 mins ago


















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

Why does my Macbook overheat and use so much CPU and energy when on YouTube?Why do so many insist on using...

How to prevent page numbers from appearing on glossaries?How to remove a dot and a page number in the...

Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...