How to add multi-line text below a node in a tree in forest
I want to make a tree which has bulleted lists centered below the child nodes, like so:
I've searched on TeX SE and found questions which describe putting labels below nodes, but it doesn't quite work out for multiline text or lists. This is my MWE (it generates the pdf in TexStudio even though I get some residual errors):
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{forest}
begin{document}
begin{figure}
begin{center}
begin{forest}
for tree={
myleaf/.style={label=below:{strut#1}},
s sep=5cm
}
[Root Question,rectangle,rounded corners,draw
[Yes,rectangle,rounded corners,draw,align=center,
myleaf={$bullet$ Subsequent question?\
$bullet$ Subsequent longer\
question?}
]
[No,rectangle,rounded corners,draw]
]
node[above=30pt,align=center,anchor=center] {Tree Title};
end{forest}
end{center}
label{fig_tree1}
end{figure}
end{document}
I'm very new to Latex trees and I've been using forest so far, but I'm not opposed to a TikZ solution.
On an unrelated note, I would eventually also like to place two trees side-by-side in a single figure (as shown below, but with the "subsequent question" text slightly bigger). I could use some guidance on that too.
forest trees text-manipulation
add a comment |
I want to make a tree which has bulleted lists centered below the child nodes, like so:
I've searched on TeX SE and found questions which describe putting labels below nodes, but it doesn't quite work out for multiline text or lists. This is my MWE (it generates the pdf in TexStudio even though I get some residual errors):
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{forest}
begin{document}
begin{figure}
begin{center}
begin{forest}
for tree={
myleaf/.style={label=below:{strut#1}},
s sep=5cm
}
[Root Question,rectangle,rounded corners,draw
[Yes,rectangle,rounded corners,draw,align=center,
myleaf={$bullet$ Subsequent question?\
$bullet$ Subsequent longer\
question?}
]
[No,rectangle,rounded corners,draw]
]
node[above=30pt,align=center,anchor=center] {Tree Title};
end{forest}
end{center}
label{fig_tree1}
end{figure}
end{document}
I'm very new to Latex trees and I've been using forest so far, but I'm not opposed to a TikZ solution.
On an unrelated note, I would eventually also like to place two trees side-by-side in a single figure (as shown below, but with the "subsequent question" text slightly bigger). I could use some guidance on that too.
forest trees text-manipulation
add a comment |
I want to make a tree which has bulleted lists centered below the child nodes, like so:
I've searched on TeX SE and found questions which describe putting labels below nodes, but it doesn't quite work out for multiline text or lists. This is my MWE (it generates the pdf in TexStudio even though I get some residual errors):
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{forest}
begin{document}
begin{figure}
begin{center}
begin{forest}
for tree={
myleaf/.style={label=below:{strut#1}},
s sep=5cm
}
[Root Question,rectangle,rounded corners,draw
[Yes,rectangle,rounded corners,draw,align=center,
myleaf={$bullet$ Subsequent question?\
$bullet$ Subsequent longer\
question?}
]
[No,rectangle,rounded corners,draw]
]
node[above=30pt,align=center,anchor=center] {Tree Title};
end{forest}
end{center}
label{fig_tree1}
end{figure}
end{document}
I'm very new to Latex trees and I've been using forest so far, but I'm not opposed to a TikZ solution.
On an unrelated note, I would eventually also like to place two trees side-by-side in a single figure (as shown below, but with the "subsequent question" text slightly bigger). I could use some guidance on that too.
forest trees text-manipulation
I want to make a tree which has bulleted lists centered below the child nodes, like so:
I've searched on TeX SE and found questions which describe putting labels below nodes, but it doesn't quite work out for multiline text or lists. This is my MWE (it generates the pdf in TexStudio even though I get some residual errors):
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{forest}
begin{document}
begin{figure}
begin{center}
begin{forest}
for tree={
myleaf/.style={label=below:{strut#1}},
s sep=5cm
}
[Root Question,rectangle,rounded corners,draw
[Yes,rectangle,rounded corners,draw,align=center,
myleaf={$bullet$ Subsequent question?\
$bullet$ Subsequent longer\
question?}
]
[No,rectangle,rounded corners,draw]
]
node[above=30pt,align=center,anchor=center] {Tree Title};
end{forest}
end{center}
label{fig_tree1}
end{figure}
end{document}
I'm very new to Latex trees and I've been using forest so far, but I'm not opposed to a TikZ solution.
On an unrelated note, I would eventually also like to place two trees side-by-side in a single figure (as shown below, but with the "subsequent question" text slightly bigger). I could use some guidance on that too.
forest trees text-manipulation
forest trees text-manipulation
asked Jan 15 at 20:38
takanuva15takanuva15
1324
1324
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You need to say align=left
or something along these lines in order to allow for multi-line texts in a node. (A label is a node, too.)
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{forest}
begin{document}
begin{figure}
begin{center}
begin{forest}
for tree={
myleaf/.style={label={[align=left]below:{strut#1}}},
s sep=5cm
}
[Root Question,rectangle,rounded corners,draw
[Yes,rectangle,rounded corners,draw,align=center,
myleaf={$bullet$ Subsequent question?\
$bullet$ Subsequent longer\
question?}
]
[No,rectangle,rounded corners,draw]
]
node[above=30pt,align=center,anchor=center] {Tree Title};
end{forest}
end{center}
label{fig_tree1}
end{figure}
end{document}
You could also use itemize
if you specify the text width
. This also addresses your second question, too.
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{subcaption}
usepackage{floatrow}
usepackage{forest}
usetikzlibrary{positioning}
tikzset{leaflet/.style={align=left,text width=3.14cm}}
begin{document}
begin{figure}[htb]
floatsetup{valign=t, heightadjust=all}
ffigbox{%
begin{subfloatrow}
ffigbox{begin{forest}
for tree={
s sep=3.14cm
}
[Root Question,rectangle,rounded corners,draw,alias=root
[Yes,rectangle,rounded corners,draw,alias=LL]
[No,rectangle,rounded corners,draw,alias=LR]
]
node[above=12pt of root,align=center,anchor=center] {LeftTree Title};
node[below=1pt of LL,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
node[below=1pt of LR,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
end{forest}}{caption{Left.label{fig:left}}}
ffigbox{begin{forest}
for tree={
s sep=3.14cm
}
[Root Question,rectangle,rounded corners,draw,alias=root
[Yes,rectangle,rounded corners,draw,alias=RL]
[No,rectangle,rounded corners,draw,alias=RR]
]
node[above=12pt of root,align=center,anchor=center] {Right Tree Title};
node[below=1pt of RL,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
node[below=1pt of RR,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item[{}] Hibernate?
end{itemize}};
end{forest}}{caption{Right.label{fig:right}}}
end{subfloatrow}}
{caption{Trees.}label{fig:Trees}}
end{figure}
end{document}
As you can see, things are now doubled: there is a title and a caption. I kept both as it may be easier to drop one of those than to add one.
Awesome thanks! If I use an itemize for the "Yes" list but only put a single word in the "No" list (without an itemize), how can I adjust the vertical alignment so that the first row of text under each node starts at the same height? (Currently the itemize environment adds some extra vertical spacing that doesn't occur with regular text)
– takanuva15
Jan 16 at 3:35
@takanuva15 I guess there are three ways: (i) go as you originally did, i.e. add the bullets by hadn; (ii) find out what distance is added by itemize and add it to thebelow
key; (iii) add an empty item. I chose (iii) for the above MWE. If you want to try (ii), you might use something like ` node[below=1pt+1.33em of RR,leaflet] {Hibernate?}; ` but it is quite likely that this distance (1.33em
) is not the perfect choice.
– marmot
Jan 16 at 4:12
...perfect! How can I get rid of the (a) and (b) under the trees (since I already have tree titles describing them)? I tried to get rid of the{caption{...}}
but that gave me an error with ffigbox.
– takanuva15
Jan 16 at 15:23
@takanuva15 Are you sure you do not wantfloatsetup{valign=t, heightadjust=all,style=Plaintop}
instead? Then the captions would be on top, you could remove the separate titles, and refer to the subtrees.
– marmot
Jan 16 at 15:31
Sure, that sounds good. (lol I realized that I can just google it and TeX SE will tell me to docaption*{}
for no captions. But yea, it makes more sense to just put the captions on top and make the caption be the "Tree Title".) Can you please update your code for what it would look like?
– takanuva15
Jan 16 at 15:44
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%2f470297%2fhow-to-add-multi-line-text-below-a-node-in-a-tree-in-forest%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
You need to say align=left
or something along these lines in order to allow for multi-line texts in a node. (A label is a node, too.)
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{forest}
begin{document}
begin{figure}
begin{center}
begin{forest}
for tree={
myleaf/.style={label={[align=left]below:{strut#1}}},
s sep=5cm
}
[Root Question,rectangle,rounded corners,draw
[Yes,rectangle,rounded corners,draw,align=center,
myleaf={$bullet$ Subsequent question?\
$bullet$ Subsequent longer\
question?}
]
[No,rectangle,rounded corners,draw]
]
node[above=30pt,align=center,anchor=center] {Tree Title};
end{forest}
end{center}
label{fig_tree1}
end{figure}
end{document}
You could also use itemize
if you specify the text width
. This also addresses your second question, too.
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{subcaption}
usepackage{floatrow}
usepackage{forest}
usetikzlibrary{positioning}
tikzset{leaflet/.style={align=left,text width=3.14cm}}
begin{document}
begin{figure}[htb]
floatsetup{valign=t, heightadjust=all}
ffigbox{%
begin{subfloatrow}
ffigbox{begin{forest}
for tree={
s sep=3.14cm
}
[Root Question,rectangle,rounded corners,draw,alias=root
[Yes,rectangle,rounded corners,draw,alias=LL]
[No,rectangle,rounded corners,draw,alias=LR]
]
node[above=12pt of root,align=center,anchor=center] {LeftTree Title};
node[below=1pt of LL,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
node[below=1pt of LR,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
end{forest}}{caption{Left.label{fig:left}}}
ffigbox{begin{forest}
for tree={
s sep=3.14cm
}
[Root Question,rectangle,rounded corners,draw,alias=root
[Yes,rectangle,rounded corners,draw,alias=RL]
[No,rectangle,rounded corners,draw,alias=RR]
]
node[above=12pt of root,align=center,anchor=center] {Right Tree Title};
node[below=1pt of RL,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
node[below=1pt of RR,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item[{}] Hibernate?
end{itemize}};
end{forest}}{caption{Right.label{fig:right}}}
end{subfloatrow}}
{caption{Trees.}label{fig:Trees}}
end{figure}
end{document}
As you can see, things are now doubled: there is a title and a caption. I kept both as it may be easier to drop one of those than to add one.
Awesome thanks! If I use an itemize for the "Yes" list but only put a single word in the "No" list (without an itemize), how can I adjust the vertical alignment so that the first row of text under each node starts at the same height? (Currently the itemize environment adds some extra vertical spacing that doesn't occur with regular text)
– takanuva15
Jan 16 at 3:35
@takanuva15 I guess there are three ways: (i) go as you originally did, i.e. add the bullets by hadn; (ii) find out what distance is added by itemize and add it to thebelow
key; (iii) add an empty item. I chose (iii) for the above MWE. If you want to try (ii), you might use something like ` node[below=1pt+1.33em of RR,leaflet] {Hibernate?}; ` but it is quite likely that this distance (1.33em
) is not the perfect choice.
– marmot
Jan 16 at 4:12
...perfect! How can I get rid of the (a) and (b) under the trees (since I already have tree titles describing them)? I tried to get rid of the{caption{...}}
but that gave me an error with ffigbox.
– takanuva15
Jan 16 at 15:23
@takanuva15 Are you sure you do not wantfloatsetup{valign=t, heightadjust=all,style=Plaintop}
instead? Then the captions would be on top, you could remove the separate titles, and refer to the subtrees.
– marmot
Jan 16 at 15:31
Sure, that sounds good. (lol I realized that I can just google it and TeX SE will tell me to docaption*{}
for no captions. But yea, it makes more sense to just put the captions on top and make the caption be the "Tree Title".) Can you please update your code for what it would look like?
– takanuva15
Jan 16 at 15:44
add a comment |
You need to say align=left
or something along these lines in order to allow for multi-line texts in a node. (A label is a node, too.)
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{forest}
begin{document}
begin{figure}
begin{center}
begin{forest}
for tree={
myleaf/.style={label={[align=left]below:{strut#1}}},
s sep=5cm
}
[Root Question,rectangle,rounded corners,draw
[Yes,rectangle,rounded corners,draw,align=center,
myleaf={$bullet$ Subsequent question?\
$bullet$ Subsequent longer\
question?}
]
[No,rectangle,rounded corners,draw]
]
node[above=30pt,align=center,anchor=center] {Tree Title};
end{forest}
end{center}
label{fig_tree1}
end{figure}
end{document}
You could also use itemize
if you specify the text width
. This also addresses your second question, too.
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{subcaption}
usepackage{floatrow}
usepackage{forest}
usetikzlibrary{positioning}
tikzset{leaflet/.style={align=left,text width=3.14cm}}
begin{document}
begin{figure}[htb]
floatsetup{valign=t, heightadjust=all}
ffigbox{%
begin{subfloatrow}
ffigbox{begin{forest}
for tree={
s sep=3.14cm
}
[Root Question,rectangle,rounded corners,draw,alias=root
[Yes,rectangle,rounded corners,draw,alias=LL]
[No,rectangle,rounded corners,draw,alias=LR]
]
node[above=12pt of root,align=center,anchor=center] {LeftTree Title};
node[below=1pt of LL,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
node[below=1pt of LR,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
end{forest}}{caption{Left.label{fig:left}}}
ffigbox{begin{forest}
for tree={
s sep=3.14cm
}
[Root Question,rectangle,rounded corners,draw,alias=root
[Yes,rectangle,rounded corners,draw,alias=RL]
[No,rectangle,rounded corners,draw,alias=RR]
]
node[above=12pt of root,align=center,anchor=center] {Right Tree Title};
node[below=1pt of RL,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
node[below=1pt of RR,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item[{}] Hibernate?
end{itemize}};
end{forest}}{caption{Right.label{fig:right}}}
end{subfloatrow}}
{caption{Trees.}label{fig:Trees}}
end{figure}
end{document}
As you can see, things are now doubled: there is a title and a caption. I kept both as it may be easier to drop one of those than to add one.
Awesome thanks! If I use an itemize for the "Yes" list but only put a single word in the "No" list (without an itemize), how can I adjust the vertical alignment so that the first row of text under each node starts at the same height? (Currently the itemize environment adds some extra vertical spacing that doesn't occur with regular text)
– takanuva15
Jan 16 at 3:35
@takanuva15 I guess there are three ways: (i) go as you originally did, i.e. add the bullets by hadn; (ii) find out what distance is added by itemize and add it to thebelow
key; (iii) add an empty item. I chose (iii) for the above MWE. If you want to try (ii), you might use something like ` node[below=1pt+1.33em of RR,leaflet] {Hibernate?}; ` but it is quite likely that this distance (1.33em
) is not the perfect choice.
– marmot
Jan 16 at 4:12
...perfect! How can I get rid of the (a) and (b) under the trees (since I already have tree titles describing them)? I tried to get rid of the{caption{...}}
but that gave me an error with ffigbox.
– takanuva15
Jan 16 at 15:23
@takanuva15 Are you sure you do not wantfloatsetup{valign=t, heightadjust=all,style=Plaintop}
instead? Then the captions would be on top, you could remove the separate titles, and refer to the subtrees.
– marmot
Jan 16 at 15:31
Sure, that sounds good. (lol I realized that I can just google it and TeX SE will tell me to docaption*{}
for no captions. But yea, it makes more sense to just put the captions on top and make the caption be the "Tree Title".) Can you please update your code for what it would look like?
– takanuva15
Jan 16 at 15:44
add a comment |
You need to say align=left
or something along these lines in order to allow for multi-line texts in a node. (A label is a node, too.)
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{forest}
begin{document}
begin{figure}
begin{center}
begin{forest}
for tree={
myleaf/.style={label={[align=left]below:{strut#1}}},
s sep=5cm
}
[Root Question,rectangle,rounded corners,draw
[Yes,rectangle,rounded corners,draw,align=center,
myleaf={$bullet$ Subsequent question?\
$bullet$ Subsequent longer\
question?}
]
[No,rectangle,rounded corners,draw]
]
node[above=30pt,align=center,anchor=center] {Tree Title};
end{forest}
end{center}
label{fig_tree1}
end{figure}
end{document}
You could also use itemize
if you specify the text width
. This also addresses your second question, too.
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{subcaption}
usepackage{floatrow}
usepackage{forest}
usetikzlibrary{positioning}
tikzset{leaflet/.style={align=left,text width=3.14cm}}
begin{document}
begin{figure}[htb]
floatsetup{valign=t, heightadjust=all}
ffigbox{%
begin{subfloatrow}
ffigbox{begin{forest}
for tree={
s sep=3.14cm
}
[Root Question,rectangle,rounded corners,draw,alias=root
[Yes,rectangle,rounded corners,draw,alias=LL]
[No,rectangle,rounded corners,draw,alias=LR]
]
node[above=12pt of root,align=center,anchor=center] {LeftTree Title};
node[below=1pt of LL,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
node[below=1pt of LR,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
end{forest}}{caption{Left.label{fig:left}}}
ffigbox{begin{forest}
for tree={
s sep=3.14cm
}
[Root Question,rectangle,rounded corners,draw,alias=root
[Yes,rectangle,rounded corners,draw,alias=RL]
[No,rectangle,rounded corners,draw,alias=RR]
]
node[above=12pt of root,align=center,anchor=center] {Right Tree Title};
node[below=1pt of RL,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
node[below=1pt of RR,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item[{}] Hibernate?
end{itemize}};
end{forest}}{caption{Right.label{fig:right}}}
end{subfloatrow}}
{caption{Trees.}label{fig:Trees}}
end{figure}
end{document}
As you can see, things are now doubled: there is a title and a caption. I kept both as it may be easier to drop one of those than to add one.
You need to say align=left
or something along these lines in order to allow for multi-line texts in a node. (A label is a node, too.)
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{forest}
begin{document}
begin{figure}
begin{center}
begin{forest}
for tree={
myleaf/.style={label={[align=left]below:{strut#1}}},
s sep=5cm
}
[Root Question,rectangle,rounded corners,draw
[Yes,rectangle,rounded corners,draw,align=center,
myleaf={$bullet$ Subsequent question?\
$bullet$ Subsequent longer\
question?}
]
[No,rectangle,rounded corners,draw]
]
node[above=30pt,align=center,anchor=center] {Tree Title};
end{forest}
end{center}
label{fig_tree1}
end{figure}
end{document}
You could also use itemize
if you specify the text width
. This also addresses your second question, too.
documentclass[11pt, letterpaper,twoside, fleqn]{article}
usepackage[margin=1in]{geometry}
usepackage{subcaption}
usepackage{floatrow}
usepackage{forest}
usetikzlibrary{positioning}
tikzset{leaflet/.style={align=left,text width=3.14cm}}
begin{document}
begin{figure}[htb]
floatsetup{valign=t, heightadjust=all}
ffigbox{%
begin{subfloatrow}
ffigbox{begin{forest}
for tree={
s sep=3.14cm
}
[Root Question,rectangle,rounded corners,draw,alias=root
[Yes,rectangle,rounded corners,draw,alias=LL]
[No,rectangle,rounded corners,draw,alias=LR]
]
node[above=12pt of root,align=center,anchor=center] {LeftTree Title};
node[below=1pt of LL,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
node[below=1pt of LR,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
end{forest}}{caption{Left.label{fig:left}}}
ffigbox{begin{forest}
for tree={
s sep=3.14cm
}
[Root Question,rectangle,rounded corners,draw,alias=root
[Yes,rectangle,rounded corners,draw,alias=RL]
[No,rectangle,rounded corners,draw,alias=RR]
]
node[above=12pt of root,align=center,anchor=center] {Right Tree Title};
node[below=1pt of RL,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item Subsequent question?
item Subsequent longer
question?
end{itemize}};
node[below=1pt of RR,leaflet]
{begin{itemize}setlengthitemsep{0pt}
item[{}] Hibernate?
end{itemize}};
end{forest}}{caption{Right.label{fig:right}}}
end{subfloatrow}}
{caption{Trees.}label{fig:Trees}}
end{figure}
end{document}
As you can see, things are now doubled: there is a title and a caption. I kept both as it may be easier to drop one of those than to add one.
edited Jan 16 at 4:08
answered Jan 15 at 20:42
marmotmarmot
93.8k4109208
93.8k4109208
Awesome thanks! If I use an itemize for the "Yes" list but only put a single word in the "No" list (without an itemize), how can I adjust the vertical alignment so that the first row of text under each node starts at the same height? (Currently the itemize environment adds some extra vertical spacing that doesn't occur with regular text)
– takanuva15
Jan 16 at 3:35
@takanuva15 I guess there are three ways: (i) go as you originally did, i.e. add the bullets by hadn; (ii) find out what distance is added by itemize and add it to thebelow
key; (iii) add an empty item. I chose (iii) for the above MWE. If you want to try (ii), you might use something like ` node[below=1pt+1.33em of RR,leaflet] {Hibernate?}; ` but it is quite likely that this distance (1.33em
) is not the perfect choice.
– marmot
Jan 16 at 4:12
...perfect! How can I get rid of the (a) and (b) under the trees (since I already have tree titles describing them)? I tried to get rid of the{caption{...}}
but that gave me an error with ffigbox.
– takanuva15
Jan 16 at 15:23
@takanuva15 Are you sure you do not wantfloatsetup{valign=t, heightadjust=all,style=Plaintop}
instead? Then the captions would be on top, you could remove the separate titles, and refer to the subtrees.
– marmot
Jan 16 at 15:31
Sure, that sounds good. (lol I realized that I can just google it and TeX SE will tell me to docaption*{}
for no captions. But yea, it makes more sense to just put the captions on top and make the caption be the "Tree Title".) Can you please update your code for what it would look like?
– takanuva15
Jan 16 at 15:44
add a comment |
Awesome thanks! If I use an itemize for the "Yes" list but only put a single word in the "No" list (without an itemize), how can I adjust the vertical alignment so that the first row of text under each node starts at the same height? (Currently the itemize environment adds some extra vertical spacing that doesn't occur with regular text)
– takanuva15
Jan 16 at 3:35
@takanuva15 I guess there are three ways: (i) go as you originally did, i.e. add the bullets by hadn; (ii) find out what distance is added by itemize and add it to thebelow
key; (iii) add an empty item. I chose (iii) for the above MWE. If you want to try (ii), you might use something like ` node[below=1pt+1.33em of RR,leaflet] {Hibernate?}; ` but it is quite likely that this distance (1.33em
) is not the perfect choice.
– marmot
Jan 16 at 4:12
...perfect! How can I get rid of the (a) and (b) under the trees (since I already have tree titles describing them)? I tried to get rid of the{caption{...}}
but that gave me an error with ffigbox.
– takanuva15
Jan 16 at 15:23
@takanuva15 Are you sure you do not wantfloatsetup{valign=t, heightadjust=all,style=Plaintop}
instead? Then the captions would be on top, you could remove the separate titles, and refer to the subtrees.
– marmot
Jan 16 at 15:31
Sure, that sounds good. (lol I realized that I can just google it and TeX SE will tell me to docaption*{}
for no captions. But yea, it makes more sense to just put the captions on top and make the caption be the "Tree Title".) Can you please update your code for what it would look like?
– takanuva15
Jan 16 at 15:44
Awesome thanks! If I use an itemize for the "Yes" list but only put a single word in the "No" list (without an itemize), how can I adjust the vertical alignment so that the first row of text under each node starts at the same height? (Currently the itemize environment adds some extra vertical spacing that doesn't occur with regular text)
– takanuva15
Jan 16 at 3:35
Awesome thanks! If I use an itemize for the "Yes" list but only put a single word in the "No" list (without an itemize), how can I adjust the vertical alignment so that the first row of text under each node starts at the same height? (Currently the itemize environment adds some extra vertical spacing that doesn't occur with regular text)
– takanuva15
Jan 16 at 3:35
@takanuva15 I guess there are three ways: (i) go as you originally did, i.e. add the bullets by hadn; (ii) find out what distance is added by itemize and add it to the
below
key; (iii) add an empty item. I chose (iii) for the above MWE. If you want to try (ii), you might use something like ` node[below=1pt+1.33em of RR,leaflet] {Hibernate?}; ` but it is quite likely that this distance (1.33em
) is not the perfect choice.– marmot
Jan 16 at 4:12
@takanuva15 I guess there are three ways: (i) go as you originally did, i.e. add the bullets by hadn; (ii) find out what distance is added by itemize and add it to the
below
key; (iii) add an empty item. I chose (iii) for the above MWE. If you want to try (ii), you might use something like ` node[below=1pt+1.33em of RR,leaflet] {Hibernate?}; ` but it is quite likely that this distance (1.33em
) is not the perfect choice.– marmot
Jan 16 at 4:12
...perfect! How can I get rid of the (a) and (b) under the trees (since I already have tree titles describing them)? I tried to get rid of the
{caption{...}}
but that gave me an error with ffigbox.– takanuva15
Jan 16 at 15:23
...perfect! How can I get rid of the (a) and (b) under the trees (since I already have tree titles describing them)? I tried to get rid of the
{caption{...}}
but that gave me an error with ffigbox.– takanuva15
Jan 16 at 15:23
@takanuva15 Are you sure you do not want
floatsetup{valign=t, heightadjust=all,style=Plaintop}
instead? Then the captions would be on top, you could remove the separate titles, and refer to the subtrees.– marmot
Jan 16 at 15:31
@takanuva15 Are you sure you do not want
floatsetup{valign=t, heightadjust=all,style=Plaintop}
instead? Then the captions would be on top, you could remove the separate titles, and refer to the subtrees.– marmot
Jan 16 at 15:31
Sure, that sounds good. (lol I realized that I can just google it and TeX SE will tell me to do
caption*{}
for no captions. But yea, it makes more sense to just put the captions on top and make the caption be the "Tree Title".) Can you please update your code for what it would look like?– takanuva15
Jan 16 at 15:44
Sure, that sounds good. (lol I realized that I can just google it and TeX SE will tell me to do
caption*{}
for no captions. But yea, it makes more sense to just put the captions on top and make the caption be the "Tree Title".) Can you please update your code for what it would look like?– takanuva15
Jan 16 at 15:44
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%2f470297%2fhow-to-add-multi-line-text-below-a-node-in-a-tree-in-forest%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