How to mimic `tikzpicture` inside `tikzpicture` (or how to fit `tikzpicture` into a node)?How to draw inside a TikZ node, using node style?Rotate a node but not its content: the case of the ellipse decorationHow to have one straight arrows surrounded by two curved arrows (TikZ)How to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionAdjusting edge alignment and positioning of fitted nodeDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of them
Flatten not working
Navigating a quick return to previous employer
Why A=2 and B=1 in the call signs for Spirit and Opportunity?
Why is std::ssize() introduced in C++20?
Gravitational Force Between Numbers
Why did it take so long for Germany to allow electric scooters / e-rollers on the roads?
Is there an idiom that means that you are in a very strong negotiation position in a negotiation?
Ribbon Cable Cross Talk - Is there a fix after the fact?
Toxic, harassing lab environment
One word for 'the thing that attracts me'?
Have any humans orbited the Earth in anything other than a prograde orbit?
How to write numbers and percentage?
Are PMR446 walkie-talkies legal in Switzerland?
Are there any German nonsense poems (Jabberwocky)?
Status of proof by contradiction and excluded middle throughout the history of mathematics?
Visual Block Mode edit with sequential number
Cisco 3750X Power Cable
Are there historical examples of audiences drawn to a work that was "so bad it's good"?
To exponential digit growth and beyond!
Testing using real data of the customer
Split into three!
Is "vegetable base" a common term in English?
Physical only checkdb is failing, but full one is completed successfully
Why is this integration method not valid?
How to mimic `tikzpicture` inside `tikzpicture` (or how to fit `tikzpicture` into a node)?
How to draw inside a TikZ node, using node style?Rotate a node but not its content: the case of the ellipse decorationHow to have one straight arrows surrounded by two curved arrows (TikZ)How to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionAdjusting edge alignment and positioning of fitted nodeDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of them
I typeset my entire document inside a single tikzpicture
, meaning that blocks of text in my document are represented by path node...;
. But without using additional tikzpicture
environment it gets complicated when a drawing has to be inserted into the document. Using additional tikzpicture
, however, would create vertical spacing which is hard to deal with (and would ruin the frame box, aka background rectange
around the tikzpiture
). How do I get around this issue? Can we somehow use a scope and assign styles to it so that it can "mimic" tikzpicture
? I need to be able to position and scale entire drawing easily, instead of dealing with each path of the drawing separately (to adjust it to the text above). It would also create problems with positioning text following the drawing, since the text needs to be aligned to something: you can't align nodes to paths which aren't nodes, and the drawing consists mostly of paths which aren't nodes (it would've been easy to position the text to a container of the drawing instead, but there's no such container).
documentclassstandalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
% following drawing should behave as a picture
% so that it can be easily moved and scaled
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endtikzpicture
enddocument
Following semi-works, but there are additional problems not highlighted in the output: (1) additional vertical spacing (which is fully under control if EVERYTHING is inside a single tikzpicture
) due to second tikzpicture
environment, (2) use of varwidth
environment and (as a result) clipping of the nodes (on the right side).
documentclass[varwidth=50mm]standalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
endtikzpicturepar
begintikzpicture[text width=50mm,align=center]
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endtikzpicture
enddocument
tikz-pgf
add a comment |
I typeset my entire document inside a single tikzpicture
, meaning that blocks of text in my document are represented by path node...;
. But without using additional tikzpicture
environment it gets complicated when a drawing has to be inserted into the document. Using additional tikzpicture
, however, would create vertical spacing which is hard to deal with (and would ruin the frame box, aka background rectange
around the tikzpiture
). How do I get around this issue? Can we somehow use a scope and assign styles to it so that it can "mimic" tikzpicture
? I need to be able to position and scale entire drawing easily, instead of dealing with each path of the drawing separately (to adjust it to the text above). It would also create problems with positioning text following the drawing, since the text needs to be aligned to something: you can't align nodes to paths which aren't nodes, and the drawing consists mostly of paths which aren't nodes (it would've been easy to position the text to a container of the drawing instead, but there's no such container).
documentclassstandalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
% following drawing should behave as a picture
% so that it can be easily moved and scaled
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endtikzpicture
enddocument
Following semi-works, but there are additional problems not highlighted in the output: (1) additional vertical spacing (which is fully under control if EVERYTHING is inside a single tikzpicture
) due to second tikzpicture
environment, (2) use of varwidth
environment and (as a result) clipping of the nodes (on the right side).
documentclass[varwidth=50mm]standalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
endtikzpicturepar
begintikzpicture[text width=50mm,align=center]
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endtikzpicture
enddocument
tikz-pgf
1
beginscope[#scaling and positioning options]…endscope
? That command can be well used for grouping related commands and sub-pictures
– Huang_d
6 hours ago
@Huang_d Sorry, didn't see your comment before I posted my answer.
– Torbjørn T.
6 hours ago
@TorbjørnT. You actually provided an answer, you deserve the credit. Cheers
– Huang_d
6 hours ago
add a comment |
I typeset my entire document inside a single tikzpicture
, meaning that blocks of text in my document are represented by path node...;
. But without using additional tikzpicture
environment it gets complicated when a drawing has to be inserted into the document. Using additional tikzpicture
, however, would create vertical spacing which is hard to deal with (and would ruin the frame box, aka background rectange
around the tikzpiture
). How do I get around this issue? Can we somehow use a scope and assign styles to it so that it can "mimic" tikzpicture
? I need to be able to position and scale entire drawing easily, instead of dealing with each path of the drawing separately (to adjust it to the text above). It would also create problems with positioning text following the drawing, since the text needs to be aligned to something: you can't align nodes to paths which aren't nodes, and the drawing consists mostly of paths which aren't nodes (it would've been easy to position the text to a container of the drawing instead, but there's no such container).
documentclassstandalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
% following drawing should behave as a picture
% so that it can be easily moved and scaled
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endtikzpicture
enddocument
Following semi-works, but there are additional problems not highlighted in the output: (1) additional vertical spacing (which is fully under control if EVERYTHING is inside a single tikzpicture
) due to second tikzpicture
environment, (2) use of varwidth
environment and (as a result) clipping of the nodes (on the right side).
documentclass[varwidth=50mm]standalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
endtikzpicturepar
begintikzpicture[text width=50mm,align=center]
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endtikzpicture
enddocument
tikz-pgf
I typeset my entire document inside a single tikzpicture
, meaning that blocks of text in my document are represented by path node...;
. But without using additional tikzpicture
environment it gets complicated when a drawing has to be inserted into the document. Using additional tikzpicture
, however, would create vertical spacing which is hard to deal with (and would ruin the frame box, aka background rectange
around the tikzpiture
). How do I get around this issue? Can we somehow use a scope and assign styles to it so that it can "mimic" tikzpicture
? I need to be able to position and scale entire drawing easily, instead of dealing with each path of the drawing separately (to adjust it to the text above). It would also create problems with positioning text following the drawing, since the text needs to be aligned to something: you can't align nodes to paths which aren't nodes, and the drawing consists mostly of paths which aren't nodes (it would've been easy to position the text to a container of the drawing instead, but there's no such container).
documentclassstandalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
% following drawing should behave as a picture
% so that it can be easily moved and scaled
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endtikzpicture
enddocument
Following semi-works, but there are additional problems not highlighted in the output: (1) additional vertical spacing (which is fully under control if EVERYTHING is inside a single tikzpicture
) due to second tikzpicture
environment, (2) use of varwidth
environment and (as a result) clipping of the nodes (on the right side).
documentclass[varwidth=50mm]standalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
endtikzpicturepar
begintikzpicture[text width=50mm,align=center]
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endtikzpicture
enddocument
tikz-pgf
tikz-pgf
edited 4 hours ago
bp2017
asked 7 hours ago
bp2017bp2017
979116
979116
1
beginscope[#scaling and positioning options]…endscope
? That command can be well used for grouping related commands and sub-pictures
– Huang_d
6 hours ago
@Huang_d Sorry, didn't see your comment before I posted my answer.
– Torbjørn T.
6 hours ago
@TorbjørnT. You actually provided an answer, you deserve the credit. Cheers
– Huang_d
6 hours ago
add a comment |
1
beginscope[#scaling and positioning options]…endscope
? That command can be well used for grouping related commands and sub-pictures
– Huang_d
6 hours ago
@Huang_d Sorry, didn't see your comment before I posted my answer.
– Torbjørn T.
6 hours ago
@TorbjørnT. You actually provided an answer, you deserve the credit. Cheers
– Huang_d
6 hours ago
1
1
beginscope[#scaling and positioning options]…endscope
? That command can be well used for grouping related commands and sub-pictures– Huang_d
6 hours ago
beginscope[#scaling and positioning options]…endscope
? That command can be well used for grouping related commands and sub-pictures– Huang_d
6 hours ago
@Huang_d Sorry, didn't see your comment before I posted my answer.
– Torbjørn T.
6 hours ago
@Huang_d Sorry, didn't see your comment before I posted my answer.
– Torbjørn T.
6 hours ago
@TorbjørnT. You actually provided an answer, you deserve the credit. Cheers
– Huang_d
6 hours ago
@TorbjørnT. You actually provided an answer, you deserve the credit. Cheers
– Huang_d
6 hours ago
add a comment |
1 Answer
1
active
oldest
votes
Could you use a scope
environment with the local bounding box
option?
documentclassstandalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
% following drawing should behave as a picture
% so that it can be easily moved and scaled
beginscope[
shift=(0,-3),
scale=0.7,
local bounding box=smiley
]
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endscope
draw [red] (smiley.north west) to[bend left] (smiley.north east);
node [right] at (smiley.east) foo;
endtikzpicture
enddocument
Can I somehow attach thesmiley
node to the south anchor ofn1
(orn2
, which I forgot to name and which is a node containing math)? Otherwise I would rely onshift
to manually trial-and-error the position of thesmiley
.
– bp2017
4 hours ago
I tried usingpositioning
library and dobelow=0mm of n2.south
to style thescope
but it didn't work (smiley doesn't move at all).
– bp2017
4 hours ago
I've noticed that settinganchor
oflocal bounding box
node does NOT work.
– bp2017
3 hours ago
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%2f491809%2fhow-to-mimic-tikzpicture-inside-tikzpicture-or-how-to-fit-tikzpicture-int%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
Could you use a scope
environment with the local bounding box
option?
documentclassstandalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
% following drawing should behave as a picture
% so that it can be easily moved and scaled
beginscope[
shift=(0,-3),
scale=0.7,
local bounding box=smiley
]
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endscope
draw [red] (smiley.north west) to[bend left] (smiley.north east);
node [right] at (smiley.east) foo;
endtikzpicture
enddocument
Can I somehow attach thesmiley
node to the south anchor ofn1
(orn2
, which I forgot to name and which is a node containing math)? Otherwise I would rely onshift
to manually trial-and-error the position of thesmiley
.
– bp2017
4 hours ago
I tried usingpositioning
library and dobelow=0mm of n2.south
to style thescope
but it didn't work (smiley doesn't move at all).
– bp2017
4 hours ago
I've noticed that settinganchor
oflocal bounding box
node does NOT work.
– bp2017
3 hours ago
add a comment |
Could you use a scope
environment with the local bounding box
option?
documentclassstandalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
% following drawing should behave as a picture
% so that it can be easily moved and scaled
beginscope[
shift=(0,-3),
scale=0.7,
local bounding box=smiley
]
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endscope
draw [red] (smiley.north west) to[bend left] (smiley.north east);
node [right] at (smiley.east) foo;
endtikzpicture
enddocument
Can I somehow attach thesmiley
node to the south anchor ofn1
(orn2
, which I forgot to name and which is a node containing math)? Otherwise I would rely onshift
to manually trial-and-error the position of thesmiley
.
– bp2017
4 hours ago
I tried usingpositioning
library and dobelow=0mm of n2.south
to style thescope
but it didn't work (smiley doesn't move at all).
– bp2017
4 hours ago
I've noticed that settinganchor
oflocal bounding box
node does NOT work.
– bp2017
3 hours ago
add a comment |
Could you use a scope
environment with the local bounding box
option?
documentclassstandalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
% following drawing should behave as a picture
% so that it can be easily moved and scaled
beginscope[
shift=(0,-3),
scale=0.7,
local bounding box=smiley
]
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endscope
draw [red] (smiley.north west) to[bend left] (smiley.north east);
node [right] at (smiley.east) foo;
endtikzpicture
enddocument
Could you use a scope
environment with the local bounding box
option?
documentclassstandalone
usepackagetikz
usetikzlibrarycalc
begindocument
begintikzpicture
path node[anchor=north west,text width=50mm](n1)This is sentence 1. This is sentence 2. This is sentence 3.;
path node[anchor=north west,text width=50mm]at(n1.south west)[2+2=4];
% following drawing should behave as a picture
% so that it can be easily moved and scaled
beginscope[
shift=(0,-3),
scale=0.7,
local bounding box=smiley
]
path node[anchor=north west](t1)DRAWING TITLE;
path[draw,radius=30pt]($(t1.south)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(-15pt,10pt)+(0,-30pt)$)circle;
path[draw,radius=5pt]($(t1.south)+(15pt,10pt)+(0,-30pt)$)circle;
path[draw,line width=1pt]($(t1.south)+(0,0)+(0,-30pt)$)--($(t1.south)+(0,10pt)+(0,-30pt)$);
path[draw]($(t1.south)+(-10pt,-15pt)+(0,-30pt)$)rectangle($(t1.south)+(10pt,-5pt)+(0,-30pt)$);
path node[font=tiny]at($(t1.south)+(0,-40pt)$)text;
endscope
draw [red] (smiley.north west) to[bend left] (smiley.north east);
node [right] at (smiley.east) foo;
endtikzpicture
enddocument
answered 6 hours ago
Torbjørn T.Torbjørn T.
160k13262451
160k13262451
Can I somehow attach thesmiley
node to the south anchor ofn1
(orn2
, which I forgot to name and which is a node containing math)? Otherwise I would rely onshift
to manually trial-and-error the position of thesmiley
.
– bp2017
4 hours ago
I tried usingpositioning
library and dobelow=0mm of n2.south
to style thescope
but it didn't work (smiley doesn't move at all).
– bp2017
4 hours ago
I've noticed that settinganchor
oflocal bounding box
node does NOT work.
– bp2017
3 hours ago
add a comment |
Can I somehow attach thesmiley
node to the south anchor ofn1
(orn2
, which I forgot to name and which is a node containing math)? Otherwise I would rely onshift
to manually trial-and-error the position of thesmiley
.
– bp2017
4 hours ago
I tried usingpositioning
library and dobelow=0mm of n2.south
to style thescope
but it didn't work (smiley doesn't move at all).
– bp2017
4 hours ago
I've noticed that settinganchor
oflocal bounding box
node does NOT work.
– bp2017
3 hours ago
Can I somehow attach the
smiley
node to the south anchor of n1
(or n2
, which I forgot to name and which is a node containing math)? Otherwise I would rely on shift
to manually trial-and-error the position of the smiley
.– bp2017
4 hours ago
Can I somehow attach the
smiley
node to the south anchor of n1
(or n2
, which I forgot to name and which is a node containing math)? Otherwise I would rely on shift
to manually trial-and-error the position of the smiley
.– bp2017
4 hours ago
I tried using
positioning
library and do below=0mm of n2.south
to style the scope
but it didn't work (smiley doesn't move at all).– bp2017
4 hours ago
I tried using
positioning
library and do below=0mm of n2.south
to style the scope
but it didn't work (smiley doesn't move at all).– bp2017
4 hours ago
I've noticed that setting
anchor
of local bounding box
node does NOT work.– bp2017
3 hours ago
I've noticed that setting
anchor
of local bounding box
node does NOT work.– bp2017
3 hours ago
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%2f491809%2fhow-to-mimic-tikzpicture-inside-tikzpicture-or-how-to-fit-tikzpicture-int%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
beginscope[#scaling and positioning options]…endscope
? That command can be well used for grouping related commands and sub-pictures– Huang_d
6 hours ago
@Huang_d Sorry, didn't see your comment before I posted my answer.
– Torbjørn T.
6 hours ago
@TorbjørnT. You actually provided an answer, you deserve the credit. Cheers
– Huang_d
6 hours ago