Horizontal hierarchy tree in tikz-qtree: bad layout for longer node-namesDrawing a directory listing a la the...
Are babies of evil humanoid species inherently evil?
how to copy/paste a formula in Excel absolutely?
Why would one plane in this picture not have gear down yet?
Makefile strange variable substitution
Is it "Vierergruppe" or "Viergruppe", or is there a distinction?
Shifting between bemols (flats) and diesis (sharps)in the key signature
How can I ensure my trip to the UK will not have to be cancelled because of Brexit?
Accountant/ lawyer will not return my call
If I receive an SOS signal, what is the proper response?
When traveling to Europe from North America, do I need to purchase a different power strip?
Find longest word in a string: are any of these algorithms good?
Database Backup for data and log files
UART pins to unpowered MCU?
When a wind turbine does not produce enough electricity how does the power company compensate for the loss?
Recommendation letter by significant other if you worked with them professionally?
Single word request: Harming the benefactor
Definition of Statistic
Signed and unsigned numbers
PTIJ: Should I kill my computer after installing software?
PTIJ: wiping amalek’s memory?
Reversed Sudoku
NASA's RS-25 Engines shut down time
Are tamper resistant receptacles really safer?
How can The Temple of Elementary Evil reliably protect itself against kinetic bombardment?
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
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
add a comment |
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
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
add a comment |
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
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
tikz-trees tikz-qtree
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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}
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
add a comment |
how do you expand the grandchild boxes so they fit text? Thank you.
New contributor
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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}
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
add a comment |
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}
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
add a comment |
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}
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}
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
add a comment |
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
add a comment |
how do you expand the grandchild boxes so they fit text? Thank you.
New contributor
add a comment |
how do you expand the grandchild boxes so they fit text? Thank you.
New contributor
add a comment |
how do you expand the grandchild boxes so they fit text? Thank you.
New contributor
how do you expand the grandchild boxes so they fit text? Thank you.
New contributor
New contributor
answered 5 mins ago
Duyen TranDuyen Tran
1
1
New contributor
New contributor
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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