Drawing node within node (Tikz)
I don't get any error for the compiling, but I don't get what I expected either, which was for my second node to show up with the same set of numbers as my first node. Can someone please let me know what is it that I am doing wrong for this problem? I appreciate any help given.
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5]
node(one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node [above right=2cm and -7.5 cm of root,circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
nodes tikz-trees tikz-node
add a comment |
I don't get any error for the compiling, but I don't get what I expected either, which was for my second node to show up with the same set of numbers as my first node. Can someone please let me know what is it that I am doing wrong for this problem? I appreciate any help given.
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5]
node(one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node [above right=2cm and -7.5 cm of root,circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
nodes tikz-trees tikz-node
1
Shoudn't you shift the nodeone2
instead of the fit?
– marmot
Mar 27 at 20:36
add a comment |
I don't get any error for the compiling, but I don't get what I expected either, which was for my second node to show up with the same set of numbers as my first node. Can someone please let me know what is it that I am doing wrong for this problem? I appreciate any help given.
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5]
node(one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node [above right=2cm and -7.5 cm of root,circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
nodes tikz-trees tikz-node
I don't get any error for the compiling, but I don't get what I expected either, which was for my second node to show up with the same set of numbers as my first node. Can someone please let me know what is it that I am doing wrong for this problem? I appreciate any help given.
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5]
node(one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node [above right=2cm and -7.5 cm of root,circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
nodes tikz-trees tikz-node
nodes tikz-trees tikz-node
asked Mar 27 at 20:33
Stiven GStiven G
764
764
1
Shoudn't you shift the nodeone2
instead of the fit?
– marmot
Mar 27 at 20:36
add a comment |
1
Shoudn't you shift the nodeone2
instead of the fit?
– marmot
Mar 27 at 20:36
1
1
Shoudn't you shift the node
one2
instead of the fit?– marmot
Mar 27 at 20:36
Shoudn't you shift the node
one2
instead of the fit?– marmot
Mar 27 at 20:36
add a comment |
2 Answers
2
active
oldest
votes
A scope
is just a way to apply special conditions or options to certain commands. Therefore, your second scope
is drawn over the first one. But you can shift
it:
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5, shift={(-7.5cm,2cm)}]
node(one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node[circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
add a comment |
If you shift one2
instead of the fit you get
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5]
node[above right=2cm and -7.5 cm of one1](one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node[circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
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%2f481785%2fdrawing-node-within-node-tikz%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
A scope
is just a way to apply special conditions or options to certain commands. Therefore, your second scope
is drawn over the first one. But you can shift
it:
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5, shift={(-7.5cm,2cm)}]
node(one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node[circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
add a comment |
A scope
is just a way to apply special conditions or options to certain commands. Therefore, your second scope
is drawn over the first one. But you can shift
it:
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5, shift={(-7.5cm,2cm)}]
node(one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node[circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
add a comment |
A scope
is just a way to apply special conditions or options to certain commands. Therefore, your second scope
is drawn over the first one. But you can shift
it:
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5, shift={(-7.5cm,2cm)}]
node(one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node[circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
A scope
is just a way to apply special conditions or options to certain commands. Therefore, your second scope
is drawn over the first one. But you can shift
it:
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5, shift={(-7.5cm,2cm)}]
node(one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node[circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
answered Mar 27 at 20:47
IgnasiIgnasi
95.7k4175320
95.7k4175320
add a comment |
add a comment |
If you shift one2
instead of the fit you get
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5]
node[above right=2cm and -7.5 cm of one1](one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node[circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
add a comment |
If you shift one2
instead of the fit you get
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5]
node[above right=2cm and -7.5 cm of one1](one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node[circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
add a comment |
If you shift one2
instead of the fit you get
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5]
node[above right=2cm and -7.5 cm of one1](one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node[circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
If you shift one2
instead of the fit you get
documentclass[a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amssymb}
usepackage{tikz}
usetikzlibrary{calc,shapes,fit,positioning}
letoldemptysetemptyset
letemptysetvarnothing
begin{document}
centering
begin{tikzpicture}[every node/.style={draw=black},scale=0.75,every
node/.append style={transform shape}]
begin{scope}[local bounding box=f1,scale=0.5]
node(one1){1};
node[below left of=one1]{2};
node[below right of=one1]{3};
end{scope}
node[circle,draw,fit=(f1)](root){};
begin{scope}[local bounding box=f2,scale=0.5]
node[above right=2cm and -7.5 cm of one1](one2){1};
node[below left of=one2]{2};
node[below right of=one2]{3};
end{scope}
node[circle,draw,fit=(f2)](11){};
end{tikzpicture}
end{document}
answered Mar 27 at 20:38
marmotmarmot
115k5146277
115k5146277
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%2f481785%2fdrawing-node-within-node-tikz%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
1
Shoudn't you shift the node
one2
instead of the fit?– marmot
Mar 27 at 20:36